Lines Matching refs:cn

220 			sm_console_t *cn = &sp->sm_cons_links[j];
221 if (cn->sm_mode & FORINPUT)
223 if (cn->sm_mode & FOROUTPUT)
225 if (cn->sm_mode == FORIO)
401 sm_console_t *cn;
404 for (cn = ms->sm_cons_links, j = 0;
405 j < ms->sm_cons_cnt; cn++, j++) {
406 if (cn->sm_path && strcmp(cn->sm_path, path) == 0)
411 cn = NULL;
413 bzero((caddr_t)cn, sizeof (*cn));
417 return (cn);
428 sm_console_t *cn;
452 if ((cn = get_aconsole(ms, cpath)) != NULL) {
453 cn->sm_obp_con = ((uint_t)(uintptr_t)arg & OBPDEV) ?
455 cn->sm_mode |= (io_mode_t)((uint_t)(uintptr_t)arg & FORIO);
456 if (cn->sm_path != NULL)
457 kmem_free(cn->sm_path, strlen(cn->sm_path) + 1);
458 cn->sm_path = cpath;
472 sm_console_t *cn;
502 if ((cn = get_aconsole(ms, devpath)) == 0) {
508 cn->sm_mode |= mode;
509 cn->sm_obp_con = B_TRUE;
511 cn->sm_i_ihdl = ihdls[i];
513 cn->sm_o_ihdl = ihdls[i];
514 if (cn->sm_path == NULL) {
515 cn->sm_path = kmem_alloc(strlen(devpath) + 1, KM_SLEEP);
516 (void) strcpy(cn->sm_path, devpath);
600 link_aconsole(vnode_t *mux_avp, sm_console_t *cn)
608 ASSERT(cn->sm_path);
611 if ((rv = open_stream(&lvp, &lfd, cn->sm_dev)) != 0)
640 FREAD+FWRITE+FNOCTTY, K_TO_K, CRED(), &(cn->sm_muxid))) != 0) {
652 assoc.ttymux_ldev = cn->sm_dev;
653 assoc.ttymux_linkid = cn->sm_muxid;
655 assoc.ttymux_ioflag = cn->sm_mode;
660 getmajor(cn->sm_dev), getminor(cn->sm_dev));
662 if (strioctl(mux_avp, I_PUNLINK, (intptr_t)cn->sm_muxid, 0,
666 getmajor(cn->sm_dev), getminor(cn->sm_dev));
678 enable_aconsole(sm_mux_state_t *ms, sm_console_t *cn, vnode_t *muxvp)
682 ASSERT(cn && cn->sm_dev != NODEV);
684 assoc.ttymux_ldev = cn->sm_dev;
686 cn->sm_muxid = (ioctl_cmd(muxvp, TTYMUX_GETLINK,
689 if (cn->sm_muxid != 0)
692 return (link_aconsole(muxvp, cn));
702 sm_console_t *cn;
706 for (cn = ms->sm_cons_links, j = 0;
707 j < ms->sm_cons_cnt; cn++, j++) {
709 if (cn->sm_path == NULL)
712 if ((strstr(cn->sm_path, "/dev") == cn->sm_path &&
713 (cn->sm_dev = fs_devtype(cn->sm_path)) == NODEV) ||
714 (cn->sm_dev = di_devtype(cn->sm_path)) == NODEV) {
718 cn->sm_path ? cn->sm_path : "");
722 getmajor(cn->sm_dev), getminor(cn->sm_dev));
728 if (compatible_console(cn->sm_dev) == B_FALSE)
736 (void) enable_aconsole(ms, cn, muxvp);
898 sm_console_t *cn = &ms->sm_cons_links[i];
899 if (cn->sm_path)
900 kmem_free(cn->sm_path, strlen(cn->sm_path) + 1);