iwlwifi: Endianity fix for iwl4965_handle_data_packet function
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/4 iwlwifi: Endianity fix for iwl4965_handle_data_packet function
From: Tomas Winkler <[email protected]>
This patch fixes endianity issue in iwl4965_handle_data_packet function.
Signed-off-by Tomas Winkler <[email protected]>
Signed-off-by Zhu Yi <[email protected]>
--- drivers/net/wireless/iwl-4965.c | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-)
drivers/net/wireless/iwl-4965.c +12 -13
@@ -3588,10 +3588,10 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,struct iwl4965_rx_phy_res *rx_start = (include_phy) ? (struct iwl4965_rx_phy_res *)&(pkt->u.raw[0 ]) :NULL ;struct ieee80211_hdr *hdr; -unsigned int len; -u32 *rx_end; +u16 len; +__le32 *rx_end;unsigned int skblen; -u32 ampd_status; +u32 ampdu_status;if (!include_phy && priv->last_phy_res[0 ]) rx_start = (struct iwl4965_rx_phy_res *)&priv->last_phy_res[1 ];
@@ -3604,9 +3604,9 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data, hdr = (struct ieee80211_hdr *)((u8 *) & rx_start[1 ] + rx_start->cfg_phy_cnt); - len = rx_start->byte_count; + len =le16_to_cpu (rx_start->byte_count); - rx_end = (u32 *) ((u8 *) & pkt->u.raw[0 ] + + rx_end = (__le32 *) ((u8 *) & pkt->u.raw[0 ] +sizeof (struct iwl4965_rx_phy_res ) + rx_start->cfg_phy_cnt + len);
@@ -3614,20 +3614,19 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,struct iwl4965_rx_mpdu_res_start *amsdu = (struct iwl4965_rx_mpdu_res_start *)pkt->u.raw; - hdr = (void *)(pkt->u.raw + + hdr = (struct ieee80211_hdr *)(pkt->u.raw +sizeof (struct iwl4965_rx_mpdu_res_start )); - len = amsdu->byte_count; - rx_end = (u32 *) (((u8 *) hdr) + len); - rx_start->byte_count = len; + len =le16_to_cpu (amsdu->byte_count); + rx_start->byte_count = amsdu->byte_count; + rx_end = (__le32 *) (((u8 *) hdr) + len); }if (len >2342 || len <16 ) {IWL_DEBUG_DROP ("byte count out of range [16,2342]" " : %d\n" , len);return ; - } - ampd_status = *rx_end; + ampdu_status =le32_to_cpu (*rx_end); skblen = ((u8 *) rx_end - (u8 *) & pkt->u.raw[0 ]) +sizeof (u32);/* start from MAC */
@@ -3644,7 +3643,7 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,if (priv->iw_mode ==IEEE80211_IF_TYPE_MNTR ) {if (iwl_param_hwcrypto)iwl_set_decrypted_flag (priv, rxb->skb, - ampd_status, stats); + ampdu_status, stats);iwl_handle_data_packet_monitor (priv, rxb, hdr, len, stats,0 );return ; }
@@ -3653,7 +3652,7 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data, hdr = (struct ieee80211_hdr *)rxb->skb->data;if (iwl_param_hwcrypto) -iwl_set_decrypted_flag (priv, rxb->skb, ampd_status, stats); +iwl_set_decrypted_flag (priv, rxb->skb, ampdu_status, stats);ieee80211_rx_irqsafe (priv->hw, rxb->skb, stats); priv->alloc_rxb_skb--;
Signature · 1 line
1.5.2
PATCH 2/4 iwlwifi: Endianity fix in iwl4965_calc_rssi function
From: Tomas Winkler <[email protected]>
This patch fixes endianity issues in iwl4965_calc_rssi function.
Signed-off-by Tomas Winkler <[email protected]>
Signed-off-by Zhu Yi <[email protected]>
--- drivers/net/wireless/iwl-4965.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/iwl-4965.c +4 -3
@@ -3670,11 +3670,12 @@ static int iwl4965_calc_rssi(struct iwl4965_rx_phy_res *rx_resp)* contents are always there, not configurable by host. */ struct iwl4965_rx_non_cfg_phy *ncphy = (struct iwl4965_rx_non_cfg_phy *)rx_resp->non_cfg_phy; -u32 agc = (ncphy->agc_info &IWL_AGC_DB_MASK ) >>IWL_AGC_DB_POS ; +u32 agc = (le16_to_cpu (ncphy->agc_info) &IWL_AGC_DB_MASK ) + >>IWL_AGC_DB_POS ;u32 valid_antennae = - (rx_resp->phy_flags &RX_PHY_FLAGS_ANTENNAE_MASK ) >> -RX_PHY_FLAGS_ANTENNAE_OFFSET ; + (le16_to_cpu (rx_resp->phy_flags) &RX_PHY_FLAGS_ANTENNAE_MASK ) + >>RX_PHY_FLAGS_ANTENNAE_OFFSET ;u8 max_rssi =0 ;u32 i;
Signature · 1 line
1.5.2
PATCH 3/4 iwlwifi: TX aggregation fix
From: Tomas Winkler <[email protected]>
This patch fixes driver crash in case when one of aggregated packets was aborted.
Signed-off-by Tomas Winkler <[email protected]>
Signed-off-by Zhu Yi <[email protected]>
--- drivers/net/wireless/iwl-base.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/iwl-base.c +8 -2
@@ -3595,8 +3595,14 @@ int iwl4965_tx_status_reply_tx(struct iwl_priv *priv, idx =SEQ_TO_INDEX (seq); txq_id =SEQ_TO_QUEUE (seq); +if (status & + (AGG_TX_STATE_FEW_BYTES_MSK | +AGG_TX_STATE_ABORT_MSK )) +continue ; +IWL_DEBUG_TX_REPLY ("FrameCnt = %d, txq_id=%d idx=%d\n" , agg->frame_count, txq_id, idx); + hdr =iwl_tx_queue_get_hdr (priv, txq_id, idx);if (idx != (SEQ_TO_SN (hdr->seq_ctrl) &0xff )) {
@@ -3611,7 +3617,6 @@ int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,IWL_DEBUG_TX_REPLY ("AGG Frame i=%d idx %d seq=%d\n" , i, idx,SEQ_TO_SN (hdr->seq_ctrl)); - sh = idx - start;if (sh >64 ) { sh = (start - idx) +0xff ;
@@ -3640,7 +3645,8 @@ int iwl4965_tx_status_reply_tx(struct iwl_priv *priv, agg->start_idx, agg->bitmap0); - agg->wait_for_ba =1 ; +if (bitmap) + agg->wait_for_ba =1 ; }return 0 ; }
Signature · 1 line
1.5.2
PATCH 4/4 iwlwifi: Update version iwl-base.c stamp to 0.1.8
Signed-off-by Zhu Yi <[email protected]>
--- drivers/net/wireless/iwl-base.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/iwl-base.c +1 -1
@@ -106,7 +106,7 @@ BUILD_BUG()#define VS #endif -#define IWLWIFI_VERSION "0.1.6k" VD VS +#define IWLWIFI_VERSION "0.1.8k" VD VS#define DRV_COPYRIGHT "Copyright(c) 2003-2007 Intel Corporation"#define DRV_VERSION IWLWIFI_VERSION
Signature · 1 line
1.5.2