rtl8188eu: Backport kernel version

This driver was added to the kernel with version 3.12. The changes in that
version are now brought back to the GitHub repo. Essentually all of the code
is updated.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-10-19 12:45:47 -05:00
parent 868a407435
commit 19db43ecbd
89 changed files with 2026 additions and 5957 deletions

View file

@ -24,7 +24,7 @@
#include <wifi.h>
#include <ieee80211.h>
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
void init_mlme_ap_info(struct adapter *padapter)
{
@ -120,7 +120,7 @@ static void update_BCNTIM(struct adapter *padapter)
if (remainder_ielen > 0) {
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if (pbackup_remainder_ie && premainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
*dst_ie++ = _TIM_IE_;
@ -142,15 +142,15 @@ static void update_BCNTIM(struct adapter *padapter)
if (tim_ielen == 4) {
*dst_ie++ = *(u8 *)&tim_bitmap_le;
} else if (tim_ielen == 5) {
_rtw_memcpy(dst_ie, &tim_bitmap_le, 2);
memcpy(dst_ie, &tim_bitmap_le, 2);
dst_ie += 2;
}
/* copy remainder IE */
if (pbackup_remainder_ie) {
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
rtw_mfree(pbackup_remainder_ie, remainder_ielen);
kfree(pbackup_remainder_ie);
}
offset = (uint)(dst_ie - pie);
pnetwork_mlmeext->IELength = offset + remainder_ielen;
@ -162,10 +162,11 @@ static void update_BCNTIM(struct adapter *padapter)
void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8 index, u8 *data, u8 len)
{
struct ndis_802_11_var_ie *pIE;
u8 bmatch = false;
u8 *pie = pnetwork->IEs;
u8 *p, *dst_ie, *premainder_ie = NULL, *pbackup_remainder_ie = NULL;
u32 i, offset, ielen, ie_offset, remainder_ielen = 0;
u8 bmatch = false;
u8 *pie = pnetwork->IEs;
u8 *p = NULL, *dst_ie = NULL, *premainder_ie = NULL;
u8 *pbackup_remainder_ie = NULL;
u32 i, offset, ielen = 0, ie_offset, remainder_ielen = 0;
for (i = sizeof(struct ndis_802_11_fixed_ie); i < pnetwork->IELength;) {
pIE = (struct ndis_802_11_var_ie *)(pnetwork->IEs + i);
@ -201,20 +202,20 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8
if (remainder_ielen > 0) {
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if (pbackup_remainder_ie && premainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
*dst_ie++ = index;
*dst_ie++ = len;
_rtw_memcpy(dst_ie, data, len);
memcpy(dst_ie, data, len);
dst_ie += len;
/* copy remainder IE */
if (pbackup_remainder_ie) {
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
rtw_mfree(pbackup_remainder_ie, remainder_ielen);
kfree(pbackup_remainder_ie);
}
offset = (uint)(dst_ie - pie);
@ -223,11 +224,13 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8
void rtw_remove_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8 index)
{
u8 *p, *dst_ie, *premainder_ie = NULL, *pbackup_remainder_ie = NULL;
u8 *p, *dst_ie = NULL, *premainder_ie = NULL;
u8 *pbackup_remainder_ie = NULL;
uint offset, ielen, ie_offset, remainder_ielen = 0;
u8 *pie = pnetwork->IEs;
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, index, &ielen, pnetwork->IELength - _FIXED_IE_LENGTH_);
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, index, &ielen,
pnetwork->IELength - _FIXED_IE_LENGTH_);
if (p != NULL && ielen > 0) {
ielen += 2;
@ -243,14 +246,14 @@ void rtw_remove_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
if (remainder_ielen > 0) {
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if (pbackup_remainder_ie && premainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
/* copy remainder IE */
if (pbackup_remainder_ie) {
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
rtw_mfree(pbackup_remainder_ie, remainder_ielen);
kfree(pbackup_remainder_ie);
}
offset = (uint)(dst_ie - pie);
@ -276,7 +279,7 @@ void expire_timeout_chk(struct adapter *padapter)
{
unsigned long irqL;
struct list_head *phead, *plist;
u8 updated;
u8 updated = 0;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
u8 chk_alive_num = 0;
@ -317,7 +320,6 @@ void expire_timeout_chk(struct adapter *padapter)
psta = NULL;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
phead = &pstapriv->asoc_list;
@ -557,7 +559,7 @@ static void update_bmc_sta(struct adapter *padapter)
supportRateNum = rtw_get_rateset_len((u8 *)&pcur_network->SupportedRates);
network_type = rtw_check_network_type((u8 *)&pcur_network->SupportedRates, supportRateNum, 1);
_rtw_memcpy(psta->bssrateset, &pcur_network->SupportedRates, supportRateNum);
memcpy(psta->bssrateset, &pcur_network->SupportedRates, supportRateNum);
psta->bssratelen = supportRateNum;
/* b/g mode ra_bitmap */
@ -727,9 +729,9 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wlan_bssid_ex *pnetwork_mlmeext = &(pmlmeinfo->network);
struct HT_info_element *pht_info = NULL;
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
bcn_interval = (u16)pnetwork->Configuration.BeaconPeriod;
cur_channel = pnetwork->Configuration.DSConfig;
@ -829,12 +831,12 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
update_capinfo(padapter, rtw_get_capability((struct wlan_bssid_ex *)pnetwork));
/* let pnetwork_mlmeext == pnetwork_mlme. */
_rtw_memcpy(pnetwork_mlmeext, pnetwork, pnetwork->Length);
memcpy(pnetwork_mlmeext, pnetwork, pnetwork->Length);
#ifdef CONFIG_P2P
_rtw_memcpy(pwdinfo->p2p_group_ssid, pnetwork->Ssid.Ssid, pnetwork->Ssid.SsidLength);
#ifdef CONFIG_88EU_P2P
memcpy(pwdinfo->p2p_group_ssid, pnetwork->Ssid.Ssid, pnetwork->Ssid.SsidLength);
pwdinfo->p2p_group_ssid_len = pnetwork->Ssid.SsidLength;
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
if (pmlmeext->bstart_bss) {
update_beacon(padapter, _TIM_IE_, NULL, false);
@ -868,7 +870,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
struct wlan_bssid_ex *pbss_network = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network;
u8 *ie = pbss_network->IEs;
/* SSID */
/* Supported rates */
/* DS Params */
@ -893,7 +894,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
_rtw_memset(ie, 0, MAX_IE_SZ);
_rtw_memcpy(ie, pbuf, pbss_network->IELength);
memcpy(ie, pbuf, pbss_network->IELength);
if (pbss_network->InfrastructureMode != Ndis802_11APMode)
@ -901,7 +902,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
pbss_network->Rssi = 0;
_rtw_memcpy(pbss_network->MacAddress, myid(&(padapter->eeprompriv)), ETH_ALEN);
memcpy(pbss_network->MacAddress, myid(&(padapter->eeprompriv)), ETH_ALEN);
/* beacon interval */
p = rtw_get_beacon_interval_from_ie(ie);/* 8: TimeStamp, 2: Beacon Interval 2:Capability */
@ -914,7 +915,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0) {
_rtw_memset(&pbss_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
_rtw_memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len);
memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len);
pbss_network->Ssid.SsidLength = ie_len;
}
@ -931,14 +932,14 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
/* get supported rates */
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p != NULL) {
_rtw_memcpy(supportRate, p+2, ie_len);
memcpy(supportRate, p+2, ie_len);
supportRateNum = ie_len;
}
/* get ext_supported rates */
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_);
if (p != NULL) {
_rtw_memcpy(supportRate+supportRateNum, p+2, ie_len);
memcpy(supportRate+supportRateNum, p+2, ie_len);
supportRateNum += ie_len;
}
@ -1053,7 +1054,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
pht_cap->supp_mcs_set[0] = 0xff;
pht_cap->supp_mcs_set[1] = 0x0;
}
_rtw_memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len);
memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len);
}
/* parsing HT_INFO_IE */
@ -1114,9 +1115,6 @@ 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;
}
@ -1178,7 +1176,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
if (!paclnode->valid) {
_rtw_init_listhead(&paclnode->list);
_rtw_memcpy(paclnode->addr, addr, ETH_ALEN);
memcpy(paclnode->addr, addr, ETH_ALEN);
paclnode->valid = true;
@ -1327,7 +1325,7 @@ static void update_bcn_wps_ie(struct adapter *padapter)
if (remainder_ielen > 0) {
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if (pbackup_remainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
pwps_ie_src = pmlmepriv->wps_beacon_ie;
@ -1336,18 +1334,18 @@ static void update_bcn_wps_ie(struct adapter *padapter)
wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */
if ((wps_offset+wps_ielen+2+remainder_ielen) <= MAX_IE_SZ) {
_rtw_memcpy(pwps_ie, pwps_ie_src, wps_ielen+2);
memcpy(pwps_ie, pwps_ie_src, wps_ielen+2);
pwps_ie += (wps_ielen+2);
if (pbackup_remainder_ie)
_rtw_memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
/* update IELength */
pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen;
}
if (pbackup_remainder_ie)
rtw_mfree(pbackup_remainder_ie, remainder_ielen);
kfree(pbackup_remainder_ie);
}
static void update_bcn_p2p_ie(struct adapter *padapter)
@ -1987,4 +1985,4 @@ void stop_ap_mode(struct adapter *padapter)
rtw_free_mlme_priv_ie_data(pmlmepriv);
}
#endif /* CONFIG_AP_MODE */
#endif /* CONFIG_88EU_AP_MODE */

View file

@ -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 = tag->tag_len + TAG_HDR_LEN;
data_len = be16_to_cpu(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,44 +155,53 @@ static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr
static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
__be32 *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, (unsigned char *)ipxNetAddr, 4);
memcpy(networkAddr+1, &cpu_netaddr, 4);
memcpy(networkAddr+5, ipxNodeAddr, 6);
}
static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
unsigned int *ipxNetAddr, unsigned short *ipxSocketAddr)
__be32 *ipxNetAddr, __be16 *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, (unsigned char *)ipxNetAddr, 4);
memcpy(networkAddr+5, (unsigned char *)ipxSocketAddr, 2);
memcpy(networkAddr+1, &cpu_netaddr, 4);
memcpy(networkAddr+5, &cpu_sockaddr, 2);
}
static inline void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
unsigned short *network, unsigned char *node)
__be16 *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, (unsigned char *)network, 2);
memcpy(networkAddr+1, &cpu_net, 2);
networkAddr[3] = *node;
}
static inline void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
unsigned char *ac_mac, unsigned short *sid)
unsigned char *ac_mac, __be16 *sid)
{
u16 cpu_sid = be16_to_cpu(*sid);
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
networkAddr[0] = NAT25_PPPOE;
memcpy(networkAddr+1, (unsigned char *)sid, 2);
memcpy(networkAddr+1, &cpu_sid, 2);
memcpy(networkAddr+3, (unsigned char *)ac_mac, 6);
}
@ -281,17 +290,6 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
return 0;
}
static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
{
struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);
unsigned char *dst_mac = skb->data;
/*modified by qinjunjie, ipv6 multicast address ix 0x33-33-xx-xx-xx-xx*/
dst_mac[0] = 0x33;
dst_mac[1] = 0x33;
memcpy(&dst_mac[2], &iph->daddr.s6_addr32[3], 4);
}
static inline int __nat25_network_hash(unsigned char *networkAddr)
{
if (networkAddr[0] == NAT25_IPV4) {
@ -471,7 +469,7 @@ void nat25_db_cleanup(struct adapter *priv)
priv->scdb_entry = NULL;
}
__network_hash_unlink(f);
rtw_mfree((u8 *) f, sizeof(struct nat25_network_db_entry));
kfree(f);
f = g;
}
}
@ -500,7 +498,7 @@ void nat25_db_expire(struct adapter *priv)
priv->scdb_entry = NULL;
}
__network_hash_unlink(f);
rtw_mfree((u8 *) f, sizeof(struct nat25_network_db_entry));
kfree(f);
}
}
f = g;
@ -690,6 +688,7 @@ 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,
@ -822,7 +821,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);
unsigned short *pMagic;
__be16 *pMagic;
switch (method) {
case NAT25_CHECK:
@ -860,7 +859,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 = (unsigned short *)tag->tag_data;
pMagic = (__be16 *)tag->tag_data;
*pMagic = htons(MAGIC_CODE);
memcpy(tag->tag_data+MAGIC_CODE_LEN, skb->data+ETH_ALEN, ETH_ALEN);
@ -923,8 +922,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
return -1;
}
pMagic = (unsigned short *)tag->tag_data;
if (ntohs(*pMagic) != MAGIC_CODE) {
pMagic = (__be16 *)tag->tag_data;
if (be16_to_cpu(*pMagic) != MAGIC_CODE) {
DEBUG_ERR("Can't find MAGIC_CODE in %s packet!\n",
(ph->code == PADO_CODE ? "PADO" : "PADS"));
return -1;
@ -1029,11 +1028,12 @@ 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,
iph->payload_len,
len,
IPPROTO_ICMPV6,
csum_partial((__u8 *)hdr, iph->payload_len, 0));
csum_partial((__u8 *)hdr, len, 0));
}
}
}
@ -1128,7 +1128,7 @@ struct dhcpMessage {
u_int8_t hops;
u_int32_t xid;
u_int16_t secs;
u_int16_t flags;
__be16 flags;
u_int32_t ciaddr;
u_int32_t yiaddr;
u_int32_t siaddr;
@ -1136,7 +1136,7 @@ struct dhcpMessage {
u_int8_t chaddr[16];
u_int8_t sname[64];
u_int8_t file[128];
u_int32_t cookie;
__be32 cookie;
u_int8_t options[308]; /* 312 - cookie */
};
@ -1163,17 +1163,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 = 0;
register int sum;
DEBUG_INFO("DHCP: change flag of DHCP request to broadcast.\n");
/* or BROADCAST flag */
dhcph->flags |= htons(BROADCAST_FLAG);
/* recalculate checksum */
sum = ~(udph->check) & 0xffff;
sum = (__force int)(~(udph->check)) & 0xffff;
sum += be16_to_cpu(dhcph->flags);
while (sum >> 16)
sum = (sum & 0xffff) + (sum >> 16);
udph->check = ~sum;
udph->check = (__force __sum16)~sum;
}
}
}

View file

@ -27,10 +27,6 @@
#include <rtw_br_ext.h>
#include <rtw_mlme_ext.h>
#ifdef CONFIG_BT_COEXIST
#include <rtl8723a_hal.h>
#endif /* CONFIG_BT_COEXIST */
/*
Caller and the rtw_cmd_thread can protect cmd_q by spin_lock.
No irqsave is necessary.
@ -100,11 +96,11 @@ _func_exit_;
return res;
}
void _rtw_free_evt_priv(struct evt_priv *pevtpriv)
void rtw_free_evt_priv(struct evt_priv *pevtpriv)
{
_func_enter_;
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+_rtw_free_evt_priv\n"));
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+rtw_free_evt_priv\n"));
_cancel_workitem_sync(&pevtpriv->c2h_wk);
while (pevtpriv->c2h_wk_alive)
@ -113,9 +109,9 @@ _func_enter_;
while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
if (c2h != NULL && c2h != (void *)pevtpriv)
rtw_mfree(c2h, 16);
kfree(c2h);
}
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("-_rtw_free_evt_priv\n"));
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("-rtw_free_evt_priv\n"));
_func_exit_;
}
@ -127,14 +123,13 @@ _func_enter_;
if (pcmdpriv) {
_rtw_spinlock_free(&(pcmdpriv->cmd_queue.lock));
_rtw_free_sema(&(pcmdpriv->cmd_queue_sema));
/* _rtw_free_sema(&(pcmdpriv->cmd_done_sema)); */
_rtw_free_sema(&(pcmdpriv->terminate_cmdthread_sema));
if (pcmdpriv->cmd_allocated_buf)
rtw_mfree(pcmdpriv->cmd_allocated_buf, MAX_CMDSZ + CMDBUFF_ALIGN_SZ);
kfree(pcmdpriv->cmd_allocated_buf);
if (pcmdpriv->rsp_allocated_buf)
rtw_mfree(pcmdpriv->rsp_allocated_buf, MAX_RSPSZ + 4);
kfree(pcmdpriv->rsp_allocated_buf);
}
_func_exit_;
}
@ -215,15 +210,7 @@ _func_exit_;
return res;
}
void rtw_free_evt_priv (struct evt_priv *pevtpriv)
{
_func_enter_;
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("rtw_free_evt_priv\n"));
_rtw_free_evt_priv(pevtpriv);
_func_exit_;
}
void rtw_free_cmd_priv (struct cmd_priv *pcmdpriv)
void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
{
_func_enter_;
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("rtw_free_cmd_priv\n"));
@ -231,8 +218,7 @@ _func_enter_;
_func_exit_;
}
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj);
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
{
u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
@ -311,18 +297,18 @@ _func_enter_;
if ((pcmd->cmdcode != _JoinBss_CMD_) && (pcmd->cmdcode != _CreateBss_CMD_)) {
/* free parmbuf in cmd_obj */
rtw_mfree((unsigned char *)pcmd->parmbuf, pcmd->cmdsz);
kfree(pcmd->parmbuf);
}
if (pcmd->rsp != NULL) {
if (pcmd->rspsz != 0) {
/* free rsp in cmd_obj */
rtw_mfree((unsigned char *)pcmd->rsp, pcmd->rspsz);
kfree(pcmd->rsp);
}
}
/* free cmd_obj */
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
kfree(pcmd);
_func_exit_;
}
@ -379,9 +365,9 @@ _next:
pcmd->cmdsz = _RND4((pcmd->cmdsz));/* _RND4 */
_rtw_memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
if (pcmd->cmdcode < (sizeof(wlancmds) / sizeof(struct cmd_hdl))) {
if (pcmd->cmdcode < ARRAY_SIZE(wlancmds)) {
cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
if (cmd_hdl) {
@ -399,7 +385,7 @@ _next:
post_process:
/* call callback function for post-processed */
if (pcmd->cmdcode < (sizeof(rtw_cmd_callback) / sizeof(struct _cmd_callback))) {
if (pcmd->cmdcode < ARRAY_SIZE(rtw_cmd_callback)) {
pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
if (pcmd_callback == NULL) {
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("mlme_cmd_hdl(): pcmd_callback = 0x%p, cmdcode = 0x%x\n", pcmd_callback, pcmd->cmdcode));
@ -455,7 +441,7 @@ _func_enter_;
psetusbsuspend = (struct usb_suspend_parm *)rtw_zmalloc(sizeof(struct usb_suspend_parm));
if (psetusbsuspend == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
ret = _FAIL;
goto exit;
}
@ -488,7 +474,6 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_func_enter_;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1);
}
@ -503,7 +488,7 @@ _func_enter_;
psurveyPara = (struct sitesurvey_parm *)rtw_zmalloc(sizeof(struct sitesurvey_parm));
if (psurveyPara == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
return _FAIL;
}
@ -521,7 +506,7 @@ _func_enter_;
int i;
for (i = 0; i < ssid_num && i < RTW_SSID_SCAN_AMOUNT; i++) {
if (ssid[i].SsidLength) {
_rtw_memcpy(&psurveyPara->ssid[i], &ssid[i], sizeof(struct ndis_802_11_ssid));
memcpy(&psurveyPara->ssid[i], &ssid[i], sizeof(struct ndis_802_11_ssid));
psurveyPara->ssid_num++;
if (0)
DBG_88E(FUNC_ADPT_FMT" ssid:(%s, %d)\n", FUNC_ADPT_ARG(padapter),
@ -535,7 +520,7 @@ _func_enter_;
int i;
for (i = 0; i < ch_num && i < RTW_CHANNEL_SCAN_AMOUNT; i++) {
if (ch[i].hw_value && !(ch[i].flags & RTW_IEEE80211_CHAN_DISABLED)) {
_rtw_memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
psurveyPara->ch_num++;
if (0)
DBG_88E(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter),
@ -582,14 +567,14 @@ _func_enter_;
pbsetdataratepara = (struct setdatarate_parm *)rtw_zmalloc(sizeof(struct setdatarate_parm));
if (pbsetdataratepara == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate));
pbsetdataratepara->mac_id = 5;
_rtw_memcpy(pbsetdataratepara->datarates, rateset, NumRates);
memcpy(pbsetdataratepara->datarates, rateset, NumRates);
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit:
@ -615,14 +600,14 @@ _func_enter_;
pssetbasicratepara = (struct setbasicrate_parm *)rtw_zmalloc(sizeof(struct setbasicrate_parm));
if (pssetbasicratepara == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
init_h2fwcmd_w_parm_no_rsp(ph2c, pssetbasicratepara, _SetBasicRate_CMD_);
_rtw_memcpy(pssetbasicratepara->basicrates, rateset, NumRates);
memcpy(pssetbasicratepara->basicrates, rateset, NumRates);
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit:
@ -657,7 +642,7 @@ _func_enter_;
psetphypara = (struct setphy_parm *)rtw_zmalloc(sizeof(struct setphy_parm));
if (psetphypara == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -691,7 +676,7 @@ _func_enter_;
pwritebbparm = (struct writeBB_parm *)rtw_zmalloc(sizeof(struct writeBB_parm));
if (pwritebbparm == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -723,7 +708,7 @@ _func_enter_;
prdbbparm = (struct readBB_parm *)rtw_zmalloc(sizeof(struct readBB_parm));
if (prdbbparm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
return _FAIL;
}
@ -757,7 +742,7 @@ _func_enter_;
pwriterfparm = (struct writeRF_parm *)rtw_zmalloc(sizeof(struct writeRF_parm));
if (pwriterfparm == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -790,7 +775,7 @@ _func_enter_;
prdrfparm = (struct readRF_parm *)rtw_zmalloc(sizeof(struct readRF_parm));
if (prdrfparm == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -817,8 +802,8 @@ void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *p
{
_func_enter_;
rtw_mfree((unsigned char *)pcmd->parmbuf, pcmd->cmdsz);
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
kfree(pcmd->parmbuf);
kfree(pcmd);
if (padapter->registrypriv.mp_mode == 1)
padapter->mppriv.workparam.bcompleted = true;
@ -829,8 +814,8 @@ void rtw_readtssi_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcm
{
_func_enter_;
rtw_mfree((unsigned char *)pcmd->parmbuf, pcmd->cmdsz);
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
kfree(pcmd->parmbuf);
kfree(pcmd);
if (padapter->registrypriv.mp_mode == 1)
padapter->mppriv.workparam.bcompleted = true;
@ -960,7 +945,7 @@ _func_enter_;
psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss;
if (psecnetwork == NULL) {
if (pcmd != NULL)
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
kfree(pcmd);
res = _FAIL;
@ -971,14 +956,14 @@ _func_enter_;
_rtw_memset(psecnetwork, 0, t_len);
_rtw_memcpy(psecnetwork, &pnetwork->network, get_wlan_bssid_ex_sz(&pnetwork->network));
memcpy(psecnetwork, &pnetwork->network, get_wlan_bssid_ex_sz(&pnetwork->network));
psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->IELength;
if ((psecnetwork->IELength-12) < (256-1)) {
_rtw_memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
} else {
_rtw_memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
}
psecnetwork->IELength = 0;
@ -988,7 +973,7 @@ _func_enter_;
/* the driver just has the bssid information for PMKIDList searching. */
if (!pmlmepriv->assoc_by_bssid)
_rtw_memcpy(&pmlmepriv->assoc_bssid[0], &pnetwork->network.MacAddress[0], ETH_ALEN);
memcpy(&pmlmepriv->assoc_bssid[0], &pnetwork->network.MacAddress[0], ETH_ALEN);
psecnetwork->IELength = rtw_restruct_sec_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength);
@ -1072,7 +1057,7 @@ _func_enter_;
cmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(*cmdobj));
if (cmdobj == NULL) {
res = _FAIL;
rtw_mfree((u8 *)param, sizeof(*param));
kfree(param);
goto exit;
}
init_h2fwcmd_w_parm_no_rsp(cmdobj, param, _DisConnect_CMD_);
@ -1081,7 +1066,7 @@ _func_enter_;
/* no need to enqueue, do the cmd hdl directly and free cmd parameter */
if (H2C_SUCCESS != disconnect_hdl(padapter, (u8 *)param))
res = _FAIL;
rtw_mfree((u8 *)param, sizeof(*param));
kfree(param);
}
exit:
@ -1109,7 +1094,7 @@ _func_enter_;
psetop = (struct setopmode_parm *)rtw_zmalloc(sizeof(struct setopmode_parm));
if (psetop == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = false;
goto exit;
}
@ -1148,15 +1133,15 @@ _func_enter_;
psetstakey_para = (struct set_stakey_parm *)rtw_zmalloc(sizeof(struct set_stakey_parm));
if (psetstakey_para == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
psetstakey_rsp = (struct set_stakey_rsp *)rtw_zmalloc(sizeof(struct set_stakey_rsp));
if (psetstakey_rsp == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
rtw_mfree((u8 *)psetstakey_para, sizeof(struct set_stakey_parm));
kfree(ph2c);
kfree(psetstakey_para);
res = _FAIL;
goto exit;
}
@ -1165,7 +1150,7 @@ _func_enter_;
ph2c->rsp = (u8 *)psetstakey_rsp;
ph2c->rspsz = sizeof(struct set_stakey_rsp);
_rtw_memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN);
memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN);
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
psetstakey_para->algorithm = (unsigned char) psecuritypriv->dot11PrivacyAlgrthm;
@ -1173,9 +1158,9 @@ _func_enter_;
GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false);
if (unicast_key)
_rtw_memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
else
_rtw_memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
/* jeff: set this becasue at least sw key is ready */
padapter->securitypriv.busetkipkey = true;
@ -1211,15 +1196,15 @@ _func_enter_;
psetstakey_para = (struct set_stakey_parm *)rtw_zmalloc(sizeof(struct set_stakey_parm));
if (psetstakey_para == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
psetstakey_rsp = (struct set_stakey_rsp *)rtw_zmalloc(sizeof(struct set_stakey_rsp));
if (psetstakey_rsp == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
rtw_mfree((u8 *)psetstakey_para, sizeof(struct set_stakey_parm));
kfree(ph2c);
kfree(psetstakey_para);
res = _FAIL;
goto exit;
}
@ -1228,7 +1213,7 @@ _func_enter_;
ph2c->rsp = (u8 *)psetstakey_rsp;
ph2c->rspsz = sizeof(struct set_stakey_rsp);
_rtw_memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN);
memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN);
psetstakey_para->algorithm = _NO_PRIVACY_;
@ -1259,14 +1244,14 @@ _func_enter_;
psetrttblparm = (struct setratable_parm *)rtw_zmalloc(sizeof(struct setratable_parm));
if (psetrttblparm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
init_h2fwcmd_w_parm_no_rsp(ph2c, psetrttblparm, GEN_CMD_CODE(_SetRaTable));
_rtw_memcpy(psetrttblparm, prate_table, sizeof(struct setratable_parm));
memcpy(psetrttblparm, prate_table, sizeof(struct setratable_parm));
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit:
@ -1290,7 +1275,7 @@ _func_enter_;
pgetrttblparm = (struct getratable_parm *)rtw_zmalloc(sizeof(struct getratable_parm));
if (pgetrttblparm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -1331,15 +1316,15 @@ _func_enter_;
psetassocsta_para = (struct set_assocsta_parm *)rtw_zmalloc(sizeof(struct set_assocsta_parm));
if (psetassocsta_para == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
psetassocsta_rsp = (struct set_stakey_rsp *)rtw_zmalloc(sizeof(struct set_assocsta_rsp));
if (psetassocsta_rsp == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
rtw_mfree((u8 *)psetassocsta_para, sizeof(struct set_assocsta_parm));
kfree(ph2c);
kfree(psetassocsta_para);
return _FAIL;
}
@ -1347,7 +1332,7 @@ _func_enter_;
ph2c->rsp = (u8 *)psetassocsta_rsp;
ph2c->rspsz = sizeof(struct set_assocsta_rsp);
_rtw_memcpy(psetassocsta_para->addr, mac_addr, ETH_ALEN);
memcpy(psetassocsta_para->addr, mac_addr, ETH_ALEN);
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
@ -1375,13 +1360,13 @@ _func_enter_;
paddbareq_parm = (struct addBaReq_parm *)rtw_zmalloc(sizeof(struct addBaReq_parm));
if (paddbareq_parm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
paddbareq_parm->tid = tid;
_rtw_memcpy(paddbareq_parm->addr, addr, ETH_ALEN);
memcpy(paddbareq_parm->addr, addr, ETH_ALEN);
init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, GEN_CMD_CODE(_AddBAReq));
@ -1414,7 +1399,7 @@ _func_enter_;
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if (pdrvextra_cmd_parm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -1462,7 +1447,7 @@ _func_enter_;
/* need enqueue, prepare cmd_obj and enqueue */
pcmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmdobj == NULL) {
rtw_mfree((u8 *)set_ch_parm, sizeof(*set_ch_parm));
kfree(set_ch_parm);
res = _FAIL;
goto exit;
}
@ -1474,7 +1459,7 @@ _func_enter_;
if (H2C_SUCCESS != set_ch_hdl(padapter, (u8 *)set_ch_parm))
res = _FAIL;
rtw_mfree((u8 *)set_ch_parm, sizeof(*set_ch_parm));
kfree(set_ch_parm);
}
/* do something based on res... */
@ -1518,7 +1503,7 @@ _func_enter_;
/* need enqueue, prepare cmd_obj and enqueue */
pcmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmdobj == NULL) {
rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param));
kfree(setChannelPlan_param);
res = _FAIL;
goto exit;
}
@ -1530,7 +1515,7 @@ _func_enter_;
if (H2C_SUCCESS != set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param))
res = _FAIL;
rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param));
kfree(setChannelPlan_param);
}
/* do something based on res... */
@ -1564,7 +1549,7 @@ _func_enter_;
ledBlink_param = (struct LedBlink_param *)rtw_zmalloc(sizeof(struct LedBlink_param));
if (ledBlink_param == NULL) {
rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj));
kfree(pcmdobj);
res = _FAIL;
goto exit;
}
@ -1601,7 +1586,7 @@ _func_enter_;
setChannelSwitch_param = (struct SetChannelSwitch_param *)rtw_zmalloc(sizeof(struct SetChannelSwitch_param));
if (setChannelSwitch_param == NULL) {
rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj));
kfree(pcmdobj);
res = _FAIL;
goto exit;
}
@ -1634,14 +1619,8 @@ static void traffic_status_watchdog(struct adapter *padapter)
/* Determine if our traffic is busy now */
/* */
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
#ifdef CONFIG_BT_COEXIST
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 50)
#else /* !CONFIG_BT_COEXIST */
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 100 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 100)
#endif /* !CONFIG_BT_COEXIST */
{
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 100) {
bBusyTraffic = true;
if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > pmlmepriv->LinkDetectInfo.NumTxOkInPeriod)
@ -1661,10 +1640,6 @@ static void traffic_status_watchdog(struct adapter *padapter)
bHigherBusyTxTraffic = true;
}
#ifdef CONFIG_BT_COEXIST
if (BT_1Ant(padapter) == false)
#endif
{
/* check traffic for powersaving. */
if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2))
@ -1677,7 +1652,6 @@ static void traffic_status_watchdog(struct adapter *padapter)
LPS_Enter(padapter);
else
LPS_Leave(padapter);
}
} else {
LPS_Leave(padapter);
}
@ -1693,15 +1667,14 @@ static void traffic_status_watchdog(struct adapter *padapter)
pmlmepriv->LinkDetectInfo.bHigherBusyTxTraffic = bHigherBusyTxTraffic;
}
void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz);
void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
{
struct mlme_priv *pmlmepriv;
padapter = (struct adapter *)pbuf;
pmlmepriv = &(padapter->mlmepriv);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
expire_timeout_chk(padapter);
#endif
@ -1712,14 +1685,9 @@ void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
traffic_status_watchdog(padapter);
rtw_hal_dm_watchdog(padapter);
#ifdef CONFIG_BT_COEXIST
/* BT-Coexist */
BT_CoexistMechanism(padapter);
#endif
}
void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@ -1733,15 +1701,9 @@ _func_enter_;
switch (lps_ctrl_type) {
case LPS_CTRL_SCAN:
#ifdef CONFIG_BT_COEXIST
BT_WifiScanNotify(padapter, true);
if (BT_1Ant(padapter) == false)
#endif
{
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
/* connect */
LPS_Leave(padapter);
}
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
/* connect */
LPS_Leave(padapter);
}
break;
case LPS_CTRL_JOINBSS:
@ -1752,40 +1714,19 @@ _func_enter_;
/* Reset LPS Setting */
padapter->pwrctrlpriv.LpsIdleCount = 0;
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_JOINBSSRPT, (u8 *)(&mstatus));
#ifdef CONFIG_BT_COEXIST
BT_WifiMediaStatusNotify(padapter, mstatus);
#endif
break;
case LPS_CTRL_DISCONNECT:
mstatus = 0;/* disconnect */
#ifdef CONFIG_BT_COEXIST
BT_WifiMediaStatusNotify(padapter, mstatus);
if (BT_1Ant(padapter) == false)
#endif
{
LPS_Leave(padapter);
}
LPS_Leave(padapter);
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_JOINBSSRPT, (u8 *)(&mstatus));
break;
case LPS_CTRL_SPECIAL_PACKET:
/* DBG_88E("LPS_CTRL_SPECIAL_PACKET\n"); */
pwrpriv->DelayLPSLastTimeStamp = rtw_get_current_time();
#ifdef CONFIG_BT_COEXIST
BT_SpecialPacketNotify(padapter);
if (BT_1Ant(padapter) == false)
#endif
{
LPS_Leave(padapter);
}
LPS_Leave(padapter);
break;
case LPS_CTRL_LEAVE:
#ifdef CONFIG_BT_COEXIST
BT_LpsLeave(padapter);
if (BT_1Ant(padapter) == false)
#endif
{
LPS_Leave(padapter);
}
LPS_Leave(padapter);
break;
default:
break;
@ -1816,7 +1757,7 @@ _func_enter_;
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if (pdrvextra_cmd_parm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -1861,7 +1802,7 @@ _func_enter_;
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if (pdrvextra_cmd_parm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -1905,7 +1846,7 @@ _func_enter_;
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if (pdrvextra_cmd_parm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -1926,12 +1867,12 @@ _func_exit_;
return res;
}
void power_saving_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
static void power_saving_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
{
rtw_ps_processor(padapter);
}
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType)
{
struct cmd_obj *ph2c;
@ -1953,7 +1894,7 @@ _func_enter_;
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if (pdrvextra_cmd_parm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -1972,7 +1913,7 @@ _func_exit_;
return res;
}
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
u8 rtw_ps_cmd(struct adapter *padapter)
{
@ -1991,7 +1932,7 @@ _func_enter_;
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if (pdrvextra_cmd_parm == NULL) {
rtw_mfree((unsigned char *)ppscmd, sizeof(struct cmd_obj));
kfree(ppscmd);
res = _FAIL;
goto exit;
}
@ -2009,7 +1950,7 @@ _func_exit_;
return res;
}
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
{
@ -2066,7 +2007,7 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter)
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if (pdrvextra_cmd_parm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -2098,7 +2039,7 @@ u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt)
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if (pdrvextra_cmd_parm == NULL) {
rtw_mfree((u8 *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -2165,17 +2106,19 @@ static void c2h_wk_callback(struct work_struct *work)
continue;
if (!c2h_evt_exist(c2h_evt)) {
rtw_mfree((u8 *)c2h_evt, 16);
kfree(c2h_evt);
continue;
}
if (ccx_id_filter(c2h_evt->id) == true) {
/* Handle CCX report here */
rtw_hal_c2h_handler(adapter, c2h_evt);
rtw_mfree((u8 *)c2h_evt, 16);
kfree(c2h_evt);
} else {
#ifdef CONFIG_88EU_P2P
/* Enqueue into cmd_thread for others */
rtw_c2h_wk_cmd(adapter, (u8 *)c2h_evt);
#endif
}
}
@ -2207,6 +2150,7 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
case ANT_SELECT_WK_CID:
antenna_select_wk_hdl(padapter, pdrvextra_cmd->type_size);
break;
#ifdef CONFIG_88EU_P2P
case P2P_PS_WK_CID:
p2p_ps_wk_hdl(padapter, pdrvextra_cmd->type_size);
break;
@ -2215,11 +2159,12 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
/* I used the type_size as the type command */
p2p_protocol_wk_hdl(padapter, pdrvextra_cmd->type_size);
break;
#ifdef CONFIG_AP_MODE
#endif
#ifdef CONFIG_88EU_AP_MODE
case CHECK_HIQ_WK_CID:
rtw_chk_hi_queue_hdl(padapter);
break;
#endif /* CONFIG_AP_MODE */
#endif /* CONFIG_88EU_AP_MODE */
case C2H_WK_CID:
c2h_evt_hdl(padapter, (struct c2h_evt_hdr *)pdrvextra_cmd->pbuf, NULL);
break;
@ -2228,7 +2173,7 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
}
if (pdrvextra_cmd->pbuf && pdrvextra_cmd->type_size > 0)
rtw_mfree(pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
kfree(pdrvextra_cmd->pbuf);
return H2C_SUCCESS;
}
@ -2279,7 +2224,6 @@ exit:
_func_exit_;
}
void rtw_joinbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -2350,9 +2294,9 @@ _func_enter_;
}
pnetwork->Length = get_wlan_bssid_ex_sz(pnetwork);
_rtw_memcpy(&(pwlan->network), pnetwork, pnetwork->Length);
memcpy(&(pwlan->network), pnetwork, pnetwork->Length);
_rtw_memcpy(&tgt_network->network, pnetwork, (get_wlan_bssid_ex_sz(pnetwork)));
memcpy(&tgt_network->network, pnetwork, (get_wlan_bssid_ex_sz(pnetwork)));
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
@ -2418,14 +2362,3 @@ exit:
_func_exit_;
}
void rtw_getrttbl_cmd_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd)
{
_func_enter_;
rtw_free_cmd_obj(pcmd);
if (padapter->registrypriv.mp_mode == 1)
padapter->mppriv.workparam.bcompleted = true;
_func_exit_;
}

View file

@ -555,10 +555,9 @@ int proc_get_rx_signal(char *page, char **start,
{
struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
int len = 0;
len += snprintf(page + len, count - len,
len = snprintf(page + len, count,
"rssi:%d\n"
"rxpwdb:%d\n"
"signal_strength:%u\n"
@ -632,13 +631,13 @@ int proc_set_ht_enable(struct file *file, const char __user *buffer,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct registry_priv *pregpriv = &padapter->registrypriv;
char tmp[32];
s32 mode;
s32 mode = 0;
if (count < 1)
return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
if (pregpriv && mode >= 0 && mode < 2) {
if (pregpriv) {
pregpriv->ht_enable = mode;
pr_info("ht_enable=%d\n", pregpriv->ht_enable);
}
@ -674,13 +673,13 @@ int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct registry_priv *pregpriv = &padapter->registrypriv;
char tmp[32];
s32 mode;
s32 mode = 0;
if (count < 1)
return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
if (pregpriv && mode >= 0 && mode < 2) {
if (pregpriv) {
pregpriv->cbw40_enable = mode;
pr_info("cbw40_enable=%d\n", mode);
}
@ -715,13 +714,13 @@ int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct registry_priv *pregpriv = &padapter->registrypriv;
char tmp[32];
s32 mode;
s32 mode = 0;
if (count < 1)
return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
if (pregpriv && mode >= 0 && mode < 3) {
if (pregpriv) {
pregpriv->ampdu_enable = mode;
pr_info("ampdu_enable=%d\n", mode);
}
@ -776,13 +775,13 @@ int proc_set_rx_stbc(struct file *file, const char __user *buffer,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct registry_priv *pregpriv = &padapter->registrypriv;
char tmp[32];
u32 mode;
u32 mode = 0;
if (count < 1)
return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
if (pregpriv && (mode == 0 || mode == 1 || mode == 2 || mode == 3)) {
if (pregpriv) {
pregpriv->rx_stbc = mode;
printk("rx_stbc=%d\n", mode);
}
@ -830,7 +829,7 @@ int proc_set_rssi_disp(struct file *file, const char __user *buffer,
return count;
}
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
int proc_get_all_sta_info(char *page, char **start,
off_t offset, int count,
@ -947,52 +946,3 @@ int proc_get_best_channel(char *page, char **start,
*eof = 1;
return len;
}
#ifdef CONFIG_BT_COEXIST
#define _bt_dbg_off_ 0
#define _bt_dbg_on_ 1
extern u32 BTCoexDbgLevel;
int proc_get_btcoex_dbg(char *page, char **start,
off_t offset, int count,
int *eof, void *data)
{
struct net_device *dev = data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct registry_priv *pregpriv = &padapter->registrypriv;
int len = 0;
if (pregpriv)
len += snprintf(page + len, count - len,
"%d\n",
BTCoexDbgLevel
);
*eof = 1;
return len;
}
int proc_set_btcoex_dbg(struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
struct net_device *dev = (struct net_device *)data;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct registry_priv *pregpriv = &padapter->registrypriv;
char tmp[32];
u32 mode;
if (count < 1)
return -EFAULT;
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
int num = sscanf(tmp, "%d ", &mode);
if (pregpriv && (mode == 0 || mode == 1 || mode == 2 || mode == 3)) {
BTCoexDbgLevel = mode;
pr_info("btcoex_dbg=%d\n", BTCoexDbgLevel);
}
}
return count;
}
#endif /* CONFIG_BT_COEXIST */

View file

@ -68,7 +68,7 @@ Efuse_Read1ByteFromFakeContent(
return true;
}
bool
static bool
Efuse_Write1ByteToFakeContent(
struct adapter *pAdapter,
u16 Offset,
@ -228,7 +228,7 @@ ReadEFuseByte(
/* write addr must be after sec5. */
/* */
void efuse_ReadEFuse(struct adapter *Adapter, u8 efuseType, u16 _offset, u16 _size_byte, u8 *pbuf, bool pseudo)
static void efuse_ReadEFuse(struct adapter *Adapter, u8 efuseType, u16 _offset, u16 _size_byte, u8 *pbuf, bool pseudo)
{
Adapter->HalFunc.ReadEFuse(Adapter, efuseType, _offset, _size_byte, pbuf, pseudo);
}
@ -297,63 +297,6 @@ u8 EFUSE_Read1Byte(struct adapter *Adapter, u16 Address)
} /* EFUSE_Read1Byte */
/*-----------------------------------------------------------------------------
* Function: EFUSE_Write1Byte
*
* Overview: Copy from WMAC fot EFUSE write 1 byte.
*
* Input: NONE
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
* 09/23/2008 MHC Copy from WMAC.
*
*---------------------------------------------------------------------------*/
void EFUSE_Write1Byte(struct adapter *Adapter, u16 Address, u8 Value)
{
u8 Bytetemp = {0x00};
u8 temp = {0x00};
u32 k = 0;
u16 contentLen = 0;
/* RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr =%x Data =%x\n", Address, Value)); */
EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI , TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen, false);
if (Address < contentLen) { /* E-fuse 512Byte */
rtw_write8(Adapter, EFUSE_CTRL, Value);
/* Write E-fuse Register address bit0~7 */
temp = Address & 0xFF;
rtw_write8(Adapter, EFUSE_CTRL+1, temp);
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
/* Write E-fuse Register address bit8~9 */
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
rtw_write8(Adapter, EFUSE_CTRL+2, temp);
/* Write 0x30[31]= 1 */
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
temp = Bytetemp | 0x80;
rtw_write8(Adapter, EFUSE_CTRL+3, temp);
/* Wait Write-ready (0x30[31]= 0) */
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
while (Bytetemp & 0x80) {
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
k++;
if (k == 100) {
k = 0;
break;
}
}
}
} /* EFUSE_Write1Byte */
/* 11/16/2008 MH Read one byte from real Efuse. */
u8 efuse_OneByteRead(struct adapter *pAdapter, u16 addr, u8 *data, bool pseudo)
{
@ -599,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 + 1];
u8 newdata[PGPKT_DATA_SIZE];
s32 i, idx;
u8 ret = _SUCCESS;
u16 mapLen = 0;
@ -682,7 +625,7 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data)
Efuse_PowerSwitch(padapter, true, false);
exit:
rtw_mfree(map, mapLen);
kfree(map);
return ret;
}
@ -691,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 + 1];
u8 newdata[PGPKT_DATA_SIZE];
s32 i, idx;
u8 ret = _SUCCESS;
u16 mapLen = 0;
@ -778,40 +721,11 @@ u8 rtw_BT_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data
exit:
rtw_mfree(map, mapLen);
kfree(map);
return ret;
}
/*-----------------------------------------------------------------------------
* Function: Efuse_ReadAllMap
*
* Overview: Read All Efuse content
*
* Input: NONE
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
* 11/11/2008 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
void Efuse_ReadAllMap(struct adapter *pAdapter, u8 efuseType, u8 *Efuse, bool pseudo)
{
u16 mapLen = 0;
Efuse_PowerSwitch(pAdapter, false, true);
EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, pseudo);
efuse_ReadEFuse(pAdapter, efuseType, 0, mapLen, Efuse, pseudo);
Efuse_PowerSwitch(pAdapter, false, false);
}
/*-----------------------------------------------------------------------------
* Function: efuse_ShadowRead1Byte
* efuse_ShadowRead2Byte
@ -872,13 +786,10 @@ efuse_ShadowRead4Byte(
} /* efuse_ShadowRead4Byte */
/*-----------------------------------------------------------------------------
* Function: efuse_ShadowWrite1Byte
* efuse_ShadowWrite2Byte
* efuse_ShadowWrite4Byte
* Function: Efuse_ReadAllMap
*
* Overview: Write efuse modify map by one/two/four byte.
* Overview: Read All Efuse content
*
* Input: NONE
*
@ -888,50 +799,21 @@ efuse_ShadowRead4Byte(
*
* Revised History:
* When Who Remark
* 11/12/2008 MHC Create Version 0.
* 11/11/2008 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
static void
efuse_ShadowWrite1Byte(
struct adapter *pAdapter,
u16 Offset,
u8 Value)
static void Efuse_ReadAllMap(struct adapter *pAdapter, u8 efuseType, u8 *Efuse, bool pseudo)
{
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
u16 mapLen = 0;
pEEPROM->efuse_eeprom_data[Offset] = Value;
Efuse_PowerSwitch(pAdapter, false, true);
} /* efuse_ShadowWrite1Byte */
EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, pseudo);
/* Write Two Bytes */
static void
efuse_ShadowWrite2Byte(
struct adapter *pAdapter,
u16 Offset,
u16 Value)
{
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
efuse_ReadEFuse(pAdapter, efuseType, 0, mapLen, Efuse, pseudo);
pEEPROM->efuse_eeprom_data[Offset] = Value&0x00FF;
pEEPROM->efuse_eeprom_data[Offset+1] = Value>>8;
} /* efuse_ShadowWrite1Byte */
/* Write Four Bytes */
static void
efuse_ShadowWrite4Byte(
struct adapter *pAdapter,
u16 Offset,
u32 Value)
{
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
pEEPROM->efuse_eeprom_data[Offset] = (u8)(Value&0x000000FF);
pEEPROM->efuse_eeprom_data[Offset+1] = (u8)((Value>>8)&0x0000FF);
pEEPROM->efuse_eeprom_data[Offset+2] = (u8)((Value>>16)&0x00FF);
pEEPROM->efuse_eeprom_data[Offset+3] = (u8)((Value>>24)&0xFF);
} /* efuse_ShadowWrite1Byte */
Efuse_PowerSwitch(pAdapter, false, false);
}
/*-----------------------------------------------------------------------------
* Function: EFUSE_ShadowMapUpdate
@ -981,12 +863,7 @@ void EFUSE_ShadowMapUpdate(
* 11/12/2008 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
void
EFUSE_ShadowRead(
struct adapter *pAdapter,
u8 Type,
u16 Offset,
u32 *Value)
void EFUSE_ShadowRead(struct adapter *pAdapter, u8 Type, u16 Offset, u32 *Value)
{
if (Type == 1)
efuse_ShadowRead1Byte(pAdapter, Offset, (u8 *)Value);
@ -996,52 +873,3 @@ EFUSE_ShadowRead(
efuse_ShadowRead4Byte(pAdapter, Offset, (u32 *)Value);
} /* EFUSE_ShadowRead */
/*-----------------------------------------------------------------------------
* Function: EFUSE_ShadowWrite
*
* Overview: Write efuse modify map for later update operation to use!!!!!
*
* Input: NONE
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
* 11/12/2008 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
void EFUSE_ShadowWrite(struct adapter *pAdapter, u8 Type, u16 Offset, u32 Value)
{
if (pAdapter->registrypriv.mp_mode == 0)
return;
if (Type == 1)
efuse_ShadowWrite1Byte(pAdapter, Offset, (u8)Value);
else if (Type == 2)
efuse_ShadowWrite2Byte(pAdapter, Offset, (u16)Value);
else if (Type == 4)
efuse_ShadowWrite4Byte(pAdapter, Offset, (u32)Value);
} /* EFUSE_ShadowWrite */
void Efuse_InitSomeVar(struct adapter *pAdapter)
{
u8 i;
_rtw_memset((void *)&fakeEfuseContent[0], 0xff, EFUSE_MAX_HW_SIZE);
_rtw_memset((void *)&fakeEfuseInitMap[0], 0xff, EFUSE_MAX_MAP_LEN);
_rtw_memset((void *)&fakeEfuseModifiedMap[0], 0xff, EFUSE_MAX_MAP_LEN);
for (i = 0; i < EFUSE_MAX_BT_BANK; i++)
_rtw_memset((void *)&BTEfuseContent[i][0], EFUSE_MAX_HW_SIZE, 0xff);
_rtw_memset((void *)&BTEfuseInitMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
_rtw_memset((void *)&BTEfuseModifiedMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
for (i = 0; i < EFUSE_MAX_BT_BANK; i++)
_rtw_memset((void *)&fakeBTEfuseContent[i][0], 0xff, EFUSE_MAX_HW_SIZE);
_rtw_memset((void *)&fakeBTEfuseInitMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
_rtw_memset((void *)&fakeBTEfuseModifiedMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
}

View file

@ -132,7 +132,7 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source,
unsigned int *frlen)
{
_rtw_memcpy((void *)pbuf, (void *)source, len);
memcpy((void *)pbuf, (void *)source, len);
*frlen = *frlen + len;
return pbuf + len;
}
@ -153,7 +153,7 @@ _func_enter_;
*(pbuf + 1) = (u8)len;
if (len > 0)
_rtw_memcpy((void *)(pbuf + 2), (void *)source, len);
memcpy((void *)(pbuf + 2), (void *)source, len);
*frlen = *frlen + (len + 2);
@ -277,7 +277,7 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
target_ie = &in_ie[cnt];
if (ie)
_rtw_memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
if (ielen)
*ielen = in_ie[cnt+1]+2;
@ -322,8 +322,8 @@ int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 o
u8 *remain_ies = target_ie + target_ielen;
uint remain_len = search_len - (remain_ies - start);
_rtw_memcpy(buf, remain_ies, remain_len);
_rtw_memcpy(target_ie, buf, remain_len);
memcpy(buf, remain_ies, remain_len);
memcpy(target_ie, buf, remain_len);
*ies_len = *ies_len - target_ielen;
ret = _SUCCESS;
@ -345,20 +345,20 @@ _func_enter_;
switch (mode) {
case WIRELESS_11B:
_rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
break;
case WIRELESS_11G:
case WIRELESS_11A:
case WIRELESS_11_5N:
case WIRELESS_11A_5N:/* Todo: no basic rate for ofdm ? */
_rtw_memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
break;
case WIRELESS_11BG:
case WIRELESS_11G_24N:
case WIRELESS_11_24N:
case WIRELESS_11BG_24N:
_rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
_rtw_memcpy(SupportedRates + IEEE80211_CCK_RATE_LEN, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
memcpy(SupportedRates + IEEE80211_CCK_RATE_LEN, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
break;
}
_func_exit_;
@ -467,7 +467,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
goto check_next_ie;
/* check version... */
_rtw_memcpy((u8 *)&le_tmp, (pbuf + 6), sizeof(val16));
memcpy((u8 *)&le_tmp, (pbuf + 6), sizeof(val16));
val16 = le16_to_cpu(le_tmp);
if (val16 != 0x0001)
@ -689,7 +689,7 @@ _func_enter_;
sec_idx, in_ie[cnt+1]+2));
if (wpa_ie) {
_rtw_memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt+1]+2);
memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt+1]+2);
for (i = 0; i < (in_ie[cnt+1]+2); i += 8) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
@ -708,7 +708,7 @@ _func_enter_;
sec_idx, in_ie[cnt+1]+2));
if (rsn_ie) {
_rtw_memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt+1]+2);
memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt+1]+2);
for (i = 0; i < (in_ie[cnt+1]+2); i += 8) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
@ -778,7 +778,7 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
wpsie_ptr = &in_ie[cnt];
if (wps_ie)
_rtw_memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2);
memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2);
if (wps_ielen)
*wps_ielen = in_ie[cnt+1]+2;
@ -828,7 +828,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8 *buf_at
if (attr_id == target_attr_id) {
target_attr_ptr = attr_ptr;
if (buf_attr)
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
memcpy(buf_attr, attr_ptr, attr_len);
if (len_attr)
*len_attr = attr_len;
break;
@ -861,7 +861,7 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8
if (attr_ptr && attr_len) {
if (buf_content)
_rtw_memcpy(buf_content, attr_ptr+4, attr_len-4);
memcpy(buf_content, attr_ptr+4, attr_len-4);
if (len_content)
*len_content = attr_len-4;
@ -1114,9 +1114,9 @@ void rtw_macaddr_cfg(u8 *mac_addr)
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk + 1]);
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
memcpy(mac_addr, mac, ETH_ALEN);
} else { /* Use the mac address stored in the Efuse */
_rtw_memcpy(mac, mac_addr, ETH_ALEN);
memcpy(mac, mac_addr, ETH_ALEN);
}
if (((mac[0] == 0xff) && (mac[1] == 0xff) && (mac[2] == 0xff) &&
@ -1130,7 +1130,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
mac[4] = 0x00;
mac[5] = 0x00;
/* use default mac addresss */
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
memcpy(mac_addr, mac, ETH_ALEN);
DBG_88E("MAC Address from efuse error, assign default one !!!\n");
}
@ -1147,7 +1147,7 @@ void dump_ies(u8 *buf, u32 buf_len)
len = *(pos+1);
DBG_88E("%s ID:%u, LEN:%u\n", __func__, id, len);
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
dump_p2p_ie(pos, len);
#endif
dump_wps_ie(pos, len);
@ -1177,7 +1177,7 @@ void dump_wps_ie(u8 *ie, u32 ie_len)
}
}
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
void dump_p2p_ie(u8 *ie, u32 ie_len)
{
u8 *pos = (u8 *)ie;
@ -1227,7 +1227,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
p2p_ie_ptr = in_ie + cnt;
if (p2p_ie != NULL)
_rtw_memcpy(p2p_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
memcpy(p2p_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
if (p2p_ielen != NULL)
*p2p_ielen = in_ie[cnt + 1] + 2;
return p2p_ie_ptr;
@ -1274,7 +1274,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id , u8 *buf_att
target_attr_ptr = attr_ptr;
if (buf_attr)
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
memcpy(buf_attr, attr_ptr, attr_len);
if (len_attr)
*len_attr = attr_len;
break;
@ -1307,7 +1307,7 @@ u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id , u8
if (attr_ptr && attr_len) {
if (buf_content)
_rtw_memcpy(buf_content, attr_ptr+3, attr_len-3);
memcpy(buf_content, attr_ptr+3, attr_len-3);
if (len_content)
*len_content = attr_len-3;
@ -1328,7 +1328,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
RTW_PUT_LE16(pbuf + 1, attr_len);
if (pdata_attr)
_rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
memcpy(pbuf + 3, pdata_attr, attr_len);
a_len = attr_len + 3;
@ -1348,7 +1348,7 @@ static uint rtw_p2p_attr_remove(u8 *ie, uint ielen_ori, u8 attr_id)
uint remain_len = ielen-(next_attr-ie);
_rtw_memset(target_attr, 0, target_attr_len);
_rtw_memcpy(target_attr, next_attr, remain_len);
memcpy(target_attr, next_attr, remain_len);
_rtw_memset(target_attr+remain_len, 0, target_attr_len);
*(ie+1) -= target_attr_len;
ielen -= target_attr_len;
@ -1372,14 +1372,14 @@ void rtw_wlan_bssid_ex_remove_p2p_attr(struct wlan_bssid_ex *bss_ex, u8 attr_id)
u8 *next_ie = p2p_ie+p2p_ielen;
uint remain_len = bss_ex->IELength-(next_ie_ori-bss_ex->IEs);
_rtw_memcpy(next_ie, next_ie_ori, remain_len);
memcpy(next_ie, next_ie_ori, remain_len);
_rtw_memset(next_ie+remain_len, 0, p2p_ielen_ori-p2p_ielen);
bss_ex->IELength -= p2p_ielen_ori-p2p_ielen;
}
}
}
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
/* Baron adds to avoid FreeBSD warning */
int ieee80211_is_empty_essid(const char *essid, int essid_len)
@ -1475,7 +1475,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
unsigned int len;
unsigned char *p;
_rtw_memcpy((u8 *)&le_tmp, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
memcpy(&le_tmp, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
cap = le16_to_cpu(le_tmp);
if (cap & WLAN_CAPABILITY_PRIVACY) {
bencrypt = 1;
@ -1588,7 +1588,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
{
const u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
u16 fc;
u8 c, a;
u8 c, a = 0;
fc = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)frame)->frame_ctl);

View file

@ -133,7 +133,7 @@ _func_enter_;
pibss = padapter->registrypriv.dev_network.MacAddress;
_rtw_memset(&pdev_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
_rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
rtw_update_registrypriv_dev_network(padapter);
@ -244,7 +244,7 @@ handle_tkip_countermeasure:
}
}
_rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN);
memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN);
pmlmepriv->assoc_by_bssid = true;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
@ -357,7 +357,7 @@ handle_tkip_countermeasure:
}
}
_rtw_memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(struct ndis_802_11_ssid));
memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(struct ndis_802_11_ssid));
pmlmepriv->assoc_by_bssid = false;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
@ -400,7 +400,7 @@ _func_enter_;
/* change to other mode from Ndis802_11APMode */
cur_network->join_res = -1;
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
stop_ap_mode(padapter);
#endif
}
@ -431,7 +431,7 @@ _func_enter_;
break;
case Ndis802_11APMode:
set_fwstate(pmlmepriv, WIFI_AP_STATE);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
start_ap_mode(padapter);
#endif
break;
@ -590,7 +590,7 @@ _func_enter_;
("rtw_set_802_11_add_wep:befor memcpy, wep->KeyLength = 0x%x wep->KeyIndex = 0x%x keyid =%x\n",
wep->KeyLength, wep->KeyIndex, keyid));
_rtw_memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]), &(wep->KeyMaterial), wep->KeyLength);
memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]), &(wep->KeyMaterial), wep->KeyLength);
psecuritypriv->dot11DefKeylen[keyid] = wep->KeyLength;
@ -867,8 +867,8 @@ _func_enter_;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY:Before memcpy\n"));
_rtw_memcpy(wep->KeyMaterial, key->KeyMaterial, key->KeyLength);
_rtw_memcpy(&(padapter->securitypriv.dot11DefKey[keyindex].skey[0]), key->KeyMaterial, key->KeyLength);
memcpy(wep->KeyMaterial, key->KeyMaterial, key->KeyLength);
memcpy(&(padapter->securitypriv.dot11DefKey[keyindex].skey[0]), key->KeyMaterial, key->KeyLength);
padapter->securitypriv.dot11DefKeylen[keyindex] = key->KeyLength;
padapter->securitypriv.dot11PrivacyKeyIndex = keyindex;
@ -881,10 +881,10 @@ _func_enter_;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("OID_802_11_ADD_KEY: +++++ SetRSC+++++\n"));
if (bgroup) {
unsigned long long keysrc = key->KeyRSC & 0x00FFFFFFFFFFFFULL;
_rtw_memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8);
memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8);
} else {
unsigned long long keysrc = key->KeyRSC & 0x00FFFFFFFFFFFFULL;
_rtw_memcpy(&padapter->securitypriv.dot11Grptxpn, &keysrc, 8);
memcpy(&padapter->securitypriv.dot11Grptxpn, &keysrc, 8);
}
}
@ -904,8 +904,8 @@ _func_enter_;
_rtw_memset(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
if ((key->KeyIndex & 0x10000000)) {
_rtw_memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8);
_rtw_memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8);
memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8);
memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8);
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
("\n rtw_set_802_11_add_key:rx mic :0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
@ -919,8 +919,8 @@ _func_enter_;
padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex-1) & 0x03)].skey[7]));
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n rtw_set_802_11_add_key:set Group mic key!!!!!!!!\n"));
} else {
_rtw_memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8);
_rtw_memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8);
memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8);
memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8);
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
("\n rtw_set_802_11_add_key:rx mic :0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
@ -937,7 +937,7 @@ _func_enter_;
}
/* set group key by index */
_rtw_memcpy(&padapter->securitypriv.dot118021XGrpKey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial, key->KeyLength);
memcpy(&padapter->securitypriv.dot118021XGrpKey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial, key->KeyLength);
key->KeyIndex = key->KeyIndex & 0x03;
@ -963,7 +963,7 @@ _func_enter_;
if (stainfo != NULL) {
_rtw_memset(&stainfo->dot118021x_UncstKey, 0, 16);/* clear keybuffer */
_rtw_memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16);
memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16);
if (encryptionalgo == _TKIP_) {
padapter->securitypriv.busetkipkey = false;
@ -974,12 +974,12 @@ _func_enter_;
/* if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255] */
if ((key->KeyIndex & 0x10000000)) {
_rtw_memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8);
_rtw_memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 24, 8);
memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8);
memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 24, 8);
} else {
_rtw_memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 24, 8);
_rtw_memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 16, 8);
memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 24, 8);
memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 16, 8);
}
}
@ -1078,7 +1078,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
if (p && ht_ielen > 0) {
pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
_rtw_memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2);
memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2);
/* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */
bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1 : 0;

View file

@ -72,7 +72,7 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
return _FAIL;
}
_rtw_memcpy(xmit_frame->buf_addr + buf_offset + pattrib->pktlen, IOL_cmds, cmd_len);
memcpy(xmit_frame->buf_addr + buf_offset + pattrib->pktlen, IOL_cmds, cmd_len);
pattrib->pktlen += cmd_len;
pattrib->last_txcmdsz += cmd_len;

View file

@ -762,91 +762,6 @@ static void SwLedBlink6(struct LED_871x *pLed)
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("<==== blink6\n"));
}
static void SwLedControlMode0(struct adapter *padapter, enum LED_CTL_MODE LedAction)
{
struct led_priv *ledpriv = &(padapter->ledpriv);
struct LED_871x *pLed = &(ledpriv->SwLed1);
/* Decide led state */
switch (LedAction) {
case LED_CTL_TX:
case LED_CTL_RX:
if (!pLed->bLedBlinkInProgress) {
pLed->bLedBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_NORMAL;
pLed->BlinkTimes = 2;
if (pLed->bLedOn)
pLed->BlinkingLedState = RTW_LED_OFF;
else
pLed->BlinkingLedState = RTW_LED_ON;
_set_timer(&(pLed->BlinkTimer), LED_BLINK_NORMAL_INTERVAL);
}
break;
case LED_CTL_START_TO_LINK:
if (!pLed->bLedBlinkInProgress) {
pLed->bLedBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_StartToBlink;
pLed->BlinkTimes = 24;
if (pLed->bLedOn)
pLed->BlinkingLedState = RTW_LED_OFF;
else
pLed->BlinkingLedState = RTW_LED_ON;
_set_timer(&(pLed->BlinkTimer), LED_BLINK_SLOWLY_INTERVAL);
} else {
pLed->CurrLedState = LED_BLINK_StartToBlink;
}
break;
case LED_CTL_LINK:
pLed->CurrLedState = RTW_LED_ON;
if (!pLed->bLedBlinkInProgress)
SwLedOn(padapter, pLed);
break;
case LED_CTL_NO_LINK:
pLed->CurrLedState = RTW_LED_OFF;
if (!pLed->bLedBlinkInProgress)
SwLedOff(padapter, pLed);
break;
case LED_CTL_POWER_OFF:
pLed->CurrLedState = RTW_LED_OFF;
if (pLed->bLedBlinkInProgress) {
_cancel_timer_ex(&(pLed->BlinkTimer));
pLed->bLedBlinkInProgress = false;
}
SwLedOff(padapter, pLed);
break;
case LED_CTL_START_WPS:
if (!pLed->bLedBlinkInProgress || pLed->CurrLedState == RTW_LED_ON) {
pLed->bLedBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_WPS;
pLed->BlinkTimes = 20;
if (pLed->bLedOn) {
pLed->BlinkingLedState = RTW_LED_OFF;
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LONG_INTERVAL);
} else {
pLed->BlinkingLedState = RTW_LED_ON;
_set_timer(&(pLed->BlinkTimer), LED_BLINK_LONG_INTERVAL);
}
}
break;
case LED_CTL_STOP_WPS:
if (pLed->bLedBlinkInProgress) {
pLed->CurrLedState = RTW_LED_OFF;
_cancel_timer_ex(&(pLed->BlinkTimer));
pLed->bLedBlinkInProgress = false;
}
break;
default:
break;
}
RT_TRACE(_module_rtl8712_led_c_, _drv_info_, ("Led %d\n", pLed->CurrLedState));
}
/* ALPHA, added by chiyoko, 20090106 */
static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAction)
{
@ -1726,7 +1641,7 @@ void BlinkHandler(struct LED_871x *pLed)
}
}
void LedControl871x(struct adapter *padapter, enum LED_CTL_MODE LedAction)
void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction)
{
struct led_priv *ledpriv = &(padapter->ledpriv);

View file

@ -32,9 +32,6 @@
#include <rtw_ioctl_set.h>
#include <usb_osintf.h>
extern void indicate_wx_scan_complete_event(struct adapter *padapter);
extern u8 rtw_do_join(struct adapter *padapter);
extern unsigned char MCS_rate_2R[16];
extern unsigned char MCS_rate_1R[16];
@ -96,25 +93,23 @@ _func_exit_;
return res;
}
void rtw_mfree_mlme_priv_lock (struct mlme_priv *pmlmepriv)
static void rtw_mfree_mlme_priv_lock (struct mlme_priv *pmlmepriv)
{
_rtw_spinlock_free(&pmlmepriv->lock);
_rtw_spinlock_free(&(pmlmepriv->free_bss_pool.lock));
_rtw_spinlock_free(&(pmlmepriv->scanned_queue.lock));
}
#if defined (CONFIG_88EU_AP_MODE)
static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen)
{
if (*ppie) {
_rtw_mfree(*ppie, *plen);
*plen = 0;
*ppie = NULL;
}
kfree(*ppie);
*plen = 0;
*ppie = NULL;
}
void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv)
{
#if defined (CONFIG_AP_MODE)
rtw_buf_free(&pmlmepriv->assoc_req, &pmlmepriv->assoc_req_len);
rtw_buf_free(&pmlmepriv->assoc_rsp, &pmlmepriv->assoc_rsp_len);
rtw_free_mlme_ie_data(&pmlmepriv->wps_beacon_ie, &pmlmepriv->wps_beacon_ie_len);
@ -127,8 +122,12 @@ void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv)
rtw_free_mlme_ie_data(&pmlmepriv->p2p_probe_resp_ie, &pmlmepriv->p2p_probe_resp_ie_len);
rtw_free_mlme_ie_data(&pmlmepriv->p2p_go_probe_resp_ie, &pmlmepriv->p2p_go_probe_resp_ie_len);
rtw_free_mlme_ie_data(&pmlmepriv->p2p_assoc_req_ie, &pmlmepriv->p2p_assoc_req_ie_len);
#endif
}
#else
void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv)
{
}
#endif
void _rtw_free_mlme_priv (struct mlme_priv *pmlmepriv)
{
@ -148,18 +147,18 @@ _func_exit_;
int _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork)
{
unsigned long irqL;
unsigned long irql;
_func_enter_;
if (pnetwork == NULL)
goto exit;
_enter_critical_bh(&queue->lock, &irqL);
_enter_critical_bh(&queue->lock, &irql);
rtw_list_insert_tail(&pnetwork->list, &queue->queue);
_exit_critical_bh(&queue->lock, &irqL);
_exit_critical_bh(&queue->lock, &irql);
exit:
@ -170,13 +169,13 @@ _func_exit_;
struct wlan_network *_rtw_dequeue_network(struct __queue *queue)
{
unsigned long irqL;
unsigned long irql;
struct wlan_network *pnetwork;
_func_enter_;
_enter_critical_bh(&queue->lock, &irqL);
_enter_critical_bh(&queue->lock, &irql);
if (_rtw_queue_empty(queue)) {
pnetwork = NULL;
@ -186,7 +185,7 @@ _func_enter_;
rtw_list_delete(&(pnetwork->list));
}
_exit_critical_bh(&queue->lock, &irqL);
_exit_critical_bh(&queue->lock, &irql);
_func_exit_;
@ -195,14 +194,14 @@ _func_exit_;
struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *free_queue) */
{
unsigned long irqL;
unsigned long irql;
struct wlan_network *pnetwork;
struct __queue *free_queue = &pmlmepriv->free_bss_pool;
struct list_head *plist = NULL;
_func_enter_;
_enter_critical_bh(&free_queue->lock, &irqL);
_enter_critical_bh(&free_queue->lock, &irql);
if (_rtw_queue_empty(free_queue) == true) {
pnetwork = NULL;
@ -224,7 +223,7 @@ _func_enter_;
pmlmepriv->num_of_scanned++;
exit:
_exit_critical_bh(&free_queue->lock, &irqL);
_exit_critical_bh(&free_queue->lock, &irql);
_func_exit_;
@ -235,7 +234,7 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv , struct wlan_network *pnetwo
{
u32 curr_time, delta_time;
u32 lifetime = SCANQUEUE_LIFETIME;
unsigned long irqL;
unsigned long irql;
struct __queue *free_queue = &(pmlmepriv->free_bss_pool);
_func_enter_;
@ -254,11 +253,11 @@ _func_enter_;
if (delta_time < lifetime)/* unit:sec */
goto exit;
}
_enter_critical_bh(&free_queue->lock, &irqL);
_enter_critical_bh(&free_queue->lock, &irql);
rtw_list_delete(&(pnetwork->list));
rtw_list_insert_tail(&(pnetwork->list), &(free_queue->queue));
pmlmepriv->num_of_scanned--;
_exit_critical_bh(&free_queue->lock, &irqL);
_exit_critical_bh(&free_queue->lock, &irql);
exit:
_func_exit_;
@ -316,7 +315,7 @@ _func_exit_;
void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
{
unsigned long irqL;
unsigned long irql;
struct list_head *phead, *plist;
struct wlan_network *pnetwork;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -325,7 +324,7 @@ void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
_func_enter_;
_enter_critical_bh(&scanned_queue->lock, &irqL);
_enter_critical_bh(&scanned_queue->lock, &irql);
phead = get_list_head(scanned_queue);
plist = get_next(phead);
@ -337,7 +336,7 @@ _func_enter_;
_rtw_free_network(pmlmepriv, pnetwork, isfreeall);
}
_exit_critical_bh(&scanned_queue->lock, &irqL);
_exit_critical_bh(&scanned_queue->lock, &irql);
_func_exit_;
}
@ -360,7 +359,6 @@ _func_exit_;
return res;
}
void rtw_generate_random_ibss(u8 *pibss)
{
u32 curtime = rtw_get_current_time();
@ -387,7 +385,7 @@ u16 rtw_get_capability(struct wlan_bssid_ex *bss)
__le16 val;
_func_enter_;
_rtw_memcpy((u8 *)&val, rtw_get_capability_from_ie(bss->IEs), 2);
memcpy((u8 *)&val, rtw_get_capability_from_ie(bss->IEs), 2);
_func_exit_;
return le16_to_cpu(val);
@ -420,28 +418,7 @@ _func_enter_;
_func_exit_;
}
int rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork);
int rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork)
{
int res;
_func_enter_;
res = _rtw_enqueue_network(queue, pnetwork);
_func_exit_;
return res;
}
static struct wlan_network *rtw_dequeue_network(struct __queue *queue)
{
struct wlan_network *pnetwork;
_func_enter_;
pnetwork = _rtw_dequeue_network(queue);
_func_exit_;
return pnetwork;
}
struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv);
struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *free_queue) */
static struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)
{
struct wlan_network *pnetwork;
_func_enter_;
@ -450,15 +427,8 @@ _func_exit_;
return pnetwork;
}
void rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 is_freeall)
{
_func_enter_;
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_network==>ssid=%s\n\n" , pnetwork->network.Ssid.Ssid));
_rtw_free_network(pmlmepriv, pnetwork, is_freeall);
_func_exit_;
}
void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork)
static void rtw_free_network_nolock(struct mlme_priv *pmlmepriv,
struct wlan_network *pnetwork)
{
_func_enter_;
_rtw_free_network_nolock(pmlmepriv, pnetwork);
@ -501,7 +471,7 @@ int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)
return ret;
}
inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
static int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
{
return (a->Ssid.SsidLength == b->Ssid.SsidLength) &&
_rtw_memcmp(a->Ssid.Ssid, b->Ssid.Ssid, a->Ssid.SsidLength);
@ -513,8 +483,8 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst)
__le16 le_scap, le_dcap;
_func_enter_;
_rtw_memcpy((u8 *)&le_scap, rtw_get_capability_from_ie(src->IEs), 2);
_rtw_memcpy((u8 *)&le_dcap, rtw_get_capability_from_ie(dst->IEs), 2);
memcpy((u8 *)&le_scap, rtw_get_capability_from_ie(src->IEs), 2);
memcpy((u8 *)&le_dcap, rtw_get_capability_from_ie(dst->IEs), 2);
s_cap = le16_to_cpu(le_scap);
@ -563,15 +533,12 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
struct adapter *padapter, bool update_ie)
{
long rssi_ori = dst->Rssi;
u8 sq_smp = src->PhyInfo.SignalQuality;
u8 ss_final;
u8 sq_final;
long rssi_final;
_func_enter_;
rtw_hal_antdiv_rssi_compared(padapter, dst, src); /* this will update src.Rssi, need consider again */
/* The rule below is 1/5 for sample value, 4/5 for history value */
@ -597,7 +564,7 @@ _func_enter_;
}
}
if (update_ie)
_rtw_memcpy((u8 *)dst, (u8 *)src, get_wlan_bssid_ex_sz(src));
memcpy((u8 *)dst, (u8 *)src, get_wlan_bssid_ex_sz(src));
dst->PhyInfo.SignalStrength = ss_final;
dst->PhyInfo.SignalQuality = sq_final;
dst->Rssi = rssi_final;
@ -625,7 +592,7 @@ Caller must hold pmlmepriv->lock first.
*/
void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *target)
{
unsigned long irqL;
unsigned long irql;
struct list_head *plist, *phead;
u32 bssid_ex_sz;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
@ -635,7 +602,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
_func_enter_;
_enter_critical_bh(&queue->lock, &irqL);
_enter_critical_bh(&queue->lock, &irql);
phead = get_list_head(queue);
plist = get_next(phead);
@ -660,7 +627,7 @@ _func_enter_;
pnetwork = oldest;
rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna));
_rtw_memcpy(&(pnetwork->network), target, get_wlan_bssid_ex_sz(target));
memcpy(&(pnetwork->network), target, get_wlan_bssid_ex_sz(target));
/* variable initialize */
pnetwork->fixed = false;
pnetwork->last_scanned = rtw_get_current_time();
@ -685,7 +652,7 @@ _func_enter_;
bssid_ex_sz = get_wlan_bssid_ex_sz(target);
target->Length = bssid_ex_sz;
rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna));
_rtw_memcpy(&(pnetwork->network), target, bssid_ex_sz);
memcpy(&(pnetwork->network), target, bssid_ex_sz);
pnetwork->last_scanned = rtw_get_current_time();
@ -711,24 +678,20 @@ _func_enter_;
}
exit:
_exit_critical_bh(&queue->lock, &irqL);
_exit_critical_bh(&queue->lock, &irql);
_func_exit_;
}
void rtw_add_network(struct adapter *adapter, struct wlan_bssid_ex *pnetwork)
static void rtw_add_network(struct adapter *adapter,
struct wlan_bssid_ex *pnetwork)
{
_func_enter_;
#if defined(CONFIG_P2P)
#if defined(CONFIG_88EU_P2P)
rtw_wlan_bssid_ex_remove_p2p_attr(pnetwork, P2P_ATTR_GROUP_INFO);
#endif
#endif
update_current_network(adapter, pnetwork);
rtw_update_scanned_network(adapter, pnetwork);
_func_exit_;
}
@ -791,7 +754,7 @@ _func_exit_;
void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
{
unsigned long irqL;
unsigned long irql;
u32 len;
struct wlan_bssid_ex *pnetwork;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
@ -807,23 +770,23 @@ _func_enter_;
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n****rtw_survey_event_callback: return a wrong bss ***\n"));
return;
}
_enter_critical_bh(&pmlmepriv->lock, &irqL);
_enter_critical_bh(&pmlmepriv->lock, &irql);
/* update IBSS_network 's timestamp */
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) {
if (_rtw_memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) {
struct wlan_network *ibss_wlan = NULL;
unsigned long irqL;
unsigned long irql;
_rtw_memcpy(pmlmepriv->cur_network.network.IEs, pnetwork->IEs, 8);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
memcpy(pmlmepriv->cur_network.network.IEs, pnetwork->IEs, 8);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->MacAddress);
if (ibss_wlan) {
_rtw_memcpy(ibss_wlan->network.IEs , pnetwork->IEs, 8);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
memcpy(ibss_wlan->network.IEs , pnetwork->IEs, 8);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
goto exit;
}
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
}
}
@ -836,7 +799,7 @@ _func_enter_;
exit:
_exit_critical_bh(&pmlmepriv->lock, &irqL);
_exit_critical_bh(&pmlmepriv->lock, &irql);
_func_exit_;
@ -847,17 +810,16 @@ _func_exit_;
void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
{
unsigned long irqL;
unsigned long irql;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
struct mlme_ext_priv *pmlmeext;
_func_enter_;
_enter_critical_bh(&pmlmepriv->lock, &irqL);
_enter_critical_bh(&pmlmepriv->lock, &irql);
if (pmlmepriv->wps_probe_req_ie) {
u32 free_len = pmlmepriv->wps_probe_req_ie_len;
pmlmepriv->wps_probe_req_ie_len = 0;
rtw_mfree(pmlmepriv->wps_probe_req_ie, free_len);
kfree(pmlmepriv->wps_probe_req_ie);
pmlmepriv->wps_probe_req_ie = NULL;
}
@ -891,7 +853,7 @@ _func_enter_;
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("switching to adhoc master\n"));
_rtw_memset(&pdev_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
_rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
rtw_update_registrypriv_dev_network(adapter);
rtw_generate_random_ibss(pibss);
@ -932,7 +894,7 @@ _func_enter_;
indicate_wx_scan_complete_event(adapter);
_exit_critical_bh(&pmlmepriv->lock, &irqL);
_exit_critical_bh(&pmlmepriv->lock, &irql);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
p2p_ps_wk_cmd(adapter, P2P_PS_SCAN_DONE, 0);
@ -955,7 +917,7 @@ void rtw_fwdbg_event_callback(struct adapter *adapter , u8 *pbuf)
static void free_scanqueue(struct mlme_priv *pmlmepriv)
{
unsigned long irqL, irqL0;
unsigned long irql, irql0;
struct __queue *free_queue = &pmlmepriv->free_bss_pool;
struct __queue *scan_queue = &pmlmepriv->scanned_queue;
struct list_head *plist, *phead, *ptemp;
@ -963,8 +925,8 @@ static void free_scanqueue(struct mlme_priv *pmlmepriv)
_func_enter_;
RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+free_scanqueue\n"));
_enter_critical_bh(&scan_queue->lock, &irqL0);
_enter_critical_bh(&free_queue->lock, &irqL);
_enter_critical_bh(&scan_queue->lock, &irql0);
_enter_critical_bh(&free_queue->lock, &irql);
phead = get_list_head(scan_queue);
plist = get_next(phead);
@ -977,8 +939,8 @@ _func_enter_;
pmlmepriv->num_of_scanned--;
}
_exit_critical_bh(&free_queue->lock, &irqL);
_exit_critical_bh(&scan_queue->lock, &irqL0);
_exit_critical_bh(&free_queue->lock, &irql);
_exit_critical_bh(&scan_queue->lock, &irql0);
_func_exit_;
}
@ -988,7 +950,7 @@ _func_exit_;
*/
void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
{
unsigned long irqL;
unsigned long irql;
struct wlan_network *pwlan = NULL;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
struct sta_priv *pstapriv = &adapter->stapriv;
@ -1006,9 +968,9 @@ _func_enter_;
psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress);
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql);
rtw_free_stainfo(adapter, psta);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql);
}
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE)) {
@ -1017,15 +979,15 @@ _func_enter_;
rtw_free_all_stainfo(adapter);
psta = rtw_get_bcmc_stainfo(adapter);
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql);
rtw_free_stainfo(adapter, psta);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql);
rtw_init_bcmc_stainfo(adapter);
}
if (lock_scanned_queue)
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
if (pwlan)
@ -1037,7 +999,7 @@ _func_enter_;
rtw_free_network_nolock(pmlmepriv, pwlan);
if (lock_scanned_queue)
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
pmlmepriv->key_mask = 0;
_func_exit_;
}
@ -1079,7 +1041,6 @@ void rtw_indicate_disconnect(struct adapter *padapter)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_func_enter_;
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("+rtw_indicate_disconnect\n"));
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING | WIFI_UNDER_WPS);
@ -1098,9 +1059,6 @@ _func_enter_;
}
p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1);
#ifdef CONFIG_WOWLAN
if (!padapter->pwrctrlpriv.wowlan_mode)
#endif /* CONFIG_WOWLAN */
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_DISCONNECT, 1);
_func_exit_;
@ -1214,10 +1172,10 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
/* why not use ptarget_wlan?? */
_rtw_memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.Length);
memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.Length);
/* some IEs in pnetwork is wrong, so we should use ptarget_wlan IEs */
cur_network->network.IELength = ptarget_wlan->network.IELength;
_rtw_memcpy(&cur_network->network.IEs[0], &ptarget_wlan->network.IEs[0], MAX_IE_SZ);
memcpy(&cur_network->network.IEs[0], &ptarget_wlan->network.IEs[0], MAX_IE_SZ);
cur_network->aid = pnetwork->join_res;
@ -1261,7 +1219,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
{
unsigned long irqL, irqL2;
unsigned long irql, irql2;
u8 timer_cancelled;
struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL;
struct sta_priv *pstapriv = &adapter->stapriv;
@ -1291,12 +1249,12 @@ _func_enter_;
goto ignore_nolock;
}
_enter_critical_bh(&pmlmepriv->lock, &irqL);
_enter_critical_bh(&pmlmepriv->lock, &irql);
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\nrtw_joinbss_event_callback!! _enter_critical\n"));
if (pnetwork->join_res > 0) {
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
/* s1. find ptarget_wlan */
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
@ -1309,9 +1267,9 @@ _func_enter_;
pcur_sta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
if (pcur_sta) {
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql2);
rtw_free_stainfo(adapter, pcur_sta);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql2);
}
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.MacAddress);
@ -1333,7 +1291,7 @@ _func_enter_;
rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork);
} else {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't find ptarget_wlan when joinbss_event callback\n"));
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
goto ignore_joinbss_callback;
}
@ -1343,7 +1301,7 @@ _func_enter_;
ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
if (ptarget_sta == NULL) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n"));
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
goto ignore_joinbss_callback;
}
}
@ -1363,11 +1321,11 @@ _func_enter_;
} else {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_joinbss_event_callback err: fw_state:%x", get_fwstate(pmlmepriv)));
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
goto ignore_joinbss_callback;
}
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
} else if (pnetwork->join_res == -4) {
rtw_reset_securitypriv(adapter);
@ -1383,7 +1341,7 @@ _func_enter_;
}
ignore_joinbss_callback:
_exit_critical_bh(&pmlmepriv->lock, &irqL);
_exit_critical_bh(&pmlmepriv->lock, &irql);
ignore_nolock:
_func_exit_;
}
@ -1403,13 +1361,16 @@ _func_exit_;
static u8 search_max_mac_id(struct adapter *padapter)
{
u8 mac_id, aid;
u8 mac_id;
#if defined (CONFIG_88EU_AP_MODE)
u8 aid;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct sta_priv *pstapriv = &padapter->stapriv;
#endif
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct sta_priv *pstapriv = &padapter->stapriv;
#if defined (CONFIG_AP_MODE)
#if defined (CONFIG_88EU_AP_MODE)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
for (aid = (pstapriv->max_num_sta); aid > 0; aid--) {
if (pstapriv->sta_aid[aid-1] != NULL)
@ -1444,7 +1405,7 @@ void rtw_stassoc_hw_rpt(struct adapter *adapter, struct sta_info *psta)
void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
{
unsigned long irqL;
unsigned long irql;
struct sta_info *psta;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
struct stassoc_event *pstassoc = (struct stassoc_event *)pbuf;
@ -1456,7 +1417,7 @@ _func_enter_;
if (rtw_access_ctrl(adapter, pstassoc->macaddr) == false)
return;
#if defined (CONFIG_AP_MODE)
#if defined (CONFIG_88EU_AP_MODE)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr);
if (psta) {
@ -1488,20 +1449,20 @@ _func_enter_;
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)
psta->dot118021XPrivacy = adapter->securitypriv.dot11PrivacyAlgrthm;
psta->ieee8021x_blocked = false;
_enter_critical_bh(&pmlmepriv->lock, &irqL);
_enter_critical_bh(&pmlmepriv->lock, &irql);
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) {
if (adapter->stapriv.asoc_sta_count == 2) {
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
if (ptarget_wlan)
ptarget_wlan->fixed = true;
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
rtw_indicate_connect(adapter);
}
}
_exit_critical_bh(&pmlmepriv->lock, &irqL);
_exit_critical_bh(&pmlmepriv->lock, &irql);
mlmeext_sta_add_event_callback(adapter, psta);
exit:
_func_exit_;
@ -1509,7 +1470,7 @@ _func_exit_;
void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
{
unsigned long irqL, irqL2;
unsigned long irql, irql2;
int mac_id = -1;
struct sta_info *psta;
struct wlan_network *pwlan = NULL;
@ -1542,7 +1503,7 @@ _func_enter_;
mlmeext_sta_del_event_callback(adapter);
_enter_critical_bh(&pmlmepriv->lock, &irqL2);
_enter_critical_bh(&pmlmepriv->lock, &irql2);
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
if (pmlmepriv->to_roaming > 0)
@ -1557,39 +1518,39 @@ _func_enter_;
rtw_free_assoc_resources(adapter, 1);
rtw_indicate_disconnect(adapter);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
/* remove the network entry in scanned_queue */
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
if (pwlan) {
pwlan->fixed = false;
rtw_free_network_nolock(pmlmepriv, pwlan);
}
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
_rtw_roaming(adapter, tgt_network);
}
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irql);
rtw_free_stainfo(adapter, psta);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irql);
if (adapter->stapriv.asoc_sta_count == 1) { /* a sta + bc/mc_stainfo (not Ibss_stainfo) */
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
/* free old ibss network */
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
if (pwlan) {
pwlan->fixed = false;
rtw_free_network_nolock(pmlmepriv, pwlan);
}
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
/* re-create ibss */
pdev_network = &(adapter->registrypriv.dev_network);
pibss = adapter->registrypriv.dev_network.MacAddress;
_rtw_memcpy(pdev_network, &tgt_network->network, get_wlan_bssid_ex_sz(&tgt_network->network));
memcpy(pdev_network, &tgt_network->network, get_wlan_bssid_ex_sz(&tgt_network->network));
_rtw_memset(&pdev_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
_rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
rtw_update_registrypriv_dev_network(adapter);
@ -1604,7 +1565,7 @@ _func_enter_;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error=>stadel_event_callback: rtw_createbss_cmd status FAIL***\n "));
}
}
_exit_critical_bh(&pmlmepriv->lock, &irqL2);
_exit_critical_bh(&pmlmepriv->lock, &irql2);
_func_exit_;
}
@ -1621,7 +1582,7 @@ _func_exit_;
*/
void _rtw_join_timeout_handler (struct adapter *adapter)
{
unsigned long irqL;
unsigned long irql;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
int do_join_r;
@ -1633,7 +1594,7 @@ _func_enter_;
return;
_enter_critical_bh(&pmlmepriv->lock, &irqL);
_enter_critical_bh(&pmlmepriv->lock, &irql);
if (pmlmepriv->to_roaming > 0) { /* join timeout caused by roaming */
while (1) {
@ -1656,7 +1617,7 @@ _func_enter_;
rtw_indicate_disconnect(adapter);
free_scanqueue(pmlmepriv);/* */
}
_exit_critical_bh(&pmlmepriv->lock, &irqL);
_exit_critical_bh(&pmlmepriv->lock, &irql);
_func_exit_;
}
@ -1666,13 +1627,13 @@ _func_exit_;
*/
void rtw_scan_timeout_handler (struct adapter *adapter)
{
unsigned long irqL;
unsigned long irql;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
DBG_88E(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv));
_enter_critical_bh(&pmlmepriv->lock, &irqL);
_enter_critical_bh(&pmlmepriv->lock, &irql);
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
_exit_critical_bh(&pmlmepriv->lock, &irqL);
_exit_critical_bh(&pmlmepriv->lock, &irql);
rtw_indicate_scan_done(adapter, true);
}
@ -1693,9 +1654,7 @@ static void rtw_auto_scan_handler(struct adapter *padapter)
void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
{
#ifdef CONFIG_AP_MODE
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
#endif /* CONFIG_AP_MODE */
struct registry_priv *pregistrypriv = &adapter->registrypriv;
if (!adapter)
@ -1709,7 +1668,7 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
rtw_dynamic_chk_wk_cmd(adapter);
if (pregistrypriv->wifi_spec == 1) {
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
#endif
@ -1719,17 +1678,10 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
}
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
rcu_read_lock();
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
if (adapter->pnetdev->br_port &&
(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true)) {
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
if (rcu_dereference(adapter->pnetdev->rx_handler_data) &&
(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true)) {
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
/* expire NAT2.5 entry */
nat25_db_expire(adapter);
@ -1743,9 +1695,7 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
}
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
rcu_read_unlock();
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
}
#define RTW_SCAN_RESULT_EXPIRE 2000
@ -1811,7 +1761,7 @@ pmlmepriv->lock
int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
{
unsigned long irqL;
unsigned long irql;
int ret;
struct list_head *phead;
struct adapter *adapter;
@ -1822,7 +1772,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
_func_enter_;
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
phead = get_list_head(queue);
adapter = (struct adapter *)pmlmepriv->nic_hdl;
pmlmepriv->pscanned = get_next(phead);
@ -1838,9 +1788,6 @@ _func_enter_;
}
if (candidate == NULL) {
DBG_88E("%s: return _FAIL(candidate==NULL)\n", __func__);
#ifdef CONFIG_WOWLAN
_clr_fwstate_(pmlmepriv, _FW_LINKED|_FW_UNDER_LINKING);
#endif
ret = _FAIL;
goto exit;
} else {
@ -1872,7 +1819,7 @@ _func_enter_;
ret = rtw_joinbss_cmd(adapter, candidate);
exit:
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irql);
_func_exit_;
@ -1896,7 +1843,7 @@ _func_enter_;
psetauthparm = (struct setauth_parm *)rtw_zmalloc(sizeof(struct setauth_parm));
if (psetauthparm == NULL) {
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
kfree(pcmd);
res = _FAIL;
goto exit;
}
@ -1934,7 +1881,7 @@ _func_enter_;
}
psetkeyparm = (struct setkey_parm *)rtw_zmalloc(sizeof(struct setkey_parm));
if (psetkeyparm == NULL) {
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
kfree(pcmd);
res = _FAIL;
goto exit;
}
@ -1964,20 +1911,20 @@ _func_enter_;
switch (psetkeyparm->algorithm) {
case _WEP40_:
keylen = 5;
_rtw_memcpy(&(psetkeyparm->key[0]), &(psecuritypriv->dot11DefKey[keyid].skey[0]), keylen);
memcpy(&(psetkeyparm->key[0]), &(psecuritypriv->dot11DefKey[keyid].skey[0]), keylen);
break;
case _WEP104_:
keylen = 13;
_rtw_memcpy(&(psetkeyparm->key[0]), &(psecuritypriv->dot11DefKey[keyid].skey[0]), keylen);
memcpy(&(psetkeyparm->key[0]), &(psecuritypriv->dot11DefKey[keyid].skey[0]), keylen);
break;
case _TKIP_:
keylen = 16;
_rtw_memcpy(&psetkeyparm->key, &psecuritypriv->dot118021XGrpKey[keyid], keylen);
memcpy(&psetkeyparm->key, &psecuritypriv->dot118021XGrpKey[keyid], keylen);
psetkeyparm->grpkey = 1;
break;
case _AES_:
keylen = 16;
_rtw_memcpy(&psetkeyparm->key, &psecuritypriv->dot118021XGrpKey[keyid], keylen);
memcpy(&psetkeyparm->key, &psecuritypriv->dot118021XGrpKey[keyid], keylen);
psetkeyparm->grpkey = 1;
break;
default:
@ -2080,7 +2027,7 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie
ie_len++;
ie[ie_len] = 0; /* PMKID count = 0x0100 */
ie_len++;
_rtw_memcpy(&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16);
memcpy(&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16);
ie_len += 16;
ie[13] += 18;/* PMKID length = 2+16 */
@ -2106,7 +2053,7 @@ _func_enter_;
ndisauthmode, ndissecuritytype));
/* copy fixed ie only */
_rtw_memcpy(out_ie, in_ie, 12);
memcpy(out_ie, in_ie, 12);
ielength = 12;
if ((ndisauthmode == Ndis802_11AuthModeWPA) ||
(ndisauthmode == Ndis802_11AuthModeWPAPSK))
@ -2116,12 +2063,12 @@ _func_enter_;
authmode = _WPA2_IE_ID_;
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
_rtw_memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
ielength += psecuritypriv->wps_ie_len;
} else if ((authmode == _WPA_IE_ID_) || (authmode == _WPA2_IE_ID_)) {
/* copy RSN or SSN */
_rtw_memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1]+2);
memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1]+2);
ielength += psecuritypriv->supplicant_ie[1]+2;
rtw_report_sec_ie(adapter, authmode, psecuritypriv->supplicant_ie);
}
@ -2148,9 +2095,9 @@ void rtw_init_registrypriv_dev_network(struct adapter *adapter)
_func_enter_;
_rtw_memcpy(pdev_network->MacAddress, myhwaddr, ETH_ALEN);
memcpy(pdev_network->MacAddress, myhwaddr, ETH_ALEN);
_rtw_memcpy(&pdev_network->Ssid, &pregistrypriv->ssid, sizeof(struct ndis_802_11_ssid));
memcpy(&pdev_network->Ssid, &pregistrypriv->ssid, sizeof(struct ndis_802_11_ssid));
pdev_network->Configuration.Length = sizeof(struct ndis_802_11_config);
pdev_network->Configuration.BeaconPeriod = 100;
@ -2447,12 +2394,12 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr
void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
{
unsigned long irqL;
unsigned long irql;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_enter_critical_bh(&pmlmepriv->lock, &irqL);
_enter_critical_bh(&pmlmepriv->lock, &irql);
_rtw_roaming(padapter, tgt_network);
_exit_critical_bh(&pmlmepriv->lock, &irqL);
_exit_critical_bh(&pmlmepriv->lock, &irql);
}
void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
{
@ -2470,7 +2417,7 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
DBG_88E("roaming from %s(%pM length:%d\n",
pnetwork->network.Ssid.Ssid, pnetwork->network.MacAddress,
pnetwork->network.Ssid.SsidLength);
_rtw_memcpy(&pmlmepriv->assoc_ssid, &pnetwork->network.Ssid, sizeof(struct ndis_802_11_ssid));
memcpy(&pmlmepriv->assoc_ssid, &pnetwork->network.Ssid, sizeof(struct ndis_802_11_ssid));
pmlmepriv->assoc_by_bssid = false;

File diff suppressed because it is too large Load diff

View file

@ -125,51 +125,10 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv)
pmp_priv->network_macaddr[5] = 0x55;
pnetwork = &pmp_priv->mp_network.network;
_rtw_memcpy(pnetwork->MacAddress, pmp_priv->network_macaddr, ETH_ALEN);
memcpy(pnetwork->MacAddress, pmp_priv->network_macaddr, ETH_ALEN);
pnetwork->Ssid.SsidLength = 8;
_rtw_memcpy(pnetwork->Ssid.Ssid, "mp_871x", pnetwork->Ssid.SsidLength);
}
static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
{
int i, res;
struct mp_xmit_frame *pmp_xmitframe;
if (pmp_priv == NULL)
return _FAIL;
_rtw_init_queue(&pmp_priv->free_mp_xmitqueue);
pmp_priv->pallocated_mp_xmitframe_buf = NULL;
pmp_priv->pallocated_mp_xmitframe_buf = rtw_zmalloc(NR_MP_XMITFRAME * sizeof(struct mp_xmit_frame) + 4);
if (pmp_priv->pallocated_mp_xmitframe_buf == NULL) {
res = _FAIL;
goto _exit_init_mp_priv;
}
pmp_priv->pmp_xmtframe_buf = pmp_priv->pallocated_mp_xmitframe_buf + 4 - ((size_t)(pmp_priv->pallocated_mp_xmitframe_buf) & 3);
pmp_xmitframe = (struct mp_xmit_frame *)pmp_priv->pmp_xmtframe_buf;
for (i = 0; i < NR_MP_XMITFRAME; i++) {
_rtw_init_listhead(&pmp_xmitframe->list);
rtw_list_insert_tail(&pmp_xmitframe->list, &pmp_priv->free_mp_xmitqueue.queue);
pmp_xmitframe->pkt = NULL;
pmp_xmitframe->frame_tag = MP_FRAMETAG;
pmp_xmitframe->padapter = pmp_priv->papdater;
pmp_xmitframe++;
}
pmp_priv->free_mp_xmitframe_cnt = NR_MP_XMITFRAME;
res = _SUCCESS;
_exit_init_mp_priv:
return res;
memcpy(pnetwork->Ssid.Ssid, "mp_871x", pnetwork->Ssid.SsidLength);
}
static void mp_init_xmit_attrib(struct mp_tx *pmptx, struct adapter *padapter)
@ -232,10 +191,8 @@ s32 init_mp_priv(struct adapter *padapter)
void free_mp_priv(struct mp_priv *pmp_priv)
{
if (pmp_priv->pallocated_mp_xmitframe_buf) {
rtw_mfree(pmp_priv->pallocated_mp_xmitframe_buf, 0);
pmp_priv->pallocated_mp_xmitframe_buf = NULL;
}
kfree(pmp_priv->pallocated_mp_xmitframe_buf);
pmp_priv->pallocated_mp_xmitframe_buf = NULL;
pmp_priv->pmp_xmtframe_buf = NULL;
}
@ -343,7 +300,6 @@ static void disable_dm(struct adapter *padapter)
{
u8 v8;
/* 3 1. disable firmware dynamic mechanism */
/* disable Power Training, Rate Adaptive */
v8 = rtw_read8(padapter, REG_BCN_CTRL);
@ -410,9 +366,9 @@ s32 mp_start_test(struct adapter *padapter)
/* 3 1. initialize a new struct wlan_bssid_ex */
/* _rtw_memset(&bssid, 0, sizeof(struct wlan_bssid_ex)); */
_rtw_memcpy(bssid.MacAddress, pmppriv->network_macaddr, ETH_ALEN);
memcpy(bssid.MacAddress, pmppriv->network_macaddr, ETH_ALEN);
bssid.Ssid.SsidLength = strlen("mp_pseudo_adhoc");
_rtw_memcpy(bssid.Ssid.Ssid, (u8 *)"mp_pseudo_adhoc", bssid.Ssid.SsidLength);
memcpy(bssid.Ssid.Ssid, (u8 *)"mp_pseudo_adhoc", bssid.Ssid.SsidLength);
bssid.InfrastructureMode = Ndis802_11IBSS;
bssid.NetworkTypeInUse = Ndis802_11DS;
bssid.IELength = 0;
@ -457,7 +413,7 @@ s32 mp_start_test(struct adapter *padapter)
tgt_network->join_res = 1;
tgt_network->aid = 1;
psta->aid = 1;
_rtw_memcpy(&tgt_network->network, &bssid, length);
memcpy(&tgt_network->network, &bssid, length);
rtw_indicate_connect(padapter);
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
@ -512,43 +468,8 @@ end_of_mp_stop_test:
_exit_critical_bh(&pmlmepriv->lock, &irqL);
}
}
/*---------------------------hal\rtl8192c\MPT_Phy.c---------------------------*/
/*-----------------------------------------------------------------------------
* Function: mpt_SwitchRfSetting
*
* Overview: Change RF Setting when we siwthc channel/rate/BW for MP.
*
* Input: struct adapter * pAdapter
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
* 01/08/2009 MHC Suggestion from SD3 Willis for 92S series.
* 01/09/2009 MHC Add CCK modification for 40MHZ. Suggestion from SD3.
*
*---------------------------------------------------------------------------*/
static void mpt_SwitchRfSetting(struct adapter *pAdapter)
{
Hal_mpt_SwitchRfSetting(pAdapter);
}
/*---------------------------hal\rtl8192c\MPT_Phy.c---------------------------*/
/*---------------------------hal\rtl8192c\MPT_HelperFunc.c---------------------------*/
static void MPT_CCKTxPowerAdjust(struct adapter *Adapter, bool bInCH14)
{
Hal_MPT_CCKTxPowerAdjust(Adapter, bInCH14);
}
static void MPT_CCKTxPowerAdjustbyIndex(struct adapter *pAdapter, bool beven)
{
Hal_MPT_CCKTxPowerAdjustbyIndex(pAdapter, beven);
}
/*---------------------------hal\rtl8192c\MPT_HelperFunc.c---------------------------*/
/*
* SetChannel
* Description
@ -569,17 +490,6 @@ void SetBandwidth(struct adapter *pAdapter)
Hal_SetBandwidth(pAdapter);
}
static void SetCCKTxPower(struct adapter *pAdapter, u8 *TxPower)
{
Hal_SetCCKTxPower(pAdapter, TxPower);
}
static void SetOFDMTxPower(struct adapter *pAdapter, u8 *TxPower)
{
Hal_SetOFDMTxPower(pAdapter, TxPower);
}
void SetAntenna(struct adapter *pAdapter)
{
Hal_SetAntenna(pAdapter);
@ -595,19 +505,6 @@ void SetTxPower(struct adapter *pAdapter)
Hal_SetTxPower(pAdapter);
}
static void SetTxAGCOffset(struct adapter *pAdapter, u32 ulTxAGCOffset)
{
u32 TxAGCOffset_B, TxAGCOffset_C, TxAGCOffset_D, tmpAGC;
TxAGCOffset_B = (ulTxAGCOffset&0x000000ff);
TxAGCOffset_C = ((ulTxAGCOffset&0x0000ff00)>>8);
TxAGCOffset_D = ((ulTxAGCOffset&0x00ff0000)>>16);
tmpAGC = (TxAGCOffset_D<<8 | TxAGCOffset_C<<4 | TxAGCOffset_B);
write_bbreg(pAdapter, rFPGA0_TxGainStage,
(bXBTxAGC|bXCTxAGC|bXDTxAGC), tmpAGC);
}
void SetDataRate(struct adapter *pAdapter)
{
Hal_SetDataRate(pAdapter);
@ -623,16 +520,6 @@ s32 SetThermalMeter(struct adapter *pAdapter, u8 target_ther)
return Hal_SetThermalMeter(pAdapter, target_ther);
}
static void TriggerRFThermalMeter(struct adapter *pAdapter)
{
Hal_TriggerRFThermalMeter(pAdapter);
}
static u8 ReadRFThermalMeter(struct adapter *pAdapter)
{
return Hal_ReadRFThermalMeter(pAdapter);
}
void GetThermalMeter(struct adapter *pAdapter, u8 *value)
{
Hal_GetThermalMeter(pAdapter, value);
@ -656,18 +543,6 @@ void SetCarrierSuppressionTx(struct adapter *pAdapter, u8 bStart)
Hal_SetCarrierSuppressionTx(pAdapter, bStart);
}
static void SetCCKContinuousTx(struct adapter *pAdapter, u8 bStart)
{
PhySetTxPowerLevel(pAdapter);
Hal_SetCCKContinuousTx(pAdapter, bStart);
}
static void SetOFDMContinuousTx(struct adapter *pAdapter, u8 bStart)
{
PhySetTxPowerLevel(pAdapter);
Hal_SetOFDMContinuousTx(pAdapter, bStart);
} /* mpt_StartOfdmContTx */
void SetContinuousTx(struct adapter *pAdapter, u8 bStart)
{
PhySetTxPowerLevel(pAdapter);
@ -744,8 +619,8 @@ static int mp_xmit_packet_thread(void *context)
}
}
_rtw_memcpy((u8 *)(pxmitframe->buf_addr+TXDESC_OFFSET), pmptx->buf, pmptx->write_size);
_rtw_memcpy(&(pxmitframe->attrib), &(pmptx->attrib), sizeof(struct pkt_attrib));
memcpy((u8 *)(pxmitframe->buf_addr+TXDESC_OFFSET), pmptx->buf, pmptx->write_size);
memcpy(&(pxmitframe->attrib), &(pmptx->attrib), sizeof(struct pkt_attrib));
dump_mpframe(padapter, pxmitframe);
@ -764,8 +639,7 @@ static int mp_xmit_packet_thread(void *context)
}
exit:
/* DBG_88E("%s:pkTx Exit\n", __func__); */
rtw_mfree(pmptx->pallocated_buf, pmptx->buf_size);
kfree(pmptx->pallocated_buf);
pmptx->pallocated_buf = NULL;
pmptx->stop = 1;
@ -775,7 +649,7 @@ exit:
void fill_txdesc_for_mp(struct adapter *padapter, struct tx_desc *ptxdesc)
{
struct mp_priv *pmp_priv = &padapter->mppriv;
_rtw_memcpy(ptxdesc, &(pmp_priv->tx.desc), TXDESC_SIZE);
memcpy(ptxdesc, &(pmp_priv->tx.desc), TXDESC_SIZE);
}
void SetPacketTx(struct adapter *padapter)
@ -799,9 +673,9 @@ void SetPacketTx(struct adapter *padapter)
/* 3 1. update_attrib() */
pattrib = &pmp_priv->tx.attrib;
_rtw_memcpy(pattrib->src, padapter->eeprompriv.mac_addr, ETH_ALEN);
_rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->src, padapter->eeprompriv.mac_addr, ETH_ALEN);
memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
bmcast = IS_MCAST(pattrib->ra);
if (bmcast) {
pattrib->mac_id = 1;
@ -816,8 +690,7 @@ void SetPacketTx(struct adapter *padapter)
/* 3 2. allocate xmit buffer */
pkt_size = pattrib->last_txcmdsz;
if (pmp_priv->tx.pallocated_buf)
rtw_mfree(pmp_priv->tx.pallocated_buf, pmp_priv->tx.buf_size);
kfree(pmp_priv->tx.pallocated_buf);
pmp_priv->tx.write_size = pkt_size;
pmp_priv->tx.buf_size = pkt_size + XMITBUF_ALIGN_SZ;
pmp_priv->tx.pallocated_buf = rtw_zmalloc(pmp_priv->tx.buf_size);
@ -877,9 +750,9 @@ void SetPacketTx(struct adapter *padapter)
/* 3 4. make wlan header, make_wlanhdr() */
hdr = (struct rtw_ieee80211_hdr *)pkt_start;
SetFrameSubType(&hdr->frame_ctl, pattrib->subtype);
_rtw_memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); /* DA */
_rtw_memcpy(hdr->addr2, pattrib->src, ETH_ALEN); /* SA */
_rtw_memcpy(hdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); /* RA, BSSID */
memcpy(hdr->addr1, pattrib->dst, ETH_ALEN); /* DA */
memcpy(hdr->addr2, pattrib->src, ETH_ALEN); /* SA */
memcpy(hdr->addr3, get_bssid(&padapter->mlmepriv), ETH_ALEN); /* RA, BSSID */
/* 3 5. make payload */
ptr = pkt_start + pattrib->hdrlen;
@ -1034,7 +907,7 @@ u32 mp_query_psd(struct adapter *pAdapter, u8 *data)
sscanf(data, "pts =%d, start =%d, stop =%d", &psd_pts, &psd_start, &psd_stop);
}
_rtw_memset(data, '\0', sizeof(data));
_rtw_memset(data, '\0', sizeof(*data));
i = psd_start;
while (i < psd_stop) {

View file

@ -27,8 +27,8 @@
#include <rtw_mp_ioctl.h>
/* oid_rtl_seg_81_85 section start **************** */
int oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv)
/* rtl8188eu_oid_rtl_seg_81_85 section start **************** */
int rtl8188eu_oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -52,8 +52,8 @@ _func_exit_;
return status;
}
/* oid_rtl_seg_81_87_80 section start **************** */
int oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv)
/* rtl8188eu_oid_rtl_seg_81_87_80 section start **************** */
int rtl8188eu_oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv)
{
struct bb_reg_param *pbbreg;
u16 offset;
@ -63,7 +63,7 @@ int oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_write_bb_reg_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_write_bb_reg_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -80,7 +80,7 @@ _func_enter_;
value = pbbreg->value;
RT_TRACE(_module_mp_, _drv_notice_,
("oid_rt_pro_write_bb_reg_hdl: offset=0x%03X value=0x%08X\n",
("rtl8188eu_oid_rt_pro_write_bb_reg_hdl: offset=0x%03X value=0x%08X\n",
offset, value));
_irqlevel_changed_(&oldirql, LOWER);
@ -92,7 +92,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv)
{
struct bb_reg_param *pbbreg;
u16 offset;
@ -102,7 +102,7 @@ int oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_read_bb_reg_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_read_bb_reg_hdl\n"));
if (poid_par_priv->type_of_oid != QUERY_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -124,14 +124,14 @@ _func_enter_;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
RT_TRACE(_module_mp_, _drv_notice_,
("-oid_rt_pro_read_bb_reg_hdl: offset=0x%03X value:0x%08X\n",
("-rtl8188eu_oid_rt_pro_read_bb_reg_hdl: offset=0x%03X value:0x%08X\n",
offset, value));
_func_exit_;
return status;
}
/* */
int oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv)
{
struct rf_reg_param *pbbreg;
u8 path;
@ -142,7 +142,7 @@ int oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_write_rf_reg_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_write_rf_reg_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -164,7 +164,7 @@ _func_enter_;
value = pbbreg->value;
RT_TRACE(_module_mp_, _drv_notice_,
("oid_rt_pro_write_rf_reg_hdl: path=%d offset=0x%02X value=0x%05X\n",
("rtl8188eu_oid_rt_pro_write_rf_reg_hdl: path=%d offset=0x%02X value=0x%05X\n",
path, offset, value));
_irqlevel_changed_(&oldirql, LOWER);
@ -176,7 +176,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv)
{
struct rf_reg_param *pbbreg;
u8 path;
@ -187,7 +187,7 @@ int oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_read_rf_reg_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_read_rf_reg_hdl\n"));
if (poid_par_priv->type_of_oid != QUERY_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -214,19 +214,19 @@ _func_enter_;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
RT_TRACE(_module_mp_, _drv_notice_,
("-oid_rt_pro_read_rf_reg_hdl: path=%d offset=0x%02X value=0x%05X\n",
("-rtl8188eu_oid_rt_pro_read_rf_reg_hdl: path=%d offset=0x%02X value=0x%05X\n",
path, offset, value));
_func_exit_;
return status;
}
/* oid_rtl_seg_81_87_00 section end**************** */
/* rtl8188eu_oid_rtl_seg_81_87_00 section end**************** */
/* */
/* oid_rtl_seg_81_80_00 section start **************** */
/* rtl8188eu_oid_rtl_seg_81_80_00 section start **************** */
/* */
int oid_rt_pro_set_data_rate_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_data_rate_hdl(struct oid_par_priv *poid_par_priv)
{
u32 ratevalue;/* 4 */
int status = NDIS_STATUS_SUCCESS;
@ -235,7 +235,7 @@ int oid_rt_pro_set_data_rate_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_,
("+oid_rt_pro_set_data_rate_hdl\n"));
("+rtl8188eu_oid_rt_pro_set_data_rate_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -245,7 +245,7 @@ _func_enter_;
ratevalue = *((u32 *)poid_par_priv->information_buf);/* 4 */
RT_TRACE(_module_mp_, _drv_notice_,
("oid_rt_pro_set_data_rate_hdl: data rate idx=%d\n", ratevalue));
("rtl8188eu_oid_rt_pro_set_data_rate_hdl: data rate idx=%d\n", ratevalue));
if (ratevalue >= MPT_RATE_LAST)
return NDIS_STATUS_INVALID_DATA;
@ -260,7 +260,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv)
{
u32 mode;
int status = NDIS_STATUS_SUCCESS;
@ -268,7 +268,7 @@ int oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_start_test_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_start_test_hdl\n"));
if (Adapter->registrypriv.mp_mode == 0)
return NDIS_STATUS_NOT_ACCEPTED;
@ -291,14 +291,14 @@ _func_enter_;
exit:
_irqlevel_changed_(&oldirql, RAISE);
RT_TRACE(_module_mp_, _drv_notice_, ("-oid_rt_pro_start_test_hdl: mp_mode=%d\n", Adapter->mppriv.mode));
RT_TRACE(_module_mp_, _drv_notice_, ("-rtl8188eu_oid_rt_pro_start_test_hdl: mp_mode=%d\n", Adapter->mppriv.mode));
_func_exit_;
return status;
}
/* */
int oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -321,7 +321,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv *poid_par_priv)
{
u32 Channel;
int status = NDIS_STATUS_SUCCESS;
@ -329,7 +329,7 @@ int oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_set_channel_direct_call_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_set_channel_direct_call_hdl\n"));
if (poid_par_priv->information_buf_len != sizeof(u32))
return NDIS_STATUS_INVALID_LENGTH;
@ -343,7 +343,7 @@ _func_enter_;
return NDIS_STATUS_NOT_ACCEPTED;
Channel = *((u32 *)poid_par_priv->information_buf);
RT_TRACE(_module_mp_, _drv_notice_, ("oid_rt_pro_set_channel_direct_call_hdl: Channel=%d\n", Channel));
RT_TRACE(_module_mp_, _drv_notice_, ("rtl8188eu_oid_rt_pro_set_channel_direct_call_hdl: Channel=%d\n", Channel));
if (Channel > 14)
return NDIS_STATUS_NOT_ACCEPTED;
Adapter->mppriv.channel = Channel;
@ -357,7 +357,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv)
{
u16 bandwidth;
u16 channel_offset;
@ -367,7 +367,7 @@ int oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_info_,
("+oid_rt_set_bandwidth_hdl\n"));
("+rtl8188eu_oid_rt_set_bandwidth_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -388,7 +388,7 @@ _func_enter_;
_irqlevel_changed_(&oldirql, RAISE);
RT_TRACE(_module_mp_, _drv_notice_,
("-oid_rt_set_bandwidth_hdl: bandwidth=%d channel_offset=%d\n",
("-rtl8188eu_oid_rt_set_bandwidth_hdl: bandwidth=%d channel_offset=%d\n",
bandwidth, channel_offset));
_func_exit_;
@ -396,7 +396,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv *poid_par_priv)
{
u32 antenna;
int status = NDIS_STATUS_SUCCESS;
@ -404,7 +404,7 @@ int oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_set_antenna_bb_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_set_antenna_bb_hdl\n"));
if (poid_par_priv->information_buf_len != sizeof(u32))
return NDIS_STATUS_INVALID_LENGTH;
@ -415,7 +415,7 @@ _func_enter_;
Adapter->mppriv.antenna_tx = (u16)((antenna & 0xFFFF0000) >> 16);
Adapter->mppriv.antenna_rx = (u16)(antenna & 0x0000FFFF);
RT_TRACE(_module_mp_, _drv_notice_,
("oid_rt_pro_set_antenna_bb_hdl: tx_ant=0x%04x rx_ant=0x%04x\n",
("rtl8188eu_oid_rt_pro_set_antenna_bb_hdl: tx_ant=0x%04x rx_ant=0x%04x\n",
Adapter->mppriv.antenna_tx, Adapter->mppriv.antenna_rx));
_irqlevel_changed_(&oldirql, LOWER);
@ -431,7 +431,7 @@ _func_exit_;
return status;
}
int oid_rt_pro_set_tx_power_control_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_tx_power_control_hdl(struct oid_par_priv *poid_par_priv)
{
u32 tx_pwr_idx;
int status = NDIS_STATUS_SUCCESS;
@ -439,7 +439,7 @@ int oid_rt_pro_set_tx_power_control_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_info_, ("+oid_rt_pro_set_tx_power_control_hdl\n"));
RT_TRACE(_module_mp_, _drv_info_, ("+rtl8188eu_oid_rt_pro_set_tx_power_control_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -454,7 +454,7 @@ _func_enter_;
Adapter->mppriv.txpoweridx = (u8)tx_pwr_idx;
RT_TRACE(_module_mp_, _drv_notice_,
("oid_rt_pro_set_tx_power_control_hdl: idx=0x%2x\n",
("rtl8188eu_oid_rt_pro_set_tx_power_control_hdl: idx=0x%2x\n",
Adapter->mppriv.txpoweridx));
_irqlevel_changed_(&oldirql, LOWER);
@ -467,9 +467,9 @@ _func_exit_;
}
/* */
/* oid_rtl_seg_81_80_20 section start **************** */
/* rtl8188eu_oid_rtl_seg_81_80_20 section start **************** */
/* */
int oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -493,7 +493,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -504,7 +504,7 @@ _func_enter_;
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
RT_TRACE(_module_mp_, _drv_alert_, ("===> oid_rt_pro_query_rx_packet_received_hdl.\n"));
RT_TRACE(_module_mp_, _drv_alert_, ("===> rtl8188eu_oid_rt_pro_query_rx_packet_received_hdl.\n"));
if (poid_par_priv->information_buf_len == sizeof(u32)) {
*(u32 *)poid_par_priv->information_buf = Adapter->mppriv.rx_pktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@ -518,7 +518,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -529,7 +529,7 @@ _func_enter_;
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
RT_TRACE(_module_mp_, _drv_alert_, ("===> oid_rt_pro_query_rx_packet_crc32_error_hdl.\n"));
RT_TRACE(_module_mp_, _drv_alert_, ("===> rtl8188eu_oid_rt_pro_query_rx_packet_crc32_error_hdl.\n"));
if (poid_par_priv->information_buf_len == sizeof(u32)) {
*(u32 *)poid_par_priv->information_buf = Adapter->mppriv.rx_crcerrpktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@ -544,7 +544,7 @@ _func_exit_;
}
/* */
int oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -556,7 +556,7 @@ _func_enter_;
return status;
}
RT_TRACE(_module_mp_, _drv_alert_, ("===> oid_rt_pro_reset_tx_packet_sent_hdl.\n"));
RT_TRACE(_module_mp_, _drv_alert_, ("===> rtl8188eu_oid_rt_pro_reset_tx_packet_sent_hdl.\n"));
Adapter->mppriv.tx_pktcount = 0;
_func_exit_;
@ -564,7 +564,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -588,7 +588,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -609,14 +609,14 @@ _func_exit_;
return status;
}
/* */
int oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
_func_enter_;
RT_TRACE(_module_mp_, _drv_info_, ("+oid_rt_get_phy_rx_packet_received_hdl\n"));
RT_TRACE(_module_mp_, _drv_info_, ("+rtl8188eu_oid_rt_get_phy_rx_packet_received_hdl\n"));
if (poid_par_priv->type_of_oid != QUERY_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -630,21 +630,21 @@ _func_enter_;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
RT_TRACE(_module_mp_, _drv_notice_, ("-oid_rt_get_phy_rx_packet_received_hdl: recv_ok=%d\n", *(u32 *)poid_par_priv->information_buf));
RT_TRACE(_module_mp_, _drv_notice_, ("-rtl8188eu_oid_rt_get_phy_rx_packet_received_hdl: recv_ok=%d\n", *(u32 *)poid_par_priv->information_buf));
_func_exit_;
return status;
}
/* */
int oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
_func_enter_;
RT_TRACE(_module_mp_, _drv_info_, ("+oid_rt_get_phy_rx_packet_crc32_error_hdl\n"));
RT_TRACE(_module_mp_, _drv_info_, ("+rtl8188eu_oid_rt_get_phy_rx_packet_crc32_error_hdl\n"));
if (poid_par_priv->type_of_oid != QUERY_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -660,15 +660,15 @@ _func_enter_;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
RT_TRACE(_module_mp_, _drv_info_,
("-oid_rt_get_phy_rx_packet_crc32_error_hdl: recv_err =%d\n",
("-rtl8188eu_oid_rt_get_phy_rx_packet_crc32_error_hdl: recv_err =%d\n",
*(u32 *)poid_par_priv->information_buf));
_func_exit_;
return status;
}
/* oid_rtl_seg_81_80_20 section end **************** */
int oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv)
/* rtl8188eu_oid_rtl_seg_81_80_20 section end **************** */
int rtl8188eu_oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv)
{
u32 bStartTest;
int status = NDIS_STATUS_SUCCESS;
@ -676,7 +676,7 @@ int oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_set_continuous_tx_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_set_continuous_tx_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -703,7 +703,7 @@ _func_exit_;
return status;
}
int oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_priv)
{
u32 bStartTest;
int status = NDIS_STATUS_SUCCESS;
@ -711,7 +711,7 @@ int oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_alert_, ("+oid_rt_pro_set_single_carrier_tx_hdl\n"));
RT_TRACE(_module_mp_, _drv_alert_, ("+rtl8188eu_oid_rt_pro_set_single_carrier_tx_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -738,7 +738,7 @@ _func_exit_;
return status;
}
int oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *poid_par_priv)
{
u32 bStartTest;
int status = NDIS_STATUS_SUCCESS;
@ -746,7 +746,7 @@ int oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *poid_par_priv
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_set_carrier_suppression_tx_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_set_carrier_suppression_tx_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -773,7 +773,7 @@ _func_exit_;
return status;
}
int oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv)
{
u32 bStartTest;
int status = NDIS_STATUS_SUCCESS;
@ -781,7 +781,7 @@ int oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_alert_, ("+oid_rt_pro_set_single_tone_tx_hdl\n"));
RT_TRACE(_module_mp_, _drv_alert_, ("+rtl8188eu_oid_rt_pro_set_single_tone_tx_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -797,12 +797,12 @@ _func_exit_;
return status;
}
int oid_rt_pro_set_modulation_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_modulation_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
int oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv)
{
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
int status = NDIS_STATUS_SUCCESS;
@ -819,14 +819,14 @@ _func_exit_;
return status;
}
/* oid_rtl_seg_81_80_00 section end **************** */
/* rtl8188eu_oid_rtl_seg_81_80_00 section end **************** */
/* */
int oid_rt_pro8711_join_bss_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro8711_join_bss_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv)
{
struct mp_rw_reg *RegRWStruct;
u32 offset, width;
@ -836,7 +836,7 @@ int oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_info_,
("+oid_rt_pro_read_register_hdl\n"));
("+rtl8188eu_oid_rt_pro_read_register_hdl\n"));
if (poid_par_priv->type_of_oid != QUERY_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -863,7 +863,7 @@ _func_enter_;
break;
}
RT_TRACE(_module_mp_, _drv_notice_,
("oid_rt_pro_read_register_hdl: offset:0x%04X value:0x%X\n",
("rtl8188eu_oid_rt_pro_read_register_hdl: offset:0x%04X value:0x%X\n",
offset, RegRWStruct->value));
_irqlevel_changed_(&oldirql, RAISE);
@ -875,7 +875,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv)
{
struct mp_rw_reg *RegRWStruct;
u32 offset, width, value;
@ -885,7 +885,7 @@ int oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_info_,
("+oid_rt_pro_write_register_hdl\n"));
("+rtl8188eu_oid_rt_pro_write_register_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -926,7 +926,7 @@ _func_enter_;
_irqlevel_changed_(&oldirql, RAISE);
RT_TRACE(_module_mp_, _drv_info_,
("-oid_rt_pro_write_register_hdl: offset=0x%08X width=%d value=0x%X\n",
("-rtl8188eu_oid_rt_pro_write_register_hdl: offset=0x%08X width=%d value=0x%X\n",
offset, width, value));
_func_exit_;
@ -934,69 +934,69 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_burst_read_register_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_burst_read_register_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_write16_eeprom_hdl (struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_write16_eeprom_hdl (struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_wr_attrib_mem_hdl (struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_wr_attrib_mem_hdl (struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_poll_rx_status_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_poll_rx_status_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_cfg_debug_message_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_cfg_debug_message_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv)
{
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -1021,7 +1021,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
u8 thermal = 0;
@ -1029,7 +1029,7 @@ int oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_get_thermal_meter_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_get_thermal_meter_hdl\n"));
if (poid_par_priv->type_of_oid != QUERY_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -1049,12 +1049,12 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -1071,7 +1071,7 @@ _func_enter_;
enable = *(u8 *)poid_par_priv->information_buf;
RT_TRACE(_module_mp_, _drv_notice_,
("+oid_rt_pro_set_power_tracking_hdl: enable =%d\n", enable));
("+rtl8188eu_oid_rt_pro_set_power_tracking_hdl: enable =%d\n", enable));
SetPowerTracking(Adapter, enable);
} else {
@ -1084,54 +1084,58 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* oid_rtl_seg_87_12_00 section start **************** */
int oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv)
/* rtl8188eu_oid_rtl_seg_87_12_00 section start **************** */
int rtl8188eu_oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
int oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
/* */
/* */
int oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_query_dr_variable_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
int rtl8188eu_oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv)
{
return NDIS_STATUS_SUCCESS;
}
/* */
int oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv)
{
struct efuse_access_struct *pefuse;
u8 *data;
@ -1153,19 +1157,19 @@ _func_enter_;
data = pefuse->data;
RT_TRACE(_module_mp_, _drv_notice_,
("+oid_rt_pro_read_efuse_hd: buf_len=%d addr=%d cnts=%d\n",
("+rtl8188eu_oid_rt_pro_read_efuse_hd: buf_len=%d addr=%d cnts=%d\n",
poid_par_priv->information_buf_len, addr, cnts));
EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (void *)&max_available_size, false);
if ((addr + cnts) > max_available_size) {
RT_TRACE(_module_mp_, _drv_err_, ("!oid_rt_pro_read_efuse_hdl: parameter error!\n"));
RT_TRACE(_module_mp_, _drv_err_, ("!rtl8188eu_oid_rt_pro_read_efuse_hdl: parameter error!\n"));
return NDIS_STATUS_NOT_ACCEPTED;
}
_irqlevel_changed_(&oldirql, LOWER);
if (rtw_efuse_access(Adapter, false, addr, cnts, data) == _FAIL) {
RT_TRACE(_module_mp_, _drv_err_, ("!oid_rt_pro_read_efuse_hdl: rtw_efuse_access FAIL!\n"));
RT_TRACE(_module_mp_, _drv_err_, ("!rtl8188eu_oid_rt_pro_read_efuse_hdl: rtw_efuse_access FAIL!\n"));
status = NDIS_STATUS_FAILURE;
} else {
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@ -1177,7 +1181,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv)
{
struct efuse_access_struct *pefuse;
u8 *data;
@ -1197,13 +1201,13 @@ _func_enter_;
data = pefuse->data;
RT_TRACE(_module_mp_, _drv_notice_,
("+oid_rt_pro_write_efuse_hdl: buf_len=%d addr=0x%04x cnts=%d\n",
("+rtl8188eu_oid_rt_pro_write_efuse_hdl: buf_len=%d addr=0x%04x cnts=%d\n",
poid_par_priv->information_buf_len, addr, cnts));
EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (void *)&max_available_size, false);
if ((addr + cnts) > max_available_size) {
RT_TRACE(_module_mp_, _drv_err_, ("!oid_rt_pro_write_efuse_hdl: parameter error"));
RT_TRACE(_module_mp_, _drv_err_, ("!rtl8188eu_oid_rt_pro_write_efuse_hdl: parameter error"));
return NDIS_STATUS_NOT_ACCEPTED;
}
@ -1217,7 +1221,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv)
{
struct pgpkt *ppgpkt;
int status = NDIS_STATUS_SUCCESS;
@ -1236,7 +1240,7 @@ _func_enter_;
if (poid_par_priv->type_of_oid == QUERY_OID) {
RT_TRACE(_module_mp_, _drv_notice_,
("oid_rt_pro_rw_efuse_pgpkt_hdl: Read offset=0x%x\n",\
("rtl8188eu_oid_rt_pro_rw_efuse_pgpkt_hdl: Read offset=0x%x\n",\
ppgpkt->offset));
Efuse_PowerSwitch(Adapter, false, true);
@ -1247,7 +1251,7 @@ _func_enter_;
Efuse_PowerSwitch(Adapter, false, false);
} else {
RT_TRACE(_module_mp_, _drv_notice_,
("oid_rt_pro_rw_efuse_pgpkt_hdl: Write offset=0x%x word_en=0x%x\n",\
("rtl8188eu_oid_rt_pro_rw_efuse_pgpkt_hdl: Write offset=0x%x word_en=0x%x\n",\
ppgpkt->offset, ppgpkt->word_en));
Efuse_PowerSwitch(Adapter, true, true);
@ -1261,14 +1265,14 @@ _func_enter_;
_irqlevel_changed_(&oldirql, RAISE);
RT_TRACE(_module_mp_, _drv_info_,
("-oid_rt_pro_rw_efuse_pgpkt_hdl: status=0x%08X\n", status));
("-rtl8188eu_oid_rt_pro_rw_efuse_pgpkt_hdl: status=0x%08X\n", status));
_func_exit_;
return status;
}
/* */
int oid_rt_get_efuse_current_size_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_get_efuse_current_size_hdl(struct oid_par_priv *poid_par_priv)
{
u16 size;
u8 ret;
@ -1297,7 +1301,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
struct adapter *Adapter = (struct adapter *)(poid_par_priv->adapter_context);
@ -1314,7 +1318,7 @@ _func_enter_;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
RT_TRACE(_module_mp_, _drv_info_,
("-oid_rt_get_efuse_max_size_hdl: size=%d status=0x%08X\n",
("-rtl8188eu_oid_rt_get_efuse_max_size_hdl: size=%d status=0x%08X\n",
*(int *)poid_par_priv->information_buf, status));
_func_exit_;
@ -1322,27 +1326,27 @@ _func_exit_;
return status;
}
/* */
int oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv)
{
int status;
_func_enter_;
RT_TRACE(_module_mp_, _drv_info_, ("+oid_rt_pro_efuse_hdl\n"));
RT_TRACE(_module_mp_, _drv_info_, ("+rtl8188eu_oid_rt_pro_efuse_hdl\n"));
if (poid_par_priv->type_of_oid == QUERY_OID)
status = oid_rt_pro_read_efuse_hdl(poid_par_priv);
status = rtl8188eu_oid_rt_pro_read_efuse_hdl(poid_par_priv);
else
status = oid_rt_pro_write_efuse_hdl(poid_par_priv);
status = rtl8188eu_oid_rt_pro_write_efuse_hdl(poid_par_priv);
RT_TRACE(_module_mp_, _drv_info_, ("-oid_rt_pro_efuse_hdl: status=0x%08X\n", status));
RT_TRACE(_module_mp_, _drv_info_, ("-rtl8188eu_oid_rt_pro_efuse_hdl: status=0x%08X\n", status));
_func_exit_;
return status;
}
/* */
int oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv)
{
u8 *data;
int status = NDIS_STATUS_SUCCESS;
@ -1351,7 +1355,7 @@ int oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv)
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_pro_efuse_map_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_pro_efuse_map_hdl\n"));
EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (void *)&maplen, false);
@ -1366,25 +1370,25 @@ _func_enter_;
if (poid_par_priv->type_of_oid == QUERY_OID) {
RT_TRACE(_module_mp_, _drv_info_,
("oid_rt_pro_efuse_map_hdl: READ\n"));
("rtl8188eu_oid_rt_pro_efuse_map_hdl: READ\n"));
if (rtw_efuse_map_read(Adapter, 0, maplen, data) == _SUCCESS) {
*poid_par_priv->bytes_rw = maplen;
} else {
RT_TRACE(_module_mp_, _drv_err_,
("oid_rt_pro_efuse_map_hdl: READ fail\n"));
("rtl8188eu_oid_rt_pro_efuse_map_hdl: READ fail\n"));
status = NDIS_STATUS_FAILURE;
}
} else {
/* SET_OID */
RT_TRACE(_module_mp_, _drv_info_,
("oid_rt_pro_efuse_map_hdl: WRITE\n"));
("rtl8188eu_oid_rt_pro_efuse_map_hdl: WRITE\n"));
if (rtw_efuse_map_write(Adapter, 0, maplen, data) == _SUCCESS) {
*poid_par_priv->bytes_rw = maplen;
} else {
RT_TRACE(_module_mp_, _drv_err_,
("oid_rt_pro_efuse_map_hdl: WRITE fail\n"));
("rtl8188eu_oid_rt_pro_efuse_map_hdl: WRITE fail\n"));
status = NDIS_STATUS_FAILURE;
}
}
@ -1392,27 +1396,27 @@ _func_enter_;
_irqlevel_changed_(&oldirql, RAISE);
RT_TRACE(_module_mp_, _drv_info_,
("-oid_rt_pro_efuse_map_hdl: status=0x%08X\n", status));
("-rtl8188eu_oid_rt_pro_efuse_map_hdl: status=0x%08X\n", status));
_func_exit_;
return status;
}
int oid_rt_set_crystal_cap_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_set_crystal_cap_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
return status;
}
int oid_rt_set_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_set_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv)
{
u8 rx_pkt_type;
int status = NDIS_STATUS_SUCCESS;
_func_enter_;
RT_TRACE(_module_mp_, _drv_notice_, ("+oid_rt_set_rx_packet_type_hdl\n"));
RT_TRACE(_module_mp_, _drv_notice_, ("+rtl8188eu_oid_rt_set_rx_packet_type_hdl\n"));
if (poid_par_priv->type_of_oid != SET_OID)
return NDIS_STATUS_NOT_ACCEPTED;
@ -1428,17 +1432,17 @@ _func_exit_;
return status;
}
int oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
int oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}
int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv)
{
struct mp_xmit_parm *pparm;
struct adapter *padapter;
@ -1463,7 +1467,7 @@ int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv)
pmp_priv->tx.payload = pparm->payload_type;
pattrib = &pmp_priv->tx.attrib;
pattrib->pktlen = pparm->length;
_rtw_memcpy(pattrib->dst, pparm->da, ETH_ALEN);
memcpy(pattrib->dst, pparm->da, ETH_ALEN);
SetPacketTx(padapter);
} else {
return NDIS_STATUS_FAILURE;
@ -1474,7 +1478,7 @@ int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv)
}
/* */
int oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv)
{
int status = NDIS_STATUS_SUCCESS;
@ -1486,7 +1490,7 @@ _func_enter_;
}
RT_TRACE(_module_mp_, _drv_info_,
("\n ===> Setoid_rt_set_power_down_hdl.\n"));
("\n ===> Setrtl8188eu_oid_rt_set_power_down_hdl.\n"));
_irqlevel_changed_(&oldirql, LOWER);
@ -1498,7 +1502,7 @@ _func_exit_;
return status;
}
/* */
int oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv)
int rtl8188eu_oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv)
{
return 0;
}

View file

@ -23,7 +23,7 @@
#include <rtw_p2p.h>
#include <wifi.h>
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
static int rtw_p2p_is_channel_list_ok(u8 desired_ch, u8 *ch_list, u8 ch_cnt)
{
@ -38,34 +38,6 @@ static int rtw_p2p_is_channel_list_ok(u8 desired_ch, u8 *ch_list, u8 ch_cnt)
return found;
}
static int is_any_client_associated(struct adapter *padapter)
{
unsigned long irqL;
struct list_head *phead, *plist;
int intFound = false;
struct sta_priv *pstapriv = &padapter->stapriv;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
phead = &pstapriv->asoc_list;
plist = get_next(phead);
if (rtw_end_of_queue_search(phead, plist))
intFound = false;
else
intFound = true;
if ((!intFound && pstapriv->asoc_list_cnt) ||
(intFound && !pstapriv->asoc_list_cnt)) {
DBG_88E("%s intFound:%d, asoc_list_cnt:%u mismatch\n", __func__ ,
intFound, pstapriv->asoc_list_cnt);
}
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
return intFound;
}
static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
{
unsigned long irqL;
@ -101,11 +73,11 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
pcur++;
/* P2P device address */
_rtw_memcpy(pcur, psta->dev_addr, ETH_ALEN);
memcpy(pcur, psta->dev_addr, ETH_ALEN);
pcur += ETH_ALEN;
/* P2P interface address */
_rtw_memcpy(pcur, psta->hwaddr, ETH_ALEN);
memcpy(pcur, psta->hwaddr, ETH_ALEN);
pcur += ETH_ALEN;
*pcur = psta->dev_cap;
@ -115,13 +87,13 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
RTW_PUT_BE16(pcur, psta->config_methods);
pcur += 2;
_rtw_memcpy(pcur, psta->primary_dev_type, 8);
memcpy(pcur, psta->primary_dev_type, 8);
pcur += 8;
*pcur = psta->num_of_secdev_type;
pcur++;
_rtw_memcpy(pcur, psta->secdev_types_list, psta->num_of_secdev_type*8);
memcpy(pcur, psta->secdev_types_list, psta->num_of_secdev_type*8);
pcur += psta->num_of_secdev_type*8;
if (psta->dev_name_len > 0) {
@ -133,7 +105,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
RTW_PUT_BE16(pcur, psta->dev_name_len);
pcur += 2;
_rtw_memcpy(pcur, psta->dev_name, psta->dev_name_len);
memcpy(pcur, psta->dev_name, psta->dev_name_len);
pcur += psta->dev_name_len;
}
@ -153,8 +125,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (attr_len > 0)
len = rtw_set_p2p_attr_content(pbuf, P2P_ATTR_GROUP_INFO, attr_len, pdata_attr);
rtw_mfree(pdata_attr, MAX_P2P_IE_LEN);
kfree(pdata_attr);
return len;
}
@ -164,7 +135,7 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da)
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
__le16 *fctrl;
struct adapter *padapter = pwdinfo->padapter;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -191,9 +162,9 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da)
fctrl = &(pwlanhdr->frame_ctl);
*(fctrl) = 0;
_rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, pwdinfo->interface_addr, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, pwdinfo->interface_addr, ETH_ALEN);
memcpy(pwlanhdr->addr1, da, ETH_ALEN);
memcpy(pwlanhdr->addr2, pwdinfo->interface_addr, ETH_ALEN);
memcpy(pwlanhdr->addr3, pwdinfo->interface_addr, ETH_ALEN);
SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
pmlmeext->mgnt_seq++;
@ -221,7 +192,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
__le16 *fctrl;
struct adapter *padapter = pwdinfo->padapter;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -250,9 +221,9 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s
fctrl = &(pwlanhdr->frame_ctl);
*(fctrl) = 0;
_rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, pwdinfo->device_addr, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, pwdinfo->device_addr, ETH_ALEN);
memcpy(pwlanhdr->addr1, da, ETH_ALEN);
memcpy(pwlanhdr->addr2, pwdinfo->device_addr, ETH_ALEN);
memcpy(pwlanhdr->addr3, pwdinfo->device_addr, ETH_ALEN);
SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
pmlmeext->mgnt_seq++;
@ -301,7 +272,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
__le16 *fctrl;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -321,9 +292,9 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
fctrl = &(pwlanhdr->frame_ctl);
*(fctrl) = 0;
_rtw_memcpy(pwlanhdr->addr1, raddr, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN);
memcpy(pwlanhdr->addr1, raddr, ETH_ALEN);
memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN);
SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
pmlmeext->mgnt_seq++;
@ -371,7 +342,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
unsigned short *fctrl;
__le16 *fctrl;
struct adapter *padapter = pwdinfo->padapter;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@ -400,9 +371,9 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8
fctrl = &(pwlanhdr->frame_ctl);
*(fctrl) = 0;
_rtw_memcpy(pwlanhdr->addr1, da, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, pwdinfo->interface_addr, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, pwdinfo->interface_addr, ETH_ALEN);
memcpy(pwlanhdr->addr1, da, ETH_ALEN);
memcpy(pwlanhdr->addr2, pwdinfo->interface_addr, ETH_ALEN);
memcpy(pwlanhdr->addr3, pwdinfo->interface_addr, ETH_ALEN);
SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
pmlmeext->mgnt_seq++;
@ -583,7 +554,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */
/* P2P Device Address */
_rtw_memcpy(p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN);
memcpy(p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN);
p2pielen += ETH_ALEN;
/* Config Method */
@ -623,7 +594,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
p2pielen += 2;
/* Value: */
_rtw_memcpy(p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len);
memcpy(p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len);
p2pielen += pwdinfo->device_name_len;
/* Group Info ATTR */
@ -691,7 +662,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
/* Value: */
/* P2P Device Address */
_rtw_memcpy(p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN);
memcpy(p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN);
p2pielen += ETH_ALEN;
/* Config Method */
@ -737,7 +708,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
p2pielen += 2;
/* Value: */
_rtw_memcpy(p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len);
memcpy(p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len);
p2pielen += pwdinfo->device_name_len;
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT)) {
@ -754,10 +725,10 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
p2pielen += 2;
/* Value: */
_rtw_memcpy(p2pie + p2pielen, pdev_raddr, ETH_ALEN);
memcpy(p2pie + p2pielen, pdev_raddr, ETH_ALEN);
p2pielen += ETH_ALEN;
_rtw_memcpy(p2pie + p2pielen, pssid, ussidlen);
memcpy(p2pie + p2pielen, pssid, ussidlen);
p2pielen += ussidlen;
}
@ -929,16 +900,16 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO , pattr_content, (uint *)&attr_contentlen);
_rtw_memcpy(psta->dev_addr, pattr_content, ETH_ALEN);/* P2P Device Address */
memcpy(psta->dev_addr, pattr_content, ETH_ALEN);/* P2P Device Address */
pattr_content += ETH_ALEN;
_rtw_memcpy(&be_tmp, pattr_content, 2);/* Config Methods */
memcpy(&be_tmp, pattr_content, 2);/* Config Methods */
psta->config_methods = be16_to_cpu(be_tmp);
pattr_content += 2;
_rtw_memcpy(psta->primary_dev_type, pattr_content, 8);
memcpy(psta->primary_dev_type, pattr_content, 8);
pattr_content += 8;
@ -955,7 +926,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
len = (sizeof(psta->secdev_types_list) < (num_of_secdev_type*8)) ?
(sizeof(psta->secdev_types_list)) : (num_of_secdev_type*8);
_rtw_memcpy(psta->secdev_types_list, pattr_content, len);
memcpy(psta->secdev_types_list, pattr_content, len);
pattr_content += (num_of_secdev_type*8);
}
@ -967,10 +938,9 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
psta->dev_name_len = (sizeof(psta->dev_name) < dev_name_len) ? sizeof(psta->dev_name) : dev_name_len;
_rtw_memcpy(psta->dev_name, pattr_content+4, psta->dev_name_len);
memcpy(psta->dev_name, pattr_content+4, psta->dev_name_len);
}
rtw_mfree(pbuf, attr_contentlen);
kfree(pbuf);
}
}
@ -1068,16 +1038,16 @@ u8 process_p2p_provdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
uconfig_method = be16_to_cpu(be_tmp);
switch (uconfig_method) {
case WPS_CM_DISPLYA:
_rtw_memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "dis", 3);
memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "dis", 3);
break;
case WPS_CM_LABEL:
_rtw_memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "lab", 3);
memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "lab", 3);
break;
case WPS_CM_PUSH_BUTTON:
_rtw_memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pbc", 3);
memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pbc", 3);
break;
case WPS_CM_KEYPAD:
_rtw_memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pad", 3);
memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pad", 3);
break;
}
issue_p2p_provision_resp(pwdinfo, GetAddr2Ptr(pframe), frame_body, uconfig_method);
@ -1155,11 +1125,11 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
wps_devicepassword_id = be16_to_cpu(be_tmp);
if (wps_devicepassword_id == WPS_DPID_USER_SPEC)
_rtw_memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "dis", 3);
memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "dis", 3);
else if (wps_devicepassword_id == WPS_DPID_REGISTRAR_SPEC)
_rtw_memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pad", 3);
memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pad", 3);
else
_rtw_memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pbc", 3);
memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pbc", 3);
}
} else {
DBG_88E("[%s] WPS IE not Found!!\n", __func__);
@ -1220,8 +1190,8 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) {
/* Store the group id information. */
_rtw_memcpy(pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN);
_rtw_memcpy(pwdinfo->groupid_info.ssid, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen);
memcpy(pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN);
memcpy(pwdinfo->groupid_info.ssid, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen);
}
}
@ -1368,8 +1338,8 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) {
/* Store the group id information. */
_rtw_memcpy(pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN);
_rtw_memcpy(pwdinfo->groupid_info.ssid, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen);
memcpy(pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN);
memcpy(pwdinfo->groupid_info.ssid, pwdinfo->nego_ssid, pwdinfo->nego_ssidlen);
}
}
@ -1426,8 +1396,8 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
attr_contentlen = 0;
_rtw_memset(groupid, 0x00, 38);
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) {
_rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN);
_rtw_memcpy(pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN);
memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN);
memcpy(pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN);
}
/* Get the next P2P IE */
@ -1491,8 +1461,8 @@ u8 process_p2p_group_negotation_confirm(struct wifidirect_info *pwdinfo, u8 *pfr
_rtw_memset(groupid, 0x00, 38);
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) {
DBG_88E("[%s] Ssid = %s, ssidlen = %zu\n", __func__, &groupid[ETH_ALEN], strlen(&groupid[ETH_ALEN]));
_rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN);
_rtw_memcpy(pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN);
memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN);
memcpy(pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN);
}
attr_contentlen = 0;
@ -1534,7 +1504,7 @@ static void find_phase_handler(struct adapter *padapter)
_func_enter_;
_rtw_memset((unsigned char *)&ssid, 0, sizeof(struct ndis_802_11_ssid));
_rtw_memcpy(ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN);
memcpy(ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN);
ssid.SsidLength = P2P_WILDCARD_SSID_LEN;
rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
@ -1553,7 +1523,6 @@ static void restore_p2p_state_handler(struct adapter *padapter)
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
_func_enter_;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL))
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DEVICE);
rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo));
@ -1611,7 +1580,6 @@ _func_exit_;
void p2p_protocol_wk_hdl(struct adapter *padapter, int intCmdType)
{
_func_enter_;
switch (intCmdType) {
case P2P_FIND_PHASE_WK:
find_phase_handler(padapter);
@ -1676,17 +1644,17 @@ _func_enter_;
/* NoA length should be n*(13) + 2 */
if (attr_contentlen > 2) {
while (noa_offset < attr_contentlen) {
/* _rtw_memcpy(&wifidirect_info->noa_count[noa_num], &noa_attr[noa_offset], 1); */
/* memcpy(&wifidirect_info->noa_count[noa_num], &noa_attr[noa_offset], 1); */
pwdinfo->noa_count[noa_num] = noa_attr[noa_offset];
noa_offset += 1;
_rtw_memcpy(&pwdinfo->noa_duration[noa_num], &noa_attr[noa_offset], 4);
memcpy(&pwdinfo->noa_duration[noa_num], &noa_attr[noa_offset], 4);
noa_offset += 4;
_rtw_memcpy(&pwdinfo->noa_interval[noa_num], &noa_attr[noa_offset], 4);
memcpy(&pwdinfo->noa_interval[noa_num], &noa_attr[noa_offset], 4);
noa_offset += 4;
_rtw_memcpy(&pwdinfo->noa_start_time[noa_num], &noa_attr[noa_offset], 4);
memcpy(&pwdinfo->noa_start_time[noa_num], &noa_attr[noa_offset], 4);
noa_offset += 4;
noa_num++;
@ -1799,7 +1767,7 @@ _func_enter_;
pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if (pdrvextra_cmd_parm == NULL) {
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
kfree(ph2c);
res = _FAIL;
goto exit;
}
@ -1929,14 +1897,14 @@ void rtw_init_wifidirect_timers(struct adapter *padapter)
void rtw_init_wifidirect_addrs(struct adapter *padapter, u8 *dev_addr, u8 *iface_addr)
{
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
/*init device&interface address */
if (dev_addr)
_rtw_memcpy(pwdinfo->device_addr, dev_addr, ETH_ALEN);
memcpy(pwdinfo->device_addr, dev_addr, ETH_ALEN);
if (iface_addr)
_rtw_memcpy(pwdinfo->interface_addr, iface_addr, ETH_ALEN);
memcpy(pwdinfo->interface_addr, iface_addr, ETH_ALEN);
#endif
}
@ -1983,7 +1951,7 @@ void init_wifidirect_info(struct adapter *padapter, enum P2P_ROLE role)
pwdinfo->support_rate[6] = 0x60; /* 48 */
pwdinfo->support_rate[7] = 0x6c; /* 54 */
_rtw_memcpy((void *)pwdinfo->p2p_wildcard_ssid, "DIRECT-", 7);
memcpy(pwdinfo->p2p_wildcard_ssid, "DIRECT-", 7);
_rtw_memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN);
pwdinfo->device_name_len = 0;
@ -2083,4 +2051,14 @@ exit:
return ret;
}
#endif /* CONFIG_P2P */
#else
u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue)
{
return _FAIL;
}
void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength)
{
}
#endif /* CONFIG_88EU_P2P */

View file

@ -24,10 +24,6 @@
#include <osdep_intf.h>
#include <linux/usb.h>
#ifdef CONFIG_BT_COEXIST
#include <rtl8723a_hal.h>
#endif
void ips_enter(struct adapter *padapter)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
@ -53,9 +49,6 @@ void ips_enter(struct adapter *padapter)
pwrpriv->ips_enter_cnts++;
DBG_88E("==>ips_enter cnts:%d\n", pwrpriv->ips_enter_cnts);
#ifdef CONFIG_BT_COEXIST
BTDM_TurnOffBtCoexistBeforeEnterIPS(padapter);
#endif
if (rf_off == pwrpriv->change_rfpwrstate) {
pwrpriv->bpower_saving = true;
DBG_88E_LEVEL(_drv_info_, "nolinked power save enter\n");
@ -123,7 +116,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
{
struct adapter *buddy = adapter->pbuddy_adapter;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
struct wifidirect_info *pwdinfo = &(adapter->wdinfo);
#endif
@ -136,7 +129,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
check_fwstate(pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS) ||
check_fwstate(pmlmepriv, WIFI_AP_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE) ||
#if defined(CONFIG_P2P)
#if defined(CONFIG_88EU_P2P)
!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
#else
0)
@ -146,7 +139,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
/* consider buddy, if exist */
if (buddy) {
struct mlme_priv *b_pmlmepriv = &(buddy->mlmepriv);
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
struct wifidirect_info *b_pwdinfo = &(buddy->wdinfo);
#endif
@ -154,7 +147,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
check_fwstate(b_pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS) ||
check_fwstate(b_pmlmepriv, WIFI_AP_STATE) ||
check_fwstate(b_pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE) ||
#if defined(CONFIG_P2P)
#if defined(CONFIG_88EU_P2P)
!rtw_p2p_chk_state(b_pwdinfo, P2P_STATE_NONE))
#else
0)
@ -215,7 +208,7 @@ exit:
return;
}
void pwr_state_check_handler(void *FunctionContext)
static void pwr_state_check_handler(void *FunctionContext)
{
struct adapter *padapter = (struct adapter *)FunctionContext;
rtw_ps_cmd(padapter);
@ -285,7 +278,7 @@ _func_enter_;
_func_exit_;
}
u8 PS_RDY_CHECK(struct adapter *padapter)
static u8 PS_RDY_CHECK(struct adapter *padapter)
{
u32 curr_time, delta_time;
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
@ -304,15 +297,8 @@ u8 PS_RDY_CHECK(struct adapter *padapter)
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)))
return false;
#ifdef CONFIG_WOWLAN
if (pwrpriv->bInSuspend && pwrpriv->wowlan_mode)
return true;
else
return false;
#else
if (pwrpriv->bInSuspend)
return false;
#endif
if ((padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && (padapter->securitypriv.binstallGrpkey == false)) {
DBG_88E("Group handshake still in progress !!!\n");
return false;
@ -323,9 +309,9 @@ u8 PS_RDY_CHECK(struct adapter *padapter)
void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
_func_enter_;
@ -349,6 +335,7 @@ _func_enter_;
/* if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) */
if (ps_mode == PS_MODE_ACTIVE) {
#ifdef CONFIG_88EU_P2P
if (pwdinfo->opp_ps == 0) {
DBG_88E("rtw_set_ps_mode: Leave 802.11 power save\n");
pwrpriv->pwr_mode = ps_mode;
@ -357,11 +344,8 @@ _func_enter_;
pwrpriv->bFwCurrentInPSMode = false;
}
} else {
#ifdef CONFIG_BT_COEXIST
if (PS_RDY_CHECK(padapter) || (BT_1Ant(padapter))) {
#else
#endif /* CONFIG_88EU_P2P */
if (PS_RDY_CHECK(padapter)) {
#endif
DBG_88E("%s: Enter 802.11 power save\n", __func__);
pwrpriv->bFwCurrentInPSMode = true;
pwrpriv->pwr_mode = ps_mode;
@ -369,9 +353,11 @@ _func_enter_;
pwrpriv->bcn_ant_mode = bcn_ant_mode;
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode));
#ifdef CONFIG_88EU_P2P
/* Set CTWindow after LPS */
if (pwdinfo->opp_ps == 1)
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 0);
#endif /* CONFIG_88EU_P2P */
rtw_set_rpwm(padapter, PS_STATE_S2);
}
@ -446,14 +432,12 @@ _func_enter_;
_func_exit_;
}
/* */
/* Description: */
/* Leave the leisure power save mode. */
/* */
void LPS_Leave(struct adapter *padapter)
{
#define LPS_LEAVE_TIMEOUT_MS 100
/* Description: */
/* Leave the leisure power save mode. */
void LPS_Leave(struct adapter *padapter)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
_func_enter_;

View file

@ -30,15 +30,15 @@
#include <wifi.h>
static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37};
static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};
static u8 rtw_rfc1042_header[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
};
/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
static u8 rtw_bridge_tunnel_header[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8
0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8
};
static u8 rtw_rfc1042_header[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
};
void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS);
@ -118,7 +118,7 @@ _func_exit_;
return res;
}
void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv)
static void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv)
{
_rtw_spinlock_free(&precvpriv->lock);
_rtw_spinlock_free(&precvpriv->free_recv_queue.lock);
@ -362,7 +362,7 @@ struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue)
return precvbuf;
}
int recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe)
static int recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe)
{
int i, res = _SUCCESS;
u32 datalen;
@ -490,7 +490,7 @@ _func_exit_;
}
/* decrypt and set the ivlen, icvlen of the recv_frame */
union recv_frame *decryptor(struct adapter *padapter, union recv_frame *precv_frame)
static union recv_frame *decryptor(struct adapter *padapter, union recv_frame *precv_frame)
{
struct rx_pkt_attrib *prxattrib = &precv_frame->u.hdr.attrib;
struct security_priv *psecuritypriv = &padapter->securitypriv;
@ -553,9 +553,9 @@ _func_exit_;
}
/* set the security information in the recv_frame */
union recv_frame *portctrl(struct adapter *adapter, union recv_frame *precv_frame)
static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *precv_frame)
{
u8 *psta_addr, *ptr;
u8 *psta_addr = NULL, *ptr;
uint auth_alg;
struct recv_frame_hdr *pfhdr;
struct sta_info *psta;
@ -592,7 +592,7 @@ _func_enter_;
/* get ether_type */
ptr = ptr+pfhdr->attrib.hdrlen+pfhdr->attrib.iv_len+LLC_HEADER_SIZE;
_rtw_memcpy(&be_tmp, ptr, 2);
memcpy(&be_tmp, ptr, 2);
ether_type = ntohs(be_tmp);
if (ether_type == eapol_type) {
@ -631,7 +631,7 @@ _func_exit_;
return prtnframe;
}
int recv_decache(union recv_frame *precv_frame, u8 bretry, struct stainfo_rxcache *prxcache)
static int recv_decache(union recv_frame *precv_frame, u8 bretry, struct stainfo_rxcache *prxcache)
{
int tid = precv_frame->u.hdr.attrib.priority;
@ -664,7 +664,7 @@ _func_exit_;
void process_pwrbit_data(struct adapter *padapter, union recv_frame *precv_frame);
void process_pwrbit_data(struct adapter *padapter, union recv_frame *precv_frame)
{
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
unsigned char pwrbit;
u8 *ptr = precv_frame->u.hdr.rx_data;
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
@ -688,9 +688,9 @@ void process_pwrbit_data(struct adapter *padapter, union recv_frame *precv_frame
#endif
}
void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
static void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
{
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
struct sta_priv *pstapriv = &padapter->stapriv;
struct sta_info *psta = NULL;
@ -743,7 +743,7 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
#endif
}
void count_rx_stats(struct adapter *padapter, union recv_frame *prframe, struct sta_info *sta)
static void count_rx_stats(struct adapter *padapter, union recv_frame *prframe, struct sta_info *sta)
{
int sz;
struct sta_info *psta = NULL;
@ -839,11 +839,11 @@ _func_enter_;
sta_addr = pattrib->src;
}
} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
_rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
_rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
sta_addr = mybssid;
} else {
@ -870,7 +870,7 @@ _func_exit_;
return ret;
}
int ap2sta_data_frame(
static int ap2sta_data_frame (
struct adapter *adapter,
union recv_frame *precv_frame,
struct sta_info **psta)
@ -943,14 +943,14 @@ _func_enter_;
}
} else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
_rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
_rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
/* */
_rtw_memcpy(pattrib->bssid, mybssid, ETH_ALEN);
memcpy(pattrib->bssid, mybssid, ETH_ALEN);
*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */
if (*psta == NULL) {
@ -982,12 +982,14 @@ _func_exit_;
return ret;
}
int sta2ap_data_frame(struct adapter *adapter, union recv_frame *precv_frame, struct sta_info **psta)
static int sta2ap_data_frame(struct adapter *adapter,
union recv_frame *precv_frame,
struct sta_info **psta)
{
u8 *ptr = precv_frame->u.hdr.rx_data;
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
struct sta_priv *pstapriv = &adapter->stapriv;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
u8 *ptr = precv_frame->u.hdr.rx_data;
unsigned char *mybssid = get_bssid(pmlmepriv);
int ret = _SUCCESS;
@ -1042,9 +1044,10 @@ _func_exit_;
return ret;
}
int validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_frame)
static int validate_recv_ctrl_frame(struct adapter *padapter,
union recv_frame *precv_frame)
{
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
struct sta_priv *pstapriv = &padapter->stapriv;
u8 *pframe = precv_frame->u.hdr.rx_data;
@ -1170,8 +1173,11 @@ int validate_recv_ctrl_frame(struct adapter *padapter, union recv_frame *precv_f
union recv_frame *recvframe_chk_defrag(struct adapter *padapter, union recv_frame *precv_frame);
int validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_frame)
static int validate_recv_mgnt_frame(struct adapter *padapter,
union recv_frame *precv_frame)
{
struct sta_info *psta;
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("+validate_recv_mgnt_frame\n"));
precv_frame = recvframe_chk_defrag(padapter, precv_frame);
@ -1180,24 +1186,22 @@ int validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_f
return _SUCCESS;
}
{
/* for rx pkt statistics */
struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(precv_frame->u.hdr.rx_data));
if (psta) {
psta->sta_stats.rx_mgnt_pkts++;
if (GetFrameSubType(precv_frame->u.hdr.rx_data) == WIFI_BEACON) {
psta->sta_stats.rx_beacon_pkts++;
} else if (GetFrameSubType(precv_frame->u.hdr.rx_data) == WIFI_PROBEREQ) {
psta->sta_stats.rx_probereq_pkts++;
} else if (GetFrameSubType(precv_frame->u.hdr.rx_data) == WIFI_PROBERSP) {
if (_rtw_memcmp(padapter->eeprompriv.mac_addr, GetAddr1Ptr(precv_frame->u.hdr.rx_data), ETH_ALEN) == true)
psta->sta_stats.rx_probersp_pkts++;
else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)) ||
is_multicast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)))
psta->sta_stats.rx_probersp_bm_pkts++;
else
psta->sta_stats.rx_probersp_uo_pkts++;
}
/* for rx pkt statistics */
psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(precv_frame->u.hdr.rx_data));
if (psta) {
psta->sta_stats.rx_mgnt_pkts++;
if (GetFrameSubType(precv_frame->u.hdr.rx_data) == WIFI_BEACON) {
psta->sta_stats.rx_beacon_pkts++;
} else if (GetFrameSubType(precv_frame->u.hdr.rx_data) == WIFI_PROBEREQ) {
psta->sta_stats.rx_probereq_pkts++;
} else if (GetFrameSubType(precv_frame->u.hdr.rx_data) == WIFI_PROBERSP) {
if (_rtw_memcmp(padapter->eeprompriv.mac_addr, GetAddr1Ptr(precv_frame->u.hdr.rx_data), ETH_ALEN) == true)
psta->sta_stats.rx_probersp_pkts++;
else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)) ||
is_multicast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)))
psta->sta_stats.rx_probersp_bm_pkts++;
else
psta->sta_stats.rx_probersp_uo_pkts++;
}
}
@ -1206,7 +1210,8 @@ int validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_f
return _SUCCESS;
}
int validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_frame)
static int validate_recv_data_frame(struct adapter *adapter,
union recv_frame *precv_frame)
{
u8 bretry;
u8 *psa, *pda, *pbssid;
@ -1228,30 +1233,30 @@ _func_enter_;
goto exit;
}
_rtw_memcpy(pattrib->dst, pda, ETH_ALEN);
_rtw_memcpy(pattrib->src, psa, ETH_ALEN);
memcpy(pattrib->dst, pda, ETH_ALEN);
memcpy(pattrib->src, psa, ETH_ALEN);
_rtw_memcpy(pattrib->bssid, pbssid, ETH_ALEN);
memcpy(pattrib->bssid, pbssid, ETH_ALEN);
switch (pattrib->to_fr_ds) {
case 0:
_rtw_memcpy(pattrib->ra, pda, ETH_ALEN);
_rtw_memcpy(pattrib->ta, psa, ETH_ALEN);
memcpy(pattrib->ra, pda, ETH_ALEN);
memcpy(pattrib->ta, psa, ETH_ALEN);
ret = sta2sta_data_frame(adapter, precv_frame, &psta);
break;
case 1:
_rtw_memcpy(pattrib->ra, pda, ETH_ALEN);
_rtw_memcpy(pattrib->ta, pbssid, ETH_ALEN);
memcpy(pattrib->ra, pda, ETH_ALEN);
memcpy(pattrib->ta, pbssid, ETH_ALEN);
ret = ap2sta_data_frame(adapter, precv_frame, &psta);
break;
case 2:
_rtw_memcpy(pattrib->ra, pbssid, ETH_ALEN);
_rtw_memcpy(pattrib->ta, psa, ETH_ALEN);
memcpy(pattrib->ra, pbssid, ETH_ALEN);
memcpy(pattrib->ta, psa, ETH_ALEN);
ret = sta2ap_data_frame(adapter, precv_frame, &psta);
break;
case 3:
_rtw_memcpy(pattrib->ra, GetAddr1Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->ta, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->ra, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->ta, GetAddr2Ptr(ptr), ETH_ALEN);
ret = _FAIL;
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" case 3\n"));
break;
@ -1326,7 +1331,7 @@ _func_exit_;
return ret;
}
int validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
static int validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
{
/* shall check frame subtype, to / from ds, da, bssid */
@ -1438,7 +1443,7 @@ _func_exit_;
/* remove the wlanhdr and add the eth_hdr */
int wlanhdr_to_ethhdr (union recv_frame *precvframe)
static int wlanhdr_to_ethhdr (union recv_frame *precvframe)
{
int rmv_len;
u16 eth_type, len;
@ -1479,7 +1484,7 @@ _func_enter_;
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
("\n===pattrib->hdrlen: %x, pattrib->iv_len:%x===\n\n", pattrib->hdrlen, pattrib->iv_len));
_rtw_memcpy(&be_tmp, ptr+rmv_len, 2);
memcpy(&be_tmp, ptr+rmv_len, 2);
eth_type = ntohs(be_tmp); /* pattrib->ether_type */
pattrib->eth_type = eth_type;
@ -1491,18 +1496,18 @@ _func_enter_;
eth_type = 0x8712;
/* append rx status for mp test packets */
ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr)+2)-24);
_rtw_memcpy(ptr, get_rxmem(precvframe), 24);
memcpy(ptr, get_rxmem(precvframe), 24);
ptr += 24;
} else {
ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0)));
}
_rtw_memcpy(ptr, pattrib->dst, ETH_ALEN);
_rtw_memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN);
memcpy(ptr, pattrib->dst, ETH_ALEN);
memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN);
if (!bsnaphdr) {
be_tmp = htons(len);
_rtw_memcpy(ptr+12, &be_tmp, 2);
memcpy(ptr+12, &be_tmp, 2);
}
_func_exit_;
@ -1510,7 +1515,7 @@ _func_exit_;
}
/* perform defrag */
union recv_frame *recvframe_defrag(struct adapter *adapter, struct __queue *defrag_q)
static union recv_frame *recvframe_defrag(struct adapter *adapter, struct __queue *defrag_q)
{
struct list_head *plist, *phead;
u8 wlanhdr_offset;
@ -1572,7 +1577,7 @@ _func_enter_;
recvframe_pull_tail(prframe, pfhdr->attrib.icv_len);
/* memcpy */
_rtw_memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len);
memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len);
recvframe_put(prframe, pnfhdr->len);
@ -1736,7 +1741,7 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
if (sub_skb) {
skb_reserve(sub_skb, 12);
data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
_rtw_memcpy(data_ptr, pdata, nSubframe_Length);
memcpy(data_ptr, pdata, nSubframe_Length);
} else {
sub_skb = skb_clone(prframe->u.hdr.pkt, GFP_ATOMIC);
if (sub_skb) {
@ -1782,26 +1787,20 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
_rtw_memcmp(sub_skb->data, rtw_bridge_tunnel_header, SNAP_SIZE))) {
/* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */
skb_pull(sub_skb, SNAP_SIZE);
_rtw_memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
_rtw_memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
} else {
__be16 len;
/* Leave Ethernet header part of hdr and full payload */
len = htons(sub_skb->len);
_rtw_memcpy(skb_push(sub_skb, 2), &len, 2);
_rtw_memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
_rtw_memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
memcpy(skb_push(sub_skb, 2), &len, 2);
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
}
/* Indicat the packets to upper layer */
if (sub_skb) {
/* Insert NAT2.5 RX here! */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
rcu_read_lock();
rcu_read_unlock();
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
sub_skb->protocol = eth_type_trans(sub_skb, padapter->pnetdev);
sub_skb->dev = padapter->pnetdev;
@ -2051,7 +2050,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext)
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
}
int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prframe)
static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prframe)
{
int retval = _SUCCESS;
/* struct recv_priv *precvpriv = &padapter->recvpriv; */
@ -2167,8 +2166,6 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr
rtw_free_recvframe(orig_prframe, pfree_recv_queue);/* free this recv_frame */
goto _recv_data_drop;
}
_exit_recv_func:
return ret;
_recv_data_drop:
@ -2176,7 +2173,7 @@ _recv_data_drop:
return ret;
}
int recv_func(struct adapter *padapter, union recv_frame *rframe)
static int recv_func(struct adapter *padapter, union recv_frame *rframe)
{
int ret;
struct rx_pkt_attrib *prxattrib = &rframe->u.hdr.attrib;

View file

@ -181,8 +181,8 @@ _func_enter_;
for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) {
iv = pframe+pattrib->hdrlen;
_rtw_memcpy(&wepkey[0], iv, 3);
_rtw_memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength);
memcpy(&wepkey[0], iv, 3);
memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength);
payload = pframe+pattrib->iv_len+pattrib->hdrlen;
if ((curfragnum+1) == pattrib->nr_frags) { /* the last fragment */
@ -230,8 +230,8 @@ _func_enter_;
iv = pframe+prxattrib->hdrlen;
keyindex = prxattrib->key_index;
keylength = psecuritypriv->dot11DefKeylen[keyindex];
_rtw_memcpy(&wepkey[0], iv, 3);
_rtw_memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
memcpy(&wepkey[0], iv, 3);
memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;
@ -811,7 +811,6 @@ static void next_key(u8 *key, int round);
static void byte_sub(u8 *in, u8 *out);
static void shift_row(u8 *in, u8 *out);
static void mix_column(u8 *in, u8 *out);
static void add_round_key(u8 *shiftrow_in, u8 *mcol_in, u8 *block_in, int round, u8 *out);
static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext);
/****************************************/
@ -1418,7 +1417,7 @@ _func_enter_;
/* start to calculate the mic */
if ((hdrlen+plen+8) <= MAX_MSG_SIZE)
_rtw_memcpy((void *)message, pframe, (hdrlen + plen+8)); /* 8 is for ext iv len */
memcpy(message, pframe, (hdrlen + plen+8)); /* 8 is for ext iv len */
pn_vector[0] = pframe[hdrlen];
pn_vector[1] = pframe[hdrlen+1];
@ -1565,319 +1564,6 @@ exit:
return res;
}
/* compress 512-bits */
static int sha256_compress(struct sha256_state *md, unsigned char *buf)
{
u32 S[8], W[64], t0, t1;
u32 t;
int i;
/* copy state into S */
for (i = 0; i < 8; i++)
S[i] = md->state[i];
/* copy the state into 512-bits into W[0..15] */
for (i = 0; i < 16; i++)
W[i] = WPA_GET_BE32(buf + (4 * i));
/* fill W[16..63] */
for (i = 16; i < 64; i++) {
W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) +
W[i - 16];
}
/* Compress */
#define RND(a, b, c, d, e, f, g, h, i) \
do { \
t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \
t1 = Sigma0(a) + Maj(a, b, c); \
d += t0; \
h = t0 + t1; \
} while (0)
for (i = 0; i < 64; ++i) {
RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], i);
t = S[7]; S[7] = S[6]; S[6] = S[5]; S[5] = S[4];
S[4] = S[3]; S[3] = S[2]; S[2] = S[1]; S[1] = S[0]; S[0] = t;
}
/* feedback */
for (i = 0; i < 8; i++)
md->state[i] = md->state[i] + S[i];
return 0;
}
/* Initialize the hash state */
static void sha256_init(struct sha256_state *md)
{
md->curlen = 0;
md->length = 0;
md->state[0] = 0x6A09E667UL;
md->state[1] = 0xBB67AE85UL;
md->state[2] = 0x3C6EF372UL;
md->state[3] = 0xA54FF53AUL;
md->state[4] = 0x510E527FUL;
md->state[5] = 0x9B05688CUL;
md->state[6] = 0x1F83D9ABUL;
md->state[7] = 0x5BE0CD19UL;
}
/**
Process a block of memory though the hash
@param md The hash state
@param in The data to hash
@param inlen The length of the data (octets)
@return CRYPT_OK if successful
*/
static int sha256_process(struct sha256_state *md, unsigned char *in,
unsigned long inlen)
{
unsigned long n;
#define block_size 64
if (md->curlen > sizeof(md->buf))
return -1;
while (inlen > 0) {
if (md->curlen == 0 && inlen >= block_size) {
if (sha256_compress(md, (unsigned char *)in) < 0)
return -1;
md->length += block_size * 8;
in += block_size;
inlen -= block_size;
} else {
n = MIN(inlen, (block_size - md->curlen));
_rtw_memcpy(md->buf + md->curlen, in, n);
md->curlen += n;
in += n;
inlen -= n;
if (md->curlen == block_size) {
if (sha256_compress(md, md->buf) < 0)
return -1;
md->length += 8 * block_size;
md->curlen = 0;
}
}
}
return 0;
}
/**
Terminate the hash to get the digest
@param md The hash state
@param out [out] The destination of the hash (32 bytes)
@return CRYPT_OK if successful
*/
static int sha256_done(struct sha256_state *md, unsigned char *out)
{
int i;
if (md->curlen >= sizeof(md->buf))
return -1;
/* increase the length of the message */
md->length += md->curlen * 8;
/* append the '1' bit */
md->buf[md->curlen++] = (unsigned char) 0x80;
/* if the length is currently above 56 bytes we append zeros
* then compress. Then we can fall back to padding zeros and length
* encoding like normal.
*/
if (md->curlen > 56) {
while (md->curlen < 64)
md->buf[md->curlen++] = (unsigned char) 0;
sha256_compress(md, md->buf);
md->curlen = 0;
}
/* pad upto 56 bytes of zeroes */
while (md->curlen < 56)
md->buf[md->curlen++] = (unsigned char) 0;
/* store length */
WPA_PUT_BE64(md->buf + 56, md->length);
sha256_compress(md, md->buf);
/* copy output */
for (i = 0; i < 8; i++)
WPA_PUT_BE32(out + (4 * i), md->state[i]);
return 0;
}
/**
* sha256_vector - SHA256 hash for data vector
* @num_elem: Number of elements in the data vector
* @addr: Pointers to the data areas
* @len: Lengths of the data blocks
* @mac: Buffer for the hash
* Returns: 0 on success, -1 of failure
*/
static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
u8 *mac)
{
struct sha256_state ctx;
size_t i;
sha256_init(&ctx);
for (i = 0; i < num_elem; i++)
if (sha256_process(&ctx, addr[i], len[i]))
return -1;
if (sha256_done(&ctx, mac))
return -1;
return 0;
}
static u8 os_strlen(const char *s)
{
const char *p = s;
while (*p)
p++;
return p - s;
}
static int os_memcmp(void *s1, void *s2, u8 n)
{
unsigned char *p1 = s1, *p2 = s2;
if (n == 0)
return 0;
while (*p1 == *p2) {
p1++;
p2++;
n--;
if (n == 0)
return 0;
}
return *p1 - *p2;
}
/**
* hmac_sha256_vector - HMAC-SHA256 over data vector (RFC 2104)
* @key: Key for HMAC operations
* @key_len: Length of the key in bytes
* @num_elem: Number of elements in the data vector
* @addr: Pointers to the data areas
* @len: Lengths of the data blocks
* @mac: Buffer for the hash (32 bytes)
*/
static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
u8 *addr[], size_t *len, u8 *mac)
{
unsigned char k_pad[64]; /* padding - key XORd with ipad/opad */
unsigned char tk[32];
u8 *_addr[6];
size_t _len[6], i;
if (num_elem > 5) {
/*
* Fixed limit on the number of fragments to avoid having to
* allocate memory (which could fail).
*/
return;
}
/* if key is longer than 64 bytes reset it to key = SHA256(key) */
if (key_len > 64) {
sha256_vector(1, &key, &key_len, tk);
key = tk;
key_len = 32;
}
/* the HMAC_SHA256 transform looks like:
*
* SHA256(K XOR opad, SHA256(K XOR ipad, text))
*
* where K is an n byte key
* ipad is the byte 0x36 repeated 64 times
* opad is the byte 0x5c repeated 64 times
* and text is the data being protected */
/* start out by storing key in ipad */
_rtw_memset(k_pad, 0, sizeof(k_pad));
_rtw_memcpy(k_pad, key, key_len);
/* XOR key with ipad values */
for (i = 0; i < 64; i++)
k_pad[i] ^= 0x36;
/* perform inner SHA256 */
_addr[0] = k_pad;
_len[0] = 64;
for (i = 0; i < num_elem; i++) {
_addr[i + 1] = addr[i];
_len[i + 1] = len[i];
}
sha256_vector(1 + num_elem, _addr, _len, mac);
_rtw_memset(k_pad, 0, sizeof(k_pad));
_rtw_memcpy(k_pad, key, key_len);
/* XOR key with opad values */
for (i = 0; i < 64; i++)
k_pad[i] ^= 0x5c;
/* perform outer SHA256 */
_addr[0] = k_pad;
_len[0] = 64;
_addr[1] = mac;
_len[1] = 32;
sha256_vector(2, _addr, _len, mac);
}
/**
* sha256_prf - SHA256-based Pseudo-Random Function (IEEE 802.11r, 8.5.1.5.2)
* @key: Key for PRF
* @key_len: Length of the key in bytes
* @label: A unique label for each purpose of the PRF
* @data: Extra data to bind into the key
* @data_len: Length of the data
* @buf: Buffer for the generated pseudo-random key
* @buf_len: Number of bytes of key to generate
*
* This function is used to derive new, cryptographically separate keys from a
* given key.
*/
static void sha256_prf(u8 *key, size_t key_len, char *label,
u8 *data, size_t data_len, u8 *buf, size_t buf_len)
{
u16 counter = 1;
size_t pos, plen;
u8 hash[SHA256_MAC_LEN];
u8 *addr[4];
size_t len[4];
u8 counter_le[2], length_le[2];
addr[0] = counter_le;
len[0] = 2;
addr[1] = (u8 *)label;
len[1] = os_strlen(label);
addr[2] = data;
len[2] = data_len;
addr[3] = length_le;
len[3] = sizeof(length_le);
WPA_PUT_LE16(length_le, buf_len * 8);
pos = 0;
while (pos < buf_len) {
plen = buf_len - pos;
WPA_PUT_LE16(counter_le, counter);
if (plen >= SHA256_MAC_LEN) {
hmac_sha256_vector(key, key_len, 4, addr, len,
&buf[pos]);
pos += SHA256_MAC_LEN;
} else {
hmac_sha256_vector(key, key_len, 4, addr, len, hash);
_rtw_memcpy(&buf[pos], hash, plen);
break;
}
counter++;
}
}
/* AES tables*/
const u32 Te0[256] = {
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
@ -2052,6 +1738,31 @@ const u8 rcons[] = {
/* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
};
/**
* Expand the cipher key into the encryption key schedule.
*
* @return the number of rounds for the given cipher key size.
*/
#define ROUND(i, d, s) \
do { \
d##0 = TE0(s##0) ^ TE1(s##1) ^ TE2(s##2) ^ TE3(s##3) ^ rk[4 * i]; \
d##1 = TE0(s##1) ^ TE1(s##2) ^ TE2(s##3) ^ TE3(s##0) ^ rk[4 * i + 1]; \
d##2 = TE0(s##2) ^ TE1(s##3) ^ TE2(s##0) ^ TE3(s##1) ^ rk[4 * i + 2]; \
d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3]; \
} while (0);
/**
* omac1_aes_128 - One-Key CBC MAC (OMAC1) hash with AES-128 (aka AES-CMAC)
* @key: 128-bit key for the hash operation
* @data: Data buffer for which a MAC is determined
* @data_len: Length of data buffer in bytes
* @mac: Buffer for MAC (128 bits, i.e., 16 bytes)
* Returns: 0 on success, -1 on failure
*
* This is a mode for using block cipher (AES in this case) for authentication.
* OMAC1 was standardized with the name CMAC by NIST in a Special Publication
* (SP) 800-38B.
*/
void rtw_use_tkipkey_handler(void *FunctionContext)
{
struct adapter *padapter = (struct adapter *)FunctionContext;

View file

@ -49,6 +49,7 @@ u8 sreset_get_wifi_status(struct adapter *padapter)
u8 status = WIFI_STATUS_SUCCESS;
u32 val32 = 0;
if (psrtpriv->silent_reset_inprogress)
return status;
val32 = rtw_read32(padapter, REG_TXDMA_STATUS);

View file

@ -26,10 +26,9 @@
#include <mlme_osdep.h>
#include <sta_info.h>
void _rtw_init_stainfo(struct sta_info *psta)
static void _rtw_init_stainfo(struct sta_info *psta)
{
_func_enter_;
_rtw_memset((u8 *)psta, 0, sizeof (struct sta_info));
_rtw_spinlock_init(&psta->lock);
@ -41,7 +40,7 @@ _func_enter_;
_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
_rtw_init_listhead(&psta->asoc_list);
@ -55,7 +54,7 @@ _func_enter_;
psta->bpairwise_key_installed = false;
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
psta->nonerp_set = 0;
psta->no_short_slot_time_set = 0;
psta->no_short_preamble_set = 0;
@ -68,7 +67,7 @@ _func_enter_;
psta->keep_alive_trycnt = 0;
#endif /* CONFIG_AP_MODE */
#endif /* CONFIG_88EU_AP_MODE */
_func_exit_;
}
@ -108,7 +107,7 @@ _func_enter_;
psta++;
}
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
pstapriv->sta_dz_bitmap = 0;
pstapriv->tim_bitmap = 0;
@ -215,9 +214,9 @@ _func_enter_;
_func_exit_;
}
void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
static void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
{
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
#endif
@ -229,7 +228,7 @@ void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
_rtw_spinlock_free(&pstapriv->wakeup_q.lock);
_rtw_spinlock_free(&pstapriv->sleep_q.lock);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
_rtw_spinlock_free(&pstapriv->asoc_list_lock);
_rtw_spinlock_free(&pstapriv->auth_list_lock);
_rtw_spinlock_free(&pacl_list->acl_node_q.lock);
@ -302,7 +301,7 @@ _func_enter_;
rtw_list_delete(&(psta->list));
_exit_critical_bh(&(pfree_sta_queue->lock), &irql);
_rtw_init_stainfo(psta);
_rtw_memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
index = wifi_mac_hash(hwaddr);
RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_, ("rtw_alloc_stainfo: index=%x", index));
if (index >= NUM_STA) {
@ -326,7 +325,7 @@ _func_enter_;
/* So, we initialize the tid_rxseq variable as the 0xffff. */
for (i = 0; i < 16; i++)
_rtw_memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2);
memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2);
RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_,
("alloc number_%d stainfo with hwaddr = %pM\n",
@ -454,7 +453,7 @@ _func_enter_;
if (!(psta->state & WIFI_AP_STATE))
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, false);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
_enter_critical_bh(&pstapriv->auth_list_lock, &irql0);
if (!rtw_is_list_empty(&psta->auth_list)) {
@ -485,7 +484,7 @@ _func_enter_;
psta->under_exist_checking = 0;
#endif /* CONFIG_AP_MODE */
#endif /* CONFIG_88EU_AP_MODE */
_enter_critical_bh(&(pfree_sta_queue->lock), &irql0);
rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue));
@ -618,7 +617,7 @@ _func_exit_;
u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
{
u8 res = true;
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
unsigned long irql;
struct list_head *plist, *phead;
struct rtw_wlan_acl_node *paclnode;

View file

@ -28,7 +28,6 @@ static unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
static unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
static unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
static unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5};
static unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96};
static unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43};
@ -145,7 +144,7 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen
return network_type;
}
unsigned char ratetbl_val_2wifirate(unsigned char rate)
static unsigned char ratetbl_val_2wifirate(unsigned char rate)
{
unsigned char val = 0;
@ -190,7 +189,7 @@ unsigned char ratetbl_val_2wifirate(unsigned char rate)
return val;
}
int is_basicrate(struct adapter *padapter, unsigned char rate)
static int is_basicrate(struct adapter *padapter, unsigned char rate)
{
int i;
unsigned char val;
@ -207,7 +206,7 @@ int is_basicrate(struct adapter *padapter, unsigned char rate)
return false;
}
unsigned int ratetbl2rateset(struct adapter *padapter, unsigned char *rateset)
static unsigned int ratetbl2rateset(struct adapter *padapter, unsigned char *rateset)
{
int i;
unsigned char rate;
@ -242,7 +241,7 @@ void get_rate_set(struct adapter *padapter, unsigned char *pbssrate, int *bssrat
_rtw_memset(supportedrates, 0, NumRates);
*bssrate_len = ratetbl2rateset(padapter, supportedrates);
_rtw_memcpy(pbssrate, supportedrates, *bssrate_len);
memcpy(pbssrate, supportedrates, *bssrate_len);
}
void UpdateBrateTbl(struct adapter *Adapter, u8 *mbrate)
@ -307,11 +306,6 @@ void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable)
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode));
}
static void Set_NETYPE1_MSR(struct adapter *padapter, u8 type)
{
rtw_hal_set_hwreg(padapter, HW_VAR_MEDIA_STATUS1, (u8 *)(&type));
}
static void Set_NETYPE0_MSR(struct adapter *padapter, u8 type)
{
rtw_hal_set_hwreg(padapter, HW_VAR_MEDIA_STATUS, (u8 *)(&type));
@ -356,11 +350,11 @@ void SelectChannel(struct adapter *padapter, unsigned char channel)
{
/* saved channel info */
rtw_set_oper_ch(padapter, channel);
rtw_hal_set_chan(padapter, channel);
}
void SetBWMode(struct adapter *padapter, unsigned short bwmode, unsigned char channel_offset)
void SetBWMode(struct adapter *padapter, unsigned short bwmode,
unsigned char channel_offset)
{
/* saved bw info */
rtw_set_oper_bw(padapter, bwmode);
@ -419,7 +413,7 @@ __inline u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork)
u16 get_beacon_interval(struct wlan_bssid_ex *bss)
{
__le16 val;
_rtw_memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->IEs), 2);
memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->IEs), 2);
return le16_to_cpu(val);
}
@ -563,7 +557,7 @@ int WMM_param_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
}
pmlmeinfo->WMM_enable = 1;
_rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element));
memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element));
return true;
}
@ -637,7 +631,7 @@ void WMMOnAssocRsp(struct adapter *padapter)
inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3;
if (pregpriv->wifi_spec == 1) {
u32 j, tmp, change_inx;
u32 j, tmp, change_inx = false;
/* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */
for (i = 0; i < 4; i++) {
@ -819,7 +813,7 @@ void HT_info_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
return;
pmlmeinfo->HT_info_enable = 1;
_rtw_memcpy(&(pmlmeinfo->HT_info), pIE->data, pIE->Length);
memcpy(&(pmlmeinfo->HT_info), pIE->data, pIE->Length);
return;
}
@ -863,7 +857,7 @@ void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
return;
pmlmeinfo->ERP_enable = 1;
_rtw_memcpy(&(pmlmeinfo->ERP_IE), pIE->data, pIE->Length);
memcpy(&(pmlmeinfo->ERP_IE), pIE->data, pIE->Length);
}
void VCS_update(struct adapter *padapter, struct sta_info *psta)
@ -952,7 +946,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
/* below is to copy the information element */
bssid->IELength = len;
_rtw_memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength);
memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength);
/* check bw and channel offset */
/* parsing HT_CAP_IE */
@ -1014,7 +1008,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
}
if ((NULL != p) && (false == hidden_ssid && (*(p + 1)))) {
_rtw_memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
bssid->Ssid.SsidLength = *(p + 1);
} else {
bssid->Ssid.SsidLength = 0;
@ -1101,14 +1095,14 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
}
}
rtw_mfree((u8 *)bssid, sizeof(struct wlan_bssid_ex));
_func_exit_;
kfree(bssid);
return _SUCCESS;
_mismatch:
rtw_mfree((u8 *)bssid, sizeof(struct wlan_bssid_ex));
_func_exit_;
kfree(bssid);
return _FAIL;
_func_exit_;
}
void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta)
@ -1351,24 +1345,12 @@ unsigned char get_highest_rate_idx(u32 mask)
return rate_idx;
}
unsigned char get_highest_mcs_rate(struct HT_caps_element *pHT_caps)
{
int i, mcs_rate;
mcs_rate = (pHT_caps->u.HT_cap_element.MCS_rate[0] | (pHT_caps->u.HT_cap_element.MCS_rate[1] << 8));
for (i = 15; i >= 0; i--)
if (mcs_rate & (0x1 << i))
break;
return i;
}
void Update_RA_Entry(struct adapter *padapter, u32 mac_id)
{
rtw_hal_update_ra_mask(padapter, mac_id, 0);
}
void enable_rate_adaptive(struct adapter *padapter, u32 mac_id)
static void enable_rate_adaptive(struct adapter *padapter, u32 mac_id)
{
Update_RA_Entry(padapter, mac_id);
}
@ -1383,7 +1365,7 @@ void set_sta_rate(struct adapter *padapter, struct sta_info *psta)
void update_tx_basic_rate(struct adapter *padapter, u8 wirelessmode)
{
unsigned char supported_rates[NDIS_802_11_LENGTH_RATES_EX];
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
/* Added by Albert 2011/03/22 */
@ -1391,15 +1373,15 @@ void update_tx_basic_rate(struct adapter *padapter, u8 wirelessmode)
/* So, the Tx packet shouldn't use the CCK rate */
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
return;
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
_rtw_memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX);
if ((wirelessmode & WIRELESS_11B) && (wirelessmode == WIRELESS_11B)) {
_rtw_memcpy(supported_rates, rtw_basic_rate_cck, 4);
memcpy(supported_rates, rtw_basic_rate_cck, 4);
} else if (wirelessmode & WIRELESS_11B) {
_rtw_memcpy(supported_rates, rtw_basic_rate_mix, 7);
memcpy(supported_rates, rtw_basic_rate_mix, 7);
} else {
_rtw_memcpy(supported_rates, rtw_basic_rate_ofdm, 3);
memcpy(supported_rates, rtw_basic_rate_ofdm, 3);
}
if (wirelessmode & WIRELESS_11B)
@ -1430,7 +1412,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
return HT_IOT_PEER_ATHEROS;
} else if ((_rtw_memcmp(pIE->data, BROADCOM_OUI1, 3)) ||
(_rtw_memcmp(pIE->data, BROADCOM_OUI2, 3)) ||
(_rtw_memcmp(pIE->data, BROADCOM_OUI3, 3))) {
(_rtw_memcmp(pIE->data, BROADCOM_OUI2, 3))) {
DBG_88E("link to Broadcom AP\n");
return HT_IOT_PEER_BROADCOM;
} else if (_rtw_memcmp(pIE->data, MARVELL_OUI, 3)) {
@ -1608,9 +1590,9 @@ void update_bmc_sta_support_rate(struct adapter *padapter, u32 mac_id)
if (pmlmeext->cur_wireless_mode & WIRELESS_11B) {
/* Only B, B/G, and B/G/N AP could use CCK rate */
_rtw_memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_cck, 4);
memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_cck, 4);
} else {
_rtw_memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_ofdm, 4);
memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_ofdm, 3);
}
}
@ -1626,12 +1608,12 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_l
if (pIE == NULL)
return _FAIL;
_rtw_memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates, pIE->data, ie_len);
memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates, pIE->data, ie_len);
supportRateNum = ie_len;
pIE = (struct ndis_802_11_var_ie *)rtw_get_ie(pvar_ie, _EXT_SUPPORTEDRATES_IE_, &ie_len, var_ie_len);
if (pIE)
_rtw_memcpy((pmlmeinfo->FW_sta_info[cam_idx].SupportedRates + supportRateNum), pIE->data, ie_len);
memcpy((pmlmeinfo->FW_sta_info[cam_idx].SupportedRates + supportRateNum), pIE->data, ie_len);
return _SUCCESS;
}
@ -1703,6 +1685,5 @@ int rtw_handle_dualmac(struct adapter *adapter, bool init)
} else {
pbuddy_padapter = NULL;
}
exit:
return status;
}

View file

@ -66,7 +66,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
_func_enter_;
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
/* _rtw_memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */
_rtw_spinlock_init(&pxmitpriv->lock);
_rtw_init_sema(&pxmitpriv->xmit_sema, 0);
@ -232,7 +231,7 @@ _func_exit_;
return res;
}
void rtw_mfree_xmit_priv_lock (struct xmit_priv *pxmitpriv)
static void rtw_mfree_xmit_priv_lock (struct xmit_priv *pxmitpriv)
{
_rtw_spinlock_free(&pxmitpriv->lock);
_rtw_free_sema(&pxmitpriv->xmit_sema);
@ -484,21 +483,21 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
pattrib->ether_type = ntohs(etherhdr.h_proto);
_rtw_memcpy(pattrib->dst, &etherhdr.h_dest, ETH_ALEN);
_rtw_memcpy(pattrib->src, &etherhdr.h_source, ETH_ALEN);
memcpy(pattrib->dst, &etherhdr.h_dest, ETH_ALEN);
memcpy(pattrib->src, &etherhdr.h_source, ETH_ALEN);
pattrib->pctrl = 0;
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
_rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
_rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN);
_rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN);
memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
_rtw_memcpy(pattrib->ta, get_bssid(pmlmepriv), ETH_ALEN);
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->ta, get_bssid(pmlmepriv), ETH_ALEN);
}
pattrib->pktlen = pktfile.pkt_len;
@ -765,7 +764,7 @@ _func_enter_;
mic[0], mic[1], mic[2], mic[3], mic[4], mic[5], mic[6], mic[7]));
/* add mic code and add the mic code length in last_txcmdsz */
_rtw_memcpy(payload, &(mic[0]), 8);
memcpy(payload, &(mic[0]), 8);
pattrib->last_txcmdsz += 8;
RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("\n ======== last pkt ========\n"));
@ -828,7 +827,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
u8 qos_option = false;
int res = _SUCCESS;
u16 *fctrl = &pwlanhdr->frame_ctl;
__le16 *fctrl = &pwlanhdr->frame_ctl;
struct sta_info *psta;
@ -855,26 +854,26 @@ _func_enter_;
/* to_ds = 1, fr_ds = 0; */
/* Data transfer to AP */
SetToDs(fctrl);
_rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
if (pqospriv->qos_option)
qos_option = true;
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* to_ds = 0, fr_ds = 1; */
SetFrDs(fctrl);
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN);
memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN);
if (psta->qos_option)
qos_option = true;
} else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
if (psta->qos_option)
qos_option = true;
@ -1078,7 +1077,7 @@ _func_enter_;
switch (pattrib->encrypt) {
case _WEP40_:
case _WEP104_:
WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
break;
case _TKIP_:
if (bmcst)
@ -1095,7 +1094,7 @@ _func_enter_;
}
}
_rtw_memcpy(pframe, pattrib->iv, pattrib->iv_len);
memcpy(pframe, pattrib->iv, pattrib->iv_len);
RT_TRACE(_module_rtl871x_xmit_c_, _drv_notice_,
("rtw_xmitframe_coalesce: keyid=%d pattrib->iv[3]=%.2x pframe=%.2x %.2x %.2x %.2x\n",
@ -1126,7 +1125,7 @@ _func_enter_;
pframe += mem_sz;
if ((pattrib->icv_len > 0) && (pattrib->bswenc)) {
_rtw_memcpy(pframe, pattrib->icv, pattrib->icv_len);
memcpy(pframe, pattrib->icv, pattrib->icv_len);
pframe += pattrib->icv_len;
}
@ -1148,7 +1147,7 @@ _func_enter_;
addr = (size_t)(pframe);
mem_start = (unsigned char *)RND4(addr) + hw_hdr_offset;
_rtw_memcpy(mem_start, pbuf_start + hw_hdr_offset, pattrib->hdrlen);
memcpy(mem_start, pbuf_start + hw_hdr_offset, pattrib->hdrlen);
}
if (xmitframe_addmic(padapter, pxmitframe) == _FAIL) {
@ -1557,12 +1556,20 @@ 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);
if (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist);
rtw_list_delete(&pxmitframe->list);
ptxservq->qcnt--;
break;
pxmitframe = NULL;
}
return pxmitframe;
}
@ -1737,8 +1744,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
hwxmits = pxmitpriv->hwxmits;
if (hwxmits)
rtw_mfree((u8 *)hwxmits, (sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry));
kfree(hwxmits);
}
void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry)
@ -1758,13 +1764,9 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
unsigned short vlan_hdr = 0;
void *br_port = NULL;
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
br_port = padapter->pnetdev->br_port;
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
rcu_read_lock();
br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
rcu_read_unlock();
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
_enter_critical_bh(&padapter->br_ext_lock, &irql);
if (!(skb->data[0] & 1) && br_port &&
memcmp(skb->data+MACADDRLEN, padapter->br_mac, MACADDRLEN) &&
@ -1838,11 +1840,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
if (skb_is_nonlinear(skb))
DEBUG_ERR("%s(): skb_is_nonlinear!!\n", __func__);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
res = skb_linearize(skb, GFP_ATOMIC);
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) */
res = skb_linearize(skb);
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) */
if (res < 0) {
DEBUG_ERR("TX DROP: skb_linearize fail!\n");
return -1;
@ -1937,7 +1935,7 @@ static void do_queue_select(struct adapter *padapter, struct pkt_attrib *pattrib
*/
s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
{
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
unsigned long irql0;
#endif
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
@ -1953,13 +1951,9 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
return -1;
}
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
br_port = padapter->pnetdev->br_port;
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
rcu_read_lock();
br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
rcu_read_unlock();
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
if (br_port && check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE)) {
res = rtw_br_client_tx(padapter, ppkt);
@ -1982,7 +1976,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
do_queue_select(padapter, &pxmitframe->attrib);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
_enter_critical_bh(&pxmitpriv->lock, &irql0);
if (xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe)) {
_exit_critical_bh(&pxmitpriv->lock, &irql0);
@ -1997,7 +1991,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
return 0;
}
#if defined(CONFIG_AP_MODE)
#if defined(CONFIG_88EU_AP_MODE)
int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_frame *pxmitframe)
{

View file

@ -202,7 +202,7 @@ enum HAL_STATUS ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *dm_odm)
u32 *array = array_agc_tab_1t_8188e;
bool biol = false;
struct adapter *adapter = dm_odm->Adapter;
struct xmit_frame *pxmit_frame;
struct xmit_frame *pxmit_frame = NULL;
u8 bndy_cnt = 1;
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
@ -480,9 +480,9 @@ enum HAL_STATUS ODM_ReadAndConfig_PHY_REG_1T_8188E(struct odm_dm_struct *dm_odm)
u8 board = dm_odm->BoardType;
u32 arraylen = sizeof(array_phy_reg_1t_8188e)/sizeof(u32);
u32 *array = array_phy_reg_1t_8188e;
bool biol = false;
bool biol = false;
struct adapter *adapter = dm_odm->Adapter;
struct xmit_frame *pxmit_frame;
struct xmit_frame *pxmit_frame = NULL;
u8 bndy_cnt = 1;
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
hex += board;

View file

@ -159,7 +159,7 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
bool biol = false;
struct adapter *adapt = dm_odm->Adapter;
struct xmit_frame *pxmit_frame;
struct xmit_frame *pxmit_frame = NULL;
u8 bndy_cnt = 1;
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
hex += board;

View file

@ -170,7 +170,7 @@ enum HAL_STATUS ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *pDM_Odm)
u32 *Array = Array_RadioA_1T_8188E;
bool biol = false;
struct adapter *Adapter = pDM_Odm->Adapter;
struct xmit_frame *pxmit_frame;
struct xmit_frame *pxmit_frame = NULL;
u8 bndy_cnt = 1;
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;

View file

@ -26,30 +26,6 @@
void ODM_ResetIQKResult(struct odm_dm_struct *pDM_Odm)
{
u8 i;
struct adapter *adapt = pDM_Odm->Adapter;
if (!IS_HARDWARE_TYPE_8192D(adapt))
return;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
("PHY_ResetIQKResult:: settings regs %d default regs %d\n",
(u32)(sizeof(pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting) /
sizeof(struct ijk_matrix_regs_set)), IQK_Matrix_Settings_NUM));
/* 0xe94, 0xe9c, 0xea4, 0xeac, 0xeb4, 0xebc, 0xec4, 0xecc */
for (i = 0; i < IQK_Matrix_Settings_NUM; i++) {
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][0] = 0x100;
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][2] = 0x100;
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][4] = 0x100;
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][6] = 0x100;
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][1] = 0;
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][3] = 0;
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][5] = 0;
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][7] = 0;
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].bIQKDone = false;
}
}
u8 ODM_GetRightChnlPlaceforIQK(u8 chnl)

View file

@ -1661,9 +1661,8 @@ static void phy_APCalibrate_8188E(struct adapter *adapt, s8 delta, bool is2t)
else
ODM_SetRFReg(dm_odm, path, 0x4, bMaskDWord,
((APK_result[path][1] << 15) | (APK_result[path][1] << 10) | (0x02 << 5) | 0x05));
if (!IS_HARDWARE_TYPE_8723A(adapt))
ODM_SetRFReg(dm_odm, path, RF_BS_PA_APSET_G9_G11, bMaskDWord,
((0x08 << 15) | (0x08 << 10) | (0x08 << 5) | 0x08));
ODM_SetRFReg(dm_odm, path, RF_BS_PA_APSET_G9_G11, bMaskDWord,
((0x08 << 15) | (0x08 << 10) | (0x08 << 5) | 0x08));
}
dm_odm->RFCalibrateInfo.bAPKdone = true;
@ -1868,6 +1867,28 @@ 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);

View file

@ -268,14 +268,14 @@ void rtw_hal_update_ra_mask(struct adapter *adapt, u32 mac_id, u8 rssi_level)
struct mlme_priv *pmlmepriv = &(adapt->mlmepriv);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
#ifdef CONFIG_88EU_AP_MODE
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &adapt->stapriv;
#ifdef CONFIG_AP_MODE
if ((mac_id-1) > 0)
psta = pstapriv->sta_aid[(mac_id-1) - 1];
#endif
if (psta)
add_RATid(adapt, psta, 0);/* todo: based on rssi_level*/
#endif
} else {
if (adapt->HalFunc.UpdateRAMaskHandler)
adapt->HalFunc.UpdateRAMaskHandler(adapt, mac_id,

298
hal/odm.c
View file

@ -540,51 +540,6 @@ void odm_CmnInfoUpdate_Debug(struct odm_dm_struct *pDM_Odm)
ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("RSSI_Min=%d\n", pDM_Odm->RSSI_Min));
}
/* 3============================================================ */
/* 3 DIG */
/* 3============================================================ */
/*-----------------------------------------------------------------------------
* Function: odm_DIGInit()
*
* Overview: Set DIG scheme init value.
*
* Input: NONE
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
*
*---------------------------------------------------------------------------*/
static void ODM_ChangeDynamicInitGainThresh(struct odm_dm_struct *pDM_Odm, u32 DM_Type, u32 DM_Value)
{
struct rtw_dig *pDM_DigTable = &pDM_Odm->DM_DigTable;
if (DM_Type == DM_DIG_THRESH_HIGH) {
pDM_DigTable->RssiHighThresh = DM_Value;
} else if (DM_Type == DM_DIG_THRESH_LOW) {
pDM_DigTable->RssiLowThresh = DM_Value;
} else if (DM_Type == RT_TYPE_ENABLE) {
pDM_DigTable->Dig_Enable_Flag = true;
} else if (DM_Type == RT_TYPE_DISABLE) {
pDM_DigTable->Dig_Enable_Flag = false;
} else if (DM_Type == RT_TYPE_BACKOFF) {
if (DM_Value > 30)
DM_Value = 30;
pDM_DigTable->BackoffVal = (u8)DM_Value;
} else if (DM_Type == RT_TYPE_RX_GAIN_MIN) {
if (DM_Value == 0)
DM_Value = 0x1;
pDM_DigTable->rx_gain_range_min = (u8)DM_Value;
} else if (DM_Type == RT_TYPE_RX_GAIN_MAX) {
if (DM_Value > 0x50)
DM_Value = 0x50;
pDM_DigTable->rx_gain_range_max = (u8)DM_Value;
}
} /* DM_ChangeDynamicInitGainThresh */
static int getIGIForDiff(int value_IGI)
{
#define ONERCCA_LOW_TH 0x30
@ -1470,39 +1425,6 @@ void odm_DynamicTxPowerInit(struct odm_dm_struct *pDM_Odm)
pdmpriv->DynamicTxHighPowerLvl = TxHighPwrLevel_Normal;
}
static void odm_DynamicTxPowerSavePowerIndex(struct odm_dm_struct *pDM_Odm)
{
u8 index;
u32 Power_Index_REG[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a};
struct adapter *Adapter = pDM_Odm->Adapter;
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
struct dm_priv *pdmpriv = &pHalData->dmpriv;
for (index = 0; index < 6; index++)
pdmpriv->PowerIndex_backup[index] = rtw_read8(Adapter, Power_Index_REG[index]);
}
static void odm_DynamicTxPowerRestorePowerIndex(struct odm_dm_struct *pDM_Odm)
{
u8 index;
struct adapter *Adapter = pDM_Odm->Adapter;
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
u32 Power_Index_REG[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a};
struct dm_priv *pdmpriv = &pHalData->dmpriv;
for (index = 0; index < 6; index++)
rtw_write8(Adapter, Power_Index_REG[index], pdmpriv->PowerIndex_backup[index]);
}
static void odm_DynamicTxPowerWritePowerIndex(struct odm_dm_struct *pDM_Odm, u8 Value)
{
u8 index;
u32 Power_Index_REG[6] = {0xc90, 0xc91, 0xc92, 0xc98, 0xc99, 0xc9a};
for (index = 0; index < 6; index++)
ODM_Write1Byte(pDM_Odm, Power_Index_REG[index], Value);
}
void odm_DynamicTxPower(struct odm_dm_struct *pDM_Odm)
{
/* For AP/ADSL use struct rtl8192cd_priv * */
@ -1546,18 +1468,10 @@ void odm_DynamicTxPowerAP(struct odm_dm_struct *pDM_Odm)
{
}
static void odm_DynamicTxPower_92C(struct odm_dm_struct *pDM_Odm)
{
}
/* 3============================================================ */
/* 3 RSSI Monitor */
/* 3============================================================ */
static void odm_RSSIMonitorInit(struct odm_dm_struct *pDM_Odm)
{
}
void odm_RSSIMonitorCheck(struct odm_dm_struct *pDM_Odm)
{
if (!(pDM_Odm->SupportAbility & ODM_BB_RSSI_MONITOR))
@ -1589,13 +1503,6 @@ void odm_RSSIMonitorCheckMP(struct odm_dm_struct *pDM_Odm)
{
}
/* */
/* sherry move from DUSC to here 20110517 */
/* */
static void FindMinimumRSSI_Dmsp(struct adapter *pAdapter)
{
}
static void FindMinimumRSSI(struct adapter *pAdapter)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
@ -1780,10 +1687,6 @@ void odm_SwAntDivChkAntSwitch(struct odm_dm_struct *pDM_Odm, u8 Step)
{
}
static void ODM_SwAntDivResetBeforeLink(struct odm_dm_struct *pDM_Odm)
{
}
void ODM_SwAntDivRestAfterLink(struct odm_dm_struct *pDM_Odm)
{
}
@ -1796,67 +1699,6 @@ void odm_SwAntDivChkAntSwitchCallback(void *FunctionContext)
/* 3 SW Antenna Diversity */
/* 3============================================================ */
static void odm_InitHybridAntDiv_88C_92D(struct odm_dm_struct *pDM_Odm)
{
struct sw_ant_switch *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
u8 bTxPathSel = 0; /* 0:Path-A 1:Path-B */
u8 i;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_InitHybridAntDiv==============>\n"));
/* whether to do antenna diversity or not */
if ((pDM_Odm->SupportICType != ODM_RTL8192C) && (pDM_Odm->SupportICType != ODM_RTL8192D))
return;
bTxPathSel = (pDM_Odm->RFType == ODM_1T1R) ? false : true;
ODM_SetBBReg(pDM_Odm, ODM_REG_BB_PWR_SAV1_11N, BIT23, 0); /* No update ANTSEL during GNT_BT=1 */
ODM_SetBBReg(pDM_Odm, ODM_REG_TX_ANT_CTRL_11N, BIT21, 1); /* TX atenna selection from tx_info */
ODM_SetBBReg(pDM_Odm, ODM_REG_ANTSEL_PIN_11N, BIT23, 1); /* enable LED[1:0] pin as ANTSEL */
ODM_SetBBReg(pDM_Odm, ODM_REG_ANTSEL_CTRL_11N, BIT8|BIT9, 0x01); /* 0x01: left antenna, 0x02: right antenna */
/* check HW setting: ANTSEL pin connection */
/* only AP support different path selection temperarly */
if (!bTxPathSel) { /* PATH-A */
ODM_SetBBReg(pDM_Odm, ODM_REG_PIN_CTRL_11N, BIT8|BIT9, 0); /* ANTSEL as HW control */
ODM_SetBBReg(pDM_Odm, ODM_REG_ANTSEL_PATH_11N, BIT13, 1); /* select TX ANTESEL from path A */
} else {
ODM_SetBBReg(pDM_Odm, ODM_REG_PIN_CTRL_11N, BIT24|BIT25, 0); /* ANTSEL as HW control */
ODM_SetBBReg(pDM_Odm, ODM_REG_ANTSEL_PATH_11N, BIT13, 0); /* select ANTESEL from path B */
}
/* Set OFDM HW RX Antenna Diversity */
ODM_SetBBReg(pDM_Odm, ODM_REG_ANTDIV_PARA1_11N, 0x7FF, 0x0c0); /* Pwdb threshold=8dB */
ODM_SetBBReg(pDM_Odm, ODM_REG_ANTDIV_PARA1_11N, BIT11, 0); /* Switch to another antenna by checking pwdb threshold */
ODM_SetBBReg(pDM_Odm, ODM_REG_ANTDIV_PARA3_11N, BIT23, 1); /* Decide final antenna by comparing 2 antennas' pwdb */
/* Set CCK HW RX Antenna Diversity */
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT4, 0); /* Antenna diversity decision period = 32 sample */
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA2_11N, 0xf, 0xf); /* Threshold for antenna diversity. Check another antenna power if input power < ANT_lim*4 */
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA3_11N, BIT13, 1); /* polarity ana_A=1 and ana_B=0 */
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA4_11N, 0x1f, 0x8); /* default antenna power = inpwr*(0.5 + r_ant_step/16) */
/* Enable HW Antenna Diversity */
if (!bTxPathSel) /* PATH-A */
ODM_SetBBReg(pDM_Odm, ODM_REG_IGI_A_11N, BIT7, 1); /* Enable Hardware antenna switch */
else
ODM_SetBBReg(pDM_Odm, ODM_REG_IGI_B_11N, BIT7, 1); /* Enable Hardware antenna switch */
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA1_11N, BIT15, 1);/* Enable antenna diversity */
pDM_SWAT_Table->CurAntenna = 0; /* choose left antenna as default antenna */
pDM_SWAT_Table->PreAntenna = 0;
for (i = 0; i < ASSOCIATE_ENTRY_NUM; i++) {
pDM_SWAT_Table->CCK_Ant1_Cnt[i] = 0;
pDM_SWAT_Table->CCK_Ant2_Cnt[i] = 0;
pDM_SWAT_Table->OFDM_Ant1_Cnt[i] = 0;
pDM_SWAT_Table->OFDM_Ant2_Cnt[i] = 0;
pDM_SWAT_Table->RSSI_Ant1_Sum[i] = 0;
pDM_SWAT_Table->RSSI_Ant2_Sum[i] = 0;
}
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("<==============odm_InitHybridAntDiv\n"));
}
void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm)
{
if (!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) {
@ -1870,69 +1712,6 @@ void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm)
ODM_AntennaDiversityInit_88E(pDM_Odm);
}
static bool odm_StaDefAntSel(struct odm_dm_struct *pDM_Odm, u32 OFDM_Ant1_Cnt,
u32 OFDM_Ant2_Cnt, u32 CCK_Ant1_Cnt, u32 CCK_Ant2_Cnt, u8 *pDefAnt)
{
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_StaDefAntSelect==============>\n"));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("OFDM_Ant1_Cnt:%d, OFDM_Ant2_Cnt:%d\n", OFDM_Ant1_Cnt, OFDM_Ant2_Cnt));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("CCK_Ant1_Cnt:%d, CCK_Ant2_Cnt:%d\n", CCK_Ant1_Cnt, CCK_Ant2_Cnt));
if (((OFDM_Ant1_Cnt+OFDM_Ant2_Cnt) == 0) && ((CCK_Ant1_Cnt + CCK_Ant2_Cnt) < 10)) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_StaDefAntSelect Fail: No enough packet info!\n"));
return false;
}
if (OFDM_Ant1_Cnt || OFDM_Ant2_Cnt) {
/* if RX OFDM packet number larger than 0 */
if (OFDM_Ant1_Cnt > OFDM_Ant2_Cnt)
(*pDefAnt) = 1;
else
(*pDefAnt) = 0;
} else if ((CCK_Ant1_Cnt + CCK_Ant2_Cnt) >= 10) {
/* else if RX CCK packet number larger than 10 */
if (CCK_Ant1_Cnt > (5*CCK_Ant2_Cnt))
(*pDefAnt) = 1;
else if (CCK_Ant2_Cnt > (5*CCK_Ant1_Cnt))
(*pDefAnt) = 0;
else if (CCK_Ant1_Cnt > CCK_Ant2_Cnt)
(*pDefAnt) = 0;
else
(*pDefAnt) = 1;
}
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("TxAnt = %s\n", ((*pDefAnt) == 1) ? "Ant1" : "Ant2"));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("<==============odm_StaDefAntSelect\n"));
return true;
}
static void odm_SetRxIdleAnt(struct odm_dm_struct *pDM_Odm, u8 Ant, bool bDualPath)
{
struct sw_ant_switch *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
if (Ant != pDM_SWAT_Table->RxIdleAnt) {
/* for path-A */
if (Ant == 1)
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N, 0xFFFF, 0x65a9); /* right-side antenna */
else
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N, 0xFFFF, 0x569a); /* left-side antenna */
/* for path-B */
if (bDualPath) {
if (Ant == 0)
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N, 0xFFFF0000, 0x65a9); /* right-side antenna */
else
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N, 0xFFFF0000, 0x569a); /* left-side antenna */
}
}
pDM_SWAT_Table->RxIdleAnt = Ant;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("RxIdleAnt: %s Reg858=0x%x\n", (Ant == 1) ? "Ant1" : "Ant2", (Ant == 1) ? 0x65a9 : 0x569a));
}
void ODM_AntselStatistics_88C(struct odm_dm_struct *pDM_Odm, u8 MacId, u32 PWDBAll, bool isCCKrate)
{
struct sw_ant_switch *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
@ -1954,78 +1733,6 @@ void ODM_AntselStatistics_88C(struct odm_dm_struct *pDM_Odm, u8 MacId, u32 PWDBA
}
}
static void ODM_SetTxAntByTxInfo_88C_92D(struct odm_dm_struct *pDM_Odm)
{
}
static void odm_HwAntDiv_92C_92D(struct odm_dm_struct *pDM_Odm)
{
struct sw_ant_switch *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
u32 RSSI_Min = 0xFF, RSSI, RSSI_Ant1, RSSI_Ant2;
u8 RxIdleAnt, i;
bool bRet = false;
struct sta_info *pEntry;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_HwAntDiv==============>\n"));
if (!(pDM_Odm->SupportAbility&ODM_BB_ANT_DIV)) {
/* if don't support antenna diveristy */
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_HwAntDiv: Not supported!\n"));
return;
}
if ((pDM_Odm->SupportICType != ODM_RTL8192C) && (pDM_Odm->SupportICType != ODM_RTL8192D)) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Return: IC Type is not 92C or 92D\n"));
return;
}
if (!pDM_Odm->bLinked) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Return: bLinked is false\n"));
return;
}
for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) {
pEntry = pDM_Odm->pODM_StaInfo[i];
if (IS_STA_VALID(pEntry)) {
RSSI_Ant1 = (pDM_SWAT_Table->OFDM_Ant1_Cnt[i] == 0) ? 0 : (pDM_SWAT_Table->RSSI_Ant1_Sum[i]/pDM_SWAT_Table->OFDM_Ant1_Cnt[i]);
RSSI_Ant2 = (pDM_SWAT_Table->OFDM_Ant2_Cnt[i] == 0) ? 0 : (pDM_SWAT_Table->RSSI_Ant2_Sum[i]/pDM_SWAT_Table->OFDM_Ant2_Cnt[i]);
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("RSSI_Ant1=%d, RSSI_Ant2=%d\n", RSSI_Ant1, RSSI_Ant2));
if (RSSI_Ant1 || RSSI_Ant2) {
RSSI = (RSSI_Ant1 < RSSI_Ant2) ? RSSI_Ant1 : RSSI_Ant2;
if ((!RSSI) || (RSSI < RSSI_Min)) {
pDM_SWAT_Table->TargetSTA = i;
RSSI_Min = RSSI;
}
}
/* STA: found out default antenna */
bRet = odm_StaDefAntSel(pDM_Odm,
pDM_SWAT_Table->OFDM_Ant1_Cnt[i],
pDM_SWAT_Table->OFDM_Ant2_Cnt[i],
pDM_SWAT_Table->CCK_Ant1_Cnt[i],
pDM_SWAT_Table->CCK_Ant2_Cnt[i],
&pDM_SWAT_Table->TxAnt[i]);
/* if Tx antenna selection: successful */
if (bRet) {
pDM_SWAT_Table->RSSI_Ant1_Sum[i] = 0;
pDM_SWAT_Table->RSSI_Ant2_Sum[i] = 0;
pDM_SWAT_Table->OFDM_Ant1_Cnt[i] = 0;
pDM_SWAT_Table->OFDM_Ant2_Cnt[i] = 0;
pDM_SWAT_Table->CCK_Ant1_Cnt[i] = 0;
pDM_SWAT_Table->CCK_Ant2_Cnt[i] = 0;
}
}
}
/* set RX Idle Ant */
RxIdleAnt = pDM_SWAT_Table->TxAnt[pDM_SWAT_Table->TargetSTA];
odm_SetRxIdleAnt(pDM_Odm, RxIdleAnt, false);
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("<==============odm_HwAntDiv\n"));
}
void odm_HwAntDiv(struct odm_dm_struct *pDM_Odm)
{
if (!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)) {
@ -2095,11 +1802,6 @@ void odm_EdcaTurboCheckCE(struct odm_dm_struct *pDM_Odm)
if (pmlmeinfo->assoc_AP_vendor >= HT_IOT_PEER_MAX)
goto dm_CheckEdcaTurbo_EXIT;
#ifdef CONFIG_BT_COEXIST
if (BT_DisableEDCATurbo(Adapter))
goto dm_CheckEdcaTurbo_EXIT;
#endif
/* Check if the status needs to be changed. */
if ((bbtchange) || (!precvpriv->bIsAnyNonBEPkts)) {
cur_tx_bytes = pxmitpriv->tx_bytes - pxmitpriv->last_tx_bytes;

View file

@ -41,20 +41,17 @@ static u8 odm_QueryRxPwrPercentage(s8 AntPower)
/* IF other SW team do not support the feature, remove this section.?? */
static s32 odm_sig_patch_lenove(struct odm_dm_struct *dm_odm, s32 CurrSig)
{
s32 RetSig;
return RetSig;
return 0;
}
static s32 odm_sig_patch_netcore(struct odm_dm_struct *dm_odm, s32 CurrSig)
{
s32 RetSig;
return RetSig;
return 0;
}
static s32 odm_SignalScaleMapping_92CSeries(struct odm_dm_struct *dm_odm, s32 CurrSig)
{
s32 RetSig;
s32 RetSig = 0;
if ((dm_odm->SupportInterface == ODM_ITRF_USB) ||
(dm_odm->SupportInterface == ODM_ITRF_SDIO)) {
@ -96,8 +93,7 @@ static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
static u8 odm_SQ_process_patch_RT_CID_819x_Lenovo(struct odm_dm_struct *dm_odm,
u8 isCCKrate, u8 PWDB_ALL, u8 path, u8 RSSI)
{
u8 SQ;
return SQ;
return 0;
}
static u8 odm_EVMdbToPercentage(s8 Value)

View file

@ -44,9 +44,6 @@ static u8 _is_fw_read_cmd_down(struct adapter *adapt, u8 msgbox_num)
valid = rtw_read8(adapt, REG_HMETFR) & BIT(msgbox_num);
if (0 == valid)
read_down = true;
#ifdef CONFIG_WOWLAN
rtw_msleep_os(2);
#endif
} while ((!read_down) && (retry_cnts--));
return read_down;
@ -101,11 +98,11 @@ _func_enter_;
*(u8 *)(&h2c_cmd) = ElementID;
if (CmdLen <= 3) {
_rtw_memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, CmdLen);
memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, CmdLen);
} else {
_rtw_memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, 3);
memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, 3);
ext_cmd_len = CmdLen-3;
_rtw_memcpy((u8 *)(&h2c_cmd_ex), pCmdBuffer+3, ext_cmd_len);
memcpy((u8 *)(&h2c_cmd_ex), pCmdBuffer+3, ext_cmd_len);
/* Write Ext command */
msgbox_ex_addr = REG_HMEBOX_EXT_0 + (h2c_box_num * RTL88E_EX_MESSAGE_BOX_SIZE);
@ -163,7 +160,7 @@ _func_enter_;
_rtw_memset(buf, 0, 3);
lmask = cpu_to_le32(mask);
_rtw_memcpy(buf, &lmask, 3);
memcpy(buf, &lmask, 3);
FillH2CCmd_88E(adapt, H2C_DM_MACID_CFG, 3, buf);
} else {
@ -276,7 +273,7 @@ void rtl8188e_set_FwMediaStatus_cmd(struct adapter *adapt, __le16 mstatus_rpt)
static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength)
{
struct rtw_ieee80211_hdr *pwlanhdr;
u16 *fctrl;
__le16 *fctrl;
u32 rate_len, pktlen;
struct mlme_ext_priv *pmlmeext = &(adapt->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -288,9 +285,9 @@ static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength)
fctrl = &(pwlanhdr->frame_ctl);
*(fctrl) = 0;
_rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN);
memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN);
memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN);
memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN);
SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/);
SetFrameSubType(pframe, WIFI_BEACON);
@ -303,20 +300,20 @@ static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength)
pktlen += 8;
/* beacon interval: 2 bytes */
_rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2);
memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2);
pframe += 2;
pktlen += 2;
/* capability info: 2 bytes */
_rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2);
memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2);
pframe += 2;
pktlen += 2;
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
pktlen += cur_network->IELength - sizeof(struct ndis_802_11_fixed_ie);
_rtw_memcpy(pframe, cur_network->IEs+sizeof(struct ndis_802_11_fixed_ie), pktlen);
memcpy(pframe, cur_network->IEs+sizeof(struct ndis_802_11_fixed_ie), pktlen);
goto _ConstructBeacon;
}
@ -361,9 +358,9 @@ _ConstructBeacon:
static void ConstructPSPoll(struct adapter *adapt, u8 *pframe, u32 *pLength)
{
struct rtw_ieee80211_hdr *pwlanhdr;
u16 *fctrl;
struct mlme_ext_priv *pmlmeext = &(adapt->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
__le16 *fctrl;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -377,10 +374,10 @@ static void ConstructPSPoll(struct adapter *adapt, u8 *pframe, u32 *pLength)
SetDuration(pframe, (pmlmeinfo->aid | 0xc000));
/* BSSID. */
_rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
/* TA. */
_rtw_memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN);
memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN);
*pLength = 16;
}
@ -394,7 +391,7 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe,
u8 bForcePowerSave)
{
struct rtw_ieee80211_hdr *pwlanhdr;
u16 *fctrl;
__le16 *fctrl;
u32 pktlen;
struct mlme_priv *pmlmepriv = &adapt->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network;
@ -411,21 +408,21 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe,
switch (cur_network->network.InfrastructureMode) {
case Ndis802_11Infrastructure:
SetToDs(fctrl);
_rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, StaAddr, ETH_ALEN);
memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN);
memcpy(pwlanhdr->addr3, StaAddr, ETH_ALEN);
break;
case Ndis802_11APMode:
SetFrDs(fctrl);
_rtw_memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, myid(&(adapt->eeprompriv)), ETH_ALEN);
memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN);
memcpy(pwlanhdr->addr2, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
memcpy(pwlanhdr->addr3, myid(&(adapt->eeprompriv)), ETH_ALEN);
break;
case Ndis802_11IBSS:
default:
_rtw_memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN);
memcpy(pwlanhdr->addr2, myid(&(adapt->eeprompriv)), ETH_ALEN);
memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
break;
}
@ -453,7 +450,7 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe,
static void ConstructProbeRsp(struct adapter *adapt, u8 *pframe, u32 *pLength, u8 *StaAddr, bool bHideSSID)
{
struct rtw_ieee80211_hdr *pwlanhdr;
u16 *fctrl;
__le16 *fctrl;
u8 *mac, *bssid;
u32 pktlen;
struct mlme_ext_priv *pmlmeext = &(adapt->mlmeextpriv);
@ -467,9 +464,9 @@ static void ConstructProbeRsp(struct adapter *adapt, u8 *pframe, u32 *pLength, u
fctrl = &(pwlanhdr->frame_ctl);
*(fctrl) = 0;
_rtw_memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, bssid, ETH_ALEN);
memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN);
memcpy(pwlanhdr->addr2, mac, ETH_ALEN);
memcpy(pwlanhdr->addr3, bssid, ETH_ALEN);
SetSeqNum(pwlanhdr, 0);
SetFrameSubType(fctrl, WIFI_PROBERSP);
@ -480,7 +477,7 @@ static void ConstructProbeRsp(struct adapter *adapt, u8 *pframe, u32 *pLength, u
if (cur_network->IELength > MAX_IE_SZ)
return;
_rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength);
memcpy(pframe, cur_network->IEs, cur_network->IELength);
pframe += cur_network->IELength;
pktlen += cur_network->IELength;
@ -511,7 +508,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
struct xmit_priv *pxmitpriv;
struct mlme_ext_priv *pmlmeext;
struct mlme_ext_info *pmlmeinfo;
u32 BeaconLength, ProbeRspLength, PSPollLength;
u32 BeaconLength = 0, ProbeRspLength = 0, PSPollLength;
u32 NullDataLength, QosNullLength;
u8 *ReservedPagePacket;
u8 PageNum, PageNeed, TxDescLen;
@ -599,7 +596,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
pattrib->qsel = 0x10;
pattrib->last_txcmdsz = TotalPacketLen - TXDESC_OFFSET;
pattrib->pktlen = pattrib->last_txcmdsz;
_rtw_memcpy(pmgntframe->buf_addr, ReservedPagePacket, TotalPacketLen);
memcpy(pmgntframe->buf_addr, ReservedPagePacket, TotalPacketLen);
rtw_hal_mgnt_xmit(adapt, pmgntframe);
@ -607,14 +604,11 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
FillH2CCmd_88E(adapt, H2C_COM_RSVD_PAGE, sizeof(RsvdPageLoc), (u8 *)&RsvdPageLoc);
exit:
rtw_mfree(ReservedPagePacket, 1000);
kfree(ReservedPagePacket);
}
void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
{
#ifdef CONFIG_WOWLAN
struct joinbssrpt_parm JoinBssRptParm;
#endif /* CONFIG_WOWLAN */
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
struct mlme_ext_priv *pmlmeext = &(adapt->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -707,21 +701,12 @@ _func_enter_;
haldata->RegCR_1 &= (~BIT0);
rtw_write8(adapt, REG_CR+1, haldata->RegCR_1);
}
#ifdef CONFIG_WOWLAN
if (adapt->pwrctrlpriv.wowlan_mode) {
JoinBssRptParm.OpMode = mstatus;
JoinBssRptParm.MacID = 0;
FillH2CCmd_88E(adapt, H2C_COM_MEDIA_STATUS_RPT, sizeof(JoinBssRptParm), (u8 *)&JoinBssRptParm);
DBG_88E_LEVEL(_drv_info_, "%s opmode:%d MacId:%d\n", __func__, JoinBssRptParm.OpMode, JoinBssRptParm.MacID);
} else {
DBG_88E_LEVEL(_drv_info_, "%s wowlan_mode is off\n", __func__);
}
#endif /* CONFIG_WOWLAN */
_func_exit_;
}
void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state)
{
#ifdef CONFIG_88EU_P2P
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
struct wifidirect_info *pwdinfo = &(adapt->wdinfo);
struct P2P_PS_Offload_t *p2p_ps_offload = &haldata->p2p_ps_offload;
@ -788,94 +773,7 @@ _func_enter_;
}
FillH2CCmd_88E(adapt, H2C_PS_P2P_OFFLOAD, 1, (u8 *)p2p_ps_offload);
#endif
_func_exit_;
}
#ifdef CONFIG_WOWLAN
void rtl8188es_set_wowlan_cmd(struct adapter *adapt, u8 enable)
{
u8 res = _SUCCESS;
struct setwowlan_parm pwowlan_parm;
struct setaoac_glocal_info paoac_global_info_parm;
struct pwrctrl_priv *pwrpriv = &adapt->pwrctrlpriv;
_func_enter_;
DBG_88E_LEVEL(_drv_info_, "+%s+\n", __func__);
pwowlan_parm.mode = 0;
pwowlan_parm.gpio_index = 0;
pwowlan_parm.gpio_duration = 0;
pwowlan_parm.second_mode = 0;
pwowlan_parm.reserve = 0;
if (enable) {
pwowlan_parm.mode |= FW_WOWLAN_FUN_EN;
pwrpriv->wowlan_magic = true;
pwrpriv->wowlan_unicast = true;
if (pwrpriv->wowlan_pattern) {
pwowlan_parm.mode |= FW_WOWLAN_PATTERN_MATCH;
DBG_88E_LEVEL(_drv_info_, "%s 2.pwowlan_parm.mode=0x%x\n", __func__, pwowlan_parm.mode);
}
if (pwrpriv->wowlan_magic) {
pwowlan_parm.mode |= FW_WOWLAN_MAGIC_PKT;
DBG_88E_LEVEL(_drv_info_, "%s 3.pwowlan_parm.mode=0x%x\n", __func__, pwowlan_parm.mode);
}
if (pwrpriv->wowlan_unicast) {
pwowlan_parm.mode |= FW_WOWLAN_UNICAST;
DBG_88E_LEVEL(_drv_info_, "%s 4.pwowlan_parm.mode=0x%x\n", __func__, pwowlan_parm.mode);
}
if (!(adapt->pwrctrlpriv.wowlan_wake_reason & FWDecisionDisconnect))
rtl8188e_set_FwJoinBssReport_cmd(adapt, 1);
else
DBG_88E_LEVEL(_drv_info_, "%s, disconnected, no FwJoinBssReport\n", __func__);
rtw_msleep_os(2);
/* WOWLAN_GPIO_ACTIVE means GPIO high active */
pwowlan_parm.mode |= FW_WOWLAN_REKEY_WAKEUP;
pwowlan_parm.mode |= FW_WOWLAN_DEAUTH_WAKEUP;
/* DataPinWakeUp */
pwowlan_parm.gpio_index = 0x0;
DBG_88E_LEVEL(_drv_info_, "%s 5.pwowlan_parm.mode=0x%x\n", __func__, pwowlan_parm.mode);
DBG_88E_LEVEL(_drv_info_, "%s 6.pwowlan_parm.index=0x%x\n", __func__, pwowlan_parm.gpio_index);
res = FillH2CCmd_88E(adapt, H2C_COM_WWLAN, 2, (u8 *)&pwowlan_parm);
rtw_msleep_os(2);
/* disconnect decision */
pwowlan_parm.mode = 1;
pwowlan_parm.gpio_index = 0;
pwowlan_parm.gpio_duration = 0;
FillH2CCmd_88E(adapt, H2C_COM_DISCNT_DECISION, 3, (u8 *)&pwowlan_parm);
/* keep alive period = 10 * 10 BCN interval */
pwowlan_parm.mode = 1;
pwowlan_parm.gpio_index = 10;
res = FillH2CCmd_88E(adapt, H2C_COM_KEEP_ALIVE, 2, (u8 *)&pwowlan_parm);
rtw_msleep_os(2);
/* Configure STA security information for GTK rekey wakeup event. */
paoac_global_info_parm.pairwiseEncAlg = adapt->securitypriv.dot11PrivacyAlgrthm;
paoac_global_info_parm.groupEncAlg = adapt->securitypriv.dot118021XGrpPrivacy;
res = FillH2CCmd_88E(adapt, H2C_COM_AOAC_GLOBAL_INFO, 2, (u8 *)&paoac_global_info_parm);
rtw_msleep_os(2);
/* enable Remote wake ctrl */
pwowlan_parm.mode = 1;
pwowlan_parm.gpio_index = 0;
pwowlan_parm.gpio_duration = 0;
res = FillH2CCmd_88E(adapt, H2C_COM_REMOTE_WAKE_CTRL, 3, (u8 *)&pwowlan_parm);
} else {
pwrpriv->wowlan_magic = false;
res = FillH2CCmd_88E(adapt, H2C_COM_WWLAN, 2, (u8 *)&pwowlan_parm);
rtw_msleep_os(2);
res = FillH2CCmd_88E(adapt, H2C_COM_REMOTE_WAKE_CTRL, 3, (u8 *)&pwowlan_parm);
}
_func_exit_;
DBG_88E_LEVEL(_drv_info_, "-%s res:%d-\n", __func__, res);
return;
}
#endif /* CONFIG_WOWLAN */

View file

@ -31,75 +31,18 @@
#include <rtl8188e_hal.h>
static void dm_CheckProtection(struct adapter *Adapter)
{
}
static void dm_CheckStatistics(struct adapter *Adapter)
{
}
static void dm_CheckPbcGPIO(struct adapter *padapter)
{
u8 tmp1byte;
u8 bPbcPressed = false;
if (!padapter->registrypriv.hw_wps_pbc)
return;
tmp1byte = rtw_read8(padapter, GPIO_IO_SEL);
tmp1byte |= (HAL_8192C_HW_GPIO_WPS_BIT);
rtw_write8(padapter, GPIO_IO_SEL, tmp1byte); /* enable GPIO[2] as output mode */
tmp1byte &= ~(HAL_8192C_HW_GPIO_WPS_BIT);
rtw_write8(padapter, GPIO_IN, tmp1byte); /* reset the floating voltage level */
tmp1byte = rtw_read8(padapter, GPIO_IO_SEL);
tmp1byte &= ~(HAL_8192C_HW_GPIO_WPS_BIT);
rtw_write8(padapter, GPIO_IO_SEL, tmp1byte); /* enable GPIO[2] as input mode */
tmp1byte = rtw_read8(padapter, GPIO_IN);
if (tmp1byte == 0xff)
return;
if (tmp1byte&HAL_8192C_HW_GPIO_WPS_BIT)
bPbcPressed = true;
if (bPbcPressed) {
/* Here we only set bPbcPressed to true */
/* After trigger PBC, the variable will be set to false */
DBG_88E("CheckPbcGPIO - PBC is pressed\n");
if (padapter->pid[0] == 0) {
/* 0 is the default value and it means the application
* monitors the HW PBC doesn't privde its pid to driver. */
return;
}
rtw_signal_process(padapter->pid[0], SIGUSR1);
}
}
/* */
/* Initialize GPIO setting registers */
/* */
static void dm_InitGPIOSetting(struct adapter *Adapter)
{
#ifdef CONFIG_BT_COEXIST
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
#endif
u8 tmp1byte;
tmp1byte = rtw_read8(Adapter, REG_GPIO_MUXCFG);
tmp1byte &= (GPIOSEL_GPIO | ~GPIOSEL_ENBT);
#ifdef CONFIG_BT_COEXIST
/* UMB-B cut bug. We need to support the modification. */
if (IS_81xxC_VENDOR_UMC_B_CUT(hal_data->VersionID) &&
hal_data->bt_coexist.BT_Coexist)
tmp1byte |= BIT5;
#endif
rtw_write8(Adapter, REG_GPIO_MUXCFG, tmp1byte);
}
@ -114,7 +57,7 @@ static void Init_ODM_ComInfo_88E(struct adapter *Adapter)
u8 cut_ver, fab_ver;
/* Init Value */
_rtw_memset(dm_odm, 0, sizeof(dm_odm));
_rtw_memset(dm_odm, 0, sizeof(*dm_odm));
dm_odm->Adapter = Adapter;
@ -240,7 +183,6 @@ void rtl8188e_HalDmWatchDog(struct adapter *Adapter)
/* Calculate Tx/Rx statistics. */
dm_CheckStatistics(Adapter);
_record_initrate:
_func_exit_;
}

View file

@ -201,8 +201,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf)
/* */
exit:
if (efuseTbl)
rtw_mfree(efuseTbl, EFUSE_MAP_LEN_88E);
kfree(efuseTbl);
if (eFuseWord)
rtw_mfree2d((void *)eFuseWord, EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
@ -264,18 +263,18 @@ static void efuse_read_phymap_from_txpktbuf(
DBG_88E("%s len:%u, lenbak:%u, aaa:%u, aaabak:%u\n", __func__, len, lenbak, aaa, aaabak);
_rtw_memcpy(pos, ((u8 *)&lo32)+2, (limit >= count+2) ? 2 : limit-count);
memcpy(pos, ((u8 *)&lo32)+2, (limit >= count+2) ? 2 : limit-count);
count += (limit >= count+2) ? 2 : limit-count;
pos = content+count;
} else {
_rtw_memcpy(pos, ((u8 *)&lo32), (limit >= count+4) ? 4 : limit-count);
memcpy(pos, ((u8 *)&lo32), (limit >= count+4) ? 4 : limit-count);
count += (limit >= count+4) ? 4 : limit-count;
pos = content+count;
}
if (limit > count && len-2 > count) {
_rtw_memcpy(pos, (u8 *)&hi32, (limit >= count+4) ? 4 : limit-count);
memcpy(pos, (u8 *)&hi32, (limit >= count+4) ? 4 : limit-count);
count += (limit >= count+4) ? 4 : limit-count;
pos = content+count;
}
@ -332,9 +331,9 @@ static s32 iol_ioconfig(struct adapter *padapter, u8 iocfg_bndy)
static int rtl8188e_IOL_exec_cmds_sync(struct adapter *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt)
{
struct pkt_attrib *pattrib = &xmit_frame->attrib;
u8 i;
int ret = _FAIL;
struct pkt_attrib *pattrib = &xmit_frame->attrib;
if (rtw_IOL_append_END_cmd(xmit_frame) != _SUCCESS)
goto exit;
@ -378,10 +377,10 @@ void rtw_IOL_cmd_tx_pkt_buf_dump(struct adapter *Adapter, int data_len)
rstatus = (reg_140 = rtw_read32(Adapter, REG_PKTBUF_DBG_CTRL)&BIT24);
if (rstatus) {
fifo_data = rtw_read32(Adapter, REG_PKTBUF_DBG_DATA_L);
_rtw_memcpy(pbuf+(addr*8), &fifo_data, 4);
memcpy(pbuf+(addr*8), &fifo_data, 4);
fifo_data = rtw_read32(Adapter, REG_PKTBUF_DBG_DATA_H);
_rtw_memcpy(pbuf+(addr*8+4), &fifo_data, 4);
memcpy(pbuf+(addr*8+4), &fifo_data, 4);
}
rtw_usleep_os(2);
} while (!rstatus && (loop++ < 10));
@ -499,22 +498,6 @@ static int _PageWrite(struct adapter *padapter, u32 page, void *buffer, u32 size
return _BlockWrite(padapter, buffer, size);
}
static void _FillDummy(u8 *pFwBuf, u32 *pFwLen)
{
u32 FwLen = *pFwLen;
u8 remain = (u8)(FwLen%4);
remain = (remain == 0) ? 0 : (4 - remain);
while (remain > 0) {
pFwBuf[FwLen] = 0;
FwLen++;
remain--;
}
*pFwLen = FwLen;
}
static int _WriteFW(struct adapter *padapter, void *buffer, u32 size)
{
/* Since we need dynamic decide method of dwonload fw, so we call this function to get chip version. */
@ -599,16 +582,7 @@ static s32 _FWFreeToGo(struct adapter *padapter)
#define IS_FW_81xxC(padapter) (((GET_HAL_DATA(padapter))->FirmwareSignature & 0xFFF0) == 0x88C0)
#ifdef CONFIG_WOWLAN
/* */
/* Description: */
/* Download 8192C firmware code. */
/* */
/* */
s32 rtl8188e_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)
#else
s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
#endif
{
s32 rtStatus = _SUCCESS;
u8 writeFW_retry = 0;
@ -617,10 +591,6 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
u8 *FwImage;
u32 FwImageLen;
#ifdef CONFIG_WOWLAN
u8 *FwImageWoWLAN;
u32 FwImageWoWLANLen;
#endif
struct rt_firmware *pFirmware = NULL;
struct rt_firmware_hdr *pFwHdr = NULL;
u8 *pFirmwareBuf;
@ -636,11 +606,6 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
FwImage = (u8 *)Rtl8188E_FwImageArray;
FwImageLen = Rtl8188E_FWImgArrayLength;
#ifdef CONFIG_WOWLAN
FwImageWoWLAN = (u8 *)Rtl8188E_FwWoWImageArray;
FwImageWoWLANLen = Rtl8188E_FwWoWImgArrayLength;
#endif /* CONFIG_WOWLAN */
pFirmware->eFWSource = FW_SOURCE_HEADER_FILE;
switch (pFirmware->eFWSource) {
@ -655,36 +620,22 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
pFirmware->szFwBuffer = FwImage;
pFirmware->ulFwLength = FwImageLen;
#ifdef CONFIG_WOWLAN
if (bUsedWoWLANFw) {
pFirmware->szWoWLANFwBuffer = FwImageWoWLAN;
pFirmware->ulWoWLANFwLength = FwImageWoWLANLen;
}
#endif /* CONFIG_WOWLAN */
break;
}
#ifdef CONFIG_WOWLAN
if (bUsedWoWLANFw) {
pFirmwareBuf = pFirmware->szWoWLANFwBuffer;
FirmwareLen = pFirmware->ulWoWLANFwLength;
pFwHdr = (struct rt_firmware_hdr *)pFirmware->szWoWLANFwBuffer;
} else
#endif
{
pFirmwareBuf = pFirmware->szFwBuffer;
FirmwareLen = pFirmware->ulFwLength;
DBG_88E_LEVEL(_drv_info_, "+%s: !bUsedWoWLANFw, FmrmwareLen:%d+\n", __func__, FirmwareLen);
/* To Check Fw header. Added by tynli. 2009.12.04. */
pFwHdr = (struct rt_firmware_hdr *)pFirmware->szFwBuffer;
}
pHalData->FirmwareVersion = le16_to_cpu(pFwHdr->Version);
pHalData->FirmwareSubVersion = pFwHdr->Subversion;
pHalData->FirmwareSignature = le16_to_cpu(pFwHdr->Signature);
DBG_88E("%s: fw_ver =%d fw_subver =%d sig = 0x%x\n",
__func__, pHalData->FirmwareVersion, pHalData->FirmwareSubVersion, pHalData->FirmwareSignature);
pr_info("%sFirmware Version %d, SubVersion %d, Signature 0x%x\n",
DRIVER_PREFIX, pHalData->FirmwareVersion,
pHalData->FirmwareSubVersion, pHalData->FirmwareSignature);
if (IS_FW_HEADER_EXIST(pFwHdr)) {
/* Shift 32 bytes for FW header */
@ -730,67 +681,10 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
Exit:
if (pFirmware)
rtw_mfree((u8 *)pFirmware, sizeof(struct rt_firmware));
#ifdef CONFIG_WOWLAN
if (padapter->pwrctrlpriv.wowlan_mode)
rtl8188e_InitializeFirmwareVars(padapter);
else
DBG_88E_LEVEL(_drv_always_, "%s: wowland_mode:%d wowlan_wake_reason:%d\n",
__func__, padapter->pwrctrlpriv.wowlan_mode,
padapter->pwrctrlpriv.wowlan_wake_reason);
#endif
kfree(pFirmware);
return rtStatus;
}
#ifdef CONFIG_WOWLAN
void rtl8188e_InitializeFirmwareVars(struct adapter *padapter)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
struct pwrctrl_priv *pwrpriv;
pwrpriv = &padapter->pwrctrlpriv;
/* Init Fw LPS related. */
padapter->pwrctrlpriv.bFwCurrentInPSMode = false;
/* Init H2C counter. by tynli. 2009.12.09. */
pHalData->LastHMEBoxNum = 0;
}
/* */
/* */
/* Description: Prepare some information to Fw for WoWLAN. */
/* (1) Download wowlan Fw. */
/* (2) Download RSVD page packets. */
/* (3) Enable AP offload if needed. */
/* */
/* 2011.04.12 by tynli. */
/* */
void
SetFwRelatedForWoWLAN8188ES(
struct adapter *padapter,
u8 bHostIsGoingtoSleep
)
{
int status = _FAIL;
/* */
/* 1. Before WoWLAN we need to re-download WoWLAN Fw. */
/* */
status = rtl8188e_FirmwareDownload(padapter, bHostIsGoingtoSleep);
if (status != _SUCCESS) {
DBG_88E("ConfigFwRelatedForWoWLAN8188ES(): Re-Download Firmware failed!!\n");
return;
} else {
DBG_88E("ConfigFwRelatedForWoWLAN8188ES(): Re-Download Firmware Success !!\n");
}
/* */
/* 2. Re-Init the variables about Fw related setting. */
/* */
rtl8188e_InitializeFirmwareVars(padapter);
}
#else
void rtl8188e_InitializeFirmwareVars(struct adapter *padapter)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
@ -801,15 +695,12 @@ void rtl8188e_InitializeFirmwareVars(struct adapter *padapter)
/* Init H2C counter. by tynli. 2009.12.09. */
pHalData->LastHMEBoxNum = 0;
}
#endif /* CONFIG_WOWLAN */
static void rtl8188e_free_hal_data(struct adapter *padapter)
{
_func_enter_;
if (padapter->HalData) {
rtw_mfree(padapter->HalData, sizeof(struct hal_data_8188e));
padapter->HalData = NULL;
}
kfree(padapter->HalData);
padapter->HalData = NULL;
_func_exit_;
}
@ -903,42 +794,7 @@ rtl8188e_EfusePowerSwitch(
}
static bool efuse_read_phymap(
struct adapter *Adapter,
u8 *pbuf, /* buffer to store efuse physical map */
u16 *size /* the max byte to read. will update to byte read */
)
{
u8 *pos = pbuf;
u16 limit = *size;
u16 addr = 0;
bool reach_end = false;
/* */
/* Refresh efuse init map as all 0xFF. */
/* */
_rtw_memset(pbuf, 0xFF, limit);
/* */
/* Read physical efuse content. */
/* */
while (addr < limit) {
ReadEFuseByte(Adapter, addr, pos, false);
if (*pos != 0xFF) {
pos++;
addr++;
} else {
reach_end = true;
break;
}
}
*size = addr;
return reach_end;
}
static void
Hal_EfuseReadEFuse88E(
struct adapter *Adapter,
static void Hal_EfuseReadEFuse88E(struct adapter *Adapter,
u16 _offset,
u16 _size_byte,
u8 *pbuf,
@ -1067,52 +923,12 @@ Hal_EfuseReadEFuse88E(
rtw_hal_set_hwreg(Adapter, HW_VAR_EFUSE_BYTES, (u8 *)&eFuse_Addr);
exit:
if (efuseTbl)
rtw_mfree(efuseTbl, EFUSE_MAP_LEN_88E);
kfree(efuseTbl);
if (eFuseWord)
rtw_mfree2d((void *)eFuseWord, EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
}
static bool Hal_EfuseSwitchToBank(struct adapter *pAdapter, u8 bank, bool bPseudoTest)
{
bool bRet = false;
u32 value32 = 0;
if (bPseudoTest) {
fakeEfuseBank = bank;
bRet = true;
} else {
if (IS_HARDWARE_TYPE_8723A(pAdapter) &&
INCLUDE_MULTI_FUNC_BT(pAdapter)) {
value32 = rtw_read32(pAdapter, EFUSE_TEST);
bRet = true;
switch (bank) {
case 0:
value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0);
break;
case 1:
value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_0);
break;
case 2:
value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_1);
break;
case 3:
value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_BT_SEL_2);
break;
default:
value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0);
bRet = false;
break;
}
rtw_write32(pAdapter, EFUSE_TEST, value32);
} else {
bRet = true;
}
}
return bRet;
}
static void ReadEFuseByIC(struct adapter *Adapter, u8 efuseType, u16 _offset, u16 _size_byte, u8 *pbuf, bool bPseudoTest)
{
if (!bPseudoTest) {
@ -1664,6 +1480,7 @@ 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;
@ -1681,6 +1498,7 @@ static bool hal_EfusePgPacketWriteData(struct adapter *pAdapter, u8 efuseType, u
else
return true;
}
return bRet;
}
static bool
@ -1701,12 +1519,8 @@ hal_EfusePgPacketWriteHeader(
return bRet;
}
static bool
wordEnMatched(
struct pgpkt *pTargetPkt,
struct pgpkt *pCurPkt,
u8 *pWden
)
static bool wordEnMatched(struct pgpkt *pTargetPkt, struct pgpkt *pCurPkt,
u8 *pWden)
{
u8 match_word_en = 0x0F; /* default all words are disabled */
@ -1857,29 +1671,6 @@ static void hal_EfuseConstructPGPkt(u8 offset, u8 word_en, u8 *pData, struct pgp
pTargetPkt->word_cnts = Efuse_CalculateWordCnts(pTargetPkt->word_en);
}
static bool hal_EfusePgPacketWrite_BT(struct adapter *pAdapter, u8 offset, u8 word_en, u8 *pData, bool bPseudoTest)
{
struct pgpkt targetPkt;
u16 startAddr = 0;
u8 efuseType = EFUSE_BT;
if (!hal_EfusePgCheckAvailableAddr(pAdapter, efuseType, bPseudoTest))
return false;
hal_EfuseConstructPGPkt(offset, word_en, pData, &targetPkt);
if (!hal_EfusePartialWriteCheck(pAdapter, efuseType, &startAddr, &targetPkt, bPseudoTest))
return false;
if (!hal_EfusePgPacketWriteHeader(pAdapter, efuseType, &startAddr, &targetPkt, bPseudoTest))
return false;
if (!hal_EfusePgPacketWriteData(pAdapter, efuseType, &startAddr, &targetPkt, bPseudoTest))
return false;
return true;
}
static bool hal_EfusePgPacketWrite_8188e(struct adapter *pAdapter, u8 offset, u8 word_en, u8 *pData, bool bPseudoTest)
{
struct pgpkt targetPkt;
@ -1979,12 +1770,6 @@ static void rtl8188e_read_chip_version(struct adapter *padapter)
static void rtl8188e_GetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVariable, void *pValue1, bool bSet)
{
switch (eVariable) {
case HAL_ODM_STA_INFO:
break;
default:
break;
}
}
static void rtl8188e_SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVariable, void *pValue1, bool bSet)
@ -2018,7 +1803,7 @@ static void rtl8188e_SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable
void rtl8188e_clone_haldata(struct adapter *dst_adapter, struct adapter *src_adapter)
{
_rtw_memcpy(dst_adapter->HalData, src_adapter->HalData, dst_adapter->hal_data_sz);
memcpy(dst_adapter->HalData, src_adapter->HalData, dst_adapter->hal_data_sz);
}
void rtl8188e_start_thread(struct adapter *padapter)
@ -2210,33 +1995,6 @@ Hal_EfuseParseIDCode88E(
DBG_88E("EEPROM ID = 0x%04x\n", EEPROMId);
}
static void
Hal_EEValueCheck(
u8 EEType,
void *pInValue,
void *pOutValue
)
{
switch (EEType) {
case EETYPE_TX_PWR:
{
s8 *pIn, *pOut;
pIn = (u8 *)pInValue;
pOut = (u8 *)pOutValue;
if (*pIn >= 0 && *pIn <= 63) {
*pOut = *pIn;
} else {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("EETYPE_TX_PWR, value =%d is invalid, set to default = 0x%x\n",
*pIn, EEPROM_Default_TxPowerLevel));
*pOut = EEPROM_Default_TxPowerLevel;
}
}
break;
default:
break;
}
}
static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G, u8 *PROMContent, bool AutoLoadFail)
{
u32 rfPath, eeAddr = EEPROM_TX_PWR_INX_88E, group, TxCount = 0;
@ -2336,19 +2094,6 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
}
}
static u8 Hal_GetChnlGroup(u8 chnl)
{
u8 group = 0;
if (chnl < 3) /* Cjanel 1-3 */
group = 0;
else if (chnl < 9) /* Channel 4-9 */
group = 1;
else /* Channel 10-14 */
group = 2;
return group;
}
static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
{
u8 bIn24G = true;
@ -2438,7 +2183,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];
@ -2615,14 +2360,6 @@ bool HalDetectPwrDownMode88E(struct adapter *Adapter)
return pHalData->pwrdown;
} /* HalDetectPwrDownMode */
#ifdef CONFIG_WOWLAN
void Hal_DetectWoWMode(struct adapter *pAdapter)
{
pAdapter->pwrctrlpriv.bSupportRemoteWakeup = true;
DBG_88E("%s\n", __func__);
}
#endif
/* This function is used only for 92C to set REG_BCN_CTRL(0x550) register. */
/* We just reserve the value of the register in variable pHalData->RegBcnCtrlVal and then operate */
/* the value of the register via atomic operation. */

View file

@ -27,10 +27,8 @@
s32 Hal_SetPowerTracking(struct adapter *padapter, u8 enable)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
if (!netif_running(padapter->pnetdev)) {
RT_TRACE(_module_mp_, _drv_warning_,
("SetPowerTracking! Fail: interface not opened!\n"));
@ -54,38 +52,11 @@ s32 Hal_SetPowerTracking(struct adapter *padapter, u8 enable)
void Hal_GetPowerTracking(struct adapter *padapter, u8 *enable)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
*enable = pDM_Odm->RFCalibrateInfo.TxPowerTrackControl;
}
static void Hal_disable_dm(struct adapter *padapter)
{
u8 v8;
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
/* 3 1. disable firmware dynamic mechanism */
/* disable Power Training, Rate Adaptive */
v8 = rtw_read8(padapter, REG_BCN_CTRL);
v8 &= ~EN_BCN_FUNCTION;
rtw_write8(padapter, REG_BCN_CTRL, v8);
/* 3 2. disable driver dynamic mechanism */
/* disable Dynamic Initial Gain */
/* disable High Power */
/* disable Power Tracking */
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false);
/* enable APK, LCK and IQK but disable power tracking */
pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = false;
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, true);
}
/*-----------------------------------------------------------------------------
* Function: mpt_SwitchRfSetting
*
@ -105,7 +76,6 @@ static void Hal_disable_dm(struct adapter *padapter)
*---------------------------------------------------------------------------*/
void Hal_mpt_SwitchRfSetting(struct adapter *pAdapter)
{
/* struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter); */
struct mp_priv *pmp = &pAdapter->mppriv;
/* <20120525, Kordan> Dynamic mechanism for APK, asked by Dennis. */
@ -188,14 +158,13 @@ void Hal_MPT_CCKTxPowerAdjust(struct adapter *Adapter, bool bInCH14)
void Hal_MPT_CCKTxPowerAdjustbyIndex(struct adapter *pAdapter, bool beven)
{
s32 TempCCk;
u8 CCK_index, CCK_index_old;
u8 Action = 0; /* 0: no action, 1: even->odd, 2:odd->even */
s32 i = 0;
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
struct mpt_context *pMptCtx = &pAdapter->mppriv.MptCtx;
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
s32 TempCCk;
u8 CCK_index, CCK_index_old = 0;
u8 Action = 0; /* 0: no action, 1: even->odd, 2:odd->even */
s32 i = 0;
if (!IS_92C_SERIAL(pHalData->VersionID))
@ -264,22 +233,15 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(struct adapter *pAdapter, bool beven)
*/
void Hal_SetChannel(struct adapter *pAdapter)
{
u8 eRFPath;
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
struct mp_priv *pmp = &pAdapter->mppriv;
struct odm_dm_struct *pDM_Odm = &(pHalData->odmpriv);
u8 eRFPath;
u8 channel = pmp->channel;
/* set RF channel register */
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++) {
if (IS_HARDWARE_TYPE_8192D(pAdapter))
_write_rfreg(pAdapter, (enum rf_radio_path)eRFPath, ODM_CHANNEL, 0xFF, channel);
else
_write_rfreg(pAdapter, eRFPath, ODM_CHANNEL, 0x3FF, channel);
}
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++)
_write_rfreg(pAdapter, eRFPath, ODM_CHANNEL, 0x3FF, channel);
Hal_mpt_SwitchRfSetting(pAdapter);
SelectChannel(pAdapter, channel);

View file

@ -358,29 +358,6 @@ rtl8188e_PHY_SetRFReg(
/* 3. Initial MAC/BB/RF config by reading MAC/BB/RF txt. */
/* */
/*-----------------------------------------------------------------------------
* Function: phy_ConfigMACWithParaFile()
*
* Overview: This function read BB parameters from general file format, and do register
* Read/Write
*
* Input: struct adapter *Adapter
* ps8 pFileName
*
* Output: NONE
*
* Return: RT_STATUS_SUCCESS: configuration file exist
*
* Note: The format of MACPHY_REG.txt is different from PHY and RF.
* [Register][Mask][Value]
*---------------------------------------------------------------------------*/
static int phy_ConfigMACWithParaFile(struct adapter *Adapter, u8 *pFileName)
{
int rtStatus = _FAIL;
return rtStatus;
}
/*-----------------------------------------------------------------------------
* Function: PHY_MACConfig8192C
*
@ -399,8 +376,8 @@ static int phy_ConfigMACWithParaFile(struct adapter *Adapter, u8 *pFileName)
*---------------------------------------------------------------------------*/
s32 PHY_MACConfig8188E(struct adapter *Adapter)
{
int rtStatus = _SUCCESS;
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
int rtStatus = _SUCCESS;
/* */
/* Config MAC */
@ -530,32 +507,6 @@ phy_InitBBRFRegisterDefinition(
pHalData->PHYRegDef[RF_PATH_B].rfLSSIReadBackPi = TransceiverB_HSPI_Readback;
}
/*-----------------------------------------------------------------------------
* Function: phy_ConfigBBWithParaFile()
*
* Overview: This function read BB parameters from general file format, and do register
* Read/Write
*
* Input: struct adapter *Adapter
* ps8 pFileName
*
* Output: NONE
*
* Return: RT_STATUS_SUCCESS: configuration file exist
* 2008/11/06 MH For 92S we do not support silent reset now. Disable
* parameter file compare!!!!!!??
*
*---------------------------------------------------------------------------*/
static int phy_ConfigBBWithParaFile(struct adapter *Adapter, u8 *pFileName)
{
return _SUCCESS;
}
/* The following is for High Power PA */
static void phy_ConfigBBExternalPA(struct adapter *Adapter)
{
}
void storePwrIndexDiffRateOffset(struct adapter *Adapter, u32 RegAddr, u32 BitMask, u32 Data)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
@ -599,62 +550,8 @@ void storePwrIndexDiffRateOffset(struct adapter *Adapter, u32 RegAddr, u32 BitMa
pHalData->pwrGroupCnt++;
}
}
/*-----------------------------------------------------------------------------
* Function: phy_ConfigBBWithPgParaFile
*
* Overview:
*
* Input: NONE
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
* 11/06/2008 MHC Create Version 0.
* 2009/07/29 tynli (porting from 92SE branch)2009/03/11 Add copy parameter file to buffer for silent reset
*---------------------------------------------------------------------------*/
static int phy_ConfigBBWithPgParaFile(struct adapter *Adapter, u8 *pFileName)
{
return _SUCCESS;
}
static void phy_BB8192C_Config_1T(struct adapter *Adapter)
{
/* for path - B */
PHY_SetBBReg(Adapter, rFPGA0_TxInfo, 0x3, 0x2);
PHY_SetBBReg(Adapter, rFPGA1_TxInfo, 0x300033, 0x200022);
/* 20100519 Joseph: Add for 1T2R config. Suggested by Kevin, Jenyu and Yunan. */
PHY_SetBBReg(Adapter, rCCK0_AFESetting, bMaskByte3, 0x45);
PHY_SetBBReg(Adapter, rOFDM0_TRxPathEnable, bMaskByte0, 0x23);
PHY_SetBBReg(Adapter, rOFDM0_AGCParameter1, 0x30, 0x1); /* B path first AGC */
PHY_SetBBReg(Adapter, 0xe74, 0x0c000000, 0x2);
PHY_SetBBReg(Adapter, 0xe78, 0x0c000000, 0x2);
PHY_SetBBReg(Adapter, 0xe7c, 0x0c000000, 0x2);
PHY_SetBBReg(Adapter, 0xe80, 0x0c000000, 0x2);
PHY_SetBBReg(Adapter, 0xe88, 0x0c000000, 0x2);
}
/* Joseph test: new initialize order!! */
/* Test only!! This part need to be re-organized. */
/* Now it is just for 8256. */
static int
phy_BB8190_Config_HardCode(
struct adapter *Adapter
)
{
return _SUCCESS;
}
static int
phy_BB8188E_Config_ParaFile(
struct adapter *Adapter
)
static int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
{
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(Adapter);
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
@ -755,11 +652,6 @@ int rtl8188e_PHY_ConfigRFWithParaFile(struct adapter *Adapter, u8 *pFileName, en
return _SUCCESS;
}
static int PHY_ConfigRFExternalPA(struct adapter *Adapter, enum rf_radio_path eRFPath)
{
return _SUCCESS;
}
void
rtl8192c_PHY_GetHWRegOriginalValue(
struct adapter *Adapter
@ -1012,8 +904,10 @@ PHY_SetTxPowerLevel8188E(
u8 channel
)
{
u8 cckPowerLevel[MAX_TX_COUNT], ofdmPowerLevel[MAX_TX_COUNT];/* [0]:RF-A, [1]:RF-B */
u8 BW20PowerLevel[MAX_TX_COUNT], BW40PowerLevel[MAX_TX_COUNT];
u8 cckPowerLevel[MAX_TX_COUNT] = {0};
u8 ofdmPowerLevel[MAX_TX_COUNT] = {0};/* [0]:RF-A, [1]:RF-B */
u8 BW20PowerLevel[MAX_TX_COUNT] = {0};
u8 BW40PowerLevel[MAX_TX_COUNT] = {0};
getTxPowerIndex88E(Adapter, channel, &cckPowerLevel[0], &ofdmPowerLevel[0], &BW20PowerLevel[0], &BW40PowerLevel[0]);
@ -1229,22 +1123,7 @@ void PHY_SwChnl8188E(struct adapter *Adapter, u8 channel)
bool bResult = true;
if (pHalData->rf_chip == RF_PSEUDO_11N)
return; /* return immediately if it is peudo-phy */
/* */
switch (pHalData->CurrentWirelessMode) {
case WIRELESS_MODE_A:
case WIRELESS_MODE_N_5G:
break;
case WIRELESS_MODE_B:
break;
case WIRELESS_MODE_G:
case WIRELESS_MODE_N_24G:
break;
default:
break;
}
/* */
return; /* return immediately if it is peudo-phy */
if (channel == 0)
channel = 1;
@ -1263,156 +1142,3 @@ void PHY_SwChnl8188E(struct adapter *Adapter, u8 channel)
pHalData->CurrentChannel = tmpchannel;
}
}
static bool
phy_SwChnlStepByStep(
struct adapter *Adapter,
u8 channel,
u8 *stage,
u8 *step,
u32 *delay
)
{
return true;
}
static bool
phy_SetSwChnlCmdArray(
struct sw_chnl_cmd *CmdTable,
u32 CmdTableIdx,
u32 CmdTableSz,
enum sw_chnl_cmd_id CmdID,
u32 Para1,
u32 Para2,
u32 msDelay
)
{
struct sw_chnl_cmd *pCmd;
if (CmdTable == NULL)
return false;
if (CmdTableIdx >= CmdTableSz)
return false;
pCmd = CmdTable + CmdTableIdx;
pCmd->CmdID = CmdID;
pCmd->Para1 = Para1;
pCmd->Para2 = Para2;
pCmd->msDelay = msDelay;
return true;
}
static void phy_FinishSwChnlNow(struct adapter *Adapter, u8 channel)
{
/* We should not call this function directly */
}
/* */
/* Description: */
/* Switch channel synchronously. Called by SwChnlByDelayHandler. */
/* */
/* Implemented by Bruce, 2008-02-14. */
/* The following procedure is operted according to SwChanlCallback8190Pci(). */
/* However, this procedure is performed synchronously which should be running under */
/* passive level. */
/* Only called during initialize */
void PHY_SwChnlPhy8192C(struct adapter *Adapter, u8 channel)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
/* return immediately if it is peudo-phy */
if (pHalData->rf_chip == RF_PSEUDO_11N)
return;
if (channel == 0)
channel = 1;
pHalData->CurrentChannel = channel;
phy_FinishSwChnlNow(Adapter, channel);
}
/* */
/* Description: */
/* Configure H/W functionality to enable/disable Monitor mode. */
/* Note, because we possibly need to configure BB and RF in this function, */
/* so caller should in PASSIVE_LEVEL. 080118, by rcnjko. */
/* */
void
PHY_SetMonitorMode8192C(
struct adapter *pAdapter,
bool bEnableMonitorMode
)
{
}
/*-----------------------------------------------------------------------------
* Function: PHYCheckIsLegalRfPath8190Pci()
*
* Overview: Check different RF type to execute legal judgement. If RF Path is illegal
* We will return false.
*
* Input: NONE
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
* 11/15/2007 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
bool PHY_CheckIsLegalRfPath8192C(struct adapter *pAdapter, u32 eRFPath)
{
return true;
} /* PHY_CheckIsLegalRfPath8192C */
static void _PHY_SetRFPathSwitch(struct adapter *pAdapter, bool bMain, bool is2T)
{
u8 u1bTmp;
if (!pAdapter->hw_init_completed) {
u1bTmp = rtw_read8(pAdapter, REG_LEDCFG2) | BIT7;
rtw_write8(pAdapter, REG_LEDCFG2, u1bTmp);
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT13, 0x01);
}
if (is2T) {
if (bMain)
PHY_SetBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x1); /* 92C_Path_A */
else
PHY_SetBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x2); /* BT */
} else {
if (bMain)
PHY_SetBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300, 0x2); /* Main */
else
PHY_SetBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300, 0x1); /* Aux */
}
}
static bool _PHY_QueryRFPathSwitch(struct adapter *pAdapter, bool is2T)
{
if (!pAdapter->hw_init_completed) {
PHY_SetBBReg(pAdapter, REG_LEDCFG0, BIT23, 0x01);
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT13, 0x01);
}
if (is2T) {
if (PHY_QueryBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6) == 0x01)
return true;
else
return false;
} else {
if (PHY_QueryBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300) == 0x02)
return true;
else
return false;
}
}
static void _PHY_DumpRFReg(struct adapter *pAdapter)
{
}

View file

@ -46,6 +46,27 @@
#include <rtl8188e_hal.h>
/*---------------------------Define Local Constant---------------------------*/
/* Define local structure for debug!!!!! */
struct rf_shadow {
/* Shadow register value */
u32 Value;
/* Compare or not flag */
u8 Compare;
/* Record If it had ever modified unpredicted */
u8 ErrorOrNot;
/* Recorver Flag */
u8 Recorver;
/* */
u8 Driver_Write;
};
/*---------------------------Define Local Constant---------------------------*/
/*------------------------Define global variable-----------------------------*/
/*------------------------Define local variable------------------------------*/
/*-----------------------------------------------------------------------------
* Function: RF_ChangeTxPath
@ -126,8 +147,8 @@ rtl8188e_PHY_RF6052SetCckTxPower(
u8 *pPowerlevel)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
struct dm_priv *pdmpriv = &pHalData->dmpriv;
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
struct dm_priv *pdmpriv = &pHalData->dmpriv;
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
u32 TxAGC[2] = {0, 0}, tmpval = 0, pwrtrac_value;
bool TurboScanOff = false;
u8 idx1, idx2;
@ -456,11 +477,11 @@ rtl8188e_PHY_RF6052SetOFDMTxPower(
static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
{
u32 u4RegValue;
u8 eRFPath;
struct bb_reg_def *pPhyReg;
int rtStatus = _SUCCESS;
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
u32 u4RegValue = 0;
u8 eRFPath;
int rtStatus = _SUCCESS;
/* 3----------------------------------------------------------------- */
/* 3 <2> Initialize RF */

View file

@ -23,17 +23,6 @@
#include <drv_types.h>
#include <rtl8188e_hal.h>
static s32 translate2dbm(u8 signal_strength_idx)
{
s32 signal_power; /* in dBm. */
/* Translate to dBm (x=0.5y-95). */
signal_power = (s32)((signal_strength_idx + 1) >> 1);
signal_power -= 95;
return signal_power;
}
static void process_rssi(struct adapter *padapter, union recv_frame *prframe)
{
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
@ -157,7 +146,7 @@ void update_recvframe_phyinfo_88e(union recv_frame *precvframe, struct phy_stat
struct odm_phy_status_info *pPHYInfo = (struct odm_phy_status_info *)(&pattrib->phy_info);
u8 *wlanhdr;
struct odm_per_pkt_info pkt_info;
u8 *sa;
u8 *sa = NULL;
struct sta_priv *pstapriv;
struct sta_info *psta;

View file

@ -22,91 +22,6 @@
#include <rtl8188e_sreset.h>
#include <rtl8188e_hal.h>
static void _restore_security_setting(struct adapter *padapter)
{
u8 EntryId = 0;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct sta_priv *pstapriv = &padapter->stapriv;
struct sta_info *psta;
struct security_priv *psecuritypriv = &(padapter->securitypriv);
struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
(pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) ?
rtw_write8(padapter, REG_SECCFG, 0xcc) :
rtw_write8(padapter, REG_SECCFG, 0xcf);
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_) ||
(padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_)) {
for (EntryId = 0; EntryId < 4; EntryId++) {
if (EntryId == psecuritypriv->dot11PrivacyKeyIndex)
rtw_set_key(padapter, &padapter->securitypriv, EntryId, 1);
else
rtw_set_key(padapter, &padapter->securitypriv, EntryId, 0);
}
} else if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv));
if (psta) {
/* pairwise key */
rtw_setstakey_cmd(padapter, (unsigned char *)psta, true);
/* group key */
rtw_set_key(padapter, &padapter->securitypriv, padapter->securitypriv.dot118021XGrpKeyid, 0);
}
}
}
static void _restore_network_status(struct adapter *padapter)
{
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 join_type;
/* */
/* reset related register of Beacon control */
/* set MSR to nolink */
Set_MSR(padapter, _HW_STATE_NOLINK_);
/* reject all data frame */
rtw_write16(padapter, REG_RXFLTMAP2, 0x00);
/* reset TSF */
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
/* disable update TSF */
SetBcnCtrlReg(padapter, BIT(4), 0);
/* */
rtw_joinbss_reset(padapter);
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
if (padapter->registrypriv.wifi_spec) {
/* for WiFi test, follow WMM test plan spec */
rtw_write32(padapter, REG_EDCA_VO_PARAM, 0x002F431C);
rtw_write32(padapter, REG_EDCA_VI_PARAM, 0x005E541C);
rtw_write32(padapter, REG_EDCA_BE_PARAM, 0x0000A525);
rtw_write32(padapter, REG_EDCA_BK_PARAM, 0x0000A549);
/* for WiFi test, mixed mode with intel STA under bg mode throughput issue */
if (padapter->mlmepriv.htpriv.ht_option == 0)
rtw_write32(padapter, REG_EDCA_BE_PARAM, 0x00004320);
} else {
rtw_write32(padapter, REG_EDCA_VO_PARAM, 0x002F3217);
rtw_write32(padapter, REG_EDCA_VI_PARAM, 0x005E4317);
rtw_write32(padapter, REG_EDCA_BE_PARAM, 0x00105320);
rtw_write32(padapter, REG_EDCA_BK_PARAM, 0x0000A444);
}
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
join_type = 0;
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
mlmeext_joinbss_event_callback(padapter, 1);
/* restore Sequence No. */
rtw_write8(padapter, 0x4dc, padapter->xmitpriv.nqos_ssn);
}
void rtl8188e_silentreset_for_specific_platform(struct adapter *padapter)
{
}

View file

@ -93,7 +93,7 @@ void rtl8188eu_InitSwLeds(struct adapter *padapter)
{
struct led_priv *pledpriv = &(padapter->ledpriv);
pledpriv->LedControlHandler = LedControl871x;
pledpriv->LedControlHandler = LedControl8188eu;
InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0);

View file

@ -95,11 +95,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
skb_queue_head_init(&precvpriv->free_recv_skb_queue);
for (i = 0; i < NR_PREALLOC_RECV_SKB; i++) {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
pskb = __dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_KERNEL);
#else
pskb = __netdev_alloc_skb(padapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_KERNEL);
#endif
if (pskb) {
pskb->dev = padapter->pnetdev;
tmpaddr = (size_t)pskb->data;
@ -128,8 +124,7 @@ void rtl8188eu_free_recv_priv(struct adapter *padapter)
precvbuf++;
}
if (precvpriv->pallocated_recv_buf)
rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF * sizeof(struct recv_buf) + 4);
kfree(precvpriv->pallocated_recv_buf);
if (skb_queue_len(&precvpriv->rx_skb_queue))
DBG_88E(KERN_WARNING "rx_skb_queue not empty\n");

View file

@ -131,110 +131,6 @@ static u32 rtl8188eu_InitPowerOn(struct adapter *adapt)
return _SUCCESS;
}
static void _dbg_dump_macreg(struct adapter *adapt)
{
u32 offset = 0;
u32 val32 = 0;
u32 index = 0;
for (index = 0; index < 64; index++) {
offset = index*4;
val32 = rtw_read32(adapt, offset);
DBG_88E("offset : 0x%02x ,val:0x%08x\n", offset, val32);
}
}
static void _InitPABias(struct adapter *adapt)
{
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
u8 pa_setting;
bool is92C = IS_92C_SERIAL(haldata->VersionID);
/* FIXED PA current issue */
pa_setting = EFUSE_Read1Byte(adapt, 0x1FA);
if (!(pa_setting & BIT0)) {
PHY_SetRFReg(adapt, RF_PATH_A, 0x15, 0x0FFFFF, 0x0F406);
PHY_SetRFReg(adapt, RF_PATH_A, 0x15, 0x0FFFFF, 0x4F406);
PHY_SetRFReg(adapt, RF_PATH_A, 0x15, 0x0FFFFF, 0x8F406);
PHY_SetRFReg(adapt, RF_PATH_A, 0x15, 0x0FFFFF, 0xCF406);
}
if (!(pa_setting & BIT1) && is92C) {
PHY_SetRFReg(adapt, RF_PATH_B, 0x15, 0x0FFFFF, 0x0F406);
PHY_SetRFReg(adapt, RF_PATH_B, 0x15, 0x0FFFFF, 0x4F406);
PHY_SetRFReg(adapt, RF_PATH_B, 0x15, 0x0FFFFF, 0x8F406);
PHY_SetRFReg(adapt, RF_PATH_B, 0x15, 0x0FFFFF, 0xCF406);
}
if (!(pa_setting & BIT4)) {
pa_setting = rtw_read8(adapt, 0x16);
pa_setting &= 0x0F;
rtw_write8(adapt, 0x16, pa_setting | 0x80);
rtw_write8(adapt, 0x16, pa_setting | 0x90);
}
}
#ifdef CONFIG_BT_COEXIST
static void _InitBTCoexist(struct adapter *adapt)
{
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
struct btcoexist_priv *pbtpriv = &(haldata->bt_coexist);
u8 u1Tmp;
if (pbtpriv->BT_Coexist && pbtpriv->BT_CoexistType == BT_CSR_BC4) {
if (adapt->registrypriv.mp_mode == 0) {
if (pbtpriv->BT_Ant_isolation) {
rtw_write8(adapt, REG_GPIO_MUXCFG, 0xa0);
DBG_88E("BT write 0x%x = 0x%x\n", REG_GPIO_MUXCFG, 0xa0);
}
}
u1Tmp = rtw_read8(adapt, 0x4fd) & BIT0;
u1Tmp = u1Tmp |
((pbtpriv->BT_Ant_isolation == 1) ? 0 : BIT1) |
((pbtpriv->BT_Service == BT_SCO) ? 0 : BIT2);
rtw_write8(adapt, 0x4fd, u1Tmp);
DBG_88E("BT write 0x%x = 0x%x for non-isolation\n", 0x4fd, u1Tmp);
rtw_write32(adapt, REG_BT_COEX_TABLE+4, 0xaaaa9aaa);
DBG_88E("BT write 0x%x = 0x%x\n", REG_BT_COEX_TABLE+4, 0xaaaa9aaa);
rtw_write32(adapt, REG_BT_COEX_TABLE+8, 0xffbd0040);
DBG_88E("BT write 0x%x = 0x%x\n", REG_BT_COEX_TABLE+8, 0xffbd0040);
rtw_write32(adapt, REG_BT_COEX_TABLE+0xc, 0x40000010);
DBG_88E("BT write 0x%x = 0x%x\n", REG_BT_COEX_TABLE+0xc, 0x40000010);
/* Config to 1T1R */
u1Tmp = rtw_read8(adapt, rOFDM0_TRxPathEnable);
u1Tmp &= ~(BIT1);
rtw_write8(adapt, rOFDM0_TRxPathEnable, u1Tmp);
DBG_88E("BT write 0xC04 = 0x%x\n", u1Tmp);
u1Tmp = rtw_read8(adapt, rOFDM1_TRxPathEnable);
u1Tmp &= ~(BIT1);
rtw_write8(adapt, rOFDM1_TRxPathEnable, u1Tmp);
DBG_88E("BT write 0xD04 = 0x%x\n", u1Tmp);
}
}
#endif
/* MAC init functions */
static void _SetMacID(struct adapter *Adapter, u8 *MacID)
{
u32 i;
for (i = 0; i < MAC_ADDR_LEN; i++)
rtw_write32(Adapter, REG_MACID+i, MacID[i]);
}
static void _SetBSSID(struct adapter *Adapter, u8 *BSSID)
{
u32 i;
for (i = 0; i < MAC_ADDR_LEN; i++)
rtw_write32(Adapter, REG_BSSID+i, BSSID[i]);
}
/* Shall USB interface init this? */
static void _InitInterrupt(struct adapter *Adapter)
{
@ -276,7 +172,7 @@ static void _InitQueueReservedPage(struct adapter *Adapter)
u32 numPubQ;
u32 value32;
u8 value8;
bool bWiFiConfig = pregistrypriv->wifi_spec;
bool bWiFiConfig = pregistrypriv->wifi_spec;
if (bWiFiConfig) {
if (haldata->OutEpQueueSel & TX_SELE_HQ)
@ -303,11 +199,7 @@ static void _InitQueueReservedPage(struct adapter *Adapter)
}
}
static void
_InitTxBufferBoundary(
struct adapter *Adapter,
u8 txpktbuf_bndy
)
static void _InitTxBufferBoundary(struct adapter *Adapter, u8 txpktbuf_bndy)
{
rtw_write8(Adapter, REG_TXPKTBUF_BCNQ_BDNY, txpktbuf_bndy);
rtw_write8(Adapter, REG_TXPKTBUF_MGQ_BDNY, txpktbuf_bndy);
@ -316,10 +208,7 @@ _InitTxBufferBoundary(
rtw_write8(Adapter, REG_TDECTRL+1, txpktbuf_bndy);
}
static void
_InitPageBoundary(
struct adapter *Adapter
)
static void _InitPageBoundary(struct adapter *Adapter)
{
/* RX Page Boundary */
/* */
@ -328,8 +217,9 @@ _InitPageBoundary(
rtw_write16(Adapter, (REG_TRXFF_BNDY + 2), rxff_bndy);
}
static void _InitNormalChipRegPriority(struct adapter *Adapter, u16 beQ, u16 bkQ, u16 viQ, u16 voQ, u16 mgtQ, u16 hiQ
)
static void _InitNormalChipRegPriority(struct adapter *Adapter, u16 beQ,
u16 bkQ, u16 viQ, u16 voQ, u16 mgtQ,
u16 hiQ)
{
u16 value16 = (rtw_read16(Adapter, REG_TRXDMA_CTRL) & 0x7);
@ -447,13 +337,6 @@ static void _InitQueuePriority(struct adapter *Adapter)
}
}
static void _InitHardwareDropIncorrectBulkOut(struct adapter *Adapter)
{
u32 value32 = rtw_read32(Adapter, REG_TXDMA_OFFSET_CHK);
value32 |= DROP_DATA_EN;
rtw_write32(Adapter, REG_TXDMA_OFFSET_CHK, value32);
}
static void _InitNetworkType(struct adapter *Adapter)
{
u32 value32;
@ -518,15 +401,6 @@ static void _InitAdaptiveCtrl(struct adapter *Adapter)
rtw_write16(Adapter, REG_RL, value16);
}
static void _InitRateFallback(struct adapter *Adapter)
{
/* Set Data Auto Rate Fallback Retry Count register. */
rtw_write32(Adapter, REG_DARFRC, 0x00000000);
rtw_write32(Adapter, REG_DARFRC+4, 0x10080404);
rtw_write32(Adapter, REG_RARFRC, 0x04030201);
rtw_write32(Adapter, REG_RARFRC+4, 0x08070605);
}
static void _InitEDCA(struct adapter *Adapter)
{
/* Set Spec SIFS (used in NAV) */
@ -724,36 +598,6 @@ static void InitUsbAggregationSetting(struct adapter *Adapter)
/* 201/12/10 MH Add for USB agg mode dynamic switch. */
haldata->UsbRxHighSpeedMode = false;
}
static void
HalRxAggr8188EUsb(
struct adapter *Adapter,
bool Value
)
{
}
/*-----------------------------------------------------------------------------
* Function: USB_AggModeSwitch()
*
* Overview: When RX traffic is more than 40M, we need to adjust some parameters to increase
* RX speed by increasing batch indication size. This will decrease TCP ACK speed, we
* need to monitor the influence of FTP/network share.
* For TX mode, we are still ubder investigation.
*
* Input: struct adapter *
*
* Output: NONE
*
* Return: NONE
*
* Revised History:
* When Who Remark
* 12/10/2010 MHC Create Version 0.
*
*---------------------------------------------------------------------------*/
static void USB_AggModeSwitch(struct adapter *Adapter)
{
} /* USB_AggModeSwitch */
static void _InitOperationMode(struct adapter *Adapter)
{
@ -781,30 +625,8 @@ static void _InitBeaconParameters(struct adapter *Adapter)
haldata->RegCR_1 = rtw_read8(Adapter, REG_CR+1);
}
static void _InitRFType(struct adapter *Adapter)
{
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
bool is92CU = IS_92C_SERIAL(haldata->VersionID);
haldata->rf_chip = RF_6052;
if (false == is92CU) {
haldata->rf_type = RF_1T1R;
DBG_88E("Set RF Chip ID to RF_6052 and RF type to 1T1R.\n");
return;
}
/* TODO: Consider that EEPROM set 92CU to 1T1R later. */
/* Force to overwrite setting according to chip version. Ignore EEPROM setting. */
MSG_88E("Set RF Chip ID to RF_6052 and RF type to %d.\n", haldata->rf_type);
}
static void
_BeaconFunctionEnable(
struct adapter *Adapter,
bool Enable,
bool Linked
)
static void _BeaconFunctionEnable(struct adapter *Adapter,
bool Enable, bool Linked)
{
rtw_write8(Adapter, REG_BCN_CTRL, (BIT4 | BIT3 | BIT1));
@ -812,29 +634,19 @@ _BeaconFunctionEnable(
}
/* Set CCK and OFDM Block "ON" */
static void _BBTurnOnBlock(
struct adapter *Adapter
)
static void _BBTurnOnBlock(struct adapter *Adapter)
{
PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bCCKEn, 0x1);
PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bOFDMEn, 0x1);
}
static void _RfPowerSave(
struct adapter *Adapter
)
{
}
enum {
Antenna_Lfet = 1,
Antenna_Right = 2,
};
static void
_InitAntenna_Selection(struct adapter *Adapter)
static void _InitAntenna_Selection(struct adapter *Adapter)
{
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
if (haldata->AntDivCfg == 0)
@ -851,17 +663,6 @@ _InitAntenna_Selection(struct adapter *Adapter)
DBG_88E("%s,Cur_ant:(%x)%s\n", __func__, haldata->CurAntenna, (haldata->CurAntenna == Antenna_A) ? "Antenna_A" : "Antenna_B");
}
/* */
/* 2010/08/26 MH Add for selective suspend mode check. */
/* If Efuse 0x0e bit1 is not enabled, we can not support selective suspend for Minicard and */
/* slim card. */
/* */
static void
HalDetectSelectiveSuspendMode(
struct adapter *Adapter
)
{
} /* HalDetectSelectiveSuspendMode */
/*-----------------------------------------------------------------------------
* Function: HwSuspendModeEnable92Cu()
*
@ -912,37 +713,6 @@ _func_enter_;
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BEGIN);
#ifdef CONFIG_WOWLAN
Adapter->pwrctrlpriv.wowlan_wake_reason = rtw_read8(Adapter, REG_WOWLAN_WAKE_REASON);
DBG_88E("%s wowlan_wake_reason: 0x%02x\n",
__func__, Adapter->pwrctrlpriv.wowlan_wake_reason);
if (rtw_read8(Adapter, REG_MCUFWDL)&BIT7) { /*&&
(Adapter->pwrctrlpriv.wowlan_wake_reason & FWDecisionDisconnect)) {*/
u8 reg_val = 0;
DBG_88E("+Reset Entry+\n");
rtw_write8(Adapter, REG_MCUFWDL, 0x00);
_8051Reset88E(Adapter);
/* reset BB */
reg_val = rtw_read8(Adapter, REG_SYS_FUNC_EN);
reg_val &= ~(BIT(0) | BIT(1));
rtw_write8(Adapter, REG_SYS_FUNC_EN, reg_val);
/* reset RF */
rtw_write8(Adapter, REG_RF_CTRL, 0);
/* reset TRX path */
rtw_write16(Adapter, REG_CR, 0);
/* reset MAC, Digital Core */
reg_val = rtw_read8(Adapter, REG_SYS_FUNC_EN+1);
reg_val &= ~(BIT(4) | BIT(7));
rtw_write8(Adapter, REG_SYS_FUNC_EN+1, reg_val);
reg_val = rtw_read8(Adapter, REG_SYS_FUNC_EN+1);
reg_val |= BIT(4) | BIT(7);
rtw_write8(Adapter, REG_SYS_FUNC_EN+1, reg_val);
DBG_88E("-Reset Entry-\n");
}
#endif /* CONFIG_WOWLAN */
if (Adapter->pwrctrlpriv.bkeepfwalive) {
_ps_open_RF(Adapter);
@ -998,11 +768,7 @@ _func_enter_;
Adapter->bFWReady = false;
haldata->fw_ractrl = false;
} else {
#ifdef CONFIG_WOWLAN
status = rtl8188e_FirmwareDownload(Adapter, false);
#else
status = rtl8188e_FirmwareDownload(Adapter);
#endif /* CONFIG_WOWLAN */
if (status != _SUCCESS) {
DBG_88E("%s: Download Firmware failed!!\n", __func__);
@ -1287,6 +1053,7 @@ static void rtl8192cu_hw_power_down(struct adapter *adapt)
static u32 rtl8188eu_hal_deinit(struct adapter *Adapter)
{
DBG_88E("==> %s\n", __func__);
rtw_write32(Adapter, REG_HIMR_88E, IMR_DISABLED_88E);
@ -1376,14 +1143,6 @@ static void _ReadLEDSetting(struct adapter *Adapter, u8 *PROMContent, bool Autol
haldata->bLedOpenDrain = true;/* Support Open-drain arrangement for controlling the LED. */
}
static void readAntennaDiversity(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail)
{
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
struct registry_priv *registry_par = &adapt->registrypriv;
haldata->AntDivCfg = registry_par->antdiv_cfg; /* 0:OFF , 1:ON, */
}
static void Hal_EfuseParsePIDVID_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail)
{
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
@ -1420,7 +1179,7 @@ static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool
eeprom->mac_addr[i] = sMacAddr[i];
} else {
/* Read Permanent MAC address */
_rtw_memcpy(eeprom->mac_addr, &hwinfo[EEPROM_MAC_ADDR_88EU], ETH_ALEN);
memcpy(eeprom->mac_addr, &hwinfo[EEPROM_MAC_ADDR_88EU], ETH_ALEN);
}
RT_TRACE(_module_hci_hal_init_c_, _drv_notice_,
("Hal_EfuseParseMACAddr_8188EU: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n",
@ -1433,11 +1192,6 @@ static void Hal_CustomizeByCustomerID_8188EU(struct adapter *adapt)
{
}
/* Read HW power down mode selection */
static void _ReadPSSetting(struct adapter *Adapter, u8 *PROMContent, u8 AutoloadFail)
{
}
static void
readAdapterInfo_8188EU(
struct adapter *adapt
@ -1536,30 +1290,6 @@ static void ResumeTxBeacon(struct adapter *adapt)
rtw_write8(adapt, REG_TBTT_PROHIBIT+2, haldata->RegReg542);
}
static void UpdateInterruptMask8188EU(struct adapter *adapt, u8 bHIMR0 , u32 AddMSR, u32 RemoveMSR)
{
struct hal_data_8188e *haldata;
u32 *himr;
haldata = GET_HAL_DATA(adapt);
if (bHIMR0)
himr = &(haldata->IntrMask[0]);
else
himr = &(haldata->IntrMask[1]);
if (AddMSR)
*himr |= AddMSR;
if (RemoveMSR)
*himr &= (~RemoveMSR);
if (bHIMR0)
rtw_write32(adapt, REG_HIMR_88E, *himr);
else
rtw_write32(adapt, REG_HIMRE_88E, *himr);
}
static void StopTxBeacon(struct adapter *adapt)
{
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
@ -1667,22 +1397,6 @@ static void hw_var_set_bcn_func(struct adapter *Adapter, u8 variable, u8 *val)
rtw_write8(Adapter, bcn_ctrl_reg, rtw_read8(Adapter, bcn_ctrl_reg)&(~(EN_BCN_FUNCTION | EN_TXBCN_RPT)));
}
static void hw_var_set_correct_tsf(struct adapter *Adapter, u8 variable, u8 *val)
{
}
static void hw_var_set_mlme_disconnect(struct adapter *Adapter, u8 variable, u8 *val)
{
}
static void hw_var_set_mlme_sitesurvey(struct adapter *Adapter, u8 variable, u8 *val)
{
}
static void hw_var_set_mlme_join(struct adapter *Adapter, u8 variable, u8 *val)
{
}
static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
{
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
@ -2060,21 +1774,11 @@ _func_enter_;
case HW_VAR_AMPDU_FACTOR:
{
u8 RegToSet_Normal[4] = {0x41, 0xa8, 0x72, 0xb9};
#ifdef CONFIG_BT_COEXIST
u8 RegToSet_BT[4] = {0x31, 0x74, 0x42, 0x97};
#endif
u8 FactorToSet;
u8 *pRegToSet;
u8 index = 0;
#ifdef CONFIG_BT_COEXIST
if ((haldata->bt_coexist.BT_Coexist) &&
(haldata->bt_coexist.BT_CoexistType == BT_CSR_BC4))
pRegToSet = RegToSet_BT; /* 0x97427431; */
else
#endif
pRegToSet = RegToSet_Normal; /* 0xb972a841; */
pRegToSet = RegToSet_Normal; /* 0xb972a841; */
FactorToSet = *((u8 *)val);
if (FactorToSet <= 3) {
FactorToSet = (1<<(FactorToSet + 2));
@ -2120,12 +1824,14 @@ _func_enter_;
rtl8188e_set_FwJoinBssReport_cmd(Adapter, mstatus);
}
break;
#ifdef CONFIG_88EU_P2P
case HW_VAR_H2C_FW_P2P_PS_OFFLOAD:
{
u8 p2p_ps_state = (*(u8 *)val);
rtl8188e_set_p2p_ps_offload_cmd(Adapter, p2p_ps_state);
}
break;
#endif
case HW_VAR_INITIAL_GAIN:
{
struct rtw_dig *pDigTable = &podmpriv->DM_DigTable;
@ -2142,20 +1848,6 @@ _func_enter_;
case HW_VAR_TRIGGER_GPIO_0:
rtl8192cu_trigger_gpio_0(Adapter);
break;
#ifdef CONFIG_BT_COEXIST
case HW_VAR_BT_SET_COEXIST:
{
u8 bStart = (*(u8 *)val);
rtl8192c_set_dm_bt_coexist(Adapter, bStart);
}
break;
case HW_VAR_BT_ISSUE_DELBA:
{
u8 dir = (*(u8 *)val);
rtl8192c_issue_delete_ba(Adapter, dir);
}
break;
#endif
case HW_VAR_RPT_TIMER_SETTING:
{
u16 min_rpt_time = (*(u16 *)val);
@ -2212,89 +1904,6 @@ _func_enter_;
haldata->bMacPwrCtrlOn = *val;
DBG_88E("%s: bMacPwrCtrlOn=%d\n", __func__, haldata->bMacPwrCtrlOn);
break;
#ifdef CONFIG_WOWLAN
case HW_VAR_WOWLAN:
{
struct wowlan_ioctl_param *poidparam;
u8 mstatus = (*(u8 *)val);
u8 trycnt = 100;
poidparam = (struct wowlan_ioctl_param *)val;
switch (poidparam->subcode) {
case WOWLAN_ENABLE:
DBG_88E_LEVEL(_drv_always_, "WOWLAN_ENABLE\n");
SetFwRelatedForWoWLAN8188ES(Adapter, true);
/* RX DMA stop */
DBG_88E_LEVEL(_drv_always_, "Pause DMA\n");
rtw_write32(Adapter, REG_RXPKT_NUM, (rtw_read32(Adapter, REG_RXPKT_NUM)|RW_RELEASE_EN));
do {
if ((rtw_read32(Adapter, REG_RXPKT_NUM)&RXDMA_IDLE)) {
DBG_88E_LEVEL(_drv_always_, "RX_DMA_IDLE is true\n");
break;
} else {
/* If RX_DMA is not idle, receive one pkt from DMA */
DBG_88E_LEVEL(_drv_always_, "RX_DMA_IDLE is not true\n");
}
} while (trycnt--);
if (trycnt == 0)
DBG_88E_LEVEL(_drv_always_, "Stop RX DMA failed......\n");
/* Set WOWLAN H2C command. */
DBG_88E_LEVEL(_drv_always_, "Set WOWLan cmd\n");
rtl8188es_set_wowlan_cmd(Adapter, 1);
mstatus = rtw_read8(Adapter, REG_WOW_CTRL);
trycnt = 10;
while (!(mstatus&BIT1) && trycnt > 1) {
mstatus = rtw_read8(Adapter, REG_WOW_CTRL);
DBG_88E_LEVEL(_drv_info_, "Loop index: %d :0x%02x\n", trycnt, mstatus);
trycnt--;
rtw_msleep_os(2);
}
Adapter->pwrctrlpriv.wowlan_wake_reason = rtw_read8(Adapter, REG_WOWLAN_WAKE_REASON);
DBG_88E_LEVEL(_drv_always_, "wowlan_wake_reason: 0x%02x\n",
Adapter->pwrctrlpriv.wowlan_wake_reason);
/* Invoid SE0 reset signal during suspending*/
rtw_write8(Adapter, REG_RSV_CTRL, 0x20);
rtw_write8(Adapter, REG_RSV_CTRL, 0x60);
/* rtw_msleep_os(10); */
break;
case WOWLAN_DISABLE:
DBG_88E_LEVEL(_drv_always_, "WOWLAN_DISABLE\n");
trycnt = 10;
rtl8188es_set_wowlan_cmd(Adapter, 0);
mstatus = rtw_read8(Adapter, REG_WOW_CTRL);
DBG_88E_LEVEL(_drv_info_, "%s mstatus:0x%02x\n", __func__, mstatus);
while (mstatus&BIT1 && trycnt > 1) {
mstatus = rtw_read8(Adapter, REG_WOW_CTRL);
DBG_88E_LEVEL(_drv_always_, "Loop index: %d :0x%02x\n", trycnt, mstatus);
trycnt--;
rtw_msleep_os(2);
}
if (mstatus & BIT1)
printk("System did not release RX_DMA\n");
else
SetFwRelatedForWoWLAN8188ES(Adapter, false);
rtw_msleep_os(2);
if (!(Adapter->pwrctrlpriv.wowlan_wake_reason & FWDecisionDisconnect))
rtl8188e_set_FwJoinBssReport_cmd(Adapter, 1);
break;
default:
break;
}
}
break;
#endif /* CONFIG_WOWLAN */
case HW_VAR_TX_RPT_MAX_MACID:
{
u8 maxMacid = *val;
@ -2542,21 +2151,6 @@ static u8 SetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eV
return bResult;
}
static void _update_response_rate(struct adapter *adapt, unsigned int mask)
{
u8 RateIndex = 0;
/* Set RRSR rate table. */
rtw_write8(adapt, REG_RRSR, mask&0xff);
rtw_write8(adapt, REG_RRSR+1, (mask>>8)&0xff);
/* Set RTS initial rate */
while (mask > 0x1) {
mask = (mask >> 1);
RateIndex++;
}
rtw_write8(adapt, REG_INIRTS_RATE_SEL, RateIndex);
}
static void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level)
{
u8 init_rate = 0;

View file

@ -31,7 +31,6 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
struct adapter *adapt = pintfhdl->padapter;
struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt);
struct usb_device *udev = dvobjpriv->pusbdev;
unsigned int pipe;
int status = 0;
u8 reqtype;
@ -70,7 +69,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
} else {
pipe = usb_sndctrlpipe(udev, 0);/* write_out */
reqtype = REALTEK_USB_VENQT_WRITE;
_rtw_memcpy(pIo_buf, pdata, len);
memcpy(pIo_buf, pdata, len);
}
status = rtw_usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT);
@ -78,7 +77,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
if (status == len) { /* Success this control transfer. */
rtw_reset_continual_urb_error(dvobjpriv);
if (requesttype == 0x01)
_rtw_memcpy(pdata, pIo_buf, len);
memcpy(pdata, pIo_buf, len);
} else { /* error cases */
DBG_88E("reg 0x%x, usb %s %u fail, status:%d value=0x%x, vendorreq_times:%d\n",
value, (requesttype == 0x01) ? "read" : "write",
@ -95,7 +94,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
if (status > 0) {
if (requesttype == 0x01) {
/* For Control read transfer, we have to copy the read data from pIo_buf to pdata. */
_rtw_memcpy(pdata, pIo_buf, len);
memcpy(pdata, pIo_buf, len);
}
}
}
@ -268,28 +267,54 @@ 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)
{
u8 request;
u8 requesttype;
u16 wvalue;
u16 index;
u16 len;
u8 buf[VENDOR_CMD_MAX_DATA_LEN] = {0};
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;
int ret;
int vendorreq_times = 0;
_func_enter_;
buffer = kmemdup(pdata, length, GFP_ATOMIC);
if (!buffer)
return -ENOMEM;
while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
pipe = usb_sndctrlpipe(udev, 0);/* write_out */
request = 0x05;
requesttype = 0x00;/* write_out */
index = 0;/* n/a */
ret = rtw_usb_control_msg(udev, pipe, request, reqtype,
value, index, buffer, length,
RTW_USB_CONTROL_MSG_TIMEOUT);
wvalue = (u16)(addr&0x0000ffff);
len = length;
_rtw_memcpy(buf, pdata, len);
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);
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, buf, len, requesttype);
_func_exit_;
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;
}
}
/* 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;
}
@ -303,17 +328,12 @@ static void interrupt_handler_8188eu(struct adapter *adapt, u16 pkt_len, u8 *pbu
}
/* HISR */
_rtw_memcpy(&(haldata->IntArray[0]), &(pbuf[USB_INTR_CONTENT_HISR_OFFSET]), 4);
_rtw_memcpy(&(haldata->IntArray[1]), &(pbuf[USB_INTR_CONTENT_HISRE_OFFSET]), 4);
memcpy(&(haldata->IntArray[0]), &(pbuf[USB_INTR_CONTENT_HISR_OFFSET]), 4);
memcpy(&(haldata->IntArray[1]), &(pbuf[USB_INTR_CONTENT_HISRE_OFFSET]), 4);
/* C2H Event */
if (pbuf[0] != 0)
_rtw_memcpy(&(haldata->C2hArray[0]), &(pbuf[USB_INTR_CONTENT_C2H_OFFSET]), 16);
}
static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxstat, struct phy_stat *pphy_status)
{
return _SUCCESS;
memcpy(&(haldata->C2hArray[0]), &(pbuf[USB_INTR_CONTENT_C2H_OFFSET]), 16);
}
static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
@ -402,11 +422,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
alloc_sz += 14;
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
pkt_copy = dev_alloc_skb(alloc_sz);
#else
pkt_copy = netdev_alloc_skb(adapt->pnetdev, alloc_sz);
#endif
if (pkt_copy) {
pkt_copy->dev = adapt->pnetdev;
precvframe->u.hdr.pkt = pkt_copy;
@ -414,7 +430,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
precvframe->u.hdr.rx_end = pkt_copy->data + alloc_sz;
skb_reserve(pkt_copy, 8 - ((size_t)(pkt_copy->data) & 7));/* force pkt_copy->data at 8-byte alignment address */
skb_reserve(pkt_copy, shift_sz);/* force ip_hdr at 8-byte alignment address according to shift_sz. */
_rtw_memcpy(pkt_copy->data, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
memcpy(pkt_copy->data, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
precvframe->u.hdr.rx_tail = pkt_copy->data;
precvframe->u.hdr.rx_data = pkt_copy->data;
} else {
@ -555,8 +571,6 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
}
} else {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
skb_put(precvbuf->pskb, purb->actual_length);
precvbuf->pskb = NULL;
DBG_88E("###=> usb_read_port_complete => urb status(%d)\n", purb->status);
@ -596,25 +610,20 @@ _func_exit_;
static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
{
int err;
unsigned int pipe;
size_t tmpaddr = 0;
size_t alignment = 0;
u32 ret = _SUCCESS;
struct urb *purb = NULL;
struct recv_buf *precvbuf = (struct recv_buf *)rmem;
struct adapter *adapter = pintfhdl->padapter;
struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter);
struct recv_priv *precvpriv = &adapter->recvpriv;
struct usb_device *pusbd = pdvobj->pusbdev;
int err;
unsigned int pipe;
size_t tmpaddr = 0;
size_t alignment = 0;
u32 ret = _SUCCESS;
_func_enter_;
if (!precvbuf) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
("usb_read_port:precvbuf ==NULL\n"));
return _FAIL;
}
if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||
adapter->pwrctrlpriv.pnp_bstop_trx) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
@ -628,60 +637,62 @@ _func_enter_;
precvbuf->reuse = true;
}
rtl8188eu_init_recvbuf(adapter, precvbuf);
if (precvbuf != NULL) {
rtl8188eu_init_recvbuf(adapter, precvbuf);
/* re-assign for linux based on skb */
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
precvbuf->pskb = dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
#else
precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
#endif
if (precvbuf->pskb == NULL) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n"));
DBG_88E("#### usb_read_port() alloc_skb fail!#####\n");
return _FAIL;
/* re-assign for linux based on skb */
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) {
precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
if (precvbuf->pskb == NULL) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n"));
DBG_88E("#### usb_read_port() alloc_skb fail!#####\n");
return _FAIL;
}
tmpaddr = (size_t)precvbuf->pskb->data;
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
precvbuf->phead = precvbuf->pskb->head;
precvbuf->pdata = precvbuf->pskb->data;
precvbuf->ptail = skb_tail_pointer(precvbuf->pskb);
precvbuf->pend = skb_end_pointer(precvbuf->pskb);
precvbuf->pbuf = precvbuf->pskb->data;
} else { /* reuse skb */
precvbuf->phead = precvbuf->pskb->head;
precvbuf->pdata = precvbuf->pskb->data;
precvbuf->ptail = skb_tail_pointer(precvbuf->pskb);
precvbuf->pend = skb_end_pointer(precvbuf->pskb);
precvbuf->pbuf = precvbuf->pskb->data;
precvbuf->reuse = false;
}
tmpaddr = (size_t)precvbuf->pskb->data;
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
precvpriv->rx_pending_cnt++;
precvbuf->phead = precvbuf->pskb->head;
precvbuf->pdata = precvbuf->pskb->data;
precvbuf->ptail = skb_tail_pointer(precvbuf->pskb);
precvbuf->pend = skb_end_pointer(precvbuf->pskb);
precvbuf->pbuf = precvbuf->pskb->data;
} else { /* reuse skb */
precvbuf->phead = precvbuf->pskb->head;
precvbuf->pdata = precvbuf->pskb->data;
precvbuf->ptail = skb_tail_pointer(precvbuf->pskb);
precvbuf->pend = skb_end_pointer(precvbuf->pskb);
precvbuf->pbuf = precvbuf->pskb->data;
purb = precvbuf->purb;
precvbuf->reuse = false;
}
/* translate DMA FIFO addr to pipehandle */
pipe = ffaddr2pipehdl(pdvobj, addr);
precvpriv->rx_pending_cnt++;
usb_fill_bulk_urb(purb, pusbd, pipe,
precvbuf->pbuf,
MAX_RECVBUF_SZ,
usb_read_port_complete,
precvbuf);/* context is precvbuf */
purb = precvbuf->purb;
/* translate DMA FIFO addr to pipehandle */
pipe = ffaddr2pipehdl(pdvobj, addr);
usb_fill_bulk_urb(purb, pusbd, pipe,
precvbuf->pbuf,
MAX_RECVBUF_SZ,
usb_read_port_complete,
precvbuf);/* context is precvbuf */
err = usb_submit_urb(purb, GFP_ATOMIC);
if ((err) && (err != (-EPERM))) {
err = usb_submit_urb(purb, GFP_ATOMIC);
if ((err) && (err != (-EPERM))) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
("cannot submit rx in-token(err=0x%.8x), URB_STATUS =0x%.8x",
err, purb->status));
DBG_88E("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",
err, purb->status);
ret = _FAIL;
}
} else {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
("cannot submit rx in-token(err=0x%.8x), URB_STATUS =0x%.8x",
err, purb->status));
DBG_88E("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",
err, purb->status);
("usb_read_port:precvbuf ==NULL\n"));
ret = _FAIL;
}

View file

@ -75,7 +75,7 @@ enum rf_radio_path {
#define MAX_PG_GROUP 13
#define RF_PATH_MAX 3
#define RF_PATH_MAX 2
#define MAX_RF_PATH RF_PATH_MAX
#define MAX_TX_COUNT 4 /* path numbers */
@ -232,21 +232,12 @@ void PHY_ScanOperationBackup8188E(struct adapter *Adapter, u8 Operation);
void PHY_SetBWMode8188E(struct adapter *adapter,
enum ht_channel_width chnlwidth, unsigned char offset);
/* Set A2 entry to fw for 8192S */
void FillA2Entry8192C(struct adapter *adapter, u8 index, u8 *val);
/* channel switch related funciton */
void PHY_SwChnl8188E(struct adapter *adapter, u8 channel);
/* Call after initialization */
void PHY_SwChnlPhy8192C(struct adapter *adapter, u8 channel);
void ChkFwCmdIoDone(struct adapter *adapter);
/* BB/MAC/RF other monitor API */
void PHY_SetMonitorMode8192C(struct adapter *adapter, bool enablemonitormode);
bool PHY_CheckIsLegalRfPath8192C(struct adapter *adapter, u32 rfpath);
void PHY_SetRFPathSwitch_8188E(struct adapter *adapter, bool main);
void PHY_SwitchEphyParameter(struct adapter *adapter);

View file

@ -44,6 +44,9 @@ void PHY_IQCalibrate_8188E(struct adapter *Adapter, bool ReCovery);
/* LC calibrate */
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,

View file

@ -25,7 +25,6 @@
extern int _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
extern int _rtw_init_evt_priv(struct evt_priv *pevtpriv);
extern void _rtw_free_evt_priv(struct evt_priv *pevtpriv);
extern void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv);
extern int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj);
extern struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue);

View file

@ -27,13 +27,13 @@
#ifndef __DRV_TYPES_H__
#define __DRV_TYPES_H__
#include <autoconf.h>
#define DRV_NAME "r8188eu"
#include <osdep_service.h>
#include <wlan_bssdef.h>
#include <drv_types_linux.h>
#include <rtw_ht.h>
#include <rtw_cmd.h>
#include <wlan_bssdef.h>
#include <rtw_xmit.h>
#include <rtw_recv.h>
#include <hal_intf.h>
@ -128,12 +128,6 @@ struct registry_priv {
u8 wifi_spec;/* !turbo_mode */
u8 channel_plan;
#ifdef CONFIG_BT_COEXIST
u8 btcoex;
u8 bt_iso;
u8 bt_sco;
u8 bt_ampdu;
#endif
bool bAcceptAddbaReq;
u8 antdiv_cfg;
@ -200,12 +194,12 @@ struct dvobj_priv {
ATOMIC_T continual_urb_error;
};
static struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
{
/* todo: get interface type from dvobj and the return
* the dev accordingly */
return &dvobj->pusbintf->dev;
}
};
enum _IFACE_TYPE {
IFACE_PORT0, /* mapping to port0 for C/D series chips */
@ -250,13 +244,11 @@ struct adapter {
struct led_priv ledpriv;
struct mp_priv mppriv;
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
struct hostapd_priv *phostapdpriv;
#endif
#ifdef CONFIG_P2P
struct wifidirect_info wdinfo;
#endif /* CONFIG_P2P */
void *HalData;
u32 hal_data_sz;
@ -305,7 +297,7 @@ struct adapter {
/* The driver will show up the desired channel number
* when this flag is 1. */
u8 bNotifyChannelChange;
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
/* The driver will show the current P2P status when the
* upper application reads it. */
u8 bShowGetP2PState;

View file

@ -107,9 +107,6 @@ enum hw_variables {
/* The valid upper nav range for the HW updating, if the true value is
* larger than the upper range, the HW won't update it. */
/* Unit in microsecond. 0 means disable this function. */
#ifdef CONFIG_WOWLAN
HW_VAR_WOWLAN,
#endif
HW_VAR_NAV_UPPER,
HW_VAR_RPT_TIMER_SETTING,
HW_VAR_TX_RPT_MAX_MACID,
@ -311,33 +308,6 @@ enum hardware_type {
HARDWARE_TYPE_MAX,
};
/* RTL8192C Series */
#define IS_HARDWARE_TYPE_8192CE(_Adapter) \
(((struct adapter *)_Adapter)->HardwareType == HARDWARE_TYPE_RTL8192CE)
#define IS_HARDWARE_TYPE_8192CU(_Adapter) \
(((struct adapter *)_Adapter)->HardwareType == HARDWARE_TYPE_RTL8192CU)
#define IS_HARDWARE_TYPE_8192C(_Adapter) \
(IS_HARDWARE_TYPE_8192CE(_Adapter) || IS_HARDWARE_TYPE_8192CU(_Adapter))
/* RTL8192D Series */
#define IS_HARDWARE_TYPE_8192DE(_Adapter) \
(((struct adapter *)_Adapter)->HardwareType == HARDWARE_TYPE_RTL8192DE)
#define IS_HARDWARE_TYPE_8192DU(_Adapter) \
(((struct adapter *)_Adapter)->HardwareType == HARDWARE_TYPE_RTL8192DU)
#define IS_HARDWARE_TYPE_8192D(_Adapter) \
(IS_HARDWARE_TYPE_8192DE(_Adapter) || IS_HARDWARE_TYPE_8192DU(_Adapter))
/* RTL8723A Series */
#define IS_HARDWARE_TYPE_8723AE(_Adapter) \
(((struct adapter *)_Adapter)->HardwareType == HARDWARE_TYPE_RTL8723AE)
#define IS_HARDWARE_TYPE_8723AU(_Adapter) \
(((struct adapter *)_Adapter)->HardwareType == HARDWARE_TYPE_RTL8723AU)
#define IS_HARDWARE_TYPE_8723AS(_Adapter) \
(((struct adapter *)_Adapter)->HardwareType == HARDWARE_TYPE_RTL8723AS)
#define IS_HARDWARE_TYPE_8723A(_Adapter) \
(IS_HARDWARE_TYPE_8723AE(_Adapter) || IS_HARDWARE_TYPE_8723AU(_Adapter) || \
IS_HARDWARE_TYPE_8723AS(_Adapter))
/* RTL8188E Series */
#define IS_HARDWARE_TYPE_8188EE(_Adapter) \
(((struct adapter *)_Adapter)->HardwareType == HARDWARE_TYPE_RTL8188EE)
@ -353,39 +323,6 @@ IS_HARDWARE_TYPE_8723AS(_Adapter))
#define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse)
#ifdef CONFIG_WOWLAN
enum wowlan_subcode {
WOWLAN_PATTERN_MATCH = 1,
WOWLAN_MAGIC_PACKET = 2,
WOWLAN_UNICAST = 3,
WOWLAN_SET_PATTERN = 4,
WOWLAN_DUMP_REG = 5,
WOWLAN_ENABLE = 6,
WOWLAN_DISABLE = 7,
WOWLAN_STATUS = 8,
WOWLAN_DEBUG_RELOAD_FW = 9,
WOWLAN_DEBUG_1 = 10,
WOWLAN_DEBUG_2 = 11
};
struct wowlan_ioctl_param {
unsigned int subcode;
unsigned int subcode_value;
unsigned int wakeup_reason;
unsigned int len;
unsigned char pattern[0];
};
#define Rx_Pairwisekey 0x01
#define Rx_GTK 0x02
#define Rx_DisAssoc 0x04
#define Rx_DeAuth 0x08
#define FWDecisionDisconnect 0x10
#define Rx_MagicPkt 0x21
#define Rx_UnicastPkt 0x22
#define Rx_PatternPkt 0x23
#endif /* CONFIG_WOWLAN */
void rtw_hal_def_value_init(struct adapter *padapter);
void rtw_hal_free_data(struct adapter *padapter);
@ -483,5 +420,7 @@ void rtw_hal_reset_security_engine(struct adapter *adapter);
s32 rtw_hal_c2h_handler(struct adapter *adapter,
struct c2h_evt_hdr *c2h_evt);
c2h_id_filter rtw_hal_c2h_id_filter_ccx(struct adapter *adapter);
void indicate_wx_scan_complete_event(struct adapter *padapter);
u8 rtw_do_join(struct adapter *padapter);
#endif /* __HAL_INTF_H__ */

View file

@ -31,7 +31,7 @@
#define ETH_TYPE_LEN 2
#define PAYLOAD_TYPE_LEN 1
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
#define RTL_IOCTL_HOSTAPD (SIOCIWFIRSTPRIV + 28)
@ -239,7 +239,7 @@ struct ieee_param {
u16 key_len;
u8 key[0];
} crypt;
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
struct {
u16 aid;
u16 capability;
@ -256,7 +256,7 @@ struct ieee_param {
} u;
};
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
struct ieee_param_ex {
u32 cmd;
u8 sta_addr[ETH_ALEN];
@ -280,15 +280,6 @@ struct sta_data {
};
#endif
#if WIRELESS_EXT < 17
#define IW_QUAL_QUAL_INVALID 0x10
#define IW_QUAL_LEVEL_INVALID 0x20
#define IW_QUAL_NOISE_INVALID 0x40
#define IW_QUAL_QUAL_UPDATED 0x1
#define IW_QUAL_LEVEL_UPDATED 0x2
#define IW_QUAL_NOISE_UPDATED 0x4
#endif
#define IEEE80211_DATA_LEN 2304
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
6.2.1.1.2.
@ -315,8 +306,8 @@ struct ieee_ibss_seq {
};
struct rtw_ieee80211_hdr {
u16 frame_ctl;
u16 duration_id;
__le16 frame_ctl;
__le16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
@ -325,8 +316,8 @@ struct rtw_ieee80211_hdr {
} __packed;
struct rtw_ieee80211_hdr_3addr {
u16 frame_ctl;
u16 duration_id;
__le16 frame_ctl;
__le16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
@ -334,8 +325,8 @@ struct rtw_ieee80211_hdr_3addr {
} __packed;
struct rtw_ieee80211_hdr_qos {
u16 frame_ctl;
u16 duration_id;
__le16 frame_ctl;
__le16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
@ -345,8 +336,8 @@ struct rtw_ieee80211_hdr_qos {
} __packed;
struct rtw_ieee80211_hdr_3addr_qos {
u16 frame_ctl;
u16 duration_id;
__le16 frame_ctl;
__le16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
@ -1242,7 +1233,7 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id,
void dump_ies(u8 *buf, u32 buf_len);
void dump_wps_ie(u8 *ie, u32 ie_len);
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
void dump_p2p_ie(u8 *ie, u32 ie_len);
u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen);
u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id,

View file

@ -77,13 +77,13 @@ void rtw_cfg80211_indicate_disconnect(struct adapter *padapter);
void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv,
bool aborted);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter,
u8 *pmgmt_frame, uint frame_len);
void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter,
unsigned char *da,
unsigned short reason);
#endif /* CONFIG_AP_MODE */
#endif /* CONFIG_88EU_AP_MODE */
void rtw_cfg80211_issue_p2p_provision_request(struct adapter *padapter,
const u8 *buf, size_t len);
@ -99,17 +99,9 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net,
bool rtw_cfg80211_pwr_mgmt(struct adapter *adapter);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)) && \
!defined(COMPAT_KERNEL_RELEASE)
#define rtw_cfg80211_rx_mgmt(dev, freq, sig_dbm, buf, len, gfp) \
cfg80211_rx_mgmt(dev, freq, buf, len, gfp)
#define rtw_cfg80211_send_rx_assoc(dev, bss, buf, len) \
cfg80211_send_rx_assoc(dev, buf, len)
#else
#define rtw_cfg80211_rx_mgmt(dev, freq, sig_dbm, buf, len, gfp) \
cfg80211_rx_mgmt(dev, freq, sig_dbm, buf, len, gfp)
#define rtw_cfg80211_send_rx_assoc(dev, bss, buf, len) \
cfg80211_send_rx_assoc(dev, bss, buf, len)
#endif
#endif /* __IOCTL_CFG80211_H__ */

View file

@ -283,6 +283,8 @@ 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. */
@ -948,7 +950,7 @@ struct odm_dm_struct {
struct timer_list FastAntTrainingTimer;
}; /* DM_Dynamic_Mechanism_Structure */
#define ODM_RF_PATH_MAX 3
#define ODM_RF_PATH_MAX 2
enum ODM_RF_RADIO_PATH {
ODM_RF_PATH_A = 0, /* Radio Path A */

View file

@ -69,7 +69,7 @@ struct phy_rx_agc_info {
};
struct phy_status_rpt {
struct phy_rx_agc_info path_agc[ODM_RF_PATH_MAX];
struct phy_rx_agc_info path_agc[2];
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[ODM_RF_PATH_MAX];
u8 path_rxsnr[2];
u8 noise_power_db_lsb;
u8 rsvd_2[3];
u8 stream_csi[2];
@ -125,7 +125,7 @@ enum HAL_STATUS ODM_ConfigRFWithHeaderFile(struct odm_dm_struct *pDM_Odm,
enum ODM_RF_RADIO_PATH eRFPath);
enum HAL_STATUS ODM_ConfigBBWithHeaderFile(struct odm_dm_struct *pDM_Odm,
enum odm_bb_config_type ConfigType);
enum odm_bb_config_type ConfigType);
enum HAL_STATUS ODM_ConfigMACWithHeaderFile(struct odm_dm_struct *pDM_Odm);

View file

@ -91,7 +91,6 @@
#define ASSERT(expr)
#endif
#if DBG
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \
if (((comp) & pDM_Odm->DebugComponents) && \
(level <= pDM_Odm->DebugLevel)) { \
@ -140,15 +139,6 @@
DbgPrint("%02X%s", __ptr[__i], (__i==5)?"":"-");\
DbgPrint("\n"); \
}
#else
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)
#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)
#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)
#define ODM_dbg_enter()
#define ODM_dbg_exit()
#define ODM_dbg_trace(str)
#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)
#endif
void ODM_InitDebugSetting(struct odm_dm_struct *pDM_Odm);

View file

@ -137,7 +137,7 @@ void ODM_IsWorkItemScheduled(void *pRtWorkItem);
/* ODM Timer relative API. */
void ODM_StallExecution(u32 usDelay);
void ODM_delay_ms(u32 ms);
void ODM_delay_ms(u32 ms);
void ODM_delay_us(u32 us);

View file

@ -57,10 +57,6 @@
#include "HalHWImg8188E_BB.h"
#include "Hal8188EReg.h"
#ifdef CONFIG_WOWLAN
#include "HalHWImg8188E_FW.h"
#endif /* CONFIG_WOWLAN */
#include "odm_RegConfig8188E.h"
#include "odm_RTL8188E.h"

View file

@ -63,20 +63,13 @@ u8 rtw_reset_drv_sw(struct adapter *padapter);
u32 rtw_start_drv_threads(struct adapter *padapter);
void rtw_stop_drv_threads (struct adapter *padapter);
#ifdef CONFIG_WOWLAN
void rtw_cancel_dynamic_chk_timer(struct adapter *padapter);
#endif
void rtw_cancel_all_timer(struct adapter *padapter);
int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
struct net_device *rtw_init_netdev(struct adapter *padapter);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
u16 rtw_recv_select_queue(struct sk_buff *skb);
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) */
void rtw_proc_init_one(struct net_device *dev);
void rtw_proc_remove_one(struct net_device *dev);

View file

@ -26,7 +26,6 @@
#define _SUCCESS 1
#define RTW_RX_HANDLED 2
#include <linux/version.h>
#include <linux/spinlock.h>
#include <linux/compiler.h>
#include <linux/kernel.h>
@ -34,9 +33,7 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 5))
#include <linux/kref.h>
#endif
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/circ_buf.h>
@ -59,11 +56,8 @@
#include <linux/kthread.h>
#include <linux/usb.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21))
#include <linux/usb_ch9.h>
#else
#include <linux/usb/ch9.h>
#endif
struct __queue {
struct list_head queue;
spinlock_t lock;
@ -71,33 +65,6 @@ struct __queue {
#define thread_exit() complete_and_exit(NULL, 0)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22))
/* Porting from linux kernel, for compatible with old kernel. */
static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb)
{
return skb->tail;
}
static inline void skb_reset_tail_pointer(struct sk_buff *skb)
{
skb->tail = skb->data;
}
static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset)
{
skb->tail = skb->data + offset;
}
static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
{
return skb->end;
}
#endif
static inline struct list_head *get_next(struct list_head *list)
{
return list->next;
@ -145,23 +112,16 @@ static inline void _exit_critical_bh(spinlock_t *plock, unsigned long *pirqL)
static inline int _enter_critical_mutex(struct mutex *pmutex, unsigned long *pirqL)
{
int ret = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
int ret;
ret = mutex_lock_interruptible(pmutex);
#else
ret = down_interruptible(pmutex);
#endif
return ret;
}
static inline void _exit_critical_mutex(struct mutex *pmutex, unsigned long *pirqL)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
mutex_unlock(pmutex);
#else
up(pmutex);
#endif
}
static inline void rtw_list_delete(struct list_head *plist)
@ -193,11 +153,7 @@ static inline void _cancel_timer(struct timer_list *ptimer,u8 *bcancelled)
static inline void _init_workitem(struct work_struct *pwork, void *pfunc, void * cntx)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
INIT_WORK(pwork, pfunc);
#else
INIT_WORK(pwork, pfunc,pwork);
#endif
}
static inline void _set_workitem(struct work_struct *pwork)
@ -207,11 +163,7 @@ static inline void _set_workitem(struct work_struct *pwork)
static inline void _cancel_workitem_sync(struct work_struct *pwork)
{
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,22))
cancel_work_sync(pwork);
#else
flush_scheduled_work();
#endif
}
/* */
/* Global Mutex: can only be used at PASSIVE level. */
@ -233,41 +185,25 @@ static inline void _cancel_workitem_sync(struct work_struct *pwork)
static inline int rtw_netif_queue_stopped(struct net_device *pnetdev)
{
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
return (netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 0)) &&
return netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 0)) &&
netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 1)) &&
netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 2)) &&
netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 3)) );
#else
return netif_queue_stopped(pnetdev);
#endif
netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 3));
}
static inline void rtw_netif_wake_queue(struct net_device *pnetdev)
{
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
netif_tx_wake_all_queues(pnetdev);
#else
netif_wake_queue(pnetdev);
#endif
}
static inline void rtw_netif_start_queue(struct net_device *pnetdev)
{
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
netif_tx_start_all_queues(pnetdev);
#else
netif_start_queue(pnetdev);
#endif
}
static inline void rtw_netif_stop_queue(struct net_device *pnetdev)
{
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
netif_tx_stop_all_queues(pnetdev);
#else
netif_stop_queue(pnetdev);
#endif
}
#ifndef BIT
@ -339,12 +275,12 @@ extern unsigned char WPA_TKIP_CIPHER[4];
extern unsigned char RSN_TKIP_CIPHER[4];
#define rtw_update_mem_stat(flag, sz) do {} while (0)
extern u8 *_rtw_vmalloc(u32 sz);
extern u8 *_rtw_zvmalloc(u32 sz);
extern void _rtw_vmfree(u8 *pbuf, u32 sz);
extern u8 *_rtw_zmalloc(u32 sz);
extern u8 *_rtw_malloc(u32 sz);
extern void _rtw_mfree(u8 *pbuf, u32 sz);
u8 *_rtw_vmalloc(u32 sz);
u8 *_rtw_zvmalloc(u32 sz);
void _rtw_vmfree(u8 *pbuf, u32 sz);
u8 *_rtw_zmalloc(u32 sz);
u8 *_rtw_malloc(u32 sz);
void _rtw_mfree(u8 *pbuf, u32 sz);
#define rtw_vmalloc(sz) _rtw_vmalloc((sz))
#define rtw_zvmalloc(sz) _rtw_zvmalloc((sz))
#define rtw_vmfree(pbuf, sz) _rtw_vmfree((pbuf), (sz))
@ -352,49 +288,49 @@ extern void _rtw_mfree(u8 *pbuf, u32 sz);
#define rtw_zmalloc(sz) _rtw_zmalloc((sz))
#define rtw_mfree(pbuf, sz) _rtw_mfree((pbuf), (sz))
extern void *rtw_malloc2d(int h, int w, int size);
extern void rtw_mfree2d(void *pbuf, int h, int w, int size);
void *rtw_malloc2d(int h, int w, int size);
void rtw_mfree2d(void *pbuf, int h, int w, int size);
extern void _rtw_memcpy(void *dec, void *sour, u32 sz);
extern int _rtw_memcmp(void *dst, void *src, u32 sz);
extern void _rtw_memset(void *pbuf, int c, u32 sz);
void _rtw_memcpy(void *dec, void *sour, u32 sz);
int _rtw_memcmp(void *dst, void *src, u32 sz);
void _rtw_memset(void *pbuf, int c, u32 sz);
extern void _rtw_init_listhead(struct list_head *list);
extern u32 rtw_is_list_empty(struct list_head *phead);
extern void rtw_list_insert_head(struct list_head *plist, struct list_head *phead);
extern void rtw_list_insert_tail(struct list_head *plist, struct list_head *phead);
extern void rtw_list_delete(struct list_head *plist);
void _rtw_init_listhead(struct list_head *list);
u32 rtw_is_list_empty(struct list_head *phead);
void rtw_list_insert_head(struct list_head *plist, struct list_head *phead);
void rtw_list_insert_tail(struct list_head *plist, struct list_head *phead);
void rtw_list_delete(struct list_head *plist);
extern void _rtw_init_sema(struct semaphore *sema, int init_val);
extern void _rtw_free_sema(struct semaphore *sema);
extern void _rtw_up_sema(struct semaphore *sema);
extern u32 _rtw_down_sema(struct semaphore *sema);
extern void _rtw_mutex_init(struct mutex *pmutex);
extern void _rtw_mutex_free(struct mutex *pmutex);
extern void _rtw_spinlock_init(spinlock_t *plock);
extern void _rtw_spinlock_free(spinlock_t *plock);
void _rtw_init_sema(struct semaphore *sema, int init_val);
void _rtw_free_sema(struct semaphore *sema);
void _rtw_up_sema(struct semaphore *sema);
u32 _rtw_down_sema(struct semaphore *sema);
void _rtw_mutex_init(struct mutex *pmutex);
void _rtw_mutex_free(struct mutex *pmutex);
void _rtw_spinlock_init(spinlock_t *plock);
void _rtw_spinlock_free(spinlock_t *plock);
extern void _rtw_init_queue(struct __queue *pqueue);
extern u32 _rtw_queue_empty(struct __queue *pqueue);
extern u32 rtw_end_of_queue_search(struct list_head *queue, struct list_head *pelement);
void _rtw_init_queue(struct __queue *pqueue);
u32 _rtw_queue_empty(struct __queue *pqueue);
u32 rtw_end_of_queue_search(struct list_head *queue, struct list_head *pelement);
extern u32 rtw_get_current_time(void);
extern u32 rtw_systime_to_ms(u32 systime);
extern u32 rtw_ms_to_systime(u32 ms);
extern s32 rtw_get_passing_time_ms(u32 start);
extern s32 rtw_get_time_interval_ms(u32 start, u32 end);
u32 rtw_get_current_time(void);
u32 rtw_systime_to_ms(u32 systime);
u32 rtw_ms_to_systime(u32 ms);
s32 rtw_get_passing_time_ms(u32 start);
s32 rtw_get_time_interval_ms(u32 start, u32 end);
extern void rtw_sleep_schedulable(int ms);
void rtw_sleep_schedulable(int ms);
extern void rtw_msleep_os(int ms);
extern void rtw_usleep_os(int us);
void rtw_msleep_os(int ms);
void rtw_usleep_os(int us);
extern u32 rtw_atoi(u8 *s);
u32 rtw_atoi(u8 *s);
extern void rtw_mdelay_os(int ms);
extern void rtw_udelay_os(int us);
void rtw_mdelay_os(int ms);
void rtw_udelay_os(int us);
extern void rtw_yield_os(void);
void rtw_yield_os(void);
static inline unsigned char _cancel_timer_ex(struct timer_list *ptimer)
{
@ -479,9 +415,6 @@ void rtw_suspend_lock_init(void);
void rtw_suspend_lock_uninit(void);
void rtw_lock_suspend(void);
void rtw_unlock_suspend(void);
#ifdef CONFIG_WOWLAN
void rtw_lock_suspend_timeout(long timeout);
#endif /* CONFIG_WOWLAN */
/* Atomic integer operations */
#define ATOMIC_T atomic_t
@ -523,11 +456,7 @@ void rtw_free_netdev(struct net_device *netdev);
#define FUNC_ADPT_FMT "%s(%s)"
#define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
#define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)),(sig), 1)
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
#define rtw_signal_process(pid, sig) kill_proc((pid), (sig), 1)
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
u64 rtw_modular64(u64 x, u64 y);
u64 rtw_division64(u64 x, u64 y);
@ -613,6 +542,6 @@ bool rtw_cbuf_empty(struct rtw_cbuf *cbuf);
bool rtw_cbuf_push(struct rtw_cbuf *cbuf, void *buf);
void *rtw_cbuf_pop(struct rtw_cbuf *cbuf);
struct rtw_cbuf *rtw_cbuf_alloc(u32 size);
void rtw_cbuf_free(struct rtw_cbuf *cbuf);
int wifirate2_ratetbl_inx(unsigned char rate);
#endif

View file

@ -51,6 +51,6 @@ void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb);
int _netdev_open(struct net_device *pnetdev);
int netdev_open(struct net_device *pnetdev);
static int netdev_close(struct net_device *pnetdev);
int netdev_close(struct net_device *pnetdev);
#endif /* */

View file

@ -27,9 +27,6 @@ enum RTL8188E_H2C_CMD_ID {
H2C_COM_SCAN = 0x02,
H2C_COM_KEEP_ALIVE = 0x03,
H2C_COM_DISCNT_DECISION = 0x04,
#ifndef CONFIG_WOWLAN
H2C_COM_WWLAN = 0x05,
#endif
H2C_COM_INIT_OFFLOAD = 0x06,
H2C_COM_REMOTE_WAKE_CTL = 0x07,
H2C_COM_AP_OFFLOAD = 0x08,
@ -53,13 +50,6 @@ enum RTL8188E_H2C_CMD_ID {
H2C_BT_DAC_SWING_VAL = 0x62,
H2C_BT_PSD_RST = 0x63,
/* Class Remote WakeUp */
#ifdef CONFIG_WOWLAN
H2C_COM_WWLAN = 0x80,
H2C_COM_REMOTE_WAKE_CTRL = 0x81,
H2C_COM_AOAC_GLOBAL_INFO = 0x82,
#endif
/* Class */
H2C_RESET_TSF = 0xc0,
};
@ -89,9 +79,6 @@ struct H2C_SS_RFOFF_PARAM {
struct joinbssrpt_parm {
u8 OpMode; /* RT_MEDIA_STATUS */
#ifdef CONFIG_WOWLAN
u8 MacID; /* MACID */
#endif /* CONFIG_WOWLAN */
};
struct rsvdpage_loc {
@ -125,43 +112,11 @@ u8 rtl8188e_set_raid_cmd(struct adapter *padapter, u32 mask);
void rtl8188e_Add_RateATid(struct adapter *padapter, u32 bitmap, u8 arg,
u8 rssi_level);
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state);
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
void CheckFwRsvdPageContent(struct adapter *adapt);
void rtl8188e_set_FwMediaStatus_cmd(struct adapter *adapt, __le16 mstatus_rpt);
#ifdef CONFIG_WOWLAN
struct setwowlan_parm {
u8 mode;
u8 gpio_index;
u8 gpio_duration;
u8 second_mode;
u8 reserve;
};
struct setaoac_glocal_info {
u8 pairwiseEncAlg;
u8 groupEncAlg;
};
#define FW_WOWLAN_FUN_EN BIT(0)
#define FW_WOWLAN_PATTERN_MATCH BIT(1)
#define FW_WOWLAN_MAGIC_PKT BIT(2)
#define FW_WOWLAN_UNICAST BIT(3)
#define FW_WOWLAN_ALL_PKT_DROP BIT(4)
#define FW_WOWLAN_GPIO_ACTIVE BIT(5)
#define FW_WOWLAN_REKEY_WAKEUP BIT(6)
#define FW_WOWLAN_DEAUTH_WAKEUP BIT(7)
#define FW_WOWLAN_GPIO_WAKEUP_EN BIT(0)
#define FW_FW_PARSE_MAGIC_PKT BIT(1)
#define FW_REMOTE_WAKE_CTRL_EN BIT(0)
#define FW_REALWOWLAN_EN BIT(5)
void rtl8188es_set_wowlan_cmd(struct adapter *adapt, u8 enable);
void SetFwRelatedForWoWLAN8188ES(struct adapter *adapt, u8 HostIsGoingtoSleep);
#endif/* CONFIG_WOWLAN */
#endif/* __RTL8188E_CMD_H__ */

View file

@ -36,13 +36,9 @@
#include "odm_precomp.h"
/* Fw Array */
#define Rtl8188E_FwImageArray Rtl8188EFwImgArray
#define Rtl8188E_FWImgArrayLength Rtl8188EFWImgArrayLength
#ifdef CONFIG_WOWLAN
#define Rtl8188E_FwWoWImageArray Array_8188E_FW_WoWLAN
#define Rtl8188E_FwWoWImgArrayLength ArrayLength_8188E_FW_WoWLAN
#endif /* CONFIG_WOWLAN */
/* Fw Array */
#define Rtl8188E_FwImageArray Rtl8188EFwImgArray
#define Rtl8188E_FWImgArrayLength Rtl8188EFWImgArrayLength
#define RTL8188E_FW_UMC_IMG "rtl8188E\\rtl8188efw.bin"
#define RTL8188E_PHY_REG "rtl8188E\\PHY_REG_1T.txt"
@ -89,11 +85,6 @@ struct rt_firmware {
enum firmware_source eFWSource;
u8 *szFwBuffer;
u32 ulFwLength;
#ifdef CONFIG_WOWLAN
u8 *szWoWLANFwBuffer;
u32 ulWoWLANFwLength;
#endif /* CONFIG_WOWLAN */
};
/* This structure must be careful with byte-ordering */
@ -205,6 +196,10 @@ struct txpowerinfo24g {
s8 BW40_Diff[MAX_RF_PATH][MAX_TX_COUNT];
};
#define EFUSE_REAL_CONTENT_LEN 512
#define EFUSE_MAX_SECTION 16
#define EFUSE_IC_ID_OFFSET 506 /* For some inferior IC purpose*/
#define AVAILABLE_EFUSE_ADDR(addr) (addr < EFUSE_REAL_CONTENT_LEN)
/* To prevent out of boundary programming case, */
/* leave 1byte and program full section */
/* 9bytes + 1byt + 5bytes and pre 1byte. */
@ -219,6 +214,7 @@ struct txpowerinfo24g {
#define EFUSE_REAL_CONTENT_LEN_88E 256
#define EFUSE_MAP_LEN_88E 512
#define EFUSE_MAP_LEN EFUSE_MAP_LEN_88E
#define EFUSE_MAX_SECTION_88E 64
#define EFUSE_MAX_WORD_UNIT_88E 4
#define EFUSE_IC_ID_OFFSET_88E 506
@ -233,15 +229,10 @@ struct txpowerinfo24g {
#define EFUSE_OOB_PROTECT_BYTES_88E 18
#define EFUSE_PROTECT_BYTES_BANK_88E 16
#define EFUSE_REAL_CONTENT_LEN EFUSE_REAL_CONTENT_LEN_88E
#define EFUSE_MAP_LEN EFUSE_MAP_LEN_88E
#define EFUSE_MAX_SECTION EFUSE_MAX_SECTION_88E
#define EFUSE_IC_ID_OFFSET EFUSE_IC_ID_OFFSET_88E
#define AVAILABLE_EFUSE_ADDR(addr) (addr < EFUSE_REAL_CONTENT_LEN)
/* EFUSE for BT definition */
#define EFUSE_BT_REAL_CONTENT_LEN 1536 /* 512*3 */
#define EFUSE_BT_MAP_LEN 1024 /* 1k bytes */
#define EFUSE_BT_MAX_SECTION 128 /* 1024/8 */
#define EFUSE_BT_MAX_SECTION 128 /* 1024/8 */
#define EFUSE_PROTECT_BYTES_BANK 16
@ -253,13 +244,7 @@ enum rt_multi_func {
RT_MULTI_FUNC_GPS = 0x04,
};
/* For RTL8723 WiFi PDn/GPIO polarity control configuration. */
enum rt_polarity_ctl {
RT_POLARITY_LOW_ACT = 0,
RT_POLARITY_HIGH_ACT = 1,
};
/* For RTL8723 regulator mode. by tynli. 2011.01.14. */
/* For RTL8723 regulator mode. */
enum rt_regulator_mode {
RT_SWITCHING_REGULATOR = 0,
RT_LDO_REGULATOR = 1,
@ -268,7 +253,6 @@ enum rt_regulator_mode {
struct hal_data_8188e {
struct HAL_VERSION VersionID;
enum rt_multi_func MultiFunc; /* For multi-function consideration. */
enum rt_polarity_ctl PolarityCtl; /* For Wifi PDn Polarity control. */
enum rt_regulator_mode RegulatorMode; /* switching regulator or LDO */
u16 CustomerID;
@ -385,10 +369,6 @@ struct hal_data_8188e {
struct odm_dm_struct odmpriv;
struct sreset_priv srestpriv;
#ifdef CONFIG_BT_COEXIST
struct btcoexist_priv bt_coexist;
#endif
u8 CurAntenna;
u8 AntDivCfg;
u8 TRxAntDivType;
@ -418,7 +398,7 @@ struct hal_data_8188e {
u16 EfuseUsedBytes;
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
struct P2P_PS_Offload_t p2p_ps_offload;
#endif
@ -456,11 +436,7 @@ struct hal_data_8188e {
(GET_HAL_DATA(_Adapter)->MultiFunc & RT_MULTI_FUNC_GPS)
/* rtl8188e_hal_init.c */
#ifdef CONFIG_WOWLAN
s32 rtl8188e_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw);
#else
s32 rtl8188e_FirmwareDownload(struct adapter *padapter);
#endif
void _8051Reset88E(struct adapter *padapter);
void rtl8188e_InitializeFirmwareVars(struct adapter *padapter);
@ -493,10 +469,6 @@ void Hal_ReadPowerSavingMode88E(struct adapter *pAdapter, u8 *hwinfo,
bool HalDetectPwrDownMode88E(struct adapter *Adapter);
#ifdef CONFIG_WOWLAN
void Hal_DetectWoWMode(struct adapter *pAdapter);
#endif /* CONFIG_WOWLAN */
void Hal_InitChannelPlan(struct adapter *padapter);
void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc);

View file

@ -179,9 +179,6 @@
#define REG_C2HEVT_MSG_NORMAL 0x01A0
#define REG_C2HEVT_CLEAR 0x01AF
#define REG_MCUTST_1 0x01c0
#ifdef CONFIG_WOWLAN
#define REG_WOWLAN_WAKE_REASON 0x01c7
#endif
#define REG_FMETHR 0x01C8
#define REG_HMETFR 0x01CC
#define REG_HMEBOX_0 0x01D0
@ -443,8 +440,6 @@
#define REG_NORMAL_SIE_MAC_ADDR 0xFE70 /* 0xFE70~0xFE75 */
#define REG_NORMAL_SIE_STRING 0xFE80 /* 0xFE80~0xFEDF */
/* Redifine 8192C register definition for compatibility */
/* TODO: use these definition when using REG_xxx naming rule. */
/* NOTE: DO NOT Remove these definition. Use later. */
@ -485,7 +480,6 @@
#define MAX_MSS_DENSITY_2T 0x13
#define MAX_MSS_DENSITY_1T 0x0A
/* 8192C Cmd9346CR bits (Offset 0xA, 16bit) */
/* EEPROM enable when set 1 */
#define CmdEEPROM_En BIT5
/* System EEPROM select, 0: boot from E-FUSE, 1: The EEPROM used is 9346 */

View file

@ -61,7 +61,4 @@ enum ANDROID_WIFI_CMD {
int rtw_android_cmdstr_to_num(char *cmdstr);
int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);
static int rtw_android_wifictrl_func_add(void) { return 0; }
static void rtw_android_wifictrl_func_del(void) {}
#endif /* __RTW_ANDROID_H__ */

View file

@ -23,7 +23,7 @@
#include <osdep_service.h>
#include <drv_types.h>
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
/* external function */
void rtw_indicate_sta_assoc_event(struct adapter *padapter,
@ -47,6 +47,7 @@ void rtw_set_macaddr_acl(struct adapter *padapter, int mode);
int rtw_acl_add_sta(struct adapter *padapter, u8 *addr);
int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr);
#ifdef CONFIG_88EU_AP_MODE
void associated_clients_update(struct adapter *padapter, u8 updated);
void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta);
u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta);
@ -58,6 +59,7 @@ int rtw_sta_flush(struct adapter *padapter);
int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset);
void start_ap_mode(struct adapter *padapter);
void stop_ap_mode(struct adapter *padapter);
#endif /* end of CONFIG_AP_MODE */
#endif
#endif /* end of CONFIG_88EU_AP_MODE */
#endif

View file

@ -22,9 +22,9 @@
#define MACADDRLEN 6
#define _DEBUG_ERR DBG_88E
#define _DEBUG_INFO /* DBG_88E */
#define _DEBUG_INFO DBG_88E
#define DEBUG_WARN DBG_88E
#define DEBUG_INFO /* DBG_88E */
#define DEBUG_INFO DBG_88E
#define DEBUG_ERR DBG_88E
#define GET_MY_HWADDR(padapter) ((padapter)->eeprompriv.mac_addr)

View file

@ -107,9 +107,9 @@ u32 rtw_init_evt_priv(struct evt_priv *pevtpriv);
void rtw_free_evt_priv(struct evt_priv *pevtpriv);
void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv);
void rtw_evt_notify_isr(struct evt_priv *pevtpriv);
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType);
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
enum rtw_drvextra_cmd_id {
NONE_WK_CID,
@ -801,7 +801,7 @@ u8 rtw_rpt_timer_cfg_cmd(struct adapter*padapter, u16 minRptTime);
u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue);
u8 rtw_ps_cmd(struct adapter*padapter);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
u8 rtw_chk_hi_queue_cmd(struct adapter*padapter);
#endif

View file

@ -68,54 +68,48 @@
#define _module_rtl8712_recv_c_ BIT(30)
#define _module_rtl8712_led_c_ BIT(31)
#ifdef pr_info
#define _dbgdump pr_info
#else
#define _dbgdump printk
#endif
#define DRIVER_PREFIX "RTL8188: "
#define DRIVER_PREFIX "r8188eu: "
extern u32 GlobalDebugLevel;
#define DBG_88E_LEVEL(_level, fmt, arg...) \
do { \
if (_level <= GlobalDebugLevel) \
_dbgdump(DRIVER_PREFIX"ERROR " fmt, ##arg); \
pr_info(DRIVER_PREFIX"ERROR " fmt, ##arg); \
} while (0)
#define DBG_88E(...) \
do { \
if (_drv_err_ <= GlobalDebugLevel) \
_dbgdump(DRIVER_PREFIX __VA_ARGS__); \
pr_info(DRIVER_PREFIX __VA_ARGS__); \
} while (0)
#define MSG_88E(...) \
do { \
if (_drv_err_ <= GlobalDebugLevel) \
_dbgdump(DRIVER_PREFIX __VA_ARGS__); \
pr_info(DRIVER_PREFIX __VA_ARGS__); \
} while (0)
#define RT_TRACE(_comp, _level, fmt) \
do { \
if (_level <= GlobalDebugLevel) { \
_dbgdump("%s [0x%08x,%d]", DRIVER_PREFIX, \
pr_info("%s [0x%08x,%d]", DRIVER_PREFIX, \
(unsigned int)_comp, _level); \
_dbgdump fmt; \
pr_info fmt; \
} \
} while (0)
#define _func_enter_ \
do { \
if (GlobalDebugLevel >= _drv_debug_) \
_dbgdump("%s : %s enters at %d\n", \
pr_info("%s : %s enters at %d\n", \
DRIVER_PREFIX, __func__, __LINE__); \
} while (0)
#define _func_exit_ \
do { \
if (GlobalDebugLevel >= _drv_debug_) \
_dbgdump("%s : %s exits at %d\n", \
pr_info("%s : %s exits at %d\n", \
DRIVER_PREFIX, __func__, __LINE__); \
} while (0)
@ -124,10 +118,10 @@ extern u32 GlobalDebugLevel;
if (_level <= GlobalDebugLevel) { \
int __i; \
u8 *ptr = (u8 *)_hexdata; \
_dbgdump("%s", DRIVER_PREFIX); \
_dbgdump(_titlestring); \
pr_info("%s", DRIVER_PREFIX); \
pr_info(_titlestring); \
for (__i = 0; __i < (int)_hexdatalen; __i++ ) { \
_dbgdump("%02X%s", ptr[__i], \
pr_info("%02X%s", ptr[__i], \
(((__i + 1) % 4) == 0) ? \
" " : " "); \
if (((__i + 1) % 16) == 0) \
@ -225,7 +219,7 @@ int proc_get_rf_reg_dump4(char *page, char **start,
off_t offset, int count,
int *eof, void *data);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
int proc_get_all_sta_info(char *page, char **start,
off_t offset, int count,

View file

@ -54,7 +54,7 @@ enum _EFUSE_DEF_TYPE {
#define EFUSE_MAX_SIZE 256
/* end of E-Fuse */
#define EFUSE_MAX_MAP_LEN 256
#define EFUSE_MAX_MAP_LEN 512
#define EFUSE_MAX_HW_SIZE 512
#define EFUSE_MAX_SECTION_BASE 16

View file

@ -31,25 +31,13 @@
#include <linux/atomic.h>
#include <linux/usb.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21))
#include <linux/usb_ch9.h>
#else
#include <linux/usb/ch9.h>
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
#define rtw_usb_buffer_alloc(dev, size, dma) \
usb_alloc_coherent((dev), (size), (in_interrupt() ? \
GFP_ATOMIC : GFP_KERNEL), (dma))
#define rtw_usb_buffer_free(dev, size, addr, dma) \
usb_free_coherent((dev), (size), (addr), (dma))
#else
#define rtw_usb_buffer_alloc(dev, size, dma) \
usb_buffer_alloc((dev), (size), (in_interrupt() ? \
GFP_ATOMIC : GFP_KERNEL), (dma))
#define rtw_usb_buffer_free(dev, size, addr, dma) \
usb_buffer_free((dev), (size), (addr), (dma))
#endif
#define NUM_IOREQ 8

View file

@ -108,9 +108,7 @@ static int oid_null_function(struct oid_par_priv *poid_par_priv) {
}
#endif
#if defined(CONFIG_WIRELESS_EXT)
extern struct iw_handler_def rtw_handlers_def;
#endif
int drv_query_info(struct net_device *miniportadaptercontext, NDIS_OID oid,
void *informationbuffer, u32 informationbufferlength,

View file

@ -160,7 +160,7 @@ enum LED_STRATEGY_871x {
LED_ST_NONE = 99,
};
void LedControl871x(struct adapter *padapter, enum LED_CTL_MODE LedAction);
void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction);
struct led_priv{
/* add for led controll */

View file

@ -383,7 +383,12 @@ struct mlme_priv {
u8 *wps_probe_req_ie;
u32 wps_probe_req_ie_len;
#if defined (CONFIG_AP_MODE)
u8 *assoc_req;
u32 assoc_req_len;
u8 *assoc_rsp;
u32 assoc_rsp_len;
#if defined (CONFIG_88EU_AP_MODE)
/* Number of associated Non-ERP stations (i.e., stations using 802.11b
* in 802.11g BSS) */
int num_sta_non_erp;
@ -410,11 +415,6 @@ struct mlme_priv {
u16 ht_op_mode;
u8 *assoc_req;
u32 assoc_req_len;
u8 *assoc_rsp;
u32 assoc_rsp_len;
u8 *wps_beacon_ie;
/* u8 *wps_probe_req_ie; */
u8 *wps_probe_resp_ie;
@ -437,10 +437,10 @@ struct mlme_priv {
u32 p2p_assoc_req_ie_len;
spinlock_t bcn_update_lock;
u8 update_bcn;
#endif /* if defined (CONFIG_AP_MODE) */
#endif /* if defined (CONFIG_88EU_AP_MODE) */
};
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
struct hostapd_priv {
struct adapter *padapter;

View file

@ -173,32 +173,6 @@ enum RT_CHANNEL_DOMAIN_2G {
RT_CHANNEL_DOMAIN_2G_MAX,
};
enum RT_CHANNEL_DOMAIN_5G {
RT_CHANNEL_DOMAIN_5G_NULL = 0x00,
RT_CHANNEL_DOMAIN_5G_ETSI1 = 0x01, /* Europe */
RT_CHANNEL_DOMAIN_5G_ETSI2 = 0x02, /* Australia, NZ */
RT_CHANNEL_DOMAIN_5G_ETSI3 = 0x03, /* Russia */
RT_CHANNEL_DOMAIN_5G_FCC1 = 0x04, /* US */
RT_CHANNEL_DOMAIN_5G_FCC2 = 0x05, /* FCC o/w DFS Chan */
RT_CHANNEL_DOMAIN_5G_FCC3 = 0x06, /* India, Mexico */
RT_CHANNEL_DOMAIN_5G_FCC4 = 0x07, /* Venezuela */
RT_CHANNEL_DOMAIN_5G_FCC5 = 0x08, /* China */
RT_CHANNEL_DOMAIN_5G_FCC6 = 0x09, /* Israel */
RT_CHANNEL_DOMAIN_5G_FCC7_IC1 = 0x0A, /* US, Canada */
RT_CHANNEL_DOMAIN_5G_KCC1 = 0x0B, /* Korea */
RT_CHANNEL_DOMAIN_5G_MKK1 = 0x0C, /* Japan */
RT_CHANNEL_DOMAIN_5G_MKK2 = 0x0D, /* Japan (W52, W53) */
RT_CHANNEL_DOMAIN_5G_MKK3 = 0x0E, /* Japan (W56) */
RT_CHANNEL_DOMAIN_5G_NCC1 = 0x0F, /* Taiwan */
RT_CHANNEL_DOMAIN_5G_NCC2 = 0x10, /* Taiwan o/w DFS */
/* Add new channel plan above this line=============== */
/* Driver Self Defined ===== */
RT_CHANNEL_DOMAIN_5G_FCC = 0x11,
RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS = 0x12,
RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS = 0x13,
RT_CHANNEL_DOMAIN_5G_MAX,
};
#define rtw_is_channel_plan_valid(chplan) \
(chplan < RT_CHANNEL_DOMAIN_MAX || \
chplan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
@ -416,7 +390,7 @@ struct p2p_channels {
};
struct p2p_oper_class_map {
enum hw_mode {IEEE80211G,IEEE80211A} mode;
enum hw_mode {IEEE80211G} mode;
u8 op_class;
u8 min_chan;
u8 max_chan;
@ -462,7 +436,7 @@ struct mlme_ext_priv {
u64 TSFValue;
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
unsigned char bstart_bss;
#endif
u8 update_channel_plan_by_ap_done;
@ -515,8 +489,6 @@ void CAM_empty_entry(struct adapter * Adapter, u8 ucIndex);
int allocate_fw_sta_entry(struct adapter *padapter);
void flush_all_cam_entry(struct adapter *padapter);
bool IsLegal5GChannel(struct adapter * Adapter, u8 channel);
void site_survey(struct adapter *padapter);
u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame,
struct wlan_bssid_ex *bssid);
@ -592,7 +564,7 @@ s32 dump_mgntframe_and_wait(struct adapter *padapter,
s32 dump_mgntframe_and_wait_ack(struct adapter *padapter,
struct xmit_frame *pmgntframe);
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
void issue_probersp_p2p(struct adapter *padapter, unsigned char *da);
void issue_p2p_provision_request(struct adapter *padapter, u8 *pssid,
u8 ussidlen, u8 *pdev_raddr);
@ -603,7 +575,7 @@ int issue_probereq_p2p_ex(struct adapter *adapter, u8 *da, int try_cnt,
void issue_p2p_invitation_response(struct adapter *padapter, u8 *raddr,
u8 dialogToken, u8 success);
void issue_p2p_invitation_request(struct adapter *padapter, u8* raddr);
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
void issue_beacon(struct adapter *padapter, int timeout_ms);
void issue_probersp(struct adapter *padapter, unsigned char *da,
u8 is_valid_p2p_probereq);
@ -901,6 +873,6 @@ static struct fwevent wlanevents[] = {
{0, NULL},
};
#endif/* _RTL8192C_CMD_C_ */
#endif/* _RTL_MLME_EXT_C_ */
#endif
#endif /* __RTW_MLME_EXT_H_ */

View file

@ -68,110 +68,110 @@ struct dr_variable_struct {
#define _irqlevel_changed_(a, b)
/* oid_rtl_seg_81_80_00 */
int oid_rt_pro_set_data_rate_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_tx_power_control_hdl(struct oid_par_priv *poid_par_priv);
/* rtl8188eu_oid_rtl_seg_81_80_00 */
int rtl8188eu_oid_rt_pro_set_data_rate_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_antenna_bb_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_tx_power_control_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_81_80_20 */
int oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *par_priv);
int oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *par_priv);
int oid_rt_pro_set_modulation_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *par_priv);
int oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv);
/* rtl8188eu_oid_rtl_seg_81_80_20 */
int rtl8188eu_oid_rt_pro_query_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_query_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_query_rx_packet_crc32_error_hdl(struct oid_par_priv *par_priv);
int rtl8188eu_oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv *par_priv);
int rtl8188eu_oid_rt_pro_set_modulation_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *par_priv);
int rtl8188eu_oid_rt_pro_set_single_tone_tx_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_81_87 */
int oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv);
/* rtl8188eu_oid_rtl_seg_81_87 */
int rtl8188eu_oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_81_85 */
int oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv);
/* rtl8188eu_oid_rtl_seg_81_85 */
int rtl8188eu_oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_87_11_00 */
int oid_rt_pro8711_join_bss_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_burst_read_register_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_write16_eeprom_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_wr_attrib_mem_hdl (struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_poll_rx_status_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_87_11_20 */
int oid_rt_pro_cfg_debug_message_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_87_11_50 */
int oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_87_11_F0 */
int oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv *poid_par_priv);
/* rtl8188eu_oid_rtl_seg_87_11_00 */
int rtl8188eu_oid_rt_pro8711_join_bss_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_burst_read_register_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_write16_eeprom_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_wr_attrib_mem_hdl (struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_poll_rx_status_hdl(struct oid_par_priv *poid_par_priv);
/* rtl8188eu_oid_rtl_seg_87_11_20 */
int rtl8188eu_oid_rt_pro_cfg_debug_message_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv);
/* rtl8188eu_oid_rtl_seg_87_11_50 */
int rtl8188eu_oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv *poid_par_priv);
/* rtl8188eu_oid_rtl_seg_87_11_F0 */
int rtl8188eu_oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv *poid_par_priv);
/* oid_rtl_seg_87_12_00 */
int oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_query_dr_variable_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_efuse_current_size_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_set_crystal_cap_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_set_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *par_priv);
int oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv);
int oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv);
/* rtl8188eu_oid_rtl_seg_87_12_00 */
int rtl8188eu_oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_query_dr_variable_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_rw_efuse_pgpkt_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_get_efuse_current_size_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_set_crystal_cap_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_set_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_get_phy_rx_packet_received_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_get_phy_rx_packet_crc32_error_hdl(struct oid_par_priv *par_priv);
int rtl8188eu_oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv);
int rtl8188eu_oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv);
#ifdef _RTW_MP_IOCTL_C_
static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = {
static const struct oid_obj_priv rtl8188eu_oid_rtl_seg_81_80_00[] = {
{1, &oid_null_function}, /* 0x00 OID_RT_PRO_RESET_DUT */
{1, &oid_rt_pro_set_data_rate_hdl}, /* 0x01 */
{1, &oid_rt_pro_start_test_hdl}, /* 0x02 */
{1, &oid_rt_pro_stop_test_hdl}, /* 0x03 */
{1, &rtl8188eu_oid_rt_pro_set_data_rate_hdl}, /* 0x01 */
{1, &rtl8188eu_oid_rt_pro_start_test_hdl}, /* 0x02 */
{1, &rtl8188eu_oid_rt_pro_stop_test_hdl}, /* 0x03 */
{1, &oid_null_function}, /* 0x04 OID_RT_PRO_SET_PREAMBLE */
{1, &oid_null_function}, /* 0x05 OID_RT_PRO_SET_SCRAMBLER */
{1, &oid_null_function}, /* 0x06 OID_RT_PRO_SET_FILTER_BB */
{1, &oid_null_function},/* 0x07 OID_RT_PRO_SET_MANUAL_DIVERSITY_BB */
{1, &oid_rt_pro_set_channel_direct_call_hdl}, /* 0x08 */
{1, &rtl8188eu_oid_rt_pro_set_channel_direct_call_hdl}, /* 0x08 */
{1, &oid_null_function},/* 0x09 OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL */
{1, &oid_null_function},/* 0x0A OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL */
{1, &oid_rt_pro_set_continuous_tx_hdl}, /* 0x0B OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL */
{1, &oid_rt_pro_set_single_carrier_tx_hdl},/* 0x0C OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS */
{1, &rtl8188eu_oid_rt_pro_set_continuous_tx_hdl}, /* 0x0B OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL */
{1, &rtl8188eu_oid_rt_pro_set_single_carrier_tx_hdl},/* 0x0C OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS */
{1, &oid_null_function}, /* 0x0D OID_RT_PRO_SET_TX_ANTENNA_BB */
{1, &oid_rt_pro_set_antenna_bb_hdl}, /* 0x0E */
{1, &rtl8188eu_oid_rt_pro_set_antenna_bb_hdl}, /* 0x0E */
{1, &oid_null_function}, /* 0x0F OID_RT_PRO_SET_CR_SCRAMBLER */
{1, &oid_null_function}, /* 0x10 OID_RT_PRO_SET_CR_NEW_FILTER */
{1, &oid_rt_pro_set_tx_power_control_hdl},/* 0x11 OID_RT_PRO_SET_TX_POWER_CONTROL */
{1, &rtl8188eu_oid_rt_pro_set_tx_power_control_hdl},/* 0x11 OID_RT_PRO_SET_TX_POWER_CONTROL */
{1, &oid_null_function}, /* 0x12 OID_RT_PRO_SET_CR_TX_CONFIG */
{1, &oid_null_function}, /* 0x13 OID_RT_PRO_GET_TX_POWER_CONTROL */
{1, &oid_null_function}, /* 0x14 OID_RT_PRO_GET_CR_SIGNAL_QUALITY */
@ -188,42 +188,42 @@ static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = {
{1, &oid_null_function} /* 0x1F OID_RT_PRO_WRITE_POWER_CONTROL */
};
static const struct oid_obj_priv oid_rtl_seg_81_80_20[] = {
static const struct oid_obj_priv rtl8188eu_oid_rtl_seg_81_80_20[] = {
{1, &oid_null_function}, /* 0x20 OID_RT_PRO_READ_POWER_CONTROL */
{1, &oid_null_function}, /* 0x21 OID_RT_PRO_WRITE_EEPROM */
{1, &oid_null_function}, /* 0x22 OID_RT_PRO_READ_EEPROM */
{1, &oid_rt_pro_reset_tx_packet_sent_hdl}, /* 0x23 */
{1, &oid_rt_pro_query_tx_packet_sent_hdl}, /* 0x24 */
{1, &oid_rt_pro_reset_rx_packet_received_hdl}, /* 0x25 */
{1, &oid_rt_pro_query_rx_packet_received_hdl}, /* 0x26 */
{1, &oid_rt_pro_query_rx_packet_crc32_error_hdl}, /* 0x27 */
{1, &rtl8188eu_oid_rt_pro_reset_tx_packet_sent_hdl}, /* 0x23 */
{1, &rtl8188eu_oid_rt_pro_query_tx_packet_sent_hdl}, /* 0x24 */
{1, &rtl8188eu_oid_rt_pro_reset_rx_packet_received_hdl}, /* 0x25 */
{1, &rtl8188eu_oid_rt_pro_query_rx_packet_received_hdl}, /* 0x26 */
{1, &rtl8188eu_oid_rt_pro_query_rx_packet_crc32_error_hdl}, /* 0x27 */
{1, &oid_null_function}, /* 0x28 OID_RT_PRO_QUERY_CURRENT_ADDRESS */
{1, &oid_null_function}, /* 0x29 OID_RT_PRO_QUERY_PERMANENT_ADDRESS */
{1, &oid_null_function}, /* 0x2A OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS */
{1, &oid_rt_pro_set_carrier_suppression_tx_hdl},/* 0x2B OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX */
{1, &rtl8188eu_oid_rt_pro_set_carrier_suppression_tx_hdl},/* 0x2B OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX */
{1, &oid_null_function}, /* 0x2C OID_RT_PRO_RECEIVE_PACKET */
{1, &oid_null_function}, /* 0x2D OID_RT_PRO_WRITE_EEPROM_BYTE */
{1, &oid_null_function}, /* 0x2E OID_RT_PRO_READ_EEPROM_BYTE */
{1, &oid_rt_pro_set_modulation_hdl} /* 0x2F */
{1, &rtl8188eu_oid_rt_pro_set_modulation_hdl} /* 0x2F */
};
static const struct oid_obj_priv oid_rtl_seg_81_80_40[] = {
static const struct oid_obj_priv rtl8188eu_oid_rtl_seg_81_80_40[] = {
{1, &oid_null_function}, /* 0x40 */
{1, &oid_null_function}, /* 0x41 */
{1, &oid_null_function}, /* 0x42 */
{1, &oid_rt_pro_set_single_tone_tx_hdl}, /* 0x43 */
{1, &rtl8188eu_oid_rt_pro_set_single_tone_tx_hdl}, /* 0x43 */
{1, &oid_null_function}, /* 0x44 */
{1, &oid_null_function} /* 0x45 */
};
static const struct oid_obj_priv oid_rtl_seg_81_80_80[] = {
static const struct oid_obj_priv rtl8188eu_oid_rtl_seg_81_80_80[] = {
{1, &oid_null_function}, /* 0x80 OID_RT_DRIVER_OPTION */
{1, &oid_null_function}, /* 0x81 OID_RT_RF_OFF */
{1, &oid_null_function} /* 0x82 OID_RT_AUTH_STATUS */
};
static const struct oid_obj_priv oid_rtl_seg_81_85[] = {
{1, &oid_rt_wireless_mode_hdl} /* 0x00 OID_RT_WIRELESS_MODE */
static const struct oid_obj_priv rtl8188eu_oid_rtl_seg_81_85[] = {
{1, &rtl8188eu_oid_rt_wireless_mode_hdl} /* 0x00 OID_RT_WIRELESS_MODE */
};
#endif /* _RTL871X_MP_IOCTL_C_ */
@ -329,11 +329,12 @@ enum RTL871X_MP_IOCTL_SUBCODE {
MAX_MP_IOCTL_SUBCODE,
};
s32 mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv);
s32 rtl8188eu_mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv);
#define GEN_HANDLER(sz, hdl, oid) {sz, hdl, oid},
#define EXT_MP_IOCTL_HANDLER(sz, subcode, oid) \
{sz, mp_ioctl_##subcode##_hdl, oid},
{sz, rtl8188eu_mp_ioctl_##subcode##_hdl, oid},
#endif

View file

@ -216,15 +216,6 @@ struct pwrctrl_priv {
u8 autopm_cnt;
#endif
u8 bSupportRemoteWakeup;
#ifdef CONFIG_WOWLAN
u8 wowlan_mode;
u8 wowlan_pattern;
u8 wowlan_magic;
u8 wowlan_unicast;
u8 wowlan_pattern_idx;
u8 wowlan_wake_reason;
u32 wowlan_pattern_context[8][5];
#endif /* CONFIG_WOWLAN */
struct timer_list pwr_state_check_timer;
int pwr_state_check_interval;
u8 pwr_state_check_cnts;

View file

@ -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 3
#define MAX_PATH_NUM_92CS 2
struct phy_info {
u8 RxPWDBAll;
u8 SignalQuality; /* in 0-100 index. */

View file

@ -29,24 +29,19 @@
#define NumRates (13)
/* slot time for 11g */
#define SHORT_SLOT_TIME 9
#define NON_SHORT_SLOT_TIME 20
#define SHORT_SLOT_TIME 9
#define NON_SHORT_SLOT_TIME 20
#define RTL8711_RF_MAX_SENS 6
#define RTL8711_RF_DEF_SENS 4
#define RTL8711_RF_MAX_SENS 6
#define RTL8711_RF_DEF_SENS 4
/* We now define the following channels as the max channels in each
* channel plan. */
/* 2G, total 14 chnls */
/* {1,2,3,4,5,6,7,8,9,10,11,12,13,14} */
/* 5G, total 24 chnls */
/* {36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,
* 128,132,136,140,149,153,157,161,165} */
#define MAX_CHANNEL_NUM_2G 14
#define MAX_CHANNEL_NUM_5G 24
#define MAX_CHANNEL_NUM 38/* 14+24 */
#define MAX_CHANNEL_NUM 14 /* 2.4 GHz only */
/* define NUM_REGULATORYS 21 */
#define NUM_REGULATORYS 1
/* Country codes */

View file

@ -123,7 +123,7 @@ struct security_priv {
union Keytype dot118021XGrprxmickey[4];
union pn48 dot11Grptxpn; /* PN48 used for Grp Key xmit.*/
union pn48 dot11Grprxpn; /* PN48 used for Grp Key recv.*/
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
/* extend security capabilities for AP_MODE */
unsigned int dot8021xalg;/* 0:disable, 1:psk, 2:802.1x */
unsigned int wpa_psk;/* 0:disable, bit(0): WPA, bit(1):WPA2 */

View file

@ -366,7 +366,7 @@ void rtw_alloc_hwxmits(struct adapter *padapter);
void rtw_free_hwxmits(struct adapter *padapter);
s32 rtw_xmit(struct adapter *padapter, struct sk_buff **pkt);
#if defined(CONFIG_AP_MODE)
#if defined(CONFIG_88EU_AP_MODE)
int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_frame *pxmitframe);
void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta);
void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta);

View file

@ -139,9 +139,8 @@ struct sta_info {
/* curr_network(mlme_priv/security_priv/qos/ht) : AP CAP/INFO */
/* sta_info: (AP & STA) CAP/INFO */
#ifdef CONFIG_AP_MODE
struct list_head asoc_list;
#ifdef CONFIG_88EU_AP_MODE
struct list_head auth_list;
unsigned int expire_to;
@ -161,7 +160,6 @@ struct sta_info {
u8 bpairwise_key_installed;
#ifdef CONFIG_AP_MODE
u8 wpa_ie[32];
u8 nonerp_set;
@ -170,7 +168,6 @@ struct sta_info {
u8 no_ht_gf_set;
u8 no_ht_set;
u8 ht_20mhz_set;
#endif /* CONFIG_AP_MODE */
unsigned int tx_ra_bitmap;
u8 qos_info;
@ -183,8 +180,9 @@ struct sta_info {
u8 has_legacy_ac;
unsigned int sleepq_ac_len;
#endif /* CONFIG_88EU_AP_MODE */
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
/* p2p priv data */
u8 is_p2p_device;
u8 p2p_status_code;
@ -198,10 +196,9 @@ struct sta_info {
u8 secdev_types_list[32];/* 32/8 == 4; */
u16 dev_name_len;
u8 dev_name[32];
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
u8 under_exist_checking;
u8 keep_alive_trycnt;
#endif /* CONFIG_AP_MODE */
/* for DM */
struct rssi_sta rssi_stat;
@ -322,11 +319,11 @@ struct sta_priv {
struct adapter *padapter;
#ifdef CONFIG_AP_MODE
struct list_head asoc_list;
struct list_head auth_list;
spinlock_t asoc_list_lock;
struct list_head asoc_list;
#ifdef CONFIG_88EU_AP_MODE
struct list_head auth_list;
spinlock_t auth_list_lock;
u8 asoc_list_cnt;
u8 auth_list_cnt;

View file

@ -20,6 +20,7 @@
#ifndef __USB_OPS_H_
#define __USB_OPS_H_
#include <linux/version.h>
#include <osdep_service.h>
#include <drv_types.h>
#include <osdep_intf.h>

View file

@ -29,8 +29,6 @@
#define RTW_USB_BULKOUT_TIME 5000/* ms */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)) || \
(LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18))
#define _usbctrl_vendorreq_async_callback(urb, regs) \
_usbctrl_vendorreq_async_callback(urb)
#define usb_bulkout_zero_complete(purb, regs) \
@ -43,7 +41,6 @@
usb_read_port_complete(purb)
#define usb_read_interrupt_complete(purb, regs) \
usb_read_interrupt_complete(purb)
#endif
unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr);

View file

@ -610,26 +610,6 @@ 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
*
@ -694,9 +674,9 @@ struct WMM_para_element {
struct ADDBA_request {
unsigned char dialog_token;
unsigned short BA_para_set;
unsigned short BA_timeout_value;
unsigned short BA_starting_seqctrl;
__le16 BA_para_set;
__le16 BA_timeout_value;
__le16 BA_starting_seqctrl;
} __packed;
enum ht_cap_ampdu_factor {

File diff suppressed because it is too large Load diff

View file

@ -88,14 +88,14 @@ void rtw_reset_securitypriv(struct adapter *adapter)
/* Backup the btkip_countermeasure information. */
/* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
_rtw_memset(&backup_pmkid[0], 0x00, sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
_rtw_memcpy(&backup_pmkid[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
memcpy(&backup_pmkid[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
backup_index = adapter->securitypriv.PMKIDIndex;
backup_counter = adapter->securitypriv.btkip_countermeasure;
backup_time = adapter->securitypriv.btkip_countermeasure_time;
_rtw_memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
/* Restore the PMK information to securitypriv structure for the following connection. */
_rtw_memcpy(&adapter->securitypriv.PMKIDList[0],
memcpy(&adapter->securitypriv.PMKIDList[0],
&backup_pmkid[0],
sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
adapter->securitypriv.PMKIDIndex = backup_index;
@ -155,8 +155,7 @@ _func_enter_;
wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ?
wrqu.data.length : IW_CUSTOM_MAX;
wireless_send_event(adapter->pnetdev, IWEVCUSTOM, &wrqu, buff);
if (buff)
rtw_mfree(buff, IW_CUSTOM_MAX);
kfree(buff);
}
exit:
_func_exit_;
@ -194,7 +193,7 @@ void init_mlme_ext_timer(struct adapter *padapter)
_init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter);
}
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *psta)
{
@ -213,7 +212,7 @@ void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *pst
wrqu.addr.sa_family = ARPHRD_ETHER;
_rtw_memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
DBG_88E("+rtw_indicate_sta_assoc_event\n");
@ -237,7 +236,7 @@ void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info *
wrqu.addr.sa_family = ARPHRD_ETHER;
_rtw_memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
DBG_88E("+rtw_indicate_sta_disassoc_event\n");

View file

@ -35,6 +35,10 @@ 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, */
/* module param defaults */
static int rtw_chip_version = 0x00;
@ -93,14 +97,6 @@ static int rtw_rf_config = RF_819X_MAX_TYPE; /* auto */
static int rtw_low_power;
static int rtw_wifi_spec;
static int rtw_channel_plan = RT_CHANNEL_DOMAIN_MAX;
#ifdef CONFIG_BT_COEXIST
int rtw_btcoex_enable = 1;
int rtw_bt_iso = 2;/* 0:Low, 1:High, 2:From Efuse */
int rtw_bt_sco = 3;/* 0:Idle, 1:None-SCO, 2:SCO, 3:From Counter, 4.Busy, 5.OtherBusy */
int rtw_bt_ampdu = 1 ;/* 0:Disable BT control A-MPDU, 1:Enable BT control A-MPDU. */
#endif
static int rtw_AcceptAddbaReq = true;/* 0:Reject AP's Add BA req, 1:Accept AP's Add BA req. */
static int rtw_antdiv_cfg = 2; /* 0:OFF , 1:ON, 2:decide by Efuse config */
@ -171,25 +167,12 @@ module_param(rtw_mc2u_disable, int, 0644);
module_param(rtw_80211d, int, 0644);
MODULE_PARM_DESC(rtw_80211d, "Enable 802.11d mechanism");
#ifdef CONFIG_BT_COEXIST
module_param(rtw_btcoex_enable, int, 0644);
MODULE_PARM_DESC(rtw_btcoex_enable, "Enable BT co-existence mechanism");
#endif
static uint rtw_notch_filter = RTW_NOTCH_FILTER;
module_param(rtw_notch_filter, uint, 0644);
MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 1:Enable, 2:Enable only for P2P");
module_param_named(debug, rtw_debug, int, 0444);
MODULE_PARM_DESC(debug, "Set debug level (1-9) (default 1)");
static char rtw_proc_name[IFNAMSIZ];
static struct proc_dir_entry *rtw_proc;
static int rtw_proc_cnt;
#define RTW_PROC_NAME DRV_NAME
#ifndef create_proc_entry
/* dummy routines */
void rtw_proc_remove_one(struct net_device *dev)
{
@ -199,7 +182,7 @@ void rtw_proc_init_one(struct net_device *dev)
{
}
#else /* create_proc_entry not defined */
#if 0 /* TODO: Convert these to /sys */
void rtw_proc_init_one(struct net_device *dev)
{
struct proc_dir_entry *dir_dev = NULL;
@ -208,13 +191,9 @@ void rtw_proc_init_one(struct net_device *dev)
u8 rf_type;
if (rtw_proc == NULL) {
_rtw_memcpy(rtw_proc_name, RTW_PROC_NAME, sizeof(RTW_PROC_NAME));
memcpy(rtw_proc_name, DRV_NAME, sizeof(DRV_NAME));
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
rtw_proc = create_proc_entry(rtw_proc_name, S_IFDIR, proc_net);
#else
rtw_proc = create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net);
#endif
if (rtw_proc == NULL) {
DBG_88E(KERN_ERR "Unable to create rtw_proc directory\n");
return;
@ -235,11 +214,7 @@ void rtw_proc_init_one(struct net_device *dev)
if (dir_dev == NULL) {
if (rtw_proc_cnt == 0) {
if (rtw_proc) {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
remove_proc_entry(rtw_proc_name, proc_net);
#else
remove_proc_entry(rtw_proc_name, init_net.proc_net);
#endif
rtw_proc = NULL;
}
}
@ -406,7 +381,7 @@ void rtw_proc_init_one(struct net_device *dev)
}
}
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
entry = create_proc_read_entry("all_sta_info", S_IFREG | S_IRUGO,
dir_dev, proc_get_all_sta_info, dev);
@ -475,15 +450,6 @@ void rtw_proc_init_one(struct net_device *dev)
return;
}
entry->write_proc = proc_set_rssi_disp;
#ifdef CONFIG_BT_COEXIST
entry = create_proc_read_entry("btcoex_dbg", S_IFREG | S_IRUGO,
dir_dev, proc_get_btcoex_dbg, dev);
if (!entry) {
pr_info("Unable to create_proc_read_entry!\n");
return;
}
entry->write_proc = proc_set_btcoex_dbg;
#endif /*CONFIG_BT_COEXIST*/
}
void rtw_proc_remove_one(struct net_device *dev)
@ -520,7 +486,7 @@ void rtw_proc_remove_one(struct net_device *dev)
remove_proc_entry("rf_reg_dump3", dir_dev);
remove_proc_entry("rf_reg_dump4", dir_dev);
}
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
remove_proc_entry("all_sta_info", dir_dev);
#endif
@ -532,9 +498,6 @@ void rtw_proc_remove_one(struct net_device *dev)
remove_proc_entry("rx_stbc", dir_dev);
remove_proc_entry("path_rssi", dir_dev);
remove_proc_entry("rssi_disp", dir_dev);
#ifdef CONFIG_BT_COEXIST
remove_proc_entry("btcoex_dbg", dir_dev);
#endif /* CONFIG_BT_COEXIST */
remove_proc_entry(dev->name, rtw_proc);
dir_dev = NULL;
} else {
@ -546,11 +509,7 @@ void rtw_proc_remove_one(struct net_device *dev)
if (rtw_proc) {
remove_proc_entry("ver_info", rtw_proc);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
remove_proc_entry(rtw_proc_name, proc_net);
#else
remove_proc_entry(rtw_proc_name, init_net.proc_net);
#endif
rtw_proc = NULL;
}
}
@ -570,7 +529,7 @@ _func_enter_;
registry_par->lbkmode = (u8)rtw_lbkmode;
registry_par->network_mode = (u8)rtw_network_mode;
_rtw_memcpy(registry_par->ssid.Ssid, "ANY", 3);
memcpy(registry_par->ssid.Ssid, "ANY", 3);
registry_par->ssid.SsidLength = 3;
registry_par->channel = (u8)rtw_channel;
@ -615,12 +574,6 @@ _func_enter_;
registry_par->low_power = (u8)rtw_low_power;
registry_par->wifi_spec = (u8)rtw_wifi_spec;
registry_par->channel_plan = (u8)rtw_channel_plan;
#ifdef CONFIG_BT_COEXIST
registry_par->btcoex = (u8)rtw_btcoex_enable;
registry_par->bt_iso = (u8)rtw_bt_iso;
registry_par->bt_sco = (u8)rtw_bt_sco;
registry_par->bt_ampdu = (u8)rtw_bt_ampdu;
#endif
registry_par->bAcceptAddbaReq = (u8)rtw_AcceptAddbaReq;
registry_par->antdiv_cfg = (u8)rtw_antdiv_cfg;
registry_par->antdiv_type = (u8)rtw_antdiv_type;
@ -646,7 +599,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
struct sockaddr *addr = p;
if (!padapter->bup)
_rtw_memcpy(padapter->eeprompriv.mac_addr, addr->sa_data, ETH_ALEN);
memcpy(padapter->eeprompriv.mac_addr, addr->sa_data, ETH_ALEN);
return 0;
}
@ -666,7 +619,6 @@ static struct net_device_stats *rtw_net_get_stats(struct net_device *pnetdev)
return &padapter->stats;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
/*
* AC to queue mapping
*
@ -722,7 +674,7 @@ u16 rtw_recv_select_queue(struct sk_buff *skb)
u32 priority;
u8 *pdata = skb->data;
_rtw_memcpy(&eth_type, pdata+(ETH_ALEN<<1), 2);
memcpy(&eth_type, pdata+(ETH_ALEN<<1), 2);
switch (eth_type) {
case htons(ETH_P_IP):
@ -737,26 +689,18 @@ u16 rtw_recv_select_queue(struct sk_buff *skb)
return rtw_1d_to_queue[priority];
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29))
static const struct net_device_ops rtw_netdev_ops = {
.ndo_open = netdev_open,
.ndo_stop = netdev_close,
.ndo_start_xmit = rtw_xmit_entry,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
.ndo_select_queue = rtw_select_queue,
#endif
.ndo_set_mac_address = rtw_net_set_mac_address,
.ndo_get_stats = rtw_net_get_stats,
.ndo_do_ioctl = rtw_ioctl,
};
#endif
int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
{
struct adapter *padapter = rtw_netdev_priv(pnetdev);
if (dev_alloc_name(pnetdev, ifname) < 0)
RT_TRACE(_module_os_intfs_c_, _drv_err_, ("dev_alloc_name, fail!\n"));
@ -786,26 +730,10 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
pnetdev->dev.type = &wlan_type;
padapter = rtw_netdev_priv(pnetdev);
padapter->pnetdev = pnetdev;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
SET_MODULE_OWNER(pnetdev);
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29))
DBG_88E("register rtw_netdev_ops to netdev_ops\n");
pnetdev->netdev_ops = &rtw_netdev_ops;
#else
pnetdev->open = netdev_open;
pnetdev->stop = netdev_close;
pnetdev->hard_start_xmit = rtw_xmit_entry;
pnetdev->set_mac_address = rtw_net_set_mac_address;
pnetdev->get_stats = rtw_net_get_stats;
pnetdev->do_ioctl = rtw_ioctl;
#endif
pnetdev->watchdog_timeo = HZ*3; /* 3 second timeout */
#ifdef CONFIG_WIRELESS_EXT
pnetdev->wireless_handlers = (struct iw_handler_def *)&rtw_handlers_def;
#endif
/* step 2. */
loadparam(padapter, pnetdev);
@ -886,7 +814,7 @@ static u8 rtw_init_default_value(struct adapter *padapter)
padapter->bWritePortCancel = false;
padapter->bRxRSSIDisplay = 0;
padapter->bNotifyChannelChange = 0;
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
padapter->bShowGetP2PState = 1;
#endif
return ret;
@ -951,11 +879,11 @@ _func_enter_;
goto exit;
}
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
rtw_init_wifidirect_timers(padapter);
init_wifidirect_info(padapter, P2P_ROLE_DISABLE);
reset_global_wifidirect_info(padapter);
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
if (init_mlme_ext_priv(padapter) == _FAIL) {
RT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't init mlme_ext_priv\n"));
@ -1007,14 +935,6 @@ exit:
return ret8;
}
#ifdef CONFIG_WOWLAN
void rtw_cancel_dynamic_chk_timer(struct adapter *padapter)
{
_cancel_timer_ex(&padapter->mlmepriv.dynamic_chk_timer);
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("rtw_cancel_all_timer:cancel dynamic_chk_timer!\n"));
}
#endif
void rtw_cancel_all_timer(struct adapter *padapter)
{
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+rtw_cancel_all_timer\n"));
@ -1041,14 +961,12 @@ void rtw_cancel_all_timer(struct adapter *padapter)
u8 rtw_free_drv_sw(struct adapter *padapter)
{
struct net_device *pnetdev = (struct net_device *)padapter->pnetdev;
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("==>rtw_free_drv_sw"));
/* we can call rtw_p2p_enable here, but: */
/* 1. rtw_p2p_enable may have IO operation */
/* 2. rtw_p2p_enable is bundled with wext interface */
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
{
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
@ -1101,45 +1019,25 @@ void netdev_br_init(struct net_device *netdev)
{
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(netdev);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
rcu_read_lock();
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
{
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
if (netdev->br_port)
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
if (rcu_dereference(adapter->pnetdev->rx_handler_data))
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
{
struct net_device *br_netdev;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
br_netdev = dev_get_by_name(CONFIG_BR_EXT_BRNAME);
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) */
struct net *devnet = NULL;
if (rcu_dereference(adapter->pnetdev->rx_handler_data)) {
struct net_device *br_netdev;
struct net *devnet = NULL;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26))
devnet = netdev->nd_net;
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)) */
devnet = dev_net(netdev);
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)) */
br_netdev = dev_get_by_name(devnet, CONFIG_BR_EXT_BRNAME);
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) */
if (br_netdev) {
memcpy(adapter->br_mac, br_netdev->dev_addr, ETH_ALEN);
dev_put(br_netdev);
} else {
pr_info("%s()-%d: dev_get_by_name(%s) failed!", __func__, __LINE__, CONFIG_BR_EXT_BRNAME);
}
devnet = dev_net(netdev);
br_netdev = dev_get_by_name(devnet, CONFIG_BR_EXT_BRNAME);
if (br_netdev) {
memcpy(adapter->br_mac, br_netdev->dev_addr, ETH_ALEN);
dev_put(br_netdev);
} else {
pr_info("%s()-%d: dev_get_by_name(%s) failed!",
__func__, __LINE__, CONFIG_BR_EXT_BRNAME);
}
adapter->ethBrExtInfo.addPPPoETag = 1;
}
adapter->ethBrExtInfo.addPPPoETag = 1;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
rcu_read_unlock();
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
}
int _netdev_open(struct net_device *pnetdev)
@ -1167,7 +1065,7 @@ int _netdev_open(struct net_device *pnetdev)
goto netdev_open_error;
}
pr_info("MAC Address = %pM\n", pnetdev->dev_addr);
pr_info("%sMAC Address = %pM\n", DRIVER_PREFIX, pnetdev->dev_addr);
status = rtw_start_drv_threads(padapter);
if (status == _FAIL) {
@ -1289,8 +1187,6 @@ void rtw_ips_pwr_down(struct adapter *padapter)
void rtw_ips_dev_unload(struct adapter *padapter)
{
struct net_device *pnetdev = (struct net_device *)padapter->pnetdev;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
DBG_88E("====> %s...\n", __func__);
rtw_hal_set_hwreg(padapter, HW_VAR_FIFO_CLEARN_UP, NULL);
@ -1314,7 +1210,7 @@ int pm_netdev_open(struct net_device *pnetdev, u8 bnormal)
return status;
}
static int netdev_close(struct net_device *pnetdev)
int netdev_close(struct net_device *pnetdev)
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
@ -1351,9 +1247,9 @@ static int netdev_close(struct net_device *pnetdev)
nat25_db_cleanup(padapter);
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
rtw_p2p_enable(padapter, P2P_ROLE_DISABLE);
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-88eu_drv - drv_close\n"));
DBG_88E("-88eu_drv - drv_close, bup =%d\n", padapter->bup);

View file

@ -93,11 +93,6 @@ u8 *_rtw_zmalloc(u32 sz)
return pbuf;
}
void _rtw_mfree(u8 *pbuf, u32 sz)
{
kfree(pbuf);
}
void *rtw_malloc2d(int h, int w, int size)
{
int j;
@ -116,12 +111,7 @@ void *rtw_malloc2d(int h, int w, int size)
void rtw_mfree2d(void *pbuf, int h, int w, int size)
{
rtw_mfree((u8 *)pbuf, h*sizeof(void *) + w*h*size);
}
void _rtw_memcpy(void *dst, void *src, u32 sz)
{
memcpy(dst, src, sz);
kfree(pbuf);
}
int _rtw_memcmp(void *dst, void *src, u32 sz)
@ -195,18 +185,12 @@ u32 _rtw_down_sema(struct semaphore *sema)
void _rtw_mutex_init(struct mutex *pmutex)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
mutex_init(pmutex);
#else
init_MUTEX(pmutex);
#endif
}
void _rtw_mutex_free(struct mutex *pmutex)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
mutex_destroy(pmutex);
#endif
}
void _rtw_spinlock_init(spinlock_t *plock)
@ -322,12 +306,6 @@ inline void rtw_unlock_suspend(void)
{
}
#ifdef CONFIG_WOWLAN
inline void rtw_lock_suspend_timeout(long timeout)
{
}
#endif /* CONFIG_WOWLAN */
inline void ATOMIC_SET(ATOMIC_T *v, int i)
{
atomic_set(v, i);
@ -592,12 +570,7 @@ struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv,
struct net_device *pnetdev;
struct rtw_netdev_priv_indicator *pnpi;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator),
4);
#else
pnetdev = alloc_etherdev(sizeof(struct rtw_netdev_priv_indicator));
#endif
pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4);
if (!pnetdev)
goto RETURN;
@ -614,12 +587,7 @@ struct net_device *rtw_alloc_etherdev(int sizeof_priv)
struct net_device *pnetdev;
struct rtw_netdev_priv_indicator *pnpi;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator),
4);
#else
pnetdev = alloc_etherdev(sizeof(struct rtw_netdev_priv_indicator));
#endif
pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4);
if (!pnetdev)
goto RETURN;
@ -656,20 +624,15 @@ RETURN:
return;
}
/*
* this function should be called under ioctl (rtnl_lock is accquired) while
* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
*/
int rtw_change_ifname(struct adapter *padapter, const char *ifname)
{
struct net_device *pnetdev;
struct net_device *cur_pnetdev;
struct net_device *cur_pnetdev = padapter->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;
@ -679,11 +642,9 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
rereg_priv->old_pnetdev = NULL;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
if (!rtnl_is_locked())
unregister_netdev(cur_pnetdev);
else
#endif
unregister_netdevice(cur_pnetdev);
rtw_proc_remove_one(cur_pnetdev);
@ -700,13 +661,11 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
rtw_init_netdev_name(pnetdev, ifname);
_rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
if (!rtnl_is_locked())
ret = register_netdev(pnetdev);
else
#endif
ret = register_netdevice(pnetdev);
if (ret != 0) {
RT_TRACE(_module_hci_intfs_c_, _drv_err_,
@ -732,14 +691,9 @@ u64 rtw_division64(u64 x, u64 y)
void rtw_buf_free(u8 **buf, u32 *buf_len)
{
if (!buf || !buf_len)
return;
if (*buf) {
*buf_len = 0;
_rtw_mfree(*buf, *buf_len);
*buf = NULL;
}
*buf_len = 0;
kfree(*buf);
*buf = NULL;
}
void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len)
@ -758,7 +712,7 @@ void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len)
dup = rtw_malloc(src_len);
if (dup) {
dup_len = src_len;
_rtw_memcpy(dup, src, dup_len);
memcpy(dup, src, dup_len);
}
keep_ori:
@ -771,8 +725,7 @@ keep_ori:
*buf_len = dup_len;
/* free ori */
if (ori && ori_len > 0)
_rtw_mfree(ori, ori_len);
kfree(ori);
}
@ -860,12 +813,3 @@ struct rtw_cbuf *rtw_cbuf_alloc(u32 size)
}
return cbuf;
}
/**
* rtw_cbuf_free - free the given rtw_cbuf
* @cbuf: pointer of struct rtw_cbuf to free
*/
void rtw_cbuf_free(struct rtw_cbuf *cbuf)
{
rtw_mfree((u8 *)cbuf, sizeof(*cbuf) + sizeof(void *)*cbuf->size);
}

View file

@ -55,8 +55,6 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter,
struct recv_buf *precvbuf)
{
int res = _SUCCESS;
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
struct usb_device *pusbd = pdvobjpriv->pusbdev;
precvbuf->irp_pending = false;
precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
@ -113,7 +111,7 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
ev.flags |= IW_MICFAILURE_PAIRWISE;
ev.src_addr.sa_family = ARPHRD_ETHER;
_rtw_memcpy(ev.src_addr.sa_data, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
memcpy(ev.src_addr.sa_data, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
_rtw_memset(&wrqu, 0x00, sizeof(wrqu));
wrqu.data.length = sizeof(ev);
wireless_send_event(padapter->pnetdev, IWEVMICHAELMICFAILURE,
@ -132,7 +130,6 @@ int rtw_recv_indicatepkt(struct adapter *padapter,
struct __queue *pfree_recv_queue;
struct sk_buff *skb;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
void *br_port = NULL;
_func_enter_;
@ -188,9 +185,7 @@ _func_enter_;
pnetdev = (struct net_device *)padapter->pnetdev;
skb->dev = pnetdev;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
skb_set_queue_mapping(skb, rtw_recv_select_queue(skb));
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) */
rtw_xmit_entry(skb, pnetdev);
@ -202,13 +197,9 @@ _func_enter_;
}
}
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
br_port = padapter->pnetdev->br_port;
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
rcu_read_lock();
br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
rcu_dereference(padapter->pnetdev->rx_handler_data);
rcu_read_unlock();
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
skb->ip_summed = CHECKSUM_NONE;
skb->dev = padapter->pnetdev;
@ -232,8 +223,9 @@ _func_exit_;
_recv_indicatepkt_drop:
/* enqueue back to free_recv_queue */
rtw_free_recvframe(precv_frame, pfree_recv_queue);
/* enqueue back to free_recv_queue */
if (precv_frame)
rtw_free_recvframe(precv_frame, pfree_recv_queue);
_func_exit_;
return _FAIL;
@ -253,7 +245,7 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf)
(unsigned char *)precvbuf);
}
void _rtw_reordering_ctrl_timeout_handler(void *func_context)
static void _rtw_reordering_ctrl_timeout_handler(void *func_context)
{
struct recv_reorder_ctrl *preorder_ctrl;

View file

@ -107,12 +107,10 @@ static int rtw_android_get_link_speed(struct net_device *net, char *command,
int total_len)
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(net);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
int bytes_written = 0;
u16 link_speed = 0;
int bytes_written;
u16 link_speed;
link_speed = rtw_get_cur_max_rate(padapter)/10;
link_speed = rtw_get_cur_max_rate(padapter) / 10;
bytes_written = snprintf(command, total_len, "LinkSpeed %d",
link_speed);
return bytes_written;
@ -121,8 +119,7 @@ static int rtw_android_get_link_speed(struct net_device *net, char *command,
static int rtw_android_get_macaddr(struct net_device *net, char *command,
int total_len)
{
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(net);
int bytes_written = 0;
int bytes_written;
bytes_written = snprintf(command, total_len, "Macaddr = %pM",
net->dev_addr);
@ -143,39 +140,17 @@ static int android_set_cntry(struct net_device *net, char *command,
static int android_get_p2p_addr(struct net_device *net, char *command,
int total_len)
{
int ret;
int bytes_written = 0;
/* We use the same address as our HW MAC address */
_rtw_memcpy(command, net->dev_addr, ETH_ALEN);
bytes_written = ETH_ALEN;
return bytes_written;
memcpy(command, net->dev_addr, ETH_ALEN);
return ETH_ALEN;
}
static int rtw_android_set_block(struct net_device *net, char *command,
int total_len)
{
int ret;
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(net);
char *block_value = command + strlen(android_wifi_cmd_str[ANDROID_WIFI_CMD_BLOCK]) + 1;
return 0;
}
static int get_int_from_command(char *pcmd)
{
int i;
for (i = 0; i < strlen(pcmd); i++) {
if (pcmd[i] == '=') {
/* Skip the '=' and space characters. */
i += 2;
break;
}
}
return rtw_atoi(pcmd + i);
}
int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
{
int ret = 0;

View file

@ -43,61 +43,8 @@ static int rtw_resume(struct usb_interface *intf);
static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device_id *pdid);
static void rtw_dev_remove(struct usb_interface *pusb_intf);
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23))
/* Some useful macros to use to create struct usb_device_id */
#define USB_DEVICE_ID_MATCH_VENDOR 0x0001
#define USB_DEVICE_ID_MATCH_PRODUCT 0x0002
#define USB_DEVICE_ID_MATCH_DEV_LO 0x0004
#define USB_DEVICE_ID_MATCH_DEV_HI 0x0008
#define USB_DEVICE_ID_MATCH_DEV_CLASS 0x0010
#define USB_DEVICE_ID_MATCH_DEV_SUBCLASS 0x0020
#define USB_DEVICE_ID_MATCH_DEV_PROTOCOL 0x0040
#define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080
#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
#define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400
#define USB_DEVICE_ID_MATCH_INT_INFO \
(USB_DEVICE_ID_MATCH_INT_CLASS | \
USB_DEVICE_ID_MATCH_INT_SUBCLASS | \
USB_DEVICE_ID_MATCH_INT_PROTOCOL)
#define USB_DEVICE_AND_INTERFACE_INFO(vend, prod, cl, sc, pr) \
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
| USB_DEVICE_ID_MATCH_DEVICE, \
.idVendor = (vend), \
.idProduct = (prod), \
.bInterfaceClass = (cl), \
.bInterfaceSubClass = (sc), \
.bInterfaceProtocol = (pr)
/**
* USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces
* @vend: the 16 bit USB Vendor ID
* @cl: bInterfaceClass value
* @sc: bInterfaceSubClass value
* @pr: bInterfaceProtocol value
*
* This macro is used to create a struct usb_device_id that matches a
* specific vendor with a specific class of interfaces.
*
* This is especially useful when explicitly matching devices that have
* vendor specific bDeviceClass values, but standards-compliant interfaces.
*/
#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
| USB_DEVICE_ID_MATCH_VENDOR, \
.idVendor = (vend), \
.bInterfaceClass = (cl), \
.bInterfaceSubClass = (sc), \
.bInterfaceProtocol = (pr)
/* ----------------------------------------------------------------------- */
#endif
#define USB_VENDER_ID_REALTEK 0x0BDA
#define USB_VENDER_ID_REALTEK 0x0bda
/* DID_USB_v916_20130116 */
static struct usb_device_id rtw_usb_id_tbl[] = {
@ -124,15 +71,13 @@ struct rtw_usb_drv {
};
static struct rtw_usb_drv rtl8188e_usb_drv = {
.usbdrv.name = (char *)"rtl8188eu",
.usbdrv.name = (char *)"r8188eu",
.usbdrv.probe = rtw_drv_init,
.usbdrv.disconnect = rtw_dev_remove,
.usbdrv.id_table = rtw_usb_id_tbl,
.usbdrv.suspend = rtw_suspend,
.usbdrv.resume = rtw_resume,
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
.usbdrv.reset_resume = rtw_resume,
#endif
};
static struct rtw_usb_drv *usb_drv = &rtl8188e_usb_drv;
@ -198,8 +143,7 @@ static u8 rtw_deinit_intf_priv(struct dvobj_priv *dvobj)
{
u8 rst = _SUCCESS;
if (dvobj->usb_vendor_req_buf)
rtw_mfree(dvobj->usb_alloc_vendor_req_buf, MAX_USB_IO_CTL_SIZE);
kfree(dvobj->usb_alloc_vendor_req_buf);
_rtw_mutex_free(&dvobj->usb_vendor_req_mutex);
return rst;
}
@ -207,7 +151,6 @@ static u8 rtw_deinit_intf_priv(struct dvobj_priv *dvobj)
static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
{
int i;
u8 val8;
int status = _FAIL;
struct dvobj_priv *pdvobjpriv;
struct usb_host_config *phost_conf;
@ -307,7 +250,7 @@ _func_enter_;
free_dvobj:
if (status != _SUCCESS && pdvobjpriv) {
usb_set_intfdata(usb_intf, NULL);
rtw_mfree((u8 *)pdvobjpriv, sizeof(*pdvobjpriv));
kfree(pdvobjpriv);
pdvobjpriv = NULL;
}
exit:
@ -339,7 +282,7 @@ _func_enter_;
}
}
rtw_deinit_intf_priv(dvobj);
rtw_mfree((u8 *)dvobj, sizeof(*dvobj));
kfree(dvobj);
}
usb_put_dev(interface_to_usbdev(usb_intf));
@ -388,8 +331,6 @@ static void usb_intf_stop(struct adapter *padapter)
static void rtw_dev_unload(struct adapter *padapter)
{
struct net_device *pnetdev = (struct net_device *)padapter->pnetdev;
u8 val8;
RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+rtw_dev_unload\n"));
if (padapter->bup) {
@ -406,21 +347,11 @@ static void rtw_dev_unload(struct adapter *padapter)
/* s5. */
if (!padapter->bSurpriseRemoved) {
#ifdef CONFIG_WOWLAN
if ((padapter->pwrctrlpriv.bSupportRemoteWakeup) &&
(padapter->pwrctrlpriv.wowlan_mode))
DBG_88E("%s bSupportWakeOnWlan == true do not run rtw_hal_deinit()\n",
__func__);
else
#endif /* CONFIG_WOWLAN */
rtw_hal_deinit(padapter);
rtw_hal_deinit(padapter);
padapter->bSurpriseRemoved = true;
}
padapter->bup = false;
#ifdef CONFIG_WOWLAN
padapter->hw_init_completed = false;
#endif /* CONFIG_WOWLAN */
} else {
RT_TRACE(_module_hci_intfs_c_, _drv_err_,
("r871x_dev_unload():padapter->bup == false\n"));
@ -456,7 +387,6 @@ static void process_spec_devid(const struct usb_device_id *pdid)
int rtw_hw_suspend(struct adapter *padapter)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
struct net_device *pnetdev = padapter->pnetdev;
_func_enter_;
@ -523,7 +453,6 @@ error_exit:
int rtw_hw_resume(struct adapter *padapter)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
struct net_device *pnetdev = padapter->pnetdev;
_func_enter_;
@ -573,10 +502,6 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
struct net_device *pnetdev = padapter->pnetdev;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct usb_device *usb_dev = interface_to_usbdev(pusb_intf);
#ifdef CONFIG_WOWLAN
struct wowlan_ioctl_param poidparam;
#endif /* CONFIG_WOWLAN */
int ret = 0;
u32 start_time = rtw_get_current_time();
@ -585,13 +510,6 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid);
#ifdef CONFIG_WOWLAN
if (check_fwstate(pmlmepriv, _FW_LINKED))
padapter->pwrctrlpriv.wowlan_mode = true;
else
padapter->pwrctrlpriv.wowlan_mode = false;
#endif
if ((!padapter->bup) || (padapter->bDriverStopped) ||
(padapter->bSurpriseRemoved)) {
DBG_88E("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
@ -611,20 +529,8 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
rtw_netif_stop_queue(pnetdev);
}
#ifdef CONFIG_WOWLAN
if (padapter->pwrctrlpriv.bSupportRemoteWakeup &&
padapter->pwrctrlpriv.wowlan_mode) {
/* set H2C command */
poidparam.subcode = WOWLAN_ENABLE;
padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_WOWLAN,
(u8 *)&poidparam);
} else
#else
{
/* s2. */
rtw_disassoc_cmd(padapter, 0, false);
}
#endif /* CONFIG_WOWLAN */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
check_fwstate(pmlmepriv, _FW_LINKED)) {
@ -665,7 +571,6 @@ static int rtw_resume(struct usb_interface *pusb_intf)
{
struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
struct adapter *padapter = dvobj->if1;
struct net_device *pnetdev = padapter->pnetdev;
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
int ret = 0;
@ -679,12 +584,9 @@ static int rtw_resume(struct usb_interface *pusb_intf)
int rtw_resume_process(struct adapter *padapter)
{
struct net_device *pnetdev;
struct pwrctrl_priv *pwrpriv;
struct pwrctrl_priv *pwrpriv = NULL;
int ret = -1;
u32 start_time = rtw_get_current_time();
#ifdef CONFIG_BT_COEXIST
u8 pm_cnt;
#endif /* ifdef CONFIG_BT_COEXIST */
_func_enter_;
DBG_88E("==> %s (%s:%d)\n", __func__, current->comm, current->pid);
@ -698,7 +600,8 @@ int rtw_resume_process(struct adapter *padapter)
_enter_pwrlock(&pwrpriv->lock);
rtw_reset_drv_sw(padapter);
pwrpriv->bkeepfwalive = false;
if (pwrpriv)
pwrpriv->bkeepfwalive = false;
DBG_88E("bkeepfwalive(%x)\n", pwrpriv->bkeepfwalive);
if (pm_netdev_open(pnetdev, true) != 0)
@ -720,10 +623,11 @@ int rtw_resume_process(struct adapter *padapter)
exit:
if (pwrpriv)
pwrpriv->bInSuspend = false;
DBG_88E("<=== %s return %d.............. in %dms\n", __func__
, ret, rtw_get_passing_time_ms(start_time));
DBG_88E("<=== %s return %d.............. in %dms\n", __func__,
ret, rtw_get_passing_time_ms(start_time));
_func_exit_;
return ret;
}
@ -735,8 +639,6 @@ exit:
* We accept the new device by returning 0.
*/
static struct adapter *rtw_sw_export;
static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
struct usb_interface *pusb_intf, const struct usb_device_id *pdid)
{
@ -793,33 +695,29 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
}
#ifdef CONFIG_PM
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18))
if (padapter->pwrctrlpriv.bSupportRemoteWakeup) {
dvobj->pusbdev->do_remote_wakeup = 1;
pusb_intf->needs_remote_wakeup = 1;
device_init_wakeup(&pusb_intf->dev, 1);
DBG_88E("\n padapter->pwrctrlpriv.bSupportRemoteWakeup~~~~~~\n");
DBG_88E("\n padapter->pwrctrlpriv.bSupportRemoteWakeup~~~[%d]~~~\n", device_may_wakeup(&pusb_intf->dev));
DBG_88E("\n padapter->pwrctrlpriv.bSupportRemoteWakeup~~~[%d]~~~\n",
device_may_wakeup(&pusb_intf->dev));
}
#endif
#endif
/* 2012-07-11 Move here to prevent the 8723AS-VAU BT auto
* suspend influence */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33))
if (usb_autopm_get_interface(pusb_intf) < 0)
DBG_88E("can't get autopm:\n");
#endif
#ifdef CONFIG_BT_COEXIST
padapter->pwrctrlpriv.autopm_cnt = 1;
#endif
/* alloc dev name after read efuse. */
rtw_init_netdev_name(pnetdev, padapter->registrypriv.ifname);
rtw_macaddr_cfg(padapter->eeprompriv.mac_addr);
#ifdef CONFIG_88EU_P2P
rtw_init_wifidirect_addrs(padapter, padapter->eeprompriv.mac_addr,
padapter->eeprompriv.mac_addr);
_rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
#endif
memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
DBG_88E("MAC Address from pnetdev->dev_addr = %pM\n",
pnetdev->dev_addr);
@ -841,7 +739,6 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
free_hal_data:
if (status != _SUCCESS && padapter->HalData)
kfree(padapter->HalData);
free_wdev:
handle_dualmac:
if (status != _SUCCESS)
rtw_handle_dualmac(padapter, 0);
@ -865,7 +762,7 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
if (check_fwstate(pmlmepriv, _FW_LINKED))
rtw_disassoc_cmd(if1, 0, false);
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
free_mlme_ap_info(if1);
#endif
@ -878,141 +775,18 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
}
rtw_cancel_all_timer(if1);
#ifdef CONFIG_WOWLAN
if1->pwrctrlpriv.wowlan_mode = false;
#endif /* CONFIG_WOWLAN */
rtw_dev_unload(if1);
DBG_88E("+r871xu_dev_remove, hw_init_completed=%d\n",
if1->hw_init_completed);
rtw_handle_dualmac(if1, 0);
#ifdef CONFIG_BT_COEXIST
if (1 == if1->pwrctrlpriv.autopm_cnt) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33))
usb_autopm_put_interface(adapter_to_dvobj(if1)->pusbintf);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20))
usb_autopm_enable(adapter_to_dvobj(if1)->pusbintf);
#else
usb_autosuspend_device(adapter_to_dvobj(if1)->pusbdev, 1);
#endif
if1->pwrctrlpriv.autopm_cnt--;
}
#endif
rtw_free_drv_sw(if1);
if (pnetdev)
rtw_free_netdev(pnetdev);
}
static void dump_usb_interface(struct usb_interface *usb_intf)
{
int i;
u8 val8;
struct usb_device *udev = interface_to_usbdev(usb_intf);
struct usb_device_descriptor *dev_desc = &udev->descriptor;
struct usb_host_config *act_conf = udev->actconfig;
struct usb_config_descriptor *act_conf_desc = &act_conf->desc;
struct usb_host_interface *host_iface;
struct usb_interface_descriptor *iface_desc;
struct usb_host_endpoint *host_endp;
struct usb_endpoint_descriptor *endp_desc;
/* The usb device this usb interface belongs to */
DBG_88E("usb_interface:%p, usb_device:%p(num:%d, path:%s), usb_device_descriptor:%p\n",
usb_intf, udev, udev->devnum, udev->devpath, dev_desc);
DBG_88E("bLength:%u\n", dev_desc->bLength);
DBG_88E("bDescriptorType:0x%02x\n", dev_desc->bDescriptorType);
DBG_88E("bcdUSB:0x%04x\n", le16_to_cpu(dev_desc->bcdUSB));
DBG_88E("bDeviceClass:0x%02x\n", dev_desc->bDeviceClass);
DBG_88E("bDeviceSubClass:0x%02x\n", dev_desc->bDeviceSubClass);
DBG_88E("bDeviceProtocol:0x%02x\n", dev_desc->bDeviceProtocol);
DBG_88E("bMaxPacketSize0:%u\n", dev_desc->bMaxPacketSize0);
DBG_88E("idVendor:0x%04x\n", le16_to_cpu(dev_desc->idVendor));
DBG_88E("idProduct:0x%04x\n", le16_to_cpu(dev_desc->idProduct));
DBG_88E("bcdDevice:0x%04x\n", le16_to_cpu(dev_desc->bcdDevice));
DBG_88E("iManufacturer:0x02%x\n", dev_desc->iManufacturer);
DBG_88E("iProduct:0x%02x\n", dev_desc->iProduct);
DBG_88E("iSerialNumber:0x%02x\n", dev_desc->iSerialNumber);
DBG_88E("bNumConfigurations:%u\n", dev_desc->bNumConfigurations);
/* The acting usb_config_descriptor */
DBG_88E("\nact_conf_desc:%p\n", act_conf_desc);
DBG_88E("bLength:%u\n", act_conf_desc->bLength);
DBG_88E("bDescriptorType:0x%02x\n", act_conf_desc->bDescriptorType);
DBG_88E("wTotalLength:%u\n", le16_to_cpu(act_conf_desc->wTotalLength));
DBG_88E("bNumInterfaces:%u\n", act_conf_desc->bNumInterfaces);
DBG_88E("bConfigurationValue:0x%02x\n",
act_conf_desc->bConfigurationValue);
DBG_88E("iConfiguration:0x%02x\n", act_conf_desc->iConfiguration);
DBG_88E("bmAttributes:0x%02x\n", act_conf_desc->bmAttributes);
DBG_88E("bMaxPower=%u\n", act_conf_desc->bMaxPower);
DBG_88E("****** num of altsetting = (%d) ******/\n",
usb_intf->num_altsetting);
/* Get he host side alternate settingi
* (the current alternate setting) for this interface*/
host_iface = usb_intf->cur_altsetting;
iface_desc = &host_iface->desc;
/* The current alternate setting*/
DBG_88E("\nusb_interface_descriptor:%p:\n", iface_desc);
DBG_88E("bLength:%u\n", iface_desc->bLength);
DBG_88E("bDescriptorType:0x%02x\n", iface_desc->bDescriptorType);
DBG_88E("bInterfaceNumber:0x%02x\n", iface_desc->bInterfaceNumber);
DBG_88E("bAlternateSetting=%x\n", iface_desc->bAlternateSetting);
DBG_88E("bNumEndpoints=%x\n", iface_desc->bNumEndpoints);
DBG_88E("bInterfaceClass=%x\n", iface_desc->bInterfaceClass);
DBG_88E("bInterfaceSubClass=%x\n", iface_desc->bInterfaceSubClass);
DBG_88E("bInterfaceProtocol=%x\n", iface_desc->bInterfaceProtocol);
DBG_88E("iInterface=%x\n", iface_desc->iInterface);
for (i = 0; i < iface_desc->bNumEndpoints; i++) {
host_endp = host_iface->endpoint + i;
if (host_endp) {
endp_desc = &host_endp->desc;
DBG_88E("\nusb_endpoint_descriptor(%d):\n", i);
DBG_88E("bLength=%x\n", endp_desc->bLength);
DBG_88E("bDescriptorType=%x\n",
endp_desc->bDescriptorType);
DBG_88E("bEndpointAddress=%x\n",
endp_desc->bEndpointAddress);
DBG_88E("bmAttributes=%x\n",
endp_desc->bmAttributes);
DBG_88E("wMaxPacketSize=%x\n",
endp_desc->wMaxPacketSize);
DBG_88E("wMaxPacketSize=%x\n",
le16_to_cpu(endp_desc->wMaxPacketSize));
DBG_88E("bInterval=%x\n", endp_desc->bInterval);
if (RT_usb_endpoint_is_bulk_in(endp_desc))
DBG_88E("RT_usb_endpoint_is_bulk_in = %x\n",
RT_usb_endpoint_num(endp_desc));
else if (usb_endpoint_is_int(endp_desc))
DBG_88E("usb_endpoint_is_int = %x, Interval = %x\n",
RT_usb_endpoint_num(endp_desc),
endp_desc->bInterval);
else if (RT_usb_endpoint_is_bulk_out(endp_desc))
DBG_88E("RT_usb_endpoint_is_bulk_out = %x\n",
RT_usb_endpoint_num(endp_desc));
}
}
if (udev->speed == USB_SPEED_HIGH)
DBG_88E("USB_SPEED_HIGH\n");
else
DBG_88E("NON USB_SPEED_HIGH\n");
}
static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device_id *pdid)
{
int i;
struct adapter *if1 = NULL, *if2 = NULL;
struct adapter *if1 = NULL;
int status;
struct dvobj_priv *dvobj;
@ -1044,7 +818,6 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
status = _SUCCESS;
free_if1:
if (status != _SUCCESS && if1)
rtw_usb_if1_deinit(if1);
free_dvobj:
@ -1062,8 +835,6 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf)
{
struct dvobj_priv *dvobj = usb_get_intfdata(pusb_intf);
struct adapter *padapter = dvobj->if1;
struct net_device *pnetdev = padapter->pnetdev;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_func_enter_;

View file

@ -46,65 +46,6 @@ struct zero_bulkout_context {
void *padapter;
};
static void usb_bulkout_zero_complete(struct urb *purb, struct pt_regs *regs)
{
struct zero_bulkout_context *pcontext = (struct zero_bulkout_context *)purb->context;
if (pcontext) {
if (pcontext->pbuf)
rtw_mfree(pcontext->pbuf, sizeof(int));
if (pcontext->purb && (pcontext->purb == purb))
usb_free_urb(pcontext->purb);
rtw_mfree((u8 *)pcontext, sizeof(struct zero_bulkout_context));
}
}
static u32 usb_bulkout_zero(struct intf_hdl *pintfhdl, u32 addr)
{
int pipe, status, len;
u32 ret;
unsigned char *pbuf;
struct zero_bulkout_context *pcontext;
struct urb *purb = NULL;
struct adapter *padapter = (struct adapter *)pintfhdl->padapter;
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
struct usb_device *pusbd = pdvobj->pusbdev;
if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||
(padapter->pwrctrlpriv.pnp_bstop_trx))
return _FAIL;
pcontext = (struct zero_bulkout_context *)rtw_zmalloc(sizeof(struct zero_bulkout_context));
pbuf = (unsigned char *)rtw_zmalloc(sizeof(int));
purb = usb_alloc_urb(0, GFP_ATOMIC);
len = 0;
pcontext->pbuf = pbuf;
pcontext->purb = purb;
pcontext->pirp = NULL;
pcontext->padapter = padapter;
/* translate DMA FIFO addr to pipehandle */
usb_fill_bulk_urb(purb, pusbd, pipe,
pbuf,
len,
usb_bulkout_zero_complete,
pcontext);/* context is pcontext */
status = usb_submit_urb(purb, GFP_ATOMIC);
if (!status)
ret = _SUCCESS;
else
ret = _FAIL;
return ret;
}
void usb_read_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
{
}
@ -134,8 +75,6 @@ void usb_read_port_cancel(struct intf_hdl *pintfhdl)
static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
{
unsigned long irqL;
int i;
struct xmit_buf *pxmitbuf = (struct xmit_buf *)purb->context;
struct adapter *padapter = pxmitbuf->padapter;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
@ -157,7 +96,7 @@ _func_enter_;
pxmitpriv->bkq_cnt--;
break;
case HIGH_QUEUE_INX:
#ifdef CONFIG_AP_MODE
#ifdef CONFIG_88EU_AP_MODE
rtw_chk_hi_queue_cmd(padapter);
#endif
break;
@ -226,7 +165,7 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
unsigned long irqL;
unsigned int pipe;
int status;
u32 ret = _FAIL, bwritezero = false;
u32 ret = _FAIL;
struct urb *purb = NULL;
struct adapter *padapter = (struct adapter *)pintfhdl->padapter;
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
@ -234,7 +173,6 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
struct xmit_buf *pxmitbuf = (struct xmit_buf *)wmem;
struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data;
struct usb_device *pusbd = pdvobj->pusbdev;
struct pkt_attrib *pattrib = &pxmitframe->attrib;
_func_enter_;

View file

@ -19,6 +19,7 @@
******************************************************************************/
#define _XMIT_OSDEP_C_
#include <linux/version.h>
#include <osdep_service.h>
#include <drv_types.h>
@ -92,8 +93,6 @@ void rtw_set_tx_chksum_offload(struct sk_buff *pkt, struct pkt_attrib *pattrib)
int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz)
{
int i;
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
struct usb_device *pusbd = pdvobjpriv->pusbdev;
pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz);
if (pxmitbuf->pallocated_buf == NULL)
@ -116,15 +115,11 @@ void rtw_os_xmit_resource_free(struct adapter *padapter,
struct xmit_buf *pxmitbuf, u32 free_sz)
{
int i;
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
struct usb_device *pusbd = pdvobjpriv->pusbdev;
for (i = 0; i < 8; i++)
usb_free_urb(pxmitbuf->pxmit_urb[i]);
if (pxmitbuf->pallocated_buf)
rtw_mfree(pxmitbuf->pallocated_buf, free_sz);
kfree(pxmitbuf->pallocated_buf);
}
#define WMM_XMIT_THRESHOLD (NR_XMITFRAME*2/5)
@ -161,9 +156,7 @@ void rtw_os_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe)
void rtw_os_xmit_schedule(struct adapter *padapter)
{
struct adapter *pri_adapter = padapter;
unsigned long irqL;
unsigned long irql;
struct xmit_priv *pxmitpriv;
if (!padapter)
@ -171,18 +164,17 @@ void rtw_os_xmit_schedule(struct adapter *padapter)
pxmitpriv = &padapter->xmitpriv;
_enter_critical_bh(&pxmitpriv->lock, &irqL);
_enter_critical_bh(&pxmitpriv->lock, &irql);
if (rtw_txframes_pending(padapter))
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
_exit_critical_bh(&pxmitpriv->lock, &irqL);
_exit_critical_bh(&pxmitpriv->lock, &irql);
}
static void rtw_check_xmit_resource(struct adapter *padapter, struct sk_buff *pkt)
{
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
u16 queue;
queue = skb_get_queue_mapping(pkt);
@ -196,25 +188,19 @@ static void rtw_check_xmit_resource(struct adapter *padapter, struct sk_buff *pk
netif_stop_subqueue(padapter->pnetdev, queue);
}
}
#else
if (pxmitpriv->free_xmitframe_cnt <= 4) {
if (!rtw_netif_queue_stopped(padapter->pnetdev))
rtw_netif_stop_queue(padapter->pnetdev);
}
#endif
}
static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
{
struct sta_priv *pstapriv = &padapter->stapriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
unsigned long irqL;
unsigned long irql;
struct list_head *phead, *plist;
struct sk_buff *newskb;
struct sta_info *psta = NULL;
s32 res;
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
_enter_critical_bh(&pstapriv->asoc_list_lock, &irql);
phead = &pstapriv->asoc_list;
plist = get_next(phead);
@ -244,12 +230,12 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
DBG_88E("%s-%d: skb_copy() failed!\n", __func__, __LINE__);
pxmitpriv->tx_drop++;
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
_exit_critical_bh(&pstapriv->asoc_list_lock, &irql);
return false; /* Caller shall tx this multicast frame via normal way. */
}
}
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
_exit_critical_bh(&pstapriv->asoc_list_lock, &irql);
dev_kfree_skb_any(skb);
return true;
}
@ -261,9 +247,6 @@ int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
s32 res = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
u16 queue;
#endif
_func_enter_;