Lines Matching +full:product +full:- +full:name

2  * Copyright (c) 2019-2022 Yubico AB. All rights reserved.
3 * Use of this source code is governed by a BSD-style
5 * SPDX-License-Identifier: BSD-2-Clause
33 int s = -1; in get_report_descriptor()
35 if (ioctl(fd, IOCTL_REQ(HIDIOCGRDESCSIZE), &s) == -1) { in get_report_descriptor()
37 return (-1); in get_report_descriptor()
42 return (-1); in get_report_descriptor()
45 hrd->size = (unsigned)s; in get_report_descriptor()
47 if (ioctl(fd, IOCTL_REQ(HIDIOCGRDESC), hrd) == -1) { in get_report_descriptor()
49 return (-1); in get_report_descriptor()
58 int fd = -1; in is_fido()
63 (fd = fido_hid_unix_open(path)) == -1) in is_fido()
66 fido_hid_get_usage(hrd->value, hrd->size, &usage_page) < 0) in is_fido()
72 if (fd != -1 && close(fd) == -1) in is_fido()
85 int ok = -1; in parse_uevent()
91 return (-1); in parse_uevent()
135 const char *name; in copy_info() local
140 int ok = -1; in copy_info()
144 if ((name = udev_list_entry_get_name(udev_entry)) == NULL || in copy_info()
145 (dev = udev_device_new_from_syspath(udev, name)) == NULL || in copy_info()
151 parse_uevent(uevent, &bus, &di->vendor_id, &di->product_id) < 0) { in copy_info()
163 di->path = strdup(path); in copy_info()
164 if ((di->manufacturer = get_usb_attr(dev, "manufacturer")) == NULL) in copy_info()
165 di->manufacturer = strdup(""); in copy_info()
166 if ((di->product = get_usb_attr(dev, "product")) == NULL) in copy_info()
167 di->product = strdup(""); in copy_info()
168 if (di->path == NULL || di->manufacturer == NULL || di->product == NULL) in copy_info()
179 free(di->path); in copy_info()
180 free(di->manufacturer); in copy_info()
181 free(di->product); in copy_info()
254 (ctx->fd = fido_hid_unix_open(path)) == -1) { in fido_hid_open()
259 while (flock(ctx->fd, LOCK_EX|LOCK_NB) == -1) { in fido_hid_open()
274 if (nanosleep(&tv_pause, NULL) == -1) { in fido_hid_open()
288 get_report_descriptor(ctx->fd, hrd) < 0 || in fido_hid_open()
289 fido_hid_get_report_len(hrd->value, hrd->size, &ctx->report_in_len, in fido_hid_open()
290 &ctx->report_out_len) < 0 || ctx->report_in_len == 0 || in fido_hid_open()
291 ctx->report_out_len == 0) { in fido_hid_open()
293 ctx->report_in_len = CTAP_MAX_REPORT_LEN; in fido_hid_open()
294 ctx->report_out_len = CTAP_MAX_REPORT_LEN; in fido_hid_open()
307 if (close(ctx->fd) == -1) in fido_hid_close()
318 ctx->sigmask = *sigmask; in fido_hid_set_sigmask()
319 ctx->sigmaskp = &ctx->sigmask; in fido_hid_set_sigmask()
330 if (len != ctx->report_in_len) { in fido_hid_read()
332 return (-1); in fido_hid_read()
335 if (fido_hid_unix_wait(ctx->fd, ms, ctx->sigmaskp) < 0) { in fido_hid_read()
337 return (-1); in fido_hid_read()
340 if ((r = read(ctx->fd, buf, len)) == -1) { in fido_hid_read()
342 return (-1); in fido_hid_read()
347 return (-1); in fido_hid_read()
359 if (len != ctx->report_out_len + 1) { in fido_hid_write()
361 return (-1); in fido_hid_write()
364 if ((r = write(ctx->fd, buf, len)) == -1) { in fido_hid_write()
366 return (-1); in fido_hid_write()
371 return (-1); in fido_hid_write()
382 return (ctx->report_in_len); in fido_hid_report_in_len()
390 return (ctx->report_out_len); in fido_hid_report_out_len()