rtl8188eu: Remove conditional #if 1

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-11-12 19:30:27 -06:00
parent f0050d3365
commit c25b5250a8
27 changed files with 2 additions and 373 deletions

View file

@ -589,14 +589,11 @@ u8 rtw_btcoex_parse_BT_info_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen)
_rtw_memset(btinfo, 0, BT_INFO_LENGTH);
#if 1
if (BT_INFO_LENGTH != btInfoLen) {
status = HCI_STATUS_INVALID_HCI_CMD_PARA_VALUE;
RTW_INFO("Error BT Info Length: %d\n", btInfoLen);
/* return _FAIL; */
} else
#endif
{
} else {
if (0x1 == btInfoReason || 0x2 == btInfoReason) {
_rtw_memcpy(btinfo, &pcmd[4], btInfoLen);
btinfo[0] = btInfoReason;

View file

@ -3137,10 +3137,8 @@ int proc_get_best_channel(struct seq_file *m, void *v)
best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
}
}
#if 1 /* debug */
RTW_PRINT_SEL(m, "The rx cnt of channel %3d = %d\n",
pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count);
#endif
}
RTW_PRINT_SEL(m, "best_channel_5G = %d\n", best_channel_5G);
@ -4415,7 +4413,6 @@ ssize_t proc_set_mcc_policy_table(struct file *file, const char __user *buffer,
}
if (buffer && !copy_from_user(tmp, buffer, count)) {
#if 1
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
_adapter *iface = NULL;
u8 i = 0;
@ -4441,7 +4438,6 @@ ssize_t proc_set_mcc_policy_table(struct file *file, const char __user *buffer,
}
rtw_hal_mcc_update_switch_channel_policy_table(padapter);
#endif
}
return count;

View file

@ -502,7 +502,6 @@ u8 rtw_set_802_11_disassociate(_adapter *padapter)
return _TRUE;
}
#if 1
u8 rtw_set_802_11_bssid_list_scan(_adapter *padapter, NDIS_802_11_SSID *pssid, int ssid_max_num, struct rtw_ieee80211_channel *ch, int ch_num)
{
_irqL irqL;
@ -516,45 +515,6 @@ u8 rtw_set_802_11_bssid_list_scan(_adapter *padapter, NDIS_802_11_SSID *pssid, i
return res;
}
#else
u8 rtw_set_802_11_bssid_list_scan(_adapter *padapter, NDIS_802_11_SSID *pssid, int ssid_max_num, struct rtw_ieee80211_channel *ch, int ch_num)
{
_irqL irqL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 res = _TRUE;
if (padapter == NULL) {
res = _FALSE;
goto exit;
}
if (!rtw_is_hw_init_completed(padapter)) {
res = _FALSE;
goto exit;
}
if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == _TRUE) ||
(pmlmepriv->LinkDetectInfo.bBusyTraffic == _TRUE)) {
/* Scan or linking is in progress, do nothing. */
res = _TRUE;
} else {
if (rtw_is_scan_deny(padapter)) {
RTW_INFO(FUNC_ADPT_FMT": scan deny\n", FUNC_ADPT_ARG(padapter));
indicate_wx_scan_complete_event(padapter);
return _SUCCESS;
}
_enter_critical_bh(&pmlmepriv->lock, &irqL);
res = rtw_sitesurvey_cmd(padapter, pssid, ssid_max_num, NULL, 0, ch, ch_num);
_exit_critical_bh(&pmlmepriv->lock, &irqL);
}
exit:
return res;
}
#endif
u8 rtw_set_802_11_authentication_mode(_adapter *padapter, NDIS_802_11_AUTHENTICATION_MODE authmode)
{
struct security_priv *psecuritypriv = &padapter->securitypriv;

View file

@ -28,7 +28,6 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter)
struct pkt_attrib *pattrib;
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
#if 1
xmit_frame = rtw_alloc_xmitframe(pxmitpriv);
if (xmit_frame == NULL) {
RTW_INFO("%s rtw_alloc_xmitframe return null\n", __func__);
@ -54,23 +53,10 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter)
pattrib->subtype = WIFI_BEACON;
pattrib->pktlen = pattrib->last_txcmdsz = 0;
#else
xmit_frame = alloc_mgtxmitframe(pxmitpriv);
if (xmit_frame == NULL)
RTW_INFO("%s alloc_mgtxmitframe return null\n", __func__);
else {
pattrib = &xmit_frame->attrib;
update_mgntframe_attrib(adapter, pattrib);
pattrib->qsel = QSLT_BEACON;
pattrib->pktlen = pattrib->last_txcmdsz = 0;
}
#endif
exit:
return xmit_frame;
}
int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len)
{
struct pkt_attrib *pattrib = &xmit_frame->attrib;

View file

@ -3000,7 +3000,6 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme
else
goto exit;
}
#if 1
if (rtw_get_passing_time_ms((u32)competitor->last_scanned) >= mlme->roam_scanr_exp_ms)
goto exit;
@ -3009,10 +3008,6 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme
if (*candidate != NULL && (*candidate)->network.Rssi >= competitor->network.Rssi)
goto exit;
#else
goto exit;
#endif
update:
*candidate = competitor;
updated = _TRUE;

View file

@ -13628,7 +13628,6 @@ exit:
set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
}
#if 1
/**
* sitesurvey_ps_annc - check and doing ps announcement for all the adapters of given @dvobj
* @padapter
@ -13645,43 +13644,6 @@ static u8 sitesurvey_ps_annc(_adapter *padapter, bool ps)
ps_anc = 1;
return ps_anc;
}
#else
/**
* sitesurvey_ps_annc - check and doing ps announcement for all the adapters of given @dvobj
* @dvobj: the dvobj to check
* @ps: power saving or not
*
* Returns: 0: no ps announcement is doing. 1: ps announcement is doing
*/
u8 sitesurvey_ps_annc(struct dvobj_priv *dvobj, bool ps)
{
_adapter *adapter;
int i;
u8 ps_anc = 0;
for (i = 0; i < dvobj->iface_nums; i++) {
adapter = dvobj->padapters[i];
if (!adapter)
continue;
if (ps) {
if (is_client_associated_to_ap(adapter) == _TRUE) {
/* TODO: TDLS peers */
issue_nulldata(adapter, NULL, 1, 3, 500);
ps_anc = 1;
}
} else {
if (is_client_associated_to_ap(adapter) == _TRUE) {
/* TODO: TDLS peers */
issue_nulldata(adapter, NULL, 0, 3, 500);
ps_anc = 1;
}
}
}
return ps_anc;
}
#endif
static void sitesurvey_set_igi(_adapter *adapter)
{

View file

@ -1438,16 +1438,11 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work)
_exit_pwrlock(&pwrpriv->lock);
if (rtw_read8(padapter, 0x100) != 0xEA) {
#if 1
struct reportpwrstate_parm report;
report.state = PS_STATE_S2;
RTW_INFO("\n%s: FW already leave 32K!\n\n", __func__);
cpwm_int_hdl(padapter, &report);
#else
RTW_INFO("\n%s: FW already leave 32K!\n\n", __func__);
cpwm_event_callback(&pwrpriv->cpwm_event);
#endif
return;
}
@ -2114,11 +2109,7 @@ void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv)
rtw_resume_lock_suspend();
#if 1
queue_work(pwrpriv->rtw_workqueue, &pwrpriv->resume_work);
#else
_set_workitem(&pwrpriv->resume_work);
#endif
}
#endif /* CONFIG_RESUME_IN_WORKQUEUE */

View file

@ -2101,7 +2101,6 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
sc = (pattrib->seq_num << 4) | pattrib->frag_num;
#endif
#if 1 /* Dump rx packets */
{
u8 bDumpRxPkt = 0;
@ -2113,7 +2112,6 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
else if ((bDumpRxPkt == 3) && (type == WIFI_DATA_TYPE))
dump_rx_packet(ptr);
}
#endif
switch (type) {
case WIFI_MGT_TYPE: /* mgnt */
DBG_COUNTER(adapter->rx_logs.core_rx_pre_mgmt);
@ -2210,9 +2208,7 @@ exit:
/* remove the wlanhdr and add the eth_hdr */
#if 1
sint wlanhdr_to_ethhdr(union recv_frame *precvframe);
sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
{
sint rmv_len;
@ -2326,103 +2322,6 @@ exiting:
}
#else
sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
{
sint rmv_len;
u16 eth_type;
u8 bsnaphdr;
u8 *psnap_type;
struct ieee80211_snap_hdr *psnap;
sint ret = _SUCCESS;
_adapter *adapter = precvframe->u.hdr.adapter;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
u8 *ptr = get_recvframe_data(precvframe) ; /* point to frame_ctrl field */
struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
struct _vlan *pvlan = NULL;
psnap = (struct ieee80211_snap_hdr *)(ptr + pattrib->hdrlen + pattrib->iv_len);
psnap_type = ptr + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE;
if (psnap->dsap == 0xaa && psnap->ssap == 0xaa && psnap->ctrl == 0x03) {
if (_rtw_memcmp(psnap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN))
bsnaphdr = _TRUE; /* wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042; */
else if (_rtw_memcmp(psnap->oui, SNAP_HDR_APPLETALK_DDP, WLAN_IEEE_OUI_LEN) &&
_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_DDP, 2))
bsnaphdr = _TRUE; /* wlan_pkt_format = WLAN_PKT_FORMAT_APPLETALK; */
else if (_rtw_memcmp(psnap->oui, oui_8021h, WLAN_IEEE_OUI_LEN))
bsnaphdr = _TRUE; /* wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_TUNNEL; */
else {
ret = _FAIL;
goto exit;
}
} else
bsnaphdr = _FALSE; /* wlan_pkt_format = WLAN_PKT_FORMAT_OTHERS; */
rmv_len = pattrib->hdrlen + pattrib->iv_len + (bsnaphdr ? SNAP_SIZE : 0);
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) {
ptr += rmv_len ;
*ptr = 0x87;
*(ptr + 1) = 0x12;
/* back to original pointer */
ptr -= rmv_len;
}
ptr += rmv_len ;
_rtw_memcpy(&eth_type, ptr, 2);
eth_type = ntohs((unsigned short)eth_type); /* pattrib->ether_type */
ptr += 2;
if (pattrib->encrypt)
recvframe_pull_tail(precvframe, pattrib->icv_len);
if (eth_type == 0x8100) { /* vlan */
pvlan = (struct _vlan *) ptr;
/* eth_type = get_vlan_encap_proto(pvlan); */
/* eth_type = pvlan->h_vlan_encapsulated_proto; */ /* ? */
rmv_len += 4;
ptr += 4;
}
if (eth_type == 0x0800) { /* ip */
/* struct iphdr* piphdr = (struct iphdr*) ptr; */
/* __u8 tos = (unsigned char)(pattrib->priority & 0xff); */
/* piphdr->tos = tos; */
} else if (eth_type == 0x8712) { /* append rx status for mp test packets */
/* ptr -= 16; */
/* _rtw_memcpy(ptr, get_rxmem(precvframe), 16); */
}
if (eth_type == 0x8712) { /* append rx status for mp test packets */
ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + 2) - 24);
_rtw_memcpy(ptr, get_rxmem(precvframe), 24);
ptr += 24;
} else
ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + 2));
_rtw_memcpy(ptr, pattrib->dst, ETH_ALEN);
_rtw_memcpy(ptr + ETH_ALEN, pattrib->src, ETH_ALEN);
eth_type = htons((unsigned short)eth_type) ;
_rtw_memcpy(ptr + 12, &eth_type, 2);
exit:
return ret;
}
#endif
/* perform defrag */
union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q);
union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q)

View file

@ -1501,7 +1501,6 @@ void flush_all_cam_entry(_adapter *padapter)
rtw_clearstakey_cmd(padapter, psta, _FALSE);
}
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) {
#if 1
int cam_id = -1;
u8 *addr = adapter_mac_addr(padapter);
@ -1510,23 +1509,7 @@ void flush_all_cam_entry(_adapter *padapter)
clear_cam_entry(padapter, cam_id);
rtw_camid_free(padapter, cam_id);
}
#else
/* clear default key */
int i, cam_id;
u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
for (i = 0; i < 4; i++) {
cam_id = rtw_camid_search(padapter, null_addr, i, -1);
if (cam_id >= 0) {
clear_cam_entry(padapter, cam_id);
rtw_camid_free(padapter, cam_id);
}
}
/* clear default key related key search setting */
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_DK_CFG, (u8 *)_FALSE);
#endif
}
#else /*NON CONFIG_CONCURRENT_MODE*/
invalidate_cam_all(padapter);

View file

@ -3554,7 +3554,6 @@ static int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
{
/* if (priv->dev->br_port &&
* !memcmp(skb->data+MACADDRLEN, priv->br_mac, MACADDRLEN)) { */
#if 1
if (*((__be16 *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_8021Q)) {
is_vlan_tag = 1;
vlan_hdr = *((unsigned short *)(skb->data + MACADDRLEN * 2 + 2));
@ -3589,7 +3588,6 @@ static int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
}
}
_exit_critical_bh(&padapter->br_ext_lock, &irqL);
#endif /* 1 */
if (do_nat25) {
if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) {
struct sk_buff *newskb;