Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mci.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-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 MCI_H
18 #define MCI_H
19 
20 #include "ar9003_mci.h"
21 
22 #define ATH_MCI_SCHED_BUF_SIZE (16 * 16) /* 16 entries, 4 dword each */
23 #define ATH_MCI_GPM_MAX_ENTRY 16
24 #define ATH_MCI_GPM_BUF_SIZE (ATH_MCI_GPM_MAX_ENTRY * 16)
25 #define ATH_MCI_DEF_BT_PERIOD 40
26 #define ATH_MCI_BDR_DUTY_CYCLE 20
27 #define ATH_MCI_MAX_DUTY_CYCLE 90
28 
29 #define ATH_MCI_DEF_AGGR_LIMIT 6 /* in 0.24 ms */
30 #define ATH_MCI_MAX_ACL_PROFILE 7
31 #define ATH_MCI_MAX_SCO_PROFILE 1
32 #define ATH_MCI_MAX_PROFILE (ATH_MCI_MAX_ACL_PROFILE +\
33  ATH_MCI_MAX_SCO_PROFILE)
34 
35 #define INC_PROF(_mci, _info) do { \
36  switch (_info->type) { \
37  case MCI_GPM_COEX_PROFILE_RFCOMM:\
38  _mci->num_other_acl++; \
39  break; \
40  case MCI_GPM_COEX_PROFILE_A2DP: \
41  _mci->num_a2dp++; \
42  if (!_info->edr) \
43  _mci->num_bdr++; \
44  break; \
45  case MCI_GPM_COEX_PROFILE_HID: \
46  _mci->num_hid++; \
47  break; \
48  case MCI_GPM_COEX_PROFILE_BNEP: \
49  _mci->num_pan++; \
50  break; \
51  case MCI_GPM_COEX_PROFILE_VOICE: \
52  _mci->num_sco++; \
53  break; \
54  default: \
55  break; \
56  } \
57  } while (0)
58 
59 #define DEC_PROF(_mci, _info) do { \
60  switch (_info->type) { \
61  case MCI_GPM_COEX_PROFILE_RFCOMM:\
62  _mci->num_other_acl--; \
63  break; \
64  case MCI_GPM_COEX_PROFILE_A2DP: \
65  _mci->num_a2dp--; \
66  if (!_info->edr) \
67  _mci->num_bdr--; \
68  break; \
69  case MCI_GPM_COEX_PROFILE_HID: \
70  _mci->num_hid--; \
71  break; \
72  case MCI_GPM_COEX_PROFILE_BNEP: \
73  _mci->num_pan--; \
74  break; \
75  case MCI_GPM_COEX_PROFILE_VOICE: \
76  _mci->num_sco--; \
77  break; \
78  default: \
79  break; \
80  } \
81  } while (0)
82 
83 #define NUM_PROF(_mci) (_mci->num_other_acl + _mci->num_a2dp + \
84  _mci->num_hid + _mci->num_pan + _mci->num_sco)
85 
89  bool start;
90  bool master;
91  bool edr;
93  u16 T; /* Voice: Tvoice, HID: Tsniff, in slots */
94  u8 W; /* Voice: Wvoice, HID: Sniff timeout, in slots */
95  u8 A; /* HID: Sniff attempt, in slots */
96  struct list_head list;
97 };
98 
101  bool is_link;
103 };
104 
106  struct list_head info;
116 };
117 
118 struct ath_mci_buf {
119  void *bf_addr; /* virtual addr of desc */
120  dma_addr_t bf_paddr; /* physical addr of buffer */
121  u32 bf_len; /* len of data */
122 };
123 
124 struct ath_mci_coex {
127 };
128 
130 int ath_mci_setup(struct ath_softc *sc);
131 void ath_mci_cleanup(struct ath_softc *sc);
132 void ath_mci_intr(struct ath_softc *sc);
133 
134 #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
135 void ath_mci_enable(struct ath_softc *sc);
136 #else
137 static inline void ath_mci_enable(struct ath_softc *sc)
138 {
139 }
140 #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
141 
142 #endif /* MCI_H*/