aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-12-18 21:37:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:58:54 -0500
commit28afaf9139ce9f1c26452f34808e322e8e868850 (patch)
tree0688d63de5770ff0b227a192a2349fbee9c66836
parent4c897253cc9ae1c6a2798b27b5fe8e6d94ab6185 (diff)
iwlwifi: 3945 drop usage of union tsf
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-commands.h33
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c18
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 fe71e0aa3715..42ef51f4d126 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 {
173 __le32 is_valid; 173 __le32 is_valid;
174} __attribute__ ((packed)); 174} __attribute__ ((packed));
175 175
176union tsf {
177 u8 byte[8];
178 __le16 word[4];
179 __le32 dw[2];
180};
181
182/*
183 * REPLY_ERROR = 0x2 (response only, not a command)
184 */
185struct iwl3945_error_resp {
186 __le32 error_type;
187 u8 cmd_id;
188 u8 reserved1;
189 __le16 bad_cmd_seq_num;
190 __le16 reserved2;
191 __le32 error_info;
192 union tsf timestamp;
193} __attribute__ ((packed));
194
195/****************************************************************************** 176/******************************************************************************
196 * (1) 177 * (1)
197 * RXON Commands & Responses: 178 * RXON Commands & Responses:
@@ -246,18 +227,6 @@ struct iwl3945_rxon_assoc_cmd {
246} __attribute__ ((packed)); 227} __attribute__ ((packed));
247 228
248/* 229/*
249 * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
250 */
251struct iwl3945_rxon_time_cmd {
252 union tsf timestamp;
253 __le16 beacon_interval;
254 __le16 atim_window;
255 __le32 beacon_init_val;
256 __le16 listen_interval;
257 __le16 reserved;
258} __attribute__ ((packed));
259
260/*
261 * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) 230 * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
262 */ 231 */
263struct iwl3945_channel_switch_cmd { 232struct iwl3945_channel_switch_cmd {
@@ -783,7 +752,7 @@ struct iwl3945_rx_packet {
783 struct iwl3945_tx_resp tx_resp; 752 struct iwl3945_tx_resp tx_resp;
784 struct iwl_spectrum_notification spectrum_notif; 753 struct iwl_spectrum_notification spectrum_notif;
785 struct iwl_csa_notification csa_notif; 754 struct iwl_csa_notification csa_notif;
786 struct iwl3945_error_resp err_resp; 755 struct iwl_error_resp err_resp;
787 struct iwl_card_state_notif card_state_notif; 756 struct iwl_card_state_notif card_state_notif;
788 struct iwl3945_beacon_notif beacon_status; 757 struct iwl3945_beacon_notif beacon_status;
789 struct iwl_add_sta_resp add_sta; 758 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 1c9e126dd23e..12ead3887020 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -337,7 +337,7 @@ struct iwl3945_cmd {
337 u16 val16; 337 u16 val16;
338 u32 val32; 338 u32 val32;
339 struct iwl_bt_cmd bt; 339 struct iwl_bt_cmd bt;
340 struct iwl3945_rxon_time_cmd rxon_time; 340 struct iwl_rxon_time_cmd rxon_time;
341 struct iwl_powertable_cmd powertable; 341 struct iwl_powertable_cmd powertable;
342 struct iwl_qosparam_cmd qosparam; 342 struct iwl_qosparam_cmd qosparam;
343 struct iwl3945_tx_cmd tx; 343 struct iwl3945_tx_cmd tx;
@@ -754,7 +754,7 @@ struct iwl3945_priv {
754 struct fw_desc ucode_boot; /* bootstrap inst */ 754 struct fw_desc ucode_boot; /* bootstrap inst */
755 755
756 756
757 struct iwl3945_rxon_time_cmd rxon_timing; 757 struct iwl_rxon_time_cmd rxon_timing;
758 758
759 /* We declare this const so it can only be 759 /* We declare this const so it can only be
760 * changed via explicit cast within the 760 * changed via explicit cast within the
@@ -844,8 +844,7 @@ struct iwl3945_priv {
844 struct sk_buff *ibss_beacon; 844 struct sk_buff *ibss_beacon;
845 845
846 /* Last Rx'd beacon timestamp */ 846 /* Last Rx'd beacon timestamp */
847 u32 timestamp0; 847 u64 timestamp;
848 u32 timestamp1;
849 u16 beacon_int; 848 u16 beacon_int;
850 struct iwl3945_driver_hw_info hw_setting; 849 struct iwl3945_driver_hw_info hw_setting;
851 struct ieee80211_vif *vif; 850 struct ieee80211_vif *vif;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 0be3e7d97149..621e0877ca28 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2058,13 +2058,10 @@ static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv)
2058 conf = ieee80211_get_hw_conf(priv->hw); 2058 conf = ieee80211_get_hw_conf(priv->hw);
2059 2059
2060 spin_lock_irqsave(&priv->lock, flags); 2060 spin_lock_irqsave(&priv->lock, flags);
2061 priv->rxon_timing.timestamp.dw[1] = cpu_to_le32(priv->timestamp1); 2061 priv->rxon_timing.timestamp = cpu_to_le64(priv->timestamp);
2062 priv->rxon_timing.timestamp.dw[0] = cpu_to_le32(priv->timestamp0);
2063
2064 priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL; 2062 priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL;
2065 2063
2066 tsf = priv->timestamp1; 2064 tsf = priv->timestamp;
2067 tsf = ((tsf << 32) | priv->timestamp0);
2068 2065
2069 beacon_int = priv->beacon_int; 2066 beacon_int = priv->beacon_int;
2070 spin_unlock_irqrestore(&priv->lock, flags); 2067 spin_unlock_irqrestore(&priv->lock, flags);
@@ -6306,7 +6303,7 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
6306 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 6303 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
6307 iwl3945_commit_rxon(priv); 6304 iwl3945_commit_rxon(priv);
6308 6305
6309 memset(&priv->rxon_timing, 0, sizeof(struct iwl3945_rxon_time_cmd)); 6306 memset(&priv->rxon_timing, 0, sizeof(struct iwl_rxon_time_cmd));
6310 iwl3945_setup_rxon_timing(priv); 6307 iwl3945_setup_rxon_timing(priv);
6311 rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING, 6308 rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING,
6312 sizeof(priv->rxon_timing), &priv->rxon_timing); 6309 sizeof(priv->rxon_timing), &priv->rxon_timing);
@@ -6686,7 +6683,7 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv)
6686 iwl3945_commit_rxon(priv); 6683 iwl3945_commit_rxon(priv);
6687 6684
6688 /* RXON Timing */ 6685 /* RXON Timing */
6689 memset(&priv->rxon_timing, 0, sizeof(struct iwl3945_rxon_time_cmd)); 6686 memset(&priv->rxon_timing, 0, sizeof(struct iwl_rxon_time_cmd));
6690 iwl3945_setup_rxon_timing(priv); 6687 iwl3945_setup_rxon_timing(priv);
6691 rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING, 6688 rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING,
6692 sizeof(priv->rxon_timing), &priv->rxon_timing); 6689 sizeof(priv->rxon_timing), &priv->rxon_timing);
@@ -6934,9 +6931,7 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
6934 if (bss_conf->assoc) { 6931 if (bss_conf->assoc) {
6935 priv->assoc_id = bss_conf->aid; 6932 priv->assoc_id = bss_conf->aid;
6936 priv->beacon_int = bss_conf->beacon_int; 6933 priv->beacon_int = bss_conf->beacon_int;
6937 priv->timestamp0 = bss_conf->timestamp & 0xFFFFFFFF; 6934 priv->timestamp = bss_conf->timestamp;
6938 priv->timestamp1 = (bss_conf->timestamp >> 32) &
6939 0xFFFFFFFF;
6940 priv->assoc_capability = bss_conf->assoc_capability; 6935 priv->assoc_capability = bss_conf->assoc_capability;
6941 priv->next_scan_jiffies = jiffies + 6936 priv->next_scan_jiffies = jiffies +
6942 IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; 6937 IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
@@ -7178,8 +7173,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7178 priv->ibss_beacon = NULL; 7173 priv->ibss_beacon = NULL;
7179 7174
7180 priv->beacon_int = priv->hw->conf.beacon_int; 7175 priv->beacon_int = priv->hw->conf.beacon_int;
7181 priv->timestamp1 = 0; 7176 priv->timestamp = 0;
7182 priv->timestamp0 = 0;
7183 if ((priv->iw_mode == NL80211_IFTYPE_STATION)) 7177 if ((priv->iw_mode == NL80211_IFTYPE_STATION))
7184 priv->beacon_int = 0; 7178 priv->beacon_int = 0;
7185 7179