diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-02-20 21:17:59 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-02-20 21:17:59 +0000 |
commit | 39902886f04f8ce8934f43a64afadf42ef2b2d15 (patch) | |
tree | a0d19fd0179ea8f1d4b66ff68c39ed378b45aceb /package/iwinfo/src/iwinfo_utils.c | |
parent | c2590fe9309910c759a9b8a5dbcd7facffe8d982 (diff) | |
download | upstream-39902886f04f8ce8934f43a64afadf42ef2b2d15.tar.gz upstream-39902886f04f8ce8934f43a64afadf42ef2b2d15.tar.bz2 upstream-39902886f04f8ce8934f43a64afadf42ef2b2d15.zip |
iwinfo: recognize AR5416 EEPROMs as seen on the Ubiquiti Picostation M2
SVN-Revision: 30663
Diffstat (limited to 'package/iwinfo/src/iwinfo_utils.c')
-rw-r--r-- | package/iwinfo/src/iwinfo_utils.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/package/iwinfo/src/iwinfo_utils.c b/package/iwinfo/src/iwinfo_utils.c index ec6aa2233f..78ea52b4ab 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); |