- if (ap_type == ATMEL410) {
- memcpy(&str410, varbinds[1].value,
- sizeof(struct sysDeviceInfo_ATMEL410));
- ap_sversion = str410.StructVersion;
- ap_macaddr = str410.MacAddress;
- ap_regdomain = swap4(str410.RegulatoryDomain);
- ap_prodtype = str410.ProductType;
- ap_oemname = str410.OEMName;
- ap_oemid = str410.OEMID;
- ap_prodname = str410.ProductName;
- ap_hwrev = str410.HardwareRevision;
- } else { /* ATMEL12350 */
- memcpy(&str12350, varbinds[1].value,
- sizeof(struct sysDeviceInfo_ATMEL12350));
- ap_regdomain = str12350.RegulatoryDomain;
- ap_sversion = str12350.StructVersion;
- ap_macaddr = str12350.MacAddress;
- ap_prodtype = str12350.ProductType;
- ap_oemname = str12350.OEMName;
- ap_oemid = str12350.OEMID;
- ap_prodname = str12350.ProductName;
- ap_hwrev = str12350.HardwareRevision;
+ if (varbinds[1].len_val == 92 || varbinds[1].len_val == 128) {
+ memcpy(&str128, varbinds[1].value,
+ sizeof(struct sysDeviceInfo_128));
+ ap_sversion = str128.StructVersion;
+ ap_macaddr = str128.MacAddress;
+ ap_regdomain = swap4(str128.RegulatoryDomain);
+ ap_prodtype = str128.ProductType;
+ ap_oemname = str128.OEMName;
+ ap_oemid = str128.OEMID;
+ ap_prodname = str128.ProductName;
+ ap_hwrev = str128.HardwareRevision;
+ } else { /* varbinds[1].len_val == 160 */
+ memcpy(&str160, varbinds[1].value,
+ sizeof(struct sysDeviceInfo_160));
+ ap_regdomain = str160.RegulatoryDomain;
+ ap_sversion = str160.StructVersion;
+ ap_macaddr = str160.MacAddress;
+ ap_prodtype = str160.ProductType;
+ ap_oemname = str160.OEMName;
+ ap_oemid = str160.OEMID;
+ ap_prodname = str160.ProductName;
+ ap_hwrev = str160.HardwareRevision;