[LEDE-DEV] [PATCH] kernel: add additional gadget drivers

Tim Harvey tharvey at gateworks.com
Fri Sep 16 07:27:19 PDT 2016


On Fri, Sep 16, 2016 at 6:02 AM, Rafał Miłecki <zajec5 at gmail.com> wrote:
> On 16 September 2016 at 14:53, John Crispin <john at phrozen.org> wrote:
>> On 15/09/2016 16:51, Tim Harvey wrote:
>>> Add the following gadget driver modules:
>>>  - kmod-usb-gadget-ncm (g_ncm)
>>>  - kmod-usb-gadget-hid (g_hid)
>>>
>>> Signed-off-by: Tim Harvey <tharvey at gateworks.com>
>>> ---
>>>  package/kernel/linux/modules/usb.mk | 39 +++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 39 insertions(+)
>>>
>>> diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
>>> index 020f474..14c7050 100644
>>> --- a/package/kernel/linux/modules/usb.mk
>>> +++ b/package/kernel/linux/modules/usb.mk
>>> @@ -316,6 +316,45 @@ endef
>>>  $(eval $(call KernelPackage,usb-gadget-mass-storage))
>>>
>>>
>>> +define KernelPackage/usb-gadget-hid
>>> +  TITLE:=USB HID Gadget
>>> +  KCONFIG:=CONFIG_USB_G_HID
>>> +  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
>>> +  FILES:= \
>>> +     $(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko \
>>
>> this is included here and ...
>>
>>> +     $(LINUX_DIR)/drivers/usb/gadget/function/usb_f_hid.ko \
>>> +     $(LINUX_DIR)/drivers/usb/gadget/legacy/g_hid.ko
>>> +  AUTOLOAD:=$(call AutoLoad,52,usb_f_hid g_hid)
>>> +  $(call AddDepends/usb)
>>> +endef
>>> +
>>> +define KernelPackage/usb-gadget-hid/description
>>> +  Kernel support for USB HID Gadget
>>> +endef
>>> +
>>> +$(eval $(call KernelPackage,usb-gadget-hid))
>>> +
>>> +
>>> +define KernelPackage/usb-gadget-ncm
>>> +  TITLE:=USB CDC Ethernet (NCM)
>>> +  KCONFIG:=CONFIG_USB_G_NCM
>>> +  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
>>> +  FILES:= \
>>> +     $(LINUX_DIR)/drivers/usb/gadget/libcomposite.ko \
>>
>> here again. this seems wrong and will result in an error when both are
>> installed and then one of the 2 is removed.
>
> Hint: a separated package for libcomposite.ko that will be selected by
> both of your packages.
>

Ooops - yes when I added back kmod-usb-lib-composite I can remove
libcomposite.ko from FILES. Also I need to pull u_ether.ko into its
own hidden dep as its now used by two things.

I will submit a v2. Thanks for the pointers!

Tim



More information about the Lede-dev mailing list