Lines Matching defs:cbp

143 static int cardbus_parse_devprop(cbus_t *cbp, char *cp);
144 static void cardbus_device_props(cbus_t *cbp);
412 cbus_t *cbp;
444 cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
445 cbp->cb_instance = cb_instance;
446 cbp->cb_dip = dip;
447 mutex_init(&cbp->cb_mutex, NULL, MUTEX_DRIVER, NULL);
464 cbp->cb_nex_ops = nex_ops;
468 cbp->orig_dopsp = devi->devi_ops;
469 cbp->orig_bopsp = devi->devi_ops->devo_bus_ops;
470 cbp->cb_dops = *devi->devi_ops;
471 devi->devi_ops = &cbp->cb_dops;
473 if (ndi_event_alloc_hdl(dip, *anp->an_iblock, &cbp->cb_ndi_event_hdl,
475 cbp->cb_ndi_events.ndi_n_events = CB_N_NDI_EVENTS;
476 cbp->cb_ndi_events.ndi_events_version = NDI_EVENTS_REV1;
477 cbp->cb_ndi_events.ndi_event_defs = cb_ndi_event_defs;
478 if (ndi_event_bind_set(cbp->cb_ndi_event_hdl,
479 &cbp->cb_ndi_events,
489 cardbus_device_props(cbp);
491 if (cardbus_init_hotplug(cbp) != DDI_SUCCESS) {
518 cbus_t *cbp;
529 cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
531 if (cbp->cb_dsp) {
534 cbdp = cbp->cb_dsp;
549 if (cbp->cb_ndi_event_hdl != NULL) {
550 (void) ndi_event_unbind_set(cbp->cb_ndi_event_hdl,
551 &cbp->cb_ndi_events, NDI_SLEEP);
552 ndi_event_free_hdl(cbp->cb_ndi_event_hdl);
555 mutex_destroy(&cbp->cb_mutex);
556 if (cbp->nexus_path)
557 kmem_free(cbp->nexus_path, strlen(cbp->nexus_path) + 1);
558 if (cbp->name)
559 kmem_free(cbp->name, strlen(cbp->name) + 1);
582 cbus_t *cbp;
594 cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
596 if (cbp->fatal_problem)
606 mutex_enter(&cbp->cb_mutex);
607 cbp->card_present = B_TRUE;
609 (void) hpc_slot_event_notify(cbp->slot_handle,
611 (void) hpc_slot_event_notify(cbp->slot_handle,
613 (void) hpc_slot_event_notify(cbp->slot_handle,
616 mutex_exit(&cbp->cb_mutex);
618 if (cardbus_configure(cbp) != PCICFG_SUCCESS) {
676 cbus_t *cbp;
683 cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
689 mutex_enter(&cbp->cb_mutex);
690 cbp->card_present = B_FALSE;
692 (void) hpc_slot_event_notify(cbp->slot_handle,
694 (void) hpc_slot_event_notify(cbp->slot_handle,
696 (void) hpc_slot_event_notify(cbp->slot_handle,
699 mutex_exit(&cbp->cb_mutex);
712 cbp->fatal_problem = B_TRUE;
720 (void) cardbus_unconfigure(cbp);
726 if (cbp->cb_ndi_event_hdl != NULL) {
728 if (ndi_event_retrieve_cookie(cbp->cb_ndi_event_hdl, dip,
730 (void) ndi_event_run_callbacks(cbp->cb_ndi_event_hdl,
1602 cardbus_parse_devprop(cbus_t *cbp, char *cp)
1830 cdsp->next = cbp->cb_dsp;
1831 cbp->cb_dsp = cdsp;
1836 cardbus_device_props(cbus_t *cbp)
1841 if (ddi_prop_lookup_string_array(DDI_DEV_T_ANY, cbp->cb_dip,
1848 (void) cardbus_parse_devprop(cbp, prop_array[i]);
2064 cbus_t *cbp;
2074 cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
2080 if (cbp->cb_ndi_event_hdl == NULL) {
2098 rc = ndi_event_retrieve_cookie(cbp->cb_ndi_event_hdl, rdip, eventname,
2112 cbus_t *cbp;
2122 cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
2128 if (cbp->cb_ndi_event_hdl == NULL) {
2147 rc = ndi_event_add_callback(cbp->cb_ndi_event_hdl, rdip, cookie,
2157 cbus_t *cbp;
2166 cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
2172 if (cbp->cb_ndi_event_hdl == NULL) {
2187 return (ndi_event_remove_callback(cbp->cb_ndi_event_hdl, cb_id));