Skip to content

Commit

Permalink
kernel: add module to support SFP cages
Browse files Browse the repository at this point in the history
Enables kernel SFP case support.

Signed-off-by: René van Dorst <opensource@vdorst.com>
  • Loading branch information
vDorst authored and lynxis committed Apr 25, 2020
1 parent 6d92470 commit ec2f7a4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions package/kernel/linux/modules/netdevices.mk
Expand Up @@ -1141,3 +1141,23 @@ define KernelPackage/mlx5-core/description
endef

$(eval $(call KernelPackage,mlx5-core))


define KernelPackage/sfp
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=SFP cage support
DEPENDS:=+kmod-i2c-core +kmod-hwmon-core
KCONFIG:= \
CONFIG_SFP=m \
CONFIG_MDIO_I2C=m
FILES:= \
$(LINUX_DIR)/drivers/net/phy/sfp.ko \
$(LINUX_DIR)/drivers/net/phy/mdio-i2c.ko
AUTOLOAD:=$(call AutoProbe,mdio-i2c sfp)
endef

define KernelPackage/SFP/description
Kernel module to support SFP cages
endef

$(eval $(call KernelPackage,sfp))
2 changes: 1 addition & 1 deletion target/linux/ramips/image/mt7621.mk
Expand Up @@ -820,7 +820,7 @@ TARGET_DEVICES += ubnt_edgerouter-x
define Device/ubnt_edgerouter-x-sfp
$(Device/ubnt_edgerouter_common)
DEVICE_MODEL := EdgeRouter X SFP
DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x
DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-sfp
SUPPORTED_DEVICES += ubnt-erx-sfp ubiquiti,edgerouterx-sfp
endef
TARGET_DEVICES += ubnt_edgerouter-x-sfp
Expand Down

3 comments on commit ec2f7a4

@peterwillcn
Copy link
Contributor

@peterwillcn peterwillcn commented on ec2f7a4 Apr 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lynxis @vDorst
ERROR: module '/home/openwrt/master/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.4.35/drivers/net/phy/sfp.ko' is missing.
modules/netdevices.mk:1163: recipe for target '/home/openwrt/master/openwrt/bin/targets/x86/64/packages/kmod-sfp_5.4.35-1_x86_64.ipk' failed

SHELL= flock /home/openwrt/master/openwrt/tmp/.root-copy.flock -c 'cp -fpR /home/openwrt/master/openwrt/build_dir/target-x86_64_musl/linux-x86_64/packages/.pkgdir/kernel/. /home/openwrt/master/openwrt/staging_dir/target-x86_64_musl/root-x86/'
touch /home/openwrt/master/openwrt/staging_dir/target-x86_64_musl/root-x86/stamp/.kernel_installed
ERROR: module '/home/openwrt/master/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.4.35/drivers/net/phy/sfp.ko' is missing.
modules/netdevices.mk:1163: recipe for target '/home/openwrt/master/openwrt/bin/targets/x86/64/packages/kmod-sfp_5.4.35-1_x86_64.ipk' failed
make[3]: *** [/home/openwrt/master/openwrt/bin/targets/x86/64/packages/kmod-sfp_5.4.35-1_x86_64.ipk] Error 1
make[3]: Leaving directory '/home/openwrt/master/openwrt/package/kernel/linux'
time: package/kernel/linux/compile#1.67#0.13#1.80
package/Makefile:111: recipe for target 'package/kernel/linux/compile' failed
make[2]: *** [package/kernel/linux/compile] Error 2
make[2]: Leaving directory '/home/openwrt/master/openwrt'
package/Makefile:107: recipe for target '/home/openwrt/master/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile' failed
make[1]: *** [/home/openwrt/master/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/openwrt/master/openwrt'
/home/openwrt/master/openwrt/include/toplevel.mk:218: recipe for target 'world' failed
make: *** [world] Error 2

@lynxis
Copy link
Member

@lynxis lynxis commented on ec2f7a4 Apr 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for me on ramips and x86/generic. Maybe you've to do a make clean.

@peterwillcn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.