On Tue, 8 Jul 2003 [EMAIL PROTECTED] wrote:

> Hi Alan,
> 
> Thanks for the quick response.
> 
> Right now I'm setting up one device per interface (using my company 
> name ATS) at /dev/usb/ats[0-7].  This gives me access to the base 
> device in the interface.  I'm currently using the USB major (180) and 
> minors 128-135.
> 
> How would I get a miscellaneous character device major assigned?  
> That seems the appropriate method, since the entire GPIB system could 
> support 256 peripherals.  (Actually many more since there is a sub-
> addressing mechanism that supports 256 logical devices at each 
> physical GPIB address, so 64K devices is the theoretical maximum).

See Documentation/devices.txt.  But do you really need all these device 
numbers?  Consider using devfs, which does dynamic device number 
assignment.

> I hadn't considered using the hotplug script mechanism for 
> configuring the system, but it might be appropriate.  The system  
> configuration actually changes depending on what user program is 
> running at the time, with some devices being ignored and other bus 
> addresses being reused by different devices.  For example you could 
> disconnect a DVM (/dev/usb/dvm0) at GPIB address 17 and connect a 
> printer (/dev/usb/prn0) at GPIB address 17, then run the program that 
> understands that topology.  This particular program would never 
> access /dev/usb/dvm0 even though that device was defined in the 
> overall system.

That sounds confusing.  Does it mean that /dev/usb/dvm0 and /dev/usb/prn0
would contain the same major/minor numbers?  And wouldn't these numbers
have to change every time you re-wire your GPIB bus?  For that matter, how
much difference does it make to your driver whether a particular device
happens to be a printer rather than a DVM?  Wouldn't the driver just
transmit data back-and-forth the same, regardless?

Maybe you should develop a user library to communicate with your driver.  
Then any program could easily inform the driver about the devices it's 
going to use, in an implementation-independent way.

Maybe you could write the driver so that it uses a single major/minor 
combination.  Have it require the user program to call a particular ioctl 
to select a GPIB address before it does anything else to the open file.  
Then keeping track of the device <-> address mapping becomes purely a 
userspace problem.

> I'm working with the 2.4 kernel as a development platform.  Since 
> this product will go into existing installations, I expect most of 
> the customers will have that version.  I'm hoping I don't have to 
> support 2.2.  Support for the 2.6 kernel will be added when it 
> becomes commercially available.
> 
> Thanks very much for your help.  Greatly appreciated.
> 
> Leigh Bassett

You're welcome.

Alan Stern



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to