I have one driver serving 4 devices at a time. Can't I have one fixed
minor number for one device ?

When read() / write() into the device, how can I know which device I
am operating on ?  Right now (in 2.4)  I use the minor number of the
node to find out which one I am working on.  Please bear with me, if
this is trivial.

On 7/5/05, Greg KH <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 05, 2005 at 07:39:49PM +0530, Jayaprakash Shanmugam wrote:
> > Thanks for your reply.  I just wanted to give some more information on
> > my requirement.
> >
> > 1) In my driver (working in 2.4), I have fixed minor numbers for the
> > USB cards (custom devices).  While reading or writing, I simply do the
> > following:
> >
> > MyCard = MINOR (pstFilp->f_dentry->d_inode->i_rdev);
> > if (MyCard == 64)
> > {
> > MyDevice = usb_find_device(MyCardVID, MyCardPID);
> > usb_control_msg();
> > }
> > else if ()
> > ......
> >
> > But if I use usb_register_dev(), it assigns the minors dynamically and
> > no way ( as far as I know ) I can get which device ( I have four
> > devices and I am sure that they will not have PIDs in common ) the
> > read / write is operating on.
> 
> You can check the minor number when you register the device.  It is
> returned in the structure after usb_register_dev() is called.
> 
> > 2) For your reply:
> >
> > It is our own control system - both the host and devices. These are
> > the only devices that can go and plug into the host's USB port.
> > There cannot be two boards with same VID / PID pair.
> >
> > 3) Can I use devfs_register in 2.6 kernel ? The /proc/kallsyms doesnt
> > display this symbol.  I tried using devfs_mk_cdev() in probe. But I
> > got "No Such Device" while opening.
> 
> devfs is gone in the latest 2.6 kernel, so no, you can't use it.
> 
> Good luck,
> 
> greg k-h
>


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&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