2007-11-07 06:06:30

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 1/5] iwlwifi: replace 0x8086 with PCI_VENDOR_ID_INTEL

From: Zhu Yi <[email protected]>

Replace 0x8086 with PCI_VENDOR_ID_INTEL for PCI_DEVICE declaration.

Signed-off-by: Zhu Yi <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-3945.c | 4 ++--
drivers/net/wireless/iwlwifi/iwl-4965.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index e9cb40e..101b970 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2267,8 +2267,8 @@ void iwl_hw_cancel_deferred_work(struct iwl_priv *priv)
}

struct pci_device_id iwl_hw_card_ids[] = {
- {PCI_DEVICE(0x8086, 0x4222)},
- {PCI_DEVICE(0x8086, 0x4227)},
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4222)},
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4227)},
{0}
};

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index fed2357..620f125 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -4690,8 +4690,8 @@ void iwl_hw_cancel_deferred_work(struct iwl_priv *priv)
}

struct pci_device_id iwl_hw_card_ids[] = {
- {PCI_DEVICE(0x8086, 0x4229)},
- {PCI_DEVICE(0x8086, 0x4230)},
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4229)},
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4230)},
{0}
};

--
1.5.2.5


2007-11-07 06:06:31

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH 2/5] iwl4965: fix cannot find a suitable rate issue

From: Mohamed Abbas <[email protected]>

This patch fixes the iwl4965 problem for "Can not find a suitable rate
issues." by making rs_switch_to_mimo and rs_switch_to_siso functions
return -1 when CONFIG_IWL4965_HT is not selected. They used to return 0,
which means we can switch to HT rate causing the rate scale problem and
the error message.

The patch also fix another bug reported by Ben Cahill that it uses wrong
value for max_success_limit.

Signed-off-by: Mohamed Abbas <[email protected]>
Signed-off-by: Zhu Yi <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 5189788..19d1b05 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -782,7 +782,7 @@ static void rs_set_stay_in_table(u8 is_legacy,
if (is_legacy) {
lq_data->table_count_limit = IWL_LEGACY_TABLE_COUNT;
lq_data->max_failure_limit = IWL_LEGACY_FAILURE_LIMIT;
- lq_data->max_success_limit = IWL_LEGACY_TABLE_COUNT;
+ lq_data->max_success_limit = IWL_LEGACY_SUCCESS_LIMIT;
} else {
lq_data->table_count_limit = IWL_NONE_LEGACY_TABLE_COUNT;
lq_data->max_failure_limit = IWL_NONE_LEGACY_FAILURE_LIMIT;
@@ -937,9 +937,10 @@ static int rs_switch_to_mimo(struct iwl_priv *priv,

IWL_DEBUG_HT("LQ: Switch to new mcs %X index is green %X\n",
tbl->current_rate.rate_n_flags, is_green);
-
-#endif /*CONFIG_IWL4965_HT */
return 0;
+#else
+ return -1;
+#endif /*CONFIG_IWL4965_HT */
}

static int rs_switch_to_siso(struct iwl_priv *priv,
@@ -991,9 +992,11 @@ static int rs_switch_to_siso(struct iwl_priv *priv,
rs_mcs_from_tbl(&tbl->current_rate, tbl, rate, is_green);
IWL_DEBUG_HT("LQ: Switch to new mcs %X index is green %X\n",
tbl->current_rate.rate_n_flags, is_green);
+ return 0;
+#else
+ return -1;

#endif /*CONFIG_IWL4965_HT */
- return 0;
}

static int rs_move_legacy_other(struct iwl_priv *priv,
@@ -1282,7 +1285,7 @@ static void rs_stay_in_table(struct iwl_rate_scale_priv *lq_data)
lq_data->total_failed = 0;
lq_data->total_success = 0;
lq_data->flush_timer = 0;
- } else if (lq_data->table_count > 0) {
+ } else {
lq_data->table_count++;
if (lq_data->table_count >=
lq_data->table_count_limit) {
--
1.5.2.5