Hi Jayaprakash,

In linux system, USB devices are identified by major number 180, so you
need to create device node with major no 180 and minor no (mknod usbdrv
180 0)
 
While registering device driver you don't have to give major as such,
you need to mention only minor number. All these information, you need
to define it in the USB driver structure (e.g, &USBH__stApplDriver).

If you say open it will check minor number and open the device file. 

One more suggestion is go thru USB code in Linux.
 

I hope you understand this.



Regards,
Shalini G

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jayaprakash Shanmugam
Sent: Saturday, March 12, 2005 2:21 AM
To: linux-usb-devel@lists.sourceforge.net
Subject: [linux-usb-devel] Open USB Device

Hi All,
   I am new to USB world.  I have a basic doubt.  I wrote the USB
driver by going through some tutorials.  I compiled it and inmod it
without any problems.  Now, If I want to use my driver, I need a major
number.  There I got stuck up.  I didnt have any major number used in
my driver.  So, how to open the USB device ?  Can anybody be of any
help ?  Here is my Init and CleanUp functions where I dont have any
major numbers used.

static int __init USBH__iInit()
{
        int Result;

        /* Register the driver with the USB subsystem */
        Result = usb_register(&USBH__stApplDriver);
        if (Result < 0) 
        {
                printk(KERN_ERR "usb_register failed for the USB
Application \
                        Driver: Error Number = %d",Result);
                return -1;
        }

        return 0;
}



static void __exit USBH__vExit(void)
{
        /* Deregister the driver from the USB subsystem */
        usb_deregister(&USBH__stApplDriver);
}

module_init(USBH__iInit);
module_exit(USBH__vExit)

Regards,
Jayaprakash.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to