common.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (c) 2010-2011 Atheros Communications Inc.
  3. * Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef COMMON_H
  18. #define COMMON_H
  19. #include <linux/netdevice.h>
  20. #define ATH6KL_MAX_IE 256
  21. __printf(2, 3) void ath6kl_printk(const char *level, const char *fmt, ...);
  22. /*
  23. * Reflects the version of binary interface exposed by ATH6KL target
  24. * firmware. Needs to be incremented by 1 for any change in the firmware
  25. * that requires upgrade of the driver on the host side for the change to
  26. * work correctly
  27. */
  28. #define ATH6KL_ABI_VERSION 1
  29. #define SIGNAL_QUALITY_METRICS_NUM_MAX 2
  30. enum {
  31. SIGNAL_QUALITY_METRICS_SNR = 0,
  32. SIGNAL_QUALITY_METRICS_RSSI,
  33. SIGNAL_QUALITY_METRICS_ALL,
  34. };
  35. /*
  36. * Data Path
  37. */
  38. #define WMI_MAX_TX_DATA_FRAME_LENGTH \
  39. (1500 + sizeof(struct wmi_data_hdr) + \
  40. sizeof(struct ethhdr) + \
  41. sizeof(struct ath6kl_llc_snap_hdr))
  42. /* An AMSDU frame */ /* The MAX AMSDU length of AR6003 is 3839 */
  43. #define WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH \
  44. (3840 + sizeof(struct wmi_data_hdr) + \
  45. sizeof(struct ethhdr) + \
  46. sizeof(struct ath6kl_llc_snap_hdr))
  47. #define EPPING_ALIGNMENT_PAD \
  48. (((sizeof(struct htc_frame_hdr) + 3) & (~0x3)) \
  49. - sizeof(struct htc_frame_hdr))
  50. struct ath6kl_llc_snap_hdr {
  51. u8 dsap;
  52. u8 ssap;
  53. u8 cntl;
  54. u8 org_code[3];
  55. __be16 eth_type;
  56. } __packed;
  57. enum crypto_type {
  58. NONE_CRYPT = 0x01,
  59. WEP_CRYPT = 0x02,
  60. TKIP_CRYPT = 0x04,
  61. AES_CRYPT = 0x08,
  62. WAPI_CRYPT = 0x10,
  63. };
  64. struct htc_endpoint_credit_dist;
  65. struct ath6kl;
  66. struct ath6kl_htcap;
  67. enum htc_credit_dist_reason;
  68. struct ath6kl_htc_credit_info;
  69. struct sk_buff *ath6kl_buf_alloc(int size);
  70. #endif /* COMMON_H */