Skip to contentSkip to conversation

ath5k: AHB port. Add AHB bus support.

PATCH Wojciech Dubowik 2 participants 2 messages Nov 15, 2010 1 message not in the archive Atheros ATH5K wireless driver

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 16 lines · Felix Fietkau
Quoted 6 lines · Wojciech Dubowik
Quoted 5 lines
Quoted 3 lines

Having both in the kernel is completely pointless. There are no devices
that can support both, nor will there ever be.

I agree. The only advantage would be that some of the typos and

missing

Quoted 1 line
Quoted 1 line

functions in either of the files would be detected during compile

time.

Compile-testing coverage is a fine reason to allow people to compile both modules. Ok, I accept that it's a bit of a pain to create separate
modules, but can we at least do it like:

Quoted 9 lines

ath5k-$(CONFIG_ATH5K_PCI) += pci.o
ath5k-$(CONFIG_ATH5K_AHB) += ahb.o

and add the appropriate selects and mutual exclusion to the Kconfig? Of course, that presupposes a Kconfig entry for CONFIG_ATHEROS_AR2316 where there is not one currently.

Signature · 1 line
Bob Copeland %% www.bobcopeland.com

What about such changes compared to original patch? It's then possible to compile both modules at the same time. Of course linking won't work because I would need to separate functions like in ath9k.

---

drivers/net/wireless/ath/ath5k/Kconfig +14 -1
index eb83b7b..eba97f8 100644
@@ -1,9 +1,11 @@
 config ATH5K
        tristate "Atheros 5xxx wireless cards support"
-       depends on PCI && MAC80211
+       depends on (PCI || ATHEROS_AR231X) && MAC80211
        select MAC80211_LEDS
        select LEDS_CLASS
        select NEW_LEDS
+       select ATH5K_AHB if ATHEROS_AR231X
+       select ATH5K_PCI if PCI
        ---help---
          This module adds support for wireless adapters based on
          Atheros 5xxx chipset.
@@ -37,3 +39,14 @@ config ATH5K_DEBUG
 
          modprobe ath5k debug=0x00000400
 
+config ATH5K_AHB
+       bool "Atheros 5xxx AHB bus support"
+       depends on ATHEROS_AR231X
+       ---help---
+       This adds support for WiSoC type chipsets of the 5xxx family
+
+config ATH5K_PCI
+       bool "Atheros 5xxx PCI bus support"
+       depends on PCI
+       ---help---
+       This adds support for PCI type chipsets of the 5xxx family
drivers/net/wireless/ath/ath5k/Makefile +2 -1
index 50d5e08..a16b178 100644
@@ -15,5 +15,6 @@ ath5k-y                               += rfkill.o
 ath5k-y                                += ani.o
 ath5k-y                                += sysfs.o
 ath5k-$(CONFIG_ATH5K_DEBUG)    += debug.o
-ath5k-y                                += $(if $(CONFIG_ATHEROS_AR231X),ahb,pci).o
+ath5k-$(CONFIG_ATH5K_PCI)      += pci.o
+ath5k-$(CONFIG_ATH5K_AHB)      += ahb.o
 obj-$(CONFIG_ATH5K)            += ath5k.o
#2 lore raw
Quoted 3 lines · Wojciech Dubowik

What about such changes compared to original patch? It's then possible to compile both modules at the same time. Of course linking won't work because I would need to separate functions like in ath9k.

Is there a plan to add a config entry for ATHEROS_AR231X (or did I miss it?) Someone will one day run their Kconfig checker and report it missing.

drivers/net/wireless/ath/ath5k/Kconfig line 8

Quoted 12 lines
drivers/net/wireless/ath/ath5k/Kconfig +3 -1
@@ -1,9 +1,11 @@
 config ATH5K
        tristate "Atheros 5xxx wireless cards support"
-       depends on PCI && MAC80211
+       depends on (PCI || ATHEROS_AR231X) && MAC80211
        select MAC80211_LEDS
        select LEDS_CLASS
        select NEW_LEDS
+       select ATH5K_AHB if ATHEROS_AR231X
+       select ATH5K_PCI if PCI

I like this better, but there probably needs to be a mutual exclusion so that randconfig builds don't break. Then you don't get to build both still, but the resulting Makefile is a bit more normal. And then if someone shows up saying that they really do have some AR231X device with PCI, then it's more obvious what they need to do to fix it (i.e. separate bus interfaces from core).

Something like?
select ATH5K_PCI if (PCI && !ATHEROS_AR231X)
or
depends on ((PCI && !ATHEROS_AR231X) || (!PCI && ATHEROS_AR231X)) ...

Signature · 1 line
Bob Copeland %% www.bobcopeland.com