staging: ft1000: Fix coding style in ft1000_dsp_prov function.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Marek Belisko 2011-03-10 11:51:34 +01:00 committed by Greg Kroah-Hartman
parent 8b2dab1cf8
commit fc796a6502

View File

@ -1439,92 +1439,97 @@ static bool ft1000_receive_cmd(struct ft1000_device *dev, u16 *pbuffer,
} }
} }
static int ft1000_dsp_prov(void *arg) static int ft1000_dsp_prov(void *arg)
{ {
struct ft1000_device *dev = (struct ft1000_device *)arg; struct ft1000_device *dev = (struct ft1000_device *)arg;
struct ft1000_info *info = netdev_priv(dev->net); struct ft1000_info *info = netdev_priv(dev->net);
u16 tempword; u16 tempword;
u16 len; u16 len;
u16 i=0; u16 i = 0;
struct prov_record *ptr; struct prov_record *ptr;
struct pseudo_hdr *ppseudo_hdr; struct pseudo_hdr *ppseudo_hdr;
u16 *pmsg; u16 *pmsg;
u16 status; u16 status;
u16 TempShortBuf [256]; u16 TempShortBuf[256];
DEBUG("*** DspProv Entered\n"); DEBUG("*** DspProv Entered\n");
while (list_empty(&info->prov_list) == 0) while (list_empty(&info->prov_list) == 0) {
{ DEBUG("DSP Provisioning List Entry\n");
DEBUG("DSP Provisioning List Entry\n");
// Check if doorbell is available /* Check if doorbell is available */
DEBUG("check if doorbell is cleared\n"); DEBUG("check if doorbell is cleared\n");
status = ft1000_read_register (dev, &tempword, FT1000_REG_DOORBELL); status =
if (status) ft1000_read_register(dev, &tempword, FT1000_REG_DOORBELL);
{ if (status) {
DEBUG("ft1000_dsp_prov::ft1000_read_register error\n"); DEBUG("ft1000_dsp_prov::ft1000_read_register error\n");
break; break;
} }
while (tempword & FT1000_DB_DPRAM_TX) { while (tempword & FT1000_DB_DPRAM_TX) {
mdelay(10); mdelay(10);
i++; i++;
if (i==10) { if (i == 10) {
DEBUG("FT1000:ft1000_dsp_prov:message drop\n"); DEBUG("FT1000:ft1000_dsp_prov:message drop\n");
return STATUS_FAILURE; return STATUS_FAILURE;
} }
ft1000_read_register(dev, &tempword, FT1000_REG_DOORBELL); ft1000_read_register(dev, &tempword,
} FT1000_REG_DOORBELL);
}
if ( !(tempword & FT1000_DB_DPRAM_TX) ) { if (!(tempword & FT1000_DB_DPRAM_TX)) {
DEBUG("*** Provision Data Sent to DSP\n"); DEBUG("*** Provision Data Sent to DSP\n");
// Send provisioning data /* Send provisioning data */
ptr = list_entry(info->prov_list.next, struct prov_record, list); ptr =
len = *(u16 *)ptr->pprov_data; list_entry(info->prov_list.next, struct prov_record,
len = htons(len); list);
len += PSEUDOSZ; len = *(u16 *) ptr->pprov_data;
len = htons(len);
len += PSEUDOSZ;
pmsg = (u16 *)ptr->pprov_data; pmsg = (u16 *) ptr->pprov_data;
ppseudo_hdr = (struct pseudo_hdr *)pmsg; ppseudo_hdr = (struct pseudo_hdr *)pmsg;
// Insert slow queue sequence number /* Insert slow queue sequence number */
ppseudo_hdr->seq_num = info->squeseqnum++; ppseudo_hdr->seq_num = info->squeseqnum++;
ppseudo_hdr->portsrc = 0; ppseudo_hdr->portsrc = 0;
// Calculate new checksum /* Calculate new checksum */
ppseudo_hdr->checksum = *pmsg++; ppseudo_hdr->checksum = *pmsg++;
//DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); //DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum);
for (i=1; i<7; i++) { for (i = 1; i < 7; i++) {
ppseudo_hdr->checksum ^= *pmsg++; ppseudo_hdr->checksum ^= *pmsg++;
//DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); //DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum);
} }
TempShortBuf[0] = 0; TempShortBuf[0] = 0;
TempShortBuf[1] = htons (len); TempShortBuf[1] = htons(len);
memcpy(&TempShortBuf[2], ppseudo_hdr, len); memcpy(&TempShortBuf[2], ppseudo_hdr, len);
status = ft1000_write_dpram32 (dev, 0, (u8 *)&TempShortBuf[0], (unsigned short)(len+2)); status =
status = ft1000_write_register (dev, FT1000_DB_DPRAM_TX, FT1000_REG_DOORBELL); ft1000_write_dpram32(dev, 0,
(u8 *) &TempShortBuf[0],
(unsigned short)(len + 2));
status =
ft1000_write_register(dev, FT1000_DB_DPRAM_TX,
FT1000_REG_DOORBELL);
list_del(&ptr->list); list_del(&ptr->list);
kfree(ptr->pprov_data); kfree(ptr->pprov_data);
kfree(ptr); kfree(ptr);
} }
msleep(10); msleep(10);
} }
DEBUG("DSP Provisioning List Entry finished\n"); DEBUG("DSP Provisioning List Entry finished\n");
msleep(100); msleep(100);
info->fProvComplete = 1; info->fProvComplete = 1;
info->CardReady = 1; info->CardReady = 1;
return STATUS_SUCCESS;
return STATUS_SUCCESS;
} }
static int ft1000_proc_drvmsg (struct ft1000_device *dev, u16 size) { static int ft1000_proc_drvmsg (struct ft1000_device *dev, u16 size) {
struct ft1000_info *info = netdev_priv(dev->net); struct ft1000_info *info = netdev_priv(dev->net);
u16 msgtype; u16 msgtype;