Lines Matching refs:cn
182 enable_device(sm_mux_state_t *ms, sm_console_t *cn)
186 if (!cn->sm_obp_con)
190 getmajor(cn->sm_dev), getminor(cn->sm_dev)));
192 if (cn->sm_i_ihdl != 0)
194 (caddr32_t)cn->sm_i_ihdl, 0, 0, 0);
196 if (cn->sm_o_ihdl != 0 && cn->sm_o_ihdl != cn->sm_i_ihdl)
198 (caddr32_t)cn->sm_o_ihdl, 0, 0, 0);
205 disable_device(sm_mux_state_t *ms, sm_console_t *cn)
209 if (!cn->sm_obp_con)
213 getmajor(cn->sm_dev), getminor(cn->sm_dev)));
215 if (cn->sm_i_ihdl != 0)
217 (caddr32_t)cn->sm_i_ihdl, 0, 0, 0);
218 if (cn->sm_o_ihdl != 0 && cn->sm_o_ihdl != cn->sm_i_ihdl)
220 (caddr32_t)cn->sm_o_ihdl, 0, 0, 0);
224 device_init_impl(sm_mux_state_t *ms, sm_console_t *cn, sm_lqi_t *plqi)
231 if (plqi == NULL || cn == NULL)
234 flags = (uint_t)cn->sm_mode;
236 cn->sm_obp_con));
237 if (ldip = e_ddi_hold_devi_by_dev(cn->sm_dev, 0)) {
244 (void) e_ddi_prop_create(cn->sm_dev, ldip,
247 (void) e_ddi_prop_create(cn->sm_dev, ldip,
255 if (cn->sm_obp_con)
264 enable_device(ms, cn);
268 device_fini_impl(sm_mux_state_t *ms, sm_console_t *cn, sm_lqi_t *plqi)
272 if (plqi == NULL || cn == NULL)
290 disable_device(ms, cn);
495 sm_console_t *cn;
520 for (cn = ms->sm_cons_links, j = 0;
521 j < ms->sm_cons_cnt; cn++, j++) {
523 cn->sm_dev) {
525 } else if (cn->sm_path != NULL &&
526 strncmp(cn->sm_path, assoc->ttymux_path, MAXPATHLEN) == 0) {
545 device_fini_impl(ms, cn, get_lqi_bydevt(assoc->ttymux_ldev));
547 if (cn->sm_path == NULL) {
549 cn->sm_path = sm_di_path(assoc->ttymux_ldev);
554 if (cn->sm_path) {
555 (void) update_config(ms, cn->sm_path, cn->sm_mode, cmd);
556 kmem_free(cn->sm_path, strlen(cn->sm_path) + 1);
557 cn->sm_path = NULL;
561 *cn = ms->sm_cons_links[ms->sm_cons_cnt];
577 bzero((caddr_t)cn, sizeof (*cn));
578 cn->sm_dev = assoc->ttymux_ldev;
579 cn->sm_muxid = assoc->ttymux_linkid;
580 cn->sm_mode = assoc->ttymux_ioflag;
581 device_init_impl(ms, cn,
584 cn->sm_dev = assoc->ttymux_ldev;
585 cn->sm_muxid = assoc->ttymux_linkid;
586 cn->sm_mode = assoc->ttymux_ioflag;
590 cn->sm_path = sm_di_path(assoc->ttymux_ldev);
592 cn->sm_path = kmem_alloc(strlen(assoc->ttymux_path) + 1,
594 (void) strcpy(cn->sm_path, assoc->ttymux_path);
596 if (cn->sm_path != NULL)
597 (void) update_config(ms, cn->sm_path, cn->sm_mode, cmd);
610 sm_console_t *cn;
617 for (cn = ms->sm_cons_links, cnt = j = 0; j < ms->sm_cons_cnt;
618 cn++, j++) {
619 if (cn->sm_path && get_lqi_bydevt(cn->sm_dev) == NULL) {
620 a->ttymux_linkid = cn->sm_muxid;
622 a->ttymux_ioflag = cn->sm_mode;
623 a->ttymux_udev = cn->sm_mode & FORINPUT ?
627 (void) strncpy(a->ttymux_path, cn->sm_path, MAXPATHLEN);
643 sm_console_t *cn;
650 for (cn = ms->sm_cons_links, cnt = j = 0; j < ms->sm_cons_cnt;
651 cn++, j++) {
653 cn->sm_path ? cn->sm_path : "NULL",
654 getmajor(cn->sm_dev), getminor(cn->sm_dev)));
655 if (cn->sm_path && get_lqi_bydevt(cn->sm_dev) == NULL) {
658 a->ttymux32_ioflag = (uint32_t)cn->sm_mode;
660 (void) cmpldev(&a->ttymux32_udev, cn->sm_mode &
664 (void) strncpy(a->ttymux32_path, cn->sm_path,
678 sm_console_t *cn;
685 for (cn = ms->sm_cons_links, cnt = j = 0; j < ms->sm_cons_cnt;
686 cn++, j++) {
688 cn->sm_path ? cn->sm_path : "NULL",
689 getmajor(cn->sm_dev), getminor(cn->sm_dev)));
690 if (cn->sm_path && get_lqi_bydevt(cn->sm_dev) == NULL)