提交 33fa0ec7 编写于 作者: L Loic Poulain 提交者: Zheng Zengkai

wcn36xx: Fix discarded frames due to wrong sequence number

stable inclusion
from stable-5.10.80
commit a586453da90c2211a7f8c227568db434c67f81dd
bugzilla: 185821 https://gitee.com/openeuler/kernel/issues/I4L7CG

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a586453da90c2211a7f8c227568db434c67f81dd

--------------------------------

[ Upstream commit 113f304d ]

The firmware is offering features such as ARP offload, for which
firmware crafts its own (QoS)packets without waking up the host.
Point is that the sequence numbers generated by the firmware are
not in sync with the host mac80211 layer and can cause packets
such as firmware ARP reponses to be dropped by the AP (too old SN).

To fix this we need to let the firmware manages the sequence
numbers by its own (except for QoS null frames). There is a SN
counter for each QoS queue and one global/baseline counter for
Non-QoS.

Fixes: 84aff52e ("wcn36xx: Use sequence number allocated by mac80211")
Signed-off-by: NLoic Poulain <loic.poulain@linaro.org>
Tested-by: NBryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1635150336-18736-1-git-send-email-loic.poulain@linaro.orgSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f77d1024
...@@ -344,8 +344,6 @@ static void wcn36xx_set_tx_pdu(struct wcn36xx_tx_bd *bd, ...@@ -344,8 +344,6 @@ static void wcn36xx_set_tx_pdu(struct wcn36xx_tx_bd *bd,
bd->pdu.mpdu_header_off; bd->pdu.mpdu_header_off;
bd->pdu.mpdu_len = len; bd->pdu.mpdu_len = len;
bd->pdu.tid = tid; bd->pdu.tid = tid;
/* Use seq number generated by mac80211 */
bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_HOST;
} }
static inline struct wcn36xx_vif *get_vif_by_addr(struct wcn36xx *wcn, static inline struct wcn36xx_vif *get_vif_by_addr(struct wcn36xx *wcn,
...@@ -442,6 +440,9 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, ...@@ -442,6 +440,9 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd,
tid = ieee80211_get_tid(hdr); tid = ieee80211_get_tid(hdr);
/* TID->QID is one-to-one mapping */ /* TID->QID is one-to-one mapping */
bd->queue_id = tid; bd->queue_id = tid;
bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_DPU_QOS;
} else {
bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_DPU_NON_QOS;
} }
if (info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT || if (info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT ||
...@@ -453,6 +454,8 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, ...@@ -453,6 +454,8 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd,
/* Don't use a regular queue for null packet (no ampdu) */ /* Don't use a regular queue for null packet (no ampdu) */
bd->queue_id = WCN36XX_TX_U_WQ_ID; bd->queue_id = WCN36XX_TX_U_WQ_ID;
bd->bd_rate = WCN36XX_BD_RATE_CTRL; bd->bd_rate = WCN36XX_BD_RATE_CTRL;
if (ieee80211_is_qos_nullfunc(hdr->frame_control))
bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_HOST;
} }
if (bcast) { if (bcast) {
...@@ -512,6 +515,8 @@ static void wcn36xx_set_tx_mgmt(struct wcn36xx_tx_bd *bd, ...@@ -512,6 +515,8 @@ static void wcn36xx_set_tx_mgmt(struct wcn36xx_tx_bd *bd,
bd->queue_id = WCN36XX_TX_U_WQ_ID; bd->queue_id = WCN36XX_TX_U_WQ_ID;
*vif_priv = __vif_priv; *vif_priv = __vif_priv;
bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_DPU_NON_QOS;
wcn36xx_set_tx_pdu(bd, wcn36xx_set_tx_pdu(bd,
ieee80211_is_data_qos(hdr->frame_control) ? ieee80211_is_data_qos(hdr->frame_control) ?
sizeof(struct ieee80211_qos_hdr) : sizeof(struct ieee80211_qos_hdr) :
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册