| 1171 | } |
| 1172 | |
| 1173 | static void |
| 1174 | ttydisc_wakeup_watermark(struct tty *tp) |
| 1175 | { |
| 1176 | size_t c; |
| 1177 | |
| 1178 | c = ttyoutq_bytesleft(&tp->t_outq); |
| 1179 | if (tp->t_flags & TF_HIWAT_OUT) { |
| 1180 | /* Only allow us to run when we're below the watermark. */ |
| 1181 | if (c < tp->t_outlow) |
| 1182 | return; |
| 1183 | |
| 1184 | /* Reset the watermark. */ |
| 1185 | tp->t_flags &= ~TF_HIWAT_OUT; |
| 1186 | } else { |
| 1187 | /* Only run when we have data at all. */ |
| 1188 | if (c == 0) |
| 1189 | return; |
| 1190 | } |
| 1191 | tty_wakeup(tp, FWRITE); |
| 1192 | } |
| 1193 | |
| 1194 | size_t |
| 1195 | ttydisc_getc(struct tty *tp, void *buf, size_t len) |
no test coverage detected