Ifdef'd the download access commands for testing. Will remove the ifdefs

later.
This commit is contained in:
mark 2000-02-01 19:26:51 +00:00
parent 0e5ea85ddd
commit 9868dee24a
1 changed files with 29 additions and 6 deletions

View File

@ -506,6 +506,10 @@ int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, UINT32 exeaddr)
if ( hw->dlstate != HFA384x_DLSTATE_DISABLED ) {
return -EINVAL;
}
WLAN_LOG_DEBUG1(1,"ramdl_enable, exeaddr=0x%08x\n", exeaddr);
hw->dlstate = HFA384x_DLSTATE_RAMENABLED;
#if 0
/* Enable the aux port */
if ( (result = hfa384x_cmd_aux_enable(hw)) ) {
return result;
@ -526,7 +530,7 @@ int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, UINT32 exeaddr)
/* Disable the aux port */
hfa384x_cmd_aux_disable(hw);
}
#endif
DBFEXIT;
return result;
}
@ -558,6 +562,9 @@ int hfa384x_drvr_ramdl_disable(hfa384x_t *hw)
return -EINVAL;
}
WLAN_LOG_DEBUG0(1,"ramdl_disable\n");
hw->dlstate = HFA384x_DLSTATE_DISABLED;
#if 0
/* There isn't much we can do at this point, so I don't */
/* bother w/ the return value */
hfa384x_cmd_download(hw, HFA384x_PROGMODE_DISABLE, 0, 0 , 0);
@ -565,7 +572,7 @@ int hfa384x_drvr_ramdl_disable(hfa384x_t *hw)
/* Disable the aux port */
hfa384x_cmd_aux_disable(hw);
#endif
DBFEXIT;
return 0;
}
@ -608,7 +615,8 @@ int hfa384x_drvr_ramdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len)
}
WLAN_LOG_INFO2("Writing %ld bytes to ram @0x%06lx\n", len, daddr);
WLAN_HEX_DUMP(1, "dldata", buf, len);
#if 0
/* Copy the data via the aux port */
hfa384x_copy_to_aux(hw, daddr, buf, len);
@ -620,10 +628,11 @@ int hfa384x_drvr_ramdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 len)
hfa384x_copy_from_aux(hw, daddr, verbuf, len);
if ( memcmp(buf, verbuf, len) ) {
WLAN_LOG_DEBUG0(1,"ramdl verify failed!\n");
result = -EINVAL;
}
kfree_s(verbuf, len);
#endif
DBFEXIT;
return result;
}
@ -666,6 +675,9 @@ int hfa384x_drvr_flashdl_enable(hfa384x_t *hw)
return -EINVAL;
}
WLAN_LOG_DEBUG0(1,"flashdl_enable\n");
hw->dlstate = HFA384x_DLSTATE_FLASHENABLED;
#if 0
/* Retrieve the buffer loc&size and timeout */
if ( (result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER,
&(hw->bufinfo), sizeof(hw->bufinfo))) ) {
@ -686,7 +698,7 @@ int hfa384x_drvr_flashdl_enable(hfa384x_t *hw)
}
hw->dlstate = HFA384x_DLSTATE_FLASHENABLED;
#endif
DBFEXIT;
return result;
}
@ -718,6 +730,9 @@ int hfa384x_drvr_flashdl_disable(hfa384x_t *hw)
if ( hw->dlstate != HFA384x_DLSTATE_FLASHENABLED ) {
return -EINVAL;
}
WLAN_LOG_DEBUG0(1,"flashdl_enable\n");
hw->dlstate = HFA384x_DLSTATE_DISABLED;
#if 0
/* There isn't much we can do at this point, so I don't */
/* bother w/ the return value */
@ -726,7 +741,8 @@ int hfa384x_drvr_flashdl_disable(hfa384x_t *hw)
/* Disable the aux port */
hfa384x_cmd_aux_disable(hw);
#endif
DBFEXIT;
return 0;
}
@ -779,6 +795,8 @@ int hfa384x_drvr_flashdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 le
return -EINVAL;
}
WLAN_LOG_INFO2("Download %ld bytes to flash @0x%06lx\n", len, daddr);
/* Figure out how many times to to the flash prog */
nwrites = len / hw->bufinfo.len;
nwrites += (len % hw->bufinfo.len) ? 1 : 0;
@ -786,6 +804,8 @@ int hfa384x_drvr_flashdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 le
/* For convenience */
dlbufaddr = (hw->bufinfo.page << 7) | hw->bufinfo.offset;
verbuf = kmalloc(hw->bufinfo.len, GFP_KERNEL);
WLAN_LOG_DEBUG3(1,"dlbuf@0x%06lx len=%d to=%d\n", dlbufaddr, hw->bufinfo.len, hw->dltimeout);
if ( verbuf == NULL ) {
WLAN_LOG_ERROR0("Failed to allocate flash verify buffer\n");
return 1;
@ -800,6 +820,8 @@ int hfa384x_drvr_flashdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 le
destlo = currdaddr & 0x0000ffff;
desthi = currdaddr >> 16;
WLAN_LOG_INFO2("Writing %ld bytes to flash @0x%06lx\n", currlen, currdaddr);
WLAN_HEX_DUMP(1, "dldata", buf+(hw->bufinfo.len*i), currlen);
#if 0
/* Set the download mode */
result = hfa384x_cmd_download(hw, HFA384x_PROGMODE_NV,
destlo, desthi, currlen);
@ -827,6 +849,7 @@ int hfa384x_drvr_flashdl_write(hfa384x_t *hw, UINT32 daddr, void* buf, UINT32 le
kfree_s(verbuf, hw->bufinfo.len);
return -EINVAL;
}
#endif
}
/* Leave the firmware in the 'post-prog' mode. flashdl_disable will */