Skip to content

Commit

Permalink
staging: ft1000: Get rid of USHORT typedef usage.
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Marek Belisko authored and Greg Kroah-Hartman committed Nov 10, 2010
1 parent d167498 commit fc549a0
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 89 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,12 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command,
{
IOCTL_DPRAM_BLK *dpram_data;
//IOCTL_DPRAM_COMMAND dpram_command;
USHORT qtype;
USHORT msgsz;
u16 qtype;
u16 msgsz;
struct pseudo_hdr *ppseudo_hdr;
u16 *pmsg;
USHORT total_len;
USHORT app_index;
u16 total_len;
u16 app_index;
u16 status;

//DEBUG("FT1000:ft1000_ChIoctl: IOCTL_FT1000_SET_DPRAM called\n");
Expand Down
114 changes: 57 additions & 57 deletions drivers/staging/ft1000/ft1000-usb/ft1000_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct dsp_image_info {
static ULONG check_usb_db (struct ft1000_device *ft1000dev)
{
int loopcnt;
USHORT temp;
u16 temp;
ULONG status;

loopcnt = 0;
Expand Down Expand Up @@ -190,7 +190,7 @@ static ULONG check_usb_db (struct ft1000_device *ft1000dev)
// Function: get_handshake
//
// Parameters: struct ft1000_device - device structure
// USHORT expected_value - the handshake value expected
// u16 expected_value - the handshake value expected
//
// Returns: handshakevalue - success
// HANDSHAKE_TIMEOUT_VALUE - failure
Expand All @@ -200,9 +200,9 @@ static ULONG check_usb_db (struct ft1000_device *ft1000dev)
// Notes:
//
//---------------------------------------------------------------------------
static USHORT get_handshake(struct ft1000_device *ft1000dev, USHORT expected_value)
static u16 get_handshake(struct ft1000_device *ft1000dev, u16 expected_value)
{
USHORT handshake;
u16 handshake;
int loopcnt;
ULONG status=0;
struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
Expand Down Expand Up @@ -259,7 +259,7 @@ static USHORT get_handshake(struct ft1000_device *ft1000dev, USHORT expected_val
// Function: put_handshake
//
// Parameters: struct ft1000_device - device structure
// USHORT handshake_value - handshake to be written
// u16 handshake_value - handshake to be written
//
// Returns: none
//
Expand All @@ -269,29 +269,29 @@ static USHORT get_handshake(struct ft1000_device *ft1000dev, USHORT expected_val
// Notes:
//
//---------------------------------------------------------------------------
static void put_handshake(struct ft1000_device *ft1000dev,USHORT handshake_value)
static void put_handshake(struct ft1000_device *ft1000dev,u16 handshake_value)
{
ULONG tempx;
USHORT tempword;
u16 tempword;
ULONG status;



tempx = (ULONG)handshake_value;
tempx = ntohl(tempx);

tempword = (USHORT)(tempx & 0xffff);
tempword = (u16)(tempx & 0xffff);
status = ft1000_write_dpram16 (ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, tempword, 0);
tempword = (USHORT)(tempx >> 16);
tempword = (u16)(tempx >> 16);
status = ft1000_write_dpram16 (ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, tempword, 1);
status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX, FT1000_REG_DOORBELL);
}

static USHORT get_handshake_usb(struct ft1000_device *ft1000dev, USHORT expected_value)
static u16 get_handshake_usb(struct ft1000_device *ft1000dev, u16 expected_value)
{
USHORT handshake;
u16 handshake;
int loopcnt;
USHORT temp;
u16 temp;
ULONG status=0;

struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
Expand Down Expand Up @@ -327,7 +327,7 @@ static USHORT get_handshake_usb(struct ft1000_device *ft1000dev, USHORT expected
return HANDSHAKE_TIMEOUT_VALUE;
}

static void put_handshake_usb(struct ft1000_device *ft1000dev,USHORT handshake_value)
static void put_handshake_usb(struct ft1000_device *ft1000dev,u16 handshake_value)
{
int i;

Expand All @@ -346,11 +346,11 @@ static void put_handshake_usb(struct ft1000_device *ft1000dev,USHORT handshake_v
// Notes:
//
//---------------------------------------------------------------------------
static USHORT get_request_type(struct ft1000_device *ft1000dev)
static u16 get_request_type(struct ft1000_device *ft1000dev)
{
USHORT request_type;
u16 request_type;
ULONG status;
USHORT tempword;
u16 tempword;
ULONG tempx;
struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);

Expand All @@ -367,18 +367,18 @@ static USHORT get_request_type(struct ft1000_device *ft1000dev)
tempx |= (tempword << 16);
tempx = ntohl(tempx);
}
request_type = (USHORT)tempx;
request_type = (u16)tempx;

//DEBUG("get_request_type: request_type is %x\n", request_type);
return request_type;

}

static USHORT get_request_type_usb(struct ft1000_device *ft1000dev)
static u16 get_request_type_usb(struct ft1000_device *ft1000dev)
{
USHORT request_type;
u16 request_type;
ULONG status;
USHORT tempword;
u16 tempword;
ULONG tempx;
struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
if ( pft1000info->bootmode == 1)
Expand All @@ -399,7 +399,7 @@ static USHORT get_request_type_usb(struct ft1000_device *ft1000dev)
tempx |= (tempword << 16);
tempx = ntohl(tempx);
}
request_type = (USHORT)tempx;
request_type = (u16)tempx;

//DEBUG("get_request_type: request_type is %x\n", request_type);
return request_type;
Expand All @@ -421,7 +421,7 @@ static USHORT get_request_type_usb(struct ft1000_device *ft1000dev)
static long get_request_value(struct ft1000_device *ft1000dev)
{
ULONG value;
USHORT tempword;
u16 tempword;
ULONG status;
struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);

Expand Down Expand Up @@ -450,7 +450,7 @@ static long get_request_value(struct ft1000_device *ft1000dev)
static long get_request_value_usb(struct ft1000_device *ft1000dev)
{
ULONG value;
USHORT tempword;
u16 tempword;
ULONG status;
struct ft1000_info * pft1000info = netdev_priv(ft1000dev->net);

Expand Down Expand Up @@ -516,10 +516,10 @@ static void put_request_value(struct ft1000_device *ft1000dev, long lvalue)
// Notes:
//
//---------------------------------------------------------------------------
static USHORT hdr_checksum(struct pseudo_hdr *pHdr)
static u16 hdr_checksum(struct pseudo_hdr *pHdr)
{
USHORT *usPtr = (USHORT *)pHdr;
USHORT chksum;
u16 *usPtr = (u16 *)pHdr;
u16 chksum;


chksum = ((((((usPtr[0] ^ usPtr[1]) ^ usPtr[2]) ^ usPtr[3]) ^
Expand All @@ -533,7 +533,7 @@ static USHORT hdr_checksum(struct pseudo_hdr *pHdr)
// Function: write_blk
//
// Parameters: struct ft1000_device - device structure
// USHORT **pUsFile - DSP image file pointer in USHORT
// u16 **pUsFile - DSP image file pointer in u16
// u8 **pUcFile - DSP image file pointer in u8
// long word_length - lenght of the buffer to be written
// to DPRAM
Expand All @@ -546,20 +546,20 @@ static USHORT hdr_checksum(struct pseudo_hdr *pHdr)
// Notes:
//
//---------------------------------------------------------------------------
static ULONG write_blk (struct ft1000_device *ft1000dev, USHORT **pUsFile, u8 **pUcFile, long word_length)
static ULONG write_blk (struct ft1000_device *ft1000dev, u16 **pUsFile, u8 **pUcFile, long word_length)
{
ULONG Status = STATUS_SUCCESS;
USHORT dpram;
u16 dpram;
long temp_word_length;
int loopcnt, i, j;
USHORT *pTempFile;
USHORT tempword;
USHORT tempbuffer[64];
USHORT resultbuffer[64];
u16 *pTempFile;
u16 tempword;
u16 tempbuffer[64];
u16 resultbuffer[64];
struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);

//DEBUG("FT1000:download:start word_length = %d\n",(int)word_length);
dpram = (USHORT)DWNLD_MAG1_PS_HDR_LOC;
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
tempword = *(*pUsFile);
(*pUsFile)++;
Status = ft1000_write_dpram16(ft1000dev, dpram, tempword, 0);
Expand All @@ -569,7 +569,7 @@ static ULONG write_blk (struct ft1000_device *ft1000dev, USHORT **pUsFile, u8 **

*pUcFile = *pUcFile + 4;
word_length--;
tempword = (USHORT)word_length;
tempword = (u16)word_length;
word_length = (word_length / 16) + 1;
pTempFile = *pUsFile;
temp_word_length = word_length;
Expand Down Expand Up @@ -689,7 +689,7 @@ static void usb_dnld_complete (struct urb *urb)
// Function: write_blk_fifo
//
// Parameters: struct ft1000_device - device structure
// USHORT **pUsFile - DSP image file pointer in USHORT
// u16 **pUsFile - DSP image file pointer in u16
// u8 **pUcFile - DSP image file pointer in u8
// long word_length - lenght of the buffer to be written
// to DPRAM
Expand All @@ -702,7 +702,7 @@ static void usb_dnld_complete (struct urb *urb)
// Notes:
//
//---------------------------------------------------------------------------
static ULONG write_blk_fifo (struct ft1000_device *ft1000dev, USHORT **pUsFile, u8 **pUcFile, long word_length)
static ULONG write_blk_fifo (struct ft1000_device *ft1000dev, u16 **pUsFile, u8 **pUcFile, long word_length)
{
ULONG Status = STATUS_SUCCESS;
int byte_length;
Expand Down Expand Up @@ -774,21 +774,21 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
{
u16 Status = STATUS_SUCCESS;
UINT uiState;
USHORT handshake;
u16 handshake;
struct pseudo_hdr *pHdr;
USHORT usHdrLength;
u16 usHdrLength;
long word_length;
USHORT request;
USHORT temp;
USHORT tempword;
u16 request;
u16 temp;
u16 tempword;

struct dsp_file_hdr *pFileHdr5;
struct dsp_image_info *pDspImageInfoV6 = NULL;
long requested_version;
BOOLEAN bGoodVersion;
struct drv_msg *pMailBoxData;
USHORT *pUsData = NULL;
USHORT *pUsFile = NULL;
u16 *pUsData = NULL;
u16 *pUsFile = NULL;
u8 *pUcFile = NULL;
u8 *pBootEnd = NULL, *pCodeEnd= NULL;
int imageN;
Expand All @@ -798,7 +798,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
ULONG templong;
ULONG image_chksum = 0;

USHORT dpram = 0;
u16 dpram = 0;
u8 *pbuffer;
struct prov_record *pprov_record;
struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
Expand All @@ -820,7 +820,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe

ft1000_write_register (ft1000dev, 0x800, FT1000_REG_MAG_WATERMARK);

pUsFile = (USHORT *)(pFileStart + pFileHdr5->loader_offset);
pUsFile = (u16 *)(pFileStart + pFileHdr5->loader_offset);
pUcFile = (u8 *)(pFileStart + pFileHdr5->loader_offset);

pBootEnd = (u8 *)(pFileStart + pFileHdr5->loader_code_end);
Expand Down Expand Up @@ -878,7 +878,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
case REQUEST_DONE_BL:
DEBUG("FT1000:REQUEST_DONE_BL\n");
/* Reposition ptrs to beginning of code section */
pUsFile = (USHORT *)(pBootEnd);
pUsFile = (u16 *)(pBootEnd);
pUcFile = (u8 *)(pBootEnd);
//DEBUG("FT1000:download:pUsFile = 0x%8x\n", (int)pUsFile);
//DEBUG("FT1000:download:pUcFile = 0x%8x\n", (int)pUcFile);
Expand Down Expand Up @@ -909,7 +909,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
/*
* Position ASIC DPRAM auto-increment pointer.
*/
dpram = (USHORT)DWNLD_MAG1_PS_HDR_LOC;
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
if (word_length & 0x1)
word_length++;
word_length = word_length / 2;
Expand Down Expand Up @@ -988,7 +988,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
case REQUEST_DONE_CL:
pft1000info->usbboot = 3;
/* Reposition ptrs to beginning of provisioning section */
pUsFile = (USHORT *)(pFileStart + pFileHdr5->commands_offset);
pUsFile = (u16 *)(pFileStart + pFileHdr5->commands_offset);
pUcFile = (u8 *)(pFileStart + pFileHdr5->commands_offset);
uiState = STATE_DONE_DWNLD;
break;
Expand Down Expand Up @@ -1027,7 +1027,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
/*
* Position ASIC DPRAM auto-increment pointer.
*/
dpram = (USHORT)DWNLD_MAG1_PS_HDR_LOC;
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
if (word_length & 0x1)
word_length++;
word_length = word_length / 2;
Expand All @@ -1053,8 +1053,8 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
*/


pUsData = (USHORT *)&pMailBoxData->data[0];
dpram = (USHORT)DWNLD_MAG1_PS_HDR_LOC;
pUsData = (u16 *)&pMailBoxData->data[0];
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
if (word_length & 0x1)
word_length++;

Expand All @@ -1079,10 +1079,10 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
* Position ASIC DPRAM auto-increment pointer.
*/

pUsFile = (USHORT *)(pFileStart + pFileHdr5->version_data_offset);
pUsFile = (u16 *)(pFileStart + pFileHdr5->version_data_offset);


dpram = (USHORT)DWNLD_MAG1_PS_HDR_LOC;
dpram = (u16)DWNLD_MAG1_PS_HDR_LOC;
if (word_length & 0x1)
word_length++;

Expand Down Expand Up @@ -1110,15 +1110,15 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
for (imageN = 0; imageN < pFileHdr5->nDspImages; imageN++)
{

temp = (USHORT)(pDspImageInfoV6->version);
temp = (u16)(pDspImageInfoV6->version);
templong = temp;
temp = (USHORT)(pDspImageInfoV6->version >> 16);
temp = (u16)(pDspImageInfoV6->version >> 16);
templong |= (temp << 16);
if (templong == (ULONG)requested_version)
{
bGoodVersion = TRUE;
DEBUG("FT1000:download: bGoodVersion is TRUE\n");
pUsFile = (USHORT *)(pFileStart + pDspImageInfoV6->begin_offset);
pUsFile = (u16 *)(pFileStart + pDspImageInfoV6->begin_offset);
pUcFile = (u8 *)(pFileStart + pDspImageInfoV6->begin_offset);
pCodeEnd = (u8 *)(pFileStart + pDspImageInfoV6->end_offset);
run_address = pDspImageInfoV6->run_address;
Expand Down
Loading

0 comments on commit fc549a0

Please sign in to comment.