Lines Matching refs:clone

58  * Minor number is instance<<8 + clone minor from range 1-255;
259 int clone;
261 clone = SRN_MINOR_TO_CLONE(getminor(dev));
262 if ((events & (POLLIN | POLLRDNORM)) && srn_poll_cnt[clone]) {
267 *phpp = &srn_pollhead[clone];
303 int clone;
309 for (clone = 1; clone < SRN_MAX_CLONE - 1; clone++)
310 if (!srn.srn_clones[clone])
313 if (clone == SRN_MAX_CLONE) {
317 srn.srn_cred[clone] = cr;
320 srn.srn_type[clone] = SRN_TYPE_APM;
324 clone);
325 srn.srn_clones[clone] = 1;
326 srn.srn_cred[clone] = cr;
337 int clone;
342 clone = SRN_MINOR_TO_CLONE(getminor(dev));
343 PMD(PMD_SX, ("srn_close: minor %x, clone %x\n", getminor(dev),
344 clone))
346 crfree(srn.srn_cred[clone]);
347 srn.srn_cred[clone] = 0;
348 srn_poll_cnt[clone] = 0;
349 srn.srn_fault[clone] = 0;
350 if (srn.srn_pending[clone].ae_type || srn.srn_delivered[clone]) {
351 srn.srn_pending[clone].ae_type = 0;
352 srn.srn_delivered[clone] = 0;
353 cv_signal(&srn_clones_cv[clone]);
355 switch (srn.srn_type[clone]) {
368 srn.srn_clones[clone] = 0;
377 int clone = SRN_MINOR_TO_CLONE(getminor(dev));
391 if (!srn_perms(SU | SG, srn.srn_cred[clone])) {
398 if (!srn.srn_clones[clone]) {
403 if (srn.srn_pending[clone].ae_type) {
408 if (srn.srn_type[clone] == SRN_TYPE_AUTOSX) {
413 ASSERT(srn.srn_type[clone] == SRN_TYPE_APM);
414 srn.srn_type[clone] = SRN_TYPE_AUTOSX;
415 srn.srn_fault[clone] = 0;
432 if (srn.srn_fault[clone]) {
433 PMD(PMD_SX, ("SRN_IOC_NEXTEVENT clone %d fault "
434 "cleared\n", clone))
435 srn.srn_fault[clone] = 0;
438 if (srn_poll_cnt[clone] == 0) {
440 PMD(PMD_SX, ("SRN_IOC_NEXTEVENT clone %d "
441 "EWOULDBLOCK\n", clone))
444 ASSERT(srn.srn_pending[clone].ae_type);
445 if (ddi_copyout(&srn.srn_pending[clone], (void *)arg,
448 PMD(PMD_SX, ("SRN_IOC_NEXTEVENT clone %d EFAULT\n",
449 clone))
452 if (srn.srn_type[clone] == SRN_TYPE_APM)
453 srn.srn_delivered[clone] =
454 srn.srn_pending[clone].ae_type;
455 PMD(PMD_SX, ("SRN_IOC_NEXTEVENT clone %d delivered %x\n",
456 clone, srn.srn_pending[clone].ae_type))
457 srn_poll_cnt[clone] = 0;
463 PMD(PMD_SX, ("SRN_IOC_SUSPEND entered clone %d\n", clone))
464 if (srn.srn_fault[clone]) {
465 PMD(PMD_SX, ("SRN_IOC_SUSPEND clone %d fault "
466 "cleared\n", clone))
467 srn.srn_fault[clone] = 0;
470 if (srn.srn_delivered[clone] != SRN_SUSPEND_REQ) {
475 srn.srn_delivered[clone] = 0;
476 srn.srn_pending[clone].ae_type = 0;
478 PMD(PMD_SX, ("SRN_IOC_SUSPEND clone %d ok\n", clone))
479 cv_signal(&srn_clones_cv[clone]);
485 PMD(PMD_SX, ("SRN_IOC_RESUME entered clone %d\n", clone))
486 if (srn.srn_fault[clone]) {
487 PMD(PMD_SX, ("SRN_IOC_RESUME clone %d fault "
488 "cleared\n", clone))
489 srn.srn_fault[clone] = 0;
492 if (srn.srn_delivered[clone] != SRN_NORMAL_RESUME) {
497 srn.srn_delivered[clone] = 0;
498 srn.srn_pending[clone].ae_type = 0;
500 PMD(PMD_SX, ("SRN_IOC_RESUME ok for clone %d\n", clone))
501 cv_signal(&srn_clones_cv[clone]);
519 int clone, count;
544 for (clone = 0; clone < SRN_MAX_CLONE; clone++) {
545 if (srn.srn_type[clone] == type) {
547 if (type == SRN_TYPE_APM && !srn.srn_fault[clone]) {
548 ASSERT(srn.srn_pending[clone].ae_type == 0);
549 ASSERT(srn_poll_cnt[clone] == 0);
550 ASSERT(srn.srn_delivered[clone] == 0);
553 srn.srn_pending[clone].ae_type = event;
554 srn_poll_cnt[clone] = 1;
555 PMD(PMD_SX, ("pollwake %d\n", clone))
556 pollwakeup(&srn_pollhead[clone], (POLLRDNORM | POLLIN));
574 for (clone = 1; clone < SRN_MAX_CLONE; clone++) {
575 if (srn.srn_clones[clone] == 0 ||
576 srn.srn_type[clone] != SRN_TYPE_APM)
578 if (srn.srn_pending[clone].ae_type && !srn.srn_fault[clone]) {
579 PMD(PMD_SX, ("srn_notify waiting for ack for clone %d, "
580 "event %x\n", clone, event))
581 if (cv_timedwait(&srn_clones_cv[clone],
588 PMD(PMD_SX, ("srn_notify: clone %d did not "
589 "ack event %x\n", clone, event))
590 cmn_err(CE_WARN, "srn_notify: clone %d did "
591 "not ack event %x\n", clone, event);
592 srn.srn_fault[clone] = 1;