Lines Matching +full:em +full:- +full:uart

2  * Linux cfg80211 driver - Android related functions
21 * <<Broadcom-WL-IPTag/Dual:>>
94 printf("ANDROID-ERROR) " x, ## args); \
100 printf("ANDROID-TRACE) " x, ## args); \
106 printf("ANDROID-INFO) " x, ## args); \
120 #define CMD_SCAN_ACTIVE "SCAN-ACTIVE"
121 #define CMD_SCAN_PASSIVE "SCAN-PASSIVE"
124 #define CMD_RXFILTER_START "RXFILTER-START"
125 #define CMD_RXFILTER_STOP "RXFILTER-STOP"
126 #define CMD_RXFILTER_ADD "RXFILTER-ADD"
127 #define CMD_RXFILTER_REMOVE "RXFILTER-REMOVE"
128 #define CMD_BTCOEXSCAN_START "BTCOEXSCAN-START"
129 #define CMD_BTCOEXSCAN_STOP "BTCOEXSCAN-STOP"
362 #define CUSTOMER_HW4_DISABLE -1
417 #define DEFAULT_WBTEXT_PROFILE_A_V2 "a -70 -75 70 10 -75 -128 0 10"
418 #define DEFAULT_WBTEXT_PROFILE_B_V2 "b -60 -75 70 10 -75 -128 0 10"
419 #define DEFAULT_WBTEXT_PROFILE_A_V3 "a -70 -75 70 10 -75 -128 0 10"
420 #define DEFAULT_WBTEXT_PROFILE_B_V3 "b -60 -75 70 10 -75 -128 0 10"
427 #define DEFAULT_WBTEXT_CU_RSSI_TRIG_A -70
428 #define DEFAULT_WBTEXT_CU_RSSI_TRIG_B -60
591 * adding these private commands corresponding to atd-server's implementation
815 .name = "bcm-genl", /* Netlink I/F for Android */
844 { .name = "bcm-genl-mcast", },
849 .name = "bcm-genl-mcast",
1026 #define DEFAULT_ROAM_TIRGGER -75
1178 smbuf = (char *)MALLOC(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_set_wfds_hash()
1182 return -ENOMEM; in wl_android_set_wfds_hash()
1201 MFREE(cfg->osh, smbuf, WLC_IOCTL_MAXLEN); in wl_android_set_wfds_hash()
1216 return -1; in wl_android_get_link_speed()
1254 return -1; in wl_android_get_rssi()
1286 return -1; in wl_android_get_rssi()
1293 return -1; in wl_android_get_rssi()
1297 return -ENOMEM; in wl_android_get_rssi()
1302 if ((total_len - bytes_written) < (strlen(" rssi -XXX") + 1)) in wl_android_get_rssi()
1303 return -ENOMEM; in wl_android_get_rssi()
1305 bytes_written += scnprintf(&command[bytes_written], total_len - bytes_written, in wl_android_get_rssi()
1319 suspend_flag = *(command + strlen(CMD_SETSUSPENDOPT) + 1) - '0'; in wl_android_set_suspendopt()
1328 ANDROID_INFO(("wl_android_set_suspendopt: Suspend Flag %d -> %d\n", in wl_android_set_suspendopt()
1345 suspend_flag = *(command + strlen(CMD_SETSUSPENDMODE) + 1) - '0'; in wl_android_set_suspendmode()
1367 return -1; in wl_android_get_80211_mode()
1394 return -1; in wl_android_get_chanspec()
1422 channel -= CH_10MHZ_APART; in wl_android_get_chanspec()
1428 channel -= (CH_10MHZ_APART + CH_20MHZ_APART); in wl_android_get_chanspec()
1430 channel -= CH_10MHZ_APART; in wl_android_get_chanspec()
1458 return -1; in wl_android_get_datarate()
1477 assoc_maclist->count = htod32(MAX_NUM_OF_ASSOCLIST); in wl_android_get_assoclist()
1481 return -1; in wl_android_get_assoclist()
1483 assoc_maclist->count = dtoh32(assoc_maclist->count); in wl_android_get_assoclist()
1485 CMD_ASSOC_CLIENTS, assoc_maclist->count); in wl_android_get_assoclist()
1487 for (i = 0; i < assoc_maclist->count; i++) { in wl_android_get_assoclist()
1488 len = snprintf(command + bytes_written, total_len - bytes_written, " " MACDBG, in wl_android_get_assoclist()
1489 MAC2STRDBG(assoc_maclist->ea[i].octet)); in wl_android_get_assoclist()
1490 /* A return value of '(total_len - bytes_written)' or more means that the in wl_android_get_assoclist()
1493 if ((len > 0) && (len < (total_len - bytes_written))) { in wl_android_get_assoclist()
1499 bytes_written = -1; in wl_android_get_assoclist()
1523 return -1; in wl_android_set_csa()
1529 return -1; in wl_android_set_csa()
1534 return -1; in wl_android_set_csa()
1544 return -1; in wl_android_set_csa()
1550 return -1; in wl_android_set_csa()
1561 return -1; in wl_android_set_csa()
1565 return -1; in wl_android_set_csa()
1569 return -1; in wl_android_set_csa()
1577 return -1; in wl_android_set_csa()
1589 dtim = *(command + strlen(CMD_SETDTIM_IN_SUSPEND) + 1) - '0'; in wl_android_set_bcn_li_dtim()
1613 dtim_flag = *(command + strlen(CMD_MAXDTIM_IN_SUSPEND) + 1) - '0'; in wl_android_set_max_dtim()
1632 dtim_flag = *(command + strlen(CMD_DISDTIM_IN_SUSPEND) + 1) - '0'; in wl_android_set_disable_dtim_in_suspend()
1668 uint band = *(command + strlen(CMD_SETBAND) + 1) - '0'; in wl_android_set_band()
1677 error = -1; in wl_android_set_band()
1700 if (dhdp->wbtext_policy == WL_BSSTRANS_POLICY_PRODUCT_WBTEXT) { in wl_android_check_wbtext_policy()
1766 return -EINVAL; in wl_android_get_roam_trigger()
1834 commandp = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_roam_trigger_config()
1837 ret = -ENOMEM; in wl_cfg80211_wbtext_roam_trigger_config()
1869 * WBTEXT_PROFILE_CONFIG band -70 roam_trigger 70 10 roam_trigger -128 0 10 in wl_cfg80211_wbtext_roam_trigger_config()
1895 MFREE(cfg->osh, commandp, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_roam_trigger_config()
1968 return -1; in wl_android_get_roam_delta()
1999 return -1; in wl_android_get_roam_scan_period()
2038 return -1; in wl_android_get_full_roam_scan_period()
2095 return -1; in wl_android_get_country_rev()
2120 return -1; in wl_android_get_roam_scan_control()
2135 return -1; in wl_android_set_roam_scan_control()
2143 return -1; in wl_android_set_roam_scan_control()
2165 buf_avail = total_len - bytes_written; in wl_android_get_roam_scan_channels()
2173 bytes_written = -1; in wl_android_get_roam_scan_channels()
2177 buf_avail -= len; in wl_android_get_roam_scan_channels()
2275 buf_avail = total_len - bytes_written; in wl_android_get_roam_scan_freqs()
2288 bytes_written = -1; in wl_android_get_roam_scan_freqs()
2292 buf_avail -= len; in wl_android_get_roam_scan_freqs()
2753 int error = -1; in wl_android_send_action_frame()
2770 if ((uint16)params->len > ANDROID_WIFI_ACTION_FRAME_SIZE) { in wl_android_send_action_frame()
2773 params->len)); in wl_android_send_action_frame()
2777 smbuf = (char *)MALLOC(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_send_action_frame()
2784 af_params = (wl_af_params_t *)MALLOCZ(cfg->osh, WL_WIFI_AF_PARAMS_SIZE); in wl_android_send_action_frame()
2791 if (bcm_ether_atoe((const char *)params->bssid, (struct ether_addr *)&tmp_bssid) == 0) { in wl_android_send_action_frame()
2803 if (params->channel < 0) { in wl_android_send_action_frame()
2816 tmp_channel = params->channel; in wl_android_send_action_frame()
2819 af_params->channel = tmp_channel; in wl_android_send_action_frame()
2820 af_params->dwell_time = params->dwell_time; in wl_android_send_action_frame()
2821 memcpy(&af_params->BSSID, &tmp_bssid, ETHER_ADDR_LEN); in wl_android_send_action_frame()
2822 action_frame = &af_params->action_frame; in wl_android_send_action_frame()
2824 action_frame->packetId = 0; in wl_android_send_action_frame()
2825 memcpy(&action_frame->da, &tmp_bssid, ETHER_ADDR_LEN); in wl_android_send_action_frame()
2826 action_frame->len = (uint16)params->len; in wl_android_send_action_frame()
2827 memcpy(action_frame->data, params->data, action_frame->len); in wl_android_send_action_frame()
2838 MFREE(cfg->osh, af_params, WL_WIFI_AF_PARAMS_SIZE); in wl_android_send_action_frame()
2842 MFREE(cfg->osh, smbuf, WLC_IOCTL_MAXLEN); in wl_android_send_action_frame()
2846 return -1; in wl_android_send_action_frame()
2870 if (bcm_ether_atoe((const char *)params->bssid, in wl_android_reassoc()
2876 if (params->channel < 0) { in wl_android_reassoc()
2877 ANDROID_ERROR(("Invalid Channel %d\n", params->channel)); in wl_android_reassoc()
2883 channel = params->channel; in wl_android_reassoc()
2920 return -1; in wl_android_set_wes_mode()
2927 return -1; in wl_android_set_wes_mode()
3015 return -1; in wl_android_set_pmk()
3021 return -1; in wl_android_set_pmk()
3025 DHD_STATLOG_CTRL(dhdp, ST(INSTALL_OKC_PMK), dhd_net2idx(dhdp->info, dev), 0); in wl_android_set_pmk()
3047 okc_enable = command[strlen(CMD_OKC_ENABLE) + 1] - '0'; in wl_android_okc_enable()
3081 if (cfg->ncho_mode == ON) { in wl_android_legacy_private_command()
3155 ANDROID_ERROR(("Unknown NCHO PRIVATE command %s - ignored\n", command)); in wl_android_legacy_private_command()
3186 if (cfg->ncho_mode == OFF) { in wl_android_ncho_private_command()
3314 ANDROID_ERROR(("Unknown NCHO PRIVATE command %s - ignored\n", command)); in wl_android_ncho_private_command()
3341 error = -1; in wl_android_default_set_scan_params()
3353 error = -1; in wl_android_default_set_scan_params()
3389 prcroam = (wlc_rcroam_t *)MALLOCZ(dhdp->osh, rcroamlen); in wl_android_rcroam_turn_on()
3402 if (prcroam->ver != WLC_RC_ROAM_CUR_VER) { in wl_android_rcroam_turn_on()
3405 prcroam->ver, WLC_RC_ROAM_CUR_VER, ret)); in wl_android_rcroam_turn_on()
3410 rcroam = (wlc_rcroam_info_v1_t *)prcroam->data; in wl_android_rcroam_turn_on()
3411 prcroam->ver = WLC_RC_ROAM_CUR_VER; in wl_android_rcroam_turn_on()
3412 prcroam->len = sizeof(*rcroam); in wl_android_rcroam_turn_on()
3413 rcroam->enab = rcroam_enab; in wl_android_rcroam_turn_on()
3424 MFREE(dhdp->osh, prcroam, rcroamlen); in wl_android_rcroam_turn_on()
3437 dhdp->sroam_turn_on = sroam_mode; in wl_android_sroam_turn_on()
3465 psroam = (wlc_sroam_t *)MALLOCZ(dhdp->osh, sroamlen); in wl_android_sroam_set_info()
3472 psroam->ver = WLC_SILENT_ROAM_CUR_VER; in wl_android_sroam_set_info()
3473 psroam->len = sizeof(*sroam); in wl_android_sroam_set_info()
3474 sroam = (wlc_sroam_info_t *)psroam->data; in wl_android_sroam_set_info()
3476 sroam->sroam_on = FALSE; in wl_android_sroam_set_info()
3478 sroam->sroam_min_rssi = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3479 ANDROID_INFO(("1.Minimum RSSI %d\n", sroam->sroam_min_rssi)); in wl_android_sroam_set_info()
3483 sroam->sroam_rssi_range = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3484 ANDROID_INFO(("2.RSSI Range %d\n", sroam->sroam_rssi_range)); in wl_android_sroam_set_info()
3488 sroam->sroam_score_delta = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3489 ANDROID_INFO(("3.Score Delta %d\n", sroam->sroam_score_delta)); in wl_android_sroam_set_info()
3493 sroam->sroam_period_time = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3494 ANDROID_INFO(("4.Sroam period %d\n", sroam->sroam_period_time)); in wl_android_sroam_set_info()
3498 sroam->sroam_band = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3499 ANDROID_INFO(("5.Sroam Band %d\n", sroam->sroam_band)); in wl_android_sroam_set_info()
3503 sroam->sroam_inact_cnt = simple_strtol(data, &data, 10); in wl_android_sroam_set_info()
3504 ANDROID_INFO(("6.Inactivity Count %d\n", sroam->sroam_inact_cnt)); in wl_android_sroam_set_info()
3521 MFREE(dhdp->osh, psroam, sroamlen); in wl_android_sroam_set_info()
3537 psroam = (wlc_sroam_t *)MALLOCZ(dhdp->osh, sroamlen); in wl_android_sroam_get_info()
3550 if (psroam->ver != WLC_SILENT_ROAM_CUR_VER) { in wl_android_sroam_get_info()
3553 psroam->ver, WLC_SILENT_ROAM_CUR_VER, ret)); in wl_android_sroam_get_info()
3557 sroam = (wlc_sroam_info_t *)psroam->data; in wl_android_sroam_get_info()
3560 CMD_SROAM_GET_INFO, sroam->sroam_on, sroam->sroam_min_rssi, sroam->sroam_rssi_range, in wl_android_sroam_get_info()
3561 sroam->sroam_score_delta, sroam->sroam_period_time, sroam->sroam_band, in wl_android_sroam_get_info()
3562 sroam->sroam_inact_cnt); in wl_android_sroam_get_info()
3568 MFREE(dhdp->osh, psroam, sroamlen); in wl_android_sroam_get_info()
3584 prio_roam = (wl_prio_roam_prof_v1_t *)MALLOCZ(dhdp->osh, buf_len); in wl_android_priority_roam_enable()
3596 } else if (prio_roam->version != WL_PRIO_ROAM_PROF_V1) { in wl_android_priority_roam_enable()
3599 } else if (prio_roam->prio_roam_mode == mode) { in wl_android_priority_roam_enable()
3604 prio_roam->version = WL_PRIO_ROAM_PROF_V1; in wl_android_priority_roam_enable()
3605 prio_roam->length = sizeof(wl_prio_roam_prof_v1_t); in wl_android_priority_roam_enable()
3606 prio_roam->prio_roam_mode = mode; in wl_android_priority_roam_enable()
3617 MFREE(dhdp->osh, prio_roam, sizeof(wl_prio_roam_prof_v1_t)); in wl_android_priority_roam_enable()
3715 if (val == (uchar)-1) { in get_int_bytes()
3769 if ((bssidx = wl_get_bssidx_by_wdev(cfg, dev->ieee80211_ptr)) < 0) { in wl_android_set_disconnect_ies()
3771 ret = -EINVAL; in wl_android_set_disconnect_ies()
3858 int bytes_written = -1, ret = 0; in wl_cfg80211_get_sta_info()
3897 if (!(dhdp->op_mode & DHD_FLAG_HOSTAP_MODE)) { in wl_cfg80211_get_sta_info()
3898 ANDROID_ERROR(("unsupported op mode: %d\n", dhdp->op_mode)); in wl_cfg80211_get_sta_info()
3914 return -EINVAL; in wl_cfg80211_get_sta_info()
3925 return -EINVAL; in wl_cfg80211_get_sta_info()
3938 return -EINVAL; in wl_cfg80211_get_sta_info()
3942 iovar_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MAXLEN); in wl_cfg80211_get_sta_info()
3972 if (dtoh16(sta->ver) != WL_STA_VER_4) { in wl_cfg80211_get_sta_info()
3975 dtoh16(sta->ver))); in wl_cfg80211_get_sta_info()
3988 cap = dtoh16(sta->cap); in wl_cfg80211_get_sta_info()
3989 rxrtry = dtoh32(sta->rx_pkts_retried); in wl_cfg80211_get_sta_info()
3990 rxmulti = dtoh32(sta->rx_mcast_pkts); in wl_cfg80211_get_sta_info()
3991 tx_pkts = dtoh32(sta->tx_pkts); in wl_cfg80211_get_sta_info()
3992 tx_failures = dtoh32(sta->tx_failures); in wl_cfg80211_get_sta_info()
3993 tx_rate = dtoh32(sta->tx_rate); in wl_cfg80211_get_sta_info()
3994 tx_pkts_retried = dtoh32(sta->tx_pkts_retried); in wl_cfg80211_get_sta_info()
3995 tx_pkts_retry_exhausted = dtoh32(sta->tx_pkts_retry_exhausted); in wl_cfg80211_get_sta_info()
3996 tx_pkts_total = dtoh32(sta->tx_pkts_total); in wl_cfg80211_get_sta_info()
3997 tx_pkts_retries = dtoh32(sta->tx_pkts_retries); in wl_cfg80211_get_sta_info()
3998 tx_pkts_fw_total = dtoh32(sta->tx_pkts_fw_total); in wl_cfg80211_get_sta_info()
3999 tx_pkts_fw_retries = dtoh32(sta->tx_pkts_fw_retries); in wl_cfg80211_get_sta_info()
4000 tx_pkts_fw_retry_exhausted = dtoh32(sta->tx_pkts_fw_retry_exhausted); in wl_cfg80211_get_sta_info()
4001 sta_flags = dtoh32(sta->flags); in wl_cfg80211_get_sta_info()
4012 rssi[cnt] = sta->rssi[cnt]; in wl_cfg80211_get_sta_info()
4013 rx_lastpkt_rssi[cnt] = sta->rx_lastpkt_rssi[cnt]; in wl_cfg80211_get_sta_info()
4019 assoc_maclist->count = htod32(MAX_NUM_OF_ASSOCLIST); in wl_cfg80211_get_sta_info()
4027 assoc_maclist->count = dtoh32(assoc_maclist->count); in wl_cfg80211_get_sta_info()
4028 ANDROID_INFO(("Assoc count : %d\n", assoc_maclist->count)); in wl_cfg80211_get_sta_info()
4030 for (i = 0; i < assoc_maclist->count; i++) { in wl_cfg80211_get_sta_info()
4033 (struct ether_addr *)assoc_maclist->ea[i].octet, ETHER_ADDR_LEN, in wl_cfg80211_get_sta_info()
4041 if (dtoh16(sta->ver) == WL_STA_VER_4) { in wl_cfg80211_get_sta_info()
4042 rxrtry += dtoh32(sta->rx_pkts_retried); in wl_cfg80211_get_sta_info()
4043 rxmulti += dtoh32(sta->rx_mcast_pkts); in wl_cfg80211_get_sta_info()
4044 tx_pkts += dtoh32(sta->tx_pkts); in wl_cfg80211_get_sta_info()
4045 tx_failures += dtoh32(sta->tx_failures); in wl_cfg80211_get_sta_info()
4046 tx_pkts_total += dtoh32(sta->tx_pkts_total); in wl_cfg80211_get_sta_info()
4047 tx_pkts_retries += dtoh32(sta->tx_pkts_retries); in wl_cfg80211_get_sta_info()
4048 tx_pkts_fw_total += dtoh32(sta->tx_pkts_fw_total); in wl_cfg80211_get_sta_info()
4049 tx_pkts_fw_retries += dtoh32(sta->tx_pkts_fw_retries); in wl_cfg80211_get_sta_info()
4051 dtoh32(sta->tx_pkts_fw_retry_exhausted); in wl_cfg80211_get_sta_info()
4067 MACOUI2STR((char*)&sta_data->mac), in wl_cfg80211_get_sta_info()
4068 sta_data->channel, wf_chspec_to_bw_str(sta_data->chanspec), in wl_cfg80211_get_sta_info()
4069 sta_data->rssi, sta_data->rate, sta_data->mode_80211, in wl_cfg80211_get_sta_info()
4070 sta_data->nss, sta_data->mimo, sta_data->reason_code, in wl_cfg80211_get_sta_info()
4083 MACOUI2STR((char*)&sta_data->mac), in wl_cfg80211_get_sta_info()
4084 sta_data->channel, wf_chspec_to_bw_str(sta_data->chanspec), in wl_cfg80211_get_sta_info()
4085 sta_data->rssi, sta_data->rate, sta_data->mode_80211, in wl_cfg80211_get_sta_info()
4086 sta_data->nss, sta_data->mimo, sta_data->reason_code, bands); in wl_cfg80211_get_sta_info()
4106 MFREE(cfg->osh, iovar_buf, WLC_IOCTL_MAXLEN); in wl_cfg80211_get_sta_info()
4109 MFREE(cfg->osh, if_stats, sizeof(*if_stats)); in wl_cfg80211_get_sta_info()
4120 * DRIVER SETWTCMODE 0 1 -80 -70 -65 -60
4122 * DRIVER SETWTCMODE 0 1 -80 -70 -65
4145 if (cfg->band_6g_supported) { in wl_android_wtc_config()
4150 wtc_params = (wlc_wtc_args_t*)MALLOCZ(cfg->osh, wtc_paramslen); in wl_android_wtc_config()
4153 return -ENOMEM; in wl_android_wtc_config()
4156 wtc_config = (wlc_wtcconfig_info_v1_t *)wtc_params->data; in wl_android_wtc_config()
4166 if (wtc_params->ver != WLC_WTC_ROAM_VER_1) { in wl_android_wtc_config()
4167 ANDROID_ERROR(("Wrong version:%d\n", wtc_params->ver)); in wl_android_wtc_config()
4168 bw = -EINVAL; in wl_android_wtc_config()
4172 if (wtc_params->len != sizeof(wlc_wtcconfig_info_v1_t)) { in wl_android_wtc_config()
4174 bw = -EINVAL; in wl_android_wtc_config()
4180 bw += scnprintf(command, (total_len - bw), "%u %u", in wl_android_wtc_config()
4181 wtc_config->mode, wtc_config->scantype); in wl_android_wtc_config()
4182 bw += scnprintf(command + bw, (total_len - bw), " %d", in wl_android_wtc_config()
4183 wtc_config->rssithresh[0]); in wl_android_wtc_config()
4185 bw += scnprintf(command + bw, (total_len - bw), " %d", in wl_android_wtc_config()
4186 wtc_config->ap_rssithresh[i]); in wl_android_wtc_config()
4188 bw += scnprintf(command + bw, (total_len - bw), "\n"); in wl_android_wtc_config()
4197 bw = -EINVAL; in wl_android_wtc_config()
4200 wtc_config->mode = (u8)bcm_atoi(token); in wl_android_wtc_config()
4206 bw = -EINVAL; in wl_android_wtc_config()
4209 wtc_config->scantype = (u8)bcm_atoi(token); in wl_android_wtc_config()
4215 bw = -EINVAL; in wl_android_wtc_config()
4219 wtc_config->rssithresh[i] = (s8)bcm_atoi(token); in wl_android_wtc_config()
4227 bw = -EINVAL; in wl_android_wtc_config()
4230 wtc_config->ap_rssithresh[i] = (s8)bcm_atoi(token); in wl_android_wtc_config()
4242 MFREE(cfg->osh, wtc_params, wtc_paramslen); in wl_android_wtc_config()
4296 dhdp->wbtext_policy = data; in wl_android_wbtext()
4305 return dhdp->wbtext_support; in wl_android_check_wbtext_support()
4432 len_remain -= strlen(CMD_WLS_BATCHING) + 1; in wls_parse_batching_cmd()
4503 batch_params.chan_list[i-1])); in wls_parse_batching_cmd()
4550 int res = -1; in wl_android_set_pno_setup()
4590 tlv_size_left = total_len - strlen(CMD_PNOSETUP_SET); in wl_android_set_pno_setup()
4595 if ((cmd_tlv_temp->prefix == PNO_TLV_PREFIX) && in wl_android_set_pno_setup()
4596 (cmd_tlv_temp->version == PNO_TLV_VERSION) && in wl_android_set_pno_setup()
4597 (cmd_tlv_temp->subtype == PNO_TLV_SUBTYPE_LEGACY_PNO)) { in wl_android_set_pno_setup()
4600 tlv_size_left -= sizeof(cmd_tlv_t); in wl_android_set_pno_setup()
4660 return -1; in wl_android_get_p2p_dev_addr()
4666 return -1; in wl_android_get_p2p_dev_addr()
4688 sizeof(int) + sizeof(struct ether_addr) * maclist->count)) != 0) { in wl_android_set_ap_mac_list()
4693 assoc_maclist->count = MAX_NUM_OF_ASSOCLIST; in wl_android_set_ap_mac_list()
4701 if (assoc_maclist->count) { in wl_android_set_ap_mac_list()
4703 for (i = 0; i < assoc_maclist->count; i++) { in wl_android_set_ap_mac_list()
4706 for (j = 0; j < maclist->count; j++) { in wl_android_set_ap_mac_list()
4709 MAC2STRDBG(assoc_maclist->ea[i].octet), in wl_android_set_ap_mac_list()
4710 MAC2STRDBG(maclist->ea[j].octet))); in wl_android_set_ap_mac_list()
4711 if (memcmp(assoc_maclist->ea[i].octet, in wl_android_set_ap_mac_list()
4712 maclist->ea[j].octet, ETHER_ADDR_LEN) == 0) { in wl_android_set_ap_mac_list()
4724 memcpy(&scbval.ea, &assoc_maclist->ea[i], in wl_android_set_ap_mac_list()
4762 return -1; in wl_android_set_mac_address_filter()
4768 return -1; in wl_android_set_mac_address_filter()
4773 return -1; in wl_android_set_mac_address_filter()
4780 return -1; in wl_android_set_mac_address_filter()
4783 list = (struct maclist*) MALLOCZ(cfg->osh, sizeof(int) + in wl_android_set_mac_address_filter()
4787 return -1; in wl_android_set_mac_address_filter()
4790 list->count = htod32(macnum); in wl_android_set_mac_address_filter()
4792 for (i = 0; i < list->count; i++) { in wl_android_set_mac_address_filter()
4796 ret = -EINVAL; in wl_android_set_mac_address_filter()
4800 if (!(ret = bcm_ether_atoe(eabuf, &list->ea[i]))) { in wl_android_set_mac_address_filter()
4804 list->count = i; in wl_android_set_mac_address_filter()
4808 i, list->count, eabuf)); in wl_android_set_mac_address_filter()
4819 MFREE(cfg->osh, list, sizeof(int) + sizeof(struct ether_addr) * macnum); in wl_android_set_mac_address_filter()
4835 MAC2STRDBG(bcmcfg_to_prmry_ndev(cfg)->perm_addr)); in wl_android_get_factory_mac_addr()
4847 return -EINVAL; in wl_android_wifi_accel_on()
4879 return -EINVAL; in wl_android_wifi_accel_off()
4910 return -EINVAL; in wl_android_wifi_on()
4914 WL_MSG(dev->name, "in g_wifi_on=%d\n", g_wifi_on); in wl_android_wifi_on()
4925 if (dhdp->dhd_induce_bh_error == DHD_INDUCE_BH_ON_FAIL_ONCE) { in wl_android_wifi_on()
4927 __FUNCTION__, dhdp->dhd_induce_bh_error)); in wl_android_wifi_on()
4931 dhdp->dhd_induce_bh_error = DHD_INDUCE_ERROR_CLEAR; in wl_android_wifi_on()
4933 if (dhdp->dhd_induce_bh_error == DHD_INDUCE_BH_ON_FAIL_ALWAYS) { in wl_android_wifi_on()
4935 __FUNCTION__, dhdp->dhd_induce_bh_error)); in wl_android_wifi_on()
4971 } while (retry-- > 0); in wl_android_wifi_on()
4984 WL_MSG(dev->name, "Failed %d\n", ret); in wl_android_wifi_on()
4986 WL_MSG(dev->name, "Success\n"); in wl_android_wifi_on()
4997 return -EINVAL; in wl_android_wifi_off()
5003 ANDROID_ERROR(("wl_android_wifi_off: - Debug UART App is running\n")); in wl_android_wifi_off()
5004 return -EBUSY; in wl_android_wifi_off()
5008 WL_MSG(dev->name, "in g_wifi_on=%d, on_failure=%d\n", g_wifi_on, on_failure); in wl_android_wifi_off()
5019 WL_MSG(dev->name, "out\n"); in wl_android_wifi_off()
5027 if ((strlen(command) - strlen(CMD_SETFWPATH)) > MOD_PARAM_PATHLEN) in wl_android_set_fwpath()
5028 return -1; in wl_android_set_fwpath()
5056 list->buflen = dtoh32(list->buflen); in wl_chanim_stats()
5057 list->version = dtoh32(list->version); in wl_chanim_stats()
5058 list->count = dtoh32(list->count); in wl_chanim_stats()
5060 if (list->buflen == 0) { in wl_chanim_stats()
5061 list->version = 0; in wl_chanim_stats()
5062 list->count = 0; in wl_chanim_stats()
5063 } else if (list->version != WL_CHANIM_STATS_VERSION) { in wl_chanim_stats()
5066 list->version, WL_CHANIM_STATS_VERSION)); in wl_chanim_stats()
5067 list->buflen = 0; in wl_chanim_stats()
5068 list->count = 0; in wl_chanim_stats()
5071 stats = list->stats; in wl_chanim_stats()
5072 stats->glitchcnt = dtoh32(stats->glitchcnt); in wl_chanim_stats()
5073 stats->badplcp = dtoh32(stats->badplcp); in wl_chanim_stats()
5074 stats->chanspec = dtoh16(stats->chanspec); in wl_chanim_stats()
5075 stats->timestamp = dtoh32(stats->timestamp); in wl_chanim_stats()
5076 stats->chan_idle = dtoh32(stats->chan_idle); in wl_chanim_stats()
5079 stats->chanspec, stats->glitchcnt, stats->badplcp, stats->chan_idle, in wl_chanim_stats()
5080 stats->timestamp)); in wl_chanim_stats()
5082 *chan_idle = stats->chan_idle; in wl_chanim_stats()
5103 int bytes_written = -1; in wl_android_get_connection_stats()
5125 if_stats = (wl_if_stats_t *)MALLOCZ(cfg->osh, sizeof(*if_stats)); in wl_android_get_connection_stats()
5153 ANDROID_ERROR(("counters error (%d) - size = %zu\n", ret, sizeof(wl_cnt_wlc_t))); in wl_android_get_connection_stats()
5169 output->txframe = dtoh32(wlc_cnt->txframe); in wl_android_get_connection_stats()
5170 output->txbyte = dtoh32(wlc_cnt->txbyte); in wl_android_get_connection_stats()
5171 output->txerror = dtoh32(wlc_cnt->txerror); in wl_android_get_connection_stats()
5172 output->rxframe = dtoh32(wlc_cnt->rxframe); in wl_android_get_connection_stats()
5173 output->rxbyte = dtoh32(wlc_cnt->rxbyte); in wl_android_get_connection_stats()
5174 output->txfail = dtoh32(wlc_cnt->txfail); in wl_android_get_connection_stats()
5175 output->txretry = dtoh32(wlc_cnt->txretry); in wl_android_get_connection_stats()
5176 output->txretrie = dtoh32(wlc_cnt->txretrie); in wl_android_get_connection_stats()
5177 output->txrts = dtoh32(wlc_cnt->txrts); in wl_android_get_connection_stats()
5178 output->txnocts = dtoh32(wlc_cnt->txnocts); in wl_android_get_connection_stats()
5179 output->txexptime = dtoh32(wlc_cnt->txexptime); in wl_android_get_connection_stats()
5183 if (dtoh16(if_stats->version) > WL_IF_STATS_T_VERSION) { in wl_android_get_connection_stats()
5187 WL_IF_STATS_T_VERSION, if_stats->version)); in wl_android_get_connection_stats()
5191 output->txframe = (uint32)dtoh64(if_stats->txframe); in wl_android_get_connection_stats()
5192 output->txbyte = (uint32)dtoh64(if_stats->txbyte); in wl_android_get_connection_stats()
5193 output->txerror = (uint32)dtoh64(if_stats->txerror); in wl_android_get_connection_stats()
5194 output->rxframe = (uint32)dtoh64(if_stats->rxframe); in wl_android_get_connection_stats()
5195 output->rxbyte = (uint32)dtoh64(if_stats->rxbyte); in wl_android_get_connection_stats()
5196 output->txfail = (uint32)dtoh64(if_stats->txfail); in wl_android_get_connection_stats()
5197 output->txretry = (uint32)dtoh64(if_stats->txretry); in wl_android_get_connection_stats()
5198 output->txretrie = (uint32)dtoh64(if_stats->txretrie); in wl_android_get_connection_stats()
5199 if (dtoh16(if_stats->length) > OFFSETOF(wl_if_stats_t, txexptime)) { in wl_android_get_connection_stats()
5200 output->txexptime = (uint32)dtoh64(if_stats->txexptime); in wl_android_get_connection_stats()
5201 output->txrts = (uint32)dtoh64(if_stats->txrts); in wl_android_get_connection_stats()
5202 output->txnocts = (uint32)dtoh64(if_stats->txnocts); in wl_android_get_connection_stats()
5204 output->txexptime = 0; in wl_android_get_connection_stats()
5205 output->txrts = 0; in wl_android_get_connection_stats()
5206 output->txnocts = 0; in wl_android_get_connection_stats()
5220 output->txrate = link_speed; in wl_android_get_connection_stats()
5223 if (wl_chanim_stats(dev, &(output->chan_idle)) < 0) { in wl_android_get_connection_stats()
5224 output->chan_idle = 0; in wl_android_get_connection_stats()
5232 MFREE(cfg->osh, if_stats, sizeof(*if_stats)); in wl_android_get_connection_stats()
5256 ret = -EINVAL; in wl_android_process_natoe_cmd()
5263 while (natoe_cmd->name != NULL) { in wl_android_process_natoe_cmd()
5264 if (strcmp(natoe_cmd->name, str) == 0) { in wl_android_process_natoe_cmd()
5266 if (natoe_cmd->handler) { in wl_android_process_natoe_cmd()
5269 ret = natoe_cmd->handler(dev, natoe_cmd, pcmd, &cmd_info); in wl_android_process_natoe_cmd()
5283 uint8 *command = cmd_info->command; in wlu_natoe_set_vars_cbfn()
5284 uint16 total_len = cmd_info->tot_len; in wlu_natoe_set_vars_cbfn()
5295 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
5305 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->sta_ip, buf); in wlu_natoe_set_vars_cbfn()
5307 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->sta_netmask, buf); in wlu_natoe_set_vars_cbfn()
5310 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->sta_router_ip, buf); in wlu_natoe_set_vars_cbfn()
5313 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->sta_dnsip, buf); in wlu_natoe_set_vars_cbfn()
5316 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->ap_ip, buf); in wlu_natoe_set_vars_cbfn()
5319 bcm_ip_ntoa((struct ipv4_addr *)&config_ips->ap_netmask, buf); in wlu_natoe_set_vars_cbfn()
5322 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
5332 dtoh16(ports_config->start_port_num)); in wlu_natoe_set_vars_cbfn()
5334 "number of ports: %d\n", dtoh16(ports_config->no_of_ports)); in wlu_natoe_set_vars_cbfn()
5335 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
5344 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
5352 cmd_info->bytes_written = bytes_written; in wlu_natoe_set_vars_cbfn()
5365 * --- common for all natoe get commands ----
5382 res = bcm_unpack_xtlv_buf(cmd_info, iocresp->data, iocresp->len, in wl_natoe_get_ioctl()
5386 res = cmd_info->bytes_written; in wl_natoe_get_ioctl()
5411 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_enable()
5414 return -ENOMEM; in wl_android_natoe_subcmd_enable()
5418 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_enable()
5421 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_enable()
5422 return -ENOMEM; in wl_android_natoe_subcmd_enable()
5426 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_enable()
5427 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_enable()
5428 natoe_ioc->len = htod16(WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_enable()
5429 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_enable()
5437 ret = -EINVAL; in wl_android_natoe_subcmd_enable()
5451 ret = -EINVAL; in wl_android_natoe_subcmd_enable()
5456 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_enable()
5457 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_enable()
5463 ret = -EINVAL; in wl_android_natoe_subcmd_enable()
5468 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_enable()
5469 MFREE(cfg->osh, natoe_ioc, iocsz); in wl_android_natoe_subcmd_enable()
5489 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ips()
5492 return -ENOMEM; in wl_android_natoe_subcmd_config_ips()
5496 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_config_ips()
5499 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ips()
5500 return -ENOMEM; in wl_android_natoe_subcmd_config_ips()
5504 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_config_ips()
5505 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_config_ips()
5506 natoe_ioc->len = htod16(WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_config_ips()
5507 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_config_ips()
5515 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
5527 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
5534 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
5541 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
5548 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
5555 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
5562 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
5571 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
5576 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_config_ips()
5577 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_config_ips()
5583 ret = -EINVAL; in wl_android_natoe_subcmd_config_ips()
5588 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ips()
5589 MFREE(cfg->osh, natoe_ioc, sizeof(*natoe_ioc) + WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_config_ips()
5609 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ports()
5612 return -ENOMEM; in wl_android_natoe_subcmd_config_ports()
5616 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_config_ports()
5619 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ports()
5620 return -ENOMEM; in wl_android_natoe_subcmd_config_ports()
5624 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_config_ports()
5625 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_config_ports()
5626 natoe_ioc->len = htod16(WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_config_ports()
5627 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_config_ports()
5635 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
5647 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
5655 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
5663 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
5671 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
5676 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_config_ports()
5677 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_config_ports()
5683 ret = -EINVAL; in wl_android_natoe_subcmd_config_ports()
5688 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_config_ports()
5689 MFREE(cfg->osh, natoe_ioc, sizeof(*natoe_ioc) + WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_config_ports()
5708 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_natoe_subcmd_dbg_stats()
5711 return -ENOMEM; in wl_android_natoe_subcmd_dbg_stats()
5715 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_dbg_stats()
5718 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MAXLEN); in wl_android_natoe_subcmd_dbg_stats()
5719 return -ENOMEM; in wl_android_natoe_subcmd_dbg_stats()
5723 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_dbg_stats()
5724 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_dbg_stats()
5725 natoe_ioc->len = htod16(WL_NATOE_DBG_STATS_BUFSZ); in wl_android_natoe_subcmd_dbg_stats()
5726 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_dbg_stats()
5734 ret = -EINVAL; in wl_android_natoe_subcmd_dbg_stats()
5748 ret = -EINVAL; in wl_android_natoe_subcmd_dbg_stats()
5753 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_dbg_stats()
5754 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_dbg_stats()
5760 ret = -EINVAL; in wl_android_natoe_subcmd_dbg_stats()
5765 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MAXLEN); in wl_android_natoe_subcmd_dbg_stats()
5766 MFREE(cfg->osh, natoe_ioc, sizeof(*natoe_ioc) + WL_NATOE_DBG_STATS_BUFSZ); in wl_android_natoe_subcmd_dbg_stats()
5785 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_tbl_cnt()
5788 return -ENOMEM; in wl_android_natoe_subcmd_tbl_cnt()
5792 natoe_ioc = (wl_natoe_ioc_t *)MALLOCZ(cfg->osh, iocsz); in wl_android_natoe_subcmd_tbl_cnt()
5795 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_tbl_cnt()
5796 return -ENOMEM; in wl_android_natoe_subcmd_tbl_cnt()
5800 natoe_ioc->version = htod16(WL_NATOE_IOCTL_VERSION); in wl_android_natoe_subcmd_tbl_cnt()
5801 natoe_ioc->id = htod16(cmd->id); in wl_android_natoe_subcmd_tbl_cnt()
5802 natoe_ioc->len = htod16(WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_tbl_cnt()
5803 pxtlv = (bcm_xtlv_t *)natoe_ioc->data; in wl_android_natoe_subcmd_tbl_cnt()
5811 ret = -EINVAL; in wl_android_natoe_subcmd_tbl_cnt()
5825 ret = -EINVAL; in wl_android_natoe_subcmd_tbl_cnt()
5830 natoe_ioc->len = (buflen_at_start - buflen); in wl_android_natoe_subcmd_tbl_cnt()
5831 iocsz = sizeof(*natoe_ioc) + natoe_ioc->len; in wl_android_natoe_subcmd_tbl_cnt()
5837 ret = -EINVAL; in wl_android_natoe_subcmd_tbl_cnt()
5842 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_natoe_subcmd_tbl_cnt()
5843 MFREE(cfg->osh, natoe_ioc, sizeof(*natoe_ioc) + WL_NATOE_IOC_BUFSZ); in wl_android_natoe_subcmd_tbl_cnt()
5866 ret = -EINVAL; in wl_android_process_mbo_cmd()
5873 while (mbo_cmd->name != NULL) { in wl_android_process_mbo_cmd()
5874 if (strnicmp(mbo_cmd->name, str, strlen(mbo_cmd->name)) == 0) { in wl_android_process_mbo_cmd()
5876 if (mbo_cmd->handler) { in wl_android_process_mbo_cmd()
5879 ret = mbo_cmd->handler(dev, mbo_cmd, pcmd, &cmd_info); in wl_android_process_mbo_cmd()
5898 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_send_wnm_notif()
5899 iov_buf->id = WL_MBO_CMD_SEND_NOTIF; in wl_android_send_wnm_notif()
5900 buflen = buflen_start = iov_buf_len - sizeof(bcm_iov_buf_t); in wl_android_send_wnm_notif()
5901 pxtlv = (uint8 *)&iov_buf->data[0]; in wl_android_send_wnm_notif()
5907 iov_buf->len = buflen_start - buflen; in wl_android_send_wnm_notif()
5908 iovlen = sizeof(bcm_iov_buf_t) + iov_buf->len; in wl_android_send_wnm_notif()
5921 uint8 *command = cmd_info->command; in wl_android_mbo_resp_parse_cbfn()
5922 uint16 total_len = cmd_info->tot_len; in wl_android_mbo_resp_parse_cbfn()
5929 return -EINVAL; in wl_android_mbo_resp_parse_cbfn()
5935 cmd_info->bytes_written = bytes_written; in wl_android_mbo_resp_parse_cbfn()
5960 iov_buf = (bcm_iov_buf_t *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_mbo_subcmd_cell_data_cap()
5962 ret = -ENOMEM; in wl_android_mbo_subcmd_cell_data_cap()
5966 iov_resp = (uint8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_mbo_subcmd_cell_data_cap()
5968 ret = -ENOMEM; in wl_android_mbo_subcmd_cell_data_cap()
5974 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_mbo_subcmd_cell_data_cap()
5975 iov_buf->id = WL_MBO_CMD_CELLULAR_DATA_CAP; in wl_android_mbo_subcmd_cell_data_cap()
5990 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
5992 if (p_resp->id == WL_MBO_CMD_CELLULAR_DATA_CAP) { in wl_android_mbo_subcmd_cell_data_cap()
5993 ret = bcm_unpack_xtlv_buf((void *)cmd_info, (uint8 *)p_resp->data, in wl_android_mbo_subcmd_cell_data_cap()
5994 p_resp->len, BCM_XTLV_OPTION_ALIGN32, in wl_android_mbo_subcmd_cell_data_cap()
5997 ret = cmd_info->bytes_written; in wl_android_mbo_subcmd_cell_data_cap()
6000 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
6001 ANDROID_ERROR(("Mismatch: resp id %d req id %d\n", p_resp->id, cmd->id)); in wl_android_mbo_subcmd_cell_data_cap()
6009 old_cell_cap = bcm_get_data_from_xtlv_buf((uint8 *)p_resp->data, p_resp->len, in wl_android_mbo_subcmd_cell_data_cap()
6017 buflen = buflen_start = WLC_IOCTL_MEDLEN - sizeof(bcm_iov_buf_t); in wl_android_mbo_subcmd_cell_data_cap()
6022 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
6025 pxtlv = (uint8 *)&iov_buf->data[0]; in wl_android_mbo_subcmd_cell_data_cap()
6031 iov_buf->len = buflen_start - buflen; in wl_android_mbo_subcmd_cell_data_cap()
6032 iovlen = sizeof(bcm_iov_buf_t) + iov_buf->len; in wl_android_mbo_subcmd_cell_data_cap()
6037 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
6040 /* Skip for CUSTOMER_HW4 - WNM notification in wl_android_mbo_subcmd_cell_data_cap()
6051 ret = -EINVAL; in wl_android_mbo_subcmd_cell_data_cap()
6058 MFREE(cfg->osh, iov_buf, WLC_IOCTL_MEDLEN); in wl_android_mbo_subcmd_cell_data_cap()
6061 MFREE(cfg->osh, iov_resp, WLC_IOCTL_MAXLEN); in wl_android_mbo_subcmd_cell_data_cap()
6070 uint8 *command = cmd_info->command + cmd_info->bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
6071 uint16 total_len = cmd_info->tot_len; in wl_android_mbo_non_pref_chan_parse_cbfn()
6074 ANDROID_INFO(("Total bytes written at begining %u\n", cmd_info->bytes_written)); in wl_android_mbo_non_pref_chan_parse_cbfn()
6078 return -EINVAL; in wl_android_mbo_non_pref_chan_parse_cbfn()
6086 cmd_info->bytes_written += bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
6094 cmd_info->bytes_written += bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
6102 cmd_info->bytes_written += bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
6110 cmd_info->bytes_written += bytes_written; in wl_android_mbo_non_pref_chan_parse_cbfn()
6116 ANDROID_INFO(("Total bytes written %u\n", cmd_info->bytes_written)); in wl_android_mbo_non_pref_chan_parse_cbfn()
6137 iov_buf = (bcm_iov_buf_t *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_mbo_subcmd_non_pref_chan()
6139 ret = -ENOMEM; in wl_android_mbo_subcmd_non_pref_chan()
6143 iov_resp = (uint8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MAXLEN); in wl_android_mbo_subcmd_non_pref_chan()
6145 ret = -ENOMEM; in wl_android_mbo_subcmd_non_pref_chan()
6152 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_mbo_subcmd_non_pref_chan()
6153 iov_buf->id = WL_MBO_CMD_LIST_CHAN_PREF; in wl_android_mbo_subcmd_non_pref_chan()
6166 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
6168 if (p_resp->id == WL_MBO_CMD_LIST_CHAN_PREF) { in wl_android_mbo_subcmd_non_pref_chan()
6169 ret = bcm_unpack_xtlv_buf((void *)cmd_info, (uint8 *)p_resp->data, in wl_android_mbo_subcmd_non_pref_chan()
6170 p_resp->len, BCM_XTLV_OPTION_ALIGN32, in wl_android_mbo_subcmd_non_pref_chan()
6173 ret = cmd_info->bytes_written; in wl_android_mbo_subcmd_non_pref_chan()
6176 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
6177 ANDROID_ERROR(("Mismatch: resp id %d req id %d\n", p_resp->id, cmd->id)); in wl_android_mbo_subcmd_non_pref_chan()
6187 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_mbo_subcmd_non_pref_chan()
6188 iov_buf->id = WL_MBO_CMD_DEL_CHAN_PREF; in wl_android_mbo_subcmd_non_pref_chan()
6189 iov_buf->len = 0; in wl_android_mbo_subcmd_non_pref_chan()
6190 iovlen = sizeof(bcm_iov_buf_t) + iov_buf->len; in wl_android_mbo_subcmd_non_pref_chan()
6195 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
6212 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
6217 pxtlv = (uint8 *)&iov_buf->data[0]; in wl_android_mbo_subcmd_non_pref_chan()
6242 ANDROID_ERROR(("len %u\n", (buflen_start - buflen))); in wl_android_mbo_subcmd_non_pref_chan()
6244 iov_buf->version = WL_MBO_IOV_VERSION; in wl_android_mbo_subcmd_non_pref_chan()
6245 iov_buf->id = WL_MBO_CMD_ADD_CHAN_PREF; in wl_android_mbo_subcmd_non_pref_chan()
6246 iov_buf->len = buflen_start - buflen; in wl_android_mbo_subcmd_non_pref_chan()
6247 iovlen = sizeof(bcm_iov_buf_t) + iov_buf->len; in wl_android_mbo_subcmd_non_pref_chan()
6252 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
6270 ret = -EINVAL; in wl_android_mbo_subcmd_non_pref_chan()
6276 MFREE(cfg->osh, iov_buf, WLC_IOCTL_MEDLEN); in wl_android_mbo_subcmd_non_pref_chan()
6279 MFREE(cfg->osh, iov_resp, WLC_IOCTL_MAXLEN); in wl_android_mbo_subcmd_non_pref_chan()
6298 return -1; in wl_android_set_ampdu_mpdu()
6305 return -1; in wl_android_set_ampdu_mpdu()
6338 if (cfg->escan_info.ndev == NULL) { in wl_android_set_auto_channel_scan_state()
6363 len -= sizeof(list->count); in wl_android_get_freq_list_chanspecs()
6369 if (len < sizeof(list->element[i])) in wl_android_get_freq_list_chanspecs()
6377 list->element[i] = chanspec; in wl_android_get_freq_list_chanspecs()
6378 len -= sizeof(list->element[i]); in wl_android_get_freq_list_chanspecs()
6388 list->element[0] = chanspec; in wl_android_get_freq_list_chanspecs()
6389 list->count = 1; in wl_android_get_freq_list_chanspecs()
6398 list->count = i; in wl_android_get_freq_list_chanspecs()
6400 if (list->count && sta_channel) { in wl_android_get_freq_list_chanspecs()
6405 chanspec = list->element[i-1]; in wl_android_get_freq_list_chanspecs()
6411 list->element[0] = in wl_android_get_freq_list_chanspecs()
6416 list->element[0] = chanspec; in wl_android_get_freq_list_chanspecs()
6419 list->count = 1; in wl_android_get_freq_list_chanspecs()
6444 sizeof(chanspec), buf, buflen, 0, &cfg->ioctl_buf_sync); in wl_android_get_band_chanspecs()
6452 for (i = 0, j = 0; i < dtoh32(list->count); i++) { in wl_android_get_band_chanspecs()
6453 if (!CHSPEC_IS20(list->element[i])) { in wl_android_get_band_chanspecs()
6456 chanspec = (chanspec_t) dtoh32(list->element[i]); in wl_android_get_band_chanspecs()
6477 list->element[j] = list->element[i]; in wl_android_get_band_chanspecs()
6478 ANDROID_INFO(("Adding chanspec in list : %x\n", list->element[j])); in wl_android_get_band_chanspecs()
6484 list->count = j; in wl_android_get_band_chanspecs()
6509 while (retry--) { in wl_android_get_best_channel()
6519 (CHAN_SEL_RETRY_COUNT - retry), ret, dtoh32(chosen))); in wl_android_get_best_channel()
6555 buf = (u8 *)MALLOC(cfg->osh, CHANSPEC_BUF_SIZE); in wl_android_get_best_channels()
6558 return -ENOMEM; in wl_android_get_best_channels()
6623 pos += snprintf(pos, total_len - (pos - cmd), "%04d ", channel); in wl_android_get_best_channels()
6626 pos += snprintf(pos, total_len - (pos - cmd), "%04d ", channel); in wl_android_get_best_channels()
6630 MFREE(cfg->osh, buf, CHANSPEC_BUF_SIZE); in wl_android_get_best_channels()
6639 return (pos - cmd); in wl_android_get_best_channels()
6768 return -EINVAL; in wl_android_set_auto_channel()
6829 WL_MSG(dev->name, "band=%d, sta_band=%d, channel=%d\n", band, sta_band, channel); in wl_android_set_auto_channel()
6865 reqbuf = (u8 *)MALLOCZ(cfg->osh, CHANSPEC_BUF_SIZE); in wl_android_set_auto_channel()
6868 return -ENOMEM; in wl_android_set_auto_channel()
6884 if (list->count == 1) { in wl_android_set_auto_channel()
6885 cfg->acs_chspec = (chanspec_t)list->element[0]; in wl_android_set_auto_channel()
6886 channel = wf_chspec_ctlchan((chanspec_t)list->element[0]); in wl_android_set_auto_channel()
6887 acs_band = CHSPEC_BAND((chanspec_t)list->element[0]); in wl_android_set_auto_channel()
6925 while (retry--) { in wl_android_set_auto_channel()
6936 cfg->acs_chspec = chosen; in wl_android_set_auto_channel()
6942 (APCS_MAX_RETRY - retry), ret, chosen, acs_band)); in wl_android_set_auto_channel()
6968 MFREE(cfg->osh, reqbuf, CHANSPEC_BUF_SIZE); in wl_android_set_auto_channel()
6992 err = -EINVAL; in wl_android_set_roam_vsie_enab()
6998 err = -ENODEV; in wl_android_set_roam_vsie_enab()
7002 roam_vsie_enable = cmd[(cmd_str_len + 1)] - '0'; in wl_android_set_roam_vsie_enab()
7028 return -1; in wl_android_get_roam_vsie_enab()
7033 return -1; in wl_android_get_roam_vsie_enab()
7039 return -1; in wl_android_get_roam_vsie_enab()
7060 err = -EINVAL; in wl_android_set_bcn_rpt_vsie_enab()
7066 err = -ENODEV; in wl_android_set_bcn_rpt_vsie_enab()
7070 bcn_vsie_enable = cmd[cmd_str_len + 1] - '0'; in wl_android_set_bcn_rpt_vsie_enab()
7096 return -1; in wl_android_get_bcn_rpt_vsie_enab()
7101 return -1; in wl_android_get_bcn_rpt_vsie_enab()
7107 return -1; in wl_android_get_bcn_rpt_vsie_enab()
7144 return -1; in wl_android_set_ssid()
7196 return -1; in wl_android_sta_diassoc()
7362 return -1; in wl_android_set_rmc_event()
7385 return -1; in wl_android_get_singlecore_scan()
7400 return -1; in wl_android_set_singlecore_scan()
7407 return -1; in wl_android_set_singlecore_scan()
7422 if (dbm < -1) { in wl_android_set_tx_power()
7424 return -EINVAL; in wl_android_set_tx_power()
7427 if (dbm == -1) in wl_android_set_tx_power()
7474 * -1 : HEAD SAR disabled in wl_android_set_sarlimit_txctrl()
7497 ANDROID_ERROR(("%s: Failed to get sar_enable - error (%d)\n", __FUNCTION__, err)); in wl_android_set_sarlimit_txctrl()
7516 ANDROID_ERROR(("%s: Failed to set sar_enable - error (%d)\n", __FUNCTION__, err)); in wl_android_set_sarlimit_txctrl()
7576 dhdp->tid_mode = mode; in wl_android_set_tid()
7577 dhdp->target_uid = uid; in wl_android_set_tid()
7578 dhdp->target_tid = prio; in wl_android_set_tid()
7584 dhdp->tid_mode = SET_TID_OFF; in wl_android_set_tid()
7585 dhdp->target_uid = 0; in wl_android_set_tid()
7586 dhdp->target_tid = 0; in wl_android_set_tid()
7590 dhdp->tid_mode, dhdp->target_uid, dhdp->target_tid)); in wl_android_set_tid()
7608 dhdp->tid_mode, dhdp->target_uid, dhdp->target_tid); in wl_android_get_tid()
7624 return -1; in wl_android_set_roam_mode()
7631 return -1; in wl_android_set_roam_mode()
7657 return -EINVAL; in wl_android_set_ibss_beacon_ouidata()
7662 return -EINVAL; in wl_android_set_ibss_beacon_ouidata()
7669 return -EINVAL; in wl_android_set_ibss_beacon_ouidata()
7685 return -EINVAL; in wl_android_set_ibss_beacon_ouidata()
7688 tot_len = (int)(sizeof(vndr_ie_setbuf_t) + (datalen - 1)); in wl_android_set_ibss_beacon_ouidata()
7689 vndr_ie = (vndr_ie_setbuf_t *)MALLOCZ(cfg->osh, tot_len); in wl_android_set_ibss_beacon_ouidata()
7692 return -ENOMEM; in wl_android_set_ibss_beacon_ouidata()
7695 strlcpy(vndr_ie->cmd, "add", sizeof(vndr_ie->cmd)); in wl_android_set_ibss_beacon_ouidata()
7697 /* Set the IE count - the buffer contains only 1 IE */ in wl_android_set_ibss_beacon_ouidata()
7699 memcpy((void *)&vndr_ie->vndr_ie_buffer.iecount, &iecount, sizeof(s32)); in wl_android_set_ibss_beacon_ouidata()
7703 memcpy((void *)&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].pktflag, &pktflag, in wl_android_set_ibss_beacon_ouidata()
7706 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()
7708 memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.oui, &ie_buf, in wl_android_set_ibss_beacon_ouidata()
7710 memcpy(&vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.data, in wl_android_set_ibss_beacon_ouidata()
7714 vndr_ie->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.len = (uchar) ielen; in wl_android_set_ibss_beacon_ouidata()
7716 ioctl_buf = (char *)MALLOC(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_set_ibss_beacon_ouidata()
7720 MFREE(cfg->osh, vndr_ie, tot_len); in wl_android_set_ibss_beacon_ouidata()
7722 return -ENOMEM; in wl_android_set_ibss_beacon_ouidata()
7725 if ((bssidx = wl_get_bssidx_by_wdev(cfg, dev->ieee80211_ptr)) < 0) { in wl_android_set_ibss_beacon_ouidata()
7731 WLC_IOCTL_MEDLEN, bssidx, &cfg->ioctl_buf_sync); in wl_android_set_ibss_beacon_ouidata()
7734 err = -EINVAL; in wl_android_set_ibss_beacon_ouidata()
7736 MFREE(cfg->osh, vndr_ie, tot_len); in wl_android_set_ibss_beacon_ouidata()
7745 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_set_ibss_beacon_ouidata()
7772 total_len_left = total_len - strlen(CMD_SET_ROAMPREF) + 1; in wl_android_set_roampref()
7777 return -1; in wl_android_set_roampref()
7782 total_len_left -= 3; in wl_android_set_roampref()
7786 return -1; in wl_android_set_roampref()
7803 total_len_left -= (num_akm_suites * WIDTH_AKM_SUITE); in wl_android_set_roampref()
7807 total_len_left -= 3; in wl_android_set_roampref()
7810 return -1; in wl_android_set_roampref()
7857 return -1; in wl_android_set_roampref()
7864 /* akm-ucipher-mcipher tuples in the format required for join_pref */ in wl_android_set_roampref()
7894 resume_cfg = (struct io_cfg *)MALLOCZ(cfg->osh, sizeof(struct io_cfg)); in wl_android_iolist_add()
7896 return -ENOMEM; in wl_android_iolist_add()
7898 if (config->iovar) { in wl_android_iolist_add()
7899 ret = wldev_iovar_getint(dev, config->iovar, &resume_cfg->param); in wl_android_iolist_add()
7902 __FUNCTION__, config->iovar)); in wl_android_iolist_add()
7906 ret = wldev_iovar_setint(dev, config->iovar, config->param); in wl_android_iolist_add()
7909 config->iovar, config->param)); in wl_android_iolist_add()
7913 resume_cfg->iovar = config->iovar; in wl_android_iolist_add()
7915 resume_cfg->arg = MALLOCZ(cfg->osh, config->len); in wl_android_iolist_add()
7916 if (!resume_cfg->arg) { in wl_android_iolist_add()
7917 ret = -ENOMEM; in wl_android_iolist_add()
7920 ret = wldev_ioctl_get(dev, config->ioctl, resume_cfg->arg, config->len); in wl_android_iolist_add()
7923 config->ioctl)); in wl_android_iolist_add()
7926 ret = wldev_ioctl_set(dev, config->ioctl + 1, config->arg, config->len); in wl_android_iolist_add()
7929 config->iovar, config->param)); in wl_android_iolist_add()
7932 if (config->ioctl + 1 == WLC_SET_PM) in wl_android_iolist_add()
7934 resume_cfg->ioctl = config->ioctl; in wl_android_iolist_add()
7935 resume_cfg->len = config->len; in wl_android_iolist_add()
7939 list_add(&resume_cfg->list, head); in wl_android_iolist_add()
7943 MFREE(cfg->osh, resume_cfg->arg, config->len); in wl_android_iolist_add()
7944 MFREE(cfg->osh, resume_cfg, sizeof(struct io_cfg)); in wl_android_iolist_add()
7959 if (config->iovar) { in wl_android_iolist_resume()
7961 ret = wldev_iovar_setint(dev, config->iovar, in wl_android_iolist_resume()
7962 config->param); in wl_android_iolist_resume()
7965 ret = wldev_ioctl_set(dev, config->ioctl + 1, in wl_android_iolist_resume()
7966 config->arg, config->len); in wl_android_iolist_resume()
7967 if (config->ioctl + 1 == WLC_SET_PM) in wl_android_iolist_resume()
7969 MFREE(cfg->osh, config->arg, config->len); in wl_android_iolist_resume()
7972 MFREE(cfg->osh, config, sizeof(struct io_cfg)); in wl_android_iolist_resume()
7985 return -1; in wl_android_set_miracast()
8177 int ret = -1; in wl_netlink_send_msg()
8199 nlh->nlmsg_seq = seq; in wl_netlink_send_msg()
8200 nlh->nlmsg_type = type; in wl_netlink_send_msg()
8222 return -1; in wl_android_set_ibss_txfail_event()
8267 return -1; in wl_android_get_ibss_peer_info()
8272 return -1; in wl_android_get_ibss_peer_info()
8276 if ((buf = MALLOC(cfg->osh, WLC_IOCTL_MAXLEN)) == NULL) { in wl_android_get_ibss_peer_info()
8278 return -1; in wl_android_get_ibss_peer_info()
8284 MFREE(cfg->osh, buf, WLC_IOCTL_MAXLEN); in wl_android_get_ibss_peer_info()
8285 return -1; in wl_android_get_ibss_peer_info()
8305 ANDROID_INFO(("index:%d rssi:%d, tx:%u, rx:%u\n", i, peer_info->rssi, in wl_android_get_ibss_peer_info()
8306 peer_info->tx_rate, peer_info->rx_rate)); in wl_android_get_ibss_peer_info()
8309 memcmp(&mac_ea, &peer_info->ea, sizeof(struct ether_addr)) == 0) { in wl_android_get_ibss_peer_info()
8315 total_len - bytes_written, in wl_android_get_ibss_peer_info()
8316 MACF" %u %d ", ETHER_TO_MACF(peer_info->ea), in wl_android_get_ibss_peer_info()
8317 peer_info->tx_rate/1000, peer_info->rssi); in wl_android_get_ibss_peer_info()
8322 bytes_written = -1; in wl_android_get_ibss_peer_info()
8339 MFREE(cfg->osh, buf, WLC_IOCTL_MAXLEN); in wl_android_get_ibss_peer_info()
8360 (MAX_IBSS_ROUTE_TBL_ENTRY - 1) * sizeof(ibss_route_entry_t); in wl_android_set_ibss_routetable()
8361 route_tbl = (ibss_route_tbl_t *)MALLOCZ(cfg->osh, route_tbl_len); in wl_android_set_ibss_routetable()
8364 return -ENOMEM; in wl_android_set_ibss_routetable()
8366 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_set_ibss_routetable()
8370 MFREE(cfg->osh, route_tbl, route_tbl_len); in wl_android_set_ibss_routetable()
8372 return -ENOMEM; in wl_android_set_ibss_routetable()
8383 err = -EINVAL; in wl_android_set_ibss_routetable()
8389 err = -EINVAL; in wl_android_set_ibss_routetable()
8394 err = -EINVAL; in wl_android_set_ibss_routetable()
8399 route_tbl->num_entry = entries; in wl_android_set_ibss_routetable()
8405 err = -EINVAL; in wl_android_set_ibss_routetable()
8412 err = -EINVAL; in wl_android_set_ibss_routetable()
8415 bcopy(&dipaddr, &route_tbl->route_entry[i].ipv4_addr, IPV4_ADDR_LEN); in wl_android_set_ibss_routetable()
8416 bcopy(&ea, &route_tbl->route_entry[i].nexthop, ETHER_ADDR_LEN); in wl_android_set_ibss_routetable()
8420 ((!entries?0:(entries - 1)) * sizeof(ibss_route_entry_t)); in wl_android_set_ibss_routetable()
8425 err = -EINVAL; in wl_android_set_ibss_routetable()
8430 MFREE(cfg->osh, route_tbl, sizeof(ibss_route_tbl_t) + in wl_android_set_ibss_routetable()
8431 (MAX_IBSS_ROUTE_TBL_ENTRY - 1) * sizeof(ibss_route_entry_t)); in wl_android_set_ibss_routetable()
8434 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_android_set_ibss_routetable()
8450 {PRIO_8021D_VO, PRIO_8021D_NC}, /* AC_VO - 3 */ in wl_android_set_ibss_ampdu()
8451 {PRIO_8021D_CL, PRIO_8021D_VI}, /* AC_VI - 2 */ in wl_android_set_ibss_ampdu()
8452 {PRIO_8021D_BK, PRIO_8021D_NONE}, /* AC_BK - 1 */ in wl_android_set_ibss_ampdu()
8453 {PRIO_8021D_BE, PRIO_8021D_EE}}; /* AC_BE - 0 */ in wl_android_set_ibss_ampdu()
8470 return -EINVAL; in wl_android_set_ibss_ampdu()
8475 return -EINVAL; in wl_android_set_ibss_ampdu()
8506 return -EINVAL; in wl_android_set_ibss_antenna()
8514 return -EINVAL; in wl_android_set_ibss_antenna()
8536 return -1; in wl_keep_alive_set()
8540 return -EINVAL; in wl_keep_alive_set()
8554 buf = (char *)MALLOC(dhd->osh, WLC_IOCTL_SMLEN); in wl_keep_alive_set()
8565 MFREE(dhd->osh, buf, WLC_IOCTL_SMLEN); in wl_keep_alive_set()
8580 return -1; in wl_android_get_wfdie_resp()
8597 return -1; in wl_android_set_wfdie_resp()
8627 int bytes_written, error, result = 0, single_stream, stf = -1, i, nss = 0, mcs_map; in wl_android_get_link_status()
8636 return -1; in wl_android_get_link_status()
8645 return -1; in wl_android_get_link_status()
8651 if (bi->BSSID.octet[i] > 0) { in wl_android_get_link_status()
8658 return -1; in wl_android_get_link_status()
8662 if (bi->vht_cap) { in wl_android_get_link_status()
8663 if (CHSPEC_IS5G(bi->chanspec)) { in wl_android_get_link_status()
8672 return -1; in wl_android_get_link_status()
8684 if (i == MAX_STREAMS_SUPPORTED-1) { in wl_android_get_link_status()
8687 if (bi->basic_mcs[i] & bitmap) { in wl_android_get_link_status()
8695 mcs_map = VHT_MCS_MAP_GET_MCS_PER_SS(i, dtoh16(bi->vht_rxmcsmap)); in wl_android_get_link_status()
8709 * HT rates for mcs 0-7 are single stream. in wl_android_get_link_status()
8729 if (CHSPEC_IS5G(bi->chanspec)) { in wl_android_get_link_status()
8768 if (!cfg || !cfg->p2p) { in wl_cfg80211_p2plo_deinit()
8769 ANDROID_ERROR(("Wl %p or cfg->p2p %p is null\n", in wl_cfg80211_p2plo_deinit()
8770 cfg, cfg ? cfg->p2p : 0)); in wl_cfg80211_p2plo_deinit()
8774 dhd = (dhd_pub_t *)(cfg->pub); in wl_cfg80211_p2plo_deinit()
8775 if (!dhd->up) { in wl_cfg80211_p2plo_deinit()
8783 cfg->ioctl_buf, WLC_IOCTL_SMLEN, bssidx, &cfg->ioctl_buf_sync); in wl_cfg80211_p2plo_deinit()
8796 int ret = -EAGAIN; in wl_cfg80211_p2plo_listen_start()
8835 ret = -EAGAIN; in wl_cfg80211_p2plo_listen_start()
8846 ret = -EAGAIN; in wl_cfg80211_p2plo_listen_start()
8851 sizeof(channel), cfg->ioctl_buf, WLC_IOCTL_SMLEN, in wl_cfg80211_p2plo_listen_start()
8852 bssidx, &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_p2plo_listen_start()
8858 sizeof(wl_p2plo_listen_t), cfg->ioctl_buf, WLC_IOCTL_SMLEN, in wl_cfg80211_p2plo_listen_start()
8859 bssidx, &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_p2plo_listen_start()
8873 int ret = -EAGAIN; in wl_cfg80211_p2plo_listen_stop()
8876 0, cfg->ioctl_buf, WLC_IOCTL_SMLEN, in wl_cfg80211_p2plo_listen_stop()
8877 bssidx, &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_p2plo_listen_stop()
8899 ret = -EINVAL; in wl_cfg80211_p2plo_offload()
8920 cfg->last_roc_id, in wl_cfg80211_cancel_p2plo()
8921 &cfg->remain_on_chan, GFP_KERNEL); in wl_cfg80211_cancel_p2plo()
8924 cfg->last_roc_id, in wl_cfg80211_cancel_p2plo()
8925 &cfg->remain_on_chan, in wl_cfg80211_cancel_p2plo()
8926 cfg->remain_on_chan_type, GFP_KERNEL); in wl_cfg80211_cancel_p2plo()
8946 return -EINVAL; in wl_android_murx_bfe_cap()
9004 return -EINVAL; in wl_android_get_rssi_per_ant()
9019 /* Optional: Check the MIMO RSSI mode - RSSI sum across antennas */ in wl_android_get_rssi_per_ant()
9071 return -EINVAL; in wl_android_set_rssi_logging()
9079 return -EINVAL; in wl_android_set_rssi_logging()
9087 return -EINVAL; in wl_android_set_rssi_logging()
9141 bytes_written = snprintf(command, total_len, "%s FAIL - RSSI Threshold " in wl_android_get_rssi_logging()
9148 bytes_written = snprintf(command, total_len, "%s BUSY - NOT READY\n", in wl_android_get_rssi_logging()
9179 return -EIO; in wl_android_lqcm_enable()
9194 return -EIO; in wl_android_get_lqcm_report()
9219 return -EIO; in wl_android_get_snr()
9247 return -EINVAL; in wl_android_set_ap_beaconrate()
9253 return -EINVAL; in wl_android_set_ap_beaconrate()
9282 return -EINVAL; in wl_android_get_ap_basicrate()
9290 return -EPROTO; in wl_android_get_ap_basicrate()
9316 return -EINVAL; in wl_android_get_ap_rps()
9325 return -EPROTO; in wl_android_get_ap_rps()
9352 return -EINVAL; in wl_android_set_ap_rps()
9358 return -EINVAL; in wl_android_set_ap_rps()
9393 return -EINVAL; in wl_android_set_ap_rps_params()
9399 return -EINVAL; in wl_android_set_ap_rps_params()
9405 return -EINVAL; in wl_android_set_ap_rps_params()
9411 return -EINVAL; in wl_android_set_ap_rps_params()
9417 return -EINVAL; in wl_android_set_ap_rps_params()
9463 memdump_mode = dhdp->memdump_enabled; in wl_android_check_priv_cmd_errors()
9484 dhdp->memdump_type = DUMP_TYPE_SEQUENTIAL_PRIVCMD_ERROR; in wl_android_check_priv_cmd_errors()
9488 dhdp->hang_reason = HANG_REASON_SEQUENTIAL_PRIVCMD_ERROR; in wl_android_check_priv_cmd_errors()
9489 dhd_os_check_hang(dhdp, 0, -EREMOTEIO); in wl_android_check_priv_cmd_errors()
9503 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_enable()
9505 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_enable()
9506 return -EINVAL; in wl_android_pktlog_filter_enable()
9509 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_enable()
9534 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_disable()
9536 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_disable()
9537 return -EINVAL; in wl_android_pktlog_filter_disable()
9540 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_disable()
9565 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_pattern_enable()
9567 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_pattern_enable()
9568 return -EINVAL; in wl_android_pktlog_filter_pattern_enable()
9571 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_pattern_enable()
9599 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_pattern_disable()
9601 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_pattern_disable()
9602 return -EINVAL; in wl_android_pktlog_filter_pattern_disable()
9605 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_pattern_disable()
9633 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_add()
9635 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_add()
9636 return -EINVAL; in wl_android_pktlog_filter_add()
9639 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_add()
9666 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_del()
9668 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_del()
9669 return -EINVAL; in wl_android_pktlog_filter_del()
9672 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_del()
9700 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_info()
9702 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_info()
9703 return -EINVAL; in wl_android_pktlog_filter_info()
9706 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_info()
9727 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_start()
9729 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_start()
9730 return -EINVAL; in wl_android_pktlog_start()
9733 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_start()
9735 __FUNCTION__, dhdp->pktlog->pktlog_ring)); in wl_android_pktlog_start()
9736 return -EINVAL; in wl_android_pktlog_start()
9739 atomic_set(&dhdp->pktlog->pktlog_ring->start, TRUE); in wl_android_pktlog_start()
9754 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_stop()
9756 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_stop()
9757 return -EINVAL; in wl_android_pktlog_stop()
9760 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_stop()
9762 __FUNCTION__, dhdp->pktlog->pktlog_ring)); in wl_android_pktlog_stop()
9763 return -EINVAL; in wl_android_pktlog_stop()
9766 atomic_set(&dhdp->pktlog->pktlog_ring->start, FALSE); in wl_android_pktlog_stop()
9784 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_filter_exist()
9786 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_filter_exist()
9787 return -EINVAL; in wl_android_pktlog_filter_exist()
9790 filter = dhdp->pktlog->pktlog_filter; in wl_android_pktlog_filter_exist()
9816 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_minmize_enable()
9818 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_minmize_enable()
9819 return -EINVAL; in wl_android_pktlog_minmize_enable()
9822 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_minmize_enable()
9824 __FUNCTION__, dhdp->pktlog->pktlog_ring)); in wl_android_pktlog_minmize_enable()
9825 return -EINVAL; in wl_android_pktlog_minmize_enable()
9828 dhdp->pktlog->pktlog_ring->pktlog_minmize = TRUE; in wl_android_pktlog_minmize_enable()
9843 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_minmize_disable()
9845 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_minmize_disable()
9846 return -EINVAL; in wl_android_pktlog_minmize_disable()
9849 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_minmize_disable()
9851 __FUNCTION__, dhdp->pktlog->pktlog_ring)); in wl_android_pktlog_minmize_disable()
9852 return -EINVAL; in wl_android_pktlog_minmize_disable()
9855 dhdp->pktlog->pktlog_ring->pktlog_minmize = FALSE; in wl_android_pktlog_minmize_disable()
9872 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_change_size()
9874 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_change_size()
9875 return -EINVAL; in wl_android_pktlog_change_size()
9884 dhdp->pktlog->pktlog_ring = in wl_android_pktlog_change_size()
9885 dhd_pktlog_ring_change_size(dhdp->pktlog->pktlog_ring, size); in wl_android_pktlog_change_size()
9886 if (!dhdp->pktlog->pktlog_ring) { in wl_android_pktlog_change_size()
9908 if (!dhdp || !dhdp->pktlog) { in wl_android_pktlog_dbg_dump()
9910 __FUNCTION__, dhdp, (dhdp ? dhdp->pktlog : NULL))); in wl_android_pktlog_dbg_dump()
9911 return -EINVAL; in wl_android_pktlog_dbg_dump()
10007 return -EINVAL; in wl_android_ewp_filter()
10022 &command[bytes_written], tot_len - bytes_written, index1, index2, index3); in wl_android_ewp_filter()
10028 &command[bytes_written], tot_len - bytes_written, type); in wl_android_ewp_filter()
10056 return -EINVAL; in wl_android_set_ap_suspend()
10063 return -EINVAL; in wl_android_set_ap_suspend()
10093 * in 8.4.1.50 of 802.11ac-2013 in wl_android_set_ap_bw()
10103 return -EINVAL; in wl_android_set_ap_bw()
10110 return -EINVAL; in wl_android_set_ap_bw()
10137 * in 8.4.1.50 of 802.11ac-2013 in wl_android_get_ap_bw()
10147 return -EINVAL; in wl_android_get_ap_bw()
10157 return -EPROTO; in wl_android_get_ap_bw()
10196 ret = -EPERM; in wl_android_priv_cmd()
10200 if (!ifr->ifr_data) { in wl_android_priv_cmd()
10201 ret = -EINVAL; in wl_android_priv_cmd()
10213 if (copy_from_user(&compat_priv_cmd, ifr->ifr_data, in wl_android_priv_cmd()
10215 ret = -EFAULT; in wl_android_priv_cmd()
10225 if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(android_wifi_priv_cmd))) { in wl_android_priv_cmd()
10226 ret = -EFAULT; in wl_android_priv_cmd()
10233 ret = -EINVAL; in wl_android_priv_cmd()
10238 command = (char *)MALLOC(dhd->osh, (buf_size + 1)); in wl_android_priv_cmd()
10241 ret = -ENOMEM; in wl_android_priv_cmd()
10245 ret = -EFAULT; in wl_android_priv_cmd()
10252 command, ifr->ifr_name)); in wl_android_priv_cmd()
10255 ANDROID_INFO(("%s: Android private cmd \"%s\" on %s\n", __FUNCTION__, command, ifr->ifr_name)); in wl_android_priv_cmd()
10275 ret = -EFAULT; in wl_android_priv_cmd()
10304 MFREE(dhd->osh, command, (buf_size + 1)); in wl_android_priv_cmd()
10316 return -EPERM; in wl_android_set_adps_mode()
10325 return -EINVAL; in wl_android_set_adps_mode()
10331 return -EIO; in wl_android_set_adps_mode()
10367 return -EIO; in wl_android_get_adps_mode()
10370 data = (wl_adps_params_v1_t *) ptr->data; in wl_android_get_adps_mode()
10371 mode = data->mode; in wl_android_get_adps_mode()
10448 return -ENOMEM; in wl_android_bcnrecv_event()
10461 return -EINVAL; in wl_android_bcnrecv_event()
10518 cfg->bcnrecv_info.bcnrecv_state = BEACON_RECV_STARTED; in _wl_android_bcnrecv_start()
10520 user_trigger, ndev->ifindex)); in _wl_android_bcnrecv_start()
10560 cfg->bcnrecv_info.bcnrecv_state = BEACON_RECV_SUSPENDED; in _wl_android_bcnrecv_stop()
10563 cfg->bcnrecv_info.bcnrecv_state = BEACON_RECV_STOPPED; in _wl_android_bcnrecv_stop()
10565 reason, ndev->ifindex)); in _wl_android_bcnrecv_stop()
10586 mutex_lock(&cfg->scan_sync); in wl_android_bcnrecv_start()
10587 mutex_lock(&cfg->bcn_sync); in wl_android_bcnrecv_start()
10589 mutex_unlock(&cfg->bcn_sync); in wl_android_bcnrecv_start()
10590 mutex_unlock(&cfg->scan_sync); in wl_android_bcnrecv_start()
10600 mutex_lock(&cfg->bcn_sync); in wl_android_bcnrecv_stop()
10601 if ((cfg->bcnrecv_info.bcnrecv_state == BEACON_RECV_STARTED) || in wl_android_bcnrecv_stop()
10602 (cfg->bcnrecv_info.bcnrecv_state == BEACON_RECV_SUSPENDED)) { in wl_android_bcnrecv_stop()
10605 mutex_unlock(&cfg->bcn_sync); in wl_android_bcnrecv_stop()
10615 mutex_lock(&cfg->bcn_sync); in wl_android_bcnrecv_suspend()
10616 if (cfg->bcnrecv_info.bcnrecv_state == BEACON_RECV_STARTED) { in wl_android_bcnrecv_suspend()
10620 mutex_unlock(&cfg->bcn_sync); in wl_android_bcnrecv_suspend()
10631 mutex_lock(&cfg->scan_sync); in wl_android_bcnrecv_resume()
10632 mutex_lock(&cfg->bcn_sync); in wl_android_bcnrecv_resume()
10633 if (cfg->bcnrecv_info.bcnrecv_state == BEACON_RECV_SUSPENDED) { in wl_android_bcnrecv_resume()
10637 mutex_unlock(&cfg->bcn_sync); in wl_android_bcnrecv_resume()
10638 mutex_unlock(&cfg->scan_sync); in wl_android_bcnrecv_resume()
10651 return -EINVAL; in wl_android_bcnrecv_config()
10657 return -EINVAL; in wl_android_bcnrecv_config()
10661 mutex_lock(&cfg->usr_sync); in wl_android_bcnrecv_config()
10680 mutex_unlock(&cfg->usr_sync); in wl_android_bcnrecv_config()
10700 dhdp->permitted_gro = FALSE; in wl_android_set_latency_crt_data()
10703 dhdp->permitted_gro = TRUE; in wl_android_set_latency_crt_data()
10744 /* Using U-APSD as the default power save mode */ in wl_android_update_tsinfo()
10752 tspec_arg->tsinfo.octets[0] = (uint8)(TSPEC_EDCA_ACCESS | direction | in wl_android_update_tsinfo()
10754 tspec_arg->tsinfo.octets[1] = (uint8)((tspec_id << TSPEC_TSINFO_PRIO_SHIFT) | in wl_android_update_tsinfo()
10756 tspec_arg->tsinfo.octets[2] = 0x00; in wl_android_update_tsinfo()
10772 tspec_arg.length = sizeof(tspec_arg_t) - (2 * sizeof(uint16)); in wl_android_handle_cac_action()
10794 tspec_arg.length = sizeof(tspec_arg_t) - (2 * sizeof(uint16)); in wl_android_handle_cac_action()
10807 if ((bssidx = wl_get_bssidx_by_wdev(cfg, ndev->ieee80211_ptr)) < 0) { in wl_android_handle_cac_action()
10813 cfg->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &cfg->ioctl_buf_sync); in wl_android_handle_cac_action()
10829 return -EINVAL; in wl_android_cac_ts_config()
10835 return -EINVAL; in wl_android_cac_ts_config()
10840 ANDROID_ERROR(("Request on non-primary interface\n")); in wl_android_cac_ts_config()
10841 return -1; in wl_android_cac_ts_config()
10845 mutex_lock(&cfg->usr_sync); in wl_android_cac_ts_config()
10847 mutex_unlock(&cfg->usr_sync); in wl_android_cac_ts_config()
10909 * Disable :-1 in wl_android_set_softap_elna_bypass()
10920 return -EINVAL; in wl_android_set_softap_elna_bypass()
10928 return -EINVAL; in wl_android_set_softap_elna_bypass()
10964 return -EINVAL; in wl_android_get_softap_elna_bypass()
10974 softap_elnabypass--; //Convert format to Customer HW4 in wl_android_get_softap_elna_bypass()
11000 "EN:%d Role:%d EM:%d CID:"MACF" NMI:"MACF" SC(2G):%d SC(5G):%d " in wl_android_get_nan_status()
11098 err = -EINVAL; in wl_android_set_softap_ax_mode()
11104 err = -EINVAL; in wl_android_set_softap_ax_mode()
11112 err = -EINVAL; in wl_android_set_softap_ax_mode()
11116 if ((bssidx = wl_get_bssidx_by_wdev(cfg, dev->ieee80211_ptr)) < 0) { in wl_android_set_softap_ax_mode()
11118 err = -EINVAL; in wl_android_set_softap_ax_mode()
11142 err = -EINVAL; in wl_android_enable_p2p_6g()
11148 err = -EINVAL; in wl_android_enable_p2p_6g()
11152 if ((bssidx = wl_get_bssidx_by_wdev(cfg, dev->ieee80211_ptr)) < 0) { in wl_android_enable_p2p_6g()
11154 err = -EINVAL; in wl_android_enable_p2p_6g()
11164 cfg->p2p_6g_enabled = TRUE; in wl_android_enable_p2p_6g()
11166 cfg->p2p_6g_enabled = FALSE; in wl_android_enable_p2p_6g()
11206 bw = -EINVAL; in wl_android_twt_setup()
11225 bw = -EINVAL; in wl_android_twt_setup()
11239 bw = -EINVAL; in wl_android_twt_setup()
11266 else if (!strnicmp(token, "-d", 2)) { in wl_android_twt_setup()
11274 else if (!strnicmp(token, "-i", 2)) { in wl_android_twt_setup()
11282 else if (!strnicmp(token, "-f", 2)) { in wl_android_twt_setup()
11289 else if (!strnicmp(token, "-b", 2)) { in wl_android_twt_setup()
11295 else if (!strnicmp(token, "-r", 2)) { in wl_android_twt_setup()
11299 bw = -EINVAL; in wl_android_twt_setup()
11307 else if (!strnicmp(token, "-s", 2)) { in wl_android_twt_setup()
11315 else if (!strnicmp(token, "-v", 2)) { in wl_android_twt_setup()
11323 else if (!strnicmp(token, "-a", 2)) { in wl_android_twt_setup()
11328 bw = -EINVAL; in wl_android_twt_setup()
11343 mybuf, sizeof(mybuf) - rem_len, resp_buf, WLC_IOCTL_SMLEN, NULL); in wl_android_twt_setup()
11359 rem_len -= bytes_written; in wl_android_twt_display_cap()
11362 !!(result->device_cap & WL_TWT_CAP_FLAGS_REQ_SUPPORT)); in wl_android_twt_display_cap()
11364 rem_len -= bytes_written; in wl_android_twt_display_cap()
11367 !!(result->device_cap & WL_TWT_CAP_FLAGS_RESP_SUPPORT)); in wl_android_twt_display_cap()
11369 rem_len -= bytes_written; in wl_android_twt_display_cap()
11372 !!(result->device_cap & WL_TWT_CAP_FLAGS_BTWT_SUPPORT)); in wl_android_twt_display_cap()
11374 rem_len -= bytes_written; in wl_android_twt_display_cap()
11377 !!(result->device_cap & WL_TWT_CAP_FLAGS_FLEX_SUPPORT)); in wl_android_twt_display_cap()
11379 rem_len -= bytes_written; in wl_android_twt_display_cap()
11382 !!(result->device_cap & WL_TWT_CAP_FLAGS_TWT_REQUIRED)); in wl_android_twt_display_cap()
11384 rem_len -= bytes_written; in wl_android_twt_display_cap()
11389 rem_len -= bytes_written; in wl_android_twt_display_cap()
11392 !!(result->peer_cap & WL_TWT_CAP_FLAGS_REQ_SUPPORT)); in wl_android_twt_display_cap()
11394 rem_len -= bytes_written; in wl_android_twt_display_cap()
11397 !!(result->peer_cap & WL_TWT_CAP_FLAGS_RESP_SUPPORT)); in wl_android_twt_display_cap()
11399 rem_len -= bytes_written; in wl_android_twt_display_cap()
11402 !!(result->peer_cap & WL_TWT_CAP_FLAGS_BTWT_SUPPORT)); in wl_android_twt_display_cap()
11404 rem_len -= bytes_written; in wl_android_twt_display_cap()
11407 !!(result->peer_cap & WL_TWT_CAP_FLAGS_FLEX_SUPPORT)); in wl_android_twt_display_cap()
11409 rem_len -= bytes_written; in wl_android_twt_display_cap()
11412 !!(result->peer_cap & WL_TWT_CAP_FLAGS_TWT_REQUIRED)); in wl_android_twt_display_cap()
11414 rem_len -= bytes_written; in wl_android_twt_display_cap()
11416 bytes_written = scnprintf(command, rem_len, "\t------------" in wl_android_twt_display_cap()
11417 "---------------------------------------------------\n\n"); in wl_android_twt_display_cap()
11419 rem_len -= bytes_written; in wl_android_twt_display_cap()
11422 !!(result->device_cap & WL_TWT_CAP_FLAGS_REQ_SUPPORT))); in wl_android_twt_display_cap()
11424 !!(result->device_cap & WL_TWT_CAP_FLAGS_RESP_SUPPORT))); in wl_android_twt_display_cap()
11426 !!(result->device_cap & WL_TWT_CAP_FLAGS_BTWT_SUPPORT))); in wl_android_twt_display_cap()
11428 !!(result->device_cap & WL_TWT_CAP_FLAGS_FLEX_SUPPORT))); in wl_android_twt_display_cap()
11430 !!(result->device_cap & WL_TWT_CAP_FLAGS_TWT_REQUIRED))); in wl_android_twt_display_cap()
11434 !!(result->peer_cap & WL_TWT_CAP_FLAGS_REQ_SUPPORT))); in wl_android_twt_display_cap()
11436 !!(result->peer_cap & WL_TWT_CAP_FLAGS_RESP_SUPPORT))); in wl_android_twt_display_cap()
11438 !!(result->peer_cap & WL_TWT_CAP_FLAGS_BTWT_SUPPORT))); in wl_android_twt_display_cap()
11440 !!(result->peer_cap & WL_TWT_CAP_FLAGS_FLEX_SUPPORT))); in wl_android_twt_display_cap()
11442 !!(result->peer_cap & WL_TWT_CAP_FLAGS_TWT_REQUIRED))); in wl_android_twt_display_cap()
11443 ANDROID_INFO(("\t-----------------------------------------------------------------\n\n")); in wl_android_twt_display_cap()
11445 if ((total_len - rem_len) > 0) { in wl_android_twt_display_cap()
11446 return (total_len - rem_len); in wl_android_twt_display_cap()
11468 cmd_cap.length = sizeof(cmd_cap) - OFFSETOF(wl_twt_cap_cmd_t, peer); in wl_android_twt_cap()
11470 iovresp = (uint8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_twt_cap()
11486 if ((ret = wldev_iovar_getbuf(dev, "twt", iovbuf, bufstart-buflen, in wl_android_twt_cap()
11509 MFREE(cfg->osh, iovresp, WLC_IOCTL_MEDLEN); in wl_android_twt_cap()
11524 ANDROID_ERROR(("\nNumber of Individual TWTs: %d\n", status->num_fid)); in wl_android_twt_status_display_v1()
11526 "\nNumber of Individual TWTs: %d\n", status->num_fid); in wl_android_twt_status_display_v1()
11528 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11530 "Number of Broadcast TWTs: %d\n", status->num_bid); in wl_android_twt_status_display_v1()
11532 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11535 !!(status->status_flags & WL_TWT_STATUS_FLAG_SPPS_ENAB), in wl_android_twt_status_display_v1()
11536 !!(status->status_flags & WL_TWT_STATUS_FLAG_WAKE_STATE), in wl_android_twt_status_display_v1()
11537 !!(status->status_flags & WL_TWT_STATUS_FLAG_WAKE_OVERRIDE)); in wl_android_twt_status_display_v1()
11539 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11540 ANDROID_INFO(("Number of Broadcast TWTs: %d\n", status->num_bid)); in wl_android_twt_status_display_v1()
11542 !!(status->status_flags & WL_TWT_STATUS_FLAG_SPPS_ENAB), in wl_android_twt_status_display_v1()
11543 !!(status->status_flags & WL_TWT_STATUS_FLAG_WAKE_STATE), in wl_android_twt_status_display_v1()
11544 !!(status->status_flags & WL_TWT_STATUS_FLAG_WAKE_OVERRIDE))); in wl_android_twt_status_display_v1()
11545 ANDROID_INFO(("\t---------------- Individual TWT list-------------------\n")); in wl_android_twt_status_display_v1()
11547 "\t---------------- Individual TWT list-------------------\n"); in wl_android_twt_status_display_v1()
11549 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11552 if ((status->itwt_status[i].state == WL_TWT_ACTIVE) || in wl_android_twt_status_display_v1()
11553 (status->itwt_status[i].state == WL_TWT_SUSPEND)) { in wl_android_twt_status_display_v1()
11554 desc = &status->itwt_status[i].desc; in wl_android_twt_status_display_v1()
11556 desc->flow_id, in wl_android_twt_status_display_v1()
11557 status->itwt_status[i].state); in wl_android_twt_status_display_v1()
11559 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11563 ETHER_TO_MACF(status->itwt_status[i].peer)); in wl_android_twt_status_display_v1()
11565 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11570 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_UNANNOUNCED), in wl_android_twt_status_display_v1()
11571 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_TRIGGER), in wl_android_twt_status_display_v1()
11572 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_PROTECT), in wl_android_twt_status_display_v1()
11573 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_INFO_FRM_DISABLED)); in wl_android_twt_status_display_v1()
11575 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11579 desc->wake_time_h, desc->wake_time_l); in wl_android_twt_status_display_v1()
11581 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11584 "wake duration: %u\t", desc->wake_dur); in wl_android_twt_status_display_v1()
11586 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11589 "wake interval: %u\t", desc->wake_int); in wl_android_twt_status_display_v1()
11591 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11594 "TWT channel: %u\n", desc->channel); in wl_android_twt_status_display_v1()
11596 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11598 desc->flow_id, in wl_android_twt_status_display_v1()
11599 status->itwt_status[i].state)); in wl_android_twt_status_display_v1()
11600 ANDROID_INFO(("peer: "MACF"\n", ETHER_TO_MACF(status->itwt_status[i].peer))); in wl_android_twt_status_display_v1()
11603 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_UNANNOUNCED), in wl_android_twt_status_display_v1()
11604 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_TRIGGER), in wl_android_twt_status_display_v1()
11605 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_PROTECT), in wl_android_twt_status_display_v1()
11606 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_INFO_FRM_DISABLED))); in wl_android_twt_status_display_v1()
11608 desc->wake_time_h, desc->wake_time_l)); in wl_android_twt_status_display_v1()
11609 ANDROID_INFO(("wake duration: %u\t", desc->wake_dur)); in wl_android_twt_status_display_v1()
11610 ANDROID_INFO(("wake interval: %u\t", desc->wake_int)); in wl_android_twt_status_display_v1()
11611 ANDROID_INFO(("TWT channel: %u\n", desc->channel)); in wl_android_twt_status_display_v1()
11615 ANDROID_INFO(("\t---------------- Broadcast TWT list-------------------\n")); in wl_android_twt_status_display_v1()
11617 "\t---------------- Broadcast TWT list-------------------\n"); in wl_android_twt_status_display_v1()
11619 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11621 if ((status->btwt_status[i].state == WL_TWT_ACTIVE) || in wl_android_twt_status_display_v1()
11622 (status->btwt_status[i].state == WL_TWT_SUSPEND)) { in wl_android_twt_status_display_v1()
11623 desc = &status->btwt_status[i].desc; in wl_android_twt_status_display_v1()
11626 desc->bid, status->btwt_status[i].state); in wl_android_twt_status_display_v1()
11628 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11632 ETHER_TO_MACF(status->btwt_status[i].peer)); in wl_android_twt_status_display_v1()
11634 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11639 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_UNANNOUNCED), in wl_android_twt_status_display_v1()
11640 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_TRIGGER), in wl_android_twt_status_display_v1()
11641 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_PROTECT), in wl_android_twt_status_display_v1()
11642 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_INFO_FRM_DISABLED)); in wl_android_twt_status_display_v1()
11644 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11648 desc->frame_recomm, desc->btwt_persistence); in wl_android_twt_status_display_v1()
11650 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11654 desc->wake_time_h, desc->wake_time_l); in wl_android_twt_status_display_v1()
11656 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11658 "wake duration: %u\t", desc->wake_dur); in wl_android_twt_status_display_v1()
11660 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11663 "wake interval: %u\t", desc->wake_int); in wl_android_twt_status_display_v1()
11665 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11668 "TWT channel: %u\n", desc->channel); in wl_android_twt_status_display_v1()
11670 rem_len -= bytes_written; in wl_android_twt_status_display_v1()
11672 desc->bid, status->btwt_status[i].state)); in wl_android_twt_status_display_v1()
11673 ANDROID_INFO(("peer: "MACF"\n", ETHER_TO_MACF(status->btwt_status[i].peer))); in wl_android_twt_status_display_v1()
11676 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_UNANNOUNCED), in wl_android_twt_status_display_v1()
11677 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_TRIGGER), in wl_android_twt_status_display_v1()
11678 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_PROTECT), in wl_android_twt_status_display_v1()
11679 !!(desc->flow_flags & WL_TWT_FLOW_FLAG_INFO_FRM_DISABLED))); in wl_android_twt_status_display_v1()
11681 desc->frame_recomm, desc->btwt_persistence)); in wl_android_twt_status_display_v1()
11683 desc->wake_time_h, desc->wake_time_l)); in wl_android_twt_status_display_v1()
11684 ANDROID_INFO(("wake duration: %u\t", desc->wake_dur)); in wl_android_twt_status_display_v1()
11685 ANDROID_INFO(("wake interval: %u\t", desc->wake_int)); in wl_android_twt_status_display_v1()
11686 ANDROID_INFO(("TWT channel: %u\n", desc->channel)); in wl_android_twt_status_display_v1()
11690 if ((total_len - rem_len) > 0) { in wl_android_twt_status_display_v1()
11691 return (total_len - rem_len); in wl_android_twt_status_display_v1()
11713 status_cmd.length = sizeof(status_cmd) - OFFSETOF(wl_twt_status_cmd_v1_t, peer); in wl_android_twt_status_query()
11715 iovresp = (uint8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_twt_status_query()
11731 if ((ret = wldev_iovar_getbuf(dev, "twt", iovbuf, bufstart-buflen, in wl_android_twt_status_query()
11754 MFREE(cfg->osh, iovresp, WLC_IOCTL_MEDLEN); in wl_android_twt_status_query()
11777 bw = -EINVAL; in wl_android_twt_info()
11796 bw = -EINVAL; in wl_android_twt_info()
11809 if (val32 != -1) { in wl_android_twt_info()
11821 if ((val32 != -1) && ((int32)(htod32((u32)twt)) != -1)) { in wl_android_twt_info()
11848 mybuf, sizeof(mybuf) - rem_len, res_buf, WLC_IOCTL_SMLEN, NULL); in wl_android_twt_info()
11873 bw = -EINVAL; in wl_android_twt_teardown()
11891 bw = -EINVAL; in wl_android_twt_teardown()
11900 bw = -EINVAL; in wl_android_twt_teardown()
11911 if (val32 != -1) { in wl_android_twt_teardown()
11922 if (val32 != -1) { in wl_android_twt_teardown()
11947 mybuf, sizeof(mybuf) - rem_len, res_buf, WLC_IOCTL_SMLEN, NULL); in wl_android_twt_teardown()
11964 for (i = 0; i < stats->num_stats; i++) { in wl_android_twt_stats_display_v2()
11965 peer_stats = &stats->peer_stats_list[i]; in wl_android_twt_stats_display_v2()
11969 peer_stats->eosp_dur_avg, peer_stats->tx_pkts_avg, peer_stats->rx_pkts_avg, in wl_android_twt_stats_display_v2()
11970 peer_stats->tx_pkt_sz_avg, peer_stats->rx_pkt_sz_avg); in wl_android_twt_stats_display_v2()
11973 rem_len -= bytes_written; in wl_android_twt_stats_display_v2()
11976 if ((total_len - rem_len) > 0) { in wl_android_twt_stats_display_v2()
11977 return (total_len - rem_len); in wl_android_twt_stats_display_v2()
12000 query.length = sizeof(query) - OFFSETOF(wl_twt_stats_cmd_v1_t, peer); in wl_android_twt_stats()
12017 ret = -EINVAL; in wl_android_twt_stats()
12022 iovresp = (uint8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_android_twt_stats()
12037 if ((ret = wldev_iovar_getbuf(ndev, "twt", iovbuf, bufstart-buflen, in wl_android_twt_stats()
12059 MFREE(cfg->osh, iovresp, WLC_IOCTL_MEDLEN); in wl_android_twt_stats()
12092 ANDROID_ERROR(("%s: Ignore private cmd \"%s\" - iface is down\n", in wl_handle_private_cmd()
12130 int filter_num = *(command + strlen(CMD_RXFILTER_ADD) + 1) - '0'; in wl_handle_private_cmd()
12134 int filter_num = *(command + strlen(CMD_RXFILTER_REMOVE) + 1) - '0'; in wl_handle_private_cmd()
12139 /* TBD: BTCOEXSCAN-START */ in wl_handle_private_cmd()
12142 /* TBD: BTCOEXSCAN-STOP */ in wl_handle_private_cmd()
12150 uint mode = *(command + strlen(CMD_BTCOEXMODE) + 1) - '0'; in wl_handle_private_cmd()
12201 * DRIVER COUNTRY US/-1 in wl_handle_private_cmd()
12205 int revinfo = -1; in wl_handle_private_cmd()
12224 if (dhdp->is_blob) { in wl_handle_private_cmd()
12297 int mode = *(command + strlen(CMD_SROAM_TURN_ON) + 1) - '0'; in wl_handle_private_cmd()
12333 int enable = *(command + strlen(CMD_PNOENABLE_SET) + 1) - '0'; in wl_handle_private_cmd()
12346 priv_cmd.total_len - skip); in wl_handle_private_cmd()
12357 bytes_written = -EINVAL; in wl_handle_private_cmd()
12384 priv_cmd.total_len - skip); in wl_handle_private_cmd()
12389 priv_cmd.total_len - skip); in wl_handle_private_cmd()
12397 command + skip, priv_cmd.total_len - skip); in wl_handle_private_cmd()
12404 priv_cmd.total_len - skip, *(command + skip - 2) - '0'); in wl_handle_private_cmd()
12485 int rmc_enable = *(command + strlen(CMD_SET_RMC_ENABLE) + 1) - '0'; in wl_handle_private_cmd()
12593 int enable = *(command + strlen(CMD_ROAM_OFFLOAD) + 1) - '0'; in wl_handle_private_cmd()
12601 bytes_written = -ENODEV; in wl_handle_private_cmd()
12619 int mode = *(command + strlen(CMD_P2P_SET_WFDIE_RESP) + 1) - '0'; in wl_handle_private_cmd()
12706 uint val = *(command + strlen(CMD_MURX_BFE_CAP) + 1) - '0'; in wl_handle_private_cmd()
12829 int affinity_cmd = *(command + strlen(CMD_PCIE_IRQ_CORE) + 1) - '0'; in wl_handle_private_cmd()
12841 int lqcm_enable = *(command + strlen(CMD_SET_LQCM_ENABLE) + 1) - '0'; in wl_handle_private_cmd()
12925 int verbose_level = *(command + strlen(CMD_DEBUG_VERBOSE) + 1) - '0'; in wl_handle_private_cmd()
12993 int bw_cmd = *(command + strlen(CMD_NAN_RANGING_SET_BW) + 1) - '0'; in wl_handle_private_cmd()
13007 int enable = *(command + strlen(CMD_SET_LATENCY_CRITICAL_DATA) + 1) - '0'; in wl_handle_private_cmd()
13038 int enable = *(command + strlen(CMD_ENABLE_6G_P2P) + 1) - '0'; in wl_handle_private_cmd()
13045 ANDROID_ERROR(("Unknown PRIVATE command %s - ignored\n", command)); in wl_handle_private_cmd()
13105 list_del(&cur->list); in wl_android_exit()
13164 return -1; in wl_genl_init()
13186 u16 event = -1; in wl_event_to_bcm_event()
13243 ret = -ENOMEM; in wl_genl_send_msg()
13249 ret = -ENOMEM; in wl_genl_send_msg()
13259 ret = -EINVAL; in wl_genl_send_msg()
13272 p = ptr = (u8 *)MALLOCZ(cfg->osh, tot_len); in wl_genl_send_msg()
13274 ret = -ENOMEM; in wl_genl_send_msg()
13281 hdr->event_type = wl_event_to_bcm_event(event_type); in wl_genl_send_msg()
13282 hdr->len = len + subhdr_len; in wl_genl_send_msg()
13332 MFREE(cfg->osh, p, tot_len); in wl_genl_send_msg()
13351 return -EINVAL; in wl_genl_handle_msg()
13354 na = info->attrs[BCM_GENL_ATTR_MSG]; in wl_genl_handle_msg()
13357 return -EINVAL; in wl_genl_handle_msg()
13363 return -EINVAL; in wl_genl_handle_msg()
13369 info->snd_pid)); in wl_genl_handle_msg()
13372 info->snd_portid)); in wl_genl_handle_msg()
13399 dhd_pub_t *dhd = cfg->pub; in wl_cfg80211_register_static_if()
13427 if (!wifi_platform_get_mac_addr(dhd->info->adapter, hw_ether, static_ifidx+1)) { in wl_cfg80211_register_static_if()
13433 (void)memcpy_s(mac_addr, ETH_ALEN, primary_ndev->dev_addr, ETH_ALEN); in wl_cfg80211_register_static_if()
13447 wdev = (struct wireless_dev *)MALLOCZ(cfg->osh, sizeof(*wdev)); in wl_cfg80211_register_static_if()
13453 wdev->wiphy = cfg->wdev->wiphy; in wl_cfg80211_register_static_if()
13454 wdev->iftype = iftype; in wl_cfg80211_register_static_if()
13456 ndev->ieee80211_ptr = wdev; in wl_cfg80211_register_static_if()
13457 SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy)); in wl_cfg80211_register_static_if()
13458 wdev->netdev = ndev; in wl_cfg80211_register_static_if()
13466 cfg->static_ndev[static_ifidx] = ndev; in wl_cfg80211_register_static_if()
13467 cfg->static_ndev_state[static_ifidx] = NDEV_STATE_OS_IF_CREATED; in wl_cfg80211_register_static_if()
13470 ANDROID_INFO(("Static I/F (%s) Registered\n", ndev->name)); in wl_cfg80211_register_static_if()
13490 /* free_netdev(cfg->static_ndev); in wl_cfg80211_unregister_static_if()
13493 if (cfg->static_ndev[i]) in wl_cfg80211_unregister_static_if()
13494 unregister_netdev(cfg->static_ndev[i]); in wl_cfg80211_unregister_static_if()
13504 u16 iftype = net->ieee80211_ptr ? net->ieee80211_ptr->iftype : 0; in wl_cfg80211_static_if_open()
13512 ANDROID_INFO(("[STATIC_IF] dev_open ndev %p and wdev %p\n", net, net->ieee80211_ptr)); in wl_cfg80211_static_if_open()
13519 if (cfg->static_ndev_state[static_ifidx] != NDEV_STATE_FW_IF_CREATED) { in wl_cfg80211_static_if_open()
13521 if (!wifi_platform_get_mac_addr(dhd->info->adapter, hw_ether, static_ifidx+1)) in wl_cfg80211_static_if_open()
13524 wdev = wl_cfg80211_add_if(cfg, primary_ndev, wl_iftype, net->name, net->dev_addr); in wl_cfg80211_static_if_open()
13546 if (cfg->static_ndev_state[static_ifidx] == NDEV_STATE_FW_IF_CREATED) { in wl_cfg80211_static_if_close()
13547 if (mutex_is_locked(&cfg->if_sync) == TRUE) { in wl_cfg80211_static_if_close()
13548 ret = _wl_cfg80211_del_if(cfg, primary_ndev, net->ieee80211_ptr, net->name); in wl_cfg80211_static_if_close()
13550 ret = wl_cfg80211_del_if(cfg, primary_ndev, net->ieee80211_ptr, net->name); in wl_cfg80211_static_if_close()
13568 new_ndev = cfg->static_ndev[static_ifidx]; in wl_cfg80211_post_static_ifcreate()
13571 wdev = new_ndev->ieee80211_ptr; in wl_cfg80211_post_static_ifcreate()
13573 wdev->iftype = iface_type; in wl_cfg80211_post_static_ifcreate()
13577 cfg->static_ndev_state[static_ifidx] = NDEV_STATE_FW_IF_CREATED; in wl_cfg80211_post_static_ifcreate()
13578 wl_cfg80211_update_iflist_info(cfg, new_ndev, event->ifidx, addr, event->bssidx, in wl_cfg80211_post_static_ifcreate()
13579 event->name, NDEV_STATE_FW_IF_CREATED); in wl_cfg80211_post_static_ifcreate()
13590 cfg->static_ndev_state[static_ifidx] = NDEV_STATE_FW_IF_DELETED; in wl_cfg80211_post_static_ifdel()
13593 wl_cfg80211_clear_per_bss_ies(cfg, ndev->ieee80211_ptr); in wl_cfg80211_post_static_ifdel()
13594 wl_dealloc_netinfo_by_wdev(cfg, ndev->ieee80211_ptr); in wl_cfg80211_post_static_ifdel()
13608 ioctl_buf = (u8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wlc_wbtext_get_roam_prof()
13611 err = -ENOMEM; in wlc_wbtext_get_roam_prof()
13614 rp->v1.band = band; in wlc_wbtext_get_roam_prof()
13615 rp->v1.len = 0; in wlc_wbtext_get_roam_prof()
13624 if (rp->v1.ver > WL_ROAM_PROF_VER_3) { in wlc_wbtext_get_roam_prof()
13625 ANDROID_ERROR(("bad version (=%d) in return data\n", rp->v1.ver)); in wlc_wbtext_get_roam_prof()
13629 switch (rp->v1.ver) { in wlc_wbtext_get_roam_prof()
13655 ANDROID_ERROR(("bad version = %d \n", rp->v1.ver)); in wlc_wbtext_get_roam_prof()
13660 if ((rp->v1.len % *roam_prof_size) != 0) { in wlc_wbtext_get_roam_prof()
13661 ANDROID_ERROR(("bad length (=%d) in return data\n", rp->v1.len)); in wlc_wbtext_get_roam_prof()
13666 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wlc_wbtext_get_roam_prof()
13685 commandp = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_set_default()
13688 ret = -ENOMEM; in wl_cfg80211_wbtext_set_default()
13691 ioctl_buf = (char *)MALLOCZ(cfg->osh, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_set_default()
13694 ret = -ENOMEM; in wl_cfg80211_wbtext_set_default()
13744 ret = -EINVAL; in wl_cfg80211_wbtext_set_default()
13884 MFREE(cfg->osh, commandp, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_set_default()
13887 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_SMLEN); in wl_cfg80211_wbtext_set_default()
13899 int err = -EINVAL, bytes_written = 0; in wl_cfg80211_wbtext_config()
13906 ioctl_buf = (u8 *)MALLOCZ(cfg->osh, WLC_IOCTL_MEDLEN); in wl_cfg80211_wbtext_config()
13909 err = -ENOMEM; in wl_cfg80211_wbtext_config()
13912 rp = (wl_roamprof_band_t *)MALLOCZ(cfg->osh, sizeof(*rp)); in wl_cfg80211_wbtext_config()
13915 err = -ENOMEM; in wl_cfg80211_wbtext_config()
13919 rp->v1.band = WLC_BAND_2G; in wl_cfg80211_wbtext_config()
13921 rp->v1.band = WLC_BAND_5G; in wl_cfg80211_wbtext_config()
13927 rp->v1.len = 0; in wl_cfg80211_wbtext_config()
13936 if (rp->v1.ver > WL_ROAM_PROF_VER_3) { in wl_cfg80211_wbtext_config()
13937 ANDROID_ERROR(("bad version (=%d) in return data\n", rp->v1.ver)); in wl_cfg80211_wbtext_config()
13938 err = -EINVAL; in wl_cfg80211_wbtext_config()
13941 switch (rp->v1.ver) { in wl_cfg80211_wbtext_config()
13967 ANDROID_ERROR(("bad version = %d \n", rp->v1.ver)); in wl_cfg80211_wbtext_config()
13971 if ((rp->v1.len % roam_prof_size) != 0) { in wl_cfg80211_wbtext_config()
13972 ANDROID_ERROR(("bad length (=%d) in return data\n", rp->v1.len)); in wl_cfg80211_wbtext_config()
13973 err = -EINVAL; in wl_cfg80211_wbtext_config()
13982 if (((i * roam_prof_size) > rp->v1.len)) { in wl_cfg80211_wbtext_config()
13986 fs_per = rp->v1.roam_prof[i].fullscan_period; in wl_cfg80211_wbtext_config()
13988 fs_per = rp->v2.roam_prof[i].fullscan_period; in wl_cfg80211_wbtext_config()
13990 fs_per = rp->v3.roam_prof[i].fullscan_period; in wl_cfg80211_wbtext_config()
13992 fs_per = rp->v4.roam_prof[i].fullscan_period; in wl_cfg80211_wbtext_config()
14004 total_len - bytes_written, in wl_cfg80211_wbtext_config()
14006 rp->v2.roam_prof[i].roam_trigger, in wl_cfg80211_wbtext_config()
14007 rp->v2.roam_prof[i].rssi_lower, in wl_cfg80211_wbtext_config()
14008 rp->v2.roam_prof[i].channel_usage, in wl_cfg80211_wbtext_config()
14009 rp->v2.roam_prof[i].cu_avg_calc_dur); in wl_cfg80211_wbtext_config()
14012 total_len - bytes_written, in wl_cfg80211_wbtext_config()
14014 rp->v3.roam_prof[i].roam_trigger, in wl_cfg80211_wbtext_config()
14015 rp->v3.roam_prof[i].rssi_lower, in wl_cfg80211_wbtext_config()
14016 rp->v3.roam_prof[i].channel_usage, in wl_cfg80211_wbtext_config()
14017 rp->v3.roam_prof[i].cu_avg_calc_dur); in wl_cfg80211_wbtext_config()
14020 total_len - bytes_written, in wl_cfg80211_wbtext_config()
14022 rp->v4.roam_prof[i].roam_trigger, in wl_cfg80211_wbtext_config()
14023 rp->v4.roam_prof[i].rssi_lower, in wl_cfg80211_wbtext_config()
14024 rp->v4.roam_prof[i].channel_usage, in wl_cfg80211_wbtext_config()
14025 rp->v4.roam_prof[i].cu_avg_calc_dur); in wl_cfg80211_wbtext_config()
14028 bytes_written += scnprintf(command+bytes_written, total_len - bytes_written, "\n"); in wl_cfg80211_wbtext_config()
14035 err = -EINVAL; in wl_cfg80211_wbtext_config()
14044 err = -EINVAL; in wl_cfg80211_wbtext_config()
14051 err = -EINVAL; in wl_cfg80211_wbtext_config()
14055 rp->v2.roam_prof[i].roam_trigger = roam_trigger; in wl_cfg80211_wbtext_config()
14056 rp->v2.roam_prof[i].rssi_lower = rssi_lower; in wl_cfg80211_wbtext_config()
14058 rp->v2.roam_prof[i].channel_usage = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_config()
14060 rp->v2.roam_prof[i].cu_avg_calc_dur = in wl_cfg80211_wbtext_config()
14064 rp->v3.roam_prof[i].roam_trigger = roam_trigger; in wl_cfg80211_wbtext_config()
14065 rp->v3.roam_prof[i].rssi_lower = rssi_lower; in wl_cfg80211_wbtext_config()
14067 rp->v3.roam_prof[i].channel_usage = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_config()
14069 rp->v3.roam_prof[i].cu_avg_calc_dur = in wl_cfg80211_wbtext_config()
14073 rp->v4.roam_prof[i].roam_trigger = roam_trigger; in wl_cfg80211_wbtext_config()
14074 rp->v4.roam_prof[i].rssi_lower = rssi_lower; in wl_cfg80211_wbtext_config()
14076 rp->v4.roam_prof[i].channel_usage = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_config()
14078 rp->v4.roam_prof[i].cu_avg_calc_dur = in wl_cfg80211_wbtext_config()
14091 err = -EINVAL; in wl_cfg80211_wbtext_config()
14094 rp->v1.len = rp_len; in wl_cfg80211_wbtext_config()
14096 sizeof(*rp), cfg->ioctl_buf, WLC_IOCTL_MEDLEN, in wl_cfg80211_wbtext_config()
14097 &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_wbtext_config()
14103 MFREE(cfg->osh, rp, sizeof(*rp)); in wl_cfg80211_wbtext_config()
14106 MFREE(cfg->osh, ioctl_buf, WLC_IOCTL_MEDLEN); in wl_cfg80211_wbtext_config()
14114 int bytes_written = 0, err = -EINVAL, argc = 0; in wl_cfg80211_wbtext_weight_config()
14121 bwcfg = (wnm_bss_select_weight_cfg_t *)MALLOCZ(cfg->osh, sizeof(*bwcfg)); in wl_cfg80211_wbtext_weight_config()
14124 err = -ENOMEM; in wl_cfg80211_wbtext_weight_config()
14127 bwcfg->version = WNM_BSSLOAD_MONITOR_VERSION; in wl_cfg80211_wbtext_weight_config()
14128 bwcfg->type = 0; in wl_cfg80211_wbtext_weight_config()
14129 bwcfg->weight = 0; in wl_cfg80211_wbtext_weight_config()
14134 bwcfg->type = WNM_BSS_SELECT_TYPE_RSSI; in wl_cfg80211_wbtext_weight_config()
14136 bwcfg->type = WNM_BSS_SELECT_TYPE_CU; in wl_cfg80211_wbtext_weight_config()
14138 bwcfg->type = WNM_BSS_SELECT_TYPE_ESTM_DL; in wl_cfg80211_wbtext_weight_config()
14145 if (BCME_BADBAND == wl_android_bandstr_to_fwband(band, &bwcfg->band)) { in wl_cfg80211_wbtext_weight_config()
14152 if (bwcfg->band == WLC_BAND_ALL) { in wl_cfg80211_wbtext_weight_config()
14164 (bwcfg->type == WNM_BSS_SELECT_TYPE_RSSI) ? "RSSI" : in wl_cfg80211_wbtext_weight_config()
14165 (bwcfg->type == WNM_BSS_SELECT_TYPE_CU) ? "CU": "ESTM_DL", in wl_cfg80211_wbtext_weight_config()
14166 wl_android_get_band_str(bwcfg->band), bwcfg->weight); in wl_cfg80211_wbtext_weight_config()
14171 bwcfg->weight = simple_strtol(weight, &endptr, 0); in wl_cfg80211_wbtext_weight_config()
14185 MFREE(cfg->osh, bwcfg, sizeof(*bwcfg)); in wl_cfg80211_wbtext_weight_config()
14197 int bytes_written = 0, err = -EINVAL; in wl_cfg80211_wbtext_table_config()
14206 btcfg = (wnm_bss_select_factor_cfg_t *)MALLOCZ(cfg->osh, in wl_cfg80211_wbtext_table_config()
14210 err = -ENOMEM; in wl_cfg80211_wbtext_table_config()
14214 btcfg->version = WNM_BSS_SELECT_FACTOR_VERSION; in wl_cfg80211_wbtext_table_config()
14215 btcfg->band = WLC_BAND_AUTO; in wl_cfg80211_wbtext_table_config()
14216 btcfg->type = 0; in wl_cfg80211_wbtext_table_config()
14217 btcfg->count = 0; in wl_cfg80211_wbtext_table_config()
14222 btcfg->type = WNM_BSS_SELECT_TYPE_RSSI; in wl_cfg80211_wbtext_table_config()
14225 btcfg->type = WNM_BSS_SELECT_TYPE_CU; in wl_cfg80211_wbtext_table_config()
14232 if (BCME_BADBAND == wl_android_bandstr_to_fwband(band, &btcfg->band)) { in wl_cfg80211_wbtext_table_config()
14237 if ((slen - 1) == (strlen(rssi) + strlen(band))) { in wl_cfg80211_wbtext_table_config()
14246 memcpy(btcfg, ioctl_buf, (btcfg->count+1) * sizeof(*btcfg)); in wl_cfg80211_wbtext_table_config()
14248 bytes_written += snprintf(command + bytes_written, total_len - bytes_written, in wl_cfg80211_wbtext_table_config()
14249 "No of entries in table: %d\n", btcfg->count); in wl_cfg80211_wbtext_table_config()
14250 bytes_written += snprintf(command + bytes_written, total_len - bytes_written, in wl_cfg80211_wbtext_table_config()
14252 (btcfg->type == WNM_BSS_SELECT_TYPE_RSSI) ? "RSSI" : "CU"); in wl_cfg80211_wbtext_table_config()
14253 bytes_written += snprintf(command + bytes_written, total_len - bytes_written, in wl_cfg80211_wbtext_table_config()
14255 for (i = 0; i <= btcfg->count-1; i++) { in wl_cfg80211_wbtext_table_config()
14257 total_len - bytes_written, "%d\t%d\t%d\n", btcfg->params[i].low, in wl_cfg80211_wbtext_table_config()
14258 btcfg->params[i].high, btcfg->params[i].factor); in wl_cfg80211_wbtext_table_config()
14264 memset_s(btcfg->params, len, 0, len); in wl_cfg80211_wbtext_table_config()
14267 slen = slen - (strlen(rssi) + strlen(band) + 2); in wl_cfg80211_wbtext_table_config()
14270 btcfg->params[i].low = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_table_config()
14272 btcfg->params[i].high = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_table_config()
14274 btcfg->params[i].factor = simple_strtol(data, &data, 10); in wl_cfg80211_wbtext_table_config()
14275 btcfg->count++; in wl_cfg80211_wbtext_table_config()
14280 parsed_len = data - start_addr; in wl_cfg80211_wbtext_table_config()
14286 btcfg_len = sizeof(*btcfg) + ((btcfg->count) * sizeof(*btcfg)); in wl_cfg80211_wbtext_table_config()
14288 cfg->ioctl_buf, WLC_IOCTL_MEDLEN, &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_wbtext_table_config()
14295 MFREE(cfg->osh, btcfg, in wl_cfg80211_wbtext_table_config()
14306 int err = -EINVAL, bytes_written = 0, argc = 0, val, len = 0; in wl_cfg80211_wbtext_delta_config()
14311 rp = (wl_roamprof_band_t *)MALLOCZ(cfg->osh, sizeof(*rp)); in wl_cfg80211_wbtext_delta_config()
14314 err = -ENOMEM; in wl_cfg80211_wbtext_delta_config()
14326 err = -EINVAL; in wl_cfg80211_wbtext_delta_config()
14342 if (len >= rp->v1.len) { in wl_cfg80211_wbtext_delta_config()
14346 if (rp->v2.roam_prof[i].fullscan_period == 0) { in wl_cfg80211_wbtext_delta_config()
14349 if (rp->v2.roam_prof[i].channel_usage != 0) { in wl_cfg80211_wbtext_delta_config()
14350 rp->v2.roam_prof[i].roam_delta = val; in wl_cfg80211_wbtext_delta_config()
14353 if (rp->v3.roam_prof[i].fullscan_period == 0) { in wl_cfg80211_wbtext_delta_config()
14356 if (rp->v3.roam_prof[i].channel_usage != 0) { in wl_cfg80211_wbtext_delta_config()
14357 rp->v3.roam_prof[i].roam_delta = val; in wl_cfg80211_wbtext_delta_config()
14360 if (rp->v4.roam_prof[i].fullscan_period == 0) { in wl_cfg80211_wbtext_delta_config()
14363 if (rp->v4.roam_prof[i].channel_usage != 0) { in wl_cfg80211_wbtext_delta_config()
14364 rp->v4.roam_prof[i].roam_delta = val; in wl_cfg80211_wbtext_delta_config()
14371 if (rp->v2.roam_prof[0].channel_usage != 0) { in wl_cfg80211_wbtext_delta_config()
14373 "%s Delta %d\n", wl_android_get_band_str(rp->v1.band), in wl_cfg80211_wbtext_delta_config()
14374 rp->v2.roam_prof[0].roam_delta); in wl_cfg80211_wbtext_delta_config()
14379 rp->v1.len = len; in wl_cfg80211_wbtext_delta_config()
14381 sizeof(*rp), cfg->ioctl_buf, WLC_IOCTL_MEDLEN, in wl_cfg80211_wbtext_delta_config()
14382 &cfg->ioctl_buf_sync)) < 0) { in wl_cfg80211_wbtext_delta_config()
14387 MFREE(cfg->osh, rp, sizeof(*rp)); in wl_cfg80211_wbtext_delta_config()