···74/* RSSI to dBm */75#define IWL39_RSSI_OFFSET 957677-#define IWL_DEFAULT_TX_POWER 0x0F78-79/*80 * EEPROM related constants, enums, and structures.81 */
···74/* RSSI to dBm */75#define IWL39_RSSI_OFFSET 95760077/*78 * EEPROM related constants, enums, and structures.79 */
-3
drivers/net/wireless/iwlegacy/iwl-4965-hw.h
···804805#define IWL4965_DEFAULT_TX_RETRY 15806807-/* Limit range of txpower output target to be between these values */808-#define IWL4965_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm: 1 milliwatt */809-810/* EEPROM */811#define IWL4965_FIRST_AMPDU_QUEUE 10812
···160 struct ieee80211_channel *geo_ch;161 struct ieee80211_rate *rates;162 int i = 0;0163164 if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||165 priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {···236237 geo_ch->flags |= ch->ht40_extension_channel;238239- if (ch->max_power_avg > priv->tx_power_device_lmt)240- priv->tx_power_device_lmt = ch->max_power_avg;241 } else {242 geo_ch->flags |= IEEE80211_CHAN_DISABLED;243 }···249 "restricted" : "valid",250 geo_ch->flags);251 }0000252253 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&254 priv->cfg->sku & IWL_SKU_A) {···1129 if (!priv->cfg->ops->lib->send_tx_power)1130 return -EOPNOTSUPP;11311132- if (tx_power < IWL4965_TX_POWER_TARGET_POWER_MIN) {01133 IWL_WARN(priv,1134- "Requested user TXPOWER %d below lower limit %d.\n",1135- tx_power,1136- IWL4965_TX_POWER_TARGET_POWER_MIN);1137 return -EINVAL;1138 }1139
···160 struct ieee80211_channel *geo_ch;161 struct ieee80211_rate *rates;162 int i = 0;163+ s8 max_tx_power = 0;164165 if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||166 priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {···235236 geo_ch->flags |= ch->ht40_extension_channel;237238+ if (ch->max_power_avg > max_tx_power)239+ max_tx_power = ch->max_power_avg;240 } else {241 geo_ch->flags |= IEEE80211_CHAN_DISABLED;242 }···248 "restricted" : "valid",249 geo_ch->flags);250 }251+252+ priv->tx_power_device_lmt = max_tx_power;253+ priv->tx_power_user_lmt = max_tx_power;254+ priv->tx_power_next = max_tx_power;255256 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&257 priv->cfg->sku & IWL_SKU_A) {···1124 if (!priv->cfg->ops->lib->send_tx_power)1125 return -EOPNOTSUPP;11261127+ /* 0 dBm mean 1 milliwatt */1128+ if (tx_power < 0) {1129 IWL_WARN(priv,1130+ "Requested user TXPOWER %d below 1 mW.\n",1131+ tx_power);01132 return -EINVAL;1133 }1134
-7
drivers/net/wireless/iwlegacy/iwl-eeprom.c
···471 flags & EEPROM_CHANNEL_RADAR))472 ? "" : "not ");473474- /* Set the tx_power_user_lmt to the highest power475- * supported by any channel */476- if (eeprom_ch_info[ch].max_power_avg >477- priv->tx_power_user_lmt)478- priv->tx_power_user_lmt =479- eeprom_ch_info[ch].max_power_avg;480-481 ch_info++;482 }483 }
···31403141 iwl_legacy_init_scan_params(priv);31423143- /* Set the tx_power_user_lmt to the lowest power level3144- * this value will get overwritten by channel max power avg3145- * from eeprom */3146- priv->tx_power_user_lmt = IWL4965_TX_POWER_TARGET_POWER_MIN;3147- priv->tx_power_next = IWL4965_TX_POWER_TARGET_POWER_MIN;3148-3149 ret = iwl_legacy_init_channel_map(priv);3150 if (ret) {3151 IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);
···31403141 iwl_legacy_init_scan_params(priv);31420000003143 ret = iwl_legacy_init_channel_map(priv);3144 if (ret) {3145 IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);