Commit ca145277 authored by Ondrej Zary's avatar Ondrej Zary Committed by Greg Kroah-Hartman

staging: ft1000-pcmcia: remove custom defines for standard types

Remove custom defines for standard types (u8, u16, u32...)
Signed-off-by: default avatarOndrej Zary <linux@rainbow-software.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cefe8adb
...@@ -67,17 +67,6 @@ struct pseudo_hdr ...@@ -67,17 +67,6 @@ struct pseudo_hdr
unsigned short checksum; // pseudo header checksum unsigned short checksum; // pseudo header checksum
} __attribute__ ((packed)); } __attribute__ ((packed));
// Definitions to maintain compatibility between other platforms
#define UCHAR u8
#define USHORT u16
#define ULONG u32
#define BOOLEAN u8
#define PULONG u32 *
#define PUSHORT u16 *
#define PUCHAR u8 *
#define PCHAR u8 *
#define UINT u32
#define ELECTRABUZZ_ID 0 // ASIC ID for Electrabuzz #define ELECTRABUZZ_ID 0 // ASIC ID for Electrabuzz
#define MAGNEMITE_ID 0x1a01 // ASIC ID for Magnemite #define MAGNEMITE_ID 0x1a01 // ASIC ID for Magnemite
...@@ -278,8 +267,6 @@ struct pseudo_hdr ...@@ -278,8 +267,6 @@ struct pseudo_hdr
#define SUCCESS 0x00 #define SUCCESS 0x00
#define FAILURE 0x01 #define FAILURE 0x01
#define TRUE 0x1
#define FALSE 0x0
#define MAXIMUM_ASIC_HB_CNT 15 #define MAXIMUM_ASIC_HB_CNT 15
......
...@@ -86,12 +86,12 @@ ...@@ -86,12 +86,12 @@
#define STATE_DONE_PROV 0x06 #define STATE_DONE_PROV 0x06
#define STATE_DONE_FILE 0x07 #define STATE_DONE_FILE 0x07
USHORT get_handshake(struct net_device *dev, USHORT expected_value); u16 get_handshake(struct net_device *dev, u16 expected_value);
void put_handshake(struct net_device *dev, USHORT handshake_value); void put_handshake(struct net_device *dev, u16 handshake_value);
USHORT get_request_type(struct net_device *dev); u16 get_request_type(struct net_device *dev);
long get_request_value(struct net_device *dev); long get_request_value(struct net_device *dev);
void put_request_value(struct net_device *dev, long lvalue); void put_request_value(struct net_device *dev, long lvalue);
USHORT hdr_checksum(struct pseudo_hdr *pHdr); u16 hdr_checksum(struct pseudo_hdr *pHdr);
struct dsp_file_hdr { struct dsp_file_hdr {
u32 build_date; u32 build_date;
...@@ -143,14 +143,14 @@ void card_bootload(struct net_device *dev) ...@@ -143,14 +143,14 @@ 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; unsigned long flags;
PULONG pdata; u32 *pdata;
UINT size; u32 size;
UINT i; u32 i;
ULONG templong; u32 templong;
DEBUG(0, "card_bootload is called\n"); DEBUG(0, "card_bootload is called\n");
pdata = (PULONG) bootimage; pdata = (u32 *) bootimage;
size = sizeof(bootimage); size = sizeof(bootimage);
// check for odd word // check for odd word
...@@ -171,11 +171,11 @@ void card_bootload(struct net_device *dev) ...@@ -171,11 +171,11 @@ void card_bootload(struct net_device *dev)
spin_unlock_irqrestore(&info->dpram_lock, flags); spin_unlock_irqrestore(&info->dpram_lock, flags);
} }
USHORT get_handshake(struct net_device *dev, USHORT expected_value) 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);
USHORT handshake; u16 handshake;
ULONG tempx; u32 tempx;
int loopcnt; int loopcnt;
loopcnt = 0; loopcnt = 0;
...@@ -189,7 +189,7 @@ USHORT get_handshake(struct net_device *dev, USHORT expected_value) ...@@ -189,7 +189,7 @@ USHORT get_handshake(struct net_device *dev, USHORT expected_value)
tempx = tempx =
ntohl(ft1000_read_dpram_mag_32 ntohl(ft1000_read_dpram_mag_32
(dev, DWNLD_MAG_HANDSHAKE_LOC)); (dev, DWNLD_MAG_HANDSHAKE_LOC));
handshake = (USHORT) tempx; handshake = (u16) tempx;
} }
if ((handshake == expected_value) if ((handshake == expected_value)
...@@ -206,27 +206,27 @@ USHORT get_handshake(struct net_device *dev, USHORT expected_value) ...@@ -206,27 +206,27 @@ USHORT get_handshake(struct net_device *dev, USHORT expected_value)
} }
void put_handshake(struct net_device *dev, USHORT handshake_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);
ULONG tempx; u32 tempx;
if (info->AsicID == ELECTRABUZZ_ID) { if (info->AsicID == ELECTRABUZZ_ID) {
ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR,
DWNLD_HANDSHAKE_LOC); DWNLD_HANDSHAKE_LOC);
ft1000_write_reg(dev, FT1000_REG_DPRAM_DATA, handshake_value); /* Handshake */ ft1000_write_reg(dev, FT1000_REG_DPRAM_DATA, handshake_value); /* Handshake */
} else { } else {
tempx = (ULONG) handshake_value; tempx = (u32) handshake_value;
tempx = ntohl(tempx); tempx = ntohl(tempx);
ft1000_write_dpram_mag_32(dev, DWNLD_MAG_HANDSHAKE_LOC, tempx); /* Handshake */ ft1000_write_dpram_mag_32(dev, DWNLD_MAG_HANDSHAKE_LOC, tempx); /* Handshake */
} }
} }
USHORT get_request_type(struct net_device *dev) 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);
USHORT request_type; u16 request_type;
ULONG tempx; u32 tempx;
if (info->AsicID == ELECTRABUZZ_ID) { if (info->AsicID == ELECTRABUZZ_ID) {
ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, DWNLD_TYPE_LOC); ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, DWNLD_TYPE_LOC);
...@@ -234,7 +234,7 @@ USHORT get_request_type(struct net_device *dev) ...@@ -234,7 +234,7 @@ USHORT get_request_type(struct net_device *dev)
} else { } else {
tempx = ft1000_read_dpram_mag_32(dev, DWNLD_MAG_TYPE_LOC); tempx = ft1000_read_dpram_mag_32(dev, DWNLD_MAG_TYPE_LOC);
tempx = ntohl(tempx); tempx = ntohl(tempx);
request_type = (USHORT) tempx; request_type = (u16) tempx;
} }
return request_type; return request_type;
...@@ -245,7 +245,7 @@ long get_request_value(struct net_device *dev) ...@@ -245,7 +245,7 @@ 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; long value;
USHORT w_val; u16 w_val;
if (info->AsicID == ELECTRABUZZ_ID) { if (info->AsicID == ELECTRABUZZ_ID) {
ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR,
...@@ -273,18 +273,18 @@ long get_request_value(struct net_device *dev) ...@@ -273,18 +273,18 @@ long get_request_value(struct net_device *dev)
void put_request_value(struct net_device *dev, long lvalue) 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);
USHORT size; u16 size;
ULONG tempx; u32 tempx;
if (info->AsicID == ELECTRABUZZ_ID) { if (info->AsicID == ELECTRABUZZ_ID) {
size = (USHORT) (lvalue >> 16); size = (u16) (lvalue >> 16);
ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR,
DWNLD_SIZE_MSW_LOC); DWNLD_SIZE_MSW_LOC);
ft1000_write_reg(dev, FT1000_REG_DPRAM_DATA, size); ft1000_write_reg(dev, FT1000_REG_DPRAM_DATA, size);
size = (USHORT) (lvalue); size = (u16) (lvalue);
ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR,
DWNLD_SIZE_LSW_LOC); DWNLD_SIZE_LSW_LOC);
...@@ -297,10 +297,10 @@ void put_request_value(struct net_device *dev, long lvalue) ...@@ -297,10 +297,10 @@ void put_request_value(struct net_device *dev, long lvalue)
} }
USHORT hdr_checksum(struct pseudo_hdr *pHdr) u16 hdr_checksum(struct pseudo_hdr *pHdr)
{ {
USHORT *usPtr = (USHORT *) pHdr; u16 *usPtr = (u16 *) pHdr;
USHORT chksum; u16 chksum;
chksum = ((((((usPtr[0] ^ usPtr[1]) ^ usPtr[2]) ^ usPtr[3]) ^ chksum = ((((((usPtr[0] ^ usPtr[1]) ^ usPtr[2]) ^ usPtr[3]) ^
usPtr[4]) ^ usPtr[5]) ^ usPtr[6]); usPtr[4]) ^ usPtr[5]) ^ usPtr[6]);
...@@ -308,32 +308,32 @@ USHORT hdr_checksum(struct pseudo_hdr *pHdr) ...@@ -308,32 +308,32 @@ USHORT hdr_checksum(struct pseudo_hdr *pHdr)
return chksum; return chksum;
} }
int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) int card_download(struct net_device *dev, const u8 *pFileStart, u32 FileLength)
{ {
struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev); struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
int Status = SUCCESS; int Status = SUCCESS;
USHORT DspWordCnt = 0; u16 DspWordCnt = 0;
UINT uiState; u32 uiState;
USHORT handshake; u16 handshake;
struct pseudo_hdr *pHdr; struct pseudo_hdr *pHdr;
USHORT usHdrLength; u16 usHdrLength;
struct dsp_file_hdr *pFileHdr; struct dsp_file_hdr *pFileHdr;
long word_length; long word_length;
USHORT request; u16 request;
USHORT temp; u16 temp;
struct prov_record *pprov_record; struct prov_record *pprov_record;
PUCHAR pbuffer; u8 *pbuffer;
struct dsp_file_hdr_5 *pFileHdr5; struct dsp_file_hdr_5 *pFileHdr5;
struct dsp_image_info *pDspImageInfo = NULL; struct dsp_image_info *pDspImageInfo = NULL;
struct dsp_image_info_v6 *pDspImageInfoV6 = NULL; struct dsp_image_info_v6 *pDspImageInfoV6 = NULL;
long requested_version; long requested_version;
BOOLEAN bGoodVersion = 0; bool bGoodVersion = 0;
struct drv_msg *pMailBoxData; struct drv_msg *pMailBoxData;
USHORT *pUsData = NULL; u16 *pUsData = NULL;
USHORT *pUsFile = NULL; u16 *pUsFile = NULL;
UCHAR *pUcFile = NULL; u8 *pUcFile = NULL;
UCHAR *pBootEnd = NULL; u8 *pBootEnd = NULL;
UCHAR *pCodeEnd = NULL; u8 *pCodeEnd = NULL;
int imageN; int imageN;
long file_version; long file_version;
long loader_code_address = 0; long loader_code_address = 0;
...@@ -358,16 +358,16 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -358,16 +358,16 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
case 5: case 5:
case 6: case 6:
pUsFile = pUsFile =
(USHORT *) ((long)pFileStart + pFileHdr5->loader_offset); (u16 *) ((long)pFileStart + pFileHdr5->loader_offset);
pUcFile = pUcFile =
(UCHAR *) ((long)pFileStart + pFileHdr5->loader_offset); (u8 *) ((long)pFileStart + pFileHdr5->loader_offset);
pBootEnd = pBootEnd =
(UCHAR *) ((long)pFileStart + pFileHdr5->loader_code_end); (u8 *) ((long)pFileStart + pFileHdr5->loader_code_end);
loader_code_address = pFileHdr5->loader_code_address; loader_code_address = pFileHdr5->loader_code_address;
loader_code_size = pFileHdr5->loader_code_size; loader_code_size = pFileHdr5->loader_code_size;
bGoodVersion = FALSE; bGoodVersion = false;
break; break;
default: default:
...@@ -410,8 +410,8 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -410,8 +410,8 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
break; break;
case REQUEST_DONE_BL: case REQUEST_DONE_BL:
/* Reposition ptrs to beginning of code section */ /* Reposition ptrs to beginning of code section */
pUsFile = (USHORT *) ((long)pBootEnd); pUsFile = (u16 *) ((long)pBootEnd);
pUcFile = (UCHAR *) ((long)pBootEnd); pUcFile = (u8 *) ((long)pBootEnd);
uiState = STATE_CODE_DWNLD; uiState = STATE_CODE_DWNLD;
break; break;
case REQUEST_CODE_SEGMENT: case REQUEST_CODE_SEGMENT:
...@@ -523,12 +523,12 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -523,12 +523,12 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
case 5: case 5:
case 6: case 6:
pUsFile = pUsFile =
(USHORT *) ((long)pFileStart (u16 *) ((long)pFileStart
+ +
pFileHdr5-> pFileHdr5->
commands_offset); commands_offset);
pUcFile = pUcFile =
(UCHAR *) ((long)pFileStart (u8 *) ((long)pFileStart
+ +
pFileHdr5-> pFileHdr5->
commands_offset); commands_offset);
...@@ -607,7 +607,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -607,7 +607,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
pMailBoxData = pMailBoxData =
(struct drv_msg *) & info->DSPInfoBlk[0]; (struct drv_msg *) & info->DSPInfoBlk[0];
pUsData = pUsData =
(USHORT *) & pMailBoxData->data[0]; (u16 *) & pMailBoxData->data[0];
// Provide mutual exclusive access while reading ASIC registers. // Provide mutual exclusive access while reading ASIC registers.
spin_lock_irqsave(&info->dpram_lock, spin_lock_irqsave(&info->dpram_lock,
flags); flags);
...@@ -657,7 +657,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -657,7 +657,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
pFileHdr5->version_data_size; pFileHdr5->version_data_size;
put_request_value(dev, word_length); put_request_value(dev, word_length);
pUsFile = pUsFile =
(USHORT *) ((long)pFileStart + (u16 *) ((long)pFileStart +
pFileHdr5-> pFileHdr5->
version_data_offset); version_data_offset);
// Provide mutual exclusive access while reading ASIC registers. // Provide mutual exclusive access while reading ASIC registers.
...@@ -709,7 +709,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -709,7 +709,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
break; break;
case REQUEST_CODE_BY_VERSION: case REQUEST_CODE_BY_VERSION:
bGoodVersion = FALSE; bGoodVersion = false;
requested_version = requested_version =
get_request_value(dev); get_request_value(dev);
if (file_version == 5) { if (file_version == 5) {
...@@ -727,23 +727,23 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -727,23 +727,23 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
version == version ==
requested_version) { requested_version) {
bGoodVersion = bGoodVersion =
TRUE; true;
pUsFile = pUsFile =
(USHORT (u16
*) ((long) *) ((long)
pFileStart pFileStart
+ +
pDspImageInfo-> pDspImageInfo->
begin_offset); begin_offset);
pUcFile = pUcFile =
(UCHAR (u8
*) ((long) *) ((long)
pFileStart pFileStart
+ +
pDspImageInfo-> pDspImageInfo->
begin_offset); begin_offset);
pCodeEnd = pCodeEnd =
(UCHAR (u8
*) ((long) *) ((long)
pFileStart pFileStart
+ +
...@@ -770,11 +770,11 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -770,11 +770,11 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
imageN < imageN <
pFileHdr5->nDspImages; pFileHdr5->nDspImages;
imageN++) { imageN++) {
temp = (USHORT) temp = (u16)
(pDspImageInfoV6-> (pDspImageInfoV6->
version); version);
templong = temp; templong = temp;
temp = (USHORT) temp = (u16)
(pDspImageInfoV6-> (pDspImageInfoV6->
version >> 16); version >> 16);
templong |= templong |=
...@@ -782,23 +782,23 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -782,23 +782,23 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
if (templong == if (templong ==
requested_version) { requested_version) {
bGoodVersion = bGoodVersion =
TRUE; true;
pUsFile = pUsFile =
(USHORT (u16
*) ((long) *) ((long)
pFileStart pFileStart
+ +
pDspImageInfoV6-> pDspImageInfoV6->
begin_offset); begin_offset);
pUcFile = pUcFile =
(UCHAR (u8
*) ((long) *) ((long)
pFileStart pFileStart
+ +
pDspImageInfoV6-> pDspImageInfoV6->
begin_offset); begin_offset);
pCodeEnd = pCodeEnd =
(UCHAR (u8
*) ((long) *) ((long)
pFileStart pFileStart
+ +
...@@ -811,7 +811,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -811,7 +811,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
pDspImageInfoV6-> pDspImageInfoV6->
image_size; image_size;
image_chksum = image_chksum =
(ULONG) (u32)
pDspImageInfoV6-> pDspImageInfoV6->
checksum; checksum;
DEBUG(0, DEBUG(0,
...@@ -886,7 +886,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -886,7 +886,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
GFP_ATOMIC); GFP_ATOMIC);
if (pbuffer) { if (pbuffer) {
memcpy(pbuffer, (void *)pUcFile, memcpy(pbuffer, (void *)pUcFile,
(UINT) (usHdrLength + (u32) (usHdrLength +
sizeof(struct pseudo_hdr))); sizeof(struct pseudo_hdr)));
// link provisioning data // link provisioning data
pprov_record = pprov_record =
...@@ -900,7 +900,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength) ...@@ -900,7 +900,7 @@ int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength)
&info->prov_list); &info->prov_list);
// Move to next entry if available // Move to next entry if available
pUcFile = pUcFile =
(UCHAR *) ((unsigned long) pUcFile + (u8 *) ((unsigned long) pUcFile +
(unsigned long) ((usHdrLength + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr)); (unsigned long) ((usHdrLength + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr));
if ((unsigned long) (pUcFile) - if ((unsigned long) (pUcFile) -
(unsigned long) (pFileStart) >= (unsigned long) (pFileStart) >=
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include "ft1000.h" #include "ft1000.h"
int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength); int card_download(struct net_device *dev, const u8 *pFileStart, u32 FileLength);
void ft1000InitProc(struct net_device *dev); void ft1000InitProc(struct net_device *dev);
void ft1000CleanupProc(struct net_device *dev); void ft1000CleanupProc(struct net_device *dev);
...@@ -405,8 +405,8 @@ static void ft1000_reset_asic(struct net_device *dev) ...@@ -405,8 +405,8 @@ static void ft1000_reset_asic(struct net_device *dev)
// Input: // Input:
// dev - device structure // dev - device structure
// Output: // Output:
// status - FALSE (card reset fail) // status - false (card reset fail)
// TRUE (card reset successful) // true (card reset successful)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static int ft1000_reset_card(struct net_device *dev) static int ft1000_reset_card(struct net_device *dev)
...@@ -506,7 +506,7 @@ static int ft1000_reset_card(struct net_device *dev) ...@@ -506,7 +506,7 @@ static int ft1000_reset_card(struct net_device *dev)
if (i == 50) { if (i == 50) {
DEBUG(0, DEBUG(0,
"ft1000_hw:ft1000_reset_card:No FEFE detected from DSP\n"); "ft1000_hw:ft1000_reset_card:No FEFE detected from DSP\n");
return FALSE; return false;
} }
} else { } else {
...@@ -517,7 +517,7 @@ static int ft1000_reset_card(struct net_device *dev) ...@@ -517,7 +517,7 @@ static int ft1000_reset_card(struct net_device *dev)
if (card_download(dev, fw_entry->data, fw_entry->size)) { if (card_download(dev, fw_entry->data, fw_entry->size)) {
DEBUG(1, "card download unsuccessful\n"); DEBUG(1, "card download unsuccessful\n");
return FALSE; return false;
} else { } else {
DEBUG(1, "card download successful\n"); DEBUG(1, "card download successful\n");
} }
...@@ -553,7 +553,7 @@ static int ft1000_reset_card(struct net_device *dev) ...@@ -553,7 +553,7 @@ static int ft1000_reset_card(struct net_device *dev)
// poll_timer.data = (u_long)dev; // poll_timer.data = (u_long)dev;
// add_timer(&poll_timer); // add_timer(&poll_timer);
return TRUE; return true;
} }
...@@ -565,8 +565,8 @@ static int ft1000_reset_card(struct net_device *dev) ...@@ -565,8 +565,8 @@ static int ft1000_reset_card(struct net_device *dev)
// Input: // Input:
// dev - device structure // dev - device structure
// Output: // Output:
// status - FALSE (device is not present) // status - false (device is not present)
// TRUE (device is present) // true (device is present)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static int ft1000_chkcard(struct net_device *dev) static int ft1000_chkcard(struct net_device *dev)
...@@ -579,7 +579,7 @@ static int ft1000_chkcard(struct net_device *dev) ...@@ -579,7 +579,7 @@ static int ft1000_chkcard(struct net_device *dev)
if (tempword == 0) { if (tempword == 0) {
DEBUG(1, DEBUG(1,
"ft1000_hw:ft1000_chkcard: IMASK = 0 Card not detected\n"); "ft1000_hw:ft1000_chkcard: IMASK = 0 Card not detected\n");
return FALSE; return false;
} }
// The system will return the value of 0xffff for the version register // The system will return the value of 0xffff for the version register
// if the device is not present. // if the device is not present.
...@@ -587,9 +587,9 @@ static int ft1000_chkcard(struct net_device *dev) ...@@ -587,9 +587,9 @@ static int ft1000_chkcard(struct net_device *dev)
if (tempword == 0xffff) { if (tempword == 0xffff) {
DEBUG(1, DEBUG(1,
"ft1000_hw:ft1000_chkcard: Version = 0xffff Card not detected\n"); "ft1000_hw:ft1000_chkcard: Version = 0xffff Card not detected\n");
return FALSE; return false;
} }
return TRUE; return true;
} }
...@@ -609,7 +609,7 @@ static void ft1000_hbchk(u_long data) ...@@ -609,7 +609,7 @@ static void ft1000_hbchk(u_long data)
struct net_device *dev = (struct net_device *)data; struct net_device *dev = (struct net_device *)data;
struct ft1000_info *info; struct ft1000_info *info;
USHORT tempword; u16 tempword;
info = netdev_priv(dev); info = netdev_priv(dev);
...@@ -907,7 +907,7 @@ void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qt ...@@ -907,7 +907,7 @@ void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qt
// = 1 (successful) // = 1 (successful)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 *pnxtph) bool ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 *pnxtph)
{ {
struct ft1000_info *info = netdev_priv(dev); struct ft1000_info *info = netdev_priv(dev);
u16 size; u16 size;
...@@ -928,7 +928,7 @@ BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 ...@@ -928,7 +928,7 @@ BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16
DEBUG(1, DEBUG(1,
"FT1000:ft1000_receive_cmd:Invalid command length = %d\n", "FT1000:ft1000_receive_cmd:Invalid command length = %d\n",
size); size);
return FALSE; return false;
} else { } else {
ppseudohdr = (u16 *) pbuffer; ppseudohdr = (u16 *) pbuffer;
spin_lock_irqsave(&info->dpram_lock, flags); spin_lock_irqsave(&info->dpram_lock, flags);
...@@ -983,9 +983,9 @@ BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 ...@@ -983,9 +983,9 @@ BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16
DEBUG(1, DEBUG(1,
"FT1000:ft1000_receive_cmd:Pseudo header checksum mismatch\n"); "FT1000:ft1000_receive_cmd:Pseudo header checksum mismatch\n");
// Drop this message // Drop this message
return FALSE; return false;
} }
return TRUE; return true;
} }
} }
...@@ -1012,7 +1012,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1012,7 +1012,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
u16 i; u16 i;
struct prov_record *ptr; struct prov_record *ptr;
struct pseudo_hdr *ppseudo_hdr; struct pseudo_hdr *ppseudo_hdr;
PUSHORT pmsg; u16 *pmsg;
struct timeval tv; struct timeval tv;
union { union {
u8 byte[2]; u8 byte[2];
...@@ -1055,7 +1055,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1055,7 +1055,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
len = *(u16 *) ptr->pprov_data; len = *(u16 *) ptr->pprov_data;
len = htons(len); len = htons(len);
pmsg = (PUSHORT) 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++;
...@@ -1146,7 +1146,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1146,7 +1146,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
tempword = ntohs(pdrvmsg->length); tempword = ntohs(pdrvmsg->length);
info->DSPInfoBlklen = tempword; info->DSPInfoBlklen = tempword;
if (tempword < (MAX_DSP_SESS_REC - 4)) { if (tempword < (MAX_DSP_SESS_REC - 4)) {
pmsg = (PUSHORT) & pdrvmsg->data[0]; pmsg = (u16 *) & pdrvmsg->data[0];
for (i = 0; i < ((tempword + 1) / 2); i++) { for (i = 0; i < ((tempword + 1) / 2); i++) {
DEBUG(1, DEBUG(1,
"FT1000:drivermsg:dsp info data = 0x%x\n", "FT1000:drivermsg:dsp info data = 0x%x\n",
...@@ -1173,7 +1173,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1173,7 +1173,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
if ((tempword & FT1000_DB_DPRAM_TX) == 0) { if ((tempword & FT1000_DB_DPRAM_TX) == 0) {
// Put message into Slow Queue // Put message into Slow Queue
// Form Pseudo header // Form Pseudo header
pmsg = (PUSHORT) info->DSPInfoBlk; pmsg = (u16 *) info->DSPInfoBlk;
ppseudo_hdr = (struct pseudo_hdr *) pmsg; ppseudo_hdr = (struct pseudo_hdr *) pmsg;
ppseudo_hdr->length = ppseudo_hdr->length =
htons(info->DSPInfoBlklen + 4); htons(info->DSPInfoBlklen + 4);
...@@ -1198,7 +1198,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1198,7 +1198,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
info->DSPInfoBlk[8] = 0x7200; info->DSPInfoBlk[8] = 0x7200;
info->DSPInfoBlk[9] = info->DSPInfoBlk[9] =
htons(info->DSPInfoBlklen); htons(info->DSPInfoBlklen);
ft1000_send_cmd (dev, (PUSHORT)info->DSPInfoBlk, (USHORT)(info->DSPInfoBlklen+4), 0); ft1000_send_cmd (dev, (u16 *)info->DSPInfoBlk, (u16)(info->DSPInfoBlklen+4), 0);
} }
break; break;
...@@ -1220,7 +1220,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1220,7 +1220,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
if ((tempword & FT1000_DB_DPRAM_TX) == 0) { if ((tempword & FT1000_DB_DPRAM_TX) == 0) {
// Put message into Slow Queue // Put message into Slow Queue
// Form Pseudo header // Form Pseudo header
pmsg = (PUSHORT) & tempbuffer[0]; pmsg = (u16 *) & tempbuffer[0];
ppseudo_hdr = (struct pseudo_hdr *) pmsg; ppseudo_hdr = (struct pseudo_hdr *) pmsg;
ppseudo_hdr->length = htons(0x0012); ppseudo_hdr->length = htons(0x0012);
ppseudo_hdr->source = 0x10; ppseudo_hdr->source = 0x10;
...@@ -1241,7 +1241,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1241,7 +1241,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
for (i=1; i<7; i++) { for (i=1; i<7; i++) {
ppseudo_hdr->checksum ^= *pmsg++; ppseudo_hdr->checksum ^= *pmsg++;
} }
pmsg = (PUSHORT) & tempbuffer[16]; pmsg = (u16 *) & tempbuffer[16];
*pmsg++ = htons(RSP_DRV_ERR_RPT_MSG); *pmsg++ = htons(RSP_DRV_ERR_RPT_MSG);
*pmsg++ = htons(0x000e); *pmsg++ = htons(0x000e);
*pmsg++ = htons(info->DSP_TIME[0]); *pmsg++ = htons(info->DSP_TIME[0]);
...@@ -1256,7 +1256,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1256,7 +1256,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
*pmsg++ = convert.wrd; *pmsg++ = convert.wrd;
*pmsg++ = htons(info->DrvErrNum); *pmsg++ = htons(info->DrvErrNum);
ft1000_send_cmd (dev, (PUSHORT)&tempbuffer[0], (USHORT)(0x0012), 0); ft1000_send_cmd (dev, (u16 *)&tempbuffer[0], (u16)(0x0012), 0);
info->DrvErrNum = 0; info->DrvErrNum = 0;
} }
...@@ -1698,7 +1698,7 @@ int ft1000_copy_up_pkt(struct net_device *dev) ...@@ -1698,7 +1698,7 @@ int ft1000_copy_up_pkt(struct net_device *dev)
tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO); tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO);
*pbuffer++ = (u8) (tempword >> 8); *pbuffer++ = (u8) (tempword >> 8);
*pbuffer++ = (u8) tempword; *pbuffer++ = (u8) tempword;
if (ft1000_chkcard(dev) == FALSE) { if (ft1000_chkcard(dev) == false) {
kfree_skb(skb); kfree_skb(skb);
return FAILURE; return FAILURE;
} }
...@@ -2025,7 +2025,7 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id) ...@@ -2025,7 +2025,7 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
if (ft1000_chkcard(dev) == FALSE) { if (ft1000_chkcard(dev) == false) {
ft1000_disable_interrupts(dev); ft1000_disable_interrupts(dev);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment