From: Marek Belisko Date: Fri, 15 Oct 2010 08:51:22 +0000 (+0200) Subject: staging: ft1000: Remove unused function ft1000_hbchk() X-Git-Tag: firefly_0821_release~7613^2~3583^2~3^2~89 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7dc591159928a0281f946d2b44510ced08f2a13c;p=firefly-linux-kernel-4.4.55.git staging: ft1000: Remove unused function ft1000_hbchk() Signed-off-by: Marek Belisko Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c index 3cbf6a87aaf1..2b9131af83f6 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c @@ -37,11 +37,9 @@ static int ft1000_reset(struct net_device *ft1000dev); static int ft1000_submit_rx_urb(PFT1000_INFO info); -static void ft1000_hbchk(u_long data); static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev); static int ft1000_open (struct net_device *dev); static struct net_device_stats *ft1000_netdev_stats(struct net_device *dev); -static struct timer_list poll_timer[MAX_NUM_CARDS]; static int ft1000_chkcard (struct ft1000_device *dev); /* static const struct net_device_ops ft1000net_ops = { @@ -801,9 +799,6 @@ static int ft1000_reset_card (struct net_device *dev) info->fProvComplete = 0; //ft1000_disable_interrupts(dev); - // Cancel heartbeat task since we are reloading the dsp - //del_timer(&poll_timer[info->CardNumber]); - // Make sure we free any memory reserve for provisioning while (list_empty(&info->prov_list) == 0) { DEBUG("ft1000_hw:ft1000_reset_card:deleting provisioning record\n"); @@ -906,10 +901,6 @@ static int ft1000_reset_card (struct net_device *dev) info->CardReady = 1; //ft1000_enable_interrupts(dev); - /* Schedule heartbeat process to run every 2 seconds */ - //poll_timer[info->CardNumber].expires = jiffies + (2*HZ); - //poll_timer[info->CardNumber].data = (u_long)dev; - //add_timer(&poll_timer[info->CardNumber]); info->fCondResetPend = 0; return TRUE; @@ -1112,7 +1103,7 @@ u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *int { struct net_device *netdev; FT1000_INFO *pInfo; - int i, rc; + int rc; netdev = ft1000dev->net; pInfo = netdev_priv(ft1000dev->net); @@ -1138,10 +1129,6 @@ u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *int //INIT_LIST_HEAD(&pInfo->prov_list); - for (i=0; inet); - - DEBUG("ft1000_hbchk called for CardNumber = %d CardReady = %d\n", info->CardNumber, info->CardReady); - - if (info->fCondResetPend == 1) { - // Reset ASIC and DSP - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, (PUCHAR)&(info->DSP_TIME[0]), FT1000_MAG_DSP_TIMER0_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, (PUCHAR)&(info->DSP_TIME[1]), FT1000_MAG_DSP_TIMER1_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, (PUCHAR)&(info->DSP_TIME[2]), FT1000_MAG_DSP_TIMER2_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, (PUCHAR)&(info->DSP_TIME[3]), FT1000_MAG_DSP_TIMER3_INDX); - - info->DrvErrNum = DSP_CONDRESET_INFO; - DEBUG("ft1000_hw:DSP conditional reset requested\n"); - ft1000_reset_card(dev->net); - info->fCondResetPend = 0; - /* Schedule this module to run every 2 seconds */ - - poll_timer[info->CardNumber].expires = jiffies + (2*HZ); - poll_timer[info->CardNumber].data = (u_long)dev; - add_timer(&poll_timer[info->CardNumber]); - - - return; - } - - if (info->CardReady == 1) { - // Perform dsp heartbeat check - status = ntohs(ft1000_read_dpram16(dev, FT1000_MAG_HI_HO, (PUCHAR)&tempword, FT1000_MAG_HI_HO_INDX)); - DEBUG("ft1000_hw:ft1000_hbchk:hi_ho value = 0x%x\n", tempword); - // Let's perform another check if ho is not detected - if (tempword != ho) { - status = ntohs(ft1000_read_dpram16(dev, FT1000_MAG_HI_HO, (PUCHAR)&tempword,FT1000_MAG_HI_HO_INDX)); - } - if (tempword != ho) { - printk(KERN_INFO "ft1000: heartbeat failed - no ho detected\n"); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, (PUCHAR)&(info->DSP_TIME[0]), FT1000_MAG_DSP_TIMER0_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, (PUCHAR)&(info->DSP_TIME[1]), FT1000_MAG_DSP_TIMER1_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, (PUCHAR)&(info->DSP_TIME[2]), FT1000_MAG_DSP_TIMER2_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, (PUCHAR)&(info->DSP_TIME[3]), FT1000_MAG_DSP_TIMER3_INDX); - info->DrvErrNum = DSP_HB_INFO; - if (ft1000_reset_card(dev->net) == 0) { - printk(KERN_INFO "ft1000: Hardware Failure Detected - PC Card disabled\n"); - info->ProgConStat = 0xff; - return; - } - /* Schedule this module to run every 2 seconds */ - poll_timer[info->CardNumber].expires = jiffies + (2*HZ); - poll_timer[info->CardNumber].data = (u_long)dev; - add_timer(&poll_timer[info->CardNumber]); - return; - } - - status = ft1000_read_register(dev, &tempword, FT1000_REG_DOORBELL); - // Let's check doorbell again if fail - if (tempword & FT1000_DB_HB) { - status = ft1000_read_register(dev, &tempword, FT1000_REG_DOORBELL); - } - if (tempword & FT1000_DB_HB) { - printk(KERN_INFO "ft1000: heartbeat doorbell not clear by firmware\n"); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, (PUCHAR)&(info->DSP_TIME[0]), FT1000_MAG_DSP_TIMER0_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, (PUCHAR)&(info->DSP_TIME[1]), FT1000_MAG_DSP_TIMER1_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, (PUCHAR)&(info->DSP_TIME[2]), FT1000_MAG_DSP_TIMER2_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, (PUCHAR)&(info->DSP_TIME[3]), FT1000_MAG_DSP_TIMER3_INDX); - info->DrvErrNum = DSP_HB_INFO; - if (ft1000_reset_card(dev->net) == 0) { - printk(KERN_INFO "ft1000: Hardware Failure Detected - PC Card disabled\n"); - info->ProgConStat = 0xff; - return; - } - /* Schedule this module to run every 2 seconds */ - poll_timer[info->CardNumber].expires = jiffies + (2*HZ); - poll_timer[info->CardNumber].data = (u_long)dev; - add_timer(&poll_timer[info->CardNumber]); - return; - } - - // Set dedicated area to hi and ring appropriate doorbell according - // to hi/ho heartbeat protocol - ft1000_write_dpram16(dev, FT1000_MAG_HI_HO, hi_mag, FT1000_MAG_HI_HO_INDX); - - status = ntohs(ft1000_read_dpram16(dev, FT1000_MAG_HI_HO, (PUCHAR)&tempword, FT1000_MAG_HI_HO_INDX)); - // Let's write hi again if fail - if (tempword != hi) { - ft1000_write_dpram16(dev, FT1000_MAG_HI_HO, hi_mag, FT1000_MAG_HI_HO_INDX); - status = ntohs(ft1000_read_dpram16(dev, FT1000_MAG_HI_HO, (PUCHAR)&tempword, FT1000_MAG_HI_HO_INDX)); - - } - if (tempword != hi) { - printk(KERN_INFO "ft1000: heartbeat failed - cannot write hi into DPRAM\n"); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, (PUCHAR)&(info->DSP_TIME[0]), FT1000_MAG_DSP_TIMER0_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, (PUCHAR)&(info->DSP_TIME[1]), FT1000_MAG_DSP_TIMER1_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, (PUCHAR)&(info->DSP_TIME[2]), FT1000_MAG_DSP_TIMER2_INDX); - status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, (PUCHAR)&(info->DSP_TIME[3]), FT1000_MAG_DSP_TIMER3_INDX); - - info->DrvErrNum = DSP_HB_INFO; - if (ft1000_reset_card(dev->net) == 0) { - printk(KERN_INFO "ft1000: Hardware Failure Detected - PC Card disabled\n"); - info->ProgConStat = 0xff; - return; - } - /* Schedule this module to run every 2 seconds */ - poll_timer[info->CardNumber].expires = jiffies + (2*HZ); - poll_timer[info->CardNumber].data = (u_long)dev; - add_timer(&poll_timer[info->CardNumber]); - return; - } - ft1000_write_register(dev, FT1000_DB_HB, FT1000_REG_DOORBELL); - - } - - /* Schedule this module to run every 2 seconds */ - poll_timer[info->CardNumber].expires = jiffies + (2*HZ); - poll_timer[info->CardNumber].data = (u_long)dev; - add_timer(&poll_timer[info->CardNumber]); -} //--------------------------------------------------------------------------- //