.. | .. |
---|
154 | 154 | ENC_TKIPAES |
---|
155 | 155 | } encmode_t; |
---|
156 | 156 | |
---|
| 157 | +typedef enum MAPSTA_MODE { |
---|
| 158 | + MCHAN_APSTA_NOT_ALLOW = 0, |
---|
| 159 | + MCHAN_APSTA_SBSC, |
---|
| 160 | + MCHAN_APSTA_NO_RESTRICT |
---|
| 161 | +} mapsta_mode_t; |
---|
| 162 | + |
---|
157 | 163 | #ifdef STA_MGMT |
---|
158 | 164 | typedef struct wl_sta_info { |
---|
159 | 165 | int ifidx; |
---|
.. | .. |
---|
270 | 276 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
271 | 277 | } wl_if_info_t; |
---|
272 | 278 | |
---|
| 279 | +u8 *g_ioctl_buf = NULL; |
---|
| 280 | + |
---|
273 | 281 | typedef struct wl_apsta_params { |
---|
274 | 282 | struct wl_if_info if_info[MAX_IF_NUM]; |
---|
275 | 283 | #ifdef WLDWDS |
---|
276 | 284 | struct wl_dwds_info dwds_info[MAX_DWDS_IF_NUM]; |
---|
277 | 285 | #endif /* WLDWDS */ |
---|
278 | | - u8 *ioctl_buf; |
---|
279 | 286 | bool init; |
---|
280 | 287 | int rsdb; |
---|
281 | 288 | bool vsdb; |
---|
.. | .. |
---|
1933 | 1940 | if (!auto_chan) { |
---|
1934 | 1941 | auto_chan = wl_ext_autochannel(cur_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
---|
1935 | 1942 | cur_chan_info->band); |
---|
| 1943 | + auto_chan = wf_chspec_ctlchan(auto_chan); |
---|
1936 | 1944 | } |
---|
1937 | 1945 | if (auto_chan) |
---|
1938 | 1946 | cur_chan_info->chan = auto_chan; |
---|
.. | .. |
---|
1954 | 1962 | if (!auto_chan) { |
---|
1955 | 1963 | auto_chan = wl_ext_autochannel(cur_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
---|
1956 | 1964 | cur_chan_info->band); |
---|
| 1965 | + auto_chan = wf_chspec_ctlchan(auto_chan); |
---|
1957 | 1966 | } |
---|
1958 | 1967 | if (auto_chan) { |
---|
1959 | 1968 | cur_chan_info->chan = auto_chan; |
---|
.. | .. |
---|
1967 | 1976 | } else { |
---|
1968 | 1977 | auto_chan = wl_ext_autochannel(cur_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
---|
1969 | 1978 | cur_chan_info->band); |
---|
| 1979 | + auto_chan = wf_chspec_ctlchan(auto_chan); |
---|
1970 | 1980 | if (auto_chan) { |
---|
1971 | 1981 | cur_chan_info->chan = auto_chan; |
---|
1972 | 1982 | } |
---|
.. | .. |
---|
2005 | 2015 | if (!auto_chan) { |
---|
2006 | 2016 | auto_chan = wl_ext_autochannel(tgt_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
---|
2007 | 2017 | tgt_chan_info->band); |
---|
| 2018 | + auto_chan = wf_chspec_ctlchan(auto_chan); |
---|
2008 | 2019 | } |
---|
2009 | 2020 | if (auto_chan) { |
---|
2010 | 2021 | tgt_chan_info->chan = auto_chan; |
---|
.. | .. |
---|
2017 | 2028 | if (!auto_chan) { |
---|
2018 | 2029 | auto_chan = wl_ext_autochannel(tgt_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
---|
2019 | 2030 | tgt_chan_info->band); |
---|
| 2031 | + auto_chan = wf_chspec_ctlchan(auto_chan); |
---|
2020 | 2032 | } |
---|
2021 | 2033 | } else { |
---|
2022 | 2034 | tgt_chan_info->chan = 0; |
---|
.. | .. |
---|
2488 | 2500 | if (wl_ext_master_if(cur_if) && apsta_params->acs) { |
---|
2489 | 2501 | chan_info->chan = wl_ext_autochannel(cur_if->dev, apsta_params->acs, |
---|
2490 | 2502 | chan_info->band); |
---|
| 2503 | + chan_info->chan = wf_chspec_ctlchan(chan_info->chan); |
---|
2491 | 2504 | } |
---|
2492 | 2505 | chan_info->chan = wl_ext_move_cur_channel(apsta_params, cur_if); |
---|
2493 | 2506 | if (chan_info->chan) { |
---|
.. | .. |
---|
4289 | 4302 | } |
---|
4290 | 4303 | } |
---|
4291 | 4304 | } else { |
---|
4292 | | - WL_ERR(("Unknown auth_alg=%d or auth_seq=%d\n", auth_alg, auth_seq)); |
---|
| 4305 | + IAPSTA_ERROR(dev->name, "Unknown auth_alg=%d or auth_seq=%d\n", |
---|
| 4306 | + auth_alg, auth_seq); |
---|
4293 | 4307 | } |
---|
4294 | 4308 | |
---|
4295 | 4309 | return; |
---|
.. | .. |
---|
4395 | 4409 | static void |
---|
4396 | 4410 | wl_ampdu_dump(struct net_device *dev) |
---|
4397 | 4411 | { |
---|
4398 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
4399 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
4400 | | - char *ioctl_buf = apsta_params->ioctl_buf, *buf = NULL; |
---|
| 4412 | + char *ioctl_buf = g_ioctl_buf, *buf = NULL; |
---|
4401 | 4413 | char *tx_pch_start, *tx_pch_end, *rx_pch_start, *rx_pch_end; |
---|
4402 | 4414 | int ret = 0, max_len, tx_len, rx_len; |
---|
4403 | 4415 | |
---|
4404 | 4416 | if (!(android_msg_level & ANDROID_AMPDU_LEVEL)) |
---|
4405 | | - return; |
---|
4406 | | - |
---|
4407 | | - if (!ioctl_buf) |
---|
4408 | 4417 | return; |
---|
4409 | 4418 | |
---|
4410 | 4419 | memset(ioctl_buf, 0, WL_DUMP_BUF_LEN); |
---|
.. | .. |
---|
4470 | 4479 | static void |
---|
4471 | 4480 | wl_tvpm_dump(struct net_device *dev) |
---|
4472 | 4481 | { |
---|
4473 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
4474 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
4475 | 4482 | wl_tvpm_req_t* tvpm_req = NULL; |
---|
4476 | 4483 | size_t reqlen = sizeof(wl_tvpm_req_t) + sizeof(wl_tvpm_status_t); |
---|
4477 | | - uint8 *outbuf = apsta_params->ioctl_buf; |
---|
| 4484 | + uint8 *outbuf = g_ioctl_buf; |
---|
4478 | 4485 | size_t outlen = WLC_IOCTL_MEDLEN; |
---|
4479 | 4486 | wl_tvpm_status_t* status; |
---|
4480 | 4487 | int ret, phy_temp = 0; |
---|
.. | .. |
---|
4545 | 4552 | wldev_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t), 0); |
---|
4546 | 4553 | rssi_ant_p->count = 1; |
---|
4547 | 4554 | rssi_ant_p->rssi_ant[0] = dtoh32(scb_val.val); |
---|
| 4555 | + } else { |
---|
| 4556 | + rssi_ant_p->count = 0; |
---|
4548 | 4557 | } |
---|
4549 | 4558 | } |
---|
4550 | 4559 | for (i=0; i<rssi_ant_p->count && rssi_ant_p->rssi_ant[i]; i++) { |
---|
.. | .. |
---|
4570 | 4579 | static void |
---|
4571 | 4580 | wl_sta_info_dump(struct net_device *dev, struct ether_addr *mac) |
---|
4572 | 4581 | { |
---|
4573 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
4574 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
4575 | | - void *buf = apsta_params->ioctl_buf; |
---|
| 4582 | + void *buf = g_ioctl_buf; |
---|
4576 | 4583 | sta_info_v4_t *sta = NULL; |
---|
4577 | 4584 | char rssi_buf[16]; |
---|
4578 | 4585 | int ret; |
---|
.. | .. |
---|
4723 | 4730 | tmp_if = &apsta_params->if_info[i]; |
---|
4724 | 4731 | if (tmp_if->dev && |
---|
4725 | 4732 | (tmp_if->ifmode == ISTA_MODE || tmp_if->ifmode == IGC_MODE) && |
---|
4726 | | - wl_ext_associated(tmp_if->dev)) { |
---|
| 4733 | + wl_get_isam_status(tmp_if, STA_CONNECTED)) { |
---|
4727 | 4734 | wl_tput_monitor(dhd, tmp_if->ifidx, &tmp_if->tput_info); |
---|
4728 | 4735 | monitor_if[i] = TRUE; |
---|
4729 | 4736 | } |
---|
.. | .. |
---|
5112 | 5119 | { |
---|
5113 | 5120 | struct dhd_pub *dhd = dhd_get_pub(cur_if->dev); |
---|
5114 | 5121 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
5115 | | - char *iovar_buf = apsta_params->ioctl_buf; |
---|
| 5122 | + char *iovar_buf = g_ioctl_buf; |
---|
5116 | 5123 | uint32 corerev = 0; |
---|
5117 | 5124 | wl_cnt_info_t *cntinfo; |
---|
5118 | 5125 | uint16 ver; |
---|
.. | .. |
---|
5971 | 5978 | (chan_5g && cur_if->chan_info.band == WLC_BAND_5G)) { |
---|
5972 | 5979 | cur_if->chan_info.chan = wl_ext_autochannel(cur_if->dev, apsta_params->acs, |
---|
5973 | 5980 | cur_if->chan_info.band); |
---|
| 5981 | + cur_if->chan_info.chan = wf_chspec_ctlchan(cur_if->chan_info.chan); |
---|
5974 | 5982 | } else { |
---|
5975 | 5983 | IAPSTA_ERROR(ifname, "invalid channel\n"); |
---|
5976 | 5984 | ret = -1; |
---|
.. | .. |
---|
6688 | 6696 | } |
---|
6689 | 6697 | |
---|
6690 | 6698 | static void |
---|
| 6699 | +wl_ext_iapsta_get_mapsta_mode(struct net_device *net) |
---|
| 6700 | +{ |
---|
| 6701 | + struct dhd_pub *dhd = dhd_get_pub(net); |
---|
| 6702 | + struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
| 6703 | + int ret, mapsta_mode; |
---|
| 6704 | + |
---|
| 6705 | + ret = wldev_iovar_getint(net, "mapsta_mode", &mapsta_mode); |
---|
| 6706 | + if (ret) { |
---|
| 6707 | + IAPSTA_INFO(net->name, "not supported %d\n", ret); |
---|
| 6708 | + mapsta_mode = MCHAN_APSTA_NOT_ALLOW; |
---|
| 6709 | + } |
---|
| 6710 | + |
---|
| 6711 | + if (mapsta_mode == MCHAN_APSTA_SBSC) |
---|
| 6712 | + apsta_params->rsdb = 1; |
---|
| 6713 | + else if (mapsta_mode == MCHAN_APSTA_NO_RESTRICT) |
---|
| 6714 | + apsta_params->vsdb = TRUE; |
---|
| 6715 | + |
---|
| 6716 | + IAPSTA_INFO(net->name, "mapsta_mode=%d(rsdb=%d, vsdb=%d)\n", |
---|
| 6717 | + mapsta_mode, apsta_params->rsdb, apsta_params->vsdb); |
---|
| 6718 | +} |
---|
| 6719 | + |
---|
| 6720 | +static void |
---|
6691 | 6721 | wl_ext_iapsta_postinit(struct net_device *net, struct wl_if_info *cur_if) |
---|
6692 | 6722 | { |
---|
6693 | 6723 | struct dhd_pub *dhd = dhd_get_pub(net); |
---|
.. | .. |
---|
6698 | 6728 | if (cur_if->ifidx == 0) { |
---|
6699 | 6729 | apsta_params->rsdb = wl_ext_iapsta_get_rsdb(net, dhd); |
---|
6700 | 6730 | apsta_params->vsdb = FALSE; |
---|
| 6731 | + wl_ext_iapsta_get_mapsta_mode(net); |
---|
6701 | 6732 | apsta_params->csa = 0; |
---|
6702 | 6733 | apsta_params->acs = 0; |
---|
6703 | 6734 | apsta_params->radar = wl_ext_radar_detect(net); |
---|
.. | .. |
---|
6873 | 6904 | struct dhd_pub *dhd = dhd_get_pub(net); |
---|
6874 | 6905 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
6875 | 6906 | |
---|
6876 | | - if (!apsta_params->ioctl_buf) { |
---|
6877 | | - apsta_params->ioctl_buf = kmalloc(WL_DUMP_BUF_LEN, GFP_KERNEL); |
---|
6878 | | - if (unlikely(!apsta_params->ioctl_buf)) { |
---|
6879 | | - IAPSTA_ERROR(net->name, "Can not allocate ioctl_buf\n"); |
---|
6880 | | - } |
---|
6881 | | - } |
---|
6882 | 6907 | init_waitqueue_head(&apsta_params->netif_change_event); |
---|
6883 | 6908 | mutex_init(&apsta_params->usr_sync); |
---|
6884 | 6909 | mutex_init(&apsta_params->in4way_sync); |
---|
.. | .. |
---|
6896 | 6921 | struct dhd_pub *dhd = dhd_get_pub(net); |
---|
6897 | 6922 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
6898 | 6923 | |
---|
6899 | | - if (apsta_params->ioctl_buf) { |
---|
6900 | | - kfree(apsta_params->ioctl_buf); |
---|
6901 | | - apsta_params->ioctl_buf = NULL; |
---|
6902 | | - } |
---|
6903 | 6924 | memset(apsta_params, 0, sizeof(struct wl_apsta_params)); |
---|
6904 | 6925 | } |
---|
6905 | 6926 | |
---|
.. | .. |
---|
7028 | 7049 | return 0; |
---|
7029 | 7050 | } |
---|
7030 | 7051 | |
---|
7031 | | -int |
---|
7032 | | -wl_ext_iapsta_attach(struct net_device *net) |
---|
7033 | | -{ |
---|
7034 | | - struct dhd_pub *dhd = dhd_get_pub(net); |
---|
7035 | | - struct wl_apsta_params *iapsta_params; |
---|
7036 | | - |
---|
7037 | | - IAPSTA_TRACE(net->name, "Enter\n"); |
---|
7038 | | - |
---|
7039 | | - iapsta_params = kzalloc(sizeof(struct wl_apsta_params), GFP_KERNEL); |
---|
7040 | | - if (unlikely(!iapsta_params)) { |
---|
7041 | | - IAPSTA_ERROR(net->name, "Can not allocate apsta_params\n"); |
---|
7042 | | - return -ENOMEM; |
---|
7043 | | - } |
---|
7044 | | - dhd->iapsta_params = (void *)iapsta_params; |
---|
7045 | | - |
---|
7046 | | - return 0; |
---|
7047 | | -} |
---|
7048 | | - |
---|
7049 | 7052 | void |
---|
7050 | 7053 | wl_ext_iapsta_dettach(struct net_device *net) |
---|
7051 | 7054 | { |
---|
.. | .. |
---|
7053 | 7056 | |
---|
7054 | 7057 | IAPSTA_TRACE(net->name, "Enter\n"); |
---|
7055 | 7058 | |
---|
| 7059 | + if (g_ioctl_buf) { |
---|
| 7060 | + kfree(g_ioctl_buf); |
---|
| 7061 | + g_ioctl_buf = NULL; |
---|
| 7062 | + } |
---|
| 7063 | + |
---|
7056 | 7064 | if (dhd->iapsta_params) { |
---|
7057 | 7065 | wl_ext_iapsta_deinit_priv(net); |
---|
7058 | 7066 | kfree(dhd->iapsta_params); |
---|
7059 | 7067 | dhd->iapsta_params = NULL; |
---|
7060 | 7068 | } |
---|
7061 | 7069 | } |
---|
| 7070 | + |
---|
| 7071 | +int |
---|
| 7072 | +wl_ext_iapsta_attach(struct net_device *net) |
---|
| 7073 | +{ |
---|
| 7074 | + struct dhd_pub *dhd = dhd_get_pub(net); |
---|
| 7075 | + struct wl_apsta_params *iapsta_params; |
---|
| 7076 | + int ret = 0; |
---|
| 7077 | + |
---|
| 7078 | + IAPSTA_TRACE(net->name, "Enter\n"); |
---|
| 7079 | + |
---|
| 7080 | + iapsta_params = kzalloc(sizeof(struct wl_apsta_params), GFP_KERNEL); |
---|
| 7081 | + if (unlikely(!iapsta_params)) { |
---|
| 7082 | + IAPSTA_ERROR(net->name, "Can not allocate apsta_params\n"); |
---|
| 7083 | + ret = -ENOMEM; |
---|
| 7084 | + goto exit; |
---|
| 7085 | + } |
---|
| 7086 | + dhd->iapsta_params = (void *)iapsta_params; |
---|
| 7087 | + |
---|
| 7088 | + if (!g_ioctl_buf) { |
---|
| 7089 | + g_ioctl_buf = kmalloc(WL_DUMP_BUF_LEN, GFP_KERNEL); |
---|
| 7090 | + if (unlikely(!g_ioctl_buf)) { |
---|
| 7091 | + IAPSTA_ERROR(net->name, "Can not allocate g_ioctl_buf\n"); |
---|
| 7092 | + ret = -ENOMEM; |
---|
| 7093 | + goto exit; |
---|
| 7094 | + } |
---|
| 7095 | + } |
---|
| 7096 | + |
---|
| 7097 | +exit: |
---|
| 7098 | + if (ret) |
---|
| 7099 | + wl_ext_iapsta_dettach(net); |
---|
| 7100 | + return ret; |
---|
| 7101 | +} |
---|
7062 | 7102 | #endif /* WL_EXT_IAPSTA */ |
---|