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. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
This commit is contained in:
		
					parent
					
						
							
								590d4693fb
							
						
					
				
			
			
				commit
				
					
						fd468c74bd
					
				
			
		
					 5 changed files with 19 additions and 10 deletions
				
			
		|  | @ -26,17 +26,17 @@ enum { | |||
| }; | ||||
| 
 | ||||
| /**
 | ||||
|  * struct hwtstamp_config - %SIOCSHWTSTAMP parameter | ||||
|  * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter | ||||
|  * | ||||
|  * @flags:	no flags defined right now, must be zero | ||||
|  * @flags:	no flags defined right now, must be zero for %SIOCSHWTSTAMP | ||||
|  * @tx_type:	one of HWTSTAMP_TX_* | ||||
|  * @rx_filter:	one of HWTSTAMP_FILTER_* | ||||
|  * | ||||
|  * %SIOCSHWTSTAMP expects a &struct ifreq with a ifr_data pointer to | ||||
|  * this structure.  If the driver or hardware does not support the | ||||
|  * requested @rx_filter value, the driver may use a more general | ||||
|  * filter mode.  In this case @rx_filter will indicate the actual mode | ||||
|  * on return. | ||||
|  * %SIOCGHWTSTAMP and %SIOCSHWTSTAMP expect a &struct ifreq with a | ||||
|  * ifr_data pointer to this structure.  For %SIOCSHWTSTAMP, if the | ||||
|  * driver or hardware does not support the requested @rx_filter value, | ||||
|  * the driver may use a more general filter mode.  In this case | ||||
|  * @rx_filter will indicate the actual mode on return. | ||||
|  */ | ||||
| struct hwtstamp_config { | ||||
| 	int flags; | ||||
|  |  | |||
|  | @ -125,7 +125,8 @@ | |||
| #define SIOCBRDELIF	0x89a3		/* remove interface from bridge */ | ||||
| 
 | ||||
| /* hardware time stamping: parameters in linux/net_tstamp.h */ | ||||
| #define SIOCSHWTSTAMP   0x89b0 | ||||
| #define SIOCSHWTSTAMP	0x89b0		/* set and get config		*/ | ||||
| #define SIOCGHWTSTAMP	0x89b1		/* get config			*/ | ||||
| 
 | ||||
| /* Device private ioctl calls */ | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ben Hutchings
				Ben Hutchings