Staging: cxt1e1: remove all code dependent on LINUX_VERSION_CODE
Remove all code which is dead for in-kernel driver due to being ifdefed by LINUX_VERSION_CODE. While at it, also remove surrounding code which is commented out, or '#if 1' nops. Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
41a38d9e63
commit
5749df14ae
@ -122,19 +122,7 @@ watchdog_func (unsigned long arg)
|
||||
pr_warning("%s: drvr not available (%x)\n", __func__, drvr_state);
|
||||
return;
|
||||
}
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
/* Initialize the tq entry only the first time */
|
||||
if (wd->init_tq)
|
||||
{
|
||||
wd->init_tq = 0;
|
||||
wd->tq.routine = wd->func;
|
||||
wd->tq.sync = 0;
|
||||
wd->tq.data = wd->softc;
|
||||
}
|
||||
schedule_task (&wd->tq);
|
||||
#else
|
||||
schedule_work (&wd->work);
|
||||
#endif
|
||||
mod_timer (&wd->h, jiffies + wd->ticks);
|
||||
}
|
||||
|
||||
|
@ -305,15 +305,9 @@ c4hw_attach_all (void)
|
||||
error_flag = 0;
|
||||
prep_hdw_info ();
|
||||
/*** scan PCI bus for all possible boards */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||
while ((pdev = pci_get_device (PCI_VENDOR_ID_CONEXANT,
|
||||
PCI_DEVICE_ID_CN8474,
|
||||
pdev)))
|
||||
#else
|
||||
while ((pdev = pci_find_device (PCI_VENDOR_ID_CONEXANT,
|
||||
PCI_DEVICE_ID_CN8474,
|
||||
pdev)))
|
||||
#endif
|
||||
{
|
||||
if (c4_hdw_init (pdev, found))
|
||||
found++;
|
||||
|
@ -142,10 +142,6 @@ getuserbychan (int channum)
|
||||
}
|
||||
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
#define DEV_TO_PRIV(dev) ( * (struct c4_priv **) ((hdlc_device*)(dev)+1))
|
||||
#else
|
||||
|
||||
char *
|
||||
get_hdlc_name (hdlc_device * hdlc)
|
||||
{
|
||||
@ -154,7 +150,6 @@ get_hdlc_name (hdlc_device * hdlc)
|
||||
|
||||
return dev->name;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static status_t
|
||||
@ -167,7 +162,6 @@ mkret (int bsd)
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
/***
|
||||
@ -259,7 +253,6 @@ c4_wq_port_cleanup (mpi_t * pi)
|
||||
pi->wq_port = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
@ -291,48 +284,6 @@ void_open (struct net_device * ndev)
|
||||
}
|
||||
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
#if !defined(GENERIC_HDLC_VERSION) || (GENERIC_HDLC_VERSION < 4)
|
||||
|
||||
/** Linux 2.4.18-19 **/
|
||||
STATIC int
|
||||
chan_open (hdlc_device * hdlc)
|
||||
{
|
||||
status_t ret;
|
||||
|
||||
if ((ret = c4_chan_up (DEV_TO_PRIV (hdlc)->ci, DEV_TO_PRIV (hdlc)->channum)))
|
||||
return -ret;
|
||||
MOD_INC_USE_COUNT;
|
||||
netif_start_queue (hdlc_to_dev (hdlc));
|
||||
return 0; /* no error = success */
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/** Linux 2.4.20 and higher **/
|
||||
STATIC int
|
||||
chan_open (struct net_device * ndev)
|
||||
{
|
||||
hdlc_device *hdlc = dev_to_hdlc (ndev);
|
||||
status_t ret;
|
||||
|
||||
hdlc->proto = IF_PROTO_HDLC;
|
||||
if ((ret = hdlc_open (hdlc)))
|
||||
{
|
||||
pr_info("hdlc_open failure, err %d.\n", ret);
|
||||
return ret;
|
||||
}
|
||||
if ((ret = c4_chan_up (DEV_TO_PRIV (hdlc)->ci, DEV_TO_PRIV (hdlc)->channum)))
|
||||
return -ret;
|
||||
MOD_INC_USE_COUNT;
|
||||
netif_start_queue (hdlc_to_dev (hdlc));
|
||||
return 0; /* no error = success */
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
/** Linux 2.6 **/
|
||||
STATIC int
|
||||
chan_open (struct net_device * ndev)
|
||||
{
|
||||
@ -351,39 +302,8 @@ chan_open (struct net_device * ndev)
|
||||
netif_start_queue (ndev);
|
||||
return 0; /* no error = success */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
#if !defined(GENERIC_HDLC_VERSION) || (GENERIC_HDLC_VERSION < 4)
|
||||
|
||||
/** Linux 2.4.18-19 **/
|
||||
STATIC void
|
||||
chan_close (hdlc_device * hdlc)
|
||||
{
|
||||
netif_stop_queue (hdlc_to_dev (hdlc));
|
||||
musycc_chan_down ((ci_t *) 0, DEV_TO_PRIV (hdlc)->channum);
|
||||
MOD_DEC_USE_COUNT;
|
||||
}
|
||||
#else
|
||||
|
||||
/** Linux 2.4.20 and higher **/
|
||||
STATIC int
|
||||
chan_close (struct net_device * ndev)
|
||||
{
|
||||
hdlc_device *hdlc = dev_to_hdlc (ndev);
|
||||
|
||||
netif_stop_queue (hdlc_to_dev (hdlc));
|
||||
musycc_chan_down ((ci_t *) 0, DEV_TO_PRIV (hdlc)->channum);
|
||||
hdlc_close (hdlc);
|
||||
MOD_DEC_USE_COUNT;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
/** Linux 2.6 **/
|
||||
STATIC int
|
||||
chan_close (struct net_device * ndev)
|
||||
{
|
||||
@ -396,7 +316,6 @@ chan_close (struct net_device * ndev)
|
||||
module_put (THIS_MODULE);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(GENERIC_HDLC_VERSION) || (GENERIC_HDLC_VERSION < 4)
|
||||
@ -435,11 +354,7 @@ chan_dev_ioctl (struct net_device * dev, struct ifreq * ifr, int cmd)
|
||||
|
||||
|
||||
STATIC int
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
chan_attach_noop (hdlc_device * hdlc, unsigned short foo_1, unsigned short foo_2)
|
||||
#else
|
||||
chan_attach_noop (struct net_device * ndev, unsigned short foo_1, unsigned short foo_2)
|
||||
#endif
|
||||
{
|
||||
return 0; /* our driver has nothing to do here, show's
|
||||
* over, go home */
|
||||
@ -455,16 +370,12 @@ chan_get_stats (struct net_device * ndev)
|
||||
struct sbecom_chan_stats *stats;
|
||||
int channum;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
channum = DEV_TO_PRIV (ndev)->channum;
|
||||
#else
|
||||
{
|
||||
struct c4_priv *priv;
|
||||
|
||||
priv = (struct c4_priv *) dev_to_hdlc (ndev)->priv;
|
||||
channum = priv->channum;
|
||||
}
|
||||
#endif
|
||||
|
||||
ch = c4_find_chan (channum);
|
||||
if (ch == NULL)
|
||||
@ -527,13 +438,9 @@ c4_linux_xmit (struct sk_buff * skb, struct net_device * ndev)
|
||||
const struct c4_priv *priv;
|
||||
int rval;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
priv = DEV_TO_PRIV (ndev);
|
||||
#else
|
||||
hdlc_device *hdlc = dev_to_hdlc (ndev);
|
||||
|
||||
priv = hdlc->priv;
|
||||
#endif
|
||||
|
||||
rval = musycc_start_xmit (priv->ci, priv->channum, skb);
|
||||
return -rval;
|
||||
@ -823,18 +730,10 @@ do_create_chan (struct net_device * ndev, void *data)
|
||||
ret = mkret (c4_new_chan (ci, cp.port, cp.channum, dev));
|
||||
if (ret)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
rtnl_unlock (); /* needed due to Ioctl calling sequence */
|
||||
V7 (unregister_hdlc_device) (dev_to_hdlc (dev));
|
||||
rtnl_lock (); /* needed due to Ioctl calling sequence */
|
||||
OS_kfree (DEV_TO_PRIV (dev));
|
||||
OS_kfree (dev);
|
||||
#else
|
||||
rtnl_unlock (); /* needed due to Ioctl calling sequence */
|
||||
unregister_hdlc_device (dev);
|
||||
rtnl_lock (); /* needed due to Ioctl calling sequence */
|
||||
free_netdev (dev);
|
||||
#endif
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -883,11 +782,7 @@ do_deluser (struct net_device * ndev, int lockit)
|
||||
const struct c4_priv *priv;
|
||||
int channum;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
priv = DEV_TO_PRIV (ndev);
|
||||
#else
|
||||
priv = (struct c4_priv *) dev_to_hdlc (ndev)->priv;
|
||||
#endif
|
||||
ci = priv->ci;
|
||||
channum = priv->channum;
|
||||
|
||||
@ -897,22 +792,12 @@ do_deluser (struct net_device * ndev, int lockit)
|
||||
ch->user = 0; /* will be freed, below */
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
if (lockit)
|
||||
rtnl_unlock (); /* needed if Ioctl calling sequence */
|
||||
V7 (unregister_hdlc_device) (dev_to_hdlc (ndev));
|
||||
if (lockit)
|
||||
rtnl_lock (); /* needed if Ioctl calling sequence */
|
||||
OS_kfree (DEV_TO_PRIV (ndev));
|
||||
OS_kfree (ndev);
|
||||
#else
|
||||
if (lockit)
|
||||
rtnl_unlock (); /* needed if Ioctl calling sequence */
|
||||
unregister_hdlc_device (ndev);
|
||||
if (lockit)
|
||||
rtnl_lock (); /* needed if Ioctl calling sequence */
|
||||
free_netdev (ndev);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1339,14 +1224,6 @@ c4_mod_remove (void)
|
||||
module_init (c4_mod_init);
|
||||
module_exit (c4_mod_remove);
|
||||
|
||||
#ifndef SBE_INCLUDE_SYMBOLS
|
||||
#ifndef CONFIG_SBE_WANC24_NCOMM
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
EXPORT_NO_SYMBOLS;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
MODULE_AUTHOR ("SBE Technical Services <support@sbei.com>");
|
||||
MODULE_DESCRIPTION ("wanPCI-CxT1E1 Generic HDLC WAN Driver module");
|
||||
#ifdef MODULE_LICENSE
|
||||
|
@ -405,7 +405,6 @@ musycc_update_tx_thp (mch_t * ch)
|
||||
}
|
||||
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
|
||||
/*
|
||||
* This is the workq task executed by the OS when our queue_work() is
|
||||
* scheduled and run. It can fire off either RX or TX ACTIVATION depending
|
||||
@ -515,7 +514,6 @@ musycc_wq_chan_restart (void *arg) /* channel private structure */
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@ -531,7 +529,6 @@ musycc_chan_restart (mch_t * ch)
|
||||
ch->channum, ch->txd_irq_srv, ch->txd_irq_srv->status);
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
|
||||
/* 2.6 - find next unprocessed message, then set TX thp to it */
|
||||
#ifdef RLD_RESTART_DEBUG
|
||||
pr_info(">> musycc_chan_restart: scheduling Chan %x workQ @ %p\n", ch->channum, &ch->ch_work);
|
||||
@ -539,51 +536,9 @@ musycc_chan_restart (mch_t * ch)
|
||||
c4_wk_chan_restart (ch); /* work queue mechanism fires off: Ref:
|
||||
* musycc_wq_chan_restart () */
|
||||
|
||||
#else
|
||||
|
||||
|
||||
/* 2.4 - find next unprocessed message, then set TX thp to it */
|
||||
#ifdef RLD_RESTART_DEBUG
|
||||
pr_info(">> musycc_chan_restart: scheduling Chan %x start_tx %x\n", ch->channum, ch->ch_start_tx);
|
||||
#endif
|
||||
/* restart transmission from background loop */
|
||||
ch->up->up->wd_notify = WD_NOTIFY_1TX;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void
|
||||
musycc_cleanup (ci_t * ci)
|
||||
{
|
||||
mpi_t *pi;
|
||||
int i, j;
|
||||
|
||||
/* free up driver resources */
|
||||
ci->state = C_INIT; /* mark as hardware not available */
|
||||
|
||||
for (i = 0; i < ci->max_ports; i++)
|
||||
{
|
||||
pi = &ci->port[i];
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
|
||||
c4_wq_port_cleanup (pi);
|
||||
#endif
|
||||
for (j = 0; j < MUSYCC_NCHANS; j++)
|
||||
{
|
||||
if (pi->chan[j])
|
||||
OS_kfree (pi->chan[j]); /* free mch_t struct */
|
||||
}
|
||||
OS_kfree (pi->regram_saved);
|
||||
}
|
||||
#if 0
|
||||
/* obsolete - watchdog is now static w/in ci_t */
|
||||
OS_free_watchdog (ci->wd);
|
||||
#endif
|
||||
OS_kfree (ci->iqd_p_saved);
|
||||
OS_kfree (ci);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
rld_put_led (mpi_t * pi, u_int32_t ledval)
|
||||
{
|
||||
@ -2008,37 +1963,13 @@ musycc_start_xmit (ci_t * ci, int channum, void *mem_token)
|
||||
atomic_add (len, &ci->tx_pending);
|
||||
ch->s.tx_packets++;
|
||||
ch->s.tx_bytes += len;
|
||||
#if 0
|
||||
spin_unlock_irqrestore (&ch->ch_txlock, flags); /* allow pending
|
||||
* interrupt to sneak
|
||||
* thru */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If an ONR was seen, then channel requires poking to restart
|
||||
* transmission.
|
||||
*/
|
||||
if (ch->ch_start_tx)
|
||||
{
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,41)
|
||||
SD_SEM_TAKE (&ci->sem_wdbusy, "_wd_"); /* only 1 thru here, per
|
||||
* board */
|
||||
if ((ch->ch_start_tx == CH_START_TX_ONR) && (ch->p.chan_mode == CFG_CH_PROTO_TRANS))
|
||||
{
|
||||
/* ONR restart transmission from background loop */
|
||||
ci->wd_notify = WD_NOTIFY_ONR; /* enabled global watchdog
|
||||
* scan-thru */
|
||||
} else
|
||||
{
|
||||
/* start first transmission from background loop */
|
||||
ci->wd_notify = WD_NOTIFY_1TX; /* enabled global watchdog
|
||||
* scan-thru */
|
||||
}
|
||||
musycc_chan_restart (ch);
|
||||
SD_SEM_GIVE (&ci->sem_wdbusy);
|
||||
#else
|
||||
musycc_chan_restart (ch);
|
||||
#endif
|
||||
}
|
||||
#ifdef SBE_WAN256T3_ENABLE
|
||||
wan256t3_led (ci, LED_TX, LEDV_G);
|
||||
@ -2047,139 +1978,4 @@ musycc_start_xmit (ci_t * ci, int channum, void *mem_token)
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
int
|
||||
musycc_set_chan (ci_t * ci, int channum, struct sbecom_chan_param * p)
|
||||
{
|
||||
mch_t *ch;
|
||||
int rok = 0;
|
||||
int n = 0;
|
||||
|
||||
if (channum < 0 || channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS)) /* sanity chk param */
|
||||
return ECHRNG;
|
||||
if (!(ch = sd_find_chan (ci, channum)))
|
||||
return ENOENT;
|
||||
if (ch->channum != p->channum)
|
||||
return EINVAL;
|
||||
if (sd_line_is_ok (ch->user))
|
||||
{
|
||||
rok = 1;
|
||||
sd_line_is_down (ch->user);
|
||||
}
|
||||
if (ch->state == UP && /* bring down in current configuration */
|
||||
(ch->p.status != p->status ||
|
||||
ch->p.chan_mode != p->chan_mode ||
|
||||
ch->p.intr_mask != p->intr_mask ||
|
||||
ch->txd_free < ch->txd_num))
|
||||
{
|
||||
if ((n = musycc_chan_down (ci, channum)))
|
||||
return n;
|
||||
if (ch->p.mode_56k != p->mode_56k)
|
||||
{
|
||||
ch->p = *p; /* copy in new parameters */
|
||||
musycc_update_timeslots (&ci->port[ch->channum / MUSYCC_NCHANS]);
|
||||
} else
|
||||
ch->p = *p; /* copy in new parameters */
|
||||
if ((n = musycc_chan_up (ci, channum)))
|
||||
return n;
|
||||
sd_enable_xmit (ch->user); /* re-enable to catch flow controlled
|
||||
* channel */
|
||||
} else
|
||||
{
|
||||
if (ch->p.mode_56k != p->mode_56k)
|
||||
{
|
||||
ch->p = *p; /* copy in new parameters */
|
||||
musycc_update_timeslots (&ci->port[ch->channum / MUSYCC_NCHANS]);
|
||||
} else
|
||||
ch->p = *p; /* copy in new parameters */
|
||||
}
|
||||
|
||||
if (rok)
|
||||
sd_line_is_up (ch->user);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
musycc_get_chan (ci_t * ci, int channum, struct sbecom_chan_param * p)
|
||||
{
|
||||
mch_t *ch;
|
||||
|
||||
#if 0
|
||||
if (channum < 0 || channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS)) /* sanity chk param */
|
||||
return ECHRNG;
|
||||
#endif
|
||||
if (!(ch = sd_find_chan (ci, channum)))
|
||||
return ENOENT;
|
||||
*p = ch->p;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
musycc_get_chan_stats (ci_t * ci, int channum, struct sbecom_chan_stats * p)
|
||||
{
|
||||
mch_t *ch;
|
||||
|
||||
if (channum < 0 || channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS)) /* sanity chk param */
|
||||
return ECHRNG;
|
||||
if (!(ch = sd_find_chan (ci, channum)))
|
||||
return ENOENT;
|
||||
*p = ch->s;
|
||||
p->tx_pending = atomic_read (&ch->tx_pending);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef SBE_WAN256T3_ENABLE
|
||||
int
|
||||
musycc_chan_down (ci_t * ci, int channum)
|
||||
{
|
||||
mch_t *ch;
|
||||
mpi_t *pi;
|
||||
int i, gchan;
|
||||
|
||||
if (!(ch = sd_find_chan (ci, channum)))
|
||||
return EINVAL;
|
||||
pi = ch->up;
|
||||
gchan = ch->gchan;
|
||||
|
||||
/* Deactivate the channel */
|
||||
musycc_serv_req (pi, SR_CHANNEL_DEACTIVATE | SR_RX_DIRECTION | gchan);
|
||||
ch->ch_start_rx = 0;
|
||||
musycc_serv_req (pi, SR_CHANNEL_DEACTIVATE | SR_TX_DIRECTION | gchan);
|
||||
ch->ch_start_tx = 0;
|
||||
|
||||
if (ch->state == DOWN)
|
||||
return 0;
|
||||
ch->state = DOWN;
|
||||
|
||||
pi->regram->thp[gchan] = 0;
|
||||
pi->regram->tmp[gchan] = 0;
|
||||
pi->regram->rhp[gchan] = 0;
|
||||
pi->regram->rmp[gchan] = 0;
|
||||
FLUSH_MEM_WRITE ();
|
||||
for (i = 0; i < ch->txd_num; i++)
|
||||
{
|
||||
if (ch->mdt[i].mem_token != 0)
|
||||
OS_mem_token_free (ch->mdt[i].mem_token);
|
||||
}
|
||||
|
||||
for (i = 0; i < ch->rxd_num; i++)
|
||||
{
|
||||
if (ch->mdr[i].mem_token != 0)
|
||||
OS_mem_token_free (ch->mdr[i].mem_token);
|
||||
}
|
||||
|
||||
OS_kfree (ch->mdt);
|
||||
ch->mdt = 0;
|
||||
OS_kfree (ch->mdr);
|
||||
ch->mdr = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*** End-of-File ***/
|
||||
|
@ -500,11 +500,7 @@ pmc_init_seeprom (u_int32_t addr, u_int32_t serialNum)
|
||||
time_t createTime;
|
||||
int i;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
createTime = CURRENT_TIME;
|
||||
#else
|
||||
createTime = get_seconds ();
|
||||
#endif
|
||||
|
||||
/* use template data */
|
||||
for (i = 0; i < sizeof (FLD_TYPE2); ++i)
|
||||
|
@ -117,12 +117,6 @@ extern "C"
|
||||
|
||||
#include "pmcc4_private.h"
|
||||
|
||||
#if !(LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
|
||||
char *get_hdlc_name (hdlc_device *);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* external interface
|
||||
*/
|
||||
|
@ -119,12 +119,10 @@ char OSSIid_pmcc4_drvc[] =
|
||||
#define KERN_WARN KERN_WARNING
|
||||
|
||||
/* forward references */
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
|
||||
status_t c4_wk_chan_init (mpi_t *, mch_t *);
|
||||
void c4_wq_port_cleanup (mpi_t *);
|
||||
status_t c4_wq_port_init (mpi_t *);
|
||||
|
||||
#endif
|
||||
int c4_loop_port (ci_t *, int, u_int8_t);
|
||||
status_t c4_set_port (ci_t *, int);
|
||||
status_t musycc_chan_down (ci_t *, int);
|
||||
@ -533,145 +531,15 @@ checkPorts (ci_t * ci)
|
||||
STATIC void
|
||||
c4_watchdog (ci_t * ci)
|
||||
{
|
||||
#if 0
|
||||
//unsigned long flags;
|
||||
#endif
|
||||
|
||||
if (drvr_state != SBE_DRVR_AVAILABLE)
|
||||
{
|
||||
if (log_level >= LOG_MONITOR)
|
||||
pr_info("drvr not available (%x)\n", drvr_state);
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
SD_SEM_TAKE (&ci->sem_wdbusy, "_wd_"); /* only 1 thru here, per
|
||||
* board */
|
||||
#endif
|
||||
|
||||
ci->wdcount++;
|
||||
checkPorts (ci);
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,41)
|
||||
if (ci->wd_notify)
|
||||
{ /* is there a state change to search for */
|
||||
int port, gchan;
|
||||
|
||||
ci->wd_notify = 0; /* reset notification */
|
||||
for (gchan = 0; gchan < MUSYCC_NCHANS; gchan++)
|
||||
{
|
||||
for (port = 0; port < ci->max_port; port++)
|
||||
{
|
||||
mch_t *ch = ci->port[port].chan[gchan];
|
||||
|
||||
if (!ch || ci->state != C_RUNNING) /* state changed while
|
||||
* acquiring semaphore */
|
||||
break;
|
||||
if (ch->state == UP)/* channel must be set up */
|
||||
{
|
||||
#if 0
|
||||
#ifdef RLD_TRANS_DEBUG
|
||||
if (1 || log_level >= LOG_MONITOR)
|
||||
#else
|
||||
if (log_level >= LOG_MONITOR)
|
||||
#endif
|
||||
pr_info("%s: watchdog reviving Port %d Channel %d [%d] sts %x/%x, start_TX %x free %x start_RX %x\n",
|
||||
ci->devname, ch->channum, port, gchan, ch->channum,
|
||||
ch->p.status, ch->status,
|
||||
ch->ch_start_tx, ch->txd_free, ch->ch_start_rx);
|
||||
#endif
|
||||
|
||||
/**********************************/
|
||||
/** check for RX restart request **/
|
||||
/**********************************/
|
||||
|
||||
if (ch->ch_start_rx &&
|
||||
(ch->status & RX_ENABLED)) /* requires start on
|
||||
* enabled RX */
|
||||
{
|
||||
ch->ch_start_rx = 0; /* we are restarting RX... */
|
||||
#ifdef RLD_TRANS_DEBUG
|
||||
pr_info("++ c4_watchdog() CHAN RX ACTIVATE: chan %d\n",
|
||||
ch->channum);
|
||||
#endif
|
||||
#ifdef RLD_RXACT_DEBUG
|
||||
{
|
||||
struct mdesc *md;
|
||||
static int hereb4 = 7;
|
||||
|
||||
if (hereb4)
|
||||
{
|
||||
hereb4--;
|
||||
md = &ch->mdr[ch->rxix_irq_srv];
|
||||
pr_info("++ c4_watchdog[%d] CHAN RX ACTIVATE: rxix_irq_srv %d, md %p sts %x, rxpkt %lu\n",
|
||||
ch->channum, ch->rxix_irq_srv, md, le32_to_cpu (md->status), ch->s.rx_packets);
|
||||
musycc_dump_rxbuffer_ring (ch, 1); /* RLD DEBUG */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
musycc_serv_req (ch->up, SR_CHANNEL_ACTIVATE | SR_RX_DIRECTION | gchan);
|
||||
}
|
||||
/**********************************/
|
||||
/** check for TX restart request **/
|
||||
/**********************************/
|
||||
|
||||
if (ch->ch_start_tx &&
|
||||
(ch->status & TX_ENABLED)) /* requires start on
|
||||
* enabled TX */
|
||||
{
|
||||
struct mdesc *md;
|
||||
|
||||
/*
|
||||
* find next unprocessed message, then set TX thp to
|
||||
* it
|
||||
*/
|
||||
musycc_update_tx_thp (ch);
|
||||
|
||||
#if 0
|
||||
spin_lock_irqsave (&ch->ch_txlock, flags);
|
||||
#endif
|
||||
md = ch->txd_irq_srv;
|
||||
if (!md)
|
||||
{
|
||||
pr_info("-- c4_watchdog[%d]: WARNING, starting NULL md\n",
|
||||
ch->channum);
|
||||
pr_info("-- chan %d txd_irq_srv %p sts %x usr_add %p sts %x, txpkt %lu\n",
|
||||
ch->channum, ch->txd_irq_srv, le32_to_cpu ((struct mdesc *) (ch->txd_irq_srv)->status),
|
||||
ch->txd_usr_add, le32_to_cpu ((struct mdesc *) (ch->txd_usr_add)->status),
|
||||
ch->s.tx_packets);
|
||||
#if 0
|
||||
spin_unlock_irqrestore (&ch->ch_txlock, flags);
|
||||
#endif
|
||||
} else if (md->data && ((le32_to_cpu (md->status)) & MUSYCC_TX_OWNED))
|
||||
{
|
||||
#ifdef RLD_TRANS_DEBUG
|
||||
pr_info("++ c4_watchdog[%d] CHAN TX ACTIVATE: start_tx %x\n",
|
||||
ch->channum, ch->ch_start_tx);
|
||||
#endif
|
||||
ch->ch_start_tx = 0; /* we are restarting
|
||||
* TX... */
|
||||
#if 0
|
||||
spin_unlock_irqrestore (&ch->ch_txlock, flags); /* allow interrupts for
|
||||
* service request */
|
||||
#endif
|
||||
musycc_serv_req (ch->up, SR_CHANNEL_ACTIVATE | SR_TX_DIRECTION | gchan);
|
||||
#ifdef RLD_TRANS_DEBUG
|
||||
if (1 || log_level >= LOG_MONITOR)
|
||||
#else
|
||||
if (log_level >= LOG_MONITOR)
|
||||
#endif
|
||||
pr_info("++ SACK[P%d/C%d] ack'd, continuing...\n",
|
||||
ch->up->portnum, ch->channum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
ci->wd_notify = 0;
|
||||
#endif
|
||||
#if 0
|
||||
SD_SEM_GIVE (&ci->sem_wdbusy);/* release per-board hold */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -690,9 +558,7 @@ c4_cleanup (void)
|
||||
for (portnum = 0; portnum < ci->max_port; portnum++)
|
||||
{
|
||||
pi = &ci->port[portnum];
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
|
||||
c4_wq_port_cleanup (pi);
|
||||
#endif
|
||||
for (j = 0; j < MUSYCC_NCHANS; j++)
|
||||
{
|
||||
if (pi->chan[j])
|
||||
@ -700,10 +566,6 @@ c4_cleanup (void)
|
||||
}
|
||||
OS_kfree (pi->regram_saved);
|
||||
}
|
||||
#if 0
|
||||
/* obsolete - watchdog is now static w/in ci_t */
|
||||
OS_free_watchdog (ci->wd);
|
||||
#endif
|
||||
OS_kfree (ci->iqd_p_saved);
|
||||
OS_kfree (ci);
|
||||
ci = next; /* cleanup next board, if any */
|
||||
@ -1145,7 +1007,6 @@ c4_set_port (ci_t * ci, int portnum)
|
||||
return EBUSY; /* group needs initialization only for
|
||||
* first channel of a group */
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
|
||||
{
|
||||
status_t ret;
|
||||
|
||||
@ -1153,7 +1014,6 @@ c4_set_port (ci_t * ci, int portnum)
|
||||
* workqueue_struct */
|
||||
return (ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
init_comet (ci, pi->cometbase, pp->port_mode, 1 /* clockmaster == true */ , pp->portP);
|
||||
clck = pci_read_32 ((u_int32_t *) &ci->cpldbase->mclk) & PMCC4_CPLD_MCLK_MASK;
|
||||
@ -1269,14 +1129,12 @@ c4_new_chan (ci_t * ci, int portnum, int channum, void *user)
|
||||
spin_lock_init (&ch->ch_rxlock);
|
||||
spin_lock_init (&ch->ch_txlock);
|
||||
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
|
||||
{
|
||||
status_t ret;
|
||||
|
||||
if ((ret = c4_wk_chan_init (pi, ch)))
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* save off interface assignments which bound a board */
|
||||
if (ci->first_if == 0) /* first channel registered is assumed to
|
||||
@ -1705,31 +1563,23 @@ sbecom_get_brdinfo (ci_t * ci, struct sbe_brd_info * bip, u_int8_t *bsn)
|
||||
|
||||
if (ci->first_if)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
np = (char *) hdlc_to_name (ci->first_if);
|
||||
#else
|
||||
{
|
||||
struct net_device *dev;
|
||||
|
||||
dev = (struct net_device *) ci->first_if;
|
||||
np = (char *) dev->name;
|
||||
}
|
||||
#endif
|
||||
strncpy (bip->first_iname, np, CHNM_STRLEN - 1);
|
||||
} else
|
||||
strcpy (bip->first_iname, "<NULL>");
|
||||
if (ci->last_if)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
np = (char *) hdlc_to_name (ci->last_if);
|
||||
#else
|
||||
{
|
||||
struct net_device *dev;
|
||||
|
||||
dev = (struct net_device *) ci->last_if;
|
||||
np = (char *) dev->name;
|
||||
}
|
||||
#endif
|
||||
strncpy (bip->last_iname, np, CHNM_STRLEN - 1);
|
||||
} else
|
||||
strcpy (bip->last_iname, "<NULL>");
|
||||
@ -1763,11 +1613,7 @@ c4_get_iidinfo (ci_t * ci, struct sbe_iid_info * iip)
|
||||
if (!(dev = getuserbychan (iip->channum)))
|
||||
return ENOENT;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
np = (char *) hdlc_to_name (dev_to_hdlc (dev));
|
||||
#else
|
||||
np = dev->name;
|
||||
#endif
|
||||
strncpy (iip->iname, np, CHNM_STRLEN - 1);
|
||||
return 0;
|
||||
}
|
||||
@ -1826,11 +1672,7 @@ c4_ebus_intr_th_handler (void *devp)
|
||||
pci_write_32 ((u_int32_t *) &ci->reg->glcd, GCD_MAGIC | MUSYCC_GCD_INTB_DISABLE);
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,20)
|
||||
return;
|
||||
#else
|
||||
return IRQ_RETVAL (handled);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,9 +48,6 @@
|
||||
#else
|
||||
#include <linux/types.h>
|
||||
#include <linux/version.h>
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
|
||||
#include <linux/config.h>
|
||||
#endif
|
||||
#if defined(CONFIG_SMP) && ! defined(__SMP__)
|
||||
#define __SMP__
|
||||
#endif
|
||||
@ -60,12 +57,8 @@
|
||||
|
||||
#ifdef MODULE
|
||||
#ifdef MODVERSIONS
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
#include <linux/modversions.h>
|
||||
#else
|
||||
#include <config/modversions.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <linux/module.h>
|
||||
#endif
|
||||
#endif
|
||||
@ -260,11 +253,7 @@ OS_sem_free (void *sem)
|
||||
struct watchdog
|
||||
{
|
||||
struct timer_list h;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
|
||||
struct tq_struct tq;
|
||||
#else
|
||||
struct work_struct work;
|
||||
#endif
|
||||
void *softc;
|
||||
void (*func) (void *softc);
|
||||
int ticks;
|
||||
|
Loading…
Reference in New Issue
Block a user