[Patch] Removing legacy method from arm csb337

Vipul Nayyar nayyar_vipul at yahoo.com
Tue Jul 2 06:52:52 UTC 2013


Hello Andreas,

Thanks Andreas for pointing out that silly mistake. I didn't focus on other variables being used. I've updated the patch, and wanted to ask, what should be done when status code returned is not successful ?

commit 9b21c1effe34cb716c00ea1c11777ef16ce9c7cc
Author: Vipul Nayyar <nayyar_vipul at yahoo.com>
Date:   Tue Jul 2 12:20:49 2013 +0530

    Updated Legacy code in arm csb337

diff --git a/c/src/lib/libbsp/arm/csb337/network/network.c b/c/src/lib/libbsp/arm/csb337/network/network.c
index e31bcc0..53d60d2 100644
--- a/c/src/lib/libbsp/arm/csb337/network/network.c
+++ b/c/src/lib/libbsp/arm/csb337/network/network.c
@@ -358,6 +358,7 @@ void at91rm9200_emac_init(void *arg)
 {
     at91rm9200_emac_softc_t     *sc = arg;
     struct ifnet *ifp = &sc->arpcom.ac_if;
+    rtems_status_code stc = RTEMS_SUCCESSFUL;
 
     /*
      *This is for stuff that only gets done once (at91rm9200_emac_init()
@@ -382,7 +383,16 @@ void at91rm9200_emac_init(void *arg)
     AIC_SMR_REG(AIC_SMR_EMAC) = AIC_SMR_PRIOR(EMAC_INT_PRIORITY);
 
     /* install the interrupt handler */
-    BSP_install_rtems_irq_handler(&at91rm9200_emac_isr_data);
+    stc = rtems_interrupt_handler_install(
+      at91rm9200_emac_isr_data.name,
+      "Network",
+      RTEMS_INTERRUPT_UNIQUE,
+      at91rm9200_emac_isr_data.hdl,
+      at91rm9200_emac_isr_data.handle
+    );
+    if (stc != RTEMS_SUCCESSFUL) {
+    printk("RTEMS Interrupt handler not installed");
+    }
 
     /* EMAC doesn't support promiscuous, so ignore requests */
     if (ifp->if_flags & IFF_PROMISC) {


Regards
Vipul Nayyar 



________________________________
 From: Andreas Heinig <andreas.heinig at cs.tu-dortmund.de>
To: rtems-devel at rtems.org; Vipul Nayyar <nayyar_vipul at yahoo.com> 
Sent: Tuesday, 2 July 2013 12:11 PM
Subject: Re: [Patch] Removing legacy method from arm csb337
 

Hello Vipul,

> diff --git a/c/src/lib/libbsp/arm/csb337/network/network.c
> b/c/src/lib/libbsp/arm/csb337/network/network.c index e31bcc0..3a02073
> 100644
> --- a/c/src/lib/libbsp/arm/csb337/network/network.c
> +++ b/c/src/lib/libbsp/arm/csb337/network/network.c
> @@ -358,6 +358,7 @@ void at91rm9200_emac_init(void *arg)
>  {
>      at91rm9200_emac_softc_t     *sc = arg;
>      struct ifnet *ifp = &sc->arpcom.ac_if;
> +    rtems_status_code sc = RTEMS_SUCCESSFUL;

Hello,

you used 'sc' twice:
1) at91rm9200_emac_softc_t
2) rtems_status_code

Cheers
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130702/6632aa86/attachment.html>


More information about the devel mailing list