913 sp->cons_fb_path);
914 return;
915 }
916
917 #ifdef _HAVE_TEM_FIRMWARE
918 /*
919 * If the underlying fb device doesn't support terminal emulation,
920 * we don't want to open the wc device (below) because it depends
921 * on features which aren't available (polled mode io).
922 */
923 if (!sp->cons_tem_supported)
924 return;
925 #endif /* _HAVE_TEM_FIRMWARE */
926
927 /* tell wc to open the frame buffer device */
928 wc_dev = sp->cons_wc_vp->v_rdev;
929 if (ldi_open_by_dev(&wc_dev, OTYP_CHR, FREAD|FWRITE|FNOCTTY, kcred,
930 &wc_lh, sp->cons_li)) {
931 cmn_err(CE_PANIC, "cons_build_upper_layer: "
932 "unable to open wc device");
933 return;
934 }
935 ASSERT(wc_dev == sp->cons_wc_vp->v_rdev);
936
937 strioc.ic_cmd = WC_OPEN_FB;
938 strioc.ic_timout = INFTIM;
939 strioc.ic_len = strlen(sp->cons_fb_path) + 1;
940 strioc.ic_dp = sp->cons_fb_path;
941
942 if (ldi_ioctl(wc_lh, I_STR, (intptr_t)&strioc,
943 FKIOCTL, kcred, &rval) == 0)
944 consmode = CONS_KFB;
945 else
946 cmn_err(CE_WARN,
947 "consconfig: terminal emulator failed to initialize");
948 (void) ldi_close(wc_lh, FREAD|FWRITE, kcred);
949 }
950
951 static void
952 consconfig_load_drivers(cons_state_t *sp)
953 {
|
913 sp->cons_fb_path);
914 return;
915 }
916
917 #ifdef _HAVE_TEM_FIRMWARE
918 /*
919 * If the underlying fb device doesn't support terminal emulation,
920 * we don't want to open the wc device (below) because it depends
921 * on features which aren't available (polled mode io).
922 */
923 if (!sp->cons_tem_supported)
924 return;
925 #endif /* _HAVE_TEM_FIRMWARE */
926
927 /* tell wc to open the frame buffer device */
928 wc_dev = sp->cons_wc_vp->v_rdev;
929 if (ldi_open_by_dev(&wc_dev, OTYP_CHR, FREAD|FWRITE|FNOCTTY, kcred,
930 &wc_lh, sp->cons_li)) {
931 cmn_err(CE_PANIC, "cons_build_upper_layer: "
932 "unable to open wc device");
933 }
934 ASSERT(wc_dev == sp->cons_wc_vp->v_rdev);
935
936 strioc.ic_cmd = WC_OPEN_FB;
937 strioc.ic_timout = INFTIM;
938 strioc.ic_len = strlen(sp->cons_fb_path) + 1;
939 strioc.ic_dp = sp->cons_fb_path;
940
941 if (ldi_ioctl(wc_lh, I_STR, (intptr_t)&strioc,
942 FKIOCTL, kcred, &rval) == 0)
943 consmode = CONS_KFB;
944 else
945 cmn_err(CE_WARN,
946 "consconfig: terminal emulator failed to initialize");
947 (void) ldi_close(wc_lh, FREAD|FWRITE, kcred);
948 }
949
950 static void
951 consconfig_load_drivers(cons_state_t *sp)
952 {
|