971
972 mutex_enter(&cvc_bbsram_input_mutex);
973 /* Poll BBSRAM for input */
974 do {
975 if (stop_bbsram) {
976 *cp = '\0'; /* set string to zero-length */
977 mutex_exit(&cvc_bbsram_input_mutex);
978 return;
979 }
980 /*
981 * Use a smaller delay between checks of BBSRAM for input
982 * when cvcd/cvcredir are not running or "via_bbsram" has
983 * been set.
984 * We don't go away completely when i/o is going through the
985 * network via cvcd since a command may be sent via BBSRAM
986 * to switch if the network is down or hung.
987 */
988 if ((cvcoutput_q == NULL) || (via_bbsram))
989 delay(drv_usectohz(100000));
990 else
991 delay(drv_usectohz(1000000));
992 cvc_bbsram_ops(BBSRAM_CONTROL_REG);
993 count = BBSRAM_INPUT_COUNT;
994 } while (count == 0);
995
996 lp = BBSRAM_INPUT_BUF - count;
997
998 while (count--) {
999 *cp++ = *lp++;
1000 }
1001 *cp = '\0';
1002
1003 BBSRAM_INPUT_COUNT = 0;
1004 mutex_exit(&cvc_bbsram_input_mutex);
1005 }
1006
1007
1008 /*
1009 * cvc_input_daemon()
1010 * this function runs as a separate kernel thread and polls BBSRAM for
1011 * input, and possibly put it on read stream for the console.
|
971
972 mutex_enter(&cvc_bbsram_input_mutex);
973 /* Poll BBSRAM for input */
974 do {
975 if (stop_bbsram) {
976 *cp = '\0'; /* set string to zero-length */
977 mutex_exit(&cvc_bbsram_input_mutex);
978 return;
979 }
980 /*
981 * Use a smaller delay between checks of BBSRAM for input
982 * when cvcd/cvcredir are not running or "via_bbsram" has
983 * been set.
984 * We don't go away completely when i/o is going through the
985 * network via cvcd since a command may be sent via BBSRAM
986 * to switch if the network is down or hung.
987 */
988 if ((cvcoutput_q == NULL) || (via_bbsram))
989 delay(drv_usectohz(100000));
990 else
991 delay(drv_sectohz(1));
992 cvc_bbsram_ops(BBSRAM_CONTROL_REG);
993 count = BBSRAM_INPUT_COUNT;
994 } while (count == 0);
995
996 lp = BBSRAM_INPUT_BUF - count;
997
998 while (count--) {
999 *cp++ = *lp++;
1000 }
1001 *cp = '\0';
1002
1003 BBSRAM_INPUT_COUNT = 0;
1004 mutex_exit(&cvc_bbsram_input_mutex);
1005 }
1006
1007
1008 /*
1009 * cvc_input_daemon()
1010 * this function runs as a separate kernel thread and polls BBSRAM for
1011 * input, and possibly put it on read stream for the console.
|