Hello all

I am using a usb device that send incremented value sent by driver.
I have writtern a driver for that. but i am facing some problem 
can some one suggest some solution for them.
I am sending a whole procedure that i am doing...
I have compiled the driver and copied .o file in 
/lib/modules/2.4.5/kernel/drivers/usb/    

* Initially when device is not connected.

root@neptune:/home/USB# cat /proc/bus/usb/devices
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=1000
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms

*when i connect device to it following message came...

root@neptune:/home/USB# cat /proc/bus/usb/devices
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=1000
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  5 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0925 ProdID=1234 Rev= 1.00
S:  Manufacturer=Microchip
S:  Product=Pic16C765 USB Mouse
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 26mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=hid
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl= 10ms

*Konsole message.....

hub.c: USB new device connect on bus1/1, assigned device number 5
usb.c: USB device 5 (vend/prod 0x925/0x1234) is not claimed by any active driver.
usb.c: registered new driver hid
usb-uhci.c: interrupt, status 3, frame# 1911
input0: USB HID v1.00 Device [Microchip Pic16C765 USB Mouse] on usb1:5.0
hid.c: v1.16 Andreas Gal, Vojtech Pavlik <[EMAIL PROTECTED]>
hid.c: USB HID support drivers

* It has not found my driver ...
but i have writtern following code in my driver file...

 if ( !( ( dev->descriptor.idVendor == 0x925 ) && ( dev->descriptor.idProduct == 
0x1234 ) ) )
   {
      printk(KERN_INFO "Returning NULL\n");
      return NULL;
   }

* Next step i have inserted my module first and then connect the device
before doing this i have removed loaded module hid and input.
Then it recognize my driver. the message comes... is

root@neptune:/home/USB/test# cat /proc/bus/usb/devices
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=1000
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  8 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0925 ProdID=1234 Rev= 1.00
S:  Manufacturer=Microchip
S:  Product=Pic16C765 USB Mouse
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 26mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=ADC_Driver
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl= 10ms

and message on konsole is ...
-------------------------------

hub.c: USB new device connect on bus1/2, assigned device number 8
driver.c: Enter in usb_adc_probe function  

  Length              = 18
  DescriptorType      = 01
  USB version         = 1.10
  Vendor:Product      = 0925:1234
  MaxPacketSize0      = 8
  NumConfigurations   = 1
  Device version      = 1.00
  Device Class:SubClass:Protocol = 00:00:00
    Per-interface classes
****usb1:8.0
The value of the context is 10
driver.c: Exit from usb_adc_probe function 

usb.c: registered new driver hid
hid.c: v1.16 Andreas Gal, Vojtech Pavlik <[EMAIL PROTECTED]>
hid.c: USB HID support drivers

QUESTION :
-----------
* Can you tell me the reason for this behaviour...

QUESTION 2 :
I have created a node using mknod /dev/usb/adc c 180 65
but still in the lsmod it is not showing my driver is using by
some device...
and i am not able to open the device...

Waiting for your valuable suggation...

Pankaj.
 


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to