On Mon, 2009-01-05 at 15:06 +0530, Vasanthakumar Thiagarajan wrote: > - if (!local->hw.conf.user_power_level) > + if (local->sw_scanning) > power = chan->max_power; > else > - power = min(chan->max_power, local->hw.conf.user_power_level); > + power = local->hw.conf.power_constr_level ? > + (chan->max_power - local->hw.conf.power_constr_level) : > + chan->max_power; I think I'd prefer that to be written as if (!scanning && power_constr_level) power = ... - ... else power = chan->max_power; Also, I don't understand the subtraction? And why are you checking only for sw scanning and not hw scanning? > +void ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata, > + u16 capab_info, u8 *pwr_constr_elem, > + u8 pwr_constr_elem_len) > +{ > + struct ieee80211_conf *conf = &sdata->local->hw.conf; > + > + if (!(capab_info & WLAN_CAPABILITY_SPECTRUM_MGMT)) > + return; > + > + /* Power constraint IE length should be 1 octet */ > + if (pwr_constr_elem_len != 1) > + return; > + > + if ((*pwr_constr_elem <= conf->channel->max_power) && > + (*pwr_constr_elem != conf->power_constr_level)) { > + conf->power_constr_level = *pwr_constr_elem; > + ieee80211_hw_config(sdata->local, 0); That needs a changed flag, no? And how does the subtraction make sense like this? The spec talks about the country element's max power, and then subtracting this, to get the local power, but if the local power was set lower than that then we shouldn't subtract even more, no? johannes
Attachment:
signature.asc
Description: This is a digitally signed message part