2 * Copyright (c) 2010-2011 Atheros Communications Inc.
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.
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.
20 #define ATH_MCI_SCHED_BUF_SIZE (16 * 16) /* 16 entries, 4 dword each */
21 #define ATH_MCI_GPM_MAX_ENTRY 16
22 #define ATH_MCI_GPM_BUF_SIZE (ATH_MCI_GPM_MAX_ENTRY * 16)
23 #define ATH_MCI_DEF_BT_PERIOD 40
24 #define ATH_MCI_BDR_DUTY_CYCLE 20
25 #define ATH_MCI_MAX_DUTY_CYCLE 90
27 #define ATH_MCI_DEF_AGGR_LIMIT 6 /* in 0.24 ms */
28 #define ATH_MCI_MAX_ACL_PROFILE 7
29 #define ATH_MCI_MAX_SCO_PROFILE 1
30 #define ATH_MCI_MAX_PROFILE (ATH_MCI_MAX_ACL_PROFILE +\
31 ATH_MCI_MAX_SCO_PROFILE)
33 #define INC_PROF(_mci, _info) do { \
34 switch (_info->type) { \
35 case MCI_GPM_COEX_PROFILE_RFCOMM:\
36 _mci->num_other_acl++; \
38 case MCI_GPM_COEX_PROFILE_A2DP: \
43 case MCI_GPM_COEX_PROFILE_HID: \
46 case MCI_GPM_COEX_PROFILE_BNEP: \
49 case MCI_GPM_COEX_PROFILE_VOICE: \
57 #define DEC_PROF(_mci, _info) do { \
58 switch (_info->type) { \
59 case MCI_GPM_COEX_PROFILE_RFCOMM:\
60 _mci->num_other_acl--; \
62 case MCI_GPM_COEX_PROFILE_A2DP: \
67 case MCI_GPM_COEX_PROFILE_HID: \
70 case MCI_GPM_COEX_PROFILE_BNEP: \
73 case MCI_GPM_COEX_PROFILE_VOICE: \
81 #define NUM_PROF(_mci) (_mci->num_other_acl + _mci->num_a2dp + \
82 _mci->num_hid + _mci->num_pan + _mci->num_sco)
84 struct ath_mci_profile_info
{
91 u16 T
; /* Voice: Tvoice, HID: Tsniff, in slots */
92 u8 W
; /* Voice: Wvoice, HID: Sniff timeout, in slots */
93 u8 A
; /* HID: Sniff attempt, in slots */
94 struct list_head list
;
97 struct ath_mci_profile_status
{
103 struct ath_mci_profile
{
104 struct list_head info
;
105 DECLARE_BITMAP(status
, ATH_MCI_MAX_PROFILE
);
118 void *bf_addr
; /* virtual addr of desc */
119 dma_addr_t bf_paddr
; /* physical addr of buffer */
120 u32 bf_len
; /* len of data */
123 struct ath_mci_coex
{
124 atomic_t mci_cal_flag
;
125 struct ath_mci_buf sched_buf
;
126 struct ath_mci_buf gpm_buf
;
130 void ath_mci_flush_profile(struct ath_mci_profile
*mci
);
131 int ath_mci_setup(struct ath_softc
*sc
);
132 void ath_mci_cleanup(struct ath_softc
*sc
);
133 void ath_mci_intr(struct ath_softc
*sc
);