mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-06 21:43:06 +00:00
rtl8188eu: Make this code look exactly like the code in the kernel version
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
9ac6886fe0
commit
91938194fd
43 changed files with 182 additions and 845 deletions
|
@ -348,7 +348,7 @@ void expire_timeout_chk(struct adapter *padapter)
|
|||
|
||||
if (psta->state & WIFI_SLEEP_STATE) {
|
||||
if (!(psta->state & WIFI_STA_ALIVE_CHK_STATE)) {
|
||||
/* to check if alive by another methods if staion is at ps mode. */
|
||||
/* to check if alive by another methods if station is at ps mode. */
|
||||
psta->expire_to = pstapriv->expire_to;
|
||||
psta->state |= WIFI_STA_ALIVE_CHK_STATE;
|
||||
|
||||
|
@ -1115,6 +1115,9 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
/* fix bug of flush_cam_entry at STOP AP mode */
|
||||
psta->state |= WIFI_AP_STATE;
|
||||
rtw_indicate_connect(padapter);
|
||||
pmlmepriv->cur_network.join_res = true;/* for check if already set beacon */
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ static inline int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *t
|
|||
struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
|
||||
int data_len;
|
||||
|
||||
data_len = be16_to_cpu(tag->tag_len) + TAG_HDR_LEN;
|
||||
data_len = tag->tag_len + TAG_HDR_LEN;
|
||||
if (skb_tailroom(skb) < data_len) {
|
||||
_DEBUG_ERR("skb_tailroom() failed in add SID tag!\n");
|
||||
return -1;
|
||||
|
@ -155,53 +155,44 @@ static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr
|
|||
|
||||
|
||||
static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
|
||||
__be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
|
||||
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
|
||||
{
|
||||
u32 cpu_netaddr = be32_to_cpu(*ipxNetAddr);
|
||||
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
networkAddr[0] = NAT25_IPX;
|
||||
memcpy(networkAddr+1, &cpu_netaddr, 4);
|
||||
memcpy(networkAddr+1, (unsigned char *)ipxNetAddr, 4);
|
||||
memcpy(networkAddr+5, ipxNodeAddr, 6);
|
||||
}
|
||||
|
||||
|
||||
static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
|
||||
__be32 *ipxNetAddr, __be16 *ipxSocketAddr)
|
||||
unsigned int *ipxNetAddr, unsigned short *ipxSocketAddr)
|
||||
{
|
||||
u32 cpu_netaddr = be32_to_cpu(*ipxNetAddr);
|
||||
u16 cpu_sockaddr = be16_to_cpu(*ipxSocketAddr);
|
||||
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
networkAddr[0] = NAT25_IPX;
|
||||
memcpy(networkAddr+1, &cpu_netaddr, 4);
|
||||
memcpy(networkAddr+5, &cpu_sockaddr, 2);
|
||||
memcpy(networkAddr+1, (unsigned char *)ipxNetAddr, 4);
|
||||
memcpy(networkAddr+5, (unsigned char *)ipxSocketAddr, 2);
|
||||
}
|
||||
|
||||
|
||||
static inline void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
|
||||
__be16 *network, unsigned char *node)
|
||||
unsigned short *network, unsigned char *node)
|
||||
{
|
||||
u16 cpu_net = be16_to_cpu(*network);
|
||||
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
networkAddr[0] = NAT25_APPLE;
|
||||
memcpy(networkAddr+1, &cpu_net, 2);
|
||||
memcpy(networkAddr+1, (unsigned char *)network, 2);
|
||||
networkAddr[3] = *node;
|
||||
}
|
||||
|
||||
static inline void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
|
||||
unsigned char *ac_mac, __be16 *sid)
|
||||
unsigned char *ac_mac, unsigned short *sid)
|
||||
{
|
||||
u16 cpu_sid = be16_to_cpu(*sid);
|
||||
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
networkAddr[0] = NAT25_PPPOE;
|
||||
memcpy(networkAddr+1, &cpu_sid, 2);
|
||||
memcpy(networkAddr+1, (unsigned char *)sid, 2);
|
||||
memcpy(networkAddr+3, (unsigned char *)ac_mac, 6);
|
||||
}
|
||||
|
||||
|
@ -536,7 +527,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
case NAT25_CHECK:
|
||||
return -1;
|
||||
case NAT25_INSERT:
|
||||
/* some muticast with source IP is all zero, maybe other case is illegal */
|
||||
/* some multicast with source IP is all zero, maybe other case is illegal */
|
||||
/* in class A, B, C, host address is all zero or all one is illegal */
|
||||
if (iph->saddr == 0)
|
||||
return 0;
|
||||
|
@ -688,7 +679,6 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
|
||||
DEBUG_INFO("NAT25: Check IPX skb_copy\n");
|
||||
return 0;
|
||||
return -1;
|
||||
case NAT25_INSERT:
|
||||
DEBUG_INFO("NAT25: Insert IPX, Dest =%08x,%02x%02x%02x%02x%02x%02x,%04x Source =%08x,%02x%02x%02x%02x%02x%02x,%04x\n",
|
||||
ipx->ipx_dest.net,
|
||||
|
@ -821,7 +811,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
/* Handle PPPoE frame */
|
||||
/*---------------------------------------------------*/
|
||||
struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
|
||||
__be16 *pMagic;
|
||||
unsigned short *pMagic;
|
||||
|
||||
switch (method) {
|
||||
case NAT25_CHECK:
|
||||
|
@ -859,7 +849,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
tag->tag_len = htons(MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN+old_tag_len);
|
||||
|
||||
/* insert the magic_code+client mac in relay tag */
|
||||
pMagic = (__be16 *)tag->tag_data;
|
||||
pMagic = (unsigned short *)tag->tag_data;
|
||||
*pMagic = htons(MAGIC_CODE);
|
||||
memcpy(tag->tag_data+MAGIC_CODE_LEN, skb->data+ETH_ALEN, ETH_ALEN);
|
||||
|
||||
|
@ -922,8 +912,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
return -1;
|
||||
}
|
||||
|
||||
pMagic = (__be16 *)tag->tag_data;
|
||||
if (be16_to_cpu(*pMagic) != MAGIC_CODE) {
|
||||
pMagic = (unsigned short *)tag->tag_data;
|
||||
if (ntohs(*pMagic) != MAGIC_CODE) {
|
||||
DEBUG_ERR("Can't find MAGIC_CODE in %s packet!\n",
|
||||
(ph->code == PADO_CODE ? "PADO" : "PADS"));
|
||||
return -1;
|
||||
|
@ -1028,12 +1018,11 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
if (update_nd_link_layer_addr(skb->data + ETH_HLEN + sizeof(*iph),
|
||||
skb->len - ETH_HLEN - sizeof(*iph), GET_MY_HWADDR(priv))) {
|
||||
struct icmp6hdr *hdr = (struct icmp6hdr *)(skb->data + ETH_HLEN + sizeof(*iph));
|
||||
u32 len = __be16_to_cpu(iph->payload_len);
|
||||
hdr->icmp6_cksum = 0;
|
||||
hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr,
|
||||
len,
|
||||
iph->payload_len,
|
||||
IPPROTO_ICMPV6,
|
||||
csum_partial((__u8 *)hdr, len, 0));
|
||||
csum_partial((__u8 *)hdr, iph->payload_len, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1128,7 +1117,7 @@ struct dhcpMessage {
|
|||
u_int8_t hops;
|
||||
u_int32_t xid;
|
||||
u_int16_t secs;
|
||||
__be16 flags;
|
||||
u_int16_t flags;
|
||||
u_int32_t ciaddr;
|
||||
u_int32_t yiaddr;
|
||||
u_int32_t siaddr;
|
||||
|
@ -1136,7 +1125,7 @@ struct dhcpMessage {
|
|||
u_int8_t chaddr[16];
|
||||
u_int8_t sname[64];
|
||||
u_int8_t file[128];
|
||||
__be32 cookie;
|
||||
u_int32_t cookie;
|
||||
u_int8_t options[308]; /* 312 - cookie */
|
||||
};
|
||||
|
||||
|
@ -1163,17 +1152,17 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb)
|
|||
if (cookie == DHCP_MAGIC) { /* match magic word */
|
||||
if (!(dhcph->flags & htons(BROADCAST_FLAG))) {
|
||||
/* if not broadcast */
|
||||
register int sum;
|
||||
register int sum = 0;
|
||||
|
||||
DEBUG_INFO("DHCP: change flag of DHCP request to broadcast.\n");
|
||||
/* or BROADCAST flag */
|
||||
dhcph->flags |= htons(BROADCAST_FLAG);
|
||||
/* recalculate checksum */
|
||||
sum = (__force int)(~(udph->check)) & 0xffff;
|
||||
sum = ~(udph->check) & 0xffff;
|
||||
sum += be16_to_cpu(dhcph->flags);
|
||||
while (sum >> 16)
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
udph->check = (__force __sum16)~sum;
|
||||
udph->check = ~sum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1162,7 +1162,7 @@ _func_enter_;
|
|||
else
|
||||
memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
|
||||
|
||||
/* jeff: set this becasue at least sw key is ready */
|
||||
/* jeff: set this because at least sw key is ready */
|
||||
padapter->securitypriv.busetkipkey = true;
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
|
|
@ -159,7 +159,7 @@ Efuse_CalculateWordCnts(u8 word_en)
|
|||
/* */
|
||||
/* Description: */
|
||||
/* Execute E-Fuse read byte operation. */
|
||||
/* Refered from SD1 Richard. */
|
||||
/* Referred from SD1 Richard. */
|
||||
/* */
|
||||
/* Assumption: */
|
||||
/* 1. Boot from E-Fuse and successfully auto-load. */
|
||||
|
@ -214,7 +214,7 @@ ReadEFuseByte(
|
|||
/* Description: */
|
||||
/* 1. Execute E-Fuse read byte operation according as map offset and */
|
||||
/* save to E-Fuse table. */
|
||||
/* 2. Refered from SD1 Richard. */
|
||||
/* 2. Referred from SD1 Richard. */
|
||||
/* */
|
||||
/* Assumption: */
|
||||
/* 1. Boot from E-Fuse and successfully auto-load. */
|
||||
|
@ -542,7 +542,7 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data)
|
|||
{
|
||||
u8 offset, word_en;
|
||||
u8 *map;
|
||||
u8 newdata[PGPKT_DATA_SIZE];
|
||||
u8 newdata[PGPKT_DATA_SIZE + 1];
|
||||
s32 i, idx;
|
||||
u8 ret = _SUCCESS;
|
||||
u16 mapLen = 0;
|
||||
|
@ -564,7 +564,7 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data)
|
|||
|
||||
offset = (addr >> 3);
|
||||
word_en = 0xF;
|
||||
_rtw_memset(newdata, 0xFF, PGPKT_DATA_SIZE);
|
||||
_rtw_memset(newdata, 0xFF, PGPKT_DATA_SIZE + 1);
|
||||
i = addr & 0x7; /* index of one package */
|
||||
idx = 0; /* data index */
|
||||
|
||||
|
@ -634,7 +634,7 @@ u8 rtw_BT_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data
|
|||
{
|
||||
u8 offset, word_en;
|
||||
u8 *map;
|
||||
u8 newdata[PGPKT_DATA_SIZE];
|
||||
u8 newdata[PGPKT_DATA_SIZE + 1];
|
||||
s32 i, idx;
|
||||
u8 ret = _SUCCESS;
|
||||
u16 mapLen = 0;
|
||||
|
@ -656,7 +656,7 @@ u8 rtw_BT_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data
|
|||
|
||||
offset = (addr >> 3);
|
||||
word_en = 0xF;
|
||||
_rtw_memset(newdata, 0xFF, PGPKT_DATA_SIZE);
|
||||
_rtw_memset(newdata, 0xFF, PGPKT_DATA_SIZE + 1);
|
||||
i = addr & 0x7; /* index of one package */
|
||||
idx = 0; /* data index */
|
||||
|
||||
|
|
|
@ -557,7 +557,7 @@ _func_enter_;
|
|||
sq_final = ((u32)(src->PhyInfo.SignalQuality)+(u32)(dst->PhyInfo.SignalQuality)*4)/5;
|
||||
rssi_final = (src->Rssi+dst->Rssi*4)/5;
|
||||
} else {
|
||||
/* bss info not receving from the right channel, use the original RX signal infos */
|
||||
/* bss info not receiving from the right channel, use the original RX signal infos */
|
||||
ss_final = dst->PhyInfo.SignalStrength;
|
||||
sq_final = dst->PhyInfo.SignalQuality;
|
||||
rssi_final = dst->Rssi;
|
||||
|
@ -636,7 +636,7 @@ _func_enter_;
|
|||
pnetwork->aid = 0;
|
||||
pnetwork->join_res = 0;
|
||||
|
||||
/* bss info not receving from the right channel */
|
||||
/* bss info not receiving from the right channel */
|
||||
if (pnetwork->network.PhyInfo.SignalQuality == 101)
|
||||
pnetwork->network.PhyInfo.SignalQuality = 0;
|
||||
} else {
|
||||
|
@ -656,7 +656,7 @@ _func_enter_;
|
|||
|
||||
pnetwork->last_scanned = rtw_get_current_time();
|
||||
|
||||
/* bss info not receving from the right channel */
|
||||
/* bss info not receiving from the right channel */
|
||||
if (pnetwork->network.PhyInfo.SignalQuality == 101)
|
||||
pnetwork->network.PhyInfo.SignalQuality = 0;
|
||||
rtw_list_insert_tail(&(pnetwork->list), &(queue->queue));
|
||||
|
@ -670,7 +670,7 @@ _func_enter_;
|
|||
|
||||
pnetwork->last_scanned = rtw_get_current_time();
|
||||
|
||||
/* target.Reserved[0]== 1, means that scaned network is a bcn frame. */
|
||||
/* target.Reserved[0]== 1, means that scanned network is a bcn frame. */
|
||||
if ((pnetwork->network.IELength > target->IELength) && (target->Reserved[0] == 1))
|
||||
update_ie = false;
|
||||
|
||||
|
@ -1130,7 +1130,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
|
|||
padapter->securitypriv.wps_ie_len = 0;
|
||||
}
|
||||
/* for A-MPDU Rx reordering buffer control for bmc_sta & sta_info */
|
||||
/* if A-MPDU Rx is enabled, reseting rx_ordering_ctrl wstart_b(indicate_seq) to default value = 0xffff */
|
||||
/* if A-MPDU Rx is enabled, resetting rx_ordering_ctrl wstart_b(indicate_seq) to default value = 0xffff */
|
||||
/* todo: check if AP can send A-MPDU packets */
|
||||
for (i = 0; i < 16; i++) {
|
||||
/* preorder_ctrl = &precvpriv->recvreorder_ctrl[i]; */
|
||||
|
@ -1210,7 +1210,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
|
|||
rtw_update_ht_cap(padapter, cur_network->network.IEs, cur_network->network.IELength);
|
||||
}
|
||||
|
||||
/* Notes: the fucntion could be > passive_level (the same context as Rx tasklet) */
|
||||
/* Notes: the function could be > passive_level (the same context as Rx tasklet) */
|
||||
/* pnetwork: returns from rtw_joinbss_event_callback */
|
||||
/* ptarget_wlan: found from scanned_queue */
|
||||
/* if join_res > 0, for (fw_state == WIFI_STATION_STATE), we check if "ptarget_sta" & "ptarget_wlan" exist. */
|
||||
|
@ -2177,7 +2177,7 @@ _func_enter_;
|
|||
_func_exit_;
|
||||
}
|
||||
|
||||
/* the fucntion is at passive_level */
|
||||
/* the function is at passive_level */
|
||||
void rtw_joinbss_reset(struct adapter *padapter)
|
||||
{
|
||||
u8 threshold;
|
||||
|
@ -2205,7 +2205,7 @@ void rtw_joinbss_reset(struct adapter *padapter)
|
|||
}
|
||||
}
|
||||
|
||||
/* the fucntion is >= passive_level */
|
||||
/* the function is >= passive_level */
|
||||
unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len)
|
||||
{
|
||||
u32 ielen, out_len;
|
||||
|
@ -2273,7 +2273,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
|
|||
return phtpriv->ht_option;
|
||||
}
|
||||
|
||||
/* the fucntion is > passive_level (in critical_section) */
|
||||
/* the function is > passive_level (in critical_section) */
|
||||
void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
|
||||
{
|
||||
u8 *p, max_ampdu_sz;
|
||||
|
@ -2332,7 +2332,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
|
|||
else
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i];
|
||||
}
|
||||
/* switch to the 40M Hz mode accoring to the AP */
|
||||
/* switch to the 40M Hz mode according to the AP */
|
||||
pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40;
|
||||
switch ((pmlmeinfo->HT_info.infos[0] & 0x3)) {
|
||||
case HT_EXTCHNL_OFFSET_UPPER:
|
||||
|
|
|
@ -2349,7 +2349,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8 *raddr, u8 *frame
|
|||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT)) {
|
||||
/* Commented by Albert 2011/03/08 */
|
||||
/* According to the P2P specification */
|
||||
/* if the sending device will be client, the P2P Capability should be reserved of group negotation response frame */
|
||||
/* if the sending device will be client, the P2P Capability should be reserved of group negotiation response frame */
|
||||
p2pie[p2pielen++] = 0;
|
||||
} else {
|
||||
/* Be group owner or meet the error case */
|
||||
|
@ -6115,17 +6115,16 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
|
|||
pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->ADDBA_req.dialog_token), &(pattrib->pktlen));
|
||||
pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&status), &(pattrib->pktlen));
|
||||
rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor);
|
||||
BA_para_set = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set);
|
||||
if (MAX_AMPDU_FACTOR_64K == max_rx_ampdu_factor)
|
||||
BA_para_set = (((BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */
|
||||
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */
|
||||
else if (MAX_AMPDU_FACTOR_32K == max_rx_ampdu_factor)
|
||||
BA_para_set = (((BA_para_set) & 0x3f) | 0x0800); /* 32 buffer size */
|
||||
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0800); /* 32 buffer size */
|
||||
else if (MAX_AMPDU_FACTOR_16K == max_rx_ampdu_factor)
|
||||
BA_para_set = (((BA_para_set) & 0x3f) | 0x0400); /* 16 buffer size */
|
||||
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0400); /* 16 buffer size */
|
||||
else if (MAX_AMPDU_FACTOR_8K == max_rx_ampdu_factor)
|
||||
BA_para_set = (((BA_para_set) & 0x3f) | 0x0200); /* 8 buffer size */
|
||||
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x0200); /* 8 buffer size */
|
||||
else
|
||||
BA_para_set = (((BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */
|
||||
BA_para_set = (((pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f) | 0x1000); /* 64 buffer size */
|
||||
|
||||
if (pregpriv->ampdu_amsdu == 0)/* disabled */
|
||||
BA_para_set = BA_para_set & ~BIT(0);
|
||||
|
@ -6700,7 +6699,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str
|
|||
}
|
||||
}
|
||||
|
||||
/* mark bss info receving from nearby channel as SignalQuality 101 */
|
||||
/* mark bss info receiving from nearby channel as SignalQuality 101 */
|
||||
if (bssid->Configuration.DSConfig != rtw_get_oper_ch(padapter))
|
||||
bssid->PhyInfo.SignalQuality = 101;
|
||||
return _SUCCESS;
|
||||
|
@ -8112,7 +8111,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf)
|
|||
Save_DM_Func_Flag(padapter);
|
||||
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false);
|
||||
|
||||
/* config the initial gain under scaning, need to write the BB registers */
|
||||
/* config the initial gain under scanning, need to write the BB registers */
|
||||
#ifdef CONFIG_88EU_P2P
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
initialgain = 0x1E;
|
||||
|
|
|
@ -193,7 +193,7 @@ void rtw_ps_processor(struct adapter *padapter)
|
|||
if (pwrpriv->ips_mode_req == IPS_NONE)
|
||||
goto exit;
|
||||
|
||||
if (rtw_pwr_unassociated_idle(padapter) == false)
|
||||
if (!rtw_pwr_unassociated_idle(padapter))
|
||||
goto exit;
|
||||
|
||||
if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4) == 0)) {
|
||||
|
|
|
@ -204,11 +204,14 @@ void rtw_init_recvframe(union recv_frame *precvframe, struct recv_priv *precvpri
|
|||
int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_queue)
|
||||
{
|
||||
unsigned long irqL;
|
||||
struct adapter *padapter = precvframe->u.hdr.adapter;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
struct adapter *padapter;
|
||||
struct recv_priv *precvpriv;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (!precvframe)
|
||||
return _FAIL;
|
||||
padapter = precvframe->u.hdr.adapter;
|
||||
precvpriv = &padapter->recvpriv;
|
||||
if (precvframe->u.hdr.pkt) {
|
||||
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
|
||||
precvframe->u.hdr.pkt = NULL;
|
||||
|
@ -1583,7 +1586,7 @@ _func_enter_;
|
|||
|
||||
pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len;
|
||||
plist = get_next(plist);
|
||||
};
|
||||
}
|
||||
|
||||
/* free the defrag_q queue and return the prframe */
|
||||
rtw_free_recvframe_queue(defrag_q, pfree_recv_queue);
|
||||
|
@ -1798,8 +1801,7 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
|
||||
}
|
||||
|
||||
/* Indicat the packets to upper layer */
|
||||
if (sub_skb) {
|
||||
/* Indicate the packets to upper layer */
|
||||
/* Insert NAT2.5 RX here! */
|
||||
sub_skb->protocol = eth_type_trans(sub_skb, padapter->pnetdev);
|
||||
sub_skb->dev = padapter->pnetdev;
|
||||
|
@ -1808,7 +1810,6 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
|
||||
netif_rx(sub_skb);
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
|
|
|
@ -916,7 +916,7 @@ _func_enter_;
|
|||
add1b[i] = 0x00;
|
||||
}
|
||||
|
||||
swap_halfs[0] = in[2]; /* Swap halfs */
|
||||
swap_halfs[0] = in[2]; /* Swap halves */
|
||||
swap_halfs[1] = in[3];
|
||||
swap_halfs[2] = in[0];
|
||||
swap_halfs[3] = in[1];
|
||||
|
|
|
@ -267,10 +267,9 @@ _func_enter_;
|
|||
|
||||
rtw_mfree_sta_priv_lock(pstapriv);
|
||||
|
||||
if (pstapriv->pallocated_stainfo_buf) {
|
||||
if (pstapriv->pallocated_stainfo_buf)
|
||||
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info)*NUM_STA+4);
|
||||
}
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
|
|
|
@ -1096,13 +1096,13 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
|||
}
|
||||
|
||||
kfree(bssid);
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
|
||||
_mismatch:
|
||||
kfree(bssid);
|
||||
return _FAIL;
|
||||
|
||||
_func_exit_;
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta)
|
||||
|
@ -1376,13 +1376,13 @@ void update_tx_basic_rate(struct adapter *padapter, u8 wirelessmode)
|
|||
#endif /* CONFIG_88EU_P2P */
|
||||
_rtw_memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX);
|
||||
|
||||
if ((wirelessmode & WIRELESS_11B) && (wirelessmode == WIRELESS_11B)) {
|
||||
if ((wirelessmode & WIRELESS_11B) && (wirelessmode == WIRELESS_11B))
|
||||
memcpy(supported_rates, rtw_basic_rate_cck, 4);
|
||||
} else if (wirelessmode & WIRELESS_11B) {
|
||||
else if (wirelessmode & WIRELESS_11B)
|
||||
memcpy(supported_rates, rtw_basic_rate_mix, 7);
|
||||
} else {
|
||||
else
|
||||
memcpy(supported_rates, rtw_basic_rate_ofdm, 3);
|
||||
}
|
||||
|
||||
|
||||
if (wirelessmode & WIRELESS_11B)
|
||||
update_mgnt_tx_rate(padapter, IEEE80211_CCK_RATE_1MB);
|
||||
|
|
|
@ -827,7 +827,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
|
|||
u8 qos_option = false;
|
||||
|
||||
int res = _SUCCESS;
|
||||
__le16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
u16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
|
||||
struct sta_info *psta;
|
||||
|
||||
|
@ -1556,7 +1556,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str
|
|||
xmitframe_phead = get_list_head(pframe_queue);
|
||||
xmitframe_plist = get_next(xmitframe_phead);
|
||||
|
||||
while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
|
||||
if (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
|
||||
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
|
||||
|
||||
xmitframe_plist = get_next(xmitframe_plist);
|
||||
|
@ -1564,12 +1564,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str
|
|||
rtw_list_delete(&pxmitframe->list);
|
||||
|
||||
ptxservq->qcnt--;
|
||||
|
||||
break;
|
||||
|
||||
pxmitframe = NULL;
|
||||
}
|
||||
|
||||
return pxmitframe;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue