staging: rtl8192e: Cleanup checkpatch -f warnings and errors - Part V
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
@@ -38,8 +38,7 @@
|
|||||||
#define DELBA_REASON_TIMEOUT 39
|
#define DELBA_REASON_TIMEOUT 39
|
||||||
union sequence_control {
|
union sequence_control {
|
||||||
u16 ShortData;
|
u16 ShortData;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
u16 FragNum:4;
|
u16 FragNum:4;
|
||||||
u16 SeqNum:12;
|
u16 SeqNum:12;
|
||||||
} field;
|
} field;
|
||||||
|
@@ -20,7 +20,8 @@
|
|||||||
#include "rtl819x_BA.h"
|
#include "rtl819x_BA.h"
|
||||||
#include "rtl_core.h"
|
#include "rtl_core.h"
|
||||||
|
|
||||||
void ActivateBAEntry(struct rtllib_device* ieee, struct ba_record *pBA, u16 Time)
|
void ActivateBAEntry(struct rtllib_device *ieee, struct ba_record *pBA,
|
||||||
|
u16 Time)
|
||||||
{
|
{
|
||||||
pBA->bValid = true;
|
pBA->bValid = true;
|
||||||
if (Time != 0)
|
if (Time != 0)
|
||||||
@@ -32,24 +33,22 @@ void DeActivateBAEntry( struct rtllib_device* ieee, struct ba_record *pBA)
|
|||||||
pBA->bValid = false;
|
pBA->bValid = false;
|
||||||
del_timer_sync(&pBA->Timer);
|
del_timer_sync(&pBA->Timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 TxTsDeleteBA(struct rtllib_device *ieee, struct tx_ts_record *pTxTs)
|
u8 TxTsDeleteBA(struct rtllib_device *ieee, struct tx_ts_record *pTxTs)
|
||||||
{
|
{
|
||||||
struct ba_record *pAdmittedBa = &pTxTs->TxAdmittedBARecord;
|
struct ba_record *pAdmittedBa = &pTxTs->TxAdmittedBARecord;
|
||||||
struct ba_record *pPendingBa = &pTxTs->TxPendingBARecord;
|
struct ba_record *pPendingBa = &pTxTs->TxPendingBARecord;
|
||||||
u8 bSendDELBA = false;
|
u8 bSendDELBA = false;
|
||||||
|
|
||||||
if (pPendingBa->bValid)
|
if (pPendingBa->bValid) {
|
||||||
{
|
|
||||||
DeActivateBAEntry(ieee, pPendingBa);
|
DeActivateBAEntry(ieee, pPendingBa);
|
||||||
bSendDELBA = true;
|
bSendDELBA = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pAdmittedBa->bValid)
|
if (pAdmittedBa->bValid) {
|
||||||
{
|
|
||||||
DeActivateBAEntry(ieee, pAdmittedBa);
|
DeActivateBAEntry(ieee, pAdmittedBa);
|
||||||
bSendDELBA = true;
|
bSendDELBA = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bSendDELBA;
|
return bSendDELBA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,8 +57,7 @@ u8 RxTsDeleteBA( struct rtllib_device* ieee, struct rx_ts_record *pRxTs)
|
|||||||
struct ba_record *pBa = &pRxTs->RxAdmittedBARecord;
|
struct ba_record *pBa = &pRxTs->RxAdmittedBARecord;
|
||||||
u8 bSendDELBA = false;
|
u8 bSendDELBA = false;
|
||||||
|
|
||||||
if (pBa->bValid)
|
if (pBa->bValid) {
|
||||||
{
|
|
||||||
DeActivateBAEntry(ieee, pBa);
|
DeActivateBAEntry(ieee, pBa);
|
||||||
bSendDELBA = true;
|
bSendDELBA = true;
|
||||||
}
|
}
|
||||||
@@ -75,22 +73,25 @@ void ResetBaEntry( struct ba_record *pBA)
|
|||||||
pBA->DialogToken = 0;
|
pBA->DialogToken = 0;
|
||||||
pBA->BaStartSeqCtrl.ShortData = 0;
|
pBA->BaStartSeqCtrl.ShortData = 0;
|
||||||
}
|
}
|
||||||
static struct sk_buff* rtllib_ADDBA(struct rtllib_device* ieee, u8* Dst, struct ba_record *pBA, u16 StatusCode, u8 type)
|
static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
|
||||||
|
struct ba_record *pBA,
|
||||||
|
u16 StatusCode, u8 type)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb = NULL;
|
struct sk_buff *skb = NULL;
|
||||||
struct rtllib_hdr_3addr *BAReq = NULL;
|
struct rtllib_hdr_3addr *BAReq = NULL;
|
||||||
u8 *tag = NULL;
|
u8 *tag = NULL;
|
||||||
u16 tmp = 0;
|
u16 tmp = 0;
|
||||||
u16 len = ieee->tx_headroom + 9;
|
u16 len = ieee->tx_headroom + 9;
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "========>%s(), frame(%d) sentd to:"MAC_FMT", ieee->dev:%p\n", __func__, type, MAC_ARG(Dst), ieee->dev);
|
RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "========>%s(), frame(%d)"
|
||||||
if (pBA == NULL||ieee == NULL)
|
" sentd to:"MAC_FMT", ieee->dev:%p\n", __func__,
|
||||||
{
|
type, MAC_ARG(Dst), ieee->dev);
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "pBA(%p) is NULL or ieee(%p) is NULL\n", pBA, ieee);
|
if (pBA == NULL || ieee == NULL) {
|
||||||
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "pBA(%p) is NULL or ieee(%p) is "
|
||||||
|
"NULL\n", pBA, ieee);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
|
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
|
||||||
if (skb == NULL)
|
if (skb == NULL) {
|
||||||
{
|
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -99,7 +100,8 @@ static struct sk_buff* rtllib_ADDBA(struct rtllib_device* ieee, u8* Dst, struct
|
|||||||
|
|
||||||
skb_reserve(skb, ieee->tx_headroom);
|
skb_reserve(skb, ieee->tx_headroom);
|
||||||
|
|
||||||
BAReq = ( struct rtllib_hdr_3addr *) skb_put(skb,sizeof( struct rtllib_hdr_3addr));
|
BAReq = (struct rtllib_hdr_3addr *)skb_put(skb,
|
||||||
|
sizeof(struct rtllib_hdr_3addr));
|
||||||
|
|
||||||
memcpy(BAReq->addr1, Dst, ETH_ALEN);
|
memcpy(BAReq->addr1, Dst, ETH_ALEN);
|
||||||
memcpy(BAReq->addr2, ieee->dev->dev_addr, ETH_ALEN);
|
memcpy(BAReq->addr2, ieee->dev->dev_addr, ETH_ALEN);
|
||||||
@@ -112,8 +114,7 @@ static struct sk_buff* rtllib_ADDBA(struct rtllib_device* ieee, u8* Dst, struct
|
|||||||
*tag ++= type;
|
*tag ++= type;
|
||||||
*tag ++= pBA->DialogToken;
|
*tag ++= pBA->DialogToken;
|
||||||
|
|
||||||
if (ACT_ADDBARSP == type)
|
if (ACT_ADDBARSP == type) {
|
||||||
{
|
|
||||||
RT_TRACE(COMP_DBG, "====>to send ADDBARSP\n");
|
RT_TRACE(COMP_DBG, "====>to send ADDBARSP\n");
|
||||||
tmp = cpu_to_le16(StatusCode);
|
tmp = cpu_to_le16(StatusCode);
|
||||||
memcpy(tag, (u8 *)&tmp, 2);
|
memcpy(tag, (u8 *)&tmp, 2);
|
||||||
@@ -126,8 +127,7 @@ static struct sk_buff* rtllib_ADDBA(struct rtllib_device* ieee, u8* Dst, struct
|
|||||||
memcpy(tag, (u8 *)&tmp, 2);
|
memcpy(tag, (u8 *)&tmp, 2);
|
||||||
tag += 2;
|
tag += 2;
|
||||||
|
|
||||||
if (ACT_ADDBAREQ == type)
|
if (ACT_ADDBAREQ == type) {
|
||||||
{
|
|
||||||
memcpy(tag, (u8 *)&(pBA->BaStartSeqCtrl), 2);
|
memcpy(tag, (u8 *)&(pBA->BaStartSeqCtrl), 2);
|
||||||
tag += 2;
|
tag += 2;
|
||||||
}
|
}
|
||||||
@@ -136,13 +136,9 @@ static struct sk_buff* rtllib_ADDBA(struct rtllib_device* ieee, u8* Dst, struct
|
|||||||
return skb;
|
return skb;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct sk_buff* rtllib_DELBA(
|
static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst,
|
||||||
struct rtllib_device* ieee,
|
|
||||||
u8* dst,
|
|
||||||
struct ba_record *pBA,
|
struct ba_record *pBA,
|
||||||
enum tr_select TxRxSelect,
|
enum tr_select TxRxSelect, u16 ReasonCode)
|
||||||
u16 ReasonCode
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
union delba_param_set DelbaParamSet;
|
union delba_param_set DelbaParamSet;
|
||||||
struct sk_buff *skb = NULL;
|
struct sk_buff *skb = NULL;
|
||||||
@@ -152,7 +148,10 @@ static struct sk_buff* rtllib_DELBA(
|
|||||||
u16 len = 6 + ieee->tx_headroom;
|
u16 len = 6 + ieee->tx_headroom;
|
||||||
|
|
||||||
if (net_ratelimit())
|
if (net_ratelimit())
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "========>%s(), ReasonCode(%d) sentd to:"MAC_FMT"\n", __func__, ReasonCode, MAC_ARG(dst));
|
RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA,
|
||||||
|
"========>%s(), Reason"
|
||||||
|
"Code(%d) sentd to:"MAC_FMT"\n", __func__,
|
||||||
|
ReasonCode, MAC_ARG(dst));
|
||||||
|
|
||||||
memset(&DelbaParamSet, 0, 2);
|
memset(&DelbaParamSet, 0, 2);
|
||||||
|
|
||||||
@@ -160,15 +159,15 @@ static struct sk_buff* rtllib_DELBA(
|
|||||||
DelbaParamSet.field.TID = pBA->BaParamSet.field.TID;
|
DelbaParamSet.field.TID = pBA->BaParamSet.field.TID;
|
||||||
|
|
||||||
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
|
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
|
||||||
if (skb == NULL)
|
if (skb == NULL) {
|
||||||
{
|
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb_reserve(skb, ieee->tx_headroom);
|
skb_reserve(skb, ieee->tx_headroom);
|
||||||
|
|
||||||
Delba = ( struct rtllib_hdr_3addr *) skb_put(skb,sizeof( struct rtllib_hdr_3addr));
|
Delba = (struct rtllib_hdr_3addr *) skb_put(skb,
|
||||||
|
sizeof(struct rtllib_hdr_3addr));
|
||||||
|
|
||||||
memcpy(Delba->addr1, dst, ETH_ALEN);
|
memcpy(Delba->addr1, dst, ETH_ALEN);
|
||||||
memcpy(Delba->addr2, ieee->dev->dev_addr, ETH_ALEN);
|
memcpy(Delba->addr2, ieee->dev->dev_addr, ETH_ALEN);
|
||||||
@@ -189,11 +188,13 @@ static struct sk_buff* rtllib_DELBA(
|
|||||||
|
|
||||||
RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
|
RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
|
||||||
if (net_ratelimit())
|
if (net_ratelimit())
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "<=====%s()\n", __func__);
|
RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "<=====%s()\n",
|
||||||
|
__func__);
|
||||||
return skb;
|
return skb;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtllib_send_ADDBAReq(struct rtllib_device* ieee, u8* dst, struct ba_record *pBA)
|
void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst,
|
||||||
|
struct ba_record *pBA)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb = NULL;
|
struct sk_buff *skb = NULL;
|
||||||
skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ);
|
skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ);
|
||||||
@@ -202,36 +203,36 @@ void rtllib_send_ADDBAReq(struct rtllib_device* ieee, u8* dst, struct ba_record
|
|||||||
RT_TRACE(COMP_DBG, "====>to send ADDBAREQ!!!!!\n");
|
RT_TRACE(COMP_DBG, "====>to send ADDBAREQ!!!!!\n");
|
||||||
softmac_mgmt_xmit(skb, ieee);
|
softmac_mgmt_xmit(skb, ieee);
|
||||||
} else {
|
} else {
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "alloc skb error in function %s()\n", __func__);
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "alloc skb error in function"
|
||||||
|
" %s()\n", __func__);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtllib_send_ADDBARsp(struct rtllib_device* ieee, u8* dst, struct ba_record *pBA, u16 StatusCode)
|
void rtllib_send_ADDBARsp(struct rtllib_device *ieee, u8 *dst,
|
||||||
|
struct ba_record *pBA, u16 StatusCode)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb = NULL;
|
struct sk_buff *skb = NULL;
|
||||||
skb = rtllib_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP);
|
skb = rtllib_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP);
|
||||||
if (skb)
|
if (skb)
|
||||||
softmac_mgmt_xmit(skb, ieee);
|
softmac_mgmt_xmit(skb, ieee);
|
||||||
else
|
else
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "alloc skb error in function %s()\n", __func__);
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "alloc skb error in function"
|
||||||
|
" %s()\n", __func__);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtllib_send_DELBA(struct rtllib_device* ieee, u8* dst, struct ba_record *pBA, enum tr_select TxRxSelect, u16 ReasonCode)
|
void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst,
|
||||||
|
struct ba_record *pBA, enum tr_select TxRxSelect,
|
||||||
|
u16 ReasonCode)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb = NULL;
|
struct sk_buff *skb = NULL;
|
||||||
skb = rtllib_DELBA(ieee, dst, pBA, TxRxSelect, ReasonCode);
|
skb = rtllib_DELBA(ieee, dst, pBA, TxRxSelect, ReasonCode);
|
||||||
if (skb)
|
if (skb)
|
||||||
{
|
|
||||||
softmac_mgmt_xmit(skb, ieee);
|
softmac_mgmt_xmit(skb, ieee);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "alloc skb error in func"
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "alloc skb error in function %s()\n", __func__);
|
"tion %s()\n", __func__);
|
||||||
}
|
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,9 +247,10 @@ int rtllib_rx_ADDBAReq( struct rtllib_device* ieee, struct sk_buff *skb)
|
|||||||
union sequence_control *pBaStartSeqCtrl = NULL;
|
union sequence_control *pBaStartSeqCtrl = NULL;
|
||||||
struct rx_ts_record *pTS = NULL;
|
struct rx_ts_record *pTS = NULL;
|
||||||
|
|
||||||
if (skb->len < sizeof( struct rtllib_hdr_3addr) + 9)
|
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 9) {
|
||||||
{
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, " Invalid skb len in BAREQ(%d / "
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, " Invalid skb len in BAREQ(%d / %d)\n",(int)skb->len, (int)(sizeof( struct rtllib_hdr_3addr) + 9));
|
"%d)\n", (int)skb->len,
|
||||||
|
(int)(sizeof(struct rtllib_hdr_3addr) + 9));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,31 +270,27 @@ int rtllib_rx_ADDBAReq( struct rtllib_device* ieee, struct sk_buff *skb)
|
|||||||
(ieee->pHTInfo->bCurrentHTSupport == false) ||
|
(ieee->pHTInfo->bCurrentHTSupport == false) ||
|
||||||
(ieee->pHTInfo->IOTAction & HT_IOT_ACT_REJECT_ADDBA_REQ)) {
|
(ieee->pHTInfo->IOTAction & HT_IOT_ACT_REJECT_ADDBA_REQ)) {
|
||||||
rc = ADDBA_STATUS_REFUSED;
|
rc = ADDBA_STATUS_REFUSED;
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n", ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport);
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "Failed to reply on ADDBA_REQ as "
|
||||||
|
"some capability is not ready(%d, %d)\n",
|
||||||
|
ieee->current_network.qos_data.active,
|
||||||
|
ieee->pHTInfo->bCurrentHTSupport);
|
||||||
goto OnADDBAReq_Fail;
|
goto OnADDBAReq_Fail;
|
||||||
}
|
}
|
||||||
if (!GetTs(
|
if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst,
|
||||||
ieee,
|
(u8)(pBaParamSet->field.TID), RX_DIR, true)) {
|
||||||
(struct ts_common_info **)(&pTS),
|
|
||||||
dst,
|
|
||||||
(u8)(pBaParamSet->field.TID),
|
|
||||||
RX_DIR,
|
|
||||||
true) )
|
|
||||||
{
|
|
||||||
rc = ADDBA_STATUS_REFUSED;
|
rc = ADDBA_STATUS_REFUSED;
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS in %s()\n", __func__);
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS in %s()\n", __func__);
|
||||||
goto OnADDBAReq_Fail;
|
goto OnADDBAReq_Fail;
|
||||||
}
|
}
|
||||||
pBA = &pTS->RxAdmittedBARecord;
|
pBA = &pTS->RxAdmittedBARecord;
|
||||||
|
|
||||||
if (pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED)
|
if (pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED) {
|
||||||
{
|
|
||||||
rc = ADDBA_STATUS_INVALID_PARAM;
|
rc = ADDBA_STATUS_INVALID_PARAM;
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "BA Policy is not correct in %s()\n", __func__);
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "BA Policy is not correct in "
|
||||||
|
"%s()\n", __func__);
|
||||||
goto OnADDBAReq_Fail;
|
goto OnADDBAReq_Fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rtllib_FlushRxTsPendingPkts(ieee, pTS);
|
rtllib_FlushRxTsPendingPkts(ieee, pTS);
|
||||||
|
|
||||||
DeActivateBAEntry(ieee, pBA);
|
DeActivateBAEntry(ieee, pBA);
|
||||||
@@ -322,7 +320,6 @@ OnADDBAReq_Fail:
|
|||||||
rtllib_send_ADDBARsp(ieee, dst, &BA, rc);
|
rtllib_send_ADDBARsp(ieee, dst, &BA, rc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb)
|
int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb)
|
||||||
@@ -335,9 +332,10 @@ int rtllib_rx_ADDBARsp( struct rtllib_device* ieee, struct sk_buff *skb)
|
|||||||
union ba_param_set *pBaParamSet = NULL;
|
union ba_param_set *pBaParamSet = NULL;
|
||||||
u16 ReasonCode;
|
u16 ReasonCode;
|
||||||
|
|
||||||
if (skb->len < sizeof( struct rtllib_hdr_3addr) + 9)
|
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 9) {
|
||||||
{
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, " Invalid skb len in BARSP(%d / "
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, " Invalid skb len in BARSP(%d / %d)\n", (int)skb->len, (int)(sizeof( struct rtllib_hdr_3addr) + 9));
|
"%d)\n", (int)skb->len,
|
||||||
|
(int)(sizeof(struct rtllib_hdr_3addr) + 9));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
rsp = (struct rtllib_hdr_3addr *)skb->data;
|
rsp = (struct rtllib_hdr_3addr *)skb->data;
|
||||||
@@ -350,12 +348,14 @@ int rtllib_rx_ADDBARsp( struct rtllib_device* ieee, struct sk_buff *skb)
|
|||||||
pBaTimeoutVal = (u16 *)(tag + 7);
|
pBaTimeoutVal = (u16 *)(tag + 7);
|
||||||
|
|
||||||
RT_TRACE(COMP_DBG, "====>rx ADDBARSP from :"MAC_FMT"\n", MAC_ARG(dst));
|
RT_TRACE(COMP_DBG, "====>rx ADDBARSP from :"MAC_FMT"\n", MAC_ARG(dst));
|
||||||
if (
|
if (ieee->current_network.qos_data.active == 0 ||
|
||||||
ieee->current_network.qos_data.active == 0 ||
|
|
||||||
ieee->pHTInfo->bCurrentHTSupport == false ||
|
ieee->pHTInfo->bCurrentHTSupport == false ||
|
||||||
ieee->pHTInfo->bCurrentAMPDUEnable == false )
|
ieee->pHTInfo->bCurrentAMPDUEnable == false) {
|
||||||
{
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "reject to ADDBA_RSP as some capab"
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n",ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport, ieee->pHTInfo->bCurrentAMPDUEnable);
|
"ility is not ready(%d, %d, %d)\n",
|
||||||
|
ieee->current_network.qos_data.active,
|
||||||
|
ieee->pHTInfo->bCurrentHTSupport,
|
||||||
|
ieee->pHTInfo->bCurrentAMPDUEnable);
|
||||||
ReasonCode = DELBA_REASON_UNKNOWN_BA;
|
ReasonCode = DELBA_REASON_UNKNOWN_BA;
|
||||||
goto OnADDBARsp_Reject;
|
goto OnADDBARsp_Reject;
|
||||||
}
|
}
|
||||||
@@ -373,28 +373,25 @@ int rtllib_rx_ADDBARsp( struct rtllib_device* ieee, struct sk_buff *skb)
|
|||||||
pAdmittedBA = &pTS->TxAdmittedBARecord;
|
pAdmittedBA = &pTS->TxAdmittedBARecord;
|
||||||
|
|
||||||
|
|
||||||
if ((pAdmittedBA->bValid==true))
|
if ((pAdmittedBA->bValid == true)) {
|
||||||
{
|
RTLLIB_DEBUG(RTLLIB_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp."
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. Drop because already admit it! \n");
|
" Drop because already admit it!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
} else if ((pPendingBA->bValid == false) ||
|
||||||
else if ((pPendingBA->bValid == false) ||(*pDialogToken != pPendingBA->DialogToken))
|
(*pDialogToken != pPendingBA->DialogToken)) {
|
||||||
{
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "OnADDBARsp(): Recv ADDBA Rsp. "
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "OnADDBARsp(): Recv ADDBA Rsp. BA invalid, DELBA! \n");
|
"BA invalid, DELBA!\n");
|
||||||
ReasonCode = DELBA_REASON_UNKNOWN_BA;
|
ReasonCode = DELBA_REASON_UNKNOWN_BA;
|
||||||
goto OnADDBARsp_Reject;
|
goto OnADDBARsp_Reject;
|
||||||
}
|
} else {
|
||||||
else
|
RTLLIB_DEBUG(RTLLIB_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. BA "
|
||||||
{
|
"is admitted! Status code:%X\n", *pStatusCode);
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. BA is admitted! Status code:%X\n", *pStatusCode);
|
|
||||||
DeActivateBAEntry(ieee, pPendingBA);
|
DeActivateBAEntry(ieee, pPendingBA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (*pStatusCode == ADDBA_STATUS_SUCCESS)
|
if (*pStatusCode == ADDBA_STATUS_SUCCESS) {
|
||||||
{
|
if (pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED) {
|
||||||
if (pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED)
|
|
||||||
{
|
|
||||||
pTS->bAddBaReqDelayed = true;
|
pTS->bAddBaReqDelayed = true;
|
||||||
DeActivateBAEntry(ieee, pAdmittedBA);
|
DeActivateBAEntry(ieee, pAdmittedBA);
|
||||||
ReasonCode = DELBA_REASON_END_BA;
|
ReasonCode = DELBA_REASON_END_BA;
|
||||||
@@ -424,7 +421,6 @@ OnADDBARsp_Reject:
|
|||||||
rtllib_send_DELBA(ieee, dst, &BA, TX_DIR, ReasonCode);
|
rtllib_send_DELBA(ieee, dst, &BA, TX_DIR, ReasonCode);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
|
int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
|
||||||
@@ -434,17 +430,19 @@ int rtllib_rx_DELBA(struct rtllib_device* ieee,struct sk_buff *skb)
|
|||||||
u16 *pReasonCode = NULL;
|
u16 *pReasonCode = NULL;
|
||||||
u8 *dst = NULL;
|
u8 *dst = NULL;
|
||||||
|
|
||||||
if (skb->len < sizeof( struct rtllib_hdr_3addr) + 6)
|
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 6) {
|
||||||
{
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, " Invalid skb len in DELBA(%d /"
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, " Invalid skb len in DELBA(%d / %d)\n", (int)skb->len, (int)(sizeof( struct rtllib_hdr_3addr) + 6));
|
" %d)\n", (int)skb->len,
|
||||||
|
(int)(sizeof(struct rtllib_hdr_3addr) + 6));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (ieee->current_network.qos_data.active == 0 ||
|
||||||
ieee->current_network.qos_data.active == 0 ||
|
ieee->pHTInfo->bCurrentHTSupport == false) {
|
||||||
ieee->pHTInfo->bCurrentHTSupport == false )
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "received DELBA while QOS or HT "
|
||||||
{
|
"is not supported(%d, %d)\n",
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "received DELBA while QOS or HT is not supported(%d, %d)\n",ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport);
|
ieee->current_network. qos_data.active,
|
||||||
|
ieee->pHTInfo->bCurrentHTSupport);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,37 +453,26 @@ int rtllib_rx_DELBA(struct rtllib_device* ieee,struct sk_buff *skb)
|
|||||||
pDelBaParamSet = (union delba_param_set *)(delba+2);
|
pDelBaParamSet = (union delba_param_set *)(delba+2);
|
||||||
pReasonCode = (u16 *)(delba+4);
|
pReasonCode = (u16 *)(delba+4);
|
||||||
|
|
||||||
if (pDelBaParamSet->field.Initiator == 1)
|
if (pDelBaParamSet->field.Initiator == 1) {
|
||||||
{
|
|
||||||
struct rx_ts_record *pRxTs;
|
struct rx_ts_record *pRxTs;
|
||||||
|
|
||||||
if ( !GetTs(
|
if (!GetTs(ieee, (struct ts_common_info **)&pRxTs, dst,
|
||||||
ieee,
|
(u8)pDelBaParamSet->field.TID, RX_DIR, false)) {
|
||||||
(struct ts_common_info **)&pRxTs,
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS for RXTS in "
|
||||||
dst,
|
"%s().dst:"MAC_FMT" TID:%d\n", __func__,
|
||||||
(u8)pDelBaParamSet->field.TID,
|
MAC_ARG(dst),
|
||||||
RX_DIR,
|
(u8)pDelBaParamSet->field.TID);
|
||||||
false) )
|
|
||||||
{
|
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS for RXTS in %s().dst:"MAC_FMT" TID:%d\n", __func__, MAC_ARG(dst), (u8)pDelBaParamSet->field.TID);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
RxTsDeleteBA(ieee, pRxTs);
|
RxTsDeleteBA(ieee, pRxTs);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
struct tx_ts_record *pTxTs;
|
struct tx_ts_record *pTxTs;
|
||||||
|
|
||||||
if (!GetTs(
|
if (!GetTs(ieee, (struct ts_common_info **)&pTxTs, dst,
|
||||||
ieee,
|
(u8)pDelBaParamSet->field.TID, TX_DIR, false)) {
|
||||||
(struct ts_common_info **)&pTxTs,
|
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS for TXTS in "
|
||||||
dst,
|
"%s()\n", __func__);
|
||||||
(u8)pDelBaParamSet->field.TID,
|
|
||||||
TX_DIR,
|
|
||||||
false) )
|
|
||||||
{
|
|
||||||
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS for TXTS in %s()\n", __func__);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -498,13 +485,8 @@ int rtllib_rx_DELBA(struct rtllib_device* ieee,struct sk_buff *skb)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TsInitAddBA(struct rtllib_device *ieee, struct tx_ts_record *pTS,
|
||||||
TsInitAddBA(
|
u8 Policy, u8 bOverwritePending)
|
||||||
struct rtllib_device* ieee,
|
|
||||||
struct tx_ts_record *pTS,
|
|
||||||
u8 Policy,
|
|
||||||
u8 bOverwritePending
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
struct ba_record *pBA = &pTS->TxPendingBARecord;
|
struct ba_record *pBA = &pTS->TxPendingBARecord;
|
||||||
|
|
||||||
@@ -516,7 +498,8 @@ TsInitAddBA(
|
|||||||
pBA->DialogToken++;
|
pBA->DialogToken++;
|
||||||
pBA->BaParamSet.field.AMSDU_Support = 0;
|
pBA->BaParamSet.field.AMSDU_Support = 0;
|
||||||
pBA->BaParamSet.field.BAPolicy = Policy;
|
pBA->BaParamSet.field.BAPolicy = Policy;
|
||||||
pBA->BaParamSet.field.TID = pTS->TsCommonInfo.TSpec.f.TSInfo.field.ucTSID;
|
pBA->BaParamSet.field.TID =
|
||||||
|
pTS->TsCommonInfo.TSpec.f.TSInfo.field.ucTSID;
|
||||||
pBA->BaParamSet.field.BufferSize = 32;
|
pBA->BaParamSet.field.BufferSize = 32;
|
||||||
pBA->BaTimeoutValue = 0;
|
pBA->BaTimeoutValue = 0;
|
||||||
pBA->BaStartSeqCtrl.field.SeqNum = (pTS->TxCurSeq + 3) % 4096;
|
pBA->BaStartSeqCtrl.field.SeqNum = (pTS->TxCurSeq + 3) % 4096;
|
||||||
@@ -526,34 +509,30 @@ TsInitAddBA(
|
|||||||
rtllib_send_ADDBAReq(ieee, pTS->TsCommonInfo.Addr, pBA);
|
rtllib_send_ADDBAReq(ieee, pTS->TsCommonInfo.Addr, pBA);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TsInitDelBA(struct rtllib_device *ieee,
|
||||||
TsInitDelBA( struct rtllib_device* ieee, struct ts_common_info *pTsCommonInfo, enum tr_select TxRxSelect)
|
struct ts_common_info *pTsCommonInfo,
|
||||||
|
enum tr_select TxRxSelect)
|
||||||
{
|
{
|
||||||
|
if (TxRxSelect == TX_DIR) {
|
||||||
if (TxRxSelect == TX_DIR)
|
struct tx_ts_record *pTxTs =
|
||||||
{
|
(struct tx_ts_record *)pTsCommonInfo;
|
||||||
struct tx_ts_record *pTxTs = (struct tx_ts_record *)pTsCommonInfo;
|
|
||||||
|
|
||||||
if (TxTsDeleteBA(ieee, pTxTs))
|
if (TxTsDeleteBA(ieee, pTxTs))
|
||||||
rtllib_send_DELBA(
|
rtllib_send_DELBA(ieee, pTsCommonInfo->Addr,
|
||||||
ieee,
|
(pTxTs->TxAdmittedBARecord.bValid) ?
|
||||||
pTsCommonInfo->Addr,
|
(&pTxTs->TxAdmittedBARecord) :
|
||||||
(pTxTs->TxAdmittedBARecord.bValid)?(&pTxTs->TxAdmittedBARecord):(&pTxTs->TxPendingBARecord),
|
(&pTxTs->TxPendingBARecord),
|
||||||
TxRxSelect,
|
TxRxSelect, DELBA_REASON_END_BA);
|
||||||
DELBA_REASON_END_BA);
|
} else if (TxRxSelect == RX_DIR) {
|
||||||
}
|
struct rx_ts_record *pRxTs =
|
||||||
else if (TxRxSelect == RX_DIR)
|
(struct rx_ts_record *)pTsCommonInfo;
|
||||||
{
|
|
||||||
struct rx_ts_record *pRxTs = (struct rx_ts_record *)pTsCommonInfo;
|
|
||||||
if (RxTsDeleteBA(ieee, pRxTs))
|
if (RxTsDeleteBA(ieee, pRxTs))
|
||||||
rtllib_send_DELBA(
|
rtllib_send_DELBA(ieee, pTsCommonInfo->Addr,
|
||||||
ieee,
|
|
||||||
pTsCommonInfo->Addr,
|
|
||||||
&pRxTs->RxAdmittedBARecord,
|
&pRxTs->RxAdmittedBARecord,
|
||||||
TxRxSelect,
|
TxRxSelect, DELBA_REASON_END_BA);
|
||||||
DELBA_REASON_END_BA );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaSetupTimeOut(unsigned long data)
|
void BaSetupTimeOut(unsigned long data)
|
||||||
{
|
{
|
||||||
struct tx_ts_record *pTxTs = (struct tx_ts_record *)data;
|
struct tx_ts_record *pTxTs = (struct tx_ts_record *)data;
|
||||||
@@ -566,27 +545,23 @@ void BaSetupTimeOut(unsigned long data)
|
|||||||
void TxBaInactTimeout(unsigned long data)
|
void TxBaInactTimeout(unsigned long data)
|
||||||
{
|
{
|
||||||
struct tx_ts_record *pTxTs = (struct tx_ts_record *)data;
|
struct tx_ts_record *pTxTs = (struct tx_ts_record *)data;
|
||||||
struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, TxTsRecord[pTxTs->num]);
|
struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device,
|
||||||
|
TxTsRecord[pTxTs->num]);
|
||||||
TxTsDeleteBA(ieee, pTxTs);
|
TxTsDeleteBA(ieee, pTxTs);
|
||||||
rtllib_send_DELBA(
|
rtllib_send_DELBA(ieee, pTxTs->TsCommonInfo.Addr,
|
||||||
ieee,
|
&pTxTs->TxAdmittedBARecord, TX_DIR,
|
||||||
pTxTs->TsCommonInfo.Addr,
|
|
||||||
&pTxTs->TxAdmittedBARecord,
|
|
||||||
TX_DIR,
|
|
||||||
DELBA_REASON_TIMEOUT);
|
DELBA_REASON_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RxBaInactTimeout(unsigned long data)
|
void RxBaInactTimeout(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]);
|
||||||
|
|
||||||
RxTsDeleteBA(ieee, pRxTs);
|
RxTsDeleteBA(ieee, pRxTs);
|
||||||
rtllib_send_DELBA(
|
rtllib_send_DELBA(ieee, pRxTs->TsCommonInfo.Addr,
|
||||||
ieee,
|
&pRxTs->RxAdmittedBARecord, RX_DIR,
|
||||||
pRxTs->TsCommonInfo.Addr,
|
|
||||||
&pRxTs->RxAdmittedBARecord,
|
|
||||||
RX_DIR,
|
|
||||||
DELBA_REASON_TIMEOUT);
|
DELBA_REASON_TIMEOUT);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
#define HT_SUPPORTED_MCS_1SS_BITMAP 0x000000ff
|
#define HT_SUPPORTED_MCS_1SS_BITMAP 0x000000ff
|
||||||
#define HT_SUPPORTED_MCS_2SS_BITMAP 0x0000ff00
|
#define HT_SUPPORTED_MCS_2SS_BITMAP 0x0000ff00
|
||||||
#define HT_SUPPORTED_MCS_1SS_2SS_BITMAP HT_MCS_1SS_BITMAP|HT_MCS_1SS_2SS_BITMAP
|
#define HT_SUPPORTED_MCS_1SS_2SS_BITMAP \
|
||||||
|
(HT_MCS_1SS_BITMAP | HT_MCS_1SS_2SS_BITMAP)
|
||||||
|
|
||||||
enum ht_mcs_rate {
|
enum ht_mcs_rate {
|
||||||
HT_MCS0 = 0x00000001,
|
HT_MCS0 = 0x00000001,
|
||||||
@@ -381,13 +381,12 @@ extern u8 MCS_FILTER_ALL[16];
|
|||||||
extern u8 MCS_FILTER_1SS[16];
|
extern u8 MCS_FILTER_1SS[16];
|
||||||
|
|
||||||
#define PICK_RATE(_nLegacyRate, _nMcsRate) \
|
#define PICK_RATE(_nLegacyRate, _nMcsRate) \
|
||||||
(_nMcsRate==0)?(_nLegacyRate&0x7f):(_nMcsRate)
|
((_nMcsRate == 0) ? (_nLegacyRate&0x7f) : (_nMcsRate))
|
||||||
#define LEGACY_WIRELESS_MODE IEEE_MODE_MASK
|
#define LEGACY_WIRELESS_MODE IEEE_MODE_MASK
|
||||||
|
|
||||||
#define CURRENT_RATE(WirelessMode, LegacyRate, HTRate) \
|
#define CURRENT_RATE(WirelessMode, LegacyRate, HTRate) \
|
||||||
((WirelessMode & (LEGACY_WIRELESS_MODE)) != 0) ? \
|
((WirelessMode & (LEGACY_WIRELESS_MODE)) != 0) ? \
|
||||||
(LegacyRate):\
|
(LegacyRate) : (PICK_RATE(LegacyRate, HTRate))
|
||||||
(PICK_RATE(LegacyRate, HTRate))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user