aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ethtool.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 9de31274341d..7e6e0a89ca26 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -24,7 +24,10 @@ struct ethtool_cmd {
24 __u32 cmd; 24 __u32 cmd;
25 __u32 supported; /* Features this interface supports */ 25 __u32 supported; /* Features this interface supports */
26 __u32 advertising; /* Features this interface advertises */ 26 __u32 advertising; /* Features this interface advertises */
27 __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ 27 __u16 speed; /* The forced speed (lower bits) in
28 * Mbps. Please use
29 * ethtool_cmd_speed()/_set() to
30 * access it */
28 __u8 duplex; /* Duplex, half or full */ 31 __u8 duplex; /* Duplex, half or full */
29 __u8 port; /* Which connector port */ 32 __u8 port; /* Which connector port */
30 __u8 phy_address; 33 __u8 phy_address;
@@ -33,7 +36,10 @@ struct ethtool_cmd {
33 __u8 mdio_support; 36 __u8 mdio_support;
34 __u32 maxtxpkt; /* Tx pkts before generating tx int */ 37 __u32 maxtxpkt; /* Tx pkts before generating tx int */
35 __u32 maxrxpkt; /* Rx pkts before generating rx int */ 38 __u32 maxrxpkt; /* Rx pkts before generating rx int */
36 __u16 speed_hi; 39 __u16 speed_hi; /* The forced speed (upper
40 * bits) in Mbps. Please use
41 * ethtool_cmd_speed()/_set() to
42 * access it */
37 __u8 eth_tp_mdix; 43 __u8 eth_tp_mdix;
38 __u8 reserved2; 44 __u8 reserved2;
39 __u32 lp_advertising; /* Features the link partner advertises */ 45 __u32 lp_advertising; /* Features the link partner advertises */
@@ -41,14 +47,14 @@ struct ethtool_cmd {
41}; 47};
42 48
43static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep, 49static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
44 __u32 speed) 50 __u32 speed)
45{ 51{
46 52
47 ep->speed = (__u16)speed; 53 ep->speed = (__u16)speed;
48 ep->speed_hi = (__u16)(speed >> 16); 54 ep->speed_hi = (__u16)(speed >> 16);
49} 55}
50 56
51static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep) 57static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
52{ 58{
53 return (ep->speed_hi << 16) | ep->speed; 59 return (ep->speed_hi << 16) | ep->speed;
54} 60}