Lines Matching +full:parallel +full:- +full:in

4  * Copyright (c) 2003-2008 Fabrice Bellard
8 * in the Software without restriction, including without limitation the rights
13 * The above copyright notice and this permission notice shall be included in
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
47 #include "chardev/char-fd.h"
48 #include "chardev/char-parallel.h"
63 if (s->mode != mode) { in pp_hw_mode()
65 if (ioctl(s->fd, PPSETMODE, &m) < 0) { in pp_hw_mode()
68 s->mode = mode; in pp_hw_mode()
76 int fd = drv->fd; in pp_ioctl()
82 return -ENOTSUP; in pp_ioctl()
89 return -ENOTSUP; in pp_ioctl()
94 return -ENOTSUP; in pp_ioctl()
104 return -ENOTSUP; in pp_ioctl()
109 return -ENOTSUP; in pp_ioctl()
115 return -ENOTSUP; in pp_ioctl()
121 int n = read(fd, parg->buffer, parg->count); in pp_ioctl()
122 if (n != parg->count) { in pp_ioctl()
123 return -EIO; in pp_ioctl()
130 int n = read(fd, parg->buffer, parg->count); in pp_ioctl()
131 if (n != parg->count) { in pp_ioctl()
132 return -EIO; in pp_ioctl()
139 int n = write(fd, parg->buffer, parg->count); in pp_ioctl()
140 if (n != parg->count) { in pp_ioctl()
141 return -EIO; in pp_ioctl()
148 int n = write(fd, parg->buffer, parg->count); in pp_ioctl()
149 if (n != parg->count) { in pp_ioctl()
150 return -EIO; in pp_ioctl()
155 return -ENOTSUP; in pp_ioctl()
167 drv->fd = fd; in qemu_chr_open_pp_fd()
170 error_setg_errno(errp, errno, "not a parallel port"); in qemu_chr_open_pp_fd()
174 drv->mode = IEEE1284_MODE_COMPAT; in qemu_chr_open_pp_fd()
195 if (ioctl(drv->fd, PPIGDATA, &b) < 0) { in pp_ioctl()
196 return -ENOTSUP; in pp_ioctl()
202 if (ioctl(drv->fd, PPISDATA, &b) < 0) { in pp_ioctl()
203 return -ENOTSUP; in pp_ioctl()
207 if (ioctl(drv->fd, PPIGCTRL, &b) < 0) { in pp_ioctl()
208 return -ENOTSUP; in pp_ioctl()
214 if (ioctl(drv->fd, PPISCTRL, &b) < 0) { in pp_ioctl()
215 return -ENOTSUP; in pp_ioctl()
219 if (ioctl(drv->fd, PPIGSTATUS, &b) < 0) { in pp_ioctl()
220 return -ENOTSUP; in pp_ioctl()
225 return -ENOTSUP; in pp_ioctl()
236 drv->fd = fd; in qemu_chr_open_pp_fd()
247 ChardevHostdev *parallel = backend->u.parallel.data; in qmp_chardev_open_parallel() local
250 fd = qmp_chardev_open_file_source(parallel->device, O_RDWR, errp); in qmp_chardev_open_parallel()
261 ChardevHostdev *parallel; in qemu_chr_parse_parallel() local
264 error_setg(errp, "chardev: parallel: no device path given"); in qemu_chr_parse_parallel()
267 backend->type = CHARDEV_BACKEND_KIND_PARALLEL; in qemu_chr_parse_parallel()
268 parallel = backend->u.parallel.data = g_new0(ChardevHostdev, 1); in qemu_chr_parse_parallel()
269 qemu_chr_parse_common(opts, qapi_ChardevHostdev_base(parallel)); in qemu_chr_parse_parallel()
270 parallel->device = g_strdup(device); in qemu_chr_parse_parallel()
277 cc->parse = qemu_chr_parse_parallel; in char_parallel_class_init()
278 cc->open = qmp_chardev_open_parallel; in char_parallel_class_init()
279 cc->chr_ioctl = pp_ioctl; in char_parallel_class_init()
286 int fd = drv->fd; in char_parallel_finalize()