> > No, don't use that in any new code. It's purely for compatibility with > > drivers that aren't converted to channel contexts (yet). > > > >> In 3.9, ath9k_htc was giving me a null channel in the code below: > >> > >> chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); > >> if (chanctx_conf) > >> channel = chanctx_conf->def.chan; > >> else > >> channel = NULL; > > > > Well that of course happens if the vif isn't bound to a channel context. > > Any opinions on what to return in ethtool stats for frequency if > there is no channel context? Why even bother doing so? "iw dev" shows the frequency and channel width just fine, no? > If there is a quick way to just return whatever the hardware is > currently using, I think that is best, but if there is not > a reliable way to do this then, some hard coded default > like 0 is probably best. Well there's no such concept as "what the hardware is currently using" in this case, the channel is completely pointless when there's no channel context at all. There might be something like the current scan channel, but what value would there be in returning 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