-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbsp-gumstix-Fix-warnings.patch
129 lines (119 loc) · 3.35 KB
/
bsp-gumstix-Fix-warnings.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
From 163e88a8c36815dad65a0342a2d6f851f1f5ed9f Mon Sep 17 00:00:00 2001
From: Vipul Nayyar <[email protected]>
Date: Fri, 12 Jul 2013 22:33:57 +0530
Subject: [PATCH] bsp/gumstix: Fix warnings
---
c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c | 68 ++++++--------------------
1 file changed, 14 insertions(+), 54 deletions(-)
diff --git a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
index ef8ae4e..dd513ee 100644
--- a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
+++ b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
@@ -332,9 +332,9 @@ ne_check_status (struct ne_softc *sc, int from_irq_handler)
/* Handle an NE2000 interrupt. */
static void
-ne_interrupt_handler (rtems_irq_hdl_param handle)
+ne_interrupt_handler (void *arg)
{
- struct ne_softc *sc = handle;
+ struct ne_softc *sc = arg;
if (sc == NULL)
return;
@@ -350,10 +350,8 @@ ne_interrupt_handler (rtems_irq_hdl_param handle)
/* Turn NE2000 interrupts on. */
static void
-ne_interrupt_on (const void * handle)
+ne_interrupt_on (struct ne_softc *sc)
{
- struct ne_softc *sc = handle;
-
#ifdef DEBUG_NE
printk ("ne_interrupt_on()\n");
#endif
@@ -361,44 +359,6 @@ ne_interrupt_on (const void * handle)
outport_byte (sc->port + IMR, NE_INTERRUPTS);
}
-/* Turn NE2000 interrupts off. See ne_interrupt_on. */
-
-static void
-ne_interrupt_off (const void * handle)
-{
- struct ne_softc *sc = handle;
-
-#ifdef DEBUG_NE
- printk ("ne_interrupt_off()\n");
-#endif
- if (sc != NULL)
- outport_byte (sc->port + IMR, 0);
-}
-
-/*
- *Return whether NE2000 interrupts are on.
- *If it is eanbled, return 1
-*/
-static int
-ne_interrupt_is_on (const void * handle)
-{
- struct ne_softc *sc = handle;
- unsigned char imr;
-#ifdef DEBUG_NE
- printk("ne_interrupt_is_on()\n");
-#endif
- if(sc != NULL){
- /*Read IMR in Page2*/
- outport_byte (sc->port + CMDR, MSK_PG2 | MSK_RD2 | MSK_STP);
- inport_byte(sc->port + IMR, imr);
- /*Back Page 0*/
- outport_byte (sc->port + CMDR, MSK_PG0 | MSK_RD2 | MSK_STP);
- if(imr == NE_INTERRUPTS)
- return 1;
- }
- return 0;
-}
-
/* Initialize the NE2000 hardware. */
static void
@@ -484,15 +444,17 @@ ne_init_irq_handler(struct ne_softc *sc)
#ifdef DEBUG_NE
printk("ne_init_irq_handler(%d)\n", sc->irno);
#endif
+
status = rtems_interrupt_handler_install(
- sc->irno,
- "RTL8019",
- RTEMS_INTERRUPT_UNIQUE,
- ne_interrupt_handler,
- sc
- );
- assert(status == RTEMS_SUCCESSFUL);
- ne_interrupt_on(sc);
+ sc->irno,
+ "RTL8019",
+ RTEMS_INTERRUPT_UNIQUE,
+ ne_interrupt_handler,
+ sc
+ );
+ assert(status == RTEMS_SUCCESSFUL);
+ ne_interrupt_on(sc);
+}
/* The NE2000 packet receive daemon. This task is started when the
NE2000 driver is initialized. */
@@ -526,7 +488,7 @@ ne_rx_daemon (void *arg)
{
unsigned char startpage, currpage;
unsigned short len;
- unsigned char next, stat, cnt1, cnt2;
+ unsigned char next, cnt1, cnt2;
struct mbuf *m = NULL;
unsigned char *p;
int startaddr;
@@ -614,8 +576,6 @@ ne_rx_daemon (void *arg)
goto Next;
}
- stat = hdr.rsr;
-
/* The first four bytes of the length are the buffer header
* Just decrease them by 2 since in ARM, we have to make sure
* 4bytes memory access align on 4bytes
--
1.7.11.7