staging: ft1000: fix checkpatch issues in ft1000_poll()
The function ft1000_poll(), in ft1000_hw.c, has many miscellaneous coding style issues, such as improper indentation, C99 comments, use of msleep(), and lines over 80 characters. Changes all spaces at the start of lines to the proper number of tabs. Convert C99 comments to standard /* */ style. Change calls to msleep(10) to usleep_range(9000, 11000). Break lines over 80 characters, unless they are user visible strings. Remove space before open paren in function calls. Fix any other issues that checkpatch finds. Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f3802bdb15
commit
9a1261f317
|
@ -1517,11 +1517,10 @@ exit_failure:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ft1000_poll(void* dev_id)
|
int ft1000_poll(void *dev_id)
|
||||||
{
|
{
|
||||||
struct ft1000_usb *dev = (struct ft1000_usb *)dev_id;
|
struct ft1000_usb *dev = (struct ft1000_usb *)dev_id;
|
||||||
struct ft1000_info *info = netdev_priv(dev->net);
|
struct ft1000_info *info = netdev_priv(dev->net);
|
||||||
|
|
||||||
u16 tempword;
|
u16 tempword;
|
||||||
int status;
|
int status;
|
||||||
u16 size;
|
u16 size;
|
||||||
|
@ -1534,31 +1533,25 @@ int ft1000_poll(void* dev_id)
|
||||||
DEBUG("ft1000_poll::ft1000_chkcard: failed\n");
|
DEBUG("ft1000_poll::ft1000_chkcard: failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
status = ft1000_read_register(dev, &tempword, FT1000_REG_DOORBELL);
|
||||||
status = ft1000_read_register (dev, &tempword, FT1000_REG_DOORBELL);
|
if (!status) {
|
||||||
|
|
||||||
if ( !status )
|
|
||||||
{
|
|
||||||
|
|
||||||
if (tempword & FT1000_DB_DPRAM_RX) {
|
if (tempword & FT1000_DB_DPRAM_RX) {
|
||||||
|
status = ft1000_read_dpram16(dev,
|
||||||
status = ft1000_read_dpram16(dev, 0x200, (u8 *)&data, 0);
|
0x200, (u8 *)&data, 0);
|
||||||
size = ntohs(data) + 16 + 2;
|
size = ntohs(data) + 16 + 2;
|
||||||
if (size % 4) {
|
if (size % 4) {
|
||||||
modulo = 4 - (size % 4);
|
modulo = 4 - (size % 4);
|
||||||
size = size + modulo;
|
size = size + modulo;
|
||||||
}
|
}
|
||||||
status = ft1000_read_dpram16(dev, 0x201, (u8 *)&portid, 1);
|
status = ft1000_read_dpram16(dev, 0x201,
|
||||||
|
(u8 *)&portid, 1);
|
||||||
portid &= 0xff;
|
portid &= 0xff;
|
||||||
|
|
||||||
if (size < MAX_CMD_SQSIZE) {
|
if (size < MAX_CMD_SQSIZE) {
|
||||||
switch (portid)
|
switch (portid) {
|
||||||
{
|
|
||||||
case DRIVERID:
|
case DRIVERID:
|
||||||
DEBUG("ft1000_poll: FT1000_REG_DOORBELL message type: FT1000_DB_DPRAM_RX : portid DRIVERID\n");
|
DEBUG("ft1000_poll: FT1000_REG_DOORBELL message type: FT1000_DB_DPRAM_RX : portid DRIVERID\n");
|
||||||
|
status = ft1000_proc_drvmsg(dev, size);
|
||||||
status = ft1000_proc_drvmsg (dev, size);
|
if (status != 0)
|
||||||
if (status != 0 )
|
|
||||||
return status;
|
return status;
|
||||||
break;
|
break;
|
||||||
case DSPBCMSGID:
|
case DSPBCMSGID:
|
||||||
|
@ -1568,74 +1561,89 @@ int ft1000_poll(void* dev_id)
|
||||||
status = handle_misc_portid(dev);
|
status = handle_misc_portid(dev);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else {
|
|
||||||
DEBUG("FT1000:dpc:Invalid total length for SlowQ = %d\n", size);
|
DEBUG("FT1000:dpc:Invalid total length for SlowQ = %d\n", size);
|
||||||
}
|
status = ft1000_write_register(dev,
|
||||||
status = ft1000_write_register (dev, FT1000_DB_DPRAM_RX, FT1000_REG_DOORBELL);
|
FT1000_DB_DPRAM_RX,
|
||||||
}
|
FT1000_REG_DOORBELL);
|
||||||
else if (tempword & FT1000_DSP_ASIC_RESET) {
|
} else if (tempword & FT1000_DSP_ASIC_RESET) {
|
||||||
|
/* Let's reset the ASIC from the Host side as well */
|
||||||
// Let's reset the ASIC from the Host side as well
|
status = ft1000_write_register(dev, ASIC_RESET_BIT,
|
||||||
status = ft1000_write_register (dev, ASIC_RESET_BIT, FT1000_REG_RESET);
|
FT1000_REG_RESET);
|
||||||
status = ft1000_read_register (dev, &tempword, FT1000_REG_RESET);
|
status = ft1000_read_register(dev, &tempword,
|
||||||
|
FT1000_REG_RESET);
|
||||||
i = 0;
|
i = 0;
|
||||||
while (tempword & ASIC_RESET_BIT) {
|
while (tempword & ASIC_RESET_BIT) {
|
||||||
status = ft1000_read_register (dev, &tempword, FT1000_REG_RESET);
|
status = ft1000_read_register(dev, &tempword,
|
||||||
msleep(10);
|
FT1000_REG_RESET);
|
||||||
|
usleep_range(9000, 11000);
|
||||||
i++;
|
i++;
|
||||||
if (i==100)
|
if (i == 100)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i==100) {
|
if (i == 100) {
|
||||||
DEBUG("Unable to reset ASIC\n");
|
DEBUG("Unable to reset ASIC\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
msleep(10);
|
usleep_range(9000, 11000);
|
||||||
// Program WMARK register
|
/* Program WMARK register */
|
||||||
status = ft1000_write_register (dev, 0x600, FT1000_REG_MAG_WATERMARK);
|
status = ft1000_write_register(dev, 0x600,
|
||||||
// clear ASIC reset doorbell
|
FT1000_REG_MAG_WATERMARK);
|
||||||
status = ft1000_write_register (dev, FT1000_DSP_ASIC_RESET, FT1000_REG_DOORBELL);
|
/* clear ASIC reset doorbell */
|
||||||
msleep(10);
|
status = ft1000_write_register(dev,
|
||||||
}
|
FT1000_DSP_ASIC_RESET,
|
||||||
else if (tempword & FT1000_ASIC_RESET_REQ) {
|
FT1000_REG_DOORBELL);
|
||||||
|
usleep_range(9000, 11000);
|
||||||
|
} else if (tempword & FT1000_ASIC_RESET_REQ) {
|
||||||
DEBUG("ft1000_poll: FT1000_REG_DOORBELL message type: FT1000_ASIC_RESET_REQ\n");
|
DEBUG("ft1000_poll: FT1000_REG_DOORBELL message type: FT1000_ASIC_RESET_REQ\n");
|
||||||
|
/* clear ASIC reset request from DSP */
|
||||||
// clear ASIC reset request from DSP
|
status = ft1000_write_register(dev,
|
||||||
status = ft1000_write_register (dev, FT1000_ASIC_RESET_REQ, FT1000_REG_DOORBELL);
|
FT1000_ASIC_RESET_REQ,
|
||||||
status = ft1000_write_register (dev, HOST_INTF_BE, FT1000_REG_SUP_CTRL);
|
FT1000_REG_DOORBELL);
|
||||||
// copy dsp session record from Adapter block
|
status = ft1000_write_register(dev, HOST_INTF_BE,
|
||||||
status = ft1000_write_dpram32 (dev, 0, (u8 *)&info->DSPSess.Rec[0], 1024);
|
FT1000_REG_SUP_CTRL);
|
||||||
// Program WMARK register
|
/* copy dsp session record from Adapter block */
|
||||||
status = ft1000_write_register (dev, 0x600, FT1000_REG_MAG_WATERMARK);
|
status = ft1000_write_dpram32(dev, 0,
|
||||||
// ring doorbell to tell DSP that ASIC is out of reset
|
(u8 *)&info->DSPSess.Rec[0], 1024);
|
||||||
status = ft1000_write_register (dev, FT1000_ASIC_RESET_DSP, FT1000_REG_DOORBELL);
|
status = ft1000_write_register(dev, 0x600,
|
||||||
}
|
FT1000_REG_MAG_WATERMARK);
|
||||||
else if (tempword & FT1000_DB_COND_RESET) {
|
/* ring doorbell to tell DSP that
|
||||||
|
* ASIC is out of reset
|
||||||
|
* */
|
||||||
|
status = ft1000_write_register(dev,
|
||||||
|
FT1000_ASIC_RESET_DSP,
|
||||||
|
FT1000_REG_DOORBELL);
|
||||||
|
} else if (tempword & FT1000_DB_COND_RESET) {
|
||||||
DEBUG("ft1000_poll: FT1000_REG_DOORBELL message type: FT1000_DB_COND_RESET\n");
|
DEBUG("ft1000_poll: FT1000_REG_DOORBELL message type: FT1000_DB_COND_RESET\n");
|
||||||
|
|
||||||
if (!dev->fAppMsgPend) {
|
if (!dev->fAppMsgPend) {
|
||||||
// Reset ASIC and DSP
|
/* Reset ASIC and DSP */
|
||||||
|
status = ft1000_read_dpram16(dev,
|
||||||
status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, (u8 *)&(info->DSP_TIME[0]), FT1000_MAG_DSP_TIMER0_INDX);
|
FT1000_MAG_DSP_TIMER0,
|
||||||
status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, (u8 *)&(info->DSP_TIME[1]), FT1000_MAG_DSP_TIMER1_INDX);
|
(u8 *)&(info->DSP_TIME[0]),
|
||||||
status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, (u8 *)&(info->DSP_TIME[2]), FT1000_MAG_DSP_TIMER2_INDX);
|
FT1000_MAG_DSP_TIMER0_INDX);
|
||||||
status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, (u8 *)&(info->DSP_TIME[3]), FT1000_MAG_DSP_TIMER3_INDX);
|
status = ft1000_read_dpram16(dev,
|
||||||
|
FT1000_MAG_DSP_TIMER1,
|
||||||
|
(u8 *)&(info->DSP_TIME[1]),
|
||||||
|
FT1000_MAG_DSP_TIMER1_INDX);
|
||||||
|
status = ft1000_read_dpram16(dev,
|
||||||
|
FT1000_MAG_DSP_TIMER2,
|
||||||
|
(u8 *)&(info->DSP_TIME[2]),
|
||||||
|
FT1000_MAG_DSP_TIMER2_INDX);
|
||||||
|
status = ft1000_read_dpram16(dev,
|
||||||
|
FT1000_MAG_DSP_TIMER3,
|
||||||
|
(u8 *)&(info->DSP_TIME[3]),
|
||||||
|
FT1000_MAG_DSP_TIMER3_INDX);
|
||||||
info->CardReady = 0;
|
info->CardReady = 0;
|
||||||
info->DrvErrNum = DSP_CONDRESET_INFO;
|
info->DrvErrNum = DSP_CONDRESET_INFO;
|
||||||
DEBUG("ft1000_hw:DSP conditional reset requested\n");
|
DEBUG("ft1000_hw:DSP conditional reset requested\n");
|
||||||
info->ft1000_reset(dev->net);
|
info->ft1000_reset(dev->net);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
dev->fProvComplete = false;
|
dev->fProvComplete = false;
|
||||||
dev->fCondResetPend = true;
|
dev->fCondResetPend = true;
|
||||||
}
|
}
|
||||||
|
ft1000_write_register(dev, FT1000_DB_COND_RESET,
|
||||||
ft1000_write_register(dev, FT1000_DB_COND_RESET, FT1000_REG_DOORBELL);
|
FT1000_REG_DOORBELL);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue