From: Luis R. Rodriguez Date: Tue, 4 Dec 2012 21:07:11 +0000 (+0000) Subject: compat-drivers: add the MDIO module X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=966eaf82824f442bf4e0fea0639613a13e680df4;p=openwrt%2Fstaging%2Fblogic.git compat-drivers: add the MDIO module 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 --- diff --git a/config.mk b/config.mk index 2aefc40c040e..fa2ce67992ef 100644 --- 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 diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh index b2586c188ab5..627a0264c3d8 100755 --- a/scripts/admin-update.sh +++ b/scripts/admin-update.sh @@ -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/