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
26};26};
27 27
28/**28/**
29 * struct hwtstamp_config - %SIOCSHWTSTAMP parameter29 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
30 *30 *
31 * @flags: no flags defined right now, must be zero31 * @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 to35 * %SIOCGHWTSTAMP and %SIOCSHWTSTAMP expect a &struct ifreq with a
36 * this structure. If the driver or hardware does not support the36 * ifr_data pointer to this structure. For %SIOCSHWTSTAMP, if the
37 * requested @rx_filter value, the driver may use a more general37 * driver or hardware does not support the requested @rx_filter value,
38 * filter mode. In this case @rx_filter will indicate the actual mode38 * 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 */
41struct hwtstamp_config {41struct hwtstamp_config {
42 int flags;42 int flags;
include/uapi/linux/sockios.h+2−1
@@ -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 0x89b0128#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