Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
[pandora-kernel.git] / drivers / staging / ath6kl / os / linux / include / ar6xapi_linux.h
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2004-2010 Atheros Communications Inc.
3 // All rights reserved.
4 //
5 // 
6 //
7 // Permission to use, copy, modify, and/or distribute this software for any
8 // purpose with or without fee is hereby granted, provided that the above
9 // copyright notice and this permission notice appear in all copies.
10 //
11 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 //
19 //
20 //
21 // Author(s): ="Atheros"
22 //------------------------------------------------------------------------------
23
24 #ifndef _AR6XAPI_LINUX_H
25 #define _AR6XAPI_LINUX_H
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 struct ar6_softc;
31
32 void ar6000_ready_event(void *devt, u8 *datap, u8 phyCap,
33                         u32 sw_ver, u32 abi_ver);
34 int ar6000_control_tx(void *devt, void *osbuf, HTC_ENDPOINT_ID eid);
35 void ar6000_connect_event(struct ar6_softc *ar, u16 channel,
36                           u8 *bssid, u16 listenInterval,
37                           u16 beaconInterval, NETWORK_TYPE networkType,
38                           u8 beaconIeLen, u8 assocReqLen,
39                           u8 assocRespLen,u8 *assocInfo);
40 void ar6000_disconnect_event(struct ar6_softc *ar, u8 reason,
41                              u8 *bssid, u8 assocRespLen,
42                              u8 *assocInfo, u16 protocolReasonStatus);
43 void ar6000_tkip_micerr_event(struct ar6_softc *ar, u8 keyid,
44                               bool ismcast);
45 void ar6000_bitrate_rx(void *devt, s32 rateKbps);
46 void ar6000_channelList_rx(void *devt, s8 numChan, u16 *chanList);
47 void ar6000_regDomain_event(struct ar6_softc *ar, u32 regCode);
48 void ar6000_txPwr_rx(void *devt, u8 txPwr);
49 void ar6000_keepalive_rx(void *devt, u8 configured);
50 void ar6000_neighborReport_event(struct ar6_softc *ar, int numAps,
51                                  WMI_NEIGHBOR_INFO *info);
52 void ar6000_set_numdataendpts(struct ar6_softc *ar, u32 num);
53 void ar6000_scanComplete_event(struct ar6_softc *ar, int status);
54 void ar6000_targetStats_event(struct ar6_softc *ar,  u8 *ptr, u32 len);
55 void ar6000_rssiThreshold_event(struct ar6_softc *ar,
56                                 WMI_RSSI_THRESHOLD_VAL newThreshold,
57                                 s16 rssi);
58 void ar6000_reportError_event(struct ar6_softc *, WMI_TARGET_ERROR_VAL errorVal);
59 void ar6000_cac_event(struct ar6_softc *ar, u8 ac, u8 cac_indication,
60                                 u8 statusCode, u8 *tspecSuggestion);
61 void ar6000_channel_change_event(struct ar6_softc *ar, u16 oldChannel, u16 newChannel);
62 void ar6000_hbChallengeResp_event(struct ar6_softc *, u32 cookie, u32 source);
63 void
64 ar6000_roam_tbl_event(struct ar6_softc *ar, WMI_TARGET_ROAM_TBL *pTbl);
65
66 void
67 ar6000_roam_data_event(struct ar6_softc *ar, WMI_TARGET_ROAM_DATA *p);
68
69 void
70 ar6000_wow_list_event(struct ar6_softc *ar, u8 num_filters,
71                       WMI_GET_WOW_LIST_REPLY *wow_reply);
72
73 void ar6000_pmkid_list_event(void *devt, u8 numPMKID,
74                              WMI_PMKID *pmkidList, u8 *bssidList);
75
76 void ar6000_gpio_intr_rx(u32 intr_mask, u32 input_values);
77 void ar6000_gpio_data_rx(u32 reg_id, u32 value);
78 void ar6000_gpio_ack_rx(void);
79
80 s32 rssi_compensation_calc_tcmd(u32 freq, s32 rssi, u32 totalPkt);
81 s16 rssi_compensation_calc(struct ar6_softc *ar, s16 rssi);
82 s16 rssi_compensation_reverse_calc(struct ar6_softc *ar, s16 rssi, bool Above);
83
84 void ar6000_dbglog_init_done(struct ar6_softc *ar);
85
86 #ifdef CONFIG_HOST_TCMD_SUPPORT
87 void ar6000_tcmd_rx_report_event(void *devt, u8 *results, int len);
88 #endif
89
90 void ar6000_tx_retry_err_event(void *devt);
91
92 void ar6000_snrThresholdEvent_rx(void *devt,
93                                  WMI_SNR_THRESHOLD_VAL newThreshold,
94                                  u8 snr);
95
96 void ar6000_lqThresholdEvent_rx(void *devt, WMI_LQ_THRESHOLD_VAL range, u8 lqVal);
97
98
99 void ar6000_ratemask_rx(void *devt, u32 ratemask);
100
101 int ar6000_get_driver_cfg(struct net_device *dev,
102                                 u16 cfgParam,
103                                 void *result);
104 void ar6000_bssInfo_event_rx(struct ar6_softc *ar, u8 *data, int len);
105
106 void ar6000_dbglog_event(struct ar6_softc *ar, u32 dropped,
107                          s8 *buffer, u32 length);
108
109 int ar6000_dbglog_get_debug_logs(struct ar6_softc *ar);
110
111 void ar6000_peer_event(void *devt, u8 eventCode, u8 *bssid);
112
113 void ar6000_indicate_tx_activity(void *devt, u8 trafficClass, bool Active);
114 HTC_ENDPOINT_ID  ar6000_ac2_endpoint_id ( void * devt, u8 ac);
115 u8 ar6000_endpoint_id2_ac (void * devt, HTC_ENDPOINT_ID ep );
116
117 void ar6000_btcoex_config_event(struct ar6_softc *ar,  u8 *ptr, u32 len);
118
119 void ar6000_btcoex_stats_event(struct ar6_softc *ar,  u8 *ptr, u32 len) ;
120
121 void ar6000_dset_open_req(void *devt,
122                           u32 id,
123                           u32 targ_handle,
124                           u32 targ_reply_fn,
125                           u32 targ_reply_arg);
126 void ar6000_dset_close(void *devt, u32 access_cookie);
127 void ar6000_dset_data_req(void *devt,
128                           u32 access_cookie,
129                           u32 offset,
130                           u32 length,
131                           u32 targ_buf,
132                           u32 targ_reply_fn,
133                           u32 targ_reply_arg);
134
135
136 #if defined(CONFIG_TARGET_PROFILE_SUPPORT)
137 void prof_count_rx(unsigned int addr, unsigned int count);
138 #endif
139
140 u32 ar6000_getnodeAge (void);
141
142 u32 ar6000_getclkfreq (void);
143
144 int ar6000_ap_mode_profile_commit(struct ar6_softc *ar);
145
146 struct ieee80211req_wpaie;
147 int
148 ar6000_ap_mode_get_wpa_ie(struct ar6_softc *ar, struct ieee80211req_wpaie *wpaie);
149
150 int is_iwioctl_allowed(u8 mode, u16 cmd);
151
152 int is_xioctl_allowed(u8 mode, int cmd);
153
154 void ar6000_pspoll_event(struct ar6_softc *ar,u8 aid);
155
156 void ar6000_dtimexpiry_event(struct ar6_softc *ar);
157
158 void ar6000_aggr_rcv_addba_req_evt(struct ar6_softc *ar, WMI_ADDBA_REQ_EVENT *cmd);
159 void ar6000_aggr_rcv_addba_resp_evt(struct ar6_softc *ar, WMI_ADDBA_RESP_EVENT *cmd);
160 void ar6000_aggr_rcv_delba_req_evt(struct ar6_softc *ar, WMI_DELBA_EVENT *cmd);
161 void ar6000_hci_event_rcv_evt(struct ar6_softc *ar, WMI_HCI_EVENT *cmd);
162
163 #ifdef WAPI_ENABLE
164 int ap_set_wapi_key(struct ar6_softc *ar, void *ik);
165 void ap_wapi_rekey_event(struct ar6_softc *ar, u8 type, u8 *mac);
166 #endif
167
168 int ar6000_connect_to_ap(struct ar6_softc *ar);
169 int ar6000_disconnect(struct ar6_softc *ar);
170 int ar6000_update_wlan_pwr_state(struct ar6_softc *ar, AR6000_WLAN_STATE state, bool suspending);
171 int ar6000_set_wlan_state(struct ar6_softc *ar, AR6000_WLAN_STATE state);
172 int ar6000_set_bt_hw_state(struct ar6_softc *ar, u32 state);
173
174 #ifdef CONFIG_PM
175 int ar6000_suspend_ev(void *context);
176 int ar6000_resume_ev(void *context);
177 int ar6000_power_change_ev(void *context, u32 config);
178 void ar6000_check_wow_status(struct ar6_softc *ar, struct sk_buff *skb, bool isEvent);
179 #endif
180
181 #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT
182 int ar6000_add_ap_interface(struct ar6_softc *ar, char *ifname);
183 int ar6000_remove_ap_interface(struct ar6_softc *ar);
184 #endif /* CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT */
185
186 #ifdef __cplusplus
187 }
188 #endif
189
190 #endif