diff options
author | David Decotigny <decot@google.com> | 2011-04-27 14:32:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-29 17:01:29 -0400 |
commit | 36504605432996590f889e33d47e2d9c581f7569 (patch) | |
tree | 3bf2de6d3e789fe8eb1b9ced0d796861b0310175 /include | |
parent | 7e610caaa5b32d3be9216f040f178e4a23b678b2 (diff) |
ethtool: cosmetics: enforce const-ness in ethtool_cmd_speed
The 'ep' argument of ethtool_cmd_speed is not altered: advertise it in
protoype. +Indentation fix. Also add comments to advise using the
ethtool_cmd_speed API to get/set the link speed.
Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ethtool.h | 14 |
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 | ||
43 | static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep, | 49 | static 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 | ||
51 | static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep) | 57 | static 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 | } |