Changeset 05aeee0e in mainline
- Timestamp:
- 2017-07-13T19:28:53Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7bd99bf
- Parents:
- 4fa5342
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/commands.c
r4fa5342 r05aeee0e 215 215 } 216 216 217 int xhci_send_reset_endpoint_command(xhci_hc_t *hc, uint32_t slot_id, uint32_t ep_id, uint8_t tcs) 218 { 219 /** 220 * Note: TCS can have values 0 or 1. If it is set to 0, see sectuon 4.5.8 for 221 * information about this flag. 222 */ 223 xhci_trb_t trb; 224 memset(&trb, 0, sizeof(trb)); 225 226 trb.control = host2xhci(32, XHCI_TRB_TYPE_RESET_ENDPOINT_CMD << 10); 227 trb.control |= host2xhci(32, hc->command_ring.pcs); 228 trb.control |= host2xhci(32, (tcs & 0x1) << 9); 229 trb.control |= host2xhci(32, (ep_id & 0x5) << 16); 230 trb.control |= host2xhci(32, slot_id << 24); 231 232 return enqueue_trb(hc, &trb, 0, 0); 233 } 234 235 int xhci_send_stop_endpoint_command(xhci_hc_t *hc, uint32_t slot_id, uint32_t ep_id, uint8_t susp) 236 { 237 xhci_trb_t trb; 238 memset(&trb, 0, sizeof(trb)); 239 240 trb.control = host2xhci(32, XHCI_TRB_TYPE_STOP_ENDPOINT_CMD << 10); 241 trb.control |= host2xhci(32, hc->command_ring.pcs); 242 trb.control |= host2xhci(32, (ep_id & 0x5) << 16); 243 trb.control |= host2xhci(32, (susp & 0x1) << 23); 244 trb.control |= host2xhci(32, slot_id << 24); 245 246 return enqueue_trb(hc, &trb, 0, 0); 247 248 } 249 217 250 int xhci_handle_command_completion(xhci_hc_t *hc, xhci_trb_t *trb) 218 251 { … … 250 283 case XHCI_TRB_TYPE_EVALUATE_CONTEXT_CMD: 251 284 return EOK; 285 case XHCI_TRB_TYPE_RESET_ENDPOINT_CMD: 286 return EOK; 287 case XHCI_TRB_TYPE_STOP_ENDPOINT_CMD: 288 // Note: If the endpoint was in the middle of a transfer, then the xHC 289 // will add a Transfer TRB before the Event TRB, research that and 290 // handle it appropriately! 291 return EOK; 252 292 default: 253 293 usb_log_debug2("Unsupported command trb."); -
uspace/drv/bus/usb/xhci/commands.h
r4fa5342 r05aeee0e 47 47 int xhci_send_configure_endpoint_command(xhci_hc_t *, uint32_t, xhci_input_ctx_t *); 48 48 int xhci_send_evaluate_context_command(xhci_hc_t *, uint32_t, xhci_input_ctx_t *); 49 int xhci_send_reset_endpoint_command(xhci_hc_t *, uint32_t, uint32_t, uint8_t); 50 int xhci_send_stop_endpoint_command(xhci_hc_t *, uint32_t, uint32_t, uint8_t); 49 51 50 52 int xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *);
Note:
See TracChangeset
for help on using the changeset viewer.