mac80211: notify mac from low level driver (iwlwifi)
authorMohamed Abbas <mabbas@linux.intel.com>
Fri, 4 Apr 2008 23:59:58 +0000 (16:59 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 8 Apr 2008 20:44:43 +0000 (16:44 -0400)
Add new API to MAC80211 to allow low level driver to
notify MAC with driver status.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/net/wireless/iwlwifi/iwl4965-base.c
include/net/mac80211.h
net/mac80211/ieee80211_sta.c

index 5e51cfcda39f141b350066f3c512da401502513e..29a9ecdcbf35f627a7924fe13c6b9adda9ccfa3d 100644 (file)
@@ -5886,6 +5886,7 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
        if (priv->error_recovering)
                iwl3945_error_recovery(priv);
 
+       ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
        return;
 
  restart:
index b043871d53f12841328f616cf0780ab545fb41bf..06e44dad5f02026244801f576b4ddfc1446b2181 100644 (file)
@@ -5714,6 +5714,7 @@ static void iwl4965_alive_start(struct iwl_priv *priv)
                iwl4965_error_recovery(priv);
 
        iwlcore_low_level_notify(priv, IWLCORE_START_EVT);
+       ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
        return;
 
  restart:
index 999f970da6ba6983a41b599419c30ef89ce9a16f..079e7bd86c903f1c1c691ca5b9368e73d6e37c73 100644 (file)
  * not do so then mac80211 may add this under certain circumstances.
  */
 
+/**
+ * enum ieee80211_notification_type - Low level driver notification
+ * @IEEE80211_NOTIFY_RE_ASSOC: start the re-association sequence
+ */
+enum ieee80211_notification_types {
+       IEEE80211_NOTIFY_RE_ASSOC,
+};
+
 /**
  * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
  *
@@ -1678,4 +1686,15 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
 void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
                                     u16 tid);
 
+/**
+ * ieee80211_notify_mac - low level driver notification
+ * @hw: pointer as obtained from ieee80211_alloc_hw().
+ * @notification_types: enum ieee80211_notification_types
+ *
+ * This function must be called by low level driver to inform mac80211 of
+ * low level driver status change or force mac80211 to re-assoc for low
+ * level driver internal error that require re-assoc.
+ */
+void ieee80211_notify_mac(struct ieee80211_hw *hw,
+                         enum ieee80211_notification_types  notif_type);
 #endif /* MAC80211_H */
index 9e30333aa81eca7ad7cdf12e28a8fcb6466a6c3c..89481c919cb6b4ebe01f049d1328857f95b273dd 100644 (file)
@@ -4225,3 +4225,26 @@ int ieee80211_sta_disassociate(struct net_device *dev, u16 reason)
        ieee80211_set_disassoc(dev, ifsta, 0);
        return 0;
 }
+
+void ieee80211_notify_mac(struct ieee80211_hw *hw,
+                         enum ieee80211_notification_types  notif_type)
+{
+       struct ieee80211_local *local = hw_to_local(hw);
+       struct ieee80211_sub_if_data *sdata;
+
+       switch (notif_type) {
+       case IEEE80211_NOTIFY_RE_ASSOC:
+               rcu_read_lock();
+               list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+
+                       if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+                               ieee80211_sta_req_auth(sdata->dev,
+                                                      &sdata->u.sta);
+                       }
+
+               }
+               rcu_read_unlock();
+               break;
+       }
+}
+EXPORT_SYMBOL(ieee80211_notify_mac);