Lines Matching defs:rbp
82 void ch_big_rbuf_recycle(ch_esb_t *rbp);
83 void ch_small_rbuf_recycle(ch_esb_t *rbp);
1118 * receiver buffer control structure (ch_esb_t *rbp).
1126 ch_esb_t *rbp;
1149 rbp = ch_alloc_small_esbbuf(sa, j);
1150 if (rbp == NULL)
1155 rbp->cs_next = sa->ch_small_esb_free;
1156 sa->ch_small_esb_free = rbp;
1161 rbp->cs_owner = sa->ch_small_owner;
1162 sa->ch_small_owner = rbp;
1177 * receiver buffer control structure (ch_esb_t *rbp).
1185 ch_esb_t *rbp;
1208 rbp = ch_alloc_big_esbbuf(sa, j);
1209 if (rbp == NULL)
1211 rbp->cs_next = sa->ch_big_esb_free;
1212 sa->ch_big_esb_free = rbp;
1217 rbp->cs_owner = sa->ch_big_owner;
1218 sa->ch_big_owner = rbp;
1239 ch_esb_t *rbp;
1241 rbp = (ch_esb_t *)kmem_zalloc(sizeof (ch_esb_t), KM_SLEEP);
1242 if (rbp == NULL) {
1247 rbp->cs_buf = (caddr_t)ch_alloc_dma_mem(sa, 1, DMA_STREAM|DMA_SMALN,
1248 SGE_SM_BUF_SZ(sa), &rbp->cs_pa, &rbp->cs_dh, &rbp->cs_ah);
1250 rbp->cs_buf = (caddr_t)ch_alloc_dma_mem(sa, 0, DMA_STREAM|DMA_SMALN,
1251 SGE_SM_BUF_SZ(sa), &rbp->cs_pa, &rbp->cs_dh, &rbp->cs_ah);
1254 if (rbp->cs_buf == NULL) {
1255 kmem_free(rbp, sizeof (ch_esb_t));
1259 rbp->cs_sa = sa;
1260 rbp->cs_index = i;
1262 rbp->cs_frtn.free_func = (void (*)())&ch_small_rbuf_recycle;
1263 rbp->cs_frtn.free_arg = (caddr_t)rbp;
1265 return (rbp);
1276 ch_esb_t *rbp;
1278 rbp = (ch_esb_t *)kmem_zalloc(sizeof (ch_esb_t), KM_SLEEP);
1279 if (rbp == NULL) {
1284 rbp->cs_buf = (caddr_t)ch_alloc_dma_mem(sa, 1, DMA_STREAM|DMA_BGALN,
1285 SGE_BG_BUF_SZ(sa), &rbp->cs_pa, &rbp->cs_dh, &rbp->cs_ah);
1287 rbp->cs_buf = (caddr_t)ch_alloc_dma_mem(sa, 0, DMA_STREAM|DMA_BGALN,
1288 SGE_BG_BUF_SZ(sa), &rbp->cs_pa, &rbp->cs_dh, &rbp->cs_ah);
1291 if (rbp->cs_buf == NULL) {
1292 kmem_free(rbp, sizeof (ch_esb_t));
1296 rbp->cs_sa = sa;
1297 rbp->cs_index = i;
1299 rbp->cs_frtn.free_func = (void (*)())&ch_big_rbuf_recycle;
1300 rbp->cs_frtn.free_arg = (caddr_t)rbp;
1302 return (rbp);
1311 ch_esb_t *rbp;
1319 rbp = sa->ch_small_owner;
1320 sa->ch_small_owner = rbp->cs_owner;
1321 rbp->cs_owner = NULL;
1322 rbp->cs_flag = 1;
1325 while ((rbp = sa->ch_small_esb_free) != NULL) {
1327 sa->ch_small_esb_free = rbp->cs_next;
1329 ch_free_dma_mem(rbp->cs_dh, rbp->cs_ah);
1331 kmem_free(rbp, sizeof (ch_esb_t));
1346 rbp = sa->ch_big_owner;
1347 sa->ch_big_owner = rbp->cs_owner;
1348 rbp->cs_owner = NULL;
1349 rbp->cs_flag = 1;
1352 while ((rbp = sa->ch_big_esb_free) != NULL) {
1354 sa->ch_big_esb_free = rbp->cs_next;
1356 ch_free_dma_mem(rbp->cs_dh, rbp->cs_ah);
1358 kmem_free(rbp, sizeof (ch_esb_t));
1368 ch_small_rbuf_recycle(ch_esb_t *rbp)
1370 ch_t *sa = rbp->cs_sa;
1372 if (rbp->cs_flag) {
1377 ch_free_dma_mem(rbp->cs_dh, rbp->cs_ah);
1379 i = rbp->cs_index;
1384 kmem_free(rbp, sizeof (ch_esb_t));
1397 rbp->cs_next = sa->ch_small_esb_free;
1398 sa->ch_small_esb_free = rbp;
1404 atomic_dec_32(&buffers_in_use[rbp->cs_index]);
1411 ch_big_rbuf_recycle(ch_esb_t *rbp)
1413 ch_t *sa = rbp->cs_sa;
1415 if (rbp->cs_flag) {
1420 ch_free_dma_mem(rbp->cs_dh, rbp->cs_ah);
1422 i = rbp->cs_index;
1427 kmem_free(rbp, sizeof (ch_esb_t));
1440 rbp->cs_next = sa->ch_big_esb_free;
1441 sa->ch_big_esb_free = rbp;
1447 atomic_dec_32(&buffers_in_use[rbp->cs_index]);
1457 ch_esb_t *rbp;
1460 rbp = sa->ch_small_esb_free;
1461 if (rbp) {
1462 sa->ch_small_esb_free = rbp->cs_next;
1466 return (rbp);
1477 ch_esb_t *rbp;
1480 rbp = sa->ch_big_esb_free;
1481 if (rbp) {
1482 sa->ch_big_esb_free = rbp->cs_next;
1486 return (rbp);