2008/2/1, Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxxxx>: > 2008/2/1 Johannes Berg <johannes@xxxxxxxxxxxxxxxx>: > > > > > > What is cap_range and why should it be in struct wiphy? > > > > > > Its the device's frequency capability range on the bands. > > > > Well since we always need channels I decided to not have such a thing > > but rather require registering a channels array that is also used for > > bookkeeping about enabled/disabled channels etc. > > > > I guess you could add a helper function that allocates a channels array > > based on a frequency range. > > This is true but also it would be nice as it is the end points which > drivers may want > to access every now and then. I think its worth the few bytes. > > Luis Why mac80211/cfg80211 has to know about phy's channel range ? I mean driver knows it and that's all we need to create the big (unfiltered) channel array. These caps are set for some chip revisions (eg. 5210 supports only part of 5GHz band while 5111/5112 support much wider range) and only used by channel_ok during channel setup (attach), we don't have any other use for those inside the driver. Other drivers don't even need such caps because channel ranges are standard for all their chip revisions, or they get channels from firmware, or use fixed range/channel table no matter what phy supports etc. The only use i can imagine for frequency range information on mac80211/cfg80211 is that the whole channel setup is being done during wiphy setup (we provide frequency range and supported bands and mac80211/cfg80211 does the rest) but we'll have (at least for ath5k) to fill channel flags (hw_value) anyway. About the patch: You are right that we should use channel_ok in hw_channel but there is no need for that switch, channel_ok checks the channel flags (hw_value) and determines the band already (and channel flags are filled per band -CHANNEL_2GHZ/CHANNEL_5GHZ- during setup so checking channel->band or channel->hw_vallue is the same). -- GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick - 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