rtl8188eu: Remove "if 1"

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-03-07 13:00:36 -06:00
parent 715a0150a8
commit cfd60faf5e
21 changed files with 2 additions and 682 deletions

View file

@ -1088,10 +1088,8 @@ int proc_get_best_channel(char *page, char **start,
best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
}
}
#if 1 /* debug */
len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count);
#endif
}
len += snprintf(page + len, count - len, "best_channel_5G = %d\n", best_channel_5G);

View file

@ -27,7 +27,6 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter)
struct pkt_attrib *pattrib;
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
#if 1
if ((xmit_frame = rtw_alloc_xmitframe(pxmitpriv)) == NULL)
{
DBG_871X("%s rtw_alloc_xmitframe return null\n", __FUNCTION__);
@ -53,19 +52,6 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(struct adapter *adapter)
pattrib->subtype = WIFI_BEACON;
pattrib->pktlen = pattrib->last_txcmdsz = 0;
#else
if ((xmit_frame = alloc_mgtxmitframe(pxmitpriv)) == NULL)
{
DBG_871X("%s alloc_mgtxmitframe return null\n", __FUNCTION__);
}
else {
pattrib = &xmit_frame->attrib;
update_mgntframe_attrib(adapter, pattrib);
pattrib->qsel = 0x10;
pattrib->pktlen = pattrib->last_txcmdsz = 0;
}
#endif
exit:
return xmit_frame;
}

View file

@ -609,7 +609,6 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
}
ptable += index;
#if 1
if (psta != NULL)
{
if (GetRetry(pframe))
@ -623,14 +622,6 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
}
psta->RxMgmtFrameSeqNum = precv_frame->u.hdr.attrib.seq_num;
}
#else
if(GetRetry(pframe))
{
/* RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("drop due to decache!\n")); */
/* return; */
}
#endif
#ifdef CONFIG_AP_MODE
switch (GetFrameSubType(pframe))

View file

@ -770,11 +770,7 @@ void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv)
/* accquire system's suspend lock preventing from falliing asleep while resume in workqueue */
rtw_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

@ -1910,9 +1910,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;
@ -1989,136 +1987,6 @@ sint wlanhdr_to_ethhdr ( union recv_frame *precvframe)
}
#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;
struct 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 {
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("drop pkt due to invalid frame format!\n"));
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);
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n", pattrib->hdrlen, pattrib->iv_len));
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 ;
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;
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; */
/* if (piphdr->protocol == 0x06) */
/* */
/* RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("@@@===recv tcp len:%d @@@===\n", precvframe->u.hdr.len)); */
/* */
}
else if(eth_type==0x8712)/* append rx status for mp test packets */
{
/* ptr -= 16; */
/* memcpy(ptr, get_rxmem(precvframe), 16); */
}
else
{
#ifdef PLATFORM_OS_XP
NDIS_PACKET_8021Q_INFO VlanPriInfo;
u3232 UserPriority = precvframe->u.hdr.attrib.priority;
u3232 VlanID = (pvlan!=NULL ? get_vlan_id(pvlan) : 0 );
VlanPriInfo.Value = /* Get current value. */
NDIS_PER_PACKET_INFO_FROM_PACKET(precvframe->u.hdr.pkt, Ieee8021QInfo);
VlanPriInfo.TagHeader.UserPriority = UserPriority;
VlanPriInfo.TagHeader.VlanId = VlanID ;
VlanPriInfo.TagHeader.CanonicalFormatId = 0; /* Should be zero. */
VlanPriInfo.TagHeader.Reserved = 0; /* Should be zero. */
NDIS_PER_PACKET_INFO_FROM_PACKET(precvframe->u.hdr.pkt, Ieee8021QInfo) = VlanPriInfo.Value;
#endif
}
if(eth_type==0x8712)/* append rx status for mp test packets */
{
ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+2)-24);
memcpy(ptr, get_rxmem(precvframe), 24);
ptr+=24;
}
else
ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+2));
memcpy(ptr, pattrib->dst, ETH_ALEN);
memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN);
eth_type = htons((unsigned short)eth_type) ;
memcpy(ptr+12, &eth_type, 2);
exit:
;
return ret;
}
#endif
/* perform defrag */
static union recv_frame * recvframe_defrag(struct adapter *adapter,_queue *defrag_q)
{
@ -2483,12 +2351,7 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
/* DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n"); */
/* return FAIL; */
#if 1
/* bypass this frame to upper layer!! */
#else
rtw_skb_free(sub_skb);
continue;
#endif
}
}
#endif /* CONFIG_BR_EXT */

View file

@ -2489,11 +2489,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
spin_unlock_bh(&padapter->br_ext_lock);
}
else
/* if (!priv->pmib->ethBrExtInfo.nat25_disable) */
{
/* 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));
@ -2528,7 +2524,6 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
}
}
spin_unlock_bh(&padapter->br_ext_lock);
#endif /* 1 */
if (do_nat25)
{
if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) {