Lines Matching defs:hpc3130_p

759 	hpc3130_unit_t	*hpc3130_p;
778 hpc3130_p =
780 ASSERT(hpc3130_p);
800 "slot-table", (caddr_t)&hpc3130_p->hpc3130_slot_table_data,
801 &hpc3130_p->hpc3130_slot_table_size);
824 for (i = 0, n = 0; i < hpc3130_p->hpc3130_slot_table_size; i++) {
825 if (hpc3130_p->hpc3130_slot_table_data[i] == 0) {
840 hpc3130_p->dip = dip;
841 hpc3130_p->hpc3130_slot_table_length = n / HPC3130_TABLE_COLUMNS;
843 if (ddi_get_iblock_cookie(dip, 0, &hpc3130_p->ic_trap_cookie) !=
849 mutex_init(&hpc3130_p->hpc3130_mutex, NULL, MUTEX_DRIVER,
850 (void *)hpc3130_p->ic_trap_cookie);
855 hpc3130_p->hpc3130_slot_table = (hpc3130_slot_table_entry_t *)
856 kmem_zalloc(hpc3130_p->hpc3130_slot_table_length *
862 if (i2c_client_register(dip, &hpc3130_p->hpc3130_hdl) != I2C_SUCCESS) {
867 s = hpc3130_p->hpc3130_slot_table_data;
868 for (i = 0; i < hpc3130_p->hpc3130_slot_table_length; i++) {
892 ste = &hpc3130_p->hpc3130_slot_table[j];
909 hpc3130_p->slots_are = HPC3130_SLOT_TYPE_PCI;
918 hpc3130_p->slots_are = HPC3130_SLOT_TYPE_SBD;
921 hpc3130_p->present[j] = B_FALSE;
922 hpc3130_p->enabled[j] = B_TRUE;
930 ste->callback_info.handle = (caddr_t)hpc3130_p->hpc3130_hdl;
934 ste->callback_info.statep = (caddr_t)hpc3130_p;
937 hpc3130_p->hpc3130_slot_ops = hpc_alloc_slot_ops(KM_SLEEP);
938 hpc3130_p->hpc3130_slot_ops->hpc_version = 0;
940 hpc3130_p->hpc3130_slot_ops->hpc_op_connect = hpc3130_slot_connect;
941 hpc3130_p->hpc3130_slot_ops->hpc_op_disconnect =
943 hpc3130_p->hpc3130_slot_ops->hpc_op_insert = hpc3130_slot_insert;
944 hpc3130_p->hpc3130_slot_ops->hpc_op_remove = hpc3130_slot_remove;
945 hpc3130_p->hpc3130_slot_ops->hpc_op_control = hpc3130_slot_control;
947 cv_init(&hpc3130_p->hpc3130_cond, NULL, CV_DEFAULT, NULL);
949 if (hpc3130_init(dip, (hpc3130_p->slots_are == HPC3130_SLOT_TYPE_SBD) ?
954 if (ddi_add_intr(dip, 0, &hpc3130_p->ic_trap_cookie,
956 (caddr_t)hpc3130_p) != DDI_SUCCESS) {
964 for (i = 0; i < hpc3130_p->hpc3130_slot_table_length; i++) {
966 &hpc3130_p->hpc3130_slot_table[i];
967 hpc3130_p->power[i] = B_TRUE;
972 hpc3130_p->hpc3130_slot_ops,
977 (void) snprintf(hpc3130_p->hpc3130_name,
978 sizeof (hpc3130_p->hpc3130_name),
990 hpc3130_p->ic_trap_cookie);
998 hpc_free_slot_ops(hpc3130_p->hpc3130_slot_ops);
1000 i2c_client_unregister(hpc3130_p->hpc3130_hdl);
1002 mutex_destroy(&hpc3130_p->hpc3130_mutex);
1003 kmem_free(hpc3130_p->hpc3130_slot_table,
1004 hpc3130_p->hpc3130_slot_table_length *
1007 kmem_free(hpc3130_p->hpc3130_slot_table_data,
1008 hpc3130_p->hpc3130_slot_table_size);
1032 hpc3130_unit_t *hpc3130_p;
1034 hpc3130_p = (hpc3130_unit_t *)ddi_get_soft_state(hpc3130soft_statep,
1036 if (hpc3130_p == NULL)
1039 i2c_client_unregister(hpc3130_p->hpc3130_hdl);
1041 ddi_remove_intr(dip, 0u, hpc3130_p->ic_trap_cookie);
1043 cv_destroy(&hpc3130_p->hpc3130_cond);
1045 for (i = 0; i < hpc3130_p->hpc3130_slot_table_length; i++) {
1047 &hpc3130_p->hpc3130_slot_table[i].hpc3130_slot_handle);
1050 kmem_free(hpc3130_p->hpc3130_slot_table,
1051 hpc3130_p->hpc3130_slot_table_length *
1054 kmem_free(hpc3130_p->hpc3130_slot_table_data,
1055 hpc3130_p->hpc3130_slot_table_size);
1057 hpc_free_slot_ops(hpc3130_p->hpc3130_slot_ops);
1059 mutex_destroy(&hpc3130_p->hpc3130_mutex);
1209 hpc3130_unit_t *hpc3130_p;
1214 hpc3130_p =
1217 ASSERT(hpc3130_p);
1219 mutex_enter(&hpc3130_p->hpc3130_mutex);
1221 handle = hpc3130_p->hpc3130_hdl;
1236 if (hpc3130_p->slots_are == HPC3130_SLOT_TYPE_SBD) {
1237 if (hpc3130_cpu_init(hpc3130_p, slot, handle)
1245 mutex_exit(&hpc3130_p->hpc3130_mutex);
1264 hpc3130_unit_t *hpc3130_p = (hpc3130_unit_t *)arg;
1265 ASSERT(hpc3130_p);
1267 mutex_enter(&hpc3130_p->hpc3130_mutex);
1269 slot_type = hpc3130_p->slots_are;
1270 handle = hpc3130_p->hpc3130_hdl;
1294 hpc3130_p->power[slot] = B_FALSE;
1296 hpc3130_p->power[slot] = B_TRUE;
1298 cv_signal(&hpc3130_p->hpc3130_cond);
1299 hpc3130_p->events[slot] |= HPC3130_IEVENT_POWER;
1307 (void) hpc3130_set_led(hpc3130_p,
1314 (void) hpc3130_set_led(hpc3130_p,
1320 hpc3130_p->present[slot] = present;
1321 hpc3130_p->events[slot] |=
1331 hpc3130_p->events[slot] |=
1344 hpc3130_p->events[slot] |=
1353 hpc3130_p->present[slot] = B_FALSE;
1356 (void) hpc3130_set_led(hpc3130_p,
1361 (void) hpc3130_set_led(hpc3130_p,
1367 hpc3130_p->present[slot] = B_TRUE;
1370 (void) hpc3130_set_led(hpc3130_p,
1376 hpc3130_p->events[slot] |=
1380 if (hpc3130_p->events[slot] &&
1381 (hpc3130_p->present[slot] == B_TRUE)) {
1382 mutex_exit(&hpc3130_p->hpc3130_mutex);
1383 pollwakeup(&hpc3130_p->pollhead[slot], POLLIN);
1384 mutex_enter(&hpc3130_p->hpc3130_mutex);
1390 mutex_exit(&hpc3130_p->hpc3130_mutex);
1396 hpc3130_cpu_init(hpc3130_unit_t *hpc3130_p, int slot, i2c_client_hdl_t handle)
1427 hpc3130_p->present[slot] = B_TRUE;
1494 hpc3130_unit_t *hpc3130_p;
1510 hpc3130_p = (hpc3130_unit_t *)info_p->statep;
1511 ASSERT(hpc3130_p);
1513 mutex_enter(&hpc3130_p->hpc3130_mutex);
1518 ste = &hpc3130_p->hpc3130_slot_table[offset];
1520 if (hpc3130_p->slots_are == HPC3130_SLOT_TYPE_SBD) {
1530 slot_type = hpc3130_p->slots_are;
1532 if (hpc3130_p->enabled[offset] == B_FALSE) {
1538 if (hpc3130_p->power[offset] == B_TRUE) {
1540 mutex_exit(&hpc3130_p->hpc3130_mutex);
1591 (hpc3130_verify_slot_power(hpc3130_p, handle, offset,
1601 (void) hpc3130_set_led(hpc3130_p, offset, HPC3130_LED_OK2REM,
1644 (void) hpc3130_set_led(hpc3130_p, offset, HPC3130_LED_FAULT,
1660 (hpc3130_verify_slot_power(hpc3130_p, handle, offset,
1663 (void) hpc3130_set_led(hpc3130_p, offset,
1668 mutex_exit(&hpc3130_p->hpc3130_mutex);
1682 hpc3130_unit_t *hpc3130_p;
1694 hpc3130_p = (hpc3130_unit_t *)info_p->statep;
1695 ASSERT(hpc3130_p);
1697 mutex_enter(&hpc3130_p->hpc3130_mutex);
1702 ASSERT(handle == hpc3130_p->hpc3130_hdl);
1704 ste = &hpc3130_p->hpc3130_slot_table[offset];
1706 if (hpc3130_p->slots_are == HPC3130_SLOT_TYPE_SBD) {
1716 slot_type = hpc3130_p->slots_are;
1756 offset, hpc3130_p->present[offset]));
1758 if (hpc3130_verify_slot_power(hpc3130_p, handle, offset,
1766 if (hpc3130_p->present[offset] == B_TRUE) {
1772 (void) hpc3130_set_led(hpc3130_p, offset, HPC3130_LED_OK2REM,
1778 (void) hpc3130_set_led(hpc3130_p, offset, HPC3130_LED_FAULT,
1787 (void) hpc3130_set_led(hpc3130_p, offset,
1789 (void) hpc3130_set_led(hpc3130_p, offset,
1796 mutex_exit(&hpc3130_p->hpc3130_mutex);
1802 hpc3130_verify_slot_power(hpc3130_unit_t *hpc3130_p, i2c_client_hdl_t handle,
1822 ste = &hpc3130_p->hpc3130_slot_table[offset];
1823 slot_actual_state = hpc3130_p->power[offset];
1827 timeleft = cv_reltimedwait(&hpc3130_p->hpc3130_cond,
1828 &hpc3130_p->hpc3130_mutex, tm, TR_CLOCK_TICK);
1845 hpc3130_p->power[offset] = slot_actual_state;
1862 (void) hpc3130_set_led(hpc3130_p, offset, HPC3130_LED_FAULT,
1896 hpc3130_unit_t *hpc3130_p;
1906 hpc3130_p = (hpc3130_unit_t *)info_p->statep;
1907 ASSERT(hpc3130_p);
1909 mutex_enter(&hpc3130_p->hpc3130_mutex);
1914 ASSERT(handle == hpc3130_p->hpc3130_hdl);
1916 slot_type = hpc3130_p->slots_are;
1927 mutex_exit(&hpc3130_p->hpc3130_mutex);
1938 mutex_exit(&hpc3130_p->hpc3130_mutex);
1962 mutex_exit(&hpc3130_p->hpc3130_mutex);
1979 mutex_exit(&hpc3130_p->hpc3130_mutex);
1983 (void) hpc3130_set_led(hpc3130_p, offset, led,
1988 if (hpc3130_p->power[offset] == B_FALSE) {
1989 if (hpc3130_p->present[offset] == B_FALSE) {
2010 (void) hpc3130_set_led(hpc3130_p, offset,
2014 (void) hpc3130_set_led(hpc3130_p, offset,
2018 (void) hpc3130_set_led(hpc3130_p, offset,
2020 hpc3130_p->present[offset] = B_TRUE;
2023 if (hpc3130_p->power[offset] == B_TRUE) {
2024 (void) hpc3130_set_led(hpc3130_p, offset,
2027 (void) hpc3130_set_led(hpc3130_p, offset,
2032 hpc3130_p->enabled[offset] = B_FALSE;
2036 hpc3130_p->enabled[offset] = B_TRUE;
2040 mutex_exit(&hpc3130_p->hpc3130_mutex);
2043 mutex_exit(&hpc3130_p->hpc3130_mutex);