Lines Matching refs:srp

170 bge_reinit_send_ring(send_ring_t *srp)
181 srp->tx_flow = 0;
182 srp->tx_next = 0;
183 srp->txfill_next = 0;
184 srp->tx_free = srp->desc.nslots;
185 ASSERT(mutex_owned(srp->tc_lock));
186 srp->tc_next = 0;
187 srp->txpkt_next = 0;
188 srp->tx_block = 0;
189 srp->tx_nobd = 0;
190 srp->tx_nobuf = 0;
195 mutex_enter(srp->freetxbuf_lock);
196 mutex_enter(srp->txbuf_lock);
197 txbuf_queue = &srp->freetxbuf_queue;
200 txbuf_queue->lock = srp->freetxbuf_lock;
201 srp->txbuf_push_queue = txbuf_queue;
206 txbuf_queue = &srp->txbuf_queue;
209 txbuf_queue->lock = srp->txbuf_lock;
210 srp->txbuf_pop_queue = txbuf_queue;
211 txbuf_head = srp->txbuf_head;
212 txbuf = srp->txbuf;
213 for (slot = 0; slot < srp->tx_buffers; ++slot) {
221 mutex_exit(srp->txbuf_lock);
222 mutex_exit(srp->freetxbuf_lock);
227 DMA_ZERO(srp->desc);
228 DMA_SYNC(srp->desc, DDI_DMA_SYNC_FORDEV);
229 bzero(srp->pktp, BGE_SEND_BUF_MAX * sizeof (*srp->pktp));
230 ssbdp = srp->sw_sbds;
231 for (slot = 0; slot < srp->desc.nslots; ++ssbdp, ++slot)
477 send_ring_t *srp;
505 srp = &bgep->send[ring];
506 mutex_enter(srp->tx_lock);
507 if (srp->tx_array > 1)
508 bge_free_txbuf_arrays(srp);
509 mutex_exit(srp->tx_lock);
2267 send_ring_t *srp;
2284 srp = &bgep->send[ring];
2285 nslots = srp->desc.nslots;
2291 srp->hw_rcb.host_ring_addr = srp->desc.cookie.dmac_laddress;
2292 srp->hw_rcb.max_len = (uint16_t)nslots;
2293 srp->hw_rcb.flags = nslots > 0 ? 0 : RCB_FLAG_RING_DISABLED;
2294 srp->hw_rcb.nic_ring_addr = NIC_MEM_SHADOW_SEND_RING(ring, nslots);
2299 srp->bgep = bgep;
2301 srp->cons_index_p = SEND_INDEX_P(bsp, ring);
2302 srp->chip_mbx_reg = SEND_RING_HOST_INDEX_REG(ring);
2303 mutex_init(srp->tx_lock, NULL, MUTEX_DRIVER,
2305 mutex_init(srp->txbuf_lock, NULL, MUTEX_DRIVER,
2307 mutex_init(srp->freetxbuf_lock, NULL, MUTEX_DRIVER,
2309 mutex_init(srp->tc_lock, NULL, MUTEX_DRIVER,
2319 srp->txbuf_head =
2321 srp->pktp = kmem_zalloc(BGE_SEND_BUF_MAX*sizeof (send_pkt_t), KM_SLEEP);
2322 srp->sw_sbds = ssbdp;
2323 srp->txbuf = txbuf;
2324 srp->tx_buffers = BGE_SEND_BUF_NUM;
2325 srp->tx_buffers_low = srp->tx_buffers / 4;
2327 srp->tx_array_max = BGE_SEND_BUF_ARRAY_JUMBO;
2329 srp->tx_array_max = BGE_SEND_BUF_ARRAY;
2330 srp->tx_array = 1;
2335 desc = srp->desc;
2346 pbuf = srp->buf[0][split];
2362 send_ring_t *srp;
2370 srp = &bgep->send[ring];
2371 mutex_destroy(srp->tc_lock);
2372 mutex_destroy(srp->freetxbuf_lock);
2373 mutex_destroy(srp->txbuf_lock);
2374 mutex_destroy(srp->tx_lock);
2375 nslots = srp->desc.nslots;
2379 for (array = 1; array < srp->tx_array; ++array)
2381 bge_free_dma_mem(&srp->buf[array][split]);
2382 kmem_free(srp->sw_sbds, nslots*sizeof (*srp->sw_sbds));
2383 kmem_free(srp->txbuf_head, BGE_SEND_BUF_MAX*sizeof (*srp->txbuf_head));
2384 kmem_free(srp->txbuf, BGE_SEND_BUF_MAX*sizeof (*srp->txbuf));
2385 kmem_free(srp->pktp, BGE_SEND_BUF_MAX*sizeof (*srp->pktp));
2386 srp->sw_sbds = NULL;
2387 srp->txbuf_head = NULL;
2388 srp->txbuf = NULL;
2389 srp->pktp = NULL;
2436 bge_free_txbuf_arrays(send_ring_t *srp)
2441 ASSERT(mutex_owned(srp->tx_lock));
2446 for (array = 1; array < srp->tx_array; ++array)
2448 bge_free_dma_mem(&srp->buf[array][split]);
2453 srp->tx_array = 1;
2454 srp->tx_buffers = BGE_SEND_BUF_NUM;
2455 srp->tx_buffers_low = srp->tx_buffers / 4;
2456 srp->tx_flow = 0;
2457 bzero(srp->pktp, BGE_SEND_BUF_MAX * sizeof (*srp->pktp));
2464 bge_alloc_txbuf_array(bge_t *bgep, send_ring_t *srp)
2478 ASSERT(mutex_owned(srp->tx_lock));
2480 array = srp->tx_array;
2481 if (array >= srp->tx_array_max)
2492 &srp->buf[array][split]);
2496 bge_free_dma_mem(&srp->buf[array][slot]);
2497 srp->tx_alloc_fail++;
2505 txbuf = srp->txbuf + array*BGE_SEND_BUF_NUM;
2507 area = srp->buf[array][split];
2518 txbuf_item = srp->txbuf_head + array*BGE_SEND_BUF_NUM;
2519 txbuf = srp->txbuf + array*BGE_SEND_BUF_NUM;
2528 txbuf_item = srp->txbuf_head + array*BGE_SEND_BUF_NUM;
2531 txbuf_queue = srp->txbuf_pop_queue;
2538 srp->tx_array++;
2539 srp->tx_buffers += BGE_SEND_BUF_NUM;
2540 srp->tx_buffers_low = srp->tx_buffers / 4;