This is the mail archive of the ecos-discuss@sourceware.org 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]

Wrong Handler Returned


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


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