aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-05-05 13:05:55 -0400
committerMichael Grzeschik <m.grzeschik@pengutronix.de>2015-09-23 02:44:24 -0400
commita34c0932c3b2f28542825ffc5280d562c49ad42d (patch)
tree2fd465fe1c93b7ea866af66847c7167f81bff47a /drivers/net
parent72aeea4841c037b9b3abf65859673cbd7b6664a9 (diff)
arcnet: Convert BUGMSG and BUGMSG2 to arc_prink and arc_cont
These macros don't actually represent BUG uses but are more commonly used as logging macros, so use a more kernel style macro. Convert the BUGMSG from a netdev_ like use to actually use netdev_<level>. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/arcnet/arc-rawmode.c16
-rw-r--r--drivers/net/arcnet/arc-rimi.c24
-rw-r--r--drivers/net/arcnet/arcnet.c212
-rw-r--r--drivers/net/arcnet/capmode.c35
-rw-r--r--drivers/net/arcnet/com20020-isa.c15
-rw-r--r--drivers/net/arcnet/com20020-pci.c2
-rw-r--r--drivers/net/arcnet/com20020.c64
-rw-r--r--drivers/net/arcnet/com90io.c43
-rw-r--r--drivers/net/arcnet/com90xx.c119
-rw-r--r--drivers/net/arcnet/rfc1051.c16
-rw-r--r--drivers/net/arcnet/rfc1201.c104
11 files changed, 338 insertions, 312 deletions
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c
index 998c8356e576..034c8988f987 100644
--- a/drivers/net/arcnet/arc-rawmode.c
+++ b/drivers/net/arcnet/arc-rawmode.c
@@ -89,7 +89,7 @@ static void rx(struct net_device *dev, int bufnum,
89 struct archdr *pkt = pkthdr; 89 struct archdr *pkt = pkthdr;
90 int ofs; 90 int ofs;
91 91
92 BUGMSG(D_DURING, "it's a raw packet (length=%d)\n", length); 92 arc_printk(D_DURING, dev, "it's a raw packet (length=%d)\n", length);
93 93
94 if (length > MTU) 94 if (length > MTU)
95 ofs = 512 - length; 95 ofs = 512 - length;
@@ -98,7 +98,7 @@ static void rx(struct net_device *dev, int bufnum,
98 98
99 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); 99 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
100 if (skb == NULL) { 100 if (skb == NULL) {
101 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); 101 arc_printk(D_NORMAL, dev, "Memory squeeze, dropping packet\n");
102 dev->stats.rx_dropped++; 102 dev->stats.rx_dropped++;
103 return; 103 return;
104 } 104 }
@@ -163,15 +163,15 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
163 struct arc_hardware *hard = &pkt->hard; 163 struct arc_hardware *hard = &pkt->hard;
164 int ofs; 164 int ofs;
165 165
166 BUGMSG(D_DURING, "prepare_tx: txbufs=%d/%d/%d\n", 166 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
167 lp->next_tx, lp->cur_tx, bufnum); 167 lp->next_tx, lp->cur_tx, bufnum);
168 168
169 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */ 169 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */
170 170
171 if (length > XMTU) { 171 if (length > XMTU) {
172 /* should never happen! other people already check for this. */ 172 /* should never happen! other people already check for this. */
173 BUGMSG(D_NORMAL, "Bug! prepare_tx with size %d (> %d)\n", 173 arc_printk(D_NORMAL, dev, "Bug! prepare_tx with size %d (> %d)\n",
174 length, XMTU); 174 length, XMTU);
175 length = XMTU; 175 length = XMTU;
176 } 176 }
177 if (length >= MinTU) { 177 if (length >= MinTU) {
@@ -184,8 +184,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
184 hard->offset[0] = ofs = 256 - length; 184 hard->offset[0] = ofs = 256 - length;
185 } 185 }
186 186
187 BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", 187 arc_printk(D_DURING, dev, "prepare_tx: length=%d ofs=%d\n",
188 length, ofs); 188 length, ofs);
189 189
190 lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); 190 lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE);
191 lp->hw.copy_to_card(dev, bufnum, ofs, &pkt->soft, length); 191 lp->hw.copy_to_card(dev, bufnum, ofs, &pkt->soft, length);
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c
index cd47a1b3008c..25f84b7437f3 100644
--- a/drivers/net/arcnet/arc-rimi.c
+++ b/drivers/net/arcnet/arc-rimi.c
@@ -147,7 +147,7 @@ static int __init arcrimi_found(struct net_device *dev)
147 p = ioremap(dev->mem_start, MIRROR_SIZE); 147 p = ioremap(dev->mem_start, MIRROR_SIZE);
148 if (!p) { 148 if (!p) {
149 release_mem_region(dev->mem_start, MIRROR_SIZE); 149 release_mem_region(dev->mem_start, MIRROR_SIZE);
150 BUGMSG(D_NORMAL, "Can't ioremap\n"); 150 arc_printk(D_NORMAL, dev, "Can't ioremap\n");
151 return -ENODEV; 151 return -ENODEV;
152 } 152 }
153 153
@@ -155,7 +155,7 @@ static int __init arcrimi_found(struct net_device *dev)
155 if (request_irq(dev->irq, arcnet_interrupt, 0, "arcnet (RIM I)", dev)) { 155 if (request_irq(dev->irq, arcnet_interrupt, 0, "arcnet (RIM I)", dev)) {
156 iounmap(p); 156 iounmap(p);
157 release_mem_region(dev->mem_start, MIRROR_SIZE); 157 release_mem_region(dev->mem_start, MIRROR_SIZE);
158 BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq); 158 arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
159 return -ENODEV; 159 return -ENODEV;
160 } 160 }
161 161
@@ -210,23 +210,24 @@ static int __init arcrimi_found(struct net_device *dev)
210 if (!request_mem_region(dev->mem_start, 210 if (!request_mem_region(dev->mem_start,
211 dev->mem_end - dev->mem_start + 1, 211 dev->mem_end - dev->mem_start + 1,
212 "arcnet (90xx)")) { 212 "arcnet (90xx)")) {
213 BUGMSG(D_NORMAL, "Card memory already allocated\n"); 213 arc_printk(D_NORMAL, dev, "Card memory already allocated\n");
214 goto err_free_irq; 214 goto err_free_irq;
215 } 215 }
216 216
217 lp->mem_start = ioremap(dev->mem_start, dev->mem_end - dev->mem_start + 1); 217 lp->mem_start = ioremap(dev->mem_start, dev->mem_end - dev->mem_start + 1);
218 if (!lp->mem_start) { 218 if (!lp->mem_start) {
219 BUGMSG(D_NORMAL, "Can't remap device memory!\n"); 219 arc_printk(D_NORMAL, dev, "Can't remap device memory!\n");
220 goto err_release_mem; 220 goto err_release_mem;
221 } 221 }
222 222
223 /* get and check the station ID from offset 1 in shmem */ 223 /* get and check the station ID from offset 1 in shmem */
224 dev->dev_addr[0] = readb(lp->mem_start + 1); 224 dev->dev_addr[0] = readb(lp->mem_start + 1);
225 225
226 BUGMSG(D_NORMAL, "ARCnet RIM I: station %02Xh found at IRQ %d, ShMem %lXh (%ld*%d bytes)\n", 226 arc_printk(D_NORMAL, dev, "ARCnet RIM I: station %02Xh found at IRQ %d, ShMem %lXh (%ld*%d bytes)\n",
227 dev->dev_addr[0], 227 dev->dev_addr[0],
228 dev->irq, dev->mem_start, 228 dev->irq, dev->mem_start,
229 (dev->mem_end - dev->mem_start + 1) / mirror_size, mirror_size); 229 (dev->mem_end - dev->mem_start + 1) / mirror_size,
230 mirror_size);
230 231
231 err = register_netdev(dev); 232 err = register_netdev(dev);
232 if (err) 233 if (err)
@@ -255,7 +256,8 @@ static int arcrimi_reset(struct net_device *dev, int really_reset)
255 struct arcnet_local *lp = netdev_priv(dev); 256 struct arcnet_local *lp = netdev_priv(dev);
256 void __iomem *ioaddr = lp->mem_start + 0x800; 257 void __iomem *ioaddr = lp->mem_start + 0x800;
257 258
258 BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); 259 arc_printk(D_INIT, dev, "Resetting %s (status=%02Xh)\n",
260 dev->name, ASTATUS());
259 261
260 if (really_reset) { 262 if (really_reset) {
261 writeb(TESTvalue, ioaddr - 0x800); /* fake reset */ 263 writeb(TESTvalue, ioaddr - 0x800); /* fake reset */
@@ -301,7 +303,7 @@ static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset,
301 struct arcnet_local *lp = netdev_priv(dev); 303 struct arcnet_local *lp = netdev_priv(dev);
302 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; 304 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset;
303 305
304 TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); 306 TIME(dev, "memcpy_toio", count, memcpy_toio(memaddr, buf, count));
305} 307}
306 308
307static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset, 309static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset,
@@ -310,7 +312,7 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse
310 struct arcnet_local *lp = netdev_priv(dev); 312 struct arcnet_local *lp = netdev_priv(dev);
311 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; 313 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset;
312 314
313 TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); 315 TIME(dev, "memcpy_fromio", count, memcpy_fromio(buf, memaddr, count));
314} 316}
315 317
316static int node; 318static int node;
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index 7a90b8a45a37..2aab7e2f7e4a 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -236,11 +236,11 @@ static void release_arcbuf(struct net_device *dev, int bufnum)
236 lp->first_free_buf %= 5; 236 lp->first_free_buf %= 5;
237 237
238 if (BUGLVL(D_DURING)) { 238 if (BUGLVL(D_DURING)) {
239 BUGMSG(D_DURING, "release_arcbuf: freed #%d; buffer queue is now: ", 239 arc_printk(D_DURING, dev, "release_arcbuf: freed #%d; buffer queue is now: ",
240 bufnum); 240 bufnum);
241 for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5) 241 for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5)
242 BUGMSG2(D_DURING, "#%d ", lp->buf_queue[i]); 242 arc_cont(D_DURING, "#%d ", lp->buf_queue[i]);
243 BUGMSG2(D_DURING, "\n"); 243 arc_cont(D_DURING, "\n");
244 } 244 }
245} 245}
246 246
@@ -254,14 +254,14 @@ static int get_arcbuf(struct net_device *dev)
254 254
255 if (!atomic_dec_and_test(&lp->buf_lock)) { 255 if (!atomic_dec_and_test(&lp->buf_lock)) {
256 /* already in this function */ 256 /* already in this function */
257 BUGMSG(D_NORMAL, "get_arcbuf: overlap (%d)!\n", 257 arc_printk(D_NORMAL, dev, "get_arcbuf: overlap (%d)!\n",
258 lp->buf_lock.counter); 258 lp->buf_lock.counter);
259 } else { /* we can continue */ 259 } else { /* we can continue */
260 if (lp->next_buf >= 5) 260 if (lp->next_buf >= 5)
261 lp->next_buf -= 5; 261 lp->next_buf -= 5;
262 262
263 if (lp->next_buf == lp->first_free_buf) { 263 if (lp->next_buf == lp->first_free_buf) {
264 BUGMSG(D_NORMAL, "get_arcbuf: BUG: no buffers are available??\n"); 264 arc_printk(D_NORMAL, dev, "get_arcbuf: BUG: no buffers are available??\n");
265 } else { 265 } else {
266 buf = lp->buf_queue[lp->next_buf++]; 266 buf = lp->buf_queue[lp->next_buf++];
267 lp->next_buf %= 5; 267 lp->next_buf %= 5;
@@ -269,10 +269,11 @@ static int get_arcbuf(struct net_device *dev)
269 } 269 }
270 270
271 if (BUGLVL(D_DURING)) { 271 if (BUGLVL(D_DURING)) {
272 BUGMSG(D_DURING, "get_arcbuf: got #%d; buffer queue is now: ", buf); 272 arc_printk(D_DURING, dev, "get_arcbuf: got #%d; buffer queue is now: ",
273 buf);
273 for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5) 274 for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5)
274 BUGMSG2(D_DURING, "#%d ", lp->buf_queue[i]); 275 arc_cont(D_DURING, "#%d ", lp->buf_queue[i]);
275 BUGMSG2(D_DURING, "\n"); 276 arc_cont(D_DURING, "\n");
276 } 277 }
277 278
278 atomic_inc(&lp->buf_lock); 279 atomic_inc(&lp->buf_lock);
@@ -351,20 +352,20 @@ int arcnet_open(struct net_device *dev)
351 struct arcnet_local *lp = netdev_priv(dev); 352 struct arcnet_local *lp = netdev_priv(dev);
352 int count, newmtu, error; 353 int count, newmtu, error;
353 354
354 BUGMSG(D_INIT, "opened."); 355 arc_printk(D_INIT, dev, "opened.");
355 356
356 if (!try_module_get(lp->hw.owner)) 357 if (!try_module_get(lp->hw.owner))
357 return -ENODEV; 358 return -ENODEV;
358 359
359 if (BUGLVL(D_PROTO)) { 360 if (BUGLVL(D_PROTO)) {
360 BUGMSG(D_PROTO, "protocol map (default is '%c'): ", 361 arc_printk(D_PROTO, dev, "protocol map (default is '%c'): ",
361 arc_proto_default->suffix); 362 arc_proto_default->suffix);
362 for (count = 0; count < 256; count++) 363 for (count = 0; count < 256; count++)
363 BUGMSG2(D_PROTO, "%c", arc_proto_map[count]->suffix); 364 arc_cont(D_PROTO, "%c", arc_proto_map[count]->suffix);
364 BUGMSG2(D_PROTO, "\n"); 365 arc_cont(D_PROTO, "\n");
365 } 366 }
366 367
367 BUGMSG(D_INIT, "arcnet_open: resetting card.\n"); 368 arc_printk(D_INIT, dev, "arcnet_open: resetting card.\n");
368 369
369 /* try to put the card in a defined state - if it fails the first 370 /* try to put the card in a defined state - if it fails the first
370 * time, actually reset it. 371 * time, actually reset it.
@@ -377,7 +378,7 @@ int arcnet_open(struct net_device *dev)
377 if (newmtu < dev->mtu) 378 if (newmtu < dev->mtu)
378 dev->mtu = newmtu; 379 dev->mtu = newmtu;
379 380
380 BUGMSG(D_INIT, "arcnet_open: mtu: %d.\n", dev->mtu); 381 arc_printk(D_INIT, dev, "arcnet_open: mtu: %d.\n", dev->mtu);
381 382
382 /* autodetect the encapsulation for each host. */ 383 /* autodetect the encapsulation for each host. */
383 memset(lp->default_proto, 0, sizeof(lp->default_proto)); 384 memset(lp->default_proto, 0, sizeof(lp->default_proto));
@@ -408,27 +409,28 @@ int arcnet_open(struct net_device *dev)
408 lp->hw.open(dev); 409 lp->hw.open(dev);
409 410
410 if (dev->dev_addr[0] == 0) 411 if (dev->dev_addr[0] == 0)
411 BUGMSG(D_NORMAL, "WARNING! Station address 00 is reserved for broadcasts!\n"); 412 arc_printk(D_NORMAL, dev, "WARNING! Station address 00 is reserved for broadcasts!\n");
412 else if (dev->dev_addr[0] == 255) 413 else if (dev->dev_addr[0] == 255)
413 BUGMSG(D_NORMAL, "WARNING! Station address FF may confuse DOS networking programs!\n"); 414 arc_printk(D_NORMAL, dev, "WARNING! Station address FF may confuse DOS networking programs!\n");
414 415
415 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 416 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
416 if (ASTATUS() & RESETflag) { 417 if (ASTATUS() & RESETflag) {
417 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 418 arc_printk(D_DEBUG, dev, "%s: %d: %s\n",
419 __FILE__, __LINE__, __func__);
418 ACOMMAND(CFLAGScmd | RESETclear); 420 ACOMMAND(CFLAGScmd | RESETclear);
419 } 421 }
420 422
421 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 423 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
422 /* make sure we're ready to receive IRQ's. */ 424 /* make sure we're ready to receive IRQ's. */
423 AINTMASK(0); 425 AINTMASK(0);
424 udelay(1); /* give it time to set the mask before 426 udelay(1); /* give it time to set the mask before
425 * we reset it again. (may not even be 427 * we reset it again. (may not even be
426 * necessary) 428 * necessary)
427 */ 429 */
428 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 430 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
429 lp->intmask = NORXflag | RECONflag; 431 lp->intmask = NORXflag | RECONflag;
430 AINTMASK(lp->intmask); 432 AINTMASK(lp->intmask);
431 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 433 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
432 434
433 netif_start_queue(dev); 435 netif_start_queue(dev);
434 436
@@ -466,20 +468,21 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
466 uint8_t _daddr, proto_num; 468 uint8_t _daddr, proto_num;
467 struct ArcProto *proto; 469 struct ArcProto *proto;
468 470
469 BUGMSG(D_DURING, 471 arc_printk(D_DURING, dev,
470 "create header from %d to %d; protocol %d (%Xh); size %u.\n", 472 "create header from %d to %d; protocol %d (%Xh); size %u.\n",
471 saddr ? *(uint8_t *)saddr : -1, 473 saddr ? *(uint8_t *)saddr : -1,
472 daddr ? *(uint8_t *)daddr : -1, 474 daddr ? *(uint8_t *)daddr : -1,
473 type, type, len); 475 type, type, len);
474 476
475 if (skb->len != 0 && len != skb->len) 477 if (skb->len != 0 && len != skb->len)
476 BUGMSG(D_NORMAL, "arcnet_header: Yikes! skb->len(%d) != len(%d)!\n", 478 arc_printk(D_NORMAL, dev, "arcnet_header: Yikes! skb->len(%d) != len(%d)!\n",
477 skb->len, len); 479 skb->len, len);
478 480
479 /* Type is host order - ? */ 481 /* Type is host order - ? */
480 if (type == ETH_P_ARCNET) { 482 if (type == ETH_P_ARCNET) {
481 proto = arc_raw_proto; 483 proto = arc_raw_proto;
482 BUGMSG(D_DEBUG, "arc_raw_proto used. proto='%c'\n", proto->suffix); 484 arc_printk(D_DEBUG, dev, "arc_raw_proto used. proto='%c'\n",
485 proto->suffix);
483 _daddr = daddr ? *(uint8_t *)daddr : 0; 486 _daddr = daddr ? *(uint8_t *)daddr : 0;
484 } else if (!daddr) { 487 } else if (!daddr) {
485 /* if the dest addr isn't provided, we can't choose an 488 /* if the dest addr isn't provided, we can't choose an
@@ -490,19 +493,19 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
490 *(uint16_t *)skb_push(skb, 2) = type; 493 *(uint16_t *)skb_push(skb, 2) = type;
491 /* XXX: Why not use skb->mac_len? */ 494 /* XXX: Why not use skb->mac_len? */
492 if (skb->network_header - skb->mac_header != 2) 495 if (skb->network_header - skb->mac_header != 2)
493 BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n", 496 arc_printk(D_NORMAL, dev, "arcnet_header: Yikes! diff (%u) is not 2!\n",
494 (int)(skb->network_header - skb->mac_header)); 497 skb->network_header - skb->mac_header);
495 return -2; /* return error -- can't transmit yet! */ 498 return -2; /* return error -- can't transmit yet! */
496 } else { 499 } else {
497 /* otherwise, we can just add the header as usual. */ 500 /* otherwise, we can just add the header as usual. */
498 _daddr = *(uint8_t *)daddr; 501 _daddr = *(uint8_t *)daddr;
499 proto_num = lp->default_proto[_daddr]; 502 proto_num = lp->default_proto[_daddr];
500 proto = arc_proto_map[proto_num]; 503 proto = arc_proto_map[proto_num];
501 BUGMSG(D_DURING, "building header for %02Xh using protocol '%c'\n", 504 arc_printk(D_DURING, dev, "building header for %02Xh using protocol '%c'\n",
502 proto_num, proto->suffix); 505 proto_num, proto->suffix);
503 if (proto == &arc_proto_null && arc_bcast_proto != proto) { 506 if (proto == &arc_proto_null && arc_bcast_proto != proto) {
504 BUGMSG(D_DURING, "actually, let's use '%c' instead.\n", 507 arc_printk(D_DURING, dev, "actually, let's use '%c' instead.\n",
505 arc_bcast_proto->suffix); 508 arc_bcast_proto->suffix);
506 proto = arc_bcast_proto; 509 proto = arc_bcast_proto;
507 } 510 }
508 } 511 }
@@ -521,22 +524,22 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb,
521 unsigned long flags; 524 unsigned long flags;
522 int freeskb, retval; 525 int freeskb, retval;
523 526
524 BUGMSG(D_DURING, 527 arc_printk(D_DURING, dev,
525 "transmit requested (status=%Xh, txbufs=%d/%d, len=%d, protocol %x)\n", 528 "transmit requested (status=%Xh, txbufs=%d/%d, len=%d, protocol %x)\n",
526 ASTATUS(), lp->cur_tx, lp->next_tx, skb->len, skb->protocol); 529 ASTATUS(), lp->cur_tx, lp->next_tx, skb->len, skb->protocol);
527 530
528 pkt = (struct archdr *)skb->data; 531 pkt = (struct archdr *)skb->data;
529 soft = &pkt->soft.rfc1201; 532 soft = &pkt->soft.rfc1201;
530 proto = arc_proto_map[soft->proto]; 533 proto = arc_proto_map[soft->proto];
531 534
532 BUGMSG(D_SKB_SIZE, "skb: transmitting %d bytes to %02X\n", 535 arc_printk(D_SKB_SIZE, dev, "skb: transmitting %d bytes to %02X\n",
533 skb->len, pkt->hard.dest); 536 skb->len, pkt->hard.dest);
534 if (BUGLVL(D_SKB)) 537 if (BUGLVL(D_SKB))
535 arcnet_dump_skb(dev, skb, "tx"); 538 arcnet_dump_skb(dev, skb, "tx");
536 539
537 /* fits in one packet? */ 540 /* fits in one packet? */
538 if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) { 541 if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) {
539 BUGMSG(D_NORMAL, "fixme: packet too large: compensating badly!\n"); 542 arc_printk(D_NORMAL, dev, "fixme: packet too large: compensating badly!\n");
540 dev_kfree_skb(skb); 543 dev_kfree_skb(skb);
541 return NETDEV_TX_OK; /* don't try again */ 544 return NETDEV_TX_OK; /* don't try again */
542 } 545 }
@@ -569,9 +572,9 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb,
569 572
570 if (proto->continue_tx && 573 if (proto->continue_tx &&
571 proto->continue_tx(dev, txbuf)) { 574 proto->continue_tx(dev, txbuf)) {
572 BUGMSG(D_NORMAL, 575 arc_printk(D_NORMAL, dev,
573 "bug! continue_tx finished the first time! (proto='%c')\n", 576 "bug! continue_tx finished the first time! (proto='%c')\n",
574 proto->suffix); 577 proto->suffix);
575 } 578 }
576 } 579 }
577 retval = NETDEV_TX_OK; 580 retval = NETDEV_TX_OK;
@@ -581,14 +584,16 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb,
581 freeskb = 0; 584 freeskb = 0;
582 } 585 }
583 586
584 BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n", __FILE__, __LINE__, __func__, ASTATUS()); 587 arc_printk(D_DEBUG, dev, "%s: %d: %s, status: %x\n",
588 __FILE__, __LINE__, __func__, ASTATUS());
585 /* make sure we didn't ignore a TX IRQ while we were in here */ 589 /* make sure we didn't ignore a TX IRQ while we were in here */
586 AINTMASK(0); 590 AINTMASK(0);
587 591
588 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 592 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
589 lp->intmask |= TXFREEflag | EXCNAKflag; 593 lp->intmask |= TXFREEflag | EXCNAKflag;
590 AINTMASK(lp->intmask); 594 AINTMASK(lp->intmask);
591 BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n", __FILE__, __LINE__, __func__, ASTATUS()); 595 arc_printk(D_DEBUG, dev, "%s: %d: %s, status: %x\n",
596 __FILE__, __LINE__, __func__, ASTATUS());
592 597
593 spin_unlock_irqrestore(&lp->lock, flags); 598 spin_unlock_irqrestore(&lp->lock, flags);
594 if (freeskb) 599 if (freeskb)
@@ -604,8 +609,8 @@ static int go_tx(struct net_device *dev)
604{ 609{
605 struct arcnet_local *lp = netdev_priv(dev); 610 struct arcnet_local *lp = netdev_priv(dev);
606 611
607 BUGMSG(D_DURING, "go_tx: status=%Xh, intmask=%Xh, next_tx=%d, cur_tx=%d\n", 612 arc_printk(D_DURING, dev, "go_tx: status=%Xh, intmask=%Xh, next_tx=%d, cur_tx=%d\n",
608 ASTATUS(), lp->intmask, lp->next_tx, lp->cur_tx); 613 ASTATUS(), lp->intmask, lp->next_tx, lp->cur_tx);
609 614
610 if (lp->cur_tx != -1 || lp->next_tx == -1) 615 if (lp->cur_tx != -1 || lp->next_tx == -1)
611 return 0; 616 return 0;
@@ -655,8 +660,8 @@ void arcnet_timeout(struct net_device *dev)
655 spin_unlock_irqrestore(&lp->lock, flags); 660 spin_unlock_irqrestore(&lp->lock, flags);
656 661
657 if (time_after(jiffies, lp->last_timeout + 10 * HZ)) { 662 if (time_after(jiffies, lp->last_timeout + 10 * HZ)) {
658 BUGMSG(D_EXTRA, "tx timed out%s (status=%Xh, intmask=%Xh, dest=%02Xh)\n", 663 arc_printk(D_EXTRA, dev, "tx timed out%s (status=%Xh, intmask=%Xh, dest=%02Xh)\n",
659 msg, status, lp->intmask, lp->lasttrans_dest); 664 msg, status, lp->intmask, lp->lasttrans_dest);
660 lp->last_timeout = jiffies; 665 lp->last_timeout = jiffies;
661 } 666 }
662 667
@@ -675,9 +680,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
675 int recbuf, status, diagstatus, didsomething, boguscount; 680 int recbuf, status, diagstatus, didsomething, boguscount;
676 int retval = IRQ_NONE; 681 int retval = IRQ_NONE;
677 682
678 BUGMSG(D_DURING, "\n"); 683 arc_printk(D_DURING, dev, "\n");
679 684
680 BUGMSG(D_DURING, "in arcnet_interrupt\n"); 685 arc_printk(D_DURING, dev, "in arcnet_interrupt\n");
681 686
682 lp = netdev_priv(dev); 687 lp = netdev_priv(dev);
683 BUG_ON(!lp); 688 BUG_ON(!lp);
@@ -695,16 +700,16 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
695 return retval; 700 return retval;
696 } 701 }
697 702
698 BUGMSG(D_DURING, "in arcnet_inthandler (status=%Xh, intmask=%Xh)\n", 703 arc_printk(D_DURING, dev, "in arcnet_inthandler (status=%Xh, intmask=%Xh)\n",
699 ASTATUS(), lp->intmask); 704 ASTATUS(), lp->intmask);
700 705
701 boguscount = 5; 706 boguscount = 5;
702 do { 707 do {
703 status = ASTATUS(); 708 status = ASTATUS();
704 diagstatus = (status >> 8) & 0xFF; 709 diagstatus = (status >> 8) & 0xFF;
705 710
706 BUGMSG(D_DEBUG, "%s: %d: %s: status=%x\n", 711 arc_printk(D_DEBUG, dev, "%s: %d: %s: status=%x\n",
707 __FILE__, __LINE__, __func__, status); 712 __FILE__, __LINE__, __func__, status);
708 didsomething = 0; 713 didsomething = 0;
709 714
710 /* RESET flag was enabled - card is resetting and if RX is 715 /* RESET flag was enabled - card is resetting and if RX is
@@ -714,7 +719,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
714 * Clear it out and start over. 719 * Clear it out and start over.
715 */ 720 */
716 if (status & RESETflag) { 721 if (status & RESETflag) {
717 BUGMSG(D_NORMAL, "spurious reset (status=%Xh)\n", status); 722 arc_printk(D_NORMAL, dev, "spurious reset (status=%Xh)\n",
723 status);
718 arcnet_close(dev); 724 arcnet_close(dev);
719 arcnet_open(dev); 725 arcnet_open(dev);
720 726
@@ -732,21 +738,21 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
732 recbuf = -1; 738 recbuf = -1;
733 if (status & lp->intmask & NORXflag) { 739 if (status & lp->intmask & NORXflag) {
734 recbuf = lp->cur_rx; 740 recbuf = lp->cur_rx;
735 BUGMSG(D_DURING, "Buffer #%d: receive irq (status=%Xh)\n", 741 arc_printk(D_DURING, dev, "Buffer #%d: receive irq (status=%Xh)\n",
736 recbuf, status); 742 recbuf, status);
737 743
738 lp->cur_rx = get_arcbuf(dev); 744 lp->cur_rx = get_arcbuf(dev);
739 if (lp->cur_rx != -1) { 745 if (lp->cur_rx != -1) {
740 BUGMSG(D_DURING, "enabling receive to buffer #%d\n", 746 arc_printk(D_DURING, dev, "enabling receive to buffer #%d\n",
741 lp->cur_rx); 747 lp->cur_rx);
742 ACOMMAND(RXcmd | (lp->cur_rx << 3) | RXbcasts); 748 ACOMMAND(RXcmd | (lp->cur_rx << 3) | RXbcasts);
743 } 749 }
744 didsomething++; 750 didsomething++;
745 } 751 }
746 752
747 if ((diagstatus & EXCNAKflag)) { 753 if ((diagstatus & EXCNAKflag)) {
748 BUGMSG(D_DURING, "EXCNAK IRQ (diagstat=%Xh)\n", 754 arc_printk(D_DURING, dev, "EXCNAK IRQ (diagstat=%Xh)\n",
749 diagstatus); 755 diagstatus);
750 756
751 ACOMMAND(NOTXcmd); /* disable transmit */ 757 ACOMMAND(NOTXcmd); /* disable transmit */
752 lp->excnak_pending = 1; 758 lp->excnak_pending = 1;
@@ -760,20 +766,22 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
760 if ((status & lp->intmask & TXFREEflag) || lp->timed_out) { 766 if ((status & lp->intmask & TXFREEflag) || lp->timed_out) {
761 lp->intmask &= ~(TXFREEflag | EXCNAKflag); 767 lp->intmask &= ~(TXFREEflag | EXCNAKflag);
762 768
763 BUGMSG(D_DURING, "TX IRQ (stat=%Xh)\n", status); 769 arc_printk(D_DURING, dev, "TX IRQ (stat=%Xh)\n", status);
764 770
765 if (lp->cur_tx != -1 && !lp->timed_out) { 771 if (lp->cur_tx != -1 && !lp->timed_out) {
766 if (!(status & TXACKflag)) { 772 if (!(status & TXACKflag)) {
767 if (lp->lasttrans_dest != 0) { 773 if (lp->lasttrans_dest != 0) {
768 BUGMSG(D_EXTRA, 774 arc_printk(D_EXTRA, dev,
769 "transmit was not acknowledged! (status=%Xh, dest=%02Xh)\n", 775 "transmit was not acknowledged! (status=%Xh, dest=%02Xh)\n",
770 status, lp->lasttrans_dest); 776 status,
777 lp->lasttrans_dest);
771 dev->stats.tx_errors++; 778 dev->stats.tx_errors++;
772 dev->stats.tx_carrier_errors++; 779 dev->stats.tx_carrier_errors++;
773 } else { 780 } else {
774 BUGMSG(D_DURING, 781 arc_printk(D_DURING, dev,
775 "broadcast was not acknowledged; that's normal (status=%Xh, dest=%02Xh)\n", 782 "broadcast was not acknowledged; that's normal (status=%Xh, dest=%02Xh)\n",
776 status, lp->lasttrans_dest); 783 status,
784 lp->lasttrans_dest);
777 } 785 }
778 } 786 }
779 787
@@ -836,29 +844,29 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
836 ACOMMAND(CFLAGScmd | CONFIGclear); 844 ACOMMAND(CFLAGScmd | CONFIGclear);
837 dev->stats.tx_carrier_errors++; 845 dev->stats.tx_carrier_errors++;
838 846
839 BUGMSG(D_RECON, "Network reconfiguration detected (status=%Xh)\n", 847 arc_printk(D_RECON, dev, "Network reconfiguration detected (status=%Xh)\n",
840 status); 848 status);
841 /* MYRECON bit is at bit 7 of diagstatus */ 849 /* MYRECON bit is at bit 7 of diagstatus */
842 if (diagstatus & 0x80) 850 if (diagstatus & 0x80)
843 BUGMSG(D_RECON, "Put out that recon myself\n"); 851 arc_printk(D_RECON, dev, "Put out that recon myself\n");
844 852
845 /* is the RECON info empty or old? */ 853 /* is the RECON info empty or old? */
846 if (!lp->first_recon || !lp->last_recon || 854 if (!lp->first_recon || !lp->last_recon ||
847 time_after(jiffies, lp->last_recon + HZ * 10)) { 855 time_after(jiffies, lp->last_recon + HZ * 10)) {
848 if (lp->network_down) 856 if (lp->network_down)
849 BUGMSG(D_NORMAL, "reconfiguration detected: cabling restored?\n"); 857 arc_printk(D_NORMAL, dev, "reconfiguration detected: cabling restored?\n");
850 lp->first_recon = lp->last_recon = jiffies; 858 lp->first_recon = lp->last_recon = jiffies;
851 lp->num_recons = lp->network_down = 0; 859 lp->num_recons = lp->network_down = 0;
852 860
853 BUGMSG(D_DURING, "recon: clearing counters.\n"); 861 arc_printk(D_DURING, dev, "recon: clearing counters.\n");
854 } else { /* add to current RECON counter */ 862 } else { /* add to current RECON counter */
855 lp->last_recon = jiffies; 863 lp->last_recon = jiffies;
856 lp->num_recons++; 864 lp->num_recons++;
857 865
858 BUGMSG(D_DURING, "recon: counter=%d, time=%lds, net=%d\n", 866 arc_printk(D_DURING, dev, "recon: counter=%d, time=%lds, net=%d\n",
859 lp->num_recons, 867 lp->num_recons,
860 (lp->last_recon - lp->first_recon) / HZ, 868 (lp->last_recon - lp->first_recon) / HZ,
861 lp->network_down); 869 lp->network_down);
862 870
863 /* if network is marked up; 871 /* if network is marked up;
864 * and first_recon and last_recon are 60+ apart; 872 * and first_recon and last_recon are 60+ apart;
@@ -870,7 +878,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
870 (lp->last_recon - lp->first_recon) <= HZ * 60 && 878 (lp->last_recon - lp->first_recon) <= HZ * 60 &&
871 lp->num_recons >= RECON_THRESHOLD) { 879 lp->num_recons >= RECON_THRESHOLD) {
872 lp->network_down = 1; 880 lp->network_down = 1;
873 BUGMSG(D_NORMAL, "many reconfigurations detected: cabling problem?\n"); 881 arc_printk(D_NORMAL, dev, "many reconfigurations detected: cabling problem?\n");
874 } else if (!lp->network_down && 882 } else if (!lp->network_down &&
875 lp->last_recon - lp->first_recon > HZ * 60) { 883 lp->last_recon - lp->first_recon > HZ * 60) {
876 /* reset counters if we've gone for over a minute. */ 884 /* reset counters if we've gone for over a minute. */
@@ -881,20 +889,20 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
881 } else if (lp->network_down && 889 } else if (lp->network_down &&
882 time_after(jiffies, lp->last_recon + HZ * 10)) { 890 time_after(jiffies, lp->last_recon + HZ * 10)) {
883 if (lp->network_down) 891 if (lp->network_down)
884 BUGMSG(D_NORMAL, "cabling restored?\n"); 892 arc_printk(D_NORMAL, dev, "cabling restored?\n");
885 lp->first_recon = lp->last_recon = 0; 893 lp->first_recon = lp->last_recon = 0;
886 lp->num_recons = lp->network_down = 0; 894 lp->num_recons = lp->network_down = 0;
887 895
888 BUGMSG(D_DURING, "not recon: clearing counters anyway.\n"); 896 arc_printk(D_DURING, dev, "not recon: clearing counters anyway.\n");
889 } 897 }
890 898
891 if (didsomething) 899 if (didsomething)
892 retval |= IRQ_HANDLED; 900 retval |= IRQ_HANDLED;
893 } while (--boguscount && didsomething); 901 } while (--boguscount && didsomething);
894 902
895 BUGMSG(D_DURING, "arcnet_interrupt complete (status=%Xh, count=%d)\n", 903 arc_printk(D_DURING, dev, "arcnet_interrupt complete (status=%Xh, count=%d)\n",
896 ASTATUS(), boguscount); 904 ASTATUS(), boguscount);
897 BUGMSG(D_DURING, "\n"); 905 arc_printk(D_DURING, dev, "\n");
898 906
899 AINTMASK(0); 907 AINTMASK(0);
900 udelay(1); 908 udelay(1);
@@ -933,8 +941,8 @@ static void arcnet_rx(struct net_device *dev, int bufnum)
933 lp->hw.copy_from_card(dev, bufnum, ofs, soft, length); 941 lp->hw.copy_from_card(dev, bufnum, ofs, soft, length);
934 } 942 }
935 943
936 BUGMSG(D_DURING, "Buffer #%d: received packet from %02Xh to %02Xh (%d+4 bytes)\n", 944 arc_printk(D_DURING, dev, "Buffer #%d: received packet from %02Xh to %02Xh (%d+4 bytes)\n",
937 bufnum, pkt.hard.source, pkt.hard.dest, length); 945 bufnum, pkt.hard.source, pkt.hard.dest, length);
938 946
939 dev->stats.rx_packets++; 947 dev->stats.rx_packets++;
940 dev->stats.rx_bytes += length + ARC_HDR_SIZE; 948 dev->stats.rx_bytes += length + ARC_HDR_SIZE;
@@ -947,10 +955,10 @@ static void arcnet_rx(struct net_device *dev, int bufnum)
947 *newp = arc_proto_map[soft->proto]; 955 *newp = arc_proto_map[soft->proto];
948 956
949 if (oldp != newp) { 957 if (oldp != newp) {
950 BUGMSG(D_PROTO, 958 arc_printk(D_PROTO, dev,
951 "got protocol %02Xh; encap for host %02Xh is now '%c' (was '%c')\n", 959 "got protocol %02Xh; encap for host %02Xh is now '%c' (was '%c')\n",
952 soft->proto, pkt.hard.source, 960 soft->proto, pkt.hard.source,
953 newp->suffix, oldp->suffix); 961 newp->suffix, oldp->suffix);
954 } 962 }
955 } 963 }
956 964
@@ -967,9 +975,9 @@ static void arcnet_rx(struct net_device *dev, int bufnum)
967static void null_rx(struct net_device *dev, int bufnum, 975static void null_rx(struct net_device *dev, int bufnum,
968 struct archdr *pkthdr, int length) 976 struct archdr *pkthdr, int length)
969{ 977{
970 BUGMSG(D_PROTO, 978 arc_printk(D_PROTO, dev,
971 "rx: don't know how to deal with proto %02Xh from host %02Xh.\n", 979 "rx: don't know how to deal with proto %02Xh from host %02Xh.\n",
972 pkthdr->soft.rfc1201.proto, pkthdr->hard.source); 980 pkthdr->soft.rfc1201.proto, pkthdr->hard.source);
973} 981}
974 982
975static int null_build_header(struct sk_buff *skb, struct net_device *dev, 983static int null_build_header(struct sk_buff *skb, struct net_device *dev,
@@ -977,9 +985,9 @@ static int null_build_header(struct sk_buff *skb, struct net_device *dev,
977{ 985{
978 struct arcnet_local *lp = netdev_priv(dev); 986 struct arcnet_local *lp = netdev_priv(dev);
979 987
980 BUGMSG(D_PROTO, 988 arc_printk(D_PROTO, dev,
981 "tx: can't build header for encap %02Xh; load a protocol driver.\n", 989 "tx: can't build header for encap %02Xh; load a protocol driver.\n",
982 lp->default_proto[daddr]); 990 lp->default_proto[daddr]);
983 991
984 /* always fails */ 992 /* always fails */
985 return 0; 993 return 0;
@@ -992,7 +1000,7 @@ static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
992 struct arcnet_local *lp = netdev_priv(dev); 1000 struct arcnet_local *lp = netdev_priv(dev);
993 struct arc_hardware newpkt; 1001 struct arc_hardware newpkt;
994 1002
995 BUGMSG(D_PROTO, "tx: no encap for this host; load a protocol driver.\n"); 1003 arc_printk(D_PROTO, dev, "tx: no encap for this host; load a protocol driver.\n");
996 1004
997 /* send a packet to myself -- will never get received, of course */ 1005 /* send a packet to myself -- will never get received, of course */
998 newpkt.source = newpkt.dest = dev->dev_addr[0]; 1006 newpkt.source = newpkt.dest = dev->dev_addr[0];
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index e7ec907f4680..d62d1accf4b6 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -47,7 +47,8 @@ static void rx(struct net_device *dev, int bufnum,
47 char *pktbuf, *pkthdrbuf; 47 char *pktbuf, *pkthdrbuf;
48 int ofs; 48 int ofs;
49 49
50 BUGMSG(D_DURING, "it's a raw(cap) packet (length=%d)\n", length); 50 arc_printk(D_DURING, dev, "it's a raw(cap) packet (length=%d)\n",
51 length);
51 52
52 if (length >= MinTU) 53 if (length >= MinTU)
53 ofs = 512 - length; 54 ofs = 512 - length;
@@ -56,7 +57,7 @@ static void rx(struct net_device *dev, int bufnum,
56 57
57 skb = alloc_skb(length + ARC_HDR_SIZE + sizeof(int), GFP_ATOMIC); 58 skb = alloc_skb(length + ARC_HDR_SIZE + sizeof(int), GFP_ATOMIC);
58 if (skb == NULL) { 59 if (skb == NULL) {
59 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); 60 arc_printk(D_NORMAL, dev, "Memory squeeze, dropping packet\n");
60 dev->stats.rx_dropped++; 61 dev->stats.rx_dropped++;
61 return; 62 return;
62 } 63 }
@@ -102,8 +103,8 @@ static int build_header(struct sk_buff *skb,
102 int hdr_size = ARC_HDR_SIZE; 103 int hdr_size = ARC_HDR_SIZE;
103 struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size); 104 struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size);
104 105
105 BUGMSG(D_PROTO, "Preparing header for cap packet %x.\n", 106 arc_printk(D_PROTO, dev, "Preparing header for cap packet %x.\n",
106 *((int *)&pkt->soft.cap.cookie[0])); 107 *((int *)&pkt->soft.cap.cookie[0]));
107 108
108 /* Set the source hardware address. 109 /* Set the source hardware address.
109 * 110 *
@@ -140,16 +141,16 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
140 /* And neither is the cookie field */ 141 /* And neither is the cookie field */
141 length -= sizeof(int); 142 length -= sizeof(int);
142 143
143 BUGMSG(D_DURING, "prepare_tx: txbufs=%d/%d/%d\n", 144 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
144 lp->next_tx, lp->cur_tx, bufnum); 145 lp->next_tx, lp->cur_tx, bufnum);
145 146
146 BUGMSG(D_PROTO, "Sending for cap packet %x.\n", 147 arc_printk(D_PROTO, dev, "Sending for cap packet %x.\n",
147 *((int *)&pkt->soft.cap.cookie[0])); 148 *((int *)&pkt->soft.cap.cookie[0]));
148 149
149 if (length > XMTU) { 150 if (length > XMTU) {
150 /* should never happen! other people already check for this. */ 151 /* should never happen! other people already check for this. */
151 BUGMSG(D_NORMAL, "Bug! prepare_tx with size %d (> %d)\n", 152 arc_printk(D_NORMAL, dev, "Bug! prepare_tx with size %d (> %d)\n",
152 length, XMTU); 153 length, XMTU);
153 length = XMTU; 154 length = XMTU;
154 } 155 }
155 if (length > MinTU) { 156 if (length > MinTU) {
@@ -162,8 +163,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
162 hard->offset[0] = ofs = 256 - length; 163 hard->offset[0] = ofs = 256 - length;
163 } 164 }
164 165
165 BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", 166 arc_printk(D_DURING, dev, "prepare_tx: length=%d ofs=%d\n",
166 length, ofs); 167 length, ofs);
167 168
168 /* Copy the arcnet-header + the protocol byte down: */ 169 /* Copy the arcnet-header + the protocol byte down: */
169 lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); 170 lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE);
@@ -188,8 +189,8 @@ static int ack_tx(struct net_device *dev, int acked)
188 struct archdr *ackpkt; 189 struct archdr *ackpkt;
189 int length = sizeof(struct arc_cap); 190 int length = sizeof(struct arc_cap);
190 191
191 BUGMSG(D_DURING, "capmode: ack_tx: protocol: %x: result: %d\n", 192 arc_printk(D_DURING, dev, "capmode: ack_tx: protocol: %x: result: %d\n",
192 lp->outgoing.skb->protocol, acked); 193 lp->outgoing.skb->protocol, acked);
193 194
194 if (BUGLVL(D_SKB)) 195 if (BUGLVL(D_SKB))
195 arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx"); 196 arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx");
@@ -197,7 +198,7 @@ static int ack_tx(struct net_device *dev, int acked)
197 /* Now alloc a skb to send back up through the layers: */ 198 /* Now alloc a skb to send back up through the layers: */
198 ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); 199 ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
199 if (ackskb == NULL) { 200 if (ackskb == NULL) {
200 BUGMSG(D_NORMAL, "Memory squeeze, can't acknowledge.\n"); 201 arc_printk(D_NORMAL, dev, "Memory squeeze, can't acknowledge\n");
201 goto free_outskb; 202 goto free_outskb;
202 } 203 }
203 204
@@ -213,8 +214,8 @@ static int ack_tx(struct net_device *dev, int acked)
213 ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */ 214 ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */
214 ackpkt->soft.cap.mes.ack = acked; 215 ackpkt->soft.cap.mes.ack = acked;
215 216
216 BUGMSG(D_PROTO, "Ackknowledge for cap packet %x.\n", 217 arc_printk(D_PROTO, dev, "Ackknowledge for cap packet %x.\n",
217 *((int *)&ackpkt->soft.cap.cookie[0])); 218 *((int *)&ackpkt->soft.cap.cookie[0]));
218 219
219 ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); 220 ackskb->protocol = cpu_to_be16(ETH_P_ARCNET);
220 221
diff --git a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c
index af87c7482478..c3748f7c5081 100644
--- a/drivers/net/arcnet/com20020-isa.c
+++ b/drivers/net/arcnet/com20020-isa.c
@@ -58,16 +58,16 @@ static int __init com20020isa_probe(struct net_device *dev)
58 58
59 ioaddr = dev->base_addr; 59 ioaddr = dev->base_addr;
60 if (!ioaddr) { 60 if (!ioaddr) {
61 BUGMSG(D_NORMAL, "No autoprobe (yet) for IO mapped cards; you must specify the base address!\n"); 61 arc_printk(D_NORMAL, dev, "No autoprobe (yet) for IO mapped cards; you must specify the base address!\n");
62 return -ENODEV; 62 return -ENODEV;
63 } 63 }
64 if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "arcnet (COM20020)")) { 64 if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "arcnet (COM20020)")) {
65 BUGMSG(D_NORMAL, "IO region %xh-%xh already allocated.\n", 65 arc_printk(D_NORMAL, dev, "IO region %xh-%xh already allocated.\n",
66 ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1); 66 ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1);
67 return -ENXIO; 67 return -ENXIO;
68 } 68 }
69 if (ASTATUS() == 0xFF) { 69 if (ASTATUS() == 0xFF) {
70 BUGMSG(D_NORMAL, "IO address %x empty\n", ioaddr); 70 arc_printk(D_NORMAL, dev, "IO address %x empty\n", ioaddr);
71 err = -ENODEV; 71 err = -ENODEV;
72 goto out; 72 goto out;
73 } 73 }
@@ -81,7 +81,8 @@ static int __init com20020isa_probe(struct net_device *dev)
81 * card has just reset and the NORXflag is on until 81 * card has just reset and the NORXflag is on until
82 * we tell it to start receiving. 82 * we tell it to start receiving.
83 */ 83 */
84 BUGMSG(D_INIT_REASONS, "intmask was %02Xh\n", inb(_INTMASK)); 84 arc_printk(D_INIT_REASONS, dev, "intmask was %02Xh\n",
85 inb(_INTMASK));
85 outb(0, _INTMASK); 86 outb(0, _INTMASK);
86 airqmask = probe_irq_on(); 87 airqmask = probe_irq_on();
87 outb(NORXflag, _INTMASK); 88 outb(NORXflag, _INTMASK);
@@ -90,14 +91,14 @@ static int __init com20020isa_probe(struct net_device *dev)
90 dev->irq = probe_irq_off(airqmask); 91 dev->irq = probe_irq_off(airqmask);
91 92
92 if ((int)dev->irq <= 0) { 93 if ((int)dev->irq <= 0) {
93 BUGMSG(D_INIT_REASONS, "Autoprobe IRQ failed first time\n"); 94 arc_printk(D_INIT_REASONS, dev, "Autoprobe IRQ failed first time\n");
94 airqmask = probe_irq_on(); 95 airqmask = probe_irq_on();
95 outb(NORXflag, _INTMASK); 96 outb(NORXflag, _INTMASK);
96 udelay(5); 97 udelay(5);
97 outb(0, _INTMASK); 98 outb(0, _INTMASK);
98 dev->irq = probe_irq_off(airqmask); 99 dev->irq = probe_irq_off(airqmask);
99 if ((int)dev->irq <= 0) { 100 if ((int)dev->irq <= 0) {
100 BUGMSG(D_NORMAL, "Autoprobe IRQ failed.\n"); 101 arc_printk(D_NORMAL, dev, "Autoprobe IRQ failed.\n");
101 err = -ENODEV; 102 err = -ENODEV;
102 goto out; 103 goto out;
103 } 104 }
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index c8184de4480d..0d0cc6a9c618 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -99,7 +99,7 @@ static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
99 99
100 lp = netdev_priv(dev); 100 lp = netdev_priv(dev);
101 101
102 BUGMSG(D_NORMAL, "%s Controls\n", ci->name); 102 arc_printk(D_NORMAL, dev, "%s Controls\n", ci->name);
103 ioaddr = pci_resource_start(pdev, cm->bar) + cm->offset; 103 ioaddr = pci_resource_start(pdev, cm->bar) + cm->offset;
104 104
105 r = devm_request_region(&pdev->dev, ioaddr, cm->size, 105 r = devm_request_region(&pdev->dev, ioaddr, cm->size,
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c
index 3170e8ebb7fa..b0b8a0be08e5 100644
--- a/drivers/net/arcnet/com20020.c
+++ b/drivers/net/arcnet/com20020.c
@@ -68,7 +68,7 @@ static void com20020_copy_from_card(struct net_device *dev, int bufnum,
68 outb(ofs & 0xff, _ADDR_LO); 68 outb(ofs & 0xff, _ADDR_LO);
69 69
70 /* copy the data */ 70 /* copy the data */
71 TIME("insb", count, insb(_MEMDATA, buf, count)); 71 TIME(dev, "insb", count, insb(_MEMDATA, buf, count));
72} 72}
73 73
74static void com20020_copy_to_card(struct net_device *dev, int bufnum, 74static void com20020_copy_to_card(struct net_device *dev, int bufnum,
@@ -81,7 +81,7 @@ static void com20020_copy_to_card(struct net_device *dev, int bufnum,
81 outb(ofs & 0xff, _ADDR_LO); 81 outb(ofs & 0xff, _ADDR_LO);
82 82
83 /* copy the data */ 83 /* copy the data */
84 TIME("outsb", count, outsb(_MEMDATA, buf, count)); 84 TIME(dev, "outsb", count, outsb(_MEMDATA, buf, count));
85} 85}
86 86
87/* Reset the card and check some basic stuff during the detection stage. */ 87/* Reset the card and check some basic stuff during the detection stage. */
@@ -120,10 +120,10 @@ int com20020_check(struct net_device *dev)
120 status = ASTATUS(); 120 status = ASTATUS();
121 121
122 if ((status & 0x99) != (NORXflag | TXFREEflag | RESETflag)) { 122 if ((status & 0x99) != (NORXflag | TXFREEflag | RESETflag)) {
123 BUGMSG(D_NORMAL, "status invalid (%Xh).\n", status); 123 arc_printk(D_NORMAL, dev, "status invalid (%Xh).\n", status);
124 return -ENODEV; 124 return -ENODEV;
125 } 125 }
126 BUGMSG(D_INIT_REASONS, "status after reset: %X\n", status); 126 arc_printk(D_INIT_REASONS, dev, "status after reset: %X\n", status);
127 127
128 /* Enable TX */ 128 /* Enable TX */
129 outb(0x39, _CONFIG); 129 outb(0x39, _CONFIG);
@@ -132,16 +132,16 @@ int com20020_check(struct net_device *dev)
132 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); 132 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
133 133
134 status = ASTATUS(); 134 status = ASTATUS();
135 BUGMSG(D_INIT_REASONS, "status after reset acknowledged: %X\n", 135 arc_printk(D_INIT_REASONS, dev, "status after reset acknowledged: %X\n",
136 status); 136 status);
137 137
138 /* Read first location of memory */ 138 /* Read first location of memory */
139 outb(0 | RDDATAflag | AUTOINCflag, _ADDR_HI); 139 outb(0 | RDDATAflag | AUTOINCflag, _ADDR_HI);
140 outb(0, _ADDR_LO); 140 outb(0, _ADDR_LO);
141 141
142 if ((status = inb(_MEMDATA)) != TESTvalue) { 142 if ((status = inb(_MEMDATA)) != TESTvalue) {
143 BUGMSG(D_NORMAL, "Signature byte not found (%02Xh != D1h).\n", 143 arc_printk(D_NORMAL, dev, "Signature byte not found (%02Xh != D1h).\n",
144 status); 144 status);
145 return -ENODEV; 145 return -ENODEV;
146 } 146 }
147 return 0; 147 return 0;
@@ -213,24 +213,25 @@ int com20020_found(struct net_device *dev, int shared)
213 /* reserve the irq */ 213 /* reserve the irq */
214 if (request_irq(dev->irq, arcnet_interrupt, shared, 214 if (request_irq(dev->irq, arcnet_interrupt, shared,
215 "arcnet (COM20020)", dev)) { 215 "arcnet (COM20020)", dev)) {
216 BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq); 216 arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
217 return -ENODEV; 217 return -ENODEV;
218 } 218 }
219 219
220 dev->base_addr = ioaddr; 220 dev->base_addr = ioaddr;
221 221
222 BUGMSG(D_NORMAL, "%s: station %02Xh found at %03lXh, IRQ %d.\n", 222 arc_printk(D_NORMAL, dev, "%s: station %02Xh found at %03lXh, IRQ %d.\n",
223 lp->card_name, dev->dev_addr[0], dev->base_addr, dev->irq); 223 lp->card_name, dev->dev_addr[0], dev->base_addr, dev->irq);
224 224
225 if (lp->backplane) 225 if (lp->backplane)
226 BUGMSG(D_NORMAL, "Using backplane mode.\n"); 226 arc_printk(D_NORMAL, dev, "Using backplane mode.\n");
227 227
228 if (lp->timeout != 3) 228 if (lp->timeout != 3)
229 BUGMSG(D_NORMAL, "Using extended timeout value of %d.\n", lp->timeout); 229 arc_printk(D_NORMAL, dev, "Using extended timeout value of %d\n",
230 lp->timeout);
230 231
231 BUGMSG(D_NORMAL, "Using CKP %d - data rate %s.\n", 232 arc_printk(D_NORMAL, dev, "Using CKP %d - data rate %s\n",
232 lp->setup >> 1, 233 lp->setup >> 1,
233 clockrates[3 - ((lp->setup2 & 0xF0) >> 4) + ((lp->setup & 0x0F) >> 1)]); 234 clockrates[3 - ((lp->setup2 & 0xF0) >> 4) + ((lp->setup & 0x0F) >> 1)]);
234 235
235 if (register_netdev(dev)) { 236 if (register_netdev(dev)) {
236 free_irq(dev->irq, dev); 237 free_irq(dev->irq, dev);
@@ -252,16 +253,16 @@ static int com20020_reset(struct net_device *dev, int really_reset)
252 u_int ioaddr = dev->base_addr; 253 u_int ioaddr = dev->base_addr;
253 u_char inbyte; 254 u_char inbyte;
254 255
255 BUGMSG(D_DEBUG, "%s: %d: %s: dev: %p, lp: %p, dev->name: %s\n", 256 arc_printk(D_DEBUG, dev, "%s: %d: %s: dev: %p, lp: %p, dev->name: %s\n",
256 __FILE__, __LINE__, __func__, dev, lp, dev->name); 257 __FILE__, __LINE__, __func__, dev, lp, dev->name);
257 BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", 258 arc_printk(D_INIT, dev, "Resetting %s (status=%02Xh)\n",
258 dev->name, ASTATUS()); 259 dev->name, ASTATUS());
259 260
260 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 261 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
261 lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2); 262 lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2);
262 /* power-up defaults */ 263 /* power-up defaults */
263 SETCONF; 264 SETCONF;
264 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 265 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
265 266
266 if (really_reset) { 267 if (really_reset) {
267 /* reset the card */ 268 /* reset the card */
@@ -269,22 +270,23 @@ static int com20020_reset(struct net_device *dev, int really_reset)
269 mdelay(RESETtime * 2); /* COM20020 seems to be slower sometimes */ 270 mdelay(RESETtime * 2); /* COM20020 seems to be slower sometimes */
270 } 271 }
271 /* clear flags & end reset */ 272 /* clear flags & end reset */
272 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 273 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
273 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); 274 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
274 275
275 /* verify that the ARCnet signature byte is present */ 276 /* verify that the ARCnet signature byte is present */
276 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 277 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
277 278
278 com20020_copy_from_card(dev, 0, 0, &inbyte, 1); 279 com20020_copy_from_card(dev, 0, 0, &inbyte, 1);
279 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 280 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
280 if (inbyte != TESTvalue) { 281 if (inbyte != TESTvalue) {
281 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 282 arc_printk(D_DEBUG, dev, "%s: %d: %s\n",
282 BUGMSG(D_NORMAL, "reset failed: TESTvalue not present.\n"); 283 __FILE__, __LINE__, __func__);
284 arc_printk(D_NORMAL, dev, "reset failed: TESTvalue not present.\n");
283 return 1; 285 return 1;
284 } 286 }
285 /* enable extended (512-byte) packets */ 287 /* enable extended (512-byte) packets */
286 ACOMMAND(CONFIGcmd | EXTconf); 288 ACOMMAND(CONFIGcmd | EXTconf);
287 BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 289 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
288 290
289 /* done! return success. */ 291 /* done! return success. */
290 return 0; 292 return 0;
@@ -294,7 +296,7 @@ static void com20020_setmask(struct net_device *dev, int mask)
294{ 296{
295 u_int ioaddr = dev->base_addr; 297 u_int ioaddr = dev->base_addr;
296 298
297 BUGMSG(D_DURING, "Setting mask to %x at %x\n", mask, ioaddr); 299 arc_printk(D_DURING, dev, "Setting mask to %x at %x\n", mask, ioaddr);
298 AINTMASK(mask); 300 AINTMASK(mask);
299} 301}
300 302
@@ -336,7 +338,7 @@ static void com20020_set_mc_list(struct net_device *dev)
336 338
337 if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */ 339 if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */
338 if (!(lp->setup & PROMISCset)) 340 if (!(lp->setup & PROMISCset))
339 BUGMSG(D_NORMAL, "Setting promiscuous flag...\n"); 341 arc_printk(D_NORMAL, dev, "Setting promiscuous flag...\n");
340 SET_SUBADR(SUB_SETUP1); 342 SET_SUBADR(SUB_SETUP1);
341 lp->setup |= PROMISCset; 343 lp->setup |= PROMISCset;
342 outb(lp->setup, _XREG); 344 outb(lp->setup, _XREG);
@@ -344,7 +346,7 @@ static void com20020_set_mc_list(struct net_device *dev)
344 /* Disable promiscuous mode, use normal mode */ 346 /* Disable promiscuous mode, use normal mode */
345 { 347 {
346 if ((lp->setup & PROMISCset)) 348 if ((lp->setup & PROMISCset))
347 BUGMSG(D_NORMAL, "Resetting promiscuous flag...\n"); 349 arc_printk(D_NORMAL, dev, "Resetting promiscuous flag...\n");
348 SET_SUBADR(SUB_SETUP1); 350 SET_SUBADR(SUB_SETUP1);
349 lp->setup &= ~PROMISCset; 351 lp->setup &= ~PROMISCset;
350 outb(lp->setup, _XREG); 352 outb(lp->setup, _XREG);
diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c
index 33a8531e90c7..ec2db8527862 100644
--- a/drivers/net/arcnet/com90io.c
+++ b/drivers/net/arcnet/com90io.c
@@ -151,16 +151,17 @@ static int __init com90io_probe(struct net_device *dev)
151 } 151 }
152 152
153 if (!ioaddr) { 153 if (!ioaddr) {
154 BUGMSG(D_NORMAL, "No autoprobe for IO mapped cards; you must specify the base address!\n"); 154 arc_printk(D_NORMAL, dev, "No autoprobe for IO mapped cards; you must specify the base address!\n");
155 return -ENODEV; 155 return -ENODEV;
156 } 156 }
157 if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com90io probe")) { 157 if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com90io probe")) {
158 BUGMSG(D_INIT_REASONS, "IO request_region %x-%x failed.\n", 158 arc_printk(D_INIT_REASONS, dev, "IO request_region %x-%x failed\n",
159 ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1); 159 ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1);
160 return -ENXIO; 160 return -ENXIO;
161 } 161 }
162 if (ASTATUS() == 0xFF) { 162 if (ASTATUS() == 0xFF) {
163 BUGMSG(D_INIT_REASONS, "IO address %x empty\n", ioaddr); 163 arc_printk(D_INIT_REASONS, dev, "IO address %x empty\n",
164 ioaddr);
164 goto err_out; 165 goto err_out;
165 } 166 }
166 inb(_RESET); 167 inb(_RESET);
@@ -169,19 +170,22 @@ static int __init com90io_probe(struct net_device *dev)
169 status = ASTATUS(); 170 status = ASTATUS();
170 171
171 if ((status & 0x9D) != (NORXflag | RECONflag | TXFREEflag | RESETflag)) { 172 if ((status & 0x9D) != (NORXflag | RECONflag | TXFREEflag | RESETflag)) {
172 BUGMSG(D_INIT_REASONS, "Status invalid (%Xh).\n", status); 173 arc_printk(D_INIT_REASONS, dev, "Status invalid (%Xh)\n",
174 status);
173 goto err_out; 175 goto err_out;
174 } 176 }
175 BUGMSG(D_INIT_REASONS, "Status after reset: %X\n", status); 177 arc_printk(D_INIT_REASONS, dev, "Status after reset: %X\n", status);
176 178
177 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); 179 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
178 180
179 BUGMSG(D_INIT_REASONS, "Status after reset acknowledged: %X\n", status); 181 arc_printk(D_INIT_REASONS, dev, "Status after reset acknowledged: %X\n",
182 status);
180 183
181 status = ASTATUS(); 184 status = ASTATUS();
182 185
183 if (status & RESETflag) { 186 if (status & RESETflag) {
184 BUGMSG(D_INIT_REASONS, "Eternal reset (status=%Xh)\n", status); 187 arc_printk(D_INIT_REASONS, dev, "Eternal reset (status=%Xh)\n",
188 status);
185 goto err_out; 189 goto err_out;
186 } 190 }
187 outb((0x16 | IOMAPflag) & ~ENABLE16flag, _CONFIG); 191 outb((0x16 | IOMAPflag) & ~ENABLE16flag, _CONFIG);
@@ -192,8 +196,8 @@ static int __init com90io_probe(struct net_device *dev)
192 outb(0, _ADDR_LO); 196 outb(0, _ADDR_LO);
193 197
194 if ((status = inb(_MEMDATA)) != 0xd1) { 198 if ((status = inb(_MEMDATA)) != 0xd1) {
195 BUGMSG(D_INIT_REASONS, "Signature byte not found (%Xh instead).\n", 199 arc_printk(D_INIT_REASONS, dev, "Signature byte not found (%Xh instead).\n",
196 status); 200 status);
197 goto err_out; 201 goto err_out;
198 } 202 }
199 if (!dev->irq) { 203 if (!dev->irq) {
@@ -209,7 +213,7 @@ static int __init com90io_probe(struct net_device *dev)
209 dev->irq = probe_irq_off(airqmask); 213 dev->irq = probe_irq_off(airqmask);
210 214
211 if ((int)dev->irq <= 0) { 215 if ((int)dev->irq <= 0) {
212 BUGMSG(D_INIT_REASONS, "Autoprobe IRQ failed\n"); 216 arc_printk(D_INIT_REASONS, dev, "Autoprobe IRQ failed\n");
213 goto err_out; 217 goto err_out;
214 } 218 }
215 } 219 }
@@ -232,7 +236,7 @@ static int __init com90io_found(struct net_device *dev)
232 236
233 /* Reserve the irq */ 237 /* Reserve the irq */
234 if (request_irq(dev->irq, arcnet_interrupt, 0, "arcnet (COM90xx-IO)", dev)) { 238 if (request_irq(dev->irq, arcnet_interrupt, 0, "arcnet (COM90xx-IO)", dev)) {
235 BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq); 239 arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
236 return -ENODEV; 240 return -ENODEV;
237 } 241 }
238 /* Reserve the I/O region */ 242 /* Reserve the I/O region */
@@ -266,8 +270,8 @@ static int __init com90io_found(struct net_device *dev)
266 return err; 270 return err;
267 } 271 }
268 272
269 BUGMSG(D_NORMAL, "COM90IO: station %02Xh found at %03lXh, IRQ %d.\n", 273 arc_printk(D_NORMAL, dev, "COM90IO: station %02Xh found at %03lXh, IRQ %d.\n",
270 dev->dev_addr[0], dev->base_addr, dev->irq); 274 dev->dev_addr[0], dev->base_addr, dev->irq);
271 275
272 return 0; 276 return 0;
273} 277}
@@ -284,7 +288,8 @@ static int com90io_reset(struct net_device *dev, int really_reset)
284 struct arcnet_local *lp = netdev_priv(dev); 288 struct arcnet_local *lp = netdev_priv(dev);
285 short ioaddr = dev->base_addr; 289 short ioaddr = dev->base_addr;
286 290
287 BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); 291 arc_printk(D_INIT, dev, "Resetting %s (status=%02Xh)\n",
292 dev->name, ASTATUS());
288 293
289 if (really_reset) { 294 if (really_reset) {
290 /* reset the card */ 295 /* reset the card */
@@ -300,7 +305,7 @@ static int com90io_reset(struct net_device *dev, int really_reset)
300 305
301 /* verify that the ARCnet signature byte is present */ 306 /* verify that the ARCnet signature byte is present */
302 if (get_buffer_byte(dev, 0) != TESTvalue) { 307 if (get_buffer_byte(dev, 0) != TESTvalue) {
303 BUGMSG(D_NORMAL, "reset failed: TESTvalue not present.\n"); 308 arc_printk(D_NORMAL, dev, "reset failed: TESTvalue not present.\n");
304 return 1; 309 return 1;
305 } 310 }
306 /* enable extended (512-byte) packets */ 311 /* enable extended (512-byte) packets */
@@ -334,13 +339,15 @@ static void com90io_setmask(struct net_device *dev, int mask)
334static void com90io_copy_to_card(struct net_device *dev, int bufnum, int offset, 339static void com90io_copy_to_card(struct net_device *dev, int bufnum, int offset,
335 void *buf, int count) 340 void *buf, int count)
336{ 341{
337 TIME("put_whole_buffer", count, put_whole_buffer(dev, bufnum * 512 + offset, count, buf)); 342 TIME(dev, "put_whole_buffer", count,
343 put_whole_buffer(dev, bufnum * 512 + offset, count, buf));
338} 344}
339 345
340static void com90io_copy_from_card(struct net_device *dev, int bufnum, int offset, 346static void com90io_copy_from_card(struct net_device *dev, int bufnum, int offset,
341 void *buf, int count) 347 void *buf, int count)
342{ 348{
343 TIME("get_whole_buffer", count, get_whole_buffer(dev, bufnum * 512 + offset, count, buf)); 349 TIME(dev, "get_whole_buffer", count,
350 get_whole_buffer(dev, bufnum * 512 + offset, count, buf));
344} 351}
345 352
346static int io; /* use the insmod io= irq= shmem= options */ 353static int io; /* use the insmod io= irq= shmem= options */
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c
index b5e1c1904f13..12534a3cb4ce 100644
--- a/drivers/net/arcnet/com90xx.c
+++ b/drivers/net/arcnet/com90xx.c
@@ -157,24 +157,24 @@ static void __init com90xx_probe(void)
157 numprint++; 157 numprint++;
158 numprint %= 8; 158 numprint %= 8;
159 if (!numprint) { 159 if (!numprint) {
160 BUGMSG2(D_INIT, "\n"); 160 arc_cont(D_INIT, "\n");
161 BUGMSG2(D_INIT, "S1: "); 161 arc_cont(D_INIT, "S1: ");
162 } 162 }
163 BUGMSG2(D_INIT, "%Xh ", *port); 163 arc_cont(D_INIT, "%Xh ", *port);
164 164
165 ioaddr = *port; 165 ioaddr = *port;
166 166
167 if (!request_region(*port, ARCNET_TOTAL_SIZE, "arcnet (90xx)")) { 167 if (!request_region(*port, ARCNET_TOTAL_SIZE, "arcnet (90xx)")) {
168 BUGMSG2(D_INIT_REASONS, "(request_region)\n"); 168 arc_cont(D_INIT_REASONS, "(request_region)\n");
169 BUGMSG2(D_INIT_REASONS, "S1: "); 169 arc_cont(D_INIT_REASONS, "S1: ");
170 if (BUGLVL(D_INIT_REASONS)) 170 if (BUGLVL(D_INIT_REASONS))
171 numprint = 0; 171 numprint = 0;
172 *port-- = ports[--numports]; 172 *port-- = ports[--numports];
173 continue; 173 continue;
174 } 174 }
175 if (ASTATUS() == 0xFF) { 175 if (ASTATUS() == 0xFF) {
176 BUGMSG2(D_INIT_REASONS, "(empty)\n"); 176 arc_cont(D_INIT_REASONS, "(empty)\n");
177 BUGMSG2(D_INIT_REASONS, "S1: "); 177 arc_cont(D_INIT_REASONS, "S1: ");
178 if (BUGLVL(D_INIT_REASONS)) 178 if (BUGLVL(D_INIT_REASONS))
179 numprint = 0; 179 numprint = 0;
180 release_region(*port, ARCNET_TOTAL_SIZE); 180 release_region(*port, ARCNET_TOTAL_SIZE);
@@ -183,15 +183,15 @@ static void __init com90xx_probe(void)
183 } 183 }
184 inb(_RESET); /* begin resetting card */ 184 inb(_RESET); /* begin resetting card */
185 185
186 BUGMSG2(D_INIT_REASONS, "\n"); 186 arc_cont(D_INIT_REASONS, "\n");
187 BUGMSG2(D_INIT_REASONS, "S1: "); 187 arc_cont(D_INIT_REASONS, "S1: ");
188 if (BUGLVL(D_INIT_REASONS)) 188 if (BUGLVL(D_INIT_REASONS))
189 numprint = 0; 189 numprint = 0;
190 } 190 }
191 BUGMSG2(D_INIT, "\n"); 191 arc_cont(D_INIT, "\n");
192 192
193 if (!numports) { 193 if (!numports) {
194 BUGMSG2(D_NORMAL, "S1: No ARCnet cards found.\n"); 194 arc_cont(D_NORMAL, "S1: No ARCnet cards found.\n");
195 kfree(shmems); 195 kfree(shmems);
196 kfree(iomem); 196 kfree(iomem);
197 return; 197 return;
@@ -205,12 +205,12 @@ static void __init com90xx_probe(void)
205 numprint++; 205 numprint++;
206 numprint %= 8; 206 numprint %= 8;
207 if (!numprint) { 207 if (!numprint) {
208 BUGMSG2(D_INIT, "\n"); 208 arc_cont(D_INIT, "\n");
209 BUGMSG2(D_INIT, "S2: "); 209 arc_cont(D_INIT, "S2: ");
210 } 210 }
211 BUGMSG2(D_INIT, "%Xh ", *port); 211 arc_cont(D_INIT, "%Xh ", *port);
212 } 212 }
213 BUGMSG2(D_INIT, "\n"); 213 arc_cont(D_INIT, "\n");
214 mdelay(RESETtime); 214 mdelay(RESETtime);
215 215
216 /* Stage 3: abandon any shmem addresses that don't have the signature 216 /* Stage 3: abandon any shmem addresses that don't have the signature
@@ -223,30 +223,30 @@ static void __init com90xx_probe(void)
223 numprint++; 223 numprint++;
224 numprint %= 8; 224 numprint %= 8;
225 if (!numprint) { 225 if (!numprint) {
226 BUGMSG2(D_INIT, "\n"); 226 arc_cont(D_INIT, "\n");
227 BUGMSG2(D_INIT, "S3: "); 227 arc_cont(D_INIT, "S3: ");
228 } 228 }
229 BUGMSG2(D_INIT, "%lXh ", *p); 229 arc_cont(D_INIT, "%lXh ", *p);
230 230
231 if (!request_mem_region(*p, MIRROR_SIZE, "arcnet (90xx)")) { 231 if (!request_mem_region(*p, MIRROR_SIZE, "arcnet (90xx)")) {
232 BUGMSG2(D_INIT_REASONS, "(request_mem_region)\n"); 232 arc_cont(D_INIT_REASONS, "(request_mem_region)\n");
233 BUGMSG2(D_INIT_REASONS, "Stage 3: "); 233 arc_cont(D_INIT_REASONS, "Stage 3: ");
234 if (BUGLVL(D_INIT_REASONS)) 234 if (BUGLVL(D_INIT_REASONS))
235 numprint = 0; 235 numprint = 0;
236 goto out; 236 goto out;
237 } 237 }
238 base = ioremap(*p, MIRROR_SIZE); 238 base = ioremap(*p, MIRROR_SIZE);
239 if (!base) { 239 if (!base) {
240 BUGMSG2(D_INIT_REASONS, "(ioremap)\n"); 240 arc_cont(D_INIT_REASONS, "(ioremap)\n");
241 BUGMSG2(D_INIT_REASONS, "Stage 3: "); 241 arc_cont(D_INIT_REASONS, "Stage 3: ");
242 if (BUGLVL(D_INIT_REASONS)) 242 if (BUGLVL(D_INIT_REASONS))
243 numprint = 0; 243 numprint = 0;
244 goto out1; 244 goto out1;
245 } 245 }
246 if (readb(base) != TESTvalue) { 246 if (readb(base) != TESTvalue) {
247 BUGMSG2(D_INIT_REASONS, "(%02Xh != %02Xh)\n", 247 arc_cont(D_INIT_REASONS, "(%02Xh != %02Xh)\n",
248 readb(base), TESTvalue); 248 readb(base), TESTvalue);
249 BUGMSG2(D_INIT_REASONS, "S3: "); 249 arc_cont(D_INIT_REASONS, "S3: ");
250 if (BUGLVL(D_INIT_REASONS)) 250 if (BUGLVL(D_INIT_REASONS))
251 numprint = 0; 251 numprint = 0;
252 goto out2; 252 goto out2;
@@ -258,12 +258,12 @@ static void __init com90xx_probe(void)
258 */ 258 */
259 writeb(0x42, base); 259 writeb(0x42, base);
260 if (readb(base) != 0x42) { 260 if (readb(base) != 0x42) {
261 BUGMSG2(D_INIT_REASONS, "(read only)\n"); 261 arc_cont(D_INIT_REASONS, "(read only)\n");
262 BUGMSG2(D_INIT_REASONS, "S3: "); 262 arc_cont(D_INIT_REASONS, "S3: ");
263 goto out2; 263 goto out2;
264 } 264 }
265 BUGMSG2(D_INIT_REASONS, "\n"); 265 arc_cont(D_INIT_REASONS, "\n");
266 BUGMSG2(D_INIT_REASONS, "S3: "); 266 arc_cont(D_INIT_REASONS, "S3: ");
267 if (BUGLVL(D_INIT_REASONS)) 267 if (BUGLVL(D_INIT_REASONS))
268 numprint = 0; 268 numprint = 0;
269 iomem[index] = base; 269 iomem[index] = base;
@@ -276,10 +276,10 @@ static void __init com90xx_probe(void)
276 *p-- = shmems[--numshmems]; 276 *p-- = shmems[--numshmems];
277 index--; 277 index--;
278 } 278 }
279 BUGMSG2(D_INIT, "\n"); 279 arc_cont(D_INIT, "\n");
280 280
281 if (!numshmems) { 281 if (!numshmems) {
282 BUGMSG2(D_NORMAL, "S3: No ARCnet cards found.\n"); 282 arc_cont(D_NORMAL, "S3: No ARCnet cards found.\n");
283 for (port = &ports[0]; port < ports + numports; port++) 283 for (port = &ports[0]; port < ports + numports; port++)
284 release_region(*port, ARCNET_TOTAL_SIZE); 284 release_region(*port, ARCNET_TOTAL_SIZE);
285 kfree(shmems); 285 kfree(shmems);
@@ -294,12 +294,12 @@ static void __init com90xx_probe(void)
294 numprint++; 294 numprint++;
295 numprint %= 8; 295 numprint %= 8;
296 if (!numprint) { 296 if (!numprint) {
297 BUGMSG2(D_INIT, "\n"); 297 arc_cont(D_INIT, "\n");
298 BUGMSG2(D_INIT, "S4: "); 298 arc_cont(D_INIT, "S4: ");
299 } 299 }
300 BUGMSG2(D_INIT, "%lXh ", *p); 300 arc_cont(D_INIT, "%lXh ", *p);
301 } 301 }
302 BUGMSG2(D_INIT, "\n"); 302 arc_cont(D_INIT, "\n");
303 303
304 /* Stage 5: for any ports that have the correct status, can disable 304 /* Stage 5: for any ports that have the correct status, can disable
305 * the RESET flag, and (if no irq is given) generate an autoirq, 305 * the RESET flag, and (if no irq is given) generate an autoirq,
@@ -315,18 +315,18 @@ static void __init com90xx_probe(void)
315 numprint++; 315 numprint++;
316 numprint %= 8; 316 numprint %= 8;
317 if (!numprint) { 317 if (!numprint) {
318 BUGMSG2(D_INIT, "\n"); 318 arc_cont(D_INIT, "\n");
319 BUGMSG2(D_INIT, "S5: "); 319 arc_cont(D_INIT, "S5: ");
320 } 320 }
321 BUGMSG2(D_INIT, "%Xh ", *port); 321 arc_cont(D_INIT, "%Xh ", *port);
322 322
323 ioaddr = *port; 323 ioaddr = *port;
324 status = ASTATUS(); 324 status = ASTATUS();
325 325
326 if ((status & 0x9D) 326 if ((status & 0x9D)
327 != (NORXflag | RECONflag | TXFREEflag | RESETflag)) { 327 != (NORXflag | RECONflag | TXFREEflag | RESETflag)) {
328 BUGMSG2(D_INIT_REASONS, "(status=%Xh)\n", status); 328 arc_cont(D_INIT_REASONS, "(status=%Xh)\n", status);
329 BUGMSG2(D_INIT_REASONS, "S5: "); 329 arc_cont(D_INIT_REASONS, "S5: ");
330 if (BUGLVL(D_INIT_REASONS)) 330 if (BUGLVL(D_INIT_REASONS))
331 numprint = 0; 331 numprint = 0;
332 release_region(*port, ARCNET_TOTAL_SIZE); 332 release_region(*port, ARCNET_TOTAL_SIZE);
@@ -336,9 +336,9 @@ static void __init com90xx_probe(void)
336 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); 336 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
337 status = ASTATUS(); 337 status = ASTATUS();
338 if (status & RESETflag) { 338 if (status & RESETflag) {
339 BUGMSG2(D_INIT_REASONS, " (eternal reset, status=%Xh)\n", 339 arc_cont(D_INIT_REASONS, " (eternal reset, status=%Xh)\n",
340 status); 340 status);
341 BUGMSG2(D_INIT_REASONS, "S5: "); 341 arc_cont(D_INIT_REASONS, "S5: ");
342 if (BUGLVL(D_INIT_REASONS)) 342 if (BUGLVL(D_INIT_REASONS))
343 numprint = 0; 343 numprint = 0;
344 release_region(*port, ARCNET_TOTAL_SIZE); 344 release_region(*port, ARCNET_TOTAL_SIZE);
@@ -360,8 +360,8 @@ static void __init com90xx_probe(void)
360 airq = probe_irq_off(airqmask); 360 airq = probe_irq_off(airqmask);
361 361
362 if (airq <= 0) { 362 if (airq <= 0) {
363 BUGMSG2(D_INIT_REASONS, "(airq=%d)\n", airq); 363 arc_cont(D_INIT_REASONS, "(airq=%d)\n", airq);
364 BUGMSG2(D_INIT_REASONS, "S5: "); 364 arc_cont(D_INIT_REASONS, "S5: ");
365 if (BUGLVL(D_INIT_REASONS)) 365 if (BUGLVL(D_INIT_REASONS))
366 numprint = 0; 366 numprint = 0;
367 release_region(*port, ARCNET_TOTAL_SIZE); 367 release_region(*port, ARCNET_TOTAL_SIZE);
@@ -372,7 +372,7 @@ static void __init com90xx_probe(void)
372 airq = irq; 372 airq = irq;
373 } 373 }
374 374
375 BUGMSG2(D_INIT, "(%d,", airq); 375 arc_cont(D_INIT, "(%d,", airq);
376 openparen = 1; 376 openparen = 1;
377 377
378 /* Everything seems okay. But which shmem, if any, puts 378 /* Everything seems okay. But which shmem, if any, puts
@@ -399,7 +399,7 @@ static void __init com90xx_probe(void)
399 void __iomem *base = iomem[index]; 399 void __iomem *base = iomem[index];
400 400
401 if (readb(base) == TESTvalue) { /* found one */ 401 if (readb(base) == TESTvalue) { /* found one */
402 BUGMSG2(D_INIT, "%lXh)\n", *p); 402 arc_cont(D_INIT, "%lXh)\n", *p);
403 openparen = 0; 403 openparen = 0;
404 404
405 /* register the card */ 405 /* register the card */
@@ -412,7 +412,7 @@ static void __init com90xx_probe(void)
412 iomem[index] = iomem[numshmems]; 412 iomem[index] = iomem[numshmems];
413 break; /* go to the next I/O port */ 413 break; /* go to the next I/O port */
414 } else { 414 } else {
415 BUGMSG2(D_INIT_REASONS, "%Xh-", readb(base)); 415 arc_cont(D_INIT_REASONS, "%Xh-", readb(base));
416 } 416 }
417 } 417 }
418 418
@@ -476,7 +476,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem
476 /* allocate struct net_device */ 476 /* allocate struct net_device */
477 dev = alloc_arcdev(device); 477 dev = alloc_arcdev(device);
478 if (!dev) { 478 if (!dev) {
479 BUGMSG2(D_NORMAL, "com90xx: Can't allocate device!\n"); 479 arc_cont(D_NORMAL, "com90xx: Can't allocate device!\n");
480 iounmap(p); 480 iounmap(p);
481 release_mem_region(shmem, MIRROR_SIZE); 481 release_mem_region(shmem, MIRROR_SIZE);
482 return -ENOMEM; 482 return -ENOMEM;
@@ -515,7 +515,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem
515 515
516 /* reserve the irq */ 516 /* reserve the irq */
517 if (request_irq(airq, arcnet_interrupt, 0, "arcnet (90xx)", dev)) { 517 if (request_irq(airq, arcnet_interrupt, 0, "arcnet (90xx)", dev)) {
518 BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", airq); 518 arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", airq);
519 goto err_release_mem; 519 goto err_release_mem;
520 } 520 }
521 dev->irq = airq; 521 dev->irq = airq;
@@ -531,7 +531,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem
531 lp->hw.copy_from_card = com90xx_copy_from_card; 531 lp->hw.copy_from_card = com90xx_copy_from_card;
532 lp->mem_start = ioremap(dev->mem_start, dev->mem_end - dev->mem_start + 1); 532 lp->mem_start = ioremap(dev->mem_start, dev->mem_end - dev->mem_start + 1);
533 if (!lp->mem_start) { 533 if (!lp->mem_start) {
534 BUGMSG(D_NORMAL, "Can't remap device memory!\n"); 534 arc_printk(D_NORMAL, dev, "Can't remap device memory!\n");
535 goto err_free_irq; 535 goto err_free_irq;
536 } 536 }
537 537
@@ -540,10 +540,11 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem
540 540
541 dev->base_addr = ioaddr; 541 dev->base_addr = ioaddr;
542 542
543 BUGMSG(D_NORMAL, "COM90xx station %02Xh found at %03lXh, IRQ %d, ShMem %lXh (%ld*%xh).\n", 543 arc_printk(D_NORMAL, dev, "COM90xx station %02Xh found at %03lXh, IRQ %d, ShMem %lXh (%ld*%xh).\n",
544 dev->dev_addr[0], 544 dev->dev_addr[0],
545 dev->base_addr, dev->irq, dev->mem_start, 545 dev->base_addr, dev->irq, dev->mem_start,
546 (dev->mem_end - dev->mem_start + 1) / mirror_size, mirror_size); 546 (dev->mem_end - dev->mem_start + 1) / mirror_size,
547 mirror_size);
547 548
548 if (register_netdev(dev)) 549 if (register_netdev(dev))
549 goto err_unmap; 550 goto err_unmap;
@@ -595,7 +596,7 @@ static int com90xx_reset(struct net_device *dev, int really_reset)
595 struct arcnet_local *lp = netdev_priv(dev); 596 struct arcnet_local *lp = netdev_priv(dev);
596 short ioaddr = dev->base_addr; 597 short ioaddr = dev->base_addr;
597 598
598 BUGMSG(D_INIT, "Resetting (status=%02Xh)\n", ASTATUS()); 599 arc_printk(D_INIT, dev, "Resetting (status=%02Xh)\n", ASTATUS());
599 600
600 if (really_reset) { 601 if (really_reset) {
601 /* reset the card */ 602 /* reset the card */
@@ -611,7 +612,7 @@ static int com90xx_reset(struct net_device *dev, int really_reset)
611 /* verify that the ARCnet signature byte is present */ 612 /* verify that the ARCnet signature byte is present */
612 if (readb(lp->mem_start) != TESTvalue) { 613 if (readb(lp->mem_start) != TESTvalue) {
613 if (really_reset) 614 if (really_reset)
614 BUGMSG(D_NORMAL, "reset failed: TESTvalue not present.\n"); 615 arc_printk(D_NORMAL, dev, "reset failed: TESTvalue not present.\n");
615 return 1; 616 return 1;
616 } 617 }
617 /* enable extended (512-byte) packets */ 618 /* enable extended (512-byte) packets */
@@ -631,7 +632,7 @@ static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset,
631 struct arcnet_local *lp = netdev_priv(dev); 632 struct arcnet_local *lp = netdev_priv(dev);
632 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; 633 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
633 634
634 TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); 635 TIME(dev, "memcpy_toio", count, memcpy_toio(memaddr, buf, count));
635} 636}
636 637
637static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset, 638static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset,
@@ -640,7 +641,7 @@ static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offse
640 struct arcnet_local *lp = netdev_priv(dev); 641 struct arcnet_local *lp = netdev_priv(dev);
641 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; 642 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
642 643
643 TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); 644 TIME(dev, "memcpy_fromio", count, memcpy_fromio(buf, memaddr, count));
644} 645}
645 646
646MODULE_LICENSE("GPL"); 647MODULE_LICENSE("GPL");
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c
index 824d71fcfd53..47c7d1a4ef4c 100644
--- a/drivers/net/arcnet/rfc1051.c
+++ b/drivers/net/arcnet/rfc1051.c
@@ -124,7 +124,7 @@ static void rx(struct net_device *dev, int bufnum,
124 struct archdr *pkt = pkthdr; 124 struct archdr *pkt = pkthdr;
125 int ofs; 125 int ofs;
126 126
127 BUGMSG(D_DURING, "it's a raw packet (length=%d)\n", length); 127 arc_printk(D_DURING, dev, "it's a raw packet (length=%d)\n", length);
128 128
129 if (length >= MinTU) 129 if (length >= MinTU)
130 ofs = 512 - length; 130 ofs = 512 - length;
@@ -133,7 +133,7 @@ static void rx(struct net_device *dev, int bufnum,
133 133
134 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); 134 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
135 if (skb == NULL) { 135 if (skb == NULL) {
136 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); 136 arc_printk(D_NORMAL, dev, "Memory squeeze, dropping packet\n");
137 dev->stats.rx_dropped++; 137 dev->stats.rx_dropped++;
138 return; 138 return;
139 } 139 }
@@ -173,8 +173,8 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
173 soft->proto = ARC_P_ARP_RFC1051; 173 soft->proto = ARC_P_ARP_RFC1051;
174 break; 174 break;
175 default: 175 default:
176 BUGMSG(D_NORMAL, "RFC1051: I don't understand protocol %d (%Xh)\n", 176 arc_printk(D_NORMAL, dev, "RFC1051: I don't understand protocol %d (%Xh)\n",
177 type, type); 177 type, type);
178 dev->stats.tx_errors++; 178 dev->stats.tx_errors++;
179 dev->stats.tx_aborted_errors++; 179 dev->stats.tx_aborted_errors++;
180 return 0; 180 return 0;
@@ -210,15 +210,15 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
210 struct arc_hardware *hard = &pkt->hard; 210 struct arc_hardware *hard = &pkt->hard;
211 int ofs; 211 int ofs;
212 212
213 BUGMSG(D_DURING, "prepare_tx: txbufs=%d/%d/%d\n", 213 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
214 lp->next_tx, lp->cur_tx, bufnum); 214 lp->next_tx, lp->cur_tx, bufnum);
215 215
216 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */ 216 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */
217 217
218 if (length > XMTU) { 218 if (length > XMTU) {
219 /* should never happen! other people already check for this. */ 219 /* should never happen! other people already check for this. */
220 BUGMSG(D_NORMAL, "Bug! prepare_tx with size %d (> %d)\n", 220 arc_printk(D_NORMAL, dev, "Bug! prepare_tx with size %d (> %d)\n",
221 length, XMTU); 221 length, XMTU);
222 length = XMTU; 222 length = XMTU;
223 } 223 }
224 if (length > MinTU) { 224 if (length > MinTU) {
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c
index d052976ebdfa..97af7d92c020 100644
--- a/drivers/net/arcnet/rfc1201.c
+++ b/drivers/net/arcnet/rfc1201.c
@@ -136,7 +136,8 @@ static void rx(struct net_device *dev, int bufnum,
136 int saddr = pkt->hard.source, ofs; 136 int saddr = pkt->hard.source, ofs;
137 struct Incoming *in = &lp->rfc1201.incoming[saddr]; 137 struct Incoming *in = &lp->rfc1201.incoming[saddr];
138 138
139 BUGMSG(D_DURING, "it's an RFC1201 packet (length=%d)\n", length); 139 arc_printk(D_DURING, dev, "it's an RFC1201 packet (length=%d)\n",
140 length);
140 141
141 if (length >= MinTU) 142 if (length >= MinTU)
142 ofs = 512 - length; 143 ofs = 512 - length;
@@ -145,10 +146,10 @@ static void rx(struct net_device *dev, int bufnum,
145 146
146 if (soft->split_flag == 0xFF) { /* Exception Packet */ 147 if (soft->split_flag == 0xFF) { /* Exception Packet */
147 if (length >= 4 + RFC1201_HDR_SIZE) { 148 if (length >= 4 + RFC1201_HDR_SIZE) {
148 BUGMSG(D_DURING, "compensating for exception packet\n"); 149 arc_printk(D_DURING, dev, "compensating for exception packet\n");
149 } else { 150 } else {
150 BUGMSG(D_EXTRA, "short RFC1201 exception packet from %02Xh", 151 arc_printk(D_EXTRA, dev, "short RFC1201 exception packet from %02Xh",
151 saddr); 152 saddr);
152 return; 153 return;
153 } 154 }
154 155
@@ -159,12 +160,13 @@ static void rx(struct net_device *dev, int bufnum,
159 soft, sizeof(pkt->soft)); 160 soft, sizeof(pkt->soft));
160 } 161 }
161 if (!soft->split_flag) { /* not split */ 162 if (!soft->split_flag) { /* not split */
162 BUGMSG(D_RX, "incoming is not split (splitflag=%d)\n", 163 arc_printk(D_RX, dev, "incoming is not split (splitflag=%d)\n",
163 soft->split_flag); 164 soft->split_flag);
164 165
165 if (in->skb) { /* already assembling one! */ 166 if (in->skb) { /* already assembling one! */
166 BUGMSG(D_EXTRA, "aborting assembly (seq=%d) for unsplit packet (splitflag=%d, seq=%d)\n", 167 arc_printk(D_EXTRA, dev, "aborting assembly (seq=%d) for unsplit packet (splitflag=%d, seq=%d)\n",
167 in->sequence, soft->split_flag, soft->sequence); 168 in->sequence, soft->split_flag,
169 soft->sequence);
168 lp->rfc1201.aborted_seq = soft->sequence; 170 lp->rfc1201.aborted_seq = soft->sequence;
169 dev_kfree_skb_irq(in->skb); 171 dev_kfree_skb_irq(in->skb);
170 dev->stats.rx_errors++; 172 dev->stats.rx_errors++;
@@ -175,7 +177,7 @@ static void rx(struct net_device *dev, int bufnum,
175 177
176 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); 178 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
177 if (skb == NULL) { 179 if (skb == NULL) {
178 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); 180 arc_printk(D_NORMAL, dev, "Memory squeeze, dropping packet\n");
179 dev->stats.rx_dropped++; 181 dev->stats.rx_dropped++;
180 return; 182 return;
181 } 183 }
@@ -205,18 +207,18 @@ static void rx(struct net_device *dev, int bufnum,
205 uint8_t *cptr = (uint8_t *)arp + sizeof(struct arphdr); 207 uint8_t *cptr = (uint8_t *)arp + sizeof(struct arphdr);
206 208
207 if (!*cptr) { /* is saddr = 00? */ 209 if (!*cptr) { /* is saddr = 00? */
208 BUGMSG(D_EXTRA, 210 arc_printk(D_EXTRA, dev,
209 "ARP source address was 00h, set to %02Xh.\n", 211 "ARP source address was 00h, set to %02Xh\n",
210 saddr); 212 saddr);
211 dev->stats.rx_crc_errors++; 213 dev->stats.rx_crc_errors++;
212 *cptr = saddr; 214 *cptr = saddr;
213 } else { 215 } else {
214 BUGMSG(D_DURING, "ARP source address (%Xh) is fine.\n", 216 arc_printk(D_DURING, dev, "ARP source address (%Xh) is fine.\n",
215 *cptr); 217 *cptr);
216 } 218 }
217 } else { 219 } else {
218 BUGMSG(D_NORMAL, "funny-shaped ARP packet. (%Xh, %Xh)\n", 220 arc_printk(D_NORMAL, dev, "funny-shaped ARP packet. (%Xh, %Xh)\n",
219 arp->ar_hln, arp->ar_pln); 221 arp->ar_hln, arp->ar_pln);
220 dev->stats.rx_errors++; 222 dev->stats.rx_errors++;
221 dev->stats.rx_crc_errors++; 223 dev->stats.rx_crc_errors++;
222 } 224 }
@@ -245,13 +247,13 @@ static void rx(struct net_device *dev, int bufnum,
245 * other way to be reliable. 247 * other way to be reliable.
246 */ 248 */
247 249
248 BUGMSG(D_RX, "packet is split (splitflag=%d, seq=%d)\n", 250 arc_printk(D_RX, dev, "packet is split (splitflag=%d, seq=%d)\n",
249 soft->split_flag, in->sequence); 251 soft->split_flag, in->sequence);
250 252
251 if (in->skb && in->sequence != soft->sequence) { 253 if (in->skb && in->sequence != soft->sequence) {
252 BUGMSG(D_EXTRA, "wrong seq number (saddr=%d, expected=%d, seq=%d, splitflag=%d)\n", 254 arc_printk(D_EXTRA, dev, "wrong seq number (saddr=%d, expected=%d, seq=%d, splitflag=%d)\n",
253 saddr, in->sequence, soft->sequence, 255 saddr, in->sequence, soft->sequence,
254 soft->split_flag); 256 soft->split_flag);
255 dev_kfree_skb_irq(in->skb); 257 dev_kfree_skb_irq(in->skb);
256 in->skb = NULL; 258 in->skb = NULL;
257 dev->stats.rx_errors++; 259 dev->stats.rx_errors++;
@@ -259,12 +261,12 @@ static void rx(struct net_device *dev, int bufnum,
259 in->lastpacket = in->numpackets = 0; 261 in->lastpacket = in->numpackets = 0;
260 } 262 }
261 if (soft->split_flag & 1) { /* first packet in split */ 263 if (soft->split_flag & 1) { /* first packet in split */
262 BUGMSG(D_RX, "brand new splitpacket (splitflag=%d)\n", 264 arc_printk(D_RX, dev, "brand new splitpacket (splitflag=%d)\n",
263 soft->split_flag); 265 soft->split_flag);
264 if (in->skb) { /* already assembling one! */ 266 if (in->skb) { /* already assembling one! */
265 BUGMSG(D_EXTRA, "aborting previous (seq=%d) assembly (splitflag=%d, seq=%d)\n", 267 arc_printk(D_EXTRA, dev, "aborting previous (seq=%d) assembly (splitflag=%d, seq=%d)\n",
266 in->sequence, soft->split_flag, 268 in->sequence, soft->split_flag,
267 soft->sequence); 269 soft->sequence);
268 dev->stats.rx_errors++; 270 dev->stats.rx_errors++;
269 dev->stats.rx_missed_errors++; 271 dev->stats.rx_missed_errors++;
270 dev_kfree_skb_irq(in->skb); 272 dev_kfree_skb_irq(in->skb);
@@ -274,8 +276,8 @@ static void rx(struct net_device *dev, int bufnum,
274 in->lastpacket = 1; 276 in->lastpacket = 1;
275 277
276 if (in->numpackets > 16) { 278 if (in->numpackets > 16) {
277 BUGMSG(D_EXTRA, "incoming packet more than 16 segments; dropping. (splitflag=%d)\n", 279 arc_printk(D_EXTRA, dev, "incoming packet more than 16 segments; dropping. (splitflag=%d)\n",
278 soft->split_flag); 280 soft->split_flag);
279 lp->rfc1201.aborted_seq = soft->sequence; 281 lp->rfc1201.aborted_seq = soft->sequence;
280 dev->stats.rx_errors++; 282 dev->stats.rx_errors++;
281 dev->stats.rx_length_errors++; 283 dev->stats.rx_length_errors++;
@@ -284,7 +286,7 @@ static void rx(struct net_device *dev, int bufnum,
284 in->skb = skb = alloc_skb(508 * in->numpackets + ARC_HDR_SIZE, 286 in->skb = skb = alloc_skb(508 * in->numpackets + ARC_HDR_SIZE,
285 GFP_ATOMIC); 287 GFP_ATOMIC);
286 if (skb == NULL) { 288 if (skb == NULL) {
287 BUGMSG(D_NORMAL, "(split) memory squeeze, dropping packet.\n"); 289 arc_printk(D_NORMAL, dev, "(split) memory squeeze, dropping packet.\n");
288 lp->rfc1201.aborted_seq = soft->sequence; 290 lp->rfc1201.aborted_seq = soft->sequence;
289 dev->stats.rx_dropped++; 291 dev->stats.rx_dropped++;
290 return; 292 return;
@@ -305,9 +307,10 @@ static void rx(struct net_device *dev, int bufnum,
305 */ 307 */
306 if (!in->skb) { 308 if (!in->skb) {
307 if (lp->rfc1201.aborted_seq != soft->sequence) { 309 if (lp->rfc1201.aborted_seq != soft->sequence) {
308 BUGMSG(D_EXTRA, "can't continue split without starting first! (splitflag=%d, seq=%d, aborted=%d)\n", 310 arc_printk(D_EXTRA, dev, "can't continue split without starting first! (splitflag=%d, seq=%d, aborted=%d)\n",
309 soft->split_flag, soft->sequence, 311 soft->split_flag,
310 lp->rfc1201.aborted_seq); 312 soft->sequence,
313 lp->rfc1201.aborted_seq);
311 dev->stats.rx_errors++; 314 dev->stats.rx_errors++;
312 dev->stats.rx_missed_errors++; 315 dev->stats.rx_missed_errors++;
313 } 316 }
@@ -317,15 +320,16 @@ static void rx(struct net_device *dev, int bufnum,
317 if (packetnum != in->lastpacket) { /* not the right flag! */ 320 if (packetnum != in->lastpacket) { /* not the right flag! */
318 /* harmless duplicate? ignore. */ 321 /* harmless duplicate? ignore. */
319 if (packetnum <= in->lastpacket - 1) { 322 if (packetnum <= in->lastpacket - 1) {
320 BUGMSG(D_EXTRA, "duplicate splitpacket ignored! (splitflag=%d)\n", 323 arc_printk(D_EXTRA, dev, "duplicate splitpacket ignored! (splitflag=%d)\n",
321 soft->split_flag); 324 soft->split_flag);
322 dev->stats.rx_errors++; 325 dev->stats.rx_errors++;
323 dev->stats.rx_frame_errors++; 326 dev->stats.rx_frame_errors++;
324 return; 327 return;
325 } 328 }
326 /* "bad" duplicate, kill reassembly */ 329 /* "bad" duplicate, kill reassembly */
327 BUGMSG(D_EXTRA, "out-of-order splitpacket, reassembly (seq=%d) aborted (splitflag=%d, seq=%d)\n", 330 arc_printk(D_EXTRA, dev, "out-of-order splitpacket, reassembly (seq=%d) aborted (splitflag=%d, seq=%d)\n",
328 in->sequence, soft->split_flag, soft->sequence); 331 in->sequence, soft->split_flag,
332 soft->sequence);
329 lp->rfc1201.aborted_seq = soft->sequence; 333 lp->rfc1201.aborted_seq = soft->sequence;
330 dev_kfree_skb_irq(in->skb); 334 dev_kfree_skb_irq(in->skb);
331 in->skb = NULL; 335 in->skb = NULL;
@@ -350,10 +354,10 @@ static void rx(struct net_device *dev, int bufnum,
350 in->skb = NULL; 354 in->skb = NULL;
351 in->lastpacket = in->numpackets = 0; 355 in->lastpacket = in->numpackets = 0;
352 356
353 BUGMSG(D_SKB_SIZE, "skb: received %d bytes from %02X (unsplit)\n", 357 arc_printk(D_SKB_SIZE, dev, "skb: received %d bytes from %02X (unsplit)\n",
354 skb->len, pkt->hard.source); 358 skb->len, pkt->hard.source);
355 BUGMSG(D_SKB_SIZE, "skb: received %d bytes from %02X (split)\n", 359 arc_printk(D_SKB_SIZE, dev, "skb: received %d bytes from %02X (split)\n",
356 skb->len, pkt->hard.source); 360 skb->len, pkt->hard.source);
357 if (BUGLVL(D_SKB)) 361 if (BUGLVL(D_SKB))
358 arcnet_dump_skb(dev, skb, "rx"); 362 arcnet_dump_skb(dev, skb, "rx");
359 363
@@ -395,8 +399,8 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
395 soft->proto = ARC_P_ATALK; 399 soft->proto = ARC_P_ATALK;
396 break; 400 break;
397 default: 401 default:
398 BUGMSG(D_NORMAL, "RFC1201: I don't understand protocol %d (%Xh)\n", 402 arc_printk(D_NORMAL, dev, "RFC1201: I don't understand protocol %d (%Xh)\n",
399 type, type); 403 type, type);
400 dev->stats.tx_errors++; 404 dev->stats.tx_errors++;
401 dev->stats.tx_aborted_errors++; 405 dev->stats.tx_aborted_errors++;
402 return 0; 406 return 0;
@@ -469,8 +473,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
469 const int maxsegsize = XMTU - RFC1201_HDR_SIZE; 473 const int maxsegsize = XMTU - RFC1201_HDR_SIZE;
470 struct Outgoing *out; 474 struct Outgoing *out;
471 475
472 BUGMSG(D_DURING, "prepare_tx: txbufs=%d/%d/%d\n", 476 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
473 lp->next_tx, lp->cur_tx, bufnum); 477 lp->next_tx, lp->cur_tx, bufnum);
474 478
475 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */ 479 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */
476 pkt->soft.rfc1201.split_flag = 0; 480 pkt->soft.rfc1201.split_flag = 0;
@@ -484,9 +488,9 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
484 out->numsegs = (out->dataleft + maxsegsize - 1) / maxsegsize; 488 out->numsegs = (out->dataleft + maxsegsize - 1) / maxsegsize;
485 out->segnum = 0; 489 out->segnum = 0;
486 490
487 BUGMSG(D_DURING, "rfc1201 prep_tx: ready for %d-segment split (%d bytes, seq=%d)\n", 491 arc_printk(D_DURING, dev, "rfc1201 prep_tx: ready for %d-segment split (%d bytes, seq=%d)\n",
488 out->numsegs, out->length, 492 out->numsegs, out->length,
489 pkt->soft.rfc1201.sequence); 493 pkt->soft.rfc1201.sequence);
490 494
491 return 0; /* not done */ 495 return 0; /* not done */
492 } 496 }
@@ -505,9 +509,9 @@ static int continue_tx(struct net_device *dev, int bufnum)
505 int maxsegsize = XMTU - RFC1201_HDR_SIZE; 509 int maxsegsize = XMTU - RFC1201_HDR_SIZE;
506 int seglen; 510 int seglen;
507 511
508 BUGMSG(D_DURING, 512 arc_printk(D_DURING, dev,
509 "rfc1201 continue_tx: loading segment %d(+1) of %d (seq=%d)\n", 513 "rfc1201 continue_tx: loading segment %d(+1) of %d (seq=%d)\n",
510 out->segnum, out->numsegs, soft->sequence); 514 out->segnum, out->numsegs, soft->sequence);
511 515
512 /* the "new" soft header comes right before the data chunk */ 516 /* the "new" soft header comes right before the data chunk */
513 newsoft = (struct arc_rfc1201 *) 517 newsoft = (struct arc_rfc1201 *)