Browse Source

Improve debugging output for legacy wrapper

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
7c76791730
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      src/drivers/net/legacy.c

+ 5
- 1
src/drivers/net/legacy.c View File

1
 #include <stdint.h>
1
 #include <stdint.h>
2
 #include <errno.h>
2
 #include <errno.h>
3
+#include <vsprintf.h>
3
 #include <gpxe/if_ether.h>
4
 #include <gpxe/if_ether.h>
4
 #include <gpxe/netdevice.h>
5
 #include <gpxe/netdevice.h>
5
 #include <gpxe/ethernet.h>
6
 #include <gpxe/ethernet.h>
25
 	struct ethhdr *ethhdr = pkb->data;
26
 	struct ethhdr *ethhdr = pkb->data;
26
 	int pad_len;
27
 	int pad_len;
27
 
28
 
29
+	DBG ( "Transmitting %d bytes\n", pkb_len ( pkb ) );
28
 	pad_len = ( ETH_ZLEN - pkb_len ( pkb ) );
30
 	pad_len = ( ETH_ZLEN - pkb_len ( pkb ) );
29
 	if ( pad_len > 0 )
31
 	if ( pad_len > 0 )
30
 		memset ( pkb_put ( pkb, pad_len ), 0, pad_len );
32
 		memset ( pkb_put ( pkb, pad_len ), 0, pad_len );
46
 
48
 
47
 	nic->packet = pkb->data;
49
 	nic->packet = pkb->data;
48
 	if ( nic->nic_op->poll ( nic, 1 ) ) {
50
 	if ( nic->nic_op->poll ( nic, 1 ) ) {
51
+		DBG ( "Received %d bytes\n", nic->packetlen );
49
 		pkb_put ( pkb, nic->packetlen );
52
 		pkb_put ( pkb, nic->packetlen );
50
 		netdev_rx ( netdev, pkb );
53
 		netdev_rx ( netdev, pkb );
51
 	} else {
54
 	} else {
87
 	}
90
 	}
88
 
91
 
89
 	/* Do not remove this message */
92
 	/* Do not remove this message */
90
-	printf ( "WARNING: Using legacy NIC wrapper\n" );
93
+	printf ( "WARNING: Using legacy NIC wrapper on %s\n",
94
+		 ethernet_protocol.ntoa ( nic.node_addr ) );
91
 
95
 
92
 	legacy_registered = 1;
96
 	legacy_registered = 1;
93
 	return 0;
97
 	return 0;

Loading…
Cancel
Save