OpenWrt Forum Archive

Topic: Adding a kernel module

The content of this topic has been archived on 9 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to add the i2400m-usb module to openwrt but I can't quite seem to call it correctly.

It's built of 3 layers (the stub wimax stack code which calls the driver and an associated bus glue).

Here's the drivers/net/wimax/Kconfig for the Wimax stub:

#
# WiMAX LAN device drivers configuration
#


comment "Enable WiMAX (Networking options) to see the WiMAX drivers"
        depends on WIMAX = n

if WIMAX

menu "WiMAX Wireless Broadband devices"

source "drivers/net/wimax/i2400m/Kconfig"

endmenu

endif

Here's the drivers/net/wimax/i2400m/Kconfig

config WIMAX_I2400M
        tristate
        depends on WIMAX
        select FW_LOADER

comment "Enable USB support to see WiMAX USB drivers"
        depends on USB = n

comment "Enable MMC support to see WiMAX SDIO drivers"
        depends on MMC = n

config WIMAX_I2400M_USB
        tristate "Intel Wireless WiMAX Connection 2400 over USB (including 5x50)"
        depends on WIMAX && USB
        select WIMAX_I2400M
        help
          Select if you have a device based on the Intel WiMAX
          Connection 2400 over USB (like any of the Intel Wireless
          WiMAX/WiFi Link 5x50 series).

          If unsure, it is safe to select M (module).

config WIMAX_I2400M_SDIO
        tristate "Intel Wireless WiMAX Connection 2400 over SDIO"
        depends on WIMAX && MMC
        select WIMAX_I2400M
        help
          Select if you have a device based on the Intel WiMAX
          Connection 2400 over SDIO.

          If unsure, it is safe to select M (module).

config WIMAX_I2400M_DEBUG_LEVEL
        int "WiMAX i2400m debug level"
        depends on WIMAX_I2400M
        default 8
        help

          Select the maximum debug verbosity level to be compiled into
          the WiMAX i2400m driver code.

          By default, this is disabled at runtime and can be
          selectively enabled at runtime for different parts of the
          code using the sysfs debug-levels file.

          If set at zero, this will compile out all the debug code.

          It is recommended that it is left at 8.

Here's the error I see:

WARNING: kmod-net-i2400m-usb is not available in the kernel config^M

Finally Here is my package/kernel/modules/wireless.mk entry

define KernelPackage/net-i2400m-usb
  SUBMENU:=$(WIRELESS_MENU)
  TITLE:=Intel i2400w WiMax driver
  DEPENDS:=@USB_SUPPORT +WIMAX +WIMAX_I2400M
  KCONFIG:=CONFIG_WIMAX_I2400M_USB
  FILES:=$(LINUX_DIR)/drivers/net/wimax/i2400m/i2400m_usb.$(LINUX_KMOD_SUFFIX)
  AUTOLOAD:=$(call AutoLoad,50,i2400m-usb)
endef

define KernelPackage/i2400m/description
 Kernel support for Intel Wimax cards
endef

$(eval $(call KernelPackage,net-i2400m-usb))

Can anybody who is more familiar with kernel module config see what I'm doing wrong?

For future reference -- anyone who is adding a module which requires several kernel settings they can be set as in the KCONFIG example below.


The following definition worked for me:

define KernelPackage/net-i2400m-usb
  SUBMENU:=$(WIRELESS_MENU)
  TITLE:=Intel i2400w WiMax driver
  DEPENDS:=@USB_SUPPORT
  KCONFIG:= \
        CONFIG_WIMAX \
        CONFIG_WIMAX_I2400M \
        CONFIG_WIMAX_I2400M_USB \
        CONFIG_WIMAX_DEBUG_LEVEL=8 \
        CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8
  FILES:=$(LINUX_DIR)/drivers/net/wimax/i2400m/i2400m-usb.$(LINUX_KMOD_SUFFIX) \
        $(LINUX_DIR)/drivers/net/wimax/i2400m/i2400m.$(LINUX_KMOD_SUFFIX) \
        $(LINUX_DIR)/net/wimax/wimax.$(LINUX_KMOD_SUFFIX)
  AUTOLOAD:=$(call AutoLoad,70, \
        wimax \
        i2400m \
        i2400m-usb)
endef

define KernelPackage/i2400m/description
 Kernel support for Intel Wimax cards
endef

$(eval $(call KernelPackage,net-i2400m-usb))

(Last edited by hopp on 18 Aug 2012, 05:12)

The discussion might have continued from here.