Skip to contentSkip to conversation

ssb/b43(legacy): clean dangling cores workarounds

PATCH New Rafał Miłecki 3 participants 9 messages May 8, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ssb/b43(legacy): clean dangling cores workarounds

There is no perfect place for this workarounds, but keeping it in ssb sounds more reasonable.
1) We already have in ssb similar workarounds for different cores
2) We do not register not working devices in system
3) We do not duplicate code in b43 and b43legacy

Rafał Miłecki (3):
ssb: update list of devices supporting multiple 80211 cores
b43: drop ssb-duplicated workaround for dangling cores
b43legacy: drop ssb-duplicated workaround for dangling cores

 drivers/net/wireless/b43/main.c       |   17 -----------------
 drivers/net/wireless/b43legacy/main.c |   18 ------------------
 drivers/ssb/scan.c                    |    5 ++++-
 3 files changed, 4 insertions(+), 36 deletions(-)
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/3 ssb: update list of devices supporting multiple 80211 cores

---
 drivers/ssb/scan.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/ssb/scan.c +4 -1
index 7dca719..45e5bab 100644
@@ -258,7 +258,10 @@ static int we_support_multiple_80211_cores(struct ssb_bus *bus)
 #ifdef CONFIG_SSB_PCIHOST
 	if (bus->bustype == SSB_BUSTYPE_PCI) {
 		if (bus->host_pci->vendor == PCI_VENDOR_ID_BROADCOM &&
-		    bus->host_pci->device == 0x4324)
+		    ((bus->host_pci->device == 0x4313) ||
+		     (bus->host_pci->device == 0x431A) ||
+		     (bus->host_pci->device == 0x4321) ||
+		     (bus->host_pci->device == 0x4324)))
 			return 1;
 	}
 #endif /* CONFIG_SSB_PCIHOST */
Signature · 1 line
1.7.3.4
#2 lore raw

PATCH 2/3 b43: drop ssb-duplicated workaround for dangling cores

In reply to Rafał Miłecki
---
 drivers/net/wireless/b43/main.c |   17 -----------------
 1 files changed, 0 insertions(+), 17 deletions(-)
drivers/net/wireless/b43/main.c +0 -17
index f907df0..b02fbab 100644
@@ -4837,25 +4837,8 @@ static void b43_one_core_detach(struct ssb_device *dev)
 static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl)
 {
 	struct b43_wldev *wldev;
-	struct pci_dev *pdev;
 	int err = -ENOMEM;
 
-	if (!list_empty(&wl->devlist)) {
-		/* We are not the first core on this chip. */
-		pdev = (dev->bus->bustype == SSB_BUSTYPE_PCI) ? dev->bus->host_pci : NULL;
-		/* Only special chips support more than one wireless
-		 * core, although some of the other chips have more than
-		 * one wireless core as well. Check for this and
-		 * bail out early.
-		 */
-		if (!pdev ||
-		    ((pdev->device != 0x4321) &&
-		     (pdev->device != 0x4313) && (pdev->device != 0x431A))) {
-			b43dbg(wl, "Ignoring unconnected 802.11 core\n");
-			return -ENODEV;
-		}
-	}
-
 	wldev = kzalloc(sizeof(*wldev), GFP_KERNEL);
 	if (!wldev)
 		goto out;
Signature · 1 line
1.7.3.4
#3 lore raw

PATCH 3/3 b43legacy: drop ssb-duplicated workaround for dangling cores

In reply to Rafał Miłecki
---
 drivers/net/wireless/b43legacy/main.c |   18 ------------------
 1 files changed, 0 insertions(+), 18 deletions(-)
drivers/net/wireless/b43legacy/main.c +0 -18
index 2162663..f6d5446 100644
@@ -3696,26 +3696,8 @@ static int b43legacy_one_core_attach(struct ssb_device *dev,
 				     struct b43legacy_wl *wl)
 {
 	struct b43legacy_wldev *wldev;
-	struct pci_dev *pdev;
 	int err = -ENOMEM;
 
-	if (!list_empty(&wl->devlist)) {
-		/* We are not the first core on this chip. */
-		pdev = (dev->bus->bustype == SSB_BUSTYPE_PCI) ? dev->bus->host_pci : NULL;
-		/* Only special chips support more than one wireless
-		 * core, although some of the other chips have more than
-		 * one wireless core as well. Check for this and
-		 * bail out early.
-		 */
-		if (!pdev ||
-		    ((pdev->device != 0x4321) &&
-		     (pdev->device != 0x4313) &&
-		     (pdev->device != 0x431A))) {
-			b43legacydbg(wl, "Ignoring unconnected 802.11 core\n");
-			return -ENODEV;
-		}
-	}
-
 	wldev = kzalloc(sizeof(*wldev), GFP_KERNEL);
 	if (!wldev)
 		goto out;
Signature · 1 line
1.7.3.4
#4 lore raw

cover ssb/b43(legacy): clean dangling cores workarounds

In reply to Rafał Miłecki
Quoted 11 lines · Rafa? Mi?ecki

There is no perfect place for this workarounds, but keeping it in ssb sounds more reasonable.
1) We already have in ssb similar workarounds for different cores
2) We do not register not working devices in system
3) We do not duplicate code in b43 and b43legacy

Rafa? Mi?ecki (3):
ssb: update list of devices supporting multiple 80211 cores
b43: drop ssb-duplicated workaround for dangling cores
b43legacy: drop ssb-duplicated workaround for dangling cores

Quoted 4 lines
  drivers/net/wireless/b43/main.c       |   17 -----------------
  drivers/net/wireless/b43legacy/main.c |   18 ------------------
  drivers/ssb/scan.c                    |    5 ++++-
  3 files changed, 4 insertions(+), 36 deletions(-)

First of all, a minor grammatical mistake. It should be "this workaround" as there is only only one workaround discussed here.

Secondly, "we do not register not working" is a little awkward. "We do not register inactive devices..." would be better.

Finally, this commit message will never show up in the git commit logs. I think this info is valuable, thus it should be in the real commits.

My suggestion for the [1/3] patch is something like:

"Many of the BCM43xx chips contain cores that are attached to the SSB, but are inactive as they do not connect to the external environment. These must not be registered. Several of these types are handled in driver ssb; however, the specific case of an inactive 802.11 cores is now treated in b43 and b43legacy. Although the current setup works, this minor change will place all such workarounds in ssb, and simplify the code in drivers b43 and b43legacy."

In each of the other two patches, add a commit message something like:

"Remove the code to detect inactive 802.11 cores, as that function is now done in ssb."

I have not yet tested the patches, but will do so soon.

Larry

#5 lore raw

cover ssb/b43(legacy): clean dangling cores workarounds

2011/5/8 Larry Finger <[email protected]>:

Quoted 38 lines · Rafa? Mi?ecki
Quoted 13 lines

There is no perfect place for this workarounds, but keeping it in ssb sounds
more reasonable.
1) We already have in ssb similar workarounds for different cores
2) We do not register not working devices in system
3) We do not duplicate code in b43 and b43legacy

Rafa? Mi?ecki (3):
? ssb: update list of devices supporting multiple 80211 cores ? b43: drop ssb-duplicated workaround for dangling cores ? b43legacy: drop ssb-duplicated workaround for dangling cores

Quoted 4 lines
?drivers/net/wireless/b43/main.c ? ? ? | ? 17 -----------------
?drivers/net/wireless/b43legacy/main.c | ? 18 ------------------
?drivers/ssb/scan.c ? ? ? ? ? ? ? ? ? ?| ? ?5 ++++-

?3 files changed, 4 insertions(+), 36 deletions(-)

First of all, a minor grammatical mistake. It should be "this workaround" as there is only only one workaround discussed here.

Secondly, "we do not register not working" is a little awkward. "We do not register inactive devices..." would be better.

Finally, this commit message will never show up in the git commit logs. I think this info is valuable, thus it should be in the real commits.

My suggestion for the [1/3] patch is something like:

"Many of the BCM43xx chips contain cores that are attached to the SSB, but are inactive as they do not connect to the external environment. These must not be registered. Several of these types are handled in driver ssb; however, the specific case of an inactive 802.11 cores is now treated in b43 and b43legacy. Although the current setup works, this minor change will place all such workarounds in ssb, and simplify the code in drivers b43 and b43legacy."

Quoted 4 lines

In each of the other two patches, add a commit message something like:

"Remove the code to detect inactive 802.11 cores, as that function is now done in ssb."

Thank you for reviewing.

Quoted 1 line

I have not yet tested the patches, but will do so soon.

Oh, do you have some device with 2 active cores? Nice :)

Signature · 1 line
Rafa?
maintainer
#6 lore raw

cover ssb/b43(legacy): clean dangling cores workarounds

Quoted 1 line · Rafa? Mi?ecki

Oh, do you have some device with 2 active cores? Nice :)

I don't think there are any supported multicore devices anyway. Those are the very early A-PHY, only. AFAIK.

Signature · 1 line
Greetings Michael.
#7 lore raw

cover ssb/b43(legacy): clean dangling cores workarounds

Quoted 5 lines · Michael B?sch
Quoted 1 line · Rafa? Mi?ecki

Oh, do you have some device with 2 active cores? Nice :)

I don't think there are any supported multicore devices anyway. Those are the very early A-PHY, only. AFAIK.

Yes, I have a Linksys WPC54G Cardbus device that uses b43legacy.

The 'dmesg | egrep "ssb|b43"' output for it is

b43-pci-bridge 0000:06:00.0: PCI INT A -> Link[LNK1] -> GSI 11 (level, low) -> IRQ 11
ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x02, vendor 0x4243)
ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x04, vendor 0x4243)
ssb: Core 2 found: PCMCIA (cc 0x80D, rev 0x01, vendor 0x4243)
ssb: Core 3 found: V90 (cc 0x807, rev 0x01, vendor 0x4243)
ssb: Core 4 found: PCI (cc 0x804, rev 0x07, vendor 0x4243)
ssb: Core 5 found: IEEE 802.11 (cc 0x812, rev 0x04, vendor 0x4243)
ssb: Ignoring additional 802.11 core
ssb: chipcommon status is 0x0
ssb: SPROM offset is 0x1000
ssb: SPROM revision 1 detected.
ssb: Sonics Silicon Backplane found on PCI device 0000:06:00.0
b43legacy-phy0: Broadcom 4306 WLAN found
b43legacy-phy0 debug: Found PHY: Analog 1, Type 2, Revision 1 b43legacy-phy0 debug: Found Radio: Manuf 0x17F, Version 0x2050, Revision 2 b43legacy-phy0 debug: Radio initialized
b43legacy-phy0: Loading firmware version 0x127, patch level 14 (2005-04-18 02:36:27) b43legacy-phy0 debug: Chip initialized
b43legacy-phy0 debug: 30-bit DMA initialized
b43legacy-phy0 debug: Wireless interface started
b43legacy-phy0 debug: Adding Interface type 2

You can add a Tested-by: and an ACK to the patches.

Larry

#8 lore raw

cover ssb/b43(legacy): clean dangling cores workarounds

W dniu 8 maja 2011 20:34 u?ytkownik Larry Finger
<[email protected]> napisa?:

Quoted 37 lines · Michael B?sch
Quoted 7 lines · Rafa? Mi?ecki
Quoted 2 lines

Oh, do you have some device with 2 active cores? Nice :)

I don't think there are any supported multicore devices anyway. Those are the very early A-PHY, only. AFAIK.

Yes, I have a Linksys WPC54G Cardbus device that uses b43legacy.

The 'dmesg | egrep "ssb|b43"' output for it is

b43-pci-bridge 0000:06:00.0: PCI INT A -> Link[LNK1] -> GSI 11 (level, low) -> IRQ 11
ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x02, vendor 0x4243)
ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x04, vendor 0x4243)
ssb: Core 2 found: PCMCIA (cc 0x80D, rev 0x01, vendor 0x4243)
ssb: Core 3 found: V90 (cc 0x807, rev 0x01, vendor 0x4243)
ssb: Core 4 found: PCI (cc 0x804, rev 0x07, vendor 0x4243)
ssb: Core 5 found: IEEE 802.11 (cc 0x812, rev 0x04, vendor 0x4243)
ssb: Ignoring additional 802.11 core
ssb: chipcommon status is 0x0
ssb: SPROM offset is 0x1000
ssb: SPROM revision 1 detected.
ssb: Sonics Silicon Backplane found on PCI device 0000:06:00.0
b43legacy-phy0: Broadcom 4306 WLAN found
b43legacy-phy0 debug: Found PHY: Analog 1, Type 2, Revision 1 b43legacy-phy0 debug: Found Radio: Manuf 0x17F, Version 0x2050, Revision 2 b43legacy-phy0 debug: Radio initialized
b43legacy-phy0: Loading firmware version 0x127, patch level 14 (2005-04-18 02:36:27)
b43legacy-phy0 debug: Chip initialized
b43legacy-phy0 debug: 30-bit DMA initialized
b43legacy-phy0 debug: Wireless interface started
b43legacy-phy0 debug: Adding Interface type 2

Quoted 1 line

You can add a Tested-by: and an ACK to the patches.

John, is this something you can do easily? Or do you want me to resubmit patches with Larry's Tested?

Signature · 1 line
Rafa?