]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ath9k_htc: Move TX specific stuff to a separate structure
authorSujith Manoharan <Sujith.Manoharan@atheros.com>
Wed, 13 Apr 2011 05:55:00 +0000 (11:25 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 13 Apr 2011 19:23:16 +0000 (15:23 -0400)
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/htc.h
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
drivers/net/wireless/ath/ath9k/htc_drv_init.c
drivers/net/wireless/ath/ath9k/htc_drv_main.c
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c

index 1568c3692da417e98e3c5337407964057f53e225..3af8a58d400fa81748366119667c8ba915237eff 100644 (file)
@@ -260,6 +260,13 @@ struct ath9k_htc_rx {
        spinlock_t rxbuflock;
 };
 
+struct ath9k_htc_tx {
+       bool tx_queues_stop;
+       spinlock_t tx_lock;
+
+       struct sk_buff_head tx_queue;
+};
+
 struct ath9k_htc_tx_ctl {
        u8 type; /* ATH9K_HTC_* */
 };
@@ -433,22 +440,20 @@ struct ath9k_htc_priv {
        u16 nstations;
        bool rearm_ani;
        bool reconfig_beacon;
+       unsigned int rxfilter;
 
        struct ath9k_hw_cal_data caldata;
+       struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
 
        spinlock_t beacon_lock;
+       struct htc_beacon_config cur_beacon_conf;
 
-       bool tx_queues_stop;
-       spinlock_t tx_lock;
+       struct ath9k_htc_rx rx;
+       struct ath9k_htc_tx tx;
 
-       struct htc_beacon_config cur_beacon_conf;
-       unsigned int rxfilter;
        struct tasklet_struct swba_tasklet;
        struct tasklet_struct rx_tasklet;
-       struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
-       struct ath9k_htc_rx rx;
        struct tasklet_struct tx_tasklet;
-       struct sk_buff_head tx_queue;
        struct delayed_work ani_work;
        struct work_struct ps_work;
        struct work_struct fatal_work;
index 459ba0d36f4caab259c6be54ccbf500815d97a32..1f6df4a1d2244a49b91f3c81f37c46af1243cfaf 100644 (file)
@@ -398,9 +398,9 @@ void ath9k_htc_radio_enable(struct ieee80211_hw *hw)
 
        /* Start TX */
        htc_start(priv->htc);
-       spin_lock_bh(&priv->tx_lock);
-       priv->tx_queues_stop = false;
-       spin_unlock_bh(&priv->tx_lock);
+       spin_lock_bh(&priv->tx.tx_lock);
+       priv->tx.tx_queues_stop = false;
+       spin_unlock_bh(&priv->tx.tx_lock);
        ieee80211_wake_queues(hw);
 
        WMI_CMD(WMI_ENABLE_INTR_CMDID);
@@ -431,7 +431,7 @@ void ath9k_htc_radio_disable(struct ieee80211_hw *hw)
        ieee80211_stop_queues(hw);
        htc_stop(priv->htc);
        WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID);
-       skb_queue_purge(&priv->tx_queue);
+       skb_queue_purge(&priv->tx.tx_queue);
 
        /* Stop RX */
        WMI_CMD(WMI_STOP_RECV_CMDID);
index 921d76f320165837d9d19e4c01b92f145fdae831..c270da7be10f6934027de8939d16c4bcf471ce00 100644 (file)
@@ -673,7 +673,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
 
        spin_lock_init(&priv->wmi->wmi_lock);
        spin_lock_init(&priv->beacon_lock);
-       spin_lock_init(&priv->tx_lock);
+       spin_lock_init(&priv->tx.tx_lock);
        mutex_init(&priv->mutex);
        mutex_init(&priv->htc_pm_lock);
        tasklet_init(&priv->rx_tasklet, ath9k_rx_tasklet,
index 400226702e0a53d0e904e2909a4bc2e6079e626d..ff3a49577a02cf39b4a881e402ffea564e3c8aa6 100644 (file)
@@ -707,9 +707,9 @@ static int ath9k_htc_tx_aggr_oper(struct ath9k_htc_priv *priv,
                        (aggr.aggr_enable) ? "Starting" : "Stopping",
                        sta->addr, tid);
 
-       spin_lock_bh(&priv->tx_lock);
+       spin_lock_bh(&priv->tx.tx_lock);
        ista->tid_state[tid] = (aggr.aggr_enable && !ret) ? AGGR_START : AGGR_STOP;
-       spin_unlock_bh(&priv->tx_lock);
+       spin_unlock_bh(&priv->tx.tx_lock);
 
        return ret;
 }
@@ -853,9 +853,9 @@ static void ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
                        ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT,
                                "Stopping TX queues\n");
                        ieee80211_stop_queues(hw);
-                       spin_lock_bh(&priv->tx_lock);
-                       priv->tx_queues_stop = true;
-                       spin_unlock_bh(&priv->tx_lock);
+                       spin_lock_bh(&priv->tx.tx_lock);
+                       priv->tx.tx_queues_stop = true;
+                       spin_unlock_bh(&priv->tx.tx_lock);
                } else {
                        ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT,
                                "Tx failed\n");
@@ -923,9 +923,9 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
        priv->op_flags &= ~OP_INVALID;
        htc_start(priv->htc);
 
-       spin_lock_bh(&priv->tx_lock);
-       priv->tx_queues_stop = false;
-       spin_unlock_bh(&priv->tx_lock);
+       spin_lock_bh(&priv->tx.tx_lock);
+       priv->tx.tx_queues_stop = false;
+       spin_unlock_bh(&priv->tx.tx_lock);
 
        ieee80211_wake_queues(hw);
 
@@ -965,7 +965,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
        tasklet_kill(&priv->rx_tasklet);
        tasklet_kill(&priv->tx_tasklet);
 
-       skb_queue_purge(&priv->tx_queue);
+       skb_queue_purge(&priv->tx.tx_queue);
 
        ath9k_wmi_event_drain(priv);
 
@@ -1563,9 +1563,9 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
                break;
        case IEEE80211_AMPDU_TX_OPERATIONAL:
                ista = (struct ath9k_htc_sta *) sta->drv_priv;
-               spin_lock_bh(&priv->tx_lock);
+               spin_lock_bh(&priv->tx.tx_lock);
                ista->tid_state[tid] = AGGR_OPERATIONAL;
-               spin_unlock_bh(&priv->tx_lock);
+               spin_unlock_bh(&priv->tx.tx_lock);
                break;
        default:
                ath_err(ath9k_hw_common(priv->ah), "Unknown AMPDU action\n");
index ab55dff4721fb7b300c53cb1c4c99eda4b8cb9b6..6f7987d7b6b0cdc31b4f5d023dad94f6a19cef6d 100644 (file)
@@ -239,10 +239,10 @@ static bool ath9k_htc_check_tx_aggr(struct ath9k_htc_priv *priv,
 {
        bool ret = false;
 
-       spin_lock_bh(&priv->tx_lock);
+       spin_lock_bh(&priv->tx.tx_lock);
        if ((tid < ATH9K_HTC_MAX_TID) && (ista->tid_state[tid] == AGGR_STOP))
                ret = true;
-       spin_unlock_bh(&priv->tx_lock);
+       spin_unlock_bh(&priv->tx.tx_lock);
 
        return ret;
 }
@@ -257,7 +257,7 @@ void ath9k_tx_tasklet(unsigned long data)
        struct sk_buff *skb = NULL;
        __le16 fc;
 
-       while ((skb = skb_dequeue(&priv->tx_queue)) != NULL) {
+       while ((skb = skb_dequeue(&priv->tx.tx_queue)) != NULL) {
 
                hdr = (struct ieee80211_hdr *) skb->data;
                fc = hdr->frame_control;
@@ -292,9 +292,9 @@ void ath9k_tx_tasklet(unsigned long data)
 
                                if (ath9k_htc_check_tx_aggr(priv, ista, tid)) {
                                        ieee80211_start_tx_ba_session(sta, tid, 0);
-                                       spin_lock_bh(&priv->tx_lock);
+                                       spin_lock_bh(&priv->tx.tx_lock);
                                        ista->tid_state[tid] = AGGR_PROGRESS;
-                                       spin_unlock_bh(&priv->tx_lock);
+                                       spin_unlock_bh(&priv->tx.tx_lock);
                                }
                        }
                }
@@ -307,16 +307,16 @@ void ath9k_tx_tasklet(unsigned long data)
        }
 
        /* Wake TX queues if needed */
-       spin_lock_bh(&priv->tx_lock);
-       if (priv->tx_queues_stop) {
-               priv->tx_queues_stop = false;
-               spin_unlock_bh(&priv->tx_lock);
+       spin_lock_bh(&priv->tx.tx_lock);
+       if (priv->tx.tx_queues_stop) {
+               priv->tx.tx_queues_stop = false;
+               spin_unlock_bh(&priv->tx.tx_lock);
                ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT,
                        "Waking up TX queues\n");
                ieee80211_wake_queues(priv->hw);
                return;
        }
-       spin_unlock_bh(&priv->tx_lock);
+       spin_unlock_bh(&priv->tx.tx_lock);
 }
 
 void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb,
@@ -348,13 +348,13 @@ void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb,
        if (txok)
                tx_info->flags |= IEEE80211_TX_STAT_ACK;
 
-       skb_queue_tail(&priv->tx_queue, skb);
+       skb_queue_tail(&priv->tx.tx_queue, skb);
        tasklet_schedule(&priv->tx_tasklet);
 }
 
 int ath9k_tx_init(struct ath9k_htc_priv *priv)
 {
-       skb_queue_head_init(&priv->tx_queue);
+       skb_queue_head_init(&priv->tx.tx_queue);
        return 0;
 }