Kalle Valo | bdcd817 | 2011-07-18 00:22:30 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2010-2011 Atheros Communications Inc. |
Vasanthakumar Thiagarajan | 1b2df40 | 2012-02-06 20:15:53 +0530 | [diff] [blame^] | 3 | * Copyright (c) 2011-2012 Qualcomm Atheros, Inc. |
Kalle Valo | bdcd817 | 2011-07-18 00:22:30 +0300 | [diff] [blame] | 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 | |
| 18 | #ifndef COMMON_H |
| 19 | #define COMMON_H |
| 20 | |
| 21 | #include <linux/netdevice.h> |
| 22 | |
| 23 | #define ATH6KL_MAX_IE 256 |
| 24 | |
| 25 | extern int ath6kl_printk(const char *level, const char *fmt, ...); |
| 26 | |
Kalle Valo | bdcd817 | 2011-07-18 00:22:30 +0300 | [diff] [blame] | 27 | /* |
| 28 | * Reflects the version of binary interface exposed by ATH6KL target |
| 29 | * firmware. Needs to be incremented by 1 for any change in the firmware |
| 30 | * that requires upgrade of the driver on the host side for the change to |
| 31 | * work correctly |
| 32 | */ |
| 33 | #define ATH6KL_ABI_VERSION 1 |
| 34 | |
| 35 | #define SIGNAL_QUALITY_METRICS_NUM_MAX 2 |
| 36 | |
| 37 | enum { |
| 38 | SIGNAL_QUALITY_METRICS_SNR = 0, |
| 39 | SIGNAL_QUALITY_METRICS_RSSI, |
| 40 | SIGNAL_QUALITY_METRICS_ALL, |
| 41 | }; |
| 42 | |
| 43 | /* |
| 44 | * Data Path |
| 45 | */ |
| 46 | |
| 47 | #define WMI_MAX_TX_DATA_FRAME_LENGTH \ |
| 48 | (1500 + sizeof(struct wmi_data_hdr) + \ |
| 49 | sizeof(struct ethhdr) + \ |
| 50 | sizeof(struct ath6kl_llc_snap_hdr)) |
| 51 | |
| 52 | /* An AMSDU frame */ /* The MAX AMSDU length of AR6003 is 3839 */ |
| 53 | #define WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH \ |
| 54 | (3840 + sizeof(struct wmi_data_hdr) + \ |
| 55 | sizeof(struct ethhdr) + \ |
| 56 | sizeof(struct ath6kl_llc_snap_hdr)) |
| 57 | |
| 58 | #define EPPING_ALIGNMENT_PAD \ |
| 59 | (((sizeof(struct htc_frame_hdr) + 3) & (~0x3)) \ |
| 60 | - sizeof(struct htc_frame_hdr)) |
| 61 | |
| 62 | struct ath6kl_llc_snap_hdr { |
| 63 | u8 dsap; |
| 64 | u8 ssap; |
| 65 | u8 cntl; |
| 66 | u8 org_code[3]; |
| 67 | __be16 eth_type; |
| 68 | } __packed; |
| 69 | |
| 70 | enum crypto_type { |
| 71 | NONE_CRYPT = 0x01, |
| 72 | WEP_CRYPT = 0x02, |
| 73 | TKIP_CRYPT = 0x04, |
| 74 | AES_CRYPT = 0x08, |
Dai Shuibing | 5e07021 | 2011-11-03 11:39:37 +0200 | [diff] [blame] | 75 | WAPI_CRYPT = 0x10, |
Kalle Valo | bdcd817 | 2011-07-18 00:22:30 +0300 | [diff] [blame] | 76 | }; |
| 77 | |
Kalle Valo | bdcd817 | 2011-07-18 00:22:30 +0300 | [diff] [blame] | 78 | struct htc_endpoint_credit_dist; |
| 79 | struct ath6kl; |
| 80 | enum htc_credit_dist_reason; |
Kalle Valo | 3c37039 | 2011-10-24 12:17:12 +0300 | [diff] [blame] | 81 | struct ath6kl_htc_credit_info; |
Kalle Valo | bdcd817 | 2011-07-18 00:22:30 +0300 | [diff] [blame] | 82 | |
Kalle Valo | bdcd817 | 2011-07-18 00:22:30 +0300 | [diff] [blame] | 83 | struct sk_buff *ath6kl_buf_alloc(int size); |
Kalle Valo | bdcd817 | 2011-07-18 00:22:30 +0300 | [diff] [blame] | 84 | #endif /* COMMON_H */ |