[PATCH] Flash download works!!!
Pavel Roskin
proski
Mon Apr 14 21:12:07 PDT 2003
On Mon, 14 Apr 2003, Jouni Malinen wrote:
> My dead test card has been resurrected. :-) That was easy; big thanks to
> Raffaele for providing information on how to do this with DOS flash
> tool.
Congratulations!
I've done some cleanup for the flash code. maxloadtime is no longer used.
I was unsure whether to use it, but now I think it's better to have a
sufficient timeout than to rely on the RID value. After all, the flash
code should rely on the existing firmware as little as possible.
The dlbuffer structure is now converted from little-endian to the CPU
format. I'm not 100% sure that it's not done elsewhere and I have no
big-endian systems to test, so be careful.
Finally, the mask for checking the command number got its own name
HFA384X_CMDCODE_MASK.
--
Regards,
Pavel Roskin
-------------- next part --------------
--- driver/modules/hostap_download.c
+++ driver/modules/hostap_download.c
@@ -361,7 +361,6 @@ static int prism2_download_nonvolatile(l
{
struct net_device *dev = local->dev;
int ret = 0, i;
- u16 maxloadtime;
struct {
u16 page;
u16 offset;
@@ -377,18 +376,6 @@ static int prism2_download_nonvolatile(l
local->hw_downloading = 1;
- ret = local->func->get_rid(dev, HFA384X_RID_MAXLOADTIME,
- &maxloadtime, 2, 0);
-
- if (ret < 0) {
- printk(KERN_WARNING "%s: Could not read maxloadtime\n",
- dev->name);
- goto out;
- }
-
- printk(KERN_DEBUG "%s: Flash download timeout: %d msec\n",
- dev->name, maxloadtime);
-
ret = local->func->get_rid(dev, HFA384X_RID_DOWNLOADBUFFER,
&dlbuffer, 6, 0);
@@ -398,6 +385,10 @@ static int prism2_download_nonvolatile(l
goto out;
}
+ dlbuffer.page = le16_to_cpu(dlbuffer.page);
+ dlbuffer.offset = le16_to_cpu(dlbuffer.offset);
+ dlbuffer.len = le16_to_cpu(dlbuffer.len);
+
printk(KERN_DEBUG "Download buffer: %d bytes at 0x%04x:0x%04x\n",
dlbuffer.len, dlbuffer.page, dlbuffer.offset);
--- driver/modules/hostap_hw.c
+++ driver/modules/hostap_hw.c
@@ -508,7 +508,7 @@ static int hfa384x_cmd_wait(struct net_d
HFA384X_OUTW(cmd, HFA384X_CMD_OFF);
/* wait for command completion */
- if ((cmd & 0x3f) == HFA384X_CMDCODE_DOWNLOAD)
+ if ((cmd & HFA384X_CMDCODE_MASK) == HFA384X_CMDCODE_DOWNLOAD)
tries = HFA384X_DL_COMPL_TIMEOUT;
else
tries = HFA384X_CMD_COMPL_TIMEOUT;
--- driver/modules/hostap_wlan.h
+++ driver/modules/hostap_wlan.h
@@ -409,6 +409,8 @@
#define HFA384X_CMDCODE_WRITEMIF 0x31
#define HFA384X_CMDCODE_TEST 0x38
+#define HFA384X_CMDCODE_MASK 0x3F
+
/* Test mode operations */
#define HFA384X_TEST_CHANGE_CHANNEL 0x08
#define HFA384X_TEST_MONITOR 0x0B
More information about the Hostap
mailing list