| OLD | NEW |
| 1 //------------------------------------------------------------------------------ | 1 //------------------------------------------------------------------------------ |
| 2 // <copyright file="wmi.c" company="Atheros"> | 2 // Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. |
| 3 // Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. | |
| 4 // | 3 // |
| 5 // This program is free software; you can redistribute it and/or modify | |
| 6 // it under the terms of the GNU General Public License version 2 as | |
| 7 // published by the Free Software Foundation; | |
| 8 // | 4 // |
| 9 // Software distributed under the License is distributed on an "AS | 5 // Permission to use, copy, modify, and/or distribute this software for any |
| 10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | 6 // purpose with or without fee is hereby granted, provided that the above |
| 11 // implied. See the License for the specific language governing | 7 // copyright notice and this permission notice appear in all copies. |
| 12 // rights and limitations under the License. | 8 // |
| 9 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 13 // | 16 // |
| 14 // | 17 // |
| 15 //------------------------------------------------------------------------------ | 18 //------------------------------------------------------------------------------ |
| 16 //============================================================================== | 19 //============================================================================== |
| 17 // This module implements the hardware independent layer of the | 20 // This module implements the hardware independent layer of the |
| 18 // Wireless Module Interface (WMI) protocol. | 21 // Wireless Module Interface (WMI) protocol. |
| 19 // | 22 // |
| 20 // Author(s): ="Atheros" | 23 // Author(s): ="Atheros" |
| 21 //============================================================================== | 24 //============================================================================== |
| 22 | 25 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 36 #include "wmi_host.h" | 39 #include "wmi_host.h" |
| 37 #include "a_drv.h" | 40 #include "a_drv.h" |
| 38 #include "a_drv_api.h" | 41 #include "a_drv_api.h" |
| 39 #define ATH_MODULE_NAME wmi | 42 #define ATH_MODULE_NAME wmi |
| 40 #include "a_debug.h" | 43 #include "a_debug.h" |
| 41 #include "dbglog_api.h" | 44 #include "dbglog_api.h" |
| 42 #include "roaming.h" | 45 #include "roaming.h" |
| 43 | 46 |
| 44 #define ATH_DEBUG_WMI ATH_DEBUG_MAKE_MODULE_MASK(0) | 47 #define ATH_DEBUG_WMI ATH_DEBUG_MAKE_MODULE_MASK(0) |
| 45 | 48 |
| 46 #ifdef DEBUG | 49 #ifdef ATH_DEBUG_MODULE |
| 47 | 50 |
| 48 static ATH_DEBUG_MASK_DESCRIPTION wmi_debug_desc[] = { | 51 static ATH_DEBUG_MASK_DESCRIPTION wmi_debug_desc[] = { |
| 49 { ATH_DEBUG_WMI , "General WMI Tracing"}, | 52 { ATH_DEBUG_WMI , "General WMI Tracing"}, |
| 50 }; | 53 }; |
| 51 | 54 |
| 52 ATH_DEBUG_INSTANTIATE_MODULE_VAR(wmi, | 55 ATH_DEBUG_INSTANTIATE_MODULE_VAR(wmi, |
| 53 "wmi", | 56 "wmi", |
| 54 "Wireless Module Interface", | 57 "Wireless Module Interface", |
| 55 ATH_DEBUG_MASK_DEFAULTS, | 58 ATH_DEBUG_MASK_DEFAULTS, |
| 56 ATH_DEBUG_DESCRIPTION_COUNT(wmi_debug_desc), | 59 ATH_DEBUG_DESCRIPTION_COUNT(wmi_debug_desc), |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 static A_STATUS wmi_roam_data_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, |
| 120 int len); | 123 int len); |
| 121 static A_STATUS wmi_get_wow_list_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, |
| 122 int len); | 125 int len); |
| 123 static A_STATUS | 126 static A_STATUS |
| 124 wmi_get_pmkid_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len); | 127 wmi_get_pmkid_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len); |
| 125 | 128 |
| 126 static A_STATUS | 129 static A_STATUS |
| 127 wmi_set_params_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); |
| 128 | 131 |
| 132 static A_STATUS |
| 133 wmi_acm_reject_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len); |
| 134 |
| 129 #ifdef CONFIG_HOST_GPIO_SUPPORT | 135 #ifdef CONFIG_HOST_GPIO_SUPPORT |
| 130 static A_STATUS wmi_gpio_intr_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); | 136 static A_STATUS wmi_gpio_intr_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); |
| 131 static A_STATUS wmi_gpio_data_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); |
| 132 static A_STATUS wmi_gpio_ack_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); |
| 133 #endif /* CONFIG_HOST_GPIO_SUPPORT */ | 139 #endif /* CONFIG_HOST_GPIO_SUPPORT */ |
| 134 | 140 |
| 135 #ifdef CONFIG_HOST_TCMD_SUPPORT | 141 #ifdef CONFIG_HOST_TCMD_SUPPORT |
| 136 static A_STATUS | 142 static A_STATUS |
| 137 wmi_tcmd_test_report_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); | 143 wmi_tcmd_test_report_rx(struct wmi_t *wmip, A_UINT8 *datap, int len); |
| 138 #endif | 144 #endif |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ | 287 #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ |
| 282 A_UINT8 ip_ttl; /* time to live */ | 288 A_UINT8 ip_ttl; /* time to live */ |
| 283 A_UINT8 ip_p; /* protocol */ | 289 A_UINT8 ip_p; /* protocol */ |
| 284 A_UINT16 ip_sum; /* checksum */ | 290 A_UINT16 ip_sum; /* checksum */ |
| 285 A_UINT8 ip_src[4]; /* source and dest address */ | 291 A_UINT8 ip_src[4]; /* source and dest address */ |
| 286 A_UINT8 ip_dst[4]; | 292 A_UINT8 ip_dst[4]; |
| 287 } POSTPACK iphdr; | 293 } POSTPACK iphdr; |
| 288 | 294 |
| 289 #include "athendpack.h" | 295 #include "athendpack.h" |
| 290 | 296 |
| 291 A_INT16 rssi_event_value = 0; | 297 static A_INT16 rssi_event_value = 0; |
| 292 A_INT16 snr_event_value = 0; | 298 static A_INT16 snr_event_value = 0; |
| 293 | 299 |
| 294 A_BOOL is_probe_ssid = FALSE; | 300 A_BOOL is_probe_ssid = FALSE; |
| 295 | 301 |
| 296 void * | 302 void * |
| 297 wmi_init(void *devt) | 303 wmi_init(void *devt) |
| 298 { | 304 { |
| 299 struct wmi_t *wmip; | 305 struct wmi_t *wmip; |
| 300 | 306 |
| 301 A_REGISTER_MODULE_DEBUG_INFO(wmi); | 307 A_REGISTER_MODULE_DEBUG_INFO(wmi); |
| 302 | 308 |
| 303 wmip = A_MALLOC(sizeof(struct wmi_t)); | 309 wmip = A_MALLOC (sizeof(struct wmi_t)); |
| 304 if (wmip == NULL) { | 310 if (wmip == NULL) { |
| 305 return (NULL); | 311 return (NULL); |
| 306 } | 312 } |
| 307 A_MEMZERO(wmip, sizeof(*wmip)); | 313 A_MEMZERO(wmip, sizeof(struct wmi_t )); |
| 308 A_MUTEX_INIT(&wmip->wmi_lock); | 314 #ifdef THREAD_X |
| 315 INIT_WMI_LOCK(wmip); |
| 316 #else |
| 317 » A_MUTEX_INIT(&wmip->wmi_lock); |
| 318 #endif |
| 309 wmip->wmi_devt = devt; | 319 wmip->wmi_devt = devt; |
| 310 wlan_node_table_init(wmip, &wmip->wmi_scan_table); | 320 wlan_node_table_init(wmip, &wmip->wmi_scan_table); |
| 311 wmi_qos_state_init(wmip); | 321 wmi_qos_state_init(wmip); |
| 312 | 322 |
| 313 wmip->wmi_powerMode = REC_POWER; | 323 wmip->wmi_powerMode = REC_POWER; |
| 314 wmip->wmi_phyMode = WMI_11G_MODE; | 324 wmip->wmi_phyMode = WMI_11G_MODE; |
| 315 | 325 |
| 316 wmip->wmi_pair_crypto_type = NONE_CRYPT; | 326 wmip->wmi_pair_crypto_type = NONE_CRYPT; |
| 317 wmip->wmi_grp_crypto_type = NONE_CRYPT; | 327 wmip->wmi_grp_crypto_type = NONE_CRYPT; |
| 318 | 328 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 { | 368 { |
| 359 return(wmip->wmi_endpoint_id); | 369 return(wmip->wmi_endpoint_id); |
| 360 } | 370 } |
| 361 | 371 |
| 362 void | 372 void |
| 363 wmi_shutdown(struct wmi_t *wmip) | 373 wmi_shutdown(struct wmi_t *wmip) |
| 364 { | 374 { |
| 365 if (wmip != NULL) { | 375 if (wmip != NULL) { |
| 366 wlan_node_table_cleanup(&wmip->wmi_scan_table); | 376 wlan_node_table_cleanup(&wmip->wmi_scan_table); |
| 367 if (A_IS_MUTEX_VALID(&wmip->wmi_lock)) { | 377 if (A_IS_MUTEX_VALID(&wmip->wmi_lock)) { |
| 378 #ifdef THREAD_X |
| 379 DELETE_WMI_LOCK(&wmip); |
| 380 #else |
| 368 A_MUTEX_DELETE(&wmip->wmi_lock); | 381 A_MUTEX_DELETE(&wmip->wmi_lock); |
| 382 #endif |
| 369 } | 383 } |
| 370 A_FREE(wmip); | 384 A_FREE(wmip); |
| 371 } | 385 } |
| 372 } | 386 } |
| 373 | 387 |
| 374 /* | 388 /* |
| 375 * performs DIX to 802.3 encapsulation for transmit packets. | 389 * performs DIX to 802.3 encapsulation for transmit packets. |
| 376 * uses passed in buffer. Returns buffer or NULL if failed. | 390 * uses passed in buffer. Returns buffer or NULL if failed. |
| 377 * Assumes the entire DIX header is contigous and that there is | 391 * Assumes the entire DIX header is contigous and that there is |
| 378 * enough room in the buffer for a 802.3 mac header and LLC+SNAP headers. | 392 * enough room in the buffer for a 802.3 mac header and LLC+SNAP headers. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 /* Extract the endpoint info from the TOS field in the IP header */ | 581 /* Extract the endpoint info from the TOS field in the IP header */ |
| 568 | 582 |
| 569 userPriority = wmi_determine_userPriority (((A_UINT8 *)llcHdr) + siz
eof(ATH_LLC_SNAP_HDR),layer2Priority); | 583 userPriority = wmi_determine_userPriority (((A_UINT8 *)llcHdr) + siz
eof(ATH_LLC_SNAP_HDR),layer2Priority); |
| 570 } | 584 } |
| 571 else | 585 else |
| 572 { | 586 { |
| 573 userPriority = layer2Priority & 0x7; | 587 userPriority = layer2Priority & 0x7; |
| 574 } | 588 } |
| 575 } | 589 } |
| 576 | 590 |
| 591 |
| 592 /* workaround for WMM S5 */ |
| 593 if ((WMM_AC_VI == wmip->wmi_traffic_class) && ((5 == userPriority) || (4 ==
userPriority))) |
| 594 { |
| 595 userPriority = 1; |
| 596 } |
| 597 |
| 577 trafficClass = convert_userPriority_to_trafficClass(userPriority); | 598 trafficClass = convert_userPriority_to_trafficClass(userPriority); |
| 578 | 599 |
| 579 WMI_DATA_HDR_SET_UP(dtHdr, userPriority); | 600 WMI_DATA_HDR_SET_UP(dtHdr, userPriority); |
| 580 //dtHdr->info |= (userPriority & WMI_DATA_HDR_UP_MASK) << WMI_DATA_HDR_UP_SH
IFT; /* lower 3-bits are 802.1d priority */ | 601 /* lower 3-bits are 802.1d priority */ |
| 602 //dtHdr->info |= (userPriority & WMI_DATA_HDR_UP_MASK) << WMI_DATA_HDR_UP_SH
IFT; |
| 581 | 603 |
| 582 LOCK_WMI(wmip); | 604 LOCK_WMI(wmip); |
| 583 streamExists = wmip->wmi_fatPipeExists; | 605 streamExists = wmip->wmi_fatPipeExists; |
| 584 UNLOCK_WMI(wmip); | 606 UNLOCK_WMI(wmip); |
| 585 | 607 |
| 586 if (!(streamExists & (1 << trafficClass))) | 608 if (!(streamExists & (1 << trafficClass))) |
| 587 { | 609 { |
| 588 | 610 |
| 589 A_MEMZERO(&cmd, sizeof(cmd)); | 611 A_MEMZERO(&cmd, sizeof(cmd)); |
| 590 cmd.trafficClass = trafficClass; | 612 cmd.trafficClass = trafficClass; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 hdrsize = A_ROUND_UP(sizeof(struct ieee80211_qosframe),sizeof(A_UINT32))
; | 737 hdrsize = A_ROUND_UP(sizeof(struct ieee80211_qosframe),sizeof(A_UINT32))
; |
| 716 A_NETBUF_PULL(osbuf, hdrsize); | 738 A_NETBUF_PULL(osbuf, hdrsize); |
| 717 } else if (subtype == IEEE80211_FC0_SUBTYPE_DATA) { | 739 } else if (subtype == IEEE80211_FC0_SUBTYPE_DATA) { |
| 718 A_NETBUF_PULL(osbuf, sizeof(struct ieee80211_frame)); | 740 A_NETBUF_PULL(osbuf, sizeof(struct ieee80211_frame)); |
| 719 } | 741 } |
| 720 | 742 |
| 721 datap = A_NETBUF_DATA(osbuf); | 743 datap = A_NETBUF_DATA(osbuf); |
| 722 llcHdr = (ATH_LLC_SNAP_HDR *)(datap); | 744 llcHdr = (ATH_LLC_SNAP_HDR *)(datap); |
| 723 | 745 |
| 724 macHdr.typeOrLen = llcHdr->etherType; | 746 macHdr.typeOrLen = llcHdr->etherType; |
| 747 A_MEMZERO(macHdr.dstMac, sizeof(macHdr.dstMac)); |
| 748 A_MEMZERO(macHdr.srcMac, sizeof(macHdr.srcMac)); |
| 725 | 749 |
| 726 switch (wh.i_fc[1] & IEEE80211_FC1_DIR_MASK) { | 750 switch (wh.i_fc[1] & IEEE80211_FC1_DIR_MASK) { |
| 727 case IEEE80211_FC1_DIR_NODS: | 751 case IEEE80211_FC1_DIR_NODS: |
| 728 IEEE80211_ADDR_COPY(macHdr.dstMac, wh.i_addr1); | 752 IEEE80211_ADDR_COPY(macHdr.dstMac, wh.i_addr1); |
| 729 IEEE80211_ADDR_COPY(macHdr.srcMac, wh.i_addr2); | 753 IEEE80211_ADDR_COPY(macHdr.srcMac, wh.i_addr2); |
| 730 break; | 754 break; |
| 731 case IEEE80211_FC1_DIR_TODS: | 755 case IEEE80211_FC1_DIR_TODS: |
| 732 IEEE80211_ADDR_COPY(macHdr.dstMac, wh.i_addr3); | 756 IEEE80211_ADDR_COPY(macHdr.dstMac, wh.i_addr3); |
| 733 IEEE80211_ADDR_COPY(macHdr.srcMac, wh.i_addr2); | 757 IEEE80211_ADDR_COPY(macHdr.srcMac, wh.i_addr2); |
| 734 break; | 758 break; |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 status = wmi_pspoll_event_rx(wmip, datap, len); | 1126 status = wmi_pspoll_event_rx(wmip, datap, len); |
| 1103 break; | 1127 break; |
| 1104 case (WMI_DTIMEXPIRY_EVENTID): | 1128 case (WMI_DTIMEXPIRY_EVENTID): |
| 1105 A_DPRINTF(DBG_WMI, (DBGFMT "WMI_DTIMEXPIRY_EVENT\n", DBGARG)); | 1129 A_DPRINTF(DBG_WMI, (DBGFMT "WMI_DTIMEXPIRY_EVENT\n", DBGARG)); |
| 1106 status = wmi_dtimexpiry_event_rx(wmip, datap, len); | 1130 status = wmi_dtimexpiry_event_rx(wmip, datap, len); |
| 1107 break; | 1131 break; |
| 1108 case (WMI_SET_PARAMS_REPLY_EVENTID): | 1132 case (WMI_SET_PARAMS_REPLY_EVENTID): |
| 1109 A_DPRINTF(DBG_WMI, (DBGFMT "WMI_SET_PARAMS_REPLY Event\n", DBGARG)); | 1133 A_DPRINTF(DBG_WMI, (DBGFMT "WMI_SET_PARAMS_REPLY Event\n", DBGARG)); |
| 1110 status = wmi_set_params_event_rx(wmip, datap, len); | 1134 status = wmi_set_params_event_rx(wmip, datap, len); |
| 1111 break; | 1135 break; |
| 1136 case (WMI_ACM_REJECT_EVENTID): |
| 1137 A_DPRINTF(DBG_WMI, (DBGFMT "WMI_SET_PARAMS_REPLY Event\n", DBGARG)); |
| 1138 status = wmi_acm_reject_event_rx(wmip, datap, len); |
| 1139 break; |
| 1112 #ifdef ATH_AR6K_11N_SUPPORT | 1140 #ifdef ATH_AR6K_11N_SUPPORT |
| 1113 case (WMI_ADDBA_REQ_EVENTID): | 1141 case (WMI_ADDBA_REQ_EVENTID): |
| 1114 status = wmi_addba_req_event_rx(wmip, datap, len); | 1142 status = wmi_addba_req_event_rx(wmip, datap, len); |
| 1115 break; | 1143 break; |
| 1116 case (WMI_ADDBA_RESP_EVENTID): | 1144 case (WMI_ADDBA_RESP_EVENTID): |
| 1117 status = wmi_addba_resp_event_rx(wmip, datap, len); | 1145 status = wmi_addba_resp_event_rx(wmip, datap, len); |
| 1118 break; | 1146 break; |
| 1119 case (WMI_DELBA_REQ_EVENTID): | 1147 case (WMI_DELBA_REQ_EVENTID): |
| 1120 status = wmi_delba_req_event_rx(wmip, datap, len); | 1148 status = wmi_delba_req_event_rx(wmip, datap, len); |
| 1121 break; | 1149 break; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 | 1350 |
| 1323 A_WMI_NEIGHBORREPORT_EVENT(wmip->wmi_devt, numAps, ev->neighbor); | 1351 A_WMI_NEIGHBORREPORT_EVENT(wmip->wmi_devt, numAps, ev->neighbor); |
| 1324 | 1352 |
| 1325 return A_OK; | 1353 return A_OK; |
| 1326 } | 1354 } |
| 1327 | 1355 |
| 1328 static A_STATUS | 1356 static A_STATUS |
| 1329 wmi_disconnect_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) | 1357 wmi_disconnect_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) |
| 1330 { | 1358 { |
| 1331 WMI_DISCONNECT_EVENT *ev; | 1359 WMI_DISCONNECT_EVENT *ev; |
| 1360 wmip->wmi_traffic_class = 100; |
| 1332 | 1361 |
| 1333 if (len < sizeof(WMI_DISCONNECT_EVENT)) { | 1362 if (len < sizeof(WMI_DISCONNECT_EVENT)) { |
| 1334 return A_EINVAL; | 1363 return A_EINVAL; |
| 1335 } | 1364 } |
| 1336 A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); | 1365 A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); |
| 1337 | 1366 |
| 1338 ev = (WMI_DISCONNECT_EVENT *)datap; | 1367 ev = (WMI_DISCONNECT_EVENT *)datap; |
| 1339 | 1368 |
| 1340 A_MEMZERO(wmip->wmi_bssid, sizeof(wmip->wmi_bssid)); | 1369 A_MEMZERO(wmip->wmi_bssid, sizeof(wmip->wmi_bssid)); |
| 1341 | 1370 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1420 } | 1449 } |
| 1421 | 1450 |
| 1422 if(!nodeCachingAllowed) { | 1451 if(!nodeCachingAllowed) { |
| 1423 wmi_node_return(wmip, bss); | 1452 wmi_node_return(wmip, bss); |
| 1424 return A_OK; | 1453 return A_OK; |
| 1425 } | 1454 } |
| 1426 | 1455 |
| 1427 buf = datap + sizeof(WMI_BSS_INFO_HDR); | 1456 buf = datap + sizeof(WMI_BSS_INFO_HDR); |
| 1428 len -= sizeof(WMI_BSS_INFO_HDR); | 1457 len -= sizeof(WMI_BSS_INFO_HDR); |
| 1429 | 1458 |
| 1430 A_DPRINTF(DBG_WMI2, (DBGFMT "bssInfo event - ch %u, rssi %02x, " | 1459 » A_DPRINTF(DBG_WMI2, (DBGFMT "bssInfo event - ch %u, rssi %02x, " |
| 1431 "bssid \"%02x:%02x:%02x:%02x:%02x:%02x\"\n", DBGARG, | 1460 » » "bssid \"%pM\"\n", DBGARG, bih->channel, |
| 1432 bih->channel, (unsigned char) bih->rssi, bih->bssid[0], | 1461 » » (unsigned char) bih->rssi, bih->bssid)); |
| 1433 bih->bssid[1], bih->bssid[2], bih->bssid[3], bih->bssid[4], | |
| 1434 bih->bssid[5])); | |
| 1435 | 1462 |
| 1436 if(wps_enable && (bih->frameType == PROBERESP_FTYPE) ) { | 1463 if(wps_enable && (bih->frameType == PROBERESP_FTYPE) ) { |
| 1437 wmi_node_return(wmip, bss); | 1464 wmi_node_return(wmip, bss); |
| 1438 return A_OK; | 1465 return A_OK; |
| 1439 } | 1466 } |
| 1440 | 1467 |
| 1441 if (bss != NULL) { | 1468 if (bss != NULL) { |
| 1442 /* | 1469 /* |
| 1443 * Free up the node. Not the most efficient process given | 1470 * Free up the node. Not the most efficient process given |
| 1444 * we are about to allocate a new node but it is simple and should be | 1471 * we are about to allocate a new node but it is simple and should be |
| 1445 * adequate. | 1472 * adequate. |
| 1446 */ | 1473 */ |
| 1447 | 1474 |
| 1448 /* In case of hidden AP, beacon will not have ssid, | 1475 /* In case of hidden AP, beacon will not have ssid, |
| 1449 * but a directed probe response will have it, | 1476 * but a directed probe response will have it, |
| 1450 * so cache the probe-resp-ssid if already present. */ | 1477 * so cache the probe-resp-ssid if already present. */ |
| 1451 if ((TRUE == is_probe_ssid) && (BEACON_FTYPE == bih->frameType)) | 1478 if ((TRUE == is_probe_ssid) && (BEACON_FTYPE == bih->frameType)) |
| 1452 { | 1479 { |
| 1453 A_UCHAR *ie_ssid; | 1480 A_UCHAR *ie_ssid; |
| 1454 | 1481 |
| 1455 ie_ssid = bss->ni_cie.ie_ssid; | 1482 ie_ssid = bss->ni_cie.ie_ssid; |
| 1456 if(ie_ssid && (ie_ssid[1] <= IEEE80211_NWID_LEN) && (ie_ssid[2] != 0
)) | 1483 if(ie_ssid && (ie_ssid[1] <= IEEE80211_NWID_LEN) && (ie_ssid[2] != 0
)) |
| 1457 { | 1484 { |
| 1458 cached_ssid_len = ie_ssid[1]; | 1485 cached_ssid_len = ie_ssid[1]; |
| 1459 memcpy(cached_ssid_buf, ie_ssid + 2, cached_ssid_len); | 1486 memcpy(cached_ssid_buf, ie_ssid + 2, cached_ssid_len); |
| 1460 } | 1487 } |
| 1461 } | 1488 } |
| 1462 | 1489 |
| 1463 /* | 1490 /* |
| 1464 * Use the current average rssi of associated AP base on assumpiton | 1491 * Use the current average rssi of associated AP base on assumpiton |
| 1465 * 1. Most os with GUI will update RSSI by wmi_get_stats_cmd() periodica
lly | 1492 * 1. Most os with GUI will update RSSI by wmi_get_stats_cmd() periodica
lly |
| 1466 * 2. wmi_get_stats_cmd(..) will be called when calling wmi_startscan_cm
d(...) | 1493 * 2. wmi_get_stats_cmd(..) will be called when calling wmi_startscan_cm
d(...) |
| 1467 * The average value of RSSI give end-user better feeling for instance v
alue of scan result | 1494 * The average value of RSSI give end-user better feeling for instance v
alue of scan result |
| 1468 * It also sync up RSSI info in GUI between scan result and RSSI signal
icon | 1495 * It also sync up RSSI info in GUI between scan result and RSSI signal
icon |
| 1469 */ | 1496 */ |
| 1470 if (bss && IEEE80211_ADDR_EQ(wmip->wmi_bssid, bih->bssid)) { | 1497 if (IEEE80211_ADDR_EQ(wmip->wmi_bssid, bih->bssid)) { |
| 1471 bih->rssi = bss->ni_rssi; | 1498 bih->rssi = bss->ni_rssi; |
| 1472 bih->snr = bss->ni_snr; | 1499 bih->snr = bss->ni_snr; |
| 1473 } | 1500 } |
| 1474 | 1501 |
| 1475 wlan_node_reclaim(&wmip->wmi_scan_table, bss); | 1502 wlan_node_reclaim(&wmip->wmi_scan_table, bss); |
| 1476 } | 1503 } |
| 1477 | 1504 |
| 1478 /* beacon/probe response frame format | 1505 /* beacon/probe response frame format |
| 1479 * [8] time stamp | 1506 * [8] time stamp |
| 1480 * [2] beacon interval | 1507 * [2] beacon interval |
| 1481 * [2] capability information | 1508 * [2] capability information |
| 1482 * [tlv] ssid */ | 1509 * [tlv] ssid */ |
| 1483 beacon_ssid_len = buf[SSID_IE_LEN_INDEX]; | 1510 beacon_ssid_len = buf[SSID_IE_LEN_INDEX]; |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1782 return A_OK; | 1809 return A_OK; |
| 1783 } | 1810 } |
| 1784 #endif /* CONFIG_HOST_DSET_SUPPORT */ | 1811 #endif /* CONFIG_HOST_DSET_SUPPORT */ |
| 1785 | 1812 |
| 1786 static A_STATUS | 1813 static A_STATUS |
| 1787 wmi_scanComplete_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) | 1814 wmi_scanComplete_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) |
| 1788 { | 1815 { |
| 1789 WMI_SCAN_COMPLETE_EVENT *ev; | 1816 WMI_SCAN_COMPLETE_EVENT *ev; |
| 1790 | 1817 |
| 1791 ev = (WMI_SCAN_COMPLETE_EVENT *)datap; | 1818 ev = (WMI_SCAN_COMPLETE_EVENT *)datap; |
| 1819 if ((A_STATUS)ev->status == A_OK) { |
| 1820 wlan_refresh_inactive_nodes(&wmip->wmi_scan_table); |
| 1821 } |
| 1792 A_WMI_SCANCOMPLETE_EVENT(wmip->wmi_devt, (A_STATUS) ev->status); | 1822 A_WMI_SCANCOMPLETE_EVENT(wmip->wmi_devt, (A_STATUS) ev->status); |
| 1793 is_probe_ssid = FALSE; | 1823 is_probe_ssid = FALSE; |
| 1794 | 1824 |
| 1795 return A_OK; | 1825 return A_OK; |
| 1796 } | 1826 } |
| 1797 | 1827 |
| 1798 /* | 1828 /* |
| 1799 * Target is reporting a programming error. This is for | 1829 * Target is reporting a programming error. This is for |
| 1800 * developer aid only. Target only checks a few common violations | 1830 * developer aid only. Target only checks a few common violations |
| 1801 * and it is responsibility of host to do all error checking. | 1831 * and it is responsibility of host to do all error checking. |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1954 A_WMI_REPORT_ERROR_EVENT(wmip->wmi_devt, (WMI_TARGET_ERROR_VAL) reply->error
Val); | 1984 A_WMI_REPORT_ERROR_EVENT(wmip->wmi_devt, (WMI_TARGET_ERROR_VAL) reply->error
Val); |
| 1955 | 1985 |
| 1956 return A_OK; | 1986 return A_OK; |
| 1957 } | 1987 } |
| 1958 | 1988 |
| 1959 static A_STATUS | 1989 static A_STATUS |
| 1960 wmi_cac_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) | 1990 wmi_cac_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) |
| 1961 { | 1991 { |
| 1962 WMI_CAC_EVENT *reply; | 1992 WMI_CAC_EVENT *reply; |
| 1963 WMM_TSPEC_IE *tspec_ie; | 1993 WMM_TSPEC_IE *tspec_ie; |
| 1994 A_UINT16 activeTsids; |
| 1964 | 1995 |
| 1965 if (len < sizeof(*reply)) { | 1996 if (len < sizeof(*reply)) { |
| 1966 return A_EINVAL; | 1997 return A_EINVAL; |
| 1967 } | 1998 } |
| 1968 reply = (WMI_CAC_EVENT *)datap; | 1999 reply = (WMI_CAC_EVENT *)datap; |
| 1969 | 2000 |
| 1970 A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); | 2001 A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG)); |
| 1971 | 2002 |
| 1972 if ((reply->cac_indication == CAC_INDICATION_ADMISSION_RESP) && | 2003 if ((reply->cac_indication == CAC_INDICATION_ADMISSION_RESP) && |
| 1973 (reply->statusCode != TSPEC_STATUS_CODE_ADMISSION_ACCEPTED)) { | 2004 (reply->statusCode != TSPEC_STATUS_CODE_ADMISSION_ACCEPTED)) { |
| 1974 tspec_ie = (WMM_TSPEC_IE *) &(reply->tspecSuggestion); | 2005 tspec_ie = (WMM_TSPEC_IE *) &(reply->tspecSuggestion); |
| 1975 | 2006 |
| 1976 wmi_delete_pstream_cmd(wmip, reply->ac, | 2007 wmi_delete_pstream_cmd(wmip, reply->ac, |
| 1977 (tspec_ie->tsInfo_info >> TSPEC_TSID_S) & TSPEC_TSID_MASK); | 2008 (tspec_ie->tsInfo_info >> TSPEC_TSID_S) & TSPEC_TSID_MASK); |
| 1978 } | 2009 } |
| 1979 else if (reply->cac_indication == CAC_INDICATION_NO_RESP) { | 2010 else if (reply->cac_indication == CAC_INDICATION_NO_RESP) { |
| 1980 A_UINT16 activeTsids; | |
| 1981 A_UINT8 i; | 2011 A_UINT8 i; |
| 1982 | 2012 |
| 1983 /* following assumes that there is only one outstanding ADDTS request | 2013 /* following assumes that there is only one outstanding ADDTS request |
| 1984 when this event is received */ | 2014 when this event is received */ |
| 1985 LOCK_WMI(wmip); | 2015 LOCK_WMI(wmip); |
| 1986 activeTsids = wmip->wmi_streamExistsForAC[reply->ac]; | 2016 activeTsids = wmip->wmi_streamExistsForAC[reply->ac]; |
| 1987 UNLOCK_WMI(wmip); | 2017 UNLOCK_WMI(wmip); |
| 1988 | 2018 |
| 1989 for (i = 0; i < sizeof(activeTsids) * 8; i++) { | 2019 for (i = 0; i < sizeof(activeTsids) * 8; i++) { |
| 1990 if ((activeTsids >> i) & 1) { | 2020 if ((activeTsids >> i) & 1) { |
| 1991 break; | 2021 break; |
| 1992 } | 2022 } |
| 1993 } | 2023 } |
| 1994 if (i < (sizeof(activeTsids) * 8)) { | 2024 if (i < (sizeof(activeTsids) * 8)) { |
| 1995 wmi_delete_pstream_cmd(wmip, reply->ac, i); | 2025 wmi_delete_pstream_cmd(wmip, reply->ac, i); |
| 1996 } | 2026 } |
| 1997 } | 2027 } |
| 2028 /* |
| 2029 * Ev#72990: Clear active tsids and Add missing handling |
| 2030 * for delete qos stream from AP |
| 2031 */ |
| 2032 else if (reply->cac_indication == CAC_INDICATION_DELETE) { |
| 2033 A_UINT8 tsid = 0; |
| 2034 |
| 2035 tspec_ie = (WMM_TSPEC_IE *) &(reply->tspecSuggestion); |
| 2036 tsid= ((tspec_ie->tsInfo_info >> TSPEC_TSID_S) & TSPEC_TSID_MASK); |
| 2037 LOCK_WMI(wmip); |
| 2038 wmip->wmi_streamExistsForAC[reply->ac] &= ~(1<<tsid); |
| 2039 activeTsids = wmip->wmi_streamExistsForAC[reply->ac]; |
| 2040 UNLOCK_WMI(wmip); |
| 2041 |
| 2042 |
| 2043 /* Indicate stream inactivity to driver layer only if all tsids |
| 2044 * within this AC are deleted. |
| 2045 */ |
| 2046 if (!activeTsids) { |
| 2047 A_WMI_STREAM_TX_INACTIVE(wmip->wmi_devt, reply->ac); |
| 2048 wmip->wmi_fatPipeExists &= ~(1 << reply->ac); |
| 2049 } |
| 2050 } |
| 1998 | 2051 |
| 1999 A_WMI_CAC_EVENT(wmip->wmi_devt, reply->ac, | 2052 A_WMI_CAC_EVENT(wmip->wmi_devt, reply->ac, |
| 2000 reply->cac_indication, reply->statusCode, | 2053 reply->cac_indication, reply->statusCode, |
| 2001 reply->tspecSuggestion); | 2054 reply->tspecSuggestion); |
| 2002 | 2055 |
| 2003 return A_OK; | 2056 return A_OK; |
| 2004 } | 2057 } |
| 2005 | 2058 |
| 2006 static A_STATUS | 2059 static A_STATUS |
| 2007 wmi_channel_change_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) | 2060 wmi_channel_change_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len) |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2365 A_STATUS | 2418 A_STATUS |
| 2366 wmi_connect_cmd(struct wmi_t *wmip, NETWORK_TYPE netType, | 2419 wmi_connect_cmd(struct wmi_t *wmip, NETWORK_TYPE netType, |
| 2367 DOT11_AUTH_MODE dot11AuthMode, AUTH_MODE authMode, | 2420 DOT11_AUTH_MODE dot11AuthMode, AUTH_MODE authMode, |
| 2368 CRYPTO_TYPE pairwiseCrypto, A_UINT8 pairwiseCryptoLen, | 2421 CRYPTO_TYPE pairwiseCrypto, A_UINT8 pairwiseCryptoLen, |
| 2369 CRYPTO_TYPE groupCrypto, A_UINT8 groupCryptoLen, | 2422 CRYPTO_TYPE groupCrypto, A_UINT8 groupCryptoLen, |
| 2370 int ssidLength, A_UCHAR *ssid, | 2423 int ssidLength, A_UCHAR *ssid, |
| 2371 A_UINT8 *bssid, A_UINT16 channel, A_UINT32 ctrl_flags) | 2424 A_UINT8 *bssid, A_UINT16 channel, A_UINT32 ctrl_flags) |
| 2372 { | 2425 { |
| 2373 void *osbuf; | 2426 void *osbuf; |
| 2374 WMI_CONNECT_CMD *cc; | 2427 WMI_CONNECT_CMD *cc; |
| 2428 wmip->wmi_traffic_class = 100; |
| 2375 | 2429 |
| 2376 if ((pairwiseCrypto == NONE_CRYPT) && (groupCrypto != NONE_CRYPT)) { | 2430 if ((pairwiseCrypto == NONE_CRYPT) && (groupCrypto != NONE_CRYPT)) { |
| 2377 return A_EINVAL; | 2431 return A_EINVAL; |
| 2378 } | 2432 } |
| 2379 if ((pairwiseCrypto != NONE_CRYPT) && (groupCrypto == NONE_CRYPT)) { | 2433 if ((pairwiseCrypto != NONE_CRYPT) && (groupCrypto == NONE_CRYPT)) { |
| 2380 return A_EINVAL; | 2434 return A_EINVAL; |
| 2381 } | 2435 } |
| 2382 | 2436 |
| 2383 osbuf = A_NETBUF_ALLOC(sizeof(WMI_CONNECT_CMD)); | 2437 osbuf = A_NETBUF_ALLOC(sizeof(WMI_CONNECT_CMD)); |
| 2384 if (osbuf == NULL) { | 2438 if (osbuf == NULL) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2402 cc->pairwiseCryptoType = pairwiseCrypto; | 2456 cc->pairwiseCryptoType = pairwiseCrypto; |
| 2403 cc->pairwiseCryptoLen = pairwiseCryptoLen; | 2457 cc->pairwiseCryptoLen = pairwiseCryptoLen; |
| 2404 cc->groupCryptoType = groupCrypto; | 2458 cc->groupCryptoType = groupCrypto; |
| 2405 cc->groupCryptoLen = groupCryptoLen; | 2459 cc->groupCryptoLen = groupCryptoLen; |
| 2406 cc->channel = channel; | 2460 cc->channel = channel; |
| 2407 cc->ctrl_flags = ctrl_flags; | 2461 cc->ctrl_flags = ctrl_flags; |
| 2408 | 2462 |
| 2409 if (bssid != NULL) { | 2463 if (bssid != NULL) { |
| 2410 A_MEMCPY(cc->bssid, bssid, ATH_MAC_LEN); | 2464 A_MEMCPY(cc->bssid, bssid, ATH_MAC_LEN); |
| 2411 } | 2465 } |
| 2412 | 2466 |
| 2413 wmip->wmi_pair_crypto_type = pairwiseCrypto; | 2467 wmip->wmi_pair_crypto_type = pairwiseCrypto; |
| 2414 wmip->wmi_grp_crypto_type = groupCrypto; | 2468 wmip->wmi_grp_crypto_type = groupCrypto; |
| 2415 | 2469 |
| 2416 return (wmi_cmd_send(wmip, osbuf, WMI_CONNECT_CMDID, NO_SYNC_WMIFLAG)); | 2470 return (wmi_cmd_send(wmip, osbuf, WMI_CONNECT_CMDID, NO_SYNC_WMIFLAG)); |
| 2417 } | 2471 } |
| 2418 | 2472 |
| 2419 A_STATUS | 2473 A_STATUS |
| 2420 wmi_reconnect_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT16 channel) | 2474 wmi_reconnect_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT16 channel) |
| 2421 { | 2475 { |
| 2422 void *osbuf; | 2476 void *osbuf; |
| 2423 WMI_RECONNECT_CMD *cc; | 2477 WMI_RECONNECT_CMD *cc; |
| 2478 wmip->wmi_traffic_class = 100; |
| 2424 | 2479 |
| 2425 osbuf = A_NETBUF_ALLOC(sizeof(WMI_RECONNECT_CMD)); | 2480 osbuf = A_NETBUF_ALLOC(sizeof(WMI_RECONNECT_CMD)); |
| 2426 if (osbuf == NULL) { | 2481 if (osbuf == NULL) { |
| 2427 return A_NO_MEMORY; | 2482 return A_NO_MEMORY; |
| 2428 } | 2483 } |
| 2429 | 2484 |
| 2430 A_NETBUF_PUT(osbuf, sizeof(WMI_RECONNECT_CMD)); | 2485 A_NETBUF_PUT(osbuf, sizeof(WMI_RECONNECT_CMD)); |
| 2431 | 2486 |
| 2432 cc = (WMI_RECONNECT_CMD *)(A_NETBUF_DATA(osbuf)); | 2487 cc = (WMI_RECONNECT_CMD *)(A_NETBUF_DATA(osbuf)); |
| 2433 A_MEMZERO(cc, sizeof(*cc)); | 2488 A_MEMZERO(cc, sizeof(*cc)); |
| 2434 | 2489 |
| 2435 cc->channel = channel; | 2490 cc->channel = channel; |
| 2436 | 2491 |
| 2437 if (bssid != NULL) { | 2492 if (bssid != NULL) { |
| 2438 A_MEMCPY(cc->bssid, bssid, ATH_MAC_LEN); | 2493 A_MEMCPY(cc->bssid, bssid, ATH_MAC_LEN); |
| 2439 } | 2494 } |
| 2440 | 2495 |
| 2441 return (wmi_cmd_send(wmip, osbuf, WMI_RECONNECT_CMDID, NO_SYNC_WMIFLAG)); | 2496 return (wmi_cmd_send(wmip, osbuf, WMI_RECONNECT_CMDID, NO_SYNC_WMIFLAG)); |
| 2442 } | 2497 } |
| 2443 | 2498 |
| 2444 A_STATUS | 2499 A_STATUS |
| 2445 wmi_disconnect_cmd(struct wmi_t *wmip) | 2500 wmi_disconnect_cmd(struct wmi_t *wmip) |
| 2446 { | 2501 { |
| 2447 A_STATUS status; | 2502 A_STATUS status; |
| 2503 wmip->wmi_traffic_class = 100; |
| 2448 | 2504 |
| 2449 /* Bug fix for 24817(elevator bug) - the disconnect command does not | 2505 /* Bug fix for 24817(elevator bug) - the disconnect command does not |
| 2450 need to do a SYNC before.*/ | 2506 need to do a SYNC before.*/ |
| 2451 status = wmi_simple_cmd(wmip, WMI_DISCONNECT_CMDID); | 2507 status = wmi_simple_cmd(wmip, WMI_DISCONNECT_CMDID); |
| 2452 | 2508 |
| 2453 return status; | 2509 return status; |
| 2454 } | 2510 } |
| 2455 | 2511 |
| 2456 A_STATUS | 2512 A_STATUS |
| 2457 wmi_startscan_cmd(struct wmi_t *wmip, WMI_SCAN_TYPE scanType, | 2513 wmi_startscan_cmd(struct wmi_t *wmip, WMI_SCAN_TYPE scanType, |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3336 | 3392 |
| 3337 /* | 3393 /* |
| 3338 * used to set the bit rate. rate is in Kbps. If rate == -1 | 3394 * used to set the bit rate. rate is in Kbps. If rate == -1 |
| 3339 * then auto selection is used. | 3395 * then auto selection is used. |
| 3340 */ | 3396 */ |
| 3341 A_STATUS | 3397 A_STATUS |
| 3342 wmi_set_bitrate_cmd(struct wmi_t *wmip, A_INT32 dataRate, A_INT32 mgmtRate, A_IN
T32 ctlRate) | 3398 wmi_set_bitrate_cmd(struct wmi_t *wmip, A_INT32 dataRate, A_INT32 mgmtRate, A_IN
T32 ctlRate) |
| 3343 { | 3399 { |
| 3344 void *osbuf; | 3400 void *osbuf; |
| 3345 WMI_BIT_RATE_CMD *cmd; | 3401 WMI_BIT_RATE_CMD *cmd; |
| 3346 A_INT8 drix, mrix, crix; | 3402 A_INT8 drix, mrix, crix, ret_val; |
| 3347 | 3403 |
| 3348 if (dataRate != -1) { | 3404 if (dataRate != -1) { |
| 3349 drix = wmi_validate_bitrate(wmip, dataRate); | 3405 ret_val = wmi_validate_bitrate(wmip, dataRate, &drix); |
| 3350 if(drix == A_EINVAL){ | 3406 if(ret_val == A_EINVAL){ |
| 3351 return A_EINVAL; | 3407 return A_EINVAL; |
| 3352 } | 3408 } |
| 3353 } else { | 3409 } else { |
| 3354 drix = -1; | 3410 drix = -1; |
| 3355 } | 3411 } |
| 3356 | 3412 |
| 3357 if (mgmtRate != -1) { | 3413 if (mgmtRate != -1) { |
| 3358 mrix = wmi_validate_bitrate(wmip, mgmtRate); | 3414 ret_val = wmi_validate_bitrate(wmip, mgmtRate, &mrix); |
| 3359 if(mrix == A_EINVAL){ | 3415 if(ret_val == A_EINVAL){ |
| 3360 return A_EINVAL; | 3416 return A_EINVAL; |
| 3361 } | 3417 } |
| 3362 } else { | 3418 } else { |
| 3363 mrix = -1; | 3419 mrix = -1; |
| 3364 } | 3420 } |
| 3365 if (ctlRate != -1) { | 3421 if (ctlRate != -1) { |
| 3366 crix = wmi_validate_bitrate(wmip, ctlRate); | 3422 ret_val = wmi_validate_bitrate(wmip, ctlRate, &crix); |
| 3367 if(crix == A_EINVAL){ | 3423 if(ret_val == A_EINVAL){ |
| 3368 return A_EINVAL; | 3424 return A_EINVAL; |
| 3369 } | 3425 } |
| 3370 } else { | 3426 } else { |
| 3371 crix = -1; | 3427 crix = -1; |
| 3372 } | 3428 } |
| 3373 osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); | 3429 osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); |
| 3374 if (osbuf == NULL) { | 3430 if (osbuf == NULL) { |
| 3375 return A_NO_MEMORY; | 3431 return A_NO_MEMORY; |
| 3376 } | 3432 } |
| 3377 | 3433 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3427 isValid = FALSE; | 3483 isValid = FALSE; |
| 3428 } | 3484 } |
| 3429 } else { | 3485 } else { |
| 3430 if ((rateIndex < MODE_GONLY_SUPPORT_RATE_START) || (rateIndex >
MODE_GONLY_SUPPORT_RATE_STOP)) { | 3486 if ((rateIndex < MODE_GONLY_SUPPORT_RATE_START) || (rateIndex >
MODE_GONLY_SUPPORT_RATE_STOP)) { |
| 3431 isValid = FALSE; | 3487 isValid = FALSE; |
| 3432 } | 3488 } |
| 3433 } | 3489 } |
| 3434 break; | 3490 break; |
| 3435 | 3491 |
| 3436 case WMI_11G_MODE: | 3492 case WMI_11G_MODE: |
| 3437 case WMI_11AG_MODE: | 3493 case WMI_11AG_MODE: |
| 3438 if (wmip->wmi_ht_allowed[A_BAND_24GHZ]){ | 3494 if (wmip->wmi_ht_allowed[A_BAND_24GHZ]){ |
| 3439 if ((rateIndex < MODE_G_SUPPORT_RATE_START) || (rateIndex > MODE
_GHT20_SUPPORT_RATE_STOP)) { | 3495 if ((rateIndex < MODE_G_SUPPORT_RATE_START) || (rateIndex > MODE
_GHT20_SUPPORT_RATE_STOP)) { |
| 3440 isValid = FALSE; | 3496 isValid = FALSE; |
| 3441 } | 3497 } |
| 3442 } else { | 3498 } else { |
| 3443 if ((rateIndex < MODE_G_SUPPORT_RATE_START) || (rateIndex > MODE
_G_SUPPORT_RATE_STOP)) { | 3499 if ((rateIndex < MODE_G_SUPPORT_RATE_START) || (rateIndex > MODE
_G_SUPPORT_RATE_STOP)) { |
| 3444 isValid = FALSE; | 3500 isValid = FALSE; |
| 3445 } | 3501 } |
| 3446 } | 3502 } |
| 3447 break; | 3503 break; |
| 3448 default: | 3504 default: |
| 3449 A_ASSERT(FALSE); | 3505 A_ASSERT(FALSE); |
| 3450 break; | 3506 break; |
| 3451 } | 3507 } |
| 3452 | 3508 |
| 3453 return isValid; | 3509 return isValid; |
| 3454 } | 3510 } |
| 3455 | 3511 |
| 3456 A_INT8 | 3512 A_INT8 |
| 3457 wmi_validate_bitrate(struct wmi_t *wmip, A_INT32 rate) | 3513 wmi_validate_bitrate(struct wmi_t *wmip, A_INT32 rate, A_INT8 *rate_idx) |
| 3458 { | 3514 { |
| 3459 A_INT8 i; | 3515 A_INT8 i; |
| 3460 if (rate != -1) | 3516 |
| 3517 for (i=0;;i++) |
| 3461 { | 3518 { |
| 3462 for (i=0;;i++) | 3519 if (wmi_rateTable[(A_UINT32) i][0] == 0) { |
| 3463 { | 3520 return A_EINVAL; |
| 3464 if (wmi_rateTable[(A_UINT32) i][0] == 0) { | |
| 3465 return A_EINVAL; | |
| 3466 } | |
| 3467 if (wmi_rateTable[(A_UINT32) i][0] == rate) { | |
| 3468 break; | |
| 3469 } | |
| 3470 } | 3521 } |
| 3471 } | 3522 if (wmi_rateTable[(A_UINT32) i][0] == rate) { |
| 3472 else{ | 3523 break; |
| 3473 i = -1; | 3524 } |
| 3474 } | 3525 } |
| 3475 | 3526 |
| 3476 if(wmi_is_bitrate_index_valid(wmip, (A_INT32) i) != TRUE) { | 3527 if(wmi_is_bitrate_index_valid(wmip, (A_INT32) i) != TRUE) { |
| 3477 return A_EINVAL; | 3528 return A_EINVAL; |
| 3478 } | 3529 } |
| 3479 | 3530 |
| 3480 return i; | 3531 *rate_idx = i; |
| 3532 return A_OK; |
| 3481 } | 3533 } |
| 3482 | 3534 |
| 3483 A_STATUS | 3535 A_STATUS |
| 3484 wmi_set_fixrates_cmd(struct wmi_t *wmip, A_UINT32 fixRatesMask) | 3536 wmi_set_fixrates_cmd(struct wmi_t *wmip, A_UINT32 fixRatesMask) |
| 3485 { | 3537 { |
| 3486 void *osbuf; | 3538 void *osbuf; |
| 3487 WMI_FIX_RATES_CMD *cmd; | 3539 WMI_FIX_RATES_CMD *cmd; |
| 3488 #if 0 | 3540 #if 0 |
| 3489 A_INT32 rateIndex; | 3541 A_INT32 rateIndex; |
| 3490 /* This check does not work for AR6003 as the HT modes are enabled only when | 3542 /* This check does not work for AR6003 as the HT modes are enabled only when |
| (...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5332 wmi_find_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, | 5384 wmi_find_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, |
| 5333 A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID) | 5385 A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID) |
| 5334 { | 5386 { |
| 5335 bss_t *node = NULL; | 5387 bss_t *node = NULL; |
| 5336 node = wlan_find_Ssidnode (&wmip->wmi_scan_table, pSsid, | 5388 node = wlan_find_Ssidnode (&wmip->wmi_scan_table, pSsid, |
| 5337 ssidLength, bIsWPA2, bMatchSSID); | 5389 ssidLength, bIsWPA2, bMatchSSID); |
| 5338 return node; | 5390 return node; |
| 5339 } | 5391 } |
| 5340 | 5392 |
| 5341 | 5393 |
| 5394 #ifdef THREAD_X |
| 5395 void |
| 5396 wmi_refresh_scan_table (struct wmi_t *wmip) |
| 5397 { |
| 5398 wlan_refresh_inactive_nodes (&wmip->wmi_scan_table); |
| 5399 } |
| 5400 #endif |
| 5401 |
| 5342 void | 5402 void |
| 5343 wmi_free_allnodes(struct wmi_t *wmip) | 5403 wmi_free_allnodes(struct wmi_t *wmip) |
| 5344 { | 5404 { |
| 5345 wlan_free_allnodes(&wmip->wmi_scan_table); | 5405 wlan_free_allnodes(&wmip->wmi_scan_table); |
| 5346 } | 5406 } |
| 5347 | 5407 |
| 5348 bss_t * | 5408 bss_t * |
| 5349 wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr) | 5409 wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr) |
| 5350 { | 5410 { |
| 5351 bss_t *ni=NULL; | 5411 bss_t *ni=NULL; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 5372 A_UINT32 access_cookie, | 5432 A_UINT32 access_cookie, |
| 5373 A_UINT32 dset_size, | 5433 A_UINT32 dset_size, |
| 5374 A_UINT32 dset_version, | 5434 A_UINT32 dset_version, |
| 5375 A_UINT32 targ_handle, | 5435 A_UINT32 targ_handle, |
| 5376 A_UINT32 targ_reply_fn, | 5436 A_UINT32 targ_reply_fn, |
| 5377 A_UINT32 targ_reply_arg) | 5437 A_UINT32 targ_reply_arg) |
| 5378 { | 5438 { |
| 5379 void *osbuf; | 5439 void *osbuf; |
| 5380 WMIX_DSETOPEN_REPLY_CMD *open_reply; | 5440 WMIX_DSETOPEN_REPLY_CMD *open_reply; |
| 5381 | 5441 |
| 5382 A_DPRINTF(DBG_WMI, (DBGFMT "Enter - wmip=0x%x\n", DBGARG, (int)wmip)); | 5442 A_DPRINTF(DBG_WMI, (DBGFMT "Enter - wmip=0x%lx\n", DBGARG, (unsigned long)wm
ip)); |
| 5383 | 5443 |
| 5384 osbuf = A_NETBUF_ALLOC(sizeof(*open_reply)); | 5444 osbuf = A_NETBUF_ALLOC(sizeof(*open_reply)); |
| 5385 if (osbuf == NULL) { | 5445 if (osbuf == NULL) { |
| 5386 return A_NO_MEMORY; | 5446 return A_NO_MEMORY; |
| 5387 } | 5447 } |
| 5388 | 5448 |
| 5389 A_NETBUF_PUT(osbuf, sizeof(*open_reply)); | 5449 A_NETBUF_PUT(osbuf, sizeof(*open_reply)); |
| 5390 open_reply = (WMIX_DSETOPEN_REPLY_CMD *)(A_NETBUF_DATA(osbuf)); | 5450 open_reply = (WMIX_DSETOPEN_REPLY_CMD *)(A_NETBUF_DATA(osbuf)); |
| 5391 | 5451 |
| 5392 open_reply->status = status; | 5452 open_reply->status = status; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5441 else | 5501 else |
| 5442 { | 5502 { |
| 5443 | 5503 |
| 5444 } | 5504 } |
| 5445 | 5505 |
| 5446 return A_OK; | 5506 return A_OK; |
| 5447 } | 5507 } |
| 5448 | 5508 |
| 5449 | 5509 |
| 5450 | 5510 |
| 5511 static A_STATUS |
| 5512 wmi_acm_reject_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len) |
| 5513 { |
| 5514 WMI_ACM_REJECT_EVENT *ev; |
| 5515 |
| 5516 ev = (WMI_ACM_REJECT_EVENT *)datap; |
| 5517 wmip->wmi_traffic_class = ev->trafficClass; |
| 5518 printk("ACM REJECT %d\n",wmip->wmi_traffic_class); |
| 5519 return A_OK; |
| 5520 } |
| 5521 |
| 5522 |
| 5451 #ifdef CONFIG_HOST_DSET_SUPPORT | 5523 #ifdef CONFIG_HOST_DSET_SUPPORT |
| 5452 A_STATUS | 5524 A_STATUS |
| 5453 wmi_dset_data_reply(struct wmi_t *wmip, | 5525 wmi_dset_data_reply(struct wmi_t *wmip, |
| 5454 A_UINT32 status, | 5526 A_UINT32 status, |
| 5455 A_UINT8 *user_buf, | 5527 A_UINT8 *user_buf, |
| 5456 A_UINT32 length, | 5528 A_UINT32 length, |
| 5457 A_UINT32 targ_buf, | 5529 A_UINT32 targ_buf, |
| 5458 A_UINT32 targ_reply_fn, | 5530 A_UINT32 targ_reply_fn, |
| 5459 A_UINT32 targ_reply_arg) | 5531 A_UINT32 targ_reply_arg) |
| 5460 { | 5532 { |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6323 } | 6395 } |
| 6324 | 6396 |
| 6325 A_NETBUF_PUT(osbuf, sizeof(*htCap)); | 6397 A_NETBUF_PUT(osbuf, sizeof(*htCap)); |
| 6326 | 6398 |
| 6327 band = (cmd->band)? A_BAND_5GHZ : A_BAND_24GHZ; | 6399 band = (cmd->band)? A_BAND_5GHZ : A_BAND_24GHZ; |
| 6328 wmip->wmi_ht_allowed[band] = (cmd->enable)? 1:0; | 6400 wmip->wmi_ht_allowed[band] = (cmd->enable)? 1:0; |
| 6329 | 6401 |
| 6330 htCap = (WMI_SET_HT_CAP_CMD *)(A_NETBUF_DATA(osbuf)); | 6402 htCap = (WMI_SET_HT_CAP_CMD *)(A_NETBUF_DATA(osbuf)); |
| 6331 A_MEMZERO(htCap, sizeof(*htCap)); | 6403 A_MEMZERO(htCap, sizeof(*htCap)); |
| 6332 A_MEMCPY(htCap, cmd, sizeof(*htCap)); | 6404 A_MEMCPY(htCap, cmd, sizeof(*htCap)); |
| 6333 | 6405 |
| 6334 return (wmi_cmd_send(wmip, osbuf, WMI_SET_HT_CAP_CMDID, | 6406 return (wmi_cmd_send(wmip, osbuf, WMI_SET_HT_CAP_CMDID, |
| 6335 NO_SYNC_WMIFLAG)); | 6407 NO_SYNC_WMIFLAG)); |
| 6336 } | 6408 } |
| 6337 | 6409 |
| 6338 A_STATUS | 6410 A_STATUS |
| 6339 wmi_set_ht_op_cmd(struct wmi_t *wmip, A_UINT8 sta_chan_width) | 6411 wmi_set_ht_op_cmd(struct wmi_t *wmip, A_UINT8 sta_chan_width) |
| 6340 { | 6412 { |
| 6341 void *osbuf; | 6413 void *osbuf; |
| 6342 WMI_SET_HT_OP_CMD *htInfo; | 6414 WMI_SET_HT_OP_CMD *htInfo; |
| 6343 | 6415 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6539 A_NETBUF_PUT(osbuf, sizeof(WMI_SET_PMK_CMD)); | 6611 A_NETBUF_PUT(osbuf, sizeof(WMI_SET_PMK_CMD)); |
| 6540 | 6612 |
| 6541 p = (WMI_SET_PMK_CMD *)(A_NETBUF_DATA(osbuf)); | 6613 p = (WMI_SET_PMK_CMD *)(A_NETBUF_DATA(osbuf)); |
| 6542 A_MEMZERO(p, sizeof(*p)); | 6614 A_MEMZERO(p, sizeof(*p)); |
| 6543 | 6615 |
| 6544 A_MEMCPY(p->pmk, pmk, WMI_PMK_LEN); | 6616 A_MEMCPY(p->pmk, pmk, WMI_PMK_LEN); |
| 6545 | 6617 |
| 6546 return (wmi_cmd_send(wmip, osbuf, WMI_SET_PMK_CMDID, NO_SYNC_WMIFLAG)); | 6618 return (wmi_cmd_send(wmip, osbuf, WMI_SET_PMK_CMDID, NO_SYNC_WMIFLAG)); |
| 6547 } | 6619 } |
| 6548 | 6620 |
| 6621 A_STATUS |
| 6622 wmi_SGI_cmd(struct wmi_t *wmip, A_UINT32 sgiMask, A_UINT8 sgiPERThreshold) |
| 6623 { |
| 6624 void *osbuf; |
| 6625 WMI_SET_TX_SGI_PARAM_CMD *cmd; |
| 6626 |
| 6627 osbuf = A_NETBUF_ALLOC(sizeof(*cmd)); |
| 6628 if (osbuf == NULL) { |
| 6629 return A_NO_MEMORY ; |
| 6630 } |
| 6631 |
| 6632 A_NETBUF_PUT(osbuf, sizeof(*cmd)); |
| 6633 |
| 6634 cmd = (WMI_SET_TX_SGI_PARAM_CMD *)(A_NETBUF_DATA(osbuf)); |
| 6635 A_MEMZERO(cmd, sizeof(*cmd)); |
| 6636 cmd->sgiMask = sgiMask; |
| 6637 cmd->sgiPERThreshold = sgiPERThreshold; |
| 6638 return (wmi_cmd_send(wmip, osbuf, WMI_SET_TX_SGI_PARAM_CMDID, |
| 6639 NO_SYNC_WMIFLAG)); |
| 6640 } |
| 6641 |
| 6549 bss_t * | 6642 bss_t * |
| 6550 wmi_find_matching_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, | 6643 wmi_find_matching_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, |
| 6551 A_UINT32 ssidLength, | 6644 A_UINT32 ssidLength, |
| 6552 A_UINT32 dot11AuthMode, A_UINT32 authMode, | 6645 A_UINT32 dot11AuthMode, A_UINT32 authMode, |
| 6553 A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp) | 6646 A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp) |
| 6554 { | 6647 { |
| 6555 bss_t *node = NULL; | 6648 bss_t *node = NULL; |
| 6556 node = wlan_find_matching_Ssidnode (&wmip->wmi_scan_table, pSsid, | 6649 node = wlan_find_matching_Ssidnode (&wmip->wmi_scan_table, pSsid, |
| 6557 ssidLength, dot11AuthMode, authMode, pairwiseCryp
toType, grpwiseCryptoTyp); | 6650 ssidLength, dot11AuthMode, authMode, pairwiseCryp
toType, grpwiseCryptoTyp); |
| 6558 | 6651 |
| 6559 return node; | 6652 return node; |
| 6560 } | 6653 } |
| 6561 | 6654 |
| 6562 A_UINT16 | 6655 A_UINT16 |
| 6563 wmi_ieee2freq (int chan) | 6656 wmi_ieee2freq (int chan) |
| 6564 { | 6657 { |
| 6565 A_UINT16 freq = 0; | 6658 A_UINT16 freq = 0; |
| 6566 freq = wlan_ieee2freq (chan); | 6659 freq = wlan_ieee2freq (chan); |
| 6567 return freq; | 6660 return freq; |
| 6568 | 6661 |
| 6569 } | 6662 } |
| 6570 | 6663 |
| 6571 A_UINT32 | 6664 A_UINT32 |
| 6572 wmi_freq2ieee (A_UINT16 freq) | 6665 wmi_freq2ieee (A_UINT16 freq) |
| 6573 { | 6666 { |
| 6574 A_UINT16 chan = 0; | 6667 A_UINT16 chan = 0; |
| 6575 chan = wlan_freq2ieee (freq); | 6668 chan = wlan_freq2ieee (freq); |
| 6576 return chan; | 6669 return chan; |
| 6577 } | 6670 } |
| OLD | NEW |