Lines Matching refs:buf

61 static int e1000g_dma_mem_alloc_82546(dma_buffer_t *buf,
779 dma_buffer_t *buf, size_t size)
793 &buf->dma_handle);
796 buf->dma_handle = NULL;
802 buf->address = kmem_alloc(size, KM_NOSLEEP);
804 if (buf->address == NULL) {
805 if (buf->dma_handle != NULL) {
806 dvma_release(buf->dma_handle);
807 buf->dma_handle = NULL;
814 dvma_kaddr_load(buf->dma_handle,
815 buf->address, size, 0, &cookie);
817 buf->dma_address = cookie.dmac_laddress;
818 buf->size = size;
819 buf->len = 0;
825 e1000g_free_dvma_buffer(dma_buffer_t *buf)
827 if (buf->dma_handle != NULL) {
828 dvma_unload(buf->dma_handle, 0, -1);
833 buf->dma_address = NULL;
835 if (buf->address != NULL) {
836 kmem_free(buf->address, buf->size);
837 buf->address = NULL;
840 if (buf->dma_handle != NULL) {
841 dvma_release(buf->dma_handle);
842 buf->dma_handle = NULL;
845 buf->size = 0;
846 buf->len = 0;
852 dma_buffer_t *buf, size_t size, ddi_dma_attr_t *p_dma_attr)
868 &buf->dma_handle);
871 buf->dma_handle = NULL;
877 mystat = ddi_dma_mem_alloc(buf->dma_handle,
880 &buf->address,
881 &len, &buf->acc_handle);
884 buf->acc_handle = NULL;
885 buf->address = NULL;
886 if (buf->dma_handle != NULL) {
887 ddi_dma_free_handle(&buf->dma_handle);
888 buf->dma_handle = NULL;
895 mystat = ddi_dma_addr_bind_handle(buf->dma_handle,
897 buf->address,
902 if (buf->acc_handle != NULL) {
903 ddi_dma_mem_free(&buf->acc_handle);
904 buf->acc_handle = NULL;
905 buf->address = NULL;
907 if (buf->dma_handle != NULL) {
908 ddi_dma_free_handle(&buf->dma_handle);
909 buf->dma_handle = NULL;
918 if (buf->dma_handle != NULL) {
919 (void) ddi_dma_unbind_handle(buf->dma_handle);
921 if (buf->acc_handle != NULL) {
922 ddi_dma_mem_free(&buf->acc_handle);
923 buf->acc_handle = NULL;
924 buf->address = NULL;
926 if (buf->dma_handle != NULL) {
927 ddi_dma_free_handle(&buf->dma_handle);
928 buf->dma_handle = NULL;
936 buf->dma_address = cookie.dmac_laddress;
937 buf->size = len;
938 buf->len = 0;
950 dma_buffer_t *buf, size_t size, ddi_dma_attr_t *p_dma_attr)
966 &buf->dma_handle);
969 buf->dma_handle = NULL;
975 mystat = e1000g_dma_mem_alloc_82546(buf, size, &len);
977 buf->acc_handle = NULL;
978 buf->address = NULL;
979 if (buf->dma_handle != NULL) {
980 ddi_dma_free_handle(&buf->dma_handle);
981 buf->dma_handle = NULL;
988 mystat = ddi_dma_addr_bind_handle(buf->dma_handle,
990 buf->address,
995 if (buf->acc_handle != NULL) {
996 ddi_dma_mem_free(&buf->acc_handle);
997 buf->acc_handle = NULL;
998 buf->address = NULL;
1000 if (buf->dma_handle != NULL) {
1001 ddi_dma_free_handle(&buf->dma_handle);
1002 buf->dma_handle = NULL;
1011 if (buf->dma_handle != NULL) {
1012 (void) ddi_dma_unbind_handle(buf->dma_handle);
1014 if (buf->acc_handle != NULL) {
1015 ddi_dma_mem_free(&buf->acc_handle);
1016 buf->acc_handle = NULL;
1017 buf->address = NULL;
1019 if (buf->dma_handle != NULL) {
1020 ddi_dma_free_handle(&buf->dma_handle);
1021 buf->dma_handle = NULL;
1029 buf->dma_address = cookie.dmac_laddress;
1030 buf->size = len;
1031 buf->len = 0;
1041 e1000g_dma_mem_alloc_82546(dma_buffer_t *buf, size_t size, size_t *len)
1052 stat = ddi_dma_mem_alloc(buf->dma_handle, size,
1054 0, &buf->address, len, &buf->acc_handle);
1065 if (e1000g_cross_64k_bound(buf->address, *len)) {
1066 hold[cnt] = buf->acc_handle;
1098 e1000g_free_dma_buffer(dma_buffer_t *buf)
1100 if (buf->dma_handle != NULL) {
1101 (void) ddi_dma_unbind_handle(buf->dma_handle);
1106 buf->dma_address = NULL;
1108 if (buf->acc_handle != NULL) {
1109 ddi_dma_mem_free(&buf->acc_handle);
1110 buf->acc_handle = NULL;
1111 buf->address = NULL;
1114 if (buf->dma_handle != NULL) {
1115 ddi_dma_free_handle(&buf->dma_handle);
1116 buf->dma_handle = NULL;
1119 buf->size = 0;
1120 buf->len = 0;