Lines Matching +full:assoc +full:- +full:weight
2 * Linux cfg80211 driver - Android related functions
6 * Copyright (C) 1999-2017, Broadcom Corporation
27 * <<Broadcom-WL-IPTag/Open:>>
29 * $Id: wl_android.c 814826 2019-04-15 05:25:59Z $
95 #define CMD_SCAN_ACTIVE "SCAN-ACTIVE"
96 #define CMD_SCAN_PASSIVE "SCAN-PASSIVE"
101 #define CMD_RXFILTER_START "RXFILTER-START"
102 #define CMD_RXFILTER_STOP "RXFILTER-STOP"
103 #define CMD_RXFILTER_ADD "RXFILTER-ADD"
104 #define CMD_RXFILTER_REMOVE "RXFILTER-REMOVE"
105 #define CMD_BTCOEXSCAN_START "BTCOEXSCAN-START"
106 #define CMD_BTCOEXSCAN_STOP "BTCOEXSCAN-STOP"
304 #define CUSTOMER_HW4_DISABLE -1
360 #define DEFAULT_WBTEXT_PROFILE_A_V2 "a -70 -75 70 10 -75 -128 0 10"
361 #define DEFAULT_WBTEXT_PROFILE_B_V2 "b -60 -75 70 10 -75 -128 0 10"
362 #define DEFAULT_WBTEXT_PROFILE_A_V3 "a -70 -75 70 10 -75 -128 0 10"
363 #define DEFAULT_WBTEXT_PROFILE_B_V3 "b -60 -75 70 10 -75 -128 0 10"
514 HEAD_SAR_BACKOFF_DISABLE = -1,
713 .name = "bcm-genl", /* Netlink I/F for Android */
746 { .name = "bcm-genl-mcast", },
751 .name = "bcm-genl-mcast",
872 #define DEFAULT_ROAM_TIRGGER -75
961 struct wireless_dev *wdev = dev->ieee80211_ptr; in wl_android_set_channel_width()
962 struct bcm_cfg80211 *cfg = (struct bcm_cfg80211 *)wiphy_priv(wdev->wiphy); in wl_android_set_channel_width()
996 return -EINVAL; in wl_android_hogsqs()
1014 return -EINVAL; in wl_android_hogsqs()
1023 return -EINVAL; in wl_android_hogsqs()
1062 struct wireless_dev *__wdev = (struct wireless_dev *)(dev)->ieee80211_ptr; in wl_android_set_bandsteer()
1063 struct bcm_cfg80211 *cfg = (struct bcm_cfg80211 *)wiphy_priv(__wdev->wiphy); in wl_android_set_bandsteer()
1074 return -1; in wl_android_set_bandsteer()
1078 cfg->ap_bs = 0; in wl_android_set_bandsteer()
1079 cfg->p2p_bs = 1; in wl_android_set_bandsteer()
1082 ret = dhd_bandsteer_module_init(dev, cfg->ap_bs, cfg->p2p_bs); in wl_android_set_bandsteer()
1085 cfg->ap_bs ? "ap":"p2p")); in wl_android_set_bandsteer()
1089 cfg->ap_bs ? "ap":"p2p")); in wl_android_set_bandsteer()
1092 ret = dhd_bandsteer_module_deinit(dev, cfg->ap_bs, cfg->p2p_bs); in wl_android_set_bandsteer()
1095 cfg->ap_bs ? "ap":"p2p")); in wl_android_set_bandsteer()
1099 cfg->ap_bs ? "ap":"p2p")); in wl_android_set_bandsteer()
1103 cfg->ap_bs = 1; in wl_android_set_bandsteer()
1104 cfg->p2p_bs = 0; in wl_android_set_bandsteer()
1107 ret = dhd_bandsteer_module_init(dev, cfg->ap_bs, cfg->p2p_bs); in wl_android_set_bandsteer()
1110 cfg->ap_bs ? "ap":"p2p")); in wl_android_set_bandsteer()
1114 cfg->ap_bs ? "ap":"p2p")); in wl_android_set_bandsteer()
1117 ret = dhd_bandsteer_module_deinit(dev, cfg->ap_bs, cfg->p2p_bs); in wl_android_set_bandsteer()
1120 cfg->ap_bs ? "ap":"p2p")); in wl_android_set_bandsteer()
1124 cfg->ap_bs ? "ap":"p2p")); in wl_android_set_bandsteer()
1128 cfg->ap_bs = 1; in wl_android_set_bandsteer()
1129 cfg->p2p_bs = 1; in wl_android_set_bandsteer()
1130 ret = dhd_bandsteer_module_init(dev, cfg->ap_bs, cfg->p2p_bs); in wl_android_set_bandsteer()
1138 cfg->ap_bs = 1; in wl_android_set_bandsteer()
1139 cfg->p2p_bs = 1; in wl_android_set_bandsteer()
1140 ret = dhd_bandsteer_module_deinit(dev, cfg->ap_bs, cfg->p2p_bs); in wl_android_set_bandsteer()
1149 return -1; in wl_android_set_bandsteer()
1164 smbuf = (char *)MALLOC(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_set_wfds_hash()
1168 return -ENOMEM; in wl_android_set_wfds_hash()
1187 MFREE(cfg->osh, smbuf, WLC_IOCTL_MAXLEN); in wl_android_set_wfds_hash()
1203 return -1; in wl_android_get_link_speed()
1241 return -1; in wl_android_get_rssi()
1273 return -1; in wl_android_get_rssi()
1277 return -1; in wl_android_get_rssi()
1281 return -ENOMEM; in wl_android_get_rssi()
1286 if ((total_len - bytes_written) < (strlen(" rssi -XXX") + 1)) in wl_android_get_rssi()
1287 return -ENOMEM; in wl_android_get_rssi()
1289 bytes_written += scnprintf(&command[bytes_written], total_len - bytes_written, in wl_android_get_rssi()
1304 suspend_flag = *(command + strlen(CMD_SETSUSPENDOPT) + 1) - '0'; in wl_android_set_suspendopt()
1313 DHD_INFO(("wl_android_set_suspendopt: Suspend Flag %d -> %d\n", in wl_android_set_suspendopt()
1330 suspend_flag = *(command + strlen(CMD_SETSUSPENDMODE) + 1) - '0'; in wl_android_set_suspendmode()
1352 return -1; in wl_android_get_80211_mode()
1380 return -1; in wl_android_get_chanspec()
1405 channel -= CH_10MHZ_APART; in wl_android_get_chanspec()
1411 channel -= (CH_10MHZ_APART + CH_20MHZ_APART); in wl_android_get_chanspec()
1413 channel -= CH_10MHZ_APART; in wl_android_get_chanspec()
1455 return -1; in wl_android_get_datarate()
1475 assoc_maclist->count = htod32(MAX_NUM_OF_ASSOCLIST); in wl_android_get_assoclist()
1479 return -1; in wl_android_get_assoclist()
1481 assoc_maclist->count = dtoh32(assoc_maclist->count); in wl_android_get_assoclist()
1483 CMD_ASSOC_CLIENTS, assoc_maclist->count); in wl_android_get_assoclist()
1485 for (i = 0; i < assoc_maclist->count; i++) { in wl_android_get_assoclist()
1486 len = snprintf(command + bytes_written, total_len - bytes_written, " " MACDBG, in wl_android_get_assoclist()
1487 MAC2STRDBG(assoc_maclist->ea[i].octet)); in wl_android_get_assoclist()
1488 /* A return value of '(total_len - bytes_written)' or more means that the in wl_android_get_assoclist()
1491 if ((len > 0) && (len < (total_len - bytes_written))) { in wl_android_get_assoclist()
1497 bytes_written = -1; in wl_android_get_assoclist()
1517 sscanf(pos, "%s %s", cic->country_abbrev, band); in wl_android_get_channel_list()
1518 DHD_INFO(("%s:country %s and mode %s \n", __FUNCTION__, cic->country_abbrev, band)); in wl_android_get_channel_list()
1519 len = strlen(cic->country_abbrev); in wl_android_get_channel_list()
1522 return -1; in wl_android_get_channel_list()
1526 cic->band = WLC_BAND_5G; in wl_android_get_channel_list()
1528 cic->band = WLC_BAND_2G; in wl_android_get_channel_list()
1531 return -1; in wl_android_get_channel_list()
1534 cic->count = 0; in wl_android_get_channel_list()
1535 cic->buflen = WL_EXTRA_BUF_MAX; in wl_android_get_channel_list()
1540 return -1; in wl_android_get_channel_list()
1543 if (cic->count == 0) in wl_android_get_channel_list()
1544 return -1; in wl_android_get_channel_list()
1546 for (i = 0; i < (cic->count); i++) { in wl_android_get_channel_list()
1547 pos += snprintf(pos, total_len, " %d", (cic->channel[i])); in wl_android_get_channel_list()
1549 return (pos - command); in wl_android_get_channel_list()
1564 struct wireless_dev *wdev = dev->ieee80211_ptr; in wl_android_set_csa()
1565 struct bcm_cfg80211 *cfg = (struct bcm_cfg80211 *)wiphy_priv(wdev->wiphy); in wl_android_set_csa()
1571 if (!(wdev->iftype == NL80211_IFTYPE_AP || wdev->iftype == NL80211_IFTYPE_P2P_GO)) { in wl_android_set_csa()
1573 wdev->iftype)); in wl_android_set_csa()
1574 return -1; in wl_android_set_csa()
1593 return -1; in wl_android_set_csa()
1599 return -1; in wl_android_set_csa()
1604 return -1; in wl_android_set_csa()
1615 return -1; in wl_android_set_csa()
1621 strncpy(str_chan, command, (str-command)); in wl_android_set_csa()
1638 return -1; in wl_android_set_csa()
1650 return -1; in wl_android_set_csa()
1662 return -1; in wl_android_set_csa()
1666 return -1; in wl_android_set_csa()
1670 return -1; in wl_android_set_csa()
1678 return -1; in wl_android_set_csa()
1682 cfg->in_csa = TRUE; in wl_android_set_csa()
1683 mod_timer(&cfg->csa_timeout, jiffies + msecs_to_jiffies(100 * (csa_arg.count+2))); in wl_android_set_csa()
1694 dtim = *(command + strlen(CMD_SETDTIM_IN_SUSPEND) + 1) - '0'; in wl_android_set_bcn_li_dtim()
1718 dtim_flag = *(command + strlen(CMD_MAXDTIM_IN_SUSPEND) + 1) - '0'; in wl_android_set_max_dtim()
1737 dtim_flag = *(command + strlen(CMD_DISDTIM_IN_SUSPEND) + 1) - '0'; in wl_android_set_disable_dtim_in_suspend()
1759 return -1; in wl_android_get_band()
1768 uint band = *(command + strlen(CMD_SETBAND) + 1) - '0'; in wl_android_set_band()
1777 error = -1; in wl_android_set_band()
1815 * Assoc Rsp: 2 in wl_android_add_vendor_ie()
1818 * Assoc Req: 16 in wl_android_add_vendor_ie()
1839 tot_len = sizeof(vndr_ie_setbuf_t) + (datalen - 1); in wl_android_add_vendor_ie()
1843 return -ENOMEM; in wl_android_add_vendor_ie()
1849 return -ENOMEM; in wl_android_add_vendor_ie()
1852 strncpy(vndr_ie->cmd, "add", VNDR_IE_CMD_LEN - 1); in wl_android_add_vendor_ie()
1853 vndr_ie->cmd[VNDR_IE_CMD_LEN - 1] = '\0'; in wl_android_add_vendor_ie()
1855 /* Set the IE count - the buffer contains only 1 IE */ in wl_android_add_vendor_ie()
1857 memcpy((void *)&vndr_ie->vndr_ie_buffer.iecount, &iecount, sizeof(s32)); in wl_android_add_vendor_ie()
1861 memcpy((void *)&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].pktflag, &pktflag, in wl_android_add_vendor_ie()
1865 vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.id = (uchar) DOT11_MNG_PROPR_ID; in wl_android_add_vendor_ie()
1868 memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.oui, &ie_buf, in wl_android_add_vendor_ie()
1871 memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.data, in wl_android_add_vendor_ie()
1875 vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.len = (uchar) ielen; in wl_android_add_vendor_ie()
1883 return -ENOMEM; in wl_android_add_vendor_ie()
1890 err = -EINVAL; in wl_android_add_vendor_ie()
1926 * Assoc Rsp: 4 in wl_android_del_vendor_ie()
1929 * Assoc Req: 32 in wl_android_del_vendor_ie()
1951 tot_len = sizeof(vndr_ie_setbuf_t) + (datalen - 1); in wl_android_del_vendor_ie()
1954 return -ENOMEM; in wl_android_del_vendor_ie()
1959 return -ENOMEM; in wl_android_del_vendor_ie()
1962 strncpy(vndr_ie->cmd, "del", VNDR_IE_CMD_LEN - 1); in wl_android_del_vendor_ie()
1963 vndr_ie->cmd[VNDR_IE_CMD_LEN - 1] = '\0'; in wl_android_del_vendor_ie()
1965 /* Set the IE count - the buffer contains only 1 IE */ in wl_android_del_vendor_ie()
1967 memcpy((void *)&vndr_ie->vndr_ie_buffer.iecount, &iecount, sizeof(s32)); in wl_android_del_vendor_ie()
1970 pktflag = htod32(1<<(pktflag-1)); in wl_android_del_vendor_ie()
1971 memcpy((void *)&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].pktflag, &pktflag, in wl_android_del_vendor_ie()
1975 vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.id = (uchar) DOT11_MNG_PROPR_ID; in wl_android_del_vendor_ie()
1978 memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.oui, &ie_buf, in wl_android_del_vendor_ie()
1982 memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.data, in wl_android_del_vendor_ie()
1986 vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.len = (uchar) ielen; in wl_android_del_vendor_ie()
1994 return -ENOMEM; in wl_android_del_vendor_ie()
2001 err = -EINVAL; in wl_android_del_vendor_ie()
2019 return dhdp->wbtext_support; in wl_android_check_wbtext()
2085 return -EINVAL; in wl_android_get_roam_trigger()
2157 return -1; in wl_android_get_roam_delta()
2184 return -1; in wl_android_get_roam_scan_period()
2223 return -1; in wl_android_get_full_roam_scan_period()
2298 return -1; in wl_android_get_country_rev()
2324 return -1; in wl_android_get_roam_scan_control()
2339 return -1; in wl_android_set_roam_scan_control()
2347 return -1; in wl_android_set_roam_scan_control()
2364 buf_avail = total_len - bytes_written; in wl_android_get_roam_scan_channels()
2372 bytes_written = -1; in wl_android_get_roam_scan_channels()
2376 buf_avail -= len; in wl_android_get_roam_scan_channels()
2393 return -1; in wl_android_set_roam_scan_channels()
2410 return -1; in wl_android_get_scan_channel_time()
2425 return -1; in wl_android_set_scan_channel_time()
2435 return -1; in wl_android_set_scan_channel_time()
2453 return -1; in wl_android_get_scan_unassoc_time()
2469 return -1; in wl_android_set_scan_unassoc_time()
2479 return -1; in wl_android_set_scan_unassoc_time()
2497 return -1; in wl_android_get_scan_passive_time()
2513 return -1; in wl_android_set_scan_passive_time()
2523 return -1; in wl_android_set_scan_passive_time()
2538 return -1; in wl_android_get_scan_home_time()
2553 return -1; in wl_android_set_scan_home_time()
2563 return -1; in wl_android_set_scan_home_time()
2580 return -1; in wl_android_get_scan_home_away_time()
2595 return -1; in wl_android_set_scan_home_away_time()
2605 return -1; in wl_android_set_scan_home_away_time()
2621 return -1; in wl_android_get_scan_nprobes()
2636 return -1; in wl_android_set_scan_nprobes()
2644 return -1; in wl_android_set_scan_nprobes()
2661 return -1; in wl_android_get_scan_dfs_channel_mode()
2683 return -1; in wl_android_set_scan_dfs_channel_mode()
2694 return -1; in wl_android_set_scan_dfs_channel_mode()
2701 return -1; in wl_android_set_scan_dfs_channel_mode()
2769 int error = -1; in wl_android_send_action_frame()
2786 if ((uint16)params->len > ANDROID_WIFI_ACTION_FRAME_SIZE) { in wl_android_send_action_frame()
2789 params->len)); in wl_android_send_action_frame()
2793 smbuf = (char *)MALLOC(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_send_action_frame()
2800 af_params = (wl_af_params_t *)MALLOCZ(cfg->osh, WL_WIFI_AF_PARAMS_SIZE); in wl_android_send_action_frame()
2807 if (bcm_ether_atoe((const char *)params->bssid, (struct ether_addr *)&tmp_bssid) == 0) { in wl_android_send_action_frame()
2819 if (params->channel < 0) { in wl_android_send_action_frame()
2832 tmp_channel = params->channel; in wl_android_send_action_frame()
2835 af_params->channel = tmp_channel; in wl_android_send_action_frame()
2836 af_params->dwell_time = params->dwell_time; in wl_android_send_action_frame()
2837 memcpy(&af_params->BSSID, &tmp_bssid, ETHER_ADDR_LEN); in wl_android_send_action_frame()
2838 action_frame = &af_params->action_frame; in wl_android_send_action_frame()
2840 action_frame->packetId = 0; in wl_android_send_action_frame()
2841 memcpy(&action_frame->da, &tmp_bssid, ETHER_ADDR_LEN); in wl_android_send_action_frame()
2842 action_frame->len = (uint16)params->len; in wl_android_send_action_frame()
2843 memcpy(action_frame->data, params->data, action_frame->len); in wl_android_send_action_frame()
2854 MFREE(cfg->osh, af_params, WL_WIFI_AF_PARAMS_SIZE); in wl_android_send_action_frame()
2858 MFREE(cfg->osh, smbuf, WLC_IOCTL_MAXLEN); in wl_android_send_action_frame()
2862 return -1; in wl_android_send_action_frame()
2879 return -1; in wl_android_reassoc()
2885 if (bcm_ether_atoe((const char *)params->bssid, in wl_android_reassoc()
2888 return -1; in wl_android_reassoc()
2891 if (params->channel < 0) { in wl_android_reassoc()
2893 return -1; in wl_android_reassoc()
2898 channel = params->channel; in wl_android_reassoc()
2920 return -1; in wl_android_reassoc()
2947 return -1; in wl_android_set_wes_mode()
2954 return -1; in wl_android_set_wes_mode()
2985 return -1; in wl_android_get_okc_mode()
3000 return -1; in wl_android_set_okc_mode()
3007 return -1; in wl_android_set_okc_mode()
3025 return -1; in wl_android_set_pmk()
3031 return -1; in wl_android_set_pmk()
3035 DHD_STATLOG_CTRL(dhdp, ST(INSTALL_OKC_PMK), dhd_net2idx(dhdp->info, dev), 0); in wl_android_set_pmk()
3057 okc_enable = command[strlen(CMD_OKC_ENABLE) + 1] - '0'; in wl_android_okc_enable()
3087 error = -1; in wl_android_restore_scan_params()
3099 error = -1; in wl_android_restore_scan_params()
3131 dhdp->sroam_turn_on = sroam_mode; in wl_android_sroam_turn_on()
3159 psroam = (wlc_sroam_t *)MALLOCZ(dhdp->osh, sroamlen); in wl_android_sroam_set_info()
3166 psroam->ver = WLC_SILENT_ROAM_CUR_VER; in wl_android_sroam_set_info()
3167 psroam->len = sizeof(*sroam); in wl_android_sroam_set_info()
3168 sroam = (wlc_sroam_info_t *)psroam->data; in wl_android_sroam_set_info()
3170 sroam->sroam_on = FALSE; in wl_android_sroam_set_info()
3172 sroam->sroam_min_rssi = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3173 WL_DBG(("1.Minimum RSSI %d\n", sroam->sroam_min_rssi)); in wl_android_sroam_set_info()
3177 sroam->sroam_rssi_range = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3178 WL_DBG(("2.RSSI Range %d\n", sroam->sroam_rssi_range)); in wl_android_sroam_set_info()
3182 sroam->sroam_score_delta = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3183 WL_DBG(("3.Score Delta %d\n", sroam->sroam_score_delta)); in wl_android_sroam_set_info()
3187 sroam->sroam_period_time = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3188 WL_DBG(("4.Sroam period %d\n", sroam->sroam_period_time)); in wl_android_sroam_set_info()
3192 sroam->sroam_band = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3193 WL_DBG(("5.Sroam Band %d\n", sroam->sroam_band)); in wl_android_sroam_set_info()
3197 sroam->sroam_inact_cnt = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3198 WL_DBG(("6.Inactivity Count %d\n", sroam->sroam_inact_cnt)); in wl_android_sroam_set_info()
3215 MFREE(dhdp->osh, psroam, sroamlen); in wl_android_sroam_set_info()
3231 psroam = (wlc_sroam_t *)MALLOCZ(dhdp->osh, sroamlen); in wl_android_sroam_get_info()
3244 if (psroam->ver != WLC_SILENT_ROAM_CUR_VER) { in wl_android_sroam_get_info()
3247 psroam->ver, WLC_SILENT_ROAM_CUR_VER, ret)); in wl_android_sroam_get_info()
3251 sroam = (wlc_sroam_info_t *)psroam->data; in wl_android_sroam_get_info()
3254 CMD_SROAM_GET_INFO, sroam->sroam_on, sroam->sroam_min_rssi, sroam->sroam_rssi_range, in wl_android_sroam_get_info()
3255 sroam->sroam_score_delta, sroam->sroam_period_time, sroam->sroam_band, in wl_android_sroam_get_info()
3256 sroam->sroam_inact_cnt); in wl_android_sroam_get_info()
3262 MFREE(dhdp->osh, psroam, sroamlen); in wl_android_sroam_get_info()
3293 if (val == (uchar)-1) { in get_int_bytes()
3347 if ((bssidx = wl_get_bssidx_by_wdev(cfg, dev->ieee80211_ptr)) < 0) { in wl_android_set_disconnect_ies()
3349 ret = -EINVAL; in wl_android_set_disconnect_ies()
3420 int bytes_written = -1, ret = 0; in wl_cfg80211_get_sta_info()
3442 iovar_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MAXLEN); in wl_cfg80211_get_sta_info()
3477 if (dtoh16(sta->ver) != WL_STA_VER_4) { in wl_cfg80211_get_sta_info()
3480 dtoh16(sta->ver))); in wl_cfg80211_get_sta_info()
3483 cap = dtoh16(sta->cap); in wl_cfg80211_get_sta_info()
3484 rxrtry = dtoh32(sta->rx_pkts_retried); in wl_cfg80211_get_sta_info()
3485 rxmulti = dtoh32(sta->rx_mcast_pkts); in wl_cfg80211_get_sta_info()
3491 WL_ERR(("counters error (%d) - size = %zu\n", in wl_cfg80211_get_sta_info()
3505 rxrtry = dtoh32(wlc_cnt->rxrtry); in wl_cfg80211_get_sta_info()
3506 rxmulti = dtoh32(wlc_cnt->rxmulti); in wl_cfg80211_get_sta_info()
3526 MACOUI2STR((char*)&sta_data->mac), in wl_cfg80211_get_sta_info()
3527 sta_data->channel, in wl_cfg80211_get_sta_info()
3528 wf_chspec_to_bw_str(sta_data->chanspec), in wl_cfg80211_get_sta_info()
3529 sta_data->rssi, sta_data->rate, in wl_cfg80211_get_sta_info()
3530 sta_data->mode_80211, sta_data->nss, sta_data->mimo, in wl_cfg80211_get_sta_info()
3531 sta_data->reason_code); in wl_cfg80211_get_sta_info()
3545 MFREE(cfg->osh, iovar_buf, WLC_IOCTL_MAXLEN); in wl_cfg80211_get_sta_info()
3588 dhdp->wbtext_support = TRUE; in wl_android_wbtext()
3599 dhdp->wbtext_support = FALSE; in wl_android_wbtext()
3709 len_remain -= strlen(CMD_WLS_BATCHING) + 1; in wls_parse_batching_cmd()
3780 batch_params.chan_list[i-1])); in wls_parse_batching_cmd()
3826 int res = -1; in wl_android_set_pno_setup()
3866 tlv_size_left = total_len - strlen(CMD_PNOSETUP_SET); in wl_android_set_pno_setup()
3871 if ((cmd_tlv_temp->prefix == PNO_TLV_PREFIX) && in wl_android_set_pno_setup()
3872 (cmd_tlv_temp->version == PNO_TLV_VERSION) && in wl_android_set_pno_setup()
3873 (cmd_tlv_temp->subtype == PNO_TLV_SUBTYPE_LEGACY_PNO)) { in wl_android_set_pno_setup()
3876 tlv_size_left -= sizeof(cmd_tlv_t); in wl_android_set_pno_setup()
3936 return -1; in wl_android_get_p2p_dev_addr()
3942 return -1; in wl_android_get_p2p_dev_addr()
3964 sizeof(int) + sizeof(struct ether_addr) * maclist->count)) != 0) { in wl_android_set_ap_mac_list()
3969 assoc_maclist->count = MAX_NUM_OF_ASSOCLIST; in wl_android_set_ap_mac_list()
3977 if (assoc_maclist->count) { in wl_android_set_ap_mac_list()
3979 for (i = 0; i < assoc_maclist->count; i++) { in wl_android_set_ap_mac_list()
3982 for (j = 0; j < maclist->count; j++) { in wl_android_set_ap_mac_list()
3985 MAC2STRDBG(assoc_maclist->ea[i].octet), in wl_android_set_ap_mac_list()
3986 MAC2STRDBG(maclist->ea[j].octet))); in wl_android_set_ap_mac_list()
3987 if (memcmp(assoc_maclist->ea[i].octet, in wl_android_set_ap_mac_list()
3988 maclist->ea[j].octet, ETHER_ADDR_LEN) == 0) { in wl_android_set_ap_mac_list()
4000 memcpy(&scbval.ea, &assoc_maclist->ea[i], in wl_android_set_ap_mac_list()
4039 return -1; in wl_android_set_mac_address_filter()
4045 return -1; in wl_android_set_mac_address_filter()
4050 return -1; in wl_android_set_mac_address_filter()
4057 return -1; in wl_android_set_mac_address_filter()
4060 list = (struct maclist*) MALLOCZ(cfg->osh, sizeof(int) + in wl_android_set_mac_address_filter()
4064 return -1; in wl_android_set_mac_address_filter()
4067 list->count = htod32(macnum); in wl_android_set_mac_address_filter()
4069 for (i = 0; i < list->count; i++) { in wl_android_set_mac_address_filter()
4073 ret = -EINVAL; in wl_android_set_mac_address_filter()
4077 if (!(ret = bcm_ether_atoe(eabuf, &list->ea[i]))) { in wl_android_set_mac_address_filter()
4081 list->count = i; in wl_android_set_mac_address_filter()
4085 i, list->count, eabuf)); in wl_android_set_mac_address_filter()
4096 MFREE(cfg->osh, list, sizeof(int) + sizeof(struct ether_addr) * macnum); in wl_android_set_mac_address_filter()
4113 return -EINVAL; in wl_android_wifi_on()
4135 } while (retry-- > 0); in wl_android_wifi_on()
4151 ret = -EFAULT; in wl_android_wifi_on()
4171 return -EINVAL; in wl_android_wifi_off()
4177 DHD_ERROR(("wl_android_wifi_off: - Debug UART App is running\n")); in wl_android_wifi_off()
4178 return -EBUSY; in wl_android_wifi_off()
4199 if ((strlen(command) - strlen(CMD_SETFWPATH)) > MOD_PARAM_PATHLEN) in wl_android_set_fwpath()
4200 return -1; in wl_android_set_fwpath()
4228 list->buflen = dtoh32(list->buflen); in wl_chanim_stats()
4229 list->version = dtoh32(list->version); in wl_chanim_stats()
4230 list->count = dtoh32(list->count); in wl_chanim_stats()
4232 if (list->buflen == 0) { in wl_chanim_stats()
4233 list->version = 0; in wl_chanim_stats()
4234 list->count = 0; in wl_chanim_stats()
4235 } else if (list->version != WL_CHANIM_STATS_VERSION) { in wl_chanim_stats()
4238 list->version, WL_CHANIM_STATS_VERSION)); in wl_chanim_stats()
4239 list->buflen = 0; in wl_chanim_stats()
4240 list->count = 0; in wl_chanim_stats()
4243 stats = list->stats; in wl_chanim_stats()
4244 stats->glitchcnt = dtoh32(stats->glitchcnt); in wl_chanim_stats()
4245 stats->badplcp = dtoh32(stats->badplcp); in wl_chanim_stats()
4246 stats->chanspec = dtoh16(stats->chanspec); in wl_chanim_stats()
4247 stats->timestamp = dtoh32(stats->timestamp); in wl_chanim_stats()
4248 stats->chan_idle = dtoh32(stats->chan_idle); in wl_chanim_stats()
4251 stats->chanspec, stats->glitchcnt, stats->badplcp, stats->chan_idle, in wl_chanim_stats()
4252 stats->timestamp)); in wl_chanim_stats()
4254 *chan_idle = stats->chan_idle; in wl_chanim_stats()
4273 int bytes_written = -1; in wl_android_get_connection_stats()
4295 if_stats = (wl_if_stats_t *)MALLOCZ(cfg->osh, sizeof(*if_stats)); in wl_android_get_connection_stats()
4321 WL_ERR(("counters error (%d) - size = %zu\n", ret, sizeof(wl_cnt_wlc_t))); in wl_android_get_connection_stats()
4337 output->txframe = dtoh32(wlc_cnt->txframe); in wl_android_get_connection_stats()
4338 output->txbyte = dtoh32(wlc_cnt->txbyte); in wl_android_get_connection_stats()
4339 output->txerror = dtoh32(wlc_cnt->txerror); in wl_android_get_connection_stats()
4340 output->rxframe = dtoh32(wlc_cnt->rxframe); in wl_android_get_connection_stats()
4341 output->rxbyte = dtoh32(wlc_cnt->rxbyte); in wl_android_get_connection_stats()
4342 output->txfail = dtoh32(wlc_cnt->txfail); in wl_android_get_connection_stats()
4343 output->txretry = dtoh32(wlc_cnt->txretry); in wl_android_get_connection_stats()
4344 output->txretrie = dtoh32(wlc_cnt->txretrie); in wl_android_get_connection_stats()
4345 output->txrts = dtoh32(wlc_cnt->txrts); in wl_android_get_connection_stats()
4346 output->txnocts = dtoh32(wlc_cnt->txnocts); in wl_android_get_connection_stats()
4347 output->txexptime = dtoh32(wlc_cnt->txexptime); in wl_android_get_connection_stats()
4351 if (dtoh16(if_stats->version) > WL_IF_STATS_T_VERSION) { in wl_android_get_connection_stats()
4355 WL_IF_STATS_T_VERSION, if_stats->version)); in wl_android_get_connection_stats()
4359 output->txframe = (uint32)dtoh64(if_stats->txframe); in wl_android_get_connection_stats()
4360 output->txbyte = (uint32)dtoh64(if_stats->txbyte); in wl_android_get_connection_stats()
4361 output->txerror = (uint32)dtoh64(if_stats->txerror); in wl_android_get_connection_stats()
4362 output->rxframe = (uint32)dtoh64(if_stats->rxframe); in wl_android_get_connection_stats()
4363 output->rxbyte = (uint32)dtoh64(if_stats->rxbyte); in wl_android_get_connection_stats()
4364 output->txfail = (uint32)dtoh64(if_stats->txfail); in wl_android_get_connection_stats()
4365 output->txretry = (uint32)dtoh64(if_stats->txretry); in wl_android_get_connection_stats()
4366 output->txretrie = (uint32)dtoh64(if_stats->txretrie); in wl_android_get_connection_stats()
4367 if (dtoh16(if_stats->length) > OFFSETOF(wl_if_stats_t, txexptime)) { in wl_android_get_connection_stats()
4368 output->txexptime = (uint32)dtoh64(if_stats->txexptime); in wl_android_get_connection_stats()
4369 output->txrts = (uint32)dtoh64(if_stats->txrts); in wl_android_get_connection_stats()
4370 output->txnocts = (uint32)dtoh64(if_stats->txnocts); in wl_android_get_connection_stats()
4372 output->txexptime = 0; in wl_android_get_connection_stats()
4373 output->txrts = 0; in wl_android_get_connection_stats()
4374 output->txnocts = 0; in wl_android_get_connection_stats()
4388 output->txrate = link_speed; in wl_android_get_connection_stats()
4391 if (wl_chanim_stats(dev, &(output->chan_idle)) < 0) { in wl_android_get_connection_stats()
4392 output->chan_idle = 0; in wl_android_get_connection_stats()
4400 MFREE(cfg->osh, if_stats, sizeof(*if_stats)); in wl_android_get_connection_stats()
4424 ret = -EINVAL; in wl_android_process_natoe_cmd()
4431 while (natoe_cmd->name != NULL) { in wl_android_process_natoe_cmd()
4432 if (strcmp(natoe_cmd->name, str) == 0) { in wl_android_process_natoe_cmd()
4434 if (natoe_cmd->handler) { in wl_android_process_natoe_cmd()
4437 ret = natoe_cmd->handler(dev, natoe_cmd, pcmd, &cmd_info); in wl_android_process_natoe_cmd()
4451 uint8 *command = cmd_info->command; in wlu_natoe_set_vars_cbfn()
4452 uint16 total_len = cmd_info->tot_len; in wlu_natoe_set_vars_cbfn()
4463 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
4473 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->sta_ip, buf); in wlu_natoe_set_vars_cbfn()
4475 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->sta_netmask, buf); in wlu_natoe_set_vars_cbfn()
4478 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->sta_router_ip, buf); in wlu_natoe_set_vars_cbfn()
4481 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->sta_dnsip, buf); in wlu_natoe_set_vars_cbfn()
4484 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->ap_ip, buf); in wlu_natoe_set_vars_cbfn()
4487 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->ap_netmask, buf); in wlu_natoe_set_vars_cbfn()
4490 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
4500 dtoh16(ports_config->start_port_num)); in wlu_natoe_set_vars_cbfn()
4502 "number of ports: %d\n", dtoh16(ports_config->no_of_ports)); in wlu_natoe_set_vars_cbfn()
4503 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
4512 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
4520 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
4533 * --- common for all natoe get commands ----
4550 res = bcm_unpack_xtlv_buf(cmd_info, iocresp->data, iocresp->len, in wl_natoe_get_ioctl()
4554 res = cmd_info->bytes_written; in wl_natoe_get_ioctl()
4579 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_enable()
4582 return -ENOMEM; in wl_android_natoe_subcmd_enable()
4586 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_enable()
4589 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_enable()
4590 return -ENOMEM; in wl_android_natoe_subcmd_enable()
4594 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_enable()
4595 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_enable()
4596 natoe_ioc->len = htod16(WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_enable()
4597 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_enable()
4605 ret = -EINVAL; in wl_android_natoe_subcmd_enable()
4619 ret = -EINVAL; in wl_android_natoe_subcmd_enable()
4624 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_enable()
4625 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_enable()
4631 ret = -EINVAL; in wl_android_natoe_subcmd_enable()
4636 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_enable()
4637 MFREE(cfg->osh, natoe_ioc, iocsz); in wl_android_natoe_subcmd_enable()
4657 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ips()
4660 return -ENOMEM; in wl_android_natoe_subcmd_config_ips()
4664 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_config_ips()
4667 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ips()
4668 return -ENOMEM; in wl_android_natoe_subcmd_config_ips()
4672 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_config_ips()
4673 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_config_ips()
4674 natoe_ioc->len = htod16(WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_config_ips()
4675 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_config_ips()
4683 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
4695 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
4702 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
4709 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
4716 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
4723 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
4730 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
4739 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
4744 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_config_ips()
4745 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_config_ips()
4751 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
4756 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ips()
4757 MFREE(cfg->osh, natoe_ioc, sizeof(*natoe_ioc) + WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_config_ips()
4777 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ports()
4780 return -ENOMEM; in wl_android_natoe_subcmd_config_ports()
4784 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_config_ports()
4787 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ports()
4788 return -ENOMEM; in wl_android_natoe_subcmd_config_ports()
4792 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_config_ports()
4793 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_config_ports()
4794 natoe_ioc->len = htod16(WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_config_ports()
4795 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_config_ports()
4803 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
4815 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
4823 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
4831 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
4839 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
4844 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_config_ports()
4845 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_config_ports()
4851 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
4856 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ports()
4857 MFREE(cfg->osh, natoe_ioc, sizeof(*natoe_ioc) + WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_config_ports()
4876 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_natoe_subcmd_dbg_stats()
4879 return -ENOMEM; in wl_android_natoe_subcmd_dbg_stats()
4883 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_dbg_stats()
4886 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MAXLEN); in wl_android_natoe_subcmd_dbg_stats()
4887 return -ENOMEM; in wl_android_natoe_subcmd_dbg_stats()
4891 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_dbg_stats()
4892 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_dbg_stats()
4893 natoe_ioc->len = htod16(WL_NATOE_DBG_STATS_BUFSZ); in wl_android_natoe_subcmd_dbg_stats()
4894 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_dbg_stats()
4902 ret = -EINVAL; in wl_android_natoe_subcmd_dbg_stats()
4916 ret = -EINVAL; in wl_android_natoe_subcmd_dbg_stats()
4921 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_dbg_stats()
4922 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_dbg_stats()
4928 ret = -EINVAL; in wl_android_natoe_subcmd_dbg_stats()
4933 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MAXLEN); in wl_android_natoe_subcmd_dbg_stats()
4934 MFREE(cfg->osh, natoe_ioc, sizeof(*natoe_ioc) + WL_NATOE_DBG_STATS_BUFSZ); in wl_android_natoe_subcmd_dbg_stats()
4953 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_tbl_cnt()
4956 return -ENOMEM; in wl_android_natoe_subcmd_tbl_cnt()
4960 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_tbl_cnt()
4963 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_tbl_cnt()
4964 return -ENOMEM; in wl_android_natoe_subcmd_tbl_cnt()
4968 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_tbl_cnt()
4969 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_tbl_cnt()
4970 natoe_ioc->len = htod16(WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_tbl_cnt()
4971 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_tbl_cnt()
4979 ret = -EINVAL; in wl_android_natoe_subcmd_tbl_cnt()
4993 ret = -EINVAL; in wl_android_natoe_subcmd_tbl_cnt()
4998 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_tbl_cnt()
4999 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_tbl_cnt()
5005 ret = -EINVAL; in wl_android_natoe_subcmd_tbl_cnt()
5010 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_tbl_cnt()
5011 MFREE(cfg->osh, natoe_ioc, sizeof(*natoe_ioc) + WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_tbl_cnt()
5034 ret = -EINVAL; in wl_android_process_mbo_cmd()
5041 while (mbo_cmd->name != NULL) { in wl_android_process_mbo_cmd()
5042 if (strnicmp(mbo_cmd->name, str, strlen(mbo_cmd->name)) == 0) { in wl_android_process_mbo_cmd()
5044 if (mbo_cmd->handler) { in wl_android_process_mbo_cmd()
5047 ret = mbo_cmd->handler(dev, mbo_cmd, pcmd, &cmd_info); in wl_android_process_mbo_cmd()
5066 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_send_wnm_notif()
5067 iov_buf->id = WL_MBO_CMD_SEND_NOTIF; in wl_android_send_wnm_notif()
5068 buflen = buflen_start = iov_buf_len - sizeof(bcm_iov_buf_t); in wl_android_send_wnm_notif()
5069 pxtlv = (uint8 *)&iov_buf->data[0]; in wl_android_send_wnm_notif()
5075 iov_buf->len = buflen_start - buflen; in wl_android_send_wnm_notif()
5076 iovlen = sizeof(bcm_iov_buf_t) + iov_buf->len; in wl_android_send_wnm_notif()
5089 uint8 *command = cmd_info->command; in wl_android_mbo_resp_parse_cbfn()
5090 uint16 total_len = cmd_info->tot_len; in wl_android_mbo_resp_parse_cbfn()
5097 return -EINVAL; in wl_android_mbo_resp_parse_cbfn()
5103 cmd_info->bytes_written = bytes_written; in wl_android_mbo_resp_parse_cbfn()
5128 iov_buf = (bcm_iov_buf_t *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_mbo_subcmd_cell_data_cap()
5130 ret = -ENOMEM; in wl_android_mbo_subcmd_cell_data_cap()
5134 iov_resp = (uint8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_mbo_subcmd_cell_data_cap()
5136 ret = -ENOMEM; in wl_android_mbo_subcmd_cell_data_cap()
5142 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_mbo_subcmd_cell_data_cap()
5143 iov_buf->id = WL_MBO_CMD_CELLULAR_DATA_CAP; in wl_android_mbo_subcmd_cell_data_cap()
5158 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
5160 if (p_resp->id == WL_MBO_CMD_CELLULAR_DATA_CAP) { in wl_android_mbo_subcmd_cell_data_cap()
5161 ret = bcm_unpack_xtlv_buf((void *)cmd_info, (uint8 *)p_resp->data, in wl_android_mbo_subcmd_cell_data_cap()
5162 p_resp->len, BCM_XTLV_OPTION_ALIGN32, in wl_android_mbo_subcmd_cell_data_cap()
5165 ret = cmd_info->bytes_written; in wl_android_mbo_subcmd_cell_data_cap()
5168 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
5169 WL_ERR(("Mismatch: resp id %d req id %d\n", p_resp->id, cmd->id)); in wl_android_mbo_subcmd_cell_data_cap()
5177 old_cell_cap = bcm_get_data_from_xtlv_buf((uint8 *)p_resp->data, p_resp->len, in wl_android_mbo_subcmd_cell_data_cap()
5185 buflen = buflen_start = WLC_IOCTL_MEDLEN - sizeof(bcm_iov_buf_t); in wl_android_mbo_subcmd_cell_data_cap()
5190 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
5193 pxtlv = (uint8 *)&iov_buf->data[0]; in wl_android_mbo_subcmd_cell_data_cap()
5199 iov_buf->len = buflen_start - buflen; in wl_android_mbo_subcmd_cell_data_cap()
5200 iovlen = sizeof(bcm_iov_buf_t) + iov_buf->len; in wl_android_mbo_subcmd_cell_data_cap()
5205 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
5208 /* Skip for CUSTOMER_HW4 - WNM notification in wl_android_mbo_subcmd_cell_data_cap()
5218 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
5224 MFREE(cfg->osh, iov_buf, WLC_IOCTL_MEDLEN); in wl_android_mbo_subcmd_cell_data_cap()
5227 MFREE(cfg->osh, iov_resp, WLC_IOCTL_MAXLEN); in wl_android_mbo_subcmd_cell_data_cap()
5236 uint8 *command = cmd_info->command + cmd_info->bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
5237 uint16 total_len = cmd_info->tot_len; in wl_android_mbo_non_pref_chan_parse_cbfn()
5240 WL_DBG(("Total bytes written at begining %u\n", cmd_info->bytes_written)); in wl_android_mbo_non_pref_chan_parse_cbfn()
5244 return -EINVAL; in wl_android_mbo_non_pref_chan_parse_cbfn()
5252 cmd_info->bytes_written += bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
5260 cmd_info->bytes_written += bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
5268 cmd_info->bytes_written += bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
5276 cmd_info->bytes_written += bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
5282 WL_DBG(("Total bytes written %u\n", cmd_info->bytes_written)); in wl_android_mbo_non_pref_chan_parse_cbfn()
5303 iov_buf = (bcm_iov_buf_t *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_mbo_subcmd_non_pref_chan()
5305 ret = -ENOMEM; in wl_android_mbo_subcmd_non_pref_chan()
5309 iov_resp = (uint8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_mbo_subcmd_non_pref_chan()
5311 ret = -ENOMEM; in wl_android_mbo_subcmd_non_pref_chan()
5318 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_mbo_subcmd_non_pref_chan()
5319 iov_buf->id = WL_MBO_CMD_LIST_CHAN_PREF; in wl_android_mbo_subcmd_non_pref_chan()
5332 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
5334 if (p_resp->id == WL_MBO_CMD_LIST_CHAN_PREF) { in wl_android_mbo_subcmd_non_pref_chan()
5335 ret = bcm_unpack_xtlv_buf((void *)cmd_info, (uint8 *)p_resp->data, in wl_android_mbo_subcmd_non_pref_chan()
5336 p_resp->len, BCM_XTLV_OPTION_ALIGN32, in wl_android_mbo_subcmd_non_pref_chan()
5339 ret = cmd_info->bytes_written; in wl_android_mbo_subcmd_non_pref_chan()
5342 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
5343 WL_ERR(("Mismatch: resp id %d req id %d\n", p_resp->id, cmd->id)); in wl_android_mbo_subcmd_non_pref_chan()
5353 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_mbo_subcmd_non_pref_chan()
5354 iov_buf->id = WL_MBO_CMD_DEL_CHAN_PREF; in wl_android_mbo_subcmd_non_pref_chan()
5355 iov_buf->len = 0; in wl_android_mbo_subcmd_non_pref_chan()
5356 iovlen = sizeof(bcm_iov_buf_t) + iov_buf->len; in wl_android_mbo_subcmd_non_pref_chan()
5361 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
5378 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
5383 pxtlv = (uint8 *)&iov_buf->data[0]; in wl_android_mbo_subcmd_non_pref_chan()
5408 WL_ERR(("len %u\n", (buflen_start - buflen))); in wl_android_mbo_subcmd_non_pref_chan()
5410 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_mbo_subcmd_non_pref_chan()
5411 iov_buf->id = WL_MBO_CMD_ADD_CHAN_PREF; in wl_android_mbo_subcmd_non_pref_chan()
5412 iov_buf->len = buflen_start - buflen; in wl_android_mbo_subcmd_non_pref_chan()
5413 iovlen = sizeof(bcm_iov_buf_t) + iov_buf->len; in wl_android_mbo_subcmd_non_pref_chan()
5418 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
5436 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
5442 MFREE(cfg->osh, iov_buf, WLC_IOCTL_MEDLEN); in wl_android_mbo_subcmd_non_pref_chan()
5445 MFREE(cfg->osh, iov_resp, WLC_IOCTL_MAXLEN); in wl_android_mbo_subcmd_non_pref_chan()
5464 return -1; in wl_android_set_ampdu_mpdu()
5471 return -1; in wl_android_set_ampdu_mpdu()
5530 return -EINVAL; in wl_android_set_auto_channel()
5578 reqbuf = (u8 *)MALLOCZ(cfg->osh, CHANSPEC_BUF_SIZE); in wl_android_set_auto_channel()
5581 return -ENOMEM; in wl_android_set_auto_channel()
5629 while (retry--) { in wl_android_set_auto_channel()
5658 (APCS_MAX_RETRY - retry), ret, chosen)); in wl_android_set_auto_channel()
5680 MFREE(cfg->osh, reqbuf, CHANSPEC_BUF_SIZE); in wl_android_set_auto_channel()
5719 return -1; in wl_android_set_ssid()
5772 return -1; in wl_android_sta_diassoc()
5938 return -1; in wl_android_set_rmc_event()
5961 return -1; in wl_android_get_singlecore_scan()
5976 return -1; in wl_android_set_singlecore_scan()
5983 return -1; in wl_android_set_singlecore_scan()
5998 if (dbm < -1) { in wl_android_set_tx_power()
6000 return -EINVAL; in wl_android_set_tx_power()
6003 if (dbm == -1) in wl_android_set_tx_power()
6050 * -1 : HEAD SAR disabled in wl_android_set_sarlimit_txctrl()
6073 DHD_ERROR(("%s: Failed to get sar_enable - error (%d)\n", __FUNCTION__, err)); in wl_android_set_sarlimit_txctrl()
6092 DHD_ERROR(("%s: Failed to set sar_enable - error (%d)\n", __FUNCTION__, err)); in wl_android_set_sarlimit_txctrl()
6151 dhdp->tid_mode = mode; in wl_android_set_tid()
6152 dhdp->target_uid = uid; in wl_android_set_tid()
6153 dhdp->target_tid = prio; in wl_android_set_tid()
6159 dhdp->tid_mode = SET_TID_OFF; in wl_android_set_tid()
6160 dhdp->target_uid = 0; in wl_android_set_tid()
6161 dhdp->target_tid = 0; in wl_android_set_tid()
6165 dhdp->tid_mode, dhdp->target_uid, dhdp->target_tid)); in wl_android_set_tid()
6183 dhdp->tid_mode, dhdp->target_uid, dhdp->target_tid); in wl_android_get_tid()
6199 return -1; in wl_android_set_roam_mode()
6206 return -1; in wl_android_set_roam_mode()
6232 return -EINVAL; in wl_android_set_ibss_beacon_ouidata()
6237 return -EINVAL; in wl_android_set_ibss_beacon_ouidata()
6244 return -EINVAL; in wl_android_set_ibss_beacon_ouidata()
6260 return -EINVAL; in wl_android_set_ibss_beacon_ouidata()
6263 tot_len = (int)(sizeof(vndr_ie_setbuf_t) + (datalen - 1)); in wl_android_set_ibss_beacon_ouidata()
6264 vndr_ie = (vndr_ie_setbuf_t *)MALLOCZ(cfg->osh, tot_len); in wl_android_set_ibss_beacon_ouidata()
6267 return -ENOMEM; in wl_android_set_ibss_beacon_ouidata()
6270 strlcpy(vndr_ie->cmd, "add", sizeof(vndr_ie->cmd)); in wl_android_set_ibss_beacon_ouidata()
6272 /* Set the IE count - the buffer contains only 1 IE */ in wl_android_set_ibss_beacon_ouidata()
6274 memcpy((void *)&vndr_ie->vndr_ie_buffer.iecount, &iecount, sizeof(s32)); in wl_android_set_ibss_beacon_ouidata()
6278 memcpy((void *)&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].pktflag, &pktflag, in wl_android_set_ibss_beacon_ouidata()
6281 vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.id = (uchar) DOT11_MNG_PROPR_ID; in wl_android_set_ibss_beacon_ouidata()
6283 memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.oui, &ie_buf, in wl_android_set_ibss_beacon_ouidata()
6285 memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.data, in wl_android_set_ibss_beacon_ouidata()
6289 vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.len = (uchar) ielen; in wl_android_set_ibss_beacon_ouidata()
6291 ioctl_buf = (char *)MALLOC(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_set_ibss_beacon_ouidata()
6295 MFREE(cfg->osh, vndr_ie, tot_len); in wl_android_set_ibss_beacon_ouidata()
6297 return -ENOMEM; in wl_android_set_ibss_beacon_ouidata()
6300 if ((bssidx = wl_get_bssidx_by_wdev(cfg, dev->ieee80211_ptr)) < 0) { in wl_android_set_ibss_beacon_ouidata()
6306 WLC_IOCTL_MEDLEN, bssidx, &cfg->ioctl_buf_sync); in wl_android_set_ibss_beacon_ouidata()
6309 err = -EINVAL; in wl_android_set_ibss_beacon_ouidata()
6311 MFREE(cfg->osh, vndr_ie, tot_len); in wl_android_set_ibss_beacon_ouidata()
6320 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_set_ibss_beacon_ouidata()
6346 total_len_left = total_len - strlen(CMD_SET_ROAMPREF) + 1; in wl_android_set_roampref()
6351 return -1; in wl_android_set_roampref()
6356 total_len_left -= 3; in wl_android_set_roampref()
6360 return -1; in wl_android_set_roampref()
6377 total_len_left -= (num_akm_suites * WIDTH_AKM_SUITE); in wl_android_set_roampref()
6381 total_len_left -= 3; in wl_android_set_roampref()
6384 return -1; in wl_android_set_roampref()
6432 return -1; in wl_android_set_roampref()
6439 /* akm-ucipher-mcipher tuples in the format required for join_pref */ in wl_android_set_roampref()
6468 resume_cfg = (struct io_cfg *)MALLOCZ(cfg->osh, sizeof(struct io_cfg)); in wl_android_iolist_add()
6470 return -ENOMEM; in wl_android_iolist_add()
6472 if (config->iovar) { in wl_android_iolist_add()
6473 ret = wldev_iovar_getint(dev, config->iovar, &resume_cfg->param); in wl_android_iolist_add()
6476 config->iovar)); in wl_android_iolist_add()
6480 ret = wldev_iovar_setint(dev, config->iovar, config->param); in wl_android_iolist_add()
6483 config->iovar, config->param)); in wl_android_iolist_add()
6487 resume_cfg->iovar = config->iovar; in wl_android_iolist_add()
6489 resume_cfg->arg = MALLOCZ(cfg->osh, config->len); in wl_android_iolist_add()
6490 if (!resume_cfg->arg) { in wl_android_iolist_add()
6491 ret = -ENOMEM; in wl_android_iolist_add()
6494 ret = wldev_ioctl_get(dev, config->ioctl, resume_cfg->arg, config->len); in wl_android_iolist_add()
6497 config->ioctl)); in wl_android_iolist_add()
6500 ret = wldev_ioctl_set(dev, config->ioctl + 1, config->arg, config->len); in wl_android_iolist_add()
6503 config->iovar, config->param)); in wl_android_iolist_add()
6506 if (config->ioctl + 1 == WLC_SET_PM) in wl_android_iolist_add()
6508 resume_cfg->ioctl = config->ioctl; in wl_android_iolist_add()
6509 resume_cfg->len = config->len; in wl_android_iolist_add()
6512 list_add(&resume_cfg->list, head); in wl_android_iolist_add()
6516 MFREE(cfg->osh, resume_cfg->arg, config->len); in wl_android_iolist_add()
6517 MFREE(cfg->osh, resume_cfg, sizeof(struct io_cfg)); in wl_android_iolist_add()
6532 if (config->iovar) { in wl_android_iolist_resume()
6534 ret = wldev_iovar_setint(dev, config->iovar, in wl_android_iolist_resume()
6535 config->param); in wl_android_iolist_resume()
6538 ret = wldev_ioctl_set(dev, config->ioctl + 1, in wl_android_iolist_resume()
6539 config->arg, config->len); in wl_android_iolist_resume()
6540 if (config->ioctl + 1 == WLC_SET_PM) in wl_android_iolist_resume()
6542 MFREE(cfg->osh, config->arg, config->len); in wl_android_iolist_resume()
6545 MFREE(cfg->osh, config, sizeof(struct io_cfg)); in wl_android_iolist_resume()
6557 return -1; in wl_android_set_miracast()
6711 int ret = -1; in wl_netlink_send_msg()
6733 nlh->nlmsg_seq = seq; in wl_netlink_send_msg()
6734 nlh->nlmsg_type = type; in wl_netlink_send_msg()
6755 return -1; in wl_android_set_ibss_txfail_event()
6800 return -1; in wl_android_get_ibss_peer_info()
6805 return -1; in wl_android_get_ibss_peer_info()
6809 if ((buf = MALLOC(cfg->osh, WLC_IOCTL_MAXLEN)) == NULL) { in wl_android_get_ibss_peer_info()
6811 return -1; in wl_android_get_ibss_peer_info()
6817 MFREE(cfg->osh, buf, WLC_IOCTL_MAXLEN); in wl_android_get_ibss_peer_info()
6818 return -1; in wl_android_get_ibss_peer_info()
6838 WL_DBG(("index:%d rssi:%d, tx:%u, rx:%u\n", i, peer_info->rssi, in wl_android_get_ibss_peer_info()
6839 peer_info->tx_rate, peer_info->rx_rate)); in wl_android_get_ibss_peer_info()
6842 memcmp(&mac_ea, &peer_info->ea, sizeof(struct ether_addr)) == 0) { in wl_android_get_ibss_peer_info()
6848 total_len - bytes_written, in wl_android_get_ibss_peer_info()
6849 MACF" %u %d ", ETHER_TO_MACF(peer_info->ea), in wl_android_get_ibss_peer_info()
6850 peer_info->tx_rate/1000, peer_info->rssi); in wl_android_get_ibss_peer_info()
6855 bytes_written = -1; in wl_android_get_ibss_peer_info()
6872 MFREE(cfg->osh, buf, WLC_IOCTL_MAXLEN); in wl_android_get_ibss_peer_info()
6893 (MAX_IBSS_ROUTE_TBL_ENTRY - 1) * sizeof(ibss_route_entry_t); in wl_android_set_ibss_routetable()
6894 route_tbl = (ibss_route_tbl_t *)MALLOCZ(cfg->osh, route_tbl_len); in wl_android_set_ibss_routetable()
6897 return -ENOMEM; in wl_android_set_ibss_routetable()
6899 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_set_ibss_routetable()
6903 MFREE(cfg->osh, route_tbl, route_tbl_len); in wl_android_set_ibss_routetable()
6905 return -ENOMEM; in wl_android_set_ibss_routetable()
6916 err = -EINVAL; in wl_android_set_ibss_routetable()
6922 err = -EINVAL; in wl_android_set_ibss_routetable()
6927 err = -EINVAL; in wl_android_set_ibss_routetable()
6932 route_tbl->num_entry = entries; in wl_android_set_ibss_routetable()
6938 err = -EINVAL; in wl_android_set_ibss_routetable()
6945 err = -EINVAL; in wl_android_set_ibss_routetable()
6948 bcopy(&dipaddr, &route_tbl->route_entry[i].ipv4_addr, IPV4_ADDR_LEN); in wl_android_set_ibss_routetable()
6949 bcopy(&ea, &route_tbl->route_entry[i].nexthop, ETHER_ADDR_LEN); in wl_android_set_ibss_routetable()
6953 ((!entries?0:(entries - 1)) * sizeof(ibss_route_entry_t)); in wl_android_set_ibss_routetable()
6958 err = -EINVAL; in wl_android_set_ibss_routetable()
6963 MFREE(cfg->osh, route_tbl, sizeof(ibss_route_tbl_t) + in wl_android_set_ibss_routetable()
6964 (MAX_IBSS_ROUTE_TBL_ENTRY - 1) * sizeof(ibss_route_entry_t)); in wl_android_set_ibss_routetable()
6967 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_set_ibss_routetable()
6983 {PRIO_8021D_VO, PRIO_8021D_NC}, /* AC_VO - 3 */ in wl_android_set_ibss_ampdu()
6984 {PRIO_8021D_CL, PRIO_8021D_VI}, /* AC_VI - 2 */ in wl_android_set_ibss_ampdu()
6985 {PRIO_8021D_BK, PRIO_8021D_NONE}, /* AC_BK - 1 */ in wl_android_set_ibss_ampdu()
6986 {PRIO_8021D_BE, PRIO_8021D_EE}}; /* AC_BE - 0 */ in wl_android_set_ibss_ampdu()
7003 return -EINVAL; in wl_android_set_ibss_ampdu()
7008 return -EINVAL; in wl_android_set_ibss_ampdu()
7039 return -EINVAL; in wl_android_set_ibss_antenna()
7047 return -EINVAL; in wl_android_set_ibss_antenna()
7069 return -1; in wl_keep_alive_set()
7073 return -EINVAL; in wl_keep_alive_set()
7087 buf = (char *)MALLOC(cfg->osh, WLC_IOCTL_SMLEN); in wl_keep_alive_set()
7098 MFREE(cfg->osh, buf, WLC_IOCTL_SMLEN); in wl_keep_alive_set()
7113 return -1; in wl_android_get_wfdie_resp()
7131 return -1; in wl_android_set_wfdie_resp()
7164 enable = command[strlen(CMD_RPSMODE) + 1] - '0'; in wl_android_set_rps_cpus()
7188 int bytes_written, error, result = 0, single_stream, stf = -1, i, nss = 0, mcs_map; in wl_android_get_link_status()
7203 return -1; in wl_android_get_link_status()
7209 if (bi->BSSID.octet[i] > 0) { in wl_android_get_link_status()
7216 return -1; in wl_android_get_link_status()
7220 if (bi->vht_cap) { in wl_android_get_link_status()
7221 if (CHSPEC_IS5G(bi->chanspec)) { in wl_android_get_link_status()
7230 return -1; in wl_android_get_link_status()
7241 if (i == MAX_STREAMS_SUPPORTED-1) { in wl_android_get_link_status()
7244 if (bi->basic_mcs[i] & bitmap) { in wl_android_get_link_status()
7252 mcs_map = VHT_MCS_MAP_GET_MCS_PER_SS(i, dtoh16(bi->vht_rxmcsmap)); in wl_android_get_link_status()
7282 if (CHSPEC_IS5G(bi->chanspec)) { in wl_android_get_link_status()
7321 if (!cfg || !cfg->p2p) { in wl_cfg80211_p2plo_deinit()
7322 WL_ERR(("Wl %p or cfg->p2p %p is null\n", in wl_cfg80211_p2plo_deinit()
7323 cfg, cfg ? cfg->p2p : 0)); in wl_cfg80211_p2plo_deinit()
7327 dhd = (dhd_pub_t *)(cfg->pub); in wl_cfg80211_p2plo_deinit()
7328 if (!dhd->up) { in wl_cfg80211_p2plo_deinit()
7336 cfg->ioctl_buf, WLC_IOCTL_SMLEN, bssidx, &cfg->ioctl_buf_sync); in wl_cfg80211_p2plo_deinit()
7349 int ret = -EAGAIN; in wl_cfg80211_p2plo_listen_start()
7388 ret = -EAGAIN; in wl_cfg80211_p2plo_listen_start()
7399 ret = -EAGAIN; in wl_cfg80211_p2plo_listen_start()
7404 sizeof(channel), cfg->ioctl_buf, WLC_IOCTL_SMLEN, in wl_cfg80211_p2plo_listen_start()
7405 bssidx, &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_p2plo_listen_start()
7411 sizeof(wl_p2plo_listen_t), cfg->ioctl_buf, WLC_IOCTL_SMLEN, in wl_cfg80211_p2plo_listen_start()
7412 bssidx, &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_p2plo_listen_start()
7426 int ret = -EAGAIN; in wl_cfg80211_p2plo_listen_stop()
7429 0, cfg->ioctl_buf, WLC_IOCTL_SMLEN, in wl_cfg80211_p2plo_listen_stop()
7430 bssidx, &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_p2plo_listen_stop()
7452 ret = -EINVAL; in wl_cfg80211_p2plo_offload()
7473 cfg->last_roc_id, in wl_cfg80211_cancel_p2plo()
7474 &cfg->remain_on_chan, GFP_KERNEL); in wl_cfg80211_cancel_p2plo()
7477 cfg->last_roc_id, in wl_cfg80211_cancel_p2plo()
7478 &cfg->remain_on_chan, in wl_cfg80211_cancel_p2plo()
7479 cfg->remain_on_chan_type, GFP_KERNEL); in wl_cfg80211_cancel_p2plo()
7499 return -EINVAL; in wl_android_murx_bfe_cap()
7557 return -EINVAL; in wl_android_get_rssi_per_ant()
7572 /* Optional: Check the MIMO RSSI mode - RSSI sum across antennas */ in wl_android_get_rssi_per_ant()
7624 return -EINVAL; in wl_android_set_rssi_logging()
7632 return -EINVAL; in wl_android_set_rssi_logging()
7640 return -EINVAL; in wl_android_set_rssi_logging()
7694 bytes_written = snprintf(command, total_len, "%s FAIL - RSSI Threshold " in wl_android_get_rssi_logging()
7701 bytes_written = snprintf(command, total_len, "%s BUSY - NOT READY\n", in wl_android_get_rssi_logging()
7737 return -EIO; in wl_android_lqcm_enable()
7752 return -EIO; in wl_android_get_lqcm_report()
7777 return -EIO; in wl_android_get_snr()
7805 return -EINVAL; in wl_android_set_ap_beaconrate()
7811 return -EINVAL; in wl_android_set_ap_beaconrate()
7840 return -EINVAL; in wl_android_get_ap_basicrate()
7848 return -EPROTO; in wl_android_get_ap_basicrate()
7874 return -EINVAL; in wl_android_get_ap_rps()
7883 return -EPROTO; in wl_android_get_ap_rps()
7910 return -EINVAL; in wl_android_set_ap_rps()
7916 return -EINVAL; in wl_android_set_ap_rps()
7951 return -EINVAL; in wl_android_set_ap_rps_params()
7957 return -EINVAL; in wl_android_set_ap_rps_params()
7963 return -EINVAL; in wl_android_set_ap_rps_params()
7966 /* sta assoc check */ in wl_android_set_ap_rps_params()
7969 return -EINVAL; in wl_android_set_ap_rps_params()
7975 return -EINVAL; in wl_android_set_ap_rps_params()
8021 memdump_mode = dhdp->memdump_enabled; in wl_android_check_priv_cmd_errors()
8042 dhdp->memdump_type = DUMP_TYPE_SEQUENTIAL_PRIVCMD_ERROR; in wl_android_check_priv_cmd_errors()
8046 dhdp->hang_reason = HANG_REASON_SEQUENTIAL_PRIVCMD_ERROR; in wl_android_check_priv_cmd_errors()
8047 dhd_os_check_hang(dhdp, 0, -EREMOTEIO); in wl_android_check_priv_cmd_errors()
8061 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_enable()
8063 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_enable()
8064 return -EINVAL; in wl_android_pktlog_filter_enable()
8067 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_enable()
8092 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_disable()
8094 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_disable()
8095 return -EINVAL; in wl_android_pktlog_filter_disable()
8098 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_disable()
8123 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_pattern_enable()
8125 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_pattern_enable()
8126 return -EINVAL; in wl_android_pktlog_filter_pattern_enable()
8129 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_pattern_enable()
8157 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_pattern_disable()
8159 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_pattern_disable()
8160 return -EINVAL; in wl_android_pktlog_filter_pattern_disable()
8163 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_pattern_disable()
8191 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_add()
8193 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_add()
8194 return -EINVAL; in wl_android_pktlog_filter_add()
8197 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_add()
8224 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_del()
8226 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_del()
8227 return -EINVAL; in wl_android_pktlog_filter_del()
8230 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_del()
8258 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_info()
8260 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_info()
8261 return -EINVAL; in wl_android_pktlog_filter_info()
8264 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_info()
8285 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_start()
8287 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_start()
8288 return -EINVAL; in wl_android_pktlog_start()
8291 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_start()
8293 __FUNCTION__, dhdp->pktlog->pktlog_ring)); in wl_android_pktlog_start()
8294 return -EINVAL; in wl_android_pktlog_start()
8297 atomic_set(&dhdp->pktlog->pktlog_ring->start, TRUE); in wl_android_pktlog_start()
8312 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_stop()
8314 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_stop()
8315 return -EINVAL; in wl_android_pktlog_stop()
8318 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_stop()
8320 __FUNCTION__, dhdp->pktlog->pktlog_ring)); in wl_android_pktlog_stop()
8321 return -EINVAL; in wl_android_pktlog_stop()
8324 atomic_set(&dhdp->pktlog->pktlog_ring->start, FALSE); in wl_android_pktlog_stop()
8342 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_exist()
8344 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_exist()
8345 return -EINVAL; in wl_android_pktlog_filter_exist()
8348 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_exist()
8374 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_minmize_enable()
8376 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_minmize_enable()
8377 return -EINVAL; in wl_android_pktlog_minmize_enable()
8380 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_minmize_enable()
8382 __FUNCTION__, dhdp->pktlog->pktlog_ring)); in wl_android_pktlog_minmize_enable()
8383 return -EINVAL; in wl_android_pktlog_minmize_enable()
8386 dhdp->pktlog->pktlog_ring->pktlog_minmize = TRUE; in wl_android_pktlog_minmize_enable()
8401 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_minmize_disable()
8403 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_minmize_disable()
8404 return -EINVAL; in wl_android_pktlog_minmize_disable()
8407 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_minmize_disable()
8409 __FUNCTION__, dhdp->pktlog->pktlog_ring)); in wl_android_pktlog_minmize_disable()
8410 return -EINVAL; in wl_android_pktlog_minmize_disable()
8413 dhdp->pktlog->pktlog_ring->pktlog_minmize = FALSE; in wl_android_pktlog_minmize_disable()
8430 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_change_size()
8432 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_change_size()
8433 return -EINVAL; in wl_android_pktlog_change_size()
8442 dhdp->pktlog->pktlog_ring = in wl_android_pktlog_change_size()
8443 dhd_pktlog_ring_change_size(dhdp->pktlog->pktlog_ring, size); in wl_android_pktlog_change_size()
8444 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_change_size()
8483 return -EINVAL; in wl_android_ewp_filter()
8493 &command[bytes_written], tot_len - bytes_written, index1, index2, index3); in wl_android_ewp_filter()
8499 &command[bytes_written], tot_len - bytes_written, type); in wl_android_ewp_filter()
8520 ret = -EPERM; in wl_android_priv_cmd()
8524 if (!ifr->ifr_data) { in wl_android_priv_cmd()
8525 ret = -EINVAL; in wl_android_priv_cmd()
8530 if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(android_wifi_priv_cmd))) { in wl_android_priv_cmd()
8531 ret = -EFAULT; in wl_android_priv_cmd()
8538 ret = -EINVAL; in wl_android_priv_cmd()
8543 command = (char *)MALLOC(cfg->osh, (buf_size + 1)); in wl_android_priv_cmd()
8546 ret = -ENOMEM; in wl_android_priv_cmd()
8550 ret = -EFAULT; in wl_android_priv_cmd()
8556 command, ifr->ifr_name)); in wl_android_priv_cmd()
8573 ret = -EFAULT; in wl_android_priv_cmd()
8593 MFREE(cfg->osh, command, (buf_size + 1)); in wl_android_priv_cmd()
8604 return -EPERM; in wl_android_set_adps_mode()
8613 return -EINVAL; in wl_android_set_adps_mode()
8619 return -EIO; in wl_android_set_adps_mode()
8655 return -EIO; in wl_android_get_adps_mode()
8658 data = (wl_adps_params_v1_t *) ptr->data; in wl_android_get_adps_mode()
8659 mode = data->mode; in wl_android_get_adps_mode()
8691 return -ENOMEM; in wl_android_bcnrecv_event()
8704 return -EINVAL; in wl_android_bcnrecv_event()
8760 cfg->bcnrecv_info.bcnrecv_state = BEACON_RECV_STARTED; in _wl_android_bcnrecv_start()
8789 /* Send sendup_bcn iovar for all cases except W_BCNRECV_ROAMABORT reason - in _wl_android_bcnrecv_stop()
8803 cfg->bcnrecv_info.bcnrecv_state = BEACON_RECV_SUSPENDED; in _wl_android_bcnrecv_stop()
8806 cfg->bcnrecv_info.bcnrecv_state = BEACON_RECV_STOPPED; in _wl_android_bcnrecv_stop()
8828 mutex_lock(&cfg->scan_sync); in wl_android_bcnrecv_start()
8829 mutex_lock(&cfg->bcn_sync); in wl_android_bcnrecv_start()
8831 mutex_unlock(&cfg->bcn_sync); in wl_android_bcnrecv_start()
8832 mutex_unlock(&cfg->scan_sync); in wl_android_bcnrecv_start()
8842 mutex_lock(&cfg->bcn_sync); in wl_android_bcnrecv_stop()
8843 if ((cfg->bcnrecv_info.bcnrecv_state == BEACON_RECV_STARTED) || in wl_android_bcnrecv_stop()
8844 (cfg->bcnrecv_info.bcnrecv_state == BEACON_RECV_SUSPENDED)) { in wl_android_bcnrecv_stop()
8847 mutex_unlock(&cfg->bcn_sync); in wl_android_bcnrecv_stop()
8857 mutex_lock(&cfg->bcn_sync); in wl_android_bcnrecv_suspend()
8858 if (cfg->bcnrecv_info.bcnrecv_state == BEACON_RECV_STARTED) { in wl_android_bcnrecv_suspend()
8862 mutex_unlock(&cfg->bcn_sync); in wl_android_bcnrecv_suspend()
8873 mutex_lock(&cfg->scan_sync); in wl_android_bcnrecv_resume()
8874 mutex_lock(&cfg->bcn_sync); in wl_android_bcnrecv_resume()
8875 if (cfg->bcnrecv_info.bcnrecv_state == BEACON_RECV_SUSPENDED) { in wl_android_bcnrecv_resume()
8879 mutex_unlock(&cfg->bcn_sync); in wl_android_bcnrecv_resume()
8880 mutex_unlock(&cfg->scan_sync); in wl_android_bcnrecv_resume()
8893 return -EINVAL; in wl_android_bcnrecv_config()
8899 return -EINVAL; in wl_android_bcnrecv_config()
8903 mutex_lock(&cfg->usr_sync); in wl_android_bcnrecv_config()
8922 mutex_unlock(&cfg->usr_sync); in wl_android_bcnrecv_config()
8935 /* Using U-APSD as the default power save mode */ in wl_android_update_tsinfo()
8943 tspec_arg->tsinfo.octets[0] = (uint8)(TSPEC_EDCA_ACCESS | direction | in wl_android_update_tsinfo()
8945 tspec_arg->tsinfo.octets[1] = (uint8)((tspec_id << TSPEC_TSINFO_PRIO_SHIFT) | in wl_android_update_tsinfo()
8947 tspec_arg->tsinfo.octets[2] = 0x00; in wl_android_update_tsinfo()
8963 tspec_arg.length = sizeof(tspec_arg_t) - (2 * sizeof(uint16)); in wl_android_handle_cac_action()
8985 tspec_arg.length = sizeof(tspec_arg_t) - (2 * sizeof(uint16)); in wl_android_handle_cac_action()
8998 if ((bssidx = wl_get_bssidx_by_wdev(cfg, ndev->ieee80211_ptr)) < 0) { in wl_android_handle_cac_action()
9004 cfg->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &cfg->ioctl_buf_sync); in wl_android_handle_cac_action()
9020 return -EINVAL; in wl_android_cac_ts_config()
9026 return -EINVAL; in wl_android_cac_ts_config()
9031 WL_ERR(("Request on non-primary interface\n")); in wl_android_cac_ts_config()
9032 return -1; in wl_android_cac_ts_config()
9036 mutex_lock(&cfg->usr_sync); in wl_android_cac_ts_config()
9038 mutex_unlock(&cfg->usr_sync); in wl_android_cac_ts_config()
9098 DHD_ERROR(("wl_handle_private_cmd: Ignore private cmd \"%s\" - iface is down\n", in wl_handle_private_cmd()
9136 int filter_num = *(command + strlen(CMD_RXFILTER_ADD) + 1) - '0'; in wl_handle_private_cmd()
9140 int filter_num = *(command + strlen(CMD_RXFILTER_REMOVE) + 1) - '0'; in wl_handle_private_cmd()
9145 /* TBD: BTCOEXSCAN-START */ in wl_handle_private_cmd()
9148 /* TBD: BTCOEXSCAN-STOP */ in wl_handle_private_cmd()
9156 uint mode = *(command + strlen(CMD_BTCOEXMODE) + 1) - '0'; in wl_handle_private_cmd()
9205 int revinfo = -1; in wl_handle_private_cmd()
9209 if (dhdp->is_blob) { in wl_handle_private_cmd()
9435 int enable = *(command + strlen(CMD_PNOENABLE_SET) + 1) - '0'; in wl_handle_private_cmd()
9448 priv_cmd.total_len - skip); in wl_handle_private_cmd()
9465 priv_cmd.total_len - skip); in wl_handle_private_cmd()
9470 priv_cmd.total_len - skip); in wl_handle_private_cmd()
9475 command + skip, priv_cmd.total_len - skip); in wl_handle_private_cmd()
9482 priv_cmd.total_len - skip, *(command + skip - 2) - '0'); in wl_handle_private_cmd()
9546 int rmc_enable = *(command + strlen(CMD_SET_RMC_ENABLE) + 1) - '0'; in wl_handle_private_cmd()
9665 int enable = *(command + strlen(CMD_ROAM_OFFLOAD) + 1) - '0'; in wl_handle_private_cmd()
9673 bytes_written = -ENODEV; in wl_handle_private_cmd()
9690 int mode = *(command + strlen(CMD_P2P_SET_WFDIE_RESP) + 1) - '0'; in wl_handle_private_cmd()
9780 uint val = *(command + strlen(CMD_MURX_BFE_CAP) + 1) - '0'; in wl_handle_private_cmd()
9844 strncpy(eabuf, p, ETHER_ADDR_STR_LEN - 1); in wl_handle_private_cmd()
9847 DHD_ERROR(("BANDSTEER: ERROR while parsing macaddr cmd %s - ignored\n", in wl_handle_private_cmd()
9904 int affinity_cmd = *(command + strlen(CMD_PCIE_IRQ_CORE) + 1) - '0'; in wl_handle_private_cmd()
9916 int lqcm_enable = *(command + strlen(CMD_SET_LQCM_ENABLE) + 1) - '0'; in wl_handle_private_cmd()
9988 int verbose_level = *(command + strlen(CMD_DEBUG_VERBOSE) + 1) - '0'; in wl_handle_private_cmd()
10030 int transition_disabled = *(command + strlen(CMD_TRANSITION_DISABLE) + 1) - '0'; in wl_handle_private_cmd()
10034 DHD_ERROR(("Unknown PRIVATE command %s - ignored\n", command)); in wl_handle_private_cmd()
10078 list_del(&cur->list); in wl_android_exit()
10105 family->module = THIS_MODULE; in wl_genl_register_family_with_ops_groups()
10106 family->ops = ops; in wl_genl_register_family_with_ops_groups()
10107 family->n_ops = n_ops; in wl_genl_register_family_with_ops_groups()
10108 family->mcgrps = mcgrps; in wl_genl_register_family_with_ops_groups()
10109 family->n_mcgrps = n_mcgrps; in wl_genl_register_family_with_ops_groups()
10156 return -1; in wl_genl_init()
10175 u16 event = -1; in wl_event_to_bcm_event()
10232 ret = -ENOMEM; in wl_genl_send_msg()
10238 ret = -ENOMEM; in wl_genl_send_msg()
10248 ret = -EINVAL; in wl_genl_send_msg()
10261 p = ptr = (u8 *)MALLOCZ(cfg->osh, tot_len); in wl_genl_send_msg()
10263 ret = -ENOMEM; in wl_genl_send_msg()
10270 hdr->event_type = wl_event_to_bcm_event(event_type); in wl_genl_send_msg()
10271 hdr->len = len + subhdr_len; in wl_genl_send_msg()
10321 MFREE(cfg->osh, p, tot_len); in wl_genl_send_msg()
10340 return -EINVAL; in wl_genl_handle_msg()
10343 na = info->attrs[BCM_GENL_ATTR_MSG]; in wl_genl_handle_msg()
10346 return -EINVAL; in wl_genl_handle_msg()
10352 return -EINVAL; in wl_genl_handle_msg()
10357 info->snd_pid)); in wl_genl_handle_msg()
10360 info->snd_portid)); in wl_genl_handle_msg()
10399 (void)memcpy_s(mac_addr, ETH_ALEN, primary_ndev->dev_addr, ETH_ALEN); in wl_cfg80211_register_static_if()
10408 wdev = (struct wireless_dev *)MALLOCZ(cfg->osh, sizeof(*wdev)); in wl_cfg80211_register_static_if()
10414 wdev->wiphy = cfg->wdev->wiphy; in wl_cfg80211_register_static_if()
10415 wdev->iftype = iftype; in wl_cfg80211_register_static_if()
10417 ndev->ieee80211_ptr = wdev; in wl_cfg80211_register_static_if()
10418 SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy)); in wl_cfg80211_register_static_if()
10419 wdev->netdev = ndev; in wl_cfg80211_register_static_if()
10427 cfg->static_ndev[ifidx - DHD_MAX_IFS] = ndev; in wl_cfg80211_register_static_if()
10428 cfg->static_ndev_state[ifidx - DHD_MAX_IFS] = NDEV_STATE_OS_IF_CREATED; in wl_cfg80211_register_static_if()
10431 WL_INFORM_MEM(("Static I/F (%s) Registered\n", ndev->name)); in wl_cfg80211_register_static_if()
10445 if (!cfg || !cfg->static_ndev[i]) { in wl_cfg80211_unregister_static_if()
10451 /* free_netdev(cfg->static_ndev); in wl_cfg80211_unregister_static_if()
10453 unregister_netdev(cfg->static_ndev[i]); in wl_cfg80211_unregister_static_if()
10463 u16 iftype = net->ieee80211_ptr ? net->ieee80211_ptr->iftype : 0; in wl_cfg80211_static_if_open()
10466 WL_INFORM_MEM(("[STATIC_IF] dev_open ndev %p and wdev %p\n", net, net->ieee80211_ptr)); in wl_cfg80211_static_if_open()
10473 wdev = wl_cfg80211_add_if(cfg, primary_ndev, wl_iftype, net->name, NULL); in wl_cfg80211_static_if_open()
10493 if (mutex_is_locked(&cfg->if_sync) == TRUE) { in wl_cfg80211_static_if_close()
10494 ret = _wl_cfg80211_del_if(cfg, primary_ndev, net->ieee80211_ptr, net->name); in wl_cfg80211_static_if_close()
10496 ret = wl_cfg80211_del_if(cfg, primary_ndev, net->ieee80211_ptr, net->name); in wl_cfg80211_static_if_close()
10521 new_ndev = cfg->static_ndev[iface_num]; in wl_cfg80211_post_static_ifcreate()
10523 wdev = new_ndev->ieee80211_ptr; in wl_cfg80211_post_static_ifcreate()
10525 wdev->iftype = iface_type; in wl_cfg80211_post_static_ifcreate()
10526 (void)memcpy_s(new_ndev->dev_addr, ETH_ALEN, addr, ETH_ALEN); in wl_cfg80211_post_static_ifcreate()
10529 cfg->static_ndev_state[iface_num] = NDEV_STATE_FW_IF_CREATED; in wl_cfg80211_post_static_ifcreate()
10530 wl_cfg80211_update_iflist_info(cfg, new_ndev, event->ifidx, addr, event->bssidx, in wl_cfg80211_post_static_ifcreate()
10531 event->name, NDEV_STATE_FW_IF_CREATED); in wl_cfg80211_post_static_ifcreate()
10538 if ((iface_num = get_iface_num(ndev->name, cfg)) < 0) { in wl_cfg80211_post_static_ifdel()
10542 cfg->static_ndev_state[iface_num] = NDEV_STATE_FW_IF_DELETED; in wl_cfg80211_post_static_ifdel()
10545 wl_cfg80211_clear_per_bss_ies(cfg, ndev->ieee80211_ptr); in wl_cfg80211_post_static_ifdel()
10546 wl_dealloc_netinfo_by_wdev(cfg, ndev->ieee80211_ptr); in wl_cfg80211_post_static_ifdel()
10560 ioctl_buf = (u8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wlc_wbtext_get_roam_prof()
10563 err = -ENOMEM; in wlc_wbtext_get_roam_prof()
10566 rp->v1.band = band; in wlc_wbtext_get_roam_prof()
10567 rp->v1.len = 0; in wlc_wbtext_get_roam_prof()
10576 if (rp->v1.ver > WL_ROAM_PROF_VER_2) { in wlc_wbtext_get_roam_prof()
10577 WL_ERR(("bad version (=%d) in return data\n", rp->v1.ver)); in wlc_wbtext_get_roam_prof()
10581 switch (rp->v1.ver) { in wlc_wbtext_get_roam_prof()
10601 WL_ERR(("bad version = %d \n", rp->v1.ver)); in wlc_wbtext_get_roam_prof()
10606 if ((rp->v1.len % *roam_prof_size) != 0) { in wlc_wbtext_get_roam_prof()
10607 WL_ERR(("bad length (=%d) in return data\n", rp->v1.len)); in wlc_wbtext_get_roam_prof()
10612 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wlc_wbtext_get_roam_prof()
10631 commandp = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_set_default()
10634 ret = -ENOMEM; in wl_cfg80211_wbtext_set_default()
10637 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_set_default()
10640 ret = -ENOMEM; in wl_cfg80211_wbtext_set_default()
10689 ret = -EINVAL; in wl_cfg80211_wbtext_set_default()
10701 /* set RSSI weight */ in wl_cfg80211_wbtext_set_default()
10708 WL_ERR(("%s: Failed to set weight config %s error = %d\n", in wl_cfg80211_wbtext_set_default()
10719 WL_ERR(("%s: Failed to set weight config %s error = %d\n", in wl_cfg80211_wbtext_set_default()
10724 /* set CU weight */ in wl_cfg80211_wbtext_set_default()
10731 WL_ERR(("%s: Failed to set weight config %s error = %d\n", in wl_cfg80211_wbtext_set_default()
10742 WL_ERR(("%s: Failed to set weight config %s error = %d\n", in wl_cfg80211_wbtext_set_default()
10752 /* set ESTM DL weight. */ in wl_cfg80211_wbtext_set_default()
10761 WL_ERR(("%s: Failed to set weight config %s error = %d\n", in wl_cfg80211_wbtext_set_default()
10772 WL_ERR(("%s: Failed to set weight config %s error = %d\n", in wl_cfg80211_wbtext_set_default()
10826 MFREE(cfg->osh, commandp, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_set_default()
10829 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_set_default()
10841 int err = -EINVAL, bytes_written = 0; in wl_cfg80211_wbtext_config()
10848 ioctl_buf = (u8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_cfg80211_wbtext_config()
10851 err = -ENOMEM; in wl_cfg80211_wbtext_config()
10854 rp = (wl_roamprof_band_t *)MALLOCZ(cfg->osh, sizeof(*rp)); in wl_cfg80211_wbtext_config()
10857 err = -ENOMEM; in wl_cfg80211_wbtext_config()
10861 rp->v1.band = WLC_BAND_2G; in wl_cfg80211_wbtext_config()
10863 rp->v1.band = WLC_BAND_5G; in wl_cfg80211_wbtext_config()
10869 rp->v1.len = 0; in wl_cfg80211_wbtext_config()
10878 if (rp->v1.ver > WL_ROAM_PROF_VER_2) { in wl_cfg80211_wbtext_config()
10879 WL_ERR(("bad version (=%d) in return data\n", rp->v1.ver)); in wl_cfg80211_wbtext_config()
10880 err = -EINVAL; in wl_cfg80211_wbtext_config()
10883 switch (rp->v1.ver) { in wl_cfg80211_wbtext_config()
10903 WL_ERR(("bad version = %d \n", rp->v1.ver)); in wl_cfg80211_wbtext_config()
10907 if ((rp->v1.len % roam_prof_size) != 0) { in wl_cfg80211_wbtext_config()
10908 WL_ERR(("bad length (=%d) in return data\n", rp->v1.len)); in wl_cfg80211_wbtext_config()
10909 err = -EINVAL; in wl_cfg80211_wbtext_config()
10918 if (((i * roam_prof_size) > rp->v1.len)) { in wl_cfg80211_wbtext_config()
10922 fs_per = rp->v1.roam_prof[i].fullscan_period; in wl_cfg80211_wbtext_config()
10924 fs_per = rp->v2.roam_prof[i].fullscan_period; in wl_cfg80211_wbtext_config()
10926 fs_per = rp->v3.roam_prof[i].fullscan_period; in wl_cfg80211_wbtext_config()
10938 total_len - bytes_written, in wl_cfg80211_wbtext_config()
10940 rp->v2.roam_prof[i].roam_trigger, in wl_cfg80211_wbtext_config()
10941 rp->v2.roam_prof[i].rssi_lower, in wl_cfg80211_wbtext_config()
10942 rp->v2.roam_prof[i].channel_usage, in wl_cfg80211_wbtext_config()
10943 rp->v2.roam_prof[i].cu_avg_calc_dur); in wl_cfg80211_wbtext_config()
10946 total_len - bytes_written, in wl_cfg80211_wbtext_config()
10948 rp->v3.roam_prof[i].roam_trigger, in wl_cfg80211_wbtext_config()
10949 rp->v3.roam_prof[i].rssi_lower, in wl_cfg80211_wbtext_config()
10950 rp->v3.roam_prof[i].channel_usage, in wl_cfg80211_wbtext_config()
10951 rp->v3.roam_prof[i].cu_avg_calc_dur); in wl_cfg80211_wbtext_config()
10960 err = -EINVAL; in wl_cfg80211_wbtext_config()
10969 err = -EINVAL; in wl_cfg80211_wbtext_config()
10976 err = -EINVAL; in wl_cfg80211_wbtext_config()
10980 rp->v2.roam_prof[i].roam_trigger = roam_trigger; in wl_cfg80211_wbtext_config()
10981 rp->v2.roam_prof[i].rssi_lower = rssi_lower; in wl_cfg80211_wbtext_config()
10983 rp->v2.roam_prof[i].channel_usage = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_config()
10985 rp->v2.roam_prof[i].cu_avg_calc_dur = in wl_cfg80211_wbtext_config()
10989 rp->v3.roam_prof[i].roam_trigger = roam_trigger; in wl_cfg80211_wbtext_config()
10990 rp->v3.roam_prof[i].rssi_lower = rssi_lower; in wl_cfg80211_wbtext_config()
10992 rp->v3.roam_prof[i].channel_usage = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_config()
10994 rp->v3.roam_prof[i].cu_avg_calc_dur = in wl_cfg80211_wbtext_config()
11007 err = -EINVAL; in wl_cfg80211_wbtext_config()
11010 rp->v1.len = rp_len; in wl_cfg80211_wbtext_config()
11012 sizeof(*rp), cfg->ioctl_buf, WLC_IOCTL_MEDLEN, in wl_cfg80211_wbtext_config()
11013 &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_wbtext_config()
11019 MFREE(cfg->osh, rp, sizeof(*rp)); in wl_cfg80211_wbtext_config()
11022 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_cfg80211_wbtext_config()
11030 int bytes_written = 0, err = -EINVAL, argc = 0; in wl_cfg80211_wbtext_weight_config()
11031 char rssi[BUFSZN], band[BUFSZN], weight[BUFSZN]; in wl_cfg80211_wbtext_weight_config() local
11037 bwcfg = (wnm_bss_select_weight_cfg_t *)MALLOCZ(cfg->osh, sizeof(*bwcfg)); in wl_cfg80211_wbtext_weight_config()
11040 err = -ENOMEM; in wl_cfg80211_wbtext_weight_config()
11043 bwcfg->version = WNM_BSSLOAD_MONITOR_VERSION; in wl_cfg80211_wbtext_weight_config()
11044 bwcfg->type = 0; in wl_cfg80211_wbtext_weight_config()
11045 bwcfg->weight = 0; in wl_cfg80211_wbtext_weight_config()
11047 argc = sscanf(data, "%"S(BUFSZ)"s %"S(BUFSZ)"s %"S(BUFSZ)"s", rssi, band, weight); in wl_cfg80211_wbtext_weight_config()
11050 bwcfg->type = WNM_BSS_SELECT_TYPE_RSSI; in wl_cfg80211_wbtext_weight_config()
11052 bwcfg->type = WNM_BSS_SELECT_TYPE_CU; in wl_cfg80211_wbtext_weight_config()
11054 bwcfg->type = WNM_BSS_SELECT_TYPE_ESTM_DL; in wl_cfg80211_wbtext_weight_config()
11056 /* Usage DRIVER WBTEXT_WEIGHT_CONFIG <rssi/cu/estm_dl> <band> <weight> */ in wl_cfg80211_wbtext_weight_config()
11062 bwcfg->band = WLC_BAND_5G; in wl_cfg80211_wbtext_weight_config()
11064 bwcfg->band = WLC_BAND_2G; in wl_cfg80211_wbtext_weight_config()
11066 bwcfg->band = WLC_BAND_ALL; in wl_cfg80211_wbtext_weight_config()
11074 if (bwcfg->band == WLC_BAND_ALL) { in wl_cfg80211_wbtext_weight_config()
11085 bytes_written = snprintf(command, total_len, "%s %s weight = %d\n", in wl_cfg80211_wbtext_weight_config()
11086 (bwcfg->type == WNM_BSS_SELECT_TYPE_RSSI) ? "RSSI" : in wl_cfg80211_wbtext_weight_config()
11087 (bwcfg->type == WNM_BSS_SELECT_TYPE_CU) ? "CU": "ESTM_DL", in wl_cfg80211_wbtext_weight_config()
11088 (bwcfg->band == WLC_BAND_2G) ? "2G" : "5G", bwcfg->weight); in wl_cfg80211_wbtext_weight_config()
11092 /* if weight is non integer returns command usage error */ in wl_cfg80211_wbtext_weight_config()
11093 bwcfg->weight = simple_strtol(weight, &endptr, 0); in wl_cfg80211_wbtext_weight_config()
11098 /* setting weight for iovar wnm_bss_select_weight to fw */ in wl_cfg80211_wbtext_weight_config()
11107 MFREE(cfg->osh, bwcfg, sizeof(*bwcfg)); in wl_cfg80211_wbtext_weight_config()
11119 int bytes_written = 0, err = -EINVAL; in wl_cfg80211_wbtext_table_config()
11128 btcfg = (wnm_bss_select_factor_cfg_t *)MALLOCZ(cfg->osh, in wl_cfg80211_wbtext_table_config()
11132 err = -ENOMEM; in wl_cfg80211_wbtext_table_config()
11136 btcfg->version = WNM_BSS_SELECT_FACTOR_VERSION; in wl_cfg80211_wbtext_table_config()
11137 btcfg->band = WLC_BAND_AUTO; in wl_cfg80211_wbtext_table_config()
11138 btcfg->type = 0; in wl_cfg80211_wbtext_table_config()
11139 btcfg->count = 0; in wl_cfg80211_wbtext_table_config()
11144 btcfg->type = WNM_BSS_SELECT_TYPE_RSSI; in wl_cfg80211_wbtext_table_config()
11147 btcfg->type = WNM_BSS_SELECT_TYPE_CU; in wl_cfg80211_wbtext_table_config()
11155 btcfg->band = WLC_BAND_5G; in wl_cfg80211_wbtext_table_config()
11158 btcfg->band = WLC_BAND_2G; in wl_cfg80211_wbtext_table_config()
11161 btcfg->band = WLC_BAND_ALL; in wl_cfg80211_wbtext_table_config()
11168 if ((slen - 1) == (strlen(rssi) + strlen(band))) { in wl_cfg80211_wbtext_table_config()
11177 memcpy(btcfg, ioctl_buf, (btcfg->count+1) * sizeof(*btcfg)); in wl_cfg80211_wbtext_table_config()
11179 bytes_written += snprintf(command + bytes_written, total_len - bytes_written, in wl_cfg80211_wbtext_table_config()
11180 "No of entries in table: %d\n", btcfg->count); in wl_cfg80211_wbtext_table_config()
11181 bytes_written += snprintf(command + bytes_written, total_len - bytes_written, in wl_cfg80211_wbtext_table_config()
11183 (btcfg->type == WNM_BSS_SELECT_TYPE_RSSI) ? "RSSI" : "CU"); in wl_cfg80211_wbtext_table_config()
11184 bytes_written += snprintf(command + bytes_written, total_len - bytes_written, in wl_cfg80211_wbtext_table_config()
11186 for (i = 0; i <= btcfg->count-1; i++) { in wl_cfg80211_wbtext_table_config()
11188 total_len - bytes_written, "%d\t%d\t%d\n", btcfg->params[i].low, in wl_cfg80211_wbtext_table_config()
11189 btcfg->params[i].high, btcfg->params[i].factor); in wl_cfg80211_wbtext_table_config()
11195 memset_s(btcfg->params, len, 0, len); in wl_cfg80211_wbtext_table_config()
11198 slen = slen - (strlen(rssi) + strlen(band) + 2); in wl_cfg80211_wbtext_table_config()
11201 btcfg->params[i].low = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_table_config()
11203 btcfg->params[i].high = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_table_config()
11205 btcfg->params[i].factor = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_table_config()
11206 btcfg->count++; in wl_cfg80211_wbtext_table_config()
11211 parsed_len = data - start_addr; in wl_cfg80211_wbtext_table_config()
11217 btcfg_len = sizeof(*btcfg) + ((btcfg->count) * sizeof(*btcfg)); in wl_cfg80211_wbtext_table_config()
11219 cfg->ioctl_buf, WLC_IOCTL_MEDLEN, &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_wbtext_table_config()
11226 MFREE(cfg->osh, btcfg, in wl_cfg80211_wbtext_table_config()
11237 int err = -EINVAL, bytes_written = 0, argc = 0, val, len = 0; in wl_cfg80211_wbtext_delta_config()
11242 rp = (wl_roamprof_band_t *)MALLOCZ(cfg->osh, sizeof(*rp)); in wl_cfg80211_wbtext_delta_config()
11245 err = -ENOMEM; in wl_cfg80211_wbtext_delta_config()
11261 err = -EINVAL; in wl_cfg80211_wbtext_delta_config()
11277 if (((i * roam_prof_size) > rp->v1.len) || in wl_cfg80211_wbtext_delta_config()
11278 (rp->v1.roam_prof[i].fullscan_period == 0)) { in wl_cfg80211_wbtext_delta_config()
11282 if (rp->v2.roam_prof[i].channel_usage != 0) { in wl_cfg80211_wbtext_delta_config()
11283 rp->v2.roam_prof[i].roam_delta = val; in wl_cfg80211_wbtext_delta_config()
11286 if (rp->v3.roam_prof[i].channel_usage != 0) { in wl_cfg80211_wbtext_delta_config()
11287 rp->v3.roam_prof[i].roam_delta = val; in wl_cfg80211_wbtext_delta_config()
11294 if (rp->v2.roam_prof[0].channel_usage != 0) { in wl_cfg80211_wbtext_delta_config()
11296 "%s Delta %d\n", (rp->v1.band == WLC_BAND_2G) ? "2G" : "5G", in wl_cfg80211_wbtext_delta_config()
11297 rp->v2.roam_prof[0].roam_delta); in wl_cfg80211_wbtext_delta_config()
11302 rp->v1.len = len; in wl_cfg80211_wbtext_delta_config()
11304 sizeof(*rp), cfg->ioctl_buf, WLC_IOCTL_MEDLEN, in wl_cfg80211_wbtext_delta_config()
11305 &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_wbtext_delta_config()
11310 MFREE(cfg->osh, rp, sizeof(*rp)); in wl_cfg80211_wbtext_delta_config()