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