Commit 3800276a authored by Joe Perches's avatar Joe Perches Committed by John W. Linville

ath: Convert ath_print(.., ATH_DBG_FATAL to ath_err

So these errors are always emitted at KERN_ERR level.
Remove ARRAY_SIZE casts, use printf type %zu
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 21a99f93
...@@ -35,9 +35,8 @@ static bool ath_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data) ...@@ -35,9 +35,8 @@ static bool ath_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
pdata = (struct ath9k_platform_data *) pdev->dev.platform_data; pdata = (struct ath9k_platform_data *) pdev->dev.platform_data;
if (off >= (ARRAY_SIZE(pdata->eeprom_data))) { if (off >= (ARRAY_SIZE(pdata->eeprom_data))) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"%s: flash read failed, offset %08x " "%s: flash read failed, offset %08x is out of range\n",
"is out of range\n",
__func__, off); __func__, off);
return false; return false;
} }
......
...@@ -173,8 +173,7 @@ static int ar5008_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan) ...@@ -173,8 +173,7 @@ static int ar5008_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
channelSel = ((freq - 704) * 2 - 3040) / 10; channelSel = ((freq - 704) * 2 - 3040) / 10;
bModeSynth = 1; bModeSynth = 1;
} else { } else {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Invalid channel %u MHz\n", freq);
"Invalid channel %u MHz\n", freq);
return -EINVAL; return -EINVAL;
} }
...@@ -206,8 +205,7 @@ static int ar5008_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan) ...@@ -206,8 +205,7 @@ static int ar5008_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
channelSel = ath9k_hw_reverse_bits((freq - 4800) / 5, 8); channelSel = ath9k_hw_reverse_bits((freq - 4800) / 5, 8);
aModeRefSel = ath9k_hw_reverse_bits(1, 2); aModeRefSel = ath9k_hw_reverse_bits(1, 2);
} else { } else {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Invalid channel %u MHz\n", freq);
"Invalid channel %u MHz\n", freq);
return -EINVAL; return -EINVAL;
} }
...@@ -448,8 +446,7 @@ static int ar5008_hw_rf_alloc_ext_banks(struct ath_hw *ah) ...@@ -448,8 +446,7 @@ static int ar5008_hw_rf_alloc_ext_banks(struct ath_hw *ah)
#define ATH_ALLOC_BANK(bank, size) do { \ #define ATH_ALLOC_BANK(bank, size) do { \
bank = kzalloc((sizeof(u32) * size), GFP_KERNEL); \ bank = kzalloc((sizeof(u32) * size), GFP_KERNEL); \
if (!bank) { \ if (!bank) { \
ath_print(common, ATH_DBG_FATAL, \ ath_err(common, "Cannot allocate RF banks\n"); \
"Cannot allocate RF banks\n"); \
return -ENOMEM; \ return -ENOMEM; \
} \ } \
} while (0); } while (0);
...@@ -879,8 +876,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah, ...@@ -879,8 +876,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,
/* Write analog registers */ /* Write analog registers */
if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) { if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) {
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah), "ar5416SetRfRegs failed\n");
"ar5416SetRfRegs failed\n");
return -EIO; return -EIO;
} }
......
...@@ -494,7 +494,7 @@ int ar9002_hw_rf_claim(struct ath_hw *ah) ...@@ -494,7 +494,7 @@ int ar9002_hw_rf_claim(struct ath_hw *ah)
case AR_RAD2122_SREV_MAJOR: case AR_RAD2122_SREV_MAJOR:
break; break;
default: default:
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah),
"Radio Chip Rev 0x%02X not supported\n", "Radio Chip Rev 0x%02X not supported\n",
val & AR_RADIO_SREV_MAJOR); val & AR_RADIO_SREV_MAJOR);
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -46,7 +46,7 @@ int ath_beaconq_config(struct ath_softc *sc) ...@@ -46,7 +46,7 @@ int ath_beaconq_config(struct ath_softc *sc)
} }
if (!ath9k_hw_set_txq_props(ah, sc->beacon.beaconq, &qi)) { if (!ath9k_hw_set_txq_props(ah, sc->beacon.beaconq, &qi)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to update h/w beacon queue parameters\n"); "Unable to update h/w beacon queue parameters\n");
return 0; return 0;
} else { } else {
...@@ -189,8 +189,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, ...@@ -189,8 +189,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
bf->bf_buf_addr = 0; bf->bf_buf_addr = 0;
ath_print(common, ATH_DBG_FATAL, ath_err(common, "dma_mapping_error on beaconing\n");
"dma_mapping_error on beaconing\n");
return NULL; return NULL;
} }
...@@ -324,8 +323,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) ...@@ -324,8 +323,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
bf->bf_buf_addr = 0; bf->bf_buf_addr = 0;
ath_print(common, ATH_DBG_FATAL, ath_err(common, "dma_mapping_error on beacon alloc\n");
"dma_mapping_error on beacon alloc\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -469,8 +467,8 @@ void ath_beacon_tasklet(unsigned long data) ...@@ -469,8 +467,8 @@ void ath_beacon_tasklet(unsigned long data)
* are still pending on the queue. * are still pending on the queue.
*/ */
if (!ath9k_hw_stoptxdma(ah, sc->beacon.beaconq)) { if (!ath9k_hw_stoptxdma(ah, sc->beacon.beaconq)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "beacon queue %u did not stop?\n",
"beacon queue %u did not stop?\n", sc->beacon.beaconq); sc->beacon.beaconq);
} }
/* NB: cabq traffic should already be queued and primed */ /* NB: cabq traffic should already be queued and primed */
......
...@@ -69,8 +69,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) ...@@ -69,8 +69,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
if (!ath9k_hw_use_flash(ah)) { if (!ath9k_hw_use_flash(ah)) {
if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET,
&magic)) { &magic)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Reading Magic # failed\n");
"Reading Magic # failed\n");
return false; return false;
} }
...@@ -90,9 +89,8 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) ...@@ -90,9 +89,8 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
eepdata++; eepdata++;
} }
} else { } else {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Invalid EEPROM Magic. " "Invalid EEPROM Magic. endianness mismatch.\n");
"endianness mismatch.\n");
return -EINVAL; return -EINVAL;
} }
} }
...@@ -163,8 +161,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) ...@@ -163,8 +161,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER || if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER ||
ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) { ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
"Bad EEPROM checksum 0x%x or revision 0x%04x\n",
sum, ah->eep_ops->get_eeprom_ver(ah)); sum, ah->eep_ops->get_eeprom_ver(ah));
return -EINVAL; return -EINVAL;
} }
......
...@@ -72,8 +72,7 @@ static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah) ...@@ -72,8 +72,7 @@ static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah)
if (!ath9k_hw_use_flash(ah)) { if (!ath9k_hw_use_flash(ah)) {
if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET,
&magic)) { &magic)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Reading Magic # failed\n");
"Reading Magic # failed\n");
return false; return false;
} }
...@@ -93,9 +92,8 @@ static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah) ...@@ -93,9 +92,8 @@ static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah)
eepdata++; eepdata++;
} }
} else { } else {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Invalid EEPROM Magic. " "Invalid EEPROM Magic. Endianness mismatch.\n");
"Endianness mismatch.\n");
return -EINVAL; return -EINVAL;
} }
} }
...@@ -160,8 +158,7 @@ static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah) ...@@ -160,8 +158,7 @@ static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah)
if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR9287_EEP_VER if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR9287_EEP_VER
|| ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) { || ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
"Bad EEPROM checksum 0x%x or revision 0x%04x\n",
sum, ah->eep_ops->get_eeprom_ver(ah)); sum, ah->eep_ops->get_eeprom_ver(ah));
return -EINVAL; return -EINVAL;
} }
......
...@@ -96,7 +96,7 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah) ...@@ -96,7 +96,7 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) { for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) {
if (!ath9k_hw_nvram_read(common, addr + ar5416_eep_start_loc, if (!ath9k_hw_nvram_read(common, addr + ar5416_eep_start_loc,
eep_data)) { eep_data)) {
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah),
"Unable to read eeprom region\n"); "Unable to read eeprom region\n");
return false; return false;
} }
...@@ -117,7 +117,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) ...@@ -117,7 +117,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
int i, addr, size; int i, addr, size;
if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
ath_print(common, ATH_DBG_FATAL, "Reading Magic # failed\n"); ath_err(common, "Reading Magic # failed\n");
return false; return false;
} }
...@@ -139,9 +139,8 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) ...@@ -139,9 +139,8 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
eepdata++; eepdata++;
} }
} else { } else {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Invalid EEPROM Magic. " "Invalid EEPROM Magic. Endianness mismatch.\n");
"Endianness mismatch.\n");
return -EINVAL; return -EINVAL;
} }
} }
...@@ -216,8 +215,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) ...@@ -216,8 +215,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER || if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER ||
ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) { ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
"Bad EEPROM checksum 0x%x or revision 0x%04x\n",
sum, ah->eep_ops->get_eeprom_ver(ah)); sum, ah->eep_ops->get_eeprom_ver(ah));
return -EINVAL; return -EINVAL;
} }
......
...@@ -103,7 +103,7 @@ static int ath_register_led(struct ath_softc *sc, struct ath_led *led, ...@@ -103,7 +103,7 @@ static int ath_register_led(struct ath_softc *sc, struct ath_led *led,
ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &led->led_cdev); ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &led->led_cdev);
if (ret) if (ret)
ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(sc->sc_ah),
"Failed to register led:%s", led->name); "Failed to register led:%s", led->name);
else else
led->registered = 1; led->registered = 1;
......
...@@ -246,7 +246,7 @@ void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv) ...@@ -246,7 +246,7 @@ void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv)
qi.tqi_cwmax = qi_be.tqi_cwmax; qi.tqi_cwmax = qi_be.tqi_cwmax;
if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) { if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) {
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah),
"Unable to update beacon queue %u!\n", qnum); "Unable to update beacon queue %u!\n", qnum);
} else { } else {
ath9k_hw_resettxqueue(ah, priv->beaconq); ath9k_hw_resettxqueue(ah, priv->beaconq);
......
...@@ -495,37 +495,31 @@ static int ath9k_init_queues(struct ath9k_htc_priv *priv) ...@@ -495,37 +495,31 @@ static int ath9k_init_queues(struct ath9k_htc_priv *priv)
priv->beaconq = ath9k_hw_beaconq_setup(priv->ah); priv->beaconq = ath9k_hw_beaconq_setup(priv->ah);
if (priv->beaconq == -1) { if (priv->beaconq == -1) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to setup BEACON xmit queue\n");
"Unable to setup BEACON xmit queue\n");
goto err; goto err;
} }
priv->cabq = ath9k_htc_cabq_setup(priv); priv->cabq = ath9k_htc_cabq_setup(priv);
if (priv->cabq == -1) { if (priv->cabq == -1) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to setup CAB xmit queue\n");
"Unable to setup CAB xmit queue\n");
goto err; goto err;
} }
if (!ath9k_htc_txq_setup(priv, WME_AC_BE)) { if (!ath9k_htc_txq_setup(priv, WME_AC_BE)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to setup xmit queue for BE traffic\n");
"Unable to setup xmit queue for BE traffic\n");
goto err; goto err;
} }
if (!ath9k_htc_txq_setup(priv, WME_AC_BK)) { if (!ath9k_htc_txq_setup(priv, WME_AC_BK)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to setup xmit queue for BK traffic\n");
"Unable to setup xmit queue for BK traffic\n");
goto err; goto err;
} }
if (!ath9k_htc_txq_setup(priv, WME_AC_VI)) { if (!ath9k_htc_txq_setup(priv, WME_AC_VI)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to setup xmit queue for VI traffic\n");
"Unable to setup xmit queue for VI traffic\n");
goto err; goto err;
} }
if (!ath9k_htc_txq_setup(priv, WME_AC_VO)) { if (!ath9k_htc_txq_setup(priv, WME_AC_VO)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to setup xmit queue for VO traffic\n");
"Unable to setup xmit queue for VO traffic\n");
goto err; goto err;
} }
...@@ -670,16 +664,15 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, ...@@ -670,16 +664,15 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
ret = ath9k_hw_init(ah); ret = ath9k_hw_init(ah);
if (ret) { if (ret) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to initialize hardware; " "Unable to initialize hardware; initialization status: %d\n",
"initialization status: %d\n", ret); ret);
goto err_hw; goto err_hw;
} }
ret = ath9k_htc_init_debug(ah); ret = ath9k_htc_init_debug(ah);
if (ret) { if (ret) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to create debugfs files\n");
"Unable to create debugfs files\n");
goto err_debug; goto err_debug;
} }
......
...@@ -152,9 +152,9 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv, ...@@ -152,9 +152,9 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
caldata = &priv->caldata[channel->hw_value]; caldata = &priv->caldata[channel->hw_value];
ret = ath9k_hw_reset(ah, hchan, caldata, fastcc); ret = ath9k_hw_reset(ah, hchan, caldata, fastcc);
if (ret) { if (ret) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to reset channel (%u Mhz) " "Unable to reset channel (%u Mhz) reset status %d\n",
"reset status %d\n", channel->center_freq, ret); channel->center_freq, ret);
goto err; goto err;
} }
...@@ -263,8 +263,9 @@ static int ath9k_htc_add_station(struct ath9k_htc_priv *priv, ...@@ -263,8 +263,9 @@ static int ath9k_htc_add_station(struct ath9k_htc_priv *priv,
WMI_CMD_BUF(WMI_NODE_CREATE_CMDID, &tsta); WMI_CMD_BUF(WMI_NODE_CREATE_CMDID, &tsta);
if (ret) { if (ret) {
if (sta) if (sta)
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to add station entry for: %pM\n", sta->addr); "Unable to add station entry for: %pM\n",
sta->addr);
return ret; return ret;
} }
...@@ -296,7 +297,7 @@ static int ath9k_htc_remove_station(struct ath9k_htc_priv *priv, ...@@ -296,7 +297,7 @@ static int ath9k_htc_remove_station(struct ath9k_htc_priv *priv,
WMI_CMD_BUF(WMI_NODE_REMOVE_CMDID, &sta_idx); WMI_CMD_BUF(WMI_NODE_REMOVE_CMDID, &sta_idx);
if (ret) { if (ret) {
if (sta) if (sta)
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to remove station entry for: %pM\n", "Unable to remove station entry for: %pM\n",
sta->addr); sta->addr);
return ret; return ret;
...@@ -390,7 +391,7 @@ static int ath9k_htc_send_rate_cmd(struct ath9k_htc_priv *priv, ...@@ -390,7 +391,7 @@ static int ath9k_htc_send_rate_cmd(struct ath9k_htc_priv *priv,
WMI_CMD_BUF(WMI_RC_RATE_UPDATE_CMDID, trate); WMI_CMD_BUF(WMI_RC_RATE_UPDATE_CMDID, trate);
if (ret) { if (ret) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to initialize Rate information on target\n"); "Unable to initialize Rate information on target\n");
} }
...@@ -895,7 +896,7 @@ static int ath9k_register_led(struct ath9k_htc_priv *priv, struct ath_led *led, ...@@ -895,7 +896,7 @@ static int ath9k_register_led(struct ath9k_htc_priv *priv, struct ath_led *led,
ret = led_classdev_register(wiphy_dev(priv->hw->wiphy), &led->led_cdev); ret = led_classdev_register(wiphy_dev(priv->hw->wiphy), &led->led_cdev);
if (ret) if (ret)
ath_print(ath9k_hw_common(priv->ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(priv->ah),
"Failed to register led:%s", led->name); "Failed to register led:%s", led->name);
else else
led->registered = 1; led->registered = 1;
...@@ -1024,9 +1025,9 @@ static void ath9k_htc_radio_enable(struct ieee80211_hw *hw) ...@@ -1024,9 +1025,9 @@ static void ath9k_htc_radio_enable(struct ieee80211_hw *hw)
/* Reset the HW */ /* Reset the HW */
ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false); ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
if (ret) { if (ret) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to reset hardware; reset status %d " "Unable to reset hardware; reset status %d (freq %u MHz)\n",
"(freq %u MHz)\n", ret, ah->curchan->channel); ret, ah->curchan->channel);
} }
ath_update_txpow(priv); ath_update_txpow(priv);
...@@ -1087,9 +1088,9 @@ static void ath9k_htc_radio_disable(struct ieee80211_hw *hw) ...@@ -1087,9 +1088,9 @@ static void ath9k_htc_radio_disable(struct ieee80211_hw *hw)
/* Reset the HW */ /* Reset the HW */
ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false); ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
if (ret) { if (ret) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to reset hardware; reset status %d " "Unable to reset hardware; reset status %d (freq %u MHz)\n",
"(freq %u MHz)\n", ret, ah->curchan->channel); ret, ah->curchan->channel);
} }
/* Disable the PHY */ /* Disable the PHY */
...@@ -1175,9 +1176,9 @@ static int ath9k_htc_start(struct ieee80211_hw *hw) ...@@ -1175,9 +1176,9 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
ath9k_hw_htc_resetinit(ah); ath9k_hw_htc_resetinit(ah);
ret = ath9k_hw_reset(ah, init_channel, ah->caldata, false); ret = ath9k_hw_reset(ah, init_channel, ah->caldata, false);
if (ret) { if (ret) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to reset hardware; reset status %d " "Unable to reset hardware; reset status %d (freq %u MHz)\n",
"(freq %u MHz)\n", ret, curchan->center_freq); ret, curchan->center_freq);
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
return ret; return ret;
} }
...@@ -1243,8 +1244,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) ...@@ -1243,8 +1244,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
/* Remove monitor interface here */ /* Remove monitor interface here */
if (ah->opmode == NL80211_IFTYPE_MONITOR) { if (ah->opmode == NL80211_IFTYPE_MONITOR) {
if (ath9k_htc_remove_monitor_interface(priv)) if (ath9k_htc_remove_monitor_interface(priv))
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to remove monitor interface\n");
"Unable to remove monitor interface\n");
else else
ath_print(common, ATH_DBG_CONFIG, ath_print(common, ATH_DBG_CONFIG,
"Monitor interface removed\n"); "Monitor interface removed\n");
...@@ -1298,7 +1298,7 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw, ...@@ -1298,7 +1298,7 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
hvif.opmode = cpu_to_be32(HTC_M_IBSS); hvif.opmode = cpu_to_be32(HTC_M_IBSS);
break; break;
default: default:
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Interface type %d not yet supported\n", vif->type); "Interface type %d not yet supported\n", vif->type);
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
goto out; goto out;
...@@ -1405,8 +1405,7 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed) ...@@ -1405,8 +1405,7 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
hw->conf.channel_type); hw->conf.channel_type);
if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) { if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to set channel\n");
"Unable to set channel\n");
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
return -EINVAL; return -EINVAL;
} }
...@@ -1426,8 +1425,7 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed) ...@@ -1426,8 +1425,7 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
if (changed & IEEE80211_CONF_CHANGE_MONITOR) { if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
if (conf->flags & IEEE80211_CONF_MONITOR) { if (conf->flags & IEEE80211_CONF_MONITOR) {
if (ath9k_htc_add_monitor_interface(priv)) if (ath9k_htc_add_monitor_interface(priv))
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Failed to set monitor mode\n");
"Failed to set monitor mode\n");
else else
ath_print(common, ATH_DBG_CONFIG, ath_print(common, ATH_DBG_CONFIG,
"HW opmode set to Monitor mode\n"); "HW opmode set to Monitor mode\n");
...@@ -1552,7 +1550,7 @@ static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, u16 queue, ...@@ -1552,7 +1550,7 @@ static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, u16 queue,
ret = ath_htc_txq_update(priv, qnum, &qi); ret = ath_htc_txq_update(priv, qnum, &qi);
if (ret) { if (ret) {
ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n"); ath_err(common, "TXQ Update failed\n");
goto out; goto out;
} }
...@@ -1764,8 +1762,7 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw, ...@@ -1764,8 +1762,7 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
spin_unlock_bh(&priv->tx_lock); spin_unlock_bh(&priv->tx_lock);
break; break;
default: default:
ath_print(ath9k_hw_common(priv->ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(priv->ah), "Unknown AMPDU action\n");
"Unknown AMPDU action\n");
} }
return ret; return ret;
......
...@@ -69,7 +69,7 @@ int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum, ...@@ -69,7 +69,7 @@ int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum,
qi.tqi_readyTime = qinfo->tqi_readyTime; qi.tqi_readyTime = qinfo->tqi_readyTime;
if (!ath9k_hw_set_txq_props(ah, qnum, &qi)) { if (!ath9k_hw_set_txq_props(ah, qnum, &qi)) {
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah),
"Unable to update hardware queue %u!\n", qnum); "Unable to update hardware queue %u!\n", qnum);
error = -EIO; error = -EIO;
} else { } else {
...@@ -296,8 +296,7 @@ void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb, ...@@ -296,8 +296,7 @@ void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb,
(ep_id == priv->data_vo_ep)) { (ep_id == priv->data_vo_ep)) {
skb_pull(skb, sizeof(struct tx_frame_hdr)); skb_pull(skb, sizeof(struct tx_frame_hdr));
} else { } else {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unsupported TX EPID: %d\n", ep_id);
"Unsupported TX EPID: %d\n", ep_id);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return; return;
} }
...@@ -337,9 +336,8 @@ bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype) ...@@ -337,9 +336,8 @@ bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype)
return false; return false;
if (qnum >= ARRAY_SIZE(priv->hwq_map)) { if (qnum >= ARRAY_SIZE(priv->hwq_map)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "qnum %u out of range, max %zu!\n",
"qnum %u out of range, max %u!\n", qnum, ARRAY_SIZE(priv->hwq_map));
qnum, (unsigned int)ARRAY_SIZE(priv->hwq_map));
ath9k_hw_releasetxqueue(ah, qnum); ath9k_hw_releasetxqueue(ah, qnum);
return false; return false;
} }
...@@ -490,8 +488,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, ...@@ -490,8 +488,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
__le16 fc; __le16 fc;
if (skb->len <= HTC_RX_FRAME_HEADER_SIZE) { if (skb->len <= HTC_RX_FRAME_HEADER_SIZE) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Corrupted RX frame, dropping\n");
"Corrupted RX frame, dropping\n");
goto rx_next; goto rx_next;
} }
...@@ -499,9 +496,8 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, ...@@ -499,9 +496,8 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
if (be16_to_cpu(rxstatus->rs_datalen) - if (be16_to_cpu(rxstatus->rs_datalen) -
(skb->len - HTC_RX_FRAME_HEADER_SIZE) != 0) { (skb->len - HTC_RX_FRAME_HEADER_SIZE) != 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Corrupted RX data len, dropping " "Corrupted RX data len, dropping (dlen: %d, skblen: %d)\n",
"(dlen: %d, skblen: %d)\n",
rxstatus->rs_datalen, skb->len); rxstatus->rs_datalen, skb->len);
goto rx_next; goto rx_next;
} }
...@@ -728,8 +724,7 @@ int ath9k_rx_init(struct ath9k_htc_priv *priv) ...@@ -728,8 +724,7 @@ int ath9k_rx_init(struct ath9k_htc_priv *priv)
for (i = 0; i < ATH9K_HTC_RXBUF; i++) { for (i = 0; i < ATH9K_HTC_RXBUF; i++) {
rxbuf = kzalloc(sizeof(struct ath9k_htc_rxbuf), GFP_KERNEL); rxbuf = kzalloc(sizeof(struct ath9k_htc_rxbuf), GFP_KERNEL);
if (rxbuf == NULL) { if (rxbuf == NULL) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to allocate RX buffers\n");
"Unable to allocate RX buffers\n");
goto err; goto err;
} }
list_add_tail(&rxbuf->list, &priv->rx.rxbuf); list_add_tail(&rxbuf->list, &priv->rx.rxbuf);
......
...@@ -211,7 +211,7 @@ u16 ath9k_hw_computetxtime(struct ath_hw *ah, ...@@ -211,7 +211,7 @@ u16 ath9k_hw_computetxtime(struct ath_hw *ah,
} }
break; break;
default: default:
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah),
"Unknown phy %u (rate ix %u)\n", phy, rateix); "Unknown phy %u (rate ix %u)\n", phy, rateix);
txTime = 0; txTime = 0;
break; break;
...@@ -331,10 +331,8 @@ static bool ath9k_hw_chip_test(struct ath_hw *ah) ...@@ -331,10 +331,8 @@ static bool ath9k_hw_chip_test(struct ath_hw *ah)
REG_WRITE(ah, addr, wrData); REG_WRITE(ah, addr, wrData);
rdData = REG_READ(ah, addr); rdData = REG_READ(ah, addr);
if (rdData != wrData) { if (rdData != wrData) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"address test failed " "address test failed addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
"addr: 0x%08x - wr:0x%08x != "
"rd:0x%08x\n",
addr, wrData, rdData); addr, wrData, rdData);
return false; return false;
} }
...@@ -344,10 +342,8 @@ static bool ath9k_hw_chip_test(struct ath_hw *ah) ...@@ -344,10 +342,8 @@ static bool ath9k_hw_chip_test(struct ath_hw *ah)
REG_WRITE(ah, addr, wrData); REG_WRITE(ah, addr, wrData);
rdData = REG_READ(ah, addr); rdData = REG_READ(ah, addr);
if (wrData != rdData) { if (wrData != rdData) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"address test failed " "address test failed addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
"addr: 0x%08x - wr:0x%08x != "
"rd:0x%08x\n",
addr, wrData, rdData); addr, wrData, rdData);
return false; return false;
} }
...@@ -476,9 +472,8 @@ static int ath9k_hw_post_init(struct ath_hw *ah) ...@@ -476,9 +472,8 @@ static int ath9k_hw_post_init(struct ath_hw *ah)
ecode = ath9k_hw_rf_alloc_ext_banks(ah); ecode = ath9k_hw_rf_alloc_ext_banks(ah);
if (ecode) { if (ecode) {
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah),
"Failed allocating banks for " "Failed allocating banks for external radio\n");
"external radio\n");
ath9k_hw_rf_free_ext_banks(ah); ath9k_hw_rf_free_ext_banks(ah);
return ecode; return ecode;
} }
...@@ -509,8 +504,7 @@ static int __ath9k_hw_init(struct ath_hw *ah) ...@@ -509,8 +504,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)
ah->hw_version.macVersion = AR_SREV_VERSION_9100; ah->hw_version.macVersion = AR_SREV_VERSION_9100;
if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) { if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Couldn't reset chip\n");
"Couldn't reset chip\n");
return -EIO; return -EIO;
} }
...@@ -520,7 +514,7 @@ static int __ath9k_hw_init(struct ath_hw *ah) ...@@ -520,7 +514,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)
ath9k_hw_attach_ops(ah); ath9k_hw_attach_ops(ah);
if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) { if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) {
ath_print(common, ATH_DBG_FATAL, "Couldn't wakeup chip\n"); ath_err(common, "Couldn't wakeup chip\n");
return -EIO; return -EIO;
} }
...@@ -545,10 +539,9 @@ static int __ath9k_hw_init(struct ath_hw *ah) ...@@ -545,10 +539,9 @@ static int __ath9k_hw_init(struct ath_hw *ah)
ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD; ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD;
if (!ath9k_hw_macversion_supported(ah)) { if (!ath9k_hw_macversion_supported(ah)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Mac Chip Rev 0x%02x.%x is not supported by " "Mac Chip Rev 0x%02x.%x is not supported by this driver\n",
"this driver\n", ah->hw_version.macVersion, ah->hw_version.macVersion, ah->hw_version.macRev);
ah->hw_version.macRev);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -594,8 +587,7 @@ static int __ath9k_hw_init(struct ath_hw *ah) ...@@ -594,8 +587,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)
r = ath9k_hw_init_macaddr(ah); r = ath9k_hw_init_macaddr(ah);
if (r) { if (r) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Failed to initialize MAC address\n");
"Failed to initialize MAC address\n");
return r; return r;
} }
...@@ -633,17 +625,16 @@ int ath9k_hw_init(struct ath_hw *ah) ...@@ -633,17 +625,16 @@ int ath9k_hw_init(struct ath_hw *ah)
default: default:
if (common->bus_ops->ath_bus_type == ATH_USB) if (common->bus_ops->ath_bus_type == ATH_USB)
break; break;
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Hardware device ID 0x%04x not supported\n",
"Hardware device ID 0x%04x not supported\n",
ah->hw_version.devid); ah->hw_version.devid);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
ret = __ath9k_hw_init(ah); ret = __ath9k_hw_init(ah);
if (ret) { if (ret) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to initialize hardware; " "Unable to initialize hardware; initialization status: %d\n",
"initialization status: %d\n", ret); ret);
return ret; return ret;
} }
...@@ -1145,8 +1136,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, ...@@ -1145,8 +1136,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
} }
if (!ath9k_hw_rfbus_req(ah)) { if (!ath9k_hw_rfbus_req(ah)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Could not kill baseband RX\n");
"Could not kill baseband RX\n");
return false; return false;
} }
...@@ -1154,8 +1144,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, ...@@ -1154,8 +1144,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
r = ath9k_hw_rf_set_freq(ah, chan); r = ath9k_hw_rf_set_freq(ah, chan);
if (r) { if (r) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Failed to set channel\n");
"Failed to set channel\n");
return false; return false;
} }
ath9k_hw_set_clockrate(ah); ath9k_hw_set_clockrate(ah);
...@@ -1287,7 +1276,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, ...@@ -1287,7 +1276,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
} }
if (!ath9k_hw_chip_reset(ah, chan)) { if (!ath9k_hw_chip_reset(ah, chan)) {
ath_print(common, ATH_DBG_FATAL, "Chip reset failed\n"); ath_err(common, "Chip reset failed\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1568,7 +1557,7 @@ static bool ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip) ...@@ -1568,7 +1557,7 @@ static bool ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip)
AR_RTC_FORCE_WAKE_EN); AR_RTC_FORCE_WAKE_EN);
} }
if (i == 0) { if (i == 0) {
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah),
"Failed to wakeup in %uus\n", "Failed to wakeup in %uus\n",
POWER_UP_TIME / 20); POWER_UP_TIME / 20);
return false; return false;
...@@ -1609,8 +1598,7 @@ bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode) ...@@ -1609,8 +1598,7 @@ bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
ath9k_set_power_network_sleep(ah, setChip); ath9k_set_power_network_sleep(ah, setChip);
break; break;
default: default:
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unknown power mode %u\n", mode);
"Unknown power mode %u\n", mode);
return false; return false;
} }
ah->power_mode = mode; ah->power_mode = mode;
...@@ -1801,8 +1789,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) ...@@ -1801,8 +1789,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
eeval = ah->eep_ops->get_eeprom(ah, EEP_OP_MODE); eeval = ah->eep_ops->get_eeprom(ah, EEP_OP_MODE);
if ((eeval & (AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A)) == 0) { if ((eeval & (AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A)) == 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"no band has been marked as supported in EEPROM.\n"); "no band has been marked as supported in EEPROM\n");
return -EINVAL; return -EINVAL;
} }
...@@ -2348,9 +2336,9 @@ struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, ...@@ -2348,9 +2336,9 @@ struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah,
timer = kzalloc(sizeof(struct ath_gen_timer), GFP_KERNEL); timer = kzalloc(sizeof(struct ath_gen_timer), GFP_KERNEL);
if (timer == NULL) { if (timer == NULL) {
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah),
"Failed to allocate memory" "Failed to allocate memory for hw timer[%d]\n",
"for hw timer[%d]\n", timer_index); timer_index);
return NULL; return NULL;
} }
......
...@@ -283,8 +283,7 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, ...@@ -283,8 +283,7 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
/* ath_desc must be a multiple of DWORDs */ /* ath_desc must be a multiple of DWORDs */
if ((desc_len % 4) != 0) { if ((desc_len % 4) != 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "ath_desc not DWORD aligned\n");
"ath_desc not DWORD aligned\n");
BUG_ON((desc_len % 4) != 0); BUG_ON((desc_len % 4) != 0);
error = -ENOMEM; error = -ENOMEM;
goto fail; goto fail;
...@@ -736,8 +735,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, ...@@ -736,8 +735,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
error = ath9k_init_debug(ah); error = ath9k_init_debug(ah);
if (error) { if (error) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to create debugfs files\n");
"Unable to create debugfs files\n");
goto error_world; goto error_world;
} }
......
...@@ -204,9 +204,8 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q) ...@@ -204,9 +204,8 @@ bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q)
wait = wait_time; wait = wait_time;
while (ath9k_hw_numtxpending(ah, q)) { while (ath9k_hw_numtxpending(ah, q)) {
if ((--wait) == 0) { if ((--wait) == 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Failed to stop TX DMA in 100 " "Failed to stop TX DMA in 100 msec after killing last frame\n");
"msec after killing last frame\n");
break; break;
} }
udelay(ATH9K_TIME_QUANTUM); udelay(ATH9K_TIME_QUANTUM);
...@@ -368,14 +367,12 @@ int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type, ...@@ -368,14 +367,12 @@ int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type,
ATH9K_TX_QUEUE_INACTIVE) ATH9K_TX_QUEUE_INACTIVE)
break; break;
if (q == pCap->total_queues) { if (q == pCap->total_queues) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "No available TX queue\n");
"No available TX queue\n");
return -1; return -1;
} }
break; break;
default: default:
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Invalid TX queue type: %u\n", type);
"Invalid TX queue type: %u\n", type);
return -1; return -1;
} }
...@@ -383,8 +380,7 @@ int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type, ...@@ -383,8 +380,7 @@ int ath9k_hw_setuptxqueue(struct ath_hw *ah, enum ath9k_tx_queue type,
qi = &ah->txq[q]; qi = &ah->txq[q];
if (qi->tqi_type != ATH9K_TX_QUEUE_INACTIVE) { if (qi->tqi_type != ATH9K_TX_QUEUE_INACTIVE) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "TX queue: %u already active\n", q);
"TX queue: %u already active\n", q);
return -1; return -1;
} }
memset(qi, 0, sizeof(struct ath9k_tx_queue_info)); memset(qi, 0, sizeof(struct ath9k_tx_queue_info));
...@@ -735,7 +731,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set) ...@@ -735,7 +731,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set)
AR_DIAG_RX_ABORT)); AR_DIAG_RX_ABORT));
reg = REG_READ(ah, AR_OBS_BUS_1); reg = REG_READ(ah, AR_OBS_BUS_1);
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(ah),
"RX failed to go idle in 10 ms RXSM=0x%x\n", "RX failed to go idle in 10 ms RXSM=0x%x\n",
reg); reg);
...@@ -791,9 +787,8 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah) ...@@ -791,9 +787,8 @@ bool ath9k_hw_stopdmarecv(struct ath_hw *ah)
} }
if (i == 0) { if (i == 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"DMA failed to stop in %d ms " "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
"AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
AH_RX_STOP_DMA_TIMEOUT / 1000, AH_RX_STOP_DMA_TIMEOUT / 1000,
REG_READ(ah, AR_CR), REG_READ(ah, AR_CR),
REG_READ(ah, AR_DIAG_SW)); REG_READ(ah, AR_DIAG_SW));
......
...@@ -268,16 +268,14 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, ...@@ -268,16 +268,14 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
r = ath9k_hw_reset(ah, hchan, caldata, fastcc); r = ath9k_hw_reset(ah, hchan, caldata, fastcc);
if (r) { if (r) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to reset channel (%u MHz), " "Unable to reset channel (%u MHz), reset status %d\n",
"reset status %d\n",
channel->center_freq, r); channel->center_freq, r);
goto ps_restore; goto ps_restore;
} }
if (ath_startrecv(sc) != 0) { if (ath_startrecv(sc) != 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to restart recv logic\n");
"Unable to restart recv logic\n");
r = -EIO; r = -EIO;
goto ps_restore; goto ps_restore;
} }
...@@ -892,16 +890,14 @@ void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw) ...@@ -892,16 +890,14 @@ void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw)
r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false); r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
if (r) { if (r) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to reset channel (%u MHz), " "Unable to reset channel (%u MHz), reset status %d\n",
"reset status %d\n",
channel->center_freq, r); channel->center_freq, r);
} }
ath_update_txpow(sc); ath_update_txpow(sc);
if (ath_startrecv(sc) != 0) { if (ath_startrecv(sc) != 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to restart recv logic\n");
"Unable to restart recv logic\n");
spin_unlock_bh(&sc->sc_pcu_lock); spin_unlock_bh(&sc->sc_pcu_lock);
return; return;
} }
...@@ -955,9 +951,8 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw) ...@@ -955,9 +951,8 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false); r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
if (r) { if (r) {
ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(sc->sc_ah),
"Unable to reset channel (%u MHz), " "Unable to reset channel (%u MHz), reset status %d\n",
"reset status %d\n",
channel->center_freq, r); channel->center_freq, r);
} }
...@@ -993,12 +988,11 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) ...@@ -993,12 +988,11 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false); r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false);
if (r) if (r)
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to reset hardware; reset status %d\n", r); "Unable to reset hardware; reset status %d\n", r);
if (ath_startrecv(sc) != 0) if (ath_startrecv(sc) != 0)
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to start recv logic\n");
"Unable to start recv logic\n");
/* /*
* We may be doing a reset in response to a request * We may be doing a reset in response to a request
...@@ -1116,10 +1110,9 @@ static int ath9k_start(struct ieee80211_hw *hw) ...@@ -1116,10 +1110,9 @@ static int ath9k_start(struct ieee80211_hw *hw)
spin_lock_bh(&sc->sc_pcu_lock); spin_lock_bh(&sc->sc_pcu_lock);
r = ath9k_hw_reset(ah, init_channel, ah->caldata, false); r = ath9k_hw_reset(ah, init_channel, ah->caldata, false);
if (r) { if (r) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to reset hardware; reset status %d " "Unable to reset hardware; reset status %d (freq %u MHz)\n",
"(freq %u MHz)\n", r, r, curchan->center_freq);
curchan->center_freq);
spin_unlock_bh(&sc->sc_pcu_lock); spin_unlock_bh(&sc->sc_pcu_lock);
goto mutex_unlock; goto mutex_unlock;
} }
...@@ -1138,8 +1131,7 @@ static int ath9k_start(struct ieee80211_hw *hw) ...@@ -1138,8 +1131,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
* here except setup the interrupt mask. * here except setup the interrupt mask.
*/ */
if (ath_startrecv(sc) != 0) { if (ath_startrecv(sc) != 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to start recv logic\n");
"Unable to start recv logic\n");
r = -EIO; r = -EIO;
spin_unlock_bh(&sc->sc_pcu_lock); spin_unlock_bh(&sc->sc_pcu_lock);
goto mutex_unlock; goto mutex_unlock;
...@@ -1378,8 +1370,8 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, ...@@ -1378,8 +1370,8 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
ic_opmode = vif->type; ic_opmode = vif->type;
break; break;
default: default:
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Interface type %d not yet supported\n",
"Interface type %d not yet supported\n", vif->type); vif->type);
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
goto out; goto out;
} }
...@@ -1650,8 +1642,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) ...@@ -1650,8 +1642,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
} }
if (ath_set_channel(sc, hw, &sc->sc_ah->channels[pos]) < 0) { if (ath_set_channel(sc, hw, &sc->sc_ah->channels[pos]) < 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Unable to set channel\n");
"Unable to set channel\n");
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
return -EINVAL; return -EINVAL;
} }
...@@ -1775,7 +1766,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue, ...@@ -1775,7 +1766,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
ret = ath_txq_update(sc, txq->axq_qnum, &qi); ret = ath_txq_update(sc, txq->axq_qnum, &qi);
if (ret) if (ret)
ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n"); ath_err(common, "TXQ Update failed\n");
if (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) if (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC)
if (queue == WME_AC_BE && !ret) if (queue == WME_AC_BE && !ret)
...@@ -2024,8 +2015,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw, ...@@ -2024,8 +2015,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
break; break;
default: default:
ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(sc->sc_ah), "Unknown AMPDU action\n");
"Unknown AMPDU action\n");
} }
local_bh_enable(); local_bh_enable();
......
...@@ -59,9 +59,8 @@ static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data) ...@@ -59,9 +59,8 @@ static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
if (pdata) { if (pdata) {
if (off >= (ARRAY_SIZE(pdata->eeprom_data))) { if (off >= (ARRAY_SIZE(pdata->eeprom_data))) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"%s: eeprom read failed, offset %08x " "%s: eeprom read failed, offset %08x is out of range\n",
"is out of range\n",
__func__, off); __func__, off);
} }
......
...@@ -1576,7 +1576,7 @@ static void *ath_rate_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp ...@@ -1576,7 +1576,7 @@ static void *ath_rate_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp
rate_priv = kzalloc(sizeof(struct ath_rate_priv), gfp); rate_priv = kzalloc(sizeof(struct ath_rate_priv), gfp);
if (!rate_priv) { if (!rate_priv) {
ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(sc->sc_ah),
"Unable to allocate private rc structure\n"); "Unable to allocate private rc structure\n");
return NULL; return NULL;
} }
......
...@@ -269,7 +269,7 @@ static int ath_rx_edma_init(struct ath_softc *sc, int nbufs) ...@@ -269,7 +269,7 @@ static int ath_rx_edma_init(struct ath_softc *sc, int nbufs)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
bf->bf_buf_addr = 0; bf->bf_buf_addr = 0;
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"dma_mapping_error() on RX init\n"); "dma_mapping_error() on RX init\n");
error = -ENOMEM; error = -ENOMEM;
goto rx_init_fail; goto rx_init_fail;
...@@ -335,7 +335,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) ...@@ -335,7 +335,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
error = ath_descdma_setup(sc, &sc->rx.rxdma, &sc->rx.rxbuf, error = ath_descdma_setup(sc, &sc->rx.rxdma, &sc->rx.rxbuf,
"rx", nbufs, 1, 0); "rx", nbufs, 1, 0);
if (error != 0) { if (error != 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"failed to allocate rx descriptors: %d\n", "failed to allocate rx descriptors: %d\n",
error); error);
goto err; goto err;
...@@ -358,7 +358,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) ...@@ -358,7 +358,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
bf->bf_buf_addr = 0; bf->bf_buf_addr = 0;
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"dma_mapping_error() on RX init\n"); "dma_mapping_error() on RX init\n");
error = -ENOMEM; error = -ENOMEM;
goto err; goto err;
...@@ -1725,8 +1725,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) ...@@ -1725,8 +1725,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
dev_kfree_skb_any(requeue_skb); dev_kfree_skb_any(requeue_skb);
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
bf->bf_buf_addr = 0; bf->bf_buf_addr = 0;
ath_print(common, ATH_DBG_FATAL, ath_err(common, "dma_mapping_error() on RX\n");
"dma_mapping_error() on RX\n");
ath_rx_send_to_mac80211(hw, sc, skb, rxs); ath_rx_send_to_mac80211(hw, sc, skb, rxs);
break; break;
} }
......
...@@ -985,9 +985,8 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype) ...@@ -985,9 +985,8 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype)
return NULL; return NULL;
} }
if (qnum >= ARRAY_SIZE(sc->tx.txq)) { if (qnum >= ARRAY_SIZE(sc->tx.txq)) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "qnum %u out of range, max %zu!\n",
"qnum %u out of range, max %u!\n", qnum, ARRAY_SIZE(sc->tx.txq));
qnum, (unsigned int)ARRAY_SIZE(sc->tx.txq));
ath9k_hw_releasetxqueue(ah, qnum); ath9k_hw_releasetxqueue(ah, qnum);
return NULL; return NULL;
} }
...@@ -1038,7 +1037,7 @@ int ath_txq_update(struct ath_softc *sc, int qnum, ...@@ -1038,7 +1037,7 @@ int ath_txq_update(struct ath_softc *sc, int qnum,
qi.tqi_readyTime = qinfo->tqi_readyTime; qi.tqi_readyTime = qinfo->tqi_readyTime;
if (!ath9k_hw_set_txq_props(ah, qnum, &qi)) { if (!ath9k_hw_set_txq_props(ah, qnum, &qi)) {
ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(sc->sc_ah),
"Unable to update hardware queue %u!\n", qnum); "Unable to update hardware queue %u!\n", qnum);
error = -EIO; error = -EIO;
} else { } else {
...@@ -1197,12 +1196,11 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) ...@@ -1197,12 +1196,11 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
if (npend) { if (npend) {
int r; int r;
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Failed to stop TX DMA. Resetting hardware!\n");
"Failed to stop TX DMA. Resetting hardware!\n");
r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false); r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false);
if (r) if (r)
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Unable to reset hardware; reset status %d\n", "Unable to reset hardware; reset status %d\n",
r); r);
} }
...@@ -1663,7 +1661,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ieee80211_hw *hw, ...@@ -1663,7 +1661,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ieee80211_hw *hw,
if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) { if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) {
bf->bf_mpdu = NULL; bf->bf_mpdu = NULL;
bf->bf_buf_addr = 0; bf->bf_buf_addr = 0;
ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL, ath_err(ath9k_hw_common(sc->sc_ah),
"dma_mapping_error() on TX\n"); "dma_mapping_error() on TX\n");
ath_tx_return_buffer(sc, bf); ath_tx_return_buffer(sc, bf);
return NULL; return NULL;
...@@ -2260,7 +2258,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs) ...@@ -2260,7 +2258,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs)
error = ath_descdma_setup(sc, &sc->tx.txdma, &sc->tx.txbuf, error = ath_descdma_setup(sc, &sc->tx.txdma, &sc->tx.txbuf,
"tx", nbufs, 1, 1); "tx", nbufs, 1, 1);
if (error != 0) { if (error != 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Failed to allocate tx descriptors: %d\n", error); "Failed to allocate tx descriptors: %d\n", error);
goto err; goto err;
} }
...@@ -2268,7 +2266,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs) ...@@ -2268,7 +2266,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs)
error = ath_descdma_setup(sc, &sc->beacon.bdma, &sc->beacon.bbuf, error = ath_descdma_setup(sc, &sc->beacon.bdma, &sc->beacon.bbuf,
"beacon", ATH_BCBUF, 1, 1); "beacon", ATH_BCBUF, 1, 1);
if (error != 0) { if (error != 0) {
ath_print(common, ATH_DBG_FATAL, ath_err(common,
"Failed to allocate beacon descriptors: %d\n", error); "Failed to allocate beacon descriptors: %d\n", error);
goto err; goto err;
} }
......
...@@ -37,8 +37,7 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry) ...@@ -37,8 +37,7 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry)
void *ah = common->ah; void *ah = common->ah;
if (entry >= common->keymax) { if (entry >= common->keymax) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "keycache entry %u out of range\n", entry);
"keychache entry %u out of range\n", entry);
return false; return false;
} }
...@@ -75,8 +74,7 @@ static bool ath_hw_keysetmac(struct ath_common *common, ...@@ -75,8 +74,7 @@ static bool ath_hw_keysetmac(struct ath_common *common,
void *ah = common->ah; void *ah = common->ah;
if (entry >= common->keymax) { if (entry >= common->keymax) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "keycache entry %u out of range\n", entry);
"keychache entry %u out of range\n", entry);
return false; return false;
} }
...@@ -117,8 +115,7 @@ static bool ath_hw_set_keycache_entry(struct ath_common *common, u16 entry, ...@@ -117,8 +115,7 @@ static bool ath_hw_set_keycache_entry(struct ath_common *common, u16 entry,
u32 keyType; u32 keyType;
if (entry >= common->keymax) { if (entry >= common->keymax) {
ath_print(common, ATH_DBG_FATAL, ath_err(common, "keycache entry %u out of range\n", entry);
"keycache entry %u out of range\n", entry);
return false; return false;
} }
...@@ -159,8 +156,7 @@ static bool ath_hw_set_keycache_entry(struct ath_common *common, u16 entry, ...@@ -159,8 +156,7 @@ static bool ath_hw_set_keycache_entry(struct ath_common *common, u16 entry,
keyType = AR_KEYTABLE_TYPE_CLR; keyType = AR_KEYTABLE_TYPE_CLR;
break; break;
default: default:
ath_print(common, ATH_DBG_FATAL, ath_err(common, "cipher %u not supported\n", k->kv_type);
"cipher %u not supported\n", k->kv_type);
return false; return false;
} }
...@@ -341,8 +337,7 @@ static int ath_setkey_tkip(struct ath_common *common, u16 keyix, const u8 *key, ...@@ -341,8 +337,7 @@ static int ath_setkey_tkip(struct ath_common *common, u16 keyix, const u8 *key,
memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic)); memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
if (!ath_hw_set_keycache_entry(common, keyix, hk, NULL)) { if (!ath_hw_set_keycache_entry(common, keyix, hk, NULL)) {
/* TX MIC entry failed. No need to proceed further */ /* TX MIC entry failed. No need to proceed further */
ath_print(common, ATH_DBG_FATAL, ath_err(common, "Setting TX MIC Key Failed\n");
"Setting TX MIC Key Failed\n");
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment