History

net_tstamp: Add SIOCGHWTSTAMP ioctl to match SIOCSHWTSTAMP

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.

Ben Hutchings committed 13 years ago

Commit fd468c71 parent 590d4695 files · +19 −10Browse files

Showing the changes to include/uapi/linux (2 of 5 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/net_tstamp.h +7 −7
  2. include/uapi/linux/sockios.h +2 −1
include/uapi/linux/net_tstamp.h+7−7
@@ -26,17 +26,17 @@ enum { · 25 unmodified lines
2626 };
2727
2828 /**
29− * struct hwtstamp_config - %SIOCSHWTSTAMP parameter
29+ * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
3030 *
31− * @flags: no flags defined right now, must be zero
31+ * @flags: no flags defined right now, must be zero for %SIOCSHWTSTAMP
3232 * @tx_type: one of HWTSTAMP_TX_*
3333 * @rx_filter: one of HWTSTAMP_FILTER_*
3434 *
35− * %SIOCSHWTSTAMP expects a &struct ifreq with a ifr_data pointer to
36− * this structure. If the driver or hardware does not support the
37− * requested @rx_filter value, the driver may use a more general
38− * filter mode. In this case @rx_filter will indicate the actual mode
39− * on return.
35+ * %SIOCGHWTSTAMP and %SIOCSHWTSTAMP expect a &struct ifreq with a
36+ * ifr_data pointer to this structure. For %SIOCSHWTSTAMP, if the
37+ * driver or hardware does not support the requested @rx_filter value,
38+ * the driver may use a more general filter mode. In this case
39+ * @rx_filter will indicate the actual mode on return.
4040 */
4141 struct hwtstamp_config {
4242 int flags;
include/uapi/linux/sockios.h+2−1
@@ -125,7 +125,8 @@ · 124 unmodified lines
125125 #define SIOCBRDELIF 0x89a3 /* remove interface from bridge */
126126
127127 /* 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 */
129130
130131 /* Device private ioctl calls */
131132