rc80211_minstrel_ht.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef __RC_MINSTREL_HT_H
  9. #define __RC_MINSTREL_HT_H
  10. /*
  11. * The number of streams can be changed to 2 to reduce code
  12. * size and memory footprint.
  13. */
  14. #define MINSTREL_MAX_STREAMS 3
  15. #define MINSTREL_STREAM_GROUPS 4
  16. #define MCS_GROUP_RATES 8
  17. struct mcs_group {
  18. u32 flags;
  19. unsigned int streams;
  20. unsigned int duration[MCS_GROUP_RATES];
  21. };
  22. extern const struct mcs_group minstrel_mcs_groups[];
  23. struct minstrel_mcs_group_data {
  24. u8 index;
  25. u8 column;
  26. /* bitfield of supported MCS rates of this group */
  27. u8 supported;
  28. /* sorted rate set within a MCS group*/
  29. u8 max_group_tp_rate[MAX_THR_RATES];
  30. u8 max_group_prob_rate;
  31. /* MCS rate statistics */
  32. struct minstrel_rate_stats rates[MCS_GROUP_RATES];
  33. };
  34. struct minstrel_ht_sta {
  35. struct ieee80211_sta *sta;
  36. /* ampdu length (average, per sampling interval) */
  37. unsigned int ampdu_len;
  38. unsigned int ampdu_packets;
  39. /* ampdu length (EWMA) */
  40. unsigned int avg_ampdu_len;
  41. /* overall sorted rate set */
  42. u8 max_tp_rate[MAX_THR_RATES];
  43. u8 max_prob_rate;
  44. /* time of last status update */
  45. unsigned long stats_update;
  46. /* overhead time in usec for each frame */
  47. unsigned int overhead;
  48. unsigned int overhead_rtscts;
  49. unsigned int total_packets;
  50. unsigned int sample_packets;
  51. /* tx flags to add for frames for this sta */
  52. u32 tx_flags;
  53. u8 sample_wait;
  54. u8 sample_tries;
  55. u8 sample_count;
  56. u8 sample_slow;
  57. /* current MCS group to be sampled */
  58. u8 sample_group;
  59. u8 cck_supported;
  60. u8 cck_supported_short;
  61. /* MCS rate group info and statistics */
  62. struct minstrel_mcs_group_data groups[MINSTREL_MAX_STREAMS * MINSTREL_STREAM_GROUPS + 1];
  63. };
  64. struct minstrel_ht_sta_priv {
  65. union {
  66. struct minstrel_ht_sta ht;
  67. struct minstrel_sta_info legacy;
  68. };
  69. #ifdef CONFIG_MAC80211_DEBUGFS
  70. struct dentry *dbg_stats;
  71. #endif
  72. void *ratelist;
  73. void *sample_table;
  74. bool is_ht;
  75. };
  76. void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
  77. void minstrel_ht_remove_sta_debugfs(void *priv, void *priv_sta);
  78. #endif