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 1/8] iwlwifi: add notification infrastructure to iwlcore
Date: Fri, 28 Mar 2008 16:21:05 -0700	[thread overview]
Message-ID: <1206746472-10443-2-git-send-email-reinette.chatre@intel.com> (raw)
In-Reply-To: <1206746472-10443-1-git-send-email-reinette.chatre@intel.com>

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

This patch add notification function to be called by low level
iwl driver to notify iwlcore with current state. This function
will call iwlcore subsystem with the new state. This will
help make the code more consistent and easy to extend. For example
the rf-kill need to know when the driver in init, start, stop or
remove state. Instead doing the same call in 3945 and 4965, we
just do it from this function.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-core.c     |   21 +++++++++++++++++++++
 drivers/net/wireless/iwlwifi/iwl-core.h     |    9 +++++++++
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    6 ++++++
 3 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index da51349..342a269 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -249,3 +249,24 @@ int iwl_setup(struct iwl_priv *priv)
 }
 EXPORT_SYMBOL(iwl_setup);
 
+/* Low level driver call this function to update iwlcore with
+ * driver status.
+ */
+int iwlcore_low_level_notify(struct iwl_priv *priv,
+			      enum iwlcore_card_notify notify)
+{
+	switch (notify) {
+	case IWLCORE_INIT_EVT:
+		break;
+	case IWLCORE_START_EVT:
+		break;
+	case IWLCORE_STOP_EVT:
+		break;
+	case IWLCORE_REMOVE_EVT:
+		break;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL(iwlcore_low_level_notify);
+
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index ce7f90e..4dfa059 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -146,4 +146,13 @@ int iwl_send_cmd_pdu_async(struct iwl_priv *priv, u8 id, u16 len,
 					   struct iwl_cmd *cmd,
 					   struct sk_buff *skb));
 
+enum iwlcore_card_notify {
+	IWLCORE_INIT_EVT = 0,
+	IWLCORE_START_EVT = 1,
+	IWLCORE_STOP_EVT = 2,
+	IWLCORE_REMOVE_EVT = 3,
+};
+
+int iwlcore_low_level_notify(struct iwl_priv *priv,
+			     enum iwlcore_card_notify notify);
 #endif /* __iwl_core_h__ */
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index cf56b95..5261b61 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -5724,6 +5724,7 @@ static void iwl4965_alive_start(struct iwl_priv *priv)
 	if (priv->error_recovering)
 		iwl4965_error_recovery(priv);
 
+	iwlcore_low_level_notify(priv, IWLCORE_START_EVT);
 	return;
 
  restart:
@@ -5747,6 +5748,8 @@ static void __iwl4965_down(struct iwl_priv *priv)
 
 	iwl_leds_unregister(priv);
 
+	iwlcore_low_level_notify(priv, IWLCORE_STOP_EVT);
+
 	iwlcore_clear_stations_table(priv);
 
 	/* Unblock any waiting calls */
@@ -8167,6 +8170,8 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
 	pci_save_state(pdev);
 	pci_disable_device(pdev);
 
+	/* notify iwlcore to init */
+	iwlcore_low_level_notify(priv, IWLCORE_INIT_EVT);
 	return 0;
 
  out_remove_sysfs:
@@ -8209,6 +8214,7 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev)
 		}
 	}
 
+	iwlcore_low_level_notify(priv, IWLCORE_REMOVE_EVT);
 	iwl_dbgfs_unregister(priv);
 	sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group);
 
-- 
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 ` Reinette Chatre [this message]
2008-03-28 23:21   ` [PATCH 2/8] iwlwifi: hook iwlwifi with Linux rfkill Reinette Chatre
2008-03-28 23:21     ` [PATCH 3/8] mac80211: enable driver to notify mac of status, change iwlwifi Reinette Chatre
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-2-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