Lines Matching refs:shp

276 	sdhost_t		*shp;
297 shp = kmem_zalloc(sizeof (*shp), KM_SLEEP);
298 ddi_set_driver_private(dip, shp);
304 shp->sh_slots[i].ss_num = -1;
311 shp->sh_dmaattr.dma_attr_version = DMA_ATTR_V0;
312 shp->sh_dmaattr.dma_attr_addr_lo = 0;
313 shp->sh_dmaattr.dma_attr_addr_hi = 0xffffffffU;
314 shp->sh_dmaattr.dma_attr_count_max = 0xffffffffU;
315 shp->sh_dmaattr.dma_attr_align = 4096; /* Ricoh needs it */
316 shp->sh_dmaattr.dma_attr_burstsizes = 0; /* for now! */
317 shp->sh_dmaattr.dma_attr_minxfer = 1;
318 shp->sh_dmaattr.dma_attr_maxxfer = 0x7ffffU;
319 shp->sh_dmaattr.dma_attr_sgllen = 1; /* no scatter/gather */
320 shp->sh_dmaattr.dma_attr_seg = 0x7ffffU; /* not to cross 512K */
321 shp->sh_dmaattr.dma_attr_granular = 1;
322 shp->sh_dmaattr.dma_attr_flags = 0;
333 shp->sh_numslots = SLOTINFO_NSLOT(slotinfo);
335 if (shp->sh_numslots > SDHOST_MAXSLOTS) {
337 shp->sh_numslots);
364 if (sdhost_setup_intr(dip, shp) != DDI_SUCCESS) {
369 shp->sh_host = sda_host_alloc(dip, shp->sh_numslots, &sdhost_ops,
371 if (shp->sh_host == NULL) {
380 for (i = 0; i < shp->sh_numslots; i++) {
381 if (sdhost_init_slot(dip, shp, i, bar + i) != DDI_SUCCESS) {
392 if (shp->sh_icap & DDI_INTR_FLAG_BLOCK) {
393 rv = ddi_intr_block_enable(&shp->sh_ihandle, 1);
395 rv = ddi_intr_enable(shp->sh_ihandle);
406 if (sda_host_attach(shp->sh_host) != DDI_SUCCESS) {
408 if (shp->sh_icap & DDI_INTR_FLAG_BLOCK) {
409 (void) ddi_intr_block_disable(&shp->sh_ihandle, 1);
411 (void) ddi_intr_disable(shp->sh_ihandle);
419 if (shp->sh_ihandle != NULL) {
420 (void) ddi_intr_remove_handler(shp->sh_ihandle);
421 (void) ddi_intr_free(shp->sh_ihandle);
423 for (i = 0; i < shp->sh_numslots; i++)
424 sdhost_uninit_slot(shp, i);
425 if (shp->sh_host != NULL)
426 sda_host_free(shp->sh_host);
427 kmem_free(shp, sizeof (*shp));
435 sdhost_t *shp;
449 shp = ddi_get_driver_private(dip);
454 sda_host_detach(shp->sh_host);
459 if (shp->sh_ihandle != NULL) {
460 if (shp->sh_icap & DDI_INTR_FLAG_BLOCK) {
461 (void) ddi_intr_block_disable(&shp->sh_ihandle, 1);
463 (void) ddi_intr_disable(shp->sh_ihandle);
465 (void) ddi_intr_remove_handler(shp->sh_ihandle);
466 (void) ddi_intr_free(shp->sh_ihandle);
472 for (i = 0; i < shp->sh_numslots; i++)
473 sdhost_uninit_slot(shp, i);
474 sda_host_free(shp->sh_host);
475 kmem_free(shp, sizeof (*shp));
483 sdhost_t *shp;
486 shp = ddi_get_driver_private(dip);
489 for (int i = 0; i < shp->sh_numslots; i++) {
490 ss = &shp->sh_slots[i];
502 sdhost_t *shp;
506 shp = ddi_get_driver_private(dip);
508 sda_host_suspend(shp->sh_host);
510 for (i = 0; i < shp->sh_numslots; i++) {
511 ss = &shp->sh_slots[i];
524 sdhost_t *shp;
528 shp = ddi_get_driver_private(dip);
530 for (i = 0; i < shp->sh_numslots; i++) {
531 ss = &shp->sh_slots[i];
539 sda_host_resume(shp->sh_host);
688 sdhost_setup_intr(dev_info_t *dip, sdhost_t *shp)
757 if ((ddi_intr_alloc(dip, &shp->sh_ihandle, itype, 0, 1,
764 if (ddi_intr_get_pri(shp->sh_ihandle, &shp->sh_ipri) !=
767 (void) ddi_intr_free(shp->sh_ihandle);
768 shp->sh_ihandle = NULL;
772 if (shp->sh_ipri >= ddi_intr_get_hilevel_pri()) {
774 (void) ddi_intr_free(shp->sh_ihandle);
775 shp->sh_ihandle = NULL;
779 if (ddi_intr_get_cap(shp->sh_ihandle, &shp->sh_icap) !=
782 (void) ddi_intr_free(shp->sh_ihandle);
783 shp->sh_ihandle = NULL;
787 if (ddi_intr_add_handler(shp->sh_ihandle, sdhost_intr,
788 shp, NULL) != DDI_SUCCESS) {
790 (void) ddi_intr_free(shp->sh_ihandle);
791 shp->sh_ihandle = NULL;
1009 sdhost_t *shp = (void *)arg1;
1014 for (num = 0; num < shp->sh_numslots; num++) {
1015 if (sdhost_slot_intr(&shp->sh_slots[num]) ==
1024 sdhost_init_slot(dev_info_t *dip, sdhost_t *shp, int num, int bar)
1037 ss = &shp->sh_slots[num];
1038 ss->ss_host = shp->sh_host;
1040 sda_host_set_private(shp->sh_host, num, ss);
1045 DDI_INTR_PRI(shp->sh_ipri));
1050 rv = ddi_dma_alloc_handle(dip, &shp->sh_dmaattr,
1219 sdhost_uninit_slot(sdhost_t *shp, int num)
1223 ss = &shp->sh_slots[num];