aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2006-02-09 14:15:02 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-02-09 14:15:02 -0500
commit2746b8623abce815aaae7afc946b1b39f8436f5a (patch)
tree9e14ce2a3710da5c079c1a96efa5e7c8674cd382 /drivers/net
parent0bdd340c092b0936f78a54bdbd3927463ed4fca3 (diff)
parent450d86dff3fc4780fd5c2d1654402ab7ffec9c38 (diff)
Merge branch 'net.b0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/bird
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/7990.c2
-rw-r--r--drivers/net/82596.c2
-rw-r--r--drivers/net/appletalk/cops.h2
-rw-r--r--drivers/net/arcnet/arc-rimi.c68
-rw-r--r--drivers/net/arcnet/com90xx.c132
-rw-r--r--drivers/net/hp100.c30
-rw-r--r--drivers/net/ibm_emac/ibm_emac_core.c40
-rw-r--r--drivers/net/ibm_emac/ibm_emac_core.h2
-rw-r--r--drivers/net/ibm_emac/ibm_emac_debug.c2
-rw-r--r--drivers/net/ibm_emac/ibm_emac_rgmii.h2
-rw-r--r--drivers/net/ibm_emac/ibm_emac_zmii.c7
-rw-r--r--drivers/net/ibm_emac/ibm_emac_zmii.h2
-rw-r--r--drivers/net/macsonic.c2
-rw-r--r--drivers/net/tulip/xircom_cb.c3
-rw-r--r--drivers/net/wan/hostess_sv11.c1
-rw-r--r--drivers/net/wan/sealevel.c1
16 files changed, 186 insertions, 112 deletions
diff --git a/drivers/net/7990.c b/drivers/net/7990.c
index 18b027e73f28..86633c5f1a4b 100644
--- a/drivers/net/7990.c
+++ b/drivers/net/7990.c
@@ -29,7 +29,7 @@
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/string.h> 30#include <linux/string.h>
31#include <linux/skbuff.h> 31#include <linux/skbuff.h>
32#include <linux/irq.h> 32#include <asm/irq.h>
33/* Used for the temporal inet entries and routing */ 33/* Used for the temporal inet entries and routing */
34#include <linux/socket.h> 34#include <linux/socket.h>
35#include <linux/bitops.h> 35#include <linux/bitops.h>
diff --git a/drivers/net/82596.c b/drivers/net/82596.c
index 13b745b39667..da0c878dcba8 100644
--- a/drivers/net/82596.c
+++ b/drivers/net/82596.c
@@ -614,7 +614,7 @@ static void rebuild_rx_bufs(struct net_device *dev)
614static int init_i596_mem(struct net_device *dev) 614static int init_i596_mem(struct net_device *dev)
615{ 615{
616 struct i596_private *lp = dev->priv; 616 struct i596_private *lp = dev->priv;
617#if !defined(ENABLE_MVME16x_NET) && !defined(ENABLE_BVME6000_NET) 617#if !defined(ENABLE_MVME16x_NET) && !defined(ENABLE_BVME6000_NET) || defined(ENABLE_APRICOT)
618 short ioaddr = dev->base_addr; 618 short ioaddr = dev->base_addr;
619#endif 619#endif
620 unsigned long flags; 620 unsigned long flags;
diff --git a/drivers/net/appletalk/cops.h b/drivers/net/appletalk/cops.h
index c68ba9c2ef46..aca47f3a7b98 100644
--- a/drivers/net/appletalk/cops.h
+++ b/drivers/net/appletalk/cops.h
@@ -51,7 +51,7 @@
51struct ltfirmware 51struct ltfirmware
52{ 52{
53 unsigned int length; 53 unsigned int length;
54 unsigned char * data; 54 const unsigned char * data;
55}; 55};
56 56
57#define DAYNA 1 57#define DAYNA 1
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c
index 38c3f033f739..8c8d6c453c45 100644
--- a/drivers/net/arcnet/arc-rimi.c
+++ b/drivers/net/arcnet/arc-rimi.c
@@ -97,25 +97,44 @@ static int __init arcrimi_probe(struct net_device *dev)
97 "must specify the shmem and irq!\n"); 97 "must specify the shmem and irq!\n");
98 return -ENODEV; 98 return -ENODEV;
99 } 99 }
100 if (dev->dev_addr[0] == 0) {
101 BUGMSG(D_NORMAL, "You need to specify your card's station "
102 "ID!\n");
103 return -ENODEV;
104 }
100 /* 105 /*
101 * Grab the memory region at mem_start for BUFFER_SIZE bytes. 106 * Grab the memory region at mem_start for MIRROR_SIZE bytes.
102 * Later in arcrimi_found() the real size will be determined 107 * Later in arcrimi_found() the real size will be determined
103 * and this reserve will be released and the correct size 108 * and this reserve will be released and the correct size
104 * will be taken. 109 * will be taken.
105 */ 110 */
106 if (!request_mem_region(dev->mem_start, BUFFER_SIZE, "arcnet (90xx)")) { 111 if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) {
107 BUGMSG(D_NORMAL, "Card memory already allocated\n"); 112 BUGMSG(D_NORMAL, "Card memory already allocated\n");
108 return -ENODEV; 113 return -ENODEV;
109 } 114 }
110 if (dev->dev_addr[0] == 0) {
111 release_mem_region(dev->mem_start, BUFFER_SIZE);
112 BUGMSG(D_NORMAL, "You need to specify your card's station "
113 "ID!\n");
114 return -ENODEV;
115 }
116 return arcrimi_found(dev); 115 return arcrimi_found(dev);
117} 116}
118 117
118static int check_mirror(unsigned long addr, size_t size)
119{
120 void __iomem *p;
121 int res = -1;
122
123 if (!request_mem_region(addr, size, "arcnet (90xx)"))
124 return -1;
125
126 p = ioremap(addr, size);
127 if (p) {
128 if (readb(p) == TESTvalue)
129 res = 1;
130 else
131 res = 0;
132 iounmap(p);
133 }
134
135 release_mem_region(addr, size);
136 return res;
137}
119 138
120/* 139/*
121 * Set up the struct net_device associated with this card. Called after 140 * Set up the struct net_device associated with this card. Called after
@@ -125,19 +144,28 @@ static int __init arcrimi_found(struct net_device *dev)
125{ 144{
126 struct arcnet_local *lp; 145 struct arcnet_local *lp;
127 unsigned long first_mirror, last_mirror, shmem; 146 unsigned long first_mirror, last_mirror, shmem;
147 void __iomem *p;
128 int mirror_size; 148 int mirror_size;
129 int err; 149 int err;
130 150
151 p = ioremap(dev->mem_start, MIRROR_SIZE);
152 if (!p) {
153 release_mem_region(dev->mem_start, MIRROR_SIZE);
154 BUGMSG(D_NORMAL, "Can't ioremap\n");
155 return -ENODEV;
156 }
157
131 /* reserve the irq */ 158 /* reserve the irq */
132 if (request_irq(dev->irq, &arcnet_interrupt, 0, "arcnet (RIM I)", dev)) { 159 if (request_irq(dev->irq, &arcnet_interrupt, 0, "arcnet (RIM I)", dev)) {
133 release_mem_region(dev->mem_start, BUFFER_SIZE); 160 iounmap(p);
161 release_mem_region(dev->mem_start, MIRROR_SIZE);
134 BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq); 162 BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq);
135 return -ENODEV; 163 return -ENODEV;
136 } 164 }
137 165
138 shmem = dev->mem_start; 166 shmem = dev->mem_start;
139 isa_writeb(TESTvalue, shmem); 167 writeb(TESTvalue, p);
140 isa_writeb(dev->dev_addr[0], shmem + 1); /* actually the node ID */ 168 writeb(dev->dev_addr[0], p + 1); /* actually the node ID */
141 169
142 /* find the real shared memory start/end points, including mirrors */ 170 /* find the real shared memory start/end points, including mirrors */
143 171
@@ -146,17 +174,18 @@ static int __init arcrimi_found(struct net_device *dev)
146 * 2k (or there are no mirrors at all) but on some, it's 4k. 174 * 2k (or there are no mirrors at all) but on some, it's 4k.
147 */ 175 */
148 mirror_size = MIRROR_SIZE; 176 mirror_size = MIRROR_SIZE;
149 if (isa_readb(shmem) == TESTvalue 177 if (readb(p) == TESTvalue
150 && isa_readb(shmem - mirror_size) != TESTvalue 178 && check_mirror(shmem - MIRROR_SIZE, MIRROR_SIZE) == 0
151 && isa_readb(shmem - 2 * mirror_size) == TESTvalue) 179 && check_mirror(shmem - 2 * MIRROR_SIZE, MIRROR_SIZE) == 1)
152 mirror_size *= 2; 180 mirror_size = 2 * MIRROR_SIZE;
153 181
154 first_mirror = last_mirror = shmem; 182 first_mirror = shmem - mirror_size;
155 while (isa_readb(first_mirror) == TESTvalue) 183 while (check_mirror(first_mirror, mirror_size) == 1)
156 first_mirror -= mirror_size; 184 first_mirror -= mirror_size;
157 first_mirror += mirror_size; 185 first_mirror += mirror_size;
158 186
159 while (isa_readb(last_mirror) == TESTvalue) 187 last_mirror = shmem + mirror_size;
188 while (check_mirror(last_mirror, mirror_size) == 1)
160 last_mirror += mirror_size; 189 last_mirror += mirror_size;
161 last_mirror -= mirror_size; 190 last_mirror -= mirror_size;
162 191
@@ -181,7 +210,8 @@ static int __init arcrimi_found(struct net_device *dev)
181 * with the correct size. There is a VERY slim chance this could 210 * with the correct size. There is a VERY slim chance this could
182 * fail. 211 * fail.
183 */ 212 */
184 release_mem_region(shmem, BUFFER_SIZE); 213 iounmap(p);
214 release_mem_region(shmem, MIRROR_SIZE);
185 if (!request_mem_region(dev->mem_start, 215 if (!request_mem_region(dev->mem_start,
186 dev->mem_end - dev->mem_start + 1, 216 dev->mem_end - dev->mem_start + 1,
187 "arcnet (90xx)")) { 217 "arcnet (90xx)")) {
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c
index 6c2c9b9ac6db..43150b2bd13f 100644
--- a/drivers/net/arcnet/com90xx.c
+++ b/drivers/net/arcnet/com90xx.c
@@ -53,7 +53,7 @@
53 53
54 54
55/* Internal function declarations */ 55/* Internal function declarations */
56static int com90xx_found(int ioaddr, int airq, u_long shmem); 56static int com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem *);
57static void com90xx_command(struct net_device *dev, int command); 57static void com90xx_command(struct net_device *dev, int command);
58static int com90xx_status(struct net_device *dev); 58static int com90xx_status(struct net_device *dev);
59static void com90xx_setmask(struct net_device *dev, int mask); 59static void com90xx_setmask(struct net_device *dev, int mask);
@@ -116,14 +116,26 @@ static void __init com90xx_probe(void)
116 unsigned long airqmask; 116 unsigned long airqmask;
117 int ports[(0x3f0 - 0x200) / 16 + 1] = 117 int ports[(0x3f0 - 0x200) / 16 + 1] =
118 {0}; 118 {0};
119 u_long shmems[(0xFF800 - 0xA0000) / 2048 + 1] = 119 unsigned long *shmems;
120 {0}; 120 void __iomem **iomem;
121 int numports, numshmems, *port; 121 int numports, numshmems, *port;
122 u_long *p; 122 u_long *p;
123 int index;
123 124
124 if (!io && !irq && !shmem && !*device && com90xx_skip_probe) 125 if (!io && !irq && !shmem && !*device && com90xx_skip_probe)
125 return; 126 return;
126 127
128 shmems = kzalloc(((0x10000-0xa0000) / 0x800) * sizeof(unsigned long),
129 GFP_KERNEL);
130 if (!shmems)
131 return;
132 iomem = kzalloc(((0x10000-0xa0000) / 0x800) * sizeof(void __iomem *),
133 GFP_KERNEL);
134 if (!iomem) {
135 kfree(shmems);
136 return;
137 }
138
127 BUGLVL(D_NORMAL) printk(VERSION); 139 BUGLVL(D_NORMAL) printk(VERSION);
128 140
129 /* set up the arrays where we'll store the possible probe addresses */ 141 /* set up the arrays where we'll store the possible probe addresses */
@@ -179,6 +191,8 @@ static void __init com90xx_probe(void)
179 191
180 if (!numports) { 192 if (!numports) {
181 BUGMSG2(D_NORMAL, "S1: No ARCnet cards found.\n"); 193 BUGMSG2(D_NORMAL, "S1: No ARCnet cards found.\n");
194 kfree(shmems);
195 kfree(iomem);
182 return; 196 return;
183 } 197 }
184 /* Stage 2: we have now reset any possible ARCnet cards, so we can't 198 /* Stage 2: we have now reset any possible ARCnet cards, so we can't
@@ -202,8 +216,8 @@ static void __init com90xx_probe(void)
202 * 0xD1 byte in the right place, or are read-only. 216 * 0xD1 byte in the right place, or are read-only.
203 */ 217 */
204 numprint = -1; 218 numprint = -1;
205 for (p = &shmems[0]; p < shmems + numshmems; p++) { 219 for (index = 0, p = &shmems[0]; index < numshmems; p++, index++) {
206 u_long ptr = *p; 220 void __iomem *base;
207 221
208 numprint++; 222 numprint++;
209 numprint %= 8; 223 numprint %= 8;
@@ -213,38 +227,49 @@ static void __init com90xx_probe(void)
213 } 227 }
214 BUGMSG2(D_INIT, "%lXh ", *p); 228 BUGMSG2(D_INIT, "%lXh ", *p);
215 229
216 if (!request_mem_region(*p, BUFFER_SIZE, "arcnet (90xx)")) { 230 if (!request_mem_region(*p, MIRROR_SIZE, "arcnet (90xx)")) {
217 BUGMSG2(D_INIT_REASONS, "(request_mem_region)\n"); 231 BUGMSG2(D_INIT_REASONS, "(request_mem_region)\n");
218 BUGMSG2(D_INIT_REASONS, "Stage 3: "); 232 BUGMSG2(D_INIT_REASONS, "Stage 3: ");
219 BUGLVL(D_INIT_REASONS) numprint = 0; 233 BUGLVL(D_INIT_REASONS) numprint = 0;
220 *p-- = shmems[--numshmems]; 234 goto out;
221 continue; 235 }
236 base = ioremap(*p, MIRROR_SIZE);
237 if (!base) {
238 BUGMSG2(D_INIT_REASONS, "(ioremap)\n");
239 BUGMSG2(D_INIT_REASONS, "Stage 3: ");
240 BUGLVL(D_INIT_REASONS) numprint = 0;
241 goto out1;
222 } 242 }
223 if (isa_readb(ptr) != TESTvalue) { 243 if (readb(base) != TESTvalue) {
224 BUGMSG2(D_INIT_REASONS, "(%02Xh != %02Xh)\n", 244 BUGMSG2(D_INIT_REASONS, "(%02Xh != %02Xh)\n",
225 isa_readb(ptr), TESTvalue); 245 readb(base), TESTvalue);
226 BUGMSG2(D_INIT_REASONS, "S3: "); 246 BUGMSG2(D_INIT_REASONS, "S3: ");
227 BUGLVL(D_INIT_REASONS) numprint = 0; 247 BUGLVL(D_INIT_REASONS) numprint = 0;
228 release_mem_region(*p, BUFFER_SIZE); 248 goto out2;
229 *p-- = shmems[--numshmems];
230 continue;
231 } 249 }
232 /* By writing 0x42 to the TESTvalue location, we also make 250 /* By writing 0x42 to the TESTvalue location, we also make
233 * sure no "mirror" shmem areas show up - if they occur 251 * sure no "mirror" shmem areas show up - if they occur
234 * in another pass through this loop, they will be discarded 252 * in another pass through this loop, they will be discarded
235 * because *cptr != TESTvalue. 253 * because *cptr != TESTvalue.
236 */ 254 */
237 isa_writeb(0x42, ptr); 255 writeb(0x42, base);
238 if (isa_readb(ptr) != 0x42) { 256 if (readb(base) != 0x42) {
239 BUGMSG2(D_INIT_REASONS, "(read only)\n"); 257 BUGMSG2(D_INIT_REASONS, "(read only)\n");
240 BUGMSG2(D_INIT_REASONS, "S3: "); 258 BUGMSG2(D_INIT_REASONS, "S3: ");
241 release_mem_region(*p, BUFFER_SIZE); 259 goto out2;
242 *p-- = shmems[--numshmems];
243 continue;
244 } 260 }
245 BUGMSG2(D_INIT_REASONS, "\n"); 261 BUGMSG2(D_INIT_REASONS, "\n");
246 BUGMSG2(D_INIT_REASONS, "S3: "); 262 BUGMSG2(D_INIT_REASONS, "S3: ");
247 BUGLVL(D_INIT_REASONS) numprint = 0; 263 BUGLVL(D_INIT_REASONS) numprint = 0;
264 iomem[index] = base;
265 continue;
266 out2:
267 iounmap(base);
268 out1:
269 release_mem_region(*p, MIRROR_SIZE);
270 out:
271 *p-- = shmems[--numshmems];
272 index--;
248 } 273 }
249 BUGMSG2(D_INIT, "\n"); 274 BUGMSG2(D_INIT, "\n");
250 275
@@ -252,6 +277,8 @@ static void __init com90xx_probe(void)
252 BUGMSG2(D_NORMAL, "S3: No ARCnet cards found.\n"); 277 BUGMSG2(D_NORMAL, "S3: No ARCnet cards found.\n");
253 for (port = &ports[0]; port < ports + numports; port++) 278 for (port = &ports[0]; port < ports + numports; port++)
254 release_region(*port, ARCNET_TOTAL_SIZE); 279 release_region(*port, ARCNET_TOTAL_SIZE);
280 kfree(shmems);
281 kfree(iomem);
255 return; 282 return;
256 } 283 }
257 /* Stage 4: something of a dummy, to report the shmems that are 284 /* Stage 4: something of a dummy, to report the shmems that are
@@ -351,30 +378,32 @@ static void __init com90xx_probe(void)
351 mdelay(RESETtime); 378 mdelay(RESETtime);
352 } else { 379 } else {
353 /* just one shmem and port, assume they match */ 380 /* just one shmem and port, assume they match */
354 isa_writeb(TESTvalue, shmems[0]); 381 writeb(TESTvalue, iomem[0]);
355 } 382 }
356#else 383#else
357 inb(_RESET); 384 inb(_RESET);
358 mdelay(RESETtime); 385 mdelay(RESETtime);
359#endif 386#endif
360 387
361 for (p = &shmems[0]; p < shmems + numshmems; p++) { 388 for (index = 0; index < numshmems; index++) {
362 u_long ptr = *p; 389 u_long ptr = shmems[index];
390 void __iomem *base = iomem[index];
363 391
364 if (isa_readb(ptr) == TESTvalue) { /* found one */ 392 if (readb(base) == TESTvalue) { /* found one */
365 BUGMSG2(D_INIT, "%lXh)\n", *p); 393 BUGMSG2(D_INIT, "%lXh)\n", *p);
366 openparen = 0; 394 openparen = 0;
367 395
368 /* register the card */ 396 /* register the card */
369 if (com90xx_found(*port, airq, *p) == 0) 397 if (com90xx_found(*port, airq, ptr, base) == 0)
370 found = 1; 398 found = 1;
371 numprint = -1; 399 numprint = -1;
372 400
373 /* remove shmem from the list */ 401 /* remove shmem from the list */
374 *p = shmems[--numshmems]; 402 shmems[index] = shmems[--numshmems];
403 iomem[index] = iomem[numshmems];
375 break; /* go to the next I/O port */ 404 break; /* go to the next I/O port */
376 } else { 405 } else {
377 BUGMSG2(D_INIT_REASONS, "%Xh-", isa_readb(ptr)); 406 BUGMSG2(D_INIT_REASONS, "%Xh-", readb(base));
378 } 407 }
379 } 408 }
380 409
@@ -391,17 +420,40 @@ static void __init com90xx_probe(void)
391 BUGLVL(D_INIT_REASONS) printk("\n"); 420 BUGLVL(D_INIT_REASONS) printk("\n");
392 421
393 /* Now put back TESTvalue on all leftover shmems. */ 422 /* Now put back TESTvalue on all leftover shmems. */
394 for (p = &shmems[0]; p < shmems + numshmems; p++) { 423 for (index = 0; index < numshmems; index++) {
395 isa_writeb(TESTvalue, *p); 424 writeb(TESTvalue, iomem[index]);
396 release_mem_region(*p, BUFFER_SIZE); 425 iounmap(iomem[index]);
426 release_mem_region(shmems[index], MIRROR_SIZE);
397 } 427 }
428 kfree(shmems);
429 kfree(iomem);
398} 430}
399 431
432static int check_mirror(unsigned long addr, size_t size)
433{
434 void __iomem *p;
435 int res = -1;
436
437 if (!request_mem_region(addr, size, "arcnet (90xx)"))
438 return -1;
439
440 p = ioremap(addr, size);
441 if (p) {
442 if (readb(p) == TESTvalue)
443 res = 1;
444 else
445 res = 0;
446 iounmap(p);
447 }
448
449 release_mem_region(addr, size);
450 return res;
451}
400 452
401/* Set up the struct net_device associated with this card. Called after 453/* Set up the struct net_device associated with this card. Called after
402 * probing succeeds. 454 * probing succeeds.
403 */ 455 */
404static int __init com90xx_found(int ioaddr, int airq, u_long shmem) 456static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem *p)
405{ 457{
406 struct net_device *dev = NULL; 458 struct net_device *dev = NULL;
407 struct arcnet_local *lp; 459 struct arcnet_local *lp;
@@ -412,7 +464,8 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem)
412 dev = alloc_arcdev(device); 464 dev = alloc_arcdev(device);
413 if (!dev) { 465 if (!dev) {
414 BUGMSG2(D_NORMAL, "com90xx: Can't allocate device!\n"); 466 BUGMSG2(D_NORMAL, "com90xx: Can't allocate device!\n");
415 release_mem_region(shmem, BUFFER_SIZE); 467 iounmap(p);
468 release_mem_region(shmem, MIRROR_SIZE);
416 return -ENOMEM; 469 return -ENOMEM;
417 } 470 }
418 lp = dev->priv; 471 lp = dev->priv;
@@ -423,24 +476,27 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem)
423 * 2k (or there are no mirrors at all) but on some, it's 4k. 476 * 2k (or there are no mirrors at all) but on some, it's 4k.
424 */ 477 */
425 mirror_size = MIRROR_SIZE; 478 mirror_size = MIRROR_SIZE;
426 if (isa_readb(shmem) == TESTvalue 479 if (readb(p) == TESTvalue &&
427 && isa_readb(shmem - mirror_size) != TESTvalue 480 check_mirror(shmem - MIRROR_SIZE, MIRROR_SIZE) == 0 &&
428 && isa_readb(shmem - 2 * mirror_size) == TESTvalue) 481 check_mirror(shmem - 2 * MIRROR_SIZE, MIRROR_SIZE) == 1)
429 mirror_size *= 2; 482 mirror_size = 2 * MIRROR_SIZE;
430 483
431 first_mirror = last_mirror = shmem; 484 first_mirror = shmem - mirror_size;
432 while (isa_readb(first_mirror) == TESTvalue) 485 while (check_mirror(first_mirror, mirror_size) == 1)
433 first_mirror -= mirror_size; 486 first_mirror -= mirror_size;
434 first_mirror += mirror_size; 487 first_mirror += mirror_size;
435 488
436 while (isa_readb(last_mirror) == TESTvalue) 489 last_mirror = shmem + mirror_size;
490 while (check_mirror(last_mirror, mirror_size) == 1)
437 last_mirror += mirror_size; 491 last_mirror += mirror_size;
438 last_mirror -= mirror_size; 492 last_mirror -= mirror_size;
439 493
440 dev->mem_start = first_mirror; 494 dev->mem_start = first_mirror;
441 dev->mem_end = last_mirror + MIRROR_SIZE - 1; 495 dev->mem_end = last_mirror + MIRROR_SIZE - 1;
442 496
443 release_mem_region(shmem, BUFFER_SIZE); 497 iounmap(p);
498 release_mem_region(shmem, MIRROR_SIZE);
499
444 if (!request_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1, "arcnet (90xx)")) 500 if (!request_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1, "arcnet (90xx)"))
445 goto err_free_dev; 501 goto err_free_dev;
446 502
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index 55c7ed608391..7ba87b7ee612 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -1718,17 +1718,10 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
1718 hp100_outw(i, FRAGMENT_LEN); /* and first/only fragment length */ 1718 hp100_outw(i, FRAGMENT_LEN); /* and first/only fragment length */
1719 1719
1720 if (lp->mode == 2) { /* memory mapped */ 1720 if (lp->mode == 2) { /* memory mapped */
1721 if (lp->mem_ptr_virt) { /* high pci memory was remapped */ 1721 /* Note: The J2585B needs alignment to 32bits here! */
1722 /* Note: The J2585B needs alignment to 32bits here! */ 1722 memcpy_toio(lp->mem_ptr_virt, skb->data, (skb->len + 3) & ~3);
1723 memcpy_toio(lp->mem_ptr_virt, skb->data, (skb->len + 3) & ~3); 1723 if (!ok_flag)
1724 if (!ok_flag) 1724 memset_io(lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len);
1725 memset_io(lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len);
1726 } else {
1727 /* Note: The J2585B needs alignment to 32bits here! */
1728 isa_memcpy_toio(lp->mem_ptr_phys, skb->data, (skb->len + 3) & ~3);
1729 if (!ok_flag)
1730 isa_memset_io(lp->mem_ptr_phys, 0, HP100_MIN_PACKET_SIZE - skb->len);
1731 }
1732 } else { /* programmed i/o */ 1725 } else { /* programmed i/o */
1733 outsl(ioaddr + HP100_REG_DATA32, skb->data, 1726 outsl(ioaddr + HP100_REG_DATA32, skb->data,
1734 (skb->len + 3) >> 2); 1727 (skb->len + 3) >> 2);
@@ -1798,10 +1791,7 @@ static void hp100_rx(struct net_device *dev)
1798 /* First we get the header, which contains information about the */ 1791 /* First we get the header, which contains information about the */
1799 /* actual length of the received packet. */ 1792 /* actual length of the received packet. */
1800 if (lp->mode == 2) { /* memory mapped mode */ 1793 if (lp->mode == 2) { /* memory mapped mode */
1801 if (lp->mem_ptr_virt) /* if memory was remapped */ 1794 header = readl(lp->mem_ptr_virt);
1802 header = readl(lp->mem_ptr_virt);
1803 else
1804 header = isa_readl(lp->mem_ptr_phys);
1805 } else /* programmed i/o */ 1795 } else /* programmed i/o */
1806 header = hp100_inl(DATA32); 1796 header = hp100_inl(DATA32);
1807 1797
@@ -1833,13 +1823,9 @@ static void hp100_rx(struct net_device *dev)
1833 ptr = skb->data; 1823 ptr = skb->data;
1834 1824
1835 /* Now transfer the data from the card into that area */ 1825 /* Now transfer the data from the card into that area */
1836 if (lp->mode == 2) { 1826 if (lp->mode == 2)
1837 if (lp->mem_ptr_virt) 1827 memcpy_fromio(ptr, lp->mem_ptr_virt,pkt_len);
1838 memcpy_fromio(ptr, lp->mem_ptr_virt,pkt_len); 1828 else /* io mapped */
1839 /* Note alignment to 32bit transfers */
1840 else
1841 isa_memcpy_fromio(ptr, lp->mem_ptr_phys, pkt_len);
1842 } else /* io mapped */
1843 insl(ioaddr + HP100_REG_DATA32, ptr, pkt_len >> 2); 1829 insl(ioaddr + HP100_REG_DATA32, ptr, pkt_len >> 2);
1844 1830
1845 skb->protocol = eth_type_trans(skb, dev); 1831 skb->protocol = eth_type_trans(skb, dev);
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 591c5864ffb1..7e49522b8b3c 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -204,7 +204,7 @@ static inline int emac_phy_gpcs(int phy_mode)
204 204
205static inline void emac_tx_enable(struct ocp_enet_private *dev) 205static inline void emac_tx_enable(struct ocp_enet_private *dev)
206{ 206{
207 struct emac_regs *p = dev->emacp; 207 struct emac_regs __iomem *p = dev->emacp;
208 unsigned long flags; 208 unsigned long flags;
209 u32 r; 209 u32 r;
210 210
@@ -220,7 +220,7 @@ static inline void emac_tx_enable(struct ocp_enet_private *dev)
220 220
221static void emac_tx_disable(struct ocp_enet_private *dev) 221static void emac_tx_disable(struct ocp_enet_private *dev)
222{ 222{
223 struct emac_regs *p = dev->emacp; 223 struct emac_regs __iomem *p = dev->emacp;
224 unsigned long flags; 224 unsigned long flags;
225 u32 r; 225 u32 r;
226 226
@@ -244,7 +244,7 @@ static void emac_tx_disable(struct ocp_enet_private *dev)
244 244
245static void emac_rx_enable(struct ocp_enet_private *dev) 245static void emac_rx_enable(struct ocp_enet_private *dev)
246{ 246{
247 struct emac_regs *p = dev->emacp; 247 struct emac_regs __iomem *p = dev->emacp;
248 unsigned long flags; 248 unsigned long flags;
249 u32 r; 249 u32 r;
250 250
@@ -275,7 +275,7 @@ static void emac_rx_enable(struct ocp_enet_private *dev)
275 275
276static void emac_rx_disable(struct ocp_enet_private *dev) 276static void emac_rx_disable(struct ocp_enet_private *dev)
277{ 277{
278 struct emac_regs *p = dev->emacp; 278 struct emac_regs __iomem *p = dev->emacp;
279 unsigned long flags; 279 unsigned long flags;
280 u32 r; 280 u32 r;
281 281
@@ -299,7 +299,7 @@ static void emac_rx_disable(struct ocp_enet_private *dev)
299 299
300static inline void emac_rx_disable_async(struct ocp_enet_private *dev) 300static inline void emac_rx_disable_async(struct ocp_enet_private *dev)
301{ 301{
302 struct emac_regs *p = dev->emacp; 302 struct emac_regs __iomem *p = dev->emacp;
303 unsigned long flags; 303 unsigned long flags;
304 u32 r; 304 u32 r;
305 305
@@ -315,7 +315,7 @@ static inline void emac_rx_disable_async(struct ocp_enet_private *dev)
315 315
316static int emac_reset(struct ocp_enet_private *dev) 316static int emac_reset(struct ocp_enet_private *dev)
317{ 317{
318 struct emac_regs *p = dev->emacp; 318 struct emac_regs __iomem *p = dev->emacp;
319 unsigned long flags; 319 unsigned long flags;
320 int n = 20; 320 int n = 20;
321 321
@@ -348,7 +348,7 @@ static int emac_reset(struct ocp_enet_private *dev)
348 348
349static void emac_hash_mc(struct ocp_enet_private *dev) 349static void emac_hash_mc(struct ocp_enet_private *dev)
350{ 350{
351 struct emac_regs *p = dev->emacp; 351 struct emac_regs __iomem *p = dev->emacp;
352 u16 gaht[4] = { 0 }; 352 u16 gaht[4] = { 0 };
353 struct dev_mc_list *dmi; 353 struct dev_mc_list *dmi;
354 354
@@ -393,7 +393,7 @@ static inline int emac_opb_mhz(void)
393/* BHs disabled */ 393/* BHs disabled */
394static int emac_configure(struct ocp_enet_private *dev) 394static int emac_configure(struct ocp_enet_private *dev)
395{ 395{
396 struct emac_regs *p = dev->emacp; 396 struct emac_regs __iomem *p = dev->emacp;
397 struct net_device *ndev = dev->ndev; 397 struct net_device *ndev = dev->ndev;
398 int gige; 398 int gige;
399 u32 r; 399 u32 r;
@@ -555,7 +555,7 @@ static void emac_full_tx_reset(struct net_device *ndev)
555 555
556static int __emac_mdio_read(struct ocp_enet_private *dev, u8 id, u8 reg) 556static int __emac_mdio_read(struct ocp_enet_private *dev, u8 id, u8 reg)
557{ 557{
558 struct emac_regs *p = dev->emacp; 558 struct emac_regs __iomem *p = dev->emacp;
559 u32 r; 559 u32 r;
560 int n; 560 int n;
561 561
@@ -604,7 +604,7 @@ static int __emac_mdio_read(struct ocp_enet_private *dev, u8 id, u8 reg)
604static void __emac_mdio_write(struct ocp_enet_private *dev, u8 id, u8 reg, 604static void __emac_mdio_write(struct ocp_enet_private *dev, u8 id, u8 reg,
605 u16 val) 605 u16 val)
606{ 606{
607 struct emac_regs *p = dev->emacp; 607 struct emac_regs __iomem *p = dev->emacp;
608 int n; 608 int n;
609 609
610 DBG2("%d: mdio_write(%02x,%02x,%04x)" NL, dev->def->index, id, reg, 610 DBG2("%d: mdio_write(%02x,%02x,%04x)" NL, dev->def->index, id, reg,
@@ -666,7 +666,7 @@ static void emac_mdio_write(struct net_device *ndev, int id, int reg, int val)
666static void emac_set_multicast_list(struct net_device *ndev) 666static void emac_set_multicast_list(struct net_device *ndev)
667{ 667{
668 struct ocp_enet_private *dev = ndev->priv; 668 struct ocp_enet_private *dev = ndev->priv;
669 struct emac_regs *p = dev->emacp; 669 struct emac_regs __iomem *p = dev->emacp;
670 u32 rmr = emac_iff2rmr(ndev); 670 u32 rmr = emac_iff2rmr(ndev);
671 671
672 DBG("%d: multicast %08x" NL, dev->def->index, rmr); 672 DBG("%d: multicast %08x" NL, dev->def->index, rmr);
@@ -825,7 +825,7 @@ static void emac_clean_rx_ring(struct ocp_enet_private *dev)
825} 825}
826 826
827static inline int emac_alloc_rx_skb(struct ocp_enet_private *dev, int slot, 827static inline int emac_alloc_rx_skb(struct ocp_enet_private *dev, int slot,
828 int flags) 828 gfp_t flags)
829{ 829{
830 struct sk_buff *skb = alloc_skb(dev->rx_skb_size, flags); 830 struct sk_buff *skb = alloc_skb(dev->rx_skb_size, flags);
831 if (unlikely(!skb)) 831 if (unlikely(!skb))
@@ -1047,7 +1047,7 @@ static inline u16 emac_tx_csum(struct ocp_enet_private *dev,
1047 1047
1048static inline int emac_xmit_finish(struct ocp_enet_private *dev, int len) 1048static inline int emac_xmit_finish(struct ocp_enet_private *dev, int len)
1049{ 1049{
1050 struct emac_regs *p = dev->emacp; 1050 struct emac_regs __iomem *p = dev->emacp;
1051 struct net_device *ndev = dev->ndev; 1051 struct net_device *ndev = dev->ndev;
1052 1052
1053 /* Send the packet out */ 1053 /* Send the packet out */
@@ -1519,7 +1519,7 @@ static void emac_rxde(void *param)
1519static irqreturn_t emac_irq(int irq, void *dev_instance, struct pt_regs *regs) 1519static irqreturn_t emac_irq(int irq, void *dev_instance, struct pt_regs *regs)
1520{ 1520{
1521 struct ocp_enet_private *dev = dev_instance; 1521 struct ocp_enet_private *dev = dev_instance;
1522 struct emac_regs *p = dev->emacp; 1522 struct emac_regs __iomem *p = dev->emacp;
1523 struct ibm_emac_error_stats *st = &dev->estats; 1523 struct ibm_emac_error_stats *st = &dev->estats;
1524 1524
1525 u32 isr = in_be32(&p->isr); 1525 u32 isr = in_be32(&p->isr);
@@ -1619,17 +1619,17 @@ static void emac_remove(struct ocp_device *ocpdev)
1619 1619
1620 DBG("%d: remove" NL, dev->def->index); 1620 DBG("%d: remove" NL, dev->def->index);
1621 1621
1622 ocp_set_drvdata(ocpdev, 0); 1622 ocp_set_drvdata(ocpdev, NULL);
1623 unregister_netdev(dev->ndev); 1623 unregister_netdev(dev->ndev);
1624 1624
1625 tah_fini(dev->tah_dev); 1625 tah_fini(dev->tah_dev);
1626 rgmii_fini(dev->rgmii_dev, dev->rgmii_input); 1626 rgmii_fini(dev->rgmii_dev, dev->rgmii_input);
1627 zmii_fini(dev->zmii_dev, dev->zmii_input); 1627 zmii_fini(dev->zmii_dev, dev->zmii_input);
1628 1628
1629 emac_dbg_register(dev->def->index, 0); 1629 emac_dbg_register(dev->def->index, NULL);
1630 1630
1631 mal_unregister_commac(dev->mal, &dev->commac); 1631 mal_unregister_commac(dev->mal, &dev->commac);
1632 iounmap((void *)dev->emacp); 1632 iounmap(dev->emacp);
1633 kfree(dev->ndev); 1633 kfree(dev->ndev);
1634} 1634}
1635 1635
@@ -2048,9 +2048,7 @@ static int __init emac_probe(struct ocp_device *ocpdev)
2048 goto out4; 2048 goto out4;
2049 2049
2050 /* Map EMAC regs */ 2050 /* Map EMAC regs */
2051 dev->emacp = 2051 dev->emacp = ioremap(dev->def->paddr, sizeof(struct emac_regs));
2052 (struct emac_regs *)ioremap(dev->def->paddr,
2053 sizeof(struct emac_regs));
2054 if (!dev->emacp) { 2052 if (!dev->emacp) {
2055 printk(KERN_ERR "emac%d: could not ioremap device registers!\n", 2053 printk(KERN_ERR "emac%d: could not ioremap device registers!\n",
2056 dev->def->index); 2054 dev->def->index);
@@ -2210,7 +2208,7 @@ static int __init emac_probe(struct ocp_device *ocpdev)
2210 2208
2211 return 0; 2209 return 0;
2212 out6: 2210 out6:
2213 iounmap((void *)dev->emacp); 2211 iounmap(dev->emacp);
2214 out5: 2212 out5:
2215 tah_fini(dev->tah_dev); 2213 tah_fini(dev->tah_dev);
2216 out4: 2214 out4:
diff --git a/drivers/net/ibm_emac/ibm_emac_core.h b/drivers/net/ibm_emac/ibm_emac_core.h
index 911abbaf471b..f61273b2e94f 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.h
+++ b/drivers/net/ibm_emac/ibm_emac_core.h
@@ -155,7 +155,7 @@ struct ibm_emac_error_stats {
155 155
156struct ocp_enet_private { 156struct ocp_enet_private {
157 struct net_device *ndev; /* 0 */ 157 struct net_device *ndev; /* 0 */
158 struct emac_regs *emacp; 158 struct emac_regs __iomem *emacp;
159 159
160 struct mal_descriptor *tx_desc; 160 struct mal_descriptor *tx_desc;
161 int tx_cnt; 161 int tx_cnt;
diff --git a/drivers/net/ibm_emac/ibm_emac_debug.c b/drivers/net/ibm_emac/ibm_emac_debug.c
index 75d3b8639041..c7e1ecfa08fe 100644
--- a/drivers/net/ibm_emac/ibm_emac_debug.c
+++ b/drivers/net/ibm_emac/ibm_emac_debug.c
@@ -58,7 +58,7 @@ static void emac_desc_dump(int idx, struct ocp_enet_private *p)
58 58
59static void emac_mac_dump(int idx, struct ocp_enet_private *dev) 59static void emac_mac_dump(int idx, struct ocp_enet_private *dev)
60{ 60{
61 struct emac_regs *p = dev->emacp; 61 struct emac_regs __iomem *p = dev->emacp;
62 62
63 printk("** EMAC%d registers **\n" 63 printk("** EMAC%d registers **\n"
64 "MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n" 64 "MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n"
diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.h b/drivers/net/ibm_emac/ibm_emac_rgmii.h
index a1ffb8a44fff..7f03d536c9a3 100644
--- a/drivers/net/ibm_emac/ibm_emac_rgmii.h
+++ b/drivers/net/ibm_emac/ibm_emac_rgmii.h
@@ -31,7 +31,7 @@ struct rgmii_regs {
31 31
32/* RGMII device */ 32/* RGMII device */
33struct ibm_ocp_rgmii { 33struct ibm_ocp_rgmii {
34 struct rgmii_regs *base; 34 struct rgmii_regs __iomem *base;
35 int users; /* number of EMACs using this RGMII bridge */ 35 int users; /* number of EMACs using this RGMII bridge */
36}; 36};
37 37
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.c b/drivers/net/ibm_emac/ibm_emac_zmii.c
index 35c1185079ed..e129e0aaa045 100644
--- a/drivers/net/ibm_emac/ibm_emac_zmii.c
+++ b/drivers/net/ibm_emac/ibm_emac_zmii.c
@@ -80,7 +80,7 @@ static inline u32 zmii_mode_mask(int mode, int input)
80static int __init zmii_init(struct ocp_device *ocpdev, int input, int *mode) 80static int __init zmii_init(struct ocp_device *ocpdev, int input, int *mode)
81{ 81{
82 struct ibm_ocp_zmii *dev = ocp_get_drvdata(ocpdev); 82 struct ibm_ocp_zmii *dev = ocp_get_drvdata(ocpdev);
83 struct zmii_regs *p; 83 struct zmii_regs __iomem *p;
84 84
85 ZMII_DBG("%d: init(%d, %d)" NL, ocpdev->def->index, input, *mode); 85 ZMII_DBG("%d: init(%d, %d)" NL, ocpdev->def->index, input, *mode);
86 86
@@ -94,8 +94,7 @@ static int __init zmii_init(struct ocp_device *ocpdev, int input, int *mode)
94 } 94 }
95 dev->mode = PHY_MODE_NA; 95 dev->mode = PHY_MODE_NA;
96 96
97 p = (struct zmii_regs *)ioremap(ocpdev->def->paddr, 97 p = ioremap(ocpdev->def->paddr, sizeof(struct zmii_regs));
98 sizeof(struct zmii_regs));
99 if (!p) { 98 if (!p) {
100 printk(KERN_ERR 99 printk(KERN_ERR
101 "zmii%d: could not ioremap device registers!\n", 100 "zmii%d: could not ioremap device registers!\n",
@@ -231,7 +230,7 @@ void __exit __zmii_fini(struct ocp_device *ocpdev, int input)
231 if (!--dev->users) { 230 if (!--dev->users) {
232 /* Free everything if this is the last user */ 231 /* Free everything if this is the last user */
233 ocp_set_drvdata(ocpdev, NULL); 232 ocp_set_drvdata(ocpdev, NULL);
234 iounmap((void *)dev->base); 233 iounmap(dev->base);
235 kfree(dev); 234 kfree(dev);
236 } 235 }
237} 236}
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.h b/drivers/net/ibm_emac/ibm_emac_zmii.h
index 0bb26062c0ad..92c854410753 100644
--- a/drivers/net/ibm_emac/ibm_emac_zmii.h
+++ b/drivers/net/ibm_emac/ibm_emac_zmii.h
@@ -32,7 +32,7 @@ struct zmii_regs {
32 32
33/* ZMII device */ 33/* ZMII device */
34struct ibm_ocp_zmii { 34struct ibm_ocp_zmii {
35 struct zmii_regs *base; 35 struct zmii_regs __iomem *base;
36 int mode; /* subset of PHY_MODE_XXXX */ 36 int mode; /* subset of PHY_MODE_XXXX */
37 int users; /* number of EMACs using this ZMII bridge */ 37 int users; /* number of EMACs using this ZMII bridge */
38 u32 fer_save; /* FER value left by firmware */ 38 u32 fer_save; /* FER value left by firmware */
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index 02d5c6822733..f6f3dafe83ee 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -622,7 +622,7 @@ static int __init mac_sonic_init_module(void)
622 return 0; 622 return 0;
623 623
624out_unregister: 624out_unregister:
625 driver_unregister(&mac_sonic_driver); 625 platform_driver_unregister(&mac_sonic_driver);
626 626
627 return -ENOMEM; 627 return -ENOMEM;
628} 628}
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index 60d1e05ab732..42e9ffb07af4 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -32,6 +32,9 @@
32 32
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <asm/io.h> 34#include <asm/io.h>
35#ifdef CONFIG_NET_POLL_CONTROLLER
36#include <asm/irq.h>
37#endif
35 38
36#ifdef DEBUG 39#ifdef DEBUG
37#define enter(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__) 40#define enter(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__)
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
index 7db1d1d0bb34..cf5c805452a3 100644
--- a/drivers/net/wan/hostess_sv11.c
+++ b/drivers/net/wan/hostess_sv11.c
@@ -29,6 +29,7 @@
29#include <linux/ioport.h> 29#include <linux/ioport.h>
30#include <net/arp.h> 30#include <net/arp.h>
31 31
32#include <asm/irq.h>
32#include <asm/io.h> 33#include <asm/io.h>
33#include <asm/dma.h> 34#include <asm/dma.h>
34#include <asm/byteorder.h> 35#include <asm/byteorder.h>
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c
index 5380ddfcd7d5..050e854e7774 100644
--- a/drivers/net/wan/sealevel.c
+++ b/drivers/net/wan/sealevel.c
@@ -23,6 +23,7 @@
23#include <linux/init.h> 23#include <linux/init.h>
24#include <net/arp.h> 24#include <net/arp.h>
25 25
26#include <asm/irq.h>
26#include <asm/io.h> 27#include <asm/io.h>
27#include <asm/dma.h> 28#include <asm/dma.h>
28#include <asm/byteorder.h> 29#include <asm/byteorder.h>