Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to send ioctl command to my Linux USB driver?

609 views
Skip to first unread message

bluestar

unread,
Apr 3, 2012, 4:45:53 AM4/3/12
to
Dear Sir:

In my USB driver, I use "usb_register" and "usb_register_dev"
to register usb_driver and usb_class_driver to usb core. I
also create some attribute files for my driver

When the device plugging in, its init and probe functions had
no error and work well

I found the attribute files under /sys/bus/usb/devices/1-1:1.0
, the name of usb_driver under /sys/bus/usb/drivers, the name
of usb_class_driver under /sys/class/usb. But I can't see the
anything under /dev

I tried to open the name of full-path of of usb_class_driver to
send ioctl commands, but it shows message:"can't open"

How to open device node for sending ioctl commands? After
using "usb_register" and "usb_register_dev", where do
system create device node?

Please give me some information

Thank you!

ps: I use kernel version is 3.0.8 and platform is Galaxy Nexus

BR,
Alan

Tauno Voipio

unread,
Apr 3, 2012, 5:45:05 AM4/3/12
to
If your system is using the udev daemon for creating the /dev entries,
you are very probably missing the udev scripts for your device.

The location of the scripts may vary according to the Linux
distribution. In Ubuntu 10.04 they are in /etc/udev/rules.d.

Here is an example for the Amontec JTAG key on USB:

--- clip clip ---

# Rules to enable USB read/write to Amontec JTAGkey

ACTION!="add", GOTO="amontec_rules_end"
SUBSYSTEM!=="usb_device", GOTO="amontec_rules_end"

ATTR{idProduct}=="cff8", ATTR{idVendor}=="0403", MODE="0666"

LABEL="amontec_rules_end"

--- clip clip ---

HTH (hope this helps)

--

Tauno Voipio

bluestar

unread,
Apr 5, 2012, 2:22:05 AM4/5/12
to
Dear Sir:

Thank you for your suggestion

I tried to find the file you point to, but don't find

I do some experiment for registering functions

(1) misc_register can auto-create device node under /dev
(2) register_chrdev don't auto-create device node under /dev,
but I can use "cat /proc/devices" to find
(3) usb_register_dev don't create any device node under /dev
and /proc/devices

I tried to use "mknod" to manual-create device node unde /
dev, but android kernel can't support this command

Above 3 functions for registering device, can they auto-
create device node under /dev? Or some can and some can't ?

I just want to send my ioctl command into my usb driver, but
I don't find out correct device node to open

Thank you

BR,
Alan

On 4月3日, 下午5時45分, Tauno Voipio <tauno.voi...@notused.fi.invalid>
wrote:

bluestar

unread,
Apr 22, 2012, 10:20:23 PM4/22/12
to
Dear Sir:

I can find the same minor number at /dev/bus/usb/002/065
,but I don't know how to find correct number(002, 065) of
path

Do you have any idea to get thme?

Thank you!

BR,
Alan
0 new messages