Re: minor device number...

"Reuter, Joseph (Mission Systems)" <[email protected]> Mon, 7 Nov 2005 07:56:06 -0800
Newsgroups gmane.linux.kernel.streams
Message-ID <[email protected]>
> I am taking a standar d version of a custom serial driver and making a

> streams driver from it. The problem I have is that the current driver
uses 
> device minor number as an index to the correct port in the FPGA.
> 
> How can I get the device minor number in the driver.  I know how 
> to get it from the open(), but I need it for the read and write 
> streams that only have mblk_t and queue_t to work from.
> 
> Any suggestions??
> 
> Bill

The queue_t structure contains a field q_ptr that is for the use of 
the driver. Allocate a structure durin open(), populate it with the 
minor number and any other state data you need and store a pointer to 
it in q->q_ptr. Now you can access that data in the other routines.

Joe Reuter
----------
In theory, theory and practice are the same; in practice, they're not.