Search Linux Wireless

Re: [PATCH 13/20] wlcore: use link count for single-STA-PSM optimization

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

 



On Wed, 2012-11-28 at 11:42 +0200, Arik Nemtsov wrote:
> Only allow a PSM STA to congest FW memory when it is the single active
> link. Being a single STA doesn't imply a single link - there might be
> other links on other roles.
> 
> Signed-off-by: Arik Nemtsov <arik@xxxxxxxxxx>
> ---

[...]

> diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
> index 1fbee0d..28a3027 100644
> --- a/drivers/net/wireless/ti/wlcore/cmd.c
> +++ b/drivers/net/wireless/ti/wlcore/cmd.c
> @@ -328,6 +328,8 @@ int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid)
>  			wl->fw_status_2->counters.tx_lnk_free_pkts[link];
>  	wl->links[link].wlvif = wlvif;
>  	*hlid = link;
> +
> +	wl->active_link_count++;
>  	return 0;
>  }
>  
> @@ -357,6 +359,8 @@ void wl12xx_free_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid)
>  	wl->links[*hlid].wlvif = NULL;
>  
>  	*hlid = WL12XX_INVALID_LINK_ID;
> +	wl->active_link_count--;
> +	WARN_ON(wl->active_link_count < 0);

This could be WARN_ON_ONCE().  If we hit this once, it's highly likely
that we will keep hitting it later on, unless we have another bug that
would cancel this one out. ;)

I can convert this myself if you agree.

--
Luca.

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