mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-09 23:19:39 +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;
|
||||
}
|
||||
|
||||
|
|
|
@ -819,7 +819,7 @@ void _PHY_SaveADDARegisters(struct adapter *adapt, u32 *ADDAReg, u32 *ADDABackup
|
|||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
if (ODM_CheckPowerStatus(adapt) == false)
|
||||
if (!ODM_CheckPowerStatus(adapt))
|
||||
return;
|
||||
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Save ADDA parameters.\n"));
|
||||
|
@ -888,7 +888,7 @@ _PHY_PathADDAOn(
|
|||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("ADDA ON.\n"));
|
||||
|
||||
pathOn = isPathAOn ? 0x04db25a4 : 0x0b1b25a4;
|
||||
if (false == is2t) {
|
||||
if (!is2t) {
|
||||
pathOn = 0x0bdb25a0;
|
||||
ODM_SetBBReg(dm_odm, ADDAReg[0], bMaskDWord, 0x0b1b25a0);
|
||||
} else {
|
||||
|
@ -1276,407 +1276,6 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)
|
|||
}
|
||||
}
|
||||
|
||||
/* Analog Pre-distortion calibration */
|
||||
#define APK_BB_REG_NUM 8
|
||||
#define APK_CURVE_REG_NUM 4
|
||||
#define PATH_NUM 2
|
||||
|
||||
static void phy_APCalibrate_8188E(struct adapter *adapt, s8 delta, bool is2t)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
u32 regD[PATH_NUM];
|
||||
u32 tmpreg, index, offset, apkbound;
|
||||
u8 path, i, pathbound = PATH_NUM;
|
||||
u32 BB_backup[APK_BB_REG_NUM];
|
||||
u32 BB_REG[APK_BB_REG_NUM] = {
|
||||
rFPGA1_TxBlock, rOFDM0_TRxPathEnable,
|
||||
rFPGA0_RFMOD, rOFDM0_TRMuxPar,
|
||||
rFPGA0_XCD_RFInterfaceSW, rFPGA0_XAB_RFInterfaceSW,
|
||||
rFPGA0_XA_RFInterfaceOE, rFPGA0_XB_RFInterfaceOE };
|
||||
u32 BB_AP_MODE[APK_BB_REG_NUM] = {
|
||||
0x00000020, 0x00a05430, 0x02040000,
|
||||
0x000800e4, 0x00204000 };
|
||||
u32 BB_normal_AP_MODE[APK_BB_REG_NUM] = {
|
||||
0x00000020, 0x00a05430, 0x02040000,
|
||||
0x000800e4, 0x22204000 };
|
||||
|
||||
u32 AFE_backup[IQK_ADDA_REG_NUM];
|
||||
u32 AFE_REG[IQK_ADDA_REG_NUM] = {
|
||||
rFPGA0_XCD_SwitchControl, rBlue_Tooth,
|
||||
rRx_Wait_CCA, rTx_CCK_RFON,
|
||||
rTx_CCK_BBON, rTx_OFDM_RFON,
|
||||
rTx_OFDM_BBON, rTx_To_Rx,
|
||||
rTx_To_Tx, rRx_CCK,
|
||||
rRx_OFDM, rRx_Wait_RIFS,
|
||||
rRx_TO_Rx, rStandby,
|
||||
rSleep, rPMPD_ANAEN };
|
||||
|
||||
u32 MAC_backup[IQK_MAC_REG_NUM];
|
||||
u32 MAC_REG[IQK_MAC_REG_NUM] = {
|
||||
REG_TXPAUSE, REG_BCN_CTRL,
|
||||
REG_BCN_CTRL_1, REG_GPIO_MUXCFG};
|
||||
|
||||
u32 APK_RF_init_value[PATH_NUM][APK_BB_REG_NUM] = {
|
||||
{0x0852c, 0x1852c, 0x5852c, 0x1852c, 0x5852c},
|
||||
{0x2852e, 0x0852e, 0x3852e, 0x0852e, 0x0852e}
|
||||
};
|
||||
|
||||
u32 APK_normal_RF_init_value[PATH_NUM][APK_BB_REG_NUM] = {
|
||||
{0x0852c, 0x0a52c, 0x3a52c, 0x5a52c, 0x5a52c}, /* path settings equal to path b settings */
|
||||
{0x0852c, 0x0a52c, 0x5a52c, 0x5a52c, 0x5a52c}
|
||||
};
|
||||
|
||||
u32 APK_RF_value_0[PATH_NUM][APK_BB_REG_NUM] = {
|
||||
{0x52019, 0x52014, 0x52013, 0x5200f, 0x5208d},
|
||||
{0x5201a, 0x52019, 0x52016, 0x52033, 0x52050}
|
||||
};
|
||||
|
||||
u32 APK_normal_RF_value_0[PATH_NUM][APK_BB_REG_NUM] = {
|
||||
{0x52019, 0x52017, 0x52010, 0x5200d, 0x5206a}, /* path settings equal to path b settings */
|
||||
{0x52019, 0x52017, 0x52010, 0x5200d, 0x5206a}
|
||||
};
|
||||
|
||||
u32 AFE_on_off[PATH_NUM] = {
|
||||
0x04db25a4, 0x0b1b25a4}; /* path A on path B off / path A off path B on */
|
||||
|
||||
u32 APK_offset[PATH_NUM] = {
|
||||
rConfig_AntA, rConfig_AntB};
|
||||
|
||||
u32 APK_normal_offset[PATH_NUM] = {
|
||||
rConfig_Pmpd_AntA, rConfig_Pmpd_AntB};
|
||||
|
||||
u32 APK_value[PATH_NUM] = {
|
||||
0x92fc0000, 0x12fc0000};
|
||||
|
||||
u32 APK_normal_value[PATH_NUM] = {
|
||||
0x92680000, 0x12680000};
|
||||
|
||||
s8 APK_delta_mapping[APK_BB_REG_NUM][13] = {
|
||||
{-4, -3, -2, -2, -1, -1, 0, 1, 2, 3, 4, 5, 6},
|
||||
{-4, -3, -2, -2, -1, -1, 0, 1, 2, 3, 4, 5, 6},
|
||||
{-6, -4, -2, -2, -1, -1, 0, 1, 2, 3, 4, 5, 6},
|
||||
{-1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6},
|
||||
{-11, -9, -7, -5, -3, -1, 0, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
u32 APK_normal_setting_value_1[13] = {
|
||||
0x01017018, 0xf7ed8f84, 0x1b1a1816, 0x2522201e, 0x322e2b28,
|
||||
0x433f3a36, 0x5b544e49, 0x7b726a62, 0xa69a8f84, 0xdfcfc0b3,
|
||||
0x12680000, 0x00880000, 0x00880000
|
||||
};
|
||||
|
||||
u32 APK_normal_setting_value_2[16] = {
|
||||
0x01c7021d, 0x01670183, 0x01000123, 0x00bf00e2, 0x008d00a3,
|
||||
0x0068007b, 0x004d0059, 0x003a0042, 0x002b0031, 0x001f0025,
|
||||
0x0017001b, 0x00110014, 0x000c000f, 0x0009000b, 0x00070008,
|
||||
0x00050006
|
||||
};
|
||||
|
||||
u32 APK_result[PATH_NUM][APK_BB_REG_NUM]; /* val_1_1a, val_1_2a, val_2a, val_3a, val_4a */
|
||||
s32 BB_offset, delta_V, delta_offset;
|
||||
|
||||
if (*(dm_odm->mp_mode) == 1) {
|
||||
struct mpt_context *pMptCtx = &(adapt->mppriv.MptCtx);
|
||||
pMptCtx->APK_bound[0] = 45;
|
||||
pMptCtx->APK_bound[1] = 52;
|
||||
}
|
||||
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("==>phy_APCalibrate_8188E() delta %d\n", delta));
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("AP Calibration for %s\n", (is2t ? "2T2R" : "1T1R")));
|
||||
if (!is2t)
|
||||
pathbound = 1;
|
||||
|
||||
/* 2 FOR NORMAL CHIP SETTINGS */
|
||||
|
||||
/* Temporarily do not allow normal driver to do the following settings
|
||||
* because these offset and value will cause RF internal PA to be
|
||||
* unpredictably disabled by HW, such that RF Tx signal will disappear
|
||||
* after disable/enable card many times on 88CU. RF SD and DD have not
|
||||
* find the root cause, so we remove these actions temporarily.
|
||||
*/
|
||||
if (*(dm_odm->mp_mode) != 1)
|
||||
return;
|
||||
/* settings adjust for normal chip */
|
||||
for (index = 0; index < PATH_NUM; index++) {
|
||||
APK_offset[index] = APK_normal_offset[index];
|
||||
APK_value[index] = APK_normal_value[index];
|
||||
AFE_on_off[index] = 0x6fdb25a4;
|
||||
}
|
||||
|
||||
for (index = 0; index < APK_BB_REG_NUM; index++) {
|
||||
for (path = 0; path < pathbound; path++) {
|
||||
APK_RF_init_value[path][index] = APK_normal_RF_init_value[path][index];
|
||||
APK_RF_value_0[path][index] = APK_normal_RF_value_0[path][index];
|
||||
}
|
||||
BB_AP_MODE[index] = BB_normal_AP_MODE[index];
|
||||
}
|
||||
|
||||
apkbound = 6;
|
||||
|
||||
/* save BB default value */
|
||||
for (index = 0; index < APK_BB_REG_NUM; index++) {
|
||||
if (index == 0) /* skip */
|
||||
continue;
|
||||
BB_backup[index] = ODM_GetBBReg(dm_odm, BB_REG[index], bMaskDWord);
|
||||
}
|
||||
|
||||
/* save MAC default value */
|
||||
_PHY_SaveMACRegisters(adapt, MAC_REG, MAC_backup);
|
||||
|
||||
/* save AFE default value */
|
||||
_PHY_SaveADDARegisters(adapt, AFE_REG, AFE_backup, IQK_ADDA_REG_NUM);
|
||||
|
||||
for (path = 0; path < pathbound; path++) {
|
||||
if (path == RF_PATH_A) {
|
||||
/* path A APK */
|
||||
/* load APK setting */
|
||||
/* path-A */
|
||||
offset = rPdp_AntA;
|
||||
for (index = 0; index < 11; index++) {
|
||||
ODM_SetBBReg(dm_odm, offset, bMaskDWord, APK_normal_setting_value_1[index]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
|
||||
("phy_APCalibrate_8188E() offset 0x%x value 0x%x\n",
|
||||
offset, ODM_GetBBReg(dm_odm, offset, bMaskDWord)));
|
||||
offset += 0x04;
|
||||
}
|
||||
|
||||
ODM_SetBBReg(dm_odm, rConfig_Pmpd_AntB, bMaskDWord, 0x12680000);
|
||||
|
||||
offset = rConfig_AntA;
|
||||
for (; index < 13; index++) {
|
||||
ODM_SetBBReg(dm_odm, offset, bMaskDWord, APK_normal_setting_value_1[index]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
|
||||
("phy_APCalibrate_8188E() offset 0x%x value 0x%x\n",
|
||||
offset, ODM_GetBBReg(dm_odm, offset, bMaskDWord)));
|
||||
offset += 0x04;
|
||||
}
|
||||
|
||||
/* page-B1 */
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x40000000);
|
||||
|
||||
/* path A */
|
||||
offset = rPdp_AntA;
|
||||
for (index = 0; index < 16; index++) {
|
||||
ODM_SetBBReg(dm_odm, offset, bMaskDWord, APK_normal_setting_value_2[index]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
|
||||
("phy_APCalibrate_8188E() offset 0x%x value 0x%x\n",
|
||||
offset, ODM_GetBBReg(dm_odm, offset, bMaskDWord)));
|
||||
|
||||
offset += 0x04;
|
||||
}
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x00000000);
|
||||
} else if (path == RF_PATH_B) {
|
||||
/* path B APK */
|
||||
/* load APK setting */
|
||||
/* path-B */
|
||||
offset = rPdp_AntB;
|
||||
for (index = 0; index < 10; index++) {
|
||||
ODM_SetBBReg(dm_odm, offset, bMaskDWord, APK_normal_setting_value_1[index]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
|
||||
("phy_APCalibrate_8188E() offset 0x%x value 0x%x\n",
|
||||
offset, ODM_GetBBReg(dm_odm, offset, bMaskDWord)));
|
||||
|
||||
offset += 0x04;
|
||||
}
|
||||
ODM_SetBBReg(dm_odm, rConfig_Pmpd_AntA, bMaskDWord, 0x12680000);
|
||||
PHY_SetBBReg(adapt, rConfig_Pmpd_AntB, bMaskDWord, 0x12680000);
|
||||
|
||||
offset = rConfig_AntA;
|
||||
index = 11;
|
||||
for (; index < 13; index++) { /* offset 0xb68, 0xb6c */
|
||||
ODM_SetBBReg(dm_odm, offset, bMaskDWord, APK_normal_setting_value_1[index]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
|
||||
("phy_APCalibrate_8188E() offset 0x%x value 0x%x\n",
|
||||
offset, ODM_GetBBReg(dm_odm, offset, bMaskDWord)));
|
||||
offset += 0x04;
|
||||
}
|
||||
|
||||
/* page-B1 */
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x40000000);
|
||||
|
||||
/* path B */
|
||||
offset = 0xb60;
|
||||
for (index = 0; index < 16; index++) {
|
||||
ODM_SetBBReg(dm_odm, offset, bMaskDWord, APK_normal_setting_value_2[index]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
|
||||
("phy_APCalibrate_8188E() offset 0x%x value 0x%x\n",
|
||||
offset, ODM_GetBBReg(dm_odm, offset, bMaskDWord)));
|
||||
|
||||
offset += 0x04;
|
||||
}
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0);
|
||||
}
|
||||
|
||||
/* save RF default value */
|
||||
regD[path] = PHY_QueryRFReg(adapt, path, RF_TXBIAS_A, bMaskDWord);
|
||||
|
||||
/* Path A AFE all on, path B AFE All off or vise versa */
|
||||
for (index = 0; index < IQK_ADDA_REG_NUM; index++)
|
||||
ODM_SetBBReg(dm_odm, AFE_REG[index], bMaskDWord, AFE_on_off[path]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
|
||||
("phy_APCalibrate_8188E() offset 0xe70 %x\n",
|
||||
ODM_GetBBReg(dm_odm, rRx_Wait_CCA, bMaskDWord)));
|
||||
|
||||
/* BB to AP mode */
|
||||
if (path == 0) {
|
||||
for (index = 0; index < APK_BB_REG_NUM; index++) {
|
||||
if (index == 0) /* skip */
|
||||
continue;
|
||||
else if (index < 5)
|
||||
ODM_SetBBReg(dm_odm, BB_REG[index], bMaskDWord, BB_AP_MODE[index]);
|
||||
else if (BB_REG[index] == 0x870)
|
||||
ODM_SetBBReg(dm_odm, BB_REG[index], bMaskDWord, BB_backup[index]|BIT10|BIT26);
|
||||
else
|
||||
ODM_SetBBReg(dm_odm, BB_REG[index], BIT10, 0x0);
|
||||
}
|
||||
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK_Tone_A, bMaskDWord, 0x01008c00);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK_Tone_A, bMaskDWord, 0x01008c00);
|
||||
} else {
|
||||
/* path B */
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK_Tone_B, bMaskDWord, 0x01008c00);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK_Tone_B, bMaskDWord, 0x01008c00);
|
||||
}
|
||||
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
|
||||
("phy_APCalibrate_8188E() offset 0x800 %x\n",
|
||||
ODM_GetBBReg(dm_odm, 0x800, bMaskDWord)));
|
||||
|
||||
/* MAC settings */
|
||||
_PHY_MACSettingCalibration(adapt, MAC_REG, MAC_backup);
|
||||
|
||||
if (path == RF_PATH_A) {
|
||||
/* Path B to standby mode */
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_B, RF_AC, bMaskDWord, 0x10000);
|
||||
} else {
|
||||
/* Path A to standby mode */
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_AC, bMaskDWord, 0x10000);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_MODE1, bMaskDWord, 0x1000f);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_MODE2, bMaskDWord, 0x20103);
|
||||
}
|
||||
|
||||
delta_offset = ((delta+14)/2);
|
||||
if (delta_offset < 0)
|
||||
delta_offset = 0;
|
||||
else if (delta_offset > 12)
|
||||
delta_offset = 12;
|
||||
|
||||
/* AP calibration */
|
||||
for (index = 0; index < APK_BB_REG_NUM; index++) {
|
||||
if (index != 1) /* only DO PA11+PAD01001, AP RF setting */
|
||||
continue;
|
||||
|
||||
tmpreg = APK_RF_init_value[path][index];
|
||||
if (!dm_odm->RFCalibrateInfo.bAPKThermalMeterIgnore) {
|
||||
BB_offset = (tmpreg & 0xF0000) >> 16;
|
||||
|
||||
if (!(tmpreg & BIT15)) /* sign bit 0 */
|
||||
BB_offset = -BB_offset;
|
||||
|
||||
delta_V = APK_delta_mapping[index][delta_offset];
|
||||
|
||||
BB_offset += delta_V;
|
||||
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
|
||||
("phy_APCalibrate_8188E() APK index %d tmpreg 0x%x delta_V %d delta_offset %d\n",
|
||||
index, tmpreg, delta_V, delta_offset));
|
||||
|
||||
if (BB_offset < 0) {
|
||||
tmpreg = tmpreg & (~BIT15);
|
||||
BB_offset = -BB_offset;
|
||||
} else {
|
||||
tmpreg = tmpreg | BIT15;
|
||||
}
|
||||
tmpreg = (tmpreg & 0xFFF0FFFF) | (BB_offset << 16);
|
||||
}
|
||||
|
||||
ODM_SetRFReg(dm_odm, path, RF_IPA_A, bMaskDWord, 0x8992e);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_APCalibrate_8188E() offset 0xc %x\n", PHY_QueryRFReg(adapt, path, RF_IPA_A, bMaskDWord)));
|
||||
ODM_SetRFReg(dm_odm, path, RF_AC, bMaskDWord, APK_RF_value_0[path][index]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_APCalibrate_8188E() offset 0x0 %x\n", PHY_QueryRFReg(adapt, path, RF_AC, bMaskDWord)));
|
||||
ODM_SetRFReg(dm_odm, path, RF_TXBIAS_A, bMaskDWord, tmpreg);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_APCalibrate_8188E() offset 0xd %x\n", PHY_QueryRFReg(adapt, path, RF_TXBIAS_A, bMaskDWord)));
|
||||
/* PA11+PAD01111, one shot */
|
||||
i = 0;
|
||||
do {
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x80000000);
|
||||
ODM_SetBBReg(dm_odm, APK_offset[path], bMaskDWord, APK_value[0]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_APCalibrate_8188E() offset 0x%x value 0x%x\n", APK_offset[path], ODM_GetBBReg(dm_odm, APK_offset[path], bMaskDWord)));
|
||||
ODM_delay_ms(3);
|
||||
ODM_SetBBReg(dm_odm, APK_offset[path], bMaskDWord, APK_value[1]);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_APCalibrate_8188E() offset 0x%x value 0x%x\n", APK_offset[path], ODM_GetBBReg(dm_odm, APK_offset[path], bMaskDWord)));
|
||||
|
||||
ODM_delay_ms(20);
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x00000000);
|
||||
|
||||
if (path == RF_PATH_A)
|
||||
tmpreg = ODM_GetBBReg(dm_odm, rAPK, 0x03E00000);
|
||||
else
|
||||
tmpreg = ODM_GetBBReg(dm_odm, rAPK, 0xF8000000);
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_APCalibrate_8188E() offset 0xbd8[25:21] %x\n", tmpreg));
|
||||
|
||||
i++;
|
||||
} while (tmpreg > apkbound && i < 4);
|
||||
|
||||
APK_result[path][index] = tmpreg;
|
||||
}
|
||||
}
|
||||
|
||||
/* reload MAC default value */
|
||||
_PHY_ReloadMACRegisters(adapt, MAC_REG, MAC_backup);
|
||||
|
||||
/* reload BB default value */
|
||||
for (index = 0; index < APK_BB_REG_NUM; index++) {
|
||||
if (index == 0) /* skip */
|
||||
continue;
|
||||
ODM_SetBBReg(dm_odm, BB_REG[index], bMaskDWord, BB_backup[index]);
|
||||
}
|
||||
|
||||
/* reload AFE default value */
|
||||
reload_adda_reg(adapt, AFE_REG, AFE_backup, IQK_ADDA_REG_NUM);
|
||||
|
||||
/* reload RF path default value */
|
||||
for (path = 0; path < pathbound; path++) {
|
||||
ODM_SetRFReg(dm_odm, path, 0xd, bMaskDWord, regD[path]);
|
||||
if (path == RF_PATH_B) {
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_MODE1, bMaskDWord, 0x1000f);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_MODE2, bMaskDWord, 0x20101);
|
||||
}
|
||||
|
||||
/* note no index == 0 */
|
||||
if (APK_result[path][1] > 6)
|
||||
APK_result[path][1] = 6;
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("apk path %d result %d 0x%x \t", path, 1, APK_result[path][1]));
|
||||
}
|
||||
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("\n"));
|
||||
|
||||
for (path = 0; path < pathbound; path++) {
|
||||
ODM_SetRFReg(dm_odm, path, 0x3, bMaskDWord,
|
||||
((APK_result[path][1] << 15) | (APK_result[path][1] << 10) | (APK_result[path][1] << 5) | APK_result[path][1]));
|
||||
if (path == RF_PATH_A)
|
||||
ODM_SetRFReg(dm_odm, path, 0x4, bMaskDWord,
|
||||
((APK_result[path][1] << 15) | (APK_result[path][1] << 10) | (0x00 << 5) | 0x05));
|
||||
else
|
||||
ODM_SetRFReg(dm_odm, path, 0x4, bMaskDWord,
|
||||
((APK_result[path][1] << 15) | (APK_result[path][1] << 10) | (0x02 << 5) | 0x05));
|
||||
ODM_SetRFReg(dm_odm, path, RF_BS_PA_APSET_G9_G11, bMaskDWord,
|
||||
((0x08 << 15) | (0x08 << 10) | (0x08 << 5) | 0x08));
|
||||
}
|
||||
|
||||
dm_odm->RFCalibrateInfo.bAPKdone = true;
|
||||
|
||||
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("<==phy_APCalibrate_8188E()\n"));
|
||||
}
|
||||
|
||||
#define DP_BB_REG_NUM 7
|
||||
#define DP_RF_REG_NUM 1
|
||||
#define DP_RETRY_LIMIT 10
|
||||
#define DP_PATH_NUM 2
|
||||
#define DP_DPK_NUM 3
|
||||
#define DP_DPK_VALUE_NUM 2
|
||||
|
||||
void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
|
@ -1697,7 +1296,7 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery)
|
|||
bool is2t;
|
||||
|
||||
is2t = (dm_odm->RFType == ODM_2T2R) ? true : false;
|
||||
if (ODM_CheckPowerStatus(adapt) == false)
|
||||
if (!ODM_CheckPowerStatus(adapt))
|
||||
return;
|
||||
|
||||
if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION))
|
||||
|
@ -1867,28 +1466,6 @@ void PHY_LCCalibrate_8188E(struct adapter *adapt)
|
|||
("LCK:Finish!!!interface %d\n", dm_odm->InterfaceIndex));
|
||||
}
|
||||
|
||||
void PHY_APCalibrate_8188E(struct adapter *adapt, s8 delta)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
return;
|
||||
if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION))
|
||||
return;
|
||||
|
||||
#if FOR_BRAZIL_PRETEST != 1
|
||||
if (dm_odm->RFCalibrateInfo.bAPKdone)
|
||||
#endif
|
||||
return;
|
||||
|
||||
if (dm_odm->RFType == ODM_2T2R) {
|
||||
phy_APCalibrate_8188E(adapt, delta, true);
|
||||
} else {
|
||||
/* For 88C 1T1R */
|
||||
phy_APCalibrate_8188E(adapt, delta, false);
|
||||
}
|
||||
}
|
||||
|
||||
static void phy_setrfpathswitch_8188e(struct adapter *adapt, bool main, bool is2t)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
|
|
|
@ -85,7 +85,7 @@ u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
|
|||
value &= ~(GET_PWR_CFG_MASK(pwrcfgcmd));
|
||||
value |= (GET_PWR_CFG_VALUE(pwrcfgcmd) & GET_PWR_CFG_MASK(pwrcfgcmd));
|
||||
|
||||
/* Write the value back to sytem register */
|
||||
/* Write the value back to system register */
|
||||
rtw_write8(padapter, offset, value);
|
||||
break;
|
||||
case PWR_CMD_POLLING:
|
||||
|
|
|
@ -484,7 +484,7 @@ static void ConstructProbeRsp(struct adapter *adapt, u8 *pframe, u32 *pLength, u
|
|||
*pLength = pktlen;
|
||||
}
|
||||
|
||||
/* To check if reserved page content is destroyed by beacon beacuse beacon is too large. */
|
||||
/* To check if reserved page content is destroyed by beacon because beacon is too large. */
|
||||
/* 2010.06.23. Added by tynli. */
|
||||
void CheckFwRsvdPageContent(struct adapter *Adapter)
|
||||
{
|
||||
|
@ -496,9 +496,9 @@ void CheckFwRsvdPageContent(struct adapter *Adapter)
|
|||
/* (1)Beacon, (2)Ps-poll, (3)Null data, (4)ProbeRsp. */
|
||||
/* Input: */
|
||||
/* bDLFinished - false: At the first time we will send all the packets as a large packet to Hw, */
|
||||
/* so we need to set the packet length to total lengh. */
|
||||
/* so we need to set the packet length to total length. */
|
||||
/* true: At the second time, we should send the first packet (default:beacon) */
|
||||
/* to Hw again and set the lengh in descriptor to the real beacon lengh. */
|
||||
/* to Hw again and set the length in descriptor to the real beacon length. */
|
||||
/* 2009.10.15 by tynli. */
|
||||
static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
|
||||
{
|
||||
|
@ -671,7 +671,7 @@ _func_enter_;
|
|||
DBG_88E("%s: 1 Download RSVD success! DLBcnCount:%u, poll:%u\n", __func__, DLBcnCount, poll);
|
||||
/* */
|
||||
/* We just can send the reserved page twice during the time that Tx thread is stopped (e.g. pnpsetpower) */
|
||||
/* becuase we need to free the Tx BCN Desc which is used by the first reserved page packet. */
|
||||
/* because we need to free the Tx BCN Desc which is used by the first reserved page packet. */
|
||||
/* At run time, we cannot get the Tx Desc until it is released in TxHandleInterrupt() so we will return */
|
||||
/* the beacon TCB in the following code. 2011.11.23. by tynli. */
|
||||
/* */
|
||||
|
|
|
@ -1489,7 +1489,6 @@ static bool hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u8 efuse
|
|||
|
||||
static bool hal_EfusePgPacketWriteData(struct adapter *pAdapter, u8 efuseType, u16 *pAddr, struct pgpkt *pTargetPkt, bool bPseudoTest)
|
||||
{
|
||||
bool bRet = false;
|
||||
u16 efuse_addr = *pAddr;
|
||||
u8 badworden = 0;
|
||||
u32 PgWriteSuccess = 0;
|
||||
|
@ -1507,7 +1506,6 @@ static bool hal_EfusePgPacketWriteData(struct adapter *pAdapter, u8 efuseType, u
|
|||
else
|
||||
return true;
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -1663,7 +1661,7 @@ hal_EfusePgCheckAvailableAddr(
|
|||
{
|
||||
u16 efuse_max_available_len = 0;
|
||||
|
||||
/* Change to check TYPE_EFUSE_MAP_LEN , beacuse 8188E raw 256, logic map over 256. */
|
||||
/* Change to check TYPE_EFUSE_MAP_LEN , because 8188E raw 256, logic map over 256. */
|
||||
EFUSE_GetEfuseDefinition(pAdapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (void *)&efuse_max_available_len, false);
|
||||
|
||||
if (Efuse_GetCurrentSize(pAdapter, efuseType, bPseudoTest) >= efuse_max_available_len)
|
||||
|
@ -2110,7 +2108,7 @@ static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
|
|||
if (chnl <= 14) {
|
||||
bIn24G = true;
|
||||
|
||||
if (chnl < 3) /* Chanel 1-2 */
|
||||
if (chnl < 3) /* Channel 1-2 */
|
||||
*pGroup = 0;
|
||||
else if (chnl < 6) /* Channel 3-5 */
|
||||
*pGroup = 1;
|
||||
|
@ -2192,7 +2190,7 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
|
|||
pHalData->bTXPowerDataReadFromEEPORM = true;
|
||||
|
||||
for (rfPath = 0; rfPath < pHalData->NumTotalRFPath; rfPath++) {
|
||||
for (ch = 0; ch <= CHANNEL_MAX_NUMBER; ch++) {
|
||||
for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
|
||||
bIn24G = Hal_GetChnlGroup88E(ch, &group);
|
||||
if (bIn24G) {
|
||||
pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
|
||||
|
|
|
@ -559,7 +559,7 @@ static int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
|
|||
|
||||
/* */
|
||||
/* 1. Read PHY_REG.TXT BB INIT!! */
|
||||
/* We will seperate as 88C / 92C according to chip version */
|
||||
/* We will separate as 88C / 92C according to chip version */
|
||||
/* */
|
||||
if (HAL_STATUS_FAILURE == ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG))
|
||||
rtStatus = _FAIL;
|
||||
|
@ -685,7 +685,7 @@ static u8 phy_DbmToTxPwrIdx(struct adapter *Adapter, enum wireless_mode Wireless
|
|||
|
||||
/* */
|
||||
/* Tested by MP, we found that CCK Index 0 equals to 8dbm, OFDM legacy equals to */
|
||||
/* 3dbm, and OFDM HT equals to 0dbm repectively. */
|
||||
/* 3dbm, and OFDM HT equals to 0dbm respectively. */
|
||||
/* Note: */
|
||||
/* The mapping may be different by different NICs. Do not use this formula for what needs accurate result. */
|
||||
/* By Bruce, 2008-01-29. */
|
||||
|
@ -1006,12 +1006,12 @@ _PHY_SetBWMode92C(
|
|||
switch (pHalData->CurrentChannelBW) {
|
||||
case HT_CHANNEL_WIDTH_20:
|
||||
regBwOpMode |= BW_OPMODE_20MHZ;
|
||||
/* 2007/02/07 Mark by Emily becasue we have not verify whether this register works */
|
||||
/* 2007/02/07 Mark by Emily because we have not verify whether this register works */
|
||||
rtw_write8(Adapter, REG_BWOPMODE, regBwOpMode);
|
||||
break;
|
||||
case HT_CHANNEL_WIDTH_40:
|
||||
regBwOpMode &= ~BW_OPMODE_20MHZ;
|
||||
/* 2007/02/07 Mark by Emily becasue we have not verify whether this register works */
|
||||
/* 2007/02/07 Mark by Emily because we have not verify whether this register works */
|
||||
rtw_write8(Adapter, REG_BWOPMODE, regBwOpMode);
|
||||
regRRSR_RSC = (regRRSR_RSC&0x90) | (pHalData->nCur40MhzPrimeSC<<5);
|
||||
rtw_write8(Adapter, REG_RRSR+2, regRRSR_RSC);
|
||||
|
|
|
@ -181,7 +181,7 @@ i * Currently, we cannot fully disable driver dynamic
|
|||
* tx power mechanism because it is referenced by BT
|
||||
* coexist mechanism.
|
||||
* In the future, two mechanism shall be separated from
|
||||
* each other and maintained independantly. */
|
||||
* each other and maintained independently. */
|
||||
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1) {
|
||||
TxAGC[RF_PATH_A] = 0x10101010;
|
||||
TxAGC[RF_PATH_B] = 0x10101010;
|
||||
|
@ -216,11 +216,11 @@ i * Currently, we cannot fully disable driver dynamic
|
|||
ODM_TxPwrTrackAdjust88E(&pHalData->odmpriv, 1, &direction, &pwrtrac_value);
|
||||
|
||||
if (direction == 1) {
|
||||
/* Increase TX pwoer */
|
||||
/* Increase TX power */
|
||||
TxAGC[0] += pwrtrac_value;
|
||||
TxAGC[1] += pwrtrac_value;
|
||||
} else if (direction == 2) {
|
||||
/* Decrease TX pwoer */
|
||||
/* Decrease TX power */
|
||||
TxAGC[0] -= pwrtrac_value;
|
||||
TxAGC[1] -= pwrtrac_value;
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ static void get_rx_power_val_by_reg(struct adapter *Adapter, u8 Channel,
|
|||
if (pHalData->pwrGroupCnt == 1)
|
||||
chnlGroup = 0;
|
||||
if (pHalData->pwrGroupCnt >= pHalData->PGMaxGroup) {
|
||||
if (Channel < 3) /* Chanel 1-2 */
|
||||
if (Channel < 3) /* Channel 1-2 */
|
||||
chnlGroup = 0;
|
||||
else if (Channel < 6) /* Channel 3-5 */
|
||||
chnlGroup = 1;
|
||||
|
@ -349,7 +349,7 @@ static void get_rx_power_val_by_reg(struct adapter *Adapter, u8 Channel,
|
|||
}
|
||||
/* 20100427 Joseph: Driver dynamic Tx power shall not affect Tx power. It shall be determined by power training mechanism. */
|
||||
/* Currently, we cannot fully disable driver dynamic tx power mechanism because it is referenced by BT coexist mechanism. */
|
||||
/* In the future, two mechanism shall be separated from each other and maintained independantly. Thanks for Lanhsin's reminder. */
|
||||
/* In the future, two mechanism shall be separated from each other and maintained independently. Thanks for Lanhsin's reminder. */
|
||||
/* 92d do not need this */
|
||||
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1)
|
||||
writeVal = 0x14141414;
|
||||
|
|
|
@ -332,7 +332,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag
|
|||
|
||||
/* 2009.11.05. tynli_test. Suggested by SD4 Filen for FW LPS. */
|
||||
/* (1) The sequence number of each non-Qos frame / broadcast / multicast / */
|
||||
/* mgnt frame should be controled by Hw because Fw will also send null data */
|
||||
/* mgnt frame should be controlled by Hw because Fw will also send null data */
|
||||
/* which we cannot control when Fw LPS enable. */
|
||||
/* --> default enable non-Qos data sequense number. 2010.06.23. by tynli. */
|
||||
/* (2) Enable HW SEQ control for beacon packet, because we use Hw beacon. */
|
||||
|
|
|
@ -464,7 +464,7 @@ static void _InitRetryFunction(struct adapter *Adapter)
|
|||
/*-----------------------------------------------------------------------------
|
||||
* Function: usb_AggSettingTxUpdate()
|
||||
*
|
||||
* Overview: Seperate TX/RX parameters update independent for TP detection and
|
||||
* Overview: Separate TX/RX parameters update independent for TP detection and
|
||||
* dynamic TX/RX aggreagtion parameters update.
|
||||
*
|
||||
* Input: struct adapter *
|
||||
|
@ -473,7 +473,7 @@ static void _InitRetryFunction(struct adapter *Adapter)
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 12/10/2010 MHC Seperate to smaller function.
|
||||
* 12/10/2010 MHC Separate to smaller function.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void usb_AggSettingTxUpdate(struct adapter *Adapter)
|
||||
|
@ -496,7 +496,7 @@ static void usb_AggSettingTxUpdate(struct adapter *Adapter)
|
|||
/*-----------------------------------------------------------------------------
|
||||
* Function: usb_AggSettingRxUpdate()
|
||||
*
|
||||
* Overview: Seperate TX/RX parameters update independent for TP detection and
|
||||
* Overview: Separate TX/RX parameters update independent for TP detection and
|
||||
* dynamic TX/RX aggreagtion parameters update.
|
||||
*
|
||||
* Input: struct adapter *
|
||||
|
@ -505,7 +505,7 @@ static void usb_AggSettingTxUpdate(struct adapter *Adapter)
|
|||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 12/10/2010 MHC Seperate to smaller function.
|
||||
* 12/10/2010 MHC Separate to smaller function.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
|
@ -847,7 +847,7 @@ _func_enter_;
|
|||
|
||||
/* */
|
||||
/* Init CR MACTXEN, MACRXEN after setting RxFF boundary REG_TRXFF_BNDY to patch */
|
||||
/* Hw bug which Hw initials RxFF boundry size to a value which is larger than the real Rx buffer size in 88E. */
|
||||
/* Hw bug which Hw initials RxFF boundary size to a value which is larger than the real Rx buffer size in 88E. */
|
||||
/* */
|
||||
/* Enable MACTXEN/MACRXEN block */
|
||||
value16 = rtw_read16(Adapter, REG_CR);
|
||||
|
|
|
@ -267,54 +267,28 @@ static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
|||
|
||||
static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
|
||||
{
|
||||
struct adapter *adapt = pintfhdl->padapter;
|
||||
struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt);
|
||||
struct usb_device *udev = dvobjpriv->pusbdev;
|
||||
u8 request = REALTEK_USB_VENQT_CMD_REQ;
|
||||
u8 reqtype = REALTEK_USB_VENQT_WRITE;
|
||||
u16 value = (u16)(addr & 0x0000ffff);
|
||||
u16 index = REALTEK_USB_VENQT_CMD_IDX;
|
||||
int pipe = usb_sndctrlpipe(udev, 0); /* write_out */
|
||||
u8 *buffer;
|
||||
u8 request;
|
||||
u8 requesttype;
|
||||
u16 wvalue;
|
||||
u16 index;
|
||||
u16 len;
|
||||
u8 buf[VENDOR_CMD_MAX_DATA_LEN] = {0};
|
||||
int ret;
|
||||
int vendorreq_times = 0;
|
||||
|
||||
buffer = kmemdup(pdata, length, GFP_ATOMIC);
|
||||
if (!buffer)
|
||||
return -ENOMEM;
|
||||
while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
|
||||
pipe = usb_sndctrlpipe(udev, 0);/* write_out */
|
||||
_func_enter_;
|
||||
|
||||
ret = rtw_usb_control_msg(udev, pipe, request, reqtype,
|
||||
value, index, buffer, length,
|
||||
RTW_USB_CONTROL_MSG_TIMEOUT);
|
||||
request = 0x05;
|
||||
requesttype = 0x00;/* write_out */
|
||||
index = 0;/* n/a */
|
||||
|
||||
if (ret == length) { /* Success this control transfer. */
|
||||
rtw_reset_continual_urb_error(dvobjpriv);
|
||||
} else { /* error cases */
|
||||
DBG_88E("reg 0x%x, usb %u write fail, status:%d value=0x%x, vendorreq_times:%d\n",
|
||||
value, length, ret, *(u32 *)pdata, vendorreq_times);
|
||||
wvalue = (u16)(addr&0x0000ffff);
|
||||
len = length;
|
||||
memcpy(buf, pdata, len);
|
||||
|
||||
if (ret < 0) {
|
||||
if (ret == (-ESHUTDOWN) || ret == -ENODEV) {
|
||||
adapt->bSurpriseRemoved = true;
|
||||
} else {
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
haldata->srestpriv.Wifi_Error_Status = USB_VEN_REQ_CMD_FAIL;
|
||||
}
|
||||
}
|
||||
if (rtw_inc_and_chk_continual_urb_error(dvobjpriv)) {
|
||||
adapt->bSurpriseRemoved = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, buf, len, requesttype);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
/* firmware download is checksumed, don't retry */
|
||||
if ((value >= FW_8188E_START_ADDRESS &&
|
||||
value <= FW_8188E_END_ADDRESS) || ret == length)
|
||||
break;
|
||||
}
|
||||
kfree(buffer);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -573,6 +547,8 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
|
|||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
|
||||
|
||||
DBG_88E("###=> usb_read_port_complete => urb status(%d)\n", purb->status);
|
||||
skb_put(precvbuf->pskb, purb->actual_length);
|
||||
precvbuf->pskb = NULL;
|
||||
|
||||
if (rtw_inc_and_chk_continual_urb_error(adapter_to_dvobj(adapt)))
|
||||
adapt->bSurpriseRemoved = true;
|
||||
|
@ -631,13 +607,18 @@ _func_enter_;
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
if (!precvbuf) {
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
|
||||
("usb_read_port:precvbuf==NULL\n"));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) {
|
||||
precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue);
|
||||
if (NULL != precvbuf->pskb)
|
||||
precvbuf->reuse = true;
|
||||
}
|
||||
|
||||
if (precvbuf != NULL) {
|
||||
rtl8188eu_init_recvbuf(adapter, precvbuf);
|
||||
|
||||
/* re-assign for linux based on skb */
|
||||
|
@ -690,11 +671,6 @@ _func_enter_;
|
|||
err, purb->status);
|
||||
ret = _FAIL;
|
||||
}
|
||||
} else {
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
|
||||
("usb_read_port:precvbuf ==NULL\n"));
|
||||
ret = _FAIL;
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
return ret;
|
||||
|
|
|
@ -75,7 +75,7 @@ enum rf_radio_path {
|
|||
|
||||
#define MAX_PG_GROUP 13
|
||||
|
||||
#define RF_PATH_MAX 2
|
||||
#define RF_PATH_MAX 3
|
||||
#define MAX_RF_PATH RF_PATH_MAX
|
||||
#define MAX_TX_COUNT 4 /* path numbers */
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/* 2. 0x800/0x900/0xA00/0xC00/0xD00/0xE00 */
|
||||
/* 3. RF register 0x00-2E */
|
||||
/* 4. Bit Mask for BB/RF register */
|
||||
/* 5. Other defintion for BB/RF R/W */
|
||||
/* 5. Other definition for BB/RF R/W */
|
||||
/* */
|
||||
|
||||
|
||||
|
|
|
@ -45,8 +45,6 @@ void PHY_IQCalibrate_8188E(struct adapter *Adapter, bool ReCovery);
|
|||
void PHY_LCCalibrate_8188E(struct adapter *pAdapter);
|
||||
|
||||
/* AP calibrate */
|
||||
void PHY_APCalibrate_8188E(struct adapter *pAdapter, s8 delta);
|
||||
|
||||
void PHY_DigitalPredistortion_8188E(struct adapter *pAdapter);
|
||||
|
||||
void _PHY_SaveADDARegisters(struct adapter *pAdapter, u32 *ADDAReg,
|
||||
|
|
|
@ -283,8 +283,6 @@ struct odm_rate_adapt {
|
|||
|
||||
/* Declare for common info */
|
||||
|
||||
#define MAX_PATH_NUM_92CS 2
|
||||
|
||||
struct odm_phy_status_info {
|
||||
u8 RxPWDBAll;
|
||||
u8 SignalQuality; /* in 0-100 index. */
|
||||
|
@ -950,7 +948,7 @@ struct odm_dm_struct {
|
|||
struct timer_list FastAntTrainingTimer;
|
||||
}; /* DM_Dynamic_Mechanism_Structure */
|
||||
|
||||
#define ODM_RF_PATH_MAX 2
|
||||
#define ODM_RF_PATH_MAX 3
|
||||
|
||||
enum ODM_RF_RADIO_PATH {
|
||||
ODM_RF_PATH_A = 0, /* Radio Path A */
|
||||
|
|
|
@ -69,7 +69,7 @@ struct phy_rx_agc_info {
|
|||
};
|
||||
|
||||
struct phy_status_rpt {
|
||||
struct phy_rx_agc_info path_agc[2];
|
||||
struct phy_rx_agc_info path_agc[3];
|
||||
u8 ch_corr[2];
|
||||
u8 cck_sig_qual_ofdm_pwdb_all;
|
||||
u8 cck_agc_rpt_ofdm_cfosho_a;
|
||||
|
@ -79,7 +79,7 @@ struct phy_status_rpt {
|
|||
u8 path_cfotail[2];
|
||||
u8 pcts_mask[2];
|
||||
s8 stream_rxevm[2];
|
||||
u8 path_rxsnr[2];
|
||||
u8 path_rxsnr[3];
|
||||
u8 noise_power_db_lsb;
|
||||
u8 rsvd_2[3];
|
||||
u8 stream_csi[2];
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
/* Define the debug levels */
|
||||
/* */
|
||||
/* 1. DBG_TRACE and DBG_LOUD are used for normal cases. */
|
||||
/* They can help SW engineer to develope or trace states changed */
|
||||
/* They can help SW engineer to develop or trace states changed */
|
||||
/* and also help HW enginner to trace every operation to and from HW, */
|
||||
/* e.g IO, Tx, Rx. */
|
||||
/* */
|
||||
|
|
|
@ -430,11 +430,6 @@ int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i);
|
|||
int ATOMIC_INC_RETURN(ATOMIC_T *v);
|
||||
int ATOMIC_DEC_RETURN(ATOMIC_T *v);
|
||||
|
||||
/* File operation APIs, just for linux now */
|
||||
int rtw_is_file_readable(char *path);
|
||||
int rtw_retrive_from_file(char *path, u8 __user *buf, u32 sz);
|
||||
int rtw_store_to_file(char *path, u8 __user *buf, u32 sz);
|
||||
|
||||
struct rtw_netdev_priv_indicator {
|
||||
void *priv;
|
||||
u32 sizeof_priv;
|
||||
|
|
|
@ -745,7 +745,7 @@ struct TDLSoption_param
|
|||
|
||||
Result:
|
||||
0x00: success
|
||||
0x01: sucess, and check Response.
|
||||
0x01: success, and check Response.
|
||||
0x02: cmd ignored due to duplicated sequcne number
|
||||
0x03: cmd dropped due to invalid cmd code
|
||||
0x04: reserved.
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#define _module_rtl8712_recv_c_ BIT(30)
|
||||
#define _module_rtl8712_led_c_ BIT(31)
|
||||
|
||||
#define DRIVER_PREFIX "r8188eu: "
|
||||
#define DRIVER_PREFIX "R8188EU: "
|
||||
|
||||
extern u32 GlobalDebugLevel;
|
||||
|
||||
|
|
|
@ -163,14 +163,14 @@ enum LED_STRATEGY_871x {
|
|||
void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction);
|
||||
|
||||
struct led_priv{
|
||||
/* add for led controll */
|
||||
/* add for led control */
|
||||
struct LED_871x SwLed0;
|
||||
struct LED_871x SwLed1;
|
||||
enum LED_STRATEGY_871x LedStrategy;
|
||||
u8 bRegUseLed;
|
||||
void (*LedControlHandler)(struct adapter *padapter,
|
||||
enum LED_CTL_MODE LedAction);
|
||||
/* add for led controll */
|
||||
/* add for led control */
|
||||
};
|
||||
|
||||
#define rtw_led_control(adapt, action) \
|
||||
|
|
|
@ -53,11 +53,11 @@
|
|||
#define WIFI_SITE_MONITOR 0x00000800 /* to indicate the station is under site surveying */
|
||||
|
||||
#define WIFI_MP_STATE 0x00010000
|
||||
#define WIFI_MP_CTX_BACKGROUND 0x00020000 /* in continous tx background */
|
||||
#define WIFI_MP_CTX_ST 0x00040000 /* in continous tx with single-tone */
|
||||
#define WIFI_MP_CTX_BACKGROUND_PENDING 0x00080000 /* pending in continous tx background due to out of skb */
|
||||
#define WIFI_MP_CTX_CCK_HW 0x00100000 /* in continous tx */
|
||||
#define WIFI_MP_CTX_CCK_CS 0x00200000 /* in continous tx with carrier suppression */
|
||||
#define WIFI_MP_CTX_BACKGROUND 0x00020000 /* in continuous tx background */
|
||||
#define WIFI_MP_CTX_ST 0x00040000 /* in continuous tx with single-tone */
|
||||
#define WIFI_MP_CTX_BACKGROUND_PENDING 0x00080000 /* pending in continuous tx background due to out of skb */
|
||||
#define WIFI_MP_CTX_CCK_HW 0x00100000 /* in continuous tx */
|
||||
#define WIFI_MP_CTX_CCK_CS 0x00200000 /* in continuous tx with carrier suppression */
|
||||
#define WIFI_MP_LPBK_STATE 0x00400000
|
||||
|
||||
#define _FW_UNDER_LINKING WIFI_UNDER_LINKING
|
||||
|
@ -239,7 +239,7 @@ struct wifidirect_info {
|
|||
u8 profileindex; /* Used to point to the index of profileinfo array */
|
||||
u8 peer_operating_ch;
|
||||
u8 find_phase_state_exchange_cnt;
|
||||
/* The device password ID for group negotation */
|
||||
/* The device password ID for group negotiation */
|
||||
u16 device_password_id_for_nego;
|
||||
u8 negotiation_dialog_token;
|
||||
/* SSID information for group negotitation */
|
||||
|
|
|
@ -107,7 +107,7 @@ extern unsigned char WMM_PARA_OUI[];
|
|||
/* Note: */
|
||||
/* We just add new channel plan when the new channel plan is different
|
||||
* from any of the following channel plan. */
|
||||
/* If you just wnat to customize the acitions(scan period or join actions)
|
||||
/* If you just want to customize the actions(scan period or join actions)
|
||||
* about one of the channel plan, */
|
||||
/* customize them in struct rt_channel_info in the RT_CHANNEL_LIST. */
|
||||
enum RT_CHANNEL_DOMAIN {
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
/* 2. 0x800/0x900/0xA00/0xC00/0xD00/0xE00 */
|
||||
/* 3. RF register 0x00-2E */
|
||||
/* 4. Bit Mask for BB/RF register */
|
||||
/* 5. Other defintion for BB/RF R/W */
|
||||
/* 5. Other definition for BB/RF R/W */
|
||||
/* */
|
||||
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ struct signal_stat {
|
|||
u32 total_num; /* num of valid elements */
|
||||
u32 total_val; /* sum of valid elements */
|
||||
};
|
||||
#define MAX_PATH_NUM_92CS 2
|
||||
#define MAX_PATH_NUM_92CS 3
|
||||
struct phy_info {
|
||||
u8 RxPWDBAll;
|
||||
u8 SignalQuality; /* in 0-100 index. */
|
||||
|
|
|
@ -119,7 +119,7 @@ enum ht_channel_width {
|
|||
};
|
||||
|
||||
/* */
|
||||
/* Represent Extention Channel Offset in HT Capabilities */
|
||||
/* Represent Extension Channel Offset in HT Capabilities */
|
||||
/* This is available only in 40Mhz mode. */
|
||||
/* */
|
||||
enum ht_extchnl_offset {
|
||||
|
|
|
@ -338,7 +338,7 @@ struct sta_priv {
|
|||
*/
|
||||
struct sta_info *sta_aid[NUM_STA];
|
||||
|
||||
u16 sta_dz_bitmap;/* only support 15 stations, staion aid bitmap
|
||||
u16 sta_dz_bitmap;/* only support 15 stations, station aid bitmap
|
||||
* for sleeping sta. */
|
||||
u16 tim_bitmap; /* only support 15 stations, aid=0~15 mapping
|
||||
* bit0~bit15 */
|
||||
|
|
|
@ -610,6 +610,26 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
|
|||
#define GetOrderBit(pbuf) \
|
||||
(((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)
|
||||
|
||||
|
||||
/**
|
||||
* struct rtw_ieee80211_bar - HT Block Ack Request
|
||||
*
|
||||
* This structure refers to "HT BlockAckReq" as
|
||||
* described in 802.11n draft section 7.2.1.7.1
|
||||
*/
|
||||
struct rtw_ieee80211_bar {
|
||||
unsigned short frame_control;
|
||||
unsigned short duration;
|
||||
unsigned char ra[6];
|
||||
unsigned char ta[6];
|
||||
unsigned short control;
|
||||
unsigned short start_seq_num;
|
||||
} __packed;
|
||||
|
||||
/* 802.11 BAR control masks */
|
||||
#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000
|
||||
#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
|
||||
|
||||
/**
|
||||
* struct rtw_ieee80211_ht_cap - HT capabilities
|
||||
*
|
||||
|
@ -674,9 +694,9 @@ struct WMM_para_element {
|
|||
|
||||
struct ADDBA_request {
|
||||
unsigned char dialog_token;
|
||||
__le16 BA_para_set;
|
||||
__le16 BA_timeout_value;
|
||||
__le16 BA_starting_seqctrl;
|
||||
unsigned short BA_para_set;
|
||||
unsigned short BA_timeout_value;
|
||||
unsigned short BA_starting_seqctrl;
|
||||
} __packed;
|
||||
|
||||
enum ht_cap_ampdu_factor {
|
||||
|
@ -964,7 +984,7 @@ enum ht_cap_ampdu_factor {
|
|||
#define P2P_PROVISION_TIMEOUT 5000
|
||||
/* 3 seconds timeout for sending the prov disc request concurrent mode */
|
||||
#define P2P_CONCURRENT_PROVISION_TIME 3000
|
||||
/* 5 seconds timeout for receiving the group negotation response */
|
||||
/* 5 seconds timeout for receiving the group negotiation response */
|
||||
#define P2P_GO_NEGO_TIMEOUT 5000
|
||||
/* 3 seconds timeout for sending the negotiation request under concurrent mode */
|
||||
#define P2P_CONCURRENT_GO_NEGO_TIME 3000
|
||||
|
|
|
@ -938,7 +938,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
|
|||
memcpy(strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN);
|
||||
if (pPMK->cmd == IW_PMKSA_ADD) {
|
||||
DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n");
|
||||
if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN) == true)
|
||||
if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN))
|
||||
return ret;
|
||||
else
|
||||
ret = true;
|
||||
|
@ -1039,7 +1039,7 @@ static int rtw_wx_get_range(struct net_device *dev,
|
|||
|
||||
range->avg_qual.qual = 92; /* > 8% missed beacons is 'bad' */
|
||||
/* TODO: Find real 'good' to 'bad' threshol value for RSSI */
|
||||
range->avg_qual.level = 20 + -98;
|
||||
range->avg_qual.level = 178; /* -78 dBm */
|
||||
range->avg_qual.noise = 0;
|
||||
range->avg_qual.updated = 7; /* Updated all three */
|
||||
|
||||
|
@ -1074,7 +1074,7 @@ static int rtw_wx_get_range(struct net_device *dev,
|
|||
|
||||
/* The following code will proivde the security capability to network manager. */
|
||||
/* If the driver doesn't provide this capability to network manager, */
|
||||
/* the WPA/WPA2 routers can't be choosen in the network manager. */
|
||||
/* the WPA/WPA2 routers can't be chosen in the network manager. */
|
||||
|
||||
/*
|
||||
#define IW_SCAN_CAPA_NONE 0x00
|
||||
|
@ -1373,7 +1373,7 @@ _func_enter_;
|
|||
}
|
||||
}
|
||||
|
||||
/* it has still some scan paramater to parse, we only do this now... */
|
||||
/* it has still some scan parameter to parse, we only do this now... */
|
||||
_status = rtw_set_802_11_bssid_list_scan(padapter, ssid, RTW_SSID_SCAN_AMOUNT);
|
||||
} else {
|
||||
_status = rtw_set_802_11_bssid_list_scan(padapter, NULL, 0);
|
||||
|
@ -2626,7 +2626,7 @@ static int rtw_get_ap_info(struct net_device *dev,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN) == true) {
|
||||
if (!memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN)) {
|
||||
/* BSSID match, then check if supporting wpa/wpa2 */
|
||||
DBG_88E("BSSID:%pM\n", (bssid));
|
||||
|
||||
|
@ -2961,7 +2961,7 @@ static int rtw_p2p_get_status(struct net_device *dev,
|
|||
|
||||
/* Commented by Albert 20110520 */
|
||||
/* This function will return the config method description */
|
||||
/* This config method description will show us which config method the remote P2P device is intented to use */
|
||||
/* This config method description will show us which config method the remote P2P device is intended to use */
|
||||
/* by sending the provisioning discovery request frame. */
|
||||
|
||||
static int rtw_p2p_get_req_cm(struct net_device *dev,
|
||||
|
@ -3413,7 +3413,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
|
|||
/* +8 is for the str "InvProc =", we have to clear it at wrqu->data.pointer */
|
||||
|
||||
/* Commented by Ouden 20121226 */
|
||||
/* The application wants to know P2P initation procedure is support or not. */
|
||||
/* The application wants to know P2P initiation procedure is supported or not. */
|
||||
/* Format: iwpriv wlanx p2p_get2 InvProc = 00:E0:4C:00:00:05 */
|
||||
|
||||
DBG_88E("[%s] data = %s\n", __func__, (char *)extra);
|
||||
|
@ -4040,7 +4040,7 @@ static int rtw_rereg_nd_name(struct net_device *dev,
|
|||
if (0 != ret)
|
||||
goto exit;
|
||||
|
||||
if (!memcmp(rereg_priv->old_ifname, "disable%d", 9) == true) {
|
||||
if (!memcmp(rereg_priv->old_ifname, "disable%d", 9)) {
|
||||
padapter->ledpriv.bRegUseLed = rereg_priv->old_bRegUseLed;
|
||||
rtw_hal_sw_led_init(padapter);
|
||||
rtw_ips_mode_req(&padapter->pwrctrlpriv, rereg_priv->old_ips_mode);
|
||||
|
@ -4049,7 +4049,7 @@ static int rtw_rereg_nd_name(struct net_device *dev,
|
|||
strncpy(rereg_priv->old_ifname, new_ifname, IFNAMSIZ);
|
||||
rereg_priv->old_ifname[IFNAMSIZ-1] = 0;
|
||||
|
||||
if (!memcmp(new_ifname, "disable%d", 9) == true) {
|
||||
if (!memcmp(new_ifname, "disable%d", 9)) {
|
||||
DBG_88E("%s disable\n", __func__);
|
||||
/* free network queue for Android's timming issue */
|
||||
rtw_free_network_queue(padapter, true);
|
||||
|
@ -4884,7 +4884,6 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid)
|
|||
case _TKIP_:
|
||||
case _TKIP_WTMIC_:
|
||||
case _AES_:
|
||||
keylen = 16;
|
||||
default:
|
||||
keylen = 16;
|
||||
}
|
||||
|
@ -6146,7 +6145,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
|
|||
|
||||
for (jj = 0, kk = 0; jj < cnts; jj++, kk += 2)
|
||||
setdata[jj] = key_2char2num(tmp[2][kk], tmp[2][kk + 1]);
|
||||
/* Change to check TYPE_EFUSE_MAP_LEN, beacuse 8188E raw 256, logic map over 256. */
|
||||
/* Change to check TYPE_EFUSE_MAP_LEN, because 8188E raw 256, logic map over 256. */
|
||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (void *)&max_available_size, false);
|
||||
if ((addr+cnts) > max_available_size) {
|
||||
DBG_88E("%s: addr(0x%X)+cnts(%d) parameter error!\n", __func__, addr, cnts);
|
||||
|
@ -6221,7 +6220,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
|
|||
|
||||
for (jj = 0, kk = 0; jj < cnts; jj++, kk += 2)
|
||||
setdata[jj] = key_2char2num(tmp[1][kk], tmp[1][kk + 1]);
|
||||
/* Change to check TYPE_EFUSE_MAP_LEN, beacuse 8188E raw 256, logic map over 256. */
|
||||
/* Change to check TYPE_EFUSE_MAP_LEN, because 8188E raw 256, logic map over 256. */
|
||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (void *)&max_available_size, false);
|
||||
if ((addr+cnts) > max_available_size) {
|
||||
DBG_88E("%s: addr(0x%X)+cnts(%d) parameter error!\n", __func__, addr, cnts);
|
||||
|
|
|
@ -35,7 +35,6 @@ MODULE_LICENSE("GPL");
|
|||
MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
|
||||
MODULE_AUTHOR("Realtek Semiconductor Corp.");
|
||||
MODULE_VERSION(DRIVERVERSION);
|
||||
MODULE_FIRMWARE("rtlwifi/rtl8188eufw.bin");
|
||||
|
||||
#define CONFIG_BR_EXT_BRNAME "br0"
|
||||
#define RTW_NOTCH_FILTER 0 /* 0:Disable, 1:Enable, */
|
||||
|
@ -86,7 +85,7 @@ static int rtw_uapsd_acvi_en;
|
|||
static int rtw_uapsd_acvo_en;
|
||||
|
||||
int rtw_ht_enable = 1;
|
||||
int rtw_cbw40_enable = 3; /* 0 :diable, bit(0): enable 2.4g, bit(1): enable 5g */
|
||||
int rtw_cbw40_enable = 3; /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */
|
||||
int rtw_ampdu_enable = 1;/* for enable tx_ampdu */
|
||||
static int rtw_rx_stbc = 1;/* 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */
|
||||
static int rtw_ampdu_amsdu;/* 0: disabled, 1:enabled, 2:auto */
|
||||
|
@ -1065,7 +1064,7 @@ int _netdev_open(struct net_device *pnetdev)
|
|||
goto netdev_open_error;
|
||||
}
|
||||
|
||||
pr_info("%sMAC Address = %pM\n", DRIVER_PREFIX, pnetdev->dev_addr);
|
||||
pr_info("MAC Address = %pM\n", pnetdev->dev_addr);
|
||||
|
||||
status = rtw_start_drv_threads(padapter);
|
||||
if (status == _FAIL) {
|
||||
|
|
|
@ -356,214 +356,6 @@ inline int ATOMIC_DEC_RETURN(ATOMIC_T *v)
|
|||
return atomic_dec_return(v);
|
||||
}
|
||||
|
||||
/* Open a file with the specific @param path, @param flag, @param mode
|
||||
* @param fpp the pointer of struct file pointer to get struct file pointer while file opening is success
|
||||
* @param path the path of the file to open
|
||||
* @param flag file operation flags, please refer to linux document
|
||||
* @param mode please refer to linux document
|
||||
* @return Linux specific error code
|
||||
*/
|
||||
static int openfile(struct file **fpp, char *path, int flag, int mode)
|
||||
{
|
||||
struct file *fp;
|
||||
|
||||
fp = filp_open(path, flag, mode);
|
||||
if (IS_ERR(fp)) {
|
||||
*fpp = NULL;
|
||||
return PTR_ERR(fp);
|
||||
} else {
|
||||
*fpp = fp;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Close the file with the specific @param fp
|
||||
* @param fp the pointer of struct file to close
|
||||
* @return always 0
|
||||
*/
|
||||
static int closefile(struct file *fp)
|
||||
{
|
||||
filp_close(fp, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int readfile(struct file *fp, char __user *buf, int len)
|
||||
{
|
||||
int rlen = 0, sum = 0;
|
||||
|
||||
if (!fp->f_op || !fp->f_op->read)
|
||||
return -EPERM;
|
||||
|
||||
while (sum < len) {
|
||||
rlen = fp->f_op->read(fp, buf+sum, len-sum, &fp->f_pos);
|
||||
if (rlen > 0)
|
||||
sum += rlen;
|
||||
else if (0 != rlen)
|
||||
return rlen;
|
||||
else
|
||||
break;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
static int writefile(struct file *fp, char __user *buf, int len)
|
||||
{
|
||||
int wlen = 0, sum = 0;
|
||||
|
||||
if (!fp->f_op || !fp->f_op->write)
|
||||
return -EPERM;
|
||||
|
||||
while (sum < len) {
|
||||
wlen = fp->f_op->write(fp, buf+sum, len-sum, &fp->f_pos);
|
||||
if (wlen > 0)
|
||||
sum += wlen;
|
||||
else if (0 != wlen)
|
||||
return wlen;
|
||||
else
|
||||
break;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/* Test if the specifi @param path is a file and readable
|
||||
* @param path the path of the file to test
|
||||
* @return Linux specific error code
|
||||
*/
|
||||
static int isfilereadable(char *path)
|
||||
{
|
||||
struct file *fp;
|
||||
int ret = 0;
|
||||
mm_segment_t oldfs;
|
||||
char __user buf;
|
||||
|
||||
fp = filp_open(path, O_RDONLY, 0);
|
||||
if (IS_ERR(fp)) {
|
||||
ret = PTR_ERR(fp);
|
||||
} else {
|
||||
oldfs = get_fs(); set_fs(get_ds());
|
||||
|
||||
if (1 != readfile(fp, &buf, 1))
|
||||
ret = PTR_ERR(fp);
|
||||
|
||||
set_fs(oldfs);
|
||||
filp_close(fp, NULL);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Open the file with @param path and retrive the file content into
|
||||
* memory starting from @param buf for @param sz at most
|
||||
* @param path the path of the file to open and read
|
||||
* @param buf the starting address of the buffer to store file content
|
||||
* @param sz how many bytes to read at most
|
||||
* @return the byte we've read, or Linux specific error code
|
||||
*/
|
||||
static int retrievefromfile(char *path, u8 __user *buf, u32 sz)
|
||||
{
|
||||
int ret = -1;
|
||||
mm_segment_t oldfs;
|
||||
struct file *fp;
|
||||
|
||||
if (path && buf) {
|
||||
ret = openfile(&fp, path, O_RDONLY, 0);
|
||||
if (0 == ret) {
|
||||
DBG_88E("%s openfile path:%s fp =%p\n", __func__,
|
||||
path, fp);
|
||||
|
||||
oldfs = get_fs(); set_fs(get_ds());
|
||||
ret = readfile(fp, buf, sz);
|
||||
set_fs(oldfs);
|
||||
closefile(fp);
|
||||
|
||||
DBG_88E("%s readfile, ret:%d\n", __func__, ret);
|
||||
|
||||
} else {
|
||||
DBG_88E("%s openfile path:%s Fail, ret:%d\n", __func__,
|
||||
path, ret);
|
||||
}
|
||||
} else {
|
||||
DBG_88E("%s NULL pointer\n", __func__);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the file with @param path and wirte @param sz byte of data starting from @param buf into the file
|
||||
* @param path the path of the file to open and write
|
||||
* @param buf the starting address of the data to write into file
|
||||
* @param sz how many bytes to write at most
|
||||
* @return the byte we've written, or Linux specific error code
|
||||
*/
|
||||
static int storetofile(char *path, u8 __user *buf, u32 sz)
|
||||
{
|
||||
int ret = 0;
|
||||
mm_segment_t oldfs;
|
||||
struct file *fp;
|
||||
|
||||
if (path && buf) {
|
||||
ret = openfile(&fp, path, O_CREAT|O_WRONLY, 0666);
|
||||
if (0 == ret) {
|
||||
DBG_88E("%s openfile path:%s fp =%p\n", __func__, path, fp);
|
||||
|
||||
oldfs = get_fs(); set_fs(get_ds());
|
||||
ret = writefile(fp, buf, sz);
|
||||
set_fs(oldfs);
|
||||
closefile(fp);
|
||||
|
||||
DBG_88E("%s writefile, ret:%d\n", __func__, ret);
|
||||
|
||||
} else {
|
||||
DBG_88E("%s openfile path:%s Fail, ret:%d\n", __func__, path, ret);
|
||||
}
|
||||
} else {
|
||||
DBG_88E("%s NULL pointer\n", __func__);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if the specifi @param path is a file and readable
|
||||
* @param path the path of the file to test
|
||||
* @return true or false
|
||||
*/
|
||||
int rtw_is_file_readable(char *path)
|
||||
{
|
||||
if (isfilereadable(path) == 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the file with @param path and retrive the file content into memory starting from @param buf for @param sz at most
|
||||
* @param path the path of the file to open and read
|
||||
* @param buf the starting address of the buffer to store file content
|
||||
* @param sz how many bytes to read at most
|
||||
* @return the byte we've read
|
||||
*/
|
||||
int rtw_retrive_from_file(char *path, u8 __user *buf, u32 sz)
|
||||
{
|
||||
int ret = retrievefromfile(path, buf, sz);
|
||||
|
||||
return ret >= 0 ? ret : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the file with @param path and wirte @param sz byte of data
|
||||
* starting from @param buf into the file
|
||||
* @param path the path of the file to open and write
|
||||
* @param buf the starting address of the data to write into file
|
||||
* @param sz how many bytes to write at most
|
||||
* @return the byte we've written
|
||||
*/
|
||||
int rtw_store_to_file(char *path, u8 __user *buf, u32 sz)
|
||||
{
|
||||
int ret = storetofile(path, buf, sz);
|
||||
return ret >= 0 ? ret : 0;
|
||||
}
|
||||
|
||||
struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv,
|
||||
void *old_priv)
|
||||
{
|
||||
|
@ -627,13 +419,14 @@ RETURN:
|
|||
int rtw_change_ifname(struct adapter *padapter, const char *ifname)
|
||||
{
|
||||
struct net_device *pnetdev;
|
||||
struct net_device *cur_pnetdev = padapter->pnetdev;
|
||||
struct net_device *cur_pnetdev;
|
||||
struct rereg_nd_name_data *rereg_priv;
|
||||
int ret;
|
||||
|
||||
if (!padapter)
|
||||
goto error;
|
||||
|
||||
cur_pnetdev = padapter->pnetdev;
|
||||
rereg_priv = &padapter->rereg_nd_name_priv;
|
||||
|
||||
/* free the old_pnetdev */
|
||||
|
@ -794,7 +587,7 @@ void *rtw_cbuf_pop(struct rtw_cbuf *cbuf)
|
|||
}
|
||||
|
||||
/**
|
||||
* rtw_cbuf_alloc - allocte a rtw_cbuf with given size and do initialization
|
||||
* rtw_cbuf_alloc - allocate a rtw_cbuf with given size and do initialization
|
||||
* @size: size of pointer
|
||||
*
|
||||
* Returns: pointer of srtuct rtw_cbuf, NULL for allocation failure
|
||||
|
|
|
@ -77,7 +77,6 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter,
|
|||
int rtw_os_recvbuf_resource_free(struct adapter *padapter,
|
||||
struct recv_buf *precvbuf)
|
||||
{
|
||||
if (precvbuf->purb)
|
||||
usb_free_urb(precvbuf->purb);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
@ -224,7 +223,6 @@ _func_exit_;
|
|||
_recv_indicatepkt_drop:
|
||||
|
||||
/* enqueue back to free_recv_queue */
|
||||
if (precv_frame)
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
|
||||
_func_exit_;
|
||||
|
|
|
@ -737,7 +737,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
status = _SUCCESS;
|
||||
|
||||
free_hal_data:
|
||||
if (status != _SUCCESS && padapter->HalData)
|
||||
if (status != _SUCCESS)
|
||||
kfree(padapter->HalData);
|
||||
handle_dualmac:
|
||||
if (status != _SUCCESS)
|
||||
|
|
Loading…
Reference in a new issue