This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Help needed for integration of my own serial driver ???
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: "Cusson, Pascal" <pascal dot cusson at analog dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Fri, 18 Oct 2002 04:43:47 +0100
- Subject: Re: [ECOS] Help needed for integration of my own serial driver ???
- References: <8FDC0F9BE1F91D44BE964AA54AAA67B61B0350@wilmexm3.ad.analog.com>
Cusson, Pascal wrote:
Hi everyone,
I am trying to incorporate my serial driver into eCos. As stated in the documents, I created all the following functions. However, for some
reason, my serial_handle does not get initialised. If single through the
lookup function, my device is detected and read but the handle does no get
initialized at all. Is initialization of the handle my responsability or
eCos' resonsability ?
eCos's, but it only does it on success.
serial_io_handle_t serial_handle;
Here is my calling function:
error=cyg_io_lookup("/dev/ttyS0", &serial_handle);
Here is my loopup function:
static Cyg_ErrNo scc1_lookup(struct cyg_devtab_entry **tab, struct cyg_devtab_entry *sub_tab, const char * name)
{
serial_channel *chan = (serial_channel *)(*tab)->priv;
//(chan->callbacks->init_scc1)(chan); // Really only required for interrupt driven devices
return 1;
}
You must return 0 (pedantically, ENOERR) for success, not 1.
And you should check the return code from cyg_io_lookup() too.
Jifl
--
eCosCentric http://www.eCosCentric.com/ <info@eCosCentric.com>
--[ "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