All of lore.kernel.org
 help / color / mirror / Atom feed
* usb_driver
@ 2004-05-07 10:30 dongzai007
  2004-05-07 23:47 ` usb_driver Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: dongzai007 @ 2004-05-07 10:30 UTC (permalink / raw)
  To: linux-kernel

I am developing a usb device driver in linux 2.4.

I have a foolish question, how can linux system differentiate usb drivers according to PID&VID.

And, I use "devfs_register(...)" to register a device node in "/dev", it seems that there is no effects, no new files created in "/dev" . Could somebody give me some examples.

THANK YOU.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: usb_driver
  2004-05-07 10:30 usb_driver dongzai007
@ 2004-05-07 23:47 ` Greg KH
  0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2004-05-07 23:47 UTC (permalink / raw)
  To: dongzai007; +Cc: linux-kernel

On Fri, May 07, 2004 at 06:30:34PM +0800, dongzai007@sohu.com wrote:
> I am developing a usb device driver in linux 2.4.
> 
> I have a foolish question, how can linux system differentiate usb
> drivers according to PID&VID.

Please read the Linux USB documentation, it is all in the kernel tree.

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* USB driver
@ 2004-10-19 21:54 Deepak Manohar
  0 siblings, 0 replies; 12+ messages in thread
From: Deepak Manohar @ 2004-10-19 21:54 UTC (permalink / raw)
  To: xen-devel

>> Does usb devices works with Xen2.0, even when only domaim0 is present?
 
 >Yes, we"ve had success reports.
 

 Hi,

 can u tell me the exact procedure to get USB devices working on Xen.
I tried connecting a USB mouse and then "cat /dev/input/mouse" it said
"no such device".

>My USB virtualisation stuff (give guests control of individual USB ports) 
>is in progess but I keep getting distracted by other things (most recently 
>the 2.0 release).
 
  Can you tell me if this would require you to make modifications to
both Xen as well the linux kernel or just one of them?

Deepak


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: USB driver
@ 2004-10-19 22:32 Neugebauer, Rolf
  2004-10-19 22:58 ` Mark A. Williamson
  0 siblings, 1 reply; 12+ messages in thread
From: Neugebauer, Rolf @ 2004-10-19 22:32 UTC (permalink / raw)
  To: Deepak Manohar, xen-devel



> -----Original Message-----
> From: xen-devel-admin@lists.sourceforge.net [mailto:xen-devel-
> admin@lists.sourceforge.net] On Behalf Of Deepak Manohar
> Sent: 19 October 2004 22:54
> To: xen-devel@lists.sourceforge.net
> Subject: [Xen-devel] USB driver
> 
> >> Does usb devices works with Xen2.0, even when only domaim0 is
present?
> 
>  >Yes, we"ve had success reports.
> 
> 
>  Hi,
> 
>  can u tell me the exact procedure to get USB devices working on Xen.
> I tried connecting a USB mouse and then "cat /dev/input/mouse" it said
> "no such device".

Do you have USB support enabled in the XenoLinux kernel for Dom0? I
don't think it is on by default. 

> >My USB virtualisation stuff (give guests control of individual USB
ports)
> >is in progess but I keep getting distracted by other things (most
> recently
> >the 2.0 release).
> 
>   Can you tell me if this would require you to make modifications to
> both Xen as well the linux kernel or just one of them?

It should only require changes to XenoLinux. Essentially we would give
one VM access to the USB HW and then have faked USB controllers in other
domains talking via some control channel to the USB VM. We'll probably
fake out a virtual USB hub per domain to which we can assign real USB
devices. Basically a similar approach to what we do with PCI.

Rolf

> Deepak
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on
ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give
us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out
> more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xen-devel


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: USB driver
  2004-10-19 22:32 Neugebauer, Rolf
@ 2004-10-19 22:58 ` Mark A. Williamson
  0 siblings, 0 replies; 12+ messages in thread
From: Mark A. Williamson @ 2004-10-19 22:58 UTC (permalink / raw)
  To: xen-devel; +Cc: Neugebauer, Rolf, Deepak Manohar

> Do you have USB support enabled in the XenoLinux kernel for Dom0? I
> don't think it is on by default.

To enable it, do:
cd xen-2.0.bk/linux-2.6.8.1-xen0/
make ARCH=xen xconfig
# now enable the USB options that are relevant to you
cp .config ../install/boot/config-2.6.8.1-xen0
cd ..
make world

Alternatively, re-use a config from an old kernel that has your preferred 
options enabled:
cd path_to_old_config xen-2.0.bk/install/boot/config-2.6.8.1-xen0
cd xen-2.0.bk
make world

> >   Can you tell me if this would require you to make modifications to
> > both Xen as well the linux kernel or just one of them?
>
> It should only require changes to XenoLinux. Essentially we would give
> one VM access to the USB HW and then have faked USB controllers in other
> domains talking via some control channel to the USB VM. We'll probably
> fake out a virtual USB hub per domain to which we can assign real USB
> devices. Basically a similar approach to what we do with PCI.

Xen basically doesn't care about USB anyhow, so it'll all be done at the level 
of domain 0.  There's not a lot for me to add to Rolf's description.  I think 
that it should be possible to get pretty good performance USB virtualisation.

As far as unpriv domains are concerned they will have a USB controller of type 
"Xen HCI" instead of UHCI, OHCI or EHCI as you get for real hardware.  This 
host controller will be implemented entirely in software and will talk to a 
"backend" driver in dom0, which will in turn talk to the actual USB hardware.

HTH,
Mark


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl

^ permalink raw reply	[flat|nested] 12+ messages in thread

* USB driver
@ 2004-11-30 11:19 zhonglei
  0 siblings, 0 replies; 12+ messages in thread
From: zhonglei @ 2004-11-30 11:19 UTC (permalink / raw)
  To: Linuxppc-embedded

hi:
My system is Lite5200 with DENX Embedded Linux running on it.I want to connect USB mass storage devices to my computer's USB port.But I found there is no driver in kernel.(when I use 'make xconfig' the USB mass storage devices driver is in grey).How can I download/install the driver and active my USB disk?
BestRegards
zhonglei

^ permalink raw reply	[flat|nested] 12+ messages in thread

* USB driver
@ 2004-11-30 11:58 zhonglei
  0 siblings, 0 replies; 12+ messages in thread
From: zhonglei @ 2004-11-30 11:58 UTC (permalink / raw)
  To: linuxppc-dev

hi:
My system is Lite5200 with DENX Embedded Linux running on it.I want to connect USB mass storage devices to my computer's USB port.But I found there is no driver in kernel.(when I use 'make xconfig' the USB mass storage devices driver is in grey).How can I download/install the driver and active my USB disk?
BestRegards
zhonglei

^ permalink raw reply	[flat|nested] 12+ messages in thread

* USB driver
@ 2020-04-25  5:44 Sohaib Mhmd
  2020-04-25  7:00 ` Greg KH
  2020-04-29  0:25 ` Aruna Hewapathirane
  0 siblings, 2 replies; 12+ messages in thread
From: Sohaib Mhmd @ 2020-04-25  5:44 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1233 bytes --]

Hi everyone, I made a very simple USB driver
<https://gist.github.com/smalinux/3d6a5b000a32b97250b2d0c86b90711b>,
but the problem is that the probe and disconnect functions never was called.
I tried to google for this problem but unfortunately:
1- I don't use usb-storage <https://stackoverflow.com/a/31071943/5688267>,
it's a keyboard! (but anyway the same problem exists with any usb-based
device) and all driver on my machine are  bluetooth related drive (i
think!) (as you see from lsmod | grep usb)
2- I tried to rmmod usbhid <https://stackoverflow.com/a/4204608/5688267>
but I get error: ERROR: Module usbhid is builtin.
I tried to search for "usbhid" in .config file to remove it but I didn't
find anything.

What should I do?
thanks, smalinux

[root@hp kernel_mod]# lsmod | grep usb
sma_usb                16384  0
btusb                  57344  0
btrtl                  24576  1 btusb
btbcm                  20480  1 btusb
btintel                32768  1 btusb
bluetooth             634880  34 btrtl,btintel,btbcm,bnep,ath3k,btusb,rfcomm

I use  :
- Linux hp 5.6.3 #2 SMP Fri Apr 10 06:45:27 EET 2020 x86_64 x86_64 x86_64
GNU/Linux
- Linux buildroot 5.4.3-gf7688b48a-dirty #1 SMP Thu Jan 1 00:00:00 UTC 1970
x86_64 GNU/Linux

[-- Attachment #1.2: Type: text/html, Size: 1460 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: USB driver
  2020-04-25  5:44 Sohaib Mhmd
@ 2020-04-25  7:00 ` Greg KH
  2020-04-25  7:45   ` Sohaib Mhmd
  2020-04-29  0:25 ` Aruna Hewapathirane
  1 sibling, 1 reply; 12+ messages in thread
From: Greg KH @ 2020-04-25  7:00 UTC (permalink / raw)
  To: Sohaib Mhmd; +Cc: kernelnewbies

On Sat, Apr 25, 2020 at 07:44:12AM +0200, Sohaib Mhmd wrote:
> Hi everyone, I made a very simple USB driver
> <https://gist.github.com/smalinux/3d6a5b000a32b97250b2d0c86b90711b>,
> but the problem is that the probe and disconnect functions never was called.

What USB device is currently attached to the ids that your driver wants
to bind to?  Unload/unbind that and then your driver should work.

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: USB driver
  2020-04-25  7:00 ` Greg KH
@ 2020-04-25  7:45   ` Sohaib Mhmd
  2020-04-25  8:05     ` Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: Sohaib Mhmd @ 2020-04-25  7:45 UTC (permalink / raw)
  To: Greg KH; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1151 bytes --]

Sorry, do you mean vendor & product id
<https://gist.github.com/smalinux/3d6a5b000a32b97250b2d0c86b90711b#file-sma_usb-c-L8>?
Do you mean to unload/unbind for any particular one?

[root@hp kernel_mod]# lsusb
Bus 003 Device 023: ID 045e:0800 Microsoft Corp. Microsoft® Nano
Transceiver v2.0

[root@hp kernel_mod]# lsusb -t
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/14p, 480M
    |__ Port 3: Dev 23, If 0, Class=Human Interface Device, Driver=usbhid,
12M
    |__ Port 3: Dev 23, If 1, Class=Human Interface Device, Driver=usbhid,
12M
    |__ Port 3: Dev 23, If 2, Class=Human Interface Device, Driver=usbhid,
12M

On Sat, Apr 25, 2020 at 9:01 AM Greg KH <greg@kroah.com> wrote:

> On Sat, Apr 25, 2020 at 07:44:12AM +0200, Sohaib Mhmd wrote:
> > Hi everyone, I made a very simple USB driver
> > <https://gist.github.com/smalinux/3d6a5b000a32b97250b2d0c86b90711b>,
> > but the problem is that the probe and disconnect functions never was
> called.
>
> What USB device is currently attached to the ids that your driver wants
> to bind to?  Unload/unbind that and then your driver should work.
>
> greg k-h
>

[-- Attachment #1.2: Type: text/html, Size: 1603 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: USB driver
  2020-04-25  7:45   ` Sohaib Mhmd
@ 2020-04-25  8:05     ` Greg KH
  0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2020-04-25  8:05 UTC (permalink / raw)
  To: Sohaib Mhmd; +Cc: kernelnewbies


A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://daringfireball.net/2007/07/on_top

On Sat, Apr 25, 2020 at 09:45:44AM +0200, Sohaib Mhmd wrote:
> Sorry, do you mean vendor & product id
> <https://gist.github.com/smalinux/3d6a5b000a32b97250b2d0c86b90711b#file-sma_usb-c-L8>?

I have no idea, what ever vendor/device id that you put in your driver,
it needs to not have a driver attached to it for your driver to be able
to be called.

> Do you mean to unload/unbind for any particular one?

Again, the driver that is attached to the device your want your driver
to bind to is what you need to watch for.

good luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: USB driver
  2020-04-25  5:44 Sohaib Mhmd
  2020-04-25  7:00 ` Greg KH
@ 2020-04-29  0:25 ` Aruna Hewapathirane
  1 sibling, 0 replies; 12+ messages in thread
From: Aruna Hewapathirane @ 2020-04-29  0:25 UTC (permalink / raw)
  To: Sohaib Mhmd; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 3020 bytes --]

>> On Sat, Apr 25, 2020 at 1:46 AM Sohaib Mhmd <xunilams@gmail.com> wrote:
>> Hi everyone, I made a very simple USB driver
<https://gist.github.com/smalinux/3d6a5b000a32b97250b2d0c86b90711b>,
>> but the problem is that the probe and disconnect functions never was
called.
>> I tried to google for this problem but unfortunately:
>> 1- I don't use usb-storage <https://stackoverflow.com/a/31071943/5688267>,
it's a keyboard! (but anyway the same problem exists with any usb-based
device) and all driver on my machine are  bluetooth related drive (i
think!) (as you see from lsmod | grep usb)
>> 2- I tried to rmmod usbhid <https://stackoverflow.com/a/4204608/5688267>
but I get error: ERROR: Module usbhid is builtin.
>> I tried to search for "usbhid" in .config file to remove it but I didn't
find anything.

>> What should I do?
>> thanks, smalinux

Hello Sohaib,

Looking at the very last line of your dmesg output :
[ 4545.614471] hid-generic 0003:045E:0800.000C: input,hiddev96,hidraw2: USB
HID v1.11 Device [Microsoft Microsoft® Nano Transceiver v2.0] on
usb-0000:00:14.0-3/input2

The reason your probe and disconnect functions are never called is because
the hid-generic driver has claimed your device. This is the default
behavior.
Since usbhid is builtin you are unable to unload it using rmmod. But you
can unbind it. The steps are below:

1 - sudo modprobe <your_kernel_module>
2 - unbind hid-generic                  ( from a root terminal )
3 - bind <your_kernel_module>    ( from a root terminal )
4 - check dmesg                         ( should show your probe has been
called )
5 - unbind <your_kernel_module> ( from a root terminal )
6 - check dmesg                         ( should show your disconnect has
been called )

Clear the log buffer with dmesg -c then run dmesg -w.

Now find your bus id. Your bus id is 3-3:1.2 from your second last dmesg
output.
[ 4545.613190] input: Microsoft Microsoft® Nano Transceiver v2.0 System
Control as
/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.2/0003:045E:0800.000C/input/input49

To unbind from hid-generic from a root shell/terminal:
echo "3-3:1.2" >  /sys/bus/usb/drivers/usbhid/unbind

Now to bind to your driver from a root shell:
echo "3-3:1.2" >  /sys/bus/usb/drivers/'my first usb driver'/bind    // you
need the single quotes because of the spaces in your driver name

You should see dmesg telling you the probe function has been called now.

To unbind your driver from a root shell:
echo "3-3:1.2" >  /sys/bus/usb/drivers/'my first usb driver'/unbind    //
you need the single quotes because of the spaces in your driver name

and now dmesg should show you the disconnect function has been called.

If you pull out your device and plug it back in usbhid will be triggered.
To stop that you can from a root terminal:
echo '0' > /sys/bus/hid/drivers_autoprobe

Good luck - Aruna ( If you have the kernel source why not re-compile ? Look
for CONFIG_USB_HID in Make menuconfig )

[-- Attachment #1.2: Type: text/html, Size: 4006 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-04-29  0:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-07 10:30 usb_driver dongzai007
2004-05-07 23:47 ` usb_driver Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2004-10-19 21:54 USB driver Deepak Manohar
2004-10-19 22:32 Neugebauer, Rolf
2004-10-19 22:58 ` Mark A. Williamson
2004-11-30 11:19 zhonglei
2004-11-30 11:58 zhonglei
2020-04-25  5:44 Sohaib Mhmd
2020-04-25  7:00 ` Greg KH
2020-04-25  7:45   ` Sohaib Mhmd
2020-04-25  8:05     ` Greg KH
2020-04-29  0:25 ` Aruna Hewapathirane

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.