From b13e39b2f7e7e313e97cd11ee65e5348afe448fb Mon Sep 17 00:00:00 2001 From: Marek Belisko Date: Fri, 15 Oct 2010 14:13:02 +0200 Subject: [PATCH] staging: ft1000: Remove PSEUDO_HDR typedef usage. Signed-off-by: Marek Belisko Signed-off-by: Greg Kroah-Hartman --- .../staging/ft1000/ft1000-usb/ft1000_chdev.c | 6 +-- .../ft1000/ft1000-usb/ft1000_download.c | 14 +++---- drivers/staging/ft1000/ft1000-usb/ft1000_hw.c | 22 +++++----- .../staging/ft1000/ft1000-usb/ft1000_ioctl.h | 7 ++-- .../staging/ft1000/ft1000-usb/ft1000_usb.h | 41 ++----------------- 5 files changed, 27 insertions(+), 63 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c index 3325e8765390..e7ebb8a032b5 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c @@ -655,7 +655,7 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command, //IOCTL_DPRAM_COMMAND dpram_command; USHORT qtype; USHORT msgsz; - PPSEUDO_HDR ppseudo_hdr; + struct pseudo_hdr *ppseudo_hdr; PUSHORT pmsg; USHORT total_len; USHORT app_index; @@ -768,7 +768,7 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command, // Need to put sequence number plus new checksum for message //pmsg = (PUSHORT)&dpram_command.dpram_blk.pseudohdr; pmsg = (PUSHORT)&dpram_data->pseudohdr; - ppseudo_hdr = (PPSEUDO_HDR)pmsg; + ppseudo_hdr = (struct pseudo_hdr *)pmsg; total_len = msgsz+2; if (total_len & 0x1) { total_len++; @@ -785,7 +785,7 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command, //DEBUG("checksum = 0x%x\n", ppseudo_hdr->checksum); } pmsg++; - ppseudo_hdr = (PPSEUDO_HDR)pmsg; + ppseudo_hdr = (struct pseudo_hdr *)pmsg; #if 0 ptr = dpram_data; DEBUG("FT1000:ft1000_ChIoctl: Command Send\n"); diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index b950634fe011..48eb697129e2 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c @@ -507,7 +507,7 @@ static void put_request_value(struct ft1000_device *ft1000dev, long lvalue) //--------------------------------------------------------------------------- // Function: hdr_checksum // -// Parameters: PPSEUDO_HDR pHdr - Pseudo header pointer +// Parameters: struct pseudo_hdr *pHdr - Pseudo header pointer // // Returns: checksum - success // @@ -516,7 +516,7 @@ static void put_request_value(struct ft1000_device *ft1000dev, long lvalue) // Notes: // //--------------------------------------------------------------------------- -static USHORT hdr_checksum(PPSEUDO_HDR pHdr) +static USHORT hdr_checksum(struct pseudo_hdr *pHdr) { USHORT *usPtr = (USHORT *)pHdr; USHORT chksum; @@ -775,7 +775,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe u16 Status = STATUS_SUCCESS; UINT uiState; USHORT handshake; - PPSEUDO_HDR pHdr; + struct pseudo_hdr *pHdr; USHORT usHdrLength; long word_length; USHORT request; @@ -1167,7 +1167,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe case STATE_SECTION_PROV: DEBUG("FT1000:download:STATE_SECTION_PROV\n"); - pHdr = (PPSEUDO_HDR)pUcFile; + pHdr = (struct pseudo_hdr *)pUcFile; if (pHdr->checksum == hdr_checksum(pHdr)) { @@ -1179,16 +1179,16 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe usHdrLength = ntohs(pHdr->length); /* Byte length for PROV records */ // Get buffer for provisioning data - pbuffer = kmalloc ( (usHdrLength + sizeof(PSEUDO_HDR) ), GFP_ATOMIC ); + pbuffer = kmalloc((usHdrLength + sizeof(struct pseudo_hdr)), GFP_ATOMIC); if (pbuffer) { - memcpy(pbuffer, (void *)pUcFile, (UINT)(usHdrLength + sizeof(PSEUDO_HDR))); + memcpy(pbuffer, (void *)pUcFile, (UINT)(usHdrLength + sizeof(struct pseudo_hdr))); // link provisioning data pprov_record = kmalloc(sizeof(struct prov_record), GFP_ATOMIC); if (pprov_record) { pprov_record->pprov_data = pbuffer; list_add_tail (&pprov_record->list, &pft1000info->prov_list); // Move to next entry if available - pUcFile = (UCHAR *)((unsigned long)pUcFile + (UINT)((usHdrLength + 1) & 0xFFFFFFFE) + sizeof(PSEUDO_HDR)); + pUcFile = (UCHAR *)((unsigned long)pUcFile + (UINT)((usHdrLength + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr)); if ( (unsigned long)(pUcFile) - (unsigned long)(pFileStart) >= (unsigned long)FileLength) { uiState = STATE_DONE_FILE; } diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c index d2c77f97084d..05b2a4172017 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c @@ -1440,7 +1440,7 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len) } #endif - count = sizeof (PSEUDO_HDR) + len; + count = sizeof(struct pseudo_hdr) + len; if(count > MAX_BUF_SIZE) { DEBUG("Error:ft1000_copy_down_pkt:Message Size Overflow!\n"); @@ -1466,7 +1466,7 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len) checksum ^= *pTemp ++; } *pTemp++ = checksum; - memcpy (&(pFt1000Dev->tx_buf[sizeof(PSEUDO_HDR)]), packet, len); + memcpy(&(pFt1000Dev->tx_buf[sizeof(struct pseudo_hdr)]), packet, len); //usb_init_urb(pFt1000Dev->tx_urb); //mbelian @@ -1685,7 +1685,7 @@ static int ft1000_copy_up_pkt (struct urb *urb) - memcpy(pbuffer, ft1000dev->rx_buf+sizeof(PSEUDO_HDR), len-sizeof(PSEUDO_HDR)); + memcpy(pbuffer, ft1000dev->rx_buf+sizeof(struct pseudo_hdr), len-sizeof(struct pseudo_hdr)); //DEBUG("ft1000_copy_up_pkt: Data passed to Protocol layer\n"); /*for (i=0; ipprov_data; - ppseudo_hdr = (PPSEUDO_HDR)pmsg; + ppseudo_hdr = (struct pseudo_hdr *)pmsg; // Insert slow queue sequence number ppseudo_hdr->seq_num = info->squeseqnum++; ppseudo_hdr->portsrc = 0; @@ -2084,7 +2084,7 @@ static int ft1000_proc_drvmsg (struct ft1000_device *dev, u16 size) { struct dsp_init_msg *pdspinitmsg; PDRVMSG pdrvmsg; u16 i; - PPSEUDO_HDR ppseudo_hdr; + struct pseudo_hdr *ppseudo_hdr; PUSHORT pmsg; u16 status; //struct timeval tv; //mbelian @@ -2255,7 +2255,7 @@ static int ft1000_proc_drvmsg (struct ft1000_device *dev, u16 size) { pmsg = (PUSHORT)info->DSPInfoBlk; *pmsg++ = 0; *pmsg++ = htons(info->DSPInfoBlklen+20+info->DSPInfoBlklen); - ppseudo_hdr = (PPSEUDO_HDR)(PUSHORT)&info->DSPInfoBlk[2]; + ppseudo_hdr = (struct pseudo_hdr *)(PUSHORT)&info->DSPInfoBlk[2]; ppseudo_hdr->length = htons(info->DSPInfoBlklen+4+info->DSPInfoBlklen); ppseudo_hdr->source = 0x10; ppseudo_hdr->destination = 0x20; @@ -2303,7 +2303,7 @@ static int ft1000_proc_drvmsg (struct ft1000_device *dev, u16 size) { // Put message into Slow Queue // Form Pseudo header pmsg = (PUSHORT)&tempbuffer[0]; - ppseudo_hdr = (PPSEUDO_HDR)pmsg; + ppseudo_hdr = (struct pseudo_hdr *)pmsg; ppseudo_hdr->length = htons(0x0012); ppseudo_hdr->source = 0x10; ppseudo_hdr->destination = 0x20; @@ -2377,7 +2377,7 @@ int ft1000_poll(void* dev_id) { USHORT portid; u16 nxtph; PDPRAM_BLK pdpram_blk; - PPSEUDO_HDR ppseudo_hdr; + struct pseudo_hdr *ppseudo_hdr; unsigned long flags; //DEBUG("Enter ft1000_poll...\n"); @@ -2431,7 +2431,7 @@ int ft1000_poll(void* dev_id) { pdpram_blk = ft1000_get_buffer (&freercvpool); if (pdpram_blk != NULL) { if ( ft1000_receive_cmd(dev, pdpram_blk->pbuffer, MAX_CMD_SQSIZE, &nxtph) ) { - ppseudo_hdr = (PPSEUDO_HDR)pdpram_blk->pbuffer; + ppseudo_hdr = (struct pseudo_hdr *)pdpram_blk->pbuffer; // Put message into the appropriate application block info->app_info[i].nRxMsg++; spin_lock_irqsave(&free_buff_lock, flags); @@ -2461,7 +2461,7 @@ int ft1000_poll(void* dev_id) { //DEBUG("Memory allocated = 0x%8x\n", (u32)pdpram_blk); if (pdpram_blk != NULL) { if ( ft1000_receive_cmd(dev, pdpram_blk->pbuffer, MAX_CMD_SQSIZE, &nxtph) ) { - ppseudo_hdr = (PPSEUDO_HDR)pdpram_blk->pbuffer; + ppseudo_hdr = (struct pseudo_hdr *)pdpram_blk->pbuffer; // Search for correct application block for (i=0; iapp_info[i].app_id == ppseudo_hdr->portdest) { diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h b/drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h index e7d3ec8869ac..3f72d5bb3f92 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h @@ -36,8 +36,7 @@ #define MAX_DNLD_BLKSZ 1024 // Standard Flarion Pseudo header -typedef struct _PSEUDO_HDR -{ +struct pseudo_hdr { unsigned short length; //length of msg body unsigned char source; //source address (0x10=Host 0x20=DSP) unsigned char destination; //destination address (refer to source address) @@ -57,7 +56,7 @@ typedef struct _PSEUDO_HDR unsigned char rsvd2; //reserved unsigned short qos_class; //Quality of Service class (Not applicable on Mobile) unsigned short checksum; //Psuedo header checksum -} __attribute__ ((packed)) PSEUDO_HDR, *PPSEUDO_HDR; +} __attribute__ ((packed)); typedef struct _IOCTL_GET_VER { @@ -106,7 +105,7 @@ typedef struct _IOCTL_GET_DSP_STAT typedef struct _IOCTL_DPRAM_BLK { unsigned short total_len; - PSEUDO_HDR pseudohdr; + struct pseudo_hdr pseudohdr; unsigned char buffer[1780]; } __attribute__ ((packed)) IOCTL_DPRAM_BLK, *PIOCTL_DPRAM_BLK; diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h index 0e2c94b2e8a4..b2a70facf967 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h @@ -52,7 +52,7 @@ struct media_msg { - PSEUDO_HDR pseudo; + struct pseudo_hdr pseudo; u16 type; u16 length; u16 state; @@ -64,7 +64,7 @@ struct media_msg { } __attribute__ ((packed)); struct dsp_init_msg { - PSEUDO_HDR pseudo; + struct pseudo_hdr pseudo; u16 type; u16 length; u8 DspVer[DSPVERSZ]; // DSP version number @@ -455,43 +455,8 @@ struct prov_record { #define MAX_BUF_SIZE 4096 - -#if 0 //Removed by Jim -typedef struct _PSEUDO_HDR - -{ - - unsigned short length; - - unsigned char source; - - unsigned char destination; - - unsigned char portdest; - - unsigned char portsrc; - - unsigned short sh_str_id; - - unsigned char control; - - unsigned char rsvd1; - - unsigned char seq_num; - - unsigned char rsvd2; - - unsigned short qos_class; - - unsigned short checksum; - - - -} PSEUDO_HDR, *PPSEUDO_HDR; -#endif //end of Jim - typedef struct _DRVMSG { - PSEUDO_HDR pseudo; + struct pseudo_hdr pseudo; u16 type; u16 length; u8 data[0]; -- 2.39.5