Search Linux Wireless

Re: [RFC 13/14] cfg80211: extend combination checking to consider channels

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

 



hi Michal,

On Mon, May 28, 2012 at 2:19 PM, Michal Kazior <michal.kazior@xxxxxxxxx> wrote:
> cfg80211_can_change_interface will soon be used
> before .start_ap, .join_mesh, .join_ibss and .auth to
> verify whether a given interface combination is
> allowed.
>
> .connect cannot be handled since the driver scans
> and connects on its own. It is up to the driver
> then to refuse a connection (with -EBUSY for
> example).
>
> Change-Id: I334c78aa9189f24fcf8829b98b7703ddde120eec
> Signed-off-by: Michal Kazior <michal.kazior@xxxxxxxxx>
> ---
[...]

> @@ -1007,7 +1007,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
>                if (rfkill_blocked(rdev->rfkill))
>                        return notifier_from_errno(-ERFKILL);
>                mutex_lock(&rdev->devlist_mtx);
> -               ret = cfg80211_can_add_interface(rdev, wdev->iftype);
> +               ret = cfg80211_can_add_interface(rdev, wdev->iftype, NULL);

you pass NULL here...

> @@ -965,9 +983,26 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
>                if (rdev->wiphy.software_iftypes & BIT(wdev_iter->iftype))
>                        continue;
>
> +               for (i = 0; i < num_max_channels; i++) {
> +                       if (!used_channels[i]) {
> +                               used_channels[i] = chan;
> +                               num_different_channels++;
> +                               break;
> +                       }
> +                       else if (used_channels[i] == chan) {
> +                               break;
> +                       }
> +               }
> +
> +               if (i == num_max_channels) {
> +                       kfree(used_channels);
> +                       return -ENOMEM;
> +               }
> +

but this code will count it as a new channel.

Eliad.
--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux