ath.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. static const u8 ath_bcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
  21. struct reg_dmn_pair_mapping {
  22. u16 regDmnEnum;
  23. u16 reg_5ghz_ctl;
  24. u16 reg_2ghz_ctl;
  25. };
  26. struct ath_regulatory {
  27. char alpha2[2];
  28. u16 country_code;
  29. u16 max_power_level;
  30. u32 tp_scale;
  31. u16 current_rd;
  32. u16 current_rd_ext;
  33. int16_t power_limit;
  34. struct reg_dmn_pair_mapping *regpair;
  35. };
  36. struct ath_ops {
  37. unsigned int (*read)(void *, u32 reg_offset);
  38. void (*write)(void *, u32 val, u32 reg_offset);
  39. };
  40. struct ath_common {
  41. u16 cachelsz;
  42. u16 curaid;
  43. u8 macaddr[ETH_ALEN];
  44. u8 curbssid[ETH_ALEN];
  45. u8 bssidmask[ETH_ALEN];
  46. struct ath_regulatory regulatory;
  47. const struct ath_ops *ops;
  48. };
  49. struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
  50. u32 len,
  51. gfp_t gfp_mask);
  52. #endif /* ATH_H */