old mode 100644new mode 100755.. | .. |
---|
135 | 135 | void wl_cfgscan_scan_abort(struct bcm_cfg80211 *cfg); |
---|
136 | 136 | static void _wl_cfgscan_cancel_scan(struct bcm_cfg80211 *cfg); |
---|
137 | 137 | |
---|
| 138 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 139 | +void wl_cfg80211_stop_pno(struct bcm_cfg80211 *cfg, struct net_device *dev); |
---|
| 140 | +#endif /* WL_SCHED_SCAN */ |
---|
| 141 | + |
---|
138 | 142 | #ifdef ESCAN_CHANNEL_CACHE |
---|
139 | 143 | void reset_roam_cache(struct bcm_cfg80211 *cfg); |
---|
140 | 144 | void add_roam_cache(struct bcm_cfg80211 *cfg, wl_bss_info_t *bi); |
---|
.. | .. |
---|
640 | 644 | |
---|
641 | 645 | if (cfg->autochannel && ndev) { |
---|
642 | 646 | #if defined(BSSCACHE) |
---|
643 | | - wl_ext_get_best_channel(ndev, &cfg->g_bss_cache_ctrl, |
---|
| 647 | + wl_ext_get_best_channel(ndev, &cfg->g_bss_cache_ctrl, ioctl_version, |
---|
644 | 648 | &cfg->best_2g_ch, &cfg->best_5g_ch, &cfg->best_6g_ch); |
---|
645 | 649 | #else |
---|
646 | | - wl_ext_get_best_channel(ndev, bss_list, |
---|
| 650 | + wl_ext_get_best_channel(ndev, bss_list, ioctl_version, |
---|
647 | 651 | &cfg->best_2g_ch, &cfg->best_5g_ch, &cfg->best_6g_ch); |
---|
648 | 652 | #endif |
---|
649 | 653 | } |
---|
.. | .. |
---|
2640 | 2644 | } |
---|
2641 | 2645 | |
---|
2642 | 2646 | #ifdef WL_EXT_IAPSTA |
---|
2643 | | - err = wl_ext_in4way_sync(ndev, STA_FAKE_SCAN_IN_CONNECT, WL_EXT_STATUS_SCANNING, NULL); |
---|
2644 | | - if (err) { |
---|
2645 | | - wl_event_msg_t msg; |
---|
| 2647 | + if (wl_ext_in4way_sync(ndev, STA_FAKE_SCAN_IN_CONNECT, WL_EXT_STATUS_SCANNING, NULL)) { |
---|
2646 | 2648 | mutex_lock(&cfg->scan_sync); |
---|
2647 | | - bzero(&msg, sizeof(wl_event_msg_t)); |
---|
2648 | | - msg.event_type = hton32(WLC_E_ESCAN_RESULT); |
---|
2649 | | - msg.status = hton32(WLC_E_STATUS_SUCCESS); |
---|
2650 | | - wl_cfg80211_event(ndev, &msg, NULL); |
---|
2651 | 2649 | goto scan_success; |
---|
2652 | 2650 | } |
---|
2653 | 2651 | #endif |
---|
.. | .. |
---|
2987 | 2985 | |
---|
2988 | 2986 | if (cfg->bss_list && (cfg->bss_list->count == 0)) { |
---|
2989 | 2987 | WL_INFORM_MEM(("bss list empty. report sched_scan_stop\n")); |
---|
| 2988 | + |
---|
| 2989 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 2990 | + wl_cfg80211_stop_pno(cfg, bcmcfg_to_prmry_ndev(cfg)); |
---|
| 2991 | + /* schedule the work to indicate sched scan stop to cfg layer */ |
---|
| 2992 | + schedule_delayed_work(&cfg->sched_scan_stop_work, 0); |
---|
| 2993 | +#else |
---|
2990 | 2994 | /* Indicated sched scan stopped so that user space |
---|
2991 | 2995 | * can do a full scan incase found match is empty. |
---|
2992 | 2996 | */ |
---|
2993 | 2997 | CFG80211_SCHED_SCAN_STOPPED(wiphy, cfg->sched_scan_req); |
---|
2994 | 2998 | cfg->sched_scan_req = NULL; |
---|
| 2999 | +#endif |
---|
| 3000 | + |
---|
2995 | 3001 | } |
---|
2996 | 3002 | } |
---|
2997 | 3003 | #endif /* WL_SCHED_SCAN */ |
---|
.. | .. |
---|
3932 | 3938 | #endif /* LINUX_VER > 4.11 */ |
---|
3933 | 3939 | { |
---|
3934 | 3940 | struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); |
---|
| 3941 | +#if defined (WL_SCHED_SCAN) && !defined (SCHED_SCAN_DELAYED_WORK) |
---|
3935 | 3942 | dhd_pub_t *dhdp = (dhd_pub_t *)(cfg->pub); |
---|
| 3943 | +#endif |
---|
| 3944 | + |
---|
| 3945 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 3946 | + struct net_device *pri_ndev; |
---|
| 3947 | +#endif |
---|
3936 | 3948 | |
---|
3937 | 3949 | WL_DBG(("Enter \n")); |
---|
3938 | 3950 | WL_PNO((">>> SCHED SCAN STOP\n")); |
---|
| 3951 | + |
---|
| 3952 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 3953 | + pri_ndev = bcmcfg_to_prmry_ndev(cfg); |
---|
| 3954 | + wl_cfg80211_stop_pno(cfg, dev); |
---|
| 3955 | + |
---|
| 3956 | + cancel_delayed_work(&cfg->sched_scan_stop_work); |
---|
| 3957 | +#else |
---|
3939 | 3958 | |
---|
3940 | 3959 | #if defined(BCMDONGLEHOST) |
---|
3941 | 3960 | if (dhd_dev_pno_stop_for_ssid(dev) < 0) { |
---|
.. | .. |
---|
3949 | 3968 | } |
---|
3950 | 3969 | #endif /* BCMDONGLEHOST */ |
---|
3951 | 3970 | |
---|
| 3971 | +#endif |
---|
| 3972 | + |
---|
3952 | 3973 | mutex_lock(&cfg->scan_sync); |
---|
3953 | 3974 | if (cfg->sched_scan_req) { |
---|
| 3975 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 3976 | + if (cfg->sched_scan_running && wl_get_drv_status(cfg, SCANNING, pri_ndev)) { |
---|
| 3977 | + /* If targetted escan for PNO is running, abort it */ |
---|
| 3978 | + WL_INFORM_MEM(("abort targetted escan\n")); |
---|
| 3979 | + _wl_cfgscan_cancel_scan(cfg); |
---|
| 3980 | + wl_clr_drv_status(cfg, SCANNING, pri_ndev); |
---|
| 3981 | + } else { |
---|
| 3982 | + WL_INFORM_MEM(("pno escan state:%d\n", |
---|
| 3983 | + cfg->sched_scan_running)); |
---|
| 3984 | + } |
---|
| 3985 | +#else |
---|
3954 | 3986 | WL_PNO((">>> Sched scan running. Aborting it..\n")); |
---|
3955 | 3987 | _wl_cfgscan_cancel_scan(cfg); |
---|
| 3988 | +#endif |
---|
3956 | 3989 | } |
---|
3957 | 3990 | cfg->sched_scan_req = NULL; |
---|
3958 | 3991 | cfg->sched_scan_running = FALSE; |
---|
3959 | 3992 | mutex_unlock(&cfg->scan_sync); |
---|
3960 | 3993 | |
---|
3961 | 3994 | return 0; |
---|
| 3995 | +} |
---|
| 3996 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 3997 | +void |
---|
| 3998 | +wl_cfgscan_sched_scan_stop_work(struct work_struct *work) |
---|
| 3999 | +{ |
---|
| 4000 | + struct bcm_cfg80211 *cfg = NULL; |
---|
| 4001 | + struct wiphy *wiphy = NULL; |
---|
| 4002 | + struct delayed_work *dw = to_delayed_work(work); |
---|
| 4003 | + |
---|
| 4004 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
| 4005 | + cfg = container_of(dw, struct bcm_cfg80211, sched_scan_stop_work); |
---|
| 4006 | + GCC_DIAGNOSTIC_POP(); |
---|
| 4007 | + |
---|
| 4008 | + /* Hold rtnl_lock -> scan_sync lock to be in sync with cfg80211_ops path */ |
---|
| 4009 | + rtnl_lock(); |
---|
| 4010 | + mutex_lock(&cfg->scan_sync); |
---|
| 4011 | + if (cfg->sched_scan_req) { |
---|
| 4012 | + wiphy = cfg->sched_scan_req->wiphy; |
---|
| 4013 | + /* Indicate sched scan stopped so that user space |
---|
| 4014 | + * can do a full scan incase found match is empty. |
---|
| 4015 | + */ |
---|
| 4016 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)) |
---|
| 4017 | + cfg80211_sched_scan_stopped_rtnl(wiphy, cfg->sched_scan_req->reqid); |
---|
| 4018 | +#else |
---|
| 4019 | + cfg80211_sched_scan_stopped_rtnl(wiphy); |
---|
| 4020 | +#endif /* KERNEL > 4.12.0 */ |
---|
| 4021 | + cfg->sched_scan_req = NULL; |
---|
| 4022 | + } |
---|
| 4023 | + mutex_unlock(&cfg->scan_sync); |
---|
| 4024 | + rtnl_unlock(); |
---|
| 4025 | +} |
---|
| 4026 | +#endif |
---|
| 4027 | +#endif /* WL_SCHED_SCAN */ |
---|
| 4028 | + |
---|
| 4029 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 4030 | +void |
---|
| 4031 | +wl_cfg80211_stop_pno(struct bcm_cfg80211 *cfg, struct net_device *dev) |
---|
| 4032 | +{ |
---|
| 4033 | +#if defined(BCMDONGLEHOST) |
---|
| 4034 | + dhd_pub_t *dhdp = (dhd_pub_t *)(cfg->pub); |
---|
| 4035 | + |
---|
| 4036 | + if (dhd_dev_pno_stop_for_ssid(dev) < 0) { |
---|
| 4037 | + WL_ERR(("PNO Stop for SSID failed")); |
---|
| 4038 | + } else { |
---|
| 4039 | + /* |
---|
| 4040 | + * purposefully logging here to make sure that |
---|
| 4041 | + * firmware configuration was successful |
---|
| 4042 | + */ |
---|
| 4043 | + DBG_EVENT_LOG(dhdp, WIFI_EVENT_DRIVER_PNO_REMOVE); |
---|
| 4044 | + } |
---|
| 4045 | +#endif /* BCMDONGLEHOST */ |
---|
3962 | 4046 | } |
---|
3963 | 4047 | #endif /* WL_SCHED_SCAN */ |
---|
3964 | 4048 | |
---|
.. | .. |
---|
4750 | 4834 | */ |
---|
4751 | 4835 | if (cfg->sched_scan_req) { |
---|
4752 | 4836 | WL_ERR(("sched_scan stopped\n")); |
---|
| 4837 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 4838 | + wl_cfg80211_stop_pno(cfg, bcmcfg_to_prmry_ndev(cfg)); |
---|
| 4839 | + /* schedule the work to indicate sched scan stop to cfg layer */ |
---|
| 4840 | + schedule_delayed_work(&cfg->sched_scan_stop_work, 0); |
---|
| 4841 | +#else |
---|
4753 | 4842 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)) |
---|
4754 | 4843 | cfg80211_sched_scan_stopped(wiphy, cfg->sched_scan_req->reqid); |
---|
4755 | 4844 | #else |
---|
4756 | 4845 | cfg80211_sched_scan_stopped(wiphy); |
---|
4757 | 4846 | #endif /* KERNEL > 4.11.0 */ |
---|
4758 | 4847 | cfg->sched_scan_req = NULL; |
---|
| 4848 | +#endif |
---|
4759 | 4849 | } else { |
---|
4760 | 4850 | WL_ERR(("sched scan req null!\n")); |
---|
4761 | 4851 | } |
---|
.. | .. |
---|
5564 | 5654 | } |
---|
5565 | 5655 | #endif /* ESCAN_CHANNEL_CACHE */ |
---|
5566 | 5656 | |
---|
5567 | | - WL_SCAN(("channel cnt:%d\n", info->chan_cnt)); |
---|
| 5657 | + WL_DBG_MEM(("channel cnt:%d\n", info->chan_cnt)); |
---|
5568 | 5658 | return BCME_OK; |
---|
5569 | 5659 | } |
---|
5570 | 5660 | |
---|
.. | .. |
---|
5586 | 5676 | |
---|
5587 | 5677 | s32 |
---|
5588 | 5678 | wl_cfgscan_get_band_freq_list(struct bcm_cfg80211 *cfg, int band, |
---|
5589 | | - uint32 *list, uint32 *num_channels) |
---|
| 5679 | + uint16 *list, uint32 *num_channels) |
---|
5590 | 5680 | { |
---|
5591 | 5681 | s32 err = BCME_OK; |
---|
5592 | 5682 | uint32 i, freq, list_count, count = 0; |
---|
.. | .. |
---|
5608 | 5698 | list_count = ((wl_chanspec_list_v1_t *)list)->count; |
---|
5609 | 5699 | for (i = 0; i < list_count; i++) { |
---|
5610 | 5700 | chspec = dtoh32(((wl_chanspec_list_v1_t *)list)->chspecs[i].chanspec); |
---|
5611 | | - if (!CHSPEC_IS20(chspec)) { |
---|
5612 | | - continue; |
---|
5613 | | - } |
---|
5614 | 5701 | chaninfo = dtoh32(((wl_chanspec_list_v1_t *)list)->chspecs[i].chaninfo); |
---|
5615 | 5702 | freq = wl_channel_to_frequency(wf_chspec_ctlchan(chspec), |
---|
5616 | 5703 | CHSPEC_BAND(chspec)); |
---|
5617 | 5704 | if (((band & WIFI_BAND_BG) && CHSPEC_IS2G(chspec)) || |
---|
5618 | 5705 | ((band & WIFI_BAND_6GHZ) && CHSPEC_IS6G(chspec))) { |
---|
5619 | 5706 | /* add 2g/6g channels */ |
---|
5620 | | - list[count] = freq; |
---|
| 5707 | + list[i] = freq; |
---|
5621 | 5708 | count++; |
---|
5622 | 5709 | } |
---|
5623 | 5710 | /* handle 5g separately */ |
---|
.. | .. |
---|
5632 | 5719 | continue; |
---|
5633 | 5720 | } |
---|
5634 | 5721 | |
---|
5635 | | - list[count] = freq; |
---|
| 5722 | + list[i] = freq; |
---|
5636 | 5723 | count++; |
---|
5637 | 5724 | } |
---|
5638 | 5725 | } |
---|