[PATCH] Updated Legacy code in arm rtl22xx

Vipul Nayyar nayyar_vipul at yahoo.com
Thu Jul 11 08:31:08 UTC 2013


---
 c/src/lib/libbsp/arm/rtl22xx/network/network.c | 29 +++++++++++++++++---------
 1 file changed, 19 insertions(+), 10 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..d222af1 100644
--- a/c/src/lib/libbsp/arm/rtl22xx/network/network.c
+++ b/c/src/lib/libbsp/arm/rtl22xx/network/network.c
@@ -3,18 +3,13 @@
 #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};
 
 char g_enetbuf[1520];
 
@@ -28,7 +23,7 @@ void cs8900_io_set_reg (cs8900_device *cs, unsigned short reg, unsigned short da
 {
     /* works the same for all values of dev */
 /*
-    printf("cs8900_io_set_reg: reg: %#6x, val %#6x\n",
+    printf("cs8900_io_set_reg: reg: %#6x, val %#6xn",
            CS8900_BASE + reg,
            data);
 */
@@ -42,7 +37,7 @@ unsigned short cs8900_io_get_reg (cs8900_device *cs, unsigned short reg)
     /* works the same for all values of dev */
     val = *(unsigned short *)(CS8900_BASE + reg);
 /*
-    printf("cs8900_io_get_reg: reg: %#6x, val %#6x\n", reg, val);
+    printf("cs8900_io_get_reg: reg: %#6x, val %#6xn", reg, val);
 */
     return val;
 }
@@ -69,13 +64,27 @@ unsigned short cs8900_mem_get_reg (cs8900_device *cs, unsigned long reg)
 
 void cs8900_attach_interrupt (cs8900_device *cs)
 {
+    rtems_status_code status = RTEMS_SUCCESSFUL;
     g_cs = cs;
-    BSP_install_rtems_irq_handler(&cs8900_isr_data);
+    status = rtems_interrupt_handler_install(
+        LPC22xx_INTERRUPT_EINT2,
+        "Network",
+        RTEMS_INTERRUPT_UNIQUE,
+        cs8900_isr,
+        NULL
+    );
+    assert(status == RTEMS_SUCCESSFUL);
 }
 
 void cs8900_detach_interrupt (cs8900_device *cs)
 {
-    BSP_remove_rtems_irq_handler(&cs8900_isr_data);
+    rtems_status_code status = RTEMS_SUCCESSFUL;
+    status = rtems_interrupt_handler_remove(
+        LPC22xx_INTERRUPT_EINT2,
+        cs8900_isr,
+        NULL
+    );
+    assert(status == RTEMS_SUCCESSFUL);
 }
 
 unsigned short cs8900_get_data_block (cs8900_device *cs, unsigned char *data)
-- 
1.7.11.7




More information about the devel mailing list