Lines Matching defs:ctx
97 terrible_ping_kludge(struct hid_openbsd *ctx)
103 if (sizeof(data) < ctx->report_out_len + 1)
118 if (fido_hid_write(ctx, data, ctx->report_out_len + 1) == -1)
122 pfd.fd = ctx->fd;
131 if (fido_hid_read(ctx, data, ctx->report_out_len, 250) == -1)
139 fido_log_xxd(data, ctx->report_out_len, "%s", __func__);
176 struct hid_openbsd *ctx = (struct hid_openbsd *)handle;
178 if (close(ctx->fd) == -1)
181 free(ctx);
187 struct hid_openbsd *ctx = handle;
189 ctx->sigmask = *sigmask;
190 ctx->sigmaskp = &ctx->sigmask;
198 struct hid_openbsd *ctx = (struct hid_openbsd *)handle;
201 if (len != ctx->report_in_len) {
203 len, ctx->report_in_len);
207 if (fido_hid_unix_wait(ctx->fd, ms, ctx->sigmaskp) < 0) {
212 if ((r = read(ctx->fd, buf, len)) == -1) {
228 struct hid_openbsd *ctx = (struct hid_openbsd *)handle;
231 if (len != ctx->report_out_len + 1) {
233 len, ctx->report_out_len);
237 if ((r = write(ctx->fd, buf + 1, len - 1)) == -1) {
253 struct hid_openbsd *ctx = handle;
255 return (ctx->report_in_len);
261 struct hid_openbsd *ctx = handle;
263 return (ctx->report_out_len);