From e3512741cde5fba7a3b27bfb366fff4ac996aa61 Mon Sep 17 00:00:00 2001 From: Damien Mascord Date: Tue, 13 Jul 2021 11:30:09 +1000 Subject: [PATCH 1/3] mdio-tools: Add package plus kernel module mdio is a low-level Linux debug tool for communicating with devices attached an MDIO bus. It improves on existing tools in this space in a few important ways: MDIO buses are directly addressable. Previous solutions relied on at least one Ethernet PHY on the bus being attached to a net device, which is typically not the case when the device is an Ethernet switch for example. Complex operations can be performed atomically. The old API only supported a single read or write of a single register. mdio sends byte code to the mdio-netlink kernel module that can perform multiple operations, store intermediate values, loop etc. As a result, things like read/mask/write operations and accesses to paged PHYs can be performed safely. Signed-off-by: Damien Mascord --- kernel/mdio-netlink/Makefile | 40 ++++++++++++++++++++++++++++++++++++ net/mdio-tools/Makefile | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 kernel/mdio-netlink/Makefile create mode 100644 net/mdio-tools/Makefile diff --git a/kernel/mdio-netlink/Makefile b/kernel/mdio-netlink/Makefile new file mode 100644 index 000000000..b0e134a36 --- /dev/null +++ b/kernel/mdio-netlink/Makefile @@ -0,0 +1,40 @@ +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=mdio-netlink +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://github.com/wkz/mdio-tools +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2021-07-02 +PKG_SOURCE_VERSION:=9f989622c21d5464168a4922542be044f21663b0 +PKG_MIRROR_HASH:=9ae5d920e23a7957a5d5a8c5764969382ce6a174c5c5e7f7841fac0c81bbac75 + +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=COPYING + +PKG_MAINTAINER:=Damien Mascord + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/mdio-netlink + SECTION:=kernel + CATEGORY:=Kernel modules + SUBMENU:=Network Support + TITLE:=mdio-netlink Linux MDIO netlink kernel module + KCONFIG:=CONFIG_PHYLIB=y CONFIG_MDIO_BUS=y + URL:=https://github.com/wkz/mdio-tools.git + FILES:=$(PKG_BUILD_DIR)/kernel/mdio-netlink.ko + AUTOLOAD:=$(call AutoProbe,mdio-netlink) +endef + +define KernelPackage/mdio-netlink/description + mdio-netlink Linux MDIO netlink kernel module +endef + +define Build/Compile + $(KERNEL_MAKE) M=$(PKG_BUILD_DIR)/kernel modules +endef + +$(eval $(call KernelPackage,mdio-netlink)) + diff --git a/net/mdio-tools/Makefile b/net/mdio-tools/Makefile new file mode 100644 index 000000000..55e4c3689 --- /dev/null +++ b/net/mdio-tools/Makefile @@ -0,0 +1,38 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=mdio-tools +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://github.com/wkz/mdio-tools +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2021-07-02 +PKG_SOURCE_VERSION:=9f989622c21d5464168a4922542be044f21663b0 +PKG_MIRROR_HASH:=9ae5d920e23a7957a5d5a8c5764969382ce6a174c5c5e7f7841fac0c81bbac75 + +PKG_FIXUP:=autoreconf + +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=COPYING + +PKG_MAINTAINER:=Damien Mascord + +include $(INCLUDE_DIR)/package.mk + +define Package/mdio-tools + SECTION:=net + CATEGORY:=Utilities + TITLE:=mdio-tools Linux MDIO register access + URL:=https://github.com/wkz/mdio-tools.git + DEPENDS:=+libmnl +endef + +define Package/mdio-tools/description + mdio-tools Linux MDIO register access +endef + +define Package/mdio-tools/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mdio/mdio $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,mdio-tools)) From 30299084e8104aadf259d39d404b932968ef12f0 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Wed, 21 Jul 2021 22:24:45 +0200 Subject: [PATCH 2/3] mdio-tools: upgrade to latest commit Also fix minor style issues. Signed-off-by: Michael Heimpold --- kernel/mdio-netlink/Makefile | 9 ++++----- net/mdio-tools/Makefile | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kernel/mdio-netlink/Makefile b/kernel/mdio-netlink/Makefile index b0e134a36..1051016e4 100644 --- a/kernel/mdio-netlink/Makefile +++ b/kernel/mdio-netlink/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/wkz/mdio-tools PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-07-02 -PKG_SOURCE_VERSION:=9f989622c21d5464168a4922542be044f21663b0 -PKG_MIRROR_HASH:=9ae5d920e23a7957a5d5a8c5764969382ce6a174c5c5e7f7841fac0c81bbac75 +PKG_SOURCE_DATE:=2021-07-19 +PKG_SOURCE_VERSION:=65f6898f25b00deebe1c38811e893d9dcd4d7ef3 +PKG_MIRROR_HASH:=9db854037b3e8596ccd71567a45aa60fd3cac88b01c9197d4dd9cf3f32589cb2 PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING @@ -29,7 +29,7 @@ define KernelPackage/mdio-netlink endef define KernelPackage/mdio-netlink/description - mdio-netlink Linux MDIO netlink kernel module + mdio-netlink Linux MDIO netlink kernel module endef define Build/Compile @@ -37,4 +37,3 @@ define Build/Compile endef $(eval $(call KernelPackage,mdio-netlink)) - diff --git a/net/mdio-tools/Makefile b/net/mdio-tools/Makefile index 55e4c3689..0fd380c09 100644 --- a/net/mdio-tools/Makefile +++ b/net/mdio-tools/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/wkz/mdio-tools PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-07-02 -PKG_SOURCE_VERSION:=9f989622c21d5464168a4922542be044f21663b0 -PKG_MIRROR_HASH:=9ae5d920e23a7957a5d5a8c5764969382ce6a174c5c5e7f7841fac0c81bbac75 +PKG_SOURCE_DATE:=2021-07-19 +PKG_SOURCE_VERSION:=65f6898f25b00deebe1c38811e893d9dcd4d7ef3 +PKG_MIRROR_HASH:=9db854037b3e8596ccd71567a45aa60fd3cac88b01c9197d4dd9cf3f32589cb2 PKG_FIXUP:=autoreconf @@ -27,7 +27,7 @@ define Package/mdio-tools endef define Package/mdio-tools/description - mdio-tools Linux MDIO register access + mdio-tools Linux MDIO register access endef define Package/mdio-tools/install From 5302cce8ff1d94813c66e8d9722f080ebc28a703 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Wed, 21 Jul 2021 23:00:09 +0200 Subject: [PATCH 3/3] mdio-netlink: fix PKG_MIRROR_HASH Signed-off-by: Michael Heimpold --- kernel/mdio-netlink/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/mdio-netlink/Makefile b/kernel/mdio-netlink/Makefile index 1051016e4..83702c683 100644 --- a/kernel/mdio-netlink/Makefile +++ b/kernel/mdio-netlink/Makefile @@ -8,7 +8,7 @@ PKG_SOURCE_URL:=https://github.com/wkz/mdio-tools PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2021-07-19 PKG_SOURCE_VERSION:=65f6898f25b00deebe1c38811e893d9dcd4d7ef3 -PKG_MIRROR_HASH:=9db854037b3e8596ccd71567a45aa60fd3cac88b01c9197d4dd9cf3f32589cb2 +PKG_MIRROR_HASH:=c1532381ac7954a4dbff97f04e7ff2c66cc09dce420458fd3f830c843714616b PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING