sunxi: improve A20 Lime2 upload speed
[openwrt/staging/lynxis.git] / package / kernel / mac80211 / patches / 020-09-rt2800-identify-station-based-on-status-WCID.patch
1 From a13d985f26f6df07d5c5c0e190477628e236babc Mon Sep 17 00:00:00 2001
2 From: Stanislaw Gruszka <sgruszka@redhat.com>
3 Date: Wed, 15 Feb 2017 10:25:05 +0100
4 Subject: [PATCH 09/19] rt2800: identify station based on status WCID
5
6 Add framework to identify sta based on tx status WCID. This is currently
7 not used, will start be utilized in the future patch.
8
9 Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
10 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
11 ---
12 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 5 +++++
13 drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 1 +
14 drivers/net/wireless/ralink/rt2x00/rt2x00queue.h | 3 ++-
15 3 files changed, 8 insertions(+), 1 deletion(-)
16
17 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
18 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
19 @@ -855,11 +855,13 @@ EXPORT_SYMBOL_GPL(rt2800_process_rxwi);
20 void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi)
21 {
22 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
23 + struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
24 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
25 struct txdone_entry_desc txdesc;
26 u32 word;
27 u16 mcs, real_mcs;
28 int aggr, ampdu;
29 + int wcid;
30
31 /*
32 * Obtain the status about this packet.
33 @@ -872,6 +874,7 @@ void rt2800_txdone_entry(struct queue_en
34
35 real_mcs = rt2x00_get_field32(status, TX_STA_FIFO_MCS);
36 aggr = rt2x00_get_field32(status, TX_STA_FIFO_TX_AGGRE);
37 + wcid = rt2x00_get_field32(status, TX_STA_FIFO_WCID);
38
39 /*
40 * If a frame was meant to be sent as a single non-aggregated MPDU
41 @@ -1468,6 +1471,7 @@ int rt2800_sta_add(struct rt2x00_dev *rt
42 return 0;
43
44 __set_bit(wcid - WCID_START, drv_data->sta_ids);
45 + drv_data->wcid_to_sta[wcid - WCID_START] = sta;
46
47 /*
48 * Clean up WCID attributes and write STA address to the device.
49 @@ -1498,6 +1502,7 @@ int rt2800_sta_remove(struct rt2x00_dev
50 * get renewed when the WCID is reused.
51 */
52 rt2800_config_wcid(rt2x00dev, NULL, wcid);
53 + drv_data->wcid_to_sta[wcid - WCID_START] = NULL;
54 __clear_bit(wcid - WCID_START, drv_data->sta_ids);
55
56 return 0;
57 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
58 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
59 @@ -41,6 +41,7 @@ struct rt2800_drv_data {
60 unsigned int tbtt_tick;
61 unsigned int ampdu_factor_cnt[4];
62 DECLARE_BITMAP(sta_ids, STA_IDS_SIZE);
63 + struct ieee80211_sta *wcid_to_sta[STA_IDS_SIZE];
64 };
65
66 struct rt2800_ops {
67 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
68 +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
69 @@ -102,7 +102,7 @@ enum skb_frame_desc_flags {
70 * of the scope of the skb->data pointer.
71 * @iv: IV/EIV data used during encryption/decryption.
72 * @skb_dma: (PCI-only) the DMA address associated with the sk buffer.
73 - * @entry: The entry to which this sk buffer belongs.
74 + * @sta: The station where sk buffer was sent.
75 */
76 struct skb_frame_desc {
77 u8 flags;
78 @@ -116,6 +116,7 @@ struct skb_frame_desc {
79 __le32 iv[2];
80
81 dma_addr_t skb_dma;
82 + struct ieee80211_sta *sta;
83 };
84
85 /**