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 | |
---|
.. | .. |
---|
223 | 198 | uint conn_state; |
---|
224 | 199 | uint16 prev_channel; |
---|
225 | 200 | uint16 post_channel; |
---|
226 | | - struct osl_timespec sta_disc_ts; |
---|
227 | | - struct osl_timespec sta_conn_ts; |
---|
228 | | - bool ap_recon_sta; |
---|
229 | | - wait_queue_head_t ap_recon_sta_event; |
---|
230 | | - struct ether_addr ap_disc_sta_bssid; |
---|
231 | | - struct osl_timespec ap_disc_sta_ts; |
---|
232 | 201 | #ifdef TPUT_MONITOR |
---|
233 | 202 | struct wl_tput_info tput_info; |
---|
234 | 203 | #endif /* TPUT_MONITOR */ |
---|
.. | .. |
---|
250 | 219 | int eapol_resend_intvl; |
---|
251 | 220 | #endif /* EAPOL_DYNAMATIC_RESEND */ |
---|
252 | 221 | #endif /* EAPOL_RESEND */ |
---|
253 | | -#ifdef KEY_INSTALL_CHECK |
---|
254 | | - timer_list_compat_t key_install_timer; |
---|
255 | | - int key_install_cnt; |
---|
256 | | -#endif /* KEY_INSTALL_CHECK */ |
---|
257 | 222 | int empty_scan; |
---|
258 | 223 | #ifdef RESTART_AP_WAR |
---|
259 | 224 | timer_list_compat_t restart_ap_timer; |
---|
.. | .. |
---|
262 | 227 | timer_list_compat_t reset_ap_timer; |
---|
263 | 228 | uint32 txbcnfrm; |
---|
264 | 229 | #endif /* RESET_AP_WAR */ |
---|
265 | | -#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
---|
266 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
---|
267 | | - struct osl_timespec sta_disc_conn_ts; |
---|
268 | | - int sta_disc_recon_cnt; |
---|
269 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
---|
270 | | -#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
271 | 230 | } wl_if_info_t; |
---|
272 | 231 | |
---|
273 | 232 | typedef struct wl_apsta_params { |
---|
.. | .. |
---|
275 | 234 | #ifdef WLDWDS |
---|
276 | 235 | struct wl_dwds_info dwds_info[MAX_DWDS_IF_NUM]; |
---|
277 | 236 | #endif /* WLDWDS */ |
---|
278 | | - u8 *ioctl_buf; |
---|
| 237 | + struct dhd_pub *dhd; |
---|
| 238 | + int ioctl_ver; |
---|
279 | 239 | bool init; |
---|
280 | 240 | int rsdb; |
---|
281 | 241 | bool vsdb; |
---|
.. | .. |
---|
294 | 254 | #endif /* WLMESH && WL_ESCAN */ |
---|
295 | 255 | struct mutex in4way_sync; |
---|
296 | 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; |
---|
297 | 263 | #ifdef TPUT_MONITOR |
---|
298 | 264 | timer_list_compat_t monitor_timer; |
---|
299 | 265 | int32 tput_sum; |
---|
.. | .. |
---|
334 | 300 | ISAM_RC_AP_RESTART = 4, |
---|
335 | 301 | ISAM_RC_AP_RESET = 5, |
---|
336 | 302 | ISAM_RC_EAPOL_RESEND = 6, |
---|
337 | | - ISAM_RC_KEY_INSTALL = 7, |
---|
338 | | - ISAM_RC_RXF0OVFL_REINIT = 8 |
---|
| 303 | + ISAM_RC_RXF0OVFL_REINIT = 7 |
---|
339 | 304 | }; |
---|
340 | 305 | |
---|
341 | 306 | #define wl_get_isam_status(cur_if, stat) \ |
---|
.. | .. |
---|
350 | 315 | static int wl_ext_enable_iface(struct net_device *dev, char *ifname, |
---|
351 | 316 | int wait_up, bool lock); |
---|
352 | 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 */ |
---|
353 | 321 | |
---|
354 | 322 | static struct wl_if_info * |
---|
355 | 323 | wl_get_cur_if(struct net_device *dev) |
---|
.. | .. |
---|
636 | 604 | } |
---|
637 | 605 | |
---|
638 | 606 | static int |
---|
639 | | -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) |
---|
640 | 609 | { |
---|
641 | 610 | struct net_device *dev = cur_if->dev; |
---|
642 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
643 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
| 611 | + int wsec=0; |
---|
644 | 612 | struct wl_wsec_key wsec_key; |
---|
645 | 613 | wsec_pmk_t psk; |
---|
646 | 614 | authmode_t amode = cur_if->amode; |
---|
647 | 615 | encmode_t emode = cur_if->emode; |
---|
648 | | - int wsec=0; |
---|
649 | 616 | char *key = cur_if->key; |
---|
| 617 | + struct dhd_pub *dhd = apsta_params->dhd; |
---|
650 | 618 | |
---|
651 | 619 | memset(&wsec_key, 0, sizeof(wsec_key)); |
---|
652 | 620 | memset(&psk, 0, sizeof(psk)); |
---|
.. | .. |
---|
742 | 710 | } |
---|
743 | 711 | |
---|
744 | 712 | static u32 |
---|
745 | | -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) |
---|
746 | 715 | { |
---|
747 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
748 | 716 | u32 chanspec = 0; |
---|
749 | 717 | |
---|
750 | 718 | if (wl_ext_associated(dev)) { |
---|
751 | 719 | if (wl_ext_iovar_getint(dev, "chanspec", (s32 *)&chanspec) == BCME_OK) { |
---|
752 | | - chanspec = wl_ext_chspec_driver_to_host(dhd, chanspec); |
---|
| 720 | + chanspec = wl_ext_chspec_driver_to_host(apsta_params->ioctl_ver, chanspec); |
---|
753 | 721 | if (chan_info) { |
---|
754 | 722 | chan_info->band = CHSPEC2WLC_BAND(chanspec); |
---|
755 | 723 | chan_info->chan = wf_chspec_ctlchan(chanspec); |
---|
.. | .. |
---|
762 | 730 | } |
---|
763 | 731 | |
---|
764 | 732 | static uint16 |
---|
765 | | -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) |
---|
766 | 735 | { |
---|
767 | 736 | uint16 chan = 0, ctl_chan; |
---|
768 | 737 | u32 chanspec = 0; |
---|
769 | 738 | |
---|
770 | | - chanspec = wl_ext_get_chanspec(dev, chan_info); |
---|
| 739 | + chanspec = wl_ext_get_chanspec(apsta_params, dev, chan_info); |
---|
771 | 740 | if (chanspec) { |
---|
772 | 741 | ctl_chan = wf_chspec_ctlchan(chanspec); |
---|
773 | 742 | chan = (u16)(ctl_chan & 0x00FF); |
---|
.. | .. |
---|
776 | 745 | return chan; |
---|
777 | 746 | } |
---|
778 | 747 | |
---|
779 | | -void |
---|
780 | | -wl_ext_get_chan_str(struct net_device *dev, char *chan_str, int total_len) |
---|
781 | | -{ |
---|
782 | | - struct wl_chan_info chan_info; |
---|
783 | | - int bytes_written=0; |
---|
784 | | - u32 chanspec = 0; |
---|
785 | | - |
---|
786 | | - memset(chan_str, 0, total_len); |
---|
787 | | - chanspec = wl_ext_get_chanspec(dev, &chan_info); |
---|
788 | | - if (chanspec) { |
---|
789 | | - bytes_written += snprintf(chan_str+bytes_written, total_len, "%s-%d %sMHz", |
---|
790 | | - WLCBAND2STR(chan_info.band), chan_info.chan, |
---|
791 | | - wf_chspec_to_bw_str(chanspec)); |
---|
792 | | - } |
---|
793 | | -} |
---|
794 | | - |
---|
795 | 748 | static chanspec_t |
---|
796 | | -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) |
---|
797 | 751 | { |
---|
798 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
799 | 752 | chanspec_band_t chanspec_band; |
---|
800 | 753 | chanspec_t chspec = 0, fw_chspec = 0; |
---|
801 | 754 | u32 bw = WL_CHANSPEC_BW_20; |
---|
.. | .. |
---|
837 | 790 | chanspec_band = wl_ext_wlcband_to_chanspec_band(chan_info->band); |
---|
838 | 791 | chspec = wf_create_chspec_from_primary(chan_info->chan, bw, chanspec_band); |
---|
839 | 792 | if (wf_chspec_valid(chspec)) { |
---|
840 | | - fw_chspec = wl_ext_chspec_host_to_driver(dhd, chspec); |
---|
| 793 | + fw_chspec = wl_ext_chspec_host_to_driver(apsta_params->ioctl_ver, chspec); |
---|
841 | 794 | if (fw_chspec == INVCHANSPEC) { |
---|
842 | 795 | IAPSTA_ERROR(dev->name, "failed to convert host chanspec to fw chanspec\n"); |
---|
843 | 796 | fw_chspec = 0; |
---|
.. | .. |
---|
894 | 847 | return bytes_written; |
---|
895 | 848 | } |
---|
896 | 849 | |
---|
897 | | -void |
---|
898 | | -wl_ext_send_event_msg(struct net_device *dev, int event, int status, |
---|
899 | | - 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) |
---|
900 | 866 | { |
---|
901 | 867 | struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
902 | 868 | struct wl_if_info *cur_if; |
---|
903 | 869 | wl_event_msg_t msg; |
---|
904 | 870 | |
---|
905 | | - if (dhd && dhd->up) { |
---|
906 | | - cur_if = wl_get_cur_if(dev); |
---|
907 | | - if (!cur_if) |
---|
908 | | - return; |
---|
909 | | - bzero(&msg, sizeof(wl_event_msg_t)); |
---|
910 | | - msg.ifidx = dhd_net2idx(dhd->info, dev); |
---|
911 | | - msg.event_type = hton32(event); |
---|
912 | | - msg.status = hton32(status); |
---|
913 | | - msg.reason = hton32(reason); |
---|
914 | | - 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 | + |
---|
915 | 882 | #ifdef WL_EVENT |
---|
916 | | - wl_ext_event_send(dhd->event_params, &msg, NULL); |
---|
917 | | -#endif /* WL_EVENT */ |
---|
| 883 | + wl_ext_event_send(dhd->event_params, &msg, NULL); |
---|
| 884 | +#endif |
---|
918 | 885 | #ifdef WL_CFG80211 |
---|
| 886 | + if (dhd->up) { |
---|
919 | 887 | wl_cfg80211_event(dev, &msg, NULL); |
---|
920 | | -#endif /* WL_CFG80211 */ |
---|
921 | 888 | } |
---|
| 889 | +#endif /* defined(WL_CFG80211) */ |
---|
922 | 890 | } |
---|
923 | | - |
---|
924 | | -#ifdef BTC_WAR |
---|
925 | | -bool |
---|
926 | | -wl_ext_iapsta_if_2g_enabled(struct net_device *net) |
---|
927 | | -{ |
---|
928 | | - struct dhd_pub *dhd = dhd_get_pub(net); |
---|
929 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
930 | | - struct wl_if_info *tmp_if; |
---|
931 | | - struct wl_chan_info chan_info; |
---|
932 | | - bool enabled = FALSE; |
---|
933 | | - uint16 cur_chan; |
---|
934 | | - int i; |
---|
935 | | - |
---|
936 | | - for (i=0; i<MAX_IF_NUM; i++) { |
---|
937 | | - tmp_if = &apsta_params->if_info[i]; |
---|
938 | | - if (tmp_if && wl_get_isam_status(tmp_if, IF_READY)) { |
---|
939 | | - cur_chan = wl_ext_get_chan(tmp_if->dev, &chan_info); |
---|
940 | | - if (cur_chan && chan_info.band == WLC_BAND_2G) { |
---|
941 | | - enabled = TRUE; |
---|
942 | | - break; |
---|
943 | | - } |
---|
944 | | - } |
---|
945 | | - } |
---|
946 | | - |
---|
947 | | - return enabled; |
---|
948 | | -} |
---|
949 | | - |
---|
950 | | -void |
---|
951 | | -wl_ext_btc_config(struct net_device *dev, bool enable) |
---|
952 | | -{ |
---|
953 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
954 | | - bool enab = FALSE; |
---|
955 | | - |
---|
956 | | - if (dhd->conf->chip == BCM4354_CHIP_ID || dhd->conf->chip == BCM4356_CHIP_ID || |
---|
957 | | - dhd->conf->chip == BCM43752_CHIP_ID) { |
---|
958 | | - IAPSTA_INFO(dev->name, "btc_war=%d, enable=%d\n", btc_war, enable); |
---|
959 | | - if (btc_war >= 0) { |
---|
960 | | - if (enable && btc_war > 0) { |
---|
961 | | - if (wl_ext_iapsta_if_2g_enabled(dev)) |
---|
962 | | - enab = TRUE; |
---|
963 | | - } |
---|
964 | | - if (enab) { |
---|
965 | | - IAPSTA_INFO(dev->name, "enable\n"); |
---|
966 | | - wl_ext_iovar_setint(dev, "txchain", 2); |
---|
967 | | - wl_ext_iovar_setint(dev, "rxchain", 2); |
---|
968 | | - wl_ext_iovar_setint(dev, "btc_mode", 5); |
---|
969 | | - } else { |
---|
970 | | - IAPSTA_INFO(dev->name, "disable\n"); |
---|
971 | | - wl_ext_iovar_setint(dev, "btc_mode", 1); |
---|
972 | | - wl_ext_iovar_setint(dev, "txchain", 3); |
---|
973 | | - wl_ext_iovar_setint(dev, "rxchain", 3); |
---|
974 | | - } |
---|
975 | | - } |
---|
976 | | - } |
---|
977 | | -} |
---|
978 | | -#endif /* BTC_WAR */ |
---|
979 | 891 | |
---|
980 | 892 | static void |
---|
981 | 893 | wl_ext_connect_timeout(unsigned long data) |
---|
.. | .. |
---|
996 | 908 | cur_if->assoc_info.reassoc = 0; |
---|
997 | 909 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
998 | 910 | IAPSTA_ERROR(dev->name, "timer expired\n"); |
---|
999 | | - 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); |
---|
1000 | 912 | } |
---|
1001 | 913 | |
---|
1002 | 914 | #if defined(WL_CFG80211) || (defined(WLMESH) && defined(WL_ESCAN)) |
---|
.. | .. |
---|
1124 | 1036 | } |
---|
1125 | 1037 | |
---|
1126 | 1038 | #ifdef WL_ESCAN |
---|
1127 | | -#define WL_MESH_DELAY_SCAN_TMO 3000 |
---|
| 1039 | +#define WL_MESH_DELAY_SCAN_TMO 3 |
---|
1128 | 1040 | static void |
---|
1129 | 1041 | wl_mesh_timer(unsigned long data) |
---|
1130 | 1042 | { |
---|
.. | .. |
---|
1216 | 1128 | } |
---|
1217 | 1129 | |
---|
1218 | 1130 | static int |
---|
1219 | | -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) |
---|
1220 | 1133 | { |
---|
1221 | | - struct dhd_pub *dhd = dhd_get_pub(mesh_if->dev); |
---|
1222 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
1223 | 1134 | struct wl_mesh_params *mesh_info = &apsta_params->mesh_info; |
---|
1224 | 1135 | uchar mesh_oui[]={0x00, 0x22, 0xf4}; |
---|
1225 | 1136 | int ret; |
---|
.. | .. |
---|
1229 | 1140 | ret = wl_mesh_clear_vndr_ie(mesh_if->dev, mesh_oui); |
---|
1230 | 1141 | memset(mesh_info, 0, sizeof(struct wl_mesh_params)); |
---|
1231 | 1142 | if (scan) { |
---|
1232 | | - 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, |
---|
1233 | 1144 | &mesh_if->chan_info); |
---|
1234 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, 100); |
---|
| 1145 | + wl_ext_mod_timer(&mesh_if->delay_scan, 0, 100); |
---|
1235 | 1146 | } |
---|
1236 | 1147 | |
---|
1237 | 1148 | return ret; |
---|
.. | .. |
---|
1310 | 1221 | if (sta_if) { |
---|
1311 | 1222 | wldev_ioctl(mesh_if->dev, WLC_GET_BSSID, &mesh_info->master_bssid, |
---|
1312 | 1223 | ETHER_ADDR_LEN, 0); |
---|
1313 | | - 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); |
---|
1314 | 1226 | mesh_info->hop_cnt = 0; |
---|
1315 | 1227 | memset(mesh_info->peer_bssid, 0, MAX_HOP_LIST*ETHER_ADDR_LEN); |
---|
1316 | 1228 | if (!wl_mesh_update_vndr_ie(apsta_params, mesh_if)) |
---|
.. | .. |
---|
1386 | 1298 | wl_ext_get_sec(mesh_if->dev, mesh_if->ifmode, sec, sizeof(sec), FALSE); |
---|
1387 | 1299 | if (strnicmp(sec, "sae/sae", strlen("sae/sae")) == 0) |
---|
1388 | 1300 | sae = TRUE; |
---|
1389 | | - 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); |
---|
1390 | 1303 | bss_found = wl_escan_mesh_peer(mesh_if->dev, mesh_if->escan, &cur_ssid, cur_chan, |
---|
1391 | 1304 | sae, &peer_mesh_info); |
---|
1392 | 1305 | |
---|
.. | .. |
---|
1407 | 1320 | } |
---|
1408 | 1321 | |
---|
1409 | 1322 | static void |
---|
1410 | | -wl_mesh_event_handler(struct wl_if_info *cur_if, |
---|
1411 | | - 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) |
---|
1412 | 1325 | { |
---|
1413 | | - struct dhd_pub *dhd = dhd_get_pub(cur_if->dev); |
---|
1414 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
1415 | 1326 | struct wl_mesh_params *mesh_info = &apsta_params->mesh_info; |
---|
1416 | 1327 | uint32 event_type = ntoh32(e->event_type); |
---|
1417 | 1328 | uint32 status = ntoh32(e->status); |
---|
1418 | 1329 | uint32 reason = ntoh32(e->reason); |
---|
1419 | | - uint16 flags = ntoh16(e->flags); |
---|
1420 | | - struct wl_if_info *mesh_if = NULL, *tmp_if = NULL; |
---|
1421 | | - int ret, i; |
---|
| 1330 | + int ret; |
---|
1422 | 1331 | |
---|
1423 | | - if (cur_if->ifmode == IMESH_MODE) |
---|
1424 | | - mesh_if = cur_if; |
---|
1425 | | - else { |
---|
1426 | | - for (i=0; i<MAX_IF_NUM; i++) { |
---|
1427 | | - tmp_if = &apsta_params->if_info[i]; |
---|
1428 | | - if (tmp_if->dev && tmp_if->ifmode == IMESH_MODE) { |
---|
1429 | | - mesh_if = tmp_if; |
---|
1430 | | - break; |
---|
1431 | | - } |
---|
| 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); |
---|
1432 | 1340 | } |
---|
1433 | 1341 | } |
---|
1434 | | - |
---|
1435 | | - if (cur_if->ifmode == ISTA_MODE || cur_if->ifmode == IGC_MODE) { |
---|
1436 | | - if (event_type == WLC_E_LINK) { |
---|
1437 | | - if (!(flags & WLC_EVENT_MSG_LINK)) { |
---|
1438 | | - if (mesh_if && apsta_params->macs) |
---|
1439 | | - wl_mesh_clear_mesh_info(mesh_if, TRUE); |
---|
1440 | | - } else { |
---|
1441 | | - if (mesh_if && apsta_params->macs) |
---|
1442 | | - 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; |
---|
1443 | 1368 | } |
---|
1444 | | - } |
---|
1445 | | - else if (event_type == WLC_E_SET_SSID && status != WLC_E_STATUS_SUCCESS) { |
---|
1446 | | - if (mesh_if && apsta_params->macs) |
---|
1447 | | - wl_mesh_clear_mesh_info(mesh_if, TRUE); |
---|
1448 | | - } |
---|
1449 | | - else if (event_type == WLC_E_DEAUTH || event_type == WLC_E_DEAUTH_IND || |
---|
1450 | | - event_type == WLC_E_DISASSOC || event_type == WLC_E_DISASSOC_IND) { |
---|
1451 | | - if (mesh_if && apsta_params->macs) |
---|
1452 | | - 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); |
---|
1453 | 1372 | } |
---|
1454 | 1373 | } |
---|
1455 | | - else if (cur_if->ifmode == IMESH_MODE && apsta_params->macs) { |
---|
1456 | | - if (wl_get_isam_status(mesh_if, AP_CREATED) && |
---|
1457 | | - ((event_type == WLC_E_SET_SSID && status == WLC_E_STATUS_SUCCESS) || |
---|
1458 | | - (event_type == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
---|
1459 | | - reason == WLC_E_REASON_INITIAL_ASSOC))) { |
---|
1460 | | - if (!wl_mesh_update_master_info(apsta_params, mesh_if)) { |
---|
1461 | | - mesh_info->scan_channel = wl_ext_get_chan(&mesh_if->dev, |
---|
1462 | | - mesh_if->chan_info); |
---|
1463 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO); |
---|
1464 | | - } |
---|
1465 | | - } |
---|
1466 | | - else if ((event_type == WLC_E_LINK && reason == WLC_E_LINK_BSSCFG_DIS) || |
---|
1467 | | - (event_type == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
---|
1468 | | - reason == WLC_E_REASON_DEAUTH)) { |
---|
1469 | | - wl_mesh_clear_mesh_info(mesh_if, FALSE); |
---|
1470 | | - } |
---|
1471 | | - else if (wl_get_isam_status(mesh_if, AP_CREATED) && |
---|
1472 | | - (event_type == WLC_E_ASSOC_IND || event_type == WLC_E_REASSOC_IND) && |
---|
1473 | | - reason == DOT11_SC_SUCCESS) { |
---|
1474 | | - mesh_info->scan_channel = wl_ext_get_chan(mesh_if->dev, |
---|
1475 | | - &mesh_if->chan_info); |
---|
1476 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, 100); |
---|
1477 | | - } |
---|
1478 | | - else if (event_type == WLC_E_DISASSOC_IND || event_type == WLC_E_DEAUTH_IND || |
---|
1479 | | - (event_type == WLC_E_DEAUTH && reason != DOT11_RC_RESERVED)) { |
---|
1480 | | - if (!memcmp(&mesh_info->peer_bssid, &e->addr, ETHER_ADDR_LEN)) |
---|
1481 | | - wl_mesh_clear_mesh_info(mesh_if, TRUE); |
---|
1482 | | - } |
---|
1483 | | - else if (wl_get_isam_status(mesh_if, AP_CREATED) && |
---|
1484 | | - event_type == WLC_E_RESERVED && reason == ISAM_RC_MESH_ACS) { |
---|
1485 | | - if (!wl_mesh_update_master_info(apsta_params, mesh_if)) { |
---|
1486 | | - wl_scan_info_t scan_info; |
---|
1487 | | - memset(&scan_info, 0, sizeof(wl_scan_info_t)); |
---|
1488 | | - wl_ext_ioctl(mesh_if->dev, WLC_GET_SSID, &scan_info.ssid, sizeof(wlc_ssid_t), 0); |
---|
1489 | | - if (mesh_info->scan_channel) { |
---|
1490 | | - scan_info.channels.count = 1; |
---|
1491 | | - scan_info.channels.channel[0] = mesh_info->scan_channel; |
---|
1492 | | - } |
---|
1493 | | - ret = wl_escan_set_scan(mesh_if->dev, &scan_info); |
---|
1494 | | - if (ret) |
---|
1495 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO); |
---|
1496 | | - } |
---|
1497 | | - } |
---|
1498 | | - else if (wl_get_isam_status(mesh_if, AP_CREATED) && |
---|
1499 | | - ((event_type == WLC_E_ESCAN_RESULT && status == WLC_E_STATUS_SUCCESS) || |
---|
1500 | | - (event_type == WLC_E_ESCAN_RESULT && |
---|
1501 | | - (status == WLC_E_STATUS_ABORT || status == WLC_E_STATUS_NEWSCAN || |
---|
1502 | | - status == WLC_E_STATUS_11HQUIET || status == WLC_E_STATUS_CS_ABORT || |
---|
1503 | | - status == WLC_E_STATUS_NEWASSOC || status == WLC_E_STATUS_TIMEOUT)))) { |
---|
1504 | | - if (!wl_mesh_update_master_info(apsta_params, mesh_if)) { |
---|
1505 | | - if (!wl_mesh_update_mesh_info(apsta_params, mesh_if)) { |
---|
1506 | | - mesh_info->scan_channel = 0; |
---|
1507 | | - wl_timer_mod(dhd, &mesh_if->delay_scan, WL_MESH_DELAY_SCAN_TMO); |
---|
1508 | | - } |
---|
| 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); |
---|
1509 | 1384 | } |
---|
1510 | 1385 | } |
---|
1511 | 1386 | } |
---|
.. | .. |
---|
1515 | 1390 | wl_mesh_escan_detach(dhd_pub_t *dhd, struct wl_if_info *mesh_if) |
---|
1516 | 1391 | { |
---|
1517 | 1392 | IAPSTA_TRACE(mesh_if->dev->name, "Enter\n"); |
---|
1518 | | - wl_timer_deregister(mesh_if->dev, &mesh_if->delay_scan); |
---|
| 1393 | + |
---|
| 1394 | + del_timer_sync(&mesh_if->delay_scan); |
---|
| 1395 | + |
---|
1519 | 1396 | if (mesh_if->escan) { |
---|
1520 | 1397 | mesh_if->escan = NULL; |
---|
1521 | 1398 | } |
---|
.. | .. |
---|
1527 | 1404 | IAPSTA_TRACE(mesh_if->dev->name, "Enter\n"); |
---|
1528 | 1405 | |
---|
1529 | 1406 | mesh_if->escan = dhd->escan; |
---|
1530 | | - 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); |
---|
1531 | 1408 | |
---|
1532 | 1409 | return 0; |
---|
1533 | 1410 | } |
---|
.. | .. |
---|
1702 | 1579 | WL_MSG(cur_if->ifname, "[%c] skip DFS channel %d\n", |
---|
1703 | 1580 | cur_if->prefix, chan_info->chan); |
---|
1704 | 1581 | return 0; |
---|
1705 | | - } else if (wl_ext_passive_chan(cur_if->dev, chan_info)) { |
---|
1706 | | - WL_MSG(cur_if->ifname, "[%c] skip PASSIVE channel %d\n", |
---|
1707 | | - cur_if->prefix, chan_info->chan); |
---|
1708 | | - return 0; |
---|
1709 | 1582 | } else if (!chan_info->chan) { |
---|
1710 | 1583 | WL_MSG(cur_if->ifname, "[%c] no valid channel\n", cur_if->prefix); |
---|
1711 | 1584 | return 0; |
---|
.. | .. |
---|
1740 | 1613 | } |
---|
1741 | 1614 | |
---|
1742 | 1615 | wl_ext_ioctl(cur_if->dev, WLC_GET_SSID, &ssid, sizeof(ssid), 0); |
---|
1743 | | - chanspec = wl_ext_get_chanspec(cur_if->dev, chan_info); |
---|
| 1616 | + chanspec = wl_ext_get_chanspec(apsta_params, cur_if->dev, chan_info); |
---|
1744 | 1617 | WL_MSG(cur_if->ifname, "[%c] enabled with SSID: \"%s\" on channel %s-%d(0x%x)\n", |
---|
1745 | 1618 | cur_if->prefix, ssid.SSID, CHSPEC2BANDSTR(chanspec), |
---|
1746 | 1619 | chan_info->chan, chanspec); |
---|
.. | .. |
---|
1790 | 1663 | if (cur_if != tmp_if && wl_get_isam_status(tmp_if, IF_READY) && |
---|
1791 | 1664 | tmp_if->prio > max_prio) { |
---|
1792 | 1665 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
---|
1793 | | - wl_ext_get_chan(tmp_if->dev, &chan_info); |
---|
| 1666 | + wl_ext_get_chan(apsta_params, tmp_if->dev, &chan_info); |
---|
1794 | 1667 | if (wl_ext_dfs_chan(&chan_info) && nodfs) |
---|
1795 | 1668 | continue; |
---|
1796 | 1669 | if (chan_info.chan && (cur_if->chan_info.band == chan_info.band)) { |
---|
.. | .. |
---|
1817 | 1690 | return 0; |
---|
1818 | 1691 | |
---|
1819 | 1692 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
---|
1820 | | - 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); |
---|
1821 | 1694 | if (target_chan) { |
---|
1822 | 1695 | target_band = chan_info.band; |
---|
1823 | 1696 | IAPSTA_INFO(cur_if->ifname, "cur_chan=%s-%d, target_chan=%s-%d\n", |
---|
.. | .. |
---|
1845 | 1718 | |
---|
1846 | 1719 | if (apsta_params->rsdb) { |
---|
1847 | 1720 | memset(&cur_chan_info, 0, sizeof(struct wl_chan_info)); |
---|
1848 | | - wl_ext_get_chan(cur_if->dev, &cur_chan_info); |
---|
| 1721 | + wl_ext_get_chan(apsta_params, cur_if->dev, &cur_chan_info); |
---|
1849 | 1722 | for (i=0; i<MAX_IF_NUM; i++) { |
---|
1850 | 1723 | tmp_if = &apsta_params->if_info[i]; |
---|
1851 | 1724 | if (tmp_if != cur_if && wl_get_isam_status(tmp_if, IF_READY) && |
---|
1852 | 1725 | tmp_if->prio > cur_if->prio) { |
---|
1853 | 1726 | memset(&tmp_chan_info, 0, sizeof(struct wl_chan_info)); |
---|
1854 | | - wl_ext_get_chan(tmp_if->dev, &tmp_chan_info); |
---|
| 1727 | + wl_ext_get_chan(apsta_params, tmp_if->dev, &tmp_chan_info); |
---|
1855 | 1728 | if (!tmp_chan_info.chan) |
---|
1856 | 1729 | continue; |
---|
1857 | 1730 | if (wl_ext_rsdb_band(cur_chan_info.band, tmp_chan_info.band) && |
---|
.. | .. |
---|
1884 | 1757 | memset(&csa_arg, 0, sizeof(csa_arg)); |
---|
1885 | 1758 | csa_arg.mode = 1; |
---|
1886 | 1759 | csa_arg.count = 3; |
---|
1887 | | - 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); |
---|
1888 | 1762 | core_conflict = wl_ext_rsdb_core_conflict(apsta_params, cur_if); |
---|
1889 | 1763 | if (core_conflict) { |
---|
1890 | 1764 | WL_MSG(cur_if->ifname, "[%c] Skip CSA due to rsdb core conflict\n", |
---|
.. | .. |
---|
2064 | 1938 | if (target_if) { |
---|
2065 | 1939 | memset(&cur_chan_info, 0, sizeof(struct wl_chan_info)); |
---|
2066 | 1940 | memset(&tgt_chan_info, 0, sizeof(struct wl_chan_info)); |
---|
2067 | | - wl_ext_get_chan(cur_if->dev, &cur_chan_info); |
---|
2068 | | - 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); |
---|
2069 | 1943 | if (apsta_params->rsdb && cur_chan_info.chan && |
---|
2070 | 1944 | wl_ext_rsdb_band(cur_chan_info.band, tgt_chan_info.band)) { |
---|
2071 | 1945 | WL_MSG(cur_if->ifname, "[%c] keep on current channel %s-%d\n", |
---|
.. | .. |
---|
2227 | 2101 | return connecting; |
---|
2228 | 2102 | } |
---|
2229 | 2103 | |
---|
2230 | | -bool |
---|
2231 | | -wl_ext_sta_handshaking(struct net_device *dev) |
---|
2232 | | -{ |
---|
2233 | | - struct wl_if_info *cur_if = NULL; |
---|
2234 | | - bool connecting = FALSE; |
---|
2235 | | - int state; |
---|
2236 | | - |
---|
2237 | | - cur_if = wl_get_cur_if(dev); |
---|
2238 | | - if (!cur_if) |
---|
2239 | | - return FALSE; |
---|
2240 | | - |
---|
2241 | | - if (cur_if->ifmode != ISTA_MODE && cur_if->ifmode != IGC_MODE) |
---|
2242 | | - return FALSE; |
---|
2243 | | - |
---|
2244 | | - state = cur_if->conn_state; |
---|
2245 | | - if (state >= CONN_STATE_4WAY_M1 && state < CONN_STATE_CONNECTED) { |
---|
2246 | | - connecting = TRUE; |
---|
2247 | | - IAPSTA_TRACE(dev->name, "conn_state %d\n", state); |
---|
2248 | | - } |
---|
2249 | | - |
---|
2250 | | - return connecting; |
---|
2251 | | -} |
---|
2252 | | - |
---|
2253 | | -#ifdef DHD_LOSSLESS_ROAMING |
---|
2254 | | -int |
---|
2255 | | -wl_ext_any_sta_handshaking(struct dhd_pub *dhd) |
---|
2256 | | -{ |
---|
2257 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
2258 | | - struct wl_if_info *cur_if; |
---|
2259 | | - int state = 0, i; |
---|
2260 | | - |
---|
2261 | | - for (i=0; i<MAX_IF_NUM; i++) { |
---|
2262 | | - cur_if = &apsta_params->if_info[i]; |
---|
2263 | | - if (cur_if->dev && cur_if->ifmode == ISTA_MODE) { |
---|
2264 | | - state = cur_if->conn_state; |
---|
2265 | | - if (state >= CONN_STATE_4WAY_M1 && state < CONN_STATE_CONNECTED) { |
---|
2266 | | - return state; |
---|
2267 | | - } |
---|
2268 | | - } |
---|
2269 | | - } |
---|
2270 | | - return 0; |
---|
2271 | | -} |
---|
2272 | | -#endif /* DHD_LOSSLESS_ROAMING */ |
---|
2273 | | - |
---|
2274 | 2104 | #ifdef PROPTX_MAXCOUNT |
---|
2275 | 2105 | int |
---|
2276 | 2106 | wl_ext_get_wlfc_maxcount(struct dhd_pub *dhd, int ifidx) |
---|
.. | .. |
---|
2313 | 2143 | tmp_if = &apsta_params->if_info[i]; |
---|
2314 | 2144 | if (tmp_if->dev) { |
---|
2315 | 2145 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
---|
2316 | | - wl_ext_get_chan(tmp_if->dev, &chan_info); |
---|
| 2146 | + wl_ext_get_chan(apsta_params, tmp_if->dev, &chan_info); |
---|
2317 | 2147 | if (chan_info.band == WLC_BAND_5G || chan_info.band == WLC_BAND_6G) { |
---|
2318 | 2148 | tmp_if->transit_maxcount = dhd->conf->proptx_maxcnt_5g; |
---|
2319 | 2149 | ret = dhd_wlfc_update_maxcount(dhd, tmp_if->ifidx, |
---|
.. | .. |
---|
2329 | 2159 | for (i=0; i<MAX_IF_NUM; i++) { |
---|
2330 | 2160 | tmp_if = &apsta_params->if_info[i]; |
---|
2331 | 2161 | if (tmp_if->dev) { |
---|
2332 | | - wl_ext_get_chan(tmp_if->dev, &chan_info); |
---|
| 2162 | + wl_ext_get_chan(apsta_params, tmp_if->dev, &chan_info); |
---|
2333 | 2163 | if ((chan_info.chan == 0) || (chan_info.band == WLC_BAND_2G)) { |
---|
2334 | 2164 | if (chan_info.chan == 0) { |
---|
2335 | 2165 | tmp_if->transit_maxcount = WL_TXSTATUS_FREERUNCTR_MASK; |
---|
.. | .. |
---|
2362 | 2192 | if (!cur_if->dev || !wl_ext_master_if(cur_if)) |
---|
2363 | 2193 | continue; |
---|
2364 | 2194 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
---|
2365 | | - wl_ext_get_chan(cur_if->dev, &chan_info); |
---|
| 2195 | + wl_ext_get_chan(apsta_params, cur_if->dev, &chan_info); |
---|
2366 | 2196 | if (chan_info.chan && wl_ext_dfs_chan(&chan_info)) { |
---|
2367 | 2197 | return cur_if; |
---|
2368 | 2198 | } |
---|
.. | .. |
---|
2386 | 2216 | if (!cur_if->dev || !wl_ext_master_if(cur_if)) |
---|
2387 | 2217 | continue; |
---|
2388 | 2218 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
---|
2389 | | - wl_ext_get_chan(cur_if->dev, &chan_info); |
---|
| 2219 | + wl_ext_get_chan(apsta_params, cur_if->dev, &chan_info); |
---|
2390 | 2220 | if (chan_info.chan) { |
---|
2391 | 2221 | cur_if->prev_channel = chan_info.chan; |
---|
2392 | 2222 | cur_if->post_channel = post_channel; |
---|
.. | .. |
---|
2409 | 2239 | cur_if->chan_info.chan = cur_if->post_channel; |
---|
2410 | 2240 | else |
---|
2411 | 2241 | cur_if->chan_info.chan = cur_if->prev_channel; |
---|
2412 | | - if (wl_ext_associated(cur_if->dev)) |
---|
2413 | | - wl_ext_if_down(apsta_params, cur_if); |
---|
2414 | 2242 | wl_ext_if_up(apsta_params, cur_if, TRUE, 0); |
---|
2415 | 2243 | cur_if->prev_channel = 0; |
---|
2416 | 2244 | cur_if->post_channel = 0; |
---|
.. | .. |
---|
2457 | 2285 | tmp_if = &apsta_params->if_info[i]; |
---|
2458 | 2286 | if (tmp_if && tmp_if->ifmode == ifmode && |
---|
2459 | 2287 | wl_get_isam_status(tmp_if, IF_READY)) { |
---|
2460 | | - 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) { |
---|
2461 | 2289 | WL_MSG(tmp_if->ifname, "re-enable channel %d\n", channel); |
---|
2462 | 2290 | if (ifmode == IAP_MODE) { |
---|
2463 | 2291 | wl_ext_if_down(apsta_params, tmp_if); |
---|
.. | .. |
---|
2505 | 2333 | } |
---|
2506 | 2334 | } |
---|
2507 | 2335 | if (cur_if->ifmode == ISTA_MODE) { |
---|
2508 | | - if (conf->war & SET_CHAN_INCONN && chan_info->chan) { |
---|
| 2336 | + if (conf->war & SET_CHAN_INCONN) { |
---|
2509 | 2337 | chanspec_t fw_chspec; |
---|
2510 | 2338 | IAPSTA_INFO(dev->name, "set channel %d\n", chan_info->chan); |
---|
2511 | 2339 | wl_ext_set_chanspec(cur_if->dev, chan_info, &fw_chspec); |
---|
.. | .. |
---|
2563 | 2391 | cur_if->prio = PRIO_STA; |
---|
2564 | 2392 | cur_if->vsdb = TRUE; |
---|
2565 | 2393 | cur_if->prefix = 'S'; |
---|
2566 | | -#ifdef WL_STATIC_IF |
---|
2567 | | - dhd_conf_preinit_ioctls_sta(dhd, ifidx); |
---|
2568 | | -#endif /* WL_STATIC_IF */ |
---|
2569 | 2394 | } else if (wl_iftype == WL_IF_TYPE_AP && cur_if->ifmode != IMESH_MODE) { |
---|
2570 | 2395 | cur_if->ifmode = IAP_MODE; |
---|
2571 | 2396 | cur_if->prio = PRIO_AP; |
---|
.. | .. |
---|
2670 | 2495 | return; |
---|
2671 | 2496 | } |
---|
2672 | 2497 | IAPSTA_ERROR(dev->name, "timer expired\n"); |
---|
2673 | | - wl_ext_send_event_msg(dev, WLC_E_SET_SSID, WLC_E_STATUS_NO_NETWORKS, WLC_E_STATUS_SUCCESS); |
---|
2674 | | -} |
---|
2675 | | - |
---|
2676 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
---|
2677 | | -static bool |
---|
2678 | | -wl_ext_disc_recon_retry(struct wl_apsta_params *apsta_params, struct wl_if_info *cur_if) |
---|
2679 | | -{ |
---|
2680 | | - int sta_disc_recon_cnt = cur_if->sta_disc_recon_cnt; |
---|
2681 | | - struct osl_timespec *sta_disc_conn_ts = &cur_if->sta_disc_conn_ts; |
---|
2682 | | - struct osl_timespec cur_ts; |
---|
2683 | | - uint32 diff_ms = 0; |
---|
2684 | | - bool retry = FALSE; |
---|
2685 | | - |
---|
2686 | | - if (sta_disc_recon_cnt == 0) |
---|
2687 | | - osl_do_gettimeofday(sta_disc_conn_ts); |
---|
2688 | | - |
---|
2689 | | - osl_do_gettimeofday(&cur_ts); |
---|
2690 | | - diff_ms = osl_do_gettimediff(&cur_ts, sta_disc_conn_ts)/1000; |
---|
2691 | | - |
---|
2692 | | - IAPSTA_INFO(cur_if->ifname, "sta_disc_recon_cnt=%d, diff_ms = %dms\n", |
---|
2693 | | - sta_disc_recon_cnt, diff_ms); |
---|
2694 | | - if (sta_disc_recon_cnt >= STA_DISCONNECT_RECONNECT_MAX) { |
---|
2695 | | - if (diff_ms >= STA_DISCONNECT_RECONNECT_TIMEOUT) { |
---|
2696 | | - osl_do_gettimeofday(sta_disc_conn_ts); |
---|
2697 | | - cur_if->sta_disc_recon_cnt = 0; |
---|
2698 | | - retry = TRUE; |
---|
2699 | | - } else { |
---|
2700 | | - retry = FALSE; |
---|
2701 | | - } |
---|
2702 | | - } else { |
---|
2703 | | - retry = TRUE; |
---|
2704 | | - } |
---|
2705 | | - |
---|
2706 | | - if (retry) |
---|
2707 | | - cur_if->sta_disc_recon_cnt++; |
---|
2708 | | - |
---|
2709 | | - return retry; |
---|
2710 | | -} |
---|
2711 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
---|
2712 | | - |
---|
2713 | | -static void |
---|
2714 | | -wl_ext_update_assoc_info(struct net_device *dev, bool reassoc) |
---|
2715 | | -{ |
---|
2716 | | -#ifndef WL_REASSOC_BCAST |
---|
2717 | | - dhd_pub_t *dhd = dhd_get_pub(dev); |
---|
2718 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
2719 | | - struct wl_chan_info chan_info; |
---|
2720 | | -#endif |
---|
2721 | | - struct bcm_cfg80211 *cfg = wl_get_cfg(dev); |
---|
2722 | | - wlcfg_assoc_info_t *assoc_info; |
---|
2723 | | - struct wl_if_info *cur_if; |
---|
2724 | | - |
---|
2725 | | - cur_if = wl_get_cur_if(dev); |
---|
2726 | | - if (cur_if) { |
---|
2727 | | - assoc_info = &cur_if->assoc_info; |
---|
2728 | | - assoc_info->reassoc = reassoc; |
---|
2729 | | - assoc_info->bssid_hint = false; |
---|
2730 | | -#ifdef WL_REASSOC_BCAST |
---|
2731 | | - assoc_info->chan_cnt = 0; |
---|
2732 | | - assoc_info->chanspecs[0] = 0; |
---|
2733 | | - memcpy(&assoc_info->bssid, ðer_bcast, ETHER_ADDR_LEN); |
---|
2734 | | -#else |
---|
2735 | | - assoc_info->chanspecs[0] = wl_ext_get_chanspec(dev, &chan_info); |
---|
2736 | | - if (assoc_info->chanspecs[0] && reassoc) { |
---|
2737 | | - assoc_info->chan_cnt = 1; |
---|
2738 | | - wldev_ioctl(dev, WLC_GET_BSSID, &cur_if->bssid, ETHER_ADDR_LEN, 0); |
---|
2739 | | - memcpy(&assoc_info->bssid, &cur_if->bssid, ETHER_ADDR_LEN); |
---|
2740 | | - } else { |
---|
2741 | | - assoc_info->chan_cnt = 0; |
---|
2742 | | - memcpy(&assoc_info->bssid, ðer_bcast, ETHER_ADDR_LEN); |
---|
2743 | | - } |
---|
2744 | | -#endif /* WL_REASSOC_BCAST */ |
---|
2745 | | - if (!ETHER_ISBCAST(assoc_info->bssid)) |
---|
2746 | | - assoc_info->targeted_join = true; |
---|
2747 | | - else |
---|
2748 | | - assoc_info->targeted_join = false; |
---|
2749 | | - wl_get_assoc_channels(cfg, dev, assoc_info); |
---|
2750 | | - } |
---|
| 2498 | + wl_ext_send_event_msg(dev, WLC_E_SET_SSID, WLC_E_STATUS_NO_NETWORKS); |
---|
2751 | 2499 | } |
---|
2752 | 2500 | |
---|
2753 | 2501 | static int |
---|
.. | .. |
---|
2757 | 2505 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
2758 | 2506 | struct wl_if_info *cur_if; |
---|
2759 | 2507 | struct bcm_cfg80211 *cfg = wl_get_cfg(dev); |
---|
2760 | | - struct osl_timespec cur_ts, *sta_conn_ts; |
---|
2761 | | - wlcfg_assoc_info_t *assoc_info; |
---|
| 2508 | + struct osl_timespec cur_ts, *sta_conn_ts = &apsta_params->sta_conn_ts; |
---|
2762 | 2509 | uint32 diff_ms = 0; |
---|
2763 | 2510 | int max_wait_time = 0, ret = 0; |
---|
2764 | | - bool connecting, handshaking, associated; |
---|
2765 | | - uint32 etype = ntoh32(e->event_type); |
---|
2766 | | - uint32 status = ntoh32(e->status); |
---|
2767 | | - |
---|
2768 | | - if (wl_get_drv_status(cfg, DISCONNECTING, dev)) { |
---|
2769 | | - WL_MSG(dev->name, "skip connect retry due to disconnecting\n"); |
---|
2770 | | - return BCME_BADADDR; |
---|
2771 | | - } |
---|
| 2511 | + bool connecting = FALSE; |
---|
2772 | 2512 | |
---|
2773 | 2513 | cur_if = wl_get_cur_if(dev); |
---|
2774 | 2514 | if (!cur_if) |
---|
2775 | 2515 | return ret; |
---|
2776 | | - sta_conn_ts = &cur_if->sta_conn_ts; |
---|
2777 | | - connecting = wl_ext_sta_connecting(dev); |
---|
2778 | | - handshaking = wl_ext_sta_handshaking(dev); |
---|
2779 | 2516 | |
---|
2780 | 2517 | mutex_unlock(&apsta_params->in4way_sync); |
---|
2781 | 2518 | mutex_lock(&cfg->connect_sync); |
---|
| 2519 | + connecting = wl_ext_sta_connecting(dev); |
---|
2782 | 2520 | |
---|
2783 | 2521 | osl_do_gettimeofday(&cur_ts); |
---|
2784 | 2522 | diff_ms = osl_do_gettimediff(&cur_ts, sta_conn_ts)/1000; |
---|
2785 | | - associated = wl_ext_associated(dev); |
---|
2786 | | - assoc_info = &cur_if->assoc_info; |
---|
2787 | 2523 | |
---|
2788 | 2524 | if (connecting && diff_ms < STA_CONNECT_TIMEOUT && |
---|
2789 | 2525 | !wl_get_drv_status(cfg, DISCONNECTING, dev)) { |
---|
| 2526 | + uint32 etype = ntoh32(e->event_type); |
---|
| 2527 | + uint32 status = ntoh32(e->status); |
---|
2790 | 2528 | if (etype == WLC_E_SET_SSID && (status == WLC_E_STATUS_NO_NETWORKS || |
---|
2791 | 2529 | status == WLC_E_STATUS_NO_ACK)) { |
---|
2792 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
---|
2793 | | - if (assoc_info->reassoc && associated && !handshaking) { |
---|
2794 | | - /* There are two cases will come in to retry reassoc: |
---|
2795 | | - * 1) reconnect from wpa_supplicant |
---|
2796 | | - * 2) fw roam |
---|
2797 | | - */ |
---|
2798 | | - if (associated) |
---|
2799 | | - 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) { |
---|
2800 | 2532 | WL_MSG(dev->name, "retry reassoc\n"); |
---|
2801 | | - if (wl_handle_reassoc(cfg, dev, assoc_info)) |
---|
2802 | | - goto exit; |
---|
2803 | | - if (assoc_info->chan_cnt == 0) |
---|
2804 | | - max_wait_time = STA_CONNECT_FULL_CHAN_TIMEOUT; |
---|
2805 | | - else |
---|
2806 | | - max_wait_time = STA_RECONNECT_RETRY_TIMEOUT + |
---|
2807 | | - (WL_BCAST_SCAN_JOIN_ACTIVE_DWELL_TIME_MS * assoc_info->chan_cnt); |
---|
2808 | | - max_wait_time = min(max_wait_time, STA_CONNECT_FULL_CHAN_TIMEOUT); |
---|
2809 | | - } |
---|
2810 | | - else { |
---|
2811 | | - /* There is one case will come in to retry join: |
---|
2812 | | - * 1) connect from wpa_supplicant |
---|
2813 | | - */ |
---|
2814 | | - WL_MSG(dev->name, "retry join\n"); |
---|
2815 | | - if (associated) { |
---|
2816 | | - bzero(&cfg->last_roamed_addr, ETHER_ADDR_LEN); |
---|
2817 | | - 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; |
---|
2818 | 2541 | } |
---|
2819 | | - if (wl_handle_join(cfg, dev, assoc_info)) |
---|
2820 | | - goto exit; |
---|
2821 | | - if (assoc_info->chan_cnt == 0) |
---|
2822 | | - max_wait_time = STA_CONNECT_FULL_CHAN_TIMEOUT; |
---|
2823 | | - else |
---|
2824 | | - max_wait_time = STA_CONNECT_RETRY_TIMEOUT + |
---|
2825 | | - (WL_BCAST_SCAN_JOIN_ACTIVE_DWELL_TIME_MS * assoc_info->chan_cnt); |
---|
2826 | | - max_wait_time = min(max_wait_time, STA_CONNECT_FULL_CHAN_TIMEOUT); |
---|
2827 | 2542 | } |
---|
2828 | | - IAPSTA_INFO(dev->name, "reconnect %dms later\n", max_wait_time); |
---|
2829 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, max_wait_time); |
---|
| 2543 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, max_wait_time); |
---|
2830 | 2544 | } |
---|
2831 | | - ret = BCME_ERROR; |
---|
| 2545 | + ret = -EAGAIN; |
---|
2832 | 2546 | } |
---|
2833 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
---|
2834 | | - else if (cur_if->conn_state >= CONN_STATE_CONNECTED && |
---|
2835 | | - !wl_get_drv_status(cfg, DISCONNECTING, dev) && |
---|
2836 | | - wl_get_drv_status(cfg, CONNECTED, dev)) { |
---|
2837 | | - if (etype == WLC_E_DISASSOC_IND || etype == WLC_E_DEAUTH_IND) { |
---|
2838 | | - /* There is one case will come in to retry join: |
---|
2839 | | - * 1) receive disconnect from AP after connected |
---|
2840 | | - */ |
---|
2841 | | - if (wl_ext_disc_recon_retry(apsta_params, cur_if)) { |
---|
2842 | | - int wpa_auth = 0; |
---|
2843 | | - WL_MSG(dev->name, "retry join cnt %d\n", cur_if->sta_disc_recon_cnt); |
---|
2844 | | - bzero(&cfg->last_roamed_addr, ETHER_ADDR_LEN); |
---|
2845 | | - wl_ext_update_assoc_info(dev, FALSE); |
---|
2846 | | -#ifdef DHD_LOSSLESS_ROAMING |
---|
2847 | | - wl_ext_send_event_msg(dev, WLC_E_ROAM_PREP, WLC_E_STATUS_SUCCESS, WLC_E_REASON_DEAUTH); |
---|
2848 | | -#endif |
---|
2849 | | - if (wl_handle_join(cfg, dev, assoc_info)) |
---|
2850 | | - goto exit; |
---|
2851 | | - wl_timer_mod(dhd, &cur_if->connect_timer, STA_CONNECT_TIMEOUT); |
---|
2852 | | - osl_do_gettimeofday(sta_conn_ts); |
---|
2853 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTING); |
---|
2854 | | - wl_ext_iovar_getint(dev, "wpa_auth", &wpa_auth); |
---|
2855 | | - if (!(wpa_auth & (WPA3_AUTH_SAE_PSK|0x20))) { |
---|
2856 | | - if (assoc_info->chan_cnt == 0) |
---|
2857 | | - max_wait_time = STA_CONNECT_FULL_CHAN_TIMEOUT; |
---|
2858 | | - else |
---|
2859 | | - max_wait_time = STA_CONNECT_RETRY_TIMEOUT + |
---|
2860 | | - (WL_BCAST_SCAN_JOIN_ACTIVE_DWELL_TIME_MS * assoc_info->chan_cnt); |
---|
2861 | | - max_wait_time = min(max_wait_time, STA_CONNECT_FULL_CHAN_TIMEOUT); |
---|
2862 | | - IAPSTA_INFO(dev->name, "reconnect %dms later\n", max_wait_time); |
---|
2863 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, max_wait_time); |
---|
2864 | | - } |
---|
2865 | | - ret = BCME_ERROR; |
---|
2866 | | - } |
---|
2867 | | - else { |
---|
2868 | | - WL_MSG(dev->name, "out of retry cnt %d within %dms\n", |
---|
2869 | | - cur_if->sta_disc_recon_cnt, STA_DISCONNECT_RECONNECT_TIMEOUT); |
---|
2870 | | - } |
---|
2871 | | - } |
---|
2872 | | - } |
---|
2873 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
---|
2874 | | - |
---|
2875 | | -exit: |
---|
2876 | 2547 | mutex_unlock(&cfg->connect_sync); |
---|
2877 | 2548 | mutex_lock(&apsta_params->in4way_sync); |
---|
2878 | 2549 | |
---|
.. | .. |
---|
2882 | 2553 | static void |
---|
2883 | 2554 | wl_ext_set_connect_retry(struct net_device *dev, void *context) |
---|
2884 | 2555 | { |
---|
2885 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
2886 | 2556 | wlcfg_assoc_info_t *assoc_info = (wlcfg_assoc_info_t *)context; |
---|
2887 | 2557 | struct wl_if_info *cur_if; |
---|
2888 | 2558 | int max_wait_time; |
---|
.. | .. |
---|
2892 | 2562 | if (!cur_if) |
---|
2893 | 2563 | return; |
---|
2894 | 2564 | |
---|
2895 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
---|
| 2565 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
---|
2896 | 2566 | memset(&cur_if->assoc_info, 0, sizeof(wlcfg_assoc_info_t)); |
---|
2897 | 2567 | wl_ext_iovar_getint(dev, "wpa_auth", &wpa_auth); |
---|
2898 | 2568 | if (!(wpa_auth & (WPA3_AUTH_SAE_PSK|0x20) && assoc_info)) { |
---|
2899 | 2569 | memcpy(&cur_if->bssid, assoc_info->bssid, ETHER_ADDR_LEN); |
---|
2900 | 2570 | memcpy(&cur_if->assoc_info, assoc_info, sizeof(wlcfg_assoc_info_t)); |
---|
2901 | | - if (assoc_info->chan_cnt == 0) |
---|
2902 | | - max_wait_time = STA_CONNECT_FULL_CHAN_TIMEOUT; |
---|
2903 | | - else if (assoc_info->reassoc) |
---|
| 2571 | + if (assoc_info->reassoc) |
---|
2904 | 2572 | max_wait_time = STA_RECONNECT_RETRY_TIMEOUT; |
---|
2905 | 2573 | else |
---|
2906 | 2574 | max_wait_time = STA_CONNECT_RETRY_TIMEOUT; |
---|
2907 | 2575 | IAPSTA_INFO(dev->name, "reconnect %dms later\n", max_wait_time); |
---|
2908 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, max_wait_time); |
---|
| 2576 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, max_wait_time); |
---|
2909 | 2577 | } |
---|
2910 | 2578 | } |
---|
2911 | 2579 | #endif /* WL_EXT_RECONNECT */ |
---|
.. | .. |
---|
3283 | 2951 | #ifdef BCMDBUS |
---|
3284 | 2952 | if (!rx) |
---|
3285 | 2953 | #endif /* BCMDBUS */ |
---|
3286 | | - wl_timer_mod(dhd, &cur_if->eapol_timer, 0); |
---|
| 2954 | + wl_ext_mod_timer(&cur_if->eapol_timer, 0, 0); |
---|
3287 | 2955 | |
---|
3288 | 2956 | if (cur_if->pend_eapol_pkt) { |
---|
3289 | 2957 | PKTCFREE(dhd->osh, cur_if->pend_eapol_pkt, TRUE); |
---|
.. | .. |
---|
3342 | 3010 | #else |
---|
3343 | 3011 | interval = STA_EAPOL_TIMEOUT; |
---|
3344 | 3012 | #endif /* EAPOL_DYNAMATIC_RESEND */ |
---|
3345 | | - wl_timer_mod(dhd, &cur_if->eapol_timer, interval); |
---|
| 3013 | + wl_ext_mod_timer(&cur_if->eapol_timer, 0, interval); |
---|
3346 | 3014 | IAPSTA_TRACE(cur_if->dev->name, "backup eapol pkt\n"); |
---|
3347 | 3015 | } |
---|
3348 | 3016 | spin_unlock_irqrestore(&apsta_params->eapol_lock, flags); |
---|
.. | .. |
---|
3376 | 3044 | cur_if->eapol_max_intvl, STA_EAPOL_TIMEOUT, |
---|
3377 | 3045 | cur_if->eapol_cnt); |
---|
3378 | 3046 | #else |
---|
3379 | | - 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); |
---|
3380 | 3048 | #endif /* EAPOL_DYNAMATIC_RESEND */ |
---|
3381 | 3049 | pending = TRUE; |
---|
3382 | 3050 | } |
---|
.. | .. |
---|
3412 | 3080 | } |
---|
3413 | 3081 | #endif /* EAPOL_RESEND */ |
---|
3414 | 3082 | |
---|
3415 | | -#ifdef KEY_INSTALL_CHECK |
---|
3416 | | -static void |
---|
3417 | | -wl_ext_key_install_timeout(unsigned long data) |
---|
3418 | | -{ |
---|
3419 | | - struct net_device *dev = (struct net_device *)data; |
---|
3420 | | - struct dhd_pub *dhd; |
---|
3421 | | - wl_event_msg_t msg; |
---|
3422 | | - |
---|
3423 | | - if (!dev) { |
---|
3424 | | - IAPSTA_ERROR("wlan", "dev is not ready\n"); |
---|
3425 | | - return; |
---|
3426 | | - } |
---|
3427 | | - |
---|
3428 | | - dhd = dhd_get_pub(dev); |
---|
3429 | | - |
---|
3430 | | - bzero(&msg, sizeof(wl_event_msg_t)); |
---|
3431 | | - IAPSTA_TRACE(dev->name, "timer expired\n"); |
---|
3432 | | - |
---|
3433 | | - msg.ifidx = dhd_net2idx(dhd->info, dev); |
---|
3434 | | - msg.event_type = hton32(WLC_E_RESERVED); |
---|
3435 | | - msg.reason = hton32(ISAM_RC_KEY_INSTALL); |
---|
3436 | | - wl_ext_event_send(dhd->event_params, &msg, NULL); |
---|
3437 | | -} |
---|
3438 | | - |
---|
3439 | | -static void |
---|
3440 | | -wl_ext_key_install_handler(struct wl_if_info *cur_if, |
---|
3441 | | - const wl_event_msg_t *e, void *data) |
---|
3442 | | -{ |
---|
3443 | | - struct net_device *dev = cur_if->dev; |
---|
3444 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
3445 | | - struct bcm_cfg80211 *cfg = wl_get_cfg(dev); |
---|
3446 | | - uint32 etype = ntoh32(e->event_type); |
---|
3447 | | - uint32 reason = ntoh32(e->reason); |
---|
3448 | | - int err, key_installed = 0; |
---|
3449 | | - |
---|
3450 | | - if (etype == WLC_E_RESERVED && reason == ISAM_RC_KEY_INSTALL) { |
---|
3451 | | - if (cur_if->conn_state >= CONN_STATE_4WAY_M4 && |
---|
3452 | | - !wl_get_drv_status(cfg, DISCONNECTING, dev) && |
---|
3453 | | - wl_get_drv_status(cfg, CONNECTED, dev)) { |
---|
3454 | | - err = wldev_iovar_getint(dev, "buf_key_b4_m4_installed", &key_installed); |
---|
3455 | | - if (!err && !key_installed) { |
---|
3456 | | - cur_if->key_install_cnt++; |
---|
3457 | | - if (cur_if->key_install_cnt > STA_KEY_INSTALL_MAX) { |
---|
3458 | | - IAPSTA_ERROR(dev->name, "key not installed, send disconnect\n"); |
---|
3459 | | -#ifdef EAPOL_RESEND |
---|
3460 | | - wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
---|
3461 | | -#endif /* EAPOL_RESEND */ |
---|
3462 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTED); |
---|
3463 | | - wl_ext_ioctl(cur_if->dev, WLC_DISASSOC, NULL, 0, 1); |
---|
3464 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
---|
3465 | | - cur_if->key_install_cnt = 0; |
---|
3466 | | - } else { |
---|
3467 | | - IAPSTA_INFO(dev->name, "check key installed %dms later, cnt=%d\n", |
---|
3468 | | - STA_KEY_INSTALL_INTERVAL, cur_if->key_install_cnt); |
---|
3469 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, STA_KEY_INSTALL_INTERVAL); |
---|
3470 | | - } |
---|
3471 | | - } else { |
---|
3472 | | -#ifdef EAPOL_RESEND |
---|
3473 | | - wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
---|
3474 | | -#endif /* EAPOL_RESEND */ |
---|
3475 | | - IAPSTA_INFO(dev->name, "key installed\n"); |
---|
3476 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
---|
3477 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTED); |
---|
3478 | | - cur_if->key_install_cnt = 0; |
---|
3479 | | - } |
---|
3480 | | - } |
---|
3481 | | - } |
---|
3482 | | - return; |
---|
3483 | | -} |
---|
3484 | | - |
---|
3485 | | -static int |
---|
3486 | | -wl_key_installed(struct wl_if_info *cur_if) |
---|
3487 | | -{ |
---|
3488 | | - struct net_device *dev = cur_if->dev; |
---|
3489 | | - dhd_pub_t *dhd = dhd_get_pub(dev); |
---|
3490 | | - int err, key_installed = 0; |
---|
3491 | | - |
---|
3492 | | - err = wldev_iovar_getint(dev, "buf_key_b4_m4_installed", &key_installed); |
---|
3493 | | - if (err) { |
---|
3494 | | - IAPSTA_INFO(dev->name, "not supported %d\n", err); |
---|
3495 | | - key_installed = 1; |
---|
3496 | | - } else if (key_installed) |
---|
3497 | | - IAPSTA_INFO(dev->name, "key installed\n"); |
---|
3498 | | - |
---|
3499 | | - if (key_installed) |
---|
3500 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
---|
3501 | | - else { |
---|
3502 | | - IAPSTA_INFO(dev->name, "check key installed %dms later\n", STA_KEY_INSTALL_INTERVAL); |
---|
3503 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, STA_KEY_INSTALL_INTERVAL); |
---|
3504 | | - } |
---|
3505 | | - |
---|
3506 | | - return key_installed; |
---|
3507 | | -} |
---|
3508 | | -#endif /* KEY_INSTALL_CHECK */ |
---|
3509 | | - |
---|
3510 | 3083 | #if defined(WL_CFG80211) && defined(SCAN_SUPPRESS) |
---|
3511 | 3084 | static void |
---|
3512 | 3085 | wl_ext_light_scan_prep(struct net_device *dev, void *scan_params, bool scan_v2) |
---|
3513 | 3086 | { |
---|
3514 | | - wl_scan_params_v1_t *params = NULL; |
---|
| 3087 | + wl_scan_params_t *params = NULL; |
---|
3515 | 3088 | wl_scan_params_v2_t *params_v2 = NULL; |
---|
3516 | 3089 | |
---|
3517 | 3090 | if (!scan_params) { |
---|
.. | .. |
---|
3523 | 3096 | if (scan_v2) { |
---|
3524 | 3097 | params_v2 = (wl_scan_params_v2_t *)scan_params; |
---|
3525 | 3098 | } else { |
---|
3526 | | - params = (wl_scan_params_v1_t *)scan_params; |
---|
| 3099 | + params = (wl_scan_params_t *)scan_params; |
---|
3527 | 3100 | } |
---|
3528 | 3101 | |
---|
3529 | 3102 | if (params_v2) { |
---|
.. | .. |
---|
3557 | 3130 | tmp_if = &apsta_params->if_info[i]; |
---|
3558 | 3131 | if (tmp_if->dev && (tmp_if->tput_info.tput_tx + tmp_if->tput_info.tput_rx) > tput_sum) { |
---|
3559 | 3132 | memset(chan_info, 0, sizeof(struct wl_chan_info)); |
---|
3560 | | - wl_ext_get_chan(tmp_if->dev, chan_info); |
---|
| 3133 | + wl_ext_get_chan(apsta_params, tmp_if->dev, chan_info); |
---|
3561 | 3134 | if (chan_info->chan) { |
---|
3562 | 3135 | max_tput_if = tmp_if; |
---|
3563 | 3136 | tput_sum = tmp_if->tput_info.tput_tx + tmp_if->tput_info.tput_rx; |
---|
.. | .. |
---|
3696 | 3269 | } |
---|
3697 | 3270 | } |
---|
3698 | 3271 | } |
---|
| 3272 | + |
---|
3699 | 3273 | } |
---|
3700 | 3274 | |
---|
3701 | 3275 | static void |
---|
.. | .. |
---|
3703 | 3277 | enum wl_ext_status status) |
---|
3704 | 3278 | { |
---|
3705 | 3279 | struct net_device *dev = cur_if->dev; |
---|
3706 | | - 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; |
---|
3707 | 3281 | int max_wait_time = 200, max_wait_cnt = 20; |
---|
3708 | 3282 | int cur_conn_state = cur_if->conn_state; |
---|
3709 | 3283 | uint32 diff_ms = 0; |
---|
.. | .. |
---|
3753 | 3327 | |
---|
3754 | 3328 | if (suspend) { |
---|
3755 | 3329 | if (insuspend & AP_DOWN_IN_SUSPEND) { |
---|
3756 | | - 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); |
---|
3757 | 3332 | if (cur_if->chan_info.chan) |
---|
3758 | 3333 | wl_ext_if_down(apsta_params, cur_if); |
---|
3759 | 3334 | } |
---|
.. | .. |
---|
3776 | 3351 | |
---|
3777 | 3352 | #ifdef TPUT_MONITOR |
---|
3778 | 3353 | if (suspend) |
---|
3779 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, 0); |
---|
| 3354 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, 0); |
---|
3780 | 3355 | #endif /* TPUT_MONITOR */ |
---|
3781 | 3356 | |
---|
3782 | 3357 | for (i=0; i<MAX_IF_NUM; i++) { |
---|
.. | .. |
---|
3795 | 3370 | |
---|
3796 | 3371 | #ifdef TPUT_MONITOR |
---|
3797 | 3372 | if (!suspend) |
---|
3798 | | - 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); |
---|
3799 | 3374 | #endif /* TPUT_MONITOR */ |
---|
3800 | 3375 | |
---|
3801 | 3376 | return 0; |
---|
.. | .. |
---|
3808 | 3383 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
3809 | 3384 | struct dhd_conf *conf = dhd->conf; |
---|
3810 | 3385 | struct net_device *dev = cur_if->dev; |
---|
3811 | | - struct osl_timespec cur_ts, *sta_disc_ts = &cur_if->sta_disc_ts; |
---|
3812 | | - 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; |
---|
3813 | 3388 | uint32 diff_ms = 0; |
---|
3814 | | - int ret = 0, suppressed = 0, wpa_auth = 0, max_wait_time = 0, key_installed = 1; |
---|
3815 | | - uint cur_conn_state, conn_state; |
---|
| 3389 | + int ret = 0, cur_conn_state; |
---|
| 3390 | + int suppressed = 0, wpa_auth = 0; |
---|
3816 | 3391 | bool connecting = FALSE; |
---|
3817 | 3392 | wl_event_msg_t *e = (wl_event_msg_t *)context; |
---|
3818 | 3393 | #ifdef WL_CFG80211 |
---|
.. | .. |
---|
3863 | 3438 | osl_do_gettimeofday(&cur_ts); |
---|
3864 | 3439 | diff_ms = osl_do_gettimediff(&cur_ts, sta_conn_ts)/1000; |
---|
3865 | 3440 | if (connecting && diff_ms <= STA_CONNECT_TIMEOUT) { |
---|
3866 | | - IAPSTA_ERROR(dev->name, "scan during connecting... %d\n", |
---|
3867 | | - cur_conn_state); |
---|
| 3441 | + IAPSTA_ERROR(dev->name, "connecting... %d\n", cur_conn_state); |
---|
3868 | 3442 | ret = -EBUSY; |
---|
3869 | 3443 | break; |
---|
3870 | 3444 | } |
---|
.. | .. |
---|
3878 | 3452 | if (wl_get_drv_status(cfg, CONNECTING, dev) || |
---|
3879 | 3453 | (connecting && diff_ms <= STA_CONNECT_TIMEOUT) || |
---|
3880 | 3454 | (cur_if->empty_scan >= STA_EMPTY_SCAN_MAX)) { |
---|
| 3455 | + unsigned long flags = 0; |
---|
3881 | 3456 | cur_if->empty_scan = 0; |
---|
3882 | | - WL_MSG(dev->name, "FAKE SCAN\n"); |
---|
3883 | | - 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); |
---|
3884 | 3468 | } |
---|
3885 | 3469 | } |
---|
3886 | 3470 | break; |
---|
3887 | 3471 | case WL_EXT_STATUS_SCAN_COMPLETE: |
---|
3888 | | - if ((conf->war & FW_REINIT_EMPTY_SCAN) && |
---|
3889 | | - cfg->bss_list->count == 0 && !p2p_scan(cfg)) { |
---|
| 3472 | + if ((conf->war & FW_REINIT_EMPTY_SCAN) && cfg->bss_list->count == 0) { |
---|
3890 | 3473 | bool assoc; |
---|
3891 | 3474 | osl_do_gettimeofday(&cur_ts); |
---|
3892 | 3475 | diff_ms = osl_do_gettimediff(&cur_ts, sta_disc_ts)/1000; |
---|
.. | .. |
---|
3911 | 3494 | } |
---|
3912 | 3495 | break; |
---|
3913 | 3496 | #endif /* WL_CFG80211 */ |
---|
3914 | | - case WL_EXT_STATUS_PRE_DISCONNECTING: |
---|
| 3497 | + case WL_EXT_STATUS_DISCONNECTING: |
---|
3915 | 3498 | #ifdef EAPOL_RESEND |
---|
3916 | 3499 | wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
---|
3917 | 3500 | #endif /* EAPOL_RESEND */ |
---|
3918 | | -#ifdef KEY_INSTALL_CHECK |
---|
3919 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
---|
3920 | | -#endif /* KEY_INSTALL_CHECK */ |
---|
3921 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
---|
| 3501 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
---|
3922 | 3502 | #if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
---|
3923 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
---|
| 3503 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
---|
3924 | 3504 | memset(&cur_if->assoc_info, 0, sizeof(wlcfg_assoc_info_t)); |
---|
3925 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
---|
3926 | | - cur_if->sta_disc_recon_cnt = 0; |
---|
3927 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
---|
3928 | 3505 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
3929 | 3506 | #ifdef SCAN_SUPPRESS |
---|
3930 | 3507 | apsta_params->scan_busy_cnt = 0; |
---|
3931 | 3508 | #endif /* SCAN_SUPPRESS */ |
---|
3932 | | - break; |
---|
3933 | | - case WL_EXT_STATUS_DISCONNECTING: |
---|
3934 | 3509 | if (connecting) { |
---|
3935 | 3510 | IAPSTA_ERROR(dev->name, "connect failed at %d\n", cur_conn_state); |
---|
3936 | 3511 | wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_IDLE); |
---|
.. | .. |
---|
3938 | 3513 | if (action & STA_NO_BTC_IN4WAY) { |
---|
3939 | 3514 | wl_set_btc_in4way(apsta_params, cur_if, status, FALSE); |
---|
3940 | 3515 | } |
---|
3941 | | -#ifdef BTC_WAR |
---|
3942 | | - wl_ext_btc_config(cur_if->dev, FALSE); |
---|
3943 | | -#endif /* BTC_WAR */ |
---|
3944 | 3516 | if (action & STA_WAIT_DISCONNECTED) { |
---|
3945 | 3517 | wl_wait_disconnect(apsta_params, cur_if, status); |
---|
3946 | 3518 | wake_up_interruptible(&conf->event_complete); |
---|
.. | .. |
---|
3951 | 3523 | if (action & STA_REASSOC_RETRY) { |
---|
3952 | 3524 | wl_ext_set_connect_retry(dev, context); |
---|
3953 | 3525 | } |
---|
3954 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
---|
3955 | | - cur_if->sta_disc_recon_cnt = 0; |
---|
3956 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
---|
3957 | 3526 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
3958 | | - wl_timer_mod(dhd, &cur_if->connect_timer, STA_CONNECT_TIMEOUT); |
---|
| 3527 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, STA_CONNECT_TIMEOUT); |
---|
3959 | 3528 | osl_do_gettimeofday(sta_conn_ts); |
---|
3960 | 3529 | wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTING); |
---|
3961 | 3530 | if (action & STA_NO_BTC_IN4WAY) { |
---|
.. | .. |
---|
3965 | 3534 | case WL_EXT_STATUS_CONNECTED: |
---|
3966 | 3535 | wl_ext_iovar_getint(dev, "wpa_auth", &wpa_auth); |
---|
3967 | 3536 | if ((wpa_auth < WPA_AUTH_UNSPECIFIED) || (wpa_auth & WPA2_AUTH_FT)) { |
---|
3968 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
---|
| 3537 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
---|
3969 | 3538 | wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTED); |
---|
3970 | | -#ifdef BTC_WAR |
---|
3971 | | - wl_ext_btc_config(cur_if->dev, TRUE); |
---|
3972 | | -#endif /* BTC_WAR */ |
---|
3973 | | - max_wait_time = 0; |
---|
3974 | | - } else { |
---|
3975 | | - max_wait_time = STA_4WAY_TIMEOUT; |
---|
3976 | 3539 | } |
---|
3977 | 3540 | #if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
---|
3978 | | - wl_ext_update_assoc_info(dev, TRUE); |
---|
3979 | | - 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)); |
---|
3980 | 3543 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
3981 | 3544 | if (cur_if->ifmode == ISTA_MODE) { |
---|
3982 | 3545 | dhd_conf_set_wme(dhd, cur_if->ifidx, 0); |
---|
.. | .. |
---|
3984 | 3547 | } |
---|
3985 | 3548 | else if (cur_if->ifmode == IGC_MODE) { |
---|
3986 | 3549 | dhd_conf_set_mchan_bw(dhd, WL_P2P_IF_CLIENT, -1); |
---|
3987 | | - } |
---|
3988 | | - break; |
---|
3989 | | - case WL_EXT_STATUS_ROAMED: |
---|
3990 | | - wl_ext_iovar_getint(dev, "wpa_auth", &wpa_auth); |
---|
3991 | | - if ((wpa_auth >= WPA_AUTH_UNSPECIFIED) && !(wpa_auth & WPA2_AUTH_FT)) { |
---|
3992 | | - wl_timer_mod(dhd, &cur_if->connect_timer, STA_CONNECT_TIMEOUT); |
---|
3993 | | - osl_do_gettimeofday(sta_conn_ts); |
---|
3994 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_CONNECTING); |
---|
3995 | | -#ifdef BTC_WAR |
---|
3996 | | - wl_ext_btc_config(cur_if->dev, TRUE); |
---|
3997 | | -#endif /* BTC_WAR */ |
---|
3998 | | - max_wait_time = STA_4WAY_TIMEOUT; |
---|
3999 | | - } else { |
---|
4000 | | - max_wait_time = 0; |
---|
4001 | | - } |
---|
4002 | | -#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
---|
4003 | | - wl_ext_update_assoc_info(dev, TRUE); |
---|
4004 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, max_wait_time); |
---|
4005 | | -#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
4006 | | -#ifdef KEY_INSTALL_CHECK |
---|
4007 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
---|
4008 | | -#endif /* KEY_INSTALL_CHECK */ |
---|
4009 | | - if (cur_if->ifmode == ISTA_MODE) { |
---|
4010 | | - dhd_conf_set_wme(dhd, cur_if->ifidx, 0); |
---|
4011 | | - wake_up_interruptible(&conf->event_complete); |
---|
4012 | 3550 | } |
---|
4013 | 3551 | break; |
---|
4014 | 3552 | case WL_EXT_STATUS_RECONNECT: |
---|
.. | .. |
---|
4025 | 3563 | #ifdef EAPOL_RESEND |
---|
4026 | 3564 | wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
---|
4027 | 3565 | #endif /* EAPOL_RESEND */ |
---|
4028 | | -#ifdef KEY_INSTALL_CHECK |
---|
4029 | | - wl_timer_mod(dhd, &cur_if->key_install_timer, 0); |
---|
4030 | | -#endif /* KEY_INSTALL_CHECK */ |
---|
4031 | 3566 | #if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
---|
4032 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
---|
| 3567 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
---|
4033 | 3568 | memset(&cur_if->assoc_info, 0, sizeof(wlcfg_assoc_info_t)); |
---|
4034 | | -#ifdef WL_EXT_DISCONNECT_RECONNECT |
---|
4035 | | - cur_if->sta_disc_recon_cnt = 0; |
---|
4036 | | -#endif /* WL_EXT_DISCONNECT_RECONNECT */ |
---|
4037 | 3569 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
4038 | 3570 | #ifdef SCAN_SUPPRESS |
---|
4039 | 3571 | apsta_params->scan_busy_cnt = 0; |
---|
.. | .. |
---|
4042 | 3574 | !(ntoh16(e->flags) & WLC_EVENT_MSG_LINK)) { |
---|
4043 | 3575 | apsta_params->linkdown_reason = ntoh32(e->reason); |
---|
4044 | 3576 | } |
---|
4045 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
---|
| 3577 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
---|
4046 | 3578 | if (connecting) { |
---|
4047 | 3579 | IAPSTA_ERROR(dev->name, "connect failed at %d\n", cur_conn_state); |
---|
4048 | 3580 | } |
---|
.. | .. |
---|
4050 | 3582 | if (action & STA_NO_BTC_IN4WAY) { |
---|
4051 | 3583 | wl_set_btc_in4way(apsta_params, cur_if, status, FALSE); |
---|
4052 | 3584 | } |
---|
4053 | | -#ifdef BTC_WAR |
---|
4054 | | - wl_ext_btc_config(cur_if->dev, FALSE); |
---|
4055 | | -#endif /* BTC_WAR */ |
---|
4056 | 3585 | osl_do_gettimeofday(sta_disc_ts); |
---|
4057 | 3586 | wake_up_interruptible(&conf->event_complete); |
---|
4058 | 3587 | break; |
---|
4059 | 3588 | case WL_EXT_STATUS_ADD_KEY: |
---|
4060 | | - conn_state = CONN_STATE_ADD_KEY; |
---|
4061 | | - wl_timer_mod(dhd, &cur_if->connect_timer, 0); |
---|
4062 | | -#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
---|
4063 | | - wl_timer_mod(dhd, &cur_if->reconnect_timer, 0); |
---|
4064 | | -#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
4065 | | -#ifdef KEY_INSTALL_CHECK |
---|
4066 | | - key_installed = wl_key_installed(cur_if); |
---|
4067 | | -#endif /* KEY_INSTALL_CHECK */ |
---|
4068 | | - if (key_installed) |
---|
4069 | | - conn_state = CONN_STATE_CONNECTED; |
---|
4070 | | - wl_ext_update_conn_state(dhd, cur_if->ifidx, conn_state); |
---|
4071 | | - IAPSTA_INFO(dev->name, "WPA 4-WAY complete %d => %d\n", |
---|
4072 | | - 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); |
---|
4073 | 3591 | #ifdef EAPOL_RESEND |
---|
4074 | | - if (key_installed) |
---|
4075 | | - wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
---|
| 3592 | + wl_ext_release_eapol_txpkt(dhd, cur_if->ifidx, FALSE); |
---|
4076 | 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 */ |
---|
4077 | 3597 | if (action & STA_NO_BTC_IN4WAY) { |
---|
4078 | 3598 | wl_set_btc_in4way(apsta_params, cur_if, status, FALSE); |
---|
4079 | 3599 | } |
---|
4080 | | -#ifdef BTC_WAR |
---|
4081 | | - wl_ext_btc_config(cur_if->dev, TRUE); |
---|
4082 | | -#endif /* BTC_WAR */ |
---|
4083 | 3600 | wake_up_interruptible(&conf->event_complete); |
---|
| 3601 | + IAPSTA_INFO(dev->name, "WPA 4-WAY complete %d\n", cur_conn_state); |
---|
4084 | 3602 | break; |
---|
4085 | 3603 | default: |
---|
4086 | 3604 | IAPSTA_INFO(dev->name, "Unknown action=0x%x, status=%d\n", action, status); |
---|
.. | .. |
---|
4096 | 3614 | { |
---|
4097 | 3615 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
4098 | 3616 | struct net_device *dev = cur_if->dev; |
---|
4099 | | - struct osl_timespec cur_ts, *ap_disc_sta_ts = &cur_if->ap_disc_sta_ts; |
---|
4100 | | - 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; |
---|
4101 | 3619 | uint32 diff_ms = 0, timeout, max_wait_time = 300; |
---|
4102 | 3620 | int ret = 0, suppressed = 0; |
---|
4103 | 3621 | u8* mac_addr = context; |
---|
.. | .. |
---|
4118 | 3636 | break; |
---|
4119 | 3637 | case WL_EXT_STATUS_AP_ENABLING: |
---|
4120 | 3638 | #ifdef RESTART_AP_WAR |
---|
4121 | | - 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); |
---|
4122 | 3640 | #endif /* RESTART_AP_WAR */ |
---|
4123 | 3641 | break; |
---|
4124 | 3642 | case WL_EXT_STATUS_AP_ENABLED: |
---|
4125 | 3643 | #ifdef RESTART_AP_WAR |
---|
4126 | | - wl_timer_mod(dhd, &cur_if->restart_ap_timer, 0); |
---|
| 3644 | + wl_ext_mod_timer(&cur_if->restart_ap_timer, 0, 0); |
---|
4127 | 3645 | #endif /* RESTART_AP_WAR */ |
---|
4128 | 3646 | if (cur_if->ifmode == IAP_MODE) |
---|
4129 | 3647 | dhd_conf_set_wme(dhd, cur_if->ifidx, 1); |
---|
.. | .. |
---|
4132 | 3650 | break; |
---|
4133 | 3651 | case WL_EXT_STATUS_AP_DISABLING: |
---|
4134 | 3652 | #ifdef RESTART_AP_WAR |
---|
4135 | | - wl_timer_mod(dhd, &cur_if->restart_ap_timer, 0); |
---|
| 3653 | + wl_ext_mod_timer(&cur_if->restart_ap_timer, 0, 0); |
---|
4136 | 3654 | #endif /* RESTART_AP_WAR */ |
---|
4137 | 3655 | break; |
---|
4138 | 3656 | case WL_EXT_STATUS_DELETE_STA: |
---|
.. | .. |
---|
4150 | 3668 | } |
---|
4151 | 3669 | if (wait) { |
---|
4152 | 3670 | IAPSTA_INFO(dev->name, "status=%d, ap_recon_sta=%d, waiting %dms ...\n", |
---|
4153 | | - status, cur_if->ap_recon_sta, max_wait_time); |
---|
| 3671 | + status, apsta_params->ap_recon_sta, max_wait_time); |
---|
4154 | 3672 | mutex_unlock(&apsta_params->in4way_sync); |
---|
4155 | | - timeout = wait_event_interruptible_timeout(cur_if->ap_recon_sta_event, |
---|
4156 | | - 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)); |
---|
4157 | 3675 | mutex_lock(&apsta_params->in4way_sync); |
---|
4158 | 3676 | IAPSTA_INFO(dev->name, "status=%d, ap_recon_sta=%d, timeout=%d\n", |
---|
4159 | | - status, cur_if->ap_recon_sta, timeout); |
---|
| 3677 | + status, apsta_params->ap_recon_sta, timeout); |
---|
4160 | 3678 | if (timeout > 0) { |
---|
4161 | 3679 | IAPSTA_INFO(dev->name, "skip delete STA %pM\n", mac_addr); |
---|
4162 | 3680 | ret = -1; |
---|
.. | .. |
---|
4164 | 3682 | } |
---|
4165 | 3683 | } else { |
---|
4166 | 3684 | IAPSTA_INFO(dev->name, "status=%d, ap_recon_sta=%d => 0\n", |
---|
4167 | | - status, cur_if->ap_recon_sta); |
---|
4168 | | - cur_if->ap_recon_sta = FALSE; |
---|
| 3685 | + status, apsta_params->ap_recon_sta); |
---|
| 3686 | + apsta_params->ap_recon_sta = FALSE; |
---|
4169 | 3687 | if (cur_if->ifmode == IGO_MODE) |
---|
4170 | 3688 | wl_ext_update_conn_state(dhd, cur_if->ifidx, CONN_STATE_IDLE); |
---|
4171 | 3689 | } |
---|
.. | .. |
---|
4174 | 3692 | case WL_EXT_STATUS_STA_DISCONNECTED: |
---|
4175 | 3693 | if (action & AP_WAIT_STA_RECONNECT) { |
---|
4176 | 3694 | IAPSTA_INFO(dev->name, "latest disc STA %pM ap_recon_sta=%d\n", |
---|
4177 | | - ap_disc_sta_bssid, cur_if->ap_recon_sta); |
---|
| 3695 | + ap_disc_sta_bssid, apsta_params->ap_recon_sta); |
---|
4178 | 3696 | osl_do_gettimeofday(ap_disc_sta_ts); |
---|
4179 | 3697 | memcpy(ap_disc_sta_bssid, mac_addr, ETHER_ADDR_LEN); |
---|
4180 | | - cur_if->ap_recon_sta = FALSE; |
---|
| 3698 | + apsta_params->ap_recon_sta = FALSE; |
---|
4181 | 3699 | } |
---|
4182 | 3700 | break; |
---|
4183 | 3701 | case WL_EXT_STATUS_STA_CONNECTED: |
---|
.. | .. |
---|
4187 | 3705 | if (diff_ms < max_wait_time && |
---|
4188 | 3706 | !memcmp(ap_disc_sta_bssid, mac_addr, ETHER_ADDR_LEN)) { |
---|
4189 | 3707 | IAPSTA_INFO(dev->name, "status=%d, ap_recon_sta=%d => 1\n", |
---|
4190 | | - status, cur_if->ap_recon_sta); |
---|
4191 | | - cur_if->ap_recon_sta = TRUE; |
---|
4192 | | - 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); |
---|
4193 | 3711 | } else { |
---|
4194 | | - cur_if->ap_recon_sta = FALSE; |
---|
| 3712 | + apsta_params->ap_recon_sta = FALSE; |
---|
4195 | 3713 | } |
---|
4196 | 3714 | } |
---|
4197 | 3715 | break; |
---|
.. | .. |
---|
4369 | 3887 | return maxassoc; |
---|
4370 | 3888 | } |
---|
4371 | 3889 | |
---|
4372 | | -static int |
---|
4373 | | -dev_wlc_ioctl(struct net_device *dev, int cmd, void *arg, int len) |
---|
4374 | | -{ |
---|
4375 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
4376 | | - dhd_ioctl_t ioc; |
---|
4377 | | - int8 index; |
---|
4378 | | - int ret; |
---|
4379 | | - |
---|
4380 | | - memset(&ioc, 0, sizeof(ioc)); |
---|
4381 | | - ioc.cmd = cmd; |
---|
4382 | | - ioc.buf = arg; |
---|
4383 | | - ioc.len = len; |
---|
4384 | | - |
---|
4385 | | - index = dhd_net2idx(dhd->info, dev); |
---|
4386 | | - if (index == DHD_BAD_IF) { |
---|
4387 | | - IAPSTA_ERROR(dev->name, "Bad ifidx from dev\n"); |
---|
4388 | | - return -ENODEV; |
---|
4389 | | - } |
---|
4390 | | - ret = dhd_ioctl_process(dhd, index, &ioc, arg); |
---|
4391 | | - |
---|
4392 | | - return ret; |
---|
4393 | | -} |
---|
4394 | | - |
---|
4395 | | -static void |
---|
4396 | | -wl_ampdu_dump(struct net_device *dev) |
---|
4397 | | -{ |
---|
4398 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
4399 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
4400 | | - char *ioctl_buf = apsta_params->ioctl_buf, *buf = NULL; |
---|
4401 | | - char *tx_pch_start, *tx_pch_end, *rx_pch_start, *rx_pch_end; |
---|
4402 | | - int ret = 0, max_len, tx_len, rx_len; |
---|
4403 | | - |
---|
4404 | | - if (!(android_msg_level & ANDROID_AMPDU_LEVEL)) |
---|
4405 | | - return; |
---|
4406 | | - |
---|
4407 | | - if (!ioctl_buf) |
---|
4408 | | - return; |
---|
4409 | | - |
---|
4410 | | - memset(ioctl_buf, 0, WL_DUMP_BUF_LEN); |
---|
4411 | | - ret = bcm_mkiovar("dump", "ampdu", strlen("ampdu"), ioctl_buf, WL_DUMP_BUF_LEN); |
---|
4412 | | - if (ret == 0) { |
---|
4413 | | - goto exit; |
---|
4414 | | - } |
---|
4415 | | - ret = dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)ioctl_buf, WL_DUMP_BUF_LEN); |
---|
4416 | | - if (ret) { |
---|
4417 | | - goto exit; |
---|
4418 | | - } |
---|
4419 | | - |
---|
4420 | | - buf = kmalloc(WLC_IOCTL_MEDLEN, GFP_KERNEL); |
---|
4421 | | - if (buf == NULL) { |
---|
4422 | | - IAPSTA_ERROR(dev->name, "Failed to allocate buffer of %d bytes\n", WLC_IOCTL_MEDLEN); |
---|
4423 | | - goto exit; |
---|
4424 | | - } |
---|
4425 | | - memset(buf, 0, WLC_IOCTL_MEDLEN); |
---|
4426 | | - ret = bcm_mkiovar("dump_clear", "ampdu", strlen("ampdu"), buf, WLC_IOCTL_MEDLEN); |
---|
4427 | | - if (ret == 0) { |
---|
4428 | | - goto exit; |
---|
4429 | | - } |
---|
4430 | | - ret = dev_wlc_ioctl(dev, WLC_SET_VAR, (void *)buf, WLC_IOCTL_MEDLEN); |
---|
4431 | | - if (ret) { |
---|
4432 | | - goto exit; |
---|
4433 | | - } |
---|
4434 | | - |
---|
4435 | | - tx_pch_start = strstr(ioctl_buf, "TX MCS"); |
---|
4436 | | - tx_pch_end = strstr(ioctl_buf, "HEMU"); |
---|
4437 | | - rx_pch_start = strstr(ioctl_buf, "RX MCS"); |
---|
4438 | | - rx_pch_end = strstr(ioctl_buf, "RX MCS SGI"); |
---|
4439 | | - max_len = (tx_pch_end-tx_pch_start) + (rx_pch_end-rx_pch_start); |
---|
4440 | | - if (max_len > (WLC_IOCTL_MEDLEN-1)) |
---|
4441 | | - goto exit; |
---|
4442 | | - |
---|
4443 | | - tx_len = tx_pch_end - tx_pch_start; |
---|
4444 | | - rx_len = rx_pch_end - rx_pch_start; |
---|
4445 | | - |
---|
4446 | | - memset(buf, 0, WLC_IOCTL_MEDLEN); |
---|
4447 | | - memcpy(buf, tx_pch_start, tx_len); |
---|
4448 | | - memcpy(buf+tx_len, rx_pch_start, rx_len); |
---|
4449 | | - WL_MSG(dev->name,"\n%s\n", buf); |
---|
4450 | | - |
---|
4451 | | -exit: |
---|
4452 | | - if (buf) |
---|
4453 | | - kfree(buf); |
---|
4454 | | -} |
---|
4455 | | - |
---|
4456 | | -static void |
---|
4457 | | -wl_btc_dump(struct net_device *dev) |
---|
4458 | | -{ |
---|
4459 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
4460 | | - int ret, val; |
---|
4461 | | - |
---|
4462 | | - if (!(android_msg_level & ANDROID_BTC_LEVEL)) |
---|
4463 | | - return; |
---|
4464 | | - |
---|
4465 | | - ret = dhd_conf_reg2args(dhd, "btc_params", FALSE, 15, &val); |
---|
4466 | | - if (!ret) |
---|
4467 | | - WL_MSG(dev->name,"btc_params15=%d\n", val); |
---|
4468 | | -} |
---|
4469 | | - |
---|
4470 | | -static void |
---|
4471 | | -wl_tvpm_dump(struct net_device *dev) |
---|
4472 | | -{ |
---|
4473 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
4474 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
4475 | | - wl_tvpm_req_t* tvpm_req = NULL; |
---|
4476 | | - size_t reqlen = sizeof(wl_tvpm_req_t) + sizeof(wl_tvpm_status_t); |
---|
4477 | | - uint8 *outbuf = apsta_params->ioctl_buf; |
---|
4478 | | - size_t outlen = WLC_IOCTL_MEDLEN; |
---|
4479 | | - wl_tvpm_status_t* status; |
---|
4480 | | - int ret, phy_temp = 0; |
---|
4481 | | - bool tvpm = FALSE, sense = FALSE; |
---|
4482 | | - |
---|
4483 | | - if (!(android_msg_level & ANDROID_TVPM_LEVEL)) |
---|
4484 | | - return; |
---|
4485 | | - |
---|
4486 | | - tvpm_req = kmalloc(reqlen, GFP_KERNEL); |
---|
4487 | | - if (tvpm_req == NULL) { |
---|
4488 | | - IAPSTA_ERROR(dev->name, "MALLOC failed\n"); |
---|
4489 | | - goto exit; |
---|
4490 | | - } |
---|
4491 | | - memset(tvpm_req, 0, reqlen); |
---|
4492 | | - |
---|
4493 | | - tvpm_req->version = TVPM_REQ_VERSION_1; |
---|
4494 | | - tvpm_req->length = reqlen; |
---|
4495 | | - tvpm_req->req_type = WL_TVPM_REQ_STATUS; |
---|
4496 | | - ret = wldev_iovar_getbuf(dev, "tvpm", tvpm_req, reqlen, outbuf, outlen, NULL); |
---|
4497 | | - status = (wl_tvpm_status_t*)outbuf; |
---|
4498 | | - if (!ret && status->enable) { |
---|
4499 | | - tvpm = TRUE; |
---|
4500 | | - } else { |
---|
4501 | | - ret = wldev_iovar_getbuf(dev, "phy_tempsense", &phy_temp, sizeof(phy_temp), |
---|
4502 | | - outbuf, outlen, NULL); |
---|
4503 | | - if (!ret) { |
---|
4504 | | - phy_temp = dtoh32(*(int*)outbuf); |
---|
4505 | | - sense = TRUE; |
---|
4506 | | - } |
---|
4507 | | - } |
---|
4508 | | - |
---|
4509 | | - if (tvpm) { |
---|
4510 | | - WL_MSG(dev->name,"temp=%3d, duty=%3d, pwrbko=%d, chains=%d\n", |
---|
4511 | | - status->temp, status->tx_dutycycle, status->tx_power_backoff, |
---|
4512 | | - status->num_active_chains); |
---|
4513 | | - } |
---|
4514 | | - else if (sense) { |
---|
4515 | | - WL_MSG(dev->name,"phy_temp=%3d\n", phy_temp); |
---|
4516 | | - } |
---|
4517 | | - |
---|
4518 | | -exit: |
---|
4519 | | - if (tvpm_req) |
---|
4520 | | - kfree(tvpm_req); |
---|
4521 | | -} |
---|
4522 | | - |
---|
4523 | 3890 | static void |
---|
4524 | 3891 | wl_phy_rssi_ant(struct net_device *dev, struct ether_addr *mac, |
---|
4525 | 3892 | char *rssi_buf, int len) |
---|
.. | .. |
---|
4570 | 3937 | static void |
---|
4571 | 3938 | wl_sta_info_dump(struct net_device *dev, struct ether_addr *mac) |
---|
4572 | 3939 | { |
---|
4573 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
4574 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
4575 | | - void *buf = apsta_params->ioctl_buf; |
---|
| 3940 | + void *buf = NULL; |
---|
4576 | 3941 | sta_info_v4_t *sta = NULL; |
---|
4577 | 3942 | char rssi_buf[16]; |
---|
4578 | 3943 | int ret; |
---|
4579 | 3944 | s32 rate = 0; |
---|
4580 | 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 | + } |
---|
4581 | 3951 | memset(rssi_buf, 0, sizeof(rssi_buf)); |
---|
4582 | 3952 | wl_phy_rssi_ant(dev, mac, rssi_buf, sizeof(rssi_buf)); |
---|
4583 | 3953 | ret = wldev_iovar_getbuf(dev, "sta_info", (const void*)mac, |
---|
.. | .. |
---|
4585 | 3955 | if (ret == 0) { |
---|
4586 | 3956 | sta = (sta_info_v4_t *)buf; |
---|
4587 | 3957 | } |
---|
4588 | | - if (sta == NULL || (sta->ver != WL_STA_VER_4 && sta->ver != WL_STA_VER_5 && |
---|
4589 | | - sta->ver != WL_STA_VER_6)) { |
---|
| 3958 | + if (sta == NULL || (sta->ver != WL_STA_VER_4 && sta->ver != WL_STA_VER_5)) { |
---|
4590 | 3959 | wldev_ioctl_get(dev, WLC_GET_RATE, &rate, sizeof(rate)); |
---|
4591 | 3960 | rate = dtoh32(rate); |
---|
4592 | 3961 | WL_MSG(dev->name, |
---|
4593 | 3962 | "mac=%pM, rssi=%s, tx_rate:%4d%2s\n", |
---|
4594 | 3963 | mac, rssi_buf, rate/2, (rate & 1) ? ".5" : ""); |
---|
4595 | 3964 | } else { |
---|
4596 | | - if (dtoh32(sta->rx_rate) != -1) { |
---|
4597 | | - WL_MSG(dev->name, |
---|
4598 | | - "mac=%pM, rssi=%s, tx_rate:%4d.%d, rx_rate:%4d.%d\n", |
---|
4599 | | - mac, rssi_buf, |
---|
4600 | | - dtoh32(sta->tx_rate)/1000, ((dtoh32(sta->tx_rate)/100)%10), |
---|
4601 | | - dtoh32(sta->rx_rate)/1000, ((dtoh32(sta->rx_rate)/100)%10)); |
---|
4602 | | - } else { |
---|
4603 | | - WL_MSG(dev->name, |
---|
4604 | | - "mac=%pM, rssi=%s, tx_rate:%4d.%d, rx_rate:%4d\n", |
---|
4605 | | - mac, rssi_buf, |
---|
4606 | | - dtoh32(sta->tx_rate)/1000, ((dtoh32(sta->tx_rate)/100)%10), |
---|
4607 | | - dtoh32(sta->rx_rate)); |
---|
4608 | | - } |
---|
| 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); |
---|
4609 | 3974 | } |
---|
4610 | 3975 | } |
---|
4611 | 3976 | |
---|
.. | .. |
---|
4698 | 4063 | } |
---|
4699 | 4064 | |
---|
4700 | 4065 | static void |
---|
4701 | | -wl_tput_monitor_handler(struct wl_if_info *cur_if, |
---|
4702 | | - 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) |
---|
4703 | 4068 | { |
---|
4704 | | - struct dhd_pub *dhd = dhd_get_pub(cur_if->dev); |
---|
4705 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
| 4069 | + struct dhd_pub *dhd = apsta_params->dhd; |
---|
4706 | 4070 | wl_tput_info_t *tput_info; |
---|
4707 | 4071 | struct wl_if_info *tmp_if; |
---|
4708 | 4072 | #ifdef WLDWDS |
---|
.. | .. |
---|
4759 | 4123 | monitor = TRUE; |
---|
4760 | 4124 | } |
---|
4761 | 4125 | } |
---|
4762 | | - if (monitor) { |
---|
4763 | | - wl_btc_dump(cur_if->dev); |
---|
4764 | | - wl_tvpm_dump(cur_if->dev); |
---|
4765 | | - wl_ampdu_dump(cur_if->dev); |
---|
4766 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, timeout); |
---|
4767 | | - } |
---|
| 4126 | + if (monitor) |
---|
| 4127 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, timeout); |
---|
4768 | 4128 | #ifdef BCMSDIO |
---|
4769 | 4129 | if (apsta_params->tput_sum >= dhd->conf->doflow_tput_thresh && dhd_doflow) { |
---|
4770 | 4130 | dhd_doflow = FALSE; |
---|
.. | .. |
---|
4780 | 4140 | else if (cur_if->ifmode == ISTA_MODE || cur_if->ifmode == IGC_MODE) { |
---|
4781 | 4141 | if (etype == WLC_E_LINK) { |
---|
4782 | 4142 | if (flags & WLC_EVENT_MSG_LINK) { |
---|
4783 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, timeout); |
---|
| 4143 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, timeout); |
---|
4784 | 4144 | } else if (!wl_ext_iapsta_other_if_enabled(cur_if->dev)) { |
---|
4785 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, 0); |
---|
| 4145 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, 0); |
---|
4786 | 4146 | } |
---|
4787 | 4147 | } |
---|
4788 | 4148 | } |
---|
.. | .. |
---|
4790 | 4150 | if ((etype == WLC_E_SET_SSID && status == WLC_E_STATUS_SUCCESS) || |
---|
4791 | 4151 | (etype == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
---|
4792 | 4152 | reason == WLC_E_REASON_INITIAL_ASSOC)) { |
---|
4793 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, timeout); |
---|
| 4153 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, timeout); |
---|
4794 | 4154 | } else if ((etype == WLC_E_LINK && reason == WLC_E_LINK_BSSCFG_DIS) || |
---|
4795 | 4155 | (etype == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
---|
4796 | 4156 | reason == WLC_E_REASON_DEAUTH)) { |
---|
4797 | 4157 | if (!wl_ext_iapsta_other_if_enabled(cur_if->dev)) { |
---|
4798 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, 0); |
---|
| 4158 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, 0); |
---|
4799 | 4159 | } |
---|
4800 | 4160 | } else if ((etype == WLC_E_ASSOC_IND || etype == WLC_E_REASSOC_IND) && |
---|
4801 | 4161 | reason == DOT11_SC_SUCCESS) { |
---|
4802 | | - wl_timer_mod(dhd, &apsta_params->monitor_timer, timeout); |
---|
| 4162 | + wl_ext_mod_timer(&apsta_params->monitor_timer, 0, timeout); |
---|
4803 | 4163 | } |
---|
4804 | 4164 | } |
---|
4805 | 4165 | } |
---|
4806 | 4166 | #endif /* TPUT_MONITOR */ |
---|
4807 | 4167 | |
---|
4808 | 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 | + |
---|
4809 | 4180 | static bool |
---|
4810 | 4181 | wl_ext_max_prio_if(struct wl_apsta_params *apsta_params, |
---|
4811 | 4182 | struct wl_if_info *cur_if) |
---|
.. | .. |
---|
4860 | 4231 | if (apsta_params->acs & ACS_DRV_BIT) { |
---|
4861 | 4232 | mutex_lock(&apsta_params->usr_sync); |
---|
4862 | 4233 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
---|
4863 | | - wl_ext_get_chan(cur_if->dev, &chan_info); |
---|
| 4234 | + wl_ext_get_chan(apsta_params, cur_if->dev, &chan_info); |
---|
4864 | 4235 | if (chan_info.chan) { |
---|
4865 | 4236 | if (chan_info.band == WLC_BAND_5G) |
---|
4866 | 4237 | cur_if->chan_info.chan = cur_if->escan->best_5g_ch; |
---|
.. | .. |
---|
4869 | 4240 | wl_ext_move_cur_channel(apsta_params, cur_if); |
---|
4870 | 4241 | if (!wl_ext_same_chan(&cur_if->chan_info, &chan_info)) { |
---|
4871 | 4242 | WL_MSG(cur_if->dev->name, "move channel %s-%d => %s-%d\n", |
---|
4872 | | - WLCBAND2STR(chan_info.band), chan_info.chan, |
---|
| 4243 | + WLCBAND2STR(chan_info->band), chan_info.chan, |
---|
4873 | 4244 | WLCBAND2STR(cur_if->chan_info.band), cur_if->chan_info.chan); |
---|
4874 | 4245 | wl_ext_if_down(apsta_params, cur_if); |
---|
4875 | 4246 | wl_ext_move_other_channel(apsta_params, cur_if); |
---|
.. | .. |
---|
4918 | 4289 | (etype == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
---|
4919 | 4290 | reason == WLC_E_REASON_INITIAL_ASSOC)) { |
---|
4920 | 4291 | // Link up |
---|
4921 | | - wl_timer_mod(dhd, &cur_if->acs_timer, acs_tmo*1000); |
---|
| 4292 | + wl_ext_mod_timer_pending(&cur_if->acs_timer, acs_tmo, 0); |
---|
4922 | 4293 | } |
---|
4923 | 4294 | else if ((etype == WLC_E_LINK && reason == WLC_E_LINK_BSSCFG_DIS) || |
---|
4924 | 4295 | (etype == WLC_E_LINK && status == WLC_E_STATUS_SUCCESS && |
---|
4925 | 4296 | reason == WLC_E_REASON_DEAUTH)) { |
---|
4926 | 4297 | // Link down |
---|
4927 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
---|
| 4298 | + wl_ext_mod_timer(&cur_if->acs_timer, 0, 0); |
---|
4928 | 4299 | cur_if->escan->autochannel = 0; |
---|
4929 | 4300 | } |
---|
4930 | 4301 | else if ((etype == WLC_E_ASSOC_IND || etype == WLC_E_REASSOC_IND) && |
---|
4931 | 4302 | reason == DOT11_SC_SUCCESS) { |
---|
4932 | 4303 | // external STA connected |
---|
4933 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
---|
| 4304 | + wl_ext_mod_timer(&cur_if->acs_timer, 0, 0); |
---|
4934 | 4305 | } |
---|
4935 | 4306 | else if (etype == WLC_E_DISASSOC_IND || |
---|
4936 | 4307 | etype == WLC_E_DEAUTH_IND || |
---|
4937 | 4308 | (etype == WLC_E_DEAUTH && reason != DOT11_RC_RESERVED)) { |
---|
4938 | 4309 | // external STA disconnected |
---|
4939 | | - wl_timer_mod(dhd, &cur_if->acs_timer, acs_tmo*1000); |
---|
| 4310 | + wl_ext_mod_timer_pending(&cur_if->acs_timer, acs_tmo, 0); |
---|
4940 | 4311 | } |
---|
4941 | 4312 | else if (etype == WLC_E_RESERVED && reason == ISAM_RC_AP_ACS) { |
---|
4942 | 4313 | // acs_tmo expired |
---|
4943 | 4314 | if (!wl_ext_assoclist_num(cur_if->dev) && |
---|
4944 | 4315 | !wl_ext_max_prio_if(apsta_params, cur_if)) { |
---|
4945 | 4316 | wl_ext_acs_scan(apsta_params, cur_if); |
---|
4946 | | - wl_timer_mod(dhd, &cur_if->acs_timer, acs_tmo*1000); |
---|
| 4317 | + wl_ext_mod_timer(&cur_if->acs_timer, acs_tmo, 0); |
---|
4947 | 4318 | } else { |
---|
4948 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
---|
| 4319 | + wl_ext_mod_timer(&cur_if->acs_timer, 0, 0); |
---|
4949 | 4320 | } |
---|
4950 | 4321 | } |
---|
4951 | 4322 | else if (((etype == WLC_E_ESCAN_RESULT && status == WLC_E_STATUS_SUCCESS) || |
---|
.. | .. |
---|
4959 | 4330 | !wl_ext_max_prio_if(apsta_params, cur_if)) { |
---|
4960 | 4331 | wl_ext_acs(apsta_params, cur_if); |
---|
4961 | 4332 | } else { |
---|
4962 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
---|
| 4333 | + wl_ext_mod_timer(&cur_if->acs_timer, 0, 0); |
---|
4963 | 4334 | } |
---|
4964 | 4335 | } |
---|
4965 | 4336 | } |
---|
.. | .. |
---|
4969 | 4340 | wl_acs_detach(struct wl_if_info *cur_if) |
---|
4970 | 4341 | { |
---|
4971 | 4342 | IAPSTA_TRACE(cur_if->dev->name, "Enter\n"); |
---|
4972 | | - wl_timer_deregister(cur_if->dev, &cur_if->acs_timer); |
---|
| 4343 | + del_timer_sync(&cur_if->acs_timer); |
---|
4973 | 4344 | if (cur_if->escan) { |
---|
4974 | 4345 | cur_if->escan = NULL; |
---|
4975 | 4346 | } |
---|
.. | .. |
---|
4980 | 4351 | { |
---|
4981 | 4352 | IAPSTA_TRACE(cur_if->dev->name, "Enter\n"); |
---|
4982 | 4353 | cur_if->escan = dhd->escan; |
---|
4983 | | - 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); |
---|
4984 | 4355 | } |
---|
4985 | 4356 | #endif /* ACS_MONITOR */ |
---|
4986 | 4357 | |
---|
.. | .. |
---|
5023 | 4394 | WL_MSG(cur_if->ifname, "restart AP\n"); |
---|
5024 | 4395 | wl_ext_if_down(apsta_params, cur_if); |
---|
5025 | 4396 | wl_ext_if_up(apsta_params, cur_if, FALSE, 1); |
---|
5026 | | - 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); |
---|
5027 | 4398 | } else { |
---|
5028 | 4399 | WL_MSG(cur_if->ifname, "skip restart AP\n"); |
---|
5029 | 4400 | } |
---|
.. | .. |
---|
5112 | 4483 | { |
---|
5113 | 4484 | struct dhd_pub *dhd = dhd_get_pub(cur_if->dev); |
---|
5114 | 4485 | struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
5115 | | - char *iovar_buf = apsta_params->ioctl_buf; |
---|
| 4486 | + char *iovar_buf = NULL; |
---|
5116 | 4487 | uint32 corerev = 0; |
---|
5117 | 4488 | wl_cnt_info_t *cntinfo; |
---|
5118 | 4489 | uint16 ver; |
---|
5119 | 4490 | int ret = 0; |
---|
5120 | 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); |
---|
5121 | 4500 | ret = wldev_iovar_getbuf(cur_if->dev, "counters", NULL, 0, |
---|
5122 | 4501 | iovar_buf, WLC_IOCTL_MEDLEN, NULL); |
---|
5123 | 4502 | if (unlikely(ret)) { |
---|
.. | .. |
---|
5130 | 4509 | cntinfo->datalen = dtoh16(cntinfo->datalen); |
---|
5131 | 4510 | ver = cntinfo->version; |
---|
5132 | 4511 | CHK_CNTBUF_DATALEN(iovar_buf, WLC_IOCTL_MEDLEN); |
---|
5133 | | - if (ver > WL_CNT_VERSION_XTLV) { |
---|
| 4512 | + if (ver > WL_CNT_T_VERSION) { |
---|
5134 | 4513 | IAPSTA_ERROR(cur_if->ifname, |
---|
5135 | 4514 | "Incorrect version of counters struct: expected %d; got %d\n", |
---|
5136 | | - WL_CNT_VERSION_XTLV, ver); |
---|
| 4515 | + WL_CNT_T_VERSION, ver); |
---|
5137 | 4516 | goto exit; |
---|
5138 | 4517 | } |
---|
5139 | 4518 | |
---|
.. | .. |
---|
5161 | 4540 | } |
---|
5162 | 4541 | |
---|
5163 | 4542 | exit: |
---|
| 4543 | + if (iovar_buf) |
---|
| 4544 | + kfree(iovar_buf); |
---|
| 4545 | + |
---|
5164 | 4546 | return ret; |
---|
5165 | 4547 | } |
---|
5166 | 4548 | #endif /* RESET_AP_WAR | RXF0OVFL_REINIT_WAR */ |
---|
.. | .. |
---|
5207 | 4589 | reason == WLC_E_REASON_INITIAL_ASSOC)) { |
---|
5208 | 4590 | // Link up |
---|
5209 | 4591 | wl_ext_counters_update(cur_if, ISAM_RC_AP_RESET); |
---|
5210 | | - 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); |
---|
5211 | 4593 | } |
---|
5212 | 4594 | else if (etype == WLC_E_RESERVED && reason == ISAM_RC_AP_RESET) { |
---|
5213 | 4595 | txbcnfrm = cur_if->txbcnfrm; |
---|
.. | .. |
---|
5220 | 4602 | wl_ext_if_up(apsta_params, cur_if, FALSE, 500); |
---|
5221 | 4603 | } |
---|
5222 | 4604 | done: |
---|
5223 | | - 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); |
---|
5224 | 4606 | } |
---|
5225 | 4607 | } |
---|
5226 | 4608 | return; |
---|
.. | .. |
---|
5268 | 4650 | (etype == WLC_E_LINK) && (flags & WLC_EVENT_MSG_LINK)) { |
---|
5269 | 4651 | // Link up |
---|
5270 | 4652 | wl_ext_counters_update(cur_if, ISAM_RC_RXF0OVFL_REINIT); |
---|
5271 | | - wl_timer_mod(dhd, &apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT); |
---|
| 4653 | + wl_ext_mod_timer(&apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT, 0); |
---|
5272 | 4654 | } |
---|
5273 | 4655 | else if ((cur_if->ifmode == IAP_MODE) && |
---|
5274 | 4656 | ((etype == WLC_E_SET_SSID && status == WLC_E_STATUS_SUCCESS) || |
---|
.. | .. |
---|
5276 | 4658 | reason == WLC_E_REASON_INITIAL_ASSOC))) { |
---|
5277 | 4659 | // Link up |
---|
5278 | 4660 | wl_ext_counters_update(cur_if, ISAM_RC_RXF0OVFL_REINIT); |
---|
5279 | | - wl_timer_mod(dhd, &apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT); |
---|
| 4661 | + wl_ext_mod_timer(&apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT, 0); |
---|
5280 | 4662 | } |
---|
5281 | 4663 | else if ((etype == WLC_E_RESERVED) && (reason == ISAM_RC_RXF0OVFL_REINIT) && |
---|
5282 | 4664 | (wl_ext_iapsta_other_if_enabled(cur_if->dev))) { |
---|
.. | .. |
---|
5305 | 4687 | wl_ext_ioctl(cur_if->dev, WLC_INIT, NULL, 0, 1); |
---|
5306 | 4688 | } |
---|
5307 | 4689 | done: |
---|
5308 | | - wl_timer_mod(dhd, &apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT); |
---|
| 4690 | + wl_ext_mod_timer(&apsta_params->rxf0ovfl_timer, RXF0OVFL_POLLING_TIMEOUT, 0); |
---|
5309 | 4691 | } |
---|
5310 | 4692 | |
---|
5311 | 4693 | return; |
---|
.. | .. |
---|
5313 | 4695 | #endif /* RXF0OVFL_REINIT_WAR */ |
---|
5314 | 4696 | |
---|
5315 | 4697 | void |
---|
5316 | | -wl_ext_iapsta_link(struct wl_if_info *cur_if, |
---|
| 4698 | +wl_ext_iapsta_event(struct net_device *dev, void *argu, |
---|
5317 | 4699 | const wl_event_msg_t *e, void *data) |
---|
5318 | 4700 | { |
---|
5319 | | - struct dhd_pub *dhd = dhd_get_pub(cur_if->dev); |
---|
5320 | | - 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 */ |
---|
5321 | 4708 | uint32 event_type = ntoh32(e->event_type); |
---|
5322 | 4709 | uint32 status = ntoh32(e->status); |
---|
5323 | 4710 | uint32 reason = ntoh32(e->reason); |
---|
5324 | 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 | + } |
---|
5325 | 4728 | |
---|
5326 | 4729 | if (cur_if->ifmode == ISTA_MODE || cur_if->ifmode == IGC_MODE) { |
---|
5327 | 4730 | if (event_type == WLC_E_LINK) { |
---|
.. | .. |
---|
5334 | 4737 | wl_ext_net_setcarrier(cur_if, FALSE, FALSE); |
---|
5335 | 4738 | #endif /* SET_CARRIER */ |
---|
5336 | 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 */ |
---|
5337 | 4744 | } else { |
---|
5338 | 4745 | WL_MSG(cur_if->ifname, "[%c] Link UP with %pM\n", |
---|
5339 | 4746 | cur_if->prefix, &e->addr); |
---|
.. | .. |
---|
5341 | 4748 | wl_ext_net_setcarrier(cur_if, TRUE, FALSE); |
---|
5342 | 4749 | #endif /* SET_CARRIER */ |
---|
5343 | 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 */ |
---|
5344 | 4755 | } |
---|
5345 | 4756 | wl_clr_isam_status(cur_if, STA_CONNECTING); |
---|
5346 | 4757 | wake_up_interruptible(&apsta_params->netif_change_event); |
---|
5347 | 4758 | #ifdef PROPTX_MAXCOUNT |
---|
5348 | | - wl_ext_update_wlfc_maxcount(dhd); |
---|
| 4759 | + wl_ext_update_wlfc_maxcount(apsta_params->dhd); |
---|
5349 | 4760 | #endif /* PROPTX_MAXCOUNT */ |
---|
5350 | 4761 | } |
---|
5351 | 4762 | else if (event_type == WLC_E_SET_SSID && status != WLC_E_STATUS_SUCCESS) { |
---|
.. | .. |
---|
5354 | 4765 | event_type, reason, status); |
---|
5355 | 4766 | wl_clr_isam_status(cur_if, STA_CONNECTING); |
---|
5356 | 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 */ |
---|
5357 | 4772 | #ifdef PROPTX_MAXCOUNT |
---|
5358 | | - wl_ext_update_wlfc_maxcount(dhd); |
---|
| 4773 | + wl_ext_update_wlfc_maxcount(apsta_params->dhd); |
---|
5359 | 4774 | #endif /* PROPTX_MAXCOUNT */ |
---|
5360 | 4775 | } |
---|
5361 | 4776 | else if (event_type == WLC_E_DEAUTH || event_type == WLC_E_DEAUTH_IND || |
---|
.. | .. |
---|
5366 | 4781 | #ifdef SET_CARRIER |
---|
5367 | 4782 | wl_ext_net_setcarrier(cur_if, FALSE, FALSE); |
---|
5368 | 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 */ |
---|
5369 | 4788 | } |
---|
5370 | 4789 | } |
---|
5371 | 4790 | else if (cur_if->ifmode == IAP_MODE || cur_if->ifmode == IGO_MODE || |
---|
.. | .. |
---|
5387 | 4806 | wl_ext_net_setcarrier(cur_if, TRUE, FALSE); |
---|
5388 | 4807 | #endif /* SET_CARRIER */ |
---|
5389 | 4808 | #ifdef PROPTX_MAXCOUNT |
---|
5390 | | - wl_ext_update_wlfc_maxcount(dhd); |
---|
| 4809 | + wl_ext_update_wlfc_maxcount(apsta_params->dhd); |
---|
5391 | 4810 | #endif /* PROPTX_MAXCOUNT */ |
---|
5392 | 4811 | } |
---|
5393 | 4812 | else if ((event_type == WLC_E_LINK && reason == WLC_E_LINK_BSSCFG_DIS) || |
---|
.. | .. |
---|
5400 | 4819 | wl_ext_net_setcarrier(cur_if, FALSE, FALSE); |
---|
5401 | 4820 | #endif /* SET_CARRIER */ |
---|
5402 | 4821 | #ifdef PROPTX_MAXCOUNT |
---|
5403 | | - wl_ext_update_wlfc_maxcount(dhd); |
---|
| 4822 | + wl_ext_update_wlfc_maxcount(apsta_params->dhd); |
---|
5404 | 4823 | #endif /* PROPTX_MAXCOUNT */ |
---|
5405 | 4824 | } |
---|
5406 | 4825 | else if ((event_type == WLC_E_ASSOC_IND || event_type == WLC_E_REASSOC_IND) && |
---|
.. | .. |
---|
5418 | 4837 | event_type, reason); |
---|
5419 | 4838 | wl_ext_isam_status(cur_if->dev, NULL, 0); |
---|
5420 | 4839 | } |
---|
5421 | | - } |
---|
5422 | | -} |
---|
5423 | | - |
---|
5424 | | -void |
---|
5425 | | -wl_ext_iapsta_event(struct net_device *dev, void *argu, |
---|
5426 | | - const wl_event_msg_t *e, void *data) |
---|
5427 | | -{ |
---|
5428 | | -#ifdef ACS_MONITOR |
---|
5429 | | - struct wl_apsta_params *apsta_params = (struct wl_apsta_params *)argu; |
---|
5430 | | -#endif /* ACS_MONITOR */ |
---|
5431 | | - struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
5432 | | - struct wl_if_info *cur_if = NULL; |
---|
5433 | | - |
---|
5434 | | - cur_if = wl_get_cur_if(dev); |
---|
5435 | | - if (!cur_if || !cur_if->dev) { |
---|
5436 | | - IAPSTA_DBG(dev->name, "ifidx %d is not ready\n", e->ifidx); |
---|
5437 | | - 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 */ |
---|
5438 | 4844 | } |
---|
5439 | 4845 | |
---|
5440 | | - wl_ext_iapsta_link(cur_if, e, data); |
---|
5441 | 4846 | #ifdef TPUT_MONITOR |
---|
5442 | | - if (dhd->conf->tput_monitor_ms) |
---|
5443 | | - 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); |
---|
5444 | 4849 | #endif /* TPUT_MONITOR */ |
---|
5445 | 4850 | |
---|
5446 | | -#if defined(WLMESH) && defined(WL_ESCAN) |
---|
5447 | | - wl_mesh_event_handler(cur_if, e, data); |
---|
5448 | | -#endif /* WLMESH && WL_ESCAN */ |
---|
5449 | 4851 | #ifdef ACS_MONITOR |
---|
5450 | 4852 | if ((apsta_params->acs & ACS_DRV_BIT) && apsta_params->acs_tmo) |
---|
5451 | 4853 | wl_acs_handler(cur_if, e, data); |
---|
.. | .. |
---|
5453 | 4855 | #ifdef EAPOL_RESEND |
---|
5454 | 4856 | wl_resend_eapol_handler(cur_if, e, data); |
---|
5455 | 4857 | #endif /* EAPOL_RESEND */ |
---|
5456 | | -#ifdef KEY_INSTALL_CHECK |
---|
5457 | | - wl_ext_key_install_handler(cur_if, e, data); |
---|
5458 | | -#endif /* KEY_INSTALL_CHECK */ |
---|
5459 | 4858 | #ifdef RESTART_AP_WAR |
---|
5460 | 4859 | wl_ext_restart_ap_handler(cur_if, e, data); |
---|
5461 | 4860 | #endif /* RESTART_AP_WAR */ |
---|
.. | .. |
---|
5707 | 5106 | cur_if->vsdb = FALSE; |
---|
5708 | 5107 | cur_if->prefix = 'M'; |
---|
5709 | 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 */ |
---|
5710 | 5113 | #endif /* WLMESH */ |
---|
5711 | 5114 | } |
---|
5712 | 5115 | } |
---|
.. | .. |
---|
5814 | 5217 | } |
---|
5815 | 5218 | #endif /* WLMESH */ |
---|
5816 | 5219 | |
---|
| 5220 | + wl_ext_get_ioctl_ver(dev, &apsta_params->ioctl_ver); |
---|
5817 | 5221 | apsta_params->init = TRUE; |
---|
5818 | 5222 | |
---|
5819 | 5223 | WL_MSG(dev->name, "apstamode=%d\n", apstamode); |
---|
.. | .. |
---|
5987 | 5391 | } |
---|
5988 | 5392 | |
---|
5989 | 5393 | memset(&chan_info, 0, sizeof(struct wl_chan_info)); |
---|
5990 | | - wl_ext_get_chan(cur_if->dev, &chan_info); |
---|
| 5394 | + wl_ext_get_chan(apsta_params, cur_if->dev, &chan_info); |
---|
5991 | 5395 | if (chan_info.chan) { |
---|
5992 | 5396 | IAPSTA_INFO(cur_if->ifname, "Associated\n"); |
---|
5993 | 5397 | if (!wl_ext_same_chan(&cur_if->chan_info, &chan_info)) { |
---|
.. | .. |
---|
6032 | 5436 | } |
---|
6033 | 5437 | |
---|
6034 | 5438 | wl_ext_set_amode(cur_if); |
---|
6035 | | - wl_ext_set_emode(cur_if); |
---|
| 5439 | + wl_ext_set_emode(apsta_params, cur_if); |
---|
6036 | 5440 | |
---|
6037 | 5441 | if (cur_if->ifmode == ISTA_MODE) { |
---|
6038 | 5442 | conn_info.bssidx = cur_if->bssidx; |
---|
.. | .. |
---|
6163 | 5567 | wl_ext_isam_dev_status(struct net_device *dev, ifmode_t ifmode, char prefix, |
---|
6164 | 5568 | char *dump_buf, int dump_len) |
---|
6165 | 5569 | { |
---|
| 5570 | + struct dhd_pub *dhd = dhd_get_pub(dev); |
---|
| 5571 | + struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
6166 | 5572 | struct wl_chan_info chan_info; |
---|
6167 | 5573 | wlc_ssid_t ssid = { 0, {0} }; |
---|
6168 | 5574 | struct ether_addr bssid; |
---|
.. | .. |
---|
6179 | 5585 | if (wl_ext_associated(dev)) { |
---|
6180 | 5586 | wl_ext_ioctl(dev, WLC_GET_SSID, &ssid, sizeof(ssid), 0); |
---|
6181 | 5587 | wldev_ioctl(dev, WLC_GET_BSSID, &bssid, sizeof(bssid), 0); |
---|
6182 | | - wldev_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t), 0); |
---|
6183 | | - 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); |
---|
6184 | 5591 | wl_ext_get_sec(dev, ifmode, sec, sizeof(sec), FALSE); |
---|
6185 | 5592 | dump_written += snprintf(dump_buf+dump_written, dump_len, |
---|
6186 | 5593 | "\n" DHD_LOG_PREFIXS "[%s-%c]: bssid=%pM, chan=%s-%-3d(0x%x %sMHz), " |
---|
.. | .. |
---|
6301 | 5708 | if (apsta_params->acs_tmo != acs_tmo) { |
---|
6302 | 5709 | apsta_params->acs_tmo = acs_tmo; |
---|
6303 | 5710 | WL_MSG(dev->name, "acs_timer reset to %d\n", acs_tmo); |
---|
6304 | | - wl_timer_mod(dhd, &cur_if->acs_timer, 0); |
---|
| 5711 | + wl_ext_mod_timer(&cur_if->acs_timer, acs_tmo, 0); |
---|
6305 | 5712 | } |
---|
6306 | 5713 | ret = 0; |
---|
6307 | 5714 | } else { |
---|
.. | .. |
---|
6618 | 6025 | } |
---|
6619 | 6026 | // fix me: how to check it's ISTAAP_MODE or IDUALAP_MODE? |
---|
6620 | 6027 | |
---|
| 6028 | + wl_ext_get_ioctl_ver(dev, &apsta_params->ioctl_ver); |
---|
6621 | 6029 | WL_MSG(dev->name, "apstamode=%d\n", apsta_params->apstamode); |
---|
6622 | 6030 | |
---|
6623 | 6031 | for (i=0; i<MAX_IF_NUM; i++) { |
---|
.. | .. |
---|
6704 | 6112 | if (dhd->conf->fw_type == FW_TYPE_MESH) { |
---|
6705 | 6113 | apsta_params->csa |= (CSA_FW_BIT | CSA_DRV_BIT); |
---|
6706 | 6114 | } |
---|
6707 | | - cur_if->ifmode = ISTA_MODE; |
---|
6708 | | - cur_if->prio = PRIO_STA; |
---|
6709 | | - cur_if->vsdb = TRUE; |
---|
6710 | | - cur_if->prefix = 'S'; |
---|
6711 | 6115 | if (dhd->conf->vndr_ie_assocreq && strlen(dhd->conf->vndr_ie_assocreq)) |
---|
6712 | 6116 | wl_ext_add_del_ie(net, VNDR_IE_ASSOCREQ_FLAG, dhd->conf->vndr_ie_assocreq, "add"); |
---|
6713 | 6117 | } else { |
---|
.. | .. |
---|
6867 | 6271 | } |
---|
6868 | 6272 | #endif /* WLDWDS */ |
---|
6869 | 6273 | |
---|
6870 | | -static void |
---|
6871 | | -wl_ext_iapsta_init_priv(struct net_device *net) |
---|
6872 | | -{ |
---|
6873 | | - struct dhd_pub *dhd = dhd_get_pub(net); |
---|
6874 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
6875 | | - |
---|
6876 | | - if (!apsta_params->ioctl_buf) { |
---|
6877 | | - apsta_params->ioctl_buf = kmalloc(WL_DUMP_BUF_LEN, GFP_KERNEL); |
---|
6878 | | - if (unlikely(!apsta_params->ioctl_buf)) { |
---|
6879 | | - IAPSTA_ERROR(net->name, "Can not allocate ioctl_buf\n"); |
---|
6880 | | - } |
---|
6881 | | - } |
---|
6882 | | - init_waitqueue_head(&apsta_params->netif_change_event); |
---|
6883 | | - mutex_init(&apsta_params->usr_sync); |
---|
6884 | | - mutex_init(&apsta_params->in4way_sync); |
---|
6885 | | -#ifdef STA_MGMT |
---|
6886 | | - INIT_LIST_HEAD(&apsta_params->sta_list); |
---|
6887 | | -#endif /* STA_MGMT */ |
---|
6888 | | -#ifdef EAPOL_RESEND |
---|
6889 | | - spin_lock_init(&apsta_params->eapol_lock); |
---|
6890 | | -#endif /* EAPOL_RESEND */ |
---|
6891 | | -} |
---|
6892 | | - |
---|
6893 | | -static void |
---|
6894 | | -wl_ext_iapsta_deinit_priv(struct net_device *net) |
---|
6895 | | -{ |
---|
6896 | | - struct dhd_pub *dhd = dhd_get_pub(net); |
---|
6897 | | - struct wl_apsta_params *apsta_params = dhd->iapsta_params; |
---|
6898 | | - |
---|
6899 | | - if (apsta_params->ioctl_buf) { |
---|
6900 | | - kfree(apsta_params->ioctl_buf); |
---|
6901 | | - apsta_params->ioctl_buf = NULL; |
---|
6902 | | - } |
---|
6903 | | - memset(apsta_params, 0, sizeof(struct wl_apsta_params)); |
---|
6904 | | -} |
---|
6905 | | - |
---|
6906 | 6274 | int |
---|
6907 | 6275 | wl_ext_iapsta_attach_netdev(struct net_device *net, int ifidx, uint8 bssidx) |
---|
6908 | 6276 | { |
---|
.. | .. |
---|
6914 | 6282 | IAPSTA_TRACE(net->name, "ifidx=%d, bssidx=%d\n", ifidx, bssidx); |
---|
6915 | 6283 | cur_if = &apsta_params->if_info[ifidx]; |
---|
6916 | 6284 | } |
---|
6917 | | - |
---|
6918 | 6285 | if (ifidx == 0) { |
---|
6919 | | - wl_ext_iapsta_init_priv(net); |
---|
6920 | | - strcpy(cur_if->ifname, net->name); |
---|
6921 | | -#ifdef TPUT_MONITOR |
---|
6922 | | - wl_timer_register(net, &apsta_params->monitor_timer, wl_tput_monitor_timer); |
---|
6923 | | -#endif /* TPUT_MONITOR */ |
---|
6924 | | -#ifdef RXF0OVFL_REINIT_WAR |
---|
6925 | | - wl_timer_register(net, &apsta_params->rxf0ovfl_timer, wl_ext_rxf0ovfl_reinit_timeout); |
---|
6926 | | -#endif /* RXF0OVFL_REINIT_WAR */ |
---|
6927 | | - } |
---|
6928 | | - |
---|
6929 | | - 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; |
---|
6930 | 6288 | cur_if->dev = net; |
---|
6931 | 6289 | cur_if->ifidx = ifidx; |
---|
6932 | 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); |
---|
6933 | 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 */ |
---|
6934 | 6312 | INIT_DELAYED_WORK(&cur_if->pm_enable_work, wl_ext_pm_work_handler); |
---|
6935 | | - 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; |
---|
6936 | 6338 | wl_ext_event_register(net, dhd, WLC_E_LAST, wl_ext_iapsta_event, |
---|
6937 | 6339 | apsta_params, PRIO_EVENT_IAPSTA); |
---|
6938 | 6340 | #if defined(WLMESH) && defined(WL_ESCAN) |
---|
6939 | | - 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 | + } |
---|
6940 | 6344 | #endif /* WLMESH && WL_ESCAN */ |
---|
6941 | 6345 | #ifdef ACS_MONITOR |
---|
6942 | 6346 | wl_acs_attach(dhd, cur_if); |
---|
6943 | 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); |
---|
6944 | 6350 | #ifdef SET_CARRIER |
---|
6945 | 6351 | wl_ext_net_setcarrier(cur_if, FALSE, TRUE); |
---|
6946 | 6352 | #endif /* SET_CARRIER */ |
---|
6947 | | - wl_timer_register(net, &cur_if->connect_timer, wl_ext_connect_timeout); |
---|
6948 | | -#if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
---|
6949 | | - wl_timer_register(net, &cur_if->reconnect_timer, wl_ext_reconnect_timeout); |
---|
6950 | | -#endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
| 6353 | + init_timer_compat(&cur_if->connect_timer, wl_ext_connect_timeout, net); |
---|
6951 | 6354 | #ifdef RESTART_AP_WAR |
---|
6952 | | - 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); |
---|
6953 | 6356 | #endif /* RESTART_AP_WAR */ |
---|
6954 | 6357 | #ifdef RESET_AP_WAR |
---|
6955 | | - 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); |
---|
6956 | 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 */ |
---|
6957 | 6363 | #ifdef EAPOL_RESEND |
---|
6958 | | - wl_timer_register(net, &cur_if->eapol_timer, wl_eapol_timer); |
---|
| 6364 | + init_timer_compat(&cur_if->eapol_timer, wl_eapol_timer, net); |
---|
6959 | 6365 | #endif /* EAPOL_RESEND */ |
---|
6960 | | -#ifdef KEY_INSTALL_CHECK |
---|
6961 | | - wl_timer_register(net, &cur_if->key_install_timer, wl_ext_key_install_timeout); |
---|
6962 | | -#endif /* KEY_INSTALL_CHECK */ |
---|
6963 | 6366 | } |
---|
6964 | 6367 | |
---|
6965 | 6368 | return 0; |
---|
.. | .. |
---|
6980 | 6383 | cur_if = &apsta_params->if_info[ifidx]; |
---|
6981 | 6384 | } |
---|
6982 | 6385 | |
---|
6983 | | - if (ifidx == 0 || (cur_if && (wl_get_isam_status(cur_if, IF_READY) || |
---|
6984 | | - wl_get_isam_status(cur_if, IF_ADDING)))) { |
---|
| 6386 | + if (ifidx == 0) { |
---|
6985 | 6387 | #ifdef EAPOL_RESEND |
---|
6986 | 6388 | wl_ext_release_eapol_txpkt(dhd, ifidx, FALSE); |
---|
6987 | 6389 | #endif /* EAPOL_RESEND */ |
---|
6988 | | -#ifdef KEY_INSTALL_CHECK |
---|
6989 | | - wl_timer_deregister(net, &cur_if->key_install_timer); |
---|
6990 | | -#endif /* KEY_INSTALL_CHECK */ |
---|
6991 | | - wl_timer_deregister(net, &cur_if->connect_timer); |
---|
| 6390 | + wl_ext_mod_timer(&cur_if->connect_timer, 0, 0); |
---|
6992 | 6391 | #if defined(WL_EXT_RECONNECT) && defined(WL_CFG80211) |
---|
6993 | | - wl_timer_deregister(net, &cur_if->reconnect_timer); |
---|
| 6392 | + wl_ext_mod_timer(&cur_if->reconnect_timer, 0, 0); |
---|
6994 | 6393 | #endif /* WL_EXT_RECONNECT && WL_CFG80211 */ |
---|
6995 | 6394 | #ifdef RESTART_AP_WAR |
---|
6996 | | - wl_timer_deregister(net, &cur_if->restart_ap_timer); |
---|
| 6395 | + wl_ext_mod_timer(&cur_if->restart_ap_timer, 0, 0); |
---|
6997 | 6396 | #endif /* RESTART_AP_WAR */ |
---|
6998 | 6397 | #ifdef RESET_AP_WAR |
---|
6999 | | - 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); |
---|
7000 | 6438 | #endif /* RESET_AP_WAR */ |
---|
7001 | 6439 | #ifdef SET_CARRIER |
---|
7002 | 6440 | wl_ext_net_setcarrier(cur_if, FALSE, FALSE); |
---|
.. | .. |
---|
7006 | 6444 | wl_acs_detach(cur_if); |
---|
7007 | 6445 | #endif /* ACS_MONITOR */ |
---|
7008 | 6446 | #if defined(WLMESH) && defined(WL_ESCAN) |
---|
7009 | | - 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 | + } |
---|
7010 | 6450 | #endif /* WLMESH && WL_ESCAN */ |
---|
7011 | 6451 | wl_ext_event_deregister(net, dhd, WLC_E_LAST, wl_ext_iapsta_event); |
---|
7012 | 6452 | #ifdef STA_MGMT |
---|
7013 | 6453 | wl_ext_flush_sta_list(net, ifidx); |
---|
7014 | 6454 | #endif /* STA_MGMT */ |
---|
7015 | 6455 | memset(cur_if, 0, sizeof(struct wl_if_info)); |
---|
7016 | | - } |
---|
7017 | | - |
---|
7018 | | - if (ifidx == 0) { |
---|
7019 | | -#ifdef RXF0OVFL_REINIT_WAR |
---|
7020 | | - wl_timer_deregister(net, &apsta_params->rxf0ovfl_timer); |
---|
7021 | | -#endif /* RXF0OVFL_REINIT_WAR */ |
---|
7022 | | -#ifdef TPUT_MONITOR |
---|
7023 | | - wl_timer_deregister(net, &apsta_params->monitor_timer); |
---|
7024 | | -#endif /* TPUT_MONITOR */ |
---|
7025 | | - wl_ext_iapsta_deinit_priv(net); |
---|
7026 | 6456 | } |
---|
7027 | 6457 | |
---|
7028 | 6458 | return 0; |
---|
.. | .. |
---|
7038 | 6468 | |
---|
7039 | 6469 | iapsta_params = kzalloc(sizeof(struct wl_apsta_params), GFP_KERNEL); |
---|
7040 | 6470 | if (unlikely(!iapsta_params)) { |
---|
7041 | | - IAPSTA_ERROR(net->name, "Can not allocate apsta_params\n"); |
---|
| 6471 | + IAPSTA_ERROR("wlan", "Could not allocate apsta_params\n"); |
---|
7042 | 6472 | return -ENOMEM; |
---|
7043 | 6473 | } |
---|
7044 | 6474 | dhd->iapsta_params = (void *)iapsta_params; |
---|
.. | .. |
---|
7054 | 6484 | IAPSTA_TRACE(net->name, "Enter\n"); |
---|
7055 | 6485 | |
---|
7056 | 6486 | if (dhd->iapsta_params) { |
---|
7057 | | - wl_ext_iapsta_deinit_priv(net); |
---|
7058 | 6487 | kfree(dhd->iapsta_params); |
---|
7059 | 6488 | dhd->iapsta_params = NULL; |
---|
7060 | 6489 | } |
---|