70
68
#define A_DPRINTF AR_DEBUG_PRINTF
73
static A_STATUS wmi_ready_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
75
static A_STATUS wmi_connect_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
77
static A_STATUS wmi_disconnect_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
80
static A_STATUS wmi_tkip_micerr_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
82
static A_STATUS wmi_bssInfo_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
84
static A_STATUS wmi_opt_frame_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
71
static int wmi_ready_event_rx(struct wmi_t *wmip, u8 *datap, int len);
73
static int wmi_connect_event_rx(struct wmi_t *wmip, u8 *datap,
75
static int wmi_disconnect_event_rx(struct wmi_t *wmip, u8 *datap,
78
static int wmi_tkip_micerr_event_rx(struct wmi_t *wmip, u8 *datap,
80
static int wmi_bssInfo_event_rx(struct wmi_t *wmip, u8 *datap,
82
static int wmi_opt_frame_event_rx(struct wmi_t *wmip, u8 *datap,
86
static A_STATUS wmi_pstream_timeout_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
84
static int wmi_pstream_timeout_event_rx(struct wmi_t *wmip, u8 *datap,
88
static A_STATUS wmi_sync_point(struct wmi_t *wmip);
86
static int wmi_sync_point(struct wmi_t *wmip);
90
static A_STATUS wmi_bitrate_reply_rx(struct wmi_t *wmip, A_UINT8 *datap,
92
static A_STATUS wmi_ratemask_reply_rx(struct wmi_t *wmip, A_UINT8 *datap,
94
static A_STATUS wmi_channelList_reply_rx(struct wmi_t *wmip, A_UINT8 *datap,
88
static int wmi_bitrate_reply_rx(struct wmi_t *wmip, u8 *datap,
90
static int wmi_ratemask_reply_rx(struct wmi_t *wmip, u8 *datap,
92
static int wmi_channelList_reply_rx(struct wmi_t *wmip, u8 *datap,
96
static A_STATUS wmi_regDomain_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
94
static int wmi_regDomain_event_rx(struct wmi_t *wmip, u8 *datap,
98
static A_STATUS wmi_txPwr_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
99
static A_STATUS wmi_neighborReport_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
96
static int wmi_txPwr_reply_rx(struct wmi_t *wmip, u8 *datap, int len);
97
static int wmi_neighborReport_event_rx(struct wmi_t *wmip, u8 *datap,
102
static A_STATUS wmi_dset_open_req_rx(struct wmi_t *wmip, A_UINT8 *datap,
100
static int wmi_dset_open_req_rx(struct wmi_t *wmip, u8 *datap,
104
102
#ifdef CONFIG_HOST_DSET_SUPPORT
105
static A_STATUS wmi_dset_close_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
106
static A_STATUS wmi_dset_data_req_rx(struct wmi_t *wmip, A_UINT8 *datap,
103
static int wmi_dset_close_rx(struct wmi_t *wmip, u8 *datap, int len);
104
static int wmi_dset_data_req_rx(struct wmi_t *wmip, u8 *datap,
108
106
#endif /* CONFIG_HOST_DSET_SUPPORT */
111
static A_STATUS wmi_scanComplete_rx(struct wmi_t *wmip, A_UINT8 *datap,
109
static int wmi_scanComplete_rx(struct wmi_t *wmip, u8 *datap,
113
static A_STATUS wmi_errorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
114
static A_STATUS wmi_statsEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
115
static A_STATUS wmi_rssiThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
116
static A_STATUS wmi_hbChallengeResp_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
117
static A_STATUS wmi_reportErrorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
118
static A_STATUS wmi_cac_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
119
static A_STATUS wmi_channel_change_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
120
static A_STATUS wmi_roam_tbl_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
122
static A_STATUS wmi_roam_data_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
124
static A_STATUS wmi_get_wow_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
127
wmi_get_pmkid_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len);
130
wmi_set_params_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len);
133
wmi_acm_reject_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len);
135
#ifdef CONFIG_HOST_GPIO_SUPPORT
136
static A_STATUS wmi_gpio_intr_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
137
static A_STATUS wmi_gpio_data_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
138
static A_STATUS wmi_gpio_ack_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
139
#endif /* CONFIG_HOST_GPIO_SUPPORT */
111
static int wmi_errorEvent_rx(struct wmi_t *wmip, u8 *datap, int len);
112
static int wmi_statsEvent_rx(struct wmi_t *wmip, u8 *datap, int len);
113
static int wmi_rssiThresholdEvent_rx(struct wmi_t *wmip, u8 *datap, int len);
114
static int wmi_hbChallengeResp_rx(struct wmi_t *wmip, u8 *datap, int len);
115
static int wmi_reportErrorEvent_rx(struct wmi_t *wmip, u8 *datap, int len);
116
static int wmi_cac_event_rx(struct wmi_t *wmip, u8 *datap, int len);
117
static int wmi_channel_change_event_rx(struct wmi_t *wmip, u8 *datap, int len);
118
static int wmi_roam_tbl_event_rx(struct wmi_t *wmip, u8 *datap,
120
static int wmi_roam_data_event_rx(struct wmi_t *wmip, u8 *datap,
122
static int wmi_get_wow_list_event_rx(struct wmi_t *wmip, u8 *datap,
125
wmi_get_pmkid_list_event_rx(struct wmi_t *wmip, u8 *datap, u32 len);
128
wmi_set_params_event_rx(struct wmi_t *wmip, u8 *datap, u32 len);
141
131
#ifdef CONFIG_HOST_TCMD_SUPPORT
143
wmi_tcmd_test_report_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
133
wmi_tcmd_test_report_rx(struct wmi_t *wmip, u8 *datap, int len);
147
wmi_txRetryErrEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
150
wmi_snrThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
153
wmi_lqThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
156
wmi_is_bitrate_index_valid(struct wmi_t *wmip, A_INT32 rateIndex);
159
wmi_aplistEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
162
wmi_dbglog_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
164
static A_STATUS wmi_keepalive_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
166
A_STATUS wmi_cmd_send_xtnd(struct wmi_t *wmip, void *osbuf, WMIX_COMMAND_ID cmdId,
137
wmi_txRetryErrEvent_rx(struct wmi_t *wmip, u8 *datap, int len);
140
wmi_snrThresholdEvent_rx(struct wmi_t *wmip, u8 *datap, int len);
143
wmi_lqThresholdEvent_rx(struct wmi_t *wmip, u8 *datap, int len);
146
wmi_is_bitrate_index_valid(struct wmi_t *wmip, s32 rateIndex);
149
wmi_aplistEvent_rx(struct wmi_t *wmip, u8 *datap, int len);
152
wmi_dbglog_event_rx(struct wmi_t *wmip, u8 *datap, int len);
154
static int wmi_keepalive_reply_rx(struct wmi_t *wmip, u8 *datap, int len);
156
int wmi_cmd_send_xtnd(struct wmi_t *wmip, void *osbuf, WMIX_COMMAND_ID cmdId,
167
157
WMI_SYNC_FLAG syncflag);
169
A_UINT8 ar6000_get_upper_threshold(A_INT16 rssi, SQ_THRESHOLD_PARAMS *sq_thresh, A_UINT32 size);
170
A_UINT8 ar6000_get_lower_threshold(A_INT16 rssi, SQ_THRESHOLD_PARAMS *sq_thresh, A_UINT32 size);
159
u8 ar6000_get_upper_threshold(s16 rssi, SQ_THRESHOLD_PARAMS *sq_thresh, u32 size);
160
u8 ar6000_get_lower_threshold(s16 rssi, SQ_THRESHOLD_PARAMS *sq_thresh, u32 size);
172
162
void wmi_cache_configure_rssithreshold(struct wmi_t *wmip, WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd);
173
163
void wmi_cache_configure_snrthreshold(struct wmi_t *wmip, WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd);
174
static A_STATUS wmi_send_rssi_threshold_params(struct wmi_t *wmip,
164
static int wmi_send_rssi_threshold_params(struct wmi_t *wmip,
175
165
WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd);
176
static A_STATUS wmi_send_snr_threshold_params(struct wmi_t *wmip,
166
static int wmi_send_snr_threshold_params(struct wmi_t *wmip,
177
167
WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd);
178
168
#if defined(CONFIG_TARGET_PROFILE_SUPPORT)
180
wmi_prof_count_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
170
wmi_prof_count_rx(struct wmi_t *wmip, u8 *datap, int len);
181
171
#endif /* CONFIG_TARGET_PROFILE_SUPPORT */
183
static A_STATUS wmi_pspoll_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
173
static int wmi_pspoll_event_rx(struct wmi_t *wmip, u8 *datap,
185
static A_STATUS wmi_dtimexpiry_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
175
static int wmi_dtimexpiry_event_rx(struct wmi_t *wmip, u8 *datap,
188
static A_STATUS wmi_peer_node_event_rx (struct wmi_t *wmip, A_UINT8 *datap,
178
static int wmi_peer_node_event_rx (struct wmi_t *wmip, u8 *datap,
190
#ifdef ATH_AR6K_11N_SUPPORT
191
static A_STATUS wmi_addba_req_event_rx(struct wmi_t *, A_UINT8 *, int);
192
static A_STATUS wmi_addba_resp_event_rx(struct wmi_t *, A_UINT8 *, int);
193
static A_STATUS wmi_delba_req_event_rx(struct wmi_t *, A_UINT8 *, int);
194
static A_STATUS wmi_btcoex_config_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
195
static A_STATUS wmi_btcoex_stats_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
197
static A_STATUS wmi_hci_event_rx(struct wmi_t *, A_UINT8 *, int);
180
static int wmi_addba_req_event_rx(struct wmi_t *, u8 *, int);
181
static int wmi_addba_resp_event_rx(struct wmi_t *, u8 *, int);
182
static int wmi_delba_req_event_rx(struct wmi_t *, u8 *, int);
183
static int wmi_btcoex_config_event_rx(struct wmi_t *wmip, u8 *datap, int len);
184
static int wmi_btcoex_stats_event_rx(struct wmi_t *wmip, u8 *datap, int len);
185
static int wmi_hci_event_rx(struct wmi_t *, u8 *, int);
199
187
#ifdef WAPI_ENABLE
200
static A_STATUS wmi_wapi_rekey_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
188
static int wmi_wapi_rekey_event_rx(struct wmi_t *wmip, u8 *datap,
4278
4187
cmd = (WMI_POWERSAVE_TIMERS_POLICY_CMD *)(A_NETBUF_DATA(osbuf));
4279
4188
A_MEMZERO(cmd, size);
4281
A_MEMCPY(cmd, pCmd, size);
4190
memcpy(cmd, pCmd, size);
4283
4192
return (wmi_cmd_send(wmip, osbuf, WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID,
4284
4193
NO_SYNC_WMIFLAG));
4287
#ifdef CONFIG_HOST_GPIO_SUPPORT
4288
/* Send a command to Target to change GPIO output pins. */
4290
wmi_gpio_output_set(struct wmi_t *wmip,
4292
A_UINT32 clear_mask,
4293
A_UINT32 enable_mask,
4294
A_UINT32 disable_mask)
4297
WMIX_GPIO_OUTPUT_SET_CMD *output_set;
4300
size = sizeof(*output_set);
4303
(DBGFMT "Enter - set=0x%x clear=0x%x enb=0x%x dis=0x%x\n", DBGARG,
4304
set_mask, clear_mask, enable_mask, disable_mask));
4306
osbuf = A_NETBUF_ALLOC(size);
4307
if (osbuf == NULL) {
4310
A_NETBUF_PUT(osbuf, size);
4311
output_set = (WMIX_GPIO_OUTPUT_SET_CMD *)(A_NETBUF_DATA(osbuf));
4313
output_set->set_mask = set_mask;
4314
output_set->clear_mask = clear_mask;
4315
output_set->enable_mask = enable_mask;
4316
output_set->disable_mask = disable_mask;
4318
return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_OUTPUT_SET_CMDID,
4322
/* Send a command to the Target requesting state of the GPIO input pins */
4324
wmi_gpio_input_get(struct wmi_t *wmip)
4326
A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
4328
return wmi_simple_cmd_xtnd(wmip, WMIX_GPIO_INPUT_GET_CMDID);
4331
/* Send a command to the Target that changes the value of a GPIO register. */
4333
wmi_gpio_register_set(struct wmi_t *wmip,
4334
A_UINT32 gpioreg_id,
4338
WMIX_GPIO_REGISTER_SET_CMD *register_set;
4341
size = sizeof(*register_set);
4344
(DBGFMT "Enter - reg=%d value=0x%x\n", DBGARG, gpioreg_id, value));
4346
osbuf = A_NETBUF_ALLOC(size);
4347
if (osbuf == NULL) {
4350
A_NETBUF_PUT(osbuf, size);
4351
register_set = (WMIX_GPIO_REGISTER_SET_CMD *)(A_NETBUF_DATA(osbuf));
4353
register_set->gpioreg_id = gpioreg_id;
4354
register_set->value = value;
4356
return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_REGISTER_SET_CMDID,
4360
/* Send a command to the Target to fetch the value of a GPIO register. */
4362
wmi_gpio_register_get(struct wmi_t *wmip,
4363
A_UINT32 gpioreg_id)
4366
WMIX_GPIO_REGISTER_GET_CMD *register_get;
4369
size = sizeof(*register_get);
4371
A_DPRINTF(DBG_WMI, (DBGFMT "Enter - reg=%d\n", DBGARG, gpioreg_id));
4373
osbuf = A_NETBUF_ALLOC(size);
4374
if (osbuf == NULL) {
4377
A_NETBUF_PUT(osbuf, size);
4378
register_get = (WMIX_GPIO_REGISTER_GET_CMD *)(A_NETBUF_DATA(osbuf));
4380
register_get->gpioreg_id = gpioreg_id;
4382
return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_REGISTER_GET_CMDID,
4386
/* Send a command to the Target acknowledging some GPIO interrupts. */
4388
wmi_gpio_intr_ack(struct wmi_t *wmip,
4392
WMIX_GPIO_INTR_ACK_CMD *intr_ack;
4395
size = sizeof(*intr_ack);
4397
A_DPRINTF(DBG_WMI, (DBGFMT "Enter ack_mask=0x%x\n", DBGARG, ack_mask));
4399
osbuf = A_NETBUF_ALLOC(size);
4400
if (osbuf == NULL) {
4403
A_NETBUF_PUT(osbuf, size);
4404
intr_ack = (WMIX_GPIO_INTR_ACK_CMD *)(A_NETBUF_DATA(osbuf));
4406
intr_ack->ack_mask = ack_mask;
4408
return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_INTR_ACK_CMDID,
4411
#endif /* CONFIG_HOST_GPIO_SUPPORT */
4414
wmi_set_access_params_cmd(struct wmi_t *wmip, A_UINT8 ac, A_UINT16 txop, A_UINT8 eCWmin,
4415
A_UINT8 eCWmax, A_UINT8 aifsn)
4197
wmi_set_access_params_cmd(struct wmi_t *wmip, u8 ac, u16 txop, u8 eCWmin,
4198
u8 eCWmax, u8 aifsn)
4418
4201
WMI_SET_ACCESS_PARAMS_CMD *cmd;
5987
5748
alloc_cmd = (WMI_SET_TARGET_EVENT_REPORT_CMD *)(A_NETBUF_DATA(osbuf));
5988
5749
A_MEMZERO(alloc_cmd, sizeof(*cmd));
5989
A_MEMCPY(alloc_cmd, cmd, sizeof(*cmd));
5750
memcpy(alloc_cmd, cmd, sizeof(*cmd));
5991
5752
return (wmi_cmd_send(wmip, osbuf, WMI_SET_TARGET_EVENT_REPORT_CMDID,
5992
5753
NO_SYNC_WMIFLAG));
5995
bss_t *wmi_rm_current_bss (struct wmi_t *wmip, A_UINT8 *id)
5756
bss_t *wmi_rm_current_bss (struct wmi_t *wmip, u8 *id)
5997
5758
wmi_get_current_bssid (wmip, id);
5998
5759
return wlan_node_remove (&wmip->wmi_scan_table, id);
6001
A_STATUS wmi_add_current_bss (struct wmi_t *wmip, A_UINT8 *id, bss_t *bss)
5762
int wmi_add_current_bss (struct wmi_t *wmip, u8 *id, bss_t *bss)
6003
5764
wlan_setup_node (&wmip->wmi_scan_table, bss, id);
6007
#ifdef ATH_AR6K_11N_SUPPORT
6009
wmi_addba_req_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
5769
wmi_addba_req_event_rx(struct wmi_t *wmip, u8 *datap, int len)
6011
5771
WMI_ADDBA_REQ_EVENT *cmd = (WMI_ADDBA_REQ_EVENT *)datap;
6013
5773
A_WMI_AGGR_RECV_ADDBA_REQ_EVT(wmip->wmi_devt, cmd);
6020
wmi_addba_resp_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
5780
wmi_addba_resp_event_rx(struct wmi_t *wmip, u8 *datap, int len)
6022
5782
WMI_ADDBA_RESP_EVENT *cmd = (WMI_ADDBA_RESP_EVENT *)datap;
6024
5784
A_WMI_AGGR_RECV_ADDBA_RESP_EVT(wmip->wmi_devt, cmd);
6030
wmi_delba_req_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
5790
wmi_delba_req_event_rx(struct wmi_t *wmip, u8 *datap, int len)
6032
5792
WMI_DELBA_EVENT *cmd = (WMI_DELBA_EVENT *)datap;
6034
5794
A_WMI_AGGR_RECV_DELBA_REQ_EVT(wmip->wmi_devt, cmd);
6040
wmi_btcoex_config_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
5800
wmi_btcoex_config_event_rx(struct wmi_t *wmip, u8 *datap, int len)
6042
5802
A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
6044
5804
A_WMI_BTCOEX_CONFIG_EVENT(wmip->wmi_devt, datap, len);
6051
wmi_btcoex_stats_event_rx(struct wmi_t * wmip,A_UINT8 * datap,int len)
5811
wmi_btcoex_stats_event_rx(struct wmi_t * wmip,u8 *datap,int len)
6053
5813
A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
6055
5815
A_WMI_BTCOEX_STATS_EVENT(wmip->wmi_devt, datap, len);
6063
wmi_hci_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
5822
wmi_hci_event_rx(struct wmi_t *wmip, u8 *datap, int len)
6065
5824
WMI_HCI_EVENT *cmd = (WMI_HCI_EVENT *)datap;
6066
5825
A_WMI_HCI_EVENT_EVT(wmip->wmi_devt, cmd);
6071
5830
////////////////////////////////////////////////////////////////////////////////