Commit d76eaf7e authored by Larry Finger's avatar Larry Finger

staging: rtl8192e: Cleanup checkpatch -f warnings and errors - Part VI

Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
parent 81108afb
...@@ -21,38 +21,38 @@ ...@@ -21,38 +21,38 @@
#include "rtllib_endianfree.h" #include "rtllib_endianfree.h"
#define BIT0 0x00000001 #define BIT0 0x00000001
#define BIT1 0x00000002 #define BIT1 0x00000002
#define BIT2 0x00000004 #define BIT2 0x00000004
#define BIT3 0x00000008 #define BIT3 0x00000008
#define BIT4 0x00000010 #define BIT4 0x00000010
#define BIT5 0x00000020 #define BIT5 0x00000020
#define BIT6 0x00000040 #define BIT6 0x00000040
#define BIT7 0x00000080 #define BIT7 0x00000080
#define BIT8 0x00000100 #define BIT8 0x00000100
#define BIT9 0x00000200 #define BIT9 0x00000200
#define BIT10 0x00000400 #define BIT10 0x00000400
#define BIT11 0x00000800 #define BIT11 0x00000800
#define BIT12 0x00001000 #define BIT12 0x00001000
#define BIT13 0x00002000 #define BIT13 0x00002000
#define BIT14 0x00004000 #define BIT14 0x00004000
#define BIT15 0x00008000 #define BIT15 0x00008000
#define BIT16 0x00010000 #define BIT16 0x00010000
#define BIT17 0x00020000 #define BIT17 0x00020000
#define BIT18 0x00040000 #define BIT18 0x00040000
#define BIT19 0x00080000 #define BIT19 0x00080000
#define BIT20 0x00100000 #define BIT20 0x00100000
#define BIT21 0x00200000 #define BIT21 0x00200000
#define BIT22 0x00400000 #define BIT22 0x00400000
#define BIT23 0x00800000 #define BIT23 0x00800000
#define BIT24 0x01000000 #define BIT24 0x01000000
#define BIT25 0x02000000 #define BIT25 0x02000000
#define BIT26 0x04000000 #define BIT26 0x04000000
#define BIT27 0x08000000 #define BIT27 0x08000000
#define BIT28 0x10000000 #define BIT28 0x10000000
#define BIT29 0x20000000 #define BIT29 0x20000000
#define BIT30 0x40000000 #define BIT30 0x40000000
#define BIT31 0x80000000 #define BIT31 0x80000000
union qos_tsinfo { union qos_tsinfo {
u8 charData[3]; u8 charData[3];
...@@ -67,14 +67,13 @@ union qos_tsinfo { ...@@ -67,14 +67,13 @@ union qos_tsinfo {
u8 ucTSInfoAckPolicy:2; u8 ucTSInfoAckPolicy:2;
u8 ucSchedule:1; u8 ucSchedule:1;
u8 ucReserved:7; u8 ucReserved:7;
}field; } field;
}; };
union tspec_body { union tspec_body {
u8 charData[55]; u8 charData[55];
struct struct {
{
union qos_tsinfo TSInfo; union qos_tsinfo TSInfo;
u16 NominalMSDUsize; u16 NominalMSDUsize;
u16 MaxMSDUsize; u16 MaxMSDUsize;
...@@ -105,9 +104,10 @@ struct wmm_tspec { ...@@ -105,9 +104,10 @@ struct wmm_tspec {
}; };
struct octet_string { struct octet_string {
u8 *Octet; u8 *Octet;
u16 Length; u16 Length;
}; };
#define MAX_WMMELE_LENGTH 64 #define MAX_WMMELE_LENGTH 64
#define QOS_MODE u32 #define QOS_MODE u32
...@@ -143,28 +143,43 @@ enum ack_policy { ...@@ -143,28 +143,43 @@ enum ack_policy {
}; };
#define SET_WMM_QOS_INFO_FIELD(_pStart, _val) WriteEF1Byte(_pStart, _val) #define SET_WMM_QOS_INFO_FIELD(_pStart, _val) \
WriteEF1Byte(_pStart, _val)
#define GET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 4) #define GET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart) \
#define SET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 4, _val) LE_BITS_TO_1BYTE(_pStart, 0, 4)
#define SET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart, _val) \
SET_BITS_TO_LE_1BYTE(_pStart, 0, 4, _val)
#define GET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 7, 1) #define GET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart) \
#define SET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 7, 1, _val) LE_BITS_TO_1BYTE(_pStart, 7, 1)
#define SET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart, _val) \
SET_BITS_TO_LE_1BYTE(_pStart, 7, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 1) #define GET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart) \
#define SET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 1, _val) LE_BITS_TO_1BYTE(_pStart, 0, 1)
#define SET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart, _val) \
SET_BITS_TO_LE_1BYTE(_pStart, 0, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 1, 1) #define GET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart) \
#define SET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 1, 1, _val) LE_BITS_TO_1BYTE(_pStart, 1, 1)
#define SET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart, _val) \
SET_BITS_TO_LE_1BYTE(_pStart, 1, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 2, 1) #define GET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart) \
#define SET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 2, 1, _val) LE_BITS_TO_1BYTE(_pStart, 2, 1)
#define SET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart, _val) \
SET_BITS_TO_LE_1BYTE(_pStart, 2, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 3, 1) #define GET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart) \
#define SET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 3, 1, _val) LE_BITS_TO_1BYTE(_pStart, 3, 1)
#define SET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart, _val) \
SET_BITS_TO_LE_1BYTE(_pStart, 3, 1, _val)
#define GET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart) LE_BITS_TO_1BYTE(_pStart, 5, 2) #define GET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart) \
#define SET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 5, 2, _val) LE_BITS_TO_1BYTE(_pStart, 5, 2)
#define SET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart, _val) \
SET_BITS_TO_LE_1BYTE(_pStart, 5, 2, _val)
enum qos_ie_source { enum qos_ie_source {
QOSIE_SRC_ADDTSREQ, QOSIE_SRC_ADDTSREQ,
...@@ -186,26 +201,40 @@ enum qos_ie_source { ...@@ -186,26 +201,40 @@ enum qos_ie_source {
#define AC_PARAM_SIZE 4 #define AC_PARAM_SIZE 4
#define GET_WMM_AC_PARAM_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 4) ) #define GET_WMM_AC_PARAM_AIFSN(_pStart) \
#define SET_WMM_AC_PARAM_AIFSN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 0, 4, _val) ((u8)LE_BITS_TO_4BYTE(_pStart, 0, 4))
#define SET_WMM_AC_PARAM_AIFSN(_pStart, _val) \
SET_BITS_TO_LE_4BYTE(_pStart, 0, 4, _val)
#define GET_WMM_AC_PARAM_ACM(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 4, 1) ) #define GET_WMM_AC_PARAM_ACM(_pStart) \
#define SET_WMM_AC_PARAM_ACM(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 4, 1, _val) ((u8)LE_BITS_TO_4BYTE(_pStart, 4, 1))
#define SET_WMM_AC_PARAM_ACM(_pStart, _val) \
SET_BITS_TO_LE_4BYTE(_pStart, 4, 1, _val)
#define GET_WMM_AC_PARAM_ACI(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 5, 2) ) #define GET_WMM_AC_PARAM_ACI(_pStart) \
#define SET_WMM_AC_PARAM_ACI(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 5, 2, _val) ((u8)LE_BITS_TO_4BYTE(_pStart, 5, 2))
#define SET_WMM_AC_PARAM_ACI(_pStart, _val) \
SET_BITS_TO_LE_4BYTE(_pStart, 5, 2, _val)
#define GET_WMM_AC_PARAM_ACI_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 8) ) #define GET_WMM_AC_PARAM_ACI_AIFSN(_pStart) \
#define SET_WMM_AC_PARAM_ACI_AIFSN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 0, 8, _val) ((u8)LE_BITS_TO_4BYTE(_pStart, 0, 8))
#define SET_WMM_AC_PARAM_ACI_AIFSN(_pStart, _val) \
SET_BITS_TO_LE_4BYTE(_pStart, 0, 8, _val)
#define GET_WMM_AC_PARAM_ECWMIN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 8, 4) ) #define GET_WMM_AC_PARAM_ECWMIN(_pStart) \
#define SET_WMM_AC_PARAM_ECWMIN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 8, 4, _val) ((u8)LE_BITS_TO_4BYTE(_pStart, 8, 4))
#define SET_WMM_AC_PARAM_ECWMIN(_pStart, _val) \
SET_BITS_TO_LE_4BYTE(_pStart, 8, 4, _val)
#define GET_WMM_AC_PARAM_ECWMAX(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 12, 4) ) #define GET_WMM_AC_PARAM_ECWMAX(_pStart) \
#define SET_WMM_AC_PARAM_ECWMAX(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 12, 4, _val) ((u8)LE_BITS_TO_4BYTE(_pStart, 12, 4))
#define SET_WMM_AC_PARAM_ECWMAX(_pStart, _val) \
SET_BITS_TO_LE_4BYTE(_pStart, 12, 4, _val)
#define GET_WMM_AC_PARAM_TXOP_LIMIT(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 16, 16) ) #define GET_WMM_AC_PARAM_TXOP_LIMIT(_pStart) \
#define SET_WMM_AC_PARAM_TXOP_LIMIT(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 16, 16, _val) ((u8)LE_BITS_TO_4BYTE(_pStart, 16, 16))
#define SET_WMM_AC_PARAM_TXOP_LIMIT(_pStart, _val) \
SET_BITS_TO_LE_4BYTE(_pStart, 16, 16, _val)
...@@ -255,13 +284,13 @@ struct acm { ...@@ -255,13 +284,13 @@ struct acm {
union qos_tclas { union qos_tclas {
struct _TYPE_GENERAL{ struct _TYPE_GENERAL {
u8 Priority; u8 Priority;
u8 ClassifierType; u8 ClassifierType;
u8 Mask; u8 Mask;
} TYPE_GENERAL; } TYPE_GENERAL;
struct _TYPE0_ETH{ struct _TYPE0_ETH {
u8 Priority; u8 Priority;
u8 ClassifierType; u8 ClassifierType;
u8 Mask; u8 Mask;
...@@ -270,7 +299,7 @@ union qos_tclas { ...@@ -270,7 +299,7 @@ union qos_tclas {
u16 Type; u16 Type;
} TYPE0_ETH; } TYPE0_ETH;
struct _TYPE1_IPV4{ struct _TYPE1_IPV4 {
u8 Priority; u8 Priority;
u8 ClassifierType; u8 ClassifierType;
u8 Mask; u8 Mask;
...@@ -284,7 +313,7 @@ union qos_tclas { ...@@ -284,7 +313,7 @@ union qos_tclas {
u8 Reserved; u8 Reserved;
} TYPE1_IPV4; } TYPE1_IPV4;
struct _TYPE1_IPV6{ struct _TYPE1_IPV6 {
u8 Priority; u8 Priority;
u8 ClassifierType; u8 ClassifierType;
u8 Mask; u8 Mask;
...@@ -296,7 +325,7 @@ union qos_tclas { ...@@ -296,7 +325,7 @@ union qos_tclas {
u8 FlowLabel[3]; u8 FlowLabel[3];
} TYPE1_IPV6; } TYPE1_IPV6;
struct _TYPE2_8021Q{ struct _TYPE2_8021Q {
u8 Priority; u8 Priority;
u8 ClassifierType; u8 ClassifierType;
u8 Mask; u8 Mask;
...@@ -317,20 +346,20 @@ struct qos_tstream { ...@@ -317,20 +346,20 @@ struct qos_tstream {
}; };
struct sta_qos { struct sta_qos {
u8 WMMIEBuf[MAX_WMMELE_LENGTH]; u8 WMMIEBuf[MAX_WMMELE_LENGTH];
u8* WMMIE; u8 *WMMIE;
QOS_MODE QosCapability; QOS_MODE QosCapability;
QOS_MODE CurrentQosMode; QOS_MODE CurrentQosMode;
AC_UAPSD b4ac_Uapsd; AC_UAPSD b4ac_Uapsd;
AC_UAPSD Curr4acUapsd; AC_UAPSD Curr4acUapsd;
u8 bInServicePeriod; u8 bInServicePeriod;
u8 MaxSPLength; u8 MaxSPLength;
int NumBcnBeforeTrigger; int NumBcnBeforeTrigger;
u8 * pWMMInfoEle; u8 *pWMMInfoEle;
u8 WMMParamEle[WMM_PARAM_ELEMENT_SIZE]; u8 WMMParamEle[WMM_PARAM_ELEMENT_SIZE];
struct acm acm[4]; struct acm acm[4];
enum acm_method AcmMethod; enum acm_method AcmMethod;
...@@ -347,67 +376,69 @@ struct sta_qos { ...@@ -347,67 +376,69 @@ struct sta_qos {
}; };
#define QBSS_LOAD_SIZE 5 #define QBSS_LOAD_SIZE 5
#define GET_QBSS_LOAD_STA_COUNT(__pStart) ReadEF2Byte(__pStart) #define GET_QBSS_LOAD_STA_COUNT(__pStart) \
#define SET_QBSS_LOAD_STA_COUNT(__pStart, __Value) WriteEF2Byte(__pStart, __Value) ReadEF2Byte(__pStart)
#define GET_QBSS_LOAD_CHNL_UTILIZATION(__pStart) ReadEF1Byte((u8*)(__pStart) + 2) #define SET_QBSS_LOAD_STA_COUNT(__pStart, __Value) \
#define SET_QBSS_LOAD_CHNL_UTILIZATION(__pStart, __Value) WriteEF1Byte((u8*)(__pStart) + 2, __Value) WriteEF2Byte(__pStart, __Value)
#define GET_QBSS_LOAD_AVAILABLE_CAPACITY(__pStart) ReadEF2Byte((u8*)(__pStart) + 3) #define GET_QBSS_LOAD_CHNL_UTILIZATION(__pStart) \
#define SET_QBSS_LOAD_AVAILABLE_CAPACITY(__pStart, __Value) WriteEF2Byte((u8*)(__pStart) + 3, __Value) ReadEF1Byte((u8 *)(__pStart) + 2)
#define SET_QBSS_LOAD_CHNL_UTILIZATION(__pStart, __Value) \
WriteEF1Byte((u8 *)(__pStart) + 2, __Value)
#define GET_QBSS_LOAD_AVAILABLE_CAPACITY(__pStart) \
ReadEF2Byte((u8 *)(__pStart) + 3)
#define SET_QBSS_LOAD_AVAILABLE_CAPACITY(__pStart, __Value) \
WriteEF2Byte((u8 *)(__pStart) + 3, __Value)
struct bss_qos { struct bss_qos {
QOS_MODE bdQoSMode;
QOS_MODE bdQoSMode; u8 bdWMMIEBuf[MAX_WMMELE_LENGTH];
u8 bdWMMIEBuf[MAX_WMMELE_LENGTH];
struct octet_string bdWMMIE; struct octet_string bdWMMIE;
enum qos_ele_subtype EleSubType; enum qos_ele_subtype EleSubType;
u8* pWMMInfoEle; u8 *pWMMInfoEle;
u8* pWMMParamEle; u8 *pWMMParamEle;
u8 QBssLoad[QBSS_LOAD_SIZE]; u8 QBssLoad[QBSS_LOAD_SIZE];
bool bQBssLoadValid; bool bQBssLoadValid;
}; };
#define sQoSCtlLng 2 #define sQoSCtlLng 2
#define QOS_CTRL_LEN(_QosMode) ( (_QosMode > QOS_DISABLE)? sQoSCtlLng : 0 ) #define QOS_CTRL_LEN(_QosMode) ((_QosMode > QOS_DISABLE) ? sQoSCtlLng : 0)
#define IsACValid(ac) ( ( ac>=0 && ac<=7 )? true : false ) #define IsACValid(ac) ((ac >= 0 && ac <= 7) ? true : false)
union aci_aifsn { union aci_aifsn {
u8 charData; u8 charData;
struct struct {
{
u8 AIFSN:4; u8 AIFSN:4;
u8 acm:1; u8 acm:1;
u8 ACI:2; u8 ACI:2;
u8 Reserved:1; u8 Reserved:1;
}f; } f;
}; };
union ecw { union ecw {
u8 charData; u8 charData;
struct struct {
{
u8 ECWmin:4; u8 ECWmin:4;
u8 ECWmax:4; u8 ECWmax:4;
}f; } f;
}; };
union ac_param { union ac_param {
u32 longData; u32 longData;
u8 charData[4]; u8 charData[4];
struct struct {
{
union aci_aifsn AciAifsn; union aci_aifsn AciAifsn;
union ecw Ecw; union ecw Ecw;
u16 TXOPLimit; u16 TXOPLimit;
}f; } f;
}; };
#endif #endif
...@@ -67,5 +67,7 @@ struct rx_ts_record { ...@@ -67,5 +67,7 @@ struct rx_ts_record {
u8 num; u8 num;
}; };
void _setup_timer(struct timer_list *, void *, unsigned long);
#endif #endif
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "rtllib.h" #include "rtllib.h"
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include "rtl819x_TS.h" #include "rtl819x_TS.h"
extern void _setup_timer( struct timer_list*, void*, unsigned long);
void TsSetupTimeOut(unsigned long data) void TsSetupTimeOut(unsigned long data)
{ {
...@@ -32,7 +31,8 @@ void TsInactTimeout(unsigned long data) ...@@ -32,7 +31,8 @@ void TsInactTimeout(unsigned long data)
void RxPktPendingTimeout(unsigned long data) void RxPktPendingTimeout(unsigned long data)
{ {
struct rx_ts_record *pRxTs = (struct rx_ts_record *)data; struct rx_ts_record *pRxTs = (struct rx_ts_record *)data;
struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device, RxTsRecord[pRxTs->num]); struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device,
RxTsRecord[pRxTs->num]);
struct rx_reorder_entry *pReorderEntry = NULL; struct rx_reorder_entry *pReorderEntry = NULL;
...@@ -42,51 +42,57 @@ void RxPktPendingTimeout(unsigned long data) ...@@ -42,51 +42,57 @@ void RxPktPendingTimeout(unsigned long data)
bool bPktInBuf = false; bool bPktInBuf = false;
spin_lock_irqsave(&(ieee->reorder_spinlock), flags); spin_lock_irqsave(&(ieee->reorder_spinlock), flags);
if (pRxTs->RxTimeoutIndicateSeq != 0xffff) if (pRxTs->RxTimeoutIndicateSeq != 0xffff) {
{ while (!list_empty(&pRxTs->RxPendingPktList)) {
while(!list_empty(&pRxTs->RxPendingPktList)) pReorderEntry = (struct rx_reorder_entry *)
{ list_entry(pRxTs->RxPendingPktList.prev,
pReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTs->RxPendingPktList.prev,struct rx_reorder_entry,List); struct rx_reorder_entry, List);
if (index == 0) if (index == 0)
pRxTs->RxIndicateSeq = pReorderEntry->SeqNum; pRxTs->RxIndicateSeq = pReorderEntry->SeqNum;
if ( SN_LESS(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq) || if (SN_LESS(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq) ||
SN_EQUAL(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq) ) SN_EQUAL(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq)) {
{
list_del_init(&pReorderEntry->List); list_del_init(&pReorderEntry->List);
if (SN_EQUAL(pReorderEntry->SeqNum, pRxTs->RxIndicateSeq)) if (SN_EQUAL(pReorderEntry->SeqNum,
pRxTs->RxIndicateSeq = (pRxTs->RxIndicateSeq + 1) % 4096; pRxTs->RxIndicateSeq))
pRxTs->RxIndicateSeq =
(pRxTs->RxIndicateSeq + 1) % 4096;
RTLLIB_DEBUG(RTLLIB_DL_REORDER,"%s(): Indicate SeqNum: %d\n",__func__, pReorderEntry->SeqNum); RTLLIB_DEBUG(RTLLIB_DL_REORDER, "%s(): Indicate"
stats_IndicateArray[index] = pReorderEntry->prxb; " SeqNum: %d\n", __func__,
pReorderEntry->SeqNum);
stats_IndicateArray[index] =
pReorderEntry->prxb;
index++; index++;
list_add_tail(&pReorderEntry->List, &ieee->RxReorder_Unused_List); list_add_tail(&pReorderEntry->List,
} &ieee->RxReorder_Unused_List);
else } else {
{
bPktInBuf = true; bPktInBuf = true;
break; break;
} }
} }
} }
if (index>0){ if (index > 0) {
pRxTs->RxTimeoutIndicateSeq = 0xffff; pRxTs->RxTimeoutIndicateSeq = 0xffff;
if (index > REORDER_WIN_SIZE){ if (index > REORDER_WIN_SIZE) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "RxReorderIndicatePacket(): Rx Reorer struct buffer full!! \n"); RTLLIB_DEBUG(RTLLIB_DL_ERR, "RxReorderIndicatePacket():"
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); " Rx Reorer struct buffer full!!\n");
spin_unlock_irqrestore(&(ieee->reorder_spinlock),
flags);
return; return;
} }
rtllib_indicate_packets(ieee, stats_IndicateArray, index); rtllib_indicate_packets(ieee, stats_IndicateArray, index);
bPktInBuf = false; bPktInBuf = false;
} }
if (bPktInBuf && (pRxTs->RxTimeoutIndicateSeq==0xffff)){ if (bPktInBuf && (pRxTs->RxTimeoutIndicateSeq == 0xffff)) {
pRxTs->RxTimeoutIndicateSeq = pRxTs->RxIndicateSeq; pRxTs->RxTimeoutIndicateSeq = pRxTs->RxIndicateSeq;
mod_timer(&pRxTs->RxPktPendingTimer, jiffies + MSECS(ieee->pHTInfo->RxReorderPendingTime)); mod_timer(&pRxTs->RxPktPendingTimer, jiffies +
MSECS(ieee->pHTInfo->RxReorderPendingTime));
} }
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
} }
...@@ -95,13 +101,14 @@ void TsAddBaProcess(unsigned long data) ...@@ -95,13 +101,14 @@ void TsAddBaProcess(unsigned long data)
{ {
struct tx_ts_record *pTxTs = (struct tx_ts_record *)data; struct tx_ts_record *pTxTs = (struct tx_ts_record *)data;
u8 num = pTxTs->num; u8 num = pTxTs->num;
struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, TxTsRecord[num]); struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device,
TxTsRecord[num]);
TsInitAddBA(ieee, pTxTs, BA_POLICY_IMMEDIATE, false); TsInitAddBA(ieee, pTxTs, BA_POLICY_IMMEDIATE, false);
RTLLIB_DEBUG(RTLLIB_DL_BA, "TsAddBaProcess(): ADDBA Req is started!! \n"); RTLLIB_DEBUG(RTLLIB_DL_BA, "TsAddBaProcess(): ADDBA Req is "
"started!!\n");
} }
void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo) void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo)
{ {
memset(pTsCommonInfo->Addr, 0, 6); memset(pTsCommonInfo->Addr, 0, 6);
...@@ -142,8 +149,7 @@ void TSInitialize(struct rtllib_device *ieee) ...@@ -142,8 +149,7 @@ void TSInitialize(struct rtllib_device *ieee)
INIT_LIST_HEAD(&ieee->Tx_TS_Pending_List); INIT_LIST_HEAD(&ieee->Tx_TS_Pending_List);
INIT_LIST_HEAD(&ieee->Tx_TS_Unused_List); INIT_LIST_HEAD(&ieee->Tx_TS_Unused_List);
for (count = 0; count < TOTAL_TS_NUM; count++) for (count = 0; count < TOTAL_TS_NUM; count++) {
{
pTxTS->num = count; pTxTS->num = count;
_setup_timer(&pTxTS->TsCommonInfo.SetupTimer, _setup_timer(&pTxTS->TsCommonInfo.SetupTimer,
TsSetupTimeOut, TsSetupTimeOut,
...@@ -173,8 +179,7 @@ void TSInitialize(struct rtllib_device *ieee) ...@@ -173,8 +179,7 @@ void TSInitialize(struct rtllib_device *ieee)
INIT_LIST_HEAD(&ieee->Rx_TS_Admit_List); INIT_LIST_HEAD(&ieee->Rx_TS_Admit_List);
INIT_LIST_HEAD(&ieee->Rx_TS_Pending_List); INIT_LIST_HEAD(&ieee->Rx_TS_Pending_List);
INIT_LIST_HEAD(&ieee->Rx_TS_Unused_List); INIT_LIST_HEAD(&ieee->Rx_TS_Unused_List);
for (count = 0; count < TOTAL_TS_NUM; count++) for (count = 0; count < TOTAL_TS_NUM; count++) {
{
pRxTS->num = count; pRxTS->num = count;
INIT_LIST_HEAD(&pRxTS->RxPendingPktList); INIT_LIST_HEAD(&pRxTS->RxPendingPktList);
...@@ -195,13 +200,14 @@ void TSInitialize(struct rtllib_device *ieee) ...@@ -195,13 +200,14 @@ void TSInitialize(struct rtllib_device *ieee)
(unsigned long) pRxTS); (unsigned long) pRxTS);
ResetRxTsEntry(pRxTS); ResetRxTsEntry(pRxTS);
list_add_tail(&pRxTS->TsCommonInfo.List, &ieee->Rx_TS_Unused_List); list_add_tail(&pRxTS->TsCommonInfo.List,
&ieee->Rx_TS_Unused_List);
pRxTS++; pRxTS++;
} }
INIT_LIST_HEAD(&ieee->RxReorder_Unused_List); INIT_LIST_HEAD(&ieee->RxReorder_Unused_List);
for (count = 0; count < REORDER_ENTRY_NUM; count++) for (count = 0; count < REORDER_ENTRY_NUM; count++) {
{ list_add_tail(&pRxReorderEntry->List,
list_add_tail( &pRxReorderEntry->List,&ieee->RxReorder_Unused_List); &ieee->RxReorder_Unused_List);
if (count == (REORDER_ENTRY_NUM-1)) if (count == (REORDER_ENTRY_NUM-1))
break; break;
pRxReorderEntry = &ieee->RxReorderEntry[count+1]; pRxReorderEntry = &ieee->RxReorderEntry[count+1];
...@@ -209,55 +215,46 @@ void TSInitialize(struct rtllib_device *ieee) ...@@ -209,55 +215,46 @@ void TSInitialize(struct rtllib_device *ieee)
} }
void AdmitTS(struct rtllib_device *ieee, struct ts_common_info *pTsCommonInfo, u32 InactTime) void AdmitTS(struct rtllib_device *ieee, struct ts_common_info *pTsCommonInfo,
u32 InactTime)
{ {
del_timer_sync(&pTsCommonInfo->SetupTimer); del_timer_sync(&pTsCommonInfo->SetupTimer);
del_timer_sync(&pTsCommonInfo->InactTimer); del_timer_sync(&pTsCommonInfo->InactTimer);
if (InactTime!=0) if (InactTime != 0)
mod_timer(&pTsCommonInfo->InactTimer, jiffies + MSECS(InactTime)); mod_timer(&pTsCommonInfo->InactTimer, jiffies +
MSECS(InactTime));
} }
struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, u8 *Addr,
struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, u8* Addr, u8 TID, enum tr_select TxRxSelect) u8 TID, enum tr_select TxRxSelect)
{ {
u8 dir; u8 dir;
bool search_dir[4] = {0, 0, 0, 0}; bool search_dir[4] = {0, 0, 0, 0};
struct list_head* psearch_list; struct list_head *psearch_list;
struct ts_common_info *pRet = NULL; struct ts_common_info *pRet = NULL;
if (ieee->iw_mode == IW_MODE_MASTER) if (ieee->iw_mode == IW_MODE_MASTER) {
{ if (TxRxSelect == TX_DIR) {
if (TxRxSelect == TX_DIR)
{
search_dir[DIR_DOWN] = true; search_dir[DIR_DOWN] = true;
search_dir[DIR_BI_DIR]= true; search_dir[DIR_BI_DIR] = true;
} } else {
else search_dir[DIR_UP] = true;
{ search_dir[DIR_BI_DIR] = true;
search_dir[DIR_UP] = true;
search_dir[DIR_BI_DIR]= true;
} }
} } else if (ieee->iw_mode == IW_MODE_ADHOC) {
else if (ieee->iw_mode == IW_MODE_ADHOC)
{
if (TxRxSelect == TX_DIR) if (TxRxSelect == TX_DIR)
search_dir[DIR_UP] = true; search_dir[DIR_UP] = true;
else else
search_dir[DIR_DOWN] = true; search_dir[DIR_DOWN] = true;
} } else {
else if (TxRxSelect == TX_DIR) {
{ search_dir[DIR_UP] = true;
if (TxRxSelect == TX_DIR) search_dir[DIR_BI_DIR] = true;
{ search_dir[DIR_DIRECT] = true;
search_dir[DIR_UP] = true; } else {
search_dir[DIR_BI_DIR]= true;
search_dir[DIR_DIRECT]= true;
}
else
{
search_dir[DIR_DOWN] = true; search_dir[DIR_DOWN] = true;
search_dir[DIR_BI_DIR]= true; search_dir[DIR_BI_DIR] = true;
search_dir[DIR_DIRECT]= true; search_dir[DIR_DIRECT] = true;
} }
} }
...@@ -266,38 +263,29 @@ struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, u8* Addr, ...@@ -266,38 +263,29 @@ struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, u8* Addr,
else else
psearch_list = &ieee->Rx_TS_Admit_List; psearch_list = &ieee->Rx_TS_Admit_List;
for (dir = 0; dir <= DIR_BI_DIR; dir++) for (dir = 0; dir <= DIR_BI_DIR; dir++) {
{ if (search_dir[dir] == false)
if (search_dir[dir] ==false )
continue; continue;
list_for_each_entry(pRet, psearch_list, List){ list_for_each_entry(pRet, psearch_list, List) {
if (memcmp(pRet->Addr, Addr, 6) == 0) if (memcmp(pRet->Addr, Addr, 6) == 0)
if (pRet->TSpec.f.TSInfo.field.ucTSID == TID) if (pRet->TSpec.f.TSInfo.field.ucTSID == TID)
if (pRet->TSpec.f.TSInfo.field.ucDirection == dir) if (pRet->TSpec.f.TSInfo.field.ucDirection == dir)
{
break; break;
}
} }
if (&pRet->List != psearch_list) if (&pRet->List != psearch_list)
break; break;
} }
if (&pRet->List != psearch_list){ if (&pRet->List != psearch_list)
return pRet ; return pRet ;
}
else else
return NULL; return NULL;
} }
void MakeTSEntry( void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr,
struct ts_common_info *pTsCommonInfo, union tspec_body *pTSPEC, union qos_tclas *pTCLAS,
u8* Addr, u8 TCLAS_Num, u8 TCLAS_Proc)
union tspec_body *pTSPEC,
union qos_tclas *pTCLAS,
u8 TCLAS_Num,
u8 TCLAS_Proc
)
{ {
u8 count; u8 count;
...@@ -307,34 +295,32 @@ void MakeTSEntry( ...@@ -307,34 +295,32 @@ void MakeTSEntry(
memcpy(pTsCommonInfo->Addr, Addr, 6); memcpy(pTsCommonInfo->Addr, Addr, 6);
if (pTSPEC != NULL) if (pTSPEC != NULL)
memcpy((u8*)(&(pTsCommonInfo->TSpec)), (u8*)pTSPEC, sizeof(union tspec_body)); memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,
sizeof(union tspec_body));
for (count = 0; count < TCLAS_Num; count++) for (count = 0; count < TCLAS_Num; count++)
memcpy((u8*)(&(pTsCommonInfo->TClass[count])), (u8*)pTCLAS, sizeof(union qos_tclas)); memcpy((u8 *)(&(pTsCommonInfo->TClass[count])),
(u8 *)pTCLAS, sizeof(union qos_tclas));
pTsCommonInfo->TClasProc = TCLAS_Proc; pTsCommonInfo->TClasProc = TCLAS_Proc;
pTsCommonInfo->TClasNum = TCLAS_Num; pTsCommonInfo->TClasNum = TCLAS_Num;
} }
bool GetTs( bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
struct rtllib_device* ieee, u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs)
struct ts_common_info **ppTS,
u8* Addr,
u8 TID,
enum tr_select TxRxSelect,
bool bAddNewTs)
{ {
u8 UP = 0; u8 UP = 0;
if (is_broadcast_ether_addr(Addr) || is_multicast_ether_addr(Addr)) if (is_broadcast_ether_addr(Addr) || is_multicast_ether_addr(Addr)) {
{ RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR! get TS for Broadcast or "
RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR! get TS for Broadcast or Multicast\n"); "Multicast\n");
return false; return false;
} }
if (ieee->current_network.qos_data.supported == 0) { if (ieee->current_network.qos_data.supported == 0) {
UP = 0; UP = 0;
} else { } else {
if (!IsACValid(TID)) { if (!IsACValid(TID)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR! in %s(), TID(%d) is not valid\n", __func__, TID); RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR! in %s(), TID(%d) is "
"not valid\n", __func__, TID);
return false; return false;
} }
...@@ -358,55 +344,54 @@ bool GetTs( ...@@ -358,55 +344,54 @@ bool GetTs(
} }
} }
*ppTS = SearchAdmitTRStream( *ppTS = SearchAdmitTRStream(ieee, Addr, UP, TxRxSelect);
ieee, if (*ppTS != NULL) {
Addr,
UP,
TxRxSelect);
if (*ppTS != NULL)
{
return true; return true;
} } else {
else if (bAddNewTs == false) {
{ RTLLIB_DEBUG(RTLLIB_DL_TS, "add new TS failed"
if (bAddNewTs == false) "(tid:%d)\n", UP);
{
RTLLIB_DEBUG(RTLLIB_DL_TS, "add new TS failed(tid:%d)\n", UP);
return false; return false;
} } else {
else
{
union tspec_body TSpec; union tspec_body TSpec;
union qos_tsinfo *pTSInfo = &TSpec.f.TSInfo; union qos_tsinfo *pTSInfo = &TSpec.f.TSInfo;
struct list_head* pUnusedList = struct list_head *pUnusedList =
(TxRxSelect == TX_DIR)? (TxRxSelect == TX_DIR) ?
(&ieee->Tx_TS_Unused_List): (&ieee->Tx_TS_Unused_List) :
(&ieee->Rx_TS_Unused_List); (&ieee->Rx_TS_Unused_List);
struct list_head* pAddmitList = struct list_head *pAddmitList =
(TxRxSelect == TX_DIR)? (TxRxSelect == TX_DIR) ?
(&ieee->Tx_TS_Admit_List): (&ieee->Tx_TS_Admit_List) :
(&ieee->Rx_TS_Admit_List); (&ieee->Rx_TS_Admit_List);
enum direction_value Dir = (ieee->iw_mode == IW_MODE_MASTER)? enum direction_value Dir =
((TxRxSelect==TX_DIR)?DIR_DOWN:DIR_UP): (ieee->iw_mode == IW_MODE_MASTER) ?
((TxRxSelect==TX_DIR)?DIR_UP:DIR_DOWN); ((TxRxSelect == TX_DIR) ? DIR_DOWN : DIR_UP) :
((TxRxSelect == TX_DIR) ? DIR_UP : DIR_DOWN);
RTLLIB_DEBUG(RTLLIB_DL_TS, "to add Ts\n"); RTLLIB_DEBUG(RTLLIB_DL_TS, "to add Ts\n");
if (!list_empty(pUnusedList)) if (!list_empty(pUnusedList)) {
{ (*ppTS) = list_entry(pUnusedList->next,
(*ppTS) = list_entry(pUnusedList->next, struct ts_common_info, List); struct ts_common_info, List);
list_del_init(&(*ppTS)->List); list_del_init(&(*ppTS)->List);
if (TxRxSelect==TX_DIR) if (TxRxSelect == TX_DIR) {
{ struct tx_ts_record *tmp =
struct tx_ts_record *tmp = container_of(*ppTS, struct tx_ts_record, TsCommonInfo); container_of(*ppTS,
struct tx_ts_record,
TsCommonInfo);
ResetTxTsEntry(tmp); ResetTxTsEntry(tmp);
} } else {
else{ struct rx_ts_record *tmp =
struct rx_ts_record *tmp = container_of(*ppTS, struct rx_ts_record, TsCommonInfo); container_of(*ppTS,
struct rx_ts_record,
TsCommonInfo);
ResetRxTsEntry(tmp); ResetRxTsEntry(tmp);
} }
RTLLIB_DEBUG(RTLLIB_DL_TS, "to init current TS, UP:%d, Dir:%d, addr:"MAC_FMT" ppTs=%p\n", UP, Dir, MAC_ARG(Addr), *ppTS); RTLLIB_DEBUG(RTLLIB_DL_TS, "to init current TS"
", UP:%d, Dir:%d, addr:"MAC_FMT
" ppTs=%p\n", UP, Dir,
MAC_ARG(Addr), *ppTS);
pTSInfo->field.ucTrafficType = 0; pTSInfo->field.ucTrafficType = 0;
pTSInfo->field.ucTSID = UP; pTSInfo->field.ucTSID = UP;
pTSInfo->field.ucDirection = Dir; pTSInfo->field.ucDirection = Dir;
...@@ -422,99 +407,90 @@ bool GetTs( ...@@ -422,99 +407,90 @@ bool GetTs(
list_add_tail(&((*ppTS)->List), pAddmitList); list_add_tail(&((*ppTS)->List), pAddmitList);
return true; return true;
} } else {
else RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR!!in function "
{ "%s() There is not enough dir=%d"
RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR!!in function %s() There is not enough dir=%d(0=up down=1) TS record to be used!!", __func__,Dir); "(0=up down=1) TS record to be "
"used!!", __func__, Dir);
return false; return false;
} }
} }
} }
} }
void RemoveTsEntry( void RemoveTsEntry(struct rtllib_device *ieee, struct ts_common_info *pTs,
struct rtllib_device* ieee, enum tr_select TxRxSelect)
struct ts_common_info *pTs,
enum tr_select TxRxSelect
)
{ {
del_timer_sync(&pTs->SetupTimer); del_timer_sync(&pTs->SetupTimer);
del_timer_sync(&pTs->InactTimer); del_timer_sync(&pTs->InactTimer);
TsInitDelBA(ieee, pTs, TxRxSelect); TsInitDelBA(ieee, pTs, TxRxSelect);
if (TxRxSelect == RX_DIR) if (TxRxSelect == RX_DIR) {
{
struct rx_reorder_entry *pRxReorderEntry; struct rx_reorder_entry *pRxReorderEntry;
struct rx_ts_record *pRxTS = (struct rx_ts_record *)pTs; struct rx_ts_record *pRxTS = (struct rx_ts_record *)pTs;
if (timer_pending(&pRxTS->RxPktPendingTimer)) if (timer_pending(&pRxTS->RxPktPendingTimer))
del_timer_sync(&pRxTS->RxPktPendingTimer); del_timer_sync(&pRxTS->RxPktPendingTimer);
while(!list_empty(&pRxTS->RxPendingPktList)){ while (!list_empty(&pRxTS->RxPendingPktList)) {
pRxReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTS->RxPendingPktList.prev,struct rx_reorder_entry,List); pRxReorderEntry = (struct rx_reorder_entry *)
RTLLIB_DEBUG(RTLLIB_DL_REORDER,"%s(): Delete SeqNum %d!\n",__func__, pRxReorderEntry->SeqNum); list_entry(pRxTS->RxPendingPktList.prev,
struct rx_reorder_entry, List);
RTLLIB_DEBUG(RTLLIB_DL_REORDER, "%s(): Delete SeqNum "
"%d!\n", __func__,
pRxReorderEntry->SeqNum);
list_del_init(&pRxReorderEntry->List); list_del_init(&pRxReorderEntry->List);
{ {
int i = 0; int i = 0;
struct rtllib_rxb * prxb = pRxReorderEntry->prxb; struct rtllib_rxb *prxb = pRxReorderEntry->prxb;
if (unlikely(!prxb)){ if (unlikely(!prxb))
return; return;
} for (i = 0; i < prxb->nr_subframes; i++)
for (i =0; i < prxb->nr_subframes; i++) {
dev_kfree_skb(prxb->subframes[i]); dev_kfree_skb(prxb->subframes[i]);
}
kfree(prxb); kfree(prxb);
prxb = NULL; prxb = NULL;
} }
list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List); list_add_tail(&pRxReorderEntry->List,
&ieee->RxReorder_Unused_List);
} }
} } else {
else{
struct tx_ts_record *pTxTS = (struct tx_ts_record *)pTs; struct tx_ts_record *pTxTS = (struct tx_ts_record *)pTs;
del_timer_sync(&pTxTS->TsAddBaTimer); del_timer_sync(&pTxTS->TsAddBaTimer);
} }
} }
void RemovePeerTS(struct rtllib_device* ieee, u8* Addr) void RemovePeerTS(struct rtllib_device *ieee, u8 *Addr)
{ {
struct ts_common_info *pTS, *pTmpTS; struct ts_common_info *pTS, *pTmpTS;
printk("===========>RemovePeerTS,"MAC_FMT"\n", MAC_ARG(Addr)); printk(KERN_INFO "===========>RemovePeerTS,"MAC_FMT"\n", MAC_ARG(Addr));
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) {
{ if (memcmp(pTS->Addr, Addr, 6) == 0) {
if (memcmp(pTS->Addr, Addr, 6) == 0)
{
RemoveTsEntry(ieee, pTS, TX_DIR); RemoveTsEntry(ieee, pTS, TX_DIR);
list_del_init(&pTS->List); list_del_init(&pTS->List);
list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List);
} }
} }
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) {
{ if (memcmp(pTS->Addr, Addr, 6) == 0) {
if (memcmp(pTS->Addr, Addr, 6) == 0) printk(KERN_INFO "====>remove Tx_TS_admin_list\n");
{
printk("====>remove Tx_TS_admin_list\n");
RemoveTsEntry(ieee, pTS, TX_DIR); RemoveTsEntry(ieee, pTS, TX_DIR);
list_del_init(&pTS->List); list_del_init(&pTS->List);
list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List);
} }
} }
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) {
{ if (memcmp(pTS->Addr, Addr, 6) == 0) {
if (memcmp(pTS->Addr, Addr, 6) == 0)
{
RemoveTsEntry(ieee, pTS, RX_DIR); RemoveTsEntry(ieee, pTS, RX_DIR);
list_del_init(&pTS->List); list_del_init(&pTS->List);
list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
} }
} }
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) {
{ if (memcmp(pTS->Addr, Addr, 6) == 0) {
if (memcmp(pTS->Addr, Addr, 6) == 0)
{
RemoveTsEntry(ieee, pTS, RX_DIR); RemoveTsEntry(ieee, pTS, RX_DIR);
list_del_init(&pTS->List); list_del_init(&pTS->List);
list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
...@@ -522,56 +498,51 @@ void RemovePeerTS(struct rtllib_device* ieee, u8* Addr) ...@@ -522,56 +498,51 @@ void RemovePeerTS(struct rtllib_device* ieee, u8* Addr)
} }
} }
void RemoveAllTS(struct rtllib_device* ieee) void RemoveAllTS(struct rtllib_device *ieee)
{ {
struct ts_common_info *pTS, *pTmpTS; struct ts_common_info *pTS, *pTmpTS;
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) {
{
RemoveTsEntry(ieee, pTS, TX_DIR); RemoveTsEntry(ieee, pTS, TX_DIR);
list_del_init(&pTS->List); list_del_init(&pTS->List);
list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List);
} }
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) {
{
RemoveTsEntry(ieee, pTS, TX_DIR); RemoveTsEntry(ieee, pTS, TX_DIR);
list_del_init(&pTS->List); list_del_init(&pTS->List);
list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List);
} }
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) {
{
RemoveTsEntry(ieee, pTS, RX_DIR); RemoveTsEntry(ieee, pTS, RX_DIR);
list_del_init(&pTS->List); list_del_init(&pTS->List);
list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
} }
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) {
{
RemoveTsEntry(ieee, pTS, RX_DIR); RemoveTsEntry(ieee, pTS, RX_DIR);
list_del_init(&pTS->List); list_del_init(&pTS->List);
list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
} }
} }
void TsStartAddBaProcess(struct rtllib_device* ieee, struct tx_ts_record *pTxTS) void TsStartAddBaProcess(struct rtllib_device *ieee, struct tx_ts_record *pTxTS)
{ {
if (pTxTS->bAddBaReqInProgress == false) if (pTxTS->bAddBaReqInProgress == false) {
{
pTxTS->bAddBaReqInProgress = true; pTxTS->bAddBaReqInProgress = true;
if (pTxTS->bAddBaReqDelayed) if (pTxTS->bAddBaReqDelayed) {
{ RTLLIB_DEBUG(RTLLIB_DL_BA, "TsStartAddBaProcess(): "
RTLLIB_DEBUG(RTLLIB_DL_BA, "TsStartAddBaProcess(): Delayed Start ADDBA after 60 sec!!\n"); "Delayed Start ADDBA after 60 sec!!\n");
mod_timer(&pTxTS->TsAddBaTimer, jiffies + MSECS(TS_ADDBA_DELAY)); mod_timer(&pTxTS->TsAddBaTimer, jiffies +
} MSECS(TS_ADDBA_DELAY));
else } else {
{ RTLLIB_DEBUG(RTLLIB_DL_BA, "TsStartAddBaProcess(): "
RTLLIB_DEBUG(RTLLIB_DL_BA,"TsStartAddBaProcess(): Immediately Start ADDBA now!!\n"); "Immediately Start ADDBA now!!\n");
mod_timer(&pTxTS->TsAddBaTimer, jiffies+10); mod_timer(&pTxTS->TsAddBaTimer, jiffies+10);
} }
} } else
else RTLLIB_DEBUG(RTLLIB_DL_BA, "%s()==>BA timer is already added\n",
RTLLIB_DEBUG(RTLLIB_DL_BA, "%s()==>BA timer is already added\n", __func__); __func__);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment