Commit 28afaf91 authored by Tomas Winkler's avatar Tomas Winkler Committed by John W. Linville

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: default avatarTomas Winkler <tomas.winkler@intel.com>
Acked-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4c897253
...@@ -173,25 +173,6 @@ struct iwl3945_alive_resp { ...@@ -173,25 +173,6 @@ struct iwl3945_alive_resp {
__le32 is_valid; __le32 is_valid;
} __attribute__ ((packed)); } __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) * (1)
* RXON Commands & Responses: * RXON Commands & Responses:
...@@ -245,18 +226,6 @@ struct iwl3945_rxon_assoc_cmd { ...@@ -245,18 +226,6 @@ struct iwl3945_rxon_assoc_cmd {
__le16 reserved; __le16 reserved;
} __attribute__ ((packed)); } __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) * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
*/ */
...@@ -783,7 +752,7 @@ struct iwl3945_rx_packet { ...@@ -783,7 +752,7 @@ struct iwl3945_rx_packet {
struct iwl3945_tx_resp tx_resp; struct iwl3945_tx_resp tx_resp;
struct iwl_spectrum_notification spectrum_notif; struct iwl_spectrum_notification spectrum_notif;
struct iwl_csa_notification csa_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 iwl_card_state_notif card_state_notif;
struct iwl3945_beacon_notif beacon_status; struct iwl3945_beacon_notif beacon_status;
struct iwl_add_sta_resp add_sta; struct iwl_add_sta_resp add_sta;
......
...@@ -337,7 +337,7 @@ struct iwl3945_cmd { ...@@ -337,7 +337,7 @@ struct iwl3945_cmd {
u16 val16; u16 val16;
u32 val32; u32 val32;
struct iwl_bt_cmd bt; 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_powertable_cmd powertable;
struct iwl_qosparam_cmd qosparam; struct iwl_qosparam_cmd qosparam;
struct iwl3945_tx_cmd tx; struct iwl3945_tx_cmd tx;
...@@ -754,7 +754,7 @@ struct iwl3945_priv { ...@@ -754,7 +754,7 @@ struct iwl3945_priv {
struct fw_desc ucode_boot; /* bootstrap inst */ 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 /* We declare this const so it can only be
* changed via explicit cast within the * changed via explicit cast within the
...@@ -844,8 +844,7 @@ struct iwl3945_priv { ...@@ -844,8 +844,7 @@ struct iwl3945_priv {
struct sk_buff *ibss_beacon; struct sk_buff *ibss_beacon;
/* Last Rx'd beacon timestamp */ /* Last Rx'd beacon timestamp */
u32 timestamp0; u64 timestamp;
u32 timestamp1;
u16 beacon_int; u16 beacon_int;
struct iwl3945_driver_hw_info hw_setting; struct iwl3945_driver_hw_info hw_setting;
struct ieee80211_vif *vif; struct ieee80211_vif *vif;
......
...@@ -2058,13 +2058,10 @@ static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv) ...@@ -2058,13 +2058,10 @@ static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv)
conf = ieee80211_get_hw_conf(priv->hw); conf = ieee80211_get_hw_conf(priv->hw);
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
priv->rxon_timing.timestamp.dw[1] = cpu_to_le32(priv->timestamp1); priv->rxon_timing.timestamp = cpu_to_le64(priv->timestamp);
priv->rxon_timing.timestamp.dw[0] = cpu_to_le32(priv->timestamp0);
priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL; priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL;
tsf = priv->timestamp1; tsf = priv->timestamp;
tsf = ((tsf << 32) | priv->timestamp0);
beacon_int = priv->beacon_int; beacon_int = priv->beacon_int;
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
...@@ -6306,7 +6303,7 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv) ...@@ -6306,7 +6303,7 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwl3945_commit_rxon(priv); 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); iwl3945_setup_rxon_timing(priv);
rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING, rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING,
sizeof(priv->rxon_timing), &priv->rxon_timing); sizeof(priv->rxon_timing), &priv->rxon_timing);
...@@ -6686,7 +6683,7 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv) ...@@ -6686,7 +6683,7 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv)
iwl3945_commit_rxon(priv); iwl3945_commit_rxon(priv);
/* RXON Timing */ /* 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); iwl3945_setup_rxon_timing(priv);
rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING, rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON_TIMING,
sizeof(priv->rxon_timing), &priv->rxon_timing); sizeof(priv->rxon_timing), &priv->rxon_timing);
...@@ -6934,9 +6931,7 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw, ...@@ -6934,9 +6931,7 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
if (bss_conf->assoc) { if (bss_conf->assoc) {
priv->assoc_id = bss_conf->aid; priv->assoc_id = bss_conf->aid;
priv->beacon_int = bss_conf->beacon_int; priv->beacon_int = bss_conf->beacon_int;
priv->timestamp0 = bss_conf->timestamp & 0xFFFFFFFF; priv->timestamp = bss_conf->timestamp;
priv->timestamp1 = (bss_conf->timestamp >> 32) &
0xFFFFFFFF;
priv->assoc_capability = bss_conf->assoc_capability; priv->assoc_capability = bss_conf->assoc_capability;
priv->next_scan_jiffies = jiffies + priv->next_scan_jiffies = jiffies +
IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
...@@ -7178,8 +7173,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw) ...@@ -7178,8 +7173,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
priv->ibss_beacon = NULL; priv->ibss_beacon = NULL;
priv->beacon_int = priv->hw->conf.beacon_int; priv->beacon_int = priv->hw->conf.beacon_int;
priv->timestamp1 = 0; priv->timestamp = 0;
priv->timestamp0 = 0;
if ((priv->iw_mode == NL80211_IFTYPE_STATION)) if ((priv->iw_mode == NL80211_IFTYPE_STATION))
priv->beacon_int = 0; priv->beacon_int = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment