@@ -116,9 +116,15 @@ static const char version[] =
116
116
117
117
static int apne_owned ; /* signal if card already owned */
118
118
119
+ static u32 apne_msg_enable ;
120
+ module_param_named (msg_enable , apne_msg_enable , uint , (S_IRUSR |S_IRGRP |S_IROTH ));
121
+ MODULE_PARM_DESC (msg_enable , "Debug message level (see linux/netdevice.h for bitmap)" );
122
+
119
123
struct net_device * __init apne_probe (int unit )
120
124
{
121
125
struct net_device * dev ;
126
+ struct ei_device * ei_local ;
127
+
122
128
#ifndef MANUAL_CONFIG
123
129
char tuple [8 ];
124
130
#endif
@@ -133,11 +139,11 @@ struct net_device * __init apne_probe(int unit)
133
139
if ( !(AMIGAHW_PRESENT (PCMCIA )) )
134
140
return ERR_PTR (- ENODEV );
135
141
136
- printk ("Looking for PCMCIA ethernet card : " );
142
+ pr_info ("Looking for PCMCIA ethernet card : " );
137
143
138
144
/* check if a card is inserted */
139
145
if (!(PCMCIA_INSERTED )) {
140
- printk ("NO PCMCIA card inserted\n" );
146
+ pr_cont ("NO PCMCIA card inserted\n" );
141
147
return ERR_PTR (- ENODEV );
142
148
}
143
149
@@ -148,21 +154,23 @@ struct net_device * __init apne_probe(int unit)
148
154
sprintf (dev -> name , "eth%d" , unit );
149
155
netdev_boot_setup_check (dev );
150
156
}
157
+ ei_local = netdev_priv (dev );
158
+ ei_local -> msg_enable = apne_msg_enable ;
151
159
152
160
/* disable pcmcia irq for readtuple */
153
161
pcmcia_disable_irq ();
154
162
155
163
#ifndef MANUAL_CONFIG
156
164
if ((pcmcia_copy_tuple (CISTPL_FUNCID , tuple , 8 ) < 3 ) ||
157
165
(tuple [2 ] != CISTPL_FUNCID_NETWORK )) {
158
- printk ("not an ethernet card\n" );
166
+ pr_cont ("not an ethernet card\n" );
159
167
/* XXX: shouldn't we re-enable irq here? */
160
168
free_netdev (dev );
161
169
return ERR_PTR (- ENODEV );
162
170
}
163
171
#endif
164
172
165
- printk ("ethernet PCMCIA card inserted\n" );
173
+ pr_cont ("ethernet PCMCIA card inserted\n" );
166
174
167
175
if (!init_pcmcia ()) {
168
176
/* XXX: shouldn't we re-enable irq here? */
@@ -204,11 +212,12 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
204
212
int neX000 , ctron ;
205
213
#endif
206
214
static unsigned version_printed ;
215
+ struct ei_device * ei_local = netdev_priv (dev );
207
216
208
- if (ei_debug && version_printed ++ == 0 )
209
- printk ( version );
217
+ if (( apne_msg_enable & NETIF_MSG_DRV ) && ( version_printed ++ == 0 ) )
218
+ netdev_info ( dev , version );
210
219
211
- printk ( "PCMCIA NE*000 ethercard probe" );
220
+ netdev_info ( dev , "PCMCIA NE*000 ethercard probe" );
212
221
213
222
/* Reset card. Who knows what dain-bramaged state it was left in. */
214
223
{ unsigned long reset_start_time = jiffies ;
@@ -217,7 +226,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
217
226
218
227
while ((inb (ioaddr + NE_EN0_ISR ) & ENISR_RESET ) == 0 )
219
228
if (time_after (jiffies , reset_start_time + 2 * HZ /100 )) {
220
- printk (" not found (no reset ack).\n" );
229
+ pr_cont (" not found (no reset ack).\n" );
221
230
return - ENODEV ;
222
231
}
223
232
@@ -288,7 +297,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
288
297
start_page = 0x01 ;
289
298
stop_page = (wordlength == 2 ) ? 0x40 : 0x20 ;
290
299
} else {
291
- printk (" not found.\n" );
300
+ pr_cont (" not found.\n" );
292
301
return - ENXIO ;
293
302
294
303
}
@@ -320,9 +329,9 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
320
329
for (i = 0 ; i < ETH_ALEN ; i ++ )
321
330
dev -> dev_addr [i ] = SA_prom [i ];
322
331
323
- printk (" %pM\n" , dev -> dev_addr );
332
+ pr_cont (" %pM\n" , dev -> dev_addr );
324
333
325
- printk ( "%s: %s found.\n" , dev -> name , name );
334
+ netdev_info ( dev , "%s found.\n" , name );
326
335
327
336
ei_status .name = name ;
328
337
ei_status .tx_start_page = start_page ;
@@ -352,10 +361,11 @@ static void
352
361
apne_reset_8390 (struct net_device * dev )
353
362
{
354
363
unsigned long reset_start_time = jiffies ;
364
+ struct ei_device * ei_local = netdev_priv (dev );
355
365
356
366
init_pcmcia ();
357
367
358
- if ( ei_debug > 1 ) printk ( "resetting the 8390 t=%ld..." , jiffies );
368
+ netif_dbg ( ei_local , hw , dev , "resetting the 8390 t=%ld...\n " , jiffies );
359
369
360
370
outb (inb (NE_BASE + NE_RESET ), NE_BASE + NE_RESET );
361
371
@@ -365,8 +375,8 @@ apne_reset_8390(struct net_device *dev)
365
375
/* This check _should_not_ be necessary, omit eventually. */
366
376
while ((inb (NE_BASE + NE_EN0_ISR ) & ENISR_RESET ) == 0 )
367
377
if (time_after (jiffies , reset_start_time + 2 * HZ /100 )) {
368
- printk ( "%s: ne_reset_8390() did not complete.\n", dev -> name );
369
- break ;
378
+ netdev_err ( dev , " ne_reset_8390() did not complete.\n" );
379
+ break ;
370
380
}
371
381
outb (ENISR_RESET , NE_BASE + NE_EN0_ISR ); /* Ack intr. */
372
382
}
@@ -386,9 +396,9 @@ apne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_pa
386
396
387
397
/* This *shouldn't* happen. If it does, it's the last thing you'll see */
388
398
if (ei_status .dmaing ) {
389
- printk ( "%s: DMAing conflict in ne_get_8390_hdr "
390
- "[DMAstat:%d][irqlock:%d][intr:%d].\n" ,
391
- dev -> name , ei_status .dmaing , ei_status .irqlock , dev -> irq );
399
+ netdev_err ( dev , " DMAing conflict in ne_get_8390_hdr "
400
+ "[DMAstat:%d][irqlock:%d][intr:%d].\n" ,
401
+ ei_status .dmaing , ei_status .irqlock , dev -> irq );
392
402
return ;
393
403
}
394
404
@@ -433,9 +443,9 @@ apne_block_input(struct net_device *dev, int count, struct sk_buff *skb, int rin
433
443
434
444
/* This *shouldn't* happen. If it does, it's the last thing you'll see */
435
445
if (ei_status .dmaing ) {
436
- printk ( "%s: DMAing conflict in ne_block_input "
437
- "[DMAstat:%d][irqlock:%d][intr:%d].\n" ,
438
- dev -> name , ei_status .dmaing , ei_status .irqlock , dev -> irq );
446
+ netdev_err ( dev , " DMAing conflict in ne_block_input "
447
+ "[DMAstat:%d][irqlock:%d][intr:%d].\n" ,
448
+ ei_status .dmaing , ei_status .irqlock , dev -> irq );
439
449
return ;
440
450
}
441
451
ei_status .dmaing |= 0x01 ;
@@ -481,9 +491,9 @@ apne_block_output(struct net_device *dev, int count,
481
491
482
492
/* This *shouldn't* happen. If it does, it's the last thing you'll see */
483
493
if (ei_status .dmaing ) {
484
- printk ( "%s: DMAing conflict in ne_block_output."
485
- "[DMAstat:%d][irqlock:%d][intr:%d]\n" ,
486
- dev -> name , ei_status .dmaing , ei_status .irqlock , dev -> irq );
494
+ netdev_err ( dev , " DMAing conflict in ne_block_output."
495
+ "[DMAstat:%d][irqlock:%d][intr:%d]\n" ,
496
+ ei_status .dmaing , ei_status .irqlock , dev -> irq );
487
497
return ;
488
498
}
489
499
ei_status .dmaing |= 0x01 ;
@@ -513,7 +523,7 @@ apne_block_output(struct net_device *dev, int count,
513
523
514
524
while ((inb (NE_BASE + NE_EN0_ISR ) & ENISR_RDC ) == 0 )
515
525
if (time_after (jiffies , dma_start + 2 * HZ /100 )) { /* 20ms */
516
- printk ( "%s: timeout waiting for Tx RDC.\n", dev -> name );
526
+ netdev_warn ( dev , " timeout waiting for Tx RDC.\n" );
517
527
apne_reset_8390 (dev );
518
528
NS8390_init (dev ,1 );
519
529
break ;
@@ -536,8 +546,8 @@ static irqreturn_t apne_interrupt(int irq, void *dev_id)
536
546
pcmcia_ack_int (pcmcia_intreq );
537
547
return IRQ_NONE ;
538
548
}
539
- if (ei_debug > 3 )
540
- printk ("pcmcia intreq = %x\n" , pcmcia_intreq );
549
+ if (apne_msg_enable & NETIF_MSG_INTR )
550
+ pr_debug ("pcmcia intreq = %x\n" , pcmcia_intreq );
541
551
pcmcia_disable_irq (); /* to get rid of the sti() within ei_interrupt */
542
552
ei_interrupt (irq , dev_id );
543
553
pcmcia_ack_int (pcmcia_get_intreq ());
0 commit comments