Linux wireless drivers development
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: linville@tuxdriver.com, johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net,
	Mohamed Abbas <mabbas@linux.intel.com>,
	Reinette Chatre <reinette.chatre@intel.com>
Subject: [PATCH 3/8] mac80211: enable driver to notify mac of status, change iwlwifi
Date: Fri, 28 Mar 2008 16:21:07 -0700	[thread overview]
Message-ID: <1206746472-10443-4-git-send-email-reinette.chatre@intel.com> (raw)
In-Reply-To: <1206746472-10443-3-git-send-email-reinette.chatre@intel.com>

From: Mohamed Abbas <mabbas@linux.intel.com>

Add new API to MAC80211 to allow low level driver to
notify MAC with driver status like comming from suspend
and HW rfkill. Modify iwlwifi driver to use new API.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    1 +
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    1 +
 include/net/mac80211.h                      |   24 ++++++++++++++++++++++
 net/mac80211/ieee80211_sta.c                |   29 +++++++++++++++++++++++++++
 4 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index ab635dc..02b4245 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -5869,6 +5869,7 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
 	if (priv->error_recovering)
 		iwl3945_error_recovery(priv);
 
+	ieee80211_notify_mac(priv->hw, TYPE_RE_ASSOC);
 	return;
 
  restart:
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 7f56565..96daece 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -5733,6 +5733,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, TYPE_RE_ASSOC);
 	return;
 
  restart:
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 48428a6..0679adc 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -74,6 +74,20 @@
  */
 
 /**
+ * enum ieee80211_notification_type - Low level driver notification
+ * @TYPE_RE_ASSOC: start the re-association sequence
+ * @TYPE_DISCONNECT: disconnect from current association
+ * @TYPE_RESET: low level driver HW problem reset
+ */
+enum ieee80211_notification_types {
+	TYPE_RE_ASSOC,
+	TYPE_DISCONNECT,
+	TYPE_RESET,
+	/* keep last */
+	NUM_IEEE80211_NOTIFICATION_TYPES
+};
+
+/**
  * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
  *
  * This structure describes most essential parameters needed
@@ -1663,4 +1677,14 @@ 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 sync mac80211
+ * with low level state.
+ */
+void ieee80211_notify_mac(struct ieee80211_hw *hw,
+			  enum ieee80211_notification_types  notif_type);
 #endif /* MAC80211_H */
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index f9cf2f1..b1c9a5a 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -4216,3 +4216,32 @@ 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 TYPE_RE_ASSOC:
+		rcu_read_lock();
+		list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+
+			/* No need to wake the master device. */
+			if (sdata->dev == local->mdev)
+				continue;
+
+			if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+				ieee80211_sta_req_auth(sdata->dev,
+						       &sdata->u.sta);
+			}
+
+		}
+		rcu_read_unlock();
+		break;
+	default:
+		break;
+	}
+}
+EXPORT_SYMBOL(ieee80211_notify_mac);
-- 
1.5.3.4


  reply	other threads:[~2008-03-28 23:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 23:21 [PATCH 0/8] iwlwifi driver updates including one mac80211 change Reinette Chatre
2008-03-28 23:21 ` [PATCH 1/8] iwlwifi: add notification infrastructure to iwlcore Reinette Chatre
2008-03-28 23:21   ` [PATCH 2/8] iwlwifi: hook iwlwifi with Linux rfkill Reinette Chatre
2008-03-28 23:21     ` Reinette Chatre [this message]
2008-03-28 23:21       ` [PATCH 4/8] iwlwifi: fix race condition during driver unload Reinette Chatre
2008-03-28 23:21         ` [PATCH 5/8] iwlwifi: move rate registration to module load Reinette Chatre
2008-03-28 23:21           ` [PATCH 6/8] iwlwifi: unregister to upper stack before releasing resources Reinette Chatre
2008-03-28 23:21             ` [PATCH 7/8] iwlwifi: LED initialize before registering Reinette Chatre
2008-03-28 23:21               ` [PATCH 8/8] iwlwifi: Fix synchronous host command Reinette Chatre
2008-03-28 23:41       ` [PATCH 3/8] mac80211: enable driver to notify mac of status, change iwlwifi Johannes Berg
2008-03-31 20:23     ` [PATCH 2/8] iwlwifi: hook iwlwifi with Linux rfkill Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1206746472-10443-4-git-send-email-reinette.chatre@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mabbas@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox