+ power = ic->ic_max_txpower;
+ if (ic->ic_bsschan && (ic->ic_bsschan != IEEE80211_CHAN_ANYC))
-+ power = min(power, ic->ic_bsschan->ic_maxpower);
++ power = min(power, (u_int16_t) ic->ic_bsschan->ic_maxpower);
+
/* txpower (128 values, but will print out only IW_MAX_TXPOWER) */
- range->num_txpower = (ic->ic_txpowlimit >= 8) ? IW_MAX_TXPOWER : ic->ic_txpowlimit;
- (IW_MAX_TXPOWER - i - 1) * step;
range->txpower_capa = IW_TXPOW_DBM;
-@@ -1382,10 +1388,8 @@ ieee80211_ioctl_siwtxpow(struct net_devi
- disabled = (fixed && vap->iv_bss->ni_txpower == 0);
+@@ -1379,13 +1385,11 @@ ieee80211_ioctl_siwtxpow(struct net_devi
+ int fixed, disabled;
+
+ fixed = (ic->ic_flags & IEEE80211_F_TXPOW_FIXED);
+- disabled = (fixed && vap->iv_bss->ni_txpower == 0);
++ disabled = (fixed && ic->ic_txpowlimit == 0);
if (rrq->disabled) {
if (!disabled) {
- if ((ic->ic_caps & IEEE80211_C_TXPMGT) == 0)
+ struct ieee80211_channel *c;
+ u_int16_t txp = ic->ic_max_txpower;
+
-+ if (ic->ic_bsschan && (ic->ic_bsschan != IEEE80211_CHAN_ANYC))
-+ txp = min(txp, ic->ic_bsschan->ic_maxpower);
++ if (ic->ic_bsschan && (ic->ic_bsschan != IEEE80211_CHAN_ANYC)) {
++ txp = min(txp, (u16) ic->ic_bsschan->ic_maxpower);
+ } else if (ic->ic_cur_txpower > 0) {
+ txp = min(txp, ic->ic_cur_txpower);
+ }