mirror of
				https://git.kernel.org/pub/scm/network/wireless/iwd.git
				synced 2025-10-31 04:57:25 +01:00 
			
		
		
		
	vendor_quirks: initial skeleton
This module will provide a database for known issues or quirks with wireless vendors. The vendor_quirks_append_for_oui() API is intended to be called from scan.c when parsing vendor attributes. This will lookup any quirks associated with the OUI provided and combine them into an existing vendor_quirk structure. This can be repeated against all the vendor OUI's seen in the scan then referenced later to alter IWD behavior. In the future more critera could be added such as MAC address prefix or more generalized IE matches e.g. vendor_quirks_append_for_mac() vendor_quirks_append_for_ie() etc.
This commit is contained in:
		
							parent
							
								
									088bb2e308
								
							
						
					
					
						commit
						a1247fe46e
					
				| @ -274,6 +274,8 @@ src_iwd_SOURCES = src/main.c linux/nl80211.h src/iwd.h \ | ||||
| 					src/dpp.c \
 | ||||
| 					src/udev.c \
 | ||||
| 					src/pmksa.h src/pmksa.c \
 | ||||
| 					src/vendor_quirks.h \
 | ||||
| 					src/vendor_quirks.c \
 | ||||
| 					$(eap_sources) \
 | ||||
| 					$(builtin_sources) | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										67
									
								
								src/vendor_quirks.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								src/vendor_quirks.c
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,67 @@ | ||||
| /*
 | ||||
|  * | ||||
|  *  Wireless daemon for Linux | ||||
|  * | ||||
|  *  Copyright (C) 2025  Locus Robotics Corporation. All rights reserved. | ||||
|  * | ||||
|  *  This library is free software; you can redistribute it and/or | ||||
|  *  modify it under the terms of the GNU Lesser General Public | ||||
|  *  License as published by the Free Software Foundation; either | ||||
|  *  version 2.1 of the License, or (at your option) any later version. | ||||
|  * | ||||
|  *  This library is distributed in the hope that it will be useful, | ||||
|  *  but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | ||||
|  *  Lesser General Public License for more details. | ||||
|  * | ||||
|  *  You should have received a copy of the GNU Lesser General Public | ||||
|  *  License along with this library; if not, write to the Free Software | ||||
|  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA | ||||
|  * | ||||
|  */ | ||||
| 
 | ||||
| #ifdef HAVE_CONFIG_H | ||||
| #include <config.h> | ||||
| #endif | ||||
| 
 | ||||
| #include <string.h> | ||||
| 
 | ||||
| #include <ell/ell.h> | ||||
| 
 | ||||
| #include "src/vendor_quirks.h" | ||||
| 
 | ||||
| static const struct { | ||||
| 	uint8_t oui[3]; | ||||
| 	struct vendor_quirk quirks; | ||||
| } oui_quirk_db[] = { | ||||
| 	{ } | ||||
| }; | ||||
| 
 | ||||
| void vendor_quirks_append_for_oui(const uint8_t *oui, | ||||
| 					struct vendor_quirk *quirks) | ||||
| { | ||||
| 	size_t i; | ||||
| 
 | ||||
| 	for (i = 0; i < L_ARRAY_SIZE(oui_quirk_db); i++) { | ||||
| 		const struct vendor_quirk *quirk = &oui_quirk_db[i].quirks; | ||||
| 
 | ||||
| 		if (memcmp(oui_quirk_db[i].oui, oui, 3)) | ||||
| 			continue; | ||||
| 
 | ||||
| 		quirks->ignore_bss_tm_candidates |= | ||||
| 				quirk->ignore_bss_tm_candidates; | ||||
| 		quirks->replay_counter_mismatch |= | ||||
| 				quirk->replay_counter_mismatch; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| const char *vendor_quirks_to_string(struct vendor_quirk quirks) | ||||
| { | ||||
| 	static char out[1024]; | ||||
| 	size_t s = 0; | ||||
| 
 | ||||
| 	if (!s) | ||||
| 		return NULL; | ||||
| 
 | ||||
| 	return out; | ||||
| } | ||||
							
								
								
									
										39
									
								
								src/vendor_quirks.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								src/vendor_quirks.h
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,39 @@ | ||||
| /*
 | ||||
|  * | ||||
|  *  Wireless daemon for Linux | ||||
|  * | ||||
|  *  Copyright (C) 2025  Locus Robotics Corporation. All rights reserved. | ||||
|  * | ||||
|  *  This library is free software; you can redistribute it and/or | ||||
|  *  modify it under the terms of the GNU Lesser General Public | ||||
|  *  License as published by the Free Software Foundation; either | ||||
|  *  version 2.1 of the License, or (at your option) any later version. | ||||
|  * | ||||
|  *  This library is distributed in the hope that it will be useful, | ||||
|  *  but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | ||||
|  *  Lesser General Public License for more details. | ||||
|  * | ||||
|  *  You should have received a copy of the GNU Lesser General Public | ||||
|  *  License along with this library; if not, write to the Free Software | ||||
|  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA | ||||
|  * | ||||
|  */ | ||||
| 
 | ||||
| #ifndef __IWD_VENDOR_QUIRKS_H | ||||
| #define __IWD_VENDOR_QUIRKS_H | ||||
| 
 | ||||
| 
 | ||||
| #include <stdint.h> | ||||
| 
 | ||||
| struct vendor_quirk { | ||||
| 	bool ignore_bss_tm_candidates : 1; | ||||
| 	bool replay_counter_mismatch : 1; | ||||
| }; | ||||
| 
 | ||||
| void vendor_quirks_append_for_oui(const uint8_t *oui, | ||||
| 					struct vendor_quirk *quirks); | ||||
| 
 | ||||
| const char *vendor_quirks_to_string(struct vendor_quirk quirks); | ||||
| 
 | ||||
| #endif /* __IWD_VENDOR_QUIRKS_H */ | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 James Prestwood
						James Prestwood