|
@@ -79,10 +79,10 @@ void netdev_link_err ( struct net_device *netdev, int rc ) {
|
79
|
79
|
/* Record link state */
|
80
|
80
|
netdev->link_rc = rc;
|
81
|
81
|
if ( netdev->link_rc == 0 ) {
|
82
|
|
- DBGC ( netdev, "NETDEV %p link is up\n", netdev );
|
|
82
|
+ DBGC ( netdev, "NETDEV %s link is up\n", netdev->name );
|
83
|
83
|
} else {
|
84
|
|
- DBGC ( netdev, "NETDEV %p link is down: %s\n",
|
85
|
|
- netdev, strerror ( netdev->link_rc ) );
|
|
84
|
+ DBGC ( netdev, "NETDEV %s link is down: %s\n",
|
|
85
|
+ netdev->name, strerror ( netdev->link_rc ) );
|
86
|
86
|
}
|
87
|
87
|
|
88
|
88
|
/* Notify drivers of link state change */
|
|
@@ -157,8 +157,8 @@ static void netdev_record_stat ( struct net_device_stats *stats, int rc ) {
|
157
|
157
|
int netdev_tx ( struct net_device *netdev, struct io_buffer *iobuf ) {
|
158
|
158
|
int rc;
|
159
|
159
|
|
160
|
|
- DBGC ( netdev, "NETDEV %p transmitting %p (%p+%zx)\n",
|
161
|
|
- netdev, iobuf, iobuf->data, iob_len ( iobuf ) );
|
|
160
|
+ DBGC ( netdev, "NETDEV %s transmitting %p (%p+%zx)\n",
|
|
161
|
+ netdev->name, iobuf, iobuf->data, iob_len ( iobuf ) );
|
162
|
162
|
|
163
|
163
|
/* Enqueue packet */
|
164
|
164
|
list_add_tail ( &iobuf->list, &netdev->tx_queue );
|
|
@@ -202,11 +202,11 @@ void netdev_tx_complete_err ( struct net_device *netdev,
|
202
|
202
|
/* Update statistics counter */
|
203
|
203
|
netdev_record_stat ( &netdev->tx_stats, rc );
|
204
|
204
|
if ( rc == 0 ) {
|
205
|
|
- DBGC ( netdev, "NETDEV %p transmission %p complete\n",
|
206
|
|
- netdev, iobuf );
|
|
205
|
+ DBGC ( netdev, "NETDEV %s transmission %p complete\n",
|
|
206
|
+ netdev->name, iobuf );
|
207
|
207
|
} else {
|
208
|
|
- DBGC ( netdev, "NETDEV %p transmission %p failed: %s\n",
|
209
|
|
- netdev, iobuf, strerror ( rc ) );
|
|
208
|
+ DBGC ( netdev, "NETDEV %s transmission %p failed: %s\n",
|
|
209
|
+ netdev->name, iobuf, strerror ( rc ) );
|
210
|
210
|
}
|
211
|
211
|
|
212
|
212
|
/* Catch data corruption as early as possible */
|
|
@@ -259,8 +259,8 @@ static void netdev_tx_flush ( struct net_device *netdev ) {
|
259
|
259
|
*/
|
260
|
260
|
void netdev_rx ( struct net_device *netdev, struct io_buffer *iobuf ) {
|
261
|
261
|
|
262
|
|
- DBGC ( netdev, "NETDEV %p received %p (%p+%zx)\n",
|
263
|
|
- netdev, iobuf, iobuf->data, iob_len ( iobuf ) );
|
|
262
|
+ DBGC ( netdev, "NETDEV %s received %p (%p+%zx)\n",
|
|
263
|
+ netdev->name, iobuf, iobuf->data, iob_len ( iobuf ) );
|
264
|
264
|
|
265
|
265
|
/* Discard packet (for test purposes) if applicable */
|
266
|
266
|
if ( ( NETDEV_DISCARD_RATE > 0 ) &&
|
|
@@ -291,8 +291,8 @@ void netdev_rx ( struct net_device *netdev, struct io_buffer *iobuf ) {
|
291
|
291
|
void netdev_rx_err ( struct net_device *netdev,
|
292
|
292
|
struct io_buffer *iobuf, int rc ) {
|
293
|
293
|
|
294
|
|
- DBGC ( netdev, "NETDEV %p failed to receive %p: %s\n",
|
295
|
|
- netdev, iobuf, strerror ( rc ) );
|
|
294
|
+ DBGC ( netdev, "NETDEV %s failed to receive %p: %s\n",
|
|
295
|
+ netdev->name, iobuf, strerror ( rc ) );
|
296
|
296
|
|
297
|
297
|
/* Discard packet */
|
298
|
298
|
free_iob ( iobuf );
|
|
@@ -414,23 +414,24 @@ int register_netdev ( struct net_device *netdev ) {
|
414
|
414
|
/* Add to device list */
|
415
|
415
|
netdev_get ( netdev );
|
416
|
416
|
list_add_tail ( &netdev->list, &net_devices );
|
417
|
|
- DBGC ( netdev, "NETDEV %p registered as %s (phys %s hwaddr %s)\n",
|
418
|
|
- netdev, netdev->name, netdev->dev->name,
|
|
417
|
+ DBGC ( netdev, "NETDEV %s registered (phys %s hwaddr %s)\n",
|
|
418
|
+ netdev->name, netdev->dev->name,
|
419
|
419
|
netdev_addr ( netdev ) );
|
420
|
420
|
|
421
|
421
|
/* Register per-netdev configuration settings */
|
422
|
422
|
if ( ( rc = register_settings ( netdev_settings ( netdev ),
|
423
|
423
|
NULL ) ) != 0 ) {
|
424
|
|
- DBGC ( netdev, "NETDEV %p could not register settings: %s\n",
|
425
|
|
- netdev, strerror ( rc ) );
|
|
424
|
+ DBGC ( netdev, "NETDEV %s could not register settings: %s\n",
|
|
425
|
+ netdev->name, strerror ( rc ) );
|
426
|
426
|
goto err_register_settings;
|
427
|
427
|
}
|
428
|
428
|
|
429
|
429
|
/* Probe device */
|
430
|
430
|
for_each_table_entry ( driver, NET_DRIVERS ) {
|
431
|
431
|
if ( ( rc = driver->probe ( netdev ) ) != 0 ) {
|
432
|
|
- DBGC ( netdev, "NETDEV %p could not add %s device: "
|
433
|
|
- "%s\n", netdev, driver->name, strerror ( rc ) );
|
|
432
|
+ DBGC ( netdev, "NETDEV %s could not add %s device: "
|
|
433
|
+ "%s\n", netdev->name, driver->name,
|
|
434
|
+ strerror ( rc ) );
|
434
|
435
|
goto err_probe;
|
435
|
436
|
}
|
436
|
437
|
}
|
|
@@ -458,7 +459,7 @@ int netdev_open ( struct net_device *netdev ) {
|
458
|
459
|
if ( netdev->state & NETDEV_OPEN )
|
459
|
460
|
return 0;
|
460
|
461
|
|
461
|
|
- DBGC ( netdev, "NETDEV %p opening\n", netdev );
|
|
462
|
+ DBGC ( netdev, "NETDEV %s opening\n", netdev->name );
|
462
|
463
|
|
463
|
464
|
/* Open the device */
|
464
|
465
|
if ( ( rc = netdev->op->open ( netdev ) ) != 0 )
|
|
@@ -487,7 +488,7 @@ void netdev_close ( struct net_device *netdev ) {
|
487
|
488
|
if ( ! ( netdev->state & NETDEV_OPEN ) )
|
488
|
489
|
return;
|
489
|
490
|
|
490
|
|
- DBGC ( netdev, "NETDEV %p closing\n", netdev );
|
|
491
|
+ DBGC ( netdev, "NETDEV %s closing\n", netdev->name );
|
491
|
492
|
|
492
|
493
|
/* Remove from open devices list */
|
493
|
494
|
list_del ( &netdev->open_list );
|
|
@@ -529,7 +530,7 @@ void unregister_netdev ( struct net_device *netdev ) {
|
529
|
530
|
/* Remove from device list */
|
530
|
531
|
list_del ( &netdev->list );
|
531
|
532
|
netdev_put ( netdev );
|
532
|
|
- DBGC ( netdev, "NETDEV %p unregistered\n", netdev );
|
|
533
|
+ DBGC ( netdev, "NETDEV %s unregistered\n", netdev->name );
|
533
|
534
|
}
|
534
|
535
|
|
535
|
536
|
/** Enable or disable interrupts
|
|
@@ -661,8 +662,8 @@ int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
|
661
|
662
|
ll_source );
|
662
|
663
|
}
|
663
|
664
|
|
664
|
|
- DBGC ( netdev, "NETDEV %p unknown network protocol %04x\n",
|
665
|
|
- netdev, ntohs ( net_proto ) );
|
|
665
|
+ DBGC ( netdev, "NETDEV %s unknown network protocol %04x\n",
|
|
666
|
+ netdev->name, ntohs ( net_proto ) );
|
666
|
667
|
free_iob ( iobuf );
|
667
|
668
|
return -ENOTSUP;
|
668
|
669
|
}
|
|
@@ -698,8 +699,8 @@ static void net_step ( struct process *process __unused ) {
|
698
|
699
|
*/
|
699
|
700
|
if ( ( iobuf = netdev_rx_dequeue ( netdev ) ) ) {
|
700
|
701
|
|
701
|
|
- DBGC ( netdev, "NETDEV %p processing %p (%p+%zx)\n",
|
702
|
|
- netdev, iobuf, iobuf->data,
|
|
702
|
+ DBGC ( netdev, "NETDEV %s processing %p (%p+%zx)\n",
|
|
703
|
+ netdev->name, iobuf, iobuf->data,
|
703
|
704
|
iob_len ( iobuf ) );
|
704
|
705
|
|
705
|
706
|
/* Remove link-layer header */
|