2 * ***************************************************************************
5 * PURPOSE: SME related definitions.
7 * Copyright (C) 2007-2011 by Cambridge Silicon Radio Ltd.
9 * Refer to LICENSE.txt included with this source code for details on
12 * ***************************************************************************
14 #ifndef __LINUX_UNIFI_SME_H__
15 #define __LINUX_UNIFI_SME_H__ 1
17 #include <linux/kernel.h>
19 #ifdef CSR_SME_USERSPACE
20 #include "sme_userspace.h"
23 #include "csr_wifi_sme_lib.h"
25 typedef int unifi_data_port_action
;
27 typedef struct unifi_port_cfg
29 /* TRUE if this port entry is allocated */
31 CsrWifiRouterCtrlPortAction port_action
;
32 CsrWifiMacAddress mac_address
;
35 #define UNIFI_MAX_CONNECTIONS 8
36 #define UNIFI_MAX_RETRY_LIMIT 5
37 #define UF_DATA_PORT_NOT_OVERIDE 0
38 #define UF_DATA_PORT_OVERIDE 1
40 typedef struct unifi_port_config
44 unifi_port_cfg_t port_cfg
[UNIFI_MAX_CONNECTIONS
];
45 } unifi_port_config_t
;
48 enum sme_request_status
{
53 SME_REQUEST_CANCELLED
,
56 /* Structure to hold a UDI logged signal */
59 /* The current status of the request */
60 enum sme_request_status request_status
;
62 /* The status the SME has passed to us */
63 CsrResult reply_status
;
65 /* SME's reply to a get request */
66 CsrWifiSmeVersions versions
;
67 CsrWifiSmePowerConfig powerConfig
;
68 CsrWifiSmeHostConfig hostConfig
;
69 CsrWifiSmeStaConfig staConfig
;
70 CsrWifiSmeDeviceConfig deviceConfig
;
71 CsrWifiSmeCoexInfo coexInfo
;
72 CsrWifiSmeCoexConfig coexConfig
;
73 CsrWifiSmeMibConfig mibConfig
;
74 CsrWifiSmeConnectionInfo connectionInfo
;
75 CsrWifiSmeConnectionConfig connectionConfig
;
76 CsrWifiSmeConnectionStats connectionStats
;
79 /* SME's reply to a scan request */
80 u16 reply_scan_results_count
;
81 CsrWifiSmeScanResult
* reply_scan_results
;
88 CsrWifiRouterEncapsulation encapsulation
;
92 } sme_ma_unidata_ind_filter_t
;
95 CsrWifiRouterCtrlPortAction
uf_sme_port_state(unifi_priv_t
*priv
,
96 unsigned char *address
,
99 unifi_port_cfg_t
*uf_sme_port_config_handle(unifi_priv_t
*priv
,
100 unsigned char *address
,
106 /* Callback for event logging to SME clients */
107 void sme_log_event(ul_client_t
*client
, const u8
*signal
, int signal_len
,
108 const bulk_data_param_t
*bulkdata
, int dir
);
110 /* The workqueue task to the set the multicast addresses list */
111 void uf_multicast_list_wq(struct work_struct
*work
);
113 /* The workqueue task to execute the TA module */
114 void uf_ta_wq(struct work_struct
*work
);
118 * SME blocking helper functions
121 # define sme_complete_request(priv, status) uf_sme_complete_request(priv, status, __func__)
123 # define sme_complete_request(priv, status) uf_sme_complete_request(priv, status, NULL)
126 void uf_sme_complete_request(unifi_priv_t
*priv
, CsrResult reply_status
, const char *func
);
127 void uf_sme_cancel_request(unifi_priv_t
*priv
, CsrResult reply_status
);
131 * Blocking functions using the SME SYS API.
133 int sme_sys_suspend(unifi_priv_t
*priv
);
134 int sme_sys_resume(unifi_priv_t
*priv
);
138 * Traffic Analysis workqueue jobs
140 void uf_ta_ind_wq(struct work_struct
*work
);
141 void uf_ta_sample_ind_wq(struct work_struct
*work
);
144 * SME config workqueue job
146 void uf_sme_config_wq(struct work_struct
*work
);
149 * To send M4 read to send IND
151 void uf_send_m4_ready_wq(struct work_struct
*work
);
153 #if (defined(CSR_WIFI_SECURITY_WAPI_ENABLE) && defined(CSR_WIFI_SECURITY_WAPI_SW_ENCRYPTION))
155 * To send data pkt to Sme for encryption
157 void uf_send_pkt_to_encrypt(struct work_struct
*work
);
160 int sme_mgt_power_config_set(unifi_priv_t
*priv
, CsrWifiSmePowerConfig
*powerConfig
);
161 int sme_mgt_power_config_get(unifi_priv_t
*priv
, CsrWifiSmePowerConfig
*powerConfig
);
162 int sme_mgt_host_config_set(unifi_priv_t
*priv
, CsrWifiSmeHostConfig
*hostConfig
);
163 int sme_mgt_host_config_get(unifi_priv_t
*priv
, CsrWifiSmeHostConfig
*hostConfig
);
164 int sme_mgt_sme_config_set(unifi_priv_t
*priv
, CsrWifiSmeStaConfig
*staConfig
, CsrWifiSmeDeviceConfig
*deviceConfig
);
165 int sme_mgt_sme_config_get(unifi_priv_t
*priv
, CsrWifiSmeStaConfig
*staConfig
, CsrWifiSmeDeviceConfig
*deviceConfig
);
166 int sme_mgt_coex_info_get(unifi_priv_t
*priv
, CsrWifiSmeCoexInfo
*coexInfo
);
167 int sme_mgt_packet_filter_set(unifi_priv_t
*priv
);
168 int sme_mgt_tspec(unifi_priv_t
*priv
, CsrWifiSmeListAction action
,
169 u32 tid
, CsrWifiSmeDataBlock
*tspec
, CsrWifiSmeDataBlock
*tclas
);
171 #ifdef CSR_SUPPORT_WEXT
173 * Blocking functions using the SME MGT API.
175 int sme_mgt_wifi_on(unifi_priv_t
*priv
);
176 int sme_mgt_wifi_off(unifi_priv_t
*priv
);
177 /*int sme_mgt_set_value_async(unifi_priv_t *priv, unifi_AppValue *app_value);
178 int sme_mgt_get_value_async(unifi_priv_t *priv, unifi_AppValue *app_value);
179 int sme_mgt_get_value(unifi_priv_t *priv, unifi_AppValue *app_value);
180 int sme_mgt_set_value(unifi_priv_t *priv, unifi_AppValue *app_value);
182 int sme_mgt_coex_config_set(unifi_priv_t
*priv
, CsrWifiSmeCoexConfig
*coexConfig
);
183 int sme_mgt_coex_config_get(unifi_priv_t
*priv
, CsrWifiSmeCoexConfig
*coexConfig
);
184 int sme_mgt_mib_config_set(unifi_priv_t
*priv
, CsrWifiSmeMibConfig
*mibConfig
);
185 int sme_mgt_mib_config_get(unifi_priv_t
*priv
, CsrWifiSmeMibConfig
*mibConfig
);
187 int sme_mgt_connection_info_set(unifi_priv_t
*priv
, CsrWifiSmeConnectionInfo
*connectionInfo
);
188 int sme_mgt_connection_info_get(unifi_priv_t
*priv
, CsrWifiSmeConnectionInfo
*connectionInfo
);
189 int sme_mgt_connection_config_set(unifi_priv_t
*priv
, CsrWifiSmeConnectionConfig
*connectionConfig
);
190 int sme_mgt_connection_config_get(unifi_priv_t
*priv
, CsrWifiSmeConnectionConfig
*connectionConfig
);
191 int sme_mgt_connection_stats_get(unifi_priv_t
*priv
, CsrWifiSmeConnectionStats
*connectionStats
);
193 int sme_mgt_versions_get(unifi_priv_t
*priv
, CsrWifiSmeVersions
*versions
);
196 int sme_mgt_scan_full(unifi_priv_t
*priv
, CsrWifiSsid
*specific_ssid
,
197 int num_channels
, unsigned char *channel_list
);
198 int sme_mgt_scan_results_get_async(unifi_priv_t
*priv
,
199 struct iw_request_info
*info
,
201 long scan_results_len
);
202 int sme_mgt_disconnect(unifi_priv_t
*priv
);
203 int sme_mgt_connect(unifi_priv_t
*priv
);
204 int sme_mgt_key(unifi_priv_t
*priv
, CsrWifiSmeKey
*sme_key
,
205 CsrWifiSmeListAction action
);
206 int sme_mgt_pmkid(unifi_priv_t
*priv
, CsrWifiSmeListAction action
,
207 CsrWifiSmePmkidList
*pmkid_list
);
208 int sme_mgt_mib_get(unifi_priv_t
*priv
,
209 unsigned char *varbind
, int *length
);
210 int sme_mgt_mib_set(unifi_priv_t
*priv
,
211 unsigned char *varbind
, int length
);
212 #ifdef CSR_SUPPORT_WEXT_AP
213 int sme_ap_start(unifi_priv_t
*priv
,u16 interface_tag
,CsrWifiSmeApConfig_t
*ap_config
);
214 int sme_ap_stop(unifi_priv_t
*priv
,u16 interface_tag
);
215 int sme_ap_config(unifi_priv_t
*priv
,CsrWifiSmeApMacConfig
*ap_mac_config
, CsrWifiNmeApConfig
*group_security_config
);
216 int uf_configure_supported_rates(u8
* supportedRates
, u8 phySupportedBitmap
);
218 int unifi_translate_scan(struct net_device
*dev
,
219 struct iw_request_info
*info
,
220 char *current_ev
, char *end_buf
,
221 CsrWifiSmeScanResult
*scan_data
,
224 #endif /* CSR_SUPPORT_WEXT */
226 int unifi_cfg_power(unifi_priv_t
*priv
, unsigned char *arg
);
227 int unifi_cfg_power_save(unifi_priv_t
*priv
, unsigned char *arg
);
228 int unifi_cfg_power_supply(unifi_priv_t
*priv
, unsigned char *arg
);
229 int unifi_cfg_packet_filters(unifi_priv_t
*priv
, unsigned char *arg
);
230 int unifi_cfg_wmm_qos_info(unifi_priv_t
*priv
, unsigned char *arg
);
231 int unifi_cfg_wmm_addts(unifi_priv_t
*priv
, unsigned char *arg
);
232 int unifi_cfg_wmm_delts(unifi_priv_t
*priv
, unsigned char *arg
);
233 int unifi_cfg_get_info(unifi_priv_t
*priv
, unsigned char *arg
);
234 int unifi_cfg_strict_draft_n(unifi_priv_t
*priv
, unsigned char *arg
);
235 int unifi_cfg_enable_okc(unifi_priv_t
*priv
, unsigned char *arg
);
236 #ifdef CSR_SUPPORT_WEXT_AP
237 int unifi_cfg_set_ap_config(unifi_priv_t
* priv
,unsigned char* arg
);
242 int convert_sme_error(CsrResult error
);
245 #endif /* __LINUX_UNIFI_SME_H__ */