lkml.org 
[lkml]   [1999]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: Request for comments (kdev_t and friends...)
On Sat, 27 Nov 1999, Bret Indrelee wrote:

> Linus Torvalds wrote:
> > > Further, major and minor don't make much sense either anymore. Major
> > > should indicate a device type, with minor indicating an
> > instance. But now
> > > there are multiple devices within a major (misc, mem) and
> > devices that
> > > span majors (tty, scsi). So the terms are more or less
> > arbitrary. So most
> > > of the kernel outside drivers themselves should treat
> > device handles as
> > > opaque.
> >
> > The major/minor stuff should never be used in a perfect
> > world, except for
> > the initial lookup. After that, you would just have "index within this
> > controller" or something, and that depends on the actual hardware.
>
> What about drivers that use the minor number to indicate instance number or
> special modes of operation?
>
> The major number is just something that the system uses to convert from the
> user concept of 'open the device at this inode' into a table lookup. Device
> drivers shouldn't care about their major number.
>
> The minor number for some devices has been and continues to indicate
> operating mode for certain devices.

Yes, and that should change. The tty drivers for instance attach private
data to struct file, so that they don't need to keep track of stuff based
on minor number, making them potentially much more dynamic. The memory
devices effectively do the same by passing off a special fops array after
open. An improved device lookup would work off of major, minor, and type
as key, rather than simply major (and type at a higher level).

--
"Love the dolphins," she advised him. "Write by W.A.S.T.E.."


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.044 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site