diff options
Diffstat (limited to 'drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c')
-rw-r--r-- | drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 244 |
1 files changed, 92 insertions, 152 deletions
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c index 830822f..b3d743a 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c @@ -54,19 +54,13 @@ #endif #include <linux/delay.h> -#include "ft1000_dev.h" #include "ft1000.h" -int card_download(struct net_device *dev, const u8 *pFileStart, UINT FileLength); - -void ft1000InitProc(struct net_device *dev); -void ft1000CleanupProc(struct net_device *dev); - -const struct firmware *fw_entry; +static const struct firmware *fw_entry; static void ft1000_hbchk(u_long data); static struct timer_list poll_timer = { - function:ft1000_hbchk + .function = ft1000_hbchk }; static u16 cmdbuffer[1024]; @@ -89,40 +83,6 @@ MODULE_SUPPORTED_DEVICE("FT1000"); //--------------------------------------------------------------------------- // -// Function: ft1000_asic_read -// Description: This function will retrieve the value of a specific ASIC -// register. -// Input: -// dev - network device structure -// offset - ASIC register to read -// Output: -// value - value of ASIC register -// -//--------------------------------------------------------------------------- -inline u16 ft1000_asic_read(struct net_device *dev, u16 offset) -{ - return (ft1000_read_reg(dev, offset)); -} - -//--------------------------------------------------------------------------- -// -// Function: ft1000_asic_write -// Description: This function will set the value of a specific ASIC -// register. -// Input: -// dev - network device structure -// value - value to set ASIC register -// Output: -// none -// -//--------------------------------------------------------------------------- -inline void ft1000_asic_write(struct net_device *dev, u16 offset, u16 value) -{ - ft1000_write_reg(dev, offset, value); -} - -//--------------------------------------------------------------------------- -// // Function: ft1000_read_fifo_len // Description: This function will read the ASIC Uplink FIFO status register // which will return the number of bytes remaining in the Uplink FIFO. @@ -136,7 +96,7 @@ inline void ft1000_asic_write(struct net_device *dev, u16 offset, u16 value) //--------------------------------------------------------------------------- static inline u16 ft1000_read_fifo_len(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); if (info->AsicID == ELECTRABUZZ_ID) { return (ft1000_read_reg(dev, FT1000_REG_UFIFO_STAT) - 16); @@ -159,7 +119,7 @@ static inline u16 ft1000_read_fifo_len(struct net_device *dev) //--------------------------------------------------------------------------- u16 ft1000_read_dpram(struct net_device * dev, int offset) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); unsigned long flags; u16 data; @@ -188,7 +148,7 @@ u16 ft1000_read_dpram(struct net_device * dev, int offset) static inline void ft1000_write_dpram(struct net_device *dev, int offset, u16 value) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); unsigned long flags; // Provide mutual exclusive access while reading ASIC registers. @@ -212,7 +172,7 @@ static inline void ft1000_write_dpram(struct net_device *dev, //--------------------------------------------------------------------------- u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, int Index) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); unsigned long flags; u16 data; @@ -246,7 +206,7 @@ u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, int Index) static inline void ft1000_write_dpram_mag_16(struct net_device *dev, int offset, u16 value, int Index) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); unsigned long flags; // Provide mutual exclusive access while reading ASIC registers. @@ -274,7 +234,7 @@ static inline void ft1000_write_dpram_mag_16(struct net_device *dev, //--------------------------------------------------------------------------- u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); unsigned long flags; u32 data; @@ -302,7 +262,7 @@ u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset) //--------------------------------------------------------------------------- void ft1000_write_dpram_mag_32(struct net_device *dev, int offset, u32 value) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); unsigned long flags; // Provide mutual exclusive access while reading ASIC registers. @@ -324,17 +284,14 @@ void ft1000_write_dpram_mag_32(struct net_device *dev, int offset, u32 value) //--------------------------------------------------------------------------- static void ft1000_enable_interrupts(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); u16 tempword; DEBUG(1, "ft1000_hw:ft1000_enable_interrupts()\n"); - ft1000_write_reg(dev, FT1000_REG_SUP_IMASK, - info->CurrentInterruptEnableMask); + ft1000_write_reg(dev, FT1000_REG_SUP_IMASK, ISR_DEFAULT_MASK); tempword = ft1000_read_reg(dev, FT1000_REG_SUP_IMASK); DEBUG(1, "ft1000_hw:ft1000_enable_interrupts:current interrupt enable mask = 0x%x\n", tempword); - info->InterruptsEnabled = TRUE; } //--------------------------------------------------------------------------- @@ -349,7 +306,6 @@ static void ft1000_enable_interrupts(struct net_device *dev) //--------------------------------------------------------------------------- static void ft1000_disable_interrupts(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); u16 tempword; DEBUG(1, "ft1000_hw: ft1000_disable_interrupts()\n"); @@ -358,7 +314,6 @@ static void ft1000_disable_interrupts(struct net_device *dev) DEBUG(1, "ft1000_hw:ft1000_disable_interrupts:current interrupt enable mask = 0x%x\n", tempword); - info->InterruptsEnabled = FALSE; } //--------------------------------------------------------------------------- @@ -374,13 +329,12 @@ static void ft1000_disable_interrupts(struct net_device *dev) //--------------------------------------------------------------------------- static void ft1000_reset_asic(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); u16 tempword; DEBUG(1, "ft1000_hw:ft1000_reset_asic called\n"); (*info->ft1000_reset) (info->link); - info->ASICResetNum++; // Let's use the register provided by the Magnemite ASIC to reset the // ASIC and DSP. @@ -412,17 +366,17 @@ static void ft1000_reset_asic(struct net_device *dev) // Input: // dev - device structure // Output: -// status - FALSE (card reset fail) -// TRUE (card reset successful) +// status - false (card reset fail) +// true (card reset successful) // //--------------------------------------------------------------------------- static int ft1000_reset_card(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); u16 tempword; int i; unsigned long flags; - PPROV_RECORD ptr; + struct prov_record *ptr; DEBUG(1, "ft1000_hw:ft1000_reset_card called.....\n"); @@ -437,7 +391,7 @@ static int ft1000_reset_card(struct net_device *dev) while (list_empty(&info->prov_list) == 0) { DEBUG(0, "ft1000_hw:ft1000_reset_card:deleting provisioning record\n"); - ptr = list_entry(info->prov_list.next, PROV_RECORD, list); + ptr = list_entry(info->prov_list.next, struct prov_record, list); list_del(&ptr->list); kfree(ptr->pprov_data); kfree(ptr); @@ -457,14 +411,12 @@ static int ft1000_reset_card(struct net_device *dev) if (ft1000_card_present == 1) { spin_lock_irqsave(&info->dpram_lock, flags); if (info->AsicID == ELECTRABUZZ_ID) { - if (info->DspHibernateFlag == 0) { - ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, - FT1000_DPRAM_RX_BASE); - for (i = 0; i < MAX_DSP_SESS_REC; i++) { - info->DSPSess.Rec[i] = - ft1000_read_reg(dev, - FT1000_REG_DPRAM_DATA); - } + ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, + FT1000_DPRAM_RX_BASE); + for (i = 0; i < MAX_DSP_SESS_REC; i++) { + info->DSPSess.Rec[i] = + ft1000_read_reg(dev, + FT1000_REG_DPRAM_DATA); } } else { ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, @@ -482,8 +434,6 @@ static int ft1000_reset_card(struct net_device *dev) //reset ASIC ft1000_reset_asic(dev); - info->DSPResetNum++; - DEBUG(1, "ft1000_hw:ft1000_reset_card:downloading dsp image\n"); if (info->AsicID == MAGNEMITE_ID) { @@ -517,7 +467,7 @@ static int ft1000_reset_card(struct net_device *dev) if (i == 50) { DEBUG(0, "ft1000_hw:ft1000_reset_card:No FEFE detected from DSP\n"); - return FALSE; + return false; } } else { @@ -528,7 +478,7 @@ static int ft1000_reset_card(struct net_device *dev) if (card_download(dev, fw_entry->data, fw_entry->size)) { DEBUG(1, "card download unsuccessful\n"); - return FALSE; + return false; } else { DEBUG(1, "card download successful\n"); } @@ -564,7 +514,7 @@ static int ft1000_reset_card(struct net_device *dev) // poll_timer.data = (u_long)dev; // add_timer(&poll_timer); - return TRUE; + return true; } @@ -576,8 +526,8 @@ static int ft1000_reset_card(struct net_device *dev) // Input: // dev - device structure // Output: -// status - FALSE (device is not present) -// TRUE (device is present) +// status - false (device is not present) +// true (device is present) // //--------------------------------------------------------------------------- static int ft1000_chkcard(struct net_device *dev) @@ -590,7 +540,7 @@ static int ft1000_chkcard(struct net_device *dev) if (tempword == 0) { DEBUG(1, "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 // if the device is not present. @@ -598,9 +548,9 @@ static int ft1000_chkcard(struct net_device *dev) if (tempword == 0xffff) { DEBUG(1, "ft1000_hw:ft1000_chkcard: Version = 0xffff Card not detected\n"); - return FALSE; + return false; } - return TRUE; + return true; } @@ -619,8 +569,8 @@ static void ft1000_hbchk(u_long data) { struct net_device *dev = (struct net_device *)data; - FT1000_INFO *info; - USHORT tempword; + struct ft1000_info *info; + u16 tempword; info = netdev_priv(dev); @@ -833,14 +783,14 @@ static void ft1000_hbchk(u_long data) // Output: // //--------------------------------------------------------------------------- -void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qtype) +static void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qtype) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); int i; u16 tempword; unsigned long flags; - size += PSEUDOSZ; + size += sizeof(struct pseudo_hdr); // check for odd byte and increment to 16-bit word align value if ((size & 0x0001)) { size++; @@ -918,9 +868,10 @@ void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qt // = 1 (successful) // //--------------------------------------------------------------------------- -BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 *pnxtph) +static bool ft1000_receive_cmd(struct net_device *dev, u16 *pbuffer, + int maxsz, u16 *pnxtph) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); u16 size; u16 *ppseudohdr; int i; @@ -928,18 +879,18 @@ BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 unsigned long flags; if (info->AsicID == ELECTRABUZZ_ID) { - size = ( ft1000_read_dpram(dev, *pnxtph) ) + PSEUDOSZ; + size = ( ft1000_read_dpram(dev, *pnxtph) ) + sizeof(struct pseudo_hdr); } else { size = ntohs(ft1000_read_dpram_mag_16 (dev, FT1000_MAG_PH_LEN, - FT1000_MAG_PH_LEN_INDX)) + PSEUDOSZ; + FT1000_MAG_PH_LEN_INDX)) + sizeof(struct pseudo_hdr); } if (size > maxsz) { DEBUG(1, "FT1000:ft1000_receive_cmd:Invalid command length = %d\n", size); - return FALSE; + return false; } else { ppseudohdr = (u16 *) pbuffer; spin_lock_irqsave(&info->dpram_lock, flags); @@ -994,9 +945,9 @@ BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 DEBUG(1, "FT1000:ft1000_receive_cmd:Pseudo header checksum mismatch\n"); // Drop this message - return FALSE; + return false; } - return TRUE; + return true; } } @@ -1011,19 +962,19 @@ BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 // none // //--------------------------------------------------------------------------- -void ft1000_proc_drvmsg(struct net_device *dev) +static void ft1000_proc_drvmsg(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); u16 msgtype; u16 tempword; - PMEDIAMSG pmediamsg; - PDSPINITMSG pdspinitmsg; - PDRVMSG pdrvmsg; + struct media_msg *pmediamsg; + struct dsp_init_msg *pdspinitmsg; + struct drv_msg *pdrvmsg; u16 len; u16 i; - PPROV_RECORD ptr; - PPSEUDO_HDR ppseudo_hdr; - PUSHORT pmsg; + struct prov_record *ptr; + struct pseudo_hdr *ppseudo_hdr; + u16 *pmsg; struct timeval tv; union { u8 byte[2]; @@ -1039,7 +990,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) if ( ft1000_receive_cmd(dev, &cmdbuffer[0], MAX_CMD_SQSIZE, &tempword) ) { // Get the message type which is total_len + PSEUDO header + msgtype + message body - pdrvmsg = (PDRVMSG) & cmdbuffer[0]; + pdrvmsg = (struct drv_msg *) & cmdbuffer[0]; msgtype = ntohs(pdrvmsg->type); DEBUG(1, "Command message type = 0x%x\n", msgtype); switch (msgtype) { @@ -1062,12 +1013,12 @@ void ft1000_proc_drvmsg(struct net_device *dev) } ptr = list_entry(info->prov_list.next, - PROV_RECORD, list); + struct prov_record, list); len = *(u16 *) ptr->pprov_data; len = htons(len); - pmsg = (PUSHORT) ptr->pprov_data; - ppseudo_hdr = (PPSEUDO_HDR) pmsg; + pmsg = (u16 *) ptr->pprov_data; + ppseudo_hdr = (struct pseudo_hdr *) pmsg; // Insert slow queue sequence number ppseudo_hdr->seq_num = info->squeseqnum++; ppseudo_hdr->portsrc = 0; @@ -1091,7 +1042,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) info->CardReady = 1; break; case MEDIA_STATE: - pmediamsg = (PMEDIAMSG) & cmdbuffer[0]; + pmediamsg = (struct media_msg *) & cmdbuffer[0]; if (info->ProgConStat != 0xFF) { if (pmediamsg->state) { DEBUG(1, "Media is up\n"); @@ -1123,7 +1074,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) } break; case DSP_INIT_MSG: - pdspinitmsg = (PDSPINITMSG) & cmdbuffer[0]; + pdspinitmsg = (struct dsp_init_msg *) & cmdbuffer[0]; memcpy(info->DspVer, pdspinitmsg->DspVer, DSPVERSZ); DEBUG(1, "DSPVER = 0x%2x 0x%2x 0x%2x 0x%2x\n", info->DspVer[0], info->DspVer[1], info->DspVer[2], @@ -1140,7 +1091,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) dev->dev_addr[5] = info->eui64[7]; if (ntohs(pdspinitmsg->length) == - (sizeof(DSPINITMSG) - 20)) { + (sizeof(struct dsp_init_msg) - 20)) { memcpy(info->ProductMode, pdspinitmsg->ProductMode, MODESZ); memcpy(info->RfCalVer, pdspinitmsg->RfCalVer, @@ -1157,7 +1108,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) tempword = ntohs(pdrvmsg->length); info->DSPInfoBlklen = tempword; 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++) { DEBUG(1, "FT1000:drivermsg:dsp info data = 0x%x\n", @@ -1169,7 +1120,6 @@ void ft1000_proc_drvmsg(struct net_device *dev) case DSP_GET_INFO: DEBUG(1, "FT1000:drivermsg:Got DSP_GET_INFO\n"); // copy dsp info block to dsp - info->DrvMsgPend = 1; // allow any outstanding ioctl to finish mdelay(10); tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL); @@ -1185,8 +1135,8 @@ void ft1000_proc_drvmsg(struct net_device *dev) if ((tempword & FT1000_DB_DPRAM_TX) == 0) { // Put message into Slow Queue // Form Pseudo header - pmsg = (PUSHORT) info->DSPInfoBlk; - ppseudo_hdr = (PPSEUDO_HDR) pmsg; + pmsg = (u16 *) info->DSPInfoBlk; + ppseudo_hdr = (struct pseudo_hdr *) pmsg; ppseudo_hdr->length = htons(info->DSPInfoBlklen + 4); ppseudo_hdr->source = 0x10; @@ -1210,15 +1160,13 @@ void ft1000_proc_drvmsg(struct net_device *dev) info->DSPInfoBlk[8] = 0x7200; info->DSPInfoBlk[9] = 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); } - info->DrvMsgPend = 0; break; case GET_DRV_ERR_RPT_MSG: DEBUG(1, "FT1000:drivermsg:Got GET_DRV_ERR_RPT_MSG\n"); // copy driver error message to dsp - info->DrvMsgPend = 1; // allow any outstanding ioctl to finish mdelay(10); tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL); @@ -1234,8 +1182,8 @@ void ft1000_proc_drvmsg(struct net_device *dev) if ((tempword & FT1000_DB_DPRAM_TX) == 0) { // Put message into Slow Queue // Form Pseudo header - pmsg = (PUSHORT) & tempbuffer[0]; - ppseudo_hdr = (PPSEUDO_HDR) pmsg; + pmsg = (u16 *) & tempbuffer[0]; + ppseudo_hdr = (struct pseudo_hdr *) pmsg; ppseudo_hdr->length = htons(0x0012); ppseudo_hdr->source = 0x10; ppseudo_hdr->destination = 0x20; @@ -1255,7 +1203,7 @@ void ft1000_proc_drvmsg(struct net_device *dev) for (i=1; i<7; i++) { ppseudo_hdr->checksum ^= *pmsg++; } - pmsg = (PUSHORT) & tempbuffer[16]; + pmsg = (u16 *) & tempbuffer[16]; *pmsg++ = htons(RSP_DRV_ERR_RPT_MSG); *pmsg++ = htons(0x000e); *pmsg++ = htons(info->DSP_TIME[0]); @@ -1270,10 +1218,9 @@ void ft1000_proc_drvmsg(struct net_device *dev) *pmsg++ = convert.wrd; *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->DrvMsgPend = 0; break; default: @@ -1294,9 +1241,9 @@ void ft1000_proc_drvmsg(struct net_device *dev) // SUCCESS // //--------------------------------------------------------------------------- -int ft1000_parse_dpram_msg(struct net_device *dev) +static int ft1000_parse_dpram_msg(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); u16 doorbell; u16 portid; u16 nxtph; @@ -1340,13 +1287,11 @@ int ft1000_parse_dpram_msg(struct net_device *dev) ft1000_write_reg(dev, FT1000_REG_SUP_CTRL, HOST_INTF_BE); } - info->DspAsicReset = 0; } if (doorbell & FT1000_DSP_ASIC_RESET) { DEBUG(0, "FT1000:ft1000_parse_dpram_msg: Got a dsp ASIC reset message\n"); - info->DspAsicReset = 1; ft1000_write_reg(dev, FT1000_REG_DOORBELL, FT1000_DSP_ASIC_RESET); udelay(200); @@ -1368,7 +1313,7 @@ int ft1000_parse_dpram_msg(struct net_device *dev) } DEBUG(1, "FT1000:ft1000_parse_dpram_msg:total length = %d\n", total_len); - if ((total_len < MAX_CMD_SQSIZE) && (total_len > PSEUDOSZ)) { + if ((total_len < MAX_CMD_SQSIZE) && (total_len > sizeof(struct pseudo_hdr))) { total_len += nxtph; cnt = 0; // ft1000_read_reg will return a value that needs to be byteswap @@ -1453,7 +1398,7 @@ int ft1000_parse_dpram_msg(struct net_device *dev) //--------------------------------------------------------------------------- static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); u16 i; u32 templong; u16 tempword; @@ -1597,10 +1542,10 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) // SUCCESS // //--------------------------------------------------------------------------- -int ft1000_copy_up_pkt(struct net_device *dev) +static int ft1000_copy_up_pkt(struct net_device *dev) { u16 tempword; - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); u16 len; struct sk_buff *skb; u16 i; @@ -1715,7 +1660,7 @@ int ft1000_copy_up_pkt(struct net_device *dev) tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO); *pbuffer++ = (u8) (tempword >> 8); *pbuffer++ = (u8) tempword; - if (ft1000_chkcard(dev) == FALSE) { + if (ft1000_chkcard(dev) == false) { kfree_skb(skb); return FAILURE; } @@ -1785,13 +1730,13 @@ int ft1000_copy_up_pkt(struct net_device *dev) // SUCCESS // //--------------------------------------------------------------------------- -int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len) +static int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); union { - PSEUDO_HDR blk; - u16 buff[sizeof(PSEUDO_HDR) >> 1]; - u8 buffc[sizeof(PSEUDO_HDR)]; + struct pseudo_hdr blk; + u16 buff[sizeof(struct pseudo_hdr) >> 1]; + u8 buffc[sizeof(struct pseudo_hdr)]; } pseudo; int i; u32 *plong; @@ -1947,7 +1892,7 @@ int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len) static struct net_device_stats *ft1000_stats(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); return (&info->stats); } @@ -1971,7 +1916,7 @@ static int ft1000_open(struct net_device *dev) static int ft1000_close(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); DEBUG(0, "ft1000_hw: ft1000_close()\n"); @@ -1993,7 +1938,7 @@ static int ft1000_close(struct net_device *dev) static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); u8 *pdata; DEBUG(1, "ft1000_hw: ft1000_start_xmit()\n"); @@ -2030,7 +1975,7 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev) static irqreturn_t ft1000_interrupt(int irq, void *dev_id) { struct net_device *dev = (struct net_device *)dev_id; - FT1000_INFO *info = netdev_priv(dev); + struct ft1000_info *info = netdev_priv(dev); u16 tempword; u16 inttype; int cnt; @@ -2042,7 +1987,7 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } - if (ft1000_chkcard(dev) == FALSE) { + if (ft1000_chkcard(dev) == false) { ft1000_disable_interrupts(dev); return IRQ_HANDLED; } @@ -2095,8 +2040,8 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id) void stop_ft1000_card(struct net_device *dev) { - FT1000_INFO *info = netdev_priv(dev); - PPROV_RECORD ptr; + struct ft1000_info *info = netdev_priv(dev); + struct prov_record *ptr; // int cnt; DEBUG(0, "ft1000_hw: stop_ft1000_card()\n"); @@ -2108,7 +2053,7 @@ void stop_ft1000_card(struct net_device *dev) // Make sure we free any memory reserve for provisioning while (list_empty(&info->prov_list) == 0) { - ptr = list_entry(info->prov_list.next, PROV_RECORD, list); + ptr = list_entry(info->prov_list.next, struct prov_record, list); list_del(&ptr->list); kfree(ptr->pprov_data); kfree(ptr); @@ -2130,7 +2075,7 @@ void stop_ft1000_card(struct net_device *dev) static void ft1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { - FT1000_INFO *ft_info; + struct ft1000_info *ft_info; ft_info = netdev_priv(dev); snprintf(info->driver, 32, "ft1000"); @@ -2142,7 +2087,7 @@ static void ft1000_get_drvinfo(struct net_device *dev, static u32 ft1000_get_link(struct net_device *dev) { - FT1000_INFO *info; + struct ft1000_info *info; info = netdev_priv(dev); return info->mediastate; } @@ -2153,9 +2098,9 @@ static const struct ethtool_ops ops = { }; struct net_device *init_ft1000_card(struct pcmcia_device *link, - void *ft1000_reset) + void *ft1000_reset) { - FT1000_INFO *info; + struct ft1000_info *info; struct net_device *dev; static const struct net_device_ops ft1000ops = // Slavius 21.10.2009 due to kernel changes @@ -2180,7 +2125,7 @@ struct net_device *init_ft1000_card(struct pcmcia_device *link, return NULL; } - dev = alloc_etherdev(sizeof(FT1000_INFO)); + dev = alloc_etherdev(sizeof(struct ft1000_info)); if (!dev) { printk(KERN_ERR "ft1000: failed to allocate etherdev\n"); return NULL; @@ -2189,7 +2134,7 @@ struct net_device *init_ft1000_card(struct pcmcia_device *link, SET_NETDEV_DEV(dev, &link->dev); info = netdev_priv(dev); - memset(info, 0, sizeof(FT1000_INFO)); + memset(info, 0, sizeof(struct ft1000_info)); DEBUG(1, "address of dev = 0x%8x\n", (u32) dev); DEBUG(1, "address of dev info = 0x%8x\n", (u32) info); @@ -2199,16 +2144,11 @@ struct net_device *init_ft1000_card(struct pcmcia_device *link, spin_lock_init(&info->dpram_lock); info->DrvErrNum = 0; - info->ASICResetNum = 0; info->registered = 1; info->link = link; info->ft1000_reset = ft1000_reset; info->mediastate = 0; info->fifo_cnt = 0; - info->DeviceCreated = FALSE; - info->DeviceMajor = 0; - info->CurrentInterruptEnableMask = ISR_DEFAULT_MASK; - info->InterruptsEnabled = FALSE; info->CardReady = 0; info->DSP_TIME[0] = 0; info->DSP_TIME[1] = 0; |