diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/htc_hif.h')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/htc_hif.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/htc_hif.h b/drivers/net/wireless/ath/ath6kl/htc_hif.h new file mode 100644 index 000000000000..d770d4ec612e --- /dev/null +++ b/drivers/net/wireless/ath/ath6kl/htc_hif.h | |||
@@ -0,0 +1,113 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2007-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 | |||
17 | #ifndef HTC_HIF_H | ||
18 | #define HTC_HIF_H | ||
19 | |||
20 | #include "htc.h" | ||
21 | #include "hif.h" | ||
22 | |||
23 | #define ATH6KL_MAILBOXES 4 | ||
24 | |||
25 | /* HTC runs over mailbox 0 */ | ||
26 | #define HTC_MAILBOX 0 | ||
27 | |||
28 | #define ATH6KL_TARGET_DEBUG_INTR_MASK 0x01 | ||
29 | |||
30 | #define OTHER_INTS_ENABLED (INT_STATUS_ENABLE_ERROR_MASK | \ | ||
31 | INT_STATUS_ENABLE_CPU_MASK | \ | ||
32 | INT_STATUS_ENABLE_COUNTER_MASK) | ||
33 | |||
34 | #define ATH6KL_REG_IO_BUFFER_SIZE 32 | ||
35 | #define ATH6KL_MAX_REG_IO_BUFFERS 8 | ||
36 | #define ATH6KL_SCATTER_ENTRIES_PER_REQ 16 | ||
37 | #define ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER (16 * 1024) | ||
38 | #define ATH6KL_SCATTER_REQS 4 | ||
39 | |||
40 | #ifndef A_CACHE_LINE_PAD | ||
41 | #define A_CACHE_LINE_PAD 128 | ||
42 | #endif | ||
43 | #define ATH6KL_MIN_SCATTER_ENTRIES_PER_REQ 2 | ||
44 | #define ATH6KL_MIN_TRANSFER_SIZE_PER_SCATTER (4 * 1024) | ||
45 | |||
46 | struct ath6kl_irq_proc_registers { | ||
47 | u8 host_int_status; | ||
48 | u8 cpu_int_status; | ||
49 | u8 error_int_status; | ||
50 | u8 counter_int_status; | ||
51 | u8 mbox_frame; | ||
52 | u8 rx_lkahd_valid; | ||
53 | u8 host_int_status2; | ||
54 | u8 gmbox_rx_avail; | ||
55 | __le32 rx_lkahd[2]; | ||
56 | __le32 rx_gmbox_lkahd_alias[2]; | ||
57 | } __packed; | ||
58 | |||
59 | struct ath6kl_irq_enable_reg { | ||
60 | u8 int_status_en; | ||
61 | u8 cpu_int_status_en; | ||
62 | u8 err_int_status_en; | ||
63 | u8 cntr_int_status_en; | ||
64 | } __packed; | ||
65 | |||
66 | /* buffers for ASYNC I/O */ | ||
67 | struct ath6kl_async_reg_io_buffer { | ||
68 | struct htc_packet packet; | ||
69 | u8 pad1[A_CACHE_LINE_PAD]; | ||
70 | /* cache-line safe with pads around */ | ||
71 | u8 buf[ATH6KL_REG_IO_BUFFER_SIZE]; | ||
72 | u8 pad2[A_CACHE_LINE_PAD]; | ||
73 | }; | ||
74 | |||
75 | struct ath6kl_device { | ||
76 | spinlock_t lock; | ||
77 | u8 pad1[A_CACHE_LINE_PAD]; | ||
78 | struct ath6kl_irq_proc_registers irq_proc_reg; | ||
79 | u8 pad2[A_CACHE_LINE_PAD]; | ||
80 | struct ath6kl_irq_enable_reg irq_en_reg; | ||
81 | u8 pad3[A_CACHE_LINE_PAD]; | ||
82 | u32 block_sz; | ||
83 | u32 block_mask; | ||
84 | struct htc_target *htc_cnxt; | ||
85 | struct list_head reg_io; | ||
86 | struct ath6kl_async_reg_io_buffer reg_io_buf[ATH6KL_MAX_REG_IO_BUFFERS]; | ||
87 | int (*msg_pending) (struct htc_target *target, u32 lk_ahds[], | ||
88 | int *npkts_fetched); | ||
89 | struct hif_dev_scat_sup_info hif_scat_info; | ||
90 | bool virt_scat; | ||
91 | int max_rx_bndl_sz; | ||
92 | int max_tx_bndl_sz; | ||
93 | int chk_irq_status_cnt; | ||
94 | struct ath6kl *ar; | ||
95 | }; | ||
96 | |||
97 | int ath6kldev_setup(struct ath6kl_device *dev); | ||
98 | int ath6kldev_unmask_intrs(struct ath6kl_device *dev); | ||
99 | int ath6kldev_mask_intrs(struct ath6kl_device *dev); | ||
100 | int ath6kldev_poll_mboxmsg_rx(struct ath6kl_device *dev, | ||
101 | u32 *lk_ahd, int timeout); | ||
102 | int ath6kldev_rx_control(struct ath6kl_device *dev, bool enable_rx); | ||
103 | int ath6kldev_disable_intrs(struct ath6kl_device *dev); | ||
104 | |||
105 | int ath6kldev_rw_comp_handler(void *context, int status); | ||
106 | int ath6kldev_intr_bh_handler(struct ath6kl *ar); | ||
107 | |||
108 | /* Scatter Function and Definitions */ | ||
109 | int ath6kldev_setup_msg_bndl(struct ath6kl_device *dev, int max_msg_per_xfer); | ||
110 | int ath6kldev_submit_scat_req(struct ath6kl_device *dev, | ||
111 | struct hif_scatter_req *scat_req, bool read); | ||
112 | |||
113 | #endif /*ATH6KL_H_ */ | ||