staging: wfx: ensure that packet_id is unique

In current code, packet_id is derivated from mac802.11 packet sequence
number, but this number is only unique for a station. It is not
sufficient.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-60-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jérôme Pouiller 2020-01-15 13:55:28 +00:00 committed by Greg Kroah-Hartman
parent ded6ca11af
commit 1b38e0d042
2 changed files with 7 additions and 2 deletions

View File

@ -469,8 +469,12 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
// Fill tx request // Fill tx request
req = (struct hif_req_tx *)hif_msg->body; req = (struct hif_req_tx *)hif_msg->body;
req->packet_id = queue_id << 16 | // packet_id just need to be unique on device. 32bits are more than
IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)); // necessary for that task, so we tae advantage of it to add some extra
// data for debug.
req->packet_id = queue_id << 28 |
IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16 |
(atomic_add_return(1, &wvif->wdev->packet_id) & 0xFFFF);
req->data_flags.fc_offset = offset; req->data_flags.fc_offset = offset;
if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)
req->data_flags.after_dtim = 1; req->data_flags.after_dtim = 1;

View File

@ -54,6 +54,7 @@ struct wfx_dev {
int tx_burst_idx; int tx_burst_idx;
atomic_t tx_lock; atomic_t tx_lock;
atomic_t packet_id;
u32 key_map; u32 key_map;
struct hif_req_add_key keys[MAX_KEY_ENTRIES]; struct hif_req_add_key keys[MAX_KEY_ENTRIES];