replace the hard coded value of 4096 with macro which defines the maximum sequence number of a ieee 802.11 frame. Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@xxxxxxxxxxx> --- v2: Previously send this as two different patches which is wrong as the individual patches doesn't make sense.Resending as a single patch --- drivers/staging/rtl8192e/rtllib.h | 1 + drivers/staging/rtl8192e/rtllib_tx.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 3c8b708..9ee0896 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -47,6 +47,7 @@ #define MAX_PRECMD_CNT 16 #define MAX_RFDEPENDCMD_CNT 16 #define MAX_POSTCMD_CNT 16 +#define IEEE80211_MAX_SEQ 4096 #ifndef WIRELESS_SPY #define WIRELESS_SPY diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c index 3b15963..6325ceb 100644 --- a/drivers/staging/rtl8192e/rtllib_tx.c +++ b/drivers/staging/rtl8192e/rtllib_tx.c @@ -326,7 +326,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, goto FORCED_AGG_SETTING; } else if (pTxTs->bUsingBa == false) { if (SN_LESS(pTxTs->TxAdmittedBARecord.BaStartSeqCtrl.field.SeqNum, - (pTxTs->TxCurSeq+1)%4096)) + (pTxTs->TxCurSeq+1)%IEEE80211_MAX_SEQ)) pTxTs->bUsingBa = true; else goto FORCED_AGG_SETTING; @@ -525,7 +525,7 @@ u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct sk_buff *skb, skb->priority, TX_DIR, true)) return 0; seqnum = pTS->TxCurSeq; - pTS->TxCurSeq = (pTS->TxCurSeq+1)%4096; + pTS->TxCurSeq = (pTS->TxCurSeq+1)%IEEE80211_MAX_SEQ; return seqnum; } return 0; -- 1.9.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel