Changeset a29529b in mainline for uspace/lib/usbdev/src
- Timestamp:
- 2011-05-13T14:40:21Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 50cd285, 5e6e50b
- Parents:
- 81db65b (diff), 8fcaeed (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/lib/usbdev/src
- Files:
-
- 13 moved
-
altiface.c (moved) (moved from uspace/lib/usb/src/altiface.c )
-
devdrv.c (moved) (moved from uspace/lib/usb/src/devdrv.c )
-
devpoll.c (moved) (moved from uspace/lib/usb/src/devpoll.c )
-
dp.c (moved) (moved from uspace/lib/usb/src/dp.c )
-
hub.c (moved) (moved from uspace/lib/usb/src/hub.c )
-
pipepriv.c (moved) (moved from uspace/lib/usb/src/pipepriv.c )
-
pipepriv.h (moved) (moved from uspace/lib/usb/src/pipepriv.h )
-
pipes.c (moved) (moved from uspace/lib/usb/src/pipes.c ) (1 diff)
-
pipesinit.c (moved) (moved from uspace/lib/usb/src/pipesinit.c )
-
pipesio.c (moved) (moved from uspace/lib/usb/src/pipesio.c )
-
recognise.c (moved) (moved from uspace/lib/usb/src/recognise.c )
-
request.c (moved) (moved from uspace/lib/usb/src/request.c ) (1 diff)
-
usbdevice.c (moved) (moved from uspace/lib/usb/src/usbdevice.c ) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/pipes.c
r81db65b ra29529b 36 36 #include <usb/pipes.h> 37 37 #include <usb/debug.h> 38 #include <usb/driver.h> 38 39 #include <usbhc_iface.h> 39 40 #include <usb_iface.h> -
uspace/lib/usbdev/src/request.c
r81db65b ra29529b 885 885 } 886 886 887 /** Clear halt bit of an endpoint pipe (after pipe stall). 888 * 889 * @param ctrl_pipe Control pipe. 890 * @param target_pipe Which pipe is halted and shall be cleared. 891 * @return Error code. 892 */ 893 int usb_pipe_clear_halt(usb_pipe_t *ctrl_pipe, usb_pipe_t *target_pipe) 894 { 895 if ((ctrl_pipe == NULL) || (target_pipe == NULL)) { 896 return EINVAL; 897 } 898 return usb_request_clear_endpoint_halt(ctrl_pipe, 899 target_pipe->endpoint_no); 900 } 901 902 /** Get endpoint status. 903 * 904 * @param[in] ctrl_pipe Control pipe. 905 * @param[in] pipe Of which pipe the status shall be received. 906 * @param[out] status Where to store pipe status (in native endianness). 907 * @return Error code. 908 */ 909 int usb_request_get_endpoint_status(usb_pipe_t *ctrl_pipe, usb_pipe_t *pipe, 910 uint16_t *status) 911 { 912 uint16_t status_tmp; 913 uint16_t pipe_index = (uint16_t) pipe->endpoint_no; 914 int rc = usb_request_get_status(ctrl_pipe, 915 USB_REQUEST_RECIPIENT_ENDPOINT, uint16_host2usb(pipe_index), 916 &status_tmp); 917 if (rc != EOK) { 918 return rc; 919 } 920 921 if (status != NULL) { 922 *status = uint16_usb2host(status_tmp); 923 } 924 925 return EOK; 926 } 927 887 928 /** 888 929 * @} -
uspace/lib/usbdev/src/usbdevice.c
r81db65b ra29529b 37 37 #include <usb_iface.h> 38 38 #include <usb/usbdevice.h> 39 #include <usb/driver.h> 39 40 #include <usb/debug.h> 40 41 #include <errno.h> 41 42 #include <assert.h> 42 43 /** Find host controller handle that is ancestor of given device.44 *45 * @param[in] device_handle Device devman handle.46 * @param[out] hc_handle Where to store handle of host controller47 * controlling device with @p device_handle handle.48 * @return Error code.49 */50 int usb_hc_find(devman_handle_t device_handle, devman_handle_t *hc_handle)51 {52 int parent_phone = devman_parent_device_connect(device_handle,53 IPC_FLAG_BLOCKING);54 if (parent_phone < 0) {55 return parent_phone;56 }57 58 devman_handle_t h;59 usb_log_debug("asking for HC handle (my handle is %zu).\n", device_handle);60 int rc = async_req_1_1(parent_phone, DEV_IFACE_ID(USB_DEV_IFACE),61 IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &h);62 63 async_hangup(parent_phone);64 65 if (rc != EOK) {66 return rc;67 }68 69 if (hc_handle != NULL) {70 *hc_handle = h;71 }72 73 return EOK;74 }75 43 76 44 /** Initialize connection to USB host controller.
Note:
See TracChangeset
for help on using the changeset viewer.
