staging: ft1000: Whitespace neatening

Use normal kernel style, indentation and alignment.

git diff -w shows no difference

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Joe Perches 2014-11-03 16:25:43 -08:00 committed by Greg Kroah-Hartman
parent 4884434c03
commit ecdd21c7b9
11 changed files with 1388 additions and 1388 deletions

View file

@ -1,28 +1,28 @@
/*---------------------------------------------------------------------------
FT1000 driver for Flarion Flash OFDM NIC Device
FT1000 driver for Flarion Flash OFDM NIC Device
Copyright (C) 2002 Flarion Technologies, All rights reserved.
Copyright (C) 2002 Flarion Technologies, All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
---------------------------------------------------------------------------
File: boot.h
File: boot.h
Description: boatloader
Description: boatloader
History:
1/11/05 Whc Ported to Linux.
History:
1/11/05 Whc Ported to Linux.
---------------------------------------------------------------------------*/
---------------------------------------------------------------------------*/
#ifndef _BOOTH_
#define _BOOTH_

View file

@ -1,21 +1,21 @@
/*---------------------------------------------------------------------------
FT1000 driver for Flarion Flash OFDM NIC Device
FT1000 driver for Flarion Flash OFDM NIC Device
Copyright (C) 2002 Flarion Technologies, All rights reserved.
Copyright (C) 2002 Flarion Technologies, All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
---------------------------------------------------------------------------
Description: Common structures and defines
---------------------------------------------------------------------------*/
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
---------------------------------------------------------------------------
Description: Common structures and defines
---------------------------------------------------------------------------*/
#ifndef _FT1000H_
#define _FT1000H_

View file

@ -1,30 +1,30 @@
/*---------------------------------------------------------------------------
FT1000 driver for Flarion Flash OFDM NIC Device
FT1000 driver for Flarion Flash OFDM NIC Device
Copyright (C) 1999 David A. Hinds. All Rights Reserved.
Copyright (C) 2002 Flarion Technologies, All rights reserved.
Copyright (C) 2006 Patrik Ostrihon, All rights reserved.
Copyright (C) 2006 ProWeb Consulting, a.s, All rights reserved.
Copyright (C) 1999 David A. Hinds. All Rights Reserved.
Copyright (C) 2002 Flarion Technologies, All rights reserved.
Copyright (C) 2006 Patrik Ostrihon, All rights reserved.
Copyright (C) 2006 ProWeb Consulting, a.s, All rights reserved.
The initial developer of the original code is David A. Hinds
<dahinds@users.sourceforge.net>. Portions created by David A. Hinds.
The initial developer of the original code is David A. Hinds
<dahinds@users.sourceforge.net>. Portions created by David A. Hinds.
This file was modified to support the Flarion Flash OFDM NIC Device
by Wai Chan (w.chan@flarion.com).
This file was modified to support the Flarion Flash OFDM NIC Device
by Wai Chan (w.chan@flarion.com).
Port for kernel 2.6 created by Patrik Ostrihon (patrik.ostrihon@pwc.sk)
Port for kernel 2.6 created by Patrik Ostrihon (patrik.ostrihon@pwc.sk)
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------------*/
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------------*/
#include <linux/kernel.h>
#include <linux/module.h>
@ -80,11 +80,11 @@ static int ft1000_confcheck(struct pcmcia_device *link, void *priv_data)
/*======================================================================
ft1000_config() is scheduled to run after a CARD_INSERTION event
is received, to configure the PCMCIA socket, and to make the
device available to the system.
ft1000_config() is scheduled to run after a CARD_INSERTION event
is received, to configure the PCMCIA socket, and to make the
device available to the system.
======================================================================*/
======================================================================*/
static int ft1000_config(struct pcmcia_device *link)
{

View file

@ -1,24 +1,24 @@
/*---------------------------------------------------------------------------
FT1000 driver for Flarion Flash OFDM NIC Device
FT1000 driver for Flarion Flash OFDM NIC Device
Copyright (C) 2002 Flarion Technologies, All rights reserved.
Copyright (C) 2002 Flarion Technologies, All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
--------------------------------------------------------------------------
Description: This module will handshake with the DSP bootloader to
download the DSP runtime image.
Description: This module will handshake with the DSP bootloader to
download the DSP runtime image.
---------------------------------------------------------------------------*/
---------------------------------------------------------------------------*/
#define __KERNEL_SYSCALLS__
@ -114,7 +114,7 @@ struct dsp_image_info {
void card_bootload(struct net_device *dev)
{
struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
struct ft1000_info *info = (struct ft1000_info *)netdev_priv(dev);
unsigned long flags;
u32 *pdata;
u32 size;
@ -123,7 +123,7 @@ void card_bootload(struct net_device *dev)
netdev_dbg(dev, "card_bootload is called\n");
pdata = (u32 *) bootimage;
pdata = (u32 *)bootimage;
size = sizeof(bootimage);
/* check for odd word */
@ -146,7 +146,7 @@ void card_bootload(struct net_device *dev)
u16 get_handshake(struct net_device *dev, u16 expected_value)
{
struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
struct ft1000_info *info = (struct ft1000_info *)netdev_priv(dev);
u16 handshake;
u32 tempx;
int loopcnt;
@ -161,12 +161,12 @@ u16 get_handshake(struct net_device *dev, u16 expected_value)
} else {
tempx =
ntohl(ft1000_read_dpram_mag_32
(dev, DWNLD_MAG_HANDSHAKE_LOC));
handshake = (u16) tempx;
(dev, DWNLD_MAG_HANDSHAKE_LOC));
handshake = (u16)tempx;
}
if ((handshake == expected_value)
|| (handshake == HANDSHAKE_RESET_VALUE)) {
|| (handshake == HANDSHAKE_RESET_VALUE)) {
return handshake;
}
loopcnt++;
@ -180,7 +180,7 @@ u16 get_handshake(struct net_device *dev, u16 expected_value)
void put_handshake(struct net_device *dev, u16 handshake_value)
{
struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
struct ft1000_info *info = (struct ft1000_info *)netdev_priv(dev);
u32 tempx;
if (info->AsicID == ELECTRABUZZ_ID) {
@ -188,7 +188,7 @@ void put_handshake(struct net_device *dev, u16 handshake_value)
DWNLD_HANDSHAKE_LOC);
ft1000_write_reg(dev, FT1000_REG_DPRAM_DATA, handshake_value); /* Handshake */
} else {
tempx = (u32) handshake_value;
tempx = (u32)handshake_value;
tempx = ntohl(tempx);
ft1000_write_dpram_mag_32(dev, DWNLD_MAG_HANDSHAKE_LOC, tempx); /* Handshake */
}
@ -196,7 +196,7 @@ void put_handshake(struct net_device *dev, u16 handshake_value)
u16 get_request_type(struct net_device *dev)
{
struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
struct ft1000_info *info = (struct ft1000_info *)netdev_priv(dev);
u16 request_type;
u32 tempx;
@ -206,7 +206,7 @@ u16 get_request_type(struct net_device *dev)
} else {
tempx = ft1000_read_dpram_mag_32(dev, DWNLD_MAG_TYPE_LOC);
tempx = ntohl(tempx);
request_type = (u16) tempx;
request_type = (u16)tempx;
}
return request_type;
@ -215,7 +215,7 @@ u16 get_request_type(struct net_device *dev)
long get_request_value(struct net_device *dev)
{
struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
struct ft1000_info *info = (struct ft1000_info *)netdev_priv(dev);
long value;
u16 w_val;
@ -244,7 +244,7 @@ long get_request_value(struct net_device *dev)
void put_request_value(struct net_device *dev, long lvalue)
{
struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
struct ft1000_info *info = (struct ft1000_info *)netdev_priv(dev);
u16 size;
u32 tempx;
@ -271,11 +271,11 @@ void put_request_value(struct net_device *dev, long lvalue)
u16 hdr_checksum(struct pseudo_hdr *pHdr)
{
u16 *usPtr = (u16 *) pHdr;
u16 *usPtr = (u16 *)pHdr;
u16 chksum;
chksum = ((((((usPtr[0] ^ usPtr[1]) ^ usPtr[2]) ^ usPtr[3]) ^
usPtr[4]) ^ usPtr[5]) ^ usPtr[6]);
usPtr[4]) ^ usPtr[5]) ^ usPtr[6]);
return chksum;
}
@ -283,7 +283,7 @@ u16 hdr_checksum(struct pseudo_hdr *pHdr)
int card_download(struct net_device *dev, const u8 *pFileStart,
size_t FileLength)
{
struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
struct ft1000_info *info = (struct ft1000_info *)netdev_priv(dev);
int Status = SUCCESS;
u32 uiState;
u16 handshake;
@ -322,7 +322,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
uiState = STATE_START_DWNLD;
pFileHdr5 = (struct dsp_file_hdr *) pFileStart;
pFileHdr5 = (struct dsp_file_hdr *)pFileStart;
pUsFile = (u16 *) ((long)pFileStart + pFileHdr5->loader_offset);
pUcFile = (u8 *) ((long)pFileStart + pFileHdr5->loader_offset);
@ -376,7 +376,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
break;
}
if ((word_length * 2 + (long)pUcFile) >
(long)pBootEnd) {
(long)pBootEnd) {
/*
* Error, beyond boot code range.
*/
@ -390,8 +390,8 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
* Position ASIC DPRAM auto-increment pointer.
*/
outw(DWNLD_MAG_PS_HDR_LOC,
dev->base_addr +
FT1000_REG_DPRAM_ADDR);
dev->base_addr +
FT1000_REG_DPRAM_ADDR);
if (word_length & 0x01)
word_length++;
word_length = word_length / 2;
@ -402,12 +402,12 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
(*pUsFile++ << 16);
pUcFile += 4;
outl(templong,
dev->base_addr +
FT1000_REG_MAG_DPDATAL);
dev->base_addr +
FT1000_REG_MAG_DPDATAL);
}
spin_unlock_irqrestore(&info->
dpram_lock,
flags);
dpram_lock,
flags);
break;
default:
Status = FAILURE;
@ -430,7 +430,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
switch (request) {
case REQUEST_FILE_CHECKSUM:
netdev_dbg(dev,
"ft1000_dnld: REQUEST_FOR_CHECKSUM\n");
"ft1000_dnld: REQUEST_FOR_CHECKSUM\n");
put_request_value(dev, image_chksum);
break;
case REQUEST_RUN_ADDRESS:
@ -468,7 +468,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
break;
}
if ((word_length * 2 + (long)pUcFile) >
(long)pCodeEnd) {
(long)pCodeEnd) {
/*
* Error, beyond boot code range.
*/
@ -479,8 +479,8 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
* Position ASIC DPRAM auto-increment pointer.
*/
outw(DWNLD_MAG_PS_HDR_LOC,
dev->base_addr +
FT1000_REG_DPRAM_ADDR);
dev->base_addr +
FT1000_REG_DPRAM_ADDR);
if (word_length & 0x01)
word_length++;
word_length = word_length / 2;
@ -491,8 +491,8 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
(*pUsFile++ << 16);
pUcFile += 4;
outl(templong,
dev->base_addr +
FT1000_REG_MAG_DPDATAL);
dev->base_addr +
FT1000_REG_MAG_DPDATAL);
}
break;
@ -502,9 +502,9 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
(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];
(u16 *)&pMailBoxData->data[0];
/* Provide mutual exclusive access while reading ASIC registers. */
spin_lock_irqsave(&info->dpram_lock,
flags);
@ -528,8 +528,8 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
* Position ASIC DPRAM auto-increment pointer.
*/
outw(DWNLD_MAG_PS_HDR_LOC,
dev->base_addr +
FT1000_REG_DPRAM_ADDR);
dev->base_addr +
FT1000_REG_DPRAM_ADDR);
if (word_length & 0x01)
word_length++;
@ -540,13 +540,13 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
templong |=
(*pUsData++ << 16);
outl(templong,
dev->base_addr +
FT1000_REG_MAG_DPDATAL);
dev->base_addr +
FT1000_REG_MAG_DPDATAL);
}
}
spin_unlock_irqrestore(&info->
dpram_lock,
flags);
dpram_lock,
flags);
break;
case REQUEST_VERSION_INFO:
@ -555,8 +555,8 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
put_request_value(dev, word_length);
pUsFile =
(u16 *) ((long)pFileStart +
pFileHdr5->
version_data_offset);
pFileHdr5->
version_data_offset);
/* Provide mutual exclusive access while reading ASIC registers. */
spin_lock_irqsave(&info->dpram_lock,
flags);
@ -564,8 +564,8 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
* Position ASIC DPRAM auto-increment pointer.
*/
outw(DWNLD_MAG_PS_HDR_LOC,
dev->base_addr +
FT1000_REG_DPRAM_ADDR);
dev->base_addr +
FT1000_REG_DPRAM_ADDR);
if (word_length & 0x01)
word_length++;
word_length = word_length / 2;
@ -578,12 +578,12 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
templong |=
(temp << 16);
outl(templong,
dev->base_addr +
FT1000_REG_MAG_DPDATAL);
dev->base_addr +
FT1000_REG_MAG_DPDATAL);
}
spin_unlock_irqrestore(&info->
dpram_lock,
flags);
dpram_lock,
flags);
break;
case REQUEST_CODE_BY_VERSION:
@ -592,14 +592,14 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
get_request_value(dev);
pDspImageInfoV6 =
(struct dsp_image_info *) ((long)
pFileStart
+
sizeof
(struct dsp_file_hdr));
pFileStart
+
sizeof
(struct dsp_file_hdr));
for (imageN = 0;
imageN <
pFileHdr5->nDspImages;
imageN++) {
imageN <
pFileHdr5->nDspImages;
imageN++) {
temp = (u16)
(pDspImageInfoV6->
version);
@ -610,30 +610,30 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
templong |=
(temp << 16);
if (templong ==
requested_version) {
requested_version) {
bGoodVersion =
true;
pUsFile =
(u16
*) ((long)
pFileStart
+
pDspImageInfoV6->
begin_offset);
pFileStart
+
pDspImageInfoV6->
begin_offset);
pUcFile =
(u8
*) ((long)
pFileStart
+
pDspImageInfoV6->
begin_offset);
pFileStart
+
pDspImageInfoV6->
begin_offset);
pCodeEnd =
(u8
*) ((long)
pFileStart
+
pDspImageInfoV6->
end_offset);
pFileStart
+
pDspImageInfoV6->
end_offset);
run_address =
pDspImageInfoV6->
run_address;
@ -645,10 +645,10 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
pDspImageInfoV6->
checksum;
netdev_dbg(dev,
"ft1000_dnld: image_chksum = 0x%8x\n",
(unsigned
int)
image_chksum);
"ft1000_dnld: image_chksum = 0x%8x\n",
(unsigned
int)
image_chksum);
break;
}
pDspImageInfoV6++;
@ -674,25 +674,25 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
break;
case STATE_DONE_DWNLD:
if (((unsigned long) (pUcFile) - (unsigned long) pFileStart) >=
(unsigned long) FileLength) {
if (((unsigned long)(pUcFile) - (unsigned long) pFileStart) >=
(unsigned long)FileLength) {
uiState = STATE_DONE_FILE;
break;
}
pHdr = (struct pseudo_hdr *) pUsFile;
pHdr = (struct pseudo_hdr *)pUsFile;
if (pHdr->portdest == 0x80 /* DspOAM */
&& (pHdr->portsrc == 0x00 /* Driver */
&& (pHdr->portsrc == 0x00 /* Driver */
|| pHdr->portsrc == 0x10 /* FMM */)) {
uiState = STATE_SECTION_PROV;
} else {
netdev_dbg(dev,
"FT1000:download:Download error: Bad Port IDs in Pseudo Record\n");
"FT1000:download:Download error: Bad Port IDs in Pseudo Record\n");
netdev_dbg(dev, "\t Port Source = 0x%2.2x\n",
pHdr->portsrc);
pHdr->portsrc);
netdev_dbg(dev, "\t Port Destination = 0x%2.2x\n",
pHdr->portdest);
pHdr->portdest);
Status = FAILURE;
}
@ -700,7 +700,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
case STATE_SECTION_PROV:
pHdr = (struct pseudo_hdr *) pUcFile;
pHdr = (struct pseudo_hdr *)pUcFile;
if (pHdr->checksum == hdr_checksum(pHdr)) {
if (pHdr->portdest != 0x80 /* Dsp OAM */) {
@ -715,8 +715,8 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
GFP_ATOMIC);
if (pbuffer) {
memcpy(pbuffer, (void *)pUcFile,
(u32) (usHdrLength +
sizeof(struct pseudo_hdr)));
(u32) (usHdrLength +
sizeof(struct pseudo_hdr)));
/* link provisioning data */
pprov_record =
kmalloc(sizeof(struct prov_record),
@ -725,15 +725,15 @@ int card_download(struct net_device *dev, const u8 *pFileStart,
pprov_record->pprov_data =
pbuffer;
list_add_tail(&pprov_record->
list,
&info->prov_list);
list,
&info->prov_list);
/* Move to next entry if available */
pUcFile =
(u8 *) ((unsigned long) pUcFile +
(unsigned long) ((usHdrLength + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr));
(u8 *)((unsigned long) pUcFile +
(unsigned long) ((usHdrLength + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr));
if ((unsigned long) (pUcFile) -
(unsigned long) (pFileStart) >=
(unsigned long) FileLength) {
(unsigned long) (pFileStart) >=
(unsigned long)FileLength) {
uiState =
STATE_DONE_FILE;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
/*
* CopyRight (C) 2007 Qualcomm Inc. All Rights Reserved.
*
* This file is part of Express Card USB Driver
*/
* CopyRight (C) 2007 Qualcomm Inc. All Rights Reserved.
*
* This file is part of Express Card USB Driver
*/
#include <linux/kernel.h>
#include <linux/module.h>
@ -117,17 +117,17 @@ static int check_usb_db(struct ft1000_usb *ft1000dev)
while (loopcnt < 10) {
status = ft1000_read_register(ft1000dev, &temp,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
DEBUG("check_usb_db: read FT1000_REG_DOORBELL value is %x\n",
temp);
temp);
if (temp & 0x0080) {
DEBUG("FT1000:Got checkusb doorbell\n");
status = ft1000_write_register(ft1000dev, 0x0080,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
status = ft1000_write_register(ft1000dev, 0x0100,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
status = ft1000_write_register(ft1000dev, 0x8000,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
break;
}
loopcnt++;
@ -138,7 +138,7 @@ static int check_usb_db(struct ft1000_usb *ft1000dev)
loopcnt = 0;
while (loopcnt < 20) {
status = ft1000_read_register(ft1000dev, &temp,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
DEBUG("FT1000:check_usb_db:Doorbell = 0x%x\n", temp);
if (temp & 0x8000) {
loopcnt++;
@ -164,10 +164,10 @@ static u16 get_handshake(struct ft1000_usb *ft1000dev, u16 expected_value)
while (loopcnt < 100) {
/* Need to clear downloader doorbell if Hartley ASIC */
status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_RX,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
if (ft1000dev->fcodeldr) {
DEBUG(" get_handshake: fcodeldr is %d\n",
ft1000dev->fcodeldr);
ft1000dev->fcodeldr);
ft1000dev->fcodeldr = 0;
status = check_usb_db(ft1000dev);
if (status != 0) {
@ -175,12 +175,12 @@ static u16 get_handshake(struct ft1000_usb *ft1000dev, u16 expected_value)
break;
}
status = ft1000_write_register(ft1000dev,
FT1000_DB_DNLD_RX,
FT1000_REG_DOORBELL);
FT1000_DB_DNLD_RX,
FT1000_REG_DOORBELL);
}
status = ft1000_read_dpram16(ft1000dev,
DWNLD_MAG1_HANDSHAKE_LOC, (u8 *)&handshake, 1);
DWNLD_MAG1_HANDSHAKE_LOC, (u8 *)&handshake, 1);
handshake = ntohs(handshake);
if (status)
@ -209,12 +209,12 @@ static void put_handshake(struct ft1000_usb *ft1000dev, u16 handshake_value)
tempword = (u16)(tempx & 0xffff);
status = ft1000_write_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC,
tempword, 0);
tempword, 0);
tempword = (u16)(tempx >> 16);
status = ft1000_write_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC,
tempword, 1);
tempword, 1);
status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
}
static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value)
@ -230,27 +230,27 @@ static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value)
while (loopcnt < 100) {
if (ft1000dev->usbboot == 2) {
status = ft1000_read_dpram32(ft1000dev, 0,
(u8 *)&(ft1000dev->tempbuf[0]), 64);
(u8 *)&(ft1000dev->tempbuf[0]), 64);
for (temp = 0; temp < 16; temp++) {
DEBUG("tempbuf %d = 0x%x\n", temp,
ft1000dev->tempbuf[temp]);
ft1000dev->tempbuf[temp]);
}
status = ft1000_read_dpram16(ft1000dev,
DWNLD_MAG1_HANDSHAKE_LOC,
(u8 *)&handshake, 1);
DWNLD_MAG1_HANDSHAKE_LOC,
(u8 *)&handshake, 1);
DEBUG("handshake from read_dpram16 = 0x%x\n",
handshake);
handshake);
if (ft1000dev->dspalive == ft1000dev->tempbuf[6]) {
handshake = 0;
} else {
handshake = ft1000dev->tempbuf[1];
ft1000dev->dspalive =
ft1000dev->tempbuf[6];
ft1000dev->tempbuf[6];
}
} else {
status = ft1000_read_dpram16(ft1000dev,
DWNLD_MAG1_HANDSHAKE_LOC,
(u8 *)&handshake, 1);
DWNLD_MAG1_HANDSHAKE_LOC,
(u8 *)&handshake, 1);
}
loopcnt++;
@ -281,12 +281,12 @@ static u16 get_request_type(struct ft1000_usb *ft1000dev)
if (ft1000dev->bootmode == 1) {
status = fix_ft1000_read_dpram32(ft1000dev,
DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx);
DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx);
tempx = ntohl(tempx);
} else {
tempx = 0;
status = ft1000_read_dpram16(ft1000dev,
DWNLD_MAG1_TYPE_LOC, (u8 *)&tempword, 1);
DWNLD_MAG1_TYPE_LOC, (u8 *)&tempword, 1);
tempx |= (tempword << 16);
tempx = ntohl(tempx);
}
@ -304,7 +304,7 @@ static u16 get_request_type_usb(struct ft1000_usb *ft1000dev)
if (ft1000dev->bootmode == 1) {
status = fix_ft1000_read_dpram32(ft1000dev,
DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx);
DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx);
tempx = ntohl(tempx);
} else {
if (ft1000dev->usbboot == 2) {
@ -313,8 +313,8 @@ static u16 get_request_type_usb(struct ft1000_usb *ft1000dev)
} else {
tempx = 0;
status = ft1000_read_dpram16(ft1000dev,
DWNLD_MAG1_TYPE_LOC,
(u8 *)&tempword, 1);
DWNLD_MAG1_TYPE_LOC,
(u8 *)&tempword, 1);
}
tempx |= (tempword << 16);
tempx = ntohl(tempx);
@ -332,14 +332,14 @@ static long get_request_value(struct ft1000_usb *ft1000dev)
if (ft1000dev->bootmode == 1) {
status = fix_ft1000_read_dpram32(ft1000dev,
DWNLD_MAG1_SIZE_LOC, (u8 *)&value);
DWNLD_MAG1_SIZE_LOC, (u8 *)&value);
value = ntohl(value);
} else {
status = ft1000_read_dpram16(ft1000dev,
DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 0);
DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 0);
value = tempword;
status = ft1000_read_dpram16(ft1000dev,
DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 1);
DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 1);
value |= (tempword << 16);
value = ntohl(value);
}
@ -369,7 +369,7 @@ static u16 hdr_checksum(struct pseudo_hdr *pHdr)
chksum = ((((((usPtr[0] ^ usPtr[1]) ^ usPtr[2]) ^ usPtr[3]) ^
usPtr[4]) ^ usPtr[5]) ^ usPtr[6]);
usPtr[4]) ^ usPtr[5]) ^ usPtr[6]);
return chksum;
}
@ -387,7 +387,7 @@ static int check_buffers(u16 *buff_w, u16 *buff_r, int len, int offset)
}
static int write_dpram32_and_check(struct ft1000_usb *ft1000dev,
u16 tempbuffer[], u16 dpram)
u16 tempbuffer[], u16 dpram)
{
int status;
u16 resultbuffer[64];
@ -395,37 +395,37 @@ static int write_dpram32_and_check(struct ft1000_usb *ft1000dev,
for (i = 0; i < 10; i++) {
status = ft1000_write_dpram32(ft1000dev, dpram,
(u8 *)&tempbuffer[0], 64);
(u8 *)&tempbuffer[0], 64);
if (status == 0) {
/* Work around for ASIC bit stuffing problem. */
if ((tempbuffer[31] & 0xfe00) == 0xfe00) {
status = ft1000_write_dpram32(ft1000dev,
dpram+12, (u8 *)&tempbuffer[24],
64);
dpram+12, (u8 *)&tempbuffer[24],
64);
}
/* Let's check the data written */
status = ft1000_read_dpram32(ft1000dev, dpram,
(u8 *)&resultbuffer[0], 64);
(u8 *)&resultbuffer[0], 64);
if ((tempbuffer[31] & 0xfe00) == 0xfe00) {
if (check_buffers(tempbuffer, resultbuffer, 28,
0)) {
0)) {
DEBUG("FT1000:download:DPRAM write failed 1 during bootloading\n");
usleep_range(9000, 11000);
break;
}
status = ft1000_read_dpram32(ft1000dev,
dpram+12,
(u8 *)&resultbuffer[0], 64);
dpram+12,
(u8 *)&resultbuffer[0], 64);
if (check_buffers(tempbuffer, resultbuffer, 16,
24)) {
24)) {
DEBUG("FT1000:download:DPRAM write failed 2 during bootloading\n");
usleep_range(9000, 11000);
break;
}
} else {
if (check_buffers(tempbuffer, resultbuffer, 32,
0)) {
0)) {
DEBUG("FT1000:download:DPRAM write failed 3 during bootloading\n");
usleep_range(9000, 11000);
break;
@ -445,7 +445,7 @@ static int write_dpram32_and_check(struct ft1000_usb *ft1000dev,
* long word_length - length of the buffer to be written to DPRAM
*/
static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile,
long word_length)
long word_length)
{
int status = 0;
u16 dpram;
@ -489,13 +489,13 @@ static int write_blk(struct ft1000_usb *ft1000dev, u16 **pUsFile, u8 **pUcFile,
if (ft1000dev->bootmode == 0) {
if (dpram >= 0x3F4)
status = ft1000_write_dpram32(ft1000dev, dpram,
(u8 *)&tempbuffer[0], 8);
(u8 *)&tempbuffer[0], 8);
else
status = ft1000_write_dpram32(ft1000dev, dpram,
(u8 *)&tempbuffer[0], 64);
(u8 *)&tempbuffer[0], 64);
} else {
status = write_dpram32_and_check(ft1000dev, tempbuffer,
dpram);
dpram);
if (status != 0) {
DEBUG("FT1000:download:Write failed tempbuffer[31] = 0x%x\n", tempbuffer[31]);
break;
@ -548,7 +548,7 @@ static int write_blk_fifo(struct ft1000_usb *ft1000dev, u16 **pUsFile,
}
static int scram_start_dwnld(struct ft1000_usb *ft1000dev, u16 *hshake,
u32 *state)
u32 *state)
{
int status = 0;
@ -571,7 +571,7 @@ static int scram_start_dwnld(struct ft1000_usb *ft1000dev, u16 *hshake,
}
static int request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file,
u8 **c_file, const u8 *endpoint, bool boot_case)
u8 **c_file, const u8 *endpoint, bool boot_case)
{
long word_length;
int status = 0;
@ -602,7 +602,7 @@ static int request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file,
ft1000dev->usbboot++;
if (ft1000dev->usbboot == 1)
status |= ft1000_write_dpram16(ft1000dev,
DWNLD_MAG1_PS_HDR_LOC, 0, 0);
DWNLD_MAG1_PS_HDR_LOC, 0, 0);
}
return status;
}
@ -705,14 +705,14 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
break;
case REQUEST_CODE_SEGMENT:
status = request_code_segment(ft1000dev,
&s_file, &c_file,
(const u8 *)boot_end,
true);
break;
&s_file, &c_file,
(const u8 *)boot_end,
true);
break;
default:
DEBUG
("FT1000:download:Download error: Bad request type=%d in BOOT download state.\n",
request);
("FT1000:download:Download error: Bad request type=%d in BOOT download state.\n",
request);
status = -1;
break;
}
@ -724,7 +724,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
HANDSHAKE_RESPONSE);
} else {
DEBUG
("FT1000:download:Download error: Handshake failed\n");
("FT1000:download:Download error: Handshake failed\n");
status = -1;
}
@ -735,56 +735,56 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
ft1000dev->bootmode = 0;
if (ft1000dev->usbboot)
handshake =
get_handshake_usb(ft1000dev,
HANDSHAKE_REQUEST);
get_handshake_usb(ft1000dev,
HANDSHAKE_REQUEST);
else
handshake =
get_handshake(ft1000dev, HANDSHAKE_REQUEST);
get_handshake(ft1000dev, HANDSHAKE_REQUEST);
if (handshake == HANDSHAKE_REQUEST) {
/*
* Get type associated with the request.
*/
if (ft1000dev->usbboot)
request =
get_request_type_usb(ft1000dev);
get_request_type_usb(ft1000dev);
else
request = get_request_type(ft1000dev);
switch (request) {
case REQUEST_FILE_CHECKSUM:
DEBUG
("FT1000:download:image_chksum = 0x%8x\n",
image_chksum);
("FT1000:download:image_chksum = 0x%8x\n",
image_chksum);
put_request_value(ft1000dev,
image_chksum);
break;
case REQUEST_RUN_ADDRESS:
DEBUG
("FT1000:download: REQUEST_RUN_ADDRESS\n");
("FT1000:download: REQUEST_RUN_ADDRESS\n");
if (correct_version) {
DEBUG
("FT1000:download:run_address = 0x%8x\n",
(int)run_address);
("FT1000:download:run_address = 0x%8x\n",
(int)run_address);
put_request_value(ft1000dev,
run_address);
} else {
DEBUG
("FT1000:download:Download error: Got Run address request before image offset request.\n");
("FT1000:download:Download error: Got Run address request before image offset request.\n");
status = -1;
break;
}
break;
case REQUEST_CODE_LENGTH:
DEBUG
("FT1000:download:REQUEST_CODE_LENGTH\n");
("FT1000:download:REQUEST_CODE_LENGTH\n");
if (correct_version) {
DEBUG
("FT1000:download:run_size = 0x%8x\n",
(int)run_size);
("FT1000:download:run_size = 0x%8x\n",
(int)run_size);
put_request_value(ft1000dev,
run_size);
} else {
DEBUG
("FT1000:download:Download error: Got Size request before image offset request.\n");
("FT1000:download:Download error: Got Size request before image offset request.\n");
status = -1;
break;
}
@ -793,47 +793,47 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
ft1000dev->usbboot = 3;
/* Reposition ptrs to beginning of provisioning section */
s_file =
(u16 *) (pFileStart +
file_hdr->commands_offset);
(u16 *) (pFileStart +
file_hdr->commands_offset);
c_file =
(u8 *) (pFileStart +
file_hdr->commands_offset);
(u8 *) (pFileStart +
file_hdr->commands_offset);
state = STATE_DONE_DWNLD;
break;
case REQUEST_CODE_SEGMENT:
/* DEBUG("FT1000:download: REQUEST_CODE_SEGMENT - CODELOADER\n"); */
if (!correct_version) {
DEBUG
("FT1000:download:Download error: Got Code Segment request before image offset request.\n");
("FT1000:download:Download error: Got Code Segment request before image offset request.\n");
status = -1;
break;
}
status = request_code_segment(ft1000dev,
&s_file, &c_file,
(const u8 *)code_end,
false);
&s_file, &c_file,
(const u8 *)code_end,
false);
break;
case REQUEST_MAILBOX_DATA:
DEBUG
("FT1000:download: REQUEST_MAILBOX_DATA\n");
("FT1000:download: REQUEST_MAILBOX_DATA\n");
/* Convert length from byte count to word count. Make sure we round up. */
word_length =
(long)(pft1000info->DSPInfoBlklen +
1) / 2;
(long)(pft1000info->DSPInfoBlklen +
1) / 2;
put_request_value(ft1000dev,
word_length);
mailbox_data =
(struct drv_msg *)&(pft1000info->
DSPInfoBlk[0]);
(struct drv_msg *)&(pft1000info->
DSPInfoBlk[0]);
/*
* Position ASIC DPRAM auto-increment pointer.
*/
data = (u16 *) &mailbox_data->data[0];
dpram = (u16) DWNLD_MAG1_PS_HDR_LOC;
data = (u16 *)&mailbox_data->data[0];
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
if (word_length & 0x1)
word_length++;
@ -844,18 +844,18 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
templong = *data++;
templong |= (*data++ << 16);
status =
fix_ft1000_write_dpram32
(ft1000dev, dpram++,
(u8 *) &templong);
fix_ft1000_write_dpram32
(ft1000dev, dpram++,
(u8 *)&templong);
}
break;
case REQUEST_VERSION_INFO:
DEBUG
("FT1000:download:REQUEST_VERSION_INFO\n");
("FT1000:download:REQUEST_VERSION_INFO\n");
word_length =
file_hdr->version_data_size;
file_hdr->version_data_size;
put_request_value(ft1000dev,
word_length);
/*
@ -863,11 +863,11 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
*/
s_file =
(u16 *) (pFileStart +
file_hdr->
version_data_offset);
(u16 *) (pFileStart +
file_hdr->
version_data_offset);
dpram = (u16) DWNLD_MAG1_PS_HDR_LOC;
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
if (word_length & 0x1)
word_length++;
@ -879,26 +879,26 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
temp = ntohs(*s_file++);
templong |= (temp << 16);
status =
fix_ft1000_write_dpram32
(ft1000dev, dpram++,
(u8 *) &templong);
fix_ft1000_write_dpram32
(ft1000dev, dpram++,
(u8 *)&templong);
}
break;
case REQUEST_CODE_BY_VERSION:
DEBUG
("FT1000:download:REQUEST_CODE_BY_VERSION\n");
("FT1000:download:REQUEST_CODE_BY_VERSION\n");
correct_version = false;
requested_version =
get_request_value(ft1000dev);
get_request_value(ft1000dev);
dsp_img_info =
(struct dsp_image_info *)(pFileStart
+
sizeof
(struct
dsp_file_hdr));
(struct dsp_image_info *)(pFileStart
+
sizeof
(struct
dsp_file_hdr));
for (image = 0;
image < file_hdr->nDspImages;
@ -908,29 +908,29 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
requested_version) {
correct_version = true;
DEBUG
("FT1000:download: correct_version is TRUE\n");
("FT1000:download: correct_version is TRUE\n");
s_file =
(u16 *) (pFileStart
+
dsp_img_info->
begin_offset);
(u16 *) (pFileStart
+
dsp_img_info->
begin_offset);
c_file =
(u8 *) (pFileStart +
dsp_img_info->
begin_offset);
(u8 *) (pFileStart +
dsp_img_info->
begin_offset);
code_end =
(u8 *) (pFileStart +
dsp_img_info->
end_offset);
(u8 *) (pFileStart +
dsp_img_info->
end_offset);
run_address =
dsp_img_info->
run_address;
dsp_img_info->
run_address;
run_size =
dsp_img_info->
image_size;
dsp_img_info->
image_size;
image_chksum =
(u32) dsp_img_info->
checksum;
(u32)dsp_img_info->
checksum;
break;
}
dsp_img_info++;
@ -942,8 +942,8 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
* Error, beyond boot code range.
*/
DEBUG
("FT1000:download:Download error: Bad Version Request = 0x%x.\n",
(int)requested_version);
("FT1000:download:Download error: Bad Version Request = 0x%x.\n",
(int)requested_version);
status = -1;
break;
}
@ -951,8 +951,8 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
default:
DEBUG
("FT1000:download:Download error: Bad request type=%d in CODE download state.\n",
request);
("FT1000:download:Download error: Bad request type=%d in CODE download state.\n",
request);
status = -1;
break;
}
@ -964,7 +964,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
HANDSHAKE_RESPONSE);
} else {
DEBUG
("FT1000:download:Download error: Handshake failed\n");
("FT1000:download:Download error: Handshake failed\n");
status = -1;
}
@ -990,9 +990,9 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
/* Get buffer for provisioning data */
pbuffer =
kmalloc((pseudo_header_len +
sizeof(struct pseudo_hdr)),
GFP_ATOMIC);
kmalloc((pseudo_header_len +
sizeof(struct pseudo_hdr)),
GFP_ATOMIC);
if (pbuffer) {
memcpy(pbuffer, (void *)c_file,
(u32) (pseudo_header_len +
@ -1000,20 +1000,20 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
pseudo_hdr)));
/* link provisioning data */
pprov_record =
kmalloc(sizeof(struct prov_record),
GFP_ATOMIC);
kmalloc(sizeof(struct prov_record),
GFP_ATOMIC);
if (pprov_record) {
pprov_record->pprov_data =
pbuffer;
pbuffer;
list_add_tail(&pprov_record->
list,
&pft1000info->
prov_list);
/* Move to next entry if available */
c_file =
(u8 *) ((unsigned long)
c_file +
(u32) ((pseudo_header_len + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr));
(u8 *) ((unsigned long)
c_file +
(u32) ((pseudo_header_len + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr));
if ((unsigned long)(c_file) -
(unsigned long)(pFileStart)
>=
@ -1032,8 +1032,8 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
status = -1;
}
DEBUG
("ft1000:download: after STATE_SECTION_PROV, state = %d, status= %d\n",
state, status);
("ft1000:download: after STATE_SECTION_PROV, state = %d, status= %d\n",
state, status);
break;
case STATE_DONE_PROV:
@ -1050,16 +1050,16 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart,
break;
/****
// Check if Card is present
status = Harley_Read_Register(&temp, FT1000_REG_SUP_IMASK);
if ( (status != NDIS_STATUS_SUCCESS) || (temp == 0x0000) ) {
break;
}
// Check if Card is present
status = Harley_Read_Register(&temp, FT1000_REG_SUP_IMASK);
if ( (status != NDIS_STATUS_SUCCESS) || (temp == 0x0000) ) {
break;
}
status = Harley_Read_Register(&temp, FT1000_REG_ASIC_ID);
if ( (status != NDIS_STATUS_SUCCESS) || (temp == 0xffff) ) {
break;
}
status = Harley_Read_Register(&temp, FT1000_REG_ASIC_ID);
if ( (status != NDIS_STATUS_SUCCESS) || (temp == 0xffff) ) {
break;
}
****/
} /* End while */

View file

@ -1,8 +1,8 @@
/* CopyRight (C) 2007 Qualcomm Inc. All Rights Reserved.
*
*
* This file is part of Express Card USB Driver
*/
*
*
* This file is part of Express Card USB Driver
*/
#include <linux/kernel.h>
#include <linux/module.h>
@ -35,16 +35,16 @@ static u8 tempbuffer[1600];
#define MAX_RCV_LOOP 100
/* send a control message via USB interface synchronously
* Parameters: ft1000_usb - device structure
* pipe - usb control message pipe
* request - control request
* requesttype - control message request type
* value - value to be written or 0
* index - register index
* data - data buffer to hold the read/write values
* size - data size
* timeout - control message time out value
*/
* Parameters: ft1000_usb - device structure
* pipe - usb control message pipe
* request - control request
* requesttype - control message request type
* value - value to be written or 0
* index - register index
* data - data buffer to hold the read/write values
* size - data size
* timeout - control message time out value
*/
static int ft1000_control(struct ft1000_usb *ft1000dev, unsigned int pipe,
u8 request, u8 requesttype, u16 value, u16 index,
void *data, u16 size, int timeout)
@ -171,7 +171,7 @@ int ft1000_read_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer,
/* write into DPRAM a number of bytes */
int ft1000_write_dpram16(struct ft1000_usb *ft1000dev, u16 indx, u16 value,
u8 highlow)
u8 highlow)
{
int ret = 0;
u8 request;
@ -287,7 +287,7 @@ static void card_reset_dsp(struct ft1000_usb *ft1000dev, bool value)
u16 tempword;
status = ft1000_write_register(ft1000dev, HOST_INTF_BE,
FT1000_REG_SUP_CTRL);
FT1000_REG_SUP_CTRL);
status = ft1000_read_register(ft1000dev, &tempword,
FT1000_REG_SUP_CTRL);
@ -318,12 +318,12 @@ static void card_reset_dsp(struct ft1000_usb *ft1000dev, bool value)
}
/* send a command to ASIC
* Parameters: ft1000_usb - device structure
* ptempbuffer - command buffer
* size - command buffer size
*/
* Parameters: ft1000_usb - device structure
* ptempbuffer - command buffer
* size - command buffer size
*/
int card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer,
int size)
int size)
{
int ret;
unsigned short temp;
@ -355,7 +355,7 @@ int card_send_command(struct ft1000_usb *ft1000dev, void *ptempbuffer,
return ret;
usleep_range(900, 1100);
ret = ft1000_write_register(ft1000dev, FT1000_DB_DPRAM_TX,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
if (ret)
return ret;
usleep_range(900, 1100);
@ -399,12 +399,12 @@ int dsp_reload(struct ft1000_usb *ft1000dev)
msleep(1000);
status =
ft1000_write_register(ft1000dev, HOST_INTF_BE, FT1000_REG_SUP_CTRL);
ft1000_write_register(ft1000dev, HOST_INTF_BE, FT1000_REG_SUP_CTRL);
/* Let's check for FEFE */
status =
ft1000_read_dpram32(ft1000dev, FT1000_MAG_DPRAM_FEFE_INDX,
(u8 *) &templong, 4);
ft1000_read_dpram32(ft1000dev, FT1000_MAG_DPRAM_FEFE_INDX,
(u8 *)&templong, 4);
DEBUG("templong (fefe) = 0x%8x\n", templong);
/* call codeloader */
@ -465,7 +465,7 @@ static int ft1000_reset_card(struct net_device *dev)
while (list_empty(&info->prov_list) == 0) {
DEBUG("ft1000_reset_card:deleting provisioning record\n");
ptr =
list_entry(info->prov_list.next, struct prov_record, list);
list_entry(info->prov_list.next, struct prov_record, list);
list_del(&ptr->list);
kfree(ptr->pprov_data);
kfree(ptr);
@ -484,7 +484,7 @@ static int ft1000_reset_card(struct net_device *dev)
/* Initialize DSP heartbeat area */
ft1000_write_dpram16(ft1000dev, FT1000_MAG_HI_HO, ho_mag,
FT1000_MAG_HI_HO_INDX);
ft1000_read_dpram16(ft1000dev, FT1000_MAG_HI_HO, (u8 *) &tempword,
ft1000_read_dpram16(ft1000dev, FT1000_MAG_HI_HO, (u8 *)&tempword,
FT1000_MAG_HI_HO_INDX);
DEBUG("ft1000_hw:ft1000_reset_card:hi_ho value = 0x%x\n", tempword);
@ -508,8 +508,8 @@ static void ft1000_usb_transmit_complete(struct urb *urb)
}
/* take an ethernet packet and convert it to a Flarion
* packet prior to sending it to the ASIC Downlink FIFO.
*/
* packet prior to sending it to the ASIC Downlink FIFO.
*/
static int ft1000_copy_down_pkt(struct net_device *netdev, u8 *packet, u16 len)
{
struct ft1000_info *pInfo = netdev_priv(netdev);
@ -545,7 +545,7 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 *packet, u16 len)
hdr.control = 0x00;
hdr.checksum = hdr.length ^ hdr.source ^ hdr.destination ^
hdr.portdest ^ hdr.portsrc ^ hdr.sh_str_id ^ hdr.control;
hdr.portdest ^ hdr.portsrc ^ hdr.sh_str_id ^ hdr.control;
memcpy(&pFt1000Dev->tx_buf[0], &hdr, sizeof(hdr));
memcpy(&(pFt1000Dev->tx_buf[sizeof(struct pseudo_hdr)]), packet, len);
@ -559,7 +559,7 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 *packet, u16 len)
pFt1000Dev->tx_buf, count,
ft1000_usb_transmit_complete, (void *)pFt1000Dev);
t = (u8 *) pFt1000Dev->tx_urb->transfer_buffer;
t = (u8 *)pFt1000Dev->tx_urb->transfer_buffer;
ret = usb_submit_urb(pFt1000Dev->tx_urb, GFP_ATOMIC);
@ -574,9 +574,9 @@ static int ft1000_copy_down_pkt(struct net_device *netdev, u8 *packet, u16 len)
}
/* transmit an ethernet packet
* Parameters: skb - socket buffer to be sent
* dev - network device
*/
* Parameters: skb - socket buffer to be sent
* dev - network device
*/
static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ft1000_info *pInfo = netdev_priv(dev);
@ -595,10 +595,10 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
pipe =
usb_sndbulkpipe(pFt1000Dev->dev, pFt1000Dev->bulk_out_endpointAddr);
usb_sndbulkpipe(pFt1000Dev->dev, pFt1000Dev->bulk_out_endpointAddr);
maxlen = usb_maxpacket(pFt1000Dev->dev, pipe, usb_pipeout(pipe));
pdata = (u8 *) skb->data;
pdata = (u8 *)skb->data;
if (pInfo->mediastate == 0) {
/* Drop packet is mediastate is down */
@ -814,8 +814,8 @@ int reg_ft1000_netdev(struct ft1000_usb *ft1000dev,
}
/* take a packet from the FIFO up link and
* convert it into an ethernet packet and deliver it to the IP stack
*/
* convert it into an ethernet packet and deliver it to the IP stack
*/
static int ft1000_copy_up_pkt(struct urb *urb)
{
struct ft1000_info *info = urb->context;
@ -839,7 +839,7 @@ static int ft1000_copy_up_pkt(struct urb *urb)
len = urb->transfer_buffer_length;
lena = urb->actual_length;
chksum = (u16 *) ft1000dev->rx_buf;
chksum = (u16 *)ft1000dev->rx_buf;
tempword = *chksum++;
for (i = 1; i < 7; i++)
@ -860,7 +860,7 @@ static int ft1000_copy_up_pkt(struct urb *urb)
return -1;
}
pbuffer = (u8 *) skb_put(skb, len + 12);
pbuffer = (u8 *)skb_put(skb, len + 12);
/* subtract the number of bytes read already */
ptemp = pbuffer;
@ -914,7 +914,7 @@ static int ft1000_submit_rx_urb(struct ft1000_info *info)
usb_rcvbulkpipe(pFt1000Dev->dev,
pFt1000Dev->bulk_in_endpointAddr),
pFt1000Dev->rx_buf, MAX_BUF_SIZE,
(usb_complete_t) ft1000_copy_up_pkt, info);
(usb_complete_t)ft1000_copy_up_pkt, info);
result = usb_submit_urb(pFt1000Dev->rx_urb, GFP_ATOMIC);
@ -976,10 +976,10 @@ static int ft1000_chkcard(struct ft1000_usb *dev)
}
/* read a message from the dpram area.
* Input:
* dev - network device structure
* pbuffer - caller supply address to buffer
*/
* Input:
* dev - network device structure
* pbuffer - caller supply address to buffer
*/
static bool ft1000_receive_cmd(struct ft1000_usb *dev, u16 *pbuffer,
int maxsz)
{
@ -990,46 +990,46 @@ static bool ft1000_receive_cmd(struct ft1000_usb *dev, u16 *pbuffer,
u16 tempword;
ret =
ft1000_read_dpram16(dev, FT1000_MAG_PH_LEN, (u8 *) &size,
FT1000_MAG_PH_LEN_INDX);
ft1000_read_dpram16(dev, FT1000_MAG_PH_LEN, (u8 *)&size,
FT1000_MAG_PH_LEN_INDX);
size = ntohs(size) + PSEUDOSZ;
if (size > maxsz) {
DEBUG("FT1000:ft1000_receive_cmd:Invalid command length = %d\n",
size);
return FALSE;
}
ppseudohdr = (u16 *) pbuffer;
ppseudohdr = (u16 *)pbuffer;
ft1000_write_register(dev, FT1000_DPRAM_MAG_RX_BASE,
FT1000_REG_DPRAM_ADDR);
ret =
ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAH);
ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAH);
pbuffer++;
ft1000_write_register(dev, FT1000_DPRAM_MAG_RX_BASE + 1,
FT1000_REG_DPRAM_ADDR);
for (i = 0; i <= (size >> 2); i++) {
ret =
ft1000_read_register(dev, pbuffer,
FT1000_REG_MAG_DPDATAL);
ft1000_read_register(dev, pbuffer,
FT1000_REG_MAG_DPDATAL);
pbuffer++;
ret =
ft1000_read_register(dev, pbuffer,
FT1000_REG_MAG_DPDATAH);
ft1000_read_register(dev, pbuffer,
FT1000_REG_MAG_DPDATAH);
pbuffer++;
}
/* copy odd aligned word */
ret =
ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAL);
ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAL);
pbuffer++;
ret =
ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAH);
ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAH);
pbuffer++;
if (size & 0x0001) {
/* copy odd byte from fifo */
ret =
ft1000_read_register(dev, &tempword,
FT1000_REG_DPRAM_DATA);
ft1000_read_register(dev, &tempword,
FT1000_REG_DPRAM_DATA);
*pbuffer = ntohs(tempword);
}
/* Check if pseudo header checksum is good
@ -1066,7 +1066,7 @@ static int ft1000_dsp_prov(void *arg)
/* Check if doorbell is available */
DEBUG("check if doorbell is cleared\n");
status =
ft1000_read_register(dev, &tempword, FT1000_REG_DOORBELL);
ft1000_read_register(dev, &tempword, FT1000_REG_DOORBELL);
if (status) {
DEBUG("ft1000_dsp_prov::ft1000_read_register error\n");
break;
@ -1088,13 +1088,13 @@ static int ft1000_dsp_prov(void *arg)
/* Send provisioning data */
ptr =
list_entry(info->prov_list.next, struct prov_record,
list);
len = *(u16 *) ptr->pprov_data;
list_entry(info->prov_list.next, struct prov_record,
list);
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;
/* Insert slow queue sequence number */
ppseudo_hdr->seq_num = info->squeseqnum++;
@ -1109,12 +1109,12 @@ static int ft1000_dsp_prov(void *arg)
memcpy(&TempShortBuf[2], ppseudo_hdr, len);
status =
ft1000_write_dpram32(dev, 0,
(u8 *) &TempShortBuf[0],
(unsigned short)(len + 2));
ft1000_write_dpram32(dev, 0,
(u8 *)&TempShortBuf[0],
(unsigned short)(len + 2));
status =
ft1000_write_register(dev, FT1000_DB_DPRAM_TX,
FT1000_REG_DOORBELL);
ft1000_write_register(dev, FT1000_DB_DPRAM_TX,
FT1000_REG_DOORBELL);
list_del(&ptr->list);
kfree(ptr->pprov_data);
@ -1229,12 +1229,12 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size)
if (ntohs(pdspinitmsg->length) ==
(sizeof(struct dsp_init_msg) - 20)) {
memcpy(info->ProductMode, pdspinitmsg->ProductMode,
MODESZ);
MODESZ);
memcpy(info->RfCalVer, pdspinitmsg->RfCalVer, CALVERSZ);
memcpy(info->RfCalDate, pdspinitmsg->RfCalDate,
CALDATESZ);
DEBUG("RFCalVer = 0x%2x 0x%2x\n", info->RfCalVer[0],
info->RfCalVer[1]);
info->RfCalVer[1]);
}
break;
}
@ -1252,7 +1252,7 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size)
} else {
dev->fProvComplete = true;
status = ft1000_write_register(dev, FT1000_DB_HB,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
DEBUG("FT1000:drivermsg:No more DSP provisioning data in dsp image\n");
}
DEBUG("ft1000_proc_drvmsg:DSP PROVISION is done\n");
@ -1264,7 +1264,7 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size)
tempword = ntohs(pdrvmsg->length);
info->DSPInfoBlklen = tempword;
if (tempword < (MAX_DSP_SESS_REC - 4)) {
pmsg = (u16 *) &pdrvmsg->data[0];
pmsg = (u16 *)&pdrvmsg->data[0];
for (i = 0; i < ((tempword + 1) / 2); i++) {
DEBUG("FT1000:drivermsg:dsp info data = 0x%x\n", *pmsg);
info->DSPInfoBlk[i + 10] = *pmsg++;
@ -1281,27 +1281,27 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size)
/* allow any outstanding ioctl to finish */
mdelay(10);
status = ft1000_read_register(dev, &tempword,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
if (tempword & FT1000_DB_DPRAM_TX) {
mdelay(10);
status = ft1000_read_register(dev, &tempword,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
if (tempword & FT1000_DB_DPRAM_TX) {
mdelay(10);
status = ft1000_read_register(dev, &tempword,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
if (tempword & FT1000_DB_DPRAM_TX)
break;
}
}
/* Put message into Slow Queue Form Pseudo header */
pmsg = (u16 *) info->DSPInfoBlk;
pmsg = (u16 *)info->DSPInfoBlk;
*pmsg++ = 0;
*pmsg++ = htons(info->DSPInfoBlklen + 20 + info->DSPInfoBlklen);
ppseudo_hdr =
(struct pseudo_hdr *)(u16 *) &info->DSPInfoBlk[2];
(struct pseudo_hdr *)(u16 *)&info->DSPInfoBlk[2];
ppseudo_hdr->length = htons(info->DSPInfoBlklen + 4
+ info->DSPInfoBlklen);
+ info->DSPInfoBlklen);
ppseudo_hdr->source = 0x10;
ppseudo_hdr->destination = 0x20;
ppseudo_hdr->portdest = 0;
@ -1323,10 +1323,10 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size)
info->DSPInfoBlk[10] = 0x7200;
info->DSPInfoBlk[11] = htons(info->DSPInfoBlklen);
status = ft1000_write_dpram32(dev, 0,
(u8 *)&info->DSPInfoBlk[0],
(unsigned short)(info->DSPInfoBlklen + 22));
(u8 *)&info->DSPInfoBlk[0],
(unsigned short)(info->DSPInfoBlklen + 22));
status = ft1000_write_register(dev, FT1000_DB_DPRAM_TX,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
dev->DrvMsgPend = 0;
break;
}
@ -1337,17 +1337,17 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size)
/* allow any outstanding ioctl to finish */
mdelay(10);
status = ft1000_read_register(dev, &tempword,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
if (tempword & FT1000_DB_DPRAM_TX) {
mdelay(10);
status = ft1000_read_register(dev, &tempword,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
if (tempword & FT1000_DB_DPRAM_TX)
mdelay(10);
}
if ((tempword & FT1000_DB_DPRAM_TX) == 0) {
/* Put message into Slow Queue Form Pseudo header */
pmsg = (u16 *) &tempbuffer[0];
pmsg = (u16 *)&tempbuffer[0];
ppseudo_hdr = (struct pseudo_hdr *)pmsg;
ppseudo_hdr->length = htons(0x0012);
ppseudo_hdr->source = 0x10;
@ -1368,7 +1368,7 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size)
for (i = 1; i < 7; i++)
ppseudo_hdr->checksum ^= *pmsg++;
pmsg = (u16 *) &tempbuffer[16];
pmsg = (u16 *)&tempbuffer[16];
*pmsg++ = htons(RSP_DRV_ERR_RPT_MSG);
*pmsg++ = htons(0x000e);
*pmsg++ = htons(info->DSP_TIME[0]);
@ -1384,7 +1384,7 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size)
*pmsg++ = htons(info->DrvErrNum);
status = card_send_command(dev, (unsigned char *)&tempbuffer[0],
(u16)(0x0012 + PSEUDOSZ));
(u16)(0x0012 + PSEUDOSZ));
if (status)
goto out;
info->DrvErrNum = 0;
@ -1412,9 +1412,9 @@ static int dsp_broadcast_msg_id(struct ft1000_usb *dev)
for (i = 0; i < MAX_NUM_APP; i++) {
if ((dev->app_info[i].DspBCMsgFlag)
&& (dev->app_info[i].fileobject)
&& (dev->app_info[i].NumOfMsg
< MAX_MSG_LIMIT)) {
&& (dev->app_info[i].fileobject)
&& (dev->app_info[i].NumOfMsg
< MAX_MSG_LIMIT)) {
pdpram_blk = ft1000_get_buffer(&freercvpool);
if (pdpram_blk == NULL) {
DEBUG("Out of memory in free receive command pool\n");
@ -1422,18 +1422,18 @@ static int dsp_broadcast_msg_id(struct ft1000_usb *dev)
return -1;
}
if (ft1000_receive_cmd(dev, pdpram_blk->pbuffer,
MAX_CMD_SQSIZE)) {
MAX_CMD_SQSIZE)) {
/* Put message into the
* appropriate application block
*/
dev->app_info[i].nRxMsg++;
spin_lock_irqsave(&free_buff_lock, flags);
list_add_tail(&pdpram_blk->list,
&dev->app_info[i] .app_sqlist);
&dev->app_info[i] .app_sqlist);
dev->app_info[i].NumOfMsg++;
spin_unlock_irqrestore(&free_buff_lock, flags);
wake_up_interruptible(&dev->app_info[i]
.wait_dpram_msg);
.wait_dpram_msg);
} else {
dev->app_info[i].nRxMsgMiss++;
ft1000_free_buffer(pdpram_blk, &freercvpool);
@ -1461,7 +1461,7 @@ static int handle_misc_portid(struct ft1000_usb *dev)
/* Search for correct application block */
for (i = 0; i < MAX_NUM_APP; i++) {
if (dev->app_info[i].app_id == ((struct pseudo_hdr *)
pdpram_blk->pbuffer)->portdest)
pdpram_blk->pbuffer)->portdest)
break;
}
if (i == MAX_NUM_APP) {
@ -1502,14 +1502,14 @@ int ft1000_poll(void *dev_id)
if (!status) {
if (tempword & FT1000_DB_DPRAM_RX) {
status = ft1000_read_dpram16(dev,
0x200, (u8 *)&data, 0);
0x200, (u8 *)&data, 0);
size = ntohs(data) + 16 + 2;
if (size % 4) {
modulo = 4 - (size % 4);
size = size + modulo;
}
status = ft1000_read_dpram16(dev, 0x201,
(u8 *)&portid, 1);
(u8 *)&portid, 1);
portid &= 0xff;
if (size < MAX_CMD_SQSIZE) {
switch (portid) {
@ -1529,18 +1529,18 @@ int ft1000_poll(void *dev_id)
} else
DEBUG("FT1000:dpc:Invalid total length for SlowQ = %d\n", size);
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) {
/* Let's reset the ASIC from the Host side as well */
status = ft1000_write_register(dev, ASIC_RESET_BIT,
FT1000_REG_RESET);
FT1000_REG_RESET);
status = ft1000_read_register(dev, &tempword,
FT1000_REG_RESET);
FT1000_REG_RESET);
i = 0;
while (tempword & ASIC_RESET_BIT) {
status = ft1000_read_register(dev, &tempword,
FT1000_REG_RESET);
FT1000_REG_RESET);
usleep_range(9000, 11000);
i++;
if (i == 100)
@ -1553,51 +1553,51 @@ int ft1000_poll(void *dev_id)
usleep_range(9000, 11000);
/* Program WMARK register */
status = ft1000_write_register(dev, 0x600,
FT1000_REG_MAG_WATERMARK);
FT1000_REG_MAG_WATERMARK);
/* clear ASIC reset doorbell */
status = ft1000_write_register(dev,
FT1000_DSP_ASIC_RESET,
FT1000_REG_DOORBELL);
FT1000_DSP_ASIC_RESET,
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");
/* clear ASIC reset request from DSP */
status = ft1000_write_register(dev,
FT1000_ASIC_RESET_REQ,
FT1000_REG_DOORBELL);
FT1000_ASIC_RESET_REQ,
FT1000_REG_DOORBELL);
status = ft1000_write_register(dev, HOST_INTF_BE,
FT1000_REG_SUP_CTRL);
FT1000_REG_SUP_CTRL);
/* copy dsp session record from Adapter block */
status = ft1000_write_dpram32(dev, 0,
(u8 *)&info->DSPSess.Rec[0], 1024);
(u8 *)&info->DSPSess.Rec[0], 1024);
status = ft1000_write_register(dev, 0x600,
FT1000_REG_MAG_WATERMARK);
FT1000_REG_MAG_WATERMARK);
/* ring doorbell to tell DSP that
* ASIC is out of reset
* */
status = ft1000_write_register(dev,
FT1000_ASIC_RESET_DSP,
FT1000_REG_DOORBELL);
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");
if (!dev->fAppMsgPend) {
/* Reset ASIC and DSP */
status = ft1000_read_dpram16(dev,
FT1000_MAG_DSP_TIMER0,
(u8 *)&(info->DSP_TIME[0]),
FT1000_MAG_DSP_TIMER0_INDX);
FT1000_MAG_DSP_TIMER0,
(u8 *)&(info->DSP_TIME[0]),
FT1000_MAG_DSP_TIMER0_INDX);
status = ft1000_read_dpram16(dev,
FT1000_MAG_DSP_TIMER1,
(u8 *)&(info->DSP_TIME[1]),
FT1000_MAG_DSP_TIMER1_INDX);
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);
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);
FT1000_MAG_DSP_TIMER3,
(u8 *)&(info->DSP_TIME[3]),
FT1000_MAG_DSP_TIMER3_INDX);
info->CardReady = 0;
info->DrvErrNum = DSP_CONDRESET_INFO;
DEBUG("ft1000_hw:DSP conditional reset requested\n");
@ -1607,7 +1607,7 @@ int ft1000_poll(void *dev_id)
dev->fCondResetPend = true;
}
ft1000_write_register(dev, FT1000_DB_COND_RESET,
FT1000_REG_DOORBELL);
FT1000_REG_DOORBELL);
}
}
return 0;

View file

@ -1,30 +1,30 @@
/*
*---------------------------------------------------------------------------
* FT1000 driver for Flarion Flash OFDM NIC Device
*
* Copyright (C) 2002 Flarion Technologies, All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version. This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details. You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place -
* Suite 330, Boston, MA 02111-1307, USA.
*---------------------------------------------------------------------------
*
* File: ft1000_ioctl.h
*
* Description: Common structures and defines relating to IOCTL
*
* History:
* 11/5/02 Whc Created.
*
*---------------------------------------------------------------------------
*/
*---------------------------------------------------------------------------
* FT1000 driver for Flarion Flash OFDM NIC Device
*
* Copyright (C) 2002 Flarion Technologies, All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version. This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details. You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place -
* Suite 330, Boston, MA 02111-1307, USA.
*---------------------------------------------------------------------------
*
* File: ft1000_ioctl.h
*
* Description: Common structures and defines relating to IOCTL
*
* History:
* 11/5/02 Whc Created.
*
*---------------------------------------------------------------------------
*/
#ifndef _FT1000IOCTLH_
#define _FT1000IOCTLH_
@ -94,8 +94,8 @@ struct IOCTL_DPRAM_COMMAND {
} __packed;
/*
* Custom IOCTL command codes
*/
* Custom IOCTL command codes
*/
#define FT1000_MAGIC_CODE 'F'
#define IOCTL_REGISTER_CMD 0
@ -106,8 +106,8 @@ struct IOCTL_DPRAM_COMMAND {
#define IOCTL_CONNECT 10
#define IOCTL_DISCONNECT 11
#define IOCTL_FT1000_GET_DSP_STAT _IOR(FT1000_MAGIC_CODE, \
IOCTL_GET_DSP_STAT_CMD, \
#define IOCTL_FT1000_GET_DSP_STAT _IOR(FT1000_MAGIC_CODE, \
IOCTL_GET_DSP_STAT_CMD, \
struct IOCTL_GET_DSP_STAT)
#define IOCTL_FT1000_GET_VER _IOR(FT1000_MAGIC_CODE, IOCTL_GET_VER_CMD, \
struct IOCTL_GET_VER)

View file

@ -109,8 +109,8 @@ static int ft1000_probe(struct usb_interface *interface,
for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
endpoint =
(struct usb_endpoint_descriptor *)&iface_desc->
endpoint[i].desc;
(struct usb_endpoint_descriptor *)&iface_desc->
endpoint[i].desc;
DEBUG("endpoint %d\n", i);
DEBUG("bEndpointAddress=%x, bmAttributes=%x\n",
endpoint->bEndpointAddress, endpoint->bmAttributes);
@ -118,7 +118,7 @@ static int ft1000_probe(struct usb_interface *interface,
&& ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_BULK)) {
ft1000dev->bulk_in_endpointAddr =
endpoint->bEndpointAddress;
endpoint->bEndpointAddress;
DEBUG("ft1000_probe: in: %d\n",
endpoint->bEndpointAddress);
}
@ -127,7 +127,7 @@ static int ft1000_probe(struct usb_interface *interface,
&& ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_BULK)) {
ft1000dev->bulk_out_endpointAddr =
endpoint->bEndpointAddress;
endpoint->bEndpointAddress;
DEBUG("ft1000_probe: out: %d\n",
endpoint->bEndpointAddress);
}
@ -172,7 +172,7 @@ static int ft1000_probe(struct usb_interface *interface,
gPollingfailed = false;
ft1000dev->pPollThread =
kthread_run(ft1000_poll_thread, ft1000dev, "ft1000_poll");
kthread_run(ft1000_poll_thread, ft1000dev, "ft1000_poll");
if (IS_ERR(ft1000dev->pPollThread)) {
ret = PTR_ERR(ft1000dev->pPollThread);
@ -218,7 +218,7 @@ static void ft1000_disconnect(struct usb_interface *interface)
DEBUG("ft1000_disconnect is called\n");
pft1000info = (struct ft1000_info *) usb_get_intfdata(interface);
pft1000info = (struct ft1000_info *)usb_get_intfdata(interface);
DEBUG("In disconnect pft1000info=%p\n", pft1000info);
if (pft1000info) {
@ -233,7 +233,7 @@ static void ft1000_disconnect(struct usb_interface *interface)
ft1000_destroy_dev(ft1000dev->net);
unregister_netdev(ft1000dev->net);
DEBUG
("ft1000_disconnect: network device unregistered\n");
("ft1000_disconnect: network device unregistered\n");
free_netdev(ft1000dev->net);
}

View file

@ -137,7 +137,7 @@ extern spinlock_t free_buff_lock;
int ft1000_create_dev(struct ft1000_usb *dev);
void ft1000_destroy_dev(struct net_device *dev);
extern int card_send_command(struct ft1000_usb *ft1000dev,
void *ptempbuffer, int size);
void *ptempbuffer, int size);
struct dpram_blk *ft1000_get_buffer(struct list_head *bufflist);
void ft1000_free_buffer(struct dpram_blk *pdpram_blk, struct list_head *plist);