Commit 0ce72ea3 authored by Marek Belisko's avatar Marek Belisko Committed by Greg Kroah-Hartman

staging: ft1000: Fix camelcase variable names.

Signed-off-by: default avatarMarek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c346541f
...@@ -772,26 +772,26 @@ static u32 write_blk_fifo (struct ft1000_device *ft1000dev, u16 **pUsFile, u8 ** ...@@ -772,26 +772,26 @@ static u32 write_blk_fifo (struct ft1000_device *ft1000dev, u16 **pUsFile, u8 **
u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLength) u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLength)
{ {
u16 Status = STATUS_SUCCESS; u16 status = STATUS_SUCCESS;
u32 uiState; u32 state;
u16 handshake; u16 handshake;
struct pseudo_hdr *pHdr; struct pseudo_hdr *pseudo_header;
u16 usHdrLength; u16 pseudo_header_len;
long word_length; long word_length;
u16 request; u16 request;
u16 temp; u16 temp;
u16 tempword; u16 tempword;
struct dsp_file_hdr *pFileHdr5; struct dsp_file_hdr *file_hdr;
struct dsp_image_info *pDspImageInfoV6 = NULL; struct dsp_image_info *dsp_img_info = NULL;
long requested_version; long requested_version;
bool bGoodVersion; bool correct_version;
struct drv_msg *pMailBoxData; struct drv_msg *mailbox_data;
u16 *pUsData = NULL; u16 *data = NULL;
u16 *pUsFile = NULL; u16 *s_file = NULL;
u8 *pUcFile = NULL; u8 *c_file = NULL;
u8 *pBootEnd = NULL, *pCodeEnd= NULL; u8 *boot_end = NULL, *code_end= NULL;
int imageN; int image;
long loader_code_address, loader_code_size = 0; long loader_code_address, loader_code_size = 0;
long run_address = 0, run_size = 0; long run_address = 0, run_size = 0;
...@@ -814,24 +814,24 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -814,24 +814,24 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
// Get version id of file, at first 4 bytes of file, for newer files. // Get version id of file, at first 4 bytes of file, for newer files.
// //
uiState = STATE_START_DWNLD; state = STATE_START_DWNLD;
pFileHdr5 = (struct dsp_file_hdr *)pFileStart; file_hdr = (struct dsp_file_hdr *)pFileStart;
ft1000_write_register (ft1000dev, 0x800, FT1000_REG_MAG_WATERMARK); ft1000_write_register (ft1000dev, 0x800, FT1000_REG_MAG_WATERMARK);
pUsFile = (u16 *)(pFileStart + pFileHdr5->loader_offset); s_file = (u16 *)(pFileStart + file_hdr->loader_offset);
pUcFile = (u8 *)(pFileStart + pFileHdr5->loader_offset); c_file = (u8 *)(pFileStart + file_hdr->loader_offset);
pBootEnd = (u8 *)(pFileStart + pFileHdr5->loader_code_end); boot_end = (u8 *)(pFileStart + file_hdr->loader_code_end);
loader_code_address = pFileHdr5->loader_code_address; loader_code_address = file_hdr->loader_code_address;
loader_code_size = pFileHdr5->loader_code_size; loader_code_size = file_hdr->loader_code_size;
bGoodVersion = FALSE; correct_version = FALSE;
while ((Status == STATUS_SUCCESS) && (uiState != STATE_DONE_FILE)) while ((status == STATUS_SUCCESS) && (state != STATE_DONE_FILE))
{ {
switch (uiState) switch (state)
{ {
case STATE_START_DWNLD: case STATE_START_DWNLD:
DEBUG("FT1000:STATE_START_DWNLD\n"); DEBUG("FT1000:STATE_START_DWNLD\n");
...@@ -848,10 +848,10 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -848,10 +848,10 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
else else
{ {
DEBUG("FT1000:download:Download error: Handshake failed\n"); DEBUG("FT1000:download:Download error: Handshake failed\n");
Status = STATUS_FAILURE; status = STATUS_FAILURE;
} }
uiState = STATE_BOOT_DWNLD; state = STATE_BOOT_DWNLD;
break; break;
...@@ -878,11 +878,11 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -878,11 +878,11 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
case REQUEST_DONE_BL: case REQUEST_DONE_BL:
DEBUG("FT1000:REQUEST_DONE_BL\n"); DEBUG("FT1000:REQUEST_DONE_BL\n");
/* Reposition ptrs to beginning of code section */ /* Reposition ptrs to beginning of code section */
pUsFile = (u16 *)(pBootEnd); s_file = (u16 *)(boot_end);
pUcFile = (u8 *)(pBootEnd); c_file = (u8 *)(boot_end);
//DEBUG("FT1000:download:pUsFile = 0x%8x\n", (int)pUsFile); //DEBUG("FT1000:download:s_file = 0x%8x\n", (int)s_file);
//DEBUG("FT1000:download:pUcFile = 0x%8x\n", (int)pUcFile); //DEBUG("FT1000:download:c_file = 0x%8x\n", (int)c_file);
uiState = STATE_CODE_DWNLD; state = STATE_CODE_DWNLD;
pft1000info->fcodeldr = 1; pft1000info->fcodeldr = 1;
break; break;
case REQUEST_CODE_SEGMENT: case REQUEST_CODE_SEGMENT:
...@@ -893,17 +893,17 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -893,17 +893,17 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
if (word_length > MAX_LENGTH) if (word_length > MAX_LENGTH)
{ {
DEBUG("FT1000:download:Download error: Max length exceeded\n"); DEBUG("FT1000:download:Download error: Max length exceeded\n");
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
if ( (word_length*2 + pUcFile) > pBootEnd) if ( (word_length*2 + c_file) > boot_end)
{ {
/* /*
* Error, beyond boot code range. * Error, beyond boot code range.
*/ */
DEBUG("FT1000:download:Download error: Requested len=%d exceeds BOOT code boundry.\n", DEBUG("FT1000:download:Download error: Requested len=%d exceeds BOOT code boundry.\n",
(int)word_length); (int)word_length);
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
/* /*
...@@ -914,12 +914,12 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -914,12 +914,12 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
word_length++; word_length++;
word_length = word_length / 2; word_length = word_length / 2;
Status = write_blk(ft1000dev, &pUsFile, &pUcFile, word_length); status = write_blk(ft1000dev, &s_file, &c_file, word_length);
//DEBUG("write_blk returned %d\n", Status); //DEBUG("write_blk returned %d\n", status);
break; break;
default: default:
DEBUG("FT1000:download:Download error: Bad request type=%d in BOOT download state.\n",request); DEBUG("FT1000:download:Download error: Bad request type=%d in BOOT download state.\n",request);
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
if (pft1000info->usbboot) if (pft1000info->usbboot)
...@@ -930,7 +930,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -930,7 +930,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
else else
{ {
DEBUG("FT1000:download:Download error: Handshake failed\n"); DEBUG("FT1000:download:Download error: Handshake failed\n");
Status = STATUS_FAILURE; status = STATUS_FAILURE;
} }
break; break;
...@@ -959,7 +959,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -959,7 +959,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
break; break;
case REQUEST_RUN_ADDRESS: case REQUEST_RUN_ADDRESS:
DEBUG("FT1000:download: REQUEST_RUN_ADDRESS\n"); DEBUG("FT1000:download: REQUEST_RUN_ADDRESS\n");
if (bGoodVersion) if (correct_version)
{ {
DEBUG("FT1000:download:run_address = 0x%8x\n", (int)run_address); DEBUG("FT1000:download:run_address = 0x%8x\n", (int)run_address);
put_request_value(ft1000dev, run_address); put_request_value(ft1000dev, run_address);
...@@ -967,13 +967,13 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -967,13 +967,13 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
else else
{ {
DEBUG("FT1000:download:Download error: Got Run address request before image offset request.\n"); DEBUG("FT1000:download:Download error: Got Run address request before image offset request.\n");
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
break; break;
case REQUEST_CODE_LENGTH: case REQUEST_CODE_LENGTH:
DEBUG("FT1000:download:REQUEST_CODE_LENGTH\n"); DEBUG("FT1000:download:REQUEST_CODE_LENGTH\n");
if (bGoodVersion) if (correct_version)
{ {
DEBUG("FT1000:download:run_size = 0x%8x\n", (int)run_size); DEBUG("FT1000:download:run_size = 0x%8x\n", (int)run_size);
put_request_value(ft1000dev, run_size); put_request_value(ft1000dev, run_size);
...@@ -981,23 +981,23 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -981,23 +981,23 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
else else
{ {
DEBUG("FT1000:download:Download error: Got Size request before image offset request.\n"); DEBUG("FT1000:download:Download error: Got Size request before image offset request.\n");
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
break; break;
case REQUEST_DONE_CL: case REQUEST_DONE_CL:
pft1000info->usbboot = 3; pft1000info->usbboot = 3;
/* Reposition ptrs to beginning of provisioning section */ /* Reposition ptrs to beginning of provisioning section */
pUsFile = (u16 *)(pFileStart + pFileHdr5->commands_offset); s_file = (u16 *)(pFileStart + file_hdr->commands_offset);
pUcFile = (u8 *)(pFileStart + pFileHdr5->commands_offset); c_file = (u8 *)(pFileStart + file_hdr->commands_offset);
uiState = STATE_DONE_DWNLD; state = STATE_DONE_DWNLD;
break; break;
case REQUEST_CODE_SEGMENT: case REQUEST_CODE_SEGMENT:
//DEBUG("FT1000:download: REQUEST_CODE_SEGMENT - CODELOADER\n"); //DEBUG("FT1000:download: REQUEST_CODE_SEGMENT - CODELOADER\n");
if (!bGoodVersion) if (!correct_version)
{ {
DEBUG("FT1000:download:Download error: Got Code Segment request before image offset request.\n"); DEBUG("FT1000:download:Download error: Got Code Segment request before image offset request.\n");
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
#if 0 #if 0
...@@ -1011,17 +1011,17 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -1011,17 +1011,17 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
#endif #endif
{ {
DEBUG("FT1000:download:Download error: Max length exceeded\n"); DEBUG("FT1000:download:Download error: Max length exceeded\n");
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
if ( (word_length*2 + pUcFile) > pCodeEnd) if ( (word_length*2 + c_file) > code_end)
{ {
/* /*
* Error, beyond boot code range. * Error, beyond boot code range.
*/ */
DEBUG("FT1000:download:Download error: Requested len=%d exceeds DSP code boundry.\n", DEBUG("FT1000:download:Download error: Requested len=%d exceeds DSP code boundry.\n",
(int)word_length); (int)word_length);
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
/* /*
...@@ -1032,7 +1032,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -1032,7 +1032,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
word_length++; word_length++;
word_length = word_length / 2; word_length = word_length / 2;
write_blk_fifo (ft1000dev, &pUsFile, &pUcFile, word_length); write_blk_fifo (ft1000dev, &s_file, &c_file, word_length);
if (pft1000info->usbboot == 0) if (pft1000info->usbboot == 0)
pft1000info->usbboot++; pft1000info->usbboot++;
if (pft1000info->usbboot == 1) { if (pft1000info->usbboot == 1) {
...@@ -1047,13 +1047,13 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -1047,13 +1047,13 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
// Convert length from byte count to word count. Make sure we round up. // Convert length from byte count to word count. Make sure we round up.
word_length = (long)(pft1000info->DSPInfoBlklen + 1)/2; word_length = (long)(pft1000info->DSPInfoBlklen + 1)/2;
put_request_value(ft1000dev, word_length); put_request_value(ft1000dev, word_length);
pMailBoxData = (struct drv_msg *)&(pft1000info->DSPInfoBlk[0]); mailbox_data = (struct drv_msg *)&(pft1000info->DSPInfoBlk[0]);
/* /*
* Position ASIC DPRAM auto-increment pointer. * Position ASIC DPRAM auto-increment pointer.
*/ */
pUsData = (u16 *)&pMailBoxData->data[0]; data = (u16 *)&mailbox_data->data[0];
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC; dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
if (word_length & 0x1) if (word_length & 0x1)
word_length++; word_length++;
...@@ -1064,22 +1064,22 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -1064,22 +1064,22 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
for (; word_length > 0; word_length--) /* In words */ for (; word_length > 0; word_length--) /* In words */
{ {
templong = *pUsData++; templong = *data++;
templong |= (*pUsData++ << 16); templong |= (*data++ << 16);
Status = fix_ft1000_write_dpram32 (ft1000dev, dpram++, (u8 *)&templong); status = fix_ft1000_write_dpram32 (ft1000dev, dpram++, (u8 *)&templong);
} }
break; break;
case REQUEST_VERSION_INFO: case REQUEST_VERSION_INFO:
DEBUG("FT1000:download:REQUEST_VERSION_INFO\n"); DEBUG("FT1000:download:REQUEST_VERSION_INFO\n");
word_length = pFileHdr5->version_data_size; word_length = file_hdr->version_data_size;
put_request_value(ft1000dev, word_length); put_request_value(ft1000dev, word_length);
/* /*
* Position ASIC DPRAM auto-increment pointer. * Position ASIC DPRAM auto-increment pointer.
*/ */
pUsFile = (u16 *)(pFileStart + pFileHdr5->version_data_offset); s_file = (u16 *)(pFileStart + file_hdr->version_data_offset);
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC; dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
...@@ -1092,59 +1092,59 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -1092,59 +1092,59 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
for (; word_length > 0; word_length--) /* In words */ for (; word_length > 0; word_length--) /* In words */
{ {
templong = ntohs(*pUsFile++); templong = ntohs(*s_file++);
temp = ntohs(*pUsFile++); temp = ntohs(*s_file++);
templong |= (temp << 16); templong |= (temp << 16);
Status = fix_ft1000_write_dpram32 (ft1000dev, dpram++, (u8 *)&templong); status = fix_ft1000_write_dpram32 (ft1000dev, dpram++, (u8 *)&templong);
} }
break; break;
case REQUEST_CODE_BY_VERSION: case REQUEST_CODE_BY_VERSION:
DEBUG("FT1000:download:REQUEST_CODE_BY_VERSION\n"); DEBUG("FT1000:download:REQUEST_CODE_BY_VERSION\n");
bGoodVersion = FALSE; correct_version = FALSE;
requested_version = get_request_value(ft1000dev); requested_version = get_request_value(ft1000dev);
pDspImageInfoV6 = (struct dsp_image_info *)(pFileStart + sizeof(struct dsp_file_hdr )); dsp_img_info = (struct dsp_image_info *)(pFileStart + sizeof(struct dsp_file_hdr ));
for (imageN = 0; imageN < pFileHdr5->nDspImages; imageN++) for (image = 0; image < file_hdr->nDspImages; image++)
{ {
temp = (u16)(pDspImageInfoV6->version); temp = (u16)(dsp_img_info->version);
templong = temp; templong = temp;
temp = (u16)(pDspImageInfoV6->version >> 16); temp = (u16)(dsp_img_info->version >> 16);
templong |= (temp << 16); templong |= (temp << 16);
if (templong == (u32)requested_version) if (templong == (u32)requested_version)
{ {
bGoodVersion = TRUE; correct_version = TRUE;
DEBUG("FT1000:download: bGoodVersion is TRUE\n"); DEBUG("FT1000:download: correct_version is TRUE\n");
pUsFile = (u16 *)(pFileStart + pDspImageInfoV6->begin_offset); s_file = (u16 *)(pFileStart + dsp_img_info->begin_offset);
pUcFile = (u8 *)(pFileStart + pDspImageInfoV6->begin_offset); c_file = (u8 *)(pFileStart + dsp_img_info->begin_offset);
pCodeEnd = (u8 *)(pFileStart + pDspImageInfoV6->end_offset); code_end = (u8 *)(pFileStart + dsp_img_info->end_offset);
run_address = pDspImageInfoV6->run_address; run_address = dsp_img_info->run_address;
run_size = pDspImageInfoV6->image_size; run_size = dsp_img_info->image_size;
image_chksum = (u32)pDspImageInfoV6->checksum; image_chksum = (u32)dsp_img_info->checksum;
break; break;
} }
pDspImageInfoV6++; dsp_img_info++;
} //end of for } //end of for
if (!bGoodVersion) if (!correct_version)
{ {
/* /*
* Error, beyond boot code range. * Error, beyond boot code range.
*/ */
DEBUG("FT1000:download:Download error: Bad Version Request = 0x%x.\n",(int)requested_version); DEBUG("FT1000:download:Download error: Bad Version Request = 0x%x.\n",(int)requested_version);
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
break; break;
default: default:
DEBUG("FT1000:download:Download error: Bad request type=%d in CODE download state.\n",request); DEBUG("FT1000:download:Download error: Bad request type=%d in CODE download state.\n",request);
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} }
if (pft1000info->usbboot) if (pft1000info->usbboot)
...@@ -1155,94 +1155,94 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng ...@@ -1155,94 +1155,94 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLeng
else else
{ {
DEBUG("FT1000:download:Download error: Handshake failed\n"); DEBUG("FT1000:download:Download error: Handshake failed\n");
Status = STATUS_FAILURE; status = STATUS_FAILURE;
} }
break; break;
case STATE_DONE_DWNLD: case STATE_DONE_DWNLD:
DEBUG("FT1000:download:Code loader is done...\n"); DEBUG("FT1000:download:Code loader is done...\n");
uiState = STATE_SECTION_PROV; state = STATE_SECTION_PROV;
break; break;
case STATE_SECTION_PROV: case STATE_SECTION_PROV:
DEBUG("FT1000:download:STATE_SECTION_PROV\n"); DEBUG("FT1000:download:STATE_SECTION_PROV\n");
pHdr = (struct pseudo_hdr *)pUcFile; pseudo_header = (struct pseudo_hdr *)c_file;
if (pHdr->checksum == hdr_checksum(pHdr)) if (pseudo_header->checksum == hdr_checksum(pseudo_header))
{ {
if (pHdr->portdest != 0x80 /* Dsp OAM */) if (pseudo_header->portdest != 0x80 /* Dsp OAM */)
{ {
uiState = STATE_DONE_PROV; state = STATE_DONE_PROV;
break; break;
} }
usHdrLength = ntohs(pHdr->length); /* Byte length for PROV records */ pseudo_header_len = ntohs(pseudo_header->length); /* Byte length for PROV records */
// Get buffer for provisioning data // Get buffer for provisioning data
pbuffer = kmalloc((usHdrLength + sizeof(struct pseudo_hdr)), GFP_ATOMIC); pbuffer = kmalloc((pseudo_header_len + sizeof(struct pseudo_hdr)), GFP_ATOMIC);
if (pbuffer) { if (pbuffer) {
memcpy(pbuffer, (void *)pUcFile, (u32)(usHdrLength + sizeof(struct pseudo_hdr))); memcpy(pbuffer, (void *)c_file, (u32)(pseudo_header_len + sizeof(struct pseudo_hdr)));
// link provisioning data // link provisioning data
pprov_record = kmalloc(sizeof(struct prov_record), GFP_ATOMIC); pprov_record = kmalloc(sizeof(struct prov_record), GFP_ATOMIC);
if (pprov_record) { if (pprov_record) {
pprov_record->pprov_data = pbuffer; pprov_record->pprov_data = pbuffer;
list_add_tail (&pprov_record->list, &pft1000info->prov_list); list_add_tail (&pprov_record->list, &pft1000info->prov_list);
// Move to next entry if available // Move to next entry if available
pUcFile = (u8 *)((unsigned long)pUcFile + (u32)((usHdrLength + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr)); c_file = (u8 *)((unsigned long)c_file + (u32)((pseudo_header_len + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr));
if ( (unsigned long)(pUcFile) - (unsigned long)(pFileStart) >= (unsigned long)FileLength) { if ( (unsigned long)(c_file) - (unsigned long)(pFileStart) >= (unsigned long)FileLength) {
uiState = STATE_DONE_FILE; state = STATE_DONE_FILE;
} }
} }
else { else {
kfree(pbuffer); kfree(pbuffer);
Status = STATUS_FAILURE; status = STATUS_FAILURE;
} }
} }
else { else {
Status = STATUS_FAILURE; status = STATUS_FAILURE;
} }
} }
else else
{ {
/* Checksum did not compute */ /* Checksum did not compute */
Status = STATUS_FAILURE; status = STATUS_FAILURE;
} }
DEBUG("ft1000:download: after STATE_SECTION_PROV, uiState = %d, Status= %d\n", uiState, Status); DEBUG("ft1000:download: after STATE_SECTION_PROV, state = %d, status= %d\n", state, status);
break; break;
case STATE_DONE_PROV: case STATE_DONE_PROV:
DEBUG("FT1000:download:STATE_DONE_PROV\n"); DEBUG("FT1000:download:STATE_DONE_PROV\n");
uiState = STATE_DONE_FILE; state = STATE_DONE_FILE;
break; break;
default: default:
Status = STATUS_FAILURE; status = STATUS_FAILURE;
break; break;
} /* End Switch */ } /* End Switch */
if (Status != STATUS_SUCCESS) { if (status != STATUS_SUCCESS) {
break; break;
} }
/**** /****
// Check if Card is present // Check if Card is present
Status = Harley_Read_Register(&temp, FT1000_REG_SUP_IMASK); status = Harley_Read_Register(&temp, FT1000_REG_SUP_IMASK);
if ( (Status != NDIS_STATUS_SUCCESS) || (temp == 0x0000) ) { if ( (status != NDIS_STATUS_SUCCESS) || (temp == 0x0000) ) {
break; break;
} }
Status = Harley_Read_Register(&temp, FT1000_REG_ASIC_ID); status = Harley_Read_Register(&temp, FT1000_REG_ASIC_ID);
if ( (Status != NDIS_STATUS_SUCCESS) || (temp == 0xffff) ) { if ( (status != NDIS_STATUS_SUCCESS) || (temp == 0xffff) ) {
break; break;
} }
****/ ****/
} /* End while */ } /* End while */
DEBUG("Download exiting with status = 0x%8x\n", Status); DEBUG("Download exiting with status = 0x%8x\n", status);
ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX, FT1000_REG_DOORBELL); ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX, FT1000_REG_DOORBELL);
return Status; return status;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment