rtl8188eu: Remove dead code inside #if 0 .... #endif

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-11-12 19:26:10 -06:00
parent e3e242b712
commit f0050d3365
52 changed files with 38 additions and 3703 deletions

View file

@ -528,17 +528,6 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net
#endif /* COMPAT_KERNEL_RELEASE */
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) */
#if 0
{
if (bss->information_elements == bss->proberesp_ies) {
if (bss->len_information_elements != bss->len_proberesp_ies)
RTW_INFO("error!, len_information_elements != bss->len_proberesp_ies\n");
} else if (bss->len_information_elements < bss->len_beacon_ies) {
bss->information_elements = bss->beacon_ies;
bss->len_information_elements = bss->len_beacon_ies;
}
}
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
cfg80211_put_bss(wiphy, bss);
#else
@ -841,11 +830,6 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter, u16 reason, u8 locally
cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC);
#endif
}
#if 0
else
RTW_INFO("pwdev->sme_state=%d\n", pwdev->sme_state);
#endif
RTW_INFO("pwdev->sme_state(a)=%d\n", pwdev->sme_state);
#else
@ -1530,25 +1514,6 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
void *cookie,
void (*callback)(void *cookie, struct key_params *))
{
#if 0
struct iwm_priv *iwm = ndev_to_iwm(ndev);
struct iwm_key *key = &iwm->keys[key_index];
struct key_params params;
IWM_DBG_WEXT(iwm, DBG, "Getting key %d\n", key_index);
memset(&params, 0, sizeof(params));
params.cipher = key->cipher;
params.key_len = key->key_len;
params.seq_len = key->seq_len;
params.seq = key->seq;
params.key = key->key;
callback(cookie, &params);
return key->key_len ? 0 : -ENOENT;
#endif
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
return 0;
}
@ -1732,23 +1697,6 @@ exit:
extern int netdev_open(struct net_device *pnetdev);
#if 0
enum nl80211_iftype {
NL80211_IFTYPE_UNSPECIFIED,
NL80211_IFTYPE_ADHOC, /* 1 */
NL80211_IFTYPE_STATION, /* 2 */
NL80211_IFTYPE_AP, /* 3 */
NL80211_IFTYPE_AP_VLAN,
NL80211_IFTYPE_WDS,
NL80211_IFTYPE_MONITOR, /* 6 */
NL80211_IFTYPE_MESH_POINT,
NL80211_IFTYPE_P2P_CLIENT, /* 8 */
NL80211_IFTYPE_P2P_GO, /* 9 */
/* keep last */
NUM_NL80211_IFTYPES,
NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
};
#endif
static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
struct net_device *ndev,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0))
@ -1870,9 +1818,6 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
case NL80211_IFTYPE_MONITOR:
networkType = Ndis802_11Monitor;
#if 0
ndev->type = ARPHRD_IEEE80211; /* IEEE 802.11 : 801 */
#endif
ndev->type = ARPHRD_IEEE80211_RADIOTAP; /* IEEE 802.11 + radiotap header : 803 */
break;
default:
@ -2060,17 +2005,6 @@ static void _rtw_cfg80211_surveydone_event_callback(_adapter *padapter, struct c
rtw_cfg80211_clear_wps_sr_of_non_target_bss(padapter, pnetwork, &target_ssid);
rtw_cfg80211_inform_bss(padapter, pnetwork);
}
#if 0
/* check ralink testbed RSN IE length */
{
if (_rtw_memcmp(pnetwork->network.Ssid.Ssid, "Ralink_11n_AP", 13)) {
uint ie_len = 0;
u8 *p = NULL;
p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_));
RTW_INFO("ie_len=%d\n", ie_len);
}
}
#endif
plist = get_next(plist);
}
@ -2527,35 +2461,6 @@ exit:
static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
#if 0
struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
if (changed & WIPHY_PARAM_RTS_THRESHOLD &&
(iwm->conf.rts_threshold != wiphy->rts_threshold)) {
int ret;
iwm->conf.rts_threshold = wiphy->rts_threshold;
ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
CFG_RTS_THRESHOLD,
iwm->conf.rts_threshold);
if (ret < 0)
return ret;
}
if (changed & WIPHY_PARAM_FRAG_THRESHOLD &&
(iwm->conf.frag_threshold != wiphy->frag_threshold)) {
int ret;
iwm->conf.frag_threshold = wiphy->frag_threshold;
ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_FA_CFG_FIX,
CFG_FRAG_THRESHOLD,
iwm->conf.frag_threshold);
if (ret < 0)
return ret;
}
#endif
RTW_INFO("%s\n", __func__);
return 0;
}
@ -2575,11 +2480,6 @@ static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32
if (wpa_version & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2))
psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPAPSK;
#if 0
if (wpa_version & NL80211_WPA_VERSION_2)
psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPA2PSK;
#endif
#ifdef CONFIG_WAPI_SUPPORT
if (wpa_version & NL80211_WAPI_VERSION_1)
psecuritypriv->ndisauthtype = Ndis802_11AuthModeWAPI;
@ -3336,32 +3236,6 @@ static int cfg80211_rtw_set_txpower(struct wiphy *wiphy,
enum tx_power_setting type, int dbm)
#endif
{
#if 0
struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
int ret;
switch (type) {
case NL80211_TX_POWER_AUTOMATIC:
return 0;
case NL80211_TX_POWER_FIXED:
if (mbm < 0 || (mbm % 100))
return -EOPNOTSUPP;
if (!test_bit(IWM_STATUS_READY, &iwm->status))
return 0;
ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
CFG_TX_PWR_LIMIT_USR,
MBM_TO_DBM(mbm) * 2);
if (ret < 0)
return ret;
return iwm_tx_power_trigger(iwm);
default:
IWM_ERR(iwm, "Unsupported power type: %d\n", type);
return -EOPNOTSUPP;
}
#endif
RTW_INFO("%s\n", __func__);
return 0;
}
@ -4998,14 +4872,6 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
/* dump_mgntframe(padapter, pmgntframe); */
if (dump_mgntframe_and_wait_ack(padapter, pmgntframe) != _SUCCESS)
RTW_INFO("%s, ack to\n", __func__);
#if 0
if(wps_devicepassword_id == WPS_DPID_REGISTRAR_SPEC) {
RTW_INFO("waiting for p2p peer key-in PIN CODE\n");
rtw_msleep_os(15000); /* 15 sec for key in PIN CODE, workaround for GS2 before issuing Nego Req. */
}
#endif
}
#ifdef CONFIG_RTW_80211R

View file

@ -1113,7 +1113,10 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen)
int i;
RTW_INFO("\n wpa_ie(length:%d):\n", ielen);
for (i = 0; i < ielen; i = i + 8)
RTW_INFO("0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", buf[i], buf[i + 1], buf[i + 2], buf[i + 3], buf[i + 4], buf[i + 5], buf[i + 6], buf[i + 7]);
RTW_INFO("0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n",
buf[i], buf[i + 1], buf[i + 2],
buf[i + 3], buf[i + 4], buf[i + 5],
buf[i + 6], buf[i + 7]);
}
pos = buf;
@ -1122,19 +1125,6 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen)
goto exit;
}
#if 0
pos += RSN_HEADER_LEN;
left = ielen - RSN_HEADER_LEN;
if (left >= RSN_SELECTOR_LEN) {
pos += RSN_SELECTOR_LEN;
left -= RSN_SELECTOR_LEN;
} else if (left > 0) {
ret = -1;
goto exit;
}
#endif
if (rtw_parse_wpa_ie(buf, ielen, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK;
@ -1417,10 +1407,6 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
switch (wrqu->mode) {
case IW_MODE_MONITOR:
networkType = Ndis802_11Monitor;
#if 0
dev->type = ARPHRD_IEEE80211; /* IEEE 802.11 : 801 */
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
dev->type = ARPHRD_IEEE80211_RADIOTAP; /* IEEE 802.11 + radiotap header : 803 */
RTW_INFO("set_mode = IW_MODE_MONITOR\n");
@ -1522,18 +1508,6 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
u8 strZeroMacAddress[ETH_ALEN] = { 0x00 };
u8 strIssueBssid[ETH_ALEN] = { 0x00 };
#if 0
struct iw_pmksa {
__u32 cmd;
struct sockaddr bssid;
__u8 pmkid[IW_PMKID_LEN]; /* IW_PMKID_LEN=16 */
}
There are the BSSID information in the bssid.sa_data array.
If cmd is IW_PMKSA_FLUSH, it means the wpa_suppplicant wants to clear all the PMKID information.
If cmd is IW_PMKSA_ADD, it means the wpa_supplicant wants to add a PMKID / BSSID to driver.
If cmd is IW_PMKSA_REMOVE, it means the wpa_supplicant wants to remove a PMKID / BSSID from driver.
#endif
_rtw_memcpy(strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN);
if (pPMK->cmd == IW_PMKSA_ADD) {
RTW_INFO("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n");
@ -1840,19 +1814,6 @@ static int rtw_wx_set_wap(struct net_device *dev,
while (1) {
if ((rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) == _TRUE) {
#if 0
ret = -EINVAL;
goto cancel_ps_deny;
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) {
rtw_set_802_11_bssid(padapter, temp->sa_data);
goto cancel_ps_deny;
} else {
ret = -EINVAL;
goto cancel_ps_deny;
}
#endif
break;
}
@ -1923,15 +1884,6 @@ static int rtw_wx_set_mlme(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
#if 0
/* SIOCSIWMLME data */
struct iw_mlme {
__u16 cmd; /* IW_MLME_* */
__u16 reason_code;
struct sockaddr addr;
};
#endif
int ret = 0;
u16 reason;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
@ -2134,12 +2086,6 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
pos += 1;
len -= 1;
break;
#if 0
case WEXT_CSCAN_NPROBE_SECTION:
RTW_INFO("WEXT_CSCAN_NPROBE_SECTION\n");
break;
#endif
default:
/* RTW_INFO("Unknown CSCAN section %c\n", section); */
len = 0; /* stop parsing */
@ -2374,17 +2320,6 @@ static int rtw_wx_set_essid(struct net_device *dev,
while (1) {
if (rtw_end_of_queue_search(phead, pmlmepriv->pscanned) == _TRUE) {
#if 0
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) {
rtw_set_802_11_ssid(padapter, &ndis_ssid);
goto cancel_ps_deny;
} else {
ret = -EINVAL;
goto cancel_ps_deny;
}
#endif
break;
}
@ -2663,29 +2598,6 @@ static int rtw_wx_get_retry(struct net_device *dev,
}
#if 0
#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */
#define IW_ENCODE_FLAGS 0xFF00 /* Flags defined below */
#define IW_ENCODE_MODE 0xF000 /* Modes defined below */
#define IW_ENCODE_DISABLED 0x8000 /* Encoding disabled */
#define IW_ENCODE_ENABLED 0x0000 /* Encoding enabled */
#define IW_ENCODE_RESTRICTED 0x4000 /* Refuse non-encoded packets */
#define IW_ENCODE_OPEN 0x2000 /* Accept non-encoded packets */
#define IW_ENCODE_NOKEY 0x0800 /* Key is write only, so not present */
#define IW_ENCODE_TEMP 0x0400 /* Temporary key */
/*
iwconfig wlan0 key on->flags = 0x6001->maybe it means auto
iwconfig wlan0 key off->flags = 0x8800
iwconfig wlan0 key open->flags = 0x2800
iwconfig wlan0 key open 1234567890->flags = 0x2000
iwconfig wlan0 key restricted->flags = 0x4800
iwconfig wlan0 key open [3] 1234567890->flags = 0x2003
iwconfig wlan0 key restricted [2] 1234567890->flags = 0x4002
iwconfig wlan0 key open [3] -> flags = 0x2803
iwconfig wlan0 key restricted [2] -> flags = 0x4802
*/
#endif
static int rtw_wx_set_enc(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *keybuf)
@ -3197,52 +3109,7 @@ static int rtw_wx_get_nick(struct net_device *dev,
/* rtw_signal_process(pid, SIGUSR1); */ /* for test */
/* dump debug info here */
#if 0
u32 dot11AuthAlgrthm; /* 802.11 auth, could be open, shared, and 8021x */
u32 dot11PrivacyAlgrthm; /* This specify the privacy for shared auth. algorithm. */
u32 dot118021XGrpPrivacy; /* This specify the privacy algthm. used for Grp key */
u32 ndisauthtype;
u32 ndisencryptstatus;
#endif
/* RTW_INFO("auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n", */
/* psecuritypriv->dot11AuthAlgrthm, psecuritypriv->dot11PrivacyAlgrthm, */
/* psecuritypriv->ndisauthtype, psecuritypriv->ndisencryptstatus); */
/* RTW_INFO("enc_alg=0x%x\n", psecuritypriv->dot11PrivacyAlgrthm); */
/* RTW_INFO("auth_type=0x%x\n", psecuritypriv->ndisauthtype); */
/* RTW_INFO("enc_type=0x%x\n", psecuritypriv->ndisencryptstatus); */
#if 0
RTW_INFO("dbg(0x210)=0x%x\n", rtw_read32(padapter, 0x210));
RTW_INFO("dbg(0x608)=0x%x\n", rtw_read32(padapter, 0x608));
RTW_INFO("dbg(0x280)=0x%x\n", rtw_read32(padapter, 0x280));
RTW_INFO("dbg(0x284)=0x%x\n", rtw_read32(padapter, 0x284));
RTW_INFO("dbg(0x288)=0x%x\n", rtw_read32(padapter, 0x288));
RTW_INFO("dbg(0x664)=0x%x\n", rtw_read32(padapter, 0x664));
RTW_INFO("\n");
RTW_INFO("dbg(0x430)=0x%x\n", rtw_read32(padapter, 0x430));
RTW_INFO("dbg(0x438)=0x%x\n", rtw_read32(padapter, 0x438));
RTW_INFO("dbg(0x440)=0x%x\n", rtw_read32(padapter, 0x440));
RTW_INFO("dbg(0x458)=0x%x\n", rtw_read32(padapter, 0x458));
RTW_INFO("dbg(0x484)=0x%x\n", rtw_read32(padapter, 0x484));
RTW_INFO("dbg(0x488)=0x%x\n", rtw_read32(padapter, 0x488));
RTW_INFO("dbg(0x444)=0x%x\n", rtw_read32(padapter, 0x444));
RTW_INFO("dbg(0x448)=0x%x\n", rtw_read32(padapter, 0x448));
RTW_INFO("dbg(0x44c)=0x%x\n", rtw_read32(padapter, 0x44c));
RTW_INFO("dbg(0x450)=0x%x\n", rtw_read32(padapter, 0x450));
#endif
return 0;
}
static int rtw_wx_read32(struct net_device *dev,
@ -3464,15 +3331,6 @@ typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info,
static int rtw_drvext_hdl(struct net_device *dev, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
#if 0
struct iw_point {
void __user *pointer; /* Pointer to the data (in user space) */
__u16 length; /* number of fields or size in bytes */
__u16 flags; /* Optional params */
};
#endif
#ifdef CONFIG_DRVEXT_MODULE
u8 res;
struct drvext_handler *phandler;
@ -6840,73 +6698,22 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value)
* can use this to determine if the CAP_PRIVACY_ON bit should
* be set.
*/
#if 0
struct ieee80211_security sec = {
.flags = SEC_ENABLED,
.enabled = value,
};
ieee->drop_unencrypted = value;
/* We only change SEC_LEVEL for open mode. Others
* are set by ipw_wpa_set_encryption.
*/
if (!value) {
sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_0;
} else {
sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_1;
}
if (ieee->set_security)
ieee->set_security(ieee->dev, &sec);
#endif
break;
}
case IEEE_PARAM_PRIVACY_INVOKED:
/* ieee->privacy_invoked=value; */
break;
case IEEE_PARAM_AUTH_ALGS:
ret = wpa_set_auth_algs(dev, value);
break;
case IEEE_PARAM_IEEE_802_1X:
/* ieee->ieee802_1x=value; */
break;
case IEEE_PARAM_WPAX_SELECT:
/* added for WPA2 mixed mode */
/*RTW_WARN("------------------------>wpax value = %x\n", value);*/
/*
spin_lock_irqsave(&ieee->wpax_suitlist_lock,flags);
ieee->wpax_type_set = 1;
ieee->wpax_type_notify = value;
spin_unlock_irqrestore(&ieee->wpax_suitlist_lock,flags);
*/
break;
default:
ret = -EOPNOTSUPP;
break;
}
return ret;
}
static int wpa_mlme(struct net_device *dev, u32 command, u32 reason)
@ -7370,18 +7177,6 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param)
param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff)
return -EINVAL;
#if 0
psta = rtw_get_stainfo(pstapriv, param->sta_addr);
if (psta) {
RTW_INFO("rtw_add_sta(), free has been added psta=%p\n", psta);
/* _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */
rtw_free_stainfo(padapter, psta);
/* _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */
psta = NULL;
}
#endif
/* psta = rtw_alloc_stainfo(pstapriv, param->sta_addr); */
psta = rtw_get_stainfo(pstapriv, param->sta_addr);
if (psta) {
int flags = param->u.add_sta.flags;
@ -7494,23 +7289,6 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par
psta = rtw_get_stainfo(pstapriv, param_ex->sta_addr);
if (psta) {
#if 0
struct {
u16 aid;
u16 capability;
int flags;
u32 sta_set;
u8 tx_supp_rates[16];
u32 tx_supp_rates_len;
struct rtw_ieee80211_ht_cap ht_cap;
u64 rx_pkts;
u64 rx_bytes;
u64 rx_drops;
u64 tx_pkts;
u64 tx_bytes;
u64 tx_drops;
} get_sta;
#endif
psta_data->aid = (u16)psta->aid;
psta_data->capability = psta->capability;
psta_data->flags = psta->flags;
@ -8602,20 +8380,6 @@ static int rtw_mp_efuse_get(struct net_device *dev,
goto exit;
}
#if 0
RTW_INFO("OFFSET\tVALUE(hex)\n");
for (i = 0; i < mapLen; i += 16) {
RTW_INFO("0x%02x\t", i);
for (j = 0; j < 8; j++)
RTW_INFO("%02X ", efuse[i + j]);
RTW_INFO("\t");
for (; j < 16; j++)
RTW_INFO("%02X ", efuse[i + j]);
RTW_INFO("\n");
}
RTW_INFO("\n");
#endif
shift = blksz * order;
efuse += shift;
cnt = mapLen - shift;
@ -11325,12 +11089,6 @@ static s32 createpseudoadhoc(PADAPTER padapter)
init_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
_exit_critical_bh(&pmlmepriv->lock, &irqL);
#if 0
err = rtw_create_ibss_cmd(padapter, 0);
if (err == _FAIL)
return _FAIL;
#else
{
struct wlan_network *pcur_network;
struct sta_info *psta;
@ -11357,7 +11115,6 @@ static s32 createpseudoadhoc(PADAPTER padapter)
Set_MSR(padapter, WIFI_FW_ADHOC_STATE);
}
#endif
return _SUCCESS;
}
@ -11981,11 +11738,6 @@ static const struct iw_priv_args rtw_private_args[] = {
SIOCIWFIRSTPRIV + 0xD,
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | IFNAMSIZ, "rfr"
},
#if 0
{
SIOCIWFIRSTPRIV + 0xE, 0, 0, "wowlan_ctrl"
},
#endif
{
SIOCIWFIRSTPRIV + 0x10,
IW_PRIV_TYPE_CHAR | 1024, 0, "p2p_set"

View file

@ -639,11 +639,6 @@ static const struct net_device_ops rtl871x_mgnt_netdev_ops = {
.ndo_open = mgnt_netdev_open,
.ndo_stop = mgnt_netdev_close,
.ndo_start_xmit = mgnt_xmit_entry,
#if 0
.ndo_set_mac_address = r871x_net_set_mac_address,
.ndo_get_stats = r871x_net_get_stats,
.ndo_do_ioctl = r871x_mp_ioctl,
#endif
};
#endif

View file

@ -2060,10 +2060,6 @@ void rtw_cancel_all_timer(_adapter *padapter)
_cancel_timer_ex(&padapter->mlmepriv.assoc_timer);
#if 0
_cancel_timer_ex(&padapter->securitypriv.tkip_timer);
#endif
_cancel_timer_ex(&padapter->mlmepriv.scan_to_timer);
#ifdef CONFIG_DFS_MASTER
@ -2240,10 +2236,6 @@ int _netdev_vir_if_open(struct net_device *pnetdev)
if (padapter->bup == _FALSE && primary_padapter->bup == _TRUE &&
rtw_is_hw_init_completed(primary_padapter)) {
padapter->bFWReady = primary_padapter->bFWReady;
#if 0 /*#ifdef CONFIG_MI_WITH_MBSSID_CAM*/
rtw_hal_set_hwreg(padapter, HW_VAR_MAC_ADDR, adapter_mac_addr(padapter)); /* set mac addr to mac register */
#endif
}
if (padapter->bup == _FALSE) {
@ -2743,10 +2735,6 @@ int _netdev_open(struct net_device *pnetdev)
if (status == _FAIL) {
goto netdev_open_error;
}
#if 0/*#ifdef CONFIG_MI_WITH_MBSSID_CAM*/
rtw_hal_set_hwreg(padapter, HW_VAR_MAC_ADDR, adapter_mac_addr(padapter)); /* set mac addr to mac register */
#endif
RTW_INFO("MAC Address = "MAC_FMT"\n", MAC_ARG(pnetdev->dev_addr));
status = rtw_start_drv_threads(padapter);
@ -2892,9 +2880,6 @@ static int ips_netdrv_open(_adapter *padapter)
if (status == _FAIL) {
goto netdev_open_error;
}
#if 0
rtw_restore_mac_addr(padapter);
#endif
rtw_intf_start(padapter);
#ifndef CONFIG_IPS_CHECK_IN_WD

View file

@ -726,18 +726,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
/* TBD: BTCOEXSCAN-STOP */
break;
case ANDROID_WIFI_CMD_BTCOEXMODE:
#if 0
uint mode = *(command + strlen(CMD_BTCOEXMODE) + 1) - '0';
if (mode == 1)
net_os_set_packet_filter(net, 0); /* DHCP starts */
else
net_os_set_packet_filter(net, 1); /* DHCP ends */
#ifdef WL_CFG80211
bytes_written = wl_cfg80211_set_btcoex_dhcp(net, command);
#endif
#endif
break;
case ANDROID_WIFI_CMD_SETSUSPENDOPT:
/* bytes_written = wl_android_set_suspendopt(net, command, priv_cmd.total_len); */
break;

View file

@ -1125,33 +1125,6 @@ static int wl_cfgvendor_priv_string_handler(struct wiphy *wiphy,
, FUNC_NDEV_ARG(wdev_to_ndev(wdev)), err);
return err;
#if 0
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
int err = 0;
int data_len = 0;
bzero(cfg->ioctl_buf, WLC_IOCTL_MAXLEN);
if (strncmp((char *)data, BRCM_VENDOR_SCMD_CAPA, strlen(BRCM_VENDOR_SCMD_CAPA)) == 0) {
err = wldev_iovar_getbuf(bcmcfg_to_prmry_ndev(cfg), "cap", NULL, 0,
cfg->ioctl_buf, WLC_IOCTL_MAXLEN, &cfg->ioctl_buf_sync);
if (unlikely(err)) {
WL_ERR(("error (%d)\n", err));
return err;
}
data_len = strlen(cfg->ioctl_buf);
cfg->ioctl_buf[data_len] = '\0';
}
err = rtw_cfgvendor_send_cmd_reply(wiphy, bcmcfg_to_prmry_ndev(cfg),
cfg->ioctl_buf, data_len + 1);
if (unlikely(err))
WL_ERR(("Vendor Command reply failed ret:%d\n", err));
else
WL_INFORM(("Vendor Command reply sent successfully!\n"));
return err;
#endif
}
static const struct wiphy_vendor_command rtw_vendor_cmds[] = {

View file

@ -2221,47 +2221,6 @@ static ssize_t proc_set_rsvd_page_info(struct file *file, const char __user *buf
return count;
}
#if 0 /*#ifdef CONFIG_SUPPORT_FIFO_DUMP*/
static int proc_dump_fifo(struct seq_file *m, void *v)
{
struct net_device *dev = m->private;
_adapter *adapter = (_adapter *)rtw_netdev_priv(dev);
/*dump fifo*/
return 0;
}
static ssize_t proc_set_fifo_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
{
struct net_device *dev = data;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
char tmp[32];
u8 acs_satae = 0;
if (count < 3)
return -EFAULT;
if (count > sizeof(tmp)) {
rtw_warn_on(1);
return -EFAULT;
}
if (buffer && !copy_from_user(tmp, buffer, count)) {
/* get fifo_sel, start addr, size
int num = sscanf(tmp, "%hhu", &acs_satae);
if (num < 1)
return -EINVAL;
if (1 == acs_satae)
rtw_acs_start(padapter, _TRUE);
else
rtw_acs_start(padapter, _FALSE);
*/
}
return count;
}
#endif
#ifdef CONFIG_WOW_PATTERN_HW_CAM
int proc_dump_pattern_cam(struct seq_file *m, void *v)
{
@ -2534,9 +2493,6 @@ static const struct rtw_proc_hdl adapter_proc_hdls[] = {
RTW_PROC_HDL_SSEQ("napi_info", proc_get_napi_info, NULL),
RTW_PROC_HDL_SSEQ("rsvd_page", proc_dump_rsvd_page, proc_set_rsvd_page_info),
#if 0 /*def CONFIG_SUPPORT_FIFO_DUMP*/
/*RTW_PROC_HDL_SSEQ("fifo_dump", proc_dump_fifo, proc_set_fifo_info),*/
#endif
RTW_PROC_HDL_SSEQ("fw_info", proc_get_fw_info, NULL),
#ifdef RTW_HALMAC
RTW_PROC_HDL_SSEQ("halmac_info", proc_get_halmac_info, NULL),

View file

@ -1200,15 +1200,7 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
RTW_INFO("wlan link up\n");
rtd2885_wlan_netlink_sendMsg("linkup", "8712");
#endif
status = _SUCCESS;
#if 0 /* not used now */
os_ndevs_deinit:
if (status != _SUCCESS)
rtw_os_ndevs_deinit(dvobj);
#endif
free_if_vir:
if (status != _SUCCESS) {
#ifdef CONFIG_CONCURRENT_MODE

View file

@ -599,12 +599,6 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
purb->transfer_flags |= URB_ZERO_PACKET;
#endif
#endif
#if 0
if (bwritezero)
purb->transfer_flags |= URB_ZERO_PACKET;
#endif
status = usb_submit_urb(purb, GFP_ATOMIC);
if (!status) {
#ifdef DBG_CONFIG_ERROR_DETECT

View file

@ -130,124 +130,11 @@ static const struct ieee80211_regdomain rtw_regdom_14 = {
}
};
#if 0
static struct rtw_regulatory *rtw_regd;
#endif
static bool _rtw_is_radar_freq(u16 center_freq)
{
return center_freq >= 5260 && center_freq <= 5700;
}
#if 0 /* not_yet */
static void _rtw_reg_apply_beaconing_flags(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator)
{
enum nl80211_band band;
struct ieee80211_supported_band *sband;
const struct ieee80211_reg_rule *reg_rule;
struct ieee80211_channel *ch;
unsigned int i;
u32 bandwidth = 0;
int r;
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (!wiphy->bands[band])
continue;
sband = wiphy->bands[band];
for (i = 0; i < sband->n_channels; i++) {
ch = &sband->channels[i];
if (_rtw_is_radar_freq(ch->center_freq) ||
(ch->flags & IEEE80211_CHAN_RADAR))
continue;
if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) {
r = freq_reg_info(wiphy, ch->center_freq,
bandwidth, &reg_rule);
if (r)
continue;
/*
*If 11d had a rule for this channel ensure
*we enable adhoc/beaconing if it allows us to
*use it. Note that we would have disabled it
*by applying our static world regdomain by
*default during init, prior to calling our
*regulatory_hint().
*/
if (!(reg_rule->flags & NL80211_RRF_NO_IBSS))
ch->flags &= ~IEEE80211_CHAN_NO_IBSS;
if (!
(reg_rule->flags &
NL80211_RRF_PASSIVE_SCAN))
ch->flags &=
~IEEE80211_CHAN_PASSIVE_SCAN;
} else {
if (ch->beacon_found)
ch->flags &= ~(IEEE80211_CHAN_NO_IBSS |
IEEE80211_CHAN_PASSIVE_SCAN);
}
}
}
}
/* Allows active scan scan on Ch 12 and 13 */
static void _rtw_reg_apply_active_scan_flags(struct wiphy *wiphy,
enum nl80211_reg_initiator
initiator)
{
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
const struct ieee80211_reg_rule *reg_rule;
u32 bandwidth = 0;
int r;
if (!wiphy->bands[NL80211_BAND_2GHZ])
return;
sband = wiphy->bands[NL80211_BAND_2GHZ];
/*
* If no country IE has been received always enable active scan
* on these channels. This is only done for specific regulatory SKUs
*/
if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
ch = &sband->channels[11]; /* CH 12 */
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
ch = &sband->channels[12]; /* CH 13 */
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
return;
}
/*
* If a country IE has been received check its rule for this
* channel first before enabling active scan. The passive scan
* would have been enforced by the initial processing of our
* custom regulatory domain.
*/
ch = &sband->channels[11]; /* CH 12 */
r = freq_reg_info(wiphy, ch->center_freq, bandwidth, &reg_rule);
if (!r) {
if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
}
ch = &sband->channels[12]; /* CH 13 */
r = freq_reg_info(wiphy, ch->center_freq, bandwidth, &reg_rule);
if (!r) {
if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
}
}
#endif
/*
* Always apply Radar/DFS rules on
* freq range 5260 MHz - 5700 MHz
@ -281,30 +168,11 @@ static void _rtw_reg_apply_radar_flags(struct wiphy *wiphy)
#endif
}
#endif /* CONFIG_DFS */
#if 0
/*
* We always enable radar detection/DFS on this
* frequency range. Additionally we also apply on
* this frequency range:
* - If STA mode does not yet have DFS supports disable
* active scanning
* - If adhoc mode does not support DFS yet then disable
* adhoc in the frequency.
* - If AP mode does not yet support radar detection/DFS
* do not allow AP mode
*/
if (!(ch->flags & IEEE80211_CHAN_DISABLED))
ch->flags |= IEEE80211_CHAN_RADAR |
IEEE80211_CHAN_NO_IBSS |
IEEE80211_CHAN_PASSIVE_SCAN;
#endif
}
}
static void _rtw_reg_apply_flags(struct wiphy *wiphy)
{
#if 1 /* by channel plan */
_adapter *padapter = wiphy_to_adapter(wiphy);
u8 channel_plan = padapter->mlmepriv.ChannelPlan;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@ -352,46 +220,6 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
ch->flags = 0;
}
}
#else
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
unsigned int i, j;
u16 channels[37] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56,
60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140,
149, 153,
157, 161, 165
};
u16 channel;
u32 freq;
for (i = 0; i < NUM_NL80211_BANDS; i++) {
sband = wiphy->bands[i];
if (sband)
for (j = 0; j < sband->n_channels; j++) {
ch = &sband->channels[j];
if (ch)
ch->flags = IEEE80211_CHAN_DISABLED;
}
}
for (i = 0; i < 37; i++) {
channel = channels[i];
freq = rtw_ch2freq(channel);
ch = ieee80211_get_channel(wiphy, freq);
if (ch) {
if (channel <= 11)
ch->flags = 0;
else
ch->flags = 0; /* IEEE80211_CHAN_PASSIVE_SCAN; */
}
/* printk("%s: freq %d(%d) flag 0x%02X\n", __func__, freq, channel, ch->flags); */
}
#endif
}
static void _rtw_reg_apply_world_flags(struct wiphy *wiphy,
@ -446,15 +274,7 @@ static const struct ieee80211_regdomain *_rtw_regdomain_select(struct
rtw_regulatory
*reg)
{
#if 0
switch (reg->country_code) {
case COUNTRY_CODE_USER:
default:
return &rtw_regdom_rd;
}
#else
return &rtw_regdom_rd;
#endif
}
static void _rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
@ -527,21 +347,6 @@ int rtw_regd_init(_adapter *padapter)
{
struct wiphy *wiphy = padapter->rtw_wdev->wiphy;
#if 0
if (rtw_regd == NULL) {
rtw_regd = (struct rtw_regulatory *)
rtw_malloc(sizeof(struct rtw_regulatory));
rtw_regd->alpha2[0] = '9';
rtw_regd->alpha2[1] = '9';
rtw_regd->country_code = COUNTRY_CODE_USER;
}
RTW_INFO("%s: Country alpha2 being used: %c%c\n",
__func__, rtw_regd->alpha2[0], rtw_regd->alpha2[1]);
#endif
_rtw_regd_init_wiphy(NULL, wiphy);
return 0;