当前位置: 技术问答>linux和unix
如何在linux下在应用层得到USB设备名称信息?
来源: 互联网 发布时间:2015-08-11
本文导语: 我想获取USB设备(比如U盘)的pid,vid以及vendor,不用读配置文件的方式,能不能从驱动的probe函数里获取?怎么向上传啊!有哪位大哥懂,指教一二,多谢! | 看/proc/bus/usb/devices里这些信息我...
我想获取USB设备(比如U盘)的pid,vid以及vendor,不用读配置文件的方式,能不能从驱动的probe函数里获取?怎么向上传啊!有哪位大哥懂,指教一二,多谢!
|
看/proc/bus/usb/devices里这些信息我认为都是USB驱动里probe函数向上传的!!!
It seems that the information in "proc/bus/usb/devices" is supplied by
"USB core " not the USB driver,the usb driver simply compare the vedor and product
id when probe.
But the driver did provide a device id table so that the Linux Hot-plug subsystem
(/sbin/hotplug) could get the information and update the usbmap of the kernel .
If you program the usb driver ,you could supply the information in device extension and
using the IOCTL to interact with user mode applications
It seems that the information in "proc/bus/usb/devices" is supplied by
"USB core " not the USB driver,the usb driver simply compare the vedor and product
id when probe.
But the driver did provide a device id table so that the Linux Hot-plug subsystem
(/sbin/hotplug) could get the information and update the usbmap of the kernel .
If you program the usb driver ,you could supply the information in device extension and
using the IOCTL to interact with user mode applications
|
先看看你的xcofig里面是不是给它进行模块化了
如果没有话就给它加上
好象是在sub support里面的
你自己把应该选的选上就行了。。
这样就可以了
如不行的话可以
在inputsupport里面看看
如果没有话就给它加上
好象是在sub support里面的
你自己把应该选的选上就行了。。
这样就可以了
如不行的话可以
在inputsupport里面看看
|
/usr/src/linux-2.4.9-e.3/drivers/usb/storage/unusual_devs.h
根据pid,vid到里面去找
根据pid,vid到里面去找