Linux wireless drivers development
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net,
	Tomas Winkler <tomas.winkler@intel.com>,
	Reinette Chatre <reinette.chatre@intel.com>
Subject: [PATCH 06/43] iwlwifi: 3945 drop usage of union tsf
Date: Fri, 19 Dec 2008 10:37:06 +0800	[thread overview]
Message-ID: <1229654263-21454-7-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <1229654263-21454-6-git-send-email-yi.zhu@intel.com>

From: Tomas Winkler <tomas.winkler@intel.com>

This patch replaces union tsf with u64
This also allows to use iwl_error_res
and iwl_rxon_time_cmd instead of 3945 structures

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-3945-commands.h |   33 +---------------------
 drivers/net/wireless/iwlwifi/iwl-3945.h          |    7 ++--
 drivers/net/wireless/iwlwifi/iwl3945-base.c      |   18 ++++--------
 3 files changed, 10 insertions(+), 48 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
index fe71e0a..42ef51f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
@@ -173,25 +173,6 @@ struct iwl3945_alive_resp {
 	__le32 is_valid;
 } __attribute__ ((packed));
 
-union tsf {
-	u8 byte[8];
-	__le16 word[4];
-	__le32 dw[2];
-};
-
-/*
- * REPLY_ERROR = 0x2 (response only, not a command)
- */
-struct iwl3945_error_resp {
-	__le32 error_type;
-	u8 cmd_id;
-	u8 reserved1;
-	__le16 bad_cmd_seq_num;
-	__le16 reserved2;
-	__le32 error_info;
-	union tsf timestamp;
-} __attribute__ ((packed));
-
 /******************************************************************************
  * (1)
  * RXON Commands & Responses:
@@ -246,18 +227,6 @@ struct iwl3945_rxon_assoc_cmd {
 } __attribute__ ((packed));
 
 /*
- * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
- */
-struct iwl3945_rxon_time_cmd {
-	union tsf timestamp;
-	__le16 beacon_interval;
-	__le16 atim_window;
-	__le32 beacon_init_val;
-	__le16 listen_interval;
-	__le16 reserved;
-} __attribute__ ((packed));
-
-/*
  * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
  */
 struct iwl3945_channel_switch_cmd {
@@ -783,7 +752,7 @@ struct iwl3945_rx_packet {
 		struct iwl3945_tx_resp tx_resp;
 		struct iwl_spectrum_notification spectrum_notif;
 		struct iwl_csa_notification csa_notif;
-		struct iwl3945_error_resp err_resp;
+		struct iwl_error_resp err_resp;
 		struct iwl_card_state_notif card_state_notif;
 		struct iwl3945_beacon_notif beacon_status;
 		struct iwl_add_sta_resp add_sta;
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 1c9e126..12ead38 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -337,7 +337,7 @@ struct iwl3945_cmd {
 		u16 val16;
 		u32 val32;
 		struct iwl_bt_cmd bt;
-		struct iwl3945_rxon_time_cmd rxon_time;
+		struct iwl_rxon_time_cmd rxon_time;
 		struct iwl_powertable_cmd powertable;
 		struct iwl_qosparam_cmd qosparam;
 		struct iwl3945_tx_cmd tx;
@@ -754,7 +754,7 @@ struct iwl3945_priv {
 	struct fw_desc ucode_boot;	/* bootstrap inst */
 
 
-	struct iwl3945_rxon_time_cmd rxon_timing;
+	struct iwl_rxon_time_cmd rxon_timing;
 
 	/* We declare this const so it can only be
 	 * changed via explicit cast within the
@@ -844,8 +844,7 @@ struct iwl3945_priv {
 	struct sk_buff *ibss_beacon;
 
 	/* Last Rx'd beacon timestamp */
-	u32 timestamp0;
-	u32 timestamp1;
+	u64 timestamp;
 	u16 beacon_int;
 	struct iwl3945_driver_hw_info hw_setting;
 	struct ieee80211_vif *vif;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 0764f37..5f90445 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2060,13 +2060,10 @@ static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv)
 	conf = ieee80211_get_hw_conf(priv->hw);
 
 	spin_lock_irqsave(&priv->lock, flags);
-	priv->rxon_timing.timestamp.dw[1] = cpu_to_le32(priv->timestamp1);
-	priv->rxon_timing.timestamp.dw[0] = cpu_to_le32(priv->timestamp0);
-
+	priv->rxon_timing.timestamp = cpu_to_le64(priv->timestamp);
 	priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL;
 
-	tsf = priv->timestamp1;
-	tsf = ((tsf << 32) | priv->timestamp0);
+	tsf = priv->timestamp;
 
 	beacon_int = priv->beacon_int;
 	spin_unlock_irqrestore(&priv->lock, flags);
@@ -6318,7 +6315,7 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
 	priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
 	iwl3945_commit_rxon(priv);
 
-	memset(&priv->rxon_timing, 0, sizeof(struct iwl3945_rxon_time_cmd));
+	memset(&priv->rxon_timing, 0, sizeof(struct iwl_rxon_time_cmd));
 	iwl3945_setup_rxon_timing(priv);
 	rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING,
 			      sizeof(priv->rxon_timing), &priv->rxon_timing);
@@ -6699,7 +6696,7 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv)
 		iwl3945_commit_rxon(priv);
 
 		/* RXON Timing */
-		memset(&priv->rxon_timing, 0, sizeof(struct iwl3945_rxon_time_cmd));
+		memset(&priv->rxon_timing, 0, sizeof(struct iwl_rxon_time_cmd));
 		iwl3945_setup_rxon_timing(priv);
 		rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING,
 				sizeof(priv->rxon_timing), &priv->rxon_timing);
@@ -6949,9 +6946,7 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
 		if (bss_conf->assoc) {
 			priv->assoc_id = bss_conf->aid;
 			priv->beacon_int = bss_conf->beacon_int;
-			priv->timestamp0 = bss_conf->timestamp & 0xFFFFFFFF;
-			priv->timestamp1 = (bss_conf->timestamp >> 32) &
-					     0xFFFFFFFF;
+			priv->timestamp = bss_conf->timestamp;
 			priv->assoc_capability = bss_conf->assoc_capability;
 			priv->next_scan_jiffies = jiffies +
 					IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
@@ -7195,8 +7190,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
 	priv->ibss_beacon = NULL;
 
 	priv->beacon_int = priv->hw->conf.beacon_int;
-	priv->timestamp1 = 0;
-	priv->timestamp0 = 0;
+	priv->timestamp = 0;
 	if ((priv->iw_mode == NL80211_IFTYPE_STATION))
 		priv->beacon_int = 0;
 
-- 
1.5.3.6


  reply	other threads:[~2008-12-19  2:45 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-19  2:37 [PATCH 00/43] iwl3945 merges into iwlagn (Dec 19) Zhu Yi
2008-12-19  2:37 ` [PATCH 01/43] iwlwifi: 3945 extract flow handler definitions into iwl-3945-fh.h Zhu Yi
2008-12-19  2:37   ` [PATCH 02/43] iwlwifi: 3945 unfold iwl-3945-commands.h Zhu Yi
2008-12-19  2:37     ` [PATCH 03/43] iwlwifi: 3945 remove current_rate from station entry Zhu Yi
2008-12-19  2:37       ` [PATCH 04/43] iwlwifi: use iwl-commands.h also in 3945 Zhu Yi
2008-12-19  2:37         ` [PATCH 05/43] iwlwifi: 3945 remove duplicated code from iwl-3945-commands.h Zhu Yi
2008-12-19  2:37           ` Zhu Yi [this message]
2008-12-19  2:37             ` [PATCH 07/43] iwlwifi: 3945 remove iwl-3945-commands.h Zhu Yi
2008-12-19  2:37               ` [PATCH 08/43] iwl3945: Getting rid of iwl-3945-debug.h Zhu Yi
2008-12-19  2:37                 ` [PATCH 09/43] iwl3945: Remove DRV_NAME dependenies Zhu Yi
2008-12-19  2:37                   ` [PATCH 10/43] iwl3945: Getting rid of iwl3945_eeprom_channel Zhu Yi
2008-12-19  2:37                     ` [PATCH 11/43] iwl3945: Have consistant and not redefined HW constants Zhu Yi
2008-12-19  2:37                       ` [PATCH 12/43] iwl3945: Use iwl-agn-rs.h rates definitions Zhu Yi
2008-12-19  2:37                         ` [PATCH 13/43] iwl3945: Getting rid of iwl-3945-led.h Zhu Yi
2008-12-19  2:37                           ` [PATCH 14/43] iwl3945: Remove power related definitions from 3945 code Zhu Yi
2008-12-19  2:37                             ` [PATCH 15/43] iwl3945: iwl3945_queue and iwl3945_channel_info replacement Zhu Yi
2008-12-19  2:37                               ` [PATCH 16/43] iwlwifi: emliminate iwl3945_mac_get_stats mac80211 handler Zhu Yi
2008-12-19  2:37                                 ` [PATCH 17/43] iwl3945: Change IWLWIFI_VERSION constant name Zhu Yi
2008-12-19  2:37                                   ` [PATCH 18/43] iwl3945: include iwl-core.h Zhu Yi
2008-12-19  2:37                                     ` [PATCH 19/43] iwl3945: replace iwl_3945_cfg with iwl_cfg Zhu Yi
2008-12-19  2:37                                       ` [PATCH 20/43] iwl3945: move structures from iwl-3945.h to iwl-dev.h Zhu Yi
2008-12-19  2:37                                         ` [PATCH 21/43] iwl3945: remove duplicate structures from iwl-3945.h Zhu Yi
2008-12-19  2:37                                           ` [PATCH 22/43] iwl3945: replace iwl3945_broadcast_addr with iwl_bcast_addr Zhu Yi
2008-12-19  2:37                                             ` [PATCH 23/43] iwlwifi: beautify code Zhu Yi
2008-12-19  2:37                                               ` [PATCH 24/43] iwl3945: use iwl_rx_mem_buffer Zhu Yi
2008-12-19  2:37                                                 ` [PATCH 25/43] iwl3945: use iwl_rx_queue in iwl3945 Zhu Yi
2008-12-19  2:37                                                   ` [PATCH 26/43] iwl3945: use iwl_hw_params in iwl3945_priv Zhu Yi
2008-12-19  2:37                                                     ` [PATCH 27/43] iwl3945: rename iwl3945_priv variables Zhu Yi
2008-12-19  2:37                                                       ` [PATCH 28/43] iwl3945: replaces iwl3945_priv with iwl_priv Zhu Yi
2008-12-19  2:37                                                         ` [PATCH 29/43] iwl3945: use iwl-io.h and delete iwl-3945-io.h Zhu Yi
2008-12-19  2:37                                                           ` [PATCH 30/43] iwlwifi: add more comments to IWL_DL_xx Zhu Yi
2008-12-19  2:37                                                             ` [PATCH 31/43] iwlwifi: clean up printing Zhu Yi
2008-12-19  2:37                                                               ` [PATCH 32/43] iwlwifi: replace IWL_WARNING with IWL_WARN Zhu Yi
2008-12-19  2:37                                                                 ` [PATCH 33/43] iwlwifi: replace IWL_ERROR with IWL_ERR Zhu Yi
2008-12-19  2:37                                                                   ` [PATCH 34/43] iwlwifi: use iwl_cmd instead of iwl3945_cmd Zhu Yi
2008-12-19  2:37                                                                     ` [PATCH 35/43] iwl3945: use iwl_mod_params for 3945 Zhu Yi
2008-12-19  2:37                                                                       ` [PATCH 36/43] iwl3945: cleanup and remove duplicate code Zhu Yi
2008-12-19  2:37                                                                         ` [PATCH 37/43] iwl3945: add load ucode op Zhu Yi
2008-12-19  2:37                                                                           ` [PATCH 38/43] iwl3945: add apm ops Zhu Yi
2008-12-19  2:37                                                                             ` [PATCH 39/43] iwl3945: add set_pwr_src Zhu Yi
2008-12-19  2:37                                                                               ` [PATCH 40/43] iwl3945: simplify iwl3945_pci_probe Zhu Yi
2008-12-19  2:37                                                                                 ` [PATCH 41/43] iwl3945: release resources before shutting down Zhu Yi
2008-12-19  2:37                                                                                   ` [PATCH 42/43] iwl3945: use iwl_get_hw_mode Zhu Yi
2008-12-19  2:37                                                                                     ` [PATCH 43/43] iwl3945: use iwl_rb_status Zhu Yi
2008-12-19 19:32 ` [PATCH 00/43] iwl3945 merges into iwlagn (Dec 19) drago01
2008-12-19 20:51   ` Luis R. Rodriguez
2008-12-19 21:15     ` drago01
2008-12-19 21:20       ` Stefanik Gábor
2008-12-22  3:55   ` Zhu Yi
2008-12-22  6:57     ` [ipw3945-devel] " Rafał Miłecki
2008-12-19 21:08 ` Maxim Levitsky

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=1229654263-21454-7-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=reinette.chatre@intel.com \
    --cc=tomas.winkler@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