staging: ft1000: Remove PSEUDO_HDR typedef usage.
authorMarek Belisko <marek.belisko@gmail.com>
Fri, 15 Oct 2010 12:13:02 +0000 (14:13 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 15 Oct 2010 19:30:39 +0000 (12:30 -0700)
Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
drivers/staging/ft1000/ft1000-usb/ft1000_download.c
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h
drivers/staging/ft1000/ft1000-usb/ft1000_usb.h

index 3325e876539029319e5dd3c680ba52c78273c800..e7ebb8a032b56de449534a575a66365db1773442 100644 (file)
@@ -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");
index b950634fe011f4258fc6ddd1e02e530788289a7c..48eb697129e2f2f19572b256016983c6a50e4edb 100644 (file)
@@ -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;
                     }
index d2c77f97084d0aba67fac8df5abe254b5bd1593a..05b2a4172017bfe2a7474422f91c090b1d4fed28 100644 (file)
@@ -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; i<len+12; i++)
@@ -1997,7 +1997,7 @@ static int ft1000_dsp_prov(void *arg)
     u16 len;
     u16 i=0;
        struct prov_record *ptr;
-    PPSEUDO_HDR ppseudo_hdr;
+       struct pseudo_hdr *ppseudo_hdr;
     PUSHORT pmsg;
     u16 status;
     USHORT TempShortBuf [256];
@@ -2039,7 +2039,7 @@ static int ft1000_dsp_prov(void *arg)
             //len = htons(len);
 
             pmsg = (PUSHORT)ptr->pprov_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; i<MAX_NUM_APP; i++) {
                                    if (info->app_info[i].app_id == ppseudo_hdr->portdest) {
index e7d3ec8869ac9b83a2d35412d3a9aab7c4b6eb3c..3f72d5bb3f925b4beddbd6a1797c59d24675525a 100644 (file)
@@ -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;
 
index 0e2c94b2e8a4cd1392c9d9d1a142b27d54561f76..b2a70facf967f56fc7106cc1571f12678ccbdc88 100644 (file)
@@ -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];