[PATCH] Graceful handling of PDR 0x0413
Pavel Roskin
proski
Tue Feb 3 13:47:36 PST 2004
Hello!
It's time to stop confusing users about modified firmware. PDR 0x0413 in
1.8.x firmware points to the memory where the firmware is not downloaded.
While we still don't know what it means, it should not be a fatal error in
most cases. Of all cards I know none has PDR 0x0413 in PDA, so the
question how to plug it is useless.
The attached patch changes the behavior of prism2_srec so that PDRs
pointing to the uncovered areas are only a fatal problem if we actually
need to write something there. If we are not plugging that PDR, it's not
an error, just a warning.
If further releases from the 0.1.x branch are planned, please apply my
patch to that branch as well. I'd like to stop distributing modified
firmware.
--
Regards,
Pavel Roskin
-------------- next part --------------
--- utils/prism2_srec.c
+++ utils/prism2_srec.c
@@ -1297,7 +1297,6 @@ int plug_pdr_entries(struct wlan_info *w
printf("Could not find data position for plugging PDR "
"0x%04x at 0x%08x (len=%d)\n",
p->pdr, p->plug_addr, p->plug_len);
- return 1;
}
if (p->pdr == 0xffffffff) {
@@ -1305,6 +1304,8 @@ int plug_pdr_entries(struct wlan_info *w
* (available from RID FFFF); like file name for
* upgrade packet, etc. */
int len;
+ if (pos == NULL)
+ return 1;
memset(pos, 0, p->plug_len);
len = strlen(srec->name);
if (p->plug_len > 0)
@@ -1315,6 +1316,8 @@ int plug_pdr_entries(struct wlan_info *w
}
if (skip_pda_read && p->pdr == 0x0400 && p->plug_len == 2) {
+ if (pos == NULL)
+ return 1;
if (plug_pdr_0400(wlan->ifname, pos))
return 1;
continue;
@@ -1343,12 +1346,19 @@ int plug_pdr_entries(struct wlan_info *w
} else
return 1;
}
+ if (pos == NULL)
+ return 1;
memcpy(pos, wlan->pda.pdrs[j].data,
wlan->pda.pdrs[j].len);
found = 1;
break;
}
}
+ if (!found && pos == 0) {
+ printf("PDR 0x%04x not found from wlan "
+ "card PDA. Not plugging.\n", p->pdr);
+ return 0;
+ }
if (!found && verbose) {
int j;
printf("PDR 0x%04x not found from wlan card PDA. "
More information about the Hostap
mailing list