kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* USB Device Driver
@ 2014-06-13  7:54 Vlad Ungureanu
  2014-06-13 10:14 ` AYAN KUMAR HALDER
  2014-06-13 14:13 ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Vlad Ungureanu @ 2014-06-13  7:54 UTC (permalink / raw)
  To: kernelnewbies

Hello,

During Google Summer of Code we are developing an USB Device Driver for an
Android phone. Mainly we want to make an ADK driver *switch the phone to ADK
mode or back to normal mode from inside the kernel*. I looked a bit over the
Internet to find a recent example of USB Device Drivers but the ones I have
found are from 2006 or so *old Kernel versions*. Do you guys have a more recent
example, preferably not drivers/usb/usb-skeleton.c .

-- 
Vlad Ungureanu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140613/dcdc7dd0/attachment.bin 

^ permalink raw reply	[flat|nested] 6+ messages in thread
* USB Device Driver
@ 2012-01-22 14:27 prathamesh deshpande
  2012-01-22 19:26 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: prathamesh deshpande @ 2012-01-22 14:27 UTC (permalink / raw)
  To: kernelnewbies

 I am experimenting with a USB device and studied the steps given in
Linux Device Drivers book.
 I have just started kernel programming and am new in this area.

This is what I tried to do:

 I "make" it, then install the module: # insmod trial.ko. Connect the
pendrive. I checked the /var/log/messages...seemed fine:

Jan 21 00:30:10 prathamesh-laptop kernel: [10508.290016]
usbcore:registered new interface driver prathamesh driver
Jan 21 00:31:57 prathamesh-laptop kernel: [10615.120142] usb
1-1:newhigh speed USB device using ehci_hcd and address 11
Jan 21 00:31:57 prathamesh-laptop kernel: [10615.273792] usb
1-1:configuration #1 chosen from 1 choice

The USB device gets detected and also the individual bulk_in and
bulk_out endpoints show no error.
But when we AND both endpoints, error occurs (line no. 354 trial.c )
on the terminal :-

 if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr))
       {
               printk(KERN_ALERT "\nTHIS IS THE POINT OF ERROR\n");
               err("Could not find both bulk-in and bulk-out endpoints");
               goto error;
       }

I see my files created in /sys/bus/usb/drivers.. and a file
/dev/prathamesh driver which i can access i guess.

Do I need to read/write to this file so that the data gets reflected
in the USB using cp command ( however it didn't happen though ) ?
I also chmod 777 ( read write and execute permissions ) to
/dev/prathamesh driver already.

I also tried echo "1" > /dev/prathamesh driver but nothing happened. I
am not able to figure out what to do next.

I also see a file /sys/bus/usb/drivers/prathamesh\ driver/module/
initstate which contains "live" when my driver is loaded.
Also,  /sys/bus/usb/drivers/prathamesh driver/6-1:1.2 which has ep_04
( out_endpoint ) and ep_84  ( in_endpoint )directories which contains
 information about endpoints.

I've attached the folder containing code ( 'trial.c' ) and 'Makefile'
and the error messages ( dmseg | tail -n 50 ).

Can someone please help and tell me what to do next ?
I mean how do I transfer data to my driver so that it gets reflected in my USB ?

Thank you and regards,
Prathamesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Code.tar.gz
Type: application/x-gzip
Size: 4274 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120122/7abe32bf/attachment-0001.gz 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmesg | tail -n 50
Type: application/octet-stream
Size: 3421 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120122/7abe32bf/attachment-0001.obj 

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

end of thread, other threads:[~2014-06-13 14:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13  7:54 USB Device Driver Vlad Ungureanu
2014-06-13 10:14 ` AYAN KUMAR HALDER
2014-06-13 14:13 ` Greg KH
2014-06-13 14:21   ` Vlad Ungureanu
  -- strict thread matches above, loose matches on Subject: below --
2012-01-22 14:27 prathamesh deshpande
2012-01-22 19:26 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).