Lines Matching refs:qep

85 static inline int qe_stop(struct sunqe *qep)  in qe_stop()  argument
87 void __iomem *cregs = qep->qcregs; in qe_stop()
88 void __iomem *mregs = qep->mregs; in qe_stop()
124 static void qe_init_rings(struct sunqe *qep) in qe_init_rings() argument
126 struct qe_init_block *qb = qep->qe_block; in qe_init_rings()
127 struct sunqe_buffers *qbufs = qep->buffers; in qe_init_rings()
128 __u32 qbufs_dvma = (__u32)qep->buffers_dvma; in qe_init_rings()
131 qep->rx_new = qep->rx_old = qep->tx_new = qep->tx_old = 0; in qe_init_rings()
141 static int qe_init(struct sunqe *qep, int from_irq) in qe_init() argument
143 struct sunqec *qecp = qep->parent; in qe_init()
144 void __iomem *cregs = qep->qcregs; in qe_init()
145 void __iomem *mregs = qep->mregs; in qe_init()
147 const unsigned char *e = &qep->dev->dev_addr[0]; in qe_init()
148 __u32 qblk_dvma = (__u32)qep->qblock_dvma; in qe_init()
153 if (qe_stop(qep)) in qe_init()
168 tmp = qep->channel * sbus_readl(gregs + GLOB_MSIZE); in qe_init()
224 qe_init_rings(qep); in qe_init()
241 printk(KERN_NOTICE "%s: Warning, link state is down.\n", qep->dev->name); in qe_init()
250 qe_set_multicast(qep->dev); in qe_init()
259 static int qe_is_bolixed(struct sunqe *qep, u32 qe_status) in qe_is_bolixed() argument
261 struct net_device *dev = qep->dev; in qe_is_bolixed()
405 qe_init(qep, 1); in qe_is_bolixed()
412 static void qe_rx(struct sunqe *qep) in qe_rx() argument
414 struct qe_rxd *rxbase = &qep->qe_block->qe_rxd[0]; in qe_rx()
415 struct net_device *dev = qep->dev; in qe_rx()
417 struct sunqe_buffers *qbufs = qep->buffers; in qe_rx()
418 __u32 qbufs_dvma = (__u32)qep->buffers_dvma; in qe_rx()
419 int elem = qep->rx_new; in qe_rx()
447 skb->protocol = eth_type_trans(skb, qep->dev); in qe_rx()
459 qep->rx_new = elem; in qe_rx()
462 static void qe_tx_reclaim(struct sunqe *qep);
478 struct sunqe *qep = qecp->qes[channel]; in qec_interrupt() local
481 qe_status = sbus_readl(qep->qcregs + CREG_STAT); in qec_interrupt()
483 if (qe_is_bolixed(qep, qe_status)) in qec_interrupt()
487 qe_rx(qep); in qec_interrupt()
488 if (netif_queue_stopped(qep->dev) && in qec_interrupt()
490 spin_lock(&qep->lock); in qec_interrupt()
491 qe_tx_reclaim(qep); in qec_interrupt()
492 if (TX_BUFFS_AVAIL(qep) > 0) { in qec_interrupt()
496 netif_wake_queue(qep->dev); in qec_interrupt()
497 sbus_writel(1, qep->qcregs + CREG_TIMASK); in qec_interrupt()
499 spin_unlock(&qep->lock); in qec_interrupt()
513 struct sunqe *qep = netdev_priv(dev); in qe_open() local
515 qep->mconfig = (MREGS_MCONFIG_TXENAB | in qe_open()
518 return qe_init(qep, 0); in qe_open()
523 struct sunqe *qep = netdev_priv(dev); in qe_close() local
525 qe_stop(qep); in qe_close()
532 static void qe_tx_reclaim(struct sunqe *qep) in qe_tx_reclaim() argument
534 struct qe_txd *txbase = &qep->qe_block->qe_txd[0]; in qe_tx_reclaim()
535 int elem = qep->tx_old; in qe_tx_reclaim()
537 while (elem != qep->tx_new) { in qe_tx_reclaim()
544 qep->tx_old = elem; in qe_tx_reclaim()
549 struct sunqe *qep = netdev_priv(dev); in qe_tx_timeout() local
552 spin_lock_irq(&qep->lock); in qe_tx_timeout()
557 qe_tx_reclaim(qep); in qe_tx_timeout()
558 tx_full = TX_BUFFS_AVAIL(qep) <= 0; in qe_tx_timeout()
560 spin_unlock_irq(&qep->lock); in qe_tx_timeout()
566 qe_init(qep, 1); in qe_tx_timeout()
575 struct sunqe *qep = netdev_priv(dev); in qe_start_xmit() local
576 struct sunqe_buffers *qbufs = qep->buffers; in qe_start_xmit()
577 __u32 txbuf_dvma, qbufs_dvma = (__u32)qep->buffers_dvma; in qe_start_xmit()
581 spin_lock_irq(&qep->lock); in qe_start_xmit()
583 qe_tx_reclaim(qep); in qe_start_xmit()
586 entry = qep->tx_new; in qe_start_xmit()
593 qep->qe_block->qe_txd[entry].tx_flags = TXD_UPDATE; in qe_start_xmit()
597 qep->qe_block->qe_txd[entry].tx_addr = txbuf_dvma; in qe_start_xmit()
598 qep->qe_block->qe_txd[entry].tx_flags = in qe_start_xmit()
600 qep->tx_new = NEXT_TX(entry); in qe_start_xmit()
603 sbus_writel(CREG_CTRL_TWAKEUP, qep->qcregs + CREG_CTRL); in qe_start_xmit()
608 if (TX_BUFFS_AVAIL(qep) <= 0) { in qe_start_xmit()
615 sbus_writel(0, qep->qcregs + CREG_TIMASK); in qe_start_xmit()
617 spin_unlock_irq(&qep->lock); in qe_start_xmit()
626 struct sunqe *qep = netdev_priv(dev); in qe_set_multicast() local
628 u8 new_mconfig = qep->mconfig; in qe_set_multicast()
637 qep->mregs + MREGS_IACONFIG); in qe_set_multicast()
638 while ((sbus_readb(qep->mregs + MREGS_IACONFIG) & MREGS_IACONFIG_ACHNGE) != 0) in qe_set_multicast()
641 sbus_writeb(0xff, qep->mregs + MREGS_FILTER); in qe_set_multicast()
642 sbus_writeb(0, qep->mregs + MREGS_IACONFIG); in qe_set_multicast()
657 qep->mregs + MREGS_IACONFIG); in qe_set_multicast()
658 while ((sbus_readb(qep->mregs + MREGS_IACONFIG) & MREGS_IACONFIG_ACHNGE) != 0) in qe_set_multicast()
662 sbus_writeb(tmp, qep->mregs + MREGS_FILTER); in qe_set_multicast()
664 sbus_writeb(0, qep->mregs + MREGS_IACONFIG); in qe_set_multicast()
673 qep->mconfig = new_mconfig; in qe_set_multicast()
674 sbus_writeb(qep->mconfig, qep->mregs + MREGS_MCONFIG); in qe_set_multicast()
684 struct sunqe *qep = netdev_priv(dev); in qe_get_drvinfo() local
690 op = qep->op; in qe_get_drvinfo()
700 struct sunqe *qep = netdev_priv(dev); in qe_get_link() local
701 void __iomem *mregs = qep->mregs; in qe_get_link()
704 spin_lock_irq(&qep->lock); in qe_get_link()
706 spin_unlock_irq(&qep->lock); in qe_get_link()