Lines Matching refs:ngep
51 void nge_tx_recycle_all(nge_t *ngep);
55 nge_tx_recycle_all(nge_t *ngep) in nge_tx_recycle_all() argument
63 srp = ngep->send; in nge_tx_recycle_all()
83 if (ngep->nge_mac_state == NGE_MAC_STARTED && in nge_tx_recycle_all()
84 ngep->resched_needed == 1) { in nge_tx_recycle_all()
85 ngep->resched_needed = 0; in nge_tx_recycle_all()
86 mac_tx_update(ngep->mh); in nge_tx_recycle_all()
125 nge_tx_desc_sync(nge_t *ngep, uint32_t start_index, uint32_t bds, uint_t type) in nge_tx_desc_sync() argument
127 send_ring_t *srp = ngep->send; in nge_tx_desc_sync()
128 const size_t txd_size = ngep->desc_attr.txd_size; in nge_tx_desc_sync()
150 nge_tx_recycle(nge_t *ngep, boolean_t is_intr) in nge_tx_recycle() argument
166 srp = ngep->send; in nge_tx_recycle()
188 ngep->watchdog = 0; in nge_tx_recycle()
193 if (used > srp->tx_hwmark && ngep->resched_needed == 0) in nge_tx_recycle()
196 nge_tx_desc_sync(ngep, slot, used, DDI_DMA_SYNC_FORKERNEL); in nge_tx_recycle()
215 stflg = ngep->desc_attr.txd_check(hw_sbd_p); in nge_tx_recycle()
246 ngep->watchdog = (srp->desc.nslots - srp->tx_free != 0); in nge_tx_recycle()
253 resched = (ngep->resched_needed != 0 && srp->tx_hwmark <= srp->tx_free); in nge_tx_recycle()
275 (void) ddi_intr_trigger_softint(ngep->resched_hdl, NULL); in nge_tx_recycle()
279 nge_tx_alloc(nge_t *ngep, uint32_t num) in nge_tx_alloc() argument
285 srp = ngep->send; in nge_tx_alloc()
292 nge_tx_recycle(ngep, B_FALSE); in nge_tx_alloc()
310 nge_tx_start(nge_t *ngep, uint32_t slotnum) in nge_tx_start() argument
315 srp = ngep->send; in nge_tx_start()
336 if (ngep->watchdog == 0) in nge_tx_start()
337 ngep->watchdog = 1; in nge_tx_start()
339 mode_cntl.mode_val = nge_reg_get32(ngep, NGE_MODE_CNTL); in nge_tx_start()
342 nge_reg_put32(ngep, NGE_MODE_CNTL, mode_cntl.mode_val); in nge_tx_start()
348 nge_send_copy(nge_t *ngep, mblk_t *mp, send_ring_t *srp);
352 nge_send_copy(nge_t *ngep, mblk_t *mp, send_ring_t *srp) in nge_send_copy() argument
368 if ((uint32_t)-1 == (start_index = nge_tx_alloc(ngep, bds))) in nge_send_copy()
381 tfint = ((start_index % ngep->tfint_threshold) == 0); in nge_send_copy()
392 if ((totlen += mblen) <= ngep->max_sdu) { in nge_send_copy()
404 ngep->desc_attr.txd_fill(hw_sbd_p, &ssbdp->pbuf.cookie, totlen, in nge_send_copy()
406 nge_tx_desc_sync(ngep, start_index, bds, DDI_DMA_SYNC_FORDEV); in nge_send_copy()
410 nge_tx_start(ngep, bds); in nge_send_copy()
428 nge_send_mapped(nge_t *ngep, mblk_t *mp, size_t fragno) in nge_send_mapped() argument
450 srp = ngep->send; in nge_send_mapped()
531 if ((uint32_t)-1 == (start_index = nge_tx_alloc(ngep, slot))) in nge_send_mapped()
544 tfint = ((j % ngep->tfint_threshold) == 0); in nge_send_mapped()
546 ngep->desc_attr.txd_fill(hw_sbd_p, cookie + i, in nge_send_mapped()
553 tfint = ((j % ngep->tfint_threshold) == 0); in nge_send_mapped()
554 ngep->desc_attr.txd_fill(hw_sbd_p, cookie + i, cookie[i].dmac_size, in nge_send_mapped()
557 nge_tx_desc_sync(ngep, start_index, slot, DDI_DMA_SYNC_FORDEV); in nge_send_mapped()
571 nge_tx_start(ngep, slot); in nge_send_mapped()
592 nge_send(nge_t *ngep, mblk_t *mp) in nge_send() argument
599 nge_statistics_t *nstp = &ngep->statistics; in nge_send()
603 ASSERT(ngep->nge_mac_state == NGE_MAC_STARTED); in nge_send()
605 srp = ngep->send; in nge_send()
620 if (mblen > (ngep->max_sdu) || mblen == 0) { in nge_send()
624 if ((mblen > ngep->param_txbcopy_threshold) && in nge_send()
627 status = nge_send_mapped(ngep, mp, frags); in nge_send()
629 status = nge_send_copy(ngep, mp, srp); in nge_send()
631 status = nge_send_copy(ngep, mp, srp); in nge_send()
634 nge_tx_recycle(ngep, B_FALSE); in nge_send()
635 status = nge_send_copy(ngep, mp, srp); in nge_send()
637 ngep->resched_needed = 1; in nge_send()
655 nge_t *ngep = arg; in nge_m_tx() local
658 rw_enter(ngep->rwlock, RW_READER); in nge_m_tx()
660 if (ngep->nge_chip_state != NGE_CHIP_RUNNING) { in nge_m_tx()
668 if (!nge_send(ngep, mp)) { in nge_m_tx()
675 rw_exit(ngep->rwlock); in nge_m_tx()
684 nge_t *ngep; in nge_reschedule() local
687 ngep = (nge_t *)args1; in nge_reschedule()
694 if (ngep->nge_mac_state == NGE_MAC_STARTED && in nge_reschedule()
695 ngep->resched_needed == 1) { in nge_reschedule()
696 ngep->resched_needed = 0; in nge_reschedule()
697 ++ngep->statistics.sw_statistics.tx_resched; in nge_reschedule()
698 mac_tx_update(ngep->mh); in nge_reschedule()