Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ethtool: Expand ethtool_cmd.speed to 32 bits

Introduce the speed_hi field to ethtool_cmd, using the reserved space,
to expand the speed field to 2^32 Megabits/second.

Making this field expansion now gives us plenty of time to fix up the
user-space pieces that use SIOCETHTOOL before hardware faster than 64
Gb/s is available.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Brandon Philips and committed by
Jeff Garzik
b11f8d8c 4f63135e

+16 -1
+16 -1
include/linux/ethtool.h
··· 27 27 __u8 autoneg; /* Enable or disable autonegotiation */ 28 28 __u32 maxtxpkt; /* Tx pkts before generating tx int */ 29 29 __u32 maxrxpkt; /* Rx pkts before generating rx int */ 30 - __u32 reserved[4]; 30 + __u16 speed_hi; 31 + __u16 reserved2; 32 + __u32 reserved[3]; 31 33 }; 34 + 35 + static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep, 36 + __u32 speed) 37 + { 38 + 39 + ep->speed = (__u16)speed; 40 + ep->speed_hi = (__u16)(speed >> 16); 41 + } 42 + 43 + static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep) 44 + { 45 + return (ep->speed_hi << 16) | ep->speed; 46 + } 32 47 33 48 #define ETHTOOL_BUSINFO_LEN 32 34 49 /* these strings are set to whatever the driver author decides... */