rc80211_minstrel.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (C) 2008 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_H
  9. #define __RC_MINSTREL_H
  10. struct minstrel_rate {
  11. int bitrate;
  12. int rix;
  13. unsigned int perfect_tx_time;
  14. unsigned int ack_time;
  15. unsigned int retry_count;
  16. unsigned int retry_count_cts;
  17. unsigned int retry_count_rtscts;
  18. unsigned int adjusted_retry_count;
  19. u32 success;
  20. u32 attempts;
  21. u32 last_attempts;
  22. u32 last_success;
  23. /* parts per thousand */
  24. u32 cur_prob;
  25. u32 probability;
  26. /* per-rate throughput */
  27. u32 cur_tp;
  28. u32 throughput;
  29. u64 succ_hist;
  30. u64 att_hist;
  31. };
  32. struct minstrel_sta_info {
  33. unsigned long stats_update;
  34. unsigned int sp_ack_dur;
  35. unsigned int rate_avg;
  36. unsigned int lowest_rix;
  37. unsigned int max_tp_rate;
  38. unsigned int max_tp_rate2;
  39. unsigned int max_prob_rate;
  40. unsigned int packet_count;
  41. unsigned int sample_count;
  42. int sample_deferred;
  43. unsigned int sample_idx;
  44. unsigned int sample_column;
  45. int n_rates;
  46. struct minstrel_rate *r;
  47. /* sampling table */
  48. u8 *sample_table;
  49. #ifdef CONFIG_MAC80211_DEBUGFS
  50. struct dentry *dbg_stats;
  51. #endif
  52. };
  53. struct minstrel_priv {
  54. struct ieee80211_hw *hw;
  55. bool has_mrr;
  56. unsigned int cw_min;
  57. unsigned int cw_max;
  58. unsigned int max_retry;
  59. unsigned int ewma_level;
  60. unsigned int segment_size;
  61. unsigned int update_interval;
  62. unsigned int lookaround_rate;
  63. unsigned int lookaround_rate_mrr;
  64. };
  65. void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
  66. void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
  67. #endif