Lines Matching refs:vhd
50 struct raw_vhd *vhd = (struct raw_vhd *)lws_protocol_vh_priv_get(
62 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
64 vhd->filefd = lws_open(filepath, O_RDWR);
65 if (vhd->filefd == -1) {
71 tcflush(vhd->filefd, TCIOFLUSH);
74 if (ioctl(vhd->filefd, TIOCGSERIAL, &s_s) == 0) {
76 ioctl(vhd->filefd, TIOCSSERIAL, &s_s);
83 if (tcgetattr(vhd->filefd, &tio)) {
84 close(vhd->filefd);
85 vhd->filefd = -1;
119 tcsetattr(vhd->filefd, TCSANOW, &tio);
121 u.filefd = (lws_filefd_type)(long long)vhd->filefd;
126 close(vhd->filefd);
127 vhd->filefd = -1;
135 if (vhd && vhd->filefd != -1)
136 close(vhd->filefd);
143 vhd->wsi = wsi;
144 lws_sul_schedule(lws_get_context(wsi), 0, &vhd->sul, sul_cb, 1);
149 n = (int)read(vhd->filefd, buf, sizeof(buf));
160 lws_sul_cancel(&vhd->sul);