mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
Merge branch 'v5.2.2.4' of http://github.com/lwfinger/rtl8188eu into v5.2.2.4
This commit is contained in:
commit
bbc8dd8720
33 changed files with 556 additions and 743 deletions
|
@ -28,20 +28,8 @@
|
|||
#include <linux/if_pppox.h>
|
||||
#endif
|
||||
|
||||
#if 1 /* rtw_wifi_driver */
|
||||
#include <drv_types.h>
|
||||
#else /* rtw_wifi_driver */
|
||||
#include "./8192cd_cfg.h"
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#include "./sys-support.h"
|
||||
#endif
|
||||
|
||||
#include "./8192cd.h"
|
||||
#include "./8192cd_headers.h"
|
||||
#include "./8192cd_br_ext.h"
|
||||
#include "./8192cd_debug.h"
|
||||
#endif /* rtw_wifi_driver */
|
||||
#include <drv_types.h>
|
||||
#include <usb_osintf.h>
|
||||
|
||||
#ifdef CL_IPV6_PASS
|
||||
#ifdef __KERNEL__
|
||||
|
@ -100,16 +88,15 @@ static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, un
|
|||
return cur_ptr;
|
||||
cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static __inline__ int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
|
||||
{
|
||||
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;
|
||||
|
@ -165,7 +152,7 @@ static __inline__ int __nat25_has_expired(_adapter *priv,
|
|||
|
||||
|
||||
static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
|
||||
unsigned int *ipAddr)
|
||||
u32 *ipAddr)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
|
@ -175,7 +162,7 @@ static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *network
|
|||
|
||||
|
||||
static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
|
||||
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
|
||||
__be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
|
@ -186,7 +173,7 @@ static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char
|
|||
|
||||
|
||||
static __inline__ void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
|
||||
unsigned int *ipxNetAddr, unsigned short *ipxSocketAddr)
|
||||
__be32 *ipxNetAddr, __be16 *ipxSocketAddr)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
|
@ -197,7 +184,7 @@ static __inline__ void __nat25_generate_ipx_network_addr_with_socket(unsigned ch
|
|||
|
||||
|
||||
static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
|
||||
unsigned short *network, unsigned char *node)
|
||||
__be16 *network, unsigned char *node)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
|
@ -208,7 +195,7 @@ static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networ
|
|||
|
||||
|
||||
static __inline__ void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
|
||||
unsigned char *ac_mac, unsigned short *sid)
|
||||
unsigned char *ac_mac, __be16 *sid)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
|
@ -757,8 +744,9 @@ static int checkIPMcAndReplace(_adapter *priv, struct sk_buff *skb, unsigned int
|
|||
|
||||
int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
{
|
||||
unsigned short protocol;
|
||||
__be16 protocol;
|
||||
unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
|
||||
unsigned int tmp;
|
||||
|
||||
if (skb == NULL)
|
||||
return -1;
|
||||
|
@ -766,7 +754,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
if ((method <= NAT25_MIN) || (method >= NAT25_MAX))
|
||||
return -1;
|
||||
|
||||
protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN));
|
||||
protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN));
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* Handle IP frame */
|
||||
|
@ -788,8 +776,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/* in class A, B, C, host address is all zero or all one is illegal */
|
||||
if (iph->saddr == 0)
|
||||
return 0;
|
||||
tmp = be32_to_cpu(iph->saddr);
|
||||
RTW_INFO("NAT25: Insert IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr);
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, &iph->saddr);
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, &tmp);
|
||||
/* record source IP address and , source mac address into db */
|
||||
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
|
||||
|
||||
|
@ -807,7 +796,8 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
(OPMODE & WIFI_ADHOC_STATE)))
|
||||
#endif
|
||||
{
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, &iph->daddr);
|
||||
tmp = be32_to_cpu(iph->daddr);
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, &tmp);
|
||||
|
||||
if (!__nat25_db_network_lookup_and_replace(priv, skb, networkAddr)) {
|
||||
if (*((unsigned char *)&iph->daddr + 3) == 0xff) {
|
||||
|
@ -843,7 +833,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
unsigned int *sender, *target;
|
||||
|
||||
if (arp->ar_pro != __constant_htons(ETH_P_IP)) {
|
||||
DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", htons(arp->ar_pro));
|
||||
DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", be16_to_cpu(arp->ar_pro));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1120,7 +1110,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
else if ((protocol == __constant_htons(ETH_P_PPP_DISC)) ||
|
||||
(protocol == __constant_htons(ETH_P_PPP_SES))) {
|
||||
struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
|
||||
unsigned short *pMagic;
|
||||
__be16 *pMagic;
|
||||
|
||||
switch (method) {
|
||||
case NAT25_CHECK:
|
||||
|
@ -1159,7 +1149,7 @@ int nat25_db_handle(_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);
|
||||
|
||||
|
@ -1208,7 +1198,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
int offset = 0;
|
||||
|
||||
ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID));
|
||||
if (ptr == 0) {
|
||||
if (!ptr) {
|
||||
DEBUG_ERR("Fail to find PTT_RELAY_SID in FADO!\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -1222,7 +1212,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
return -1;
|
||||
}
|
||||
|
||||
pMagic = (unsigned short *)tag->tag_data;
|
||||
pMagic = (__be16 *)tag->tag_data;
|
||||
if (ntohs(*pMagic) != MAGIC_CODE) {
|
||||
DEBUG_ERR("Can't find MAGIC_CODE in %s packet!\n",
|
||||
(ph->code == PADO_CODE ? "PADO" : "PADS"));
|
||||
|
@ -1348,9 +1338,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
struct icmp6hdr *hdr = (struct icmp6hdr *)(skb->data + ETH_HLEN + sizeof(*iph));
|
||||
hdr->icmp6_cksum = 0;
|
||||
hdr->icmp6_cksum = csum_ipv6_magic(&iph->saddr, &iph->daddr,
|
||||
iph->payload_len,
|
||||
be16_to_cpu(iph->payload_len),
|
||||
IPPROTO_ICMPV6,
|
||||
csum_partial((__u8 *)hdr, iph->payload_len, 0));
|
||||
csum_partial((__u8 *)hdr, be16_to_cpu(iph->payload_len), 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1409,7 +1399,7 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
int is_vlan_tag = 0, i, retval = 0;
|
||||
unsigned short vlan_hdr = 0;
|
||||
|
||||
if (*((unsigned short *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_8021Q)) {
|
||||
if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_8021Q)) {
|
||||
is_vlan_tag = 1;
|
||||
vlan_hdr = *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2));
|
||||
for (i = 0; i < 6; i++)
|
||||
|
@ -1426,7 +1416,7 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
* corresponding network protocol is NOT support.
|
||||
*/
|
||||
if (!priv->ethBrExtInfo.nat25sc_disable &&
|
||||
(*((unsigned short *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP)) &&
|
||||
(*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP)) &&
|
||||
!memcmp(priv->scdb_ip, skb->data + ETH_HLEN + 16, 4)) {
|
||||
memcpy(skb->data, priv->scdb_mac, ETH_ALEN);
|
||||
|
||||
|
@ -1437,9 +1427,9 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
retval = nat25_db_handle(priv, skb, NAT25_LOOKUP);
|
||||
}
|
||||
} else {
|
||||
if (((*((unsigned short *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP)) &&
|
||||
if (((*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP)) &&
|
||||
!memcmp(priv->br_ip, skb->data + ETH_HLEN + 16, 4)) ||
|
||||
((*((unsigned short *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_ARP)) &&
|
||||
((*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_ARP)) &&
|
||||
!memcmp(priv->br_ip, skb->data + ETH_HLEN + 24, 4))) {
|
||||
/* for traffic to upper TCP/IP */
|
||||
retval = nat25_db_handle(priv, skb, NAT25_LOOKUP);
|
||||
|
@ -1449,9 +1439,9 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
if (is_vlan_tag) {
|
||||
skb_push(skb, 4);
|
||||
for (i = 0; i < 6; i++)
|
||||
*((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2));
|
||||
*((unsigned short *)(skb->data + ETH_ALEN * 2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr;
|
||||
*((__be16 *)(skb->data + i * 2)) = *((__be16 *)(skb->data + 4 + i * 2));
|
||||
*((__be16 *)(skb->data + ETH_ALEN * 2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((u16 *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr;
|
||||
}
|
||||
|
||||
if (retval == -1) {
|
||||
|
@ -1463,35 +1453,6 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void mac_clone(_adapter *priv, unsigned char *addr)
|
||||
{
|
||||
struct sockaddr sa;
|
||||
|
||||
memcpy(sa.sa_data, addr, ETH_ALEN);
|
||||
RTW_INFO("MAC Clone: Addr=%02x%02x%02x%02x%02x%02x\n",
|
||||
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
|
||||
rtl8192cd_set_hwaddr(priv->dev, &sa);
|
||||
}
|
||||
|
||||
|
||||
int mac_clone_handle_frame(_adapter *priv, struct sk_buff *skb)
|
||||
{
|
||||
if (priv->ethBrExtInfo.macclone_enable && !priv->macclone_completed) {
|
||||
if (!(skb->data[ETH_ALEN] & 1)) { /* check any other particular MAC add */
|
||||
if (memcmp(skb->data + ETH_ALEN, GET_MY_HWADDR(priv), ETH_ALEN) &&
|
||||
((priv->dev->br_port) &&
|
||||
memcmp(skb->data + ETH_ALEN, priv->br_mac, ETH_ALEN))) {
|
||||
mac_clone(priv, skb->data + ETH_ALEN);
|
||||
priv->macclone_completed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
#define SERVER_PORT 67
|
||||
#define CLIENT_PORT 68
|
||||
#define DHCP_MAGIC 0x63825363
|
||||
|
@ -1535,13 +1496,13 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
|
|||
struct dhcpMessage *dhcph =
|
||||
(struct dhcpMessage *)((SIZE_PTR)udph + sizeof(struct udphdr));
|
||||
|
||||
if (dhcph->cookie == __constant_htonl(DHCP_MAGIC)) { /* match magic word */
|
||||
if (!(dhcph->flags & htons(BROADCAST_FLAG))) { /* if not broadcast */
|
||||
if (dhcph->cookie == DHCP_MAGIC) { /* match magic word */
|
||||
if (!(dhcph->flags & BROADCAST_FLAG)) { /* if not broadcast */
|
||||
register int sum = 0;
|
||||
|
||||
RTW_INFO("DHCP: change flag of DHCP request to broadcast.\n");
|
||||
/* or BROADCAST flag */
|
||||
dhcph->flags |= htons(BROADCAST_FLAG);
|
||||
dhcph->flags |= BROADCAST_FLAG;
|
||||
/* recalculate checksum */
|
||||
sum = ~(udph->check) & 0xffff;
|
||||
sum += dhcph->flags;
|
||||
|
|
|
@ -4298,10 +4298,6 @@ static void session_tracker_chk_for_sta(_adapter *adapter, struct sta_info *sta)
|
|||
continue;
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
if (0)
|
||||
RTW_INFO(FUNC_ADPT_FMT" local:%u, remote:%u, rtsp:%u, %u, %u\n", FUNC_ADPT_ARG(adapter)
|
||||
, ntohs(st->local_port), ntohs(st->remote_port), adapter->wfd_info.rtsp_ctrlport, adapter->wfd_info.tdls_rtsp_ctrlport
|
||||
, adapter->wfd_info.peer_rtsp_ctrlport);
|
||||
if (ntohs(st->local_port) == adapter->wfd_info.rtsp_ctrlport)
|
||||
op_wfd_mode |= MIRACAST_SINK;
|
||||
if (ntohs(st->local_port) == adapter->wfd_info.tdls_rtsp_ctrlport)
|
||||
|
|
|
@ -2546,7 +2546,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
|
||||
if (p && len > 0) {
|
||||
pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
|
||||
pnetwork->BcnInfo.ht_cap_info = pht_cap->cap_info;
|
||||
pnetwork->BcnInfo.ht_cap_info = le16_to_cpu(pht_cap->cap_info);
|
||||
} else
|
||||
pnetwork->BcnInfo.ht_cap_info = 0;
|
||||
/* parsing HT_INFO_IE */
|
||||
|
|
|
@ -21,8 +21,7 @@
|
|||
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
extern void indicate_wx_scan_complete_event(_adapter *padapter);
|
||||
#include <rtw_mlme.h>
|
||||
|
||||
#define IS_MAC_ADDRESS_BROADCAST(addr) \
|
||||
(\
|
||||
|
|
|
@ -186,7 +186,7 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr,
|
|||
|
||||
/* RTW_PUT_LE16((u8*)&cmd.address, addr); */
|
||||
/* RTW_PUT_LE32((u8*)&cmd.value, (u32)value); */
|
||||
cmd.address = (rf_path << 8) | ((addr) & 0xFF);
|
||||
cmd.address = cpu_to_le16((rf_path << 8) | ((addr) & 0xFF));
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if (mask != 0x000FFFFF) {
|
||||
|
@ -225,7 +225,7 @@ int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
|||
}
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4, IOREG_CMD_END, 0xFFFF, 0xFF, 0x0};
|
||||
struct ioreg_cfg cmd = {4, IOREG_CMD_END, cpu_to_le16(0xFFFF), cpu_to_le32(0xFF), 0x0};
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8 *)&cmd, 4);
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#define _RTW_MLME_C_
|
||||
|
||||
#include <hal_data.h>
|
||||
#include <usb_osintf.h>
|
||||
|
||||
extern void indicate_wx_scan_complete_event(_adapter *padapter);
|
||||
extern u8 rtw_do_join(_adapter *padapter);
|
||||
|
@ -2914,7 +2915,6 @@ void rtw_iface_dynamic_check_timer_handler(_adapter *adapter)
|
|||
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
|
||||
&& (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) == _TRUE)) {
|
||||
/* expire NAT2.5 entry */
|
||||
void nat25_db_expire(_adapter *priv);
|
||||
nat25_db_expire(adapter);
|
||||
|
||||
if (adapter->pppoe_connection_in_progress > 0)
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
|
||||
#ifdef CONFIG_P2P
|
||||
|
||||
int rtw_p2p_is_channel_list_ok(u8 desired_ch, u8 *ch_list, u8 ch_cnt)
|
||||
void p2p_concurrent_handler(_adapter *padapter);
|
||||
|
||||
static int rtw_p2p_is_channel_list_ok(u8 desired_ch, u8 *ch_list, u8 ch_cnt)
|
||||
{
|
||||
int found = 0, i = 0;
|
||||
|
||||
|
@ -36,7 +38,7 @@ int rtw_p2p_is_channel_list_ok(u8 desired_ch, u8 *ch_list, u8 ch_cnt)
|
|||
return found ;
|
||||
}
|
||||
|
||||
int is_any_client_associated(_adapter *padapter)
|
||||
static int is_any_client_associated(_adapter *padapter)
|
||||
{
|
||||
return padapter->stapriv.asoc_list_cnt ? _TRUE : _FALSE;
|
||||
}
|
||||
|
@ -149,12 +151,12 @@ 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;
|
||||
_adapter *padapter = pwdinfo->padapter;
|
||||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
unsigned char category = RTW_WLAN_CATEGORY_P2P;/* P2P action frame */
|
||||
u32 p2poui = cpu_to_be32(P2POUI);
|
||||
__be32 p2poui = cpu_to_be32(P2POUI);
|
||||
u8 oui_subtype = P2P_GO_DISC_REQUEST;
|
||||
u8 dialogToken = 0;
|
||||
|
||||
|
@ -207,13 +209,13 @@ 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;
|
||||
_adapter *padapter = pwdinfo->padapter;
|
||||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
unsigned char category = RTW_WLAN_CATEGORY_PUBLIC;
|
||||
u8 action = P2P_PUB_ACTION_ACTION;
|
||||
u32 p2poui = cpu_to_be32(P2POUI);
|
||||
__be32 p2poui = cpu_to_be32(P2POUI);
|
||||
u8 oui_subtype = P2P_DEVDISC_RESP;
|
||||
u8 p2pie[8] = { 0x00 };
|
||||
u32 p2pielen = 0;
|
||||
|
@ -280,7 +282,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
|
|||
unsigned char category = RTW_WLAN_CATEGORY_PUBLIC;
|
||||
u8 action = P2P_PUB_ACTION_ACTION;
|
||||
u8 dialogToken = frame_body[7]; /* The Dialog Token of provisioning discovery request frame. */
|
||||
u32 p2poui = cpu_to_be32(P2POUI);
|
||||
__be32 p2poui = cpu_to_be32(P2POUI);
|
||||
u8 oui_subtype = P2P_PROVISION_DISC_RESP;
|
||||
u8 wpsie[100] = { 0x00 };
|
||||
u8 wpsielen = 0;
|
||||
|
@ -292,7 +294,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);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
@ -389,12 +391,12 @@ 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;
|
||||
_adapter *padapter = pwdinfo->padapter;
|
||||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
unsigned char category = RTW_WLAN_CATEGORY_P2P;/* P2P action frame */
|
||||
u32 p2poui = cpu_to_be32(P2POUI);
|
||||
__be32 p2poui = cpu_to_be32(P2POUI);
|
||||
u8 oui_subtype = P2P_PRESENCE_RESPONSE;
|
||||
u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 };
|
||||
u8 noa_attr_content[32] = { 0x00 };
|
||||
|
@ -471,7 +473,7 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 };
|
||||
u16 capability = 0;
|
||||
u32 len = 0, p2pielen = 0;
|
||||
|
||||
__le16 le_tmp;
|
||||
|
||||
/* P2P OUI */
|
||||
p2pielen = 0;
|
||||
|
@ -499,9 +501,9 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING))
|
||||
capability |= (P2P_GRPCAP_GROUP_FORMATION << 8);
|
||||
|
||||
capability = cpu_to_le16(capability);
|
||||
le_tmp = cpu_to_le16(capability);
|
||||
|
||||
p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_CAPABILITY, 2, (u8 *)&capability);
|
||||
p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_CAPABILITY, 2, (u8 *)&le_tmp);
|
||||
|
||||
|
||||
/* P2P Device ID ATTR */
|
||||
|
@ -2324,6 +2326,8 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
u32 ies_len;
|
||||
u8 *p2p_ie;
|
||||
u32 p2p_ielen = 0;
|
||||
__be16 be_tmp;
|
||||
__le16 le_tmp;
|
||||
|
||||
if (!rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
return P2P_STATUS_FAIL_REQUEST_UNABLE;
|
||||
|
@ -2347,9 +2351,9 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
|
||||
while (p2p_ie) {
|
||||
/* Check P2P Capability ATTR */
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8 *)&cap_attr, (uint *) &attr_contentlen)) {
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8 *)&le_tmp, (uint *) &attr_contentlen)) {
|
||||
RTW_INFO("[%s] Got P2P Capability Attr!!\n", __FUNCTION__);
|
||||
cap_attr = le16_to_cpu(cap_attr);
|
||||
cap_attr = le16_to_cpu(le_tmp);
|
||||
psta->dev_cap = cap_attr & 0xff;
|
||||
}
|
||||
|
||||
|
@ -2371,8 +2375,8 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
|
||||
pattr_content += ETH_ALEN;
|
||||
|
||||
_rtw_memcpy(&psta->config_methods, pattr_content, 2);/* Config Methods */
|
||||
psta->config_methods = be16_to_cpu(psta->config_methods);
|
||||
_rtw_memcpy(&be_tmp, pattr_content, 2);/* Config Methods */
|
||||
psta->config_methods = be16_to_cpu(be_tmp);
|
||||
|
||||
pattr_content += 2;
|
||||
|
||||
|
@ -2400,8 +2404,8 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
|
||||
/* dev_name_len = attr_contentlen - ETH_ALEN - 2 - 8 - 1 - (num_of_secdev_type*8); */
|
||||
psta->dev_name_len = 0;
|
||||
if (WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(u16 *)pattr_content)) {
|
||||
dev_name_len = be16_to_cpu(*(u16 *)(pattr_content + 2));
|
||||
if (WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(__be16 *)(pattr_content))) {
|
||||
dev_name_len = be16_to_cpu(*(__be16 *)(pattr_content + 2));
|
||||
|
||||
psta->dev_name_len = (sizeof(psta->dev_name) < dev_name_len) ? sizeof(psta->dev_name) : dev_name_len;
|
||||
|
||||
|
@ -2509,14 +2513,14 @@ u8 process_p2p_provdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
u8 *wpsie;
|
||||
uint wps_ielen = 0, attr_contentlen = 0;
|
||||
u16 uconfig_method = 0;
|
||||
|
||||
__be16 be_tmp;
|
||||
|
||||
frame_body = (pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
|
||||
wpsie = rtw_get_wps_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen);
|
||||
if (wpsie) {
|
||||
if (rtw_get_wps_attr_content(wpsie, wps_ielen, WPS_ATTR_CONF_METHOD , (u8 *) &uconfig_method, &attr_contentlen)) {
|
||||
uconfig_method = be16_to_cpu(uconfig_method);
|
||||
if (rtw_get_wps_attr_content(wpsie, wps_ielen, WPS_ATTR_CONF_METHOD , (u8 *)&be_tmp, &attr_contentlen)) {
|
||||
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);
|
||||
|
@ -2549,7 +2553,7 @@ u8 process_p2p_provdisc_resp(struct wifidirect_info *pwdinfo, u8 *pframe)
|
|||
return _TRUE;
|
||||
}
|
||||
|
||||
u8 rtw_p2p_get_peer_ch_list(struct wifidirect_info *pwdinfo, u8 *ch_content, u8 ch_cnt, u8 *peer_ch_list)
|
||||
static u8 rtw_p2p_get_peer_ch_list(struct wifidirect_info *pwdinfo, u8 *ch_content, u8 ch_cnt, u8 *peer_ch_list)
|
||||
{
|
||||
u8 i = 0, j = 0;
|
||||
u8 temp = 0;
|
||||
|
@ -2571,7 +2575,7 @@ u8 rtw_p2p_get_peer_ch_list(struct wifidirect_info *pwdinfo, u8 *ch_content, u8
|
|||
return ch_no;
|
||||
}
|
||||
|
||||
u8 rtw_p2p_check_peer_oper_ch(struct mlme_ext_priv *pmlmeext, u8 ch)
|
||||
static u8 rtw_p2p_check_peer_oper_ch(struct mlme_ext_priv *pmlmeext, u8 ch)
|
||||
{
|
||||
u8 i = 0;
|
||||
|
||||
|
@ -2583,7 +2587,7 @@ u8 rtw_p2p_check_peer_oper_ch(struct mlme_ext_priv *pmlmeext, u8 ch)
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
u8 rtw_p2p_ch_inclusion(struct mlme_ext_priv *pmlmeext, u8 *peer_ch_list, u8 peer_ch_num, u8 *ch_list_inclusioned)
|
||||
static u8 rtw_p2p_ch_inclusion(struct mlme_ext_priv *pmlmeext, u8 *peer_ch_list, u8 peer_ch_num, u8 *ch_list_inclusioned)
|
||||
{
|
||||
int i = 0, j = 0, temp = 0;
|
||||
u8 ch_no = 0;
|
||||
|
@ -2612,6 +2616,7 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
|
|||
u8 *wpsie;
|
||||
u16 wps_devicepassword_id = 0x0000;
|
||||
uint wps_devicepassword_id_len = 0;
|
||||
__be16 be_tmp;
|
||||
#ifdef CONFIG_WFD
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
|
@ -2623,8 +2628,8 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
|
|||
/* If some device wants to do p2p handshake without sending prov_disc_req */
|
||||
/* We have to get peer_req_cm from here. */
|
||||
if (_rtw_memcmp(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3)) {
|
||||
rtw_get_wps_attr_content(wpsie, wps_ielen, WPS_ATTR_DEVICE_PWID, (u8 *) &wps_devicepassword_id, &wps_devicepassword_id_len);
|
||||
wps_devicepassword_id = be16_to_cpu(wps_devicepassword_id);
|
||||
rtw_get_wps_attr_content(wpsie, wps_ielen, WPS_ATTR_DEVICE_PWID, (u8 *) &be_tmp, &wps_devicepassword_id_len);
|
||||
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);
|
||||
|
@ -2662,12 +2667,13 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
|
|||
u8 ch_num_inclusioned = 0;
|
||||
u16 cap_attr;
|
||||
u8 listen_ch_attr[5] = { 0x00 };
|
||||
__le16 le_tmp;
|
||||
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING);
|
||||
|
||||
/* Check P2P Capability ATTR */
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8 *)&cap_attr, (uint *)&attr_contentlen)) {
|
||||
cap_attr = le16_to_cpu(cap_attr);
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8 *)&le_tmp, (uint *)&attr_contentlen)) {
|
||||
cap_attr = le16_to_cpu(le_tmp);
|
||||
|
||||
#if defined(CONFIG_WFD) && defined(CONFIG_TDLS)
|
||||
if (!(cap_attr & P2P_GRPCAP_INTRABSS))
|
||||
|
@ -2823,12 +2829,12 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
u8 peer_ch_num = 0;
|
||||
u8 ch_list_inclusioned[100] = { 0x00 };
|
||||
u8 ch_num_inclusioned = 0;
|
||||
__le16 le_tmp;
|
||||
|
||||
while (p2p_ie) { /* Found the P2P IE. */
|
||||
|
||||
/* Check P2P Capability ATTR */
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8 *)&cap_attr, (uint *)&attr_contentlen)) {
|
||||
cap_attr = le16_to_cpu(cap_attr);
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8 *)&le_tmp, (uint *)&attr_contentlen)) {
|
||||
cap_attr = le16_to_cpu(le_tmp);
|
||||
#ifdef CONFIG_TDLS
|
||||
if (!(cap_attr & P2P_GRPCAP_INTRABSS))
|
||||
ptdlsinfo->ap_prohibited = _TRUE;
|
||||
|
@ -3078,7 +3084,7 @@ u8 process_p2p_presence_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
|
|||
return _TRUE;
|
||||
}
|
||||
|
||||
void find_phase_handler(_adapter *padapter)
|
||||
static void find_phase_handler(_adapter *padapter)
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
@ -3100,9 +3106,7 @@ void find_phase_handler(_adapter *padapter)
|
|||
|
||||
}
|
||||
|
||||
void p2p_concurrent_handler(_adapter *padapter);
|
||||
|
||||
void restore_p2p_state_handler(_adapter *padapter)
|
||||
static void restore_p2p_state_handler(_adapter *padapter)
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
@ -3137,7 +3141,7 @@ void restore_p2p_state_handler(_adapter *padapter)
|
|||
}
|
||||
}
|
||||
|
||||
void pre_tx_invitereq_handler(_adapter *padapter)
|
||||
static void pre_tx_invitereq_handler(_adapter *padapter)
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
u8 val8 = 1;
|
||||
|
@ -3149,7 +3153,7 @@ void pre_tx_invitereq_handler(_adapter *padapter)
|
|||
|
||||
}
|
||||
|
||||
void pre_tx_provdisc_handler(_adapter *padapter)
|
||||
static void pre_tx_provdisc_handler(_adapter *padapter)
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
u8 val8 = 1;
|
||||
|
@ -3161,7 +3165,7 @@ void pre_tx_provdisc_handler(_adapter *padapter)
|
|||
|
||||
}
|
||||
|
||||
void pre_tx_negoreq_handler(_adapter *padapter)
|
||||
static void pre_tx_negoreq_handler(_adapter *padapter)
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
u8 val8 = 1;
|
||||
|
@ -3612,7 +3616,7 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram
|
|||
}
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
|
||||
static u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
|
||||
{
|
||||
_adapter *adapter = xframe->padapter;
|
||||
struct wifidirect_info *wdinfo = &adapter->wdinfo;
|
||||
|
@ -3690,7 +3694,7 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
|
|||
}
|
||||
#endif /* CONFIG_WFD */
|
||||
|
||||
bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe)
|
||||
static bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe)
|
||||
{
|
||||
#define DBG_XFRAME_DEL_WFD_IE 0
|
||||
|
||||
|
@ -3767,7 +3771,7 @@ void rtw_xframe_chk_wfd_ie(struct xmit_frame *xframe)
|
|||
#endif
|
||||
}
|
||||
|
||||
u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_len)
|
||||
static u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_len)
|
||||
{
|
||||
uint attr_contentlen = 0;
|
||||
u8 *pattr = NULL;
|
||||
|
@ -3820,7 +3824,7 @@ u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_len)
|
|||
/*
|
||||
* return _TRUE if requester is GO, _FALSE if responder is GO
|
||||
*/
|
||||
bool rtw_p2p_nego_intent_compare(u8 req, u8 resp)
|
||||
static bool rtw_p2p_nego_intent_compare(u8 req, u8 resp)
|
||||
{
|
||||
if (req >> 1 == resp >> 1)
|
||||
return req & 0x01 ? _TRUE : _FALSE;
|
||||
|
|
|
@ -174,12 +174,7 @@ int ips_leave(_adapter *padapter)
|
|||
extern int autoresume_enter(_adapter *padapter);
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
int rtw_hw_suspend(_adapter *padapter);
|
||||
int rtw_hw_resume(_adapter *padapter);
|
||||
#endif
|
||||
|
||||
bool rtw_pwr_unassociated_idle(_adapter *adapter)
|
||||
static bool rtw_pwr_unassociated_idle(_adapter *adapter)
|
||||
{
|
||||
u8 i;
|
||||
_adapter *iface;
|
||||
|
@ -394,9 +389,9 @@ exit:
|
|||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
void pwr_state_check_handler(RTW_TIMER_HDL_ARGS)
|
||||
static void pwr_state_check_handler(RTW_TIMER_HDL_ARGS)
|
||||
#else
|
||||
void pwr_state_check_handler(struct timer_list *t)
|
||||
static void pwr_state_check_handler(struct timer_list *t)
|
||||
#endif
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
||||
|
@ -592,7 +587,7 @@ void rtw_set_rpwm(PADAPTER padapter, u8 pslv)
|
|||
|
||||
}
|
||||
|
||||
u8 PS_RDY_CHECK(_adapter *padapter)
|
||||
static u8 PS_RDY_CHECK(_adapter *padapter)
|
||||
{
|
||||
u32 curr_time, delta_time;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
|
|
181
core/rtw_recv.c
181
core/rtw_recv.c
|
@ -35,7 +35,7 @@ enum {
|
|||
SIGNAL_STAT_CALC_PROFILE_MAX
|
||||
};
|
||||
|
||||
u8 signal_stat_calc_profile[SIGNAL_STAT_CALC_PROFILE_MAX][2] = {
|
||||
static u8 signal_stat_calc_profile[SIGNAL_STAT_CALC_PROFILE_MAX][2] = {
|
||||
{4, 1}, /* Profile 0 => pre_stat : curr_stat = 4 : 1 */
|
||||
{3, 7} /* Profile 1 => pre_stat : curr_stat = 3 : 7 */
|
||||
};
|
||||
|
@ -160,7 +160,7 @@ exit:
|
|||
|
||||
}
|
||||
|
||||
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);
|
||||
#ifdef CONFIG_RECV_THREAD_MODE
|
||||
|
@ -700,7 +700,7 @@ union recv_frame *portctrl(_adapter *adapter, union recv_frame *precv_frame)
|
|||
u16 ether_type = 0;
|
||||
u16 eapol_type = 0x888e;/* for Funia BD's WPA issue */
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
|
||||
__be16 be_tmp;
|
||||
|
||||
pstapriv = &adapter->stapriv;
|
||||
|
||||
|
@ -725,8 +725,8 @@ union recv_frame *portctrl(_adapter *adapter, union recv_frame *precv_frame)
|
|||
|
||||
/* get ether_type */
|
||||
ptr = ptr + pfhdr->attrib.hdrlen + pfhdr->attrib.iv_len + LLC_HEADER_SIZE;
|
||||
_rtw_memcpy(ðer_type, ptr, 2);
|
||||
ether_type = ntohs((unsigned short)ether_type);
|
||||
_rtw_memcpy(&be_tmp, ptr, 2);
|
||||
ether_type = ntohs(be_tmp);
|
||||
|
||||
if (ether_type == eapol_type)
|
||||
prtnframe = precv_frame;
|
||||
|
@ -761,14 +761,11 @@ sint recv_decache(union recv_frame *precv_frame, u8 bretry, struct stainfo_rxcac
|
|||
{
|
||||
sint tid = precv_frame->u.hdr.attrib.priority;
|
||||
|
||||
u16 seq_ctrl = ((precv_frame->u.hdr.attrib.seq_num & 0xffff) << 4) |
|
||||
u16 seq_ctrl = ((le16_to_cpu(precv_frame->u.hdr.attrib.seq_num) & 0xffff) << 4) |
|
||||
(precv_frame->u.hdr.attrib.frag_num & 0xf);
|
||||
|
||||
|
||||
if (tid > 15) {
|
||||
|
||||
if (tid > 15)
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if (1) { /* if(bretry) */
|
||||
if (seq_ctrl == prxcache->tid_rxseq[tid]) {
|
||||
|
@ -784,9 +781,7 @@ sint recv_decache(union recv_frame *precv_frame, u8 bretry, struct stainfo_rxcac
|
|||
|
||||
prxcache->tid_rxseq[tid] = seq_ctrl;
|
||||
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/* VALID_PN_CHK
|
||||
|
@ -795,11 +790,11 @@ sint recv_decache(union recv_frame *precv_frame, u8 bretry, struct stainfo_rxcac
|
|||
* 1. If old PN is 0, any PN is legal
|
||||
* 2. PN > old PN
|
||||
*/
|
||||
#define PN_LESS_CHK(a, b) (((a-b) & 0x800000000000) != 0)
|
||||
#define PN_LESS_CHK(a, b) (((a-b) & 0x800000000000L) != 0)
|
||||
#define VALID_PN_CHK(new, old) (((old) == 0) || PN_LESS_CHK(old, new))
|
||||
#define CCMPH_2_KEYID(ch) (((ch) & 0x00000000c0000000) >> 30)
|
||||
#define CCMPH_2_PN(ch) ((ch) & 0x000000000000ffff) \
|
||||
| (((ch) & 0xffffffff00000000) >> 16)
|
||||
#define CCMPH_2_KEYID(ch) (((ch) & 0x00000000c0000000L) >> 30)
|
||||
#define CCMPH_2_PN(ch) ((ch) & 0x000000000000ffffL) \
|
||||
| (((ch) & 0xffffffff00000000L) >> 16)
|
||||
sint recv_ucast_pn_decache(union recv_frame *precv_frame, struct stainfo_rxcache *prxcache);
|
||||
sint recv_ucast_pn_decache(union recv_frame *precv_frame, struct stainfo_rxcache *prxcache)
|
||||
{
|
||||
|
@ -815,10 +810,10 @@ sint recv_ucast_pn_decache(union recv_frame *precv_frame, struct stainfo_rxcache
|
|||
return _FAIL;
|
||||
|
||||
if (pattrib->encrypt == _AES_) {
|
||||
tmp_iv_hdr = le64_to_cpu(*(u64*)(pdata + pattrib->hdrlen));
|
||||
tmp_iv_hdr = le64_to_cpu(*(__le64*)(pdata + pattrib->hdrlen));
|
||||
pkt_pn = CCMPH_2_PN(tmp_iv_hdr);
|
||||
|
||||
tmp_iv_hdr = le64_to_cpu(*(u64*)prxcache->iv[tid]);
|
||||
tmp_iv_hdr = le64_to_cpu(*(__le64*)prxcache->iv[tid]);
|
||||
curr_pn = CCMPH_2_PN(tmp_iv_hdr);
|
||||
|
||||
if (!VALID_PN_CHK(pkt_pn, curr_pn)) {
|
||||
|
@ -830,8 +825,7 @@ sint recv_ucast_pn_decache(union recv_frame *precv_frame, struct stainfo_rxcache
|
|||
return _SUCCESS;
|
||||
}
|
||||
|
||||
sint recv_bcast_pn_decache(union recv_frame *precv_frame);
|
||||
sint recv_bcast_pn_decache(union recv_frame *precv_frame)
|
||||
static sint recv_bcast_pn_decache(union recv_frame *precv_frame)
|
||||
{
|
||||
_adapter *padapter = precv_frame->u.hdr.adapter;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
@ -846,17 +840,17 @@ sint recv_bcast_pn_decache(union recv_frame *precv_frame)
|
|||
if ((pattrib->encrypt == _AES_) &&
|
||||
(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)) {
|
||||
|
||||
tmp_iv_hdr = le64_to_cpu(*(u64*)(pdata + pattrib->hdrlen));
|
||||
tmp_iv_hdr = le64_to_cpu(*(__le64*)(pdata + pattrib->hdrlen));
|
||||
key_id = CCMPH_2_KEYID(tmp_iv_hdr);
|
||||
pkt_pn = CCMPH_2_PN(tmp_iv_hdr);
|
||||
|
||||
curr_pn = le64_to_cpu(*(u64*)psecuritypriv->iv_seq[key_id]);
|
||||
curr_pn &= 0x0000ffffffffffff;
|
||||
curr_pn = le64_to_cpu(*(__le64*)psecuritypriv->iv_seq[key_id]);
|
||||
curr_pn &= 0x0000ffffffffffffL;
|
||||
|
||||
if (!VALID_PN_CHK(pkt_pn, curr_pn))
|
||||
return _FAIL;
|
||||
|
||||
*(u64*)psecuritypriv->iv_seq[key_id] = cpu_to_le64(pkt_pn);
|
||||
*(__le64*)psecuritypriv->iv_seq[key_id] = cpu_to_le64(pkt_pn);
|
||||
}
|
||||
|
||||
return _SUCCESS;
|
||||
|
@ -1701,7 +1695,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
union recv_frame *recvframe_chk_defrag(PADAPTER padapter, union recv_frame *precv_frame);
|
||||
|
||||
sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame)
|
||||
static sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame)
|
||||
{
|
||||
precv_frame = recvframe_chk_defrag(padapter, precv_frame);
|
||||
if (precv_frame == NULL) {
|
||||
|
@ -2119,7 +2113,7 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
|||
pattrib->to_fr_ds = get_tofr_ds(ptr);
|
||||
|
||||
pattrib->frag_num = GetFragNum(ptr);
|
||||
pattrib->seq_num = GetSequence(ptr);
|
||||
pattrib->seq_num = cpu_to_le16(GetSequence(ptr));
|
||||
|
||||
pattrib->pw_save = GetPwrMgt(ptr);
|
||||
pattrib->mfrag = GetMFrag(ptr);
|
||||
|
@ -2248,6 +2242,7 @@ sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
|
|||
u16 eth_type, len;
|
||||
u8 bsnaphdr;
|
||||
u8 *psnap_type;
|
||||
__be16 be_tmp;
|
||||
struct ieee80211_snap_hdr *psnap;
|
||||
|
||||
sint ret = _SUCCESS;
|
||||
|
@ -2281,9 +2276,9 @@ sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
|
|||
len = precvframe->u.hdr.len - rmv_len;
|
||||
|
||||
|
||||
_rtw_memcpy(ð_type, ptr + rmv_len, 2);
|
||||
eth_type = ntohs((unsigned short)eth_type); /* pattrib->ether_type */
|
||||
pattrib->eth_type = eth_type;
|
||||
_rtw_memcpy(&be_tmp, ptr + rmv_len, 2);
|
||||
eth_type = ntohs(be_tmp); /* pattrib->ether_type */
|
||||
pattrib->eth_type = cpu_to_le16(eth_type);
|
||||
|
||||
#ifdef CONFIG_AUTO_AP_MODE
|
||||
if (0x8899 == pattrib->eth_type) {
|
||||
|
@ -2581,7 +2576,7 @@ union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q)
|
|||
/* memcpy */
|
||||
_rtw_memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len);
|
||||
|
||||
recvframe_put(prframe, pnfhdr->len);
|
||||
recvframe_put(prframe, cpu_to_le16(pnfhdr->len));
|
||||
|
||||
pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len;
|
||||
plist = get_next(plist);
|
||||
|
@ -2591,8 +2586,6 @@ union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q)
|
|||
/* free the defrag_q queue and return the prframe */
|
||||
rtw_free_recvframe_queue(defrag_q, pfree_recv_queue);
|
||||
|
||||
|
||||
|
||||
return prframe;
|
||||
}
|
||||
|
||||
|
@ -2702,7 +2695,7 @@ union recv_frame *recvframe_chk_defrag(PADAPTER padapter, union recv_frame *prec
|
|||
|
||||
}
|
||||
|
||||
int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
|
||||
static int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
int a_len, padding_len;
|
||||
u16 nSubframe_Length;
|
||||
|
@ -2781,8 +2774,7 @@ int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num);
|
||||
int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
|
||||
static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, __le16 seq_num)
|
||||
{
|
||||
PADAPTER padapter = preorder_ctrl->padapter;
|
||||
struct dvobj_priv *psdpriv = padapter->dvobj;
|
||||
|
@ -2792,27 +2784,18 @@ int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
|
|||
|
||||
/* Rx Reorder initialize condition. */
|
||||
if (preorder_ctrl->indicate_seq == 0xFFFF) {
|
||||
preorder_ctrl->indicate_seq = seq_num;
|
||||
preorder_ctrl->indicate_seq = le16_to_cpu(seq_num);
|
||||
#ifdef DBG_RX_SEQ
|
||||
RTW_INFO("DBG_RX_SEQ %s:%d init IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, seq_num);
|
||||
#endif
|
||||
|
||||
/* DbgPrint("check_indicate_seq, 1st->indicate_seq=%d\n", precvpriv->indicate_seq); */
|
||||
}
|
||||
|
||||
/* DbgPrint("enter->check_indicate_seq(): IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */
|
||||
|
||||
/* Drop out the packet which SeqNum is smaller than WinStart */
|
||||
if (SN_LESS(seq_num, preorder_ctrl->indicate_seq)) {
|
||||
/* DbgPrint("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */
|
||||
|
||||
if (SN_LESS(le16_to_cpu(seq_num), preorder_ctrl->indicate_seq)) {
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
RTW_INFO("%s IndicateSeq: %d > NewSeq: %d\n", __FUNCTION__,
|
||||
preorder_ctrl->indicate_seq, seq_num);
|
||||
#endif
|
||||
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
|
@ -2821,25 +2804,25 @@ int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
|
|||
/* 1. Incoming SeqNum is equal to WinStart =>Window shift 1 */
|
||||
/* 2. Incoming SeqNum is larger than the WinEnd => Window shift N */
|
||||
/* */
|
||||
if (SN_EQUAL(seq_num, preorder_ctrl->indicate_seq)) {
|
||||
if (SN_EQUAL(le16_to_cpu(seq_num), preorder_ctrl->indicate_seq)) {
|
||||
preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF;
|
||||
|
||||
#ifdef DBG_RX_SEQ
|
||||
RTW_INFO("DBG_RX_SEQ %s:%d SN_EQUAL IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, seq_num);
|
||||
#endif
|
||||
} else if (SN_LESS(wend, seq_num)) {
|
||||
} else if (SN_LESS(wend, le16_to_cpu(seq_num))) {
|
||||
/* DbgPrint("CheckRxTsIndicateSeq(): Window Shift! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */
|
||||
|
||||
/* boundary situation, when seq_num cross 0xFFF */
|
||||
if (seq_num >= (wsize - 1))
|
||||
preorder_ctrl->indicate_seq = seq_num + 1 - wsize;
|
||||
if (le16_to_cpu(seq_num) >= (wsize - 1))
|
||||
preorder_ctrl->indicate_seq = le16_to_cpu(seq_num) + 1 - wsize;
|
||||
else
|
||||
preorder_ctrl->indicate_seq = 0xFFF - (wsize - (seq_num + 1)) + 1;
|
||||
preorder_ctrl->indicate_seq = 0xFFF - (wsize - (le16_to_cpu(seq_num) + 1)) + 1;
|
||||
pdbgpriv->dbg_rx_ampdu_window_shift_cnt++;
|
||||
#ifdef DBG_RX_SEQ
|
||||
RTW_INFO("DBG_RX_SEQ %s:%d SN_LESS(wend, seq_num) IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, seq_num);
|
||||
preorder_ctrl->indicate_seq, le16_to_cpu(seq_num));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -2848,8 +2831,7 @@ int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
|
|||
return _TRUE;
|
||||
}
|
||||
|
||||
int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union recv_frame *prframe);
|
||||
int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union recv_frame *prframe)
|
||||
static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union recv_frame *prframe)
|
||||
{
|
||||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
_queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
|
||||
|
@ -2870,7 +2852,7 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, union rec
|
|||
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
pnextattrib = &pnextrframe->u.hdr.attrib;
|
||||
|
||||
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
|
||||
if (SN_LESS(le16_to_cpu(pnextattrib->seq_num), le16_to_cpu(pattrib->seq_num)))
|
||||
plist = get_next(plist);
|
||||
else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) {
|
||||
/* Duplicate entry is found!! Do not insert current entry. */
|
||||
|
@ -2951,8 +2933,8 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
|
|||
RTW_INFO("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
#endif
|
||||
recv_indicatepkts_pkt_loss_cnt(pdbgpriv, preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
recv_indicatepkts_pkt_loss_cnt(pdbgpriv, preorder_ctrl->indicate_seq, le16_to_cpu(pattrib->seq_num));
|
||||
preorder_ctrl->indicate_seq = le16_to_cpu(pattrib->seq_num);
|
||||
|
||||
}
|
||||
|
||||
|
@ -2963,11 +2945,11 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
|
|||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
|
||||
if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
|
||||
if (!SN_LESS(preorder_ctrl->indicate_seq, le16_to_cpu(pattrib->seq_num))) {
|
||||
plist = get_next(plist);
|
||||
rtw_list_delete(&(prframe->u.hdr.list));
|
||||
|
||||
if (SN_EQUAL(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
|
||||
if (SN_EQUAL(preorder_ctrl->indicate_seq, le16_to_cpu(pattrib->seq_num))) {
|
||||
preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF;
|
||||
#ifdef DBG_RX_SEQ
|
||||
RTW_INFO("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
|
@ -3003,7 +2985,7 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
|
|||
return bPktInBuf;
|
||||
}
|
||||
|
||||
int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
|
||||
static int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
_irqL irql;
|
||||
int retval = _SUCCESS;
|
||||
|
@ -3045,7 +3027,7 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
|
|||
|
||||
if (preorder_ctrl->enable == _FALSE) {
|
||||
/* indicate this recv_frame */
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
preorder_ctrl->indicate_seq = le16_to_cpu(pattrib->seq_num);
|
||||
#ifdef DBG_RX_SEQ
|
||||
RTW_INFO("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
|
@ -3070,7 +3052,7 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
|
|||
|
||||
} else if (pattrib->amsdu == 1) { /* temp filter->means didn't support A-MSDUs in a A-MPDU */
|
||||
if (preorder_ctrl->enable == _FALSE) {
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
preorder_ctrl->indicate_seq = le16_to_cpu(pattrib->seq_num);
|
||||
#ifdef DBG_RX_SEQ
|
||||
RTW_INFO("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq, pattrib->seq_num);
|
||||
|
@ -3245,7 +3227,7 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
int validate_mp_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
static int validate_mp_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
|
@ -3295,7 +3277,8 @@ static sint MPwlanhdr_to_ethhdr(union recv_frame *precvframe)
|
|||
u8 bsnaphdr;
|
||||
u8 *psnap_type;
|
||||
u8 mcastheadermac[] = {0x01, 0x00, 0x5e};
|
||||
|
||||
__be16 be_tmp;
|
||||
__le16 le_tmp;
|
||||
struct ieee80211_snap_hdr *psnap;
|
||||
|
||||
sint ret = _SUCCESS;
|
||||
|
@ -3328,27 +3311,24 @@ static sint MPwlanhdr_to_ethhdr(union recv_frame *precvframe)
|
|||
rmv_len = pattrib->hdrlen + pattrib->iv_len + (bsnaphdr ? SNAP_SIZE : 0);
|
||||
len = precvframe->u.hdr.len - rmv_len;
|
||||
|
||||
_rtw_memcpy(&be_tmp, ptr + rmv_len, 2);
|
||||
eth_type = ntohs((__be16)be_tmp); /* pattrib->ether_type */
|
||||
pattrib->eth_type = cpu_to_le16(eth_type);
|
||||
|
||||
_rtw_memcpy(ð_type, ptr + rmv_len, 2);
|
||||
eth_type = ntohs((unsigned short)eth_type); /* pattrib->ether_type */
|
||||
pattrib->eth_type = eth_type;
|
||||
|
||||
{
|
||||
ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0)));
|
||||
}
|
||||
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);
|
||||
|
||||
if (!bsnaphdr) {
|
||||
len = htons(len);
|
||||
_rtw_memcpy(ptr + 12, &len, 2);
|
||||
be_tmp = htons(len);
|
||||
_rtw_memcpy(ptr + 12, &be_tmp, 2);
|
||||
}
|
||||
|
||||
|
||||
len = htons(pattrib->seq_num);
|
||||
be_tmp = htons(le16_to_cpu(pattrib->seq_num));
|
||||
/* RTW_INFO("wlan seq = %d ,seq_num =%x\n",len,pattrib->seq_num); */
|
||||
_rtw_memcpy(ptr + 12, &len, 2);
|
||||
_rtw_memcpy(ptr + 12, &be_tmp, 2);
|
||||
if (adapter->mppriv.bRTWSmbCfg == _TRUE) {
|
||||
/* if(_rtw_memcmp(mcastheadermac, pattrib->dst, 3) == _TRUE) */ /* SimpleConfig Dest. */
|
||||
/* _rtw_memcpy(ptr+ETH_ALEN, pattrib->bssid, ETH_ALEN); */
|
||||
|
@ -3364,7 +3344,7 @@ static sint MPwlanhdr_to_ethhdr(union recv_frame *precvframe)
|
|||
}
|
||||
|
||||
|
||||
int mp_recv_frame(_adapter *padapter, union recv_frame *rframe)
|
||||
static int mp_recv_frame(_adapter *padapter, union recv_frame *rframe)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
|
||||
|
@ -3398,7 +3378,7 @@ int mp_recv_frame(_adapter *padapter, union recv_frame *rframe)
|
|||
type = GetFrameType(ptr);
|
||||
pattrib->to_fr_ds = get_tofr_ds(ptr);
|
||||
pattrib->frag_num = GetFragNum(ptr);
|
||||
pattrib->seq_num = GetSequence(ptr);
|
||||
pattrib->seq_num = cpu_to_le16(GetSequence(ptr));
|
||||
pattrib->pw_save = GetPwrMgt(ptr);
|
||||
pattrib->mfrag = GetMFrag(ptr);
|
||||
pattrib->mdata = GetMData(ptr);
|
||||
|
@ -3519,7 +3499,7 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
|||
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
u16 tmp_16bit = 0;
|
||||
__le16 tmp_16bit = 0;
|
||||
|
||||
u8 data_rate[] = {
|
||||
2, 4, 11, 22, /* CCK */
|
||||
|
@ -3546,16 +3526,13 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
|||
|
||||
/* tsft */
|
||||
if (pattrib->tsfl) {
|
||||
u64 tmp_64bit;
|
||||
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_TSFT);
|
||||
tmp_64bit = cpu_to_le64(pattrib->tsfl);
|
||||
memcpy(&hdr_buf[rt_len], &tmp_64bit, 8);
|
||||
rtap_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_TSFT);
|
||||
memcpy(&hdr_buf[rt_len], &pattrib->tsfl, 8);
|
||||
rt_len += 8;
|
||||
}
|
||||
|
||||
/* flags */
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_FLAGS);
|
||||
rtap_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_FLAGS);
|
||||
if (0)
|
||||
hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_CFP;
|
||||
|
||||
|
@ -3586,7 +3563,7 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
|||
|
||||
/* rate */
|
||||
if (pattrib->data_rate < 12) {
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_RATE);
|
||||
rtap_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE);
|
||||
if (pattrib->data_rate < 4) {
|
||||
/* CCK */
|
||||
hdr_buf[rt_len] = data_rate[pattrib->data_rate];
|
||||
|
@ -3599,8 +3576,8 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
|||
|
||||
/* channel */
|
||||
tmp_16bit = 0;
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_CHANNEL);
|
||||
tmp_16bit = CHAN2FREQ(rtw_get_oper_ch(padapter));
|
||||
rtap_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_CHANNEL);
|
||||
tmp_16bit = cpu_to_le16(CHAN2FREQ(rtw_get_oper_ch(padapter)));
|
||||
/*tmp_16bit = CHAN2FREQ(pHalData->current_channel);*/
|
||||
memcpy(&hdr_buf[rt_len], &tmp_16bit, 2);
|
||||
rt_len += 2;
|
||||
|
@ -3626,22 +3603,22 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
|||
rt_len += 2;
|
||||
|
||||
/* dBm Antenna Signal */
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL);
|
||||
rtap_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL);
|
||||
hdr_buf[rt_len] = pattrib->phy_info.RecvSignalPower;
|
||||
rt_len += 1;
|
||||
|
||||
/* Antenna */
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_ANTENNA);
|
||||
rtap_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_ANTENNA);
|
||||
hdr_buf[rt_len] = 0; /* pHalData->rf_type; */
|
||||
rt_len += 1;
|
||||
|
||||
/* RX flags */
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_RX_FLAGS);
|
||||
rtap_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RX_FLAGS);
|
||||
rt_len += 2;
|
||||
|
||||
/* MCS information */
|
||||
if (pattrib->data_rate >= 12 && pattrib->data_rate < 44) {
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_MCS);
|
||||
rtap_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
|
||||
/* known, flag */
|
||||
hdr_buf[rt_len] |= BIT1; /* MCS index known */
|
||||
|
||||
|
@ -3666,30 +3643,30 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
|||
|
||||
/* VHT */
|
||||
if (pattrib->data_rate >= 44 && pattrib->data_rate < 84) {
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_VHT);
|
||||
rtap_hdr->it_present |= cpu_to_le32((1 << IEEE80211_RADIOTAP_VHT));
|
||||
|
||||
/* known 16 bit, flag 8 bit */
|
||||
tmp_16bit = 0;
|
||||
|
||||
/* Bandwidth */
|
||||
tmp_16bit |= BIT6;
|
||||
tmp_16bit |= cpu_to_le16(BIT6);
|
||||
|
||||
/* Group ID */
|
||||
tmp_16bit |= BIT7;
|
||||
tmp_16bit |= cpu_to_le16(BIT7);
|
||||
|
||||
/* Partial AID */
|
||||
tmp_16bit |= BIT8;
|
||||
tmp_16bit |= cpu_to_le16(BIT8);
|
||||
|
||||
/* STBC */
|
||||
tmp_16bit |= BIT0;
|
||||
tmp_16bit |= cpu_to_le16(BIT0);
|
||||
hdr_buf[rt_len + 2] |= (pattrib->stbc & 0x01);
|
||||
|
||||
/* Guard interval */
|
||||
tmp_16bit |= BIT2;
|
||||
tmp_16bit |= cpu_to_le16(BIT2);
|
||||
hdr_buf[rt_len + 2] |= (pattrib->sgi & 0x01) << 2;
|
||||
|
||||
/* LDPC extra OFDM symbol */
|
||||
tmp_16bit |= BIT4;
|
||||
tmp_16bit |= cpu_to_le16(BIT4);
|
||||
hdr_buf[rt_len + 2] |= (pattrib->ldpc & 0x01) << 4;
|
||||
|
||||
memcpy(&hdr_buf[rt_len], &tmp_16bit, 2);
|
||||
|
@ -3755,7 +3732,7 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
|||
|
||||
}
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
|
||||
int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe)
|
||||
static int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
|
||||
|
@ -3802,7 +3779,7 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
#endif
|
||||
int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe)
|
||||
static int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
|
||||
|
@ -3838,7 +3815,7 @@ exit:
|
|||
}
|
||||
|
||||
/*#define DBG_RX_BMC_FRAME*/
|
||||
int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
|
||||
static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
union recv_frame *orig_prframe = prframe;
|
||||
|
@ -4293,7 +4270,7 @@ static void rx_process_link_qual(_adapter *padapter, union recv_frame *prframe)
|
|||
#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
||||
}
|
||||
|
||||
void rx_process_phy_info(_adapter *padapter, union recv_frame *rframe)
|
||||
static void rx_process_phy_info(_adapter *padapter, union recv_frame *rframe)
|
||||
{
|
||||
/* Check RSSI */
|
||||
rx_process_rssi(padapter, rframe);
|
||||
|
|
|
@ -43,7 +43,7 @@ u8 center_ch_2g_40m[CENTER_CH_2G_40M_NUM] = {
|
|||
11,
|
||||
};
|
||||
|
||||
u8 op_chs_of_cch_2g_40m[CENTER_CH_2G_40M_NUM][2] = {
|
||||
static u8 op_chs_of_cch_2g_40m[CENTER_CH_2G_40M_NUM][2] = {
|
||||
{1, 5}, /* 3 */
|
||||
{2, 6}, /* 4 */
|
||||
{3, 7}, /* 5 */
|
||||
|
@ -133,7 +133,7 @@ u8 center_ch_5g_20m_40m[CENTER_CH_5G_20M_NUM + CENTER_CH_5G_40M_NUM] = {
|
|||
/* G13 */173, 175, 177
|
||||
};
|
||||
|
||||
u8 op_chs_of_cch_5g_40m[CENTER_CH_5G_40M_NUM][2] = {
|
||||
static u8 op_chs_of_cch_5g_40m[CENTER_CH_5G_40M_NUM][2] = {
|
||||
{36, 40}, /* 38 */
|
||||
{44, 48}, /* 46 */
|
||||
{52, 56}, /* 54 */
|
||||
|
@ -160,7 +160,7 @@ u8 center_ch_5g_80m[CENTER_CH_5G_80M_NUM] = {
|
|||
/* G12 ~ G13*/171
|
||||
};
|
||||
|
||||
u8 op_chs_of_cch_5g_80m[CENTER_CH_5G_80M_NUM][4] = {
|
||||
static u8 op_chs_of_cch_5g_80m[CENTER_CH_5G_80M_NUM][4] = {
|
||||
{36, 40, 44, 48}, /* 42 */
|
||||
{52, 56, 60, 64}, /* 58 */
|
||||
{100, 104, 108, 112}, /* 106 */
|
||||
|
@ -170,13 +170,13 @@ u8 op_chs_of_cch_5g_80m[CENTER_CH_5G_80M_NUM][4] = {
|
|||
{165, 169, 173, 177}, /* 171 */
|
||||
};
|
||||
|
||||
u8 center_ch_5g_160m[CENTER_CH_5G_160M_NUM] = {
|
||||
static u8 center_ch_5g_160m[CENTER_CH_5G_160M_NUM] = {
|
||||
/* G00 ~ G03*/50,
|
||||
/* G04 ~ G07*/114,
|
||||
/* G10 ~ G13*/163
|
||||
};
|
||||
|
||||
u8 op_chs_of_cch_5g_160m[CENTER_CH_5G_160M_NUM][8] = {
|
||||
static u8 op_chs_of_cch_5g_160m[CENTER_CH_5G_160M_NUM][8] = {
|
||||
{36, 40, 44, 48, 52, 56, 60, 64}, /* 50 */
|
||||
{100, 104, 108, 112, 116, 120, 124, 128}, /* 114 */
|
||||
{149, 153, 157, 161, 165, 169, 173, 177}, /* 163 */
|
||||
|
@ -187,12 +187,12 @@ struct center_chs_ent_t {
|
|||
u8 *chs;
|
||||
};
|
||||
|
||||
struct center_chs_ent_t center_chs_2g_by_bw[] = {
|
||||
static struct center_chs_ent_t center_chs_2g_by_bw[] = {
|
||||
{CENTER_CH_2G_NUM, center_ch_2g},
|
||||
{CENTER_CH_2G_40M_NUM, center_ch_2g_40m},
|
||||
};
|
||||
|
||||
struct center_chs_ent_t center_chs_5g_by_bw[] = {
|
||||
static struct center_chs_ent_t center_chs_5g_by_bw[] = {
|
||||
{CENTER_CH_5G_20M_NUM, center_ch_5g_20m},
|
||||
{CENTER_CH_5G_40M_NUM, center_ch_5g_40m},
|
||||
{CENTER_CH_5G_80M_NUM, center_ch_5g_80m},
|
||||
|
@ -257,12 +257,12 @@ struct op_chs_ent_t {
|
|||
u8 *chs;
|
||||
};
|
||||
|
||||
struct op_chs_ent_t op_chs_of_cch_2g_by_bw[] = {
|
||||
static struct op_chs_ent_t op_chs_of_cch_2g_by_bw[] = {
|
||||
{1, center_ch_2g},
|
||||
{2, (u8 *)op_chs_of_cch_2g_40m},
|
||||
};
|
||||
|
||||
struct op_chs_ent_t op_chs_of_cch_5g_by_bw[] = {
|
||||
static struct op_chs_ent_t op_chs_of_cch_5g_by_bw[] = {
|
||||
{1, center_ch_5g_20m},
|
||||
{2, (u8 *)op_chs_of_cch_5g_40m},
|
||||
{4, (u8 *)op_chs_of_cch_5g_80m},
|
||||
|
@ -935,7 +935,7 @@ static const struct country_chplan country_chplan_map[] = {
|
|||
COUNTRY_CHPLAN_ENT("ZW", 0x26, 1, 0xF1), /* Zimbabwe */
|
||||
};
|
||||
|
||||
u16 const country_chplan_map_sz = sizeof(country_chplan_map) / sizeof(struct country_chplan);
|
||||
static u16 const country_chplan_map_sz = sizeof(country_chplan_map) / sizeof(struct country_chplan);
|
||||
|
||||
/*
|
||||
* rtw_get_chplan_from_country -
|
||||
|
@ -1006,7 +1006,7 @@ int rtw_ch_to_bb_gain_sel(int ch)
|
|||
return sel;
|
||||
}
|
||||
|
||||
s8 rtw_rf_get_kfree_tx_gain_offset(_adapter *padapter, u8 path, u8 ch)
|
||||
static s8 rtw_rf_get_kfree_tx_gain_offset(_adapter *padapter, u8 path, u8 ch)
|
||||
{
|
||||
s8 kfree_offset = 0;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
#include <usb_osintf.h>
|
||||
|
||||
static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 };
|
||||
static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 };
|
||||
|
@ -486,7 +487,7 @@ exit:
|
|||
*r_bmp_vht = bmp_vht;
|
||||
}
|
||||
|
||||
void rtw_get_shared_macid_tx_rate_bmp_by_bw(struct dvobj_priv *dvobj, u8 bw, u16 *r_bmp_cck_ofdm, u32 *r_bmp_ht, u32 *r_bmp_vht)
|
||||
static void rtw_get_shared_macid_tx_rate_bmp_by_bw(struct dvobj_priv *dvobj, u8 bw, u16 *r_bmp_cck_ofdm, u32 *r_bmp_ht, u32 *r_bmp_vht)
|
||||
{
|
||||
struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj);
|
||||
u16 bmp_cck_ofdm = 0;
|
||||
|
@ -1590,7 +1591,7 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib)
|
|||
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
|
||||
u8 qos_option = _FALSE;
|
||||
sint res = _SUCCESS;
|
||||
u16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
__le16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
|
||||
/* struct sta_info *psta; */
|
||||
|
||||
|
@ -2700,7 +2701,7 @@ s32 rtw_put_snap(u8 *data, u16 h_proto)
|
|||
snap->oui[1] = oui[1];
|
||||
snap->oui[2] = oui[2];
|
||||
|
||||
*(u16 *)(data + SNAP_SIZE) = htons(h_proto);
|
||||
*(__be16 *)(data + SNAP_SIZE) = htons(h_proto);
|
||||
|
||||
return SNAP_SIZE + sizeof(u16);
|
||||
}
|
||||
|
@ -3033,7 +3034,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
|
|||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void rtw_init_xmitframe(struct xmit_frame *pxframe)
|
||||
static void rtw_init_xmitframe(struct xmit_frame *pxframe)
|
||||
{
|
||||
if (pxframe != NULL) { /* default value setting */
|
||||
pxframe->buf_addr = NULL;
|
||||
|
@ -3295,7 +3296,7 @@ static struct xmit_frame *get_one_xmitframe(struct xmit_priv *pxmitpriv, struct
|
|||
return pxmitframe;
|
||||
}
|
||||
|
||||
struct xmit_frame *rtw_get_xframe(struct xmit_priv *pxmitpriv, int *num_frame)
|
||||
static struct xmit_frame *rtw_get_xframe(struct xmit_priv *pxmitpriv, int *num_frame)
|
||||
{
|
||||
_irqL irqL0;
|
||||
_list *sta_plist, *sta_phead;
|
||||
|
@ -3670,7 +3671,7 @@ void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_BR_EXT
|
||||
int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
|
||||
static int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
|
||||
{
|
||||
struct sk_buff *skb = *pskb;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
@ -3694,8 +3695,8 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
|
|||
if (!(skb->data[0] & 1) &&
|
||||
br_port &&
|
||||
memcmp(skb->data + MACADDRLEN, padapter->br_mac, MACADDRLEN) &&
|
||||
*((unsigned short *)(skb->data + MACADDRLEN * 2)) != __constant_htons(ETH_P_8021Q) &&
|
||||
*((unsigned short *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_IP) &&
|
||||
*((__be16 *)(skb->data + MACADDRLEN * 2)) != __constant_htons(ETH_P_8021Q) &&
|
||||
*((__be16 *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_IP) &&
|
||||
!memcmp(padapter->scdb_mac, skb->data + MACADDRLEN, MACADDRLEN) && padapter->scdb_entry) {
|
||||
memcpy(skb->data + MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN);
|
||||
padapter->scdb_entry->ageing_timer = jiffies;
|
||||
|
@ -3715,10 +3716,10 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
|
|||
}
|
||||
/* if SA == br_mac && skb== IP => copy SIP to br_ip ?? why */
|
||||
if (!memcmp(skb->data + MACADDRLEN, padapter->br_mac, MACADDRLEN) &&
|
||||
(*((unsigned short *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_IP)))
|
||||
(*((__be16 *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_IP)))
|
||||
memcpy(padapter->br_ip, skb->data + WLAN_ETHHDR_LEN + 12, 4);
|
||||
|
||||
if (*((unsigned short *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_IP)) {
|
||||
if (*((__be16 *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_IP)) {
|
||||
if (memcmp(padapter->scdb_mac, skb->data + MACADDRLEN, MACADDRLEN)) {
|
||||
|
||||
padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter,
|
||||
|
@ -3742,7 +3743,6 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
|
|||
_exit_critical_bh(&padapter->br_ext_lock, &irqL);
|
||||
#endif /* 1 */
|
||||
if (do_nat25) {
|
||||
int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method);
|
||||
if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) {
|
||||
struct sk_buff *newskb;
|
||||
|
||||
|
@ -3750,7 +3750,7 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
|
|||
skb_push(skb, 4);
|
||||
for (i = 0; i < 6; i++)
|
||||
*((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2));
|
||||
*((unsigned short *)(skb->data + MACADDRLEN * 2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((__be16 *)(skb->data + MACADDRLEN * 2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((unsigned short *)(skb->data + MACADDRLEN * 2 + 2)) = vlan_hdr;
|
||||
}
|
||||
|
||||
|
@ -3810,7 +3810,7 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
|
|||
skb_push(skb, 4);
|
||||
for (i = 0; i < 6; i++)
|
||||
*((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2));
|
||||
*((unsigned short *)(skb->data + MACADDRLEN * 2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((__be16 *)(skb->data + MACADDRLEN * 2)) = __constant_htons(ETH_P_8021Q);
|
||||
*((unsigned short *)(skb->data + MACADDRLEN * 2 + 2)) = vlan_hdr;
|
||||
}
|
||||
}
|
||||
|
@ -5222,7 +5222,7 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg)
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool rtw_sctx_chk_waring_status(int status)
|
||||
static bool rtw_sctx_chk_waring_status(int status)
|
||||
{
|
||||
switch (status) {
|
||||
case RTW_SCTX_DONE_UNKNOWN:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue