On Wed, Mar 19, 2014 at 10:54 AM, Michal Kazior <michal.kazior@xxxxxxxxx> wrote: > On 19 March 2014 09:43, Eliad Peller <eliad@xxxxxxxxxx> wrote: >> On Wed, Mar 19, 2014 at 10:32 AM, Michal Kazior <michal.kazior@xxxxxxxxx> wrote: >>> On 18 March 2014 17:17, Eliad Peller <eliad@xxxxxxxxxx> wrote: >>>> hi, >>>> >>>> On Tue, Mar 18, 2014 at 3:53 PM, Michal Kazior <michal.kazior@xxxxxxxxx> wrote: >>>>> The utility function has no uses yet. It is aimed >>>>> at future chanctx reservation management and >>>>> channel switching. >>>>> >>>>> Signed-off-by: Michal Kazior <michal.kazior@xxxxxxxxx> >>>>> --- >>>> [...] >>>> >>>>> +int ieee80211_max_num_channels(struct ieee80211_local *local) >>>>> +{ >>>>> + struct ieee80211_sub_if_data *sdata; >>>>> + int num[NUM_NL80211_IFTYPES] = {}; >>>>> + struct ieee80211_chanctx *ctx; >>>>> + int num_different_channels = 0; >>>>> + u8 radar_detect = 0; >>>>> + u32 max_num_different_channels = 1; >>>>> + int err; >>>>> + >>>>> + lockdep_assert_held(&local->chanctx_mtx); >>>>> + >>>>> + list_for_each_entry(ctx, &local->chanctx_list, list) { >>>>> + num_different_channels++; >>>>> + >>>> this doesn't seem correct - i think we can have multiple channel >>>> contexts with the same channel (e.g. due to exclusive mode)? >>> >>> Hmm, does it even make sense to consider chanctx mode here? >>> >> i don't think you should consider the chancx mode, but keep track of >> the used channels. >> if you have 2 different channel contexts with the same channel (e.g. >> due to exclusive mode), you have to make sure you don't count the same >> channel twice. you shouldn't care about the actual reason for it. > > I disagree. There's a reason why we have exclusive chanctx mode. > > If you insist on counting compatible chandefs you can lead to > overcommit if your exclusive chanctx bound interface decides to switch > to another channel. > ok. fair point. i guess you're right. Eliad. -- 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