Commit b7923d22 authored by Daeseok Youn's avatar Daeseok Youn Committed by Greg Kroah-Hartman

staging: cxt1e1: remove dead code in musycc.c

Removes "#if 0" blocks.

And the musycc_dump_rxbuffer_ring(ch, 0) which is commented
out puts in RLD_DEBUG block and uncommented.
Because this function may be used for debugging.
Signed-off-by: default avatarDaeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2ab4b6e7
...@@ -64,7 +64,6 @@ void musycc_update_timeslots(mpi_t *); ...@@ -64,7 +64,6 @@ void musycc_update_timeslots(mpi_t *);
/*******************************************************************/ /*******************************************************************/
#if 1
static int static int
musycc_dump_rxbuffer_ring(mch_t *ch, int lockit) musycc_dump_rxbuffer_ring(mch_t *ch, int lockit)
{ {
...@@ -128,9 +127,7 @@ musycc_dump_rxbuffer_ring(mch_t *ch, int lockit) ...@@ -128,9 +127,7 @@ musycc_dump_rxbuffer_ring(mch_t *ch, int lockit)
spin_unlock_irqrestore(&ch->ch_rxlock, flags); spin_unlock_irqrestore(&ch->ch_rxlock, flags);
return 0; return 0;
} }
#endif
#if 1
static int static int
musycc_dump_txbuffer_ring(mch_t *ch, int lockit) musycc_dump_txbuffer_ring(mch_t *ch, int lockit)
{ {
...@@ -188,8 +185,6 @@ musycc_dump_txbuffer_ring(mch_t *ch, int lockit) ...@@ -188,8 +185,6 @@ musycc_dump_txbuffer_ring(mch_t *ch, int lockit)
spin_unlock_irqrestore(&ch->ch_txlock, flags); spin_unlock_irqrestore(&ch->ch_txlock, flags);
return 0; return 0;
} }
#endif
/* /*
* The following supports a backdoor debug facility which can be used to * The following supports a backdoor debug facility which can be used to
...@@ -340,9 +335,6 @@ musycc_wq_chan_restart(void *arg) /* channel private structure */ ...@@ -340,9 +335,6 @@ musycc_wq_chan_restart(void *arg) /* channel private structure */
mch_t *ch; mch_t *ch;
mpi_t *pi; mpi_t *pi;
struct mdesc *md; struct mdesc *md;
#if 0
unsigned long flags;
#endif
ch = container_of(arg, struct c4_chan_info, ch_work); ch = container_of(arg, struct c4_chan_info, ch_work);
pi = ch->up; pi = ch->up;
...@@ -391,22 +383,14 @@ musycc_wq_chan_restart(void *arg) /* channel private structure */ ...@@ -391,22 +383,14 @@ musycc_wq_chan_restart(void *arg) /* channel private structure */
/* find next unprocessed message, then set TX thp to it */ /* find next unprocessed message, then set TX thp to it */
musycc_update_tx_thp(ch); musycc_update_tx_thp(ch);
#if 0
spin_lock_irqsave(&ch->ch_txlock, flags);
#endif
md = ch->txd_irq_srv; md = ch->txd_irq_srv;
if (!md) { if (!md) {
#ifdef RLD_TRANS_DEBUG #ifdef RLD_TRANS_DEBUG
pr_info("-- musycc_wq_chan_restart[%d]: WARNING, starting NULL md\n", ch->channum); pr_info("-- musycc_wq_chan_restart[%d]: WARNING, starting NULL md\n", ch->channum);
#endif
#if 0
spin_unlock_irqrestore(&ch->ch_txlock, flags);
#endif #endif
} else if (md->data && ((le32_to_cpu(md->status)) & MUSYCC_TX_OWNED)) { } else if (md->data && ((le32_to_cpu(md->status)) & MUSYCC_TX_OWNED)) {
ch->ch_start_tx = 0; ch->ch_start_tx = 0;
#if 0
spin_unlock_irqrestore(&ch->ch_txlock, flags); /* allow interrupts for service request */
#endif
#ifdef RLD_TRANS_DEBUG #ifdef RLD_TRANS_DEBUG
pr_info("++ musycc_wq_chan_restart() CHAN TX ACTIVATE: chan %d txd_irq_srv %p = sts %x, txpkt %lu\n", pr_info("++ musycc_wq_chan_restart() CHAN TX ACTIVATE: chan %d txd_irq_srv %p = sts %x, txpkt %lu\n",
ch->channum, ch->txd_irq_srv, ch->txd_irq_srv->status, ch->s.tx_packets); ch->channum, ch->txd_irq_srv, ch->txd_irq_srv->status, ch->s.tx_packets);
...@@ -421,9 +405,6 @@ musycc_wq_chan_restart(void *arg) /* channel private structure */ ...@@ -421,9 +405,6 @@ musycc_wq_chan_restart(void *arg) /* channel private structure */
le32_to_cpu(md->status), le32_to_cpu(md->status),
le32_to_cpu(md->data), ch->ch_start_tx); le32_to_cpu(md->data), ch->ch_start_tx);
musycc_dump_txbuffer_ring(ch, 0); musycc_dump_txbuffer_ring(ch, 0);
#if 0
spin_unlock_irqrestore(&ch->ch_txlock, flags); /* allow interrupts for service request */
#endif
} }
#endif #endif
} }
...@@ -831,12 +812,6 @@ musycc_bh_tx_eom(mpi_t *pi, int gchan) ...@@ -831,12 +812,6 @@ musycc_bh_tx_eom(mpi_t *pi, int gchan)
mch_t *ch; mch_t *ch;
struct mdesc *md; struct mdesc *md;
#if 0
#ifndef SBE_ISR_INLINE
unsigned long flags;
#endif
#endif
volatile u_int32_t status; volatile u_int32_t status;
ch = pi->chan[gchan]; ch = pi->chan[gchan];
...@@ -849,13 +824,6 @@ musycc_bh_tx_eom(mpi_t *pi, int gchan) ...@@ -849,13 +824,6 @@ musycc_bh_tx_eom(mpi_t *pi, int gchan)
return; /* note: mdt==0 implies a malloc() return; /* note: mdt==0 implies a malloc()
* failure w/in chan_up() routine */ * failure w/in chan_up() routine */
#if 0
#ifdef SBE_ISR_INLINE
spin_lock_irq(&ch->ch_txlock);
#else
spin_lock_irqsave(&ch->ch_txlock, flags);
#endif
#endif
do { do {
FLUSH_MEM_READ(); FLUSH_MEM_READ();
md = ch->txd_irq_srv; md = ch->txd_irq_srv;
...@@ -993,13 +961,6 @@ musycc_bh_tx_eom(mpi_t *pi, int gchan) ...@@ -993,13 +961,6 @@ musycc_bh_tx_eom(mpi_t *pi, int gchan)
#endif #endif
FLUSH_MEM_WRITE(); FLUSH_MEM_WRITE();
#if 0
#ifdef SBE_ISR_INLINE
spin_unlock_irq(&ch->ch_txlock);
#else
spin_unlock_irqrestore(&ch->ch_txlock, flags);
#endif
#endif
} }
...@@ -1181,11 +1142,6 @@ musycc_intr_th_handler(void *devp) ...@@ -1181,11 +1142,6 @@ musycc_intr_th_handler(void *devp)
* walking the chain. As the chain is walked, the interrupt will * walking the chain. As the chain is walked, the interrupt will
* eventually be serviced by the correct driver/handler. * eventually be serviced by the correct driver/handler.
*/ */
#if 0
/* chained interrupt = not ours */
pr_info(">> %s: intCnt NULL, sts %x, possibly a chained interrupt!\n",
ci->devname, status);
#endif
return IRQ_NONE; return IRQ_NONE;
} }
...@@ -1360,15 +1316,11 @@ musycc_intr_bh_tasklet(ci_t *ci) ...@@ -1360,15 +1316,11 @@ musycc_intr_bh_tasklet(ci_t *ci)
musycc_bh_tx_eom(pi, gchan); musycc_bh_tx_eom(pi, gchan);
else else
musycc_bh_rx_eom(pi, gchan); musycc_bh_rx_eom(pi, gchan);
#if 0
break;
#else
/* /*
* MUSYCC Interrupt Descriptor section states that EOB and EOM * MUSYCC Interrupt Descriptor section states that EOB and EOM
* can be combined with the NONE error (as well as others). So * can be combined with the NONE error (as well as others). So
* drop thru to catch this... * drop thru to catch this...
*/ */
#endif
case EVE_NONE: case EVE_NONE:
if (err == ERR_SHT) if (err == ERR_SHT)
ch->s.rx_length_errors++; ch->s.rx_length_errors++;
...@@ -1444,7 +1396,9 @@ musycc_intr_bh_tasklet(ci_t *ci) ...@@ -1444,7 +1396,9 @@ musycc_intr_bh_tasklet(ci_t *ci)
if (cxt1e1_log_level >= LOG_WARN) { if (cxt1e1_log_level >= LOG_WARN) {
pr_info("%s: RX buffer overflow [ONR] on channel %d, mode %x\n", pr_info("%s: RX buffer overflow [ONR] on channel %d, mode %x\n",
ci->devname, ch->channum, ch->p.chan_mode); ci->devname, ch->channum, ch->p.chan_mode);
//musycc_dump_rxbuffer_ring (ch, 0); /* RLD DEBUG */ #ifdef RLD_DEBUG
musycc_dump_rxbuffer_ring(ch, 0);
#endif
} }
} }
musycc_chan_restart(ch); musycc_chan_restart(ch);
...@@ -1511,35 +1465,6 @@ musycc_intr_bh_tasklet(ci_t *ci) ...@@ -1511,35 +1465,6 @@ musycc_intr_bh_tasklet(ci_t *ci)
/* else, nothing returned */ /* else, nothing returned */
} }
#if 0
int __init
musycc_new_chan(ci_t *ci, int channum, void *user)
{
mch_t *ch;
ch = ci->port[channum / MUSYCC_NCHANS].chan[channum % MUSYCC_NCHANS];
if (ch->state != UNASSIGNED)
return EEXIST;
/* NOTE: mch_t already cleared during OS_kmalloc() */
ch->state = DOWN;
ch->user = user;
#if 0
ch->status = 0;
ch->p.status = 0;
ch->p.intr_mask = 0;
#endif
ch->p.chan_mode = CFG_CH_PROTO_HDLC_FCS16;
ch->p.idlecode = CFG_CH_FLAG_7E;
ch->p.pad_fill_count = 2;
spin_lock_init(&ch->ch_rxlock);
spin_lock_init(&ch->ch_txlock);
return 0;
}
#endif
#ifdef SBE_PMCC4_ENABLE #ifdef SBE_PMCC4_ENABLE
status_t status_t
musycc_chan_down(ci_t *dummy, int channum) musycc_chan_down(ci_t *dummy, int channum)
...@@ -1592,52 +1517,12 @@ musycc_chan_down(ci_t *dummy, int channum) ...@@ -1592,52 +1517,12 @@ musycc_chan_down(ci_t *dummy, int channum)
} }
#endif #endif
#if 0
/* TODO: determine if these functions will not be needed and can be removed */
int
musycc_del_chan(ci_t *ci, int channum)
{
mch_t *ch;
if ((channum < 0) || (channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS))) /* sanity chk param */
return ECHRNG;
ch = sd_find_chan(ci, channum);
if (!ch)
return ENOENT;
if (ch->state == UP)
musycc_chan_down(ci, channum);
ch->state = UNASSIGNED;
return 0;
}
int
musycc_del_chan_stats(ci_t *ci, int channum)
{
mch_t *ch;
if (channum < 0 || channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS)) /* sanity chk param */
return ECHRNG;
ch = sd_find_chan(ci, channum);
if (!ch)
return ENOENT;
memset(&ch->s, 0, sizeof(struct sbecom_chan_stats));
return 0;
}
#endif
int int
musycc_start_xmit(ci_t *ci, int channum, void *mem_token) musycc_start_xmit(ci_t *ci, int channum, void *mem_token)
{ {
mch_t *ch; mch_t *ch;
struct mdesc *md; struct mdesc *md;
void *m2; void *m2;
#if 0
unsigned long flags;
#endif
int txd_need_cnt; int txd_need_cnt;
u_int32_t len; u_int32_t len;
...@@ -1694,9 +1579,7 @@ musycc_start_xmit(ci_t *ci, int channum, void *mem_token) ...@@ -1694,9 +1579,7 @@ musycc_start_xmit(ci_t *ci, int channum, void *mem_token)
OS_mem_token_free(mem_token); OS_mem_token_free(mem_token);
return 0; return 0;
} }
#if 0
spin_lock_irqsave(&ch->ch_txlock, flags);
#endif
/************************************************************/ /************************************************************/
/** flow control the line if not enough descriptors remain **/ /** flow control the line if not enough descriptors remain **/
/************************************************************/ /************************************************************/
...@@ -1707,9 +1590,6 @@ musycc_start_xmit(ci_t *ci, int channum, void *mem_token) ...@@ -1707,9 +1590,6 @@ musycc_start_xmit(ci_t *ci, int channum, void *mem_token)
ch->tx_full = 1; ch->tx_full = 1;
ch->txd_required = txd_need_cnt; ch->txd_required = txd_need_cnt;
sd_disable_xmit(ch->user); sd_disable_xmit(ch->user);
#if 0
spin_unlock_irqrestore(&ch->ch_txlock, flags);
#endif
return -EBUSY; /* tell user to try again later */ return -EBUSY; /* tell user to try again later */
} }
/**************************************************/ /**************************************************/
...@@ -1748,12 +1628,6 @@ musycc_start_xmit(ci_t *ci, int channum, void *mem_token) ...@@ -1748,12 +1628,6 @@ musycc_start_xmit(ci_t *ci, int channum, void *mem_token)
/* last chunk in hdlc mode */ /* last chunk in hdlc mode */
u |= (ch->p.idlecode << IDLE_CODE); u |= (ch->p.idlecode << IDLE_CODE);
if (ch->p.pad_fill_count) { if (ch->p.pad_fill_count) {
#if 0
/* NOOP NOTE: u_int8_t cannot be > 0xFF */
/* sanitize pad_fill_count for maximums allowed by hardware */
if (ch->p.pad_fill_count > EXTRA_FLAGS_MASK)
ch->p.pad_fill_count = EXTRA_FLAGS_MASK;
#endif
u |= (PADFILL_ENABLE | (ch->p.pad_fill_count << EXTRA_FLAGS)); u |= (PADFILL_ENABLE | (ch->p.pad_fill_count << EXTRA_FLAGS));
} }
md->mem_token = len ? NULL : mem_token; /* Fill in mds on last md->mem_token = len ? NULL : mem_token; /* Fill in mds on last
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment