From bd535d6d77a02d1ee64e61b8ffc9547cce00b81f Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Mon, 27 Aug 2007 10:42:39 +0800 Subject: [PATCH 31/31] iwlwifi: fix aggregation problem This patch fixes aggregation problem related to pick up wrong tx queue in wl4965_set_tx_status by using tid instead of tx queue number. This might also cause some invalid memory problem. Signed-off-by: Mohamed Abbas Signed-off-by: Zhu Yi --- drivers/net/wireless/iwl-4965.c | 20 +++++++++----------- drivers/net/wireless/iwl-base.c | 22 +++++++++++++--------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/iwl-4965.c b/drivers/net/wireless/iwl-4965.c index 697f52a..a78cc8c 100644 --- a/drivers/net/wireless/iwl-4965.c +++ b/drivers/net/wireless/iwl-4965.c @@ -2988,12 +2988,11 @@ static u8 iwl4964_tl_ba_avail(struct iwl_priv *priv) static void iwl4965_ba_status(struct iwl_priv *priv, u8 tid, enum HT_STATUS status); -static int iwl4965_perform_addba(struct iwl_priv *priv, u8 tid, - u32 length, u32 ba_timeout) +static int iwl4965_perform_addba(struct iwl_priv *priv, u8 tid, u32 length, + u32 ba_timeout) { - int rc = 0; + int rc; - IWL_WARNING("ZZZY we are staring Tx agg\n"); rc = ieee80211_start_BA_session(priv->hw, priv->bssid, tid); if (rc) iwl4965_ba_status(priv, tid, BA_STATUS_FAILURE); @@ -3003,18 +3002,18 @@ static int iwl4965_perform_addba(struct iwl_priv *priv, u8 tid, static int iwl4965_perform_delba(struct iwl_priv *priv, u8 tid) { - int rc = 0; + int rc; rc = ieee80211_stop_BA_session(priv->hw, priv->bssid, tid); - if (rc) iwl4965_ba_status(priv, tid, BA_STATUS_FAILURE); + return rc; } static void iwl4965_turn_on_agg_for_tid(struct iwl_priv *priv, - struct iwl_lq_mngr *lq, - u8 auto_agg, u8 tid) + struct iwl_lq_mngr *lq, + u8 auto_agg, u8 tid) { u32 tid_msk = (1 << tid); unsigned long flags; @@ -4114,7 +4113,7 @@ static int iwl4965_tx_status_reply_compressed_ba(struct iwl_priv *priv, ack = bitmap0 & (1 << i); IWL_DEBUG_TX_REPLY("%s ON i=%d idx=%d raw=%d\n", ack? "ACK":"NACK", i, idx, agg->start_idx + i); - iwl4965_set_tx_status(priv, ba_resp->tid, idx, ack, 1, + iwl4965_set_tx_status(priv, agg->txq_id, idx, ack, 1, agg->rate_n_flags); } @@ -4415,8 +4414,7 @@ static u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv, ht_info->extension_chan_offset)); } -void iwl4965_set_rxon_ht(struct iwl_priv *priv, - struct sta_ht_info *ht_info) +void iwl4965_set_rxon_ht(struct iwl_priv *priv, struct sta_ht_info *ht_info) { struct iwl_rxon_cmd *rxon = &priv->staging_rxon; u32 val; diff --git a/drivers/net/wireless/iwl-base.c b/drivers/net/wireless/iwl-base.c index 6cee62d..4b80728 100644 --- a/drivers/net/wireless/iwl-base.c +++ b/drivers/net/wireless/iwl-base.c @@ -3642,16 +3642,16 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv, agg->bitmap0 = agg->bitmap1 = 0; if (agg->frame_count == 1) { + struct iwl_tx_queue *txq ; status = le32_to_cpu(frame_status[0]); - seq = status >> 16; - idx = SEQ_TO_INDEX(seq); - txq_id = SEQ_TO_QUEUE(seq); + txq_id = agg->txq_id; + txq = &priv->txq[txq_id]; /* FIXME: code repetition */ - IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n", - agg->frame_count, agg->start_idx, idx); + IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d \n", + agg->frame_count, agg->start_idx); - tx_status = &(priv->txq[txq_id].txb[idx].status); + tx_status = &(priv->txq[txq_id].txb[txq->q.last_used].status); tx_status->retry_count = tx_resp->failure_frame; tx_status->queue_number = status & 0xff; tx_status->queue_length = tx_resp->bt_kill_count; @@ -3663,8 +3663,8 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv, iwl_hw_get_rate_n_flags(tx_resp->rate_n_flags); /* FIXME: code repetition end */ - IWL_DEBUG_TX_REPLY("1 Frame 0x%x idx %d failure :%d\n", - status & 0xff, idx, tx_resp->failure_frame); + IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", + status & 0xff, tx_resp->failure_frame); IWL_DEBUG_TX_REPLY("Rate Info rate_n_flags=%x\n", iwl_hw_get_rate_n_flags(tx_resp->rate_n_flags)); @@ -3796,7 +3796,7 @@ static void iwl_rx_reply_tx(struct iwl_priv *priv, /* TODO: send BAR */ } - if (txq->q.last_used != (scd_ssn & 0xff)) { + if ((txq->q.last_used != (scd_ssn & 0xff))) { index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd); IWL_DEBUG_TX_REPLY("Retry scheduler reclaim scd_ssn " "%d index %d\n", scd_ssn , index); @@ -8289,6 +8289,10 @@ static int sta_ht_info_init(struct ieee80211_ht_capability *ht_cap, ht_info->ampdu_factor = param_info.max_rx_ampdu_factor; ht_info->mpdu_density = param_info.mpdu_density; + IWL_DEBUG_MAC80211("SISO mask 0x%X MIMO mask 0x%X \n", + ht_cap->supported_mcs_set[0], + ht_cap->supported_mcs_set[1]); + if (ht_info_ap) { ht_info->control_channel = ht_info_ap->control_channel; ht_info->extension_chan_offset = -- 1.5.2