ieee80211_amrr.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* $OpenBSD: ieee80211_amrr.h,v 1.4 2007/06/16 13:17:05 damien Exp $ */
  2. /*-
  3. * Copyright (c) 2006
  4. * Damien Bergamini <damien.bergamini@free.fr>
  5. *
  6. * Permission to use, copy, modify, and distribute this software for any
  7. * purpose with or without fee is hereby granted, provided that the above
  8. * copyright notice and this permission notice appear in all copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  13. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef _NET80211_IEEE80211_AMRR_H_
  19. #define _NET80211_IEEE80211_AMRR_H_
  20. /*-
  21. * Naive implementation of the Adaptive Multi Rate Retry algorithm:
  22. *
  23. * "IEEE 802.11 Rate Adaptation: A Practical Approach"
  24. * Mathieu Lacage, Hossein Manshaei, Thierry Turletti
  25. * INRIA Sophia - Projet Planete
  26. * http://www-sop.inria.fr/rapports/sophia/RR-5208.html
  27. */
  28. /*
  29. * Rate control settings.
  30. */
  31. struct ieee80211_amrr {
  32. u_int amrr_min_success_threshold;
  33. u_int amrr_max_success_threshold;
  34. };
  35. #define IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD 1
  36. #define IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD 15
  37. /*
  38. * Rate control state for a given node.
  39. */
  40. struct ieee80211_amrr_node {
  41. u_int amn_success;
  42. u_int amn_recovery;
  43. u_int amn_success_threshold;
  44. u_int amn_txcnt;
  45. u_int amn_retrycnt;
  46. };
  47. void ieee80211_amrr_node_init(const struct ieee80211_amrr *,
  48. struct ieee80211_amrr_node *);
  49. void ieee80211_amrr_choose(struct ieee80211_amrr *, struct ieee80211_node *,
  50. struct ieee80211_amrr_node *);
  51. #endif /* _NET80211_IEEE80211_AMRR_H_ */