Lines Matching defs:buf
214 char *buf[HID_STRING_DESC_NUM] = {NULL};
250 buf[i] = (char *)malloc(len);
251 if (buf[i] == NULL)
256 g_fhid_device_strings[i + 1].s = buf[i];
258 *buf[i] = (char)len;
259 *(buf[i] + 1) = UDESC_STRING;
263 (void)memcpy_s(buf[i] + HID_STRING_HEAD_LEN, (size_t)str_desc[i]->len,
272 if (buf[i] != NULL)
274 free(buf[i]);
280 int hid_report_descriptor_info(const void *buf, size_t len)
284 if (buf == NULL || len == 0)
286 usb_err("%s failed, buf is NULL or len is 0\n", __FUNCTION__);
302 (void)memcpy_s(report_desc, len, buf, len);
350 ret = memcpy_s(hid->read_buf, HID_OUT_DATA_SIZE, req->buf, req->xfrd);
465 hid->outputreq.buf = NULL;
492 hid->inputreq.buf = NULL;
601 req->buf = (uint8_t *)hid->read_buf;
621 ret = memcpy_s(req->buf, USB_COMP_EP0_BUFSIZ,
699 ret = memset_s(req->buf, req->len, 0, req->len);
719 ret = memset_s(req->buf, req->len, 0, req->len);
828 static void hid_mkdevdesc(uint8_t *buf)
830 errno_t ret = memcpy_s(buf, USB_COMP_EP0_BUFSIZ, &g_fhid_device_desc, sizeof(g_fhid_device_desc));
838 static int16_t hid_mkcfgdesc(uint8_t *buf, struct usbdev_devinfo_s *devinfo)
851 ret = memcpy_s(buf, USB_COMP_EP0_BUFSIZ, des, total_len);
864 static int hid_mkstrdesc(uint8_t id, uint8_t *buf)
875 ret = memcpy_s(buf, USB_COMP_EP0_BUFSIZ, (const void *)str, (uint32_t)str[0]);