aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-03-31 11:59:17 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-04-09 14:28:16 -0400
commit05d5752027d02ca9204d1ece5074d41000fee23d (patch)
tree24efb80f55111f6588a13e5a0df300db7d176d56 /drivers/net
parent76c3c698bf47927fb31044fa2f4321c99ed7411d (diff)
iwlwifi: clean up last_phy_res
The last_phy_res[100] variable is used in an odd way. The first byte of it is used as a flag, and the rest as the data. Thus, the array need only be 61 bytes, since it is just the flag and a struct iwl_rx_phy_res (which is 60 bytes). Clean this up by splitting the variable into two: last_phy_res and last_phy_res_valid, using correct types for both (struct and bool). While doing all this also move the variables to the _agn part of the hw-specific union since they only apply to A-MPDUs. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h4
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 49e20f1acb7c..7f27a945c187 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1001,11 +1001,11 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv,
1001 phy_res->cfg_phy_cnt + len); 1001 phy_res->cfg_phy_cnt + len);
1002 ampdu_status = le32_to_cpu(rx_pkt_status); 1002 ampdu_status = le32_to_cpu(rx_pkt_status);
1003 } else { 1003 } else {
1004 if (!priv->last_phy_res[0]) { 1004 if (!priv->_agn.last_phy_res_valid) {
1005 IWL_ERR(priv, "MPDU frame without cached PHY data\n"); 1005 IWL_ERR(priv, "MPDU frame without cached PHY data\n");
1006 return; 1006 return;
1007 } 1007 }
1008 phy_res = (struct iwl_rx_phy_res *)&priv->last_phy_res[1]; 1008 phy_res = &priv->_agn.last_phy_res;
1009 amsdu = (struct iwl4965_rx_mpdu_res_start *)pkt->u.raw; 1009 amsdu = (struct iwl4965_rx_mpdu_res_start *)pkt->u.raw;
1010 header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*amsdu)); 1010 header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*amsdu));
1011 len = le16_to_cpu(amsdu->byte_count); 1011 len = le16_to_cpu(amsdu->byte_count);
@@ -1094,10 +1094,10 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv,
1094/* Cache phy data (Rx signal strength, etc) for HT frame (REPLY_RX_PHY_CMD). 1094/* Cache phy data (Rx signal strength, etc) for HT frame (REPLY_RX_PHY_CMD).
1095 * This will be used later in iwl_rx_reply_rx() for REPLY_RX_MPDU_CMD. */ 1095 * This will be used later in iwl_rx_reply_rx() for REPLY_RX_MPDU_CMD. */
1096void iwlagn_rx_reply_rx_phy(struct iwl_priv *priv, 1096void iwlagn_rx_reply_rx_phy(struct iwl_priv *priv,
1097 struct iwl_rx_mem_buffer *rxb) 1097 struct iwl_rx_mem_buffer *rxb)
1098{ 1098{
1099 struct iwl_rx_packet *pkt = rxb_addr(rxb); 1099 struct iwl_rx_packet *pkt = rxb_addr(rxb);
1100 priv->last_phy_res[0] = 1; 1100 priv->_agn.last_phy_res_valid = true;
1101 memcpy(&priv->last_phy_res[1], &(pkt->u.raw[0]), 1101 memcpy(&priv->_agn.last_phy_res, pkt->u.raw,
1102 sizeof(struct iwl_rx_phy_res)); 1102 sizeof(struct iwl_rx_phy_res));
1103} 1103}
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 95c2bc3c79ed..9466e909f553 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1120,7 +1120,6 @@ struct iwl_priv {
1120 __le16 sensitivity_tbl[HD_TABLE_SIZE]; 1120 __le16 sensitivity_tbl[HD_TABLE_SIZE];
1121 1121
1122 struct iwl_ht_config current_ht_config; 1122 struct iwl_ht_config current_ht_config;
1123 u8 last_phy_res[100];
1124 1123
1125 /* Rate scaling data */ 1124 /* Rate scaling data */
1126 u8 retry_rate; 1125 u8 retry_rate;
@@ -1237,6 +1236,9 @@ struct iwl_priv {
1237 * no AGGREGATION 1236 * no AGGREGATION
1238 */ 1237 */
1239 u8 agg_tids_count; 1238 u8 agg_tids_count;
1239
1240 struct iwl_rx_phy_res last_phy_res;
1241 bool last_phy_res_valid;
1240 } _agn; 1242 } _agn;
1241#endif 1243#endif
1242 }; 1244 };