2
0

020-09-rt2800-identify-station-based-on-status-WCID.patch 3.0 KB

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