mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: More Sparse fixes
There are only a few more left. Most are in the P2P code Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
481d6c817d
commit
5b8f5bc69d
22 changed files with 212 additions and 393 deletions
|
@ -29,22 +29,10 @@
|
|||
#include <net/ip6_checksum.h>
|
||||
#endif
|
||||
|
||||
#if 1 // rtw_wifi_driver
|
||||
#include <drv_conf.h>
|
||||
#include <drv_types.h>
|
||||
#include "rtw_br_ext.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 <usb_osintf.h>
|
||||
|
||||
#ifdef CL_IPV6_PASS
|
||||
#ifdef __KERNEL__
|
||||
|
@ -99,7 +87,7 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1296,7 +1284,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
|||
unsigned short tagType, tagLen;
|
||||
int offset=0;
|
||||
|
||||
if((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == 0) {
|
||||
if((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == NULL) {
|
||||
DEBUG_ERR("Fail to find PTT_RELAY_SID in FADO!\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -2423,7 +2423,7 @@ exit:
|
|||
#endif
|
||||
|
||||
#if (RATE_ADAPTIVE_SUPPORT==1)
|
||||
void rpt_timer_setting_wk_hdl(struct adapter *padapter, u16 minRptTime)
|
||||
static void rpt_timer_setting_wk_hdl(struct adapter *padapter, u16 minRptTime)
|
||||
{
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RPT_TIMER_SETTING, (u8 *)(&minRptTime));
|
||||
}
|
||||
|
@ -2466,7 +2466,7 @@ exit:
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_ANTENNA_DIVERSITY
|
||||
void antenna_select_wk_hdl(struct adapter *padapter, u8 antenna)
|
||||
static void antenna_select_wk_hdl(struct adapter *padapter, u8 antenna)
|
||||
{
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_ANTENNA_DIVERSITY_SELECT, (u8 *)(&antenna));
|
||||
}
|
||||
|
@ -2524,12 +2524,12 @@ void power_saving_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
|
|||
}
|
||||
|
||||
//add for CONFIG_IEEE80211W, none 11w can use it
|
||||
void reset_securitypriv_hdl(struct adapter *padapter)
|
||||
static void reset_securitypriv_hdl(struct adapter *padapter)
|
||||
{
|
||||
rtw_reset_securitypriv(padapter);
|
||||
}
|
||||
|
||||
void free_assoc_resources_hdl(struct adapter *padapter)
|
||||
static void free_assoc_resources_hdl(struct adapter *padapter)
|
||||
{
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
}
|
||||
|
@ -2738,7 +2738,7 @@ exit:
|
|||
return res;
|
||||
}
|
||||
|
||||
s32 c2h_evt_hdl(struct adapter *adapter, struct c2h_evt_hdr *c2h_evt, c2h_id_filter filter)
|
||||
static s32 c2h_evt_hdl(struct adapter *adapter, struct c2h_evt_hdr *c2h_evt, c2h_id_filter filter)
|
||||
{
|
||||
s32 ret = _FAIL;
|
||||
u8 buf[16];
|
||||
|
|
|
@ -98,7 +98,7 @@ int proc_get_write_reg(char *page, char **start,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int proc_set_write_reg(struct file *file, const char *buffer,
|
||||
int proc_set_write_reg(struct file *file, const char __user *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
|
@ -182,7 +182,7 @@ int proc_get_read_reg(char *page, char **start,
|
|||
|
||||
}
|
||||
|
||||
int proc_set_read_reg(struct file *file, const char *buffer,
|
||||
int proc_set_read_reg(struct file *file, const char __user *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
char tmp[16];
|
||||
|
@ -675,7 +675,7 @@ int proc_get_rx_signal(char *page, char **start,
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_rx_signal(struct file *file, const char *buffer,
|
||||
int proc_set_rx_signal(struct file *file, const char __user *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
|
@ -733,7 +733,7 @@ int proc_get_ht_enable(char *page, char **start,
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_ht_enable(struct file *file, const char *buffer,
|
||||
int proc_set_ht_enable(struct file *file, const char __user *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
|
@ -780,7 +780,7 @@ int proc_get_cbw40_enable(char *page, char **start,
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_cbw40_enable(struct file *file, const char *buffer,
|
||||
int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
|
@ -829,7 +829,7 @@ int proc_get_ampdu_enable(char *page, char **start,
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_ampdu_enable(struct file *file, const char *buffer,
|
||||
int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
|
@ -898,7 +898,7 @@ int proc_get_rx_stbc(char *page, char **start,
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_rx_stbc(struct file *file, const char *buffer,
|
||||
int proc_set_rx_stbc(struct file *file, const char __user *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
|
@ -935,7 +935,7 @@ int proc_get_rssi_disp(char *page, char **start,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int proc_set_rssi_disp(struct file *file, const char *buffer,
|
||||
int proc_set_rssi_disp(struct file *file, const char __user *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
|
@ -1133,7 +1133,7 @@ int proc_get_best_channel(char *page, char **start,
|
|||
|
||||
}
|
||||
|
||||
int proc_set_best_channel(struct file *file, const char *buffer,
|
||||
int proc_set_best_channel(struct file *file, const char __user *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
|
@ -1183,7 +1183,7 @@ int proc_get_btcoex_dbg(char *page, char **start,
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_btcoex_dbg(struct file *file, const char *buffer,
|
||||
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;
|
||||
|
@ -1225,7 +1225,7 @@ int proc_get_sreset(char *page, char **start, off_t offset, int count, int *eof,
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_sreset(struct file *file, const char *buffer, unsigned long count, void *data)
|
||||
int proc_set_sreset(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);
|
||||
|
@ -1262,7 +1262,7 @@ int proc_get_odm_dbg_comp(char *page, char **start, off_t offset, int count, int
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_odm_dbg_comp(struct file *file, const char *buffer, unsigned long count, void *data)
|
||||
int proc_set_odm_dbg_comp(struct file *file, const char __user *buffer, unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
|
@ -1298,7 +1298,7 @@ int proc_get_odm_dbg_level(char *page, char **start, off_t offset, int count, in
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_odm_dbg_level(struct file *file, const char *buffer, unsigned long count, void *data)
|
||||
int proc_set_odm_dbg_level(struct file *file, const char __user *buffer, unsigned long count, void *data)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)data;
|
||||
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
|
@ -1334,7 +1334,7 @@ int proc_get_odm_adaptivity(char *page, char **start, off_t offset, int count, i
|
|||
return len;
|
||||
}
|
||||
|
||||
int proc_set_odm_adaptivity(struct file *file, const char *buffer, unsigned long count, void *data)
|
||||
int proc_set_odm_adaptivity(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);
|
||||
|
|
|
@ -525,7 +525,7 @@ Efuse_PgPacketWrite(IN struct adapter *pAdapter,
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
static int
|
||||
Efuse_PgPacketWrite_BT(IN struct adapter *pAdapter,
|
||||
IN u8 offset,
|
||||
IN u8 word_en,
|
||||
|
|
|
@ -1933,7 +1933,7 @@ int ieee80211_get_hdrlen(u16 fc)
|
|||
return hdrlen;
|
||||
}
|
||||
|
||||
int rtw_get_cipher_info(struct wlan_network *pnetwork)
|
||||
static int rtw_get_cipher_info(struct wlan_network *pnetwork)
|
||||
{
|
||||
u32 wpa_ielen;
|
||||
unsigned char *pbuf;
|
||||
|
|
|
@ -122,10 +122,7 @@ DeInitLed871x(
|
|||
|
||||
#define CONFIG_LED_REMOVE_HAL
|
||||
|
||||
void
|
||||
SwLedBlink(
|
||||
PLED_871x pLed
|
||||
)
|
||||
static void SwLedBlink(PLED_871x pLed)
|
||||
{
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
@ -240,10 +237,7 @@ SwLedBlink(
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
SwLedBlink1(
|
||||
PLED_871x pLed
|
||||
)
|
||||
static void SwLedBlink1(PLED_871x pLed)
|
||||
{
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
#ifndef CONFIG_LED_REMOVE_HAL
|
||||
|
@ -449,13 +443,9 @@ SwLedBlink1(
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SwLedBlink2(
|
||||
PLED_871x pLed
|
||||
)
|
||||
static void SwLedBlink2(PLED_871x pLed)
|
||||
{
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
@ -574,10 +564,7 @@ SwLedBlink2(
|
|||
|
||||
}
|
||||
|
||||
void
|
||||
SwLedBlink3(
|
||||
PLED_871x pLed
|
||||
)
|
||||
static void SwLedBlink3(PLED_871x pLed)
|
||||
{
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
@ -741,14 +728,9 @@ SwLedBlink3(
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SwLedBlink4(
|
||||
PLED_871x pLed
|
||||
)
|
||||
static void SwLedBlink4(PLED_871x pLed)
|
||||
{
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
struct led_priv *ledpriv = &(padapter->ledpriv);
|
||||
|
@ -940,14 +922,9 @@ SwLedBlink4(
|
|||
}
|
||||
|
||||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedBlink4 CurrLedState %d\n", pLed->CurrLedState));
|
||||
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SwLedBlink5(
|
||||
PLED_871x pLed
|
||||
)
|
||||
static void SwLedBlink5(PLED_871x pLed)
|
||||
{
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
@ -1058,14 +1035,9 @@ SwLedBlink5(
|
|||
}
|
||||
|
||||
RT_TRACE(_module_rtl8712_led_c_,_drv_info_,("SwLedBlink5 CurrLedState %d\n", pLed->CurrLedState));
|
||||
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SwLedBlink6(
|
||||
PLED_871x pLed
|
||||
)
|
||||
static void SwLedBlink6(PLED_871x pLed)
|
||||
{
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <wifi.h>
|
||||
#include <wlan_bssdef.h>
|
||||
#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);
|
||||
|
@ -2468,7 +2469,6 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
|
|||
&& (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) )
|
||||
{
|
||||
// expire NAT2.5 entry
|
||||
void nat25_db_expire(struct adapter *priv);
|
||||
nat25_db_expire(adapter);
|
||||
|
||||
if (adapter->pppoe_connection_in_progress > 0) {
|
||||
|
|
|
@ -119,7 +119,7 @@ extern void autosuspend_enter(struct adapter* padapter);
|
|||
extern int autoresume_enter(struct adapter* padapter);
|
||||
#endif
|
||||
|
||||
bool rtw_pwr_unassociated_idle(struct adapter *adapter)
|
||||
static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
|
||||
{
|
||||
struct adapter *buddy = adapter->pbuddy_adapter;
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
|
@ -328,7 +328,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);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <if_ether.h>
|
||||
#include <ethernet.h>
|
||||
#include <usb_ops.h>
|
||||
#include <usb_osintf.h>
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
#include <rtl8723a_hal.h>
|
||||
|
@ -591,20 +592,16 @@ exit:
|
|||
}
|
||||
|
||||
//decrypt and set the ivlen,icvlen of the recv_frame
|
||||
union recv_frame * decryptor(struct adapter *padapter,union recv_frame *precv_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;
|
||||
union recv_frame *return_packet=precv_frame;
|
||||
u32 res=_SUCCESS;
|
||||
;
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("prxstat->decrypted=%x prxattrib->encrypt = 0x%03x\n",prxattrib->bdecrypted,prxattrib->encrypt));
|
||||
|
||||
if(prxattrib->encrypt>0)
|
||||
{
|
||||
if(prxattrib->encrypt>0) {
|
||||
u8 *iv = precv_frame->u.hdr.rx_data+prxattrib->hdrlen;
|
||||
prxattrib->key_index = ( ((iv[3])>>6)&0x3) ;
|
||||
|
||||
|
@ -693,7 +690,7 @@ union recv_frame * decryptor(struct adapter *padapter,union recv_frame *precv_fr
|
|||
|
||||
}
|
||||
//###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;
|
||||
uint auth_alg;
|
||||
|
@ -2463,7 +2460,7 @@ exit:
|
|||
|
||||
|
||||
//perform defrag
|
||||
union recv_frame * recvframe_defrag(struct adapter *adapter,_queue *defrag_q)
|
||||
static union recv_frame * recvframe_defrag(struct adapter *adapter,_queue *defrag_q)
|
||||
{
|
||||
_list *plist, *phead;
|
||||
u8 *data,wlanhdr_offset;
|
||||
|
@ -2826,7 +2823,6 @@ int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
|
||||
if( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) )
|
||||
{
|
||||
int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb);
|
||||
if (nat25_handle_frame(padapter, sub_skb) == -1) {
|
||||
//priv->ext_stats.rx_data_drops++;
|
||||
//DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n");
|
||||
|
@ -2867,7 +2863,7 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
|
||||
static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
|
||||
{
|
||||
u8 wsize = preorder_ctrl->wsize_b;
|
||||
u16 wend = (preorder_ctrl->indicate_seq + wsize -1) & 0xFFF;//% 4096;
|
||||
|
@ -3136,8 +3132,7 @@ int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctr
|
|||
|
||||
}
|
||||
|
||||
int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe);
|
||||
int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe)
|
||||
static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
_irqL irql;
|
||||
int retval = _SUCCESS;
|
||||
|
@ -3145,23 +3140,19 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
struct recv_reorder_ctrl *preorder_ctrl = prframe->u.hdr.preorder_ctrl;
|
||||
_queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
|
||||
|
||||
if(!pattrib->amsdu)
|
||||
{
|
||||
if(!pattrib->amsdu) {
|
||||
//s1.
|
||||
wlanhdr_to_ethhdr(prframe);
|
||||
|
||||
//if ((pattrib->qos!=1) /*|| pattrib->priority!=0 || IS_MCAST(pattrib->ra)*/
|
||||
// || (pattrib->eth_type==0x0806) || (pattrib->ack_policy!=0))
|
||||
if (pattrib->qos!=1)
|
||||
{
|
||||
if (pattrib->qos!=1) {
|
||||
if ((padapter->bDriverStopped == false) &&
|
||||
(padapter->bSurpriseRemoved == false))
|
||||
{
|
||||
(padapter->bSurpriseRemoved == false)) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("@@@@ recv_indicatepkt_reorder -recv_func recv_indicatepkt\n" ));
|
||||
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
|
@ -3169,11 +3160,8 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
#endif
|
||||
|
||||
return _FAIL;
|
||||
|
||||
}
|
||||
|
||||
if (preorder_ctrl->enable == false)
|
||||
{
|
||||
if (preorder_ctrl->enable == false) {
|
||||
//indicate this recv_frame
|
||||
preorder_ctrl->indicate_seq = pattrib->seq_num;
|
||||
#ifdef DBG_RX_SEQ
|
||||
|
@ -3197,12 +3185,8 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
return _SUCCESS;
|
||||
#endif
|
||||
|
||||
}
|
||||
else if(pattrib->amsdu==1) //temp filter -> means didn't support A-MSDUs in a A-MPDU
|
||||
{
|
||||
if (preorder_ctrl->enable == false)
|
||||
{
|
||||
} 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;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
|
@ -3226,10 +3210,6 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
return retval;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
_enter_critical_bh(&ppending_recvframe_queue->lock, &irql);
|
||||
|
||||
|
@ -3238,34 +3218,21 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
preorder_ctrl->indicate_seq, pattrib->seq_num));
|
||||
|
||||
//s2. check if winstart_b(indicate_seq) needs to been updated
|
||||
if(!check_indicate_seq(preorder_ctrl, pattrib->seq_num))
|
||||
{
|
||||
//pHTInfo->RxReorderDropCounter++;
|
||||
//ReturnRFDList(Adapter, pRfd);
|
||||
//RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("RxReorderIndicatePacket() ==> Packet Drop!!\n"));
|
||||
//_exit_critical_ex(&ppending_recvframe_queue->lock, &irql);
|
||||
//return _FAIL;
|
||||
|
||||
if(!check_indicate_seq(preorder_ctrl, pattrib->seq_num)) {
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s check_indicate_seq fail\n", __FUNCTION__);
|
||||
#endif
|
||||
goto _err_exit;
|
||||
}
|
||||
|
||||
|
||||
//s3. Insert all packet into Reorder Queue to maintain its ordering.
|
||||
if(!enqueue_reorder_recvframe(preorder_ctrl, prframe))
|
||||
{
|
||||
//DbgPrint("recv_indicatepkt_reorder, enqueue_reorder_recvframe fail!\n");
|
||||
//_exit_critical_ex(&ppending_recvframe_queue->lock, &irql);
|
||||
//return _FAIL;
|
||||
if(!enqueue_reorder_recvframe(preorder_ctrl, prframe)) {
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
DBG_871X("DBG_RX_DROP_FRAME %s enqueue_reorder_recvframe fail\n", __FUNCTION__);
|
||||
#endif
|
||||
goto _err_exit;
|
||||
}
|
||||
|
||||
|
||||
//s4.
|
||||
// Indication process.
|
||||
// After Packet dropping and Sliding Window shifting as above, we can now just indicate the packets
|
||||
|
@ -3276,31 +3243,20 @@ int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *prframe
|
|||
// 2. All packets with SeqNum larger than or equal to WinStart => Buffer it.
|
||||
//
|
||||
|
||||
//recv_indicatepkts_in_order(padapter, preorder_ctrl, true);
|
||||
if(recv_indicatepkts_in_order(padapter, preorder_ctrl, false)==true)
|
||||
{
|
||||
if(recv_indicatepkts_in_order(padapter, preorder_ctrl, false)) {
|
||||
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
}
|
||||
|
||||
|
||||
_success_exit:
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
_err_exit:
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
void rtw_reordering_ctrl_timeout_handler(void *pcontext)
|
||||
{
|
||||
_irqL irql;
|
||||
|
@ -3403,7 +3359,7 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram
|
|||
|
||||
}
|
||||
|
||||
int recv_func_prehandle(struct adapter *padapter, union recv_frame *rframe)
|
||||
static int recv_func_prehandle(struct adapter *padapter, union recv_frame *rframe)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
|
||||
|
@ -3424,7 +3380,7 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int recv_func_posthandle(struct adapter *padapter, union recv_frame *prframe)
|
||||
static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
union recv_frame *orig_prframe = prframe;
|
||||
|
|
|
@ -31,7 +31,7 @@ struct ch_freq {
|
|||
u32 frequency;
|
||||
};
|
||||
|
||||
struct ch_freq ch_freq_map[] = {
|
||||
static struct ch_freq ch_freq_map[] = {
|
||||
{1, 2412},{2, 2417},{3, 2422},{4, 2427},{5, 2432},
|
||||
{6, 2437},{7, 2442},{8, 2447},{9, 2452},{10, 2457},
|
||||
{11, 2462},{12, 2467},{13, 2472},{14, 2484},
|
||||
|
@ -53,7 +53,7 @@ struct ch_freq ch_freq_map[] = {
|
|||
{216, 5080},/* Japan, means J16 */
|
||||
};
|
||||
|
||||
int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
|
||||
static int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
|
||||
|
||||
u32 rtw_ch2freq(u32 channel)
|
||||
{
|
||||
|
|
|
@ -1971,42 +1971,27 @@ static sint aes_decipher(u8 *key, uint hdrlen,
|
|||
|
||||
u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
|
||||
{ // exclude ICV
|
||||
|
||||
|
||||
/*static*/
|
||||
// unsigned char message[MAX_MSG_SIZE];
|
||||
|
||||
|
||||
/* Intermediate Buffers */
|
||||
|
||||
|
||||
sint length;
|
||||
int length;
|
||||
u8 *pframe,*prwskey; //, *payload,*iv
|
||||
struct sta_info *stainfo;
|
||||
struct rx_pkt_attrib *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib;
|
||||
struct security_priv *psecuritypriv=&padapter->securitypriv;
|
||||
// struct recv_priv *precvpriv=&padapter->recvpriv;
|
||||
u32 res=_SUCCESS;
|
||||
;
|
||||
pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
|
||||
//4 start to encrypt each fragment
|
||||
if((prxattrib->encrypt==_AES_)){
|
||||
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] );
|
||||
if (stainfo!=NULL){
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_decrypt: stainfo!=NULL!!!\n"));
|
||||
|
||||
if(IS_MCAST(prxattrib->ra))
|
||||
{
|
||||
if(IS_MCAST(prxattrib->ra)) {
|
||||
static u32 start = 0;
|
||||
static u32 no_gkey_bc_cnt = 0;
|
||||
static u32 no_gkey_mc_cnt = 0;
|
||||
|
||||
//in concurrent we should use sw descrypt in group key, so we remove this message
|
||||
//DBG_871X("rx bc/mc packets, to perform sw rtw_aes_decrypt\n");
|
||||
//prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
|
||||
if(psecuritypriv->binstallGrpkey==false)
|
||||
{
|
||||
if (!psecuritypriv->binstallGrpkey) {
|
||||
res=_FAIL;
|
||||
|
||||
if (start == 0)
|
||||
|
@ -2039,54 +2024,25 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
|
|||
no_gkey_mc_cnt = 0;
|
||||
|
||||
prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey;
|
||||
if(psecuritypriv->dot118021XGrpKeyid != prxattrib->key_index)
|
||||
{
|
||||
if(psecuritypriv->dot118021XGrpKeyid != prxattrib->key_index) {
|
||||
DBG_871X("not match packet_index=%d, install_index=%d \n"
|
||||
, prxattrib->key_index, psecuritypriv->dot118021XGrpKeyid);
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
prwskey=&stainfo->dot118021x_UncstKey.skey[0];
|
||||
}
|
||||
|
||||
length= ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
|
||||
/*// add for CONFIG_IEEE80211W, debug
|
||||
if(0)
|
||||
printk("@@@@@@@@@@@@@@@@@@ length=%d, prxattrib->hdrlen=%d, prxattrib->pkt_len=%d \n"
|
||||
, length, prxattrib->hdrlen, prxattrib->pkt_len);
|
||||
if(0)
|
||||
{
|
||||
int no;
|
||||
//test print PSK
|
||||
printk("PSK key below:\n");
|
||||
for(no=0;no<16;no++)
|
||||
printk(" %02x ", prwskey[no]);
|
||||
printk("\n");
|
||||
}
|
||||
if(0)
|
||||
{
|
||||
int no;
|
||||
//test print PSK
|
||||
printk("frame:\n");
|
||||
for(no=0;no<prxattrib->pkt_len;no++)
|
||||
printk(" %02x ", pframe[no]);
|
||||
printk("\n");
|
||||
}*/
|
||||
|
||||
res= aes_decipher(prwskey,prxattrib->hdrlen,pframe, length);
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_encrypt: stainfo==NULL!!!\n"));
|
||||
res=_FAIL;
|
||||
}
|
||||
|
||||
}
|
||||
;
|
||||
exit:
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -680,43 +680,29 @@ void read_cam(struct adapter *padapter ,u8 entry)
|
|||
void write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key)
|
||||
{
|
||||
unsigned int i, val, addr;
|
||||
//unsigned int cmd;
|
||||
int j;
|
||||
u32 cam_val[2];
|
||||
|
||||
addr = entry << 3;
|
||||
|
||||
for (j = 5; j >= 0; j--)
|
||||
{
|
||||
switch (j)
|
||||
{
|
||||
case 0:
|
||||
val = (ctrl | (mac[0] << 16) | (mac[1] << 24) );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
val = (mac[2] | ( mac[3] << 8) | (mac[4] << 16) | (mac[5] << 24));
|
||||
break;
|
||||
|
||||
default:
|
||||
i = (j - 2) << 2;
|
||||
val = (key[i] | (key[i+1] << 8) | (key[i+2] << 16) | (key[i+3] << 24));
|
||||
break;
|
||||
|
||||
for (j = 5; j >= 0; j--) {
|
||||
switch (j) {
|
||||
case 0:
|
||||
val = (ctrl | (mac[0] << 16) | (mac[1] << 24) );
|
||||
break;
|
||||
case 1:
|
||||
val = (mac[2] | ( mac[3] << 8) | (mac[4] << 16) | (mac[5] << 24));
|
||||
break;
|
||||
default:
|
||||
i = (j - 2) << 2;
|
||||
val = (key[i] | (key[i+1] << 8) | (key[i+2] << 16) | (key[i+3] << 24));
|
||||
break;
|
||||
}
|
||||
|
||||
cam_val[0] = val;
|
||||
cam_val[1] = addr + (unsigned int)j;
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_WRITE, (u8 *)cam_val);
|
||||
|
||||
//rtw_write32(padapter, WCAMI, val);
|
||||
|
||||
//cmd = CAM_POLLINIG | CAM_WRITE | (addr + j);
|
||||
//rtw_write32(padapter, RWCAM, cmd);
|
||||
|
||||
//DBG_871X("%s=> cam write: %x, %x\n",__FUNCTION__, cmd, val);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -724,7 +710,6 @@ void write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key)
|
|||
void clear_cam_entry(struct adapter *padapter, u8 entry)
|
||||
{
|
||||
unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
unsigned char null_key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
write_cam(padapter, entry, 0, null_sta, null_key);
|
||||
|
@ -736,10 +721,8 @@ int allocate_fw_sta_entry(struct adapter *padapter)
|
|||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
for (mac_id = IBSS_START_MAC_ID; mac_id < NUM_STA; mac_id++)
|
||||
{
|
||||
if (pmlmeinfo->FW_sta_info[mac_id].status == 0)
|
||||
{
|
||||
for (mac_id = IBSS_START_MAC_ID; mac_id < NUM_STA; mac_id++) {
|
||||
if (pmlmeinfo->FW_sta_info[mac_id].status == 0) {
|
||||
pmlmeinfo->FW_sta_info[mac_id].status = 1;
|
||||
pmlmeinfo->FW_sta_info[mac_id].retry = 0;
|
||||
break;
|
||||
|
@ -759,14 +742,10 @@ void flush_all_cam_entry(struct adapter *padapter)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
//if(check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_))
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED) == false)
|
||||
{
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED) == false) {
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE))
|
||||
{
|
||||
} else {
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
u8 cam_id;//cam_entry
|
||||
|
@ -784,9 +763,7 @@ void flush_all_cam_entry(struct adapter *padapter)
|
|||
//clear_cam_entry(padapter, cam_id);
|
||||
rtw_clearstakey_cmd(padapter, (u8*)psta, cam_id, false);
|
||||
}
|
||||
}
|
||||
else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
|
||||
{
|
||||
} else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
|
||||
//clear cam when ap free per sta_info
|
||||
}
|
||||
}
|
||||
|
@ -796,8 +773,7 @@ void flush_all_cam_entry(struct adapter *padapter)
|
|||
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
_rtw_memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info));
|
||||
|
||||
memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info));
|
||||
}
|
||||
|
||||
#if defined(CONFIG_P2P) && defined(CONFIG_WFD)
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <ip.h>
|
||||
#include <usb_ops.h>
|
||||
#include "rtw_br_ext.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 };
|
||||
|
@ -2984,7 +2985,6 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
|
|||
_irqL irqL;
|
||||
//if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true)
|
||||
{
|
||||
void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb);
|
||||
int res, is_vlan_tag=0, i, do_nat25=1;
|
||||
unsigned short vlan_hdr=0;
|
||||
void *br_port = NULL;
|
||||
|
@ -3052,7 +3052,6 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
|
|||
#endif // 1
|
||||
if (do_nat25)
|
||||
{
|
||||
int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method);
|
||||
if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) {
|
||||
struct sk_buff *newskb;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue