Lines Matching full:ep
24 uint8_t ep; member
49 static struct usb_transfer_data *usb_ep_get_transfer(uint8_t ep) in usb_ep_get_transfer() argument
52 if (ut_data[i].ep == ep && ut_data[i].status != 0) { in usb_ep_get_transfer()
60 bool usb_transfer_is_busy(uint8_t ep) in usb_transfer_is_busy() argument
62 struct usb_transfer_data *trans = usb_ep_get_transfer(ep); in usb_transfer_is_busy()
76 uint8_t ep; in usb_transfer_work() local
79 ep = trans->ep; in usb_transfer_work()
83 LOG_DBG("Transfer cancelled or completed, ep 0x%02x", ep); in usb_transfer_work()
102 ret = usb_write(ep, trans->buffer, trans->bsize, &bytes); in usb_transfer_work()
104 LOG_ERR("Transfer error %d, ep 0x%02x", ret, ep); in usb_transfer_work()
114 ret = usb_dc_ep_read_wait(ep, trans->buffer, trans->bsize, in usb_transfer_work()
117 LOG_ERR("Transfer error %d, ep 0x%02x", ret, ep); in usb_transfer_work()
128 if (!bytes || (bytes % usb_dc_ep_mps(ep)) || !trans->bsize) { in usb_transfer_work()
135 usb_dc_ep_read_continue(ep); in usb_transfer_work()
150 LOG_DBG("Transfer done, ep 0x%02x, status %d, size %zu", in usb_transfer_work()
151 trans->ep, trans->status, trans->tsize); in usb_transfer_work()
158 cb(ep, tsize, priv); in usb_transfer_work()
163 void usb_transfer_ep_callback(uint8_t ep, enum usb_dc_ep_cb_status_code status) in usb_transfer_ep_callback() argument
165 struct usb_transfer_data *trans = usb_ep_get_transfer(ep); in usb_transfer_ep_callback()
183 usb_dc_ep_read_wait(ep, &data, 1, &bytes); in usb_transfer_ep_callback()
200 int usb_transfer(uint8_t ep, uint8_t *data, size_t dlen, unsigned int flags, in usb_transfer() argument
207 if (usb_transfer_is_busy(ep)) { in usb_transfer()
211 LOG_DBG("Transfer start, ep 0x%02x, data %p, dlen %zd", in usb_transfer()
212 ep, data, dlen); in usb_transfer()
231 LOG_ERR("A transfer is already ongoing, ep 0x%02x", ep); in usb_transfer()
238 trans->ep = ep; in usb_transfer()
247 if (usb_dc_ep_mps(ep) && (dlen % usb_dc_ep_mps(ep))) { in usb_transfer()
257 ret = usb_dc_ep_read_continue(ep); in usb_transfer()
265 void usb_cancel_transfer(uint8_t ep) in usb_cancel_transfer() argument
272 trans = usb_ep_get_transfer(ep); in usb_cancel_transfer()
299 LOG_DBG("Cancel transfer for ep: 0x%02x", trans->ep); in usb_cancel_transfers()
306 static void usb_transfer_sync_cb(uint8_t ep, int size, void *priv) in usb_transfer_sync_cb() argument
314 int usb_transfer_sync(uint8_t ep, uint8_t *data, size_t dlen, unsigned int flags) in usb_transfer_sync() argument
321 ret = usb_transfer(ep, data, dlen, flags, usb_transfer_sync_cb, &pdata); in usb_transfer_sync()