Lines Matching refs:pdp
240 struct xendev_ppd *pdp; in xvdi_init_dev() local
262 pdp = kmem_zalloc(sizeof (*pdp), KM_SLEEP); in xvdi_init_dev()
263 pdp->xd_domain = domid; in xvdi_init_dev()
264 pdp->xd_vdevnum = vdevnum; in xvdi_init_dev()
265 pdp->xd_devclass = devcls; in xvdi_init_dev()
266 pdp->xd_evtchn = INVALID_EVTCHN; in xvdi_init_dev()
267 list_create(&pdp->xd_xb_watches, sizeof (xd_xb_watches_t), in xvdi_init_dev()
269 mutex_init(&pdp->xd_evt_lk, NULL, MUTEX_DRIVER, NULL); in xvdi_init_dev()
270 mutex_init(&pdp->xd_ndi_lk, NULL, MUTEX_DRIVER, NULL); in xvdi_init_dev()
271 ddi_set_parent_data(dip, pdp); in xvdi_init_dev()
301 mutex_destroy(&pdp->xd_ndi_lk); in xvdi_init_dev()
302 mutex_destroy(&pdp->xd_evt_lk); in xvdi_init_dev()
303 kmem_free(pdp, sizeof (*pdp)); in xvdi_init_dev()
308 pdp->xd_xsdev.nodename = i_ddi_strdup(xsname, KM_SLEEP); in xvdi_init_dev()
309 pdp->xd_xsdev.devicetype = xdcp->xsdev; in xvdi_init_dev()
310 pdp->xd_xsdev.frontend = (backend ? 0 : 1); in xvdi_init_dev()
311 pdp->xd_xsdev.data = dip; in xvdi_init_dev()
312 pdp->xd_xsdev.otherend_id = (backend ? domid : -1); in xvdi_init_dev()
351 if (xenbus_read(XBT_NULL, pdp->xd_xsdev.otherend, "dev", in xvdi_init_dev()
368 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in xvdi_uninit_dev() local
370 if (pdp != NULL) { in xvdi_uninit_dev()
378 if (pdp->xd_xsdev.otherend_id != (domid_t)-1) in xvdi_uninit_dev()
382 if (pdp->xd_xsdev.nodename != NULL) in xvdi_uninit_dev()
383 kmem_free((char *)(pdp->xd_xsdev.nodename), in xvdi_uninit_dev()
384 strlen(pdp->xd_xsdev.nodename) + 1); in xvdi_uninit_dev()
388 mutex_destroy(&pdp->xd_ndi_lk); in xvdi_uninit_dev()
389 mutex_destroy(&pdp->xd_evt_lk); in xvdi_uninit_dev()
390 kmem_free(pdp, sizeof (*pdp)); in xvdi_uninit_dev()
401 struct xendev_ppd *pdp; in xvdi_bind_evtchn() local
405 pdp = ddi_get_parent_data(dip); in xvdi_bind_evtchn()
406 ASSERT(pdp != NULL); in xvdi_bind_evtchn()
407 ASSERT(pdp->xd_evtchn == INVALID_EVTCHN); in xvdi_bind_evtchn()
409 mutex_enter(&pdp->xd_evt_lk); in xvdi_bind_evtchn()
410 if (pdp->xd_devclass == XEN_CONSOLE) { in xvdi_bind_evtchn()
412 pdp->xd_evtchn = xen_info->console.domU.evtchn; in xvdi_bind_evtchn()
414 pdp->xd_evtchn = INVALID_EVTCHN; in xvdi_bind_evtchn()
415 mutex_exit(&pdp->xd_evt_lk); in xvdi_bind_evtchn()
419 oeid = pdp->xd_xsdev.otherend_id; in xvdi_bind_evtchn()
421 mutex_exit(&pdp->xd_evt_lk); in xvdi_bind_evtchn()
425 if ((r = xen_bind_interdomain(oeid, evtchn, &pdp->xd_evtchn))) { in xvdi_bind_evtchn()
427 mutex_exit(&pdp->xd_evt_lk); in xvdi_bind_evtchn()
432 pdp->xd_ispec.intrspec_vec = ec_bind_evtchn_to_irq(pdp->xd_evtchn); in xvdi_bind_evtchn()
434 mutex_exit(&pdp->xd_evt_lk); in xvdi_bind_evtchn()
446 struct xendev_ppd *pdp; in xvdi_alloc_evtchn() local
450 pdp = ddi_get_parent_data(dip); in xvdi_alloc_evtchn()
451 ASSERT(pdp != NULL); in xvdi_alloc_evtchn()
452 ASSERT(pdp->xd_evtchn == INVALID_EVTCHN); in xvdi_alloc_evtchn()
454 mutex_enter(&pdp->xd_evt_lk); in xvdi_alloc_evtchn()
455 if (pdp->xd_devclass == XEN_CONSOLE) { in xvdi_alloc_evtchn()
457 pdp->xd_evtchn = xen_info->console.domU.evtchn; in xvdi_alloc_evtchn()
459 pdp->xd_evtchn = INVALID_EVTCHN; in xvdi_alloc_evtchn()
460 mutex_exit(&pdp->xd_evt_lk); in xvdi_alloc_evtchn()
464 oeid = pdp->xd_xsdev.otherend_id; in xvdi_alloc_evtchn()
466 mutex_exit(&pdp->xd_evt_lk); in xvdi_alloc_evtchn()
470 if ((rv = xen_alloc_unbound_evtchn(oeid, &pdp->xd_evtchn))) { in xvdi_alloc_evtchn()
472 mutex_exit(&pdp->xd_evt_lk); in xvdi_alloc_evtchn()
477 pdp->xd_ispec.intrspec_vec = ec_bind_evtchn_to_irq(pdp->xd_evtchn); in xvdi_alloc_evtchn()
479 mutex_exit(&pdp->xd_evt_lk); in xvdi_alloc_evtchn()
491 struct xendev_ppd *pdp; in xvdi_free_evtchn() local
493 pdp = ddi_get_parent_data(dip); in xvdi_free_evtchn()
494 ASSERT(pdp != NULL); in xvdi_free_evtchn()
496 mutex_enter(&pdp->xd_evt_lk); in xvdi_free_evtchn()
497 if (pdp->xd_evtchn != INVALID_EVTCHN) { in xvdi_free_evtchn()
499 ec_unbind_irq(pdp->xd_ispec.intrspec_vec); in xvdi_free_evtchn()
500 pdp->xd_ispec.intrspec_vec = 0; in xvdi_free_evtchn()
502 pdp->xd_evtchn = INVALID_EVTCHN; in xvdi_free_evtchn()
504 mutex_exit(&pdp->xd_evt_lk); in xvdi_free_evtchn()
969 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in xvdi_find_dev() local
971 if (pdp == NULL) { in xvdi_find_dev()
996 domid = pdp->xd_domain; in xvdi_find_dev()
997 vdevnum = pdp->xd_vdevnum; in xvdi_find_dev()
998 devcls = pdp->xd_devclass; in xvdi_find_dev()
1010 struct xendev_ppd *pdp = ddi_get_parent_data(xdip); in xvdi_get_evtchn() local
1012 ASSERT(pdp != NULL); in xvdi_get_evtchn()
1013 return (pdp->xd_evtchn); in xvdi_get_evtchn()
1019 struct xendev_ppd *pdp = ddi_get_parent_data(xdip); in xvdi_get_vdevnum() local
1021 ASSERT(pdp != NULL); in xvdi_get_vdevnum()
1022 return (pdp->xd_vdevnum); in xvdi_get_vdevnum()
1028 struct xendev_ppd *pdp = ddi_get_parent_data(xdip); in xvdi_get_xsname() local
1030 ASSERT(pdp != NULL); in xvdi_get_xsname()
1031 return ((char *)(pdp->xd_xsdev.nodename)); in xvdi_get_xsname()
1037 struct xendev_ppd *pdp = ddi_get_parent_data(xdip); in xvdi_get_oename() local
1039 ASSERT(pdp != NULL); in xvdi_get_oename()
1040 if (pdp->xd_devclass == XEN_CONSOLE) in xvdi_get_oename()
1042 return ((char *)(pdp->xd_xsdev.otherend)); in xvdi_get_oename()
1048 struct xendev_ppd *pdp = ddi_get_parent_data(xdip); in xvdi_get_xsd() local
1050 ASSERT(pdp != NULL); in xvdi_get_xsd()
1051 return (&pdp->xd_xsdev); in xvdi_get_xsd()
1057 struct xendev_ppd *pdp = ddi_get_parent_data(xdip); in xvdi_get_oeid() local
1059 ASSERT(pdp != NULL); in xvdi_get_oeid()
1060 if (pdp->xd_devclass == XEN_CONSOLE) in xvdi_get_oeid()
1062 return ((domid_t)(pdp->xd_xsdev.otherend_id)); in xvdi_get_oeid()
1068 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in xvdi_dev_error() local
1070 ASSERT(pdp != NULL); in xvdi_dev_error()
1071 xenbus_dev_error(&pdp->xd_xsdev, errno, errstr); in xvdi_dev_error()
1077 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in xvdi_fatal_error() local
1079 ASSERT(pdp != NULL); in xvdi_fatal_error()
1080 xenbus_dev_fatal(&pdp->xd_xsdev, errno, errstr); in xvdi_fatal_error()
1088 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_oestate_handler() local
1089 XenbusState oestate = pdp->xd_xsdev.otherend_state; in i_xvdi_oestate_handler()
1103 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_oestate_handler()
1105 if (pdp->xd_oe_ehid != NULL) { in i_xvdi_oestate_handler()
1109 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_oestate_handler()
1111 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_oestate_handler()
1128 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_oestate_handler()
1143 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_hpstate_handler() local
1148 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_hpstate_handler()
1150 (xenbus_read(XBT_NULL, pdp->xd_hp_watch.node, "", in i_xvdi_hpstate_handler()
1158 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_hpstate_handler()
1164 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_hpstate_handler()
1170 struct xendev_ppd *pdp; in xvdi_notify_oe() local
1172 pdp = ddi_get_parent_data(dip); in xvdi_notify_oe()
1173 ASSERT(pdp->xd_evtchn != INVALID_EVTCHN); in xvdi_notify_oe()
1174 ec_notify_via_evtchn(pdp->xd_evtchn); in xvdi_notify_oe()
1181 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_bepath_cb() local
1193 == 0) && (strcmp(be, pdp->xd_xsdev.otherend) != 0)) in i_xvdi_bepath_cb()
1232 struct xendev_ppd *pdp = xxwp->xxw_xppd; in i_xvdi_xb_watch_cb_tq() local
1236 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_xb_watch_cb_tq()
1238 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_xb_watch_cb_tq()
1245 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_xb_watch_cb() local
1251 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_xb_watch_cb()
1252 for (xxwp = list_head(&pdp->xd_xb_watches); xxwp != NULL; in i_xvdi_xb_watch_cb()
1253 xxwp = list_next(&pdp->xd_xb_watches, xxwp)) { in i_xvdi_xb_watch_cb()
1259 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_xb_watch_cb()
1264 (void) ddi_taskq_dispatch(pdp->xd_xb_watch_taskq, in i_xvdi_xb_watch_cb()
1266 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_xb_watch_cb()
1279 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in xvdi_add_xb_watch_handler() local
1299 xxw_new->xxw_xppd = pdp; in xvdi_add_xb_watch_handler()
1303 mutex_enter(&pdp->xd_ndi_lk); in xvdi_add_xb_watch_handler()
1309 if (pdp->xd_xb_watch_taskq == NULL) { in xvdi_add_xb_watch_handler()
1312 ASSERT(list_is_empty(&pdp->xd_xb_watches)); in xvdi_add_xb_watch_handler()
1317 if ((pdp->xd_xb_watch_taskq = ddi_taskq_create(dip, tq_name, in xvdi_add_xb_watch_handler()
1320 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_xb_watch_handler()
1326 for (xxwp = list_head(&pdp->xd_xb_watches); xxwp != NULL; in xvdi_add_xb_watch_handler()
1327 xxwp = list_next(&pdp->xd_xb_watches, xxwp)) { in xvdi_add_xb_watch_handler()
1333 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_xb_watch_handler()
1338 if (list_is_empty(&pdp->xd_xb_watches)) { in xvdi_add_xb_watch_handler()
1339 ddi_taskq_destroy(pdp->xd_xb_watch_taskq); in xvdi_add_xb_watch_handler()
1340 pdp->xd_xb_watch_taskq = NULL; in xvdi_add_xb_watch_handler()
1343 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_xb_watch_handler()
1347 list_insert_head(&pdp->xd_xb_watches, xxw_new); in xvdi_add_xb_watch_handler()
1348 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_xb_watch_handler()
1358 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in xvdi_remove_xb_watch_handlers() local
1362 mutex_enter(&pdp->xd_ndi_lk); in xvdi_remove_xb_watch_handlers()
1364 while ((xxwp = list_remove_head(&pdp->xd_xb_watches)) != NULL) { in xvdi_remove_xb_watch_handlers()
1365 mutex_exit(&pdp->xd_ndi_lk); in xvdi_remove_xb_watch_handlers()
1367 mutex_enter(&pdp->xd_ndi_lk); in xvdi_remove_xb_watch_handlers()
1370 ASSERT(list_is_empty(&pdp->xd_xb_watches)); in xvdi_remove_xb_watch_handlers()
1379 tq = pdp->xd_xb_watch_taskq; in xvdi_remove_xb_watch_handlers()
1380 pdp->xd_xb_watch_taskq = NULL; in xvdi_remove_xb_watch_handlers()
1381 mutex_exit(&pdp->xd_ndi_lk); in xvdi_remove_xb_watch_handlers()
1389 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_add_watch_oestate() local
1391 ASSERT(pdp != NULL); in i_xvdi_add_watch_oestate()
1392 ASSERT(pdp->xd_xsdev.nodename != NULL); in i_xvdi_add_watch_oestate()
1393 ASSERT(mutex_owned(&pdp->xd_ndi_lk)); in i_xvdi_add_watch_oestate()
1408 if (pdp->xd_oe_taskq == NULL) in i_xvdi_add_watch_oestate()
1409 if ((pdp->xd_oe_taskq = ddi_taskq_create(dip, in i_xvdi_add_watch_oestate()
1416 pdp->xd_xsdev.otherend_state = XenbusStateUnknown; in i_xvdi_add_watch_oestate()
1417 pdp->xd_xsdev.otherend_changed = i_xvdi_oestate_cb; in i_xvdi_add_watch_oestate()
1419 if (talk_to_otherend(&pdp->xd_xsdev) != 0) { in i_xvdi_add_watch_oestate()
1430 struct xendev_ppd *pdp; in i_xvdi_rem_watch_oestate() local
1433 pdp = ddi_get_parent_data(dip); in i_xvdi_rem_watch_oestate()
1434 ASSERT(pdp != NULL); in i_xvdi_rem_watch_oestate()
1435 ASSERT(mutex_owned(&pdp->xd_ndi_lk)); in i_xvdi_rem_watch_oestate()
1437 dev = &pdp->xd_xsdev; in i_xvdi_rem_watch_oestate()
1441 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_oestate()
1443 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_oestate()
1447 if (pdp->xd_oe_taskq != NULL) { in i_xvdi_rem_watch_oestate()
1448 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_oestate()
1449 ddi_taskq_destroy(pdp->xd_oe_taskq); in i_xvdi_rem_watch_oestate()
1450 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_oestate()
1451 pdp->xd_oe_taskq = NULL; in i_xvdi_rem_watch_oestate()
1469 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_add_watch_hpstate() local
1471 ASSERT(pdp != NULL); in i_xvdi_add_watch_hpstate()
1472 ASSERT(pdp->xd_xsdev.frontend == 0); in i_xvdi_add_watch_hpstate()
1473 ASSERT(mutex_owned(&pdp->xd_ndi_lk)); in i_xvdi_add_watch_hpstate()
1488 if (pdp->xd_hp_taskq == NULL) in i_xvdi_add_watch_hpstate()
1489 if ((pdp->xd_hp_taskq = ddi_taskq_create(dip, in i_xvdi_add_watch_hpstate()
1493 if (pdp->xd_hp_watch.node == NULL) { in i_xvdi_add_watch_hpstate()
1497 ASSERT(pdp->xd_xsdev.nodename != NULL); in i_xvdi_add_watch_hpstate()
1499 len = strlen(pdp->xd_xsdev.nodename) + in i_xvdi_add_watch_hpstate()
1503 pdp->xd_xsdev.nodename); in i_xvdi_add_watch_hpstate()
1505 pdp->xd_hp_watch.node = path; in i_xvdi_add_watch_hpstate()
1506 pdp->xd_hp_watch.callback = i_xvdi_hpstate_cb; in i_xvdi_add_watch_hpstate()
1507 pdp->xd_hp_watch.dev = (struct xenbus_device *)dip; /* yuck! */ in i_xvdi_add_watch_hpstate()
1508 if (register_xenbus_watch(&pdp->xd_hp_watch) != 0) { in i_xvdi_add_watch_hpstate()
1520 struct xendev_ppd *pdp; in i_xvdi_rem_watch_hpstate() local
1521 pdp = ddi_get_parent_data(dip); in i_xvdi_rem_watch_hpstate()
1523 ASSERT(pdp != NULL); in i_xvdi_rem_watch_hpstate()
1524 ASSERT(pdp->xd_xsdev.frontend == 0); in i_xvdi_rem_watch_hpstate()
1525 ASSERT(mutex_owned(&pdp->xd_ndi_lk)); in i_xvdi_rem_watch_hpstate()
1528 if (pdp->xd_hp_watch.node != NULL) { in i_xvdi_rem_watch_hpstate()
1529 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_hpstate()
1530 unregister_xenbus_watch(&pdp->xd_hp_watch); in i_xvdi_rem_watch_hpstate()
1531 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_hpstate()
1535 if (pdp->xd_hp_taskq != NULL) { in i_xvdi_rem_watch_hpstate()
1536 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_hpstate()
1537 ddi_taskq_destroy(pdp->xd_hp_taskq); in i_xvdi_rem_watch_hpstate()
1538 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_hpstate()
1539 pdp->xd_hp_taskq = NULL; in i_xvdi_rem_watch_hpstate()
1543 if (pdp->xd_hp_watch.node != NULL) { in i_xvdi_rem_watch_hpstate()
1544 kmem_free((void *)pdp->xd_hp_watch.node, in i_xvdi_rem_watch_hpstate()
1545 strlen(pdp->xd_hp_watch.node) + 1); in i_xvdi_rem_watch_hpstate()
1546 pdp->xd_hp_watch.node = NULL; in i_xvdi_rem_watch_hpstate()
1553 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_add_watches() local
1555 ASSERT(pdp != NULL); in i_xvdi_add_watches()
1557 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_add_watches()
1560 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_add_watches()
1564 if (pdp->xd_xsdev.frontend == 1) { in i_xvdi_add_watches()
1579 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_add_watches()
1585 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_add_watches()
1593 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_rem_watches() local
1595 ASSERT(pdp != NULL); in i_xvdi_rem_watches()
1597 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_rem_watches()
1601 if (pdp->xd_xsdev.frontend == 1) in i_xvdi_rem_watches()
1606 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_rem_watches()
1614 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_add_watch_bepath() local
1616 ASSERT(pdp != NULL); in i_xvdi_add_watch_bepath()
1617 ASSERT(pdp->xd_xsdev.frontend == 1); in i_xvdi_add_watch_bepath()
1622 if (pdp->xd_bepath_watch.node == NULL) { in i_xvdi_add_watch_bepath()
1626 ASSERT(pdp->xd_xsdev.nodename != NULL); in i_xvdi_add_watch_bepath()
1628 len = strlen(pdp->xd_xsdev.nodename) + strlen("/backend") + 1; in i_xvdi_add_watch_bepath()
1631 pdp->xd_xsdev.nodename); in i_xvdi_add_watch_bepath()
1633 pdp->xd_bepath_watch.node = path; in i_xvdi_add_watch_bepath()
1634 pdp->xd_bepath_watch.callback = i_xvdi_bepath_cb; in i_xvdi_add_watch_bepath()
1635 pdp->xd_bepath_watch.dev = (struct xenbus_device *)dip; in i_xvdi_add_watch_bepath()
1636 if (register_xenbus_watch(&pdp->xd_bepath_watch) != 0) { in i_xvdi_add_watch_bepath()
1638 pdp->xd_bepath_watch.node = NULL; in i_xvdi_add_watch_bepath()
1649 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_rem_watch_bepath() local
1651 ASSERT(pdp != NULL); in i_xvdi_rem_watch_bepath()
1652 ASSERT(pdp->xd_xsdev.frontend == 1); in i_xvdi_rem_watch_bepath()
1653 ASSERT(mutex_owned(&pdp->xd_ndi_lk)); in i_xvdi_rem_watch_bepath()
1655 if (pdp->xd_bepath_watch.node != NULL) { in i_xvdi_rem_watch_bepath()
1656 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_bepath()
1657 unregister_xenbus_watch(&pdp->xd_bepath_watch); in i_xvdi_rem_watch_bepath()
1658 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_rem_watch_bepath()
1660 kmem_free((void *)(pdp->xd_bepath_watch.node), in i_xvdi_rem_watch_bepath()
1661 strlen(pdp->xd_bepath_watch.node) + 1); in i_xvdi_rem_watch_bepath()
1662 pdp->xd_bepath_watch.node = NULL; in i_xvdi_rem_watch_bepath()
1671 struct xendev_ppd *pdp; in xvdi_switch_state() local
1673 pdp = ddi_get_parent_data(dip); in xvdi_switch_state()
1674 ASSERT(pdp != NULL); in xvdi_switch_state()
1682 rv = xenbus_switch_state(&pdp->xd_xsdev, xbt, newState); in xvdi_switch_state()
1695 struct xendev_ppd *pdp; in xvdi_post_event() local
1702 pdp = ddi_get_parent_data(dip); in xvdi_post_event()
1703 ASSERT(pdp != NULL); in xvdi_post_event()
1705 xdcp = i_xvdi_devclass2cfg(pdp->xd_devclass); in xvdi_post_event()
1715 err = nvlist_add_int32(attr_list, "domain", pdp->xd_domain); in xvdi_post_event()
1718 err = nvlist_add_int32(attr_list, "vdev", pdp->xd_vdevnum); in xvdi_post_event()
1728 ((pdp->xd_xsdev.frontend == 1) ? "frontend" : "backend")); in xvdi_post_event()
1910 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in xvdi_add_event_handler() local
1916 ASSERT(pdp != NULL); in xvdi_add_event_handler()
1918 mutex_enter(&pdp->xd_ndi_lk); in xvdi_add_event_handler()
1921 ASSERT(pdp->xd_xsdev.otherend != NULL); in xvdi_add_event_handler()
1923 cbid = &pdp->xd_oe_ehid; in xvdi_add_event_handler()
1925 if (pdp->xd_xsdev.frontend == 1) { in xvdi_add_event_handler()
1926 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_event_handler()
1930 ASSERT(pdp->xd_hp_watch.node != NULL); in xvdi_add_event_handler()
1932 cbid = &pdp->xd_hp_ehid; in xvdi_add_event_handler()
1935 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_event_handler()
1944 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_event_handler()
1953 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_event_handler()
1961 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_event_handler()
1972 (pdp->xd_xsdev.otherend_state != XenbusStateUnknown)) { in xvdi_add_event_handler()
1973 oestate = pdp->xd_xsdev.otherend_state; in xvdi_add_event_handler()
1977 mutex_exit(&pdp->xd_ndi_lk); in xvdi_add_event_handler()
1983 (void) ddi_taskq_dispatch(pdp->xd_oe_taskq, in xvdi_add_event_handler()
1997 struct xendev_ppd *pdp; in xvdi_remove_event_handler() local
2001 pdp = ddi_get_parent_data(dip); in xvdi_remove_event_handler()
2002 ASSERT(pdp != NULL); in xvdi_remove_event_handler()
2016 mutex_enter(&pdp->xd_ndi_lk); in xvdi_remove_event_handler()
2018 if (rem_oe && (pdp->xd_oe_ehid != NULL)) { in xvdi_remove_event_handler()
2019 oeid = pdp->xd_oe_ehid; in xvdi_remove_event_handler()
2020 pdp->xd_oe_ehid = NULL; in xvdi_remove_event_handler()
2023 if (rem_hp && (pdp->xd_hp_ehid != NULL)) { in xvdi_remove_event_handler()
2024 hpid = pdp->xd_hp_ehid; in xvdi_remove_event_handler()
2025 pdp->xd_hp_ehid = NULL; in xvdi_remove_event_handler()
2028 mutex_exit(&pdp->xd_ndi_lk); in xvdi_remove_event_handler()
2273 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_oestate_cb() local
2285 mutex_enter(&pdp->xd_ndi_lk); in i_xvdi_oestate_cb()
2290 mutex_exit(&pdp->xd_ndi_lk); in i_xvdi_oestate_cb()
2299 (void) ddi_taskq_dispatch(pdp->xd_oe_taskq, in i_xvdi_oestate_cb()
2310 struct xendev_ppd *pdp = ddi_get_parent_data(dip); in i_xvdi_hpstate_cb() local
2316 (void) xenbus_read(XBT_NULL, pdp->xd_hp_watch.node, "", in i_xvdi_hpstate_cb()
2327 (void) ddi_taskq_dispatch(pdp->xd_hp_taskq, in i_xvdi_hpstate_cb()