ath.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2008-2009 Atheros Communications Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef ATH_H
  17. #define ATH_H
  18. #include <linux/skbuff.h>
  19. #include <linux/if_ether.h>
  20. #include <net/mac80211.h>
  21. static const u8 ath_bcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
  22. struct reg_dmn_pair_mapping {
  23. u16 regDmnEnum;
  24. u16 reg_5ghz_ctl;
  25. u16 reg_2ghz_ctl;
  26. };
  27. struct ath_regulatory {
  28. char alpha2[2];
  29. u16 country_code;
  30. u16 max_power_level;
  31. u32 tp_scale;
  32. u16 current_rd;
  33. u16 current_rd_ext;
  34. int16_t power_limit;
  35. struct reg_dmn_pair_mapping *regpair;
  36. };
  37. struct ath_ops {
  38. unsigned int (*read)(void *, u32 reg_offset);
  39. void (*write)(void *, u32 val, u32 reg_offset);
  40. };
  41. struct ath_common {
  42. void *ah;
  43. struct ieee80211_hw *hw;
  44. int debug_mask;
  45. u16 cachelsz;
  46. u16 curaid;
  47. u8 macaddr[ETH_ALEN];
  48. u8 curbssid[ETH_ALEN];
  49. u8 bssidmask[ETH_ALEN];
  50. u8 tx_chainmask;
  51. u8 rx_chainmask;
  52. struct ath_regulatory regulatory;
  53. const struct ath_ops *ops;
  54. };
  55. struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
  56. u32 len,
  57. gfp_t gfp_mask);
  58. void ath_hw_setbssidmask(struct ath_common *common);
  59. #endif /* ATH_H */