]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath9k: Exclude more functions
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Sat, 23 Aug 2014 07:59:11 +0000 (13:29 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 28 Aug 2014 18:49:36 +0000 (14:49 -0400)
Use CONFIG_ATH9K_CHANNEL_CONTEXT to exclude more functions:

ath_offchannel_channel_change()
ath_scan_channel_start()
ath_scan_send_probe()

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/channel.c

index f9863e689cd2edd52f893f48368ccfb2dc3ce9d4..3b4201caee5b678b15cdc6c171d9c443ea5002b8 100644 (file)
@@ -420,7 +420,6 @@ void ath_chanctx_set_channel(struct ath_softc *sc, struct ath_chanctx *ctx,
 void ath_chanctx_switch(struct ath_softc *sc, struct ath_chanctx *ctx,
                        struct cfg80211_chan_def *chandef);
 void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx);
-void ath_offchannel_channel_change(struct ath_softc *sc);
 void ath_chanctx_offchan_switch(struct ath_softc *sc,
                                struct ieee80211_channel *chan);
 struct ath_chanctx *ath_chanctx_get_oper_chan(struct ath_softc *sc,
index 61ed7a72c989342172213c800486a981aadd4460..cd8af454cf46b4d045c6fe36f918076557745188 100644 (file)
 
 #include "ath9k.h"
 
-static const char *offchannel_state_string(enum ath_offchannel_state state)
-{
-#define case_rtn_string(val) case val: return #val
-
-       switch (state) {
-               case_rtn_string(ATH_OFFCHANNEL_IDLE);
-               case_rtn_string(ATH_OFFCHANNEL_PROBE_SEND);
-               case_rtn_string(ATH_OFFCHANNEL_PROBE_WAIT);
-               case_rtn_string(ATH_OFFCHANNEL_SUSPEND);
-               case_rtn_string(ATH_OFFCHANNEL_ROC_START);
-               case_rtn_string(ATH_OFFCHANNEL_ROC_WAIT);
-               case_rtn_string(ATH_OFFCHANNEL_ROC_DONE);
-       default:
-               return "unknown";
-       }
-}
-
 /* Set/change channels.  If the channel is really being changed, it's done
  * by reseting the chip.  To accomplish this we must first cleanup any pending
  * DMA, then restart stuff.
@@ -616,6 +599,25 @@ void ath_scan_complete(struct ath_softc *sc, bool abort)
        ath9k_ps_restore(sc);
 }
 
+#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
+
+static const char *offchannel_state_string(enum ath_offchannel_state state)
+{
+#define case_rtn_string(val) case val: return #val
+
+       switch (state) {
+               case_rtn_string(ATH_OFFCHANNEL_IDLE);
+               case_rtn_string(ATH_OFFCHANNEL_PROBE_SEND);
+               case_rtn_string(ATH_OFFCHANNEL_PROBE_WAIT);
+               case_rtn_string(ATH_OFFCHANNEL_SUSPEND);
+               case_rtn_string(ATH_OFFCHANNEL_ROC_START);
+               case_rtn_string(ATH_OFFCHANNEL_ROC_WAIT);
+               case_rtn_string(ATH_OFFCHANNEL_ROC_DONE);
+       default:
+               return "unknown";
+       }
+}
+
 static void ath_scan_send_probe(struct ath_softc *sc,
                                struct cfg80211_ssid *ssid)
 {
@@ -674,49 +676,6 @@ static void ath_scan_channel_start(struct ath_softc *sc)
        mod_timer(&sc->offchannel.timer, jiffies + sc->offchannel.duration);
 }
 
-void ath_offchannel_channel_change(struct ath_softc *sc)
-{
-       struct ath_common *common = ath9k_hw_common(sc->sc_ah);
-
-       ath_dbg(common, CHAN_CTX, "%s: state: %s\n",
-               __func__, offchannel_state_string(sc->offchannel.state));
-
-       switch (sc->offchannel.state) {
-       case ATH_OFFCHANNEL_PROBE_SEND:
-               if (!sc->offchannel.scan_req)
-                       return;
-
-               if (sc->cur_chan->chandef.chan !=
-                   sc->offchannel.chan.chandef.chan)
-                       return;
-
-               ath_scan_channel_start(sc);
-               break;
-       case ATH_OFFCHANNEL_IDLE:
-               if (!sc->offchannel.scan_req)
-                       return;
-
-               ath_scan_complete(sc, false);
-               break;
-       case ATH_OFFCHANNEL_ROC_START:
-               if (sc->cur_chan != &sc->offchannel.chan)
-                       break;
-
-               sc->offchannel.state = ATH_OFFCHANNEL_ROC_WAIT;
-               mod_timer(&sc->offchannel.timer, jiffies +
-                         msecs_to_jiffies(sc->offchannel.duration));
-               ieee80211_ready_on_channel(sc->hw);
-               break;
-       case ATH_OFFCHANNEL_ROC_DONE:
-               ath_roc_complete(sc, false);
-               break;
-       default:
-               break;
-       }
-}
-
-#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
-
 static void ath_chanctx_timer(unsigned long data)
 {
        struct ath_softc *sc = (struct ath_softc *) data;
@@ -848,6 +807,47 @@ static bool ath_chanctx_defer_switch(struct ath_softc *sc)
        return true;
 }
 
+static void ath_offchannel_channel_change(struct ath_softc *sc)
+{
+       struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+
+       ath_dbg(common, CHAN_CTX, "%s: state: %s\n",
+               __func__, offchannel_state_string(sc->offchannel.state));
+
+       switch (sc->offchannel.state) {
+       case ATH_OFFCHANNEL_PROBE_SEND:
+               if (!sc->offchannel.scan_req)
+                       return;
+
+               if (sc->cur_chan->chandef.chan !=
+                   sc->offchannel.chan.chandef.chan)
+                       return;
+
+               ath_scan_channel_start(sc);
+               break;
+       case ATH_OFFCHANNEL_IDLE:
+               if (!sc->offchannel.scan_req)
+                       return;
+
+               ath_scan_complete(sc, false);
+               break;
+       case ATH_OFFCHANNEL_ROC_START:
+               if (sc->cur_chan != &sc->offchannel.chan)
+                       break;
+
+               sc->offchannel.state = ATH_OFFCHANNEL_ROC_WAIT;
+               mod_timer(&sc->offchannel.timer, jiffies +
+                         msecs_to_jiffies(sc->offchannel.duration));
+               ieee80211_ready_on_channel(sc->hw);
+               break;
+       case ATH_OFFCHANNEL_ROC_DONE:
+               ath_roc_complete(sc, false);
+               break;
+       default:
+               break;
+       }
+}
+
 void ath_chanctx_set_next(struct ath_softc *sc, bool force)
 {
        struct timespec ts;