Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (c) 2010-2011 Atheros Communications Inc.
0003  * Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
0004  *
0005  * Permission to use, copy, modify, and/or distribute this software for any
0006  * purpose with or without fee is hereby granted, provided that the above
0007  * copyright notice and this permission notice appear in all copies.
0008  *
0009  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
0010  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
0011  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
0012  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
0013  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
0014  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
0015  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0016  */
0017 
0018 #ifndef COMMON_H
0019 #define COMMON_H
0020 
0021 #include <linux/netdevice.h>
0022 
0023 #define ATH6KL_MAX_IE           256
0024 
0025 __printf(2, 3) void ath6kl_printk(const char *level, const char *fmt, ...);
0026 
0027 /*
0028  * Reflects the version of binary interface exposed by ATH6KL target
0029  * firmware. Needs to be incremented by 1 for any change in the firmware
0030  * that requires upgrade of the driver on the host side for the change to
0031  * work correctly
0032  */
0033 #define ATH6KL_ABI_VERSION        1
0034 
0035 #define SIGNAL_QUALITY_METRICS_NUM_MAX    2
0036 
0037 enum {
0038     SIGNAL_QUALITY_METRICS_SNR = 0,
0039     SIGNAL_QUALITY_METRICS_RSSI,
0040     SIGNAL_QUALITY_METRICS_ALL,
0041 };
0042 
0043 /*
0044  * Data Path
0045  */
0046 
0047 #define WMI_MAX_TX_DATA_FRAME_LENGTH          \
0048     (1500 + sizeof(struct wmi_data_hdr) + \
0049      sizeof(struct ethhdr) +      \
0050      sizeof(struct ath6kl_llc_snap_hdr))
0051 
0052 /* An AMSDU frame */ /* The MAX AMSDU length of AR6003 is 3839 */
0053 #define WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH    \
0054     (3840 + sizeof(struct wmi_data_hdr) + \
0055      sizeof(struct ethhdr) +      \
0056      sizeof(struct ath6kl_llc_snap_hdr))
0057 
0058 #define EPPING_ALIGNMENT_PAD                   \
0059     (((sizeof(struct htc_frame_hdr) + 3) & (~0x3)) \
0060      - sizeof(struct htc_frame_hdr))
0061 
0062 struct ath6kl_llc_snap_hdr {
0063     u8 dsap;
0064     u8 ssap;
0065     u8 cntl;
0066     u8 org_code[3];
0067     __be16 eth_type;
0068 } __packed;
0069 
0070 enum ath6kl_crypto_type {
0071     NONE_CRYPT          = 0x01,
0072     WEP_CRYPT           = 0x02,
0073     TKIP_CRYPT          = 0x04,
0074     AES_CRYPT           = 0x08,
0075     WAPI_CRYPT          = 0x10,
0076 };
0077 
0078 struct htc_endpoint_credit_dist;
0079 struct ath6kl;
0080 struct ath6kl_htcap;
0081 enum htc_credit_dist_reason;
0082 struct ath6kl_htc_credit_info;
0083 
0084 struct sk_buff *ath6kl_buf_alloc(int size);
0085 #endif /* COMMON_H */