-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbsp-rtl22xx-Use-IRQ-extensions-API.patch
75 lines (65 loc) · 2.23 KB
/
bsp-rtl22xx-Use-IRQ-extensions-API.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
From 583eb4588fb0c674ede7be485f037f50fc1bb843 Mon Sep 17 00:00:00 2001
From: Vipul Nayyar <[email protected]>
Date: Mon, 15 Jul 2013 15:04:45 +0530
Subject: [PATCH] bsp/rtl22xx: Use IRQ extensions API
---
c/src/lib/libbsp/arm/rtl22xx/network/network.c | 33 ++++++++++++++++----------
1 file changed, 20 insertions(+), 13 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..e89a9e7 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};
+static void cs8900_isr(void *);
char g_enetbuf[1520];
-void cs8900_isr(rtems_irq_hdl_param unused)
+static void cs8900_isr(void *arg)
{
- cs8900_interrupt(LPC22xx_INTERRUPT_EINT2, g_cs);
+ cs8900_interrupt(LPC22xx_INTERRUPT_EINT2, arg);
}
/* cs8900_io_set_reg - set one of the I/O addressed registers */
@@ -69,13 +63,26 @@ unsigned short cs8900_mem_get_reg (cs8900_device *cs, unsigned long reg)
void cs8900_attach_interrupt (cs8900_device *cs)
{
- 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,
+ cs8900_isr,
+ cs
+ );
+ 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,
+ cs
+ );
+ assert(status == RTEMS_SUCCESSFUL);
}
unsigned short cs8900_get_data_block (cs8900_device *cs, unsigned char *data)
--
1.7.11.7