This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: device driver interface
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: "Koeller, T." <Thomas dot Koeller at baslerweb dot com>
- Cc: "ecos-discuss (E-Mail)" <ecos-discuss at sources dot redhat dot com>
- Date: Tue, 30 Apr 2002 18:23:37 +0100
- Subject: Re: [ECOS] device driver interface
- Organization: Red Hat UK Ltd.
- References: <850597605E79D21182830008C7A4B9CF07D88901@COMM1>
"Koeller, T." wrote:
>
> Hi all,
>
> what would be the recommended way of coding a device driver that does
> not fit the rather rudimentary and rigid read/write/set_config/get_config
> model
> as described by the documentation? If, for example, I wanted asynchronous
> notifications upon certain driver-detected events, such as data arriving, is
> there a standard way of coding this, or do I have to use sychronization
> primitives directly, extending the I/O API in a nonstandard way? Is there
> something similar to an ioctl API, allowing for more generalized I/O
> operations
> that require additional parameters beyond just a buffer and a byte count?
That's indeed something which set_config/get_config could theoretically do.
> Can I attach context information to I/O requests that can be retrieved
> after the operation is finished?
Not easily.
Remember the cyg_io_* functions are only there to provide a framework. If
your device isn't really able to support it, then just go ahead and provide
your own io/whatever package with its own API in a header file. If your
application has to have detailed knowledge about the driver it is using,
there's little point forcing the interface to be the "generic" API.
There's no point fitting a round peg in a square hole :-).
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss