This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help needed for integration of my own serial driver ???


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]