Re: Clone Drivers

Mike Jagdis (mike@roan.co.uk)
Mon, 28 Sep 1998 13:07:54 +0100 (GMT/BST)


On Fri, 25 Sep 1998, David Grothe wrote:

> Now comes the question: I am going to have to write pretty much the
> same piece of code either under the covers of LiS or as an addition to
> the sys_open routine. If I do the former then the feature will be
> available to LiS STREAMS drivers only. If I do the latter, and you
> accept the code into the kernel, then the feature will be available to
> any character special device driver.

Have you considered making a separate clone device driver? The
major number is used to identify the clone device. When opened
it uses the node's minor number as the real major number, allocates
an unused minor and punts the open to the constructed device.
iBCS does something similar when opening file names representing
AF_UNIX sockets, TLI/XTI transport providers etc.

Mike

-- 
.----------------------------------------------------------------------.
|  Mike Jagdis                  |  Internet:  mailto:mike@roan.co.uk   |
|  Roan Technology Ltd.         |                                      |
|  54A Peach Street, Wokingham  |  Telephone:  +44 118 989 0403        |
|  RG40 1XG, ENGLAND            |  Fax:        +44 118 989 1195        |
`----------------------------------------------------------------------'

- 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/