common.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (c) 2010-2011 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 COMMON_H
  17. #define COMMON_H
  18. #include <linux/netdevice.h>
  19. #define ATH6KL_MAX_IE 256
  20. extern int ath6kl_printk(const char *level, const char *fmt, ...);
  21. /*
  22. * Reflects the version of binary interface exposed by ATH6KL target
  23. * firmware. Needs to be incremented by 1 for any change in the firmware
  24. * that requires upgrade of the driver on the host side for the change to
  25. * work correctly
  26. */
  27. #define ATH6KL_ABI_VERSION 1
  28. #define SIGNAL_QUALITY_METRICS_NUM_MAX 2
  29. enum {
  30. SIGNAL_QUALITY_METRICS_SNR = 0,
  31. SIGNAL_QUALITY_METRICS_RSSI,
  32. SIGNAL_QUALITY_METRICS_ALL,
  33. };
  34. /*
  35. * Data Path
  36. */
  37. #define WMI_MAX_TX_DATA_FRAME_LENGTH \
  38. (1500 + sizeof(struct wmi_data_hdr) + \
  39. sizeof(struct ethhdr) + \
  40. sizeof(struct ath6kl_llc_snap_hdr))
  41. /* An AMSDU frame */ /* The MAX AMSDU length of AR6003 is 3839 */
  42. #define WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH \
  43. (3840 + sizeof(struct wmi_data_hdr) + \
  44. sizeof(struct ethhdr) + \
  45. sizeof(struct ath6kl_llc_snap_hdr))
  46. #define EPPING_ALIGNMENT_PAD \
  47. (((sizeof(struct htc_frame_hdr) + 3) & (~0x3)) \
  48. - sizeof(struct htc_frame_hdr))
  49. struct ath6kl_llc_snap_hdr {
  50. u8 dsap;
  51. u8 ssap;
  52. u8 cntl;
  53. u8 org_code[3];
  54. __be16 eth_type;
  55. } __packed;
  56. enum crypto_type {
  57. NONE_CRYPT = 0x01,
  58. WEP_CRYPT = 0x02,
  59. TKIP_CRYPT = 0x04,
  60. AES_CRYPT = 0x08,
  61. WAPI_CRYPT = 0x10,
  62. };
  63. struct htc_endpoint_credit_dist;
  64. struct ath6kl;
  65. enum htc_credit_dist_reason;
  66. struct ath6kl_htc_credit_info;
  67. struct ath6kl *ath6kl_core_alloc(struct device *sdev);
  68. int ath6kl_core_init(struct ath6kl *ar);
  69. void ath6kl_core_cleanup(struct ath6kl *ar);
  70. struct sk_buff *ath6kl_buf_alloc(int size);
  71. #endif /* COMMON_H */