aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c')
-rw-r--r--drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
index 47cc365c630b..6311b2ff5816 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
@@ -132,16 +132,16 @@ void card_bootload(struct net_device *dev)
pdata = (u32 *) bootimage;
size = sizeof(bootimage);
- // check for odd word
- if (size & 0x0003) {
+ /* check for odd word */
+ if (size & 0x0003)
size += 4;
- }
- // Provide mutual exclusive access while reading ASIC registers.
+
+ /* Provide mutual exclusive access while reading ASIC registers. */
spin_lock_irqsave(&info->dpram_lock, flags);
- // need to set i/o base address initially and hardware will autoincrement
+ /* need to set i/o base address initially and hardware will autoincrement */
ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, FT1000_DPRAM_BASE);
- // write bytes
+ /* write bytes */
for (i = 0; i < (size >> 2); i++) {
templong = *pdata++;
outl(templong, dev->base_addr + FT1000_REG_MAG_DPDATA);
@@ -345,11 +345,10 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
handshake = get_handshake(dev, HANDSHAKE_DSP_BL_READY);
- if (handshake == HANDSHAKE_DSP_BL_READY) {
+ if (handshake == HANDSHAKE_DSP_BL_READY)
put_handshake(dev, HANDSHAKE_DRIVER_READY);
- } else {
+ else
Status = FAILURE;
- }
uiState = STATE_BOOT_DWNLD;
@@ -391,7 +390,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
Status = FAILURE;
break;
}
- // Provide mutual exclusive access while reading ASIC registers.
+ /* Provide mutual exclusive access while reading ASIC registers. */
spin_lock_irqsave(&info->dpram_lock,
flags);
/*
@@ -505,15 +504,15 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
break;
case REQUEST_MAILBOX_DATA:
- // 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)(info->DSPInfoBlklen + 1) / 2;
put_request_value(dev, word_length);
pMailBoxData =
- (struct drv_msg *) & info->DSPInfoBlk[0];
+ (struct drv_msg *) &info->DSPInfoBlk[0];
pUsData =
- (u16 *) & pMailBoxData->data[0];
- // Provide mutual exclusive access while reading ASIC registers.
+ (u16 *) &pMailBoxData->data[0];
+ /* Provide mutual exclusive access while reading ASIC registers. */
spin_lock_irqsave(&info->dpram_lock,
flags);
if (file_version == 5) {
@@ -538,9 +537,9 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
outw(DWNLD_MAG_PS_HDR_LOC,
dev->base_addr +
FT1000_REG_DPRAM_ADDR);
- if (word_length & 0x01) {
+ if (word_length & 0x01)
word_length++;
- }
+
word_length = word_length / 2;
for (; word_length > 0; word_length--) { /* In words */
@@ -565,7 +564,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
(u16 *) ((long)pFileStart +
pFileHdr5->
version_data_offset);
- // Provide mutual exclusive access while reading ASIC registers.
+ /* Provide mutual exclusive access while reading ASIC registers. */
spin_lock_irqsave(&info->dpram_lock,
flags);
/*
@@ -692,7 +691,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
if (pHdr->portdest == 0x80 /* DspOAM */
&& (pHdr->portsrc == 0x00 /* Driver */
- || pHdr->portsrc == 0x10 /* FMM */ )) {
+ || pHdr->portsrc == 0x10 /* FMM */)) {
uiState = STATE_SECTION_PROV;
} else {
DEBUG(1,
@@ -711,13 +710,13 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
pHdr = (struct pseudo_hdr *) pUcFile;
if (pHdr->checksum == hdr_checksum(pHdr)) {
- if (pHdr->portdest != 0x80 /* Dsp OAM */ ) {
+ if (pHdr->portdest != 0x80 /* Dsp OAM */) {
uiState = STATE_DONE_PROV;
break;
}
usHdrLength = ntohs(pHdr->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);
@@ -725,7 +724,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
memcpy(pbuffer, (void *)pUcFile,
(u32) (usHdrLength +
sizeof(struct pseudo_hdr)));
- // link provisioning data
+ /* link provisioning data */
pprov_record =
kmalloc(sizeof(struct prov_record),
GFP_ATOMIC);
@@ -735,7 +734,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
list_add_tail(&pprov_record->
list,
&info->prov_list);
- // Move to next entry if available
+ /* Move to next entry if available */
pUcFile =
(u8 *) ((unsigned long) pUcFile +
(unsigned long) ((usHdrLength + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr));