Hi Johannes,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on mac80211-next/master]
[also build test WARNING on mac80211/master v5.9-rc5 next-20200917]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Johannes-Berg/nl80211-cfg80211-s...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: sparc64-randconfig-s032-20200917 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-201-g24bdaac6-dirty
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sparc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> net/wireless/scan.c:750:65: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected struct cfg80211_bss_ies const *ies
@@ got struct cfg80211_bss_ies const [noderef] __rcu *ies @@
> net/wireless/scan.c:750:65: sparse: expected struct cfg80211_bss_ies const *ies
> net/wireless/scan.c:750:65: sparse: got struct cfg80211_bss_ies const [noderef]
__rcu *ies
#
https://github.com/0day-ci/linux/commit/719d2dd7e36af813d8445a92a29e43b89...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Johannes-Berg/nl80211-cfg80211-support-6-GHz-scanning/20200917-222339
git checkout 719d2dd7e36af813d8445a92a29e43b899ab4c51
vim +750 net/wireless/scan.c
720
721 static int cfg80211_scan_6ghz(struct cfg80211_registered_device *rdev)
722 {
723 u8 i;
724 struct cfg80211_colocated_ap *ap;
725 int n_channels, count = 0, err;
726 struct cfg80211_scan_request *request, *rdev_req = rdev->scan_req;
727 LIST_HEAD(coloc_ap_list);
728 bool need_scan_psc;
729 const struct ieee80211_sband_iftype_data *iftd;
730
731 rdev_req->scan_6ghz = true;
732
733 if (!rdev->wiphy.bands[NL80211_BAND_6GHZ])
734 return -EOPNOTSUPP;
735
736 iftd = ieee80211_get_sband_iftype_data(rdev->wiphy.bands[NL80211_BAND_6GHZ],
737 rdev_req->wdev->iftype);
738 if (!iftd || !iftd->he_cap.has_he)
739 return -EOPNOTSUPP;
740
741 n_channels = rdev->wiphy.bands[NL80211_BAND_6GHZ]->n_channels;
742
743 if (rdev_req->flags & NL80211_SCAN_FLAG_COLOCATED_6GHZ) {
744 struct cfg80211_internal_bss *intbss;
745
746 spin_lock_bh(&rdev->bss_lock);
747 list_for_each_entry(intbss, &rdev->bss_list, list) {
748 struct cfg80211_bss *res = &intbss->pub;
749
750 count += cfg80211_parse_colocated_ap(res->ies,
751 &coloc_ap_list);
752 }
753 spin_unlock_bh(&rdev->bss_lock);
754 }
755
756 request = kzalloc(struct_size(request, channels, n_channels) +
757 sizeof(*request->scan_6ghz_params) * count,
758 GFP_KERNEL);
759 if (!request) {
760 cfg80211_free_coloc_ap_list(&coloc_ap_list);
761 return -ENOMEM;
762 }
763
764 *request = *rdev_req;
765 request->n_channels = 0;
766 request->scan_6ghz_params =
767 (void *)&request->channels[n_channels];
768
769 /*
770 * PSC channels should not be scanned if all the reported co-located APs
771 * are indicating that all APs in the same ESS are co-located
772 */
773 if (count) {
774 need_scan_psc = false;
775
776 list_for_each_entry(ap, &coloc_ap_list, list) {
777 if (!ap->colocated_ess) {
778 need_scan_psc = true;
779 break;
780 }
781 }
782 } else {
783 need_scan_psc = true;
784 }
785
786 /*
787 * add to the scan request the channels that need to be scanned
788 * regardless of the collocated APs (PSC channels or all channels
789 * in case that NL80211_SCAN_FLAG_COLOCATED_6GHZ is not set)
790 */
791 for (i = 0; i < rdev_req->n_channels; i++) {
792 if (rdev_req->channels[i]->band == NL80211_BAND_6GHZ &&
793 ((need_scan_psc &&
794 cfg80211_channel_is_psc(rdev_req->channels[i])) ||
795 !(rdev_req->flags & NL80211_SCAN_FLAG_COLOCATED_6GHZ))) {
796 cfg80211_scan_req_add_chan(request,
797 rdev_req->channels[i],
798 false);
799 }
800 }
801
802 if (!(rdev_req->flags & NL80211_SCAN_FLAG_COLOCATED_6GHZ))
803 goto skip;
804
805 list_for_each_entry(ap, &coloc_ap_list, list) {
806 bool found = false;
807 struct cfg80211_scan_6ghz_params *scan_6ghz_params =
808 &request->scan_6ghz_params[request->n_6ghz_params];
809 struct ieee80211_channel *chan =
810 ieee80211_get_channel(&rdev->wiphy, ap->center_freq);
811
812 if (!chan || chan->flags & IEEE80211_CHAN_DISABLED)
813 continue;
814
815 for (i = 0; i < rdev_req->n_channels; i++) {
816 if (rdev_req->channels[i] == chan)
817 found = true;
818 }
819
820 if (!found)
821 continue;
822
823 if (request->n_ssids > 0 &&
824 !cfg80211_find_ssid_match(ap, request))
825 continue;
826
827 cfg80211_scan_req_add_chan(request, chan, true);
828 memcpy(scan_6ghz_params->bssid, ap->bssid, ETH_ALEN);
829 scan_6ghz_params->short_ssid = ap->short_ssid;
830 scan_6ghz_params->short_ssid_valid = ap->short_ssid_valid;
831 scan_6ghz_params->unsolicited_probe = ap->unsolicited_probe;
832
833 /*
834 * If a PSC channel is added to the scan and 'need_scan_psc' is
835 * set to false, then all the APs that the scan logic is
836 * interested with on the channel are collocated and thus there
837 * is no need to perform the initial PSC channel listen.
838 */
839 if (cfg80211_channel_is_psc(chan) && !need_scan_psc)
840 scan_6ghz_params->psc_no_listen = true;
841
842 request->n_6ghz_params++;
843 }
844
845 skip:
846 cfg80211_free_coloc_ap_list(&coloc_ap_list);
847
848 if (request->n_channels) {
849 struct cfg80211_scan_request *old = rdev->int_scan_req;
850
851 rdev->int_scan_req = request;
852
853 /*
854 * If this scan follows a previous scan, save the scan start
855 * info from the first part of the scan
856 */
857 if (old)
858 rdev->int_scan_req->info = old->info;
859
860 err = rdev_scan(rdev, request);
861 if (err) {
862 rdev->int_scan_req = old;
863 kfree(request);
864 } else {
865 kfree(old);
866 }
867
868 return err;
869 }
870
871 kfree(request);
872 return -EINVAL;
873 }
874
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org