Lines Matching defs:instance

141 static void	iosram_remove_instance(int instance);
294 int instance;
300 instance = ddi_get_instance(dip);
302 DPRINTF(1, ("iosram(%d): attach dip:%p\n", instance, (void *)dip));
304 IOSRAMLOG(1, "ATTACH: dip:%p instance %d ... start\n",
305 dip, instance, NULL, NULL);
311 instance))) {
351 if (ddi_soft_state_zalloc(iosramsoft_statep, instance) != 0) {
355 if ((softp = ddi_get_soft_state(iosramsoft_statep, instance)) == NULL) {
359 softp->instance = instance;
363 * If this instance is not tunnel capable, we don't attach it.
366 DPRINTF(1, ("iosram(%d): not tunnel_capable\n", instance));
367 IOSRAMLOG(1, "ATTACH(%d): not tunnel_capable\n", instance, NULL,
379 instance));
391 * Get interrupts cookies and initialize per-instance mutexes
396 instance, NULL, NULL, NULL);
403 * Add this instance to the iosram_instances list so that it can be used
412 * let's set this instance as the master.
423 instance);
425 iosram_remove_instance(softp->instance);
437 (void) sprintf(name, "iosram%d", instance);
438 if (ddi_create_minor_node(dip, name, S_IFCHR, instance, NULL, NULL) ==
446 instance);
450 DPRINTF(1, ("iosram_attach(%d): success.\n", instance));
451 IOSRAMLOG(1, "ATTACH: dip:%p instance:%d ... success softp:%p\n",
452 dip, instance, softp, NULL);
457 DPRINTF(1, ("iosram_attach(%d):failed.\n", instance));
458 IOSRAMLOG(1, "ATTACH: dip:%p instance:%d ... failed.\n",
459 dip, instance, NULL, NULL);
461 ddi_soft_state_free(iosramsoft_statep, instance);
469 int instance;
472 instance = ddi_get_instance(dip);
473 if (!(softp = ddi_get_soft_state(iosramsoft_statep, instance))) {
477 IOSRAMLOG(1, "DETACH: dip:%p instance %d softp:%p\n",
478 dip, instance, softp, NULL);
512 * Indicate that this instance is being detached so that this instance
519 * If this instance is currently the master or the target of the tunnel
524 (void) iosram_switchfrom(instance);
530 * of tunnel relocation, then we can't detach this instance right now.
549 * Now remove our instance from the iosram_instances list.
551 iosram_remove_instance(instance);
561 * Destroy per-instance mutexes
570 ddi_soft_state_free(iosramsoft_statep, instance);
583 int instance, ret;
585 instance = getminor(dev);
587 IOSRAMLOG(2, "GETINFO: dip:%x instance %d dev:%x infocmd:%x\n",
588 dip, instance, dev, infocmd);
592 softp = ddi_get_soft_state(iosramsoft_statep, instance);
602 *result = (void *)(uintptr_t)instance;
619 int instance;
621 instance = getminor(*dev);
622 softp = ddi_get_soft_state(iosramsoft_statep, instance);
628 IOSRAMLOG(1, "OPEN: dev:%p otype:%x ... instance:%d softp:%p\n",
629 *dev, otype, softp->instance, softp);
640 int instance;
642 instance = getminor(dev);
643 softp = ddi_get_soft_state(iosramsoft_statep, instance);
648 IOSRAMLOG(1, "CLOSE: dev:%p otype:%x ... instance:%d softp:%p\n",
649 dev, otype, softp->instance, softp);
1141 iosram_master->instance, key));
1384 DPRINTF(1, ("iosram(%d): in iosram_softintr\n", softp->instance));
1400 softp->instance, softp->intr_busy, softp->intr_pending));
1414 "state=0x%x\n", softp->instance, softp->state));
1425 softp->instance, softp->state));
1440 softp->instance));
1459 softp->instance));
1511 softp->instance, i, (int)flag,
1522 softp->instance));
1545 softp->instance,
1583 DPRINTF(1, ("iosram(%d): softintr exit\n", softp->instance));
1600 DPRINTF(2, ("iosram(%d): in iosram_intr\n", softp->instance));
1611 softp->instance));
1647 softp->instance));
1658 DPRINTF(1, ("iosram(%d): iosram_intr exit\n", softp->instance));
1700 IOSRAMLOG(1, "IOCTL: dev:%p cmd:%x arg:%p ... instance %d\n",
1701 dev, cmd, arg, softp->instance);
1970 * Switch master tunnel to the specified instance
1978 int instance = softp->instance;
1986 (void *)softp, instance, (void *)iosram_master,
1987 ((iosram_master) ? iosram_master->instance : -1)));
1989 softp, instance, iosram_master,
1990 ((iosram_master) ? iosram_master->instance : -1));
2019 softp->instance));
2020 IOSRAMLOG(1, "TSWTCH: mapping instance:%d softp:%p\n",
2021 instance, softp, NULL, NULL);
2064 "TSWTCH: map failed instance:%d softp:%p error:%x\n",
2065 instance, softp, error, NULL);
2094 * when that instance is detached.
2129 prev_master, prev_master->instance, NULL, NULL);
2160 IOSRAMLOG(1, "TSWTCH: done error:%d iosram_master:%p instance:%d\n",
2162 (iosram_master) ? iosram_master->instance : -1, NULL);
2186 iosram_master, iosram_master->instance, iosram_new_master,
2187 (iosram_new_master == NULL) ? -1 : iosram_new_master->instance);
2210 iosram_master->instance, NULL, NULL, NULL);
2250 iosram_master->instance, NULL, NULL, NULL);
2260 iosram_master->instance, NULL, NULL, NULL);
2265 iosram_new_master->instance, NULL, NULL,
2272 iosram_new_master->instance, NULL, NULL,
2281 iosram_master->instance, NULL, NULL, NULL);
2289 iosram_master->instance, NULL, NULL, NULL);
2294 * iosram_switchfrom(instance)
2295 * Switch master tunnel away from the specified instance
2299 iosram_switchfrom(int instance)
2309 IOSRAMLOG(1, "SwtchFrom: instance:%d iosram_master:%p (%d)\n",
2310 instance, iosram_master,
2311 ((iosram_master) ? iosram_master->instance : -1), NULL);
2330 * Check if the specified instance holds the tunnel. If not,
2333 if ((iosram_master == NULL) || (iosram_master->instance != instance)) {
2369 * The specified instance holds the tunnel. We need to move it to some
2379 /* we can't switch _to_ the instance we're switching _from_ */
2380 if (softp->instance == instance) {
2390 * Try to avoid reverting to the last instance we switched away
2395 if (softp->instance == last_master_instance) {
2401 * Do the tunnel switch. If successful, record the instance of
2406 last_master_instance = instance;
2412 * If we failed to switch the tunnel, but we skipped over an instance
2415 * or the instance we skipped is finally being detached).
2422 last_master_instance = instance;
2446 * Check if this IOSRAM instance is tunnel-capable by looing at
2533 int instance = softp->instance;
2551 instance);
2557 instance, regprop->addr_hi,
2564 DPRINTF(1, ("SetupMap(%d): IOSRAM length: 0x%x\n", instance,
2575 instance, softp->iosramlen);
2588 instance);
2596 instance);
2670 softp->instance);
2675 softp->instance, nodeid, IOSRAM_CHOSEN_PROP));
2686 softp->instance, nodeid, chosen_iosram));
2690 softp->instance, (void *)softp->dip, pn));
2693 DPRINTF(1, ("iosram(%d): ... %s\n", softp->instance,
2695 IOSRAMLOG(1, "iosram(%d): ... %s\n", softp->instance,
2732 IOSRAMLOG(1, "SETMASTER: softp:%p instance:%d\n", softp,
2733 softp->instance, NULL, NULL);
2740 * Read the TOC from an IOSRAM instance that has been mapped in.
2747 int instance = softp->instance;
2769 instance));
2786 cmn_err(CE_WARN, "iosram(%d): invalid TOC index.\n", instance);
2811 instance, chunkp->toc_data.key,
2817 instance, i + 1, chunkp->toc_data.off,
2982 IOSRAMLOG(2, "ADDINTR: softp:%p instance:%d\n",
2983 softp, softp->instance, NULL, NULL);
2990 softp->instance);
2998 " handler.\n", softp->instance);
3019 IOSRAMLOG(2, "REMINTR: softp:%p instance:%d\n",
3020 softp, softp->instance, NULL, NULL);
3057 int instance = new_softp->instance;
3064 /* Verify that this instance is not in the list */
3066 ASSERT(softp->instance != instance);
3071 * Add this instance to the list
3083 * iosram_remove_instance(int instance)
3087 iosram_remove_instance(int instance)
3092 * Remove specified instance from the iosram_instances list so that
3098 if (softp->instance == instance) {
3164 "SBBC not mapped\n", softp->instance));
3185 "old value=0x%x rv=%d\n", softp->instance, sema_val, rv));
3236 "SBBC not mapped\n", softp->instance));
3247 softp->instance));
3333 * iosram_print_state(instance)
3336 iosram_print_state(int instance)
3341 if (instance < 0) {
3344 softp = ddi_get_soft_state(iosramsoft_statep, instance);
3348 cmn_err(CE_CONT, "iosram_print_state: Can't find instance %d\n",
3349 instance);
3352 instance = softp->instance;
3357 cmn_err(CE_CONT, "iosram_print_state(%d): ... %s\n", instance,
3362 cmn_err(CE_CONT, " instance:%d portid:%d iosramlen:0x%x\n",
3363 softp->instance, softp->portid, softp->iosramlen);