* [ECOS] Wrong Handler Returned
@ 2005-09-12 16:19 somarouthu venkata raja sekhar
0 siblings, 0 replies; only message in thread
From: somarouthu venkata raja sekhar @ 2005-09-12 16:19 UTC (permalink / raw)
To: ecos-discuss
Hi
I am trying to write a device driver for a SD card. I
have just recently started to learn ecos.
I have managed to create the /devs/ layer. When I try
to call cyg_io_write ( ) using the handle that the
cyg_io_lookup( ) returns, it comes up with no error,
but does not execute anything that I have written in
my sdio_write routine. Any ideas as to why? I am
copying the related code below:
APPLICATION
-----------------
The output that I receive is as below:
APPLICATION
------------
static void simple_prog(CYG_ADDRESS data)
{
cyg_io_handle_t handle=2;
int err=3;
diag_printf("<APP>IN THE MAIN FTN\n\n\n");
err = cyg_io_lookup( "/dev/sdio", &handle );
if (ENOERR == err) {
diag_printf("<APP>Look function successfully
called\n");
}
err = cyg_io_write( handle,&buffer1, &buffer2 );
if (ENOERR == err) {
diag_printf("<APP> Write function was
successfully called\n");
}
}
DEVS LAYER
----------
DEVTAB_ENTRY(sdio_label,
"/dev/sdio",
0, // Does not depend on a
lower level interface
&sdio1_devio,
sdio_init,
sdio_lookup,
0);
static Cyg_ErrNo
sdio_lookup(struct cyg_devtab_entry *tab)
{
diag_printf("sdio_lookup function called.\n");
return ENOERR;
}
IO LAYER
--------
DEVIO_TABLE(sdio1_devio,
sdio_write,
sdio_read,
sdio_select,
sdio_get_config,
sdio_set_config
);
static Cyg_ErrNo
sdio_write(cyg_io_handle_t handle, const void *buf,
cyg_uint32 *len)
{
cyg_devtab_entry_t *ptrDevTab;
diag_printf("sdio_write function called.
\n");
return 2;
}
static Cyg_ErrNo
sdio_read(cyg_io_handle_t handle, void *buf,
cyg_uint32 *len)
{
diag_printf("sdio_read function called.
\n");
return ENOERR;
}
-------------------------------------------
<APP>IN THE MAIN FTN
sdio_lookup function called
<APP> Look function was successfully called
<APP>Write function was successfully called
<APP>Read function was successfully called
Regards
Raj
__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-09-12 16:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-12 16:19 [ECOS] Wrong Handler Returned somarouthu venkata raja sekhar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).