ath9k: Use cleaner debug masks
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / ath9k / main.c
index e05eb1f07894b0b0d627cbf3a79e90b29683369a..de059c38467d54320ffa6030a17e6f31cd6c82e2 100644 (file)
@@ -38,6 +38,21 @@ static struct pci_device_id ath_pci_id_table[] __devinitdata = {
 
 static void ath_detach(struct ath_softc *sc);
 
+void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...)
+{
+       if (!sc)
+               return;
+
+       if (sc->sc_debug & dbg_mask) {
+               va_list args;
+
+               va_start(args, fmt);
+               printk(KERN_DEBUG "ath9k: ");
+               vprintk(fmt, args);
+               va_end(args);
+       }
+}
+
 /* return bus cachesize in 4B word units */
 
 static void bus_read_cachesize(struct ath_softc *sc, int *csz)
@@ -175,8 +190,8 @@ static void ath_setup_rates(struct ath_softc *sc, enum ieee80211_band band)
                rate[i].bitrate = rate_table->info[i].ratekbps / 100;
                rate[i].hw_value = rate_table->info[i].ratecode;
                sband->n_bitrates++;
-               DPRINTF(sc, ATH_DBG_CONFIG, "%s: Rate: %2dMbps, ratecode: %2d\n",
-                       __func__, rate[i].bitrate / 10, rate[i].hw_value);
+               DPRINTF(sc, ATH_DBG_CONFIG, "Rate: %2dMbps, ratecode: %2d\n",
+                       rate[i].bitrate / 10, rate[i].hw_value);
        }
 }
 
@@ -198,9 +213,9 @@ static int ath_setup_channels(struct ath_softc *sc)
                                      &nregclass, CTRY_DEFAULT, false, 1)) {
                u32 rd = ah->ah_currentRD;
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to collect channel list; "
+                       "Unable to collect channel list; "
                        "regdomain likely %u country code %u\n",
-                       __func__, rd, CTRY_DEFAULT);
+                       rd, CTRY_DEFAULT);
                return -EINVAL;
        }
 
@@ -223,9 +238,9 @@ static int ath_setup_channels(struct ath_softc *sc)
 
                        band_2ghz->n_channels = ++a;
 
-                       DPRINTF(sc, ATH_DBG_CONFIG, "%s: 2MHz channel: %d, "
+                       DPRINTF(sc, ATH_DBG_CONFIG, "2MHz channel: %d, "
                                "channelFlags: 0x%x\n",
-                               __func__, c->channel, c->channelFlags);
+                               c->channel, c->channelFlags);
                } else if (IS_CHAN_5GHZ(c)) {
                        chan_5ghz[b].band = IEEE80211_BAND_5GHZ;
                        chan_5ghz[b].center_freq = c->channel;
@@ -238,9 +253,9 @@ static int ath_setup_channels(struct ath_softc *sc)
 
                        band_5ghz->n_channels = ++b;
 
-                       DPRINTF(sc, ATH_DBG_CONFIG, "%s: 5MHz channel: %d, "
+                       DPRINTF(sc, ATH_DBG_CONFIG, "5MHz channel: %d, "
                                "channelFlags: 0x%x\n",
-                               __func__, c->channel, c->channelFlags);
+                               c->channel, c->channelFlags);
                }
        }
 
@@ -274,9 +289,9 @@ static int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
                 * hardware at the new frequency, and then re-enable
                 * the relevant bits of the h/w.
                 */
-               ath9k_hw_set_interrupts(ah, 0); /* disable interrupts */
-               ath_draintxq(sc, false);        /* clear pending tx frames */
-               stopped = ath_stoprecv(sc);     /* turn off frame recv */
+               ath9k_hw_set_interrupts(ah, 0);
+               ath_draintxq(sc, false);
+               stopped = ath_stoprecv(sc);
 
                /* XXX: do not flush receive queue here. We don't want
                 * to flush data frames already in queue because of
@@ -286,8 +301,7 @@ static int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
                        fastcc = false;
 
                DPRINTF(sc, ATH_DBG_CONFIG,
-                       "%s: (%u MHz) -> (%u MHz), cflags:%x, chanwidth: %d\n",
-                       __func__,
+                       "(%u MHz) -> (%u MHz), cflags:%x, chanwidth: %d\n",
                        sc->sc_ah->ah_curchan->channel,
                        hchan->channel, hchan->channelFlags, sc->tx_chan_width);
 
@@ -296,8 +310,8 @@ static int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
                                    sc->sc_tx_chainmask, sc->sc_rx_chainmask,
                                    sc->sc_ht_extprotspacing, fastcc, &status)) {
                        DPRINTF(sc, ATH_DBG_FATAL,
-                               "%s: unable to reset channel %u (%uMhz) "
-                               "flags 0x%x hal status %u\n", __func__,
+                               "Unable to reset channel %u (%uMhz) "
+                               "flags 0x%x hal status %u\n",
                                ath9k_hw_mhz2ieee(ah, hchan->channel,
                                                  hchan->channelFlags),
                                hchan->channel, hchan->channelFlags, status);
@@ -311,7 +325,7 @@ static int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
 
                if (ath_startrecv(sc) != 0) {
                        DPRINTF(sc, ATH_DBG_FATAL,
-                               "%s: unable to restart recv logic\n", __func__);
+                               "Unable to restart recv logic\n");
                        return -EIO;
                }
 
@@ -352,8 +366,7 @@ static void ath_ani_calibrate(unsigned long data)
        /* Long calibration runs independently of short calibration. */
        if ((timestamp - sc->sc_ani.sc_longcal_timer) >= ATH_LONG_CALINTERVAL) {
                longcal = true;
-               DPRINTF(sc, ATH_DBG_ANI, "%s: longcal @%lu\n",
-                       __func__, jiffies);
+               DPRINTF(sc, ATH_DBG_ANI, "longcal @%lu\n", jiffies);
                sc->sc_ani.sc_longcal_timer = timestamp;
        }
 
@@ -362,8 +375,7 @@ static void ath_ani_calibrate(unsigned long data)
                if ((timestamp - sc->sc_ani.sc_shortcal_timer) >=
                    ATH_SHORT_CALINTERVAL) {
                        shortcal = true;
-                       DPRINTF(sc, ATH_DBG_ANI, "%s: shortcal @%lu\n",
-                              __func__, jiffies);
+                       DPRINTF(sc, ATH_DBG_ANI, "shortcal @%lu\n", jiffies);
                        sc->sc_ani.sc_shortcal_timer = timestamp;
                        sc->sc_ani.sc_resetcal_timer = timestamp;
                }
@@ -404,15 +416,13 @@ static void ath_ani_calibrate(unsigned long data)
                                                               ah->ah_curchan);
 
                                DPRINTF(sc, ATH_DBG_ANI,
-                                       "%s: calibrate chan %u/%x nf: %d\n",
-                                        __func__,
+                                       "calibrate chan %u/%x nf: %d\n",
                                        ah->ah_curchan->channel,
                                        ah->ah_curchan->channelFlags,
                                        sc->sc_ani.sc_noise_floor);
                        } else {
                                DPRINTF(sc, ATH_DBG_ANY,
-                                       "%s: calibrate chan %u/%x failed\n",
-                                        __func__,
+                                       "calibrate chan %u/%x failed\n",
                                        ah->ah_curchan->channel,
                                        ah->ah_curchan->channelFlags);
                        }
@@ -449,8 +459,8 @@ static void ath_update_chainmask(struct ath_softc *sc, int is_ht)
                sc->sc_rx_chainmask = 1;
        }
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: tx chmask: %d, rx chmask: %d\n",
-               __func__, sc->sc_tx_chainmask, sc->sc_rx_chainmask);
+       DPRINTF(sc, ATH_DBG_CONFIG, "tx chmask: %d, rx chmask: %d\n",
+               sc->sc_tx_chainmask, sc->sc_rx_chainmask);
 }
 
 static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta)
@@ -712,7 +722,7 @@ static int ath_setkey_tkip(struct ath_softc *sc,
        if (!ath_keyset(sc, key->keyidx, hk, NULL)) {
                /* Txmic entry failed. No need to proceed further */
                DPRINTF(sc, ATH_DBG_KEYCACHE,
-                       "%s Setting TX MIC Key Failed\n", __func__);
+                       "Setting TX MIC Key Failed\n");
                return 0;
        }
 
@@ -836,8 +846,7 @@ static void ath9k_ht_conf(struct ath_softc *sc,
                ath9k_hw_set11nmac2040(sc->sc_ah, sc->tx_chan_width);
 
                DPRINTF(sc, ATH_DBG_CONFIG,
-                       "%s: BSS Changed HT, chanwidth: %d\n",
-                       __func__, sc->tx_chan_width);
+                       "BSS Changed HT, chanwidth: %d\n", sc->tx_chan_width);
        }
 }
 
@@ -863,9 +872,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
        int pos;
 
        if (bss_conf->assoc) {
-               DPRINTF(sc, ATH_DBG_CONFIG, "%s: Bss Info ASSOC %d\n",
-                       __func__,
-                       bss_conf->aid);
+               DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info ASSOC %d\n", bss_conf->aid);
 
                /* New association, store aid */
                if (avp->av_opmode == ATH9K_M_STA) {
@@ -888,18 +895,13 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
                ath_update_chainmask(sc, hw->conf.ht.enabled);
 
                DPRINTF(sc, ATH_DBG_CONFIG,
-                       "%s: bssid %pM aid 0x%x\n",
-                       __func__,
+                       "bssid %pM aid 0x%x\n",
                        sc->sc_curbssid, sc->sc_curaid);
 
-               DPRINTF(sc, ATH_DBG_CONFIG, "%s: Set channel: %d MHz\n",
-                       __func__,
-                       curchan->center_freq);
-
                pos = ath_get_channel(sc, curchan);
                if (pos == -1) {
                        DPRINTF(sc, ATH_DBG_FATAL,
-                               "%s: Invalid channel\n", __func__);
+                               "Invalid channel: %d\n", curchan->center_freq);
                        return;
                }
 
@@ -920,14 +922,15 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
 
                /* set h/w channel */
                if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0)
-                       DPRINTF(sc, ATH_DBG_FATAL,
-                               "%s: Unable to set channel\n", __func__);
+                       DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel: %d\n",
+                               curchan->center_freq);
+
                /* Start ANI */
                mod_timer(&sc->sc_ani.timer,
                        jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL));
 
        } else {
-               DPRINTF(sc, ATH_DBG_CONFIG, "%s: Bss Info DISSOC\n", __func__);
+               DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info DISSOC\n");
                sc->sc_curaid = 0;
        }
 }
@@ -1066,8 +1069,8 @@ static void ath_radio_enable(struct ath_softc *sc)
                            sc->sc_ht_extprotspacing,
                            false, &status)) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to reset channel %u (%uMhz) "
-                       "flags 0x%x hal status %u\n", __func__,
+                       "Unable to reset channel %u (%uMhz) "
+                       "flags 0x%x hal status %u\n",
                        ath9k_hw_mhz2ieee(ah,
                                          ah->ah_curchan->channel,
                                          ah->ah_curchan->channelFlags),
@@ -1079,7 +1082,7 @@ static void ath_radio_enable(struct ath_softc *sc)
        ath_update_txpow(sc);
        if (ath_startrecv(sc) != 0) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to restart recv logic\n", __func__);
+                       "Unable to restart recv logic\n");
                return;
        }
 
@@ -1124,8 +1127,8 @@ static void ath_radio_disable(struct ath_softc *sc)
                            sc->sc_ht_extprotspacing,
                            false, &status)) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to reset channel %u (%uMhz) "
-                       "flags 0x%x hal status %u\n", __func__,
+                       "Unable to reset channel %u (%uMhz) "
+                       "flags 0x%x hal status %u\n",
                        ath9k_hw_mhz2ieee(ah,
                                ah->ah_curchan->channel,
                                ah->ah_curchan->channelFlags),
@@ -1205,7 +1208,7 @@ static int ath_sw_toggle_radio(void *data, enum rfkill_state state)
                        sc->sc_flags &= ~SC_OP_RFKILL_SW_BLOCKED;
                        if (sc->sc_flags & SC_OP_RFKILL_HW_BLOCKED) {
                                DPRINTF(sc, ATH_DBG_FATAL, "Can't turn on the"
-                                       "radio as it is disabled by h/w \n");
+                                       "radio as it is disabled by h/w\n");
                                return -EPERM;
                        }
                        ath_radio_enable(sc);
@@ -1285,7 +1288,7 @@ static void ath_detach(struct ath_softc *sc)
        struct ieee80211_hw *hw = sc->hw;
        int i = 0;
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: Detach ATH hw\n", __func__);
+       DPRINTF(sc, ATH_DBG_CONFIG, "Detach ATH hw\n");
 
 #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
        ath_deinit_rfkill(sc);
@@ -1340,8 +1343,7 @@ static int ath_init(u16 devid, struct ath_softc *sc)
        ah = ath9k_hw_attach(devid, sc, sc->mem, &status);
        if (ah == NULL) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to attach hardware; HAL status %u\n",
-                       __func__, status);
+                       "Unable to attach hardware; HAL status %u\n", status);
                error = -ENXIO;
                goto bad;
        }
@@ -1351,8 +1353,8 @@ static int ath_init(u16 devid, struct ath_softc *sc)
        sc->sc_keymax = ah->ah_caps.keycache_size;
        if (sc->sc_keymax > ATH_KEYMAX) {
                DPRINTF(sc, ATH_DBG_KEYCACHE,
-                       "%s: Warning, using only %u entries in %u key cache\n",
-                       __func__, ATH_KEYMAX, sc->sc_keymax);
+                       "Warning, using only %u entries in %u key cache\n",
+                       ATH_KEYMAX, sc->sc_keymax);
                sc->sc_keymax = ATH_KEYMAX;
        }
 
@@ -1399,14 +1401,14 @@ static int ath_init(u16 devid, struct ath_softc *sc)
        sc->sc_bhalq = ath_beaconq_setup(ah);
        if (sc->sc_bhalq == -1) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to setup a beacon xmit queue\n", __func__);
+                       "Unable to setup a beacon xmit queue\n");
                error = -EIO;
                goto bad2;
        }
        sc->sc_cabq = ath_txq_setup(sc, ATH9K_TX_QUEUE_CAB, 0);
        if (sc->sc_cabq == NULL) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to setup CAB xmit queue\n", __func__);
+                       "Unable to setup CAB xmit queue\n");
                error = -EIO;
                goto bad2;
        }
@@ -1421,30 +1423,26 @@ static int ath_init(u16 devid, struct ath_softc *sc)
        /* NB: ensure BK queue is the lowest priority h/w queue */
        if (!ath_tx_setup(sc, ATH9K_WME_AC_BK)) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to setup xmit queue for BK traffic\n",
-                       __func__);
+                       "Unable to setup xmit queue for BK traffic\n");
                error = -EIO;
                goto bad2;
        }
 
        if (!ath_tx_setup(sc, ATH9K_WME_AC_BE)) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to setup xmit queue for BE traffic\n",
-                       __func__);
+                       "Unable to setup xmit queue for BE traffic\n");
                error = -EIO;
                goto bad2;
        }
        if (!ath_tx_setup(sc, ATH9K_WME_AC_VI)) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to setup xmit queue for VI traffic\n",
-                       __func__);
+                       "Unable to setup xmit queue for VI traffic\n");
                error = -EIO;
                goto bad2;
        }
        if (!ath_tx_setup(sc, ATH9K_WME_AC_VO)) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to setup xmit queue for VO traffic\n",
-                       __func__);
+                       "Unable to setup xmit queue for VO traffic\n");
                error = -EIO;
                goto bad2;
        }
@@ -1556,7 +1554,7 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
        struct ieee80211_hw *hw = sc->hw;
        int error = 0;
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: Attach ATH hw\n", __func__);
+       DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n");
 
        error = ath_init(devid, sc);
        if (error != 0)
@@ -1587,8 +1585,7 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
        error = ath_rate_control_register();
        if (error != 0) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: Unable to register rate control "
-                       "algorithm:%d\n", __func__, error);
+                       "Unable to register rate control algorithm: %d\n", error);
                ath_rate_control_unregister();
                goto bad;
        }
@@ -1656,15 +1653,13 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
                            sc->sc_tx_chainmask, sc->sc_rx_chainmask,
                            sc->sc_ht_extprotspacing, false, &status)) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to reset hardware; hal status %u\n",
-                       __func__, status);
+                       "Unable to reset hardware; hal status %u\n", status);
                error = -EIO;
        }
        spin_unlock_bh(&sc->sc_resetlock);
 
        if (ath_startrecv(sc) != 0)
-               DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to start recv logic\n", __func__);
+               DPRINTF(sc, ATH_DBG_FATAL, "Unable to start recv logic\n");
 
        /*
         * We may be doing a reset in response to a request
@@ -1712,13 +1707,12 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
        struct ath_buf *bf;
        int i, bsize, error;
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: %s DMA: %u buffers %u desc/buf\n",
-               __func__, name, nbuf, ndesc);
+       DPRINTF(sc, ATH_DBG_CONFIG, "%s DMA: %u buffers %u desc/buf\n",
+               name, nbuf, ndesc);
 
        /* ath_desc must be a multiple of DWORDs */
        if ((sizeof(struct ath_desc) % 4) != 0) {
-               DPRINTF(sc, ATH_DBG_FATAL, "%s: ath_desc not DWORD aligned\n",
-                       __func__);
+               DPRINTF(sc, ATH_DBG_FATAL, "ath_desc not DWORD aligned\n");
                ASSERT((sizeof(struct ath_desc) % 4) == 0);
                error = -ENOMEM;
                goto fail;
@@ -1754,8 +1748,8 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
                goto fail;
        }
        ds = dd->dd_desc;
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: %s DMA map: %p (%u) -> %llx (%u)\n",
-               __func__, dd->dd_name, ds, (u32) dd->dd_desc_len,
+       DPRINTF(sc, ATH_DBG_CONFIG, "%s DMA map: %p (%u) -> %llx (%u)\n",
+               dd->dd_name, ds, (u32) dd->dd_desc_len,
                ito64(dd->dd_desc_paddr), /*XXX*/(u32) dd->dd_desc_len);
 
        /* allocate buffers */
@@ -1877,14 +1871,14 @@ static int ath9k_start(struct ieee80211_hw *hw)
        struct ath9k_channel *init_channel;
        int error = 0, pos, status;
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: Starting driver with "
-               "initial channel: %d MHz\n", __func__, curchan->center_freq);
+       DPRINTF(sc, ATH_DBG_CONFIG, "Starting driver with "
+               "initial channel: %d MHz\n", curchan->center_freq);
 
        /* setup initial channel */
 
        pos = ath_get_channel(sc, curchan);
        if (pos == -1) {
-               DPRINTF(sc, ATH_DBG_FATAL, "%s: Invalid channel\n", __func__);
+               DPRINTF(sc, ATH_DBG_FATAL, "Invalid channel: %d\n", curchan->center_freq);
                error = -EINVAL;
                goto error;
        }
@@ -1910,8 +1904,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
                            sc->sc_tx_chainmask, sc->sc_rx_chainmask,
                            sc->sc_ht_extprotspacing, false, &status)) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to reset hardware; hal status %u "
-                       "(freq %u flags 0x%x)\n", __func__, status,
+                       "Unable to reset hardware; hal status %u "
+                       "(freq %u flags 0x%x)\n", status,
                        init_channel->channel, init_channel->channelFlags);
                error = -EIO;
                spin_unlock_bh(&sc->sc_resetlock);
@@ -1934,7 +1928,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
         */
        if (ath_startrecv(sc) != 0) {
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: unable to start recv logic\n", __func__);
+                       "Unable to start recv logic\n");
                error = -EIO;
                goto error;
        }
@@ -2026,12 +2020,10 @@ static int ath9k_tx(struct ieee80211_hw *hw,
        if (!txctl.txq)
                goto exit;
 
-       DPRINTF(sc, ATH_DBG_XMIT, "%s: transmitting packet, skb: %p\n",
-               __func__,
-               skb);
+       DPRINTF(sc, ATH_DBG_XMIT, "transmitting packet, skb: %p\n", skb);
 
        if (ath_tx_start(sc, skb, &txctl) != 0) {
-               DPRINTF(sc, ATH_DBG_XMIT, "%s: TX failed\n", __func__);
+               DPRINTF(sc, ATH_DBG_XMIT, "TX failed\n");
                goto exit;
        }
 
@@ -2046,11 +2038,11 @@ static void ath9k_stop(struct ieee80211_hw *hw)
        struct ath_softc *sc = hw->priv;
 
        if (sc->sc_flags & SC_OP_INVALID) {
-               DPRINTF(sc, ATH_DBG_ANY, "%s: Device not present\n", __func__);
+               DPRINTF(sc, ATH_DBG_ANY, "Device not present\n");
                return;
        }
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: Cleaning up\n", __func__);
+       DPRINTF(sc, ATH_DBG_CONFIG, "Cleaning up\n");
 
        ieee80211_stop_queues(sc->hw);
 
@@ -2075,7 +2067,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
 
        sc->sc_flags |= SC_OP_INVALID;
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: Driver halt\n", __func__);
+       DPRINTF(sc, ATH_DBG_CONFIG, "Driver halt\n");
 }
 
 static int ath9k_add_interface(struct ieee80211_hw *hw,
@@ -2102,14 +2094,11 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
                break;
        default:
                DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: Interface type %d not yet supported\n",
-                       __func__, conf->type);
+                       "Interface type %d not yet supported\n", conf->type);
                return -EOPNOTSUPP;
        }
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: Attach a VAP of type: %d\n",
-               __func__,
-               ic_opmode);
+       DPRINTF(sc, ATH_DBG_CONFIG, "Attach a VAP of type: %d\n", ic_opmode);
 
        /* Set the VAP opmode */
        avp->av_opmode = ic_opmode;
@@ -2140,7 +2129,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
        struct ath_softc *sc = hw->priv;
        struct ath_vap *avp = (void *)conf->vif->drv_priv;
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: Detach VAP\n", __func__);
+       DPRINTF(sc, ATH_DBG_CONFIG, "Detach Interface\n");
 
 #ifdef CONFIG_SLOW_ANT_DIV
        ath_slow_ant_div_stop(&sc->sc_antdiv);
@@ -2170,12 +2159,13 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
                struct ieee80211_channel *curchan = hw->conf.channel;
                int pos;
 
-               DPRINTF(sc, ATH_DBG_CONFIG, "%s: Set channel: %d MHz\n",
-                       __func__, curchan->center_freq);
+               DPRINTF(sc, ATH_DBG_CONFIG, "Set channel: %d MHz\n",
+                       curchan->center_freq);
 
                pos = ath_get_channel(sc, curchan);
                if (pos == -1) {
-                       DPRINTF(sc, ATH_DBG_FATAL, "%s: Invalid channel\n", __func__);
+                       DPRINTF(sc, ATH_DBG_FATAL, "Invalid channel: %d\n",
+                               curchan->center_freq);
                        return -EINVAL;
                }
 
@@ -2196,8 +2186,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
                }
 
                if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0) {
-                       DPRINTF(sc, ATH_DBG_FATAL,
-                               "%s: Unable to set channel\n", __func__);
+                       DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel\n");
                        return -EINVAL;
                }
        }
@@ -2247,9 +2236,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
                        sc->sc_config.ath_aggr_prot = 0;
 
                        DPRINTF(sc, ATH_DBG_CONFIG,
-                               "%s: RX filter 0x%x bssid %pM aid 0x%x\n",
-                               __func__, rfilt,
-                               sc->sc_curbssid, sc->sc_curaid);
+                               "RX filter 0x%x bssid %pM aid 0x%x\n",
+                               rfilt, sc->sc_curbssid, sc->sc_curaid);
 
                        /* need to reconfigure the beacon */
                        sc->sc_flags &= ~SC_OP_BEACONS ;
@@ -2326,8 +2314,7 @@ static void ath9k_configure_filter(struct ieee80211_hw *hw,
                        ath9k_hw_write_associd(sc->sc_ah, ath_bcast_mac, 0);
        }
 
-       DPRINTF(sc, ATH_DBG_CONFIG, "%s: Set HW RX filter: 0x%x\n",
-               __func__, sc->rx_filter);
+       DPRINTF(sc, ATH_DBG_CONFIG, "Set HW RX filter: 0x%x\n", sc->rx_filter);
 }
 
 static void ath9k_sta_notify(struct ieee80211_hw *hw,
@@ -2367,20 +2354,14 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw,
        qnum = ath_get_hal_qnum(queue, sc);
 
        DPRINTF(sc, ATH_DBG_CONFIG,
-               "%s: Configure tx [queue/halq] [%d/%d],  "
+               "Configure tx [queue/halq] [%d/%d],  "
                "aifs: %d, cw_min: %d, cw_max: %d, txop: %d\n",
-               __func__,
-               queue,
-               qnum,
-               params->aifs,
-               params->cw_min,
-               params->cw_max,
-               params->txop);
+               queue, qnum, params->aifs, params->cw_min,
+               params->cw_max, params->txop);
 
        ret = ath_txq_update(sc, qnum, &qi);
        if (ret)
-               DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: TXQ Update failed\n", __func__);
+               DPRINTF(sc, ATH_DBG_FATAL, "TXQ Update failed\n");
 
        return ret;
 }
@@ -2394,7 +2375,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
        struct ath_softc *sc = hw->priv;
        int ret = 0;
 
-       DPRINTF(sc, ATH_DBG_KEYCACHE, " %s: Set HW Key\n", __func__);
+       DPRINTF(sc, ATH_DBG_KEYCACHE, "Set HW Key\n");
 
        switch (cmd) {
        case SET_KEY:
@@ -2427,8 +2408,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
        struct ath_softc *sc = hw->priv;
 
        if (changed & BSS_CHANGED_ERP_PREAMBLE) {
-               DPRINTF(sc, ATH_DBG_CONFIG, "%s: BSS Changed PREAMBLE %d\n",
-                       __func__,
+               DPRINTF(sc, ATH_DBG_CONFIG, "BSS Changed PREAMBLE %d\n",
                        bss_conf->use_short_preamble);
                if (bss_conf->use_short_preamble)
                        sc->sc_flags |= SC_OP_PREAMBLE_SHORT;
@@ -2437,8 +2417,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
        }
 
        if (changed & BSS_CHANGED_ERP_CTS_PROT) {
-               DPRINTF(sc, ATH_DBG_CONFIG, "%s: BSS Changed CTS PROT %d\n",
-                       __func__,
+               DPRINTF(sc, ATH_DBG_CONFIG, "BSS Changed CTS PROT %d\n",
                        bss_conf->use_cts_prot);
                if (bss_conf->use_cts_prot &&
                    hw->conf.channel->band != IEEE80211_BAND_5GHZ)
@@ -2451,8 +2430,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
                ath9k_ht_conf(sc, bss_conf);
 
        if (changed & BSS_CHANGED_ASSOC) {
-               DPRINTF(sc, ATH_DBG_CONFIG, "%s: BSS Changed ASSOC %d\n",
-                       __func__,
+               DPRINTF(sc, ATH_DBG_CONFIG, "BSS Changed ASSOC %d\n",
                        bss_conf->assoc);
                ath9k_bss_assoc_info(sc, vif, bss_conf);
        }
@@ -2496,8 +2474,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
                ret = ath_tx_aggr_start(sc, sta, tid, ssn);
                if (ret < 0)
                        DPRINTF(sc, ATH_DBG_FATAL,
-                               "%s: Unable to start TX aggregation\n",
-                               __func__);
+                               "Unable to start TX aggregation\n");
                else
                        ieee80211_start_tx_ba_cb_irqsafe(hw, sta->addr, tid);
                break;
@@ -2505,8 +2482,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
                ret = ath_tx_aggr_stop(sc, sta, tid);
                if (ret < 0)
                        DPRINTF(sc, ATH_DBG_FATAL,
-                               "%s: Unable to stop TX aggregation\n",
-                               __func__);
+                               "Unable to stop TX aggregation\n");
 
                ieee80211_stop_tx_ba_cb_irqsafe(hw, sta->addr, tid);
                break;
@@ -2514,8 +2490,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
                ath_tx_aggr_resume(sc, sta, tid);
                break;
        default:
-               DPRINTF(sc, ATH_DBG_FATAL,
-                       "%s: Unknown AMPDU action\n", __func__);
+               DPRINTF(sc, ATH_DBG_FATAL, "Unknown AMPDU action\n");
        }
 
        return ret;
@@ -2571,7 +2546,6 @@ static struct {
 /*
  * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown.
  */
-
 static const char *
 ath_mac_bb_name(u32 mac_bb_version)
 {
@@ -2589,7 +2563,6 @@ ath_mac_bb_name(u32 mac_bb_version)
 /*
  * Return the RF name. "????" is returned if the RF is unknown.
  */
-
 static const char *
 ath_rf_name(u16 rf_version)
 {
@@ -2628,7 +2601,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        if (ret) {
                printk(KERN_ERR "ath9k: 32-bit DMA consistent "
-                       "DMA enable faled\n");
+                       "DMA enable failed\n");
                goto bad;
        }
 
@@ -2838,6 +2811,6 @@ module_init(init_ath_pci);
 static void __exit exit_ath_pci(void)
 {
        pci_unregister_driver(&ath_pci_driver);
-       printk(KERN_INFO "%s: driver unloaded\n", dev_info);
+       printk(KERN_INFO "%s: Driver unloaded\n", dev_info);
 }
 module_exit(exit_ath_pci);