18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2010-2011 Atheros Communications Inc.
38c2ecf20Sopenharmony_ci * Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any
68c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above
78c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
108c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
118c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
128c2ecf20Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
138c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
148c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
158c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
168c2ecf20Sopenharmony_ci */
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#ifndef COMMON_H
198c2ecf20Sopenharmony_ci#define COMMON_H
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#include <linux/netdevice.h>
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define ATH6KL_MAX_IE			256
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci__printf(2, 3) void ath6kl_printk(const char *level, const char *fmt, ...);
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci/*
288c2ecf20Sopenharmony_ci * Reflects the version of binary interface exposed by ATH6KL target
298c2ecf20Sopenharmony_ci * firmware. Needs to be incremented by 1 for any change in the firmware
308c2ecf20Sopenharmony_ci * that requires upgrade of the driver on the host side for the change to
318c2ecf20Sopenharmony_ci * work correctly
328c2ecf20Sopenharmony_ci */
338c2ecf20Sopenharmony_ci#define ATH6KL_ABI_VERSION        1
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define SIGNAL_QUALITY_METRICS_NUM_MAX    2
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_cienum {
388c2ecf20Sopenharmony_ci	SIGNAL_QUALITY_METRICS_SNR = 0,
398c2ecf20Sopenharmony_ci	SIGNAL_QUALITY_METRICS_RSSI,
408c2ecf20Sopenharmony_ci	SIGNAL_QUALITY_METRICS_ALL,
418c2ecf20Sopenharmony_ci};
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci/*
448c2ecf20Sopenharmony_ci * Data Path
458c2ecf20Sopenharmony_ci */
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define WMI_MAX_TX_DATA_FRAME_LENGTH	      \
488c2ecf20Sopenharmony_ci	(1500 + sizeof(struct wmi_data_hdr) + \
498c2ecf20Sopenharmony_ci	 sizeof(struct ethhdr) +      \
508c2ecf20Sopenharmony_ci	 sizeof(struct ath6kl_llc_snap_hdr))
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci/* An AMSDU frame */ /* The MAX AMSDU length of AR6003 is 3839 */
538c2ecf20Sopenharmony_ci#define WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH    \
548c2ecf20Sopenharmony_ci	(3840 + sizeof(struct wmi_data_hdr) + \
558c2ecf20Sopenharmony_ci	 sizeof(struct ethhdr) +      \
568c2ecf20Sopenharmony_ci	 sizeof(struct ath6kl_llc_snap_hdr))
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define EPPING_ALIGNMENT_PAD			       \
598c2ecf20Sopenharmony_ci	(((sizeof(struct htc_frame_hdr) + 3) & (~0x3)) \
608c2ecf20Sopenharmony_ci	 - sizeof(struct htc_frame_hdr))
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_cistruct ath6kl_llc_snap_hdr {
638c2ecf20Sopenharmony_ci	u8 dsap;
648c2ecf20Sopenharmony_ci	u8 ssap;
658c2ecf20Sopenharmony_ci	u8 cntl;
668c2ecf20Sopenharmony_ci	u8 org_code[3];
678c2ecf20Sopenharmony_ci	__be16 eth_type;
688c2ecf20Sopenharmony_ci} __packed;
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_cienum ath6kl_crypto_type {
718c2ecf20Sopenharmony_ci	NONE_CRYPT          = 0x01,
728c2ecf20Sopenharmony_ci	WEP_CRYPT           = 0x02,
738c2ecf20Sopenharmony_ci	TKIP_CRYPT          = 0x04,
748c2ecf20Sopenharmony_ci	AES_CRYPT           = 0x08,
758c2ecf20Sopenharmony_ci	WAPI_CRYPT          = 0x10,
768c2ecf20Sopenharmony_ci};
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_cistruct htc_endpoint_credit_dist;
798c2ecf20Sopenharmony_cistruct ath6kl;
808c2ecf20Sopenharmony_cistruct ath6kl_htcap;
818c2ecf20Sopenharmony_cienum htc_credit_dist_reason;
828c2ecf20Sopenharmony_cistruct ath6kl_htc_credit_info;
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_cistruct sk_buff *ath6kl_buf_alloc(int size);
858c2ecf20Sopenharmony_ci#endif /* COMMON_H */
86