//
// Returns: None
//-----------------------------------------------------------------------
-void dsp_reload (struct ft1000_device *ft1000dev)
+int dsp_reload(struct ft1000_device *ft1000dev)
{
u16 status;
USHORT tempword;
pft1000info = netdev_priv(ft1000dev->net);
pft1000info->CardReady = 0;
- pft1000info->DSP_loading= 1;
// Program Interrupt Mask register
status = ft1000_write_register (ft1000dev, 0xffff, FT1000_REG_SUP_IMASK);
// call codeloader
status = scram_dnldr(ft1000dev, pFileStart, FileLength);
- if ( status != STATUS_SUCCESS)
- return;
+ if (status != STATUS_SUCCESS)
+ return -EIO;
msleep(1000);
- pft1000info->DSP_loading= 0;
DEBUG("dsp_reload returned\n");
-
+ return 0;
}
pInfo->CurrentInterruptEnableMask = ISR_DEFAULT_MASK;
pInfo->InterruptsEnabled = FALSE;
pInfo->CardReady = 0;
- pInfo->DSP_loading = 0;
pInfo->DSP_TIME[0] = 0;
pInfo->DSP_TIME[1] = 0;
pInfo->DSP_TIME[2] = 0;
info->fProvComplete = 1;
info->CardReady = 1;
- info->DSP_loading= 0;
return STATUS_SUCCESS;
}
// DEBUG("In probe: pft1000info=%x\n", pft1000info); // aelias [-] reason: warning: format ???%x??? expects type ???unsigned int???, but argument 2 has type ???struct FT1000_INFO *???
DEBUG("In probe: pft1000info=%p\n", pft1000info); // aelias [+] reason: up
- dsp_reload(ft1000dev);
+ ret = dsp_reload(ft1000dev);
+ if (ret) {
+ printk(KERN_ERR "Problem with DSP image loading\n");
+ goto err_load;
+ }
+
gPollingfailed = FALSE; //mbelian
pft1000info->pPollThread = kthread_run(ft1000_poll_thread, ft1000dev, "ft1000_poll");
msleep(500); //mbelian
-
- if ( pft1000info->DSP_loading )
- {
- DEBUG("ERROR!!!! RETURN FROM ft1000_probe **********************\n");
- return 0;
- }
-
while (!pft1000info->CardReady)
{
if ( gPollingfailed )
return 0;
+err_load:
+ kfree(pFileStart);
err_fw:
kfree(ft1000dev);
return ret;
int IOCTLBufLvl;
int DeviceCreated;
int CardReady;
- int DSP_loading;
int NetDevRegDone;
u8 CardNumber;
u8 DeviceName[15];
char *getfw (char *fn, size_t *pimgsz);
-void dsp_reload(struct ft1000_device *ft1000dev);
+int dsp_reload(struct ft1000_device *ft1000dev);
u16 init_ft1000_netdev(struct ft1000_device *ft1000dev);
struct usb_interface;
u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *intf);