Lines Matching defs:buf_info

7309  * The buf_info->flags field describes the memory operation requested.
7312 * Virtual address is supplied in buf_info->virt
7313 * DMA mapping flag is in buf_info->align
7315 * The mapped physical address is returned buf_info->phys
7319 * The byte alignment of the memory request is supplied in buf_info->align
7320 * The byte size of the memory request is supplied in buf_info->size
7321 * The virtual address is returned buf_info->virt
7322 * The mapped physical address is returned buf_info->phys (for FC_MBUF_DMA)
7325 emlxs_mem_alloc(emlxs_hba_t *hba, MBUF_INFO *buf_info)
7339 if (buf_info->flags & FC_MBUF_SNGLSG) {
7343 if (buf_info->flags & FC_MBUF_DMA32) {
7347 if (buf_info->flags & FC_MBUF_PHYSONLY) {
7349 if (buf_info->virt == 0) {
7358 NULL, (ddi_dma_handle_t *)&buf_info->dma_handle);
7362 "flags=%x", buf_info->size, buf_info->align,
7363 buf_info->flags);
7365 buf_info->phys = 0;
7366 buf_info->dma_handle = 0;
7370 switch (buf_info->align) {
7384 (ddi_dma_handle_t)buf_info->dma_handle, NULL,
7385 (caddr_t)buf_info->virt, (size_t)buf_info->size,
7393 buf_info->flags);
7396 (ddi_dma_handle_t *)&buf_info->dma_handle);
7397 buf_info->phys = 0;
7398 buf_info->dma_handle = 0;
7408 buf_info->dma_handle) & burstsizes_limit;
7409 if (ddi_dma_set_sbus64(buf_info->dma_handle,
7418 buf_info->phys = dma_cookie.dmac_laddress;
7423 EMLXS_MPDATA_SYNC((ddi_dma_handle_t)buf_info->dma_handle,
7424 (off_t)0, (size_t)buf_info->size, DDI_DMA_SYNC_FORDEV);
7426 } else if (buf_info->flags & (FC_MBUF_DMA|FC_MBUF_DMA32)) {
7428 dma_attr.dma_attr_align = buf_info->align;
7435 (ddi_dma_handle_t *)&buf_info->dma_handle);
7439 "flags=%x", buf_info->size, buf_info->align,
7440 buf_info->flags);
7442 buf_info->virt = 0;
7443 buf_info->phys = 0;
7444 buf_info->data_handle = 0;
7445 buf_info->dma_handle = 0;
7450 (ddi_dma_handle_t)buf_info->dma_handle,
7451 (size_t)buf_info->size, &dev_attr, DDI_DMA_CONSISTENT,
7452 DDI_DMA_DONTWAIT, NULL, (caddr_t *)&buf_info->virt,
7453 &dma_reallen, (ddi_acc_handle_t *)&buf_info->data_handle);
7455 if ((status != DDI_SUCCESS) || (buf_info->size > dma_reallen)) {
7458 "flags=%x", buf_info->size, buf_info->align,
7459 buf_info->flags);
7462 (ddi_dma_handle_t *)&buf_info->dma_handle);
7464 buf_info->virt = 0;
7465 buf_info->phys = 0;
7466 buf_info->data_handle = 0;
7467 buf_info->dma_handle = 0;
7473 (ddi_dma_handle_t)buf_info->dma_handle, NULL,
7474 (caddr_t)buf_info->virt, (size_t)buf_info->size,
7482 cookie_count, buf_info->size, buf_info->align,
7483 buf_info->flags);
7486 (ddi_acc_handle_t *)&buf_info->data_handle);
7488 (ddi_dma_handle_t *)&buf_info->dma_handle);
7490 buf_info->virt = 0;
7491 buf_info->phys = 0;
7492 buf_info->dma_handle = 0;
7493 buf_info->data_handle = 0;
7502 ddi_dma_burstsizes(buf_info->
7504 if (ddi_dma_set_sbus64(buf_info->dma_handle,
7513 buf_info->phys = dma_cookie.dmac_laddress;
7516 EMLXS_MPDATA_SYNC((ddi_dma_handle_t)buf_info->dma_handle,
7517 (off_t)0, (size_t)buf_info->size, DDI_DMA_SYNC_FORDEV);
7521 buf_info->virt =
7522 (uint32_t *)kmem_zalloc((size_t)buf_info->size,
7524 buf_info->phys = 0;
7525 buf_info->data_handle = 0;
7526 buf_info->dma_handle = 0;
7528 if (buf_info->virt == (uint32_t *)0) {
7530 "size=%x flags=%x", buf_info->size,
7531 buf_info->flags);
7538 return ((uint8_t *)buf_info->virt);
7549 * The buf_info->flags field describes the memory operation requested.
7553 * buf_info->phys
7557 * buf_info->phys. The virtual address to be freed is in buf_info->virt
7561 emlxs_mem_free(emlxs_hba_t *hba, MBUF_INFO *buf_info)
7563 if (buf_info->flags & FC_MBUF_PHYSONLY) {
7565 if (buf_info->dma_handle) {
7566 (void) ddi_dma_unbind_handle(buf_info->dma_handle);
7568 (ddi_dma_handle_t *)&buf_info->dma_handle);
7569 buf_info->dma_handle = NULL;
7572 } else if (buf_info->flags & (FC_MBUF_DMA|FC_MBUF_DMA32)) {
7574 if (buf_info->dma_handle) {
7575 (void) ddi_dma_unbind_handle(buf_info->dma_handle);
7577 (ddi_acc_handle_t *)&buf_info->data_handle);
7579 (ddi_dma_handle_t *)&buf_info->dma_handle);
7580 buf_info->dma_handle = NULL;
7581 buf_info->data_handle = NULL;
7586 if (buf_info->virt) {
7587 kmem_free(buf_info->virt, (size_t)buf_info->size);
7588 buf_info->virt = NULL;