compat-drivers: add the MDIO module
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Tue, 4 Dec 2012 21:07:11 +0000 (21:07 +0000)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Tue, 4 Dec 2012 23:00:19 +0000 (15:00 -0800)
The alx Ethernet driver depends on the MDIO module.
This module has UAPI and kernel headers. The headers are
carried over intact to help *both* backport it for older
drivers and also provide the newer driver to other kernels
that may have it enabled after it was introduced in 2.6.31.

The way support for MDIO is enabled is by carrying over both
the UAPI and Linux kernel header files along with the module
with in compat-drivers. The exported symbols of the module
however are renamed with a compat_* prefix within compat
in include/linux/compat-2.6.31.h. This enables Linux
distributions shipping a driver that depends on older
versions of the MDIO to keep using it while allowing the
supplied drivers in compat-drivers to become users of
the newer module it likely will require a tighter
dependency on.

An alternative to using different exported symbol names
is for compat-drivers to work under a separate namespace
and while I hear some folks already implemented that support
we never got those patches sent to us.

C'est la vie.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
config.mk
scripts/admin-update.sh

index 2aefc40c040e755306c552cc1b62f535bf786c66..fa2ce67992ef636d7fe761463d37e36a609670fa 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -413,6 +413,9 @@ export CONFIG_ATL1E=m
 ifndef CONFIG_COMPAT_KERNEL_2_6_28
 export CONFIG_ATL1C=m
 export CONFIG_ALX=m
+# If MDIO is needed for another driver feel free to
+# make it not depend on 2.6.28
+export CONFIG_COMPAT_MDIO=m
 endif #CONFIG_COMPAT_KERNEL_2_6_28
 
 ifdef CONFIG_WIRELESS_EXT
index b2586c188ab53486fa01be6d668a646fb4daa64d..627a0264c3d87c69ad1bfa641eebca10ef1006a0 100755 (executable)
@@ -384,6 +384,9 @@ DRIVERS_ETH="drivers/net/ethernet/atheros
             drivers/net/ethernet/atheros/atl1e
             drivers/net/ethernet/atheros/atlx"
 
+# Ethernet drivers that have their own file alone
+DRIVERS_ETH_FILES="mdio.c"
+
 # Bluetooth drivers
 DRIVERS_BT="drivers/bluetooth"
 
@@ -612,11 +615,18 @@ if [[ "$ENABLE_NETWORK" == "1" ]]; then
        copyFiles "$DRIVERS_WLAN_FILES"                 "drivers/net/wireless"
        copyFiles "$RNDIS_REQUIREMENTS"                 "drivers/net/usb"
 
+       # Ethernet
+       copyFiles "$DRIVERS_ETH_FILES"                  "drivers/net/"
+       echo "compat_mdio-y                      += mdio.o" > drivers/net/Makefile
+       echo "obj-\$(CONFIG_COMPAT_MDIO)          += compat_mdio.o" >> drivers/net/Makefile
+       copyDirectories "$DRIVERS_ETH"
+       cp $GIT_TREE/include/linux/mdio.h include/linux/
+       cp $GIT_TREE/include/uapi/linux/mdio.h include/uapi/linux/
+
        copyDirectories "$NET_WLAN_DIRS"
        copyDirectories "$NET_BT_DIRS"
        copyDirectories "$DRIVERS_BT"
        copyDirectories "$DRIVERS_WLAN"
-       copyDirectories "$DRIVERS_ETH"
 
        cp -a $GIT_TREE/include/linux/ssb include/linux/
        cp -a $GIT_TREE/include/linux/bcma include/linux/