[PATCH] Updated Legacy code in arm rtl22xx

Vipul Nayyar nayyar_vipul at yahoo.com
Fri Jul 12 12:01:51 UTC 2013


You want this : (rtems_interrupt_handler)cs8900_isr ?

Plus, Do I need to put 0 instead of NULL ? I don't know right now if I'm aware of the answer or I'm just overlooking it .

Regards
Vipul Nayyar 



________________________________
 From: Sebastian Huber <sebastian.huber at embedded-brains.de>
To: rtems-devel at rtems.org 
Sent: Friday, 12 July 2013 5:07 PM
Subject: Re: [PATCH] Updated Legacy code in arm rtl22xx
 

On 07/12/2013 01:24 PM, Vipul Nayyar wrote:
> ---
>   c/src/lib/libbsp/arm/rtl22xx/network/network.c | 37 +++++++++++++++-----------
>   c/src/libchip/network/cs8900.c                 |  4 +--
>   c/src/libchip/network/cs8900.h                 |  4 +--
>   3 files changed, 26 insertions(+), 19 deletions(-)
>
> diff --git a/c/src/lib/libbsp/arm/rtl22xx/network/network.c b/c/src/lib/libbsp/arm/rtl22xx/network/network.c
> index 3b54862..77dc3e2 100644
> --- a/c/src/lib/libbsp/arm/rtl22xx/network/network.c
> +++ b/c/src/lib/libbsp/arm/rtl22xx/network/network.c
> @@ -3,24 +3,18 @@
>   #include <sys/mbuf.h>
>   #include <bsp/irq.h>
>   #include <libchip/cs8900.h>
> +#include <assert.h>
>
>   #define CS8900_BASE 0x20000300
>   unsigned int bsp_cs8900_io_base = 0;
>   unsigned int bsp_cs8900_memory_base = 0;
> -cs8900_device *g_cs;
> -void cs8900_isr(rtems_irq_hdl_param unused);
> -rtems_irq_connect_data cs8900_isr_data = {LPC22xx_INTERRUPT_EINT2,
> -                                         cs8900_isr,
> -                      NULL,
> -                      NULL,
> -                      NULL,
> -                      NULL};
> +void cs8900_isr(cs8900_device *cs);
>
>   char g_enetbuf[1520];
>
> -void cs8900_isr(rtems_irq_hdl_param unused)
> +void cs8900_isr(cs8900_device *cs)
>   {
> -    cs8900_interrupt(LPC22xx_INTERRUPT_EINT2, g_cs);
> +    cs8900_interrupt(LPC22xx_INTERRUPT_EINT2, cs);
>   }
>
>   /* cs8900_io_set_reg - set one of the I/O addressed registers */
> @@ -67,15 +61,28 @@ unsigned short cs8900_mem_get_reg (cs8900_device *cs, unsigned long reg)
>       return cs8900_io_get_reg(cs, CS8900_IO_PP_DATA_PORT0);
>   }
>
> -void cs8900_attach_interrupt (cs8900_device *cs)
> +void cs8900_attach_interrupt (void)
>   {
> -    g_cs = cs;
> -    BSP_install_rtems_irq_handler(&cs8900_isr_data);
> +    rtems_status_code status = RTEMS_SUCCESSFUL;
> +    status = rtems_interrupt_handler_install(
> +        LPC22xx_INTERRUPT_EINT2,
> +        "Network",
> +        RTEMS_INTERRUPT_UNIQUE,
> +        (void *)cs8900_isr,

Please use the right function type and move the cast inside the cs8900_isr.

> +        NULL
> +    );
[...]

This will not work.  Do you know why?


-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
_______________________________________________
rtems-devel mailing list
rtems-devel at rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130712/07058c22/attachment-0001.html>


More information about the devel mailing list