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]

 



OnOn Wed, 11 Nov 2015 14:39:16 +0100
> Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
> > > On Wed, 2015-11-11 at 08:34 -0500, Steven Rostedt wrote:
> > 
> > > > 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?  
> > 
> > > > 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 */  
> > 
> > I'm comparing those numbers to see if there's a driver that's
> > incrementing NUM_DRIVERS but not HW_MYFLAG.
> > 
 Wed, 2015-11-11 at 09:18 -0500, Steven Rostedt wrote:
> 
> OK, I'm still a bit confused. What happens if another driver
> increments
> NUM_DRIVERS? Then the above wont be equal right? That's what you
> want?
> 

Right. Basically it'd be one of three options:
 * all compiled drivers want the flag set:
   use a static key to make the fast case "flag set"
 * no compiled driver wants the flag set:
   use a static key to make the fast case "flag unset"
 * different drivers are compiled:
   don't use a static key since we don't know which one will get used

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