diff options
| author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2006-04-28 20:53:47 -0400 |
|---|---|---|
| committer | David Woodhouse <dwmw2@infradead.org> | 2006-04-28 20:53:47 -0400 |
| commit | c3ce7e203af5d8eab7c3390fc991a1fcb152f741 (patch) | |
| tree | 43b0837c42a1deb5b0f87800bf6a5ed8eea2eafe | |
| parent | 56142536868a2be34f261ed8fdca1610f8a73fbd (diff) | |
Sanitise ethtool.h and mii.h for userspace.
They shouldn't be using 'u32' et al in structures which are used for
communication with userspace. Switch to the proper types (__u32 etc).
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| -rw-r--r-- | include/linux/ethtool.h | 169 | ||||
| -rw-r--r-- | include/linux/mii.h | 30 |
2 files changed, 101 insertions, 98 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 93535f093216..cf2abeca92a0 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -15,24 +15,24 @@ | |||
| 15 | 15 | ||
| 16 | /* This should work for both 32 and 64 bit userland. */ | 16 | /* This should work for both 32 and 64 bit userland. */ |
| 17 | struct ethtool_cmd { | 17 | struct ethtool_cmd { |
| 18 | u32 cmd; | 18 | __u32 cmd; |
| 19 | u32 supported; /* Features this interface supports */ | 19 | __u32 supported; /* Features this interface supports */ |
| 20 | u32 advertising; /* Features this interface advertises */ | 20 | __u32 advertising; /* Features this interface advertises */ |
| 21 | u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ | 21 | __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ |
| 22 | u8 duplex; /* Duplex, half or full */ | 22 | __u8 duplex; /* Duplex, half or full */ |
| 23 | u8 port; /* Which connector port */ | 23 | __u8 port; /* Which connector port */ |
| 24 | u8 phy_address; | 24 | __u8 phy_address; |
| 25 | u8 transceiver; /* Which transceiver to use */ | 25 | __u8 transceiver; /* Which transceiver to use */ |
| 26 | u8 autoneg; /* Enable or disable autonegotiation */ | 26 | __u8 autoneg; /* Enable or disable autonegotiation */ |
| 27 | u32 maxtxpkt; /* Tx pkts before generating tx int */ | 27 | __u32 maxtxpkt; /* Tx pkts before generating tx int */ |
| 28 | u32 maxrxpkt; /* Rx pkts before generating rx int */ | 28 | __u32 maxrxpkt; /* Rx pkts before generating rx int */ |
| 29 | u32 reserved[4]; | 29 | __u32 reserved[4]; |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | #define ETHTOOL_BUSINFO_LEN 32 | 32 | #define ETHTOOL_BUSINFO_LEN 32 |
| 33 | /* these strings are set to whatever the driver author decides... */ | 33 | /* these strings are set to whatever the driver author decides... */ |
| 34 | struct ethtool_drvinfo { | 34 | struct ethtool_drvinfo { |
| 35 | u32 cmd; | 35 | __u32 cmd; |
| 36 | char driver[32]; /* driver short name, "tulip", "eepro100" */ | 36 | char driver[32]; /* driver short name, "tulip", "eepro100" */ |
| 37 | char version[32]; /* driver version string */ | 37 | char version[32]; /* driver version string */ |
| 38 | char fw_version[32]; /* firmware version string, if applicable */ | 38 | char fw_version[32]; /* firmware version string, if applicable */ |
| @@ -40,53 +40,53 @@ struct ethtool_drvinfo { | |||
| 40 | /* For PCI devices, use pci_name(pci_dev). */ | 40 | /* For PCI devices, use pci_name(pci_dev). */ |
| 41 | char reserved1[32]; | 41 | char reserved1[32]; |
| 42 | char reserved2[16]; | 42 | char reserved2[16]; |
| 43 | u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ | 43 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ |
| 44 | u32 testinfo_len; | 44 | __u32 testinfo_len; |
| 45 | u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ | 45 | __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ |
| 46 | u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ | 46 | __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | #define SOPASS_MAX 6 | 49 | #define SOPASS_MAX 6 |
| 50 | /* wake-on-lan settings */ | 50 | /* wake-on-lan settings */ |
| 51 | struct ethtool_wolinfo { | 51 | struct ethtool_wolinfo { |
| 52 | u32 cmd; | 52 | __u32 cmd; |
| 53 | u32 supported; | 53 | __u32 supported; |
| 54 | u32 wolopts; | 54 | __u32 wolopts; |
| 55 | u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */ | 55 | __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */ |
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| 58 | /* for passing single values */ | 58 | /* for passing single values */ |
| 59 | struct ethtool_value { | 59 | struct ethtool_value { |
| 60 | u32 cmd; | 60 | __u32 cmd; |
| 61 | u32 data; | 61 | __u32 data; |
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | /* for passing big chunks of data */ | 64 | /* for passing big chunks of data */ |
| 65 | struct ethtool_regs { | 65 | struct ethtool_regs { |
| 66 | u32 cmd; | 66 | __u32 cmd; |
| 67 | u32 version; /* driver-specific, indicates different chips/revs */ | 67 | __u32 version; /* driver-specific, indicates different chips/revs */ |
| 68 | u32 len; /* bytes */ | 68 | __u32 len; /* bytes */ |
| 69 | u8 data[0]; | 69 | __u8 data[0]; |
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | /* for passing EEPROM chunks */ | 72 | /* for passing EEPROM chunks */ |
| 73 | struct ethtool_eeprom { | 73 | struct ethtool_eeprom { |
| 74 | u32 cmd; | 74 | __u32 cmd; |
| 75 | u32 magic; | 75 | __u32 magic; |
| 76 | u32 offset; /* in bytes */ | 76 | __u32 offset; /* in bytes */ |
| 77 | u32 len; /* in bytes */ | 77 | __u32 len; /* in bytes */ |
| 78 | u8 data[0]; | 78 | __u8 data[0]; |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | /* for configuring coalescing parameters of chip */ | 81 | /* for configuring coalescing parameters of chip */ |
| 82 | struct ethtool_coalesce { | 82 | struct ethtool_coalesce { |
| 83 | u32 cmd; /* ETHTOOL_{G,S}COALESCE */ | 83 | __u32 cmd; /* ETHTOOL_{G,S}COALESCE */ |
| 84 | 84 | ||
| 85 | /* How many usecs to delay an RX interrupt after | 85 | /* How many usecs to delay an RX interrupt after |
| 86 | * a packet arrives. If 0, only rx_max_coalesced_frames | 86 | * a packet arrives. If 0, only rx_max_coalesced_frames |
| 87 | * is used. | 87 | * is used. |
| 88 | */ | 88 | */ |
| 89 | u32 rx_coalesce_usecs; | 89 | __u32 rx_coalesce_usecs; |
| 90 | 90 | ||
| 91 | /* How many packets to delay an RX interrupt after | 91 | /* How many packets to delay an RX interrupt after |
| 92 | * a packet arrives. If 0, only rx_coalesce_usecs is | 92 | * a packet arrives. If 0, only rx_coalesce_usecs is |
| @@ -94,21 +94,21 @@ struct ethtool_coalesce { | |||
| 94 | * to zero as this would cause RX interrupts to never be | 94 | * to zero as this would cause RX interrupts to never be |
| 95 | * generated. | 95 | * generated. |
| 96 | */ | 96 | */ |
| 97 | u32 rx_max_coalesced_frames; | 97 | __u32 rx_max_coalesced_frames; |
| 98 | 98 | ||
| 99 | /* Same as above two parameters, except that these values | 99 | /* Same as above two parameters, except that these values |
| 100 | * apply while an IRQ is being serviced by the host. Not | 100 | * apply while an IRQ is being serviced by the host. Not |
| 101 | * all cards support this feature and the values are ignored | 101 | * all cards support this feature and the values are ignored |
| 102 | * in that case. | 102 | * in that case. |
| 103 | */ | 103 | */ |
| 104 | u32 rx_coalesce_usecs_irq; | 104 | __u32 rx_coalesce_usecs_irq; |
| 105 | u32 rx_max_coalesced_frames_irq; | 105 | __u32 rx_max_coalesced_frames_irq; |
| 106 | 106 | ||
| 107 | /* How many usecs to delay a TX interrupt after | 107 | /* How many usecs to delay a TX interrupt after |
| 108 | * a packet is sent. If 0, only tx_max_coalesced_frames | 108 | * a packet is sent. If 0, only tx_max_coalesced_frames |
| 109 | * is used. | 109 | * is used. |
| 110 | */ | 110 | */ |
| 111 | u32 tx_coalesce_usecs; | 111 | __u32 tx_coalesce_usecs; |
| 112 | 112 | ||
| 113 | /* How many packets to delay a TX interrupt after | 113 | /* How many packets to delay a TX interrupt after |
| 114 | * a packet is sent. If 0, only tx_coalesce_usecs is | 114 | * a packet is sent. If 0, only tx_coalesce_usecs is |
| @@ -116,22 +116,22 @@ struct ethtool_coalesce { | |||
| 116 | * to zero as this would cause TX interrupts to never be | 116 | * to zero as this would cause TX interrupts to never be |
| 117 | * generated. | 117 | * generated. |
| 118 | */ | 118 | */ |
| 119 | u32 tx_max_coalesced_frames; | 119 | __u32 tx_max_coalesced_frames; |
| 120 | 120 | ||
| 121 | /* Same as above two parameters, except that these values | 121 | /* Same as above two parameters, except that these values |
| 122 | * apply while an IRQ is being serviced by the host. Not | 122 | * apply while an IRQ is being serviced by the host. Not |
| 123 | * all cards support this feature and the values are ignored | 123 | * all cards support this feature and the values are ignored |
| 124 | * in that case. | 124 | * in that case. |
| 125 | */ | 125 | */ |
| 126 | u32 tx_coalesce_usecs_irq; | 126 | __u32 tx_coalesce_usecs_irq; |
| 127 | u32 tx_max_coalesced_frames_irq; | 127 | __u32 tx_max_coalesced_frames_irq; |
| 128 | 128 | ||
| 129 | /* How many usecs to delay in-memory statistics | 129 | /* How many usecs to delay in-memory statistics |
| 130 | * block updates. Some drivers do not have an in-memory | 130 | * block updates. Some drivers do not have an in-memory |
| 131 | * statistic block, and in such cases this value is ignored. | 131 | * statistic block, and in such cases this value is ignored. |
| 132 | * This value must not be zero. | 132 | * This value must not be zero. |
| 133 | */ | 133 | */ |
| 134 | u32 stats_block_coalesce_usecs; | 134 | __u32 stats_block_coalesce_usecs; |
| 135 | 135 | ||
| 136 | /* Adaptive RX/TX coalescing is an algorithm implemented by | ||
