Search Linux Wireless

Re: [RFC v2 3/4] mac80211: use static keys for hw flags

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

 



On Wed, 11 Nov 2015 08:37:52 +0100
Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:

> On Wed, 2015-11-11 at 02:22 +0200, Luca Coelho wrote:
> > 
> > Now that you have all these options in Kconfig, wouldn't it be
> > possible
> > to remove the calls to the "static" ieee80211_hw_set() in the drivers
> > and somehow set all the flags that are defined in Kconfig
> > automatically?
> >   
> 
> Since Kconfig flags are global (across multiple drivers) I don't really
> see a way to do that.
> 
> I'd *love*, however, to have an "increment" in Kconfig, then I could
> get rid of the _OFF ones:
> 
> config MAC80211_NUM_DRIVERS
> 	int
> 
> config MAC80211_HW_HAS_RATE_CONTROL
> 	int
> 
> config MY_DRIVER
> 	depends on MAC80211
> 	increment MAC80211_NUM_DRIVERS
> 	increment MAC80211_HW_MYFLAG

If you don't need to check more that >0 why not just use SELECT?

-- Steve

> 
> 
> and then later
> 
> if (CONFIG_MAC80211_HW_MYFLAG == 0)
> 	/* optimise for flag OFF */
> else if (CONFIG_MAC80211_HW_MYFLAG > 0 &&
>          CONFIG_MAC80211_NUM_DRIVERS == CONFIG_MAC80211_HW_MYFLAG)
> 	/* optimise for flag ON */
> else if (CONFIG_MAC80211_HW_MYFLAG > 0)
> 	/* don't optimise */
> 
> That's far more maintainable in the long term, since each driver only
> needs to list in its Kconfig the flags it *wants*, not *all*.
> 
> Maybe I'll try to see if I can hack Kconfig to do that.
> 
> 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 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