600-0005-rt2x00-rt2800lib-add-hw_beacon_count-field-to-struct.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From a058825fa7b53fab3b003d8928b60e5b686b3421 Mon Sep 17 00:00:00 2001
  2. From: Gabor Juhos <juhosg@openwrt.org>
  3. Date: Sun, 4 Aug 2013 14:36:11 +0200
  4. Subject: [PATCH] rt2x00: rt2800lib: add hw_beacon_count field to struct
  5. rt2800_drv_data
  6. Some chipsets can handle more than 8 beacons at once.
  7. Add a new field to the rt2800_drv_data structure which
  8. will hold the number of supported beacons of the given
  9. chipset.
  10. Update the rt2x00_init_registers function to get the
  11. beacon count from the new field instead of using a
  12. hardcoded value.
  13. In order to keep the current behaviour, initialize the
  14. new field with the actually used value.
  15. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  16. ---
  17. drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 5 ++++-
  18. drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 1 +
  19. 2 files changed, 5 insertions(+), 1 deletion(-)
  20. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  21. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
  22. @@ -4615,6 +4615,7 @@ EXPORT_SYMBOL_GPL(rt2800_link_tuner);
  23. */
  24. static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
  25. {
  26. + struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  27. u32 reg;
  28. u16 eeprom;
  29. unsigned int i;
  30. @@ -4980,7 +4981,7 @@ static int rt2800_init_registers(struct
  31. /*
  32. * Clear all beacons
  33. */
  34. - for (i = 0; i < 8; i++)
  35. + for (i = 0; i < drv_data->hw_beacon_count; i++)
  36. rt2800_clear_beacon_register(rt2x00dev, i);
  37. if (rt2x00_is_usb(rt2x00dev)) {
  38. @@ -7831,6 +7832,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  39. if (rt2x00_rt(rt2x00dev, RT3593))
  40. __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
  41. + drv_data->hw_beacon_count = 8;
  42. +
  43. /*
  44. * Allocate eeprom data.
  45. */
  46. --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
  47. +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
  48. @@ -35,6 +35,7 @@ struct rt2800_drv_data {
  49. u8 txmixer_gain_24g;
  50. u8 txmixer_gain_5g;
  51. unsigned int tbtt_tick;
  52. + unsigned int hw_beacon_count;
  53. DECLARE_BITMAP(sta_ids, STA_IDS_SIZE);
  54. unsigned long rt2800_flags;