Lines Matching defs:hp

930 	struct bofi_shadow *hp;
1505 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext) {
1506 if (!driver_under_test(hp->dip))
1508 if (ddi_name_to_major(ddi_get_name(hp->dip)) !=
1511 if (hp->instance != get_handles.instance)
1518 " %s %d %s ", hp->name, hp->instance,
1519 (hp->type == BOFI_INT_HDL) ? "INTR" :
1520 (hp->type == BOFI_ACC_HDL) ? "PIO" :
1521 (hp->type == BOFI_DMA_HDL) ? "DMA" :
1522 (hp->hparrayp != NULL) ? "DVMA" : "DMA*");
1524 if (hp->type == BOFI_ACC_HDL) {
1525 if (hp->len == INT_MAX - hp->offset)
1529 hp->rnumber, hp->offset);
1535 hp->rnumber, hp->offset,
1536 hp->len);
1537 } else if (hp->type == BOFI_DMA_HDL)
1541 " addr 0x%p\n", hp->rnumber,
1542 hp->len, (void *)hp->addr);
1543 else if (hp->type == BOFI_NULL &&
1544 hp->hparrayp == NULL)
1547 "handle no %d\n", hp->rnumber);
1621 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext) {
1622 if (!driver_under_test(hp->dip) ||
1623 ddi_name_to_major(ddi_get_name(hp->dip)) !=
1629 hdlip->instance = hp->instance;
1630 hdlip->rnumber = hp->rnumber;
1631 switch (hp->type) {
1634 hdlip->offset = hp->offset;
1635 hdlip->len = hp->len;
1639 if (hp->flags & DDI_DMA_WRITE)
1642 if (hp->flags & DDI_DMA_READ)
1645 hdlip->len = hp->len;
1647 (uint64_t)(uintptr_t)hp->addr;
1736 struct bofi_shadow *hp;
1778 for (hp = shadow_list.next; hp != &shadow_list; hp = hp->next) {
1779 if (ddi_name_to_major(hp->name) == ddi_name_to_major(namep) &&
1780 hp->instance == errdefp->instance &&
1783 hp->rnumber == ep->errdef.rnumber) &&
1784 hp->type == BOFI_DMA_HDL &&
1785 (((uintptr_t)(hp->addr + ep->errdef.offset +
1787 ((uintptr_t)((hp->addr + ep->errdef.offset) +
1790 hp->type == BOFI_INT_HDL) ||
1792 hp->type == BOFI_ACC_HDL &&
1794 hp->rnumber == errdefp->rnumber) &&
1796 hp->offset < errdefp->offset + errdefp->len) &&
1797 hp->offset + hp->len > errdefp->offset))) {
1802 lp->link = hp->link;
1803 hp->link = lp;
1824 struct bofi_shadow *hp;
1861 for (hp = shadow_list.next; hp != &shadow_list; hp = hp->next) {
1863 for (lp = hp->link; lp != NULL; ) {
1868 hp->link = lp->link;
2293 do_dma_corrupt(struct bofi_shadow *hp, struct bofi_errent *ep,
2322 logaddr = (caddr_t)((uintptr_t)(hp->addr +
2325 log_acc_event(ep, atype, logaddr - hp->addr,
2342 * Make sure endaddr isn't greater than hp->addr + hp->len.
2346 addr = (uint64_t *)((uintptr_t)((hp->addr +
2348 endaddr = (uint64_t *)((uintptr_t)(hp->addr + min(hp->len,
2352 hdlp = (ddi_dma_impl_t *)(hp->hdl.dma_handle);
2361 ddi_fm_ereport_post(hp->dip, buf, ena,
2407 do_pior_corrupt(struct bofi_shadow *hp, caddr_t addr,
2424 for (lp = hp->link; lp != NULL; lp = lp->link) {
2427 minlen = hp->len;
2429 minlen = min(hp->len, ep->errdef.len);
2430 base = addr - hp->addr - ep->errdef.offset + hp->offset;
2441 gv = get_val = func(hp, addr);
2445 addr - hp->addr,
2465 gv = get_val = func(hp, addr);
2470 addr - hp->addr,
2473 hdlp = (ddi_acc_impl_t *)(hp->hdl.acc_handle);
2483 ddi_fm_ereport_post(hp->dip, buf, ena,
2509 return (func(hp, addr));
2525 do_piow_corrupt(struct bofi_shadow *hp, caddr_t addr, uint64_t *valuep,
2540 for (lp = hp->link; lp != NULL; lp = lp->link) {
2543 minlen = hp->len;
2545 minlen = min(hp->len, ep->errdef.len);
2546 base = (caddr_t)addr - hp->addr - ep->errdef.offset +hp->offset;
2558 addr - hp->addr, size,
2565 addr - hp->addr, size,
2572 hdlp = (ddi_acc_impl_t *)(hp->hdl.acc_handle);
2582 ddi_fm_ereport_post(hp->dip, buf, ena,
2617 do_bofi_rd8(struct bofi_shadow *hp, caddr_t addr)
2619 return (hp->save.acc.ahi_get8(&hp->save.acc, (uint8_t *)addr));
2624 addr = (type *)((uintptr_t)addr - 64 + hp->addr); \
2625 if (bofi_range_check && ((caddr_t)addr < hp->addr || \
2626 (caddr_t)addr - hp->addr >= hp->len)) { \
2629 (void *)addr, (void *)hp->addr, hp->len); \
2639 struct bofi_shadow *hp;
2642 hp = handle->ahi_common.ah_bus_private;
2644 if (!hp->link || !mutex_tryenter(&bofi_mutex))
2645 return (hp->save.acc.ahi_get8(&hp->save.acc, addr));
2646 retval = (uint8_t)do_pior_corrupt(hp, (caddr_t)addr, do_bofi_rd8, 1,
2654 do_bofi_rd16(struct bofi_shadow *hp, caddr_t addr)
2656 return (hp->save.acc.ahi_get16(&hp->save.acc, (uint16_t *)addr));
2666 struct bofi_shadow *hp;
2669 hp = handle->ahi_common.ah_bus_private;
2671 if (!hp->link || !mutex_tryenter(&bofi_mutex))
2672 return (hp->save.acc.ahi_get16(&hp->save.acc, addr));
2673 retval = (uint16_t)do_pior_corrupt(hp, (caddr_t)addr, do_bofi_rd16, 1,
2681 do_bofi_rd32(struct bofi_shadow *hp, caddr_t addr)
2683 return (hp->save.acc.ahi_get32(&hp->save.acc, (uint32_t *)addr));
2693 struct bofi_shadow *hp;
2696 hp = handle->ahi_common.ah_bus_private;
2698 if (!hp->link || !mutex_tryenter(&bofi_mutex))
2699 return (hp->save.acc.ahi_get32(&hp->save.acc, addr));
2700 retval = (uint32_t)do_pior_corrupt(hp, (caddr_t)addr, do_bofi_rd32, 1,
2708 do_bofi_rd64(struct bofi_shadow *hp, caddr_t addr)
2710 return (hp->save.acc.ahi_get64(&hp->save.acc, (uint64_t *)addr));
2720 struct bofi_shadow *hp;
2723 hp = handle->ahi_common.ah_bus_private;
2725 if (!hp->link || !mutex_tryenter(&bofi_mutex))
2726 return (hp->save.acc.ahi_get64(&hp->save.acc, addr));
2727 retval = (uint64_t)do_pior_corrupt(hp, (caddr_t)addr, do_bofi_rd64, 1,
2735 addr = (type *)((uintptr_t)addr - 64 + hp->addr); \
2736 if (bofi_range_check && ((caddr_t)addr < hp->addr || \
2737 (caddr_t)addr - hp->addr >= hp->len)) { \
2740 (void *)addr, (void *)hp->addr, hp->len); \
2750 struct bofi_shadow *hp;
2753 hp = handle->ahi_common.ah_bus_private;
2755 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
2756 hp->save.acc.ahi_put8(&hp->save.acc, addr, (uint8_t)llvalue);
2759 if (do_piow_corrupt(hp, (caddr_t)addr, &llvalue, 1, 1))
2760 hp->save.acc.ahi_put8(&hp->save.acc, addr, (uint8_t)llvalue);
2771 struct bofi_shadow *hp;
2774 hp = handle->ahi_common.ah_bus_private;
2776 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
2777 hp->save.acc.ahi_put16(&hp->save.acc, addr, (uint16_t)llvalue);
2780 if (do_piow_corrupt(hp, (caddr_t)addr, &llvalue, 2, 1))
2781 hp->save.acc.ahi_put16(&hp->save.acc, addr, (uint16_t)llvalue);
2792 struct bofi_shadow *hp;
2795 hp = handle->ahi_common.ah_bus_private;
2797 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
2798 hp->save.acc.ahi_put32(&hp->save.acc, addr, (uint32_t)llvalue);
2801 if (do_piow_corrupt(hp, (caddr_t)addr, &llvalue, 4, 1))
2802 hp->save.acc.ahi_put32(&hp->save.acc, addr, (uint32_t)llvalue);
2813 struct bofi_shadow *hp;
2816 hp = handle->ahi_common.ah_bus_private;
2818 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
2819 hp->save.acc.ahi_put64(&hp->save.acc, addr, (uint64_t)llvalue);
2822 if (do_piow_corrupt(hp, (caddr_t)addr, &llvalue, 8, 1))
2823 hp->save.acc.ahi_put64(&hp->save.acc, addr, (uint64_t)llvalue);
2829 dev_addr = (type *)((uintptr_t)dev_addr - 64 + hp->addr); \
2830 if (bofi_range_check && ((caddr_t)dev_addr < hp->addr || \
2831 (caddr_t)(dev_addr + repcount) - hp->addr > hp->len)) { \
2834 (void *)dev_addr, (void *)hp->addr, hp->len); \
2835 if ((caddr_t)dev_addr < hp->addr || \
2836 (caddr_t)dev_addr - hp->addr >= hp->len) \
2838 repcount = (type *)(hp->addr + hp->len) - dev_addr; \
2848 struct bofi_shadow *hp;
2852 hp = handle->ahi_common.ah_bus_private;
2854 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
2855 hp->save.acc.ahi_rep_get8(&hp->save.acc, host_addr, dev_addr,
2861 *(host_addr + i) = (uint8_t)do_pior_corrupt(hp, (caddr_t)addr,
2875 struct bofi_shadow *hp;
2879 hp = handle->ahi_common.ah_bus_private;
2881 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
2882 hp->save.acc.ahi_rep_get16(&hp->save.acc, host_addr, dev_addr,
2888 *(host_addr + i) = (uint16_t)do_pior_corrupt(hp, (caddr_t)addr,
2902 struct bofi_shadow *hp;
2906 hp = handle->ahi_common.ah_bus_private;
2908 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
2909 hp->save.acc.ahi_rep_get32(&hp->save.acc, host_addr, dev_addr,
2915 *(host_addr + i) = (uint32_t)do_pior_corrupt(hp, (caddr_t)addr,
2929 struct bofi_shadow *hp;
2933 hp = handle->ahi_common.ah_bus_private;
2935 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
2936 hp->save.acc.ahi_rep_get64(&hp->save.acc, host_addr, dev_addr,
2942 *(host_addr + i) = (uint64_t)do_pior_corrupt(hp, (caddr_t)addr,
2950 dev_addr = (type *)((uintptr_t)dev_addr - 64 + hp->addr); \
2951 if (bofi_range_check && ((caddr_t)dev_addr < hp->addr || \
2952 (caddr_t)(dev_addr + repcount) - hp->addr > hp->len)) { \
2955 (void *)dev_addr, (void *)hp->addr, hp->len); \
2956 if ((caddr_t)dev_addr < hp->addr || \
2957 (caddr_t)dev_addr - hp->addr >= hp->len) \
2959 repcount = (type *)(hp->addr + hp->len) - dev_addr; \
2969 struct bofi_shadow *hp;
2974 hp = handle->ahi_common.ah_bus_private;
2976 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
2977 hp->save.acc.ahi_rep_put8(&hp->save.acc, host_addr, dev_addr,
2984 if (do_piow_corrupt(hp, (caddr_t)addr, &llvalue, 1, i ? 0 :
2986 hp->save.acc.ahi_put8(&hp->save.acc, addr,
3000 struct bofi_shadow *hp;
3005 hp = handle->ahi_common.ah_bus_private;
3007 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
3008 hp->save.acc.ahi_rep_put16(&hp->save.acc, host_addr, dev_addr,
3015 if (do_piow_corrupt(hp, (caddr_t)addr, &llvalue, 2, i ? 0 :
3017 hp->save.acc.ahi_put16(&hp->save.acc, addr,
3031 struct bofi_shadow *hp;
3036 hp = handle->ahi_common.ah_bus_private;
3038 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
3039 hp->save.acc.ahi_rep_put32(&hp->save.acc, host_addr, dev_addr,
3046 if (do_piow_corrupt(hp, (caddr_t)addr, &llvalue, 4, i ? 0 :
3048 hp->save.acc.ahi_put32(&hp->save.acc, addr,
3062 struct bofi_shadow *hp;
3067 hp = handle->ahi_common.ah_bus_private;
3069 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
3070 hp->save.acc.ahi_rep_put64(&hp->save.acc, host_addr, dev_addr,
3077 if (do_piow_corrupt(hp, (caddr_t)addr, &llvalue, 8, i ? 0 :
3079 hp->save.acc.ahi_put64(&hp->save.acc, addr,
3094 struct bofi_shadow *hp;
3124 hp = kmem_zalloc(sizeof (struct bofi_shadow), KM_SLEEP);
3125 (void) strncpy(hp->name, ddi_get_name(ap->ahi_common.ah_dip),
3127 hp->instance = ddi_get_instance(ap->ahi_common.ah_dip);
3128 hp->dip = ap->ahi_common.ah_dip;
3129 hp->addr = *vaddrp;
3135 hp->rnumber = ((ddi_acc_hdl_t *)ap)->ah_rnumber;
3136 hp->offset = offset;
3138 hp->len = INT_MAX - offset;
3140 hp->len = min(len, INT_MAX - offset);
3141 hp->hdl.acc_handle = (ddi_acc_handle_t)ap;
3142 hp->link = NULL;
3143 hp->type = BOFI_ACC_HDL;
3147 hp->save.acc = *ap;
3172 ap->ahi_common.ah_bus_private = hp;
3178 hp->next = shadow_list.next;
3179 shadow_list.next->prev = hp;
3180 hp->prev = &shadow_list;
3181 shadow_list.next = hp;
3183 hp->hnext = hhashp->hnext;
3184 hhashp->hnext->hprev = hp;
3185 hp->hprev = hhashp;
3186 hhashp->hnext = hp;
3187 dhashp = HDL_DHASH(hp->dip);
3188 hp->dnext = dhashp->dnext;
3189 dhashp->dnext->dprev = hp;
3190 hp->dprev = dhashp;
3191 dhashp->dnext = hp;
3197 if (ddi_name_to_major(hp->name) ==
3199 hp->instance == ep->errdef.instance &&
3202 hp->rnumber == ep->errdef.rnumber) &&
3205 offset + hp->len > ep->errdef.offset) {
3210 lp->link = hp->link;
3211 hp->link = lp;
3230 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext)
3231 if (hp->hdl.acc_handle == (ddi_acc_handle_t)ap)
3233 if (hp == hhashp) {
3241 *ap = hp->save.acc;
3242 *vaddrp = hp->addr;
3246 hp->hnext->hprev = hp->hprev;
3247 hp->hprev->hnext = hp->hnext;
3248 hp->dnext->dprev = hp->dprev;
3249 hp->dprev->dnext = hp->dnext;
3250 hp->next->prev = hp->prev;
3251 hp->prev->next = hp->next;
3255 for (lp = hp->link; lp != NULL; ) {
3261 hp->link = NULL;
3267 kmem_free(hp, sizeof (struct bofi_shadow));
3281 chain_on_errdefs(struct bofi_shadow *hp)
3291 if (ddi_name_to_major(hp->name) ==
3293 hp->instance == ep->errdef.instance &&
3295 hp->rnumber == ep->errdef.rnumber) &&
3297 (((uintptr_t)(hp->addr + ep->errdef.offset +
3299 ((uintptr_t)((hp->addr + ep->errdef.offset) +
3308 lp->link = hp->link;
3309 hp->link = lp;
3311 (hp->flags & DDI_DMA_WRITE) &&
3313 do_dma_corrupt(hp, ep,
3315 0, hp->len);
3345 struct bofi_shadow *hp, *xhp;
3361 hp = kmem_zalloc(sizeof (struct bofi_shadow),
3363 if (hp == NULL) {
3371 (void) strncpy(hp->name, ddi_get_name(rdip), NAMESIZE);
3372 hp->instance = ddi_get_instance(rdip);
3373 hp->dip = rdip;
3374 hp->link = NULL;
3375 hp->type = BOFI_NULL;
3382 kmem_free(hp, sizeof (struct bofi_shadow));
3388 hp->hdl.dma_handle = *handlep;
3408 dhashp = HDL_DHASH(hp->dip);
3411 ddi_name_to_major(hp->name) &&
3412 xhp->instance == hp->instance &&
3421 hp->rnumber = maxrnumber;
3425 hp->next = shadow_list.next;
3426 shadow_list.next->prev = hp;
3427 hp->prev = &shadow_list;
3428 shadow_list.next = hp;
3430 hp->hnext = hhashp->hnext;
3431 hhashp->hnext->hprev = hp;
3432 hp->hprev = hhashp;
3433 hhashp->hnext = hp;
3434 dhashp = HDL_DHASH(hp->dip);
3435 hp->dnext = dhashp->dnext;
3436 dhashp->dnext->dprev = hp;
3437 hp->dprev = dhashp;
3438 dhashp->dnext = hp;
3452 struct bofi_shadow *hp;
3461 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext)
3462 if (hp->hdl.dma_handle == handle)
3476 if (hp == hhashp)
3483 if (hp->type != BOFI_NULL)
3488 hp->hnext->hprev = hp->hprev;
3489 hp->hprev->hnext = hp->hnext;
3490 hp->dnext->dprev = hp->dprev;
3491 hp->dprev->dnext = hp->dnext;
3492 hp->next->prev = hp->prev;
3493 hp->prev->next = hp->next;
3497 kmem_free(hp, sizeof (struct bofi_shadow));
3512 struct bofi_shadow *hp;
3523 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext)
3524 if (hp->hdl.dma_handle == handle)
3528 if (hp == hhashp) {
3538 if (hp->type != BOFI_NULL)
3541 hp->flags = dmareqp->dmar_flags;
3543 hp->map_flags = B_PAGEIO;
3544 hp->map_pp = dmareqp->dmar_object.dmao_obj.pp_obj.pp_pp;
3546 hp->map_flags = B_SHADOW;
3547 hp->map_pplist = dmareqp->dmar_object.dmao_obj.virt_obj.v_priv;
3549 hp->map_flags = 0;
3554 hp->addr = ddi_dmareq_mapin(dmareqp, &hp->mapaddr, &hp->len);
3555 if (hp->addr == NULL)
3565 hp->origaddr = hp->addr;
3566 hp->allocaddr = ddi_umem_alloc(
3567 ((uintptr_t)hp->addr & pagemask) + hp->len,
3569 &hp->umem_cookie);
3570 if (hp->allocaddr == NULL)
3572 hp->addr = hp->allocaddr + ((uintptr_t)hp->addr & pagemask);
3574 xbcopy(hp->origaddr, hp->addr, hp->len);
3576 dmareq.dmar_object.dmao_size = hp->len;
3579 dmareq.dmar_object.dmao_obj.virt_obj.v_addr = hp->addr;
3602 hp->type = BOFI_DMA_HDL;
3603 chain_on_errdefs(hp);
3617 if (hp) {
3618 ddi_dmareq_mapout(hp->mapaddr, hp->len, hp->map_flags,
3619 hp->map_pp, hp->map_pplist);
3620 if (bofi_sync_check && hp->allocaddr)
3621 ddi_umem_free(hp->umem_cookie);
3622 hp->mapaddr = NULL;
3623 hp->allocaddr = NULL;
3624 hp->origaddr = NULL;
3639 struct bofi_shadow *hp;
3654 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext)
3655 if (hp->hdl.dma_handle == handle)
3657 if (hp == hhashp) {
3665 if (hp->type == BOFI_NULL)
3671 for (lp = hp->link; lp != NULL; ) {
3679 (hp->flags & DDI_DMA_READ) &&
3681 do_dma_corrupt(hp, ep, DDI_DMA_SYNC_FORCPU, 0, hp->len);
3687 hp->link = NULL;
3688 hp->type = BOFI_NULL;
3692 if (bofi_sync_check && (hp->flags & DDI_DMA_READ))
3696 if (hp->allocaddr)
3697 xbcopy(hp->addr, hp->origaddr, hp->len);
3698 ddi_dmareq_mapout(hp->mapaddr, hp->len, hp->map_flags,
3699 hp->map_pp, hp->map_pplist);
3700 if (bofi_sync_check && hp->allocaddr)
3701 ddi_umem_free(hp->umem_cookie);
3702 hp->mapaddr = NULL;
3703 hp->allocaddr = NULL;
3704 hp->origaddr = NULL;
3718 struct bofi_shadow *hp;
3737 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext)
3738 if (hp->hdl.dma_handle == handle &&
3739 hp->type == BOFI_DMA_HDL)
3743 if (hp != hhashp) {
3748 if (hp->allocaddr)
3749 xbcopy(hp->origaddr+off, hp->addr+off,
3750 len ? len : (hp->len - off));
3756 for (lp = hp->link; lp != NULL; lp = lp->link) {
3764 do_dma_corrupt(hp, ep, flags, off,
3765 len ? len : (hp->len - off));
3775 if (hp->allocaddr)
3776 xbcopy(hp->addr+off, hp->origaddr+off,
3777 len ? len : (hp->len - off));
3797 struct bofi_shadow *hp;
3815 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext)
3816 if (hp->hdl.dma_handle == handle)
3818 if (hp != hhashp) {
3839 struct bofi_shadow *hp;
3874 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext)
3875 if (hp->hdl.dma_handle == handle)
3877 if (hp == hhashp) {
3890 dummyhp = hp;
3896 hp = dummyhp->hparrayp[i];
3900 if (hp->type != BOFI_NULL)
3907 hp->dnext->dprev = hp->dprev;
3908 hp->dprev->dnext = hp->dnext;
3909 hp->next->prev = hp->prev;
3910 hp->prev->next = hp->next;
3914 if (bofi_sync_check && hp->allocaddr)
3915 ddi_umem_free(hp->umem_cookie);
3916 kmem_free(hp, sizeof (struct bofi_shadow));
3937 struct bofi_shadow *hp;
3981 hp = kmem_zalloc(sizeof (*hp), KM_SLEEP);
3982 (void) strncpy(hp->name, ddi_get_name(rdip), NAMESIZE);
3983 hp->instance = ddi_get_instance(rdip);
3984 hp->rnumber = -1;
3985 hp->dip = rdip;
3986 hp->hdl.dma_handle = 0;
3987 hp->link = NULL;
3988 hp->type = BOFI_NULL;
3992 * Take a copy and set this to be hp->addr
3999 hp->allocaddr = ddi_umem_alloc(
4000 ((int)(uintptr_t)hp->addr & pagemask)
4002 KM_SLEEP, &hp->umem_cookie);
4003 hp->addr = hp->allocaddr +
4004 ((int)(uintptr_t)hp->addr & pagemask);
4012 hp->next = shadow_list.next;
4013 shadow_list.next->prev = hp;
4014 hp->prev = &shadow_list;
4015 shadow_list.next = hp;
4016 dhashp = HDL_DHASH(hp->dip);
4017 hp->dnext = dhashp->dnext;
4018 dhashp->dnext->dprev = hp;
4019 hp->dprev = dhashp;
4020 dhashp->dnext = hp;
4021 dummyhp->hparrayp[i] = hp;
4047 struct bofi_shadow *hp;
4072 * find real hp
4074 hp = dummyhp->hparrayp[index];
4078 if (hp->type != BOFI_NULL)
4082 * nexus to map hp->addr again
4083 * if not, set hp->addr to new address.
4086 if (bofi_sync_check && hp->allocaddr) {
4087 hp->origaddr = a;
4088 a = hp->addr;
4090 hp->addr = a;
4091 hp->len = len;
4102 hp->type = BOFI_DMA_HDL;
4104 if (ddi_name_to_major(hp->name) ==
4106 hp->instance == ep->errdef.instance &&
4108 hp->rnumber == ep->errdef.rnumber) &&
4110 (((uintptr_t)(hp->addr + ep->errdef.offset +
4112 ((uintptr_t)((hp->addr + ep->errdef.offset) +
4118 lp->link = hp->link;
4119 hp->link = lp;
4136 struct bofi_shadow *hp;
4159 * find real hp
4161 hp = dummyhp->hparrayp[index];
4165 if (hp->type == BOFI_NULL)
4173 for (lp = hp->link; lp != NULL; ) {
4180 do_dma_corrupt(hp, ep, view, 0, hp->len);
4186 hp->link = NULL;
4187 hp->type = BOFI_NULL;
4195 if (hp->allocaddr)
4196 xbcopy(hp->addr, hp->origaddr, hp->len);
4207 struct bofi_shadow *hp;
4230 * find real hp
4232 hp = dummyhp->hparrayp[index];
4236 if (hp->type == BOFI_NULL)
4247 if (hp->allocaddr)
4248 xbcopy(hp->origaddr, hp->addr, hp->len);
4255 for (lp = hp->link; lp != NULL; lp = lp->link) {
4263 do_dma_corrupt(hp, ep, view, 0, hp->len);
4273 if (hp->allocaddr)
4274 xbcopy(hp->addr, hp->origaddr, hp->len);
4292 struct bofi_shadow *hp;
4300 hp = (struct bofi_shadow *)xp;
4304 if (hp->link == NULL)
4305 return (hp->save.intr.int_handler
4306 (hp->save.intr.int_handler_arg1, arg2));
4311 for (lp = hp->link; lp != NULL; lp = lp->link) {
4333 if (!hp->hilevel) {
4355 result = hp->save.intr.int_handler
4356 (hp->save.intr.int_handler_arg1, arg2);
4370 hp->name, hp->instance);
4385 struct bofi_shadow *hp;
4389 hp = handle->ahi_common.ah_bus_private;
4390 if (!hp->link || !mutex_tryenter(&bofi_mutex)) {
4393 for (lp = hp->link; lp != NULL; lp = lp->link) {
4414 struct bofi_shadow *hp;
4423 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext)
4424 if (hp->hdl.dma_handle == (ddi_dma_handle_t)handle)
4426 if (hp == hhashp) {
4430 if (!hp->link) {
4434 for (lp = hp->link; lp != NULL; lp = lp->link) {
4457 struct bofi_shadow *hp;
4476 for (hp = dhashp->dnext; hp != dhashp; hp = hp->dnext) {
4477 if (hp->dip == arg->f_dip) {
4478 for (lp = hp->link; lp != NULL; lp = lp->link) {
4508 struct bofi_shadow *hp;
4529 for (hp = shadow_list.next; hp != &shadow_list; hp = hp->next) {
4530 (void) ddi_pathname(hp->dip, hppath);
4533 for (lp = hp->link; lp != NULL; lp = lp->link) {
4578 struct bofi_shadow *hp;
4595 hp = kmem_zalloc(sizeof (struct bofi_shadow), KM_SLEEP);
4596 (void) strncpy(hp->name, ddi_get_name(rdip), NAMESIZE);
4597 hp->instance = ddi_get_instance(rdip);
4598 hp->save.intr.int_handler = hdlp->ih_cb_func;
4599 hp->save.intr.int_handler_arg1 = hdlp->ih_cb_arg1;
4601 hdlp->ih_cb_arg1 = (caddr_t)hp;
4602 hp->bofi_inum = hdlp->ih_inum;
4603 hp->dip = rdip;
4604 hp->link = NULL;
4605 hp->type = BOFI_INT_HDL;
4611 hp->hilevel = 1;
4613 hp->hilevel = 0;
4622 kmem_free(hp, sizeof (struct bofi_shadow));
4630 hp->next = shadow_list.next;
4631 shadow_list.next->prev = hp;
4632 hp->prev = &shadow_list;
4633 shadow_list.next = hp;
4635 hp->hnext = hhashp->hnext;
4636 hhashp->hnext->hprev = hp;
4637 hp->hprev = hhashp;
4638 hhashp->hnext = hp;
4639 dhashp = HDL_DHASH(hp->dip);
4640 hp->dnext = dhashp->dnext;
4641 dhashp->dnext->dprev = hp;
4642 hp->dprev = dhashp;
4643 dhashp->dnext = hp;
4649 if (ddi_name_to_major(hp->name) ==
4651 hp->instance == ep->errdef.instance &&
4657 lp->link = hp->link;
4658 hp->link = lp;
4677 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext) {
4678 if (hp->dip == rdip &&
4679 hp->type == BOFI_INT_HDL &&
4680 hp->bofi_inum == hdlp->ih_inum) {
4684 if (hp == hhashp) {
4692 hp->hnext->hprev = hp->hprev;
4693 hp->hprev->hnext = hp->hnext;
4694 hp->dnext->dprev = hp->dprev;
4695 hp->dprev->dnext = hp->dnext;
4696 hp->next->prev = hp->prev;
4697 hp->prev->next = hp->next;
4702 for (lp = hp->link; lp != NULL; ) {
4708 hp->link = NULL;
4711 kmem_free(hp, sizeof (struct bofi_shadow));