old mode 100644new mode 100755| .. | .. |
|---|
| 1 | | -/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 1 | |
|---|
| 3 | 2 | #ifdef WL_EXT_IAPSTA |
|---|
| 4 | 3 | #include <net/rtnetlink.h> |
|---|
| .. | .. |
|---|
| 9 | 8 | #include <dhd_config.h> |
|---|
| 10 | 9 | #ifdef WL_CFG80211 |
|---|
| 11 | 10 | #include <wl_cfg80211.h> |
|---|
| 12 | | -#include <wl_cfgscan.h> |
|---|
| 13 | 11 | #endif /* WL_CFG80211 */ |
|---|
| 14 | 12 | #ifdef WL_ESCAN |
|---|
| 15 | 13 | #include <wl_escan.h> |
|---|
| 16 | 14 | #endif /* WL_ESCAN */ |
|---|
| 17 | | - |
|---|
| 18 | | -#ifdef BTC_WAR |
|---|
| 19 | | -/* btc_war: |
|---|
| 20 | | - * -1(don't apply btc) |
|---|
| 21 | | - * 0(disable btc war): btc_mode=1; txchain=3; rxchain=3 |
|---|
| 22 | | - * 1(enable btc war): txchain=2; rxchain=2; btc_mode=5 |
|---|
| 23 | | - */ |
|---|
| 24 | | -int btc_war = -1; |
|---|
| 25 | | -module_param(btc_war, int, 0644); |
|---|
| 26 | | -#endif /* BTC_WAR */ |
|---|
| 27 | 15 | |
|---|
| 28 | 16 | #define IAPSTA_ERROR(name, arg1, args...) \ |
|---|
| 29 | 17 | do { \ |
|---|
| .. | .. |
|---|
| 69 | 57 | #define CSA_FW_BIT (1<<0) |
|---|
| 70 | 58 | #define CSA_DRV_BIT (1<<1) |
|---|
| 71 | 59 | |
|---|
| 72 | | -#define WL_DUMP_BUF_LEN (127 * 1024) |
|---|
| 73 | | - |
|---|
| 74 | 60 | #define MAX_AP_LINK_WAIT_TIME 3000 |
|---|
| 75 | 61 | #define MAX_STA_LINK_WAIT_TIME 15000 |
|---|
| 76 | 62 | #define STA_LINKDOWN_TIMEOUT 10000 |
|---|
| 77 | 63 | #define STA_CONNECT_TIMEOUT 10500 |
|---|
| 78 | | -#define STA_CONNECT_FULL_CHAN_TIMEOUT 3000 |
|---|
| 79 | 64 | #define STA_CONNECT_RETRY_TIMEOUT 600 |
|---|
| 80 | 65 | #define STA_RECONNECT_RETRY_TIMEOUT 300 |
|---|
| 81 | | -#define STA_DISCONNECT_RECONNECT_TIMEOUT 30000 |
|---|
| 82 | | -#define STA_DISCONNECT_RECONNECT_MAX 3 |
|---|
| 83 | | -#define STA_4WAY_TIMEOUT 1000 |
|---|
| 84 | | -#ifdef EAPOL_RESEND_M4 |
|---|
| 85 | | -#define STA_KEY_INSTALL_INTERVAL 50 |
|---|
| 86 | | -#define STA_KEY_INSTALL_MAX (STA_4WAY_TIMEOUT/STA_KEY_INSTALL_INTERVAL) |
|---|
| 87 | | -#else |
|---|
| 88 | | -#define STA_KEY_INSTALL_INTERVAL 50 |
|---|
| 89 | | -#define STA_KEY_INSTALL_MAX 3 |
|---|
| 90 | | -#endif |
|---|
| 91 | 66 | #define STA_EAPOL_TIMEOUT 100 |
|---|
| 92 | 67 | #define STA_EMPTY_SCAN_MAX 6 |
|---|
| 93 | | -#define AP_RESTART_TIMEOUT 1000 |
|---|
| 94 | | -#define AP_TXBCNFRM_TIMEOUT 10000 |
|---|
| 68 | +#define AP_RESTART_TIMEOUT 1 |
|---|
| 69 | +#define AP_TXBCNFRM_TIMEOUT 10 |
|---|
| 95 | 70 | #ifdef RXF0OVFL_REINIT_WAR |
|---|
| 96 | | -#define RXF0OVFL_POLLING_TIMEOUT 1000 |
|---|
| 71 | +#define RXF0OVFL_POLLING_TIMEOUT 1 |
|---|
| 97 | 72 | #define RXF0OVFL_THRESHOLD 100 |
|---|
| 98 | 73 | #endif /* RXF0OVFL_REINIT_WAR */ |
|---|
| 99 | 74 | |
|---|
| .. | .. |
|---|
| 153 | 128 | ENC_AES, |
|---|
| 154 | 129 | ENC_TKIPAES |
|---|
| 155 | 130 | } encmode_t; |
|---|
| 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 | 131 | |
|---|
| 163 | 132 | #ifdef STA_MGMT |
|---|
| 164 | 133 | typedef struct wl_sta_info { |
|---|
| .. | .. |
|---|
| 229 | 198 | uint conn_state; |
|---|
| 230 | 199 | uint16 prev_channel; |
|---|
| 231 | 200 | uint16 post_channel; |
|---|
| 232 | | - struct osl_timespec sta_disc_ts; |
|---|
| 233 | | - struct osl_timespec sta_conn_ts; |
|---|
| 234 | | - bool ap_recon_sta; |
|---|
| 235 | | - wait_queue_head_t ap_recon_sta_event; |
|---|
| 236 | | - struct ether_addr ap_disc_sta_bssid; |
|---|
| 237 | | - struct osl_timespec ap_disc_sta_ts; |
|---|
| 238 | 201 | #ifdef TPUT_MONITOR |
|---|
| 239 | 202 | struct wl_tput_info tput_info; |
|---|
| 240 | 203 | #endif /* TPUT_MONITOR */ |
|---|
| .. | .. |
|---|
| 256 | 219 | int eapol_resend_intvl; |
|---|
| 257 | 220 | #endif /* EAPOL_DYNAMATIC_RESEND */ |
|---|
| 258 | 221 | #endif /* EAPOL_RESEND */ |
|---|
| 259 | | -#ifdef KEY_INSTALL_CHECK |
|---|
| 260 | | - timer_list_compat_t key_install_timer; |
|---|
| 261 | | - int key_install_cnt; |
|---|
| 262 | | -#endif /* KEY_INSTALL_CHECK */ |
|---|
| 263 | 222 | int empty_scan; |
|---|
| 264 | 223 | #ifdef RESTART_AP_WAR |
|---|
| 265 | 224 | timer_list_compat_t restart_ap_timer; |
|---|
| .. | .. |
|---|
| 268 | 227 | timer_list_compat_t reset_ap_timer; |
|---|
| 269 | 228 | uint32 txbcnfrm; |
|---|
| 270 | 229 | #endif /* RESET_AP_WAR */ |
|---|
| 271 | | -#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 272 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
|---|
| 273 | | - struct osl_timespec sta_disc_conn_ts; |
|---|
| 274 | | - int sta_disc_recon_cnt; |
|---|
| 275 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
|---|
| 276 | | -#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 277 | 230 | } wl_if_info_t; |
|---|
| 278 | | - |
|---|
| 279 | | -u8 *g_ioctl_buf = NULL; |
|---|
| 280 | 231 | |
|---|
| 281 | 232 | typedef struct wl_apsta_params { |
|---|
| 282 | 233 | struct wl_if_info if_info[MAX_IF_NUM]; |
|---|
| 283 | 234 | #ifdef WLDWDS |
|---|
| 284 | 235 | struct wl_dwds_info dwds_info[MAX_DWDS_IF_NUM]; |
|---|
| 285 | 236 | #endif /* WLDWDS */ |
|---|
| 237 | + struct dhd_pub *dhd; |
|---|
| 238 | + int ioctl_ver; |
|---|
| 286 | 239 | bool init; |
|---|
| 287 | 240 | int rsdb; |
|---|
| 288 | 241 | bool vsdb; |
|---|
| .. | .. |
|---|
| 301 | 254 | #endif /* WLMESH && WL_ESCAN */ |
|---|
| 302 | 255 | struct mutex in4way_sync; |
|---|
| 303 | 256 | int sta_btc_mode; |
|---|
| 257 | + struct osl_timespec sta_disc_ts; |
|---|
| 258 | + struct osl_timespec sta_conn_ts; |
|---|
| 259 | + bool ap_recon_sta; |
|---|
| 260 | + wait_queue_head_t ap_recon_sta_event; |
|---|
| 261 | + struct ether_addr ap_disc_sta_bssid; |
|---|
| 262 | + struct osl_timespec ap_disc_sta_ts; |
|---|
| 304 | 263 | #ifdef TPUT_MONITOR |
|---|
| 305 | 264 | timer_list_compat_t monitor_timer; |
|---|
| 306 | 265 | int32 tput_sum; |
|---|
| .. | .. |
|---|
| 341 | 300 | ISAM_RC_AP_RESTART = 4, |
|---|
| 342 | 301 | ISAM_RC_AP_RESET = 5, |
|---|
| 343 | 302 | ISAM_RC_EAPOL_RESEND = 6, |
|---|
| 344 | | - ISAM_RC_KEY_INSTALL = 7, |
|---|
| 345 | | - ISAM_RC_RXF0OVFL_REINIT = 8 |
|---|
| 303 | + ISAM_RC_RXF0OVFL_REINIT = 7 |
|---|
| 346 | 304 | }; |
|---|
| 347 | 305 | |
|---|
| 348 | 306 | #define wl_get_isam_status(cur_if, stat) \ |
|---|
| .. | .. |
|---|
| 357 | 315 | static int wl_ext_enable_iface(struct net_device *dev, char *ifname, |
|---|
| 358 | 316 | int wait_up, bool lock); |
|---|
| 359 | 317 | static int wl_ext_disable_iface(struct net_device *dev, char *ifname); |
|---|
| 318 | +#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 319 | +static int wl_mesh_escan_attach(dhd_pub_t *dhd, struct wl_if_info *cur_if); |
|---|
| 320 | +#endif /* WLMESH && WL_ESCAN */ |
|---|
| 360 | 321 | |
|---|
| 361 | 322 | static struct wl_if_info * |
|---|
| 362 | 323 | wl_get_cur_if(struct net_device *dev) |
|---|
| .. | .. |
|---|
| 643 | 604 | } |
|---|
| 644 | 605 | |
|---|
| 645 | 606 | static int |
|---|
| 646 | | -wl_ext_set_emode(struct wl_if_info *cur_if) |
|---|
| 607 | +wl_ext_set_emode(struct wl_apsta_params *apsta_params, |
|---|
| 608 | + struct wl_if_info *cur_if) |
|---|
| 647 | 609 | { |
|---|
| 648 | 610 | struct net_device *dev = cur_if->dev; |
|---|
| 649 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 650 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 611 | + int wsec=0; |
|---|
| 651 | 612 | struct wl_wsec_key wsec_key; |
|---|
| 652 | 613 | wsec_pmk_t psk; |
|---|
| 653 | 614 | authmode_t amode = cur_if->amode; |
|---|
| 654 | 615 | encmode_t emode = cur_if->emode; |
|---|
| 655 | | - int wsec=0; |
|---|
| 656 | 616 | char *key = cur_if->key; |
|---|
| 617 | + struct dhd_pub *dhd = apsta_params->dhd; |
|---|
| 657 | 618 | |
|---|
| 658 | 619 | memset(&wsec_key, 0, sizeof(wsec_key)); |
|---|
| 659 | 620 | memset(&psk, 0, sizeof(psk)); |
|---|
| .. | .. |
|---|
| 749 | 710 | } |
|---|
| 750 | 711 | |
|---|
| 751 | 712 | static u32 |
|---|
| 752 | | -wl_ext_get_chanspec(struct net_device *dev, struct wl_chan_info *chan_info) |
|---|
| 713 | +wl_ext_get_chanspec(struct wl_apsta_params *apsta_params, |
|---|
| 714 | + struct net_device *dev, struct wl_chan_info *chan_info) |
|---|
| 753 | 715 | { |
|---|
| 754 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 755 | 716 | u32 chanspec = 0; |
|---|
| 756 | 717 | |
|---|
| 757 | 718 | if (wl_ext_associated(dev)) { |
|---|
| 758 | 719 | if (wl_ext_iovar_getint(dev, "chanspec", (s32 *)&chanspec) == BCME_OK) { |
|---|
| 759 | | - chanspec = wl_ext_chspec_driver_to_host(dhd, chanspec); |
|---|
| 720 | + chanspec = wl_ext_chspec_driver_to_host(apsta_params->ioctl_ver, chanspec); |
|---|
| 760 | 721 | if (chan_info) { |
|---|
| 761 | 722 | chan_info->band = CHSPEC2WLC_BAND(chanspec); |
|---|
| 762 | 723 | chan_info->chan = wf_chspec_ctlchan(chanspec); |
|---|
| .. | .. |
|---|
| 769 | 730 | } |
|---|
| 770 | 731 | |
|---|
| 771 | 732 | static uint16 |
|---|
| 772 | | -wl_ext_get_chan(struct net_device *dev, struct wl_chan_info *chan_info) |
|---|
| 733 | +wl_ext_get_chan(struct wl_apsta_params *apsta_params, |
|---|
| 734 | + struct net_device *dev, struct wl_chan_info *chan_info) |
|---|
| 773 | 735 | { |
|---|
| 774 | 736 | uint16 chan = 0, ctl_chan; |
|---|
| 775 | 737 | u32 chanspec = 0; |
|---|
| 776 | 738 | |
|---|
| 777 | | - chanspec = wl_ext_get_chanspec(dev, chan_info); |
|---|
| 739 | + chanspec = wl_ext_get_chanspec(apsta_params, dev, chan_info); |
|---|
| 778 | 740 | if (chanspec) { |
|---|
| 779 | 741 | ctl_chan = wf_chspec_ctlchan(chanspec); |
|---|
| 780 | 742 | chan = (u16)(ctl_chan & 0x00FF); |
|---|
| .. | .. |
|---|
| 783 | 745 | return chan; |
|---|
| 784 | 746 | } |
|---|
| 785 | 747 | |
|---|
| 786 | | -void |
|---|
| 787 | | -wl_ext_get_chan_str(struct net_device *dev, char *chan_str, int total_len) |
|---|
| 788 | | -{ |
|---|
| 789 | | - struct wl_chan_info chan_info; |
|---|
| 790 | | - int bytes_written=0; |
|---|
| 791 | | - u32 chanspec = 0; |
|---|
| 792 | | - |
|---|
| 793 | | - memset(chan_str, 0, total_len); |
|---|
| 794 | | - chanspec = wl_ext_get_chanspec(dev, &chan_info); |
|---|
| 795 | | - if (chanspec) { |
|---|
| 796 | | - bytes_written += snprintf(chan_str+bytes_written, total_len, "%s-%d %sMHz", |
|---|
| 797 | | - WLCBAND2STR(chan_info.band), chan_info.chan, |
|---|
| 798 | | - wf_chspec_to_bw_str(chanspec)); |
|---|
| 799 | | - } |
|---|
| 800 | | -} |
|---|
| 801 | | - |
|---|
| 802 | 748 | static chanspec_t |
|---|
| 803 | | -wl_ext_chan_to_chanspec(struct net_device *dev, struct wl_chan_info *chan_info) |
|---|
| 749 | +wl_ext_chan_to_chanspec(struct wl_apsta_params *apsta_params, |
|---|
| 750 | + struct net_device *dev, struct wl_chan_info *chan_info) |
|---|
| 804 | 751 | { |
|---|
| 805 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 806 | 752 | chanspec_band_t chanspec_band; |
|---|
| 807 | 753 | chanspec_t chspec = 0, fw_chspec = 0; |
|---|
| 808 | 754 | u32 bw = WL_CHANSPEC_BW_20; |
|---|
| .. | .. |
|---|
| 844 | 790 | chanspec_band = wl_ext_wlcband_to_chanspec_band(chan_info->band); |
|---|
| 845 | 791 | chspec = wf_create_chspec_from_primary(chan_info->chan, bw, chanspec_band); |
|---|
| 846 | 792 | if (wf_chspec_valid(chspec)) { |
|---|
| 847 | | - fw_chspec = wl_ext_chspec_host_to_driver(dhd, chspec); |
|---|
| 793 | + fw_chspec = wl_ext_chspec_host_to_driver(apsta_params->ioctl_ver, chspec); |
|---|
| 848 | 794 | if (fw_chspec == INVCHANSPEC) { |
|---|
| 849 | 795 | IAPSTA_ERROR(dev->name, "failed to convert host chanspec to fw chanspec\n"); |
|---|
| 850 | 796 | fw_chspec = 0; |
|---|
| .. | .. |
|---|
| 901 | 847 | return bytes_written; |
|---|
| 902 | 848 | } |
|---|
| 903 | 849 | |
|---|
| 904 | | -void |
|---|
| 905 | | -wl_ext_send_event_msg(struct net_device *dev, int event, int status, |
|---|
| 906 | | - int reason) |
|---|
| 850 | +static void |
|---|
| 851 | +wl_ext_mod_timer(timer_list_compat_t *timer, uint sec, uint msec) |
|---|
| 852 | +{ |
|---|
| 853 | + uint timeout = sec * 1000 + msec; |
|---|
| 854 | + |
|---|
| 855 | + IAPSTA_TRACE("wlan", "timeout=%d\n", timeout); |
|---|
| 856 | + |
|---|
| 857 | + if (timer_pending(timer)) |
|---|
| 858 | + del_timer_sync(timer); |
|---|
| 859 | + |
|---|
| 860 | + if (timeout) |
|---|
| 861 | + mod_timer(timer, jiffies + msecs_to_jiffies(timeout)); |
|---|
| 862 | +} |
|---|
| 863 | + |
|---|
| 864 | +static void |
|---|
| 865 | +wl_ext_send_event_msg(struct net_device *dev, int event, int status) |
|---|
| 907 | 866 | { |
|---|
| 908 | 867 | struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 909 | 868 | struct wl_if_info *cur_if; |
|---|
| 910 | 869 | wl_event_msg_t msg; |
|---|
| 911 | 870 | |
|---|
| 912 | | - if (dhd && dhd->up) { |
|---|
| 913 | | - cur_if = wl_get_cur_if(dev); |
|---|
| 914 | | - if (!cur_if) |
|---|
| 915 | | - return; |
|---|
| 916 | | - bzero(&msg, sizeof(wl_event_msg_t)); |
|---|
| 917 | | - msg.ifidx = dhd_net2idx(dhd->info, dev); |
|---|
| 918 | | - msg.event_type = hton32(event); |
|---|
| 919 | | - msg.status = hton32(status); |
|---|
| 920 | | - msg.reason = hton32(reason); |
|---|
| 921 | | - memcpy(&msg.addr, &cur_if->bssid, ETHER_ADDR_LEN); |
|---|
| 871 | + cur_if = wl_get_cur_if(dev); |
|---|
| 872 | + if (!cur_if) |
|---|
| 873 | + return; |
|---|
| 874 | + |
|---|
| 875 | + bzero(&msg, sizeof(wl_event_msg_t)); |
|---|
| 876 | + |
|---|
| 877 | + msg.ifidx = dhd_net2idx(dhd->info, dev); |
|---|
| 878 | + msg.event_type = hton32(event); |
|---|
| 879 | + msg.status = hton32(status); |
|---|
| 880 | + memcpy(&msg.addr, &cur_if->bssid, ETHER_ADDR_LEN); |
|---|
| 881 | + |
|---|
| 922 | 882 | #ifdef WL_EVENT |
|---|
| 923 | | - wl_ext_event_send(dhd->event_params, &msg, NULL); |
|---|
| 924 | | -#endif /* WL_EVENT */ |
|---|
| 883 | + wl_ext_event_send(dhd->event_params, &msg, NULL); |
|---|
| 884 | +#endif |
|---|
| 925 | 885 | #ifdef WL_CFG80211 |
|---|
| 886 | + if (dhd->up) { |
|---|
| 926 | 887 | wl_cfg80211_event(dev, &msg, NULL); |
|---|
| 927 | | -#endif /* WL_CFG80211 */ |
|---|
| 928 | 888 | } |
|---|
| 889 | +#endif /* defined(WL_CFG80211) */ |
|---|
| 929 | 890 | } |
|---|
| 930 | | - |
|---|
| 931 | | -#ifdef BTC_WAR |
|---|
| 932 | | -bool |
|---|
| 933 | | -wl_ext_iapsta_if_2g_enabled(struct net_device *net) |
|---|
| 934 | | -{ |
|---|
| 935 | | - struct dhd_pub *dhd = dhd_get_pub(net); |
|---|
| 936 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 937 | | - struct wl_if_info *tmp_if; |
|---|
| 938 | | - struct wl_chan_info chan_info; |
|---|
| 939 | | - bool enabled = FALSE; |
|---|
| 940 | | - uint16 cur_chan; |
|---|
| 941 | | - int i; |
|---|
| 942 | | - |
|---|
| 943 | | - for (i=0; i<MAX_IF_NUM; i++) { |
|---|
| 944 | | - tmp_if = &apsta_params->if_info[i]; |
|---|
| 945 | | - if (tmp_if && wl_get_isam_status(tmp_if, IF_READY)) { |
|---|
| 946 | | - cur_chan = wl_ext_get_chan(tmp_if->dev, &chan_info); |
|---|
| 947 | | - if (cur_chan && chan_info.band == WLC_BAND_2G) { |
|---|
| 948 | | - enabled = TRUE; |
|---|
| 949 | | - break; |
|---|
| 950 | | - } |
|---|
| 951 | | - } |
|---|
| 952 | | - } |
|---|
| 953 | | - |
|---|
| 954 | | - return enabled; |
|---|
| 955 | | -} |
|---|
| 956 | | - |
|---|
| 957 | | -void |
|---|
| 958 | | -wl_ext_btc_config(struct net_device *dev, bool enable) |
|---|
| 959 | | -{ |
|---|
| 960 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 961 | | - bool enab = FALSE; |
|---|
| 962 | | - |
|---|
| 963 | | - if (dhd->conf->chip == BCM4354_CHIP_ID || dhd->conf->chip == BCM4356_CHIP_ID || |
|---|
| 964 | | - dhd->conf->chip == BCM43752_CHIP_ID) { |
|---|
| 965 | | - IAPSTA_INFO(dev->name, "btc_war=%d, enable=%d\n", btc_war, enable); |
|---|
| 966 | | - if (btc_war >= 0) { |
|---|
| 967 | | - if (enable && btc_war > 0) { |
|---|
| 968 | | - if (wl_ext_iapsta_if_2g_enabled(dev)) |
|---|
| 969 | | - enab = TRUE; |
|---|
| 970 | | - } |
|---|
| 971 | | - if (enab) { |
|---|
| 972 | | - IAPSTA_INFO(dev->name, "enable\n"); |
|---|
| 973 | | - wl_ext_iovar_setint(dev, "txchain", 2); |
|---|
| 974 | | - wl_ext_iovar_setint(dev, "rxchain", 2); |
|---|
| 975 | | - wl_ext_iovar_setint(dev, "btc_mode", 5); |
|---|
| 976 | | - } else { |
|---|
| 977 | | - IAPSTA_INFO(dev->name, "disable\n"); |
|---|
| 978 | | - wl_ext_iovar_setint(dev, "btc_mode", 1); |
|---|
| 979 | | - wl_ext_iovar_setint(dev, "txchain", 3); |
|---|
| 980 | | - wl_ext_iovar_setint(dev, "rxchain", 3); |
|---|
| 981 | | - } |
|---|
| 982 | | - } |
|---|
| 983 | | - } |
|---|
| 984 | | -} |
|---|
| 985 | | -#endif /* BTC_WAR */ |
|---|
| 986 | 891 | |
|---|
| 987 | 892 | static void |
|---|
| 988 | 893 | wl_ext_connect_timeout(unsigned long data) |
|---|
| .. | .. |
|---|
| 1003 | 908 | cur_if->assoc_info.reassoc = 0; |
|---|
| 1004 | 909 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 1005 | 910 | IAPSTA_ERROR(dev->name, "timer expired\n"); |
|---|
| 1006 | | - wl_ext_send_event_msg(dev, WLC_E_SET_SSID, WLC_E_STATUS_NO_NETWORKS, WLC_E_STATUS_SUCCESS); |
|---|
| 911 | + wl_ext_send_event_msg(dev, WLC_E_SET_SSID, WLC_E_STATUS_NO_NETWORKS); |
|---|
| 1007 | 912 | } |
|---|
| 1008 | 913 | |
|---|
| 1009 | 914 | #if defined(WL_CFG80211) || (defined(WLMESH) && defined(WL_ESCAN)) |
|---|
| .. | .. |
|---|
| 1131 | 1036 | } |
|---|
| 1132 | 1037 | |
|---|
| 1133 | 1038 | #ifdef WL_ESCAN |
|---|
| 1134 | | -#define WL_MESH_DELAY_SCAN_TMO 3000 |
|---|
| 1039 | +#define WL_MESH_DELAY_SCAN_TMO 3 |
|---|
| 1135 | 1040 | static void |
|---|
| 1136 | 1041 | wl_mesh_timer(unsigned long data) |
|---|
| 1137 | 1042 | { |
|---|
| .. | .. |
|---|
| 1223 | 1128 | } |
|---|
| 1224 | 1129 | |
|---|
| 1225 | 1130 | static int |
|---|
| 1226 | | -wl_mesh_clear_mesh_info(struct wl_if_info *mesh_if, bool scan) |
|---|
| 1131 | +wl_mesh_clear_mesh_info(struct wl_apsta_params *apsta_params, |
|---|
| 1132 | + struct wl_if_info *mesh_if, bool scan) |
|---|
| 1227 | 1133 | { |
|---|
| 1228 | | - struct dhd_pub *dhd = dhd_get_pub(mesh_if->dev); |
|---|
| 1229 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 1230 | 1134 | struct wl_mesh_params *mesh_info = &apsta_params->mesh_info; |
|---|
| 1231 | 1135 | uchar mesh_oui[]={0x00, 0x22, 0xf4}; |
|---|
| 1232 | 1136 | int ret; |
|---|
| .. | .. |
|---|
| 1236 | 1140 | ret = wl_mesh_clear_vndr_ie(mesh_if->dev, mesh_oui); |
|---|
| 1237 | 1141 | memset(mesh_info, 0, sizeof(struct wl_mesh_params)); |
|---|
| 1238 | 1142 | if (scan) { |
|---|
| 1239 | | - mesh_info->scan_channel = wl_ext_get_chan(mesh_if->dev, |
|---|
| 1143 | + mesh_info->scan_channel = wl_ext_get_chan(apsta_params, mesh_if->dev, |
|---|
| 1240 | 1144 | &mesh_if->chan_info); |
|---|
| 1241 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, 100); |
|---|
| 1145 | + wl_ext_mod_timer(&mesh_if->delay_scan, 0, 100); |
|---|
| 1242 | 1146 | } |
|---|
| 1243 | 1147 | |
|---|
| 1244 | 1148 | return ret; |
|---|
| .. | .. |
|---|
| 1317 | 1221 | if (sta_if) { |
|---|
| 1318 | 1222 | wldev_ioctl(mesh_if->dev, WLC_GET_BSSID, &mesh_info->master_bssid, |
|---|
| 1319 | 1223 | ETHER_ADDR_LEN, 0); |
|---|
| 1320 | | - mesh_info->master_channel = wl_ext_get_chan(mesh_if->dev, &mesh_if->chan_info); |
|---|
| 1224 | + mesh_info->master_channel = wl_ext_get_chan(apsta_params, mesh_if->dev, |
|---|
| 1225 | + &mesh_if->chan_info); |
|---|
| 1321 | 1226 | mesh_info->hop_cnt = 0; |
|---|
| 1322 | 1227 | memset(mesh_info->peer_bssid, 0, MAX_HOP_LIST*ETHER_ADDR_LEN); |
|---|
| 1323 | 1228 | if (!wl_mesh_update_vndr_ie(apsta_params, mesh_if)) |
|---|
| .. | .. |
|---|
| 1393 | 1298 | wl_ext_get_sec(mesh_if->dev, mesh_if->ifmode, sec, sizeof(sec), FALSE); |
|---|
| 1394 | 1299 | if (strnicmp(sec, "sae/sae", strlen("sae/sae")) == 0) |
|---|
| 1395 | 1300 | sae = TRUE; |
|---|
| 1396 | | - cur_chan = wl_ext_get_chan(mesh_if->dev, &mesh_if->chan_info); |
|---|
| 1301 | + cur_chan = wl_ext_get_chan(apsta_params, mesh_if->dev, |
|---|
| 1302 | + &mesh_if->chan_info); |
|---|
| 1397 | 1303 | bss_found = wl_escan_mesh_peer(mesh_if->dev, mesh_if->escan, &cur_ssid, cur_chan, |
|---|
| 1398 | 1304 | sae, &peer_mesh_info); |
|---|
| 1399 | 1305 | |
|---|
| .. | .. |
|---|
| 1414 | 1320 | } |
|---|
| 1415 | 1321 | |
|---|
| 1416 | 1322 | static void |
|---|
| 1417 | | -wl_mesh_event_handler(struct wl_if_info *cur_if, |
|---|
| 1418 | | - const wl_event_msg_t *e, void *data) |
|---|
| 1323 | +wl_mesh_event_handler(struct wl_apsta_params *apsta_params, |
|---|
| 1324 | + struct wl_if_info *mesh_if, const wl_event_msg_t *e, void *data) |
|---|
| 1419 | 1325 | { |
|---|
| 1420 | | - struct dhd_pub *dhd = dhd_get_pub(cur_if->dev); |
|---|
| 1421 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 1422 | 1326 | struct wl_mesh_params *mesh_info = &apsta_params->mesh_info; |
|---|
| 1423 | 1327 | uint32 event_type = ntoh32(e->event_type); |
|---|
| 1424 | 1328 | uint32 status = ntoh32(e->status); |
|---|
| 1425 | 1329 | uint32 reason = ntoh32(e->reason); |
|---|
| 1426 | | - uint16 flags = ntoh16(e->flags); |
|---|
| 1427 | | - struct wl_if_info *mesh_if = NULL, *tmp_if = NULL; |
|---|
| 1428 | | - int ret, i; |
|---|
| 1330 | + int ret; |
|---|
| 1429 | 1331 | |
|---|
| 1430 | | - if (cur_if->ifmode == IMESH_MODE) |
|---|
| 1431 | | - mesh_if = cur_if; |
|---|
| 1432 | | - else { |
|---|
| 1433 | | - for (i=0; i<MAX_IF_NUM; i++) { |
|---|
| 1434 | | - tmp_if = &apsta_params->if_info[i]; |
|---|
| 1435 | | - if (tmp_if->dev && tmp_if->ifmode == IMESH_MODE) { |
|---|
| 1436 | | - mesh_if = tmp_if; |
|---|
| 1437 | | - break; |
|---|
| 1438 | | - } |
|---|
| 1332 | + if (wl_get_isam_status(mesh_if, AP_CREATED) && |
|---|
| 1333 | + ((event_type == WLC_E_SET_SSID && status == WLC_E_STATUS_SUCCESS) || |
|---|
| 1334 | + (event_type == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
|---|
| 1335 | + reason == WLC_E_REASON_INITIAL_ASSOC))) { |
|---|
| 1336 | + if (!wl_mesh_update_master_info(apsta_params, mesh_if)) { |
|---|
| 1337 | + mesh_info->scan_channel = wl_ext_get_chan(apsta_params, &mesh_if->dev, |
|---|
| 1338 | + mesh_if->chan_info); |
|---|
| 1339 | + wl_ext_mod_timer(&mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO, 0); |
|---|
| 1439 | 1340 | } |
|---|
| 1440 | 1341 | } |
|---|
| 1441 | | - |
|---|
| 1442 | | - if (cur_if->ifmode == ISTA_MODE || cur_if->ifmode == IGC_MODE) { |
|---|
| 1443 | | - if (event_type == WLC_E_LINK) { |
|---|
| 1444 | | - if (!(flags & WLC_EVENT_MSG_LINK)) { |
|---|
| 1445 | | - if (mesh_if && apsta_params->macs) |
|---|
| 1446 | | - wl_mesh_clear_mesh_info(mesh_if, TRUE); |
|---|
| 1447 | | - } else { |
|---|
| 1448 | | - if (mesh_if && apsta_params->macs) |
|---|
| 1449 | | - wl_mesh_update_master_info(apsta_params, mesh_if); |
|---|
| 1342 | + else if ((event_type == WLC_E_LINK && reason == WLC_E_LINK_BSSCFG_DIS) || |
|---|
| 1343 | + (event_type == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
|---|
| 1344 | + reason == WLC_E_REASON_DEAUTH)) { |
|---|
| 1345 | + wl_mesh_clear_mesh_info(apsta_params, mesh_if, FALSE); |
|---|
| 1346 | + } |
|---|
| 1347 | + else if (wl_get_isam_status(mesh_if, AP_CREATED) && |
|---|
| 1348 | + (event_type == WLC_E_ASSOC_IND || event_type == WLC_E_REASSOC_IND) && |
|---|
| 1349 | + reason == DOT11_SC_SUCCESS) { |
|---|
| 1350 | + mesh_info->scan_channel = wl_ext_get_chan(apsta_params, mesh_if->dev, |
|---|
| 1351 | + &mesh_if->chan_info); |
|---|
| 1352 | + wl_ext_mod_timer(&mesh_if->delay_scan, 0, 100); |
|---|
| 1353 | + } |
|---|
| 1354 | + else if (event_type == WLC_E_DISASSOC_IND || event_type == WLC_E_DEAUTH_IND || |
|---|
| 1355 | + (event_type == WLC_E_DEAUTH && reason != DOT11_RC_RESERVED)) { |
|---|
| 1356 | + if (!memcmp(&mesh_info->peer_bssid, &e->addr, ETHER_ADDR_LEN)) |
|---|
| 1357 | + wl_mesh_clear_mesh_info(apsta_params, mesh_if, TRUE); |
|---|
| 1358 | + } |
|---|
| 1359 | + else if (wl_get_isam_status(mesh_if, AP_CREATED) && |
|---|
| 1360 | + event_type == WLC_E_RESERVED && reason == ISAM_RC_MESH_ACS) { |
|---|
| 1361 | + if (!wl_mesh_update_master_info(apsta_params, mesh_if)) { |
|---|
| 1362 | + wl_scan_info_t scan_info; |
|---|
| 1363 | + memset(&scan_info, 0, sizeof(wl_scan_info_t)); |
|---|
| 1364 | + wl_ext_ioctl(mesh_if->dev, WLC_GET_SSID, &scan_info.ssid, sizeof(wlc_ssid_t), 0); |
|---|
| 1365 | + if (mesh_info->scan_channel) { |
|---|
| 1366 | + scan_info.channels.count = 1; |
|---|
| 1367 | + scan_info.channels.channel[0] = mesh_info->scan_channel; |
|---|
| 1450 | 1368 | } |
|---|
| 1451 | | - } |
|---|
| 1452 | | - else if (event_type == WLC_E_SET_SSID && status != WLC_E_STATUS_SUCCESS) { |
|---|
| 1453 | | - if (mesh_if && apsta_params->macs) |
|---|
| 1454 | | - wl_mesh_clear_mesh_info(mesh_if, TRUE); |
|---|
| 1455 | | - } |
|---|
| 1456 | | - else if (event_type == WLC_E_DEAUTH || event_type == WLC_E_DEAUTH_IND || |
|---|
| 1457 | | - event_type == WLC_E_DISASSOC || event_type == WLC_E_DISASSOC_IND) { |
|---|
| 1458 | | - if (mesh_if && apsta_params->macs) |
|---|
| 1459 | | - wl_mesh_clear_mesh_info(mesh_if, TRUE); |
|---|
| 1369 | + ret = wl_escan_set_scan(mesh_if->dev, &scan_info); |
|---|
| 1370 | + if (ret) |
|---|
| 1371 | + wl_ext_mod_timer(&mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO, 0); |
|---|
| 1460 | 1372 | } |
|---|
| 1461 | 1373 | } |
|---|
| 1462 | | - else if (cur_if->ifmode == IMESH_MODE && apsta_params->macs) { |
|---|
| 1463 | | - if (wl_get_isam_status(mesh_if, AP_CREATED) && |
|---|
| 1464 | | - ((event_type == WLC_E_SET_SSID && status == WLC_E_STATUS_SUCCESS) || |
|---|
| 1465 | | - (event_type == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
|---|
| 1466 | | - reason == WLC_E_REASON_INITIAL_ASSOC))) { |
|---|
| 1467 | | - if (!wl_mesh_update_master_info(apsta_params, mesh_if)) { |
|---|
| 1468 | | - mesh_info->scan_channel = wl_ext_get_chan(&mesh_if->dev, |
|---|
| 1469 | | - mesh_if->chan_info); |
|---|
| 1470 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO); |
|---|
| 1471 | | - } |
|---|
| 1472 | | - } |
|---|
| 1473 | | - else if ((event_type == WLC_E_LINK && reason == WLC_E_LINK_BSSCFG_DIS) || |
|---|
| 1474 | | - (event_type == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
|---|
| 1475 | | - reason == WLC_E_REASON_DEAUTH)) { |
|---|
| 1476 | | - wl_mesh_clear_mesh_info(mesh_if, FALSE); |
|---|
| 1477 | | - } |
|---|
| 1478 | | - else if (wl_get_isam_status(mesh_if, AP_CREATED) && |
|---|
| 1479 | | - (event_type == WLC_E_ASSOC_IND || event_type == WLC_E_REASSOC_IND) && |
|---|
| 1480 | | - reason == DOT11_SC_SUCCESS) { |
|---|
| 1481 | | - mesh_info->scan_channel = wl_ext_get_chan(mesh_if->dev, |
|---|
| 1482 | | - &mesh_if->chan_info); |
|---|
| 1483 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, 100); |
|---|
| 1484 | | - } |
|---|
| 1485 | | - else if (event_type == WLC_E_DISASSOC_IND || event_type == WLC_E_DEAUTH_IND || |
|---|
| 1486 | | - (event_type == WLC_E_DEAUTH && reason != DOT11_RC_RESERVED)) { |
|---|
| 1487 | | - if (!memcmp(&mesh_info->peer_bssid, &e->addr, ETHER_ADDR_LEN)) |
|---|
| 1488 | | - wl_mesh_clear_mesh_info(mesh_if, TRUE); |
|---|
| 1489 | | - } |
|---|
| 1490 | | - else if (wl_get_isam_status(mesh_if, AP_CREATED) && |
|---|
| 1491 | | - event_type == WLC_E_RESERVED && reason == ISAM_RC_MESH_ACS) { |
|---|
| 1492 | | - if (!wl_mesh_update_master_info(apsta_params, mesh_if)) { |
|---|
| 1493 | | - wl_scan_info_t scan_info; |
|---|
| 1494 | | - memset(&scan_info, 0, sizeof(wl_scan_info_t)); |
|---|
| 1495 | | - wl_ext_ioctl(mesh_if->dev, WLC_GET_SSID, &scan_info.ssid, sizeof(wlc_ssid_t), 0); |
|---|
| 1496 | | - if (mesh_info->scan_channel) { |
|---|
| 1497 | | - scan_info.channels.count = 1; |
|---|
| 1498 | | - scan_info.channels.channel[0] = mesh_info->scan_channel; |
|---|
| 1499 | | - } |
|---|
| 1500 | | - ret = wl_escan_set_scan(mesh_if->dev, &scan_info); |
|---|
| 1501 | | - if (ret) |
|---|
| 1502 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO); |
|---|
| 1503 | | - } |
|---|
| 1504 | | - } |
|---|
| 1505 | | - else if (wl_get_isam_status(mesh_if, AP_CREATED) && |
|---|
| 1506 | | - ((event_type == WLC_E_ESCAN_RESULT && status == WLC_E_STATUS_SUCCESS) || |
|---|
| 1507 | | - (event_type == WLC_E_ESCAN_RESULT && |
|---|
| 1508 | | - (status == WLC_E_STATUS_ABORT || status == WLC_E_STATUS_NEWSCAN || |
|---|
| 1509 | | - status == WLC_E_STATUS_11HQUIET || status == WLC_E_STATUS_CS_ABORT || |
|---|
| 1510 | | - status == WLC_E_STATUS_NEWASSOC || status == WLC_E_STATUS_TIMEOUT)))) { |
|---|
| 1511 | | - if (!wl_mesh_update_master_info(apsta_params, mesh_if)) { |
|---|
| 1512 | | - if (!wl_mesh_update_mesh_info(apsta_params, mesh_if)) { |
|---|
| 1513 | | - mesh_info->scan_channel = 0; |
|---|
| 1514 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO); |
|---|
| 1515 | | - } |
|---|
| 1374 | + else if (wl_get_isam_status(mesh_if, AP_CREATED) && |
|---|
| 1375 | + ((event_type == WLC_E_ESCAN_RESULT && status == WLC_E_STATUS_SUCCESS) || |
|---|
| 1376 | + (event_type == WLC_E_ESCAN_RESULT && |
|---|
| 1377 | + (status == WLC_E_STATUS_ABORT || status == WLC_E_STATUS_NEWSCAN || |
|---|
| 1378 | + status == WLC_E_STATUS_11HQUIET || status == WLC_E_STATUS_CS_ABORT || |
|---|
| 1379 | + status == WLC_E_STATUS_NEWASSOC || status == WLC_E_STATUS_TIMEOUT)))) { |
|---|
| 1380 | + if (!wl_mesh_update_master_info(apsta_params, mesh_if)) { |
|---|
| 1381 | + if (!wl_mesh_update_mesh_info(apsta_params, mesh_if)) { |
|---|
| 1382 | + mesh_info->scan_channel = 0; |
|---|
| 1383 | + wl_ext_mod_timer(&mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO, 0); |
|---|
| 1516 | 1384 | } |
|---|
| 1517 | 1385 | } |
|---|
| 1518 | 1386 | } |
|---|
| .. | .. |
|---|
| 1522 | 1390 | wl_mesh_escan_detach(dhd_pub_t *dhd, struct wl_if_info *mesh_if) |
|---|
| 1523 | 1391 | { |
|---|
| 1524 | 1392 | IAPSTA_TRACE(mesh_if->dev->name, "Enter\n"); |
|---|
| 1525 | | - wl_timer_deregister(mesh_if->dev, &mesh_if->delay_scan); |
|---|
| 1393 | + |
|---|
| 1394 | + del_timer_sync(&mesh_if->delay_scan); |
|---|
| 1395 | + |
|---|
| 1526 | 1396 | if (mesh_if->escan) { |
|---|
| 1527 | 1397 | mesh_if->escan = NULL; |
|---|
| 1528 | 1398 | } |
|---|
| .. | .. |
|---|
| 1534 | 1404 | IAPSTA_TRACE(mesh_if->dev->name, "Enter\n"); |
|---|
| 1535 | 1405 | |
|---|
| 1536 | 1406 | mesh_if->escan = dhd->escan; |
|---|
| 1537 | | - wl_timer_register(mesh_if->dev, &mesh_if->delay_scan, wl_mesh_timer); |
|---|
| 1407 | + init_timer_compat(&mesh_if->delay_scan, wl_mesh_timer, mesh_if->dev); |
|---|
| 1538 | 1408 | |
|---|
| 1539 | 1409 | return 0; |
|---|
| 1540 | 1410 | } |
|---|
| .. | .. |
|---|
| 1709 | 1579 | WL_MSG(cur_if->ifname, "[%c] skip DFS channel %d\n", |
|---|
| 1710 | 1580 | cur_if->prefix, chan_info->chan); |
|---|
| 1711 | 1581 | return 0; |
|---|
| 1712 | | - } else if (wl_ext_passive_chan(cur_if->dev, chan_info)) { |
|---|
| 1713 | | - WL_MSG(cur_if->ifname, "[%c] skip PASSIVE channel %d\n", |
|---|
| 1714 | | - cur_if->prefix, chan_info->chan); |
|---|
| 1715 | | - return 0; |
|---|
| 1716 | 1582 | } else if (!chan_info->chan) { |
|---|
| 1717 | 1583 | WL_MSG(cur_if->ifname, "[%c] no valid channel\n", cur_if->prefix); |
|---|
| 1718 | 1584 | return 0; |
|---|
| .. | .. |
|---|
| 1747 | 1613 | } |
|---|
| 1748 | 1614 | |
|---|
| 1749 | 1615 | wl_ext_ioctl(cur_if->dev, WLC_GET_SSID, &ssid, sizeof(ssid), 0); |
|---|
| 1750 | | - chanspec = wl_ext_get_chanspec(cur_if->dev, chan_info); |
|---|
| 1616 | + chanspec = wl_ext_get_chanspec(apsta_params, cur_if->dev, chan_info); |
|---|
| 1751 | 1617 | WL_MSG(cur_if->ifname, "[%c] enabled with SSID: \"%s\" on channel %s-%d(0x%x)\n", |
|---|
| 1752 | 1618 | cur_if->prefix, ssid.SSID, CHSPEC2BANDSTR(chanspec), |
|---|
| 1753 | 1619 | chan_info->chan, chanspec); |
|---|
| .. | .. |
|---|
| 1797 | 1663 | if (cur_if != tmp_if && wl_get_isam_status(tmp_if, IF_READY) && |
|---|
| 1798 | 1664 | tmp_if->prio > max_prio) { |
|---|
| 1799 | 1665 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 1800 | | - wl_ext_get_chan(tmp_if->dev, &chan_info); |
|---|
| 1666 | + wl_ext_get_chan(apsta_params, tmp_if->dev, &chan_info); |
|---|
| 1801 | 1667 | if (wl_ext_dfs_chan(&chan_info) && nodfs) |
|---|
| 1802 | 1668 | continue; |
|---|
| 1803 | 1669 | if (chan_info.chan && (cur_if->chan_info.band == chan_info.band)) { |
|---|
| .. | .. |
|---|
| 1824 | 1690 | return 0; |
|---|
| 1825 | 1691 | |
|---|
| 1826 | 1692 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 1827 | | - target_chan = wl_ext_get_chan(target_if->dev, &chan_info); |
|---|
| 1693 | + target_chan = wl_ext_get_chan(apsta_params, target_if->dev, &chan_info); |
|---|
| 1828 | 1694 | if (target_chan) { |
|---|
| 1829 | 1695 | target_band = chan_info.band; |
|---|
| 1830 | 1696 | IAPSTA_INFO(cur_if->ifname, "cur_chan=%s-%d, target_chan=%s-%d\n", |
|---|
| .. | .. |
|---|
| 1852 | 1718 | |
|---|
| 1853 | 1719 | if (apsta_params->rsdb) { |
|---|
| 1854 | 1720 | memset(&cur_chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 1855 | | - wl_ext_get_chan(cur_if->dev, &cur_chan_info); |
|---|
| 1721 | + wl_ext_get_chan(apsta_params, cur_if->dev, &cur_chan_info); |
|---|
| 1856 | 1722 | for (i=0; i<MAX_IF_NUM; i++) { |
|---|
| 1857 | 1723 | tmp_if = &apsta_params->if_info[i]; |
|---|
| 1858 | 1724 | if (tmp_if != cur_if && wl_get_isam_status(tmp_if, IF_READY) && |
|---|
| 1859 | 1725 | tmp_if->prio > cur_if->prio) { |
|---|
| 1860 | 1726 | memset(&tmp_chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 1861 | | - wl_ext_get_chan(tmp_if->dev, &tmp_chan_info); |
|---|
| 1727 | + wl_ext_get_chan(apsta_params, tmp_if->dev, &tmp_chan_info); |
|---|
| 1862 | 1728 | if (!tmp_chan_info.chan) |
|---|
| 1863 | 1729 | continue; |
|---|
| 1864 | 1730 | if (wl_ext_rsdb_band(cur_chan_info.band, tmp_chan_info.band) && |
|---|
| .. | .. |
|---|
| 1891 | 1757 | memset(&csa_arg, 0, sizeof(csa_arg)); |
|---|
| 1892 | 1758 | csa_arg.mode = 1; |
|---|
| 1893 | 1759 | csa_arg.count = 3; |
|---|
| 1894 | | - csa_arg.chspec = wl_ext_chan_to_chanspec(cur_if->dev, &cur_if->chan_info); |
|---|
| 1760 | + csa_arg.chspec = wl_ext_chan_to_chanspec(apsta_params, cur_if->dev, |
|---|
| 1761 | + &cur_if->chan_info); |
|---|
| 1895 | 1762 | core_conflict = wl_ext_rsdb_core_conflict(apsta_params, cur_if); |
|---|
| 1896 | 1763 | if (core_conflict) { |
|---|
| 1897 | 1764 | WL_MSG(cur_if->ifname, "[%c] Skip CSA due to rsdb core conflict\n", |
|---|
| .. | .. |
|---|
| 1940 | 1807 | if (!auto_chan) { |
|---|
| 1941 | 1808 | auto_chan = wl_ext_autochannel(cur_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
|---|
| 1942 | 1809 | cur_chan_info->band); |
|---|
| 1943 | | - auto_chan = wf_chspec_ctlchan(auto_chan); |
|---|
| 1944 | 1810 | } |
|---|
| 1945 | 1811 | if (auto_chan) |
|---|
| 1946 | 1812 | cur_chan_info->chan = auto_chan; |
|---|
| .. | .. |
|---|
| 1962 | 1828 | if (!auto_chan) { |
|---|
| 1963 | 1829 | auto_chan = wl_ext_autochannel(cur_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
|---|
| 1964 | 1830 | cur_chan_info->band); |
|---|
| 1965 | | - auto_chan = wf_chspec_ctlchan(auto_chan); |
|---|
| 1966 | 1831 | } |
|---|
| 1967 | 1832 | if (auto_chan) { |
|---|
| 1968 | 1833 | cur_chan_info->chan = auto_chan; |
|---|
| .. | .. |
|---|
| 1976 | 1841 | } else { |
|---|
| 1977 | 1842 | auto_chan = wl_ext_autochannel(cur_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
|---|
| 1978 | 1843 | cur_chan_info->band); |
|---|
| 1979 | | - auto_chan = wf_chspec_ctlchan(auto_chan); |
|---|
| 1980 | 1844 | if (auto_chan) { |
|---|
| 1981 | 1845 | cur_chan_info->chan = auto_chan; |
|---|
| 1982 | 1846 | } |
|---|
| .. | .. |
|---|
| 2015 | 1879 | if (!auto_chan) { |
|---|
| 2016 | 1880 | auto_chan = wl_ext_autochannel(tgt_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
|---|
| 2017 | 1881 | tgt_chan_info->band); |
|---|
| 2018 | | - auto_chan = wf_chspec_ctlchan(auto_chan); |
|---|
| 2019 | 1882 | } |
|---|
| 2020 | 1883 | if (auto_chan) { |
|---|
| 2021 | 1884 | tgt_chan_info->chan = auto_chan; |
|---|
| .. | .. |
|---|
| 2028 | 1891 | if (!auto_chan) { |
|---|
| 2029 | 1892 | auto_chan = wl_ext_autochannel(tgt_if->dev, ACS_FW_BIT|ACS_DRV_BIT, |
|---|
| 2030 | 1893 | tgt_chan_info->band); |
|---|
| 2031 | | - auto_chan = wf_chspec_ctlchan(auto_chan); |
|---|
| 2032 | 1894 | } |
|---|
| 2033 | 1895 | } else { |
|---|
| 2034 | 1896 | tgt_chan_info->chan = 0; |
|---|
| .. | .. |
|---|
| 2076 | 1938 | if (target_if) { |
|---|
| 2077 | 1939 | memset(&cur_chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 2078 | 1940 | memset(&tgt_chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 2079 | | - wl_ext_get_chan(cur_if->dev, &cur_chan_info); |
|---|
| 2080 | | - wl_ext_get_chan(target_if->dev, &tgt_chan_info); |
|---|
| 1941 | + wl_ext_get_chan(apsta_params, cur_if->dev, &cur_chan_info); |
|---|
| 1942 | + wl_ext_get_chan(apsta_params, target_if->dev, &tgt_chan_info); |
|---|
| 2081 | 1943 | if (apsta_params->rsdb && cur_chan_info.chan && |
|---|
| 2082 | 1944 | wl_ext_rsdb_band(cur_chan_info.band, tgt_chan_info.band)) { |
|---|
| 2083 | 1945 | WL_MSG(cur_if->ifname, "[%c] keep on current channel %s-%d\n", |
|---|
| .. | .. |
|---|
| 2239 | 2101 | return connecting; |
|---|
| 2240 | 2102 | } |
|---|
| 2241 | 2103 | |
|---|
| 2242 | | -bool |
|---|
| 2243 | | -wl_ext_sta_handshaking(struct net_device *dev) |
|---|
| 2244 | | -{ |
|---|
| 2245 | | - struct wl_if_info *cur_if = NULL; |
|---|
| 2246 | | - bool connecting = FALSE; |
|---|
| 2247 | | - int state; |
|---|
| 2248 | | - |
|---|
| 2249 | | - cur_if = wl_get_cur_if(dev); |
|---|
| 2250 | | - if (!cur_if) |
|---|
| 2251 | | - return FALSE; |
|---|
| 2252 | | - |
|---|
| 2253 | | - if (cur_if->ifmode != ISTA_MODE && cur_if->ifmode != IGC_MODE) |
|---|
| 2254 | | - return FALSE; |
|---|
| 2255 | | - |
|---|
| 2256 | | - state = cur_if->conn_state; |
|---|
| 2257 | | - if (state >= CONN_STATE_4WAY_M1 && state < CONN_STATE_CONNECTED) { |
|---|
| 2258 | | - connecting = TRUE; |
|---|
| 2259 | | - IAPSTA_TRACE(dev->name, "conn_state %d\n", state); |
|---|
| 2260 | | - } |
|---|
| 2261 | | - |
|---|
| 2262 | | - return connecting; |
|---|
| 2263 | | -} |
|---|
| 2264 | | - |
|---|
| 2265 | | -#ifdef DHD_LOSSLESS_ROAMING |
|---|
| 2266 | | -int |
|---|
| 2267 | | -wl_ext_any_sta_handshaking(struct dhd_pub *dhd) |
|---|
| 2268 | | -{ |
|---|
| 2269 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 2270 | | - struct wl_if_info *cur_if; |
|---|
| 2271 | | - int state = 0, i; |
|---|
| 2272 | | - |
|---|
| 2273 | | - for (i=0; i<MAX_IF_NUM; i++) { |
|---|
| 2274 | | - cur_if = &apsta_params->if_info[i]; |
|---|
| 2275 | | - if (cur_if->dev && cur_if->ifmode == ISTA_MODE) { |
|---|
| 2276 | | - state = cur_if->conn_state; |
|---|
| 2277 | | - if (state >= CONN_STATE_4WAY_M1 && state < CONN_STATE_CONNECTED) { |
|---|
| 2278 | | - return state; |
|---|
| 2279 | | - } |
|---|
| 2280 | | - } |
|---|
| 2281 | | - } |
|---|
| 2282 | | - return 0; |
|---|
| 2283 | | -} |
|---|
| 2284 | | -#endif /* DHD_LOSSLESS_ROAMING */ |
|---|
| 2285 | | - |
|---|
| 2286 | 2104 | #ifdef PROPTX_MAXCOUNT |
|---|
| 2287 | 2105 | int |
|---|
| 2288 | 2106 | wl_ext_get_wlfc_maxcount(struct dhd_pub *dhd, int ifidx) |
|---|
| .. | .. |
|---|
| 2325 | 2143 | tmp_if = &apsta_params->if_info[i]; |
|---|
| 2326 | 2144 | if (tmp_if->dev) { |
|---|
| 2327 | 2145 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 2328 | | - wl_ext_get_chan(tmp_if->dev, &chan_info); |
|---|
| 2146 | + wl_ext_get_chan(apsta_params, tmp_if->dev, &chan_info); |
|---|
| 2329 | 2147 | if (chan_info.band == WLC_BAND_5G || chan_info.band == WLC_BAND_6G) { |
|---|
| 2330 | 2148 | tmp_if->transit_maxcount = dhd->conf->proptx_maxcnt_5g; |
|---|
| 2331 | 2149 | ret = dhd_wlfc_update_maxcount(dhd, tmp_if->ifidx, |
|---|
| .. | .. |
|---|
| 2341 | 2159 | for (i=0; i<MAX_IF_NUM; i++) { |
|---|
| 2342 | 2160 | tmp_if = &apsta_params->if_info[i]; |
|---|
| 2343 | 2161 | if (tmp_if->dev) { |
|---|
| 2344 | | - wl_ext_get_chan(tmp_if->dev, &chan_info); |
|---|
| 2162 | + wl_ext_get_chan(apsta_params, tmp_if->dev, &chan_info); |
|---|
| 2345 | 2163 | if ((chan_info.chan == 0) || (chan_info.band == WLC_BAND_2G)) { |
|---|
| 2346 | 2164 | if (chan_info.chan == 0) { |
|---|
| 2347 | 2165 | tmp_if->transit_maxcount = WL_TXSTATUS_FREERUNCTR_MASK; |
|---|
| .. | .. |
|---|
| 2374 | 2192 | if (!cur_if->dev || !wl_ext_master_if(cur_if)) |
|---|
| 2375 | 2193 | continue; |
|---|
| 2376 | 2194 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 2377 | | - wl_ext_get_chan(cur_if->dev, &chan_info); |
|---|
| 2195 | + wl_ext_get_chan(apsta_params, cur_if->dev, &chan_info); |
|---|
| 2378 | 2196 | if (chan_info.chan && wl_ext_dfs_chan(&chan_info)) { |
|---|
| 2379 | 2197 | return cur_if; |
|---|
| 2380 | 2198 | } |
|---|
| .. | .. |
|---|
| 2398 | 2216 | if (!cur_if->dev || !wl_ext_master_if(cur_if)) |
|---|
| 2399 | 2217 | continue; |
|---|
| 2400 | 2218 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 2401 | | - wl_ext_get_chan(cur_if->dev, &chan_info); |
|---|
| 2219 | + wl_ext_get_chan(apsta_params, cur_if->dev, &chan_info); |
|---|
| 2402 | 2220 | if (chan_info.chan) { |
|---|
| 2403 | 2221 | cur_if->prev_channel = chan_info.chan; |
|---|
| 2404 | 2222 | cur_if->post_channel = post_channel; |
|---|
| .. | .. |
|---|
| 2421 | 2239 | cur_if->chan_info.chan = cur_if->post_channel; |
|---|
| 2422 | 2240 | else |
|---|
| 2423 | 2241 | cur_if->chan_info.chan = cur_if->prev_channel; |
|---|
| 2424 | | - if (wl_ext_associated(cur_if->dev)) |
|---|
| 2425 | | - wl_ext_if_down(apsta_params, cur_if); |
|---|
| 2426 | 2242 | wl_ext_if_up(apsta_params, cur_if, TRUE, 0); |
|---|
| 2427 | 2243 | cur_if->prev_channel = 0; |
|---|
| 2428 | 2244 | cur_if->post_channel = 0; |
|---|
| .. | .. |
|---|
| 2469 | 2285 | tmp_if = &apsta_params->if_info[i]; |
|---|
| 2470 | 2286 | if (tmp_if && tmp_if->ifmode == ifmode && |
|---|
| 2471 | 2287 | wl_get_isam_status(tmp_if, IF_READY)) { |
|---|
| 2472 | | - if (wl_ext_get_chan(tmp_if->dev, &tmp_if->chan_info) == channel) { |
|---|
| 2288 | + if (wl_ext_get_chan(apsta_params, tmp_if->dev, &tmp_if->chan_info) == channel) { |
|---|
| 2473 | 2289 | WL_MSG(tmp_if->ifname, "re-enable channel %d\n", channel); |
|---|
| 2474 | 2290 | if (ifmode == IAP_MODE) { |
|---|
| 2475 | 2291 | wl_ext_if_down(apsta_params, tmp_if); |
|---|
| .. | .. |
|---|
| 2500 | 2316 | if (wl_ext_master_if(cur_if) && apsta_params->acs) { |
|---|
| 2501 | 2317 | chan_info->chan = wl_ext_autochannel(cur_if->dev, apsta_params->acs, |
|---|
| 2502 | 2318 | chan_info->band); |
|---|
| 2503 | | - chan_info->chan = wf_chspec_ctlchan(chan_info->chan); |
|---|
| 2504 | 2319 | } |
|---|
| 2505 | 2320 | chan_info->chan = wl_ext_move_cur_channel(apsta_params, cur_if); |
|---|
| 2506 | 2321 | if (chan_info->chan) { |
|---|
| .. | .. |
|---|
| 2518 | 2333 | } |
|---|
| 2519 | 2334 | } |
|---|
| 2520 | 2335 | if (cur_if->ifmode == ISTA_MODE) { |
|---|
| 2521 | | - if (conf->war & SET_CHAN_INCONN && chan_info->chan) { |
|---|
| 2336 | + if (conf->war & SET_CHAN_INCONN) { |
|---|
| 2522 | 2337 | chanspec_t fw_chspec; |
|---|
| 2523 | 2338 | IAPSTA_INFO(dev->name, "set channel %d\n", chan_info->chan); |
|---|
| 2524 | 2339 | wl_ext_set_chanspec(cur_if->dev, chan_info, &fw_chspec); |
|---|
| .. | .. |
|---|
| 2576 | 2391 | cur_if->prio = PRIO_STA; |
|---|
| 2577 | 2392 | cur_if->vsdb = TRUE; |
|---|
| 2578 | 2393 | cur_if->prefix = 'S'; |
|---|
| 2579 | | -#ifdef WL_STATIC_IF |
|---|
| 2580 | | - dhd_conf_preinit_ioctls_sta(dhd, ifidx); |
|---|
| 2581 | | -#endif /* WL_STATIC_IF */ |
|---|
| 2582 | 2394 | } else if (wl_iftype == WL_IF_TYPE_AP && cur_if->ifmode != IMESH_MODE) { |
|---|
| 2583 | 2395 | cur_if->ifmode = IAP_MODE; |
|---|
| 2584 | 2396 | cur_if->prio = PRIO_AP; |
|---|
| .. | .. |
|---|
| 2683 | 2495 | return; |
|---|
| 2684 | 2496 | } |
|---|
| 2685 | 2497 | IAPSTA_ERROR(dev->name, "timer expired\n"); |
|---|
| 2686 | | - wl_ext_send_event_msg(dev, WLC_E_SET_SSID, WLC_E_STATUS_NO_NETWORKS, WLC_E_STATUS_SUCCESS); |
|---|
| 2687 | | -} |
|---|
| 2688 | | - |
|---|
| 2689 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
|---|
| 2690 | | -static bool |
|---|
| 2691 | | -wl_ext_disc_recon_retry(struct wl_apsta_params *apsta_params, struct wl_if_info *cur_if) |
|---|
| 2692 | | -{ |
|---|
| 2693 | | - int sta_disc_recon_cnt = cur_if->sta_disc_recon_cnt; |
|---|
| 2694 | | - struct osl_timespec *sta_disc_conn_ts = &cur_if->sta_disc_conn_ts; |
|---|
| 2695 | | - struct osl_timespec cur_ts; |
|---|
| 2696 | | - uint32 diff_ms = 0; |
|---|
| 2697 | | - bool retry = FALSE; |
|---|
| 2698 | | - |
|---|
| 2699 | | - if (sta_disc_recon_cnt == 0) |
|---|
| 2700 | | - osl_do_gettimeofday(sta_disc_conn_ts); |
|---|
| 2701 | | - |
|---|
| 2702 | | - osl_do_gettimeofday(&cur_ts); |
|---|
| 2703 | | - diff_ms = osl_do_gettimediff(&cur_ts, sta_disc_conn_ts)/1000; |
|---|
| 2704 | | - |
|---|
| 2705 | | - IAPSTA_INFO(cur_if->ifname, "sta_disc_recon_cnt=%d, diff_ms = %dms\n", |
|---|
| 2706 | | - sta_disc_recon_cnt, diff_ms); |
|---|
| 2707 | | - if (sta_disc_recon_cnt >= STA_DISCONNECT_RECONNECT_MAX) { |
|---|
| 2708 | | - if (diff_ms >= STA_DISCONNECT_RECONNECT_TIMEOUT) { |
|---|
| 2709 | | - osl_do_gettimeofday(sta_disc_conn_ts); |
|---|
| 2710 | | - cur_if->sta_disc_recon_cnt = 0; |
|---|
| 2711 | | - retry = TRUE; |
|---|
| 2712 | | - } else { |
|---|
| 2713 | | - retry = FALSE; |
|---|
| 2714 | | - } |
|---|
| 2715 | | - } else { |
|---|
| 2716 | | - retry = TRUE; |
|---|
| 2717 | | - } |
|---|
| 2718 | | - |
|---|
| 2719 | | - if (retry) |
|---|
| 2720 | | - cur_if->sta_disc_recon_cnt++; |
|---|
| 2721 | | - |
|---|
| 2722 | | - return retry; |
|---|
| 2723 | | -} |
|---|
| 2724 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
|---|
| 2725 | | - |
|---|
| 2726 | | -static void |
|---|
| 2727 | | -wl_ext_update_assoc_info(struct net_device *dev, bool reassoc) |
|---|
| 2728 | | -{ |
|---|
| 2729 | | -#ifndef WL_REASSOC_BCAST |
|---|
| 2730 | | - dhd_pub_t *dhd = dhd_get_pub(dev); |
|---|
| 2731 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 2732 | | - struct wl_chan_info chan_info; |
|---|
| 2733 | | -#endif |
|---|
| 2734 | | - struct bcm_cfg80211 *cfg = wl_get_cfg(dev); |
|---|
| 2735 | | - wlcfg_assoc_info_t *assoc_info; |
|---|
| 2736 | | - struct wl_if_info *cur_if; |
|---|
| 2737 | | - |
|---|
| 2738 | | - cur_if = wl_get_cur_if(dev); |
|---|
| 2739 | | - if (cur_if) { |
|---|
| 2740 | | - assoc_info = &cur_if->assoc_info; |
|---|
| 2741 | | - assoc_info->reassoc = reassoc; |
|---|
| 2742 | | - assoc_info->bssid_hint = false; |
|---|
| 2743 | | -#ifdef WL_REASSOC_BCAST |
|---|
| 2744 | | - assoc_info->chan_cnt = 0; |
|---|
| 2745 | | - assoc_info->chanspecs[0] = 0; |
|---|
| 2746 | | - memcpy(&assoc_info->bssid, ðer_bcast, ETHER_ADDR_LEN); |
|---|
| 2747 | | -#else |
|---|
| 2748 | | - assoc_info->chanspecs[0] = wl_ext_get_chanspec(dev, &chan_info); |
|---|
| 2749 | | - if (assoc_info->chanspecs[0] && reassoc) { |
|---|
| 2750 | | - assoc_info->chan_cnt = 1; |
|---|
| 2751 | | - wldev_ioctl(dev, WLC_GET_BSSID, &cur_if->bssid, ETHER_ADDR_LEN, 0); |
|---|
| 2752 | | - memcpy(&assoc_info->bssid, &cur_if->bssid, ETHER_ADDR_LEN); |
|---|
| 2753 | | - } else { |
|---|
| 2754 | | - assoc_info->chan_cnt = 0; |
|---|
| 2755 | | - memcpy(&assoc_info->bssid, ðer_bcast, ETHER_ADDR_LEN); |
|---|
| 2756 | | - } |
|---|
| 2757 | | -#endif /* WL_REASSOC_BCAST */ |
|---|
| 2758 | | - if (!ETHER_ISBCAST(assoc_info->bssid)) |
|---|
| 2759 | | - assoc_info->targeted_join = true; |
|---|
| 2760 | | - else |
|---|
| 2761 | | - assoc_info->targeted_join = false; |
|---|
| 2762 | | - wl_get_assoc_channels(cfg, dev, assoc_info); |
|---|
| 2763 | | - } |
|---|
| 2498 | + wl_ext_send_event_msg(dev, WLC_E_SET_SSID, WLC_E_STATUS_NO_NETWORKS); |
|---|
| 2764 | 2499 | } |
|---|
| 2765 | 2500 | |
|---|
| 2766 | 2501 | static int |
|---|
| .. | .. |
|---|
| 2770 | 2505 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 2771 | 2506 | struct wl_if_info *cur_if; |
|---|
| 2772 | 2507 | struct bcm_cfg80211 *cfg = wl_get_cfg(dev); |
|---|
| 2773 | | - struct osl_timespec cur_ts, *sta_conn_ts; |
|---|
| 2774 | | - wlcfg_assoc_info_t *assoc_info; |
|---|
| 2508 | + struct osl_timespec cur_ts, *sta_conn_ts = &apsta_params->sta_conn_ts; |
|---|
| 2775 | 2509 | uint32 diff_ms = 0; |
|---|
| 2776 | 2510 | int max_wait_time = 0, ret = 0; |
|---|
| 2777 | | - bool connecting, handshaking, associated; |
|---|
| 2778 | | - uint32 etype = ntoh32(e->event_type); |
|---|
| 2779 | | - uint32 status = ntoh32(e->status); |
|---|
| 2780 | | - |
|---|
| 2781 | | - if (wl_get_drv_status(cfg, DISCONNECTING, dev)) { |
|---|
| 2782 | | - WL_MSG(dev->name, "skip connect retry due to disconnecting\n"); |
|---|
| 2783 | | - return BCME_BADADDR; |
|---|
| 2784 | | - } |
|---|
| 2511 | + bool connecting = FALSE; |
|---|
| 2785 | 2512 | |
|---|
| 2786 | 2513 | cur_if = wl_get_cur_if(dev); |
|---|
| 2787 | 2514 | if (!cur_if) |
|---|
| 2788 | 2515 | return ret; |
|---|
| 2789 | | - sta_conn_ts = &cur_if->sta_conn_ts; |
|---|
| 2790 | | - connecting = wl_ext_sta_connecting(dev); |
|---|
| 2791 | | - handshaking = wl_ext_sta_handshaking(dev); |
|---|
| 2792 | 2516 | |
|---|
| 2793 | 2517 | mutex_unlock(&apsta_params->in4way_sync); |
|---|
| 2794 | 2518 | mutex_lock(&cfg->connect_sync); |
|---|
| 2519 | + connecting = wl_ext_sta_connecting(dev); |
|---|
| 2795 | 2520 | |
|---|
| 2796 | 2521 | osl_do_gettimeofday(&cur_ts); |
|---|
| 2797 | 2522 | diff_ms = osl_do_gettimediff(&cur_ts, sta_conn_ts)/1000; |
|---|
| 2798 | | - associated = wl_ext_associated(dev); |
|---|
| 2799 | | - assoc_info = &cur_if->assoc_info; |
|---|
| 2800 | 2523 | |
|---|
| 2801 | 2524 | if (connecting && diff_ms < STA_CONNECT_TIMEOUT && |
|---|
| 2802 | 2525 | !wl_get_drv_status(cfg, DISCONNECTING, dev)) { |
|---|
| 2526 | + uint32 etype = ntoh32(e->event_type); |
|---|
| 2527 | + uint32 status = ntoh32(e->status); |
|---|
| 2803 | 2528 | if (etype == WLC_E_SET_SSID && (status == WLC_E_STATUS_NO_NETWORKS || |
|---|
| 2804 | 2529 | status == WLC_E_STATUS_NO_ACK)) { |
|---|
| 2805 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
|---|
| 2806 | | - if (assoc_info->reassoc && associated && !handshaking) { |
|---|
| 2807 | | - /* There are two cases will come in to retry reassoc: |
|---|
| 2808 | | - * 1) reconnect from wpa_supplicant |
|---|
| 2809 | | - * 2) fw roam |
|---|
| 2810 | | - */ |
|---|
| 2811 | | - if (associated) |
|---|
| 2812 | | - bzero(&cfg->last_roamed_addr, ETHER_ADDR_LEN); |
|---|
| 2530 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
|---|
| 2531 | + if (cur_if->assoc_info.reassoc) { |
|---|
| 2813 | 2532 | WL_MSG(dev->name, "retry reassoc\n"); |
|---|
| 2814 | | - if (wl_handle_reassoc(cfg, dev, assoc_info)) |
|---|
| 2815 | | - goto exit; |
|---|
| 2816 | | - if (assoc_info->chan_cnt == 0) |
|---|
| 2817 | | - max_wait_time = STA_CONNECT_FULL_CHAN_TIMEOUT; |
|---|
| 2818 | | - else |
|---|
| 2819 | | - max_wait_time = STA_RECONNECT_RETRY_TIMEOUT + |
|---|
| 2820 | | - (WL_BCAST_SCAN_JOIN_ACTIVE_DWELL_TIME_MS * assoc_info->chan_cnt); |
|---|
| 2821 | | - max_wait_time = min(max_wait_time, STA_CONNECT_FULL_CHAN_TIMEOUT); |
|---|
| 2822 | | - } |
|---|
| 2823 | | - else { |
|---|
| 2824 | | - /* There is one case will come in to retry join: |
|---|
| 2825 | | - * 1) connect from wpa_supplicant |
|---|
| 2826 | | - */ |
|---|
| 2827 | | - WL_MSG(dev->name, "retry join\n"); |
|---|
| 2828 | | - if (associated) { |
|---|
| 2829 | | - bzero(&cfg->last_roamed_addr, ETHER_ADDR_LEN); |
|---|
| 2830 | | - wl_cfg80211_disassoc(dev, WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT); |
|---|
| 2533 | + wl_handle_reassoc(cfg, dev, &cur_if->assoc_info); |
|---|
| 2534 | + max_wait_time = STA_RECONNECT_RETRY_TIMEOUT; |
|---|
| 2535 | + } else { |
|---|
| 2536 | + if (!wl_ext_associated(dev)) { |
|---|
| 2537 | + WL_MSG(dev->name, "retry join\n"); |
|---|
| 2538 | + wl_cfg80211_disassoc(dev, WLAN_REASON_DEAUTH_LEAVING); |
|---|
| 2539 | + wl_handle_join(cfg, dev, &cur_if->assoc_info); |
|---|
| 2540 | + max_wait_time = STA_CONNECT_RETRY_TIMEOUT; |
|---|
| 2831 | 2541 | } |
|---|
| 2832 | | - if (wl_handle_join(cfg, dev, assoc_info)) |
|---|
| 2833 | | - goto exit; |
|---|
| 2834 | | - if (assoc_info->chan_cnt == 0) |
|---|
| 2835 | | - max_wait_time = STA_CONNECT_FULL_CHAN_TIMEOUT; |
|---|
| 2836 | | - else |
|---|
| 2837 | | - max_wait_time = STA_CONNECT_RETRY_TIMEOUT + |
|---|
| 2838 | | - (WL_BCAST_SCAN_JOIN_ACTIVE_DWELL_TIME_MS * assoc_info->chan_cnt); |
|---|
| 2839 | | - max_wait_time = min(max_wait_time, STA_CONNECT_FULL_CHAN_TIMEOUT); |
|---|
| 2840 | 2542 | } |
|---|
| 2841 | | - IAPSTA_INFO(dev->name, "reconnect %dms later\n", max_wait_time); |
|---|
| 2842 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, max_wait_time); |
|---|
| 2543 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, max_wait_time); |
|---|
| 2843 | 2544 | } |
|---|
| 2844 | | - ret = BCME_ERROR; |
|---|
| 2545 | + ret = -EAGAIN; |
|---|
| 2845 | 2546 | } |
|---|
| 2846 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
|---|
| 2847 | | - else if (cur_if->conn_state >= CONN_STATE_CONNECTED && |
|---|
| 2848 | | - !wl_get_drv_status(cfg, DISCONNECTING, dev) && |
|---|
| 2849 | | - wl_get_drv_status(cfg, CONNECTED, dev)) { |
|---|
| 2850 | | - if (etype == WLC_E_DISASSOC_IND || etype == WLC_E_DEAUTH_IND) { |
|---|
| 2851 | | - /* There is one case will come in to retry join: |
|---|
| 2852 | | - * 1) receive disconnect from AP after connected |
|---|
| 2853 | | - */ |
|---|
| 2854 | | - if (wl_ext_disc_recon_retry(apsta_params, cur_if)) { |
|---|
| 2855 | | - int wpa_auth = 0; |
|---|
| 2856 | | - WL_MSG(dev->name, "retry join cnt %d\n", cur_if->sta_disc_recon_cnt); |
|---|
| 2857 | | - bzero(&cfg->last_roamed_addr, ETHER_ADDR_LEN); |
|---|
| 2858 | | - wl_ext_update_assoc_info(dev, FALSE); |
|---|
| 2859 | | -#ifdef DHD_LOSSLESS_ROAMING |
|---|
| 2860 | | - wl_ext_send_event_msg(dev, WLC_E_ROAM_PREP, WLC_E_STATUS_SUCCESS, WLC_E_REASON_DEAUTH); |
|---|
| 2861 | | -#endif |
|---|
| 2862 | | - if (wl_handle_join(cfg, dev, assoc_info)) |
|---|
| 2863 | | - goto exit; |
|---|
| 2864 | | - wl_timer_mod(dhd, &cur_if->connect_timer, STA_CONNECT_TIMEOUT); |
|---|
| 2865 | | - osl_do_gettimeofday(sta_conn_ts); |
|---|
| 2866 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTING); |
|---|
| 2867 | | - wl_ext_iovar_getint(dev, "wpa_auth", &wpa_auth); |
|---|
| 2868 | | - if (!(wpa_auth & (WPA3_AUTH_SAE_PSK|0x20))) { |
|---|
| 2869 | | - if (assoc_info->chan_cnt == 0) |
|---|
| 2870 | | - max_wait_time = STA_CONNECT_FULL_CHAN_TIMEOUT; |
|---|
| 2871 | | - else |
|---|
| 2872 | | - max_wait_time = STA_CONNECT_RETRY_TIMEOUT + |
|---|
| 2873 | | - (WL_BCAST_SCAN_JOIN_ACTIVE_DWELL_TIME_MS * assoc_info->chan_cnt); |
|---|
| 2874 | | - max_wait_time = min(max_wait_time, STA_CONNECT_FULL_CHAN_TIMEOUT); |
|---|
| 2875 | | - IAPSTA_INFO(dev->name, "reconnect %dms later\n", max_wait_time); |
|---|
| 2876 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, max_wait_time); |
|---|
| 2877 | | - } |
|---|
| 2878 | | - ret = BCME_ERROR; |
|---|
| 2879 | | - } |
|---|
| 2880 | | - else { |
|---|
| 2881 | | - WL_MSG(dev->name, "out of retry cnt %d within %dms\n", |
|---|
| 2882 | | - cur_if->sta_disc_recon_cnt, STA_DISCONNECT_RECONNECT_TIMEOUT); |
|---|
| 2883 | | - } |
|---|
| 2884 | | - } |
|---|
| 2885 | | - } |
|---|
| 2886 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
|---|
| 2887 | | - |
|---|
| 2888 | | -exit: |
|---|
| 2889 | 2547 | mutex_unlock(&cfg->connect_sync); |
|---|
| 2890 | 2548 | mutex_lock(&apsta_params->in4way_sync); |
|---|
| 2891 | 2549 | |
|---|
| .. | .. |
|---|
| 2895 | 2553 | static void |
|---|
| 2896 | 2554 | wl_ext_set_connect_retry(struct net_device *dev, void *context) |
|---|
| 2897 | 2555 | { |
|---|
| 2898 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 2899 | 2556 | wlcfg_assoc_info_t *assoc_info = (wlcfg_assoc_info_t *)context; |
|---|
| 2900 | 2557 | struct wl_if_info *cur_if; |
|---|
| 2901 | 2558 | int max_wait_time; |
|---|
| .. | .. |
|---|
| 2905 | 2562 | if (!cur_if) |
|---|
| 2906 | 2563 | return; |
|---|
| 2907 | 2564 | |
|---|
| 2908 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
|---|
| 2565 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
|---|
| 2909 | 2566 | memset(&cur_if->assoc_info, 0, sizeof(wlcfg_assoc_info_t)); |
|---|
| 2910 | 2567 | wl_ext_iovar_getint(dev, "wpa_auth", &wpa_auth); |
|---|
| 2911 | 2568 | if (!(wpa_auth & (WPA3_AUTH_SAE_PSK|0x20) && assoc_info)) { |
|---|
| 2912 | 2569 | memcpy(&cur_if->bssid, assoc_info->bssid, ETHER_ADDR_LEN); |
|---|
| 2913 | 2570 | memcpy(&cur_if->assoc_info, assoc_info, sizeof(wlcfg_assoc_info_t)); |
|---|
| 2914 | | - if (assoc_info->chan_cnt == 0) |
|---|
| 2915 | | - max_wait_time = STA_CONNECT_FULL_CHAN_TIMEOUT; |
|---|
| 2916 | | - else if (assoc_info->reassoc) |
|---|
| 2571 | + if (assoc_info->reassoc) |
|---|
| 2917 | 2572 | max_wait_time = STA_RECONNECT_RETRY_TIMEOUT; |
|---|
| 2918 | 2573 | else |
|---|
| 2919 | 2574 | max_wait_time = STA_CONNECT_RETRY_TIMEOUT; |
|---|
| 2920 | 2575 | IAPSTA_INFO(dev->name, "reconnect %dms later\n", max_wait_time); |
|---|
| 2921 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, max_wait_time); |
|---|
| 2576 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, max_wait_time); |
|---|
| 2922 | 2577 | } |
|---|
| 2923 | 2578 | } |
|---|
| 2924 | 2579 | #endif /* WL_EXT_RECONNECT */ |
|---|
| .. | .. |
|---|
| 3296 | 2951 | #ifdef BCMDBUS |
|---|
| 3297 | 2952 | if (!rx) |
|---|
| 3298 | 2953 | #endif /* BCMDBUS */ |
|---|
| 3299 | | - wl_timer_mod(dhd, &cur_if->eapol_timer, 0); |
|---|
| 2954 | + wl_ext_mod_timer(&cur_if->eapol_timer, 0, 0); |
|---|
| 3300 | 2955 | |
|---|
| 3301 | 2956 | if (cur_if->pend_eapol_pkt) { |
|---|
| 3302 | 2957 | PKTCFREE(dhd->osh, cur_if->pend_eapol_pkt, TRUE); |
|---|
| .. | .. |
|---|
| 3355 | 3010 | #else |
|---|
| 3356 | 3011 | interval = STA_EAPOL_TIMEOUT; |
|---|
| 3357 | 3012 | #endif /* EAPOL_DYNAMATIC_RESEND */ |
|---|
| 3358 | | - wl_timer_mod(dhd, &cur_if->eapol_timer, interval); |
|---|
| 3013 | + wl_ext_mod_timer(&cur_if->eapol_timer, 0, interval); |
|---|
| 3359 | 3014 | IAPSTA_TRACE(cur_if->dev->name, "backup eapol pkt\n"); |
|---|
| 3360 | 3015 | } |
|---|
| 3361 | 3016 | spin_unlock_irqrestore(&apsta_params->eapol_lock, flags); |
|---|
| .. | .. |
|---|
| 3389 | 3044 | cur_if->eapol_max_intvl, STA_EAPOL_TIMEOUT, |
|---|
| 3390 | 3045 | cur_if->eapol_cnt); |
|---|
| 3391 | 3046 | #else |
|---|
| 3392 | | - IAPSTA_INFO(dev->name, "resend eapol pkt %dms\n", STA_EAPOL_TIMEOUT); |
|---|
| 3047 | + IAPSTA_INFO(dev->name, "resend eapol pkt %d\n", STA_EAPOL_TIMEOUT); |
|---|
| 3393 | 3048 | #endif /* EAPOL_DYNAMATIC_RESEND */ |
|---|
| 3394 | 3049 | pending = TRUE; |
|---|
| 3395 | 3050 | } |
|---|
| .. | .. |
|---|
| 3425 | 3080 | } |
|---|
| 3426 | 3081 | #endif /* EAPOL_RESEND */ |
|---|
| 3427 | 3082 | |
|---|
| 3428 | | -#ifdef KEY_INSTALL_CHECK |
|---|
| 3429 | | -static void |
|---|
| 3430 | | -wl_ext_key_install_timeout(unsigned long data) |
|---|
| 3431 | | -{ |
|---|
| 3432 | | - struct net_device *dev = (struct net_device *)data; |
|---|
| 3433 | | - struct dhd_pub *dhd; |
|---|
| 3434 | | - wl_event_msg_t msg; |
|---|
| 3435 | | - |
|---|
| 3436 | | - if (!dev) { |
|---|
| 3437 | | - IAPSTA_ERROR("wlan", "dev is not ready\n"); |
|---|
| 3438 | | - return; |
|---|
| 3439 | | - } |
|---|
| 3440 | | - |
|---|
| 3441 | | - dhd = dhd_get_pub(dev); |
|---|
| 3442 | | - |
|---|
| 3443 | | - bzero(&msg, sizeof(wl_event_msg_t)); |
|---|
| 3444 | | - IAPSTA_TRACE(dev->name, "timer expired\n"); |
|---|
| 3445 | | - |
|---|
| 3446 | | - msg.ifidx = dhd_net2idx(dhd->info, dev); |
|---|
| 3447 | | - msg.event_type = hton32(WLC_E_RESERVED); |
|---|
| 3448 | | - msg.reason = hton32(ISAM_RC_KEY_INSTALL); |
|---|
| 3449 | | - wl_ext_event_send(dhd->event_params, &msg, NULL); |
|---|
| 3450 | | -} |
|---|
| 3451 | | - |
|---|
| 3452 | | -static void |
|---|
| 3453 | | -wl_ext_key_install_handler(struct wl_if_info *cur_if, |
|---|
| 3454 | | - const wl_event_msg_t *e, void *data) |
|---|
| 3455 | | -{ |
|---|
| 3456 | | - struct net_device *dev = cur_if->dev; |
|---|
| 3457 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 3458 | | - struct bcm_cfg80211 *cfg = wl_get_cfg(dev); |
|---|
| 3459 | | - uint32 etype = ntoh32(e->event_type); |
|---|
| 3460 | | - uint32 reason = ntoh32(e->reason); |
|---|
| 3461 | | - int err, key_installed = 0; |
|---|
| 3462 | | - |
|---|
| 3463 | | - if (etype == WLC_E_RESERVED && reason == ISAM_RC_KEY_INSTALL) { |
|---|
| 3464 | | - if (cur_if->conn_state >= CONN_STATE_4WAY_M4 && |
|---|
| 3465 | | - !wl_get_drv_status(cfg, DISCONNECTING, dev) && |
|---|
| 3466 | | - wl_get_drv_status(cfg, CONNECTED, dev)) { |
|---|
| 3467 | | - err = wldev_iovar_getint(dev, "buf_key_b4_m4_installed", &key_installed); |
|---|
| 3468 | | - if (!err && !key_installed) { |
|---|
| 3469 | | - cur_if->key_install_cnt++; |
|---|
| 3470 | | - if (cur_if->key_install_cnt > STA_KEY_INSTALL_MAX) { |
|---|
| 3471 | | - IAPSTA_ERROR(dev->name, "key not installed, send disconnect\n"); |
|---|
| 3472 | | -#ifdef EAPOL_RESEND |
|---|
| 3473 | | - wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
|---|
| 3474 | | -#endif /* EAPOL_RESEND */ |
|---|
| 3475 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTED); |
|---|
| 3476 | | - wl_ext_ioctl(cur_if->dev, WLC_DISASSOC, NULL, 0, 1); |
|---|
| 3477 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
|---|
| 3478 | | - cur_if->key_install_cnt = 0; |
|---|
| 3479 | | - } else { |
|---|
| 3480 | | - IAPSTA_INFO(dev->name, "check key installed %dms later, cnt=%d\n", |
|---|
| 3481 | | - STA_KEY_INSTALL_INTERVAL, cur_if->key_install_cnt); |
|---|
| 3482 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, STA_KEY_INSTALL_INTERVAL); |
|---|
| 3483 | | - } |
|---|
| 3484 | | - } else { |
|---|
| 3485 | | -#ifdef EAPOL_RESEND |
|---|
| 3486 | | - wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
|---|
| 3487 | | -#endif /* EAPOL_RESEND */ |
|---|
| 3488 | | - IAPSTA_INFO(dev->name, "key installed\n"); |
|---|
| 3489 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
|---|
| 3490 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTED); |
|---|
| 3491 | | - cur_if->key_install_cnt = 0; |
|---|
| 3492 | | - } |
|---|
| 3493 | | - } |
|---|
| 3494 | | - } |
|---|
| 3495 | | - return; |
|---|
| 3496 | | -} |
|---|
| 3497 | | - |
|---|
| 3498 | | -static int |
|---|
| 3499 | | -wl_key_installed(struct wl_if_info *cur_if) |
|---|
| 3500 | | -{ |
|---|
| 3501 | | - struct net_device *dev = cur_if->dev; |
|---|
| 3502 | | - dhd_pub_t *dhd = dhd_get_pub(dev); |
|---|
| 3503 | | - int err, key_installed = 0; |
|---|
| 3504 | | - |
|---|
| 3505 | | - err = wldev_iovar_getint(dev, "buf_key_b4_m4_installed", &key_installed); |
|---|
| 3506 | | - if (err) { |
|---|
| 3507 | | - IAPSTA_INFO(dev->name, "not supported %d\n", err); |
|---|
| 3508 | | - key_installed = 1; |
|---|
| 3509 | | - } else if (key_installed) |
|---|
| 3510 | | - IAPSTA_INFO(dev->name, "key installed\n"); |
|---|
| 3511 | | - |
|---|
| 3512 | | - if (key_installed) |
|---|
| 3513 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
|---|
| 3514 | | - else { |
|---|
| 3515 | | - IAPSTA_INFO(dev->name, "check key installed %dms later\n", STA_KEY_INSTALL_INTERVAL); |
|---|
| 3516 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, STA_KEY_INSTALL_INTERVAL); |
|---|
| 3517 | | - } |
|---|
| 3518 | | - |
|---|
| 3519 | | - return key_installed; |
|---|
| 3520 | | -} |
|---|
| 3521 | | -#endif /* KEY_INSTALL_CHECK */ |
|---|
| 3522 | | - |
|---|
| 3523 | 3083 | #if defined(WL_CFG80211) && defined(SCAN_SUPPRESS) |
|---|
| 3524 | 3084 | static void |
|---|
| 3525 | 3085 | wl_ext_light_scan_prep(struct net_device *dev, void *scan_params, bool scan_v2) |
|---|
| 3526 | 3086 | { |
|---|
| 3527 | | - wl_scan_params_v1_t *params = NULL; |
|---|
| 3087 | + wl_scan_params_t *params = NULL; |
|---|
| 3528 | 3088 | wl_scan_params_v2_t *params_v2 = NULL; |
|---|
| 3529 | 3089 | |
|---|
| 3530 | 3090 | if (!scan_params) { |
|---|
| .. | .. |
|---|
| 3536 | 3096 | if (scan_v2) { |
|---|
| 3537 | 3097 | params_v2 = (wl_scan_params_v2_t *)scan_params; |
|---|
| 3538 | 3098 | } else { |
|---|
| 3539 | | - params = (wl_scan_params_v1_t *)scan_params; |
|---|
| 3099 | + params = (wl_scan_params_t *)scan_params; |
|---|
| 3540 | 3100 | } |
|---|
| 3541 | 3101 | |
|---|
| 3542 | 3102 | if (params_v2) { |
|---|
| .. | .. |
|---|
| 3570 | 3130 | tmp_if = &apsta_params->if_info[i]; |
|---|
| 3571 | 3131 | if (tmp_if->dev && (tmp_if->tput_info.tput_tx + tmp_if->tput_info.tput_rx) > tput_sum) { |
|---|
| 3572 | 3132 | memset(chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 3573 | | - wl_ext_get_chan(tmp_if->dev, chan_info); |
|---|
| 3133 | + wl_ext_get_chan(apsta_params, tmp_if->dev, chan_info); |
|---|
| 3574 | 3134 | if (chan_info->chan) { |
|---|
| 3575 | 3135 | max_tput_if = tmp_if; |
|---|
| 3576 | 3136 | tput_sum = tmp_if->tput_info.tput_tx + tmp_if->tput_info.tput_rx; |
|---|
| .. | .. |
|---|
| 3709 | 3269 | } |
|---|
| 3710 | 3270 | } |
|---|
| 3711 | 3271 | } |
|---|
| 3272 | + |
|---|
| 3712 | 3273 | } |
|---|
| 3713 | 3274 | |
|---|
| 3714 | 3275 | static void |
|---|
| .. | .. |
|---|
| 3716 | 3277 | enum wl_ext_status status) |
|---|
| 3717 | 3278 | { |
|---|
| 3718 | 3279 | struct net_device *dev = cur_if->dev; |
|---|
| 3719 | | - struct osl_timespec cur_ts, *sta_disc_ts = &cur_if->sta_disc_ts; |
|---|
| 3280 | + struct osl_timespec cur_ts, *sta_disc_ts = &apsta_params->sta_disc_ts; |
|---|
| 3720 | 3281 | int max_wait_time = 200, max_wait_cnt = 20; |
|---|
| 3721 | 3282 | int cur_conn_state = cur_if->conn_state; |
|---|
| 3722 | 3283 | uint32 diff_ms = 0; |
|---|
| .. | .. |
|---|
| 3766 | 3327 | |
|---|
| 3767 | 3328 | if (suspend) { |
|---|
| 3768 | 3329 | if (insuspend & AP_DOWN_IN_SUSPEND) { |
|---|
| 3769 | | - cur_if->chan_info.chan = wl_ext_get_chan(cur_if->dev, &cur_if->chan_info); |
|---|
| 3330 | + cur_if->chan_info.chan = wl_ext_get_chan(apsta_params, cur_if->dev, |
|---|
| 3331 | + &cur_if->chan_info); |
|---|
| 3770 | 3332 | if (cur_if->chan_info.chan) |
|---|
| 3771 | 3333 | wl_ext_if_down(apsta_params, cur_if); |
|---|
| 3772 | 3334 | } |
|---|
| .. | .. |
|---|
| 3789 | 3351 | |
|---|
| 3790 | 3352 | #ifdef TPUT_MONITOR |
|---|
| 3791 | 3353 | if (suspend) |
|---|
| 3792 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, 0); |
|---|
| 3354 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, 0); |
|---|
| 3793 | 3355 | #endif /* TPUT_MONITOR */ |
|---|
| 3794 | 3356 | |
|---|
| 3795 | 3357 | for (i=0; i<MAX_IF_NUM; i++) { |
|---|
| .. | .. |
|---|
| 3808 | 3370 | |
|---|
| 3809 | 3371 | #ifdef TPUT_MONITOR |
|---|
| 3810 | 3372 | if (!suspend) |
|---|
| 3811 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, dhd->conf->tput_monitor_ms); |
|---|
| 3373 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, dhd->conf->tput_monitor_ms); |
|---|
| 3812 | 3374 | #endif /* TPUT_MONITOR */ |
|---|
| 3813 | 3375 | |
|---|
| 3814 | 3376 | return 0; |
|---|
| .. | .. |
|---|
| 3821 | 3383 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 3822 | 3384 | struct dhd_conf *conf = dhd->conf; |
|---|
| 3823 | 3385 | struct net_device *dev = cur_if->dev; |
|---|
| 3824 | | - struct osl_timespec cur_ts, *sta_disc_ts = &cur_if->sta_disc_ts; |
|---|
| 3825 | | - struct osl_timespec *sta_conn_ts = &cur_if->sta_conn_ts; |
|---|
| 3386 | + struct osl_timespec cur_ts, *sta_disc_ts = &apsta_params->sta_disc_ts; |
|---|
| 3387 | + struct osl_timespec *sta_conn_ts = &apsta_params->sta_conn_ts; |
|---|
| 3826 | 3388 | uint32 diff_ms = 0; |
|---|
| 3827 | | - int ret = 0, suppressed = 0, wpa_auth = 0, max_wait_time = 0, key_installed = 1; |
|---|
| 3828 | | - uint cur_conn_state, conn_state; |
|---|
| 3389 | + int ret = 0, cur_conn_state; |
|---|
| 3390 | + int suppressed = 0, wpa_auth = 0; |
|---|
| 3829 | 3391 | bool connecting = FALSE; |
|---|
| 3830 | 3392 | wl_event_msg_t *e = (wl_event_msg_t *)context; |
|---|
| 3831 | 3393 | #ifdef WL_CFG80211 |
|---|
| .. | .. |
|---|
| 3876 | 3438 | osl_do_gettimeofday(&cur_ts); |
|---|
| 3877 | 3439 | diff_ms = osl_do_gettimediff(&cur_ts, sta_conn_ts)/1000; |
|---|
| 3878 | 3440 | if (connecting && diff_ms <= STA_CONNECT_TIMEOUT) { |
|---|
| 3879 | | - IAPSTA_ERROR(dev->name, "scan during connecting... %d\n", |
|---|
| 3880 | | - cur_conn_state); |
|---|
| 3441 | + IAPSTA_ERROR(dev->name, "connecting... %d\n", cur_conn_state); |
|---|
| 3881 | 3442 | ret = -EBUSY; |
|---|
| 3882 | 3443 | break; |
|---|
| 3883 | 3444 | } |
|---|
| .. | .. |
|---|
| 3891 | 3452 | if (wl_get_drv_status(cfg, CONNECTING, dev) || |
|---|
| 3892 | 3453 | (connecting && diff_ms <= STA_CONNECT_TIMEOUT) || |
|---|
| 3893 | 3454 | (cur_if->empty_scan >= STA_EMPTY_SCAN_MAX)) { |
|---|
| 3455 | + unsigned long flags = 0; |
|---|
| 3894 | 3456 | cur_if->empty_scan = 0; |
|---|
| 3895 | | - WL_MSG(dev->name, "FAKE SCAN\n"); |
|---|
| 3896 | | - ret = -EBUSY; |
|---|
| 3457 | + spin_lock_irqsave(&dhd->up_lock, flags); |
|---|
| 3458 | + if (dhd->up) { |
|---|
| 3459 | + wl_event_msg_t msg; |
|---|
| 3460 | + bzero(&msg, sizeof(wl_event_msg_t)); |
|---|
| 3461 | + msg.event_type = hton32(WLC_E_ESCAN_RESULT); |
|---|
| 3462 | + msg.status = hton32(WLC_E_STATUS_SUCCESS); |
|---|
| 3463 | + WL_MSG(dev->name, "FAKE SCAN\n"); |
|---|
| 3464 | + wl_cfg80211_event(dev, &msg, NULL); |
|---|
| 3465 | + ret = -EBUSY; |
|---|
| 3466 | + } |
|---|
| 3467 | + spin_unlock_irqrestore(&dhd->up_lock, flags); |
|---|
| 3897 | 3468 | } |
|---|
| 3898 | 3469 | } |
|---|
| 3899 | 3470 | break; |
|---|
| 3900 | 3471 | case WL_EXT_STATUS_SCAN_COMPLETE: |
|---|
| 3901 | | - if ((conf->war & FW_REINIT_EMPTY_SCAN) && |
|---|
| 3902 | | - cfg->bss_list->count == 0 && !p2p_scan(cfg)) { |
|---|
| 3472 | + if ((conf->war & FW_REINIT_EMPTY_SCAN) && cfg->bss_list->count == 0) { |
|---|
| 3903 | 3473 | bool assoc; |
|---|
| 3904 | 3474 | osl_do_gettimeofday(&cur_ts); |
|---|
| 3905 | 3475 | diff_ms = osl_do_gettimediff(&cur_ts, sta_disc_ts)/1000; |
|---|
| .. | .. |
|---|
| 3924 | 3494 | } |
|---|
| 3925 | 3495 | break; |
|---|
| 3926 | 3496 | #endif /* WL_CFG80211 */ |
|---|
| 3927 | | - case WL_EXT_STATUS_PRE_DISCONNECTING: |
|---|
| 3497 | + case WL_EXT_STATUS_DISCONNECTING: |
|---|
| 3928 | 3498 | #ifdef EAPOL_RESEND |
|---|
| 3929 | 3499 | wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
|---|
| 3930 | 3500 | #endif /* EAPOL_RESEND */ |
|---|
| 3931 | | -#ifdef KEY_INSTALL_CHECK |
|---|
| 3932 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
|---|
| 3933 | | -#endif /* KEY_INSTALL_CHECK */ |
|---|
| 3934 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
|---|
| 3501 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
|---|
| 3935 | 3502 | #if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 3936 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
|---|
| 3503 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
|---|
| 3937 | 3504 | memset(&cur_if->assoc_info, 0, sizeof(wlcfg_assoc_info_t)); |
|---|
| 3938 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
|---|
| 3939 | | - cur_if->sta_disc_recon_cnt = 0; |
|---|
| 3940 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
|---|
| 3941 | 3505 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 3942 | 3506 | #ifdef SCAN_SUPPRESS |
|---|
| 3943 | 3507 | apsta_params->scan_busy_cnt = 0; |
|---|
| 3944 | 3508 | #endif /* SCAN_SUPPRESS */ |
|---|
| 3945 | | - break; |
|---|
| 3946 | | - case WL_EXT_STATUS_DISCONNECTING: |
|---|
| 3947 | 3509 | if (connecting) { |
|---|
| 3948 | 3510 | IAPSTA_ERROR(dev->name, "connect failed at %d\n", cur_conn_state); |
|---|
| 3949 | 3511 | wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_IDLE); |
|---|
| .. | .. |
|---|
| 3951 | 3513 | if (action & STA_NO_BTC_IN4WAY) { |
|---|
| 3952 | 3514 | wl_set_btc_in4way(apsta_params, cur_if, status, FALSE); |
|---|
| 3953 | 3515 | } |
|---|
| 3954 | | -#ifdef BTC_WAR |
|---|
| 3955 | | - wl_ext_btc_config(cur_if->dev, FALSE); |
|---|
| 3956 | | -#endif /* BTC_WAR */ |
|---|
| 3957 | 3516 | if (action & STA_WAIT_DISCONNECTED) { |
|---|
| 3958 | 3517 | wl_wait_disconnect(apsta_params, cur_if, status); |
|---|
| 3959 | 3518 | wake_up_interruptible(&conf->event_complete); |
|---|
| .. | .. |
|---|
| 3964 | 3523 | if (action & STA_REASSOC_RETRY) { |
|---|
| 3965 | 3524 | wl_ext_set_connect_retry(dev, context); |
|---|
| 3966 | 3525 | } |
|---|
| 3967 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
|---|
| 3968 | | - cur_if->sta_disc_recon_cnt = 0; |
|---|
| 3969 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
|---|
| 3970 | 3526 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 3971 | | - wl_timer_mod(dhd, &cur_if->connect_timer, STA_CONNECT_TIMEOUT); |
|---|
| 3527 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, STA_CONNECT_TIMEOUT); |
|---|
| 3972 | 3528 | osl_do_gettimeofday(sta_conn_ts); |
|---|
| 3973 | 3529 | wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTING); |
|---|
| 3974 | 3530 | if (action & STA_NO_BTC_IN4WAY) { |
|---|
| .. | .. |
|---|
| 3978 | 3534 | case WL_EXT_STATUS_CONNECTED: |
|---|
| 3979 | 3535 | wl_ext_iovar_getint(dev, "wpa_auth", &wpa_auth); |
|---|
| 3980 | 3536 | if ((wpa_auth < WPA_AUTH_UNSPECIFIED) || (wpa_auth & WPA2_AUTH_FT)) { |
|---|
| 3981 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
|---|
| 3537 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
|---|
| 3982 | 3538 | wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTED); |
|---|
| 3983 | | -#ifdef BTC_WAR |
|---|
| 3984 | | - wl_ext_btc_config(cur_if->dev, TRUE); |
|---|
| 3985 | | -#endif /* BTC_WAR */ |
|---|
| 3986 | | - max_wait_time = 0; |
|---|
| 3987 | | - } else { |
|---|
| 3988 | | - max_wait_time = STA_4WAY_TIMEOUT; |
|---|
| 3989 | 3539 | } |
|---|
| 3990 | 3540 | #if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 3991 | | - wl_ext_update_assoc_info(dev, TRUE); |
|---|
| 3992 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, max_wait_time); |
|---|
| 3541 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
|---|
| 3542 | + memset(&cur_if->assoc_info, 0, sizeof(wlcfg_assoc_info_t)); |
|---|
| 3993 | 3543 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 3994 | 3544 | if (cur_if->ifmode == ISTA_MODE) { |
|---|
| 3995 | 3545 | dhd_conf_set_wme(dhd, cur_if->ifidx, 0); |
|---|
| .. | .. |
|---|
| 3997 | 3547 | } |
|---|
| 3998 | 3548 | else if (cur_if->ifmode == IGC_MODE) { |
|---|
| 3999 | 3549 | dhd_conf_set_mchan_bw(dhd, WL_P2P_IF_CLIENT, -1); |
|---|
| 4000 | | - } |
|---|
| 4001 | | - break; |
|---|
| 4002 | | - case WL_EXT_STATUS_ROAMED: |
|---|
| 4003 | | - wl_ext_iovar_getint(dev, "wpa_auth", &wpa_auth); |
|---|
| 4004 | | - if ((wpa_auth >= WPA_AUTH_UNSPECIFIED) && !(wpa_auth & WPA2_AUTH_FT)) { |
|---|
| 4005 | | - wl_timer_mod(dhd, &cur_if->connect_timer, STA_CONNECT_TIMEOUT); |
|---|
| 4006 | | - osl_do_gettimeofday(sta_conn_ts); |
|---|
| 4007 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTING); |
|---|
| 4008 | | -#ifdef BTC_WAR |
|---|
| 4009 | | - wl_ext_btc_config(cur_if->dev, TRUE); |
|---|
| 4010 | | -#endif /* BTC_WAR */ |
|---|
| 4011 | | - max_wait_time = STA_4WAY_TIMEOUT; |
|---|
| 4012 | | - } else { |
|---|
| 4013 | | - max_wait_time = 0; |
|---|
| 4014 | | - } |
|---|
| 4015 | | -#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 4016 | | - wl_ext_update_assoc_info(dev, TRUE); |
|---|
| 4017 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, max_wait_time); |
|---|
| 4018 | | -#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 4019 | | -#ifdef KEY_INSTALL_CHECK |
|---|
| 4020 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
|---|
| 4021 | | -#endif /* KEY_INSTALL_CHECK */ |
|---|
| 4022 | | - if (cur_if->ifmode == ISTA_MODE) { |
|---|
| 4023 | | - dhd_conf_set_wme(dhd, cur_if->ifidx, 0); |
|---|
| 4024 | | - wake_up_interruptible(&conf->event_complete); |
|---|
| 4025 | 3550 | } |
|---|
| 4026 | 3551 | break; |
|---|
| 4027 | 3552 | case WL_EXT_STATUS_RECONNECT: |
|---|
| .. | .. |
|---|
| 4038 | 3563 | #ifdef EAPOL_RESEND |
|---|
| 4039 | 3564 | wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
|---|
| 4040 | 3565 | #endif /* EAPOL_RESEND */ |
|---|
| 4041 | | -#ifdef KEY_INSTALL_CHECK |
|---|
| 4042 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
|---|
| 4043 | | -#endif /* KEY_INSTALL_CHECK */ |
|---|
| 4044 | 3566 | #if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 4045 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
|---|
| 3567 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
|---|
| 4046 | 3568 | memset(&cur_if->assoc_info, 0, sizeof(wlcfg_assoc_info_t)); |
|---|
| 4047 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
|---|
| 4048 | | - cur_if->sta_disc_recon_cnt = 0; |
|---|
| 4049 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
|---|
| 4050 | 3569 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 4051 | 3570 | #ifdef SCAN_SUPPRESS |
|---|
| 4052 | 3571 | apsta_params->scan_busy_cnt = 0; |
|---|
| .. | .. |
|---|
| 4055 | 3574 | !(ntoh16(e->flags) & WLC_EVENT_MSG_LINK)) { |
|---|
| 4056 | 3575 | apsta_params->linkdown_reason = ntoh32(e->reason); |
|---|
| 4057 | 3576 | } |
|---|
| 4058 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
|---|
| 3577 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
|---|
| 4059 | 3578 | if (connecting) { |
|---|
| 4060 | 3579 | IAPSTA_ERROR(dev->name, "connect failed at %d\n", cur_conn_state); |
|---|
| 4061 | 3580 | } |
|---|
| .. | .. |
|---|
| 4063 | 3582 | if (action & STA_NO_BTC_IN4WAY) { |
|---|
| 4064 | 3583 | wl_set_btc_in4way(apsta_params, cur_if, status, FALSE); |
|---|
| 4065 | 3584 | } |
|---|
| 4066 | | -#ifdef BTC_WAR |
|---|
| 4067 | | - wl_ext_btc_config(cur_if->dev, FALSE); |
|---|
| 4068 | | -#endif /* BTC_WAR */ |
|---|
| 4069 | 3585 | osl_do_gettimeofday(sta_disc_ts); |
|---|
| 4070 | 3586 | wake_up_interruptible(&conf->event_complete); |
|---|
| 4071 | 3587 | break; |
|---|
| 4072 | 3588 | case WL_EXT_STATUS_ADD_KEY: |
|---|
| 4073 | | - conn_state = CONN_STATE_ADD_KEY; |
|---|
| 4074 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
|---|
| 4075 | | -#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 4076 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
|---|
| 4077 | | -#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 4078 | | -#ifdef KEY_INSTALL_CHECK |
|---|
| 4079 | | - key_installed = wl_key_installed(cur_if); |
|---|
| 4080 | | -#endif /* KEY_INSTALL_CHECK */ |
|---|
| 4081 | | - if (key_installed) |
|---|
| 4082 | | - conn_state = CONN_STATE_CONNECTED; |
|---|
| 4083 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, conn_state); |
|---|
| 4084 | | - IAPSTA_INFO(dev->name, "WPA 4-WAY complete %d => %d\n", |
|---|
| 4085 | | - cur_conn_state, conn_state); |
|---|
| 3589 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
|---|
| 3590 | + wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTED); |
|---|
| 4086 | 3591 | #ifdef EAPOL_RESEND |
|---|
| 4087 | | - if (key_installed) |
|---|
| 4088 | | - wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
|---|
| 3592 | + wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
|---|
| 4089 | 3593 | #endif /* EAPOL_RESEND */ |
|---|
| 3594 | +#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 3595 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
|---|
| 3596 | +#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 4090 | 3597 | if (action & STA_NO_BTC_IN4WAY) { |
|---|
| 4091 | 3598 | wl_set_btc_in4way(apsta_params, cur_if, status, FALSE); |
|---|
| 4092 | 3599 | } |
|---|
| 4093 | | -#ifdef BTC_WAR |
|---|
| 4094 | | - wl_ext_btc_config(cur_if->dev, TRUE); |
|---|
| 4095 | | -#endif /* BTC_WAR */ |
|---|
| 4096 | 3600 | wake_up_interruptible(&conf->event_complete); |
|---|
| 3601 | + IAPSTA_INFO(dev->name, "WPA 4-WAY complete %d\n", cur_conn_state); |
|---|
| 4097 | 3602 | break; |
|---|
| 4098 | 3603 | default: |
|---|
| 4099 | 3604 | IAPSTA_INFO(dev->name, "Unknown action=0x%x, status=%d\n", action, status); |
|---|
| .. | .. |
|---|
| 4109 | 3614 | { |
|---|
| 4110 | 3615 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 4111 | 3616 | struct net_device *dev = cur_if->dev; |
|---|
| 4112 | | - struct osl_timespec cur_ts, *ap_disc_sta_ts = &cur_if->ap_disc_sta_ts; |
|---|
| 4113 | | - u8 *ap_disc_sta_bssid = (u8*)&cur_if->ap_disc_sta_bssid; |
|---|
| 3617 | + struct osl_timespec cur_ts, *ap_disc_sta_ts = &apsta_params->ap_disc_sta_ts; |
|---|
| 3618 | + u8 *ap_disc_sta_bssid = (u8*)&apsta_params->ap_disc_sta_bssid; |
|---|
| 4114 | 3619 | uint32 diff_ms = 0, timeout, max_wait_time = 300; |
|---|
| 4115 | 3620 | int ret = 0, suppressed = 0; |
|---|
| 4116 | 3621 | u8* mac_addr = context; |
|---|
| .. | .. |
|---|
| 4131 | 3636 | break; |
|---|
| 4132 | 3637 | case WL_EXT_STATUS_AP_ENABLING: |
|---|
| 4133 | 3638 | #ifdef RESTART_AP_WAR |
|---|
| 4134 | | - wl_timer_mod(dhd, &cur_if->restart_ap_timer, AP_RESTART_TIMEOUT); |
|---|
| 3639 | + wl_ext_mod_timer(&cur_if->restart_ap_timer, AP_RESTART_TIMEOUT, 0); |
|---|
| 4135 | 3640 | #endif /* RESTART_AP_WAR */ |
|---|
| 4136 | 3641 | break; |
|---|
| 4137 | 3642 | case WL_EXT_STATUS_AP_ENABLED: |
|---|
| 4138 | 3643 | #ifdef RESTART_AP_WAR |
|---|
| 4139 | | - wl_timer_mod(dhd, &cur_if->restart_ap_timer, 0); |
|---|
| 3644 | + wl_ext_mod_timer(&cur_if->restart_ap_timer, 0, 0); |
|---|
| 4140 | 3645 | #endif /* RESTART_AP_WAR */ |
|---|
| 4141 | 3646 | if (cur_if->ifmode == IAP_MODE) |
|---|
| 4142 | 3647 | dhd_conf_set_wme(dhd, cur_if->ifidx, 1); |
|---|
| .. | .. |
|---|
| 4145 | 3650 | break; |
|---|
| 4146 | 3651 | case WL_EXT_STATUS_AP_DISABLING: |
|---|
| 4147 | 3652 | #ifdef RESTART_AP_WAR |
|---|
| 4148 | | - wl_timer_mod(dhd, &cur_if->restart_ap_timer, 0); |
|---|
| 3653 | + wl_ext_mod_timer(&cur_if->restart_ap_timer, 0, 0); |
|---|
| 4149 | 3654 | #endif /* RESTART_AP_WAR */ |
|---|
| 4150 | 3655 | break; |
|---|
| 4151 | 3656 | case WL_EXT_STATUS_DELETE_STA: |
|---|
| .. | .. |
|---|
| 4163 | 3668 | } |
|---|
| 4164 | 3669 | if (wait) { |
|---|
| 4165 | 3670 | IAPSTA_INFO(dev->name, "status=%d, ap_recon_sta=%d, waiting %dms ...\n", |
|---|
| 4166 | | - status, cur_if->ap_recon_sta, max_wait_time); |
|---|
| 3671 | + status, apsta_params->ap_recon_sta, max_wait_time); |
|---|
| 4167 | 3672 | mutex_unlock(&apsta_params->in4way_sync); |
|---|
| 4168 | | - timeout = wait_event_interruptible_timeout(cur_if->ap_recon_sta_event, |
|---|
| 4169 | | - cur_if->ap_recon_sta, msecs_to_jiffies(max_wait_time)); |
|---|
| 3673 | + timeout = wait_event_interruptible_timeout(apsta_params->ap_recon_sta_event, |
|---|
| 3674 | + apsta_params->ap_recon_sta, msecs_to_jiffies(max_wait_time)); |
|---|
| 4170 | 3675 | mutex_lock(&apsta_params->in4way_sync); |
|---|
| 4171 | 3676 | IAPSTA_INFO(dev->name, "status=%d, ap_recon_sta=%d, timeout=%d\n", |
|---|
| 4172 | | - status, cur_if->ap_recon_sta, timeout); |
|---|
| 3677 | + status, apsta_params->ap_recon_sta, timeout); |
|---|
| 4173 | 3678 | if (timeout > 0) { |
|---|
| 4174 | 3679 | IAPSTA_INFO(dev->name, "skip delete STA %pM\n", mac_addr); |
|---|
| 4175 | 3680 | ret = -1; |
|---|
| .. | .. |
|---|
| 4177 | 3682 | } |
|---|
| 4178 | 3683 | } else { |
|---|
| 4179 | 3684 | IAPSTA_INFO(dev->name, "status=%d, ap_recon_sta=%d => 0\n", |
|---|
| 4180 | | - status, cur_if->ap_recon_sta); |
|---|
| 4181 | | - cur_if->ap_recon_sta = FALSE; |
|---|
| 3685 | + status, apsta_params->ap_recon_sta); |
|---|
| 3686 | + apsta_params->ap_recon_sta = FALSE; |
|---|
| 4182 | 3687 | if (cur_if->ifmode == IGO_MODE) |
|---|
| 4183 | 3688 | wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_IDLE); |
|---|
| 4184 | 3689 | } |
|---|
| .. | .. |
|---|
| 4187 | 3692 | case WL_EXT_STATUS_STA_DISCONNECTED: |
|---|
| 4188 | 3693 | if (action & AP_WAIT_STA_RECONNECT) { |
|---|
| 4189 | 3694 | IAPSTA_INFO(dev->name, "latest disc STA %pM ap_recon_sta=%d\n", |
|---|
| 4190 | | - ap_disc_sta_bssid, cur_if->ap_recon_sta); |
|---|
| 3695 | + ap_disc_sta_bssid, apsta_params->ap_recon_sta); |
|---|
| 4191 | 3696 | osl_do_gettimeofday(ap_disc_sta_ts); |
|---|
| 4192 | 3697 | memcpy(ap_disc_sta_bssid, mac_addr, ETHER_ADDR_LEN); |
|---|
| 4193 | | - cur_if->ap_recon_sta = FALSE; |
|---|
| 3698 | + apsta_params->ap_recon_sta = FALSE; |
|---|
| 4194 | 3699 | } |
|---|
| 4195 | 3700 | break; |
|---|
| 4196 | 3701 | case WL_EXT_STATUS_STA_CONNECTED: |
|---|
| .. | .. |
|---|
| 4200 | 3705 | if (diff_ms < max_wait_time && |
|---|
| 4201 | 3706 | !memcmp(ap_disc_sta_bssid, mac_addr, ETHER_ADDR_LEN)) { |
|---|
| 4202 | 3707 | IAPSTA_INFO(dev->name, "status=%d, ap_recon_sta=%d => 1\n", |
|---|
| 4203 | | - status, cur_if->ap_recon_sta); |
|---|
| 4204 | | - cur_if->ap_recon_sta = TRUE; |
|---|
| 4205 | | - wake_up_interruptible(&cur_if->ap_recon_sta_event); |
|---|
| 3708 | + status, apsta_params->ap_recon_sta); |
|---|
| 3709 | + apsta_params->ap_recon_sta = TRUE; |
|---|
| 3710 | + wake_up_interruptible(&apsta_params->ap_recon_sta_event); |
|---|
| 4206 | 3711 | } else { |
|---|
| 4207 | | - cur_if->ap_recon_sta = FALSE; |
|---|
| 3712 | + apsta_params->ap_recon_sta = FALSE; |
|---|
| 4208 | 3713 | } |
|---|
| 4209 | 3714 | } |
|---|
| 4210 | 3715 | break; |
|---|
| .. | .. |
|---|
| 4302 | 3807 | } |
|---|
| 4303 | 3808 | } |
|---|
| 4304 | 3809 | } else { |
|---|
| 4305 | | - IAPSTA_ERROR(dev->name, "Unknown auth_alg=%d or auth_seq=%d\n", |
|---|
| 4306 | | - auth_alg, auth_seq); |
|---|
| 3810 | + WL_ERR(("Unknown auth_alg=%d or auth_seq=%d\n", auth_alg, auth_seq)); |
|---|
| 4307 | 3811 | } |
|---|
| 4308 | 3812 | |
|---|
| 4309 | 3813 | return; |
|---|
| .. | .. |
|---|
| 4383 | 3887 | return maxassoc; |
|---|
| 4384 | 3888 | } |
|---|
| 4385 | 3889 | |
|---|
| 4386 | | -static int |
|---|
| 4387 | | -dev_wlc_ioctl(struct net_device *dev, int cmd, void *arg, int len) |
|---|
| 4388 | | -{ |
|---|
| 4389 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 4390 | | - dhd_ioctl_t ioc; |
|---|
| 4391 | | - int8 index; |
|---|
| 4392 | | - int ret; |
|---|
| 4393 | | - |
|---|
| 4394 | | - memset(&ioc, 0, sizeof(ioc)); |
|---|
| 4395 | | - ioc.cmd = cmd; |
|---|
| 4396 | | - ioc.buf = arg; |
|---|
| 4397 | | - ioc.len = len; |
|---|
| 4398 | | - |
|---|
| 4399 | | - index = dhd_net2idx(dhd->info, dev); |
|---|
| 4400 | | - if (index == DHD_BAD_IF) { |
|---|
| 4401 | | - IAPSTA_ERROR(dev->name, "Bad ifidx from dev\n"); |
|---|
| 4402 | | - return -ENODEV; |
|---|
| 4403 | | - } |
|---|
| 4404 | | - ret = dhd_ioctl_process(dhd, index, &ioc, arg); |
|---|
| 4405 | | - |
|---|
| 4406 | | - return ret; |
|---|
| 4407 | | -} |
|---|
| 4408 | | - |
|---|
| 4409 | | -static void |
|---|
| 4410 | | -wl_ampdu_dump(struct net_device *dev) |
|---|
| 4411 | | -{ |
|---|
| 4412 | | - char *ioctl_buf = g_ioctl_buf, *buf = NULL; |
|---|
| 4413 | | - char *tx_pch_start, *tx_pch_end, *rx_pch_start, *rx_pch_end; |
|---|
| 4414 | | - int ret = 0, max_len, tx_len, rx_len; |
|---|
| 4415 | | - |
|---|
| 4416 | | - if (!(android_msg_level & ANDROID_AMPDU_LEVEL)) |
|---|
| 4417 | | - return; |
|---|
| 4418 | | - |
|---|
| 4419 | | - memset(ioctl_buf, 0, WL_DUMP_BUF_LEN); |
|---|
| 4420 | | - ret = bcm_mkiovar("dump", "ampdu", strlen("ampdu"), ioctl_buf, WL_DUMP_BUF_LEN); |
|---|
| 4421 | | - if (ret == 0) { |
|---|
| 4422 | | - goto exit; |
|---|
| 4423 | | - } |
|---|
| 4424 | | - ret = dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)ioctl_buf, WL_DUMP_BUF_LEN); |
|---|
| 4425 | | - if (ret) { |
|---|
| 4426 | | - goto exit; |
|---|
| 4427 | | - } |
|---|
| 4428 | | - |
|---|
| 4429 | | - buf = kmalloc(WLC_IOCTL_MEDLEN, GFP_KERNEL); |
|---|
| 4430 | | - if (buf == NULL) { |
|---|
| 4431 | | - IAPSTA_ERROR(dev->name, "Failed to allocate buffer of %d bytes\n", WLC_IOCTL_MEDLEN); |
|---|
| 4432 | | - goto exit; |
|---|
| 4433 | | - } |
|---|
| 4434 | | - memset(buf, 0, WLC_IOCTL_MEDLEN); |
|---|
| 4435 | | - ret = bcm_mkiovar("dump_clear", "ampdu", strlen("ampdu"), buf, WLC_IOCTL_MEDLEN); |
|---|
| 4436 | | - if (ret == 0) { |
|---|
| 4437 | | - goto exit; |
|---|
| 4438 | | - } |
|---|
| 4439 | | - ret = dev_wlc_ioctl(dev, WLC_SET_VAR, (void *)buf, WLC_IOCTL_MEDLEN); |
|---|
| 4440 | | - if (ret) { |
|---|
| 4441 | | - goto exit; |
|---|
| 4442 | | - } |
|---|
| 4443 | | - |
|---|
| 4444 | | - tx_pch_start = strstr(ioctl_buf, "TX MCS"); |
|---|
| 4445 | | - tx_pch_end = strstr(ioctl_buf, "HEMU"); |
|---|
| 4446 | | - rx_pch_start = strstr(ioctl_buf, "RX MCS"); |
|---|
| 4447 | | - rx_pch_end = strstr(ioctl_buf, "RX MCS SGI"); |
|---|
| 4448 | | - max_len = (tx_pch_end-tx_pch_start) + (rx_pch_end-rx_pch_start); |
|---|
| 4449 | | - if (max_len > (WLC_IOCTL_MEDLEN-1)) |
|---|
| 4450 | | - goto exit; |
|---|
| 4451 | | - |
|---|
| 4452 | | - tx_len = tx_pch_end - tx_pch_start; |
|---|
| 4453 | | - rx_len = rx_pch_end - rx_pch_start; |
|---|
| 4454 | | - |
|---|
| 4455 | | - memset(buf, 0, WLC_IOCTL_MEDLEN); |
|---|
| 4456 | | - memcpy(buf, tx_pch_start, tx_len); |
|---|
| 4457 | | - memcpy(buf+tx_len, rx_pch_start, rx_len); |
|---|
| 4458 | | - WL_MSG(dev->name,"\n%s\n", buf); |
|---|
| 4459 | | - |
|---|
| 4460 | | -exit: |
|---|
| 4461 | | - if (buf) |
|---|
| 4462 | | - kfree(buf); |
|---|
| 4463 | | -} |
|---|
| 4464 | | - |
|---|
| 4465 | | -static void |
|---|
| 4466 | | -wl_btc_dump(struct net_device *dev) |
|---|
| 4467 | | -{ |
|---|
| 4468 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 4469 | | - int ret, val; |
|---|
| 4470 | | - |
|---|
| 4471 | | - if (!(android_msg_level & ANDROID_BTC_LEVEL)) |
|---|
| 4472 | | - return; |
|---|
| 4473 | | - |
|---|
| 4474 | | - ret = dhd_conf_reg2args(dhd, "btc_params", FALSE, 15, &val); |
|---|
| 4475 | | - if (!ret) |
|---|
| 4476 | | - WL_MSG(dev->name,"btc_params15=%d\n", val); |
|---|
| 4477 | | -} |
|---|
| 4478 | | - |
|---|
| 4479 | | -static void |
|---|
| 4480 | | -wl_tvpm_dump(struct net_device *dev) |
|---|
| 4481 | | -{ |
|---|
| 4482 | | - wl_tvpm_req_t* tvpm_req = NULL; |
|---|
| 4483 | | - size_t reqlen = sizeof(wl_tvpm_req_t) + sizeof(wl_tvpm_status_t); |
|---|
| 4484 | | - uint8 *outbuf = g_ioctl_buf; |
|---|
| 4485 | | - size_t outlen = WLC_IOCTL_MEDLEN; |
|---|
| 4486 | | - wl_tvpm_status_t* status; |
|---|
| 4487 | | - int ret, phy_temp = 0; |
|---|
| 4488 | | - bool tvpm = FALSE, sense = FALSE; |
|---|
| 4489 | | - |
|---|
| 4490 | | - if (!(android_msg_level & ANDROID_TVPM_LEVEL)) |
|---|
| 4491 | | - return; |
|---|
| 4492 | | - |
|---|
| 4493 | | - tvpm_req = kmalloc(reqlen, GFP_KERNEL); |
|---|
| 4494 | | - if (tvpm_req == NULL) { |
|---|
| 4495 | | - IAPSTA_ERROR(dev->name, "MALLOC failed\n"); |
|---|
| 4496 | | - goto exit; |
|---|
| 4497 | | - } |
|---|
| 4498 | | - memset(tvpm_req, 0, reqlen); |
|---|
| 4499 | | - |
|---|
| 4500 | | - tvpm_req->version = TVPM_REQ_VERSION_1; |
|---|
| 4501 | | - tvpm_req->length = reqlen; |
|---|
| 4502 | | - tvpm_req->req_type = WL_TVPM_REQ_STATUS; |
|---|
| 4503 | | - ret = wldev_iovar_getbuf(dev, "tvpm", tvpm_req, reqlen, outbuf, outlen, NULL); |
|---|
| 4504 | | - status = (wl_tvpm_status_t*)outbuf; |
|---|
| 4505 | | - if (!ret && status->enable) { |
|---|
| 4506 | | - tvpm = TRUE; |
|---|
| 4507 | | - } else { |
|---|
| 4508 | | - ret = wldev_iovar_getbuf(dev, "phy_tempsense", &phy_temp, sizeof(phy_temp), |
|---|
| 4509 | | - outbuf, outlen, NULL); |
|---|
| 4510 | | - if (!ret) { |
|---|
| 4511 | | - phy_temp = dtoh32(*(int*)outbuf); |
|---|
| 4512 | | - sense = TRUE; |
|---|
| 4513 | | - } |
|---|
| 4514 | | - } |
|---|
| 4515 | | - |
|---|
| 4516 | | - if (tvpm) { |
|---|
| 4517 | | - WL_MSG(dev->name,"temp=%3d, duty=%3d, pwrbko=%d, chains=%d\n", |
|---|
| 4518 | | - status->temp, status->tx_dutycycle, status->tx_power_backoff, |
|---|
| 4519 | | - status->num_active_chains); |
|---|
| 4520 | | - } |
|---|
| 4521 | | - else if (sense) { |
|---|
| 4522 | | - WL_MSG(dev->name,"phy_temp=%3d\n", phy_temp); |
|---|
| 4523 | | - } |
|---|
| 4524 | | - |
|---|
| 4525 | | -exit: |
|---|
| 4526 | | - if (tvpm_req) |
|---|
| 4527 | | - kfree(tvpm_req); |
|---|
| 4528 | | -} |
|---|
| 4529 | | - |
|---|
| 4530 | 3890 | static void |
|---|
| 4531 | 3891 | wl_phy_rssi_ant(struct net_device *dev, struct ether_addr *mac, |
|---|
| 4532 | 3892 | char *rssi_buf, int len) |
|---|
| .. | .. |
|---|
| 4552 | 3912 | wldev_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t), 0); |
|---|
| 4553 | 3913 | rssi_ant_p->count = 1; |
|---|
| 4554 | 3914 | rssi_ant_p->rssi_ant[0] = dtoh32(scb_val.val); |
|---|
| 4555 | | - } else { |
|---|
| 4556 | | - rssi_ant_p->count = 0; |
|---|
| 4557 | 3915 | } |
|---|
| 4558 | 3916 | } |
|---|
| 4559 | 3917 | for (i=0; i<rssi_ant_p->count && rssi_ant_p->rssi_ant[i]; i++) { |
|---|
| .. | .. |
|---|
| 4579 | 3937 | static void |
|---|
| 4580 | 3938 | wl_sta_info_dump(struct net_device *dev, struct ether_addr *mac) |
|---|
| 4581 | 3939 | { |
|---|
| 4582 | | - void *buf = g_ioctl_buf; |
|---|
| 3940 | + void *buf = NULL; |
|---|
| 4583 | 3941 | sta_info_v4_t *sta = NULL; |
|---|
| 4584 | 3942 | char rssi_buf[16]; |
|---|
| 4585 | 3943 | int ret; |
|---|
| 4586 | 3944 | s32 rate = 0; |
|---|
| 4587 | 3945 | |
|---|
| 3946 | + buf = kmalloc(WLC_IOCTL_MEDLEN, GFP_KERNEL); |
|---|
| 3947 | + if (buf == NULL) { |
|---|
| 3948 | + IAPSTA_ERROR(dev->name, "MALLOC failed\n"); |
|---|
| 3949 | + goto exit; |
|---|
| 3950 | + } |
|---|
| 4588 | 3951 | memset(rssi_buf, 0, sizeof(rssi_buf)); |
|---|
| 4589 | 3952 | wl_phy_rssi_ant(dev, mac, rssi_buf, sizeof(rssi_buf)); |
|---|
| 4590 | 3953 | ret = wldev_iovar_getbuf(dev, "sta_info", (const void*)mac, |
|---|
| .. | .. |
|---|
| 4592 | 3955 | if (ret == 0) { |
|---|
| 4593 | 3956 | sta = (sta_info_v4_t *)buf; |
|---|
| 4594 | 3957 | } |
|---|
| 4595 | | - if (sta == NULL || (sta->ver != WL_STA_VER_4 && sta->ver != WL_STA_VER_5 && |
|---|
| 4596 | | - sta->ver != WL_STA_VER_6)) { |
|---|
| 3958 | + if (sta == NULL || (sta->ver != WL_STA_VER_4 && sta->ver != WL_STA_VER_5)) { |
|---|
| 4597 | 3959 | wldev_ioctl_get(dev, WLC_GET_RATE, &rate, sizeof(rate)); |
|---|
| 4598 | 3960 | rate = dtoh32(rate); |
|---|
| 4599 | 3961 | WL_MSG(dev->name, |
|---|
| 4600 | 3962 | "mac=%pM, rssi=%s, tx_rate:%4d%2s\n", |
|---|
| 4601 | 3963 | mac, rssi_buf, rate/2, (rate & 1) ? ".5" : ""); |
|---|
| 4602 | 3964 | } else { |
|---|
| 4603 | | - if (dtoh32(sta->rx_rate) != -1) { |
|---|
| 4604 | | - WL_MSG(dev->name, |
|---|
| 4605 | | - "mac=%pM, rssi=%s, tx_rate:%4d.%d, rx_rate:%4d.%d\n", |
|---|
| 4606 | | - mac, rssi_buf, |
|---|
| 4607 | | - dtoh32(sta->tx_rate)/1000, ((dtoh32(sta->tx_rate)/100)%10), |
|---|
| 4608 | | - dtoh32(sta->rx_rate)/1000, ((dtoh32(sta->rx_rate)/100)%10)); |
|---|
| 4609 | | - } else { |
|---|
| 4610 | | - WL_MSG(dev->name, |
|---|
| 4611 | | - "mac=%pM, rssi=%s, tx_rate:%4d.%d, rx_rate:%4d\n", |
|---|
| 4612 | | - mac, rssi_buf, |
|---|
| 4613 | | - dtoh32(sta->tx_rate)/1000, ((dtoh32(sta->tx_rate)/100)%10), |
|---|
| 4614 | | - dtoh32(sta->rx_rate)); |
|---|
| 4615 | | - } |
|---|
| 3965 | + WL_MSG(dev->name, |
|---|
| 3966 | + "mac=%pM, rssi=%s, tx_rate:%4d.%d, rx_rate:%4d.%d\n", mac, rssi_buf, |
|---|
| 3967 | + dtoh32(sta->tx_rate)/1000, ((dtoh32(sta->tx_rate)/100)%10), |
|---|
| 3968 | + dtoh32(sta->rx_rate)/1000, ((dtoh32(sta->rx_rate)/100)%10)); |
|---|
| 3969 | + } |
|---|
| 3970 | + |
|---|
| 3971 | +exit: |
|---|
| 3972 | + if (buf) { |
|---|
| 3973 | + kfree(buf); |
|---|
| 4616 | 3974 | } |
|---|
| 4617 | 3975 | } |
|---|
| 4618 | 3976 | |
|---|
| .. | .. |
|---|
| 4705 | 4063 | } |
|---|
| 4706 | 4064 | |
|---|
| 4707 | 4065 | static void |
|---|
| 4708 | | -wl_tput_monitor_handler(struct wl_if_info *cur_if, |
|---|
| 4709 | | - const wl_event_msg_t *e, void *data) |
|---|
| 4066 | +wl_tput_monitor_handler(struct wl_apsta_params *apsta_params, |
|---|
| 4067 | + struct wl_if_info *cur_if, const wl_event_msg_t *e, void *data) |
|---|
| 4710 | 4068 | { |
|---|
| 4711 | | - struct dhd_pub *dhd = dhd_get_pub(cur_if->dev); |
|---|
| 4712 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 4069 | + struct dhd_pub *dhd = apsta_params->dhd; |
|---|
| 4713 | 4070 | wl_tput_info_t *tput_info; |
|---|
| 4714 | 4071 | struct wl_if_info *tmp_if; |
|---|
| 4715 | 4072 | #ifdef WLDWDS |
|---|
| .. | .. |
|---|
| 4730 | 4087 | tmp_if = &apsta_params->if_info[i]; |
|---|
| 4731 | 4088 | if (tmp_if->dev && |
|---|
| 4732 | 4089 | (tmp_if->ifmode == ISTA_MODE || tmp_if->ifmode == IGC_MODE) && |
|---|
| 4733 | | - wl_get_isam_status(tmp_if, STA_CONNECTED)) { |
|---|
| 4090 | + wl_ext_associated(tmp_if->dev)) { |
|---|
| 4734 | 4091 | wl_tput_monitor(dhd, tmp_if->ifidx, &tmp_if->tput_info); |
|---|
| 4735 | 4092 | monitor_if[i] = TRUE; |
|---|
| 4736 | 4093 | } |
|---|
| .. | .. |
|---|
| 4766 | 4123 | monitor = TRUE; |
|---|
| 4767 | 4124 | } |
|---|
| 4768 | 4125 | } |
|---|
| 4769 | | - if (monitor) { |
|---|
| 4770 | | - wl_btc_dump(cur_if->dev); |
|---|
| 4771 | | - wl_tvpm_dump(cur_if->dev); |
|---|
| 4772 | | - wl_ampdu_dump(cur_if->dev); |
|---|
| 4773 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, timeout); |
|---|
| 4774 | | - } |
|---|
| 4126 | + if (monitor) |
|---|
| 4127 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, timeout); |
|---|
| 4775 | 4128 | #ifdef BCMSDIO |
|---|
| 4776 | 4129 | if (apsta_params->tput_sum >= dhd->conf->doflow_tput_thresh && dhd_doflow) { |
|---|
| 4777 | 4130 | dhd_doflow = FALSE; |
|---|
| .. | .. |
|---|
| 4787 | 4140 | else if (cur_if->ifmode == ISTA_MODE || cur_if->ifmode == IGC_MODE) { |
|---|
| 4788 | 4141 | if (etype == WLC_E_LINK) { |
|---|
| 4789 | 4142 | if (flags & WLC_EVENT_MSG_LINK) { |
|---|
| 4790 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, timeout); |
|---|
| 4143 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, timeout); |
|---|
| 4791 | 4144 | } else if (!wl_ext_iapsta_other_if_enabled(cur_if->dev)) { |
|---|
| 4792 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, 0); |
|---|
| 4145 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, 0); |
|---|
| 4793 | 4146 | } |
|---|
| 4794 | 4147 | } |
|---|
| 4795 | 4148 | } |
|---|
| .. | .. |
|---|
| 4797 | 4150 | if ((etype == WLC_E_SET_SSID && status == WLC_E_STATUS_SUCCESS) || |
|---|
| 4798 | 4151 | (etype == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
|---|
| 4799 | 4152 | reason == WLC_E_REASON_INITIAL_ASSOC)) { |
|---|
| 4800 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, timeout); |
|---|
| 4153 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, timeout); |
|---|
| 4801 | 4154 | } else if ((etype == WLC_E_LINK && reason == WLC_E_LINK_BSSCFG_DIS) || |
|---|
| 4802 | 4155 | (etype == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
|---|
| 4803 | 4156 | reason == WLC_E_REASON_DEAUTH)) { |
|---|
| 4804 | 4157 | if (!wl_ext_iapsta_other_if_enabled(cur_if->dev)) { |
|---|
| 4805 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, 0); |
|---|
| 4158 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, 0); |
|---|
| 4806 | 4159 | } |
|---|
| 4807 | 4160 | } else if ((etype == WLC_E_ASSOC_IND || etype == WLC_E_REASSOC_IND) && |
|---|
| 4808 | 4161 | reason == DOT11_SC_SUCCESS) { |
|---|
| 4809 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, timeout); |
|---|
| 4162 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, timeout); |
|---|
| 4810 | 4163 | } |
|---|
| 4811 | 4164 | } |
|---|
| 4812 | 4165 | } |
|---|
| 4813 | 4166 | #endif /* TPUT_MONITOR */ |
|---|
| 4814 | 4167 | |
|---|
| 4815 | 4168 | #ifdef ACS_MONITOR |
|---|
| 4169 | +static void |
|---|
| 4170 | +wl_ext_mod_timer_pending(timer_list_compat_t *timer, uint sec, uint msec) |
|---|
| 4171 | +{ |
|---|
| 4172 | + uint timeout = sec * 1000 + msec; |
|---|
| 4173 | + |
|---|
| 4174 | + if (timeout && !timer_pending(timer)) { |
|---|
| 4175 | + IAPSTA_TRACE("wlan", "timeout=%d\n", timeout); |
|---|
| 4176 | + mod_timer(timer, jiffies + msecs_to_jiffies(timeout)); |
|---|
| 4177 | + } |
|---|
| 4178 | +} |
|---|
| 4179 | + |
|---|
| 4816 | 4180 | static bool |
|---|
| 4817 | 4181 | wl_ext_max_prio_if(struct wl_apsta_params *apsta_params, |
|---|
| 4818 | 4182 | struct wl_if_info *cur_if) |
|---|
| .. | .. |
|---|
| 4867 | 4231 | if (apsta_params->acs & ACS_DRV_BIT) { |
|---|
| 4868 | 4232 | mutex_lock(&apsta_params->usr_sync); |
|---|
| 4869 | 4233 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 4870 | | - wl_ext_get_chan(cur_if->dev, &chan_info); |
|---|
| 4234 | + wl_ext_get_chan(apsta_params, cur_if->dev, &chan_info); |
|---|
| 4871 | 4235 | if (chan_info.chan) { |
|---|
| 4872 | 4236 | if (chan_info.band == WLC_BAND_5G) |
|---|
| 4873 | 4237 | cur_if->chan_info.chan = cur_if->escan->best_5g_ch; |
|---|
| .. | .. |
|---|
| 4876 | 4240 | wl_ext_move_cur_channel(apsta_params, cur_if); |
|---|
| 4877 | 4241 | if (!wl_ext_same_chan(&cur_if->chan_info, &chan_info)) { |
|---|
| 4878 | 4242 | WL_MSG(cur_if->dev->name, "move channel %s-%d => %s-%d\n", |
|---|
| 4879 | | - WLCBAND2STR(chan_info.band), chan_info.chan, |
|---|
| 4243 | + WLCBAND2STR(chan_info->band), chan_info.chan, |
|---|
| 4880 | 4244 | WLCBAND2STR(cur_if->chan_info.band), cur_if->chan_info.chan); |
|---|
| 4881 | 4245 | wl_ext_if_down(apsta_params, cur_if); |
|---|
| 4882 | 4246 | wl_ext_move_other_channel(apsta_params, cur_if); |
|---|
| .. | .. |
|---|
| 4925 | 4289 | (etype == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
|---|
| 4926 | 4290 | reason == WLC_E_REASON_INITIAL_ASSOC)) { |
|---|
| 4927 | 4291 | // Link up |
|---|
| 4928 | | - wl_timer_mod(dhd, &cur_if->acs_timer, acs_tmo*1000); |
|---|
| 4292 | + wl_ext_mod_timer_pending(&cur_if->acs_timer, acs_tmo, 0); |
|---|
| 4929 | 4293 | } |
|---|
| 4930 | 4294 | else if ((etype == WLC_E_LINK && reason == WLC_E_LINK_BSSCFG_DIS) || |
|---|
| 4931 | 4295 | (etype == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
|---|
| 4932 | 4296 | reason == WLC_E_REASON_DEAUTH)) { |
|---|
| 4933 | 4297 | // Link down |
|---|
| 4934 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
|---|
| 4298 | + wl_ext_mod_timer(&cur_if->acs_timer, 0, 0); |
|---|
| 4935 | 4299 | cur_if->escan->autochannel = 0; |
|---|
| 4936 | 4300 | } |
|---|
| 4937 | 4301 | else if ((etype == WLC_E_ASSOC_IND || etype == WLC_E_REASSOC_IND) && |
|---|
| 4938 | 4302 | reason == DOT11_SC_SUCCESS) { |
|---|
| 4939 | 4303 | // external STA connected |
|---|
| 4940 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
|---|
| 4304 | + wl_ext_mod_timer(&cur_if->acs_timer, 0, 0); |
|---|
| 4941 | 4305 | } |
|---|
| 4942 | 4306 | else if (etype == WLC_E_DISASSOC_IND || |
|---|
| 4943 | 4307 | etype == WLC_E_DEAUTH_IND || |
|---|
| 4944 | 4308 | (etype == WLC_E_DEAUTH && reason != DOT11_RC_RESERVED)) { |
|---|
| 4945 | 4309 | // external STA disconnected |
|---|
| 4946 | | - wl_timer_mod(dhd, &cur_if->acs_timer, acs_tmo*1000); |
|---|
| 4310 | + wl_ext_mod_timer_pending(&cur_if->acs_timer, acs_tmo, 0); |
|---|
| 4947 | 4311 | } |
|---|
| 4948 | 4312 | else if (etype == WLC_E_RESERVED && reason == ISAM_RC_AP_ACS) { |
|---|
| 4949 | 4313 | // acs_tmo expired |
|---|
| 4950 | 4314 | if (!wl_ext_assoclist_num(cur_if->dev) && |
|---|
| 4951 | 4315 | !wl_ext_max_prio_if(apsta_params, cur_if)) { |
|---|
| 4952 | 4316 | wl_ext_acs_scan(apsta_params, cur_if); |
|---|
| 4953 | | - wl_timer_mod(dhd, &cur_if->acs_timer, acs_tmo*1000); |
|---|
| 4317 | + wl_ext_mod_timer(&cur_if->acs_timer, acs_tmo, 0); |
|---|
| 4954 | 4318 | } else { |
|---|
| 4955 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
|---|
| 4319 | + wl_ext_mod_timer(&cur_if->acs_timer, 0, 0); |
|---|
| 4956 | 4320 | } |
|---|
| 4957 | 4321 | } |
|---|
| 4958 | 4322 | else if (((etype == WLC_E_ESCAN_RESULT && status == WLC_E_STATUS_SUCCESS) || |
|---|
| .. | .. |
|---|
| 4966 | 4330 | !wl_ext_max_prio_if(apsta_params, cur_if)) { |
|---|
| 4967 | 4331 | wl_ext_acs(apsta_params, cur_if); |
|---|
| 4968 | 4332 | } else { |
|---|
| 4969 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
|---|
| 4333 | + wl_ext_mod_timer(&cur_if->acs_timer, 0, 0); |
|---|
| 4970 | 4334 | } |
|---|
| 4971 | 4335 | } |
|---|
| 4972 | 4336 | } |
|---|
| .. | .. |
|---|
| 4976 | 4340 | wl_acs_detach(struct wl_if_info *cur_if) |
|---|
| 4977 | 4341 | { |
|---|
| 4978 | 4342 | IAPSTA_TRACE(cur_if->dev->name, "Enter\n"); |
|---|
| 4979 | | - wl_timer_deregister(cur_if->dev, &cur_if->acs_timer); |
|---|
| 4343 | + del_timer_sync(&cur_if->acs_timer); |
|---|
| 4980 | 4344 | if (cur_if->escan) { |
|---|
| 4981 | 4345 | cur_if->escan = NULL; |
|---|
| 4982 | 4346 | } |
|---|
| .. | .. |
|---|
| 4987 | 4351 | { |
|---|
| 4988 | 4352 | IAPSTA_TRACE(cur_if->dev->name, "Enter\n"); |
|---|
| 4989 | 4353 | cur_if->escan = dhd->escan; |
|---|
| 4990 | | - wl_timer_register(cur_if->dev, &cur_if->acs_timer, wl_acs_timer); |
|---|
| 4354 | + init_timer_compat(&cur_if->acs_timer, wl_acs_timer, cur_if->dev); |
|---|
| 4991 | 4355 | } |
|---|
| 4992 | 4356 | #endif /* ACS_MONITOR */ |
|---|
| 4993 | 4357 | |
|---|
| .. | .. |
|---|
| 5030 | 4394 | WL_MSG(cur_if->ifname, "restart AP\n"); |
|---|
| 5031 | 4395 | wl_ext_if_down(apsta_params, cur_if); |
|---|
| 5032 | 4396 | wl_ext_if_up(apsta_params, cur_if, FALSE, 1); |
|---|
| 5033 | | - wl_timer_mod(dhd, &cur_if->restart_ap_timer, AP_RESTART_TIMEOUT); |
|---|
| 4397 | + wl_ext_mod_timer(&cur_if->restart_ap_timer, AP_RESTART_TIMEOUT, 0); |
|---|
| 5034 | 4398 | } else { |
|---|
| 5035 | 4399 | WL_MSG(cur_if->ifname, "skip restart AP\n"); |
|---|
| 5036 | 4400 | } |
|---|
| .. | .. |
|---|
| 5119 | 4483 | { |
|---|
| 5120 | 4484 | struct dhd_pub *dhd = dhd_get_pub(cur_if->dev); |
|---|
| 5121 | 4485 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 5122 | | - char *iovar_buf = g_ioctl_buf; |
|---|
| 4486 | + char *iovar_buf = NULL; |
|---|
| 5123 | 4487 | uint32 corerev = 0; |
|---|
| 5124 | 4488 | wl_cnt_info_t *cntinfo; |
|---|
| 5125 | 4489 | uint16 ver; |
|---|
| 5126 | 4490 | int ret = 0; |
|---|
| 5127 | 4491 | |
|---|
| 4492 | + iovar_buf = kmalloc(WLC_IOCTL_MEDLEN, GFP_KERNEL); |
|---|
| 4493 | + if (!iovar_buf) { |
|---|
| 4494 | + IAPSTA_ERROR(cur_if->ifname, "no memory\n"); |
|---|
| 4495 | + ret = BCME_NOMEM; |
|---|
| 4496 | + goto exit; |
|---|
| 4497 | + } |
|---|
| 4498 | + |
|---|
| 4499 | + memset(iovar_buf, 0, WLC_IOCTL_MEDLEN); |
|---|
| 5128 | 4500 | ret = wldev_iovar_getbuf(cur_if->dev, "counters", NULL, 0, |
|---|
| 5129 | 4501 | iovar_buf, WLC_IOCTL_MEDLEN, NULL); |
|---|
| 5130 | 4502 | if (unlikely(ret)) { |
|---|
| .. | .. |
|---|
| 5137 | 4509 | cntinfo->datalen = dtoh16(cntinfo->datalen); |
|---|
| 5138 | 4510 | ver = cntinfo->version; |
|---|
| 5139 | 4511 | CHK_CNTBUF_DATALEN(iovar_buf, WLC_IOCTL_MEDLEN); |
|---|
| 5140 | | - if (ver > WL_CNT_VERSION_XTLV) { |
|---|
| 4512 | + if (ver > WL_CNT_T_VERSION) { |
|---|
| 5141 | 4513 | IAPSTA_ERROR(cur_if->ifname, |
|---|
| 5142 | 4514 | "Incorrect version of counters struct: expected %d; got %d\n", |
|---|
| 5143 | | - WL_CNT_VERSION_XTLV, ver); |
|---|
| 4515 | + WL_CNT_T_VERSION, ver); |
|---|
| 5144 | 4516 | goto exit; |
|---|
| 5145 | 4517 | } |
|---|
| 5146 | 4518 | |
|---|
| .. | .. |
|---|
| 5168 | 4540 | } |
|---|
| 5169 | 4541 | |
|---|
| 5170 | 4542 | exit: |
|---|
| 4543 | + if (iovar_buf) |
|---|
| 4544 | + kfree(iovar_buf); |
|---|
| 4545 | + |
|---|
| 5171 | 4546 | return ret; |
|---|
| 5172 | 4547 | } |
|---|
| 5173 | 4548 | #endif /* RESET_AP_WAR | RXF0OVFL_REINIT_WAR */ |
|---|
| .. | .. |
|---|
| 5214 | 4589 | reason == WLC_E_REASON_INITIAL_ASSOC)) { |
|---|
| 5215 | 4590 | // Link up |
|---|
| 5216 | 4591 | wl_ext_counters_update(cur_if, ISAM_RC_AP_RESET); |
|---|
| 5217 | | - wl_timer_mod(dhd, &cur_if->reset_ap_timer, AP_TXBCNFRM_TIMEOUT); |
|---|
| 4592 | + wl_ext_mod_timer(&cur_if->reset_ap_timer, AP_TXBCNFRM_TIMEOUT, 0); |
|---|
| 5218 | 4593 | } |
|---|
| 5219 | 4594 | else if (etype == WLC_E_RESERVED && reason == ISAM_RC_AP_RESET) { |
|---|
| 5220 | 4595 | txbcnfrm = cur_if->txbcnfrm; |
|---|
| .. | .. |
|---|
| 5227 | 4602 | wl_ext_if_up(apsta_params, cur_if, FALSE, 500); |
|---|
| 5228 | 4603 | } |
|---|
| 5229 | 4604 | done: |
|---|
| 5230 | | - wl_timer_mod(dhd, &cur_if->reset_ap_timer, AP_TXBCNFRM_TIMEOUT); |
|---|
| 4605 | + wl_ext_mod_timer(&cur_if->reset_ap_timer, AP_TXBCNFRM_TIMEOUT, 0); |
|---|
| 5231 | 4606 | } |
|---|
| 5232 | 4607 | } |
|---|
| 5233 | 4608 | return; |
|---|
| .. | .. |
|---|
| 5275 | 4650 | (etype == WLC_E_LINK) && (flags & WLC_EVENT_MSG_LINK)) { |
|---|
| 5276 | 4651 | // Link up |
|---|
| 5277 | 4652 | wl_ext_counters_update(cur_if, ISAM_RC_RXF0OVFL_REINIT); |
|---|
| 5278 | | - wl_timer_mod(dhd, &apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT); |
|---|
| 4653 | + wl_ext_mod_timer(&apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT, 0); |
|---|
| 5279 | 4654 | } |
|---|
| 5280 | 4655 | else if ((cur_if->ifmode == IAP_MODE) && |
|---|
| 5281 | 4656 | ((etype == WLC_E_SET_SSID && status == WLC_E_STATUS_SUCCESS) || |
|---|
| .. | .. |
|---|
| 5283 | 4658 | reason == WLC_E_REASON_INITIAL_ASSOC))) { |
|---|
| 5284 | 4659 | // Link up |
|---|
| 5285 | 4660 | wl_ext_counters_update(cur_if, ISAM_RC_RXF0OVFL_REINIT); |
|---|
| 5286 | | - wl_timer_mod(dhd, &apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT); |
|---|
| 4661 | + wl_ext_mod_timer(&apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT, 0); |
|---|
| 5287 | 4662 | } |
|---|
| 5288 | 4663 | else if ((etype == WLC_E_RESERVED) && (reason == ISAM_RC_RXF0OVFL_REINIT) && |
|---|
| 5289 | 4664 | (wl_ext_iapsta_other_if_enabled(cur_if->dev))) { |
|---|
| .. | .. |
|---|
| 5312 | 4687 | wl_ext_ioctl(cur_if->dev, WLC_INIT, NULL, 0, 1); |
|---|
| 5313 | 4688 | } |
|---|
| 5314 | 4689 | done: |
|---|
| 5315 | | - wl_timer_mod(dhd, &apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT); |
|---|
| 4690 | + wl_ext_mod_timer(&apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT, 0); |
|---|
| 5316 | 4691 | } |
|---|
| 5317 | 4692 | |
|---|
| 5318 | 4693 | return; |
|---|
| .. | .. |
|---|
| 5320 | 4695 | #endif /* RXF0OVFL_REINIT_WAR */ |
|---|
| 5321 | 4696 | |
|---|
| 5322 | 4697 | void |
|---|
| 5323 | | -wl_ext_iapsta_link(struct wl_if_info *cur_if, |
|---|
| 4698 | +wl_ext_iapsta_event(struct net_device *dev, void *argu, |
|---|
| 5324 | 4699 | const wl_event_msg_t *e, void *data) |
|---|
| 5325 | 4700 | { |
|---|
| 5326 | | - struct dhd_pub *dhd = dhd_get_pub(cur_if->dev); |
|---|
| 5327 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 4701 | + struct wl_apsta_params *apsta_params = (struct wl_apsta_params *)argu; |
|---|
| 4702 | + struct wl_if_info *cur_if = NULL; |
|---|
| 4703 | +#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 4704 | + struct wl_if_info *tmp_if = NULL; |
|---|
| 4705 | + struct wl_if_info *mesh_if = NULL; |
|---|
| 4706 | + int i; |
|---|
| 4707 | +#endif /* WLMESH && WL_ESCAN */ |
|---|
| 5328 | 4708 | uint32 event_type = ntoh32(e->event_type); |
|---|
| 5329 | 4709 | uint32 status = ntoh32(e->status); |
|---|
| 5330 | 4710 | uint32 reason = ntoh32(e->reason); |
|---|
| 5331 | 4711 | uint16 flags = ntoh16(e->flags); |
|---|
| 4712 | + |
|---|
| 4713 | + cur_if = wl_get_cur_if(dev); |
|---|
| 4714 | + |
|---|
| 4715 | +#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 4716 | + for (i=0; i<MAX_IF_NUM; i++) { |
|---|
| 4717 | + tmp_if = &apsta_params->if_info[i]; |
|---|
| 4718 | + if (tmp_if->dev && tmp_if->ifmode == IMESH_MODE) { |
|---|
| 4719 | + mesh_if = tmp_if; |
|---|
| 4720 | + break; |
|---|
| 4721 | + } |
|---|
| 4722 | + } |
|---|
| 4723 | +#endif /* WLMESH && WL_ESCAN */ |
|---|
| 4724 | + if (!cur_if || !cur_if->dev) { |
|---|
| 4725 | + IAPSTA_DBG(dev->name, "ifidx %d is not ready\n", e->ifidx); |
|---|
| 4726 | + return; |
|---|
| 4727 | + } |
|---|
| 5332 | 4728 | |
|---|
| 5333 | 4729 | if (cur_if->ifmode == ISTA_MODE || cur_if->ifmode == IGC_MODE) { |
|---|
| 5334 | 4730 | if (event_type == WLC_E_LINK) { |
|---|
| .. | .. |
|---|
| 5341 | 4737 | wl_ext_net_setcarrier(cur_if, FALSE, FALSE); |
|---|
| 5342 | 4738 | #endif /* SET_CARRIER */ |
|---|
| 5343 | 4739 | wl_clr_isam_status(cur_if, STA_CONNECTED); |
|---|
| 4740 | +#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 4741 | + if (mesh_if && apsta_params->macs) |
|---|
| 4742 | + wl_mesh_clear_mesh_info(apsta_params, mesh_if, TRUE); |
|---|
| 4743 | +#endif /* WLMESH && WL_ESCAN */ |
|---|
| 5344 | 4744 | } else { |
|---|
| 5345 | 4745 | WL_MSG(cur_if->ifname, "[%c] Link UP with %pM\n", |
|---|
| 5346 | 4746 | cur_if->prefix, &e->addr); |
|---|
| .. | .. |
|---|
| 5348 | 4748 | wl_ext_net_setcarrier(cur_if, TRUE, FALSE); |
|---|
| 5349 | 4749 | #endif /* SET_CARRIER */ |
|---|
| 5350 | 4750 | wl_set_isam_status(cur_if, STA_CONNECTED); |
|---|
| 4751 | +#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 4752 | + if (mesh_if && apsta_params->macs) |
|---|
| 4753 | + wl_mesh_update_master_info(apsta_params, mesh_if); |
|---|
| 4754 | +#endif /* WLMESH && WL_ESCAN */ |
|---|
| 5351 | 4755 | } |
|---|
| 5352 | 4756 | wl_clr_isam_status(cur_if, STA_CONNECTING); |
|---|
| 5353 | 4757 | wake_up_interruptible(&apsta_params->netif_change_event); |
|---|
| 5354 | 4758 | #ifdef PROPTX_MAXCOUNT |
|---|
| 5355 | | - wl_ext_update_wlfc_maxcount(dhd); |
|---|
| 4759 | + wl_ext_update_wlfc_maxcount(apsta_params->dhd); |
|---|
| 5356 | 4760 | #endif /* PROPTX_MAXCOUNT */ |
|---|
| 5357 | 4761 | } |
|---|
| 5358 | 4762 | else if (event_type == WLC_E_SET_SSID && status != WLC_E_STATUS_SUCCESS) { |
|---|
| .. | .. |
|---|
| 5361 | 4765 | event_type, reason, status); |
|---|
| 5362 | 4766 | wl_clr_isam_status(cur_if, STA_CONNECTING); |
|---|
| 5363 | 4767 | wake_up_interruptible(&apsta_params->netif_change_event); |
|---|
| 4768 | +#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 4769 | + if (mesh_if && apsta_params->macs) |
|---|
| 4770 | + wl_mesh_clear_mesh_info(apsta_params, mesh_if, TRUE); |
|---|
| 4771 | +#endif /* WLMESH && WL_ESCAN */ |
|---|
| 5364 | 4772 | #ifdef PROPTX_MAXCOUNT |
|---|
| 5365 | | - wl_ext_update_wlfc_maxcount(dhd); |
|---|
| 4773 | + wl_ext_update_wlfc_maxcount(apsta_params->dhd); |
|---|
| 5366 | 4774 | #endif /* PROPTX_MAXCOUNT */ |
|---|
| 5367 | 4775 | } |
|---|
| 5368 | 4776 | else if (event_type == WLC_E_DEAUTH || event_type == WLC_E_DEAUTH_IND || |
|---|
| .. | .. |
|---|
| 5373 | 4781 | #ifdef SET_CARRIER |
|---|
| 5374 | 4782 | wl_ext_net_setcarrier(cur_if, FALSE, FALSE); |
|---|
| 5375 | 4783 | #endif /* SET_CARRIER */ |
|---|
| 4784 | +#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 4785 | + if (mesh_if && apsta_params->macs) |
|---|
| 4786 | + wl_mesh_clear_mesh_info(apsta_params, mesh_if, TRUE); |
|---|
| 4787 | +#endif /* WLMESH && WL_ESCAN */ |
|---|
| 5376 | 4788 | } |
|---|
| 5377 | 4789 | } |
|---|
| 5378 | 4790 | else if (cur_if->ifmode == IAP_MODE || cur_if->ifmode == IGO_MODE || |
|---|
| .. | .. |
|---|
| 5394 | 4806 | wl_ext_net_setcarrier(cur_if, TRUE, FALSE); |
|---|
| 5395 | 4807 | #endif /* SET_CARRIER */ |
|---|
| 5396 | 4808 | #ifdef PROPTX_MAXCOUNT |
|---|
| 5397 | | - wl_ext_update_wlfc_maxcount(dhd); |
|---|
| 4809 | + wl_ext_update_wlfc_maxcount(apsta_params->dhd); |
|---|
| 5398 | 4810 | #endif /* PROPTX_MAXCOUNT */ |
|---|
| 5399 | 4811 | } |
|---|
| 5400 | 4812 | else if ((event_type == WLC_E_LINK && reason == WLC_E_LINK_BSSCFG_DIS) || |
|---|
| .. | .. |
|---|
| 5407 | 4819 | wl_ext_net_setcarrier(cur_if, FALSE, FALSE); |
|---|
| 5408 | 4820 | #endif /* SET_CARRIER */ |
|---|
| 5409 | 4821 | #ifdef PROPTX_MAXCOUNT |
|---|
| 5410 | | - wl_ext_update_wlfc_maxcount(dhd); |
|---|
| 4822 | + wl_ext_update_wlfc_maxcount(apsta_params->dhd); |
|---|
| 5411 | 4823 | #endif /* PROPTX_MAXCOUNT */ |
|---|
| 5412 | 4824 | } |
|---|
| 5413 | 4825 | else if ((event_type == WLC_E_ASSOC_IND || event_type == WLC_E_REASSOC_IND) && |
|---|
| .. | .. |
|---|
| 5425 | 4837 | event_type, reason); |
|---|
| 5426 | 4838 | wl_ext_isam_status(cur_if->dev, NULL, 0); |
|---|
| 5427 | 4839 | } |
|---|
| 5428 | | - } |
|---|
| 5429 | | -} |
|---|
| 5430 | | - |
|---|
| 5431 | | -void |
|---|
| 5432 | | -wl_ext_iapsta_event(struct net_device *dev, void *argu, |
|---|
| 5433 | | - const wl_event_msg_t *e, void *data) |
|---|
| 5434 | | -{ |
|---|
| 5435 | | -#ifdef ACS_MONITOR |
|---|
| 5436 | | - struct wl_apsta_params *apsta_params = (struct wl_apsta_params *)argu; |
|---|
| 5437 | | -#endif /* ACS_MONITOR */ |
|---|
| 5438 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 5439 | | - struct wl_if_info *cur_if = NULL; |
|---|
| 5440 | | - |
|---|
| 5441 | | - cur_if = wl_get_cur_if(dev); |
|---|
| 5442 | | - if (!cur_if || !cur_if->dev) { |
|---|
| 5443 | | - IAPSTA_DBG(dev->name, "ifidx %d is not ready\n", e->ifidx); |
|---|
| 5444 | | - return; |
|---|
| 4840 | +#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 4841 | + if (cur_if->ifmode == IMESH_MODE && apsta_params->macs) |
|---|
| 4842 | + wl_mesh_event_handler(apsta_params, cur_if, e, data); |
|---|
| 4843 | +#endif /* WLMESH && WL_ESCAN */ |
|---|
| 5445 | 4844 | } |
|---|
| 5446 | 4845 | |
|---|
| 5447 | | - wl_ext_iapsta_link(cur_if, e, data); |
|---|
| 5448 | 4846 | #ifdef TPUT_MONITOR |
|---|
| 5449 | | - if (dhd->conf->tput_monitor_ms) |
|---|
| 5450 | | - wl_tput_monitor_handler(cur_if, e, data); |
|---|
| 4847 | + if (apsta_params->dhd->conf->tput_monitor_ms) |
|---|
| 4848 | + wl_tput_monitor_handler(apsta_params, cur_if, e, data); |
|---|
| 5451 | 4849 | #endif /* TPUT_MONITOR */ |
|---|
| 5452 | 4850 | |
|---|
| 5453 | | -#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 5454 | | - wl_mesh_event_handler(cur_if, e, data); |
|---|
| 5455 | | -#endif /* WLMESH && WL_ESCAN */ |
|---|
| 5456 | 4851 | #ifdef ACS_MONITOR |
|---|
| 5457 | 4852 | if ((apsta_params->acs & ACS_DRV_BIT) && apsta_params->acs_tmo) |
|---|
| 5458 | 4853 | wl_acs_handler(cur_if, e, data); |
|---|
| .. | .. |
|---|
| 5460 | 4855 | #ifdef EAPOL_RESEND |
|---|
| 5461 | 4856 | wl_resend_eapol_handler(cur_if, e, data); |
|---|
| 5462 | 4857 | #endif /* EAPOL_RESEND */ |
|---|
| 5463 | | -#ifdef KEY_INSTALL_CHECK |
|---|
| 5464 | | - wl_ext_key_install_handler(cur_if, e, data); |
|---|
| 5465 | | -#endif /* KEY_INSTALL_CHECK */ |
|---|
| 5466 | 4858 | #ifdef RESTART_AP_WAR |
|---|
| 5467 | 4859 | wl_ext_restart_ap_handler(cur_if, e, data); |
|---|
| 5468 | 4860 | #endif /* RESTART_AP_WAR */ |
|---|
| .. | .. |
|---|
| 5714 | 5106 | cur_if->vsdb = FALSE; |
|---|
| 5715 | 5107 | cur_if->prefix = 'M'; |
|---|
| 5716 | 5108 | snprintf(cur_if->ssid, DOT11_MAX_SSID_LEN, "ttt_mesh"); |
|---|
| 5109 | +#ifdef WL_ESCAN |
|---|
| 5110 | + if (i == 0 && apsta_params->macs) |
|---|
| 5111 | + wl_mesh_escan_attach(dhd, cur_if); |
|---|
| 5112 | +#endif /* WL_ESCAN */ |
|---|
| 5717 | 5113 | #endif /* WLMESH */ |
|---|
| 5718 | 5114 | } |
|---|
| 5719 | 5115 | } |
|---|
| .. | .. |
|---|
| 5821 | 5217 | } |
|---|
| 5822 | 5218 | #endif /* WLMESH */ |
|---|
| 5823 | 5219 | |
|---|
| 5220 | + wl_ext_get_ioctl_ver(dev, &apsta_params->ioctl_ver); |
|---|
| 5824 | 5221 | apsta_params->init = TRUE; |
|---|
| 5825 | 5222 | |
|---|
| 5826 | 5223 | WL_MSG(dev->name, "apstamode=%d\n", apstamode); |
|---|
| .. | .. |
|---|
| 5978 | 5375 | (chan_5g && cur_if->chan_info.band == WLC_BAND_5G)) { |
|---|
| 5979 | 5376 | cur_if->chan_info.chan = wl_ext_autochannel(cur_if->dev, apsta_params->acs, |
|---|
| 5980 | 5377 | cur_if->chan_info.band); |
|---|
| 5981 | | - cur_if->chan_info.chan = wf_chspec_ctlchan(cur_if->chan_info.chan); |
|---|
| 5982 | 5378 | } else { |
|---|
| 5983 | 5379 | IAPSTA_ERROR(ifname, "invalid channel\n"); |
|---|
| 5984 | 5380 | ret = -1; |
|---|
| .. | .. |
|---|
| 5995 | 5391 | } |
|---|
| 5996 | 5392 | |
|---|
| 5997 | 5393 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
|---|
| 5998 | | - wl_ext_get_chan(cur_if->dev, &chan_info); |
|---|
| 5394 | + wl_ext_get_chan(apsta_params, cur_if->dev, &chan_info); |
|---|
| 5999 | 5395 | if (chan_info.chan) { |
|---|
| 6000 | 5396 | IAPSTA_INFO(cur_if->ifname, "Associated\n"); |
|---|
| 6001 | 5397 | if (!wl_ext_same_chan(&cur_if->chan_info, &chan_info)) { |
|---|
| .. | .. |
|---|
| 6040 | 5436 | } |
|---|
| 6041 | 5437 | |
|---|
| 6042 | 5438 | wl_ext_set_amode(cur_if); |
|---|
| 6043 | | - wl_ext_set_emode(cur_if); |
|---|
| 5439 | + wl_ext_set_emode(apsta_params, cur_if); |
|---|
| 6044 | 5440 | |
|---|
| 6045 | 5441 | if (cur_if->ifmode == ISTA_MODE) { |
|---|
| 6046 | 5442 | conn_info.bssidx = cur_if->bssidx; |
|---|
| .. | .. |
|---|
| 6171 | 5567 | wl_ext_isam_dev_status(struct net_device *dev, ifmode_t ifmode, char prefix, |
|---|
| 6172 | 5568 | char *dump_buf, int dump_len) |
|---|
| 6173 | 5569 | { |
|---|
| 5570 | + struct dhd_pub *dhd = dhd_get_pub(dev); |
|---|
| 5571 | + struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 6174 | 5572 | struct wl_chan_info chan_info; |
|---|
| 6175 | 5573 | wlc_ssid_t ssid = { 0, {0} }; |
|---|
| 6176 | 5574 | struct ether_addr bssid; |
|---|
| .. | .. |
|---|
| 6187 | 5585 | if (wl_ext_associated(dev)) { |
|---|
| 6188 | 5586 | wl_ext_ioctl(dev, WLC_GET_SSID, &ssid, sizeof(ssid), 0); |
|---|
| 6189 | 5587 | wldev_ioctl(dev, WLC_GET_BSSID, &bssid, sizeof(bssid), 0); |
|---|
| 6190 | | - wldev_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t), 0); |
|---|
| 6191 | | - chanspec = wl_ext_get_chanspec(dev, &chan_info); |
|---|
| 5588 | + wldev_ioctl(dev, WLC_GET_RSSI, &scb_val, |
|---|
| 5589 | + sizeof(scb_val_t), 0); |
|---|
| 5590 | + chanspec = wl_ext_get_chanspec(apsta_params, dev, &chan_info); |
|---|
| 6192 | 5591 | wl_ext_get_sec(dev, ifmode, sec, sizeof(sec), FALSE); |
|---|
| 6193 | 5592 | dump_written += snprintf(dump_buf+dump_written, dump_len, |
|---|
| 6194 | 5593 | "\n" DHD_LOG_PREFIXS "[%s-%c]: bssid=%pM, chan=%s-%-3d(0x%x %sMHz), " |
|---|
| .. | .. |
|---|
| 6309 | 5708 | if (apsta_params->acs_tmo != acs_tmo) { |
|---|
| 6310 | 5709 | apsta_params->acs_tmo = acs_tmo; |
|---|
| 6311 | 5710 | WL_MSG(dev->name, "acs_timer reset to %d\n", acs_tmo); |
|---|
| 6312 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
|---|
| 5711 | + wl_ext_mod_timer(&cur_if->acs_timer, acs_tmo, 0); |
|---|
| 6313 | 5712 | } |
|---|
| 6314 | 5713 | ret = 0; |
|---|
| 6315 | 5714 | } else { |
|---|
| .. | .. |
|---|
| 6626 | 6025 | } |
|---|
| 6627 | 6026 | // fix me: how to check it's ISTAAP_MODE or IDUALAP_MODE? |
|---|
| 6628 | 6027 | |
|---|
| 6028 | + wl_ext_get_ioctl_ver(dev, &apsta_params->ioctl_ver); |
|---|
| 6629 | 6029 | WL_MSG(dev->name, "apstamode=%d\n", apsta_params->apstamode); |
|---|
| 6630 | 6030 | |
|---|
| 6631 | 6031 | for (i=0; i<MAX_IF_NUM; i++) { |
|---|
| .. | .. |
|---|
| 6696 | 6096 | } |
|---|
| 6697 | 6097 | |
|---|
| 6698 | 6098 | 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 |
|---|
| 6721 | 6099 | wl_ext_iapsta_postinit(struct net_device *net, struct wl_if_info *cur_if) |
|---|
| 6722 | 6100 | { |
|---|
| 6723 | 6101 | struct dhd_pub *dhd = dhd_get_pub(net); |
|---|
| .. | .. |
|---|
| 6728 | 6106 | if (cur_if->ifidx == 0) { |
|---|
| 6729 | 6107 | apsta_params->rsdb = wl_ext_iapsta_get_rsdb(net, dhd); |
|---|
| 6730 | 6108 | apsta_params->vsdb = FALSE; |
|---|
| 6731 | | - wl_ext_iapsta_get_mapsta_mode(net); |
|---|
| 6732 | 6109 | apsta_params->csa = 0; |
|---|
| 6733 | 6110 | apsta_params->acs = 0; |
|---|
| 6734 | 6111 | apsta_params->radar = wl_ext_radar_detect(net); |
|---|
| 6735 | 6112 | if (dhd->conf->fw_type == FW_TYPE_MESH) { |
|---|
| 6736 | 6113 | apsta_params->csa |= (CSA_FW_BIT | CSA_DRV_BIT); |
|---|
| 6737 | 6114 | } |
|---|
| 6738 | | - cur_if->ifmode = ISTA_MODE; |
|---|
| 6739 | | - cur_if->prio = PRIO_STA; |
|---|
| 6740 | | - cur_if->vsdb = TRUE; |
|---|
| 6741 | | - cur_if->prefix = 'S'; |
|---|
| 6742 | 6115 | if (dhd->conf->vndr_ie_assocreq && strlen(dhd->conf->vndr_ie_assocreq)) |
|---|
| 6743 | 6116 | wl_ext_add_del_ie(net, VNDR_IE_ASSOCREQ_FLAG, dhd->conf->vndr_ie_assocreq, "add"); |
|---|
| 6744 | 6117 | } else { |
|---|
| .. | .. |
|---|
| 6898 | 6271 | } |
|---|
| 6899 | 6272 | #endif /* WLDWDS */ |
|---|
| 6900 | 6273 | |
|---|
| 6901 | | -static void |
|---|
| 6902 | | -wl_ext_iapsta_init_priv(struct net_device *net) |
|---|
| 6903 | | -{ |
|---|
| 6904 | | - struct dhd_pub *dhd = dhd_get_pub(net); |
|---|
| 6905 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 6906 | | - |
|---|
| 6907 | | - init_waitqueue_head(&apsta_params->netif_change_event); |
|---|
| 6908 | | - mutex_init(&apsta_params->usr_sync); |
|---|
| 6909 | | - mutex_init(&apsta_params->in4way_sync); |
|---|
| 6910 | | -#ifdef STA_MGMT |
|---|
| 6911 | | - INIT_LIST_HEAD(&apsta_params->sta_list); |
|---|
| 6912 | | -#endif /* STA_MGMT */ |
|---|
| 6913 | | -#ifdef EAPOL_RESEND |
|---|
| 6914 | | - spin_lock_init(&apsta_params->eapol_lock); |
|---|
| 6915 | | -#endif /* EAPOL_RESEND */ |
|---|
| 6916 | | -} |
|---|
| 6917 | | - |
|---|
| 6918 | | -static void |
|---|
| 6919 | | -wl_ext_iapsta_deinit_priv(struct net_device *net) |
|---|
| 6920 | | -{ |
|---|
| 6921 | | - struct dhd_pub *dhd = dhd_get_pub(net); |
|---|
| 6922 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
|---|
| 6923 | | - |
|---|
| 6924 | | - memset(apsta_params, 0, sizeof(struct wl_apsta_params)); |
|---|
| 6925 | | -} |
|---|
| 6926 | | - |
|---|
| 6927 | 6274 | int |
|---|
| 6928 | 6275 | wl_ext_iapsta_attach_netdev(struct net_device *net, int ifidx, uint8 bssidx) |
|---|
| 6929 | 6276 | { |
|---|
| .. | .. |
|---|
| 6935 | 6282 | IAPSTA_TRACE(net->name, "ifidx=%d, bssidx=%d\n", ifidx, bssidx); |
|---|
| 6936 | 6283 | cur_if = &apsta_params->if_info[ifidx]; |
|---|
| 6937 | 6284 | } |
|---|
| 6938 | | - |
|---|
| 6939 | 6285 | if (ifidx == 0) { |
|---|
| 6940 | | - wl_ext_iapsta_init_priv(net); |
|---|
| 6941 | | - strcpy(cur_if->ifname, net->name); |
|---|
| 6942 | | -#ifdef TPUT_MONITOR |
|---|
| 6943 | | - wl_timer_register(net, &apsta_params->monitor_timer, wl_tput_monitor_timer); |
|---|
| 6944 | | -#endif /* TPUT_MONITOR */ |
|---|
| 6945 | | -#ifdef RXF0OVFL_REINIT_WAR |
|---|
| 6946 | | - wl_timer_register(net, &apsta_params->rxf0ovfl_timer, wl_ext_rxf0ovfl_reinit_timeout); |
|---|
| 6947 | | -#endif /* RXF0OVFL_REINIT_WAR */ |
|---|
| 6948 | | - } |
|---|
| 6949 | | - |
|---|
| 6950 | | - if (ifidx == 0 || (cur_if && wl_get_isam_status(cur_if, IF_ADDING))) { |
|---|
| 6286 | + memset(apsta_params, 0, sizeof(struct wl_apsta_params)); |
|---|
| 6287 | + apsta_params->dhd = dhd; |
|---|
| 6951 | 6288 | cur_if->dev = net; |
|---|
| 6952 | 6289 | cur_if->ifidx = ifidx; |
|---|
| 6953 | 6290 | cur_if->bssidx = bssidx; |
|---|
| 6291 | + cur_if->ifmode = ISTA_MODE; |
|---|
| 6292 | + cur_if->prio = PRIO_STA; |
|---|
| 6293 | + cur_if->vsdb = TRUE; |
|---|
| 6294 | + cur_if->prefix = 'S'; |
|---|
| 6295 | + wl_ext_event_register(net, dhd, WLC_E_LAST, wl_ext_iapsta_event, |
|---|
| 6296 | + apsta_params, PRIO_EVENT_IAPSTA); |
|---|
| 6297 | + strcpy(cur_if->ifname, net->name); |
|---|
| 6298 | + init_waitqueue_head(&apsta_params->netif_change_event); |
|---|
| 6299 | + init_waitqueue_head(&apsta_params->ap_recon_sta_event); |
|---|
| 6300 | + mutex_init(&apsta_params->usr_sync); |
|---|
| 6301 | + mutex_init(&apsta_params->in4way_sync); |
|---|
| 6954 | 6302 | mutex_init(&cur_if->pm_sync); |
|---|
| 6303 | +#ifdef STA_MGMT |
|---|
| 6304 | + INIT_LIST_HEAD(&apsta_params->sta_list); |
|---|
| 6305 | +#endif /* STA_MGMT */ |
|---|
| 6306 | +#ifdef TPUT_MONITOR |
|---|
| 6307 | + init_timer_compat(&apsta_params->monitor_timer, wl_tput_monitor_timer, net); |
|---|
| 6308 | +#endif /* TPUT_MONITOR */ |
|---|
| 6309 | +#ifdef ACS_MONITOR |
|---|
| 6310 | + wl_acs_attach(dhd, cur_if); |
|---|
| 6311 | +#endif /* ACS_MONITOR */ |
|---|
| 6955 | 6312 | INIT_DELAYED_WORK(&cur_if->pm_enable_work, wl_ext_pm_work_handler); |
|---|
| 6956 | | - init_waitqueue_head(&cur_if->ap_recon_sta_event); |
|---|
| 6313 | +#ifdef SET_CARRIER |
|---|
| 6314 | + wl_ext_net_setcarrier(cur_if, FALSE, TRUE); |
|---|
| 6315 | +#endif /* SET_CARRIER */ |
|---|
| 6316 | + init_timer_compat(&cur_if->connect_timer, wl_ext_connect_timeout, net); |
|---|
| 6317 | +#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 6318 | + init_timer_compat(&cur_if->reconnect_timer, wl_ext_reconnect_timeout, net); |
|---|
| 6319 | +#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 6320 | +#ifdef RESTART_AP_WAR |
|---|
| 6321 | + init_timer_compat(&cur_if->restart_ap_timer, wl_ext_restart_ap_timeout, net); |
|---|
| 6322 | +#endif /* RESTART_AP_WAR */ |
|---|
| 6323 | +#ifdef RESET_AP_WAR |
|---|
| 6324 | + init_timer_compat(&cur_if->reset_ap_timer, wl_ext_reset_ap_timeout, net); |
|---|
| 6325 | +#endif /* RESET_AP_WAR */ |
|---|
| 6326 | +#ifdef RXF0OVFL_REINIT_WAR |
|---|
| 6327 | + init_timer_compat(&apsta_params->rxf0ovfl_timer, wl_ext_rxf0ovfl_reinit_timeout, net); |
|---|
| 6328 | +#endif /* RXF0OVFL_REINIT_WAR */ |
|---|
| 6329 | +#ifdef EAPOL_RESEND |
|---|
| 6330 | + spin_lock_init(&apsta_params->eapol_lock); |
|---|
| 6331 | + init_timer_compat(&cur_if->eapol_timer, wl_eapol_timer, net); |
|---|
| 6332 | +#endif /* EAPOL_RESEND */ |
|---|
| 6333 | + } |
|---|
| 6334 | + else if (cur_if && wl_get_isam_status(cur_if, IF_ADDING)) { |
|---|
| 6335 | + cur_if->dev = net; |
|---|
| 6336 | + cur_if->ifidx = ifidx; |
|---|
| 6337 | + cur_if->bssidx = bssidx; |
|---|
| 6957 | 6338 | wl_ext_event_register(net, dhd, WLC_E_LAST, wl_ext_iapsta_event, |
|---|
| 6958 | 6339 | apsta_params, PRIO_EVENT_IAPSTA); |
|---|
| 6959 | 6340 | #if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 6960 | | - wl_mesh_escan_attach(dhd, cur_if); |
|---|
| 6341 | + if (cur_if->ifmode == IMESH_MODE && apsta_params->macs) { |
|---|
| 6342 | + wl_mesh_escan_attach(dhd, cur_if); |
|---|
| 6343 | + } |
|---|
| 6961 | 6344 | #endif /* WLMESH && WL_ESCAN */ |
|---|
| 6962 | 6345 | #ifdef ACS_MONITOR |
|---|
| 6963 | 6346 | wl_acs_attach(dhd, cur_if); |
|---|
| 6964 | 6347 | #endif /* ACS_MONITOR */ |
|---|
| 6348 | + mutex_init(&cur_if->pm_sync); |
|---|
| 6349 | + INIT_DELAYED_WORK(&cur_if->pm_enable_work, wl_ext_pm_work_handler); |
|---|
| 6965 | 6350 | #ifdef SET_CARRIER |
|---|
| 6966 | 6351 | wl_ext_net_setcarrier(cur_if, FALSE, TRUE); |
|---|
| 6967 | 6352 | #endif /* SET_CARRIER */ |
|---|
| 6968 | | - wl_timer_register(net, &cur_if->connect_timer, wl_ext_connect_timeout); |
|---|
| 6969 | | -#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 6970 | | - wl_timer_register(net, &cur_if->reconnect_timer, wl_ext_reconnect_timeout); |
|---|
| 6971 | | -#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 6353 | + init_timer_compat(&cur_if->connect_timer, wl_ext_connect_timeout, net); |
|---|
| 6972 | 6354 | #ifdef RESTART_AP_WAR |
|---|
| 6973 | | - wl_timer_register(net, &cur_if->restart_ap_timer, wl_ext_restart_ap_timeout); |
|---|
| 6355 | + init_timer_compat(&cur_if->restart_ap_timer, wl_ext_restart_ap_timeout, net); |
|---|
| 6974 | 6356 | #endif /* RESTART_AP_WAR */ |
|---|
| 6975 | 6357 | #ifdef RESET_AP_WAR |
|---|
| 6976 | | - wl_timer_register(net, &cur_if->reset_ap_timer, wl_ext_reset_ap_timeout); |
|---|
| 6358 | + init_timer_compat(&cur_if->reset_ap_timer, wl_ext_reset_ap_timeout, net); |
|---|
| 6977 | 6359 | #endif /* RESET_AP_WAR */ |
|---|
| 6360 | +#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 6361 | + init_timer_compat(&cur_if->reconnect_timer, wl_ext_reconnect_timeout, net); |
|---|
| 6362 | +#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 6978 | 6363 | #ifdef EAPOL_RESEND |
|---|
| 6979 | | - wl_timer_register(net, &cur_if->eapol_timer, wl_eapol_timer); |
|---|
| 6364 | + init_timer_compat(&cur_if->eapol_timer, wl_eapol_timer, net); |
|---|
| 6980 | 6365 | #endif /* EAPOL_RESEND */ |
|---|
| 6981 | | -#ifdef KEY_INSTALL_CHECK |
|---|
| 6982 | | - wl_timer_register(net, &cur_if->key_install_timer, wl_ext_key_install_timeout); |
|---|
| 6983 | | -#endif /* KEY_INSTALL_CHECK */ |
|---|
| 6984 | 6366 | } |
|---|
| 6985 | 6367 | |
|---|
| 6986 | 6368 | return 0; |
|---|
| .. | .. |
|---|
| 7001 | 6383 | cur_if = &apsta_params->if_info[ifidx]; |
|---|
| 7002 | 6384 | } |
|---|
| 7003 | 6385 | |
|---|
| 7004 | | - if (ifidx == 0 || (cur_if && (wl_get_isam_status(cur_if, IF_READY) || |
|---|
| 7005 | | - wl_get_isam_status(cur_if, IF_ADDING)))) { |
|---|
| 6386 | + if (ifidx == 0) { |
|---|
| 7006 | 6387 | #ifdef EAPOL_RESEND |
|---|
| 7007 | 6388 | wl_ext_release_eapol_txpkt(dhd, ifidx, FALSE); |
|---|
| 7008 | 6389 | #endif /* EAPOL_RESEND */ |
|---|
| 7009 | | -#ifdef KEY_INSTALL_CHECK |
|---|
| 7010 | | - wl_timer_deregister(net, &cur_if->key_install_timer); |
|---|
| 7011 | | -#endif /* KEY_INSTALL_CHECK */ |
|---|
| 7012 | | - wl_timer_deregister(net, &cur_if->connect_timer); |
|---|
| 6390 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
|---|
| 7013 | 6391 | #if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 7014 | | - wl_timer_deregister(net, &cur_if->reconnect_timer); |
|---|
| 6392 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
|---|
| 7015 | 6393 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 7016 | 6394 | #ifdef RESTART_AP_WAR |
|---|
| 7017 | | - wl_timer_deregister(net, &cur_if->restart_ap_timer); |
|---|
| 6395 | + wl_ext_mod_timer(&cur_if->restart_ap_timer, 0, 0); |
|---|
| 7018 | 6396 | #endif /* RESTART_AP_WAR */ |
|---|
| 7019 | 6397 | #ifdef RESET_AP_WAR |
|---|
| 7020 | | - wl_timer_deregister(net, &cur_if->reset_ap_timer); |
|---|
| 6398 | + wl_ext_mod_timer(&cur_if->reset_ap_timer, 0, 0); |
|---|
| 6399 | +#endif /* RESET_AP_WAR */ |
|---|
| 6400 | +#ifdef RXF0OVFL_REINIT_WAR |
|---|
| 6401 | + wl_ext_mod_timer(&apsta_params->rxf0ovfl_timer, 0, 0); |
|---|
| 6402 | +#endif /* RXF0OVFL_REINIT_WAR */ |
|---|
| 6403 | +#ifdef SET_CARRIER |
|---|
| 6404 | + wl_ext_net_setcarrier(cur_if, FALSE, FALSE); |
|---|
| 6405 | +#endif /* SET_CARRIER */ |
|---|
| 6406 | + wl_ext_add_remove_pm_enable_work(net, FALSE); |
|---|
| 6407 | +#ifdef ACS_MONITOR |
|---|
| 6408 | + wl_acs_detach(cur_if); |
|---|
| 6409 | +#endif /* ACS_MONITOR */ |
|---|
| 6410 | +#ifdef TPUT_MONITOR |
|---|
| 6411 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, 0); |
|---|
| 6412 | +#endif /* TPUT_MONITOR */ |
|---|
| 6413 | +#if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 6414 | + if (cur_if->ifmode == IMESH_MODE && apsta_params->macs) { |
|---|
| 6415 | + wl_mesh_escan_detach(dhd, cur_if); |
|---|
| 6416 | + } |
|---|
| 6417 | +#endif /* WLMESH && WL_ESCAN */ |
|---|
| 6418 | + wl_ext_event_deregister(net, dhd, WLC_E_LAST, wl_ext_iapsta_event); |
|---|
| 6419 | +#ifdef STA_MGMT |
|---|
| 6420 | + wl_ext_flush_sta_list(net, ifidx); |
|---|
| 6421 | +#endif /* STA_MGMT */ |
|---|
| 6422 | + memset(apsta_params, 0, sizeof(struct wl_apsta_params)); |
|---|
| 6423 | + } |
|---|
| 6424 | + else if (cur_if && (wl_get_isam_status(cur_if, IF_READY) || |
|---|
| 6425 | + wl_get_isam_status(cur_if, IF_ADDING))) { |
|---|
| 6426 | +#ifdef EAPOL_RESEND |
|---|
| 6427 | + wl_ext_release_eapol_txpkt(dhd, ifidx, FALSE); |
|---|
| 6428 | +#endif /* EAPOL_RESEND */ |
|---|
| 6429 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
|---|
| 6430 | +#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
|---|
| 6431 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
|---|
| 6432 | +#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
|---|
| 6433 | +#ifdef RESTART_AP_WAR |
|---|
| 6434 | + wl_ext_mod_timer(&cur_if->restart_ap_timer, 0, 0); |
|---|
| 6435 | +#endif /* RESTART_AP_WAR */ |
|---|
| 6436 | +#ifdef RESET_AP_WAR |
|---|
| 6437 | + wl_ext_mod_timer(&cur_if->reset_ap_timer, 0, 0); |
|---|
| 7021 | 6438 | #endif /* RESET_AP_WAR */ |
|---|
| 7022 | 6439 | #ifdef SET_CARRIER |
|---|
| 7023 | 6440 | wl_ext_net_setcarrier(cur_if, FALSE, FALSE); |
|---|
| .. | .. |
|---|
| 7027 | 6444 | wl_acs_detach(cur_if); |
|---|
| 7028 | 6445 | #endif /* ACS_MONITOR */ |
|---|
| 7029 | 6446 | #if defined(WLMESH) && defined(WL_ESCAN) |
|---|
| 7030 | | - wl_mesh_escan_detach(dhd, cur_if); |
|---|
| 6447 | + if (cur_if->ifmode == IMESH_MODE && apsta_params->macs) { |
|---|
| 6448 | + wl_mesh_escan_detach(dhd, cur_if); |
|---|
| 6449 | + } |
|---|
| 7031 | 6450 | #endif /* WLMESH && WL_ESCAN */ |
|---|
| 7032 | 6451 | wl_ext_event_deregister(net, dhd, WLC_E_LAST, wl_ext_iapsta_event); |
|---|
| 7033 | 6452 | #ifdef STA_MGMT |
|---|
| .. | .. |
|---|
| 7036 | 6455 | memset(cur_if, 0, sizeof(struct wl_if_info)); |
|---|
| 7037 | 6456 | } |
|---|
| 7038 | 6457 | |
|---|
| 7039 | | - if (ifidx == 0) { |
|---|
| 7040 | | -#ifdef RXF0OVFL_REINIT_WAR |
|---|
| 7041 | | - wl_timer_deregister(net, &apsta_params->rxf0ovfl_timer); |
|---|
| 7042 | | -#endif /* RXF0OVFL_REINIT_WAR */ |
|---|
| 7043 | | -#ifdef TPUT_MONITOR |
|---|
| 7044 | | - wl_timer_deregister(net, &apsta_params->monitor_timer); |
|---|
| 7045 | | -#endif /* TPUT_MONITOR */ |
|---|
| 7046 | | - wl_ext_iapsta_deinit_priv(net); |
|---|
| 6458 | + return 0; |
|---|
| 6459 | +} |
|---|
| 6460 | + |
|---|
| 6461 | +int |
|---|
| 6462 | +wl_ext_iapsta_attach(struct net_device *net) |
|---|
| 6463 | +{ |
|---|
| 6464 | + struct dhd_pub *dhd = dhd_get_pub(net); |
|---|
| 6465 | + struct wl_apsta_params *iapsta_params; |
|---|
| 6466 | + |
|---|
| 6467 | + IAPSTA_TRACE(net->name, "Enter\n"); |
|---|
| 6468 | + |
|---|
| 6469 | + iapsta_params = kzalloc(sizeof(struct wl_apsta_params), GFP_KERNEL); |
|---|
| 6470 | + if (unlikely(!iapsta_params)) { |
|---|
| 6471 | + IAPSTA_ERROR("wlan", "Could not allocate apsta_params\n"); |
|---|
| 6472 | + return -ENOMEM; |
|---|
| 7047 | 6473 | } |
|---|
| 6474 | + dhd->iapsta_params = (void *)iapsta_params; |
|---|
| 7048 | 6475 | |
|---|
| 7049 | 6476 | return 0; |
|---|
| 7050 | 6477 | } |
|---|
| .. | .. |
|---|
| 7056 | 6483 | |
|---|
| 7057 | 6484 | IAPSTA_TRACE(net->name, "Enter\n"); |
|---|
| 7058 | 6485 | |
|---|
| 7059 | | - if (g_ioctl_buf) { |
|---|
| 7060 | | - kfree(g_ioctl_buf); |
|---|
| 7061 | | - g_ioctl_buf = NULL; |
|---|
| 7062 | | - } |
|---|
| 7063 | | - |
|---|
| 7064 | 6486 | if (dhd->iapsta_params) { |
|---|
| 7065 | | - wl_ext_iapsta_deinit_priv(net); |
|---|
| 7066 | 6487 | kfree(dhd->iapsta_params); |
|---|
| 7067 | 6488 | dhd->iapsta_params = NULL; |
|---|
| 7068 | 6489 | } |
|---|
| 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 | 6490 | } |
|---|
| 7102 | 6491 | #endif /* WL_EXT_IAPSTA */ |
|---|