summaryrefslogtreecommitdiffstats
path: root/package/iwinfo
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-02-20 21:17:59 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-02-20 21:17:59 +0000
commitb888530e4121a6c463e27d87f85ccb59df414a46 (patch)
tree6a3755d06e70c1eee049befbcf94f456f9847e48 /package/iwinfo
parent2685b0601715829f499608a3a2c6f2a79713fbc2 (diff)
[package] iwinfo: recognize AR5416 EEPROMs as seen on the Ubiquiti Picostation M2
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30663 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/iwinfo')
-rw-r--r--package/iwinfo/Makefile2
-rw-r--r--package/iwinfo/src/iwinfo_utils.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/package/iwinfo/Makefile b/package/iwinfo/Makefile
index 721de4954..d58d62d46 100644
--- a/package/iwinfo/Makefile
+++ b/package/iwinfo/Makefile
@@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libiwinfo
-PKG_RELEASE:=27
+PKG_RELEASE:=28
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \
diff --git a/package/iwinfo/src/iwinfo_utils.c b/package/iwinfo/src/iwinfo_utils.c
index ec6aa2233..78ea52b4a 100644
--- a/package/iwinfo/src/iwinfo_utils.c
+++ b/package/iwinfo/src/iwinfo_utils.c
@@ -165,7 +165,7 @@ int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id)
while (fgets(buf, sizeof(buf), mtd) > 0)
{
if (fscanf(mtd, "mtd%d: %*x %x %127s", &off, &len, buf) < 3 ||
- strcmp(buf, "\"boardconfig\""))
+ strcmp(buf, "\"boardconfig\"") || strcmp(buf, "\"EEPROM\""))
{
off = -1;
continue;
@@ -193,6 +193,7 @@ int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id)
for (off = len / 2 - 0x800; off >= 0; off -= 0x800)
{
+ /* AR531X board data magic */
if ((bc[off] == 0x3533) && (bc[off + 1] == 0x3131))
{
id->vendor_id = bc[off + 0x7d];
@@ -201,6 +202,16 @@ int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id)
id->subsystem_device_id = bc[off + 0x83];
break;
}
+
+ /* AR5416 EEPROM magic */
+ else if ((bc[off] == 0xA55A) || (bc[off] == 0x5AA5))
+ {
+ id->vendor_id = bc[off + 0x0D];
+ id->device_id = bc[off + 0x0E];
+ id->subsystem_vendor_id = bc[off + 0x13];
+ id->subsystem_device_id = bc[off + 0x14];
+ break;
+ }
}
munmap(bc, len);