2
0

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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. 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 <sgruszka@redhat.com>
  8. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  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. diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  15. index 8223a1520316..46405cce35e0 100644
  16. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  17. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  18. @@ -855,11 +855,13 @@ EXPORT_SYMBOL_GPL(rt2800_process_rxwi);
  19. void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi)
  20. {
  21. struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
  22. + struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  23. struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
  24. struct txdone_entry_desc txdesc;
  25. u32 word;
  26. u16 mcs, real_mcs;
  27. int aggr, ampdu;
  28. + int wcid;
  29. /*
  30. * Obtain the status about this packet.
  31. @@ -872,6 +874,7 @@ void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi)
  32. real_mcs = rt2x00_get_field32(status, TX_STA_FIFO_MCS);
  33. aggr = rt2x00_get_field32(status, TX_STA_FIFO_TX_AGGRE);
  34. + wcid = rt2x00_get_field32(status, TX_STA_FIFO_WCID);
  35. /*
  36. * If a frame was meant to be sent as a single non-aggregated MPDU
  37. @@ -1468,6 +1471,7 @@ int rt2800_sta_add(struct rt2x00_dev *rt2x00dev, struct ieee80211_vif *vif,
  38. return 0;
  39. __set_bit(wcid - WCID_START, drv_data->sta_ids);
  40. + drv_data->wcid_to_sta[wcid - WCID_START] = sta;
  41. /*
  42. * Clean up WCID attributes and write STA address to the device.
  43. @@ -1498,6 +1502,7 @@ int rt2800_sta_remove(struct rt2x00_dev *rt2x00dev, struct ieee80211_sta *sta)
  44. * get renewed when the WCID is reused.
  45. */
  46. rt2800_config_wcid(rt2x00dev, NULL, wcid);
  47. + drv_data->wcid_to_sta[wcid - WCID_START] = NULL;
  48. __clear_bit(wcid - WCID_START, drv_data->sta_ids);
  49. return 0;
  50. diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
  51. index 8e1ae138c3f1..6811d677a6e7 100644
  52. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
  53. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
  54. @@ -41,6 +41,7 @@ struct rt2800_drv_data {
  55. unsigned int tbtt_tick;
  56. unsigned int ampdu_factor_cnt[4];
  57. DECLARE_BITMAP(sta_ids, STA_IDS_SIZE);
  58. + struct ieee80211_sta *wcid_to_sta[STA_IDS_SIZE];
  59. };
  60. struct rt2800_ops {
  61. diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
  62. index 22d18818e850..9b297fce4692 100644
  63. --- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
  64. +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
  65. @@ -102,7 +102,7 @@ enum skb_frame_desc_flags {
  66. * of the scope of the skb->data pointer.
  67. * @iv: IV/EIV data used during encryption/decryption.
  68. * @skb_dma: (PCI-only) the DMA address associated with the sk buffer.
  69. - * @entry: The entry to which this sk buffer belongs.
  70. + * @sta: The station where sk buffer was sent.
  71. */
  72. struct skb_frame_desc {
  73. u8 flags;
  74. @@ -116,6 +116,7 @@ struct skb_frame_desc {
  75. __le32 iv[2];
  76. dma_addr_t skb_dma;
  77. + struct ieee80211_sta *sta;
  78. };
  79. /**
  80. --
  81. 2.12.1