Lines Matching refs:sbbcsoftp
293 struct sbbcsoft *sbbcsoftp;
311 if (!(sbbcsoftp =
314 "to acquire sbbcsoftp for instance %d",
318 mutex_enter(&sbbcsoftp->umutex);
319 if (!sbbcsoftp->suspended) {
320 mutex_exit(&sbbcsoftp->umutex);
323 sbbcsoftp->suspended = 0;
324 mutex_exit(&sbbcsoftp->umutex);
337 sbbcsoftp = ddi_get_soft_state(sbbcsoft_statep, instance);
339 if (sbbcsoftp == NULL) {
341 "sbbcsoftp for instance %d", instance);
346 sbbcsoftp->instance = instance;
347 sbbcsoftp->dip = dip;
348 sbbcsoftp->oflag = FALSE;
355 if (sbbc_get_ranges(sbbcsoftp)) {
362 if (sbbc_config4pci(sbbcsoftp)) {
365 kmem_free(sbbcsoftp->rangep, sbbcsoftp->range_len);
370 mutex_init(&sbbcsoftp->umutex, NULL, MUTEX_DRIVER, (void *)NULL);
371 mutex_init(&sbbcsoftp->sbbc_intr_mutex, NULL,
375 if (ddi_regs_map_setup(dip, 1, (caddr_t *)&sbbcsoftp->pci_sbbc_map,
378 &sbbcsoftp->pci_sbbc_map_handle) != DDI_SUCCESS) {
385 sbbcsoftp->pci_sbbc_map);
387 sbbc_dump_devid(dip, sbbcsoftp, instance);
393 sbbc_id_reg = ddi_get32(sbbcsoftp->pci_sbbc_map_handle,
394 &sbbcsoftp->pci_sbbc_map->device_conf);
402 if (!sbbc_init(sbbcsoftp)) {
411 if (!sbbc_init(sbbcsoftp)) {
421 sbbc_remove_reg_maps(sbbcsoftp);
422 sbbcsoftp->pci_sbbc_map = NULL;
440 mutex_destroy(&sbbcsoftp->sbbc_intr_mutex);
441 mutex_destroy(&sbbcsoftp->umutex);
443 sbbc_remove_reg_maps(sbbcsoftp);
444 kmem_free(sbbcsoftp->rangep, sbbcsoftp->range_len);
456 struct sbbcsoft *sbbcsoftp;
467 if (!(sbbcsoftp =
471 (void *)sbbcsoftp);
474 mutex_enter(&sbbcsoftp->umutex);
475 if (sbbcsoftp->suspended) {
476 mutex_exit(&sbbcsoftp->umutex);
479 sbbcsoftp->suspended = 1;
480 mutex_exit(&sbbcsoftp->umutex);
487 if (!(sbbcsoftp = ddi_get_soft_state(sbbcsoft_statep, instance))) {
489 (void *)sbbcsoftp);
495 mutex_destroy(&sbbcsoftp->sbbc_intr_mutex);
496 mutex_destroy(&sbbcsoftp->umutex);
498 sbbc_remove_reg_maps(sbbcsoftp);
499 kmem_free(sbbcsoftp->rangep, sbbcsoftp->range_len);
515 struct sbbcsoft *sbbcsoftp;
533 if (!(sbbcsoftp = ddi_get_soft_state(sbbcsoft_statep, instance)))
561 ddi_get_name(sbbcsoftp->dip), instance);
588 rval = sbbc_apply_range(sbbcsoftp, rdip, child_rp, &pci_reg);
671 sbbcsoft_t *sbbcsoftp;
680 if (!(sbbcsoftp = ddi_get_soft_state(sbbcsoft_statep, instance)))
693 if (sbbcsoftp->child_intr[i] == 0) {
694 sbbcsoftp->child_intr[i] = childintr;
701 (caddr_t)sbbcsoftp, NULL);
708 sbbcsoftp->child_intr[i] = NULL;
725 sbbcsoft_t *sbbcsoftp;
733 if (!(sbbcsoftp = ddi_get_soft_state(sbbcsoft_statep, instance)))
738 if (sbbcsoftp->child_intr[i]) {
739 childintr = sbbcsoftp->child_intr[i];
763 sbbcsoftp->child_intr[i] = NULL;
773 sbbcsoft_t *sbbcsoftp;
782 if (!(sbbcsoftp = ddi_get_soft_state(sbbcsoft_statep, instance)))
786 if (sbbcsoftp->child_intr[i]) {
787 childintr = sbbcsoftp->child_intr[i];
946 sbbc_get_ranges(struct sbbcsoft *sbbcsoftp)
951 if (ddi_getlongprop(DDI_DEV_T_ANY, sbbcsoftp->dip, DDI_PROP_DONTPASS,
954 ddi_get_name(sbbcsoftp->dip), sbbcsoftp->instance);
966 sbbcsoftp->rangep = rangep;
967 sbbcsoftp->range_cnt = nrange;
968 sbbcsoftp->range_len = range_len;
978 sbbc_config4pci(struct sbbcsoft *sbbcsoftp)
987 "sbbc_config4pci: sbbcsoftp %p\n", (void *)sbbcsoftp);
990 if (pci_config_setup(sbbcsoftp->dip, &conf_handle) != DDI_SUCCESS)
1029 struct sbbcsoft *sbbcsoftp;
1038 sbbcsoftp = (struct sbbcsoft *)
1040 if (sbbcsoftp == NULL) {
1044 *result = sbbcsoftp->dip;
1064 struct sbbcsoft *sbbcsoftp;
1075 sbbcsoftp = (struct sbbcsoft *)ddi_get_soft_state(sbbcsoft_statep,
1077 SBBCTRACE(sbbc_open, 'OPEN', sbbcsoftp);
1079 if (sbbcsoftp == NULL)
1082 mutex_enter(&sbbcsoftp->umutex);
1085 if ((sbbcsoftp->oflag == TRUE)) {
1086 mutex_exit(&sbbcsoftp->umutex);
1089 sbbcsoftp->oflag = TRUE;
1091 mutex_exit(&sbbcsoftp->umutex);
1100 struct sbbcsoft *sbbcsoftp;
1106 sbbcsoftp = (struct sbbcsoft *)ddi_get_soft_state(sbbcsoft_statep,
1110 mutex_enter(&sbbcsoftp->umutex);
1112 SBBCTRACE(sbbc_close, 'CLOS', sbbcsoftp);
1114 sbbcsoftp->oflag = FALSE;
1116 mutex_exit(&sbbcsoftp->umutex);
1126 struct sbbcsoft *sbbcsoftp;
1130 sbbcsoftp = ddi_get_soft_state(sbbcsoft_statep, getminor(dev));
1132 if (sbbcsoftp == NULL) {
1171 offset = (uint64_t)sbbcsoftp->pci_sbbc_map;
1173 ddi_put32(sbbcsoftp->pci_sbbc_map_handle, (uint32_t *)offset,
1211 offset = (uint64_t)sbbcsoftp->pci_sbbc_map;
1214 sbbcregs.value = ddi_get32(sbbcsoftp->pci_sbbc_map_handle,
1235 sbbc_remove_reg_maps(struct sbbcsoft *sbbcsoftp)
1237 SBBCTRACE(sbbc_remove_reg_maps, 'RMAP', sbbcsoftp);
1238 if (sbbcsoftp->pci_sbbc_map_handle)
1239 ddi_regs_map_free(&sbbcsoftp->pci_sbbc_map_handle);
1244 sbbc_init(struct sbbcsoft *sbbcsoftp)
1247 ddi_put32(sbbcsoftp->pci_sbbc_map_handle,
1248 &sbbcsoftp->pci_sbbc_map->sys_intr_enable,
1328 struct sbbcsoft *sbbcsoftp = (struct sbbcsoft *)arg;
1331 SBBC_DBG1(SBBC_DBG_INTR, sbbcsoftp->dip, "Isr arg 0x%llx\n", arg);
1333 mutex_enter(&sbbcsoftp->sbbc_intr_mutex);
1342 if (sbbcsoftp->child_intr[i] &&
1343 sbbcsoftp->child_intr[i]->status ==
1349 rval = sbbcsoftp->child_intr[i]->intr_handler(
1350 sbbcsoftp->child_intr[i]->arg1,
1351 sbbcsoftp->child_intr[i]->arg2);
1354 mutex_exit(&sbbcsoftp->sbbc_intr_mutex);
1360 mutex_exit(&sbbcsoftp->sbbc_intr_mutex);
1480 static void sbbc_dump_devid(dev_info_t *dip, struct sbbcsoft *sbbcsoftp,
1487 sbbc_id_reg = ddi_get32(sbbcsoftp->pci_sbbc_map_handle,
1488 (uint32_t *)&sbbcsoftp->pci_sbbc_map->devid);