USB gadget testing ---- New method

[Linux 3.18] 在Linux 3.18中,gadget的方式更改如下:

mass storage gadget 

$ insmod libcomposite.ko (drivers/usb/gadget/libcomposite.ko)

$ insmod usb_f_mass_storage.ko (drivers/usb/gadget/function/usb_f_mass_storage.ko)

$ insmod g_mass_storage.ko file=file.img removable=1 (drivers/usb/gadget/legacy/g_mass_storage.ko)


[Linux v3.16-rc2]

serial gadget driver (consider the configfs is built in kernel)

# insmod libcomposite.ko

# insmod u_serial.ko
# insmod usb_f_acm.ko
# insmod g_serial.ko


[Linux v3.10-rc1]

最近在测试usb gadget时发现,多了更多中间层configfs.ko and libcomposite.ko文件。(如果,target_core_mod是build in kernel, 其方法与linux v3.7 一样)

举例如下:

用atmel的gadget和ethernet gadget的应用:

# insmod atmel_usba_udc.ko

#insmod configfs.ko

#insmod target_core_mod.ko (Actually this is not needed.)

#insmod libcomposite.ko

#insmod g_ether.ko

2. lsmod 得出如下结果

# lsmod
Module Size Used by Not tainted
g_ether 22174 0
libcomposite 27129 1 g_ether
target_core_mod 163699 0
configfs 18942 3 libcomposite,target_core_mod
atmel_usba_udc 11636 0


[Linux v3.7] [Linux v3.8-rc4]

最近在测试usb gadget时发现,多个一个中间层ko 文件。所以,在加载usb gadget的时候需要多一步操作了。

举例如下:

用atmel的gadget和mass storage的应用

#  insmod atmel_usba_udc.ko

# insmode libcomposite.ko

# insmod g_mass_storage.ko file=test.img removable=1

最简单的方法是用modprobe来解决依赖关系。


[Linux 3.10]

1. g_serial based on acm

# lsmod
Module                  Size  Used by    Not tainted
g_serial                1841  0 
usb_f_acm               3910  1 
u_serial                8019  1 usb_f_acm
libcomposite           27109  2 g_serial,usb_f_acm
configfs               19006  3 usb_f_acm,libcomposite




你可能感兴趣的:(USB gadget testing ---- New method)