Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup dead code #255

Open
wants to merge 7 commits into
base: realtek-4.4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions core/efuse/rtw_efuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
return (IS_MASKED(8812A, _MUSB, Offset)) ? TRUE : FALSE;
#endif
#if defined(CONFIG_RTL8821A)
#if 0
if (IS_HARDWARE_TYPE_8811AU(pAdapter))
return (IS_MASKED(8811A, _MUSB, Offset)) ? TRUE : FALSE;
#endif
if (IS_HARDWARE_TYPE_8821(pAdapter))
return (IS_MASKED(8821A, _MUSB, Offset)) ? TRUE : FALSE;
#endif
Expand Down Expand Up @@ -3013,7 +3009,6 @@ u8 mac_hidden_wl_func_to_hal_wl_func(u8 func)
return wl_func;
}

#ifdef PLATFORM_LINUX
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
/* #include <rtw_eeprom.h> */

Expand Down Expand Up @@ -3054,13 +3049,6 @@ int retriveAdaptorInfoFile(char *path, u8 *efuse_data)
else
ret = _FAIL;

#if 0
if (isAdaptorInfoFileValid())
return 0;
else
return _FAIL;
#endif

} else {
RTW_INFO("%s NULL pointer\n", __FUNCTION__);
ret = _FAIL;
Expand Down Expand Up @@ -3276,4 +3264,3 @@ u32 rtw_read_macaddr_from_file(const char *path, u8 *buf)
}
#endif /* CONFIG_EFUSE_CONFIG_FILE */

#endif /* PLATFORM_LINUX */
38 changes: 0 additions & 38 deletions core/mesh/rtw_mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2725,49 +2725,31 @@ static void rtw_mpath_tx_queue_flush(_adapter *adapter)
}
}

#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */
#if defined(CONFIG_SLUB)
#include <linux/slub_def.h>
#elif defined(CONFIG_SLAB)
#include <linux/slab_def.h>
#endif
typedef struct kmem_cache rtw_mcache;
#endif

rtw_mcache *rtw_mcache_create(const char *name, size_t size)
{
#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */
return kmem_cache_create(name, size, 0, 0, NULL);
#else
#error "TBD\n";
#endif
}

void rtw_mcache_destroy(rtw_mcache *s)
{
#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */
kmem_cache_destroy(s);
#else
#error "TBD\n";
#endif
}

void *_rtw_mcache_alloc(rtw_mcache *cachep)
{
#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */
return kmem_cache_alloc(cachep, GFP_ATOMIC);
#else
#error "TBD\n";
#endif
}

void _rtw_mcache_free(rtw_mcache *cachep, void *objp)
{
#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */
kmem_cache_free(cachep, objp);
#else
#error "TBD\n";
#endif
}

#ifdef DBG_MEM_ALLOC
Expand Down Expand Up @@ -3769,14 +3751,6 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe
u8 b2u_num = 0;
#endif

/* fwd info lifetime update */
#if 0
if (!is_mda_self)
mDA(A3) fwinfo.lifetime
mSA(A4) fwinfo.lifetime
Precursor-to-mDA(A2) fwinfo.lifetime
#endif

/* update/create pxoxy info for SA, mSA */
if ((mctrl->flags & MESH_FLAGS_AE)
&& sa != msa && _rtw_memcmp(sa, msa, ETH_ALEN) == _FALSE
Expand Down Expand Up @@ -3853,10 +3827,6 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe

} else {
/* mDA is known in fwd info */
#if 0
if (TA is not in precursors)
goto exit;
#endif
goto fwd_chk;
}

Expand Down Expand Up @@ -3948,14 +3918,6 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe
, FUNC_ADPT_ARG(adapter), MAC_ARG(da));
#endif
/* DA is unknown */
#if 0 /* TODO: flags with AE bit */
rtw_mesh_path_error_tx(adapter
, adapter->mesh_cfg.element_ttl
, mda, adapter->mesh_info.last_sn_update
, WLAN_REASON_MESH_PATH_NOPROXY
, msa
);
#endif
}

/*
Expand Down
2 changes: 1 addition & 1 deletion core/mesh/rtw_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe

void dump_mesh_stats(void *sel, _adapter *adapter);

#if defined(PLATFORM_LINUX) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32))
#define rtw_lockdep_assert_held(l) lockdep_assert_held(l)
#define rtw_lockdep_is_held(l) lockdep_is_held(l)
#else
Expand Down
10 changes: 1 addition & 9 deletions core/mesh/rtw_mesh_hwmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,8 @@ static inline BOOLEAN rtw_ether_addr_equal(const u8 *addr1, const u8 *addr2)
return _rtw_memcmp(addr1, addr2, ETH_ALEN);
}

#ifdef PLATFORM_LINUX
#define rtw_print_ratelimit() printk_ratelimit()
#define rtw_mod_timer(ptimer, expires) mod_timer(&(ptimer)->timer, expires)
#else

#endif

#define RTW_MESH_EWMA_PRECISION 20
#define RTW_MESH_EWMA_WEIGHT_RCP 8
Expand Down Expand Up @@ -1464,11 +1460,7 @@ void rtw_mesh_path_timer(void *ctx)
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
struct rtw_mesh_cfg *mshcfg = &adapter->mesh_cfg;
#endif
/* TBD: Proctect for suspend */
#if 0
if (suspending)
return;
#endif

enter_critical_bh(&path->state_lock);
if (path->flags & RTW_MESH_PATH_RESOLVED ||
(!(path->flags & RTW_MESH_PATH_RESOLVING))) {
Expand Down
16 changes: 0 additions & 16 deletions core/mesh/rtw_mesh_pathtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <drv_types.h>
#include <linux/jhash.h>

#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
static void rtw_mpath_free_rcu(struct rtw_mesh_path *mpath)
{
Expand All @@ -39,7 +38,6 @@ static void rtw_mpath_free_rcu(struct rtw_mesh_path *mpath)
call_rcu(&mpath->rcu, rtw_mpath_free_rcu_callback);
}
#endif
#endif /* PLATFORM_LINUX */

static void rtw_mesh_path_free_rcu(struct rtw_mesh_table *tbl, struct rtw_mesh_path *mpath);

Expand Down Expand Up @@ -201,20 +199,6 @@ static void rtw_mesh_path_move_to_queue(struct rtw_mesh_path *gate_mpath,
gate_mpath->frame_queue_len++;
_exit_critical_bh(&gate_mpath->frame_queue.lock, &flags);

#if 0 /* TODO: copy */
skb = rtw_skb_copy(fskb);
if (rtw_warn_on(!skb))
break;

rtw_prepare_for_gate(skb, gate_mpath->dst, gate_mpath);
skb_queue_tail(&gate_mpath->frame_queue, skb);

if (copy)
continue;

__skb_unlink(fskb, &failq);
rtw_skb_free(fskb);
#endif
}

RTW_MPATH_DBG(FUNC_ADPT_FMT" mpath queue for gate %pM has %d frames\n"
Expand Down
Loading