Skip to contentSkip to conversation

iwlwifi: replace 0x8086 with PCI_VENDOR_ID_INTEL

PATCH In review Reinette Chatre 3 participants 6 messages Nov 7, 2007 – Nov 9, 2007 2 messages not in the archive Networking drivers (wireless)

lore
Share & tools
lore
#1 lore raw

PATCH 1/5 iwlwifi: replace 0x8086 with PCI_VENDOR_ID_INTEL

In reply to a message not in the archive

From: Zhu Yi <[email protected]>

Replace 0x8086 with PCI_VENDOR_ID_INTEL for PCI_DEVICE declaration.

---
 drivers/net/wireless/iwlwifi/iwl-3945.c |    4 ++--
 drivers/net/wireless/iwlwifi/iwl-4965.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945.c +2 -2
index e9cb40e..101b970 100644
@@ -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}
 };
 
drivers/net/wireless/iwlwifi/iwl-4965.c +2 -2
index fed2357..620f125 100644
@@ -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}
 };
 
Signature · 1 line
1.5.2.5
#2 lore raw

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.

---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +8 -5
index 5189788..19d1b05 100644
@@ -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) {
Signature · 1 line
1.5.2.5
#4 lore raw

PATCH 4/5 remove unused iwl4965_init_hw_rates function

In reply to a message not in the archive

From: Zhu Yi <[email protected]>

The patch removes the unused function to fix a recursive bug caused by namespace change.

---
 drivers/net/wireless/iwlwifi/iwl-4965.c     |    8 --------
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    2 --
 2 files changed, 0 insertions(+), 10 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +0 -8
index f7c5ac3..9b8560d 100644
@@ -4269,14 +4269,6 @@ static int iwl4965_tx_queue_agg_disable(struct iwl4965_priv *priv, u16 txq_id,
 
 #endif/* CONFIG_IWL4965_HT_AGG */
 #endif /* CONFIG_IWL4965_HT */
-/*
- * RATE SCALE CODE
- */
-int iwl4965_init_hw_rates(struct iwl4965_priv *priv, struct ieee80211_rate *rates)
-{
-	return 0;
-}
-
 
 /**
  * iwl4965_add_station - Initialize a station's hardware rate table
drivers/net/wireless/iwlwifi/iwl4965-base.c +0 -2
index 7549224..64366c8 100644
@@ -5626,8 +5626,6 @@ static void iwl4965_init_hw_rates(struct iwl4965_priv *priv,
 		if (IWL_BASIC_RATES_MASK & (1 << i))
 			rates[i].flags |= IEEE80211_RATE_BASIC;
 	}
-
-	iwl4965_init_hw_rates(priv, rates);
 }
 
 /**
Signature · 1 line
1.5.2.5
#5 lore raw

PATCH 5/5 MAINTAINERS: Add Reinette Chatre to iwlwifi & ipw2100/ipw2200

Also fix Zhu Yi's name.

---
 MAINTAINERS |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
MAINTAINERS +8 -2
index 498e890..f300a65 100644
@@ -2039,10 +2039,12 @@ W:	http://sourceforge.net/projects/e1000/
 S:	Supported
 
 INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
-P:	Yi Zhu
+P:	Zhu Yi
 M:	[email protected]
 P:	James Ketrenos
 M:	[email protected]
+P:	Reinette Chatre
+M:	[email protected]
 L:	[email protected]
 L:	[email protected]
 L:	http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
@@ -2050,10 +2052,12 @@ W:	http://ipw2100.sourceforge.net
 S:	Supported
 
 INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
-P:	Yi Zhu
+P:	Zhu Yi
 M:	[email protected]
 P:	James Ketrenos
 M:	[email protected]
+P:	Reinette Chatre
+M:	[email protected]
 L:	[email protected]
 L:	[email protected]
 L:	http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
@@ -2063,6 +2067,8 @@ S:	Supported
 INTEL WIRELESS WIFI LINK (iwlwifi)
 P:	Zhu Yi
 M:	[email protected]
+P:	Reinette Chatre
+M:	[email protected]
 L:	[email protected]
 L:	[email protected]
 W:	http://intellinuxwireless.org
Signature · 1 line
1.5.2.5
#6 lore raw

Re: [PATCH 3/5] iwlwifi: cleanup namespace

In reply to a message not in the archive
Quoted 5 lines · Reinette Chatre

From: Christoph Hellwig <[email protected]>

Prefix all symbols with iwl3945_ or iwl4965_ and thus allow building the driver into the kernel. Also remove all the useless default statements in Kconfig while we're at it.

Any chance we can get this whole patch series into 2.6.24? It's just a blind cleanup of the symbols and having two new drivers that can't be built into the kernel or loaded into the kernel is rather embarassing.

#7 lore raw

Re: [PATCH 3/5] iwlwifi: cleanup namespace

Quoted 4 lines · Christoph Hellwig

Any chance we can get this whole patch series into 2.6.24? It's just a blind cleanup of the symbols and having two new drivers that can't be built into the kernel or loaded into the kernel is rather embarassing.

No. It's not a that "simple" cleanup. We actually found a endless recursive bug in your previous patch (already fixed in this one). There is a static iwl_init_hw_rates() in iwl4965-base.c and there is also a public iwl4965_init_hw_rates() in iwl-4965.c. When you do the string replacement, it became a endless recursive for iwl4965_init_hw_rates().

Furthermore, although both of the drivers can be built into kernel at the same time, it is useless if you do so now. Because if you make a network driver build in the kernel, it is initialized in a very early stage (before hd, sata). Currently the iwlwifi drivers (I think also other wireless drivers) load the firmware in pci_probe(), we have to move it to interface open() time to resolve this problem. But this is not so easy as it looks like: iwlwifi drivers cannot get MAC address before firmware is loaded and running, but mac80211 requires MAC address from the driver when ieee80211_register_hw() is called. ieee80211_register_hw() creates the wlan0 interface. You have no interface if you don't call ieee80211_register_hw() at pci_probe()...

I'll come up a patch to delay the device MAC address get until wlan0->start() is called for mac80211. So that I can delay the firmware loading from pci probe to interface open time for iwlwifi drivers. In conclusion, the patch only makes iwlwifi drivers compile but not work for the kernel build in case. More patches will come. And we have to target it for 2.6.25.

Thanks,
-yi