Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
[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, A_UINT8 *datap, A_UINT8 phyCap,
33                         A_UINT32 sw_ver, A_UINT32 abi_ver);
34 A_STATUS ar6000_control_tx(void *devt, void *osbuf, HTC_ENDPOINT_ID eid);
35 void ar6000_connect_event(struct ar6_softc *ar, A_UINT16 channel,
36                           A_UINT8 *bssid, A_UINT16 listenInterval,
37                           A_UINT16 beaconInterval, NETWORK_TYPE networkType,
38                           A_UINT8 beaconIeLen, A_UINT8 assocReqLen,
39                           A_UINT8 assocRespLen,A_UINT8 *assocInfo);
40 void ar6000_disconnect_event(struct ar6_softc *ar, A_UINT8 reason,
41                              A_UINT8 *bssid, A_UINT8 assocRespLen,
42                              A_UINT8 *assocInfo, A_UINT16 protocolReasonStatus);
43 void ar6000_tkip_micerr_event(struct ar6_softc *ar, A_UINT8 keyid,
44                               A_BOOL ismcast);
45 void ar6000_bitrate_rx(void *devt, A_INT32 rateKbps);
46 void ar6000_channelList_rx(void *devt, A_INT8 numChan, A_UINT16 *chanList);
47 void ar6000_regDomain_event(struct ar6_softc *ar, A_UINT32 regCode);
48 void ar6000_txPwr_rx(void *devt, A_UINT8 txPwr);
49 void ar6000_keepalive_rx(void *devt, A_UINT8 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, A_UINT32 num);
53 void ar6000_scanComplete_event(struct ar6_softc *ar, A_STATUS status);
54 void ar6000_targetStats_event(struct ar6_softc *ar,  A_UINT8 *ptr, A_UINT32 len);
55 void ar6000_rssiThreshold_event(struct ar6_softc *ar,
56                                 WMI_RSSI_THRESHOLD_VAL newThreshold,
57                                 A_INT16 rssi);
58 void ar6000_reportError_event(struct ar6_softc *, WMI_TARGET_ERROR_VAL errorVal);
59 void ar6000_cac_event(struct ar6_softc *ar, A_UINT8 ac, A_UINT8 cac_indication,
60                                 A_UINT8 statusCode, A_UINT8 *tspecSuggestion);
61 void ar6000_channel_change_event(struct ar6_softc *ar, A_UINT16 oldChannel, A_UINT16 newChannel);
62 void ar6000_hbChallengeResp_event(struct ar6_softc *, A_UINT32 cookie, A_UINT32 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, A_UINT8 num_filters,
71                       WMI_GET_WOW_LIST_REPLY *wow_reply);
72
73 void ar6000_pmkid_list_event(void *devt, A_UINT8 numPMKID,
74                              WMI_PMKID *pmkidList, A_UINT8 *bssidList);
75
76 void ar6000_gpio_intr_rx(A_UINT32 intr_mask, A_UINT32 input_values);
77 void ar6000_gpio_data_rx(A_UINT32 reg_id, A_UINT32 value);
78 void ar6000_gpio_ack_rx(void);
79
80 A_INT32 rssi_compensation_calc_tcmd(A_UINT32 freq, A_INT32 rssi, A_UINT32 totalPkt);
81 A_INT16 rssi_compensation_calc(struct ar6_softc *ar, A_INT16 rssi);
82 A_INT16 rssi_compensation_reverse_calc(struct ar6_softc *ar, A_INT16 rssi, A_BOOL Above);
83
84 void ar6000_dbglog_init_done(struct ar6_softc *ar);
85
86 #ifdef SEND_EVENT_TO_APP
87 void ar6000_send_event_to_app(struct ar6_softc *ar, A_UINT16 eventId, A_UINT8 *datap, int len);
88 void ar6000_send_generic_event_to_app(struct ar6_softc *ar, A_UINT16 eventId, A_UINT8 *datap, int len);
89 #endif
90
91 #ifdef CONFIG_HOST_TCMD_SUPPORT
92 void ar6000_tcmd_rx_report_event(void *devt, A_UINT8 * results, int len);
93 #endif
94
95 void ar6000_tx_retry_err_event(void *devt);
96
97 void ar6000_snrThresholdEvent_rx(void *devt,
98                                  WMI_SNR_THRESHOLD_VAL newThreshold,
99                                  A_UINT8 snr);
100
101 void ar6000_lqThresholdEvent_rx(void *devt, WMI_LQ_THRESHOLD_VAL range, A_UINT8 lqVal);
102
103
104 void ar6000_ratemask_rx(void *devt, A_UINT32 ratemask);
105
106 A_STATUS ar6000_get_driver_cfg(struct net_device *dev,
107                                 A_UINT16 cfgParam,
108                                 void *result);
109 void ar6000_bssInfo_event_rx(struct ar6_softc *ar, A_UINT8 *data, int len);
110
111 void ar6000_dbglog_event(struct ar6_softc *ar, A_UINT32 dropped,
112                          A_INT8 *buffer, A_UINT32 length);
113
114 int ar6000_dbglog_get_debug_logs(struct ar6_softc *ar);
115
116 void ar6000_peer_event(void *devt, A_UINT8 eventCode, A_UINT8 *bssid);
117
118 void ar6000_indicate_tx_activity(void *devt, A_UINT8 trafficClass, A_BOOL Active);
119 HTC_ENDPOINT_ID  ar6000_ac2_endpoint_id ( void * devt, A_UINT8 ac);
120 A_UINT8 ar6000_endpoint_id2_ac (void * devt, HTC_ENDPOINT_ID ep );
121
122 void ar6000_btcoex_config_event(struct ar6_softc *ar,  A_UINT8 *ptr, A_UINT32 len);
123
124 void ar6000_btcoex_stats_event(struct ar6_softc *ar,  A_UINT8 *ptr, A_UINT32 len) ;
125
126 void ar6000_dset_open_req(void *devt,
127                           A_UINT32 id,
128                           A_UINT32 targ_handle,
129                           A_UINT32 targ_reply_fn,
130                           A_UINT32 targ_reply_arg);
131 void ar6000_dset_close(void *devt, A_UINT32 access_cookie);
132 void ar6000_dset_data_req(void *devt,
133                           A_UINT32 access_cookie,
134                           A_UINT32 offset,
135                           A_UINT32 length,
136                           A_UINT32 targ_buf,
137                           A_UINT32 targ_reply_fn,
138                           A_UINT32 targ_reply_arg);
139
140
141 #if defined(CONFIG_TARGET_PROFILE_SUPPORT)
142 void prof_count_rx(unsigned int addr, unsigned int count);
143 #endif
144
145 A_UINT32 ar6000_getnodeAge (void);
146
147 A_UINT32 ar6000_getclkfreq (void);
148
149 int ar6000_ap_mode_profile_commit(struct ar6_softc *ar);
150
151 struct ieee80211req_wpaie;
152 A_STATUS
153 ar6000_ap_mode_get_wpa_ie(struct ar6_softc *ar, struct ieee80211req_wpaie *wpaie);
154
155 A_STATUS is_iwioctl_allowed(A_UINT8 mode, A_UINT16 cmd);
156
157 A_STATUS is_xioctl_allowed(A_UINT8 mode, int cmd);
158
159 void ar6000_pspoll_event(struct ar6_softc *ar,A_UINT8 aid);
160
161 void ar6000_dtimexpiry_event(struct ar6_softc *ar);
162
163 void ar6000_aggr_rcv_addba_req_evt(struct ar6_softc *ar, WMI_ADDBA_REQ_EVENT *cmd);
164 void ar6000_aggr_rcv_addba_resp_evt(struct ar6_softc *ar, WMI_ADDBA_RESP_EVENT *cmd);
165 void ar6000_aggr_rcv_delba_req_evt(struct ar6_softc *ar, WMI_DELBA_EVENT *cmd);
166 void ar6000_hci_event_rcv_evt(struct ar6_softc *ar, WMI_HCI_EVENT *cmd);
167
168 #ifdef WAPI_ENABLE
169 int ap_set_wapi_key(struct ar6_softc *ar, void *ik);
170 void ap_wapi_rekey_event(struct ar6_softc *ar, A_UINT8 type, A_UINT8 *mac);
171 #endif
172
173 A_STATUS ar6000_connect_to_ap(struct ar6_softc *ar);
174 A_STATUS ar6000_update_wlan_pwr_state(struct ar6_softc *ar, AR6000_WLAN_STATE state, A_BOOL suspending);
175 A_STATUS ar6000_set_wlan_state(struct ar6_softc *ar, AR6000_WLAN_STATE state);
176 A_STATUS ar6000_set_bt_hw_state(struct ar6_softc *ar, A_UINT32 state);
177
178 #ifdef CONFIG_PM
179 A_STATUS ar6000_suspend_ev(void *context);
180 A_STATUS ar6000_resume_ev(void *context);
181 A_STATUS ar6000_power_change_ev(void *context, A_UINT32 config);
182 void ar6000_check_wow_status(struct ar6_softc *ar, struct sk_buff *skb, A_BOOL isEvent);
183 #endif
184
185 void ar6000_pm_init(void);
186 void ar6000_pm_exit(void);
187
188 #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT
189 A_STATUS ar6000_add_ap_interface(struct ar6_softc *ar, char *ifname);
190 A_STATUS ar6000_remove_ap_interface(struct ar6_softc *ar);
191 #endif /* CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT */
192
193 #ifdef __cplusplus
194 }
195 #endif
196
197 #endif