diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-04 03:42:17 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-04 03:42:17 +0000 |
commit | 0d587a173c3ab39ea95719110d8e6791bd3dfbb1 (patch) | |
tree | 96b02527f41c9a14ec51ec7d631e3785930d9e8f /package/iwinfo/src/iwinfo_utils.c | |
parent | 83e6c14f82f6c2d9028f4ec9f4da943c0e524345 (diff) | |
download | upstream-0d587a173c3ab39ea95719110d8e6791bd3dfbb1.tar.gz upstream-0d587a173c3ab39ea95719110d8e6791bd3dfbb1.tar.bz2 upstream-0d587a173c3ab39ea95719110d8e6791bd3dfbb1.zip |
iwinfo: add initial hardware detection capabilities
SVN-Revision: 29421
Diffstat (limited to 'package/iwinfo/src/iwinfo_utils.c')
-rw-r--r-- | package/iwinfo/src/iwinfo_utils.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/package/iwinfo/src/iwinfo_utils.c b/package/iwinfo/src/iwinfo_utils.c index 081464aafa..b49447b072 100644 --- a/package/iwinfo/src/iwinfo_utils.c +++ b/package/iwinfo/src/iwinfo_utils.c @@ -124,3 +124,29 @@ void iwinfo_close(void) if( ioctl_socket > -1 ) close(ioctl_socket); } + +struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id) +{ + const struct iwinfo_hardware_entry *e; + + for (e = IWINFO_HARDWARE_ENTRIES; e->vendor_name; e++) + { + if ((e->vendor_id != 0xffff) && (e->vendor_id != id->vendor_id)) + continue; + + if ((e->device_id != 0xffff) && (e->device_id != id->device_id)) + continue; + + if ((e->subsystem_vendor_id != 0xffff) && + (e->subsystem_vendor_id != id->subsystem_vendor_id)) + continue; + + if ((e->subsystem_device_id != 0xffff) && + (e->subsystem_device_id != id->subsystem_device_id)) + continue; + + return e; + } + + return NULL; +} |