//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;
// 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++;
//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");
//---------------------------------------------------------------------------
// Function: hdr_checksum
//
-// Parameters: PPSEUDO_HDR pHdr - Pseudo header pointer
+// Parameters: struct pseudo_hdr *pHdr - Pseudo header pointer
//
// Returns: checksum - success
//
// Notes:
//
//---------------------------------------------------------------------------
-static USHORT hdr_checksum(PPSEUDO_HDR pHdr)
+static USHORT hdr_checksum(struct pseudo_hdr *pHdr)
{
USHORT *usPtr = (USHORT *)pHdr;
USHORT chksum;
u16 Status = STATUS_SUCCESS;
UINT uiState;
USHORT handshake;
- PPSEUDO_HDR pHdr;
+ struct pseudo_hdr *pHdr;
USHORT usHdrLength;
long word_length;
USHORT request;
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))
{
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;
}
}
#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");
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
- 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++)
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];
//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;
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
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;
// 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;
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");
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);
//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) {
#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)
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
{
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;
struct media_msg {
- PSEUDO_HDR pseudo;
+ struct pseudo_hdr pseudo;
u16 type;
u16 length;
u16 state;
} __attribute__ ((packed));
struct dsp_init_msg {
- PSEUDO_HDR pseudo;
+ struct pseudo_hdr pseudo;
u16 type;
u16 length;
u8 DspVer[DSPVERSZ]; // DSP version number
#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];