linux/generic: split ar8327 from ar8216 switch code
authoracoul <alex@ozo.com>
Sat, 5 Dec 2015 16:29:21 +0000 (18:29 +0200)
committeracoul <alex@ozo.com>
Thu, 31 Mar 2016 05:28:36 +0000 (08:28 +0300)
package/kernel/linux/modules/netdevices.mk
target/linux/generic/patches-3.18/734-phy_split_ar8216_ar8327.patch [new file with mode: 0644]

index ed4c47bdbf220539f227545b200c7d24fd22d598..2188c7b522040fae683964ab94db2e9ce5318b85 100644 (file)
@@ -212,11 +212,10 @@ define KernelPackage/switch-ar8216
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=Atheros AR8216 switch support
   DEPENDS:=+kmod-swconfig
-  KCONFIG:=CONFIG_AR8216_PHY=m
+  KCONFIG:=CONFIG_AR8216_PHY
   FILES:= \
-    $(LINUX_DIR)/drivers/net/phy/ar8216.ko \
-     $(LINUX_DIR)/drivers/net/phy/ar8327.ko
-  AUTOLOAD:=$(call AutoLoad,42,ar8327 ar8216)
+    $(LINUX_DIR)/drivers/net/phy/ar8216.ko 
+  AUTOLOAD:=$(call AutoLoad,42,ar8216)
 endef
 
 define KernelPackage/switch-ar8216/description
@@ -225,6 +224,22 @@ endef
 
 $(eval $(call KernelPackage,switch-ar8216))
 
+define KernelPackage/switch-ar83x7
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=Atheros AR83x7 switch support
+  DEPENDS:=+kmod-switch-ar83x7
+  KCONFIG:=CONFIG_AR83x7_PHY
+  FILES:= \
+    $(LINUX_DIR)/drivers/net/phy/ar8327.ko
+  AUTOLOAD:=$(call AutoLoad,43,ar8327)
+endef
+
+define KernelPackage/switch-ar83x7/description
+  Atheros AR83x7 switch support
+endef
+
+$(eval $(call KernelPackage,switch-ar83x7))
+
 define KernelPackage/switch-ip17xx
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=IC+ IP17XX switch support
diff --git a/target/linux/generic/patches-3.18/734-phy_split_ar8216_ar8327.patch b/target/linux/generic/patches-3.18/734-phy_split_ar8216_ar8327.patch
new file mode 100644 (file)
index 0000000..b29d670
--- /dev/null
@@ -0,0 +1,58 @@
+--- a/drivers/net/phy/Makefile
++++ b/drivers/net/phy/Makefile
+@@ -23,7 +23,8 @@ obj-$(CONFIG_MVSWITCH_PHY)   += mvswitch.o
+ obj-$(CONFIG_MVSW61XX_PHY)    += mvsw61xx.o
+ obj-$(CONFIG_IP17XX_PHY)      += ip17xx.o
+ obj-$(CONFIG_REALTEK_PHY)     += realtek.o
+-obj-$(CONFIG_AR8216_PHY)      += ar8216.o ar8327.o
++obj-$(CONFIG_AR8216_PHY)      += ar8216.o
++obj-$(CONFIG_AR83x7_PHY)      += ar8327.o
+ obj-$(CONFIG_RTL8306_PHY)     += rtl8306.o
+ obj-$(CONFIG_RTL8366_SMI)     += rtl8366_smi.o
+ obj-$(CONFIG_RTL8366S_PHY)    += rtl8366s.o
+--- a/drivers/net/phy/Kconfig
++++ b/drivers/net/phy/Kconfig
+@@ -156,6 +156,13 @@ config AR8216_PHY
+       select ETHERNET_PACKET_MANGLE
+       select SWCONFIG
++if AR8216_PHY
++
++config AR83x7_PHY
++      tristate "Driver for Atheros AR8327 switches"
++
++endif
++
+ config AR8216_PHY_LEDS
+       bool "Atheros AR8216 switch LED support"
+       depends on (AR8216_PHY && LEDS_CLASS)
+--- a/drivers/net/phy/ar8216.c
++++ b/drivers/net/phy/ar8216.c
+@@ -36,9 +36,9 @@
+ #include <linux/version.h>
+ #include "ar8216.h"
+-
+-extern const struct ar8xxx_chip ar8327_chip;
+-extern const struct ar8xxx_chip ar8337_chip;
++#ifdef CONFIG_AR83x7_PHY
++#include "ar8327.c"
++#endif
+ #define AR8XXX_MIB_WORK_DELAY 2000 /* msecs */
+@@ -1744,12 +1744,14 @@ ar8xxx_id_chip(struct ar8xxx_priv *priv)
+       case AR8XXX_VER_AR8316:
+               priv->chip = &ar8316_chip;
+               break;
++#ifdef CONFIG_AR83x7_PHY
+       case AR8XXX_VER_AR8327:
+               priv->chip = &ar8327_chip;
+               break;
+       case AR8XXX_VER_AR8337:
+               priv->chip = &ar8337_chip;
+               break;
++#endif
+       default:
+               pr_err("ar8216: Unknown Atheros device [ver=%d, rev=%d]\n",
+                      priv->chip_ver, priv->chip_rev);