diff mbox

[RFC] iwlagn: reenable AP mode

Message ID [email protected] (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

John W. Linville Nov. 10, 2009, 1:30 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 2bbd04d..d02874e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -558,9 +558,17 @@  static void iwl_bg_beacon_update(struct work_struct *work)
 {
 	struct iwl_priv *priv =
 		container_of(work, struct iwl_priv, beacon_update);
-	struct sk_buff *beacon;
+	struct sk_buff *beacon, *skb;
 
-	/* Pull updated AP beacon from mac80211. will fail if not in AP mode */
+	/* Tx buffered bcast/mcast traffic. */
+	skb = ieee80211_get_buffered_bc(priv->hw, priv->vif);
+	while (skb) {
+		if (iwl_tx_skb(priv, skb))
+			dev_kfree_skb_any(skb);
+		skb = ieee80211_get_buffered_bc(priv->hw, priv->vif);
+	}
+
+	/* Pull updated AP beacon from mac80211. */
 	beacon = ieee80211_beacon_get(priv->hw, priv->vif);
 
 	if (!beacon) {
@@ -2316,7 +2324,8 @@  static int iwl_setup_mac(struct iwl_priv *priv)
 	hw->flags = IEEE80211_HW_SIGNAL_DBM |
 		    IEEE80211_HW_NOISE_DBM |
 		    IEEE80211_HW_AMPDU_AGGREGATION |
-		    IEEE80211_HW_SPECTRUM_MGMT;
+		    IEEE80211_HW_SPECTRUM_MGMT |
+		    IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING;
 
 	if (!priv->cfg->broken_powersave)
 		hw->flags |= IEEE80211_HW_SUPPORTS_PS |
@@ -2324,6 +2333,7 @@  static int iwl_setup_mac(struct iwl_priv *priv)
 
 	hw->sta_data_size = sizeof(struct iwl_station_priv);
 	hw->wiphy->interface_modes =
+		BIT(NL80211_IFTYPE_AP) |
 		BIT(NL80211_IFTYPE_STATION) |
 		BIT(NL80211_IFTYPE_ADHOC);