Search Linux Wireless

Re: [PATCH] cfg80211: allow scanning on specified frequencies when using wext-compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> This is a bit weird -- this way you don't report errors if the
> user specified frequencies that don't exist.

The old code did this:

Loop over all bands
   Loop over all channels
      Stick channel to scan request

I simply added this:

Loop over all bands
   Loop over all channels
      If scan-request hasn't this channel freq: continue
      Stick channel to scan request


Now, if I want to report an -EINVAL for every possibly invalid 
scan-request channel, I'd have to do this:


If scan-request has freqs:
   Loop over all scan-request freqs
      Loop over all bands
         Loop over all channels
            search for freq
   if found:
       Stick channel to scan request
   else:
       err = -EINVAL
else:
   Loop over all bands
      Loop over all channels
         Stick channel to scan request

This is considerable code-bloat for such a seldom-used function.


I'd rather do it like this:


Loop over all bands
   Loop over all channels
      If scan-request hasn't this channel freq: continue
      Stick channel to scan request
if no channels:
   err = -EINVAL

That's a compromise :-)

-- 
http://www.holgerschurig.de
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux