Changeset 928afc8d in mainline for uspace/drv/bus/usb/xhci/hc.c
- Timestamp:
- 2017-10-26T13:20:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a501aaba
- Parents:
- 25251bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hc.c
r25251bb r928afc8d 620 620 { 621 621 assert(hc); 622 623 int err; 624 if ((err = xhci_cmd_sync_inline(hc, DISABLE_SLOT, .slot_id = slot_id))) { 625 return err; 626 } 627 628 return EOK; 622 return xhci_cmd_sync_inline(hc, DISABLE_SLOT, .slot_id = slot_id); 629 623 } 630 624 … … 718 712 int hc_configure_device(xhci_hc_t *hc, uint32_t slot_id) 719 713 { 720 int err;721 722 714 /* Issue configure endpoint command (sec 4.3.5). */ 723 715 xhci_input_ctx_t *ictx; 724 if ((err = create_valid_input_ctx(&ictx))) { 716 const int err = create_valid_input_ctx(&ictx); 717 if (err) 725 718 return err; 726 } 719 727 720 // TODO: Set slot context and other flags. (probably forgot a lot of 'em) 728 721 729 if ((err = xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT, .slot_id = slot_id, .input_ctx = ictx))) { 730 return err; 731 } 732 733 return EOK; 722 return xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT, .slot_id = slot_id, .input_ctx = ictx); 734 723 } 735 724 736 725 int hc_deconfigure_device(xhci_hc_t *hc, uint32_t slot_id) 737 726 { 738 int err;739 740 727 /* Issue configure endpoint command (sec 4.3.5) with the DC flag. */ 741 if ((err = xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT, .slot_id = slot_id, .deconfigure = true))) { 742 return err; 743 } 744 745 return EOK; 728 return xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT, .slot_id = slot_id, .deconfigure = true); 746 729 } 747 730 748 731 int hc_add_endpoint(xhci_hc_t *hc, uint32_t slot_id, uint8_t ep_idx, xhci_ep_ctx_t *ep_ctx) 749 732 { 750 int err;751 752 733 /* Issue configure endpoint command (sec 4.3.5). */ 753 734 xhci_input_ctx_t *ictx; 754 if ((err = create_valid_input_ctx(&ictx))) { 735 const int err = create_valid_input_ctx(&ictx); 736 if (err) 755 737 return err; 756 }757 738 758 739 XHCI_INPUT_CTRL_CTX_ADD_SET(ictx->ctrl_ctx, ep_idx + 1); /* Preceded by slot ctx */ … … 760 741 // TODO: Set slot context and other flags. (probably forgot a lot of 'em) 761 742 762 if ((err = xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT, .slot_id = slot_id, .input_ctx = ictx))) { 763 return err; 764 } 765 766 return EOK; 743 return xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT, .slot_id = slot_id, .input_ctx = ictx); 767 744 } 768 745 769 746 int hc_drop_endpoint(xhci_hc_t *hc, uint32_t slot_id, uint8_t ep_idx) 770 747 { 771 int err;772 773 748 /* Issue configure endpoint command (sec 4.3.5). */ 774 749 xhci_input_ctx_t *ictx; 775 if ((err = create_valid_input_ctx(&ictx))) { 750 const int err = create_valid_input_ctx(&ictx); 751 if (err) 776 752 return err; 777 }778 753 779 754 XHCI_INPUT_CTRL_CTX_DROP_SET(ictx->ctrl_ctx, ep_idx + 1); /* Preceded by slot ctx */ 780 755 // TODO: Set slot context and other flags. (probably forgot a lot of 'em) 781 756 782 if ((err = xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT, .slot_id = slot_id, .input_ctx = ictx))) { 783 return err; 784 } 785 786 return EOK; 757 return xhci_cmd_sync_inline(hc, CONFIGURE_ENDPOINT, .slot_id = slot_id, .input_ctx = ictx); 787 758 } 788 759
Note:
See TracChangeset
for help on using the changeset viewer.