Search Linux Wireless

[RFT] ar9170: AP broadcast buffering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch should fix "broadcast traffic before DTIM beacon",
But there is a downside: the broadcast (e.g arp) frames
might get delayed and won't make it in time.

let me know, if this patch does any good, or not...
---
diff --git a/drivers/net/wireless/ath/ar9170/ar9170.h b/drivers/net/wireless/ath/ar9170/ar9170.h
index b99a8c2..c3d1349 100644
--- a/drivers/net/wireless/ath/ar9170/ar9170.h
+++ b/drivers/net/wireless/ath/ar9170/ar9170.h
@@ -176,6 +176,7 @@ struct ar9170 {
 	/* beaconing */
 	struct sk_buff *beacon;
 	struct work_struct beacon_work;
+	struct work_struct cab_work;
 	bool enable_beacon;
 
 	/* cryptographic engine */
@@ -278,6 +279,7 @@ int ar9170_set_basic_rates(struct ar9170 *ar);
 int ar9170_set_hwretry_limit(struct ar9170 *ar, u32 max_retry);
 int ar9170_update_beacon(struct ar9170 *ar);
 void ar9170_new_beacon(struct work_struct *work);
+void ar9170_send_buffered(struct work_struct *work);
 int ar9170_upload_key(struct ar9170 *ar, u8 id, const u8 *mac, u8 ktype,
 		      u8 keyidx, u8 *keydata, int keylen);
 int ar9170_disable_key(struct ar9170 *ar, u8 id);
diff --git a/drivers/net/wireless/ath/ar9170/mac.c b/drivers/net/wireless/ath/ar9170/mac.c
index 857e861..805b4f4 100644
--- a/drivers/net/wireless/ath/ar9170/mac.c
+++ b/drivers/net/wireless/ath/ar9170/mac.c
@@ -463,7 +463,6 @@ void ar9170_new_beacon(struct work_struct *work)
 {
 	struct ar9170 *ar = container_of(work, struct ar9170,
 					 beacon_work);
-	struct sk_buff *skb;
 
 	if (unlikely(!IS_STARTED(ar)))
 		return ;
@@ -475,6 +474,24 @@ void ar9170_new_beacon(struct work_struct *work)
 
 	ar9170_update_beacon(ar);
 
+ out:
+	mutex_unlock(&ar->mutex);
+}
+
+void ar9170_send_buffered(struct work_struct *work)
+{
+	struct ar9170 *ar = container_of(work, struct ar9170,
+					 cab_work);
+	struct sk_buff *skb;
+
+	if (unlikely(!IS_STARTED(ar)))
+		return ;
+
+	mutex_lock(&ar->mutex);
+
+	if (!ar->vif)
+		goto out;
+
 	rcu_read_lock();
 	while ((skb = ieee80211_get_buffered_bc(ar->hw, ar->vif)))
 		ar9170_op_tx(ar->hw, skb);
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 20f04ab..f027d74 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -660,6 +660,10 @@ void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)
 		 * YY always 00
 		 * B1-B4 "should" be the number of send out beacons.
 		 */
+
+		if (ar->vif && ar->vif->type == NL80211_IFTYPE_AP)
+			ieee80211_queue_work(ar->hw, &ar->cab_work);
+
 		break;
 
 	case 0xc3:
@@ -1294,6 +1298,7 @@ static void ar9170_op_stop(struct ieee80211_hw *hw)
 	cancel_delayed_work_sync(&ar->led_work);
 #endif
 	cancel_work_sync(&ar->beacon_work);
+	cancel_work_sync(&ar->cab_work);
 
 	mutex_lock(&ar->mutex);
 
@@ -2549,6 +2554,7 @@ void *ar9170_alloc(size_t priv_size)
 	}
 	ar9170_rx_reset_rx_mpdu(ar);
 	INIT_WORK(&ar->beacon_work, ar9170_new_beacon);
+	INIT_WORK(&ar->cab_work, ar9170_send_buffered);
 	INIT_DELAYED_WORK(&ar->tx_janitor, ar9170_tx_janitor);
 	INIT_LIST_HEAD(&ar->tx_ampdu_list);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux