2008-10-15 18:15:44

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 1/2] iwlwifi: protect headers from double inclusion

From: Tomas Winkler <[email protected]>

This patch protects iwl-csr.h and iwl-fh.h from double inclusion
by ifndef define endif idiom

Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-csr.h | 4 +++-
drivers/net/wireless/iwlwifi/iwl-fh.h | 3 +++
2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-csr.h b/drivers/net/wireless/iwlwifi/iwl-csr.h
index 662edf4..84f56a2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/iwlwifi/iwl-csr.h
@@ -60,6 +60,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
+#ifndef __iwl_csr_h__
+#define __iwl_csr_h__
/*=== CSR (control and status registers) ===*/
#define CSR_BASE (0x000)

@@ -286,4 +288,4 @@
#define HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED (0x00000004)


-
+#endif /* !__iwl_csr_h__ */
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h
index a72efdf..8c48d88 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fh.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fh.h
@@ -60,6 +60,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
+#ifndef __iwl_fh_h__
+#define __iwl_fh_h__

/****************************/
/* Flow Handler Definitions */
@@ -391,3 +393,4 @@
/* TCSR: tx_config register values */
#define FH_RSCSR_FRAME_SIZE_MSK (0x00003FFF) /* bits 0-13 */

+#endif /* !__iwl_fh_h__ */
--
1.5.4.3



2008-10-15 18:15:43

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 2/2] iwlwifi: don't update TFD free counter for invalid station

From: Tomas Winkler <[email protected]>

This patch makes sure that station table is not accessed
with invalid station id in 4965 TX response path

Signed-off-by: Tomas Winkler <[email protected]>
Reported-by: Johannes Berg <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-4965.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 7cf5e2c..b2d8647 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2236,7 +2236,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
tx_resp->failure_frame);

freed = iwl_tx_queue_reclaim(priv, txq_id, index);
- if (qc)
+ if (qc && likely(sta_id != IWL_INVALID_STATION))
priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;

if (priv->mac80211_registered &&
@@ -2244,7 +2244,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
ieee80211_wake_queue(priv->hw, txq_id);
}

- if (qc)
+ if (qc && likely(sta_id != IWL_INVALID_STATION))
iwl_txq_check_empty(priv, sta_id, tid, txq_id);

if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
--
1.5.4.3


2008-10-22 21:16:28

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 2/2] iwlwifi: don't update TFD free counter for invalid station

On Wed, Oct 15, 2008 at 11:06:24AM -0700, Reinette Chatre wrote:
> From: Tomas Winkler <[email protected]>
>
> This patch makes sure that station table is not accessed
> with invalid station id in 4965 TX response path
>
> Signed-off-by: Tomas Winkler <[email protected]>
> Reported-by: Johannes Berg <[email protected]>
> Signed-off-by: Reinette Chatre <[email protected]>

This doesn't apply, probably due to the merge failures mentioned
earlier.

John
--
John W. Linville Linux should be at the core
[email protected] of your literate lifestyle.