aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Belisko <marek.belisko@gmail.com>2010-10-15 04:51:22 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-15 15:26:37 -0400
commit7dc591159928a0281f946d2b44510ced08f2a13c (patch)
tree1223c1aebb04e3b58e455ace742ca01254f054f7
parent81a2fff67a75d2ade3c0b627c08e07587ac46b76 (diff)
staging: ft1000: Remove unused function ft1000_hbchk()
Signed-off-by: Marek Belisko <marek.belisko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/ft1000/ft1000-usb/ft1000_hw.c148
1 files changed, 1 insertions, 147 deletions
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 @@
37 37
38static int ft1000_reset(struct net_device *ft1000dev); 38static int ft1000_reset(struct net_device *ft1000dev);
39static int ft1000_submit_rx_urb(PFT1000_INFO info); 39static int ft1000_submit_rx_urb(PFT1000_INFO info);
40static void ft1000_hbchk(u_long data);
41static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev); 40static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev);
42static int ft1000_open (struct net_device *dev); 41static int ft1000_open (struct net_device *dev);
43static struct net_device_stats *ft1000_netdev_stats(struct net_device *dev); 42static struct net_device_stats *ft1000_netdev_stats(struct net_device *dev);
44static struct timer_list poll_timer[MAX_NUM_CARDS];
45static int ft1000_chkcard (struct ft1000_device *dev); 43static int ft1000_chkcard (struct ft1000_device *dev);
46/* 44/*
47static const struct net_device_ops ft1000net_ops = { 45static const struct net_device_ops ft1000net_ops = {
@@ -801,9 +799,6 @@ static int ft1000_reset_card (struct net_device *dev)
801 info->fProvComplete = 0; 799 info->fProvComplete = 0;
802 //ft1000_disable_interrupts(dev); 800 //ft1000_disable_interrupts(dev);
803 801
804 // Cancel heartbeat task since we are reloading the dsp
805 //del_timer(&poll_timer[info->CardNumber]);
806
807 // Make sure we free any memory reserve for provisioning 802 // Make sure we free any memory reserve for provisioning
808 while (list_empty(&info->prov_list) == 0) { 803 while (list_empty(&info->prov_list) == 0) {
809 DEBUG("ft1000_hw:ft1000_reset_card:deleting provisioning record\n"); 804 DEBUG("ft1000_hw:ft1000_reset_card:deleting provisioning record\n");
@@ -906,10 +901,6 @@ static int ft1000_reset_card (struct net_device *dev)
906 901
907 info->CardReady = 1; 902 info->CardReady = 1;
908 //ft1000_enable_interrupts(dev); 903 //ft1000_enable_interrupts(dev);
909 /* Schedule heartbeat process to run every 2 seconds */
910 //poll_timer[info->CardNumber].expires = jiffies + (2*HZ);
911 //poll_timer[info->CardNumber].data = (u_long)dev;
912 //add_timer(&poll_timer[info->CardNumber]);
913 904
914 info->fCondResetPend = 0; 905 info->fCondResetPend = 0;
915 return TRUE; 906 return TRUE;
@@ -1112,7 +1103,7 @@ u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *int
1112{ 1103{
1113 struct net_device *netdev; 1104 struct net_device *netdev;
1114 FT1000_INFO *pInfo; 1105 FT1000_INFO *pInfo;
1115 int i, rc; 1106 int rc;
1116 1107
1117 netdev = ft1000dev->net; 1108 netdev = ft1000dev->net;
1118 pInfo = netdev_priv(ft1000dev->net); 1109 pInfo = netdev_priv(ft1000dev->net);
@@ -1138,10 +1129,6 @@ u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *int
1138 1129
1139 //INIT_LIST_HEAD(&pInfo->prov_list); 1130 //INIT_LIST_HEAD(&pInfo->prov_list);
1140 1131
1141 for (i=0; i<MAX_NUM_CARDS; i++) {
1142 poll_timer[i].function = ft1000_hbchk;
1143 }
1144
1145 1132
1146 //hard code MAC address for now 1133 //hard code MAC address for now
1147/** 1134/**
@@ -1914,140 +1901,7 @@ static int ft1000_chkcard (struct ft1000_device *dev) {
1914 return TRUE; 1901 return TRUE;
1915} 1902}
1916 1903
1917//---------------------------------------------------------------------------
1918//
1919// Function: ft1000_hbchk
1920// Descripton: This function will perform the heart beat check of the DSP as
1921// well as the ASIC.
1922// Input:
1923// dev - device structure
1924// Output:
1925// none
1926//
1927//---------------------------------------------------------------------------
1928static void ft1000_hbchk(u_long data)
1929{
1930 struct ft1000_device *dev = (struct ft1000_device *)data;
1931
1932 FT1000_INFO *info;
1933 USHORT tempword;
1934 u16 status;
1935 info = (FT1000_INFO *) netdev_priv (dev->net);
1936
1937 DEBUG("ft1000_hbchk called for CardNumber = %d CardReady = %d\n", info->CardNumber, info->CardReady);
1938
1939 if (info->fCondResetPend == 1) {
1940 // Reset ASIC and DSP
1941 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, (PUCHAR)&(info->DSP_TIME[0]), FT1000_MAG_DSP_TIMER0_INDX);
1942 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, (PUCHAR)&(info->DSP_TIME[1]), FT1000_MAG_DSP_TIMER1_INDX);
1943 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, (PUCHAR)&(info->DSP_TIME[2]), FT1000_MAG_DSP_TIMER2_INDX);
1944 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, (PUCHAR)&(info->DSP_TIME[3]), FT1000_MAG_DSP_TIMER3_INDX);
1945
1946 info->DrvErrNum = DSP_CONDRESET_INFO;
1947 DEBUG("ft1000_hw:DSP conditional reset requested\n");
1948 ft1000_reset_card(dev->net);
1949 info->fCondResetPend = 0;
1950 /* Schedule this module to run every 2 seconds */
1951
1952 poll_timer[info->CardNumber].expires = jiffies + (2*HZ);
1953 poll_timer[info->CardNumber].data = (u_long)dev;
1954 add_timer(&poll_timer[info->CardNumber]);
1955
1956
1957 1904
1958 return;
1959 }
1960
1961 if (info->CardReady == 1) {
1962 // Perform dsp heartbeat check
1963 status = ntohs(ft1000_read_dpram16(dev, FT1000_MAG_HI_HO, (PUCHAR)&tempword, FT1000_MAG_HI_HO_INDX));
1964 DEBUG("ft1000_hw:ft1000_hbchk:hi_ho value = 0x%x\n", tempword);
1965 // Let's perform another check if ho is not detected
1966 if (tempword != ho) {
1967 status = ntohs(ft1000_read_dpram16(dev, FT1000_MAG_HI_HO, (PUCHAR)&tempword,FT1000_MAG_HI_HO_INDX));
1968 }
1969 if (tempword != ho) {
1970 printk(KERN_INFO "ft1000: heartbeat failed - no ho detected\n");
1971 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, (PUCHAR)&(info->DSP_TIME[0]), FT1000_MAG_DSP_TIMER0_INDX);
1972 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, (PUCHAR)&(info->DSP_TIME[1]), FT1000_MAG_DSP_TIMER1_INDX);
1973 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, (PUCHAR)&(info->DSP_TIME[2]), FT1000_MAG_DSP_TIMER2_INDX);
1974 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, (PUCHAR)&(info->DSP_TIME[3]), FT1000_MAG_DSP_TIMER3_INDX);
1975 info->DrvErrNum = DSP_HB_INFO;
1976 if (ft1000_reset_card(dev->net) == 0) {
1977 printk(KERN_INFO "ft1000: Hardware Failure Detected - PC Card disabled\n");
1978 info->ProgConStat = 0xff;
1979 return;
1980 }
1981 /* Schedule this module to run every 2 seconds */
1982 poll_timer[info->CardNumber].expires = jiffies + (2*HZ);
1983 poll_timer[info->CardNumber].data = (u_long)dev;
1984 add_timer(&poll_timer[info->CardNumber]);
1985 return;
1986 }
1987
1988 status = ft1000_read_register(dev, &tempword, FT1000_REG_DOORBELL);
1989 // Let's check doorbell again if fail
1990 if (tempword & FT1000_DB_HB) {
1991 status = ft1000_read_register(dev, &tempword, FT1000_REG_DOORBELL);
1992 }
1993 if (tempword & FT1000_DB_HB) {
1994 printk(KERN_INFO "ft1000: heartbeat doorbell not clear by firmware\n");
1995 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, (PUCHAR)&(info->DSP_TIME[0]), FT1000_MAG_DSP_TIMER0_INDX);
1996 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, (PUCHAR)&(info->DSP_TIME[1]), FT1000_MAG_DSP_TIMER1_INDX);
1997 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, (PUCHAR)&(info->DSP_TIME[2]), FT1000_MAG_DSP_TIMER2_INDX);
1998 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, (PUCHAR)&(info->DSP_TIME[3]), FT1000_MAG_DSP_TIMER3_INDX);
1999 info->DrvErrNum = DSP_HB_INFO;
2000 if (ft1000_reset_card(dev->net) == 0) {
2001 printk(KERN_INFO "ft1000: Hardware Failure Detected - PC Card disabled\n");
2002 info->ProgConStat = 0xff;
2003 return;
2004 }
2005 /* Schedule this module to run every 2 seconds */
2006 poll_timer[info->CardNumber].expires = jiffies + (2*HZ);
2007 poll_timer[info->CardNumber].data = (u_long)dev;
2008 add_timer(&poll_timer[info->CardNumber]);
2009 return;
2010 }
2011
2012 // Set dedicated area to hi and ring appropriate doorbell according
2013 // to hi/ho heartbeat protocol
2014 ft1000_write_dpram16(dev, FT1000_MAG_HI_HO, hi_mag, FT1000_MAG_HI_HO_INDX);
2015
2016 status = ntohs(ft1000_read_dpram16(dev, FT1000_MAG_HI_HO, (PUCHAR)&tempword, FT1000_MAG_HI_HO_INDX));
2017 // Let's write hi again if fail
2018 if (tempword != hi) {
2019 ft1000_write_dpram16(dev, FT1000_MAG_HI_HO, hi_mag, FT1000_MAG_HI_HO_INDX);
2020 status = ntohs(ft1000_read_dpram16(dev, FT1000_MAG_HI_HO, (PUCHAR)&tempword, FT1000_MAG_HI_HO_INDX));
2021
2022 }
2023 if (tempword != hi) {
2024 printk(KERN_INFO "ft1000: heartbeat failed - cannot write hi into DPRAM\n");
2025 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER0, (PUCHAR)&(info->DSP_TIME[0]), FT1000_MAG_DSP_TIMER0_INDX);
2026 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER1, (PUCHAR)&(info->DSP_TIME[1]), FT1000_MAG_DSP_TIMER1_INDX);
2027 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER2, (PUCHAR)&(info->DSP_TIME[2]), FT1000_MAG_DSP_TIMER2_INDX);
2028 status = ft1000_read_dpram16(dev, FT1000_MAG_DSP_TIMER3, (PUCHAR)&(info->DSP_TIME[3]), FT1000_MAG_DSP_TIMER3_INDX);
2029
2030 info->DrvErrNum = DSP_HB_INFO;
2031 if (ft1000_reset_card(dev->net) == 0) {
2032 printk(KERN_INFO "ft1000: Hardware Failure Detected - PC Card disabled\n");
2033 info->ProgConStat = 0xff;
2034 return;
2035 }
2036 /* Schedule this module to run every 2 seconds */
2037 poll_timer[info->CardNumber].expires = jiffies + (2*HZ);
2038 poll_timer[info->CardNumber].data = (u_long)dev;
2039 add_timer(&poll_timer[info->CardNumber]);
2040 return;
2041 }
2042 ft1000_write_register(dev, FT1000_DB_HB, FT1000_REG_DOORBELL);
2043
2044 }
2045
2046 /* Schedule this module to run every 2 seconds */
2047 poll_timer[info->CardNumber].expires = jiffies + (2*HZ);
2048 poll_timer[info->CardNumber].data = (u_long)dev;
2049 add_timer(&poll_timer[info->CardNumber]);
2050}
2051 1905
2052//--------------------------------------------------------------------------- 1906//---------------------------------------------------------------------------
2053// 1907//