netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.5.70] e100 report link speed via if_port
@ 2003-05-29 17:41 Stephen Hemminger
  2003-05-29 20:49 ` Jeff Garzik
  2003-05-29 21:08 ` David S. Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Stephen Hemminger @ 2003-05-29 17:41 UTC (permalink / raw)
  To: David S. Miller, Scott Feldman; +Cc: netdev

The e100 driver knows the link speed, but it is not visible through sysfs.
Small patch to update the net_device if_port when speed is detected;
this can then be read through /sys/class/net/eth0/if_port.

--- linux-2.5-incr/drivers/net/e100/e100_main.c	2003-05-29 09:52:35.000000000 -0700
+++ linux-2.5-sysfs/drivers/net/e100/e100_main.c	2003-05-29 08:56:47.000000000 -0700
@@ -1720,12 +1720,22 @@
 			       (bdp->cur_dplx_mode == HALF_DUPLEX) ?
 			       "Half" : "Full");
 
+			if (bdp->cur_line_speed == 10)
+				dev->if_port = IF_PORT_10BASET;
+			else if(bdp->cur_line_speed == 100) {
+				if (bdp->cur_dplx_mode == HALF_DUPLEX) 
+					dev->if_port = 	IF_PORT_100BASETX;
+				else
+					dev->if_port = IF_PORT_100BASEFX;
+			}
+
 			e100_config_fc(bdp);
 			e100_config(bdp);  
 
 		} else {
 			printk(KERN_ERR "e100: %s NIC Link is Down\n",
 			       bdp->device->name);
+			dev->if_port = IF_PORT_UNKNOWN;
 		}
 	}
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-05-30  3:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-29 17:41 [PATCH 2.5.70] e100 report link speed via if_port Stephen Hemminger
2003-05-29 20:49 ` Jeff Garzik
2003-05-29 21:08 ` David S. Miller
2003-05-29 21:28   ` [PATCH 2.5.70] remove if_port_text Stephen Hemminger
2003-05-29 21:39     ` Jeff Garzik
2003-05-29 21:48       ` David S. Miller
2003-05-29 22:07         ` Jeff Garzik
2003-05-30  3:15     ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).