SIOCSHWTSTAMP returns the real configuration to the application using it, but there is currently no way for any other application to find out the configuration non-destructively. Add a new ioctl for this, making it unprivileged.
Showing the changes to include/uapi/linux (2 of 5 files). Show all
Unified · Split
| @@ -26,17 +26,17 @@ enum { · 25 unmodified lines | |||
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * struct hwtstamp_config - %SIOCSHWTSTAMP parameter | 29 | * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter |
| 30 | * | 30 | * |
| 31 | * @flags: no flags defined right now, must be zero | 31 | * @flags: no flags defined right now, must be zero for %SIOCSHWTSTAMP |
| 32 | * @tx_type: one of HWTSTAMP_TX_* | 32 | * @tx_type: one of HWTSTAMP_TX_* |
| 33 | * @rx_filter: one of HWTSTAMP_FILTER_* | 33 | * @rx_filter: one of HWTSTAMP_FILTER_* |
| 34 | * | 34 | * |
| 35 | * %SIOCSHWTSTAMP expects a &struct ifreq with a ifr_data pointer to | 35 | * %SIOCGHWTSTAMP and %SIOCSHWTSTAMP expect a &struct ifreq with a |
| 36 | * this structure. If the driver or hardware does not support the | 36 | * ifr_data pointer to this structure. For %SIOCSHWTSTAMP, if the |
| 37 | * requested @rx_filter value, the driver may use a more general | 37 | * driver or hardware does not support the requested @rx_filter value, |
| 38 | * filter mode. In this case @rx_filter will indicate the actual mode | 38 | * the driver may use a more general filter mode. In this case |
| 39 | * on return. | 39 | * @rx_filter will indicate the actual mode on return. |
| 40 | */ | 40 | */ |
| 41 | struct hwtstamp_config { | 41 | struct hwtstamp_config { |
| 42 | int flags; | 42 | int flags; |
| @@ -125,7 +125,8 @@ · 124 unmodified lines | |||
| 125 | #define SIOCBRDELIF 0x89a3 /* remove interface from bridge */ | 125 | #define SIOCBRDELIF 0x89a3 /* remove interface from bridge */ |
| 126 | 126 | ||
| 127 | /* hardware time stamping: parameters in linux/net_tstamp.h */ | 127 | /* hardware time stamping: parameters in linux/net_tstamp.h */ |
| 128 | #define SIOCSHWTSTAMP 0x89b0 | 128 | #define SIOCSHWTSTAMP 0x89b0 /* set and get config */ |
| 129 | #define SIOCGHWTSTAMP 0x89b1 /* get config */ | ||
| 129 | 130 | ||
| 130 | /* Device private ioctl calls */ | 131 | /* Device private ioctl calls */ |
| 131 | 132 | ||