Search Linux Wireless

Re: [PATCH] mac80211: cancel scan_work in ieee80211_unregister_hw

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

 



On Fri, 2011-05-13 at 22:48 +0530, Rajkumar Manoharan wrote:

> These unneccesary driver calls has to be avoided. How about the following
> change to abort scan during scan loop.
> 
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index 4054399..9d18c43 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -384,11 +384,11 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
>         int i;
>         enum nl80211_channel_type orig_ct;
>  
> +       clear_bit(SDATA_STATE_RUNNING, &sdata->state);
> +
>         if (local->scan_sdata == sdata)
>                 ieee80211_scan_cancel(local);
>  
> -       clear_bit(SDATA_STATE_RUNNING, &sdata->state);
> -
>         /*
>          * Stop TX on this interface first.
>          */
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index ea44a8e..6353f93 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -719,6 +719,11 @@ void ieee80211_scan_work(struct work_struct *work)
>          * without scheduling a new work
>          */
>         do {
> +               if (!test_bit(SDATA_STATE_RUNNING, &sdata->state)) {
> +                       aborted = true;
> +                       goto out_complete;
> +               }
> +

Seems reasonable, but you should use ieee80211_sdata_running().

johannes

--
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