Lines Matching refs:srn

29  * srn	Provide apm-like interfaces to Xorg
55 #include <sys/srn.h>
70 * The soft state of the srn driver. Since there will only be
82 } srn = { NULL, -1};
140 "srn driver",
177 if (srn.srn_instance != -1) /* Only allow one instance */
179 srn.srn_instance = ddi_get_instance(dip);
180 if (ddi_create_minor_node(dip, "srn", S_IFCHR,
181 (srn.srn_instance << 8) + 0, DDI_PSEUDO, 0)
185 srn.srn_dip = dip; /* srn_init and getinfo depend on it */
190 srn.srn_instance = ddi_get_instance(dip);
226 srn.srn_instance = -1;
282 if (srn.srn_instance == -1)
284 *result = srn.srn_dip;
310 if (!srn.srn_clones[clone])
317 srn.srn_cred[clone] = cr;
320 srn.srn_type[clone] = SRN_TYPE_APM;
323 *devp = makedevice(getmajor(*devp), (srn.srn_instance << 8) +
325 srn.srn_clones[clone] = 1;
326 srn.srn_cred[clone] = cr;
329 PMD(PMD_SX, ("srn open OK\n"))
346 crfree(srn.srn_cred[clone]);
347 srn.srn_cred[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;
355 switch (srn.srn_type[clone]) {
368 srn.srn_clones[clone] = 0;
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]) {
435 srn.srn_fault[clone] = 0;
444 ASSERT(srn.srn_pending[clone].ae_type);
445 if (ddi_copyout(&srn.srn_pending[clone], (void *)arg,
452 if (srn.srn_type[clone] == SRN_TYPE_APM)
453 srn.srn_delivered[clone] =
454 srn.srn_pending[clone].ae_type;
456 clone, srn.srn_pending[clone].ae_type))
464 if (srn.srn_fault[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;
486 if (srn.srn_fault[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;
511 * A very simple handshake with the srn driver,
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);
550 ASSERT(srn.srn_delivered[clone] == 0);
553 srn.srn_pending[clone].ae_type = event;
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]) {
592 srn.srn_fault[clone] = 1;