 +                        sta_found=sta_pos;
 +                        if(tid)
 +                        {
-+#ifdef TID_SLEEPING_DEBUG                               
++#ifdef CPTCFG_ATH_DEBUG                               
 +                            printk("ath_tx_start: STA found 2");
 +#endif                            
 +                            tid_sleep_tid_force_sleep=sta_found->

 
 		/*
 		 * Add this frame to software queue for scheduling later
@@ -2218,9 +2438,16 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
 		 */
 		TX_STAT_INC(txq->axq_qnum, a_queued_sw);
 		__skb_queue_tail(&tid->buf_q, skb);
-		if (!txctl->an->sleeping)
+#ifdef TID_SLEEPING
+		if (!txctl->an->sleeping && tid_sleep_tid_force_sleep==false) {
+#else
+		if (!txctl->an->sleeping) {
+#endif        
+#ifdef TID_SLEEPING_DEBUG   
+            printk("ath_tx_start: This frame will be sent\n");
+#endif            
 			ath_tx_queue_tid(txq, tid);

 		ac = tid->ac;
 		txq = ac->txq;
 
@@ -2178,6 +2323,14 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
 	struct ath_buf *bf;
 	int q;
 	int ret;
+    
+#ifdef CPTCFG_ATH9K_TID_SLEEPING
+	struct tid_sleep_sta_sleep_ctl *sta_pos, *sta_n, *sta_found;
+    bool tid_sleep_tid_force_sleep=false;
+    sta_found = 0;
