config: clock, port: convert 'boundary_clock_jbod' to the new scheme.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
This commit is contained in:
		
							parent
							
								
									eaa70f165f
								
							
						
					
					
						commit
						38c891b2c8
					
				
							
								
								
									
										15
									
								
								config.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								config.c
									
									
									
									
									
								
							| @ -93,6 +93,7 @@ struct config_item { | ||||
| struct config_item config_tab[] = { | ||||
| 	PORT_ITEM_INT("announceReceiptTimeout", 3, 2, UINT8_MAX), | ||||
| 	GLOB_ITEM_INT("assume_two_step", 0, 0, 1), | ||||
| 	PORT_ITEM_INT("boundary_clock_jbod", 0, 0, 1), | ||||
| 	GLOB_ITEM_INT("check_fup_sync", 0, 0, 1), | ||||
| 	PORT_ITEM_INT("delayAsymmetry", 0, INT_MIN, INT_MAX), | ||||
| 	PORT_ITEM_INT("delay_filter_length", 10, 1, INT_MAX), | ||||
| @ -310,7 +311,6 @@ static enum parser_result parse_port_setting(struct config *cfg, | ||||
| 					     struct interface *iface) | ||||
| { | ||||
| 	enum parser_result r; | ||||
| 	int val; | ||||
| 
 | ||||
| 	r = parse_pod_setting(option, value, &iface->pod); | ||||
| 	if (r != NOT_PARSED) | ||||
| @ -356,12 +356,6 @@ static enum parser_result parse_port_setting(struct config *cfg, | ||||
| 		else | ||||
| 			return BAD_VALUE; | ||||
| 
 | ||||
| 	} else if (!strcmp(option, "boundary_clock_jbod")) { | ||||
| 		r = get_ranged_int(value, &val, 0, 1); | ||||
| 		if (r != PARSED_OK) | ||||
| 			return r; | ||||
| 		iface->boundary_clock_jbod = val; | ||||
| 
 | ||||
| 	} else | ||||
| 		return parse_item(cfg, iface->name, option, value); | ||||
| 
 | ||||
| @ -606,12 +600,6 @@ static enum parser_result parse_global_setting(const char *option, | ||||
| 		else | ||||
| 			return BAD_VALUE; | ||||
| 
 | ||||
| 	} else if (!strcmp(option, "boundary_clock_jbod")) { | ||||
| 		r = get_ranged_int(value, &val, 0, 1); | ||||
| 		if (r != PARSED_OK) | ||||
| 			return r; | ||||
| 		cfg->dds.boundary_clock_jbod = val; | ||||
| 
 | ||||
| 	} else | ||||
| 		return parse_item(cfg, NULL, option, value); | ||||
| 
 | ||||
| @ -799,7 +787,6 @@ void config_init_interface(struct interface *iface, struct config *cfg) | ||||
| 	sk_get_ts_info(iface->name, &iface->ts_info); | ||||
| 
 | ||||
| 	iface->delay_filter = cfg->dds.delay_filter; | ||||
| 	iface->boundary_clock_jbod = cfg->dds.boundary_clock_jbod; | ||||
| } | ||||
| 
 | ||||
| int config_init(struct config *cfg) | ||||
|  | ||||
							
								
								
									
										1
									
								
								config.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								config.h
									
									
									
									
									
								
							| @ -41,7 +41,6 @@ struct interface { | ||||
| 	struct sk_ts_info ts_info; | ||||
| 	enum tsproc_mode tsproc_mode; | ||||
| 	enum filter_type delay_filter; | ||||
| 	int boundary_clock_jbod; | ||||
| }; | ||||
| 
 | ||||
| #define CFG_IGNORE_DM           (1 << 0) | ||||
|  | ||||
							
								
								
									
										1
									
								
								ds.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								ds.h
									
									
									
									
									
								
							| @ -61,7 +61,6 @@ struct default_ds { | ||||
| 	struct clock_description clock_desc; | ||||
| 	enum tsproc_mode tsproc_mode; | ||||
| 	enum filter_type delay_filter; | ||||
| 	int boundary_clock_jbod; | ||||
| }; | ||||
| 
 | ||||
| struct dataset { | ||||
|  | ||||
							
								
								
									
										4
									
								
								port.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								port.c
									
									
									
									
									
								
							| @ -2513,14 +2513,14 @@ struct port *port_open(int phc_index, | ||||
| 	memset(p, 0, sizeof(*p)); | ||||
| 
 | ||||
| 	p->phc_index = phc_index; | ||||
| 	p->jbod = interface->boundary_clock_jbod; | ||||
| 	p->jbod = config_get_int(cfg, interface->name, "boundary_clock_jbod"); | ||||
| 
 | ||||
| 	if (interface->transport == TRANS_UDS) | ||||
| 		; /* UDS cannot have a PHC. */ | ||||
| 	else if (!interface->ts_info.valid) | ||||
| 		pr_warning("port %d: get_ts_info not supported", number); | ||||
| 	else if (phc_index >= 0 && phc_index != interface->ts_info.phc_index) { | ||||
| 		if (interface->boundary_clock_jbod) { | ||||
| 		if (p->jbod) { | ||||
| 			pr_warning("port %d: just a bunch of devices", number); | ||||
| 			p->phc_index = interface->ts_info.phc_index; | ||||
| 		} else { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user