Changeset 0edf7c7 in mainline
- Timestamp:
- 2011-05-20T20:01:25Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 04028225
- Parents:
- a60afd0
- Location:
- uspace
- Files:
-
- 2 deleted
- 9 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/lsusb/main.c
ra60afd0 r0edf7c7 45 45 #include <devmap.h> 46 46 #include <usb/dev/hub.h> 47 #include <usb/h ost.h>47 #include <usb/hc.h> 48 48 49 49 #define NAME "lsusb" -
uspace/app/mkbd/main.c
ra60afd0 r0edf7c7 45 45 #include <devmap.h> 46 46 #include <usb/dev/hub.h> 47 #include <usb/h ost.h>47 #include <usb/hc.h> 48 48 #include <usb/driver.h> 49 49 #include <usb/dev/pipes.h> -
uspace/app/usbinfo/main.c
ra60afd0 r0edf7c7 43 43 #include <devman.h> 44 44 #include <devmap.h> 45 #include <usb/ dev/hc.h>45 #include <usb/hc.h> 46 46 #include <usb/dev/pipes.h> 47 #include <usb/host.h>48 47 #include <usb/driver.h> 49 48 #include "usbinfo.h" -
uspace/drv/uhci-rhd/port.h
ra60afd0 r0edf7c7 38 38 #include <fibril.h> 39 39 #include <ddf/driver.h> 40 #include <usb/ dev/hc.h> /* usb_hc_connection_t */40 #include <usb/hc.h> /* usb_hc_connection_t */ 41 41 42 42 typedef uint16_t port_status_t; -
uspace/lib/usb/Makefile
ra60afd0 r0edf7c7 39 39 src/driver.c \ 40 40 src/dump.c \ 41 src/h ost.c \41 src/hc.c \ 42 42 src/usb.c 43 43 -
uspace/lib/usb/include/usb/hc.h
ra60afd0 r0edf7c7 27 27 */ 28 28 29 /** @addtogroup libusb dev29 /** @addtogroup libusb 30 30 * @{ 31 31 */ 32 32 /** @file 33 * General communication between device drivers andhost controller driver.33 * General communication with host controller driver. 34 34 */ 35 #ifndef LIBUSB DEV_HC_H_36 #define LIBUSB DEV_HC_H_35 #ifndef LIBUSB_HC_H_ 36 #define LIBUSB_HC_H_ 37 37 38 38 #include <sys/types.h> … … 57 57 bool usb_hc_connection_is_opened(const usb_hc_connection_t *); 58 58 int usb_hc_connection_close(usb_hc_connection_t *); 59 int usb_hc_get_handle_by_address(usb_hc_connection_t *, usb_address_t, 60 devman_handle_t *); 59 61 62 int usb_ddf_get_hc_handle_by_class(size_t, devman_handle_t *); 60 63 61 64 -
uspace/lib/usb/src/hc.c
ra60afd0 r0edf7c7 27 27 */ 28 28 29 /** @addtogroup libusb dev29 /** @addtogroup libusb 30 30 * @{ 31 31 */ 32 32 /** @file 33 * General communication between device drivers and host controller driver.33 * General communication with host controller driver (implementation). 34 34 */ 35 35 #include <devman.h> 36 36 #include <async.h> 37 #include <dev_iface.h> 37 38 #include <usb_iface.h> 38 #include <usb/dev/hc.h> 39 #include <usbhc_iface.h> 40 #include <usb/hc.h> 39 41 #include <usb/driver.h> 40 42 #include <usb/debug.h> … … 143 145 } 144 146 147 /** Get handle of USB device with given address. 148 * 149 * @param[in] connection Opened connection to host controller. 150 * @param[in] address Address of device in question. 151 * @param[out] handle Where to write the device handle. 152 * @return Error code. 153 */ 154 int usb_hc_get_handle_by_address(usb_hc_connection_t *connection, 155 usb_address_t address, devman_handle_t *handle) 156 { 157 if (!usb_hc_connection_is_opened(connection)) { 158 return ENOENT; 159 } 160 161 sysarg_t tmp; 162 int rc = async_req_2_1(connection->hc_phone, 163 DEV_IFACE_ID(USBHC_DEV_IFACE), 164 IPC_M_USBHC_GET_HANDLE_BY_ADDRESS, 165 address, &tmp); 166 if ((rc == EOK) && (handle != NULL)) { 167 *handle = tmp; 168 } 169 170 return rc; 171 } 172 173 174 /** Get host controller handle by its class index. 175 * 176 * @param class_index Class index for the host controller. 177 * @param hc_handle Where to store the HC handle 178 * (can be NULL for existence test only). 179 * @return Error code. 180 */ 181 int usb_ddf_get_hc_handle_by_class(size_t class_index, 182 devman_handle_t *hc_handle) 183 { 184 char *class_index_str; 185 devman_handle_t hc_handle_tmp; 186 int rc; 187 188 rc = asprintf(&class_index_str, "%zu", class_index); 189 if (rc < 0) { 190 return ENOMEM; 191 } 192 rc = devman_device_get_handle_by_class("usbhc", class_index_str, 193 &hc_handle_tmp, 0); 194 free(class_index_str); 195 if (rc != EOK) { 196 return rc; 197 } 198 199 if (hc_handle != NULL) { 200 *hc_handle = hc_handle_tmp; 201 } 202 203 return EOK; 204 } 205 145 206 /** 146 207 * @} -
uspace/lib/usbdev/Makefile
ra60afd0 r0edf7c7 46 46 src/pipesio.c \ 47 47 src/recognise.c \ 48 src/request.c \ 49 src/usbdevice.c 48 src/request.c 50 49 51 50 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/usbdev/include/usb/dev/hub.h
ra60afd0 r0edf7c7 39 39 40 40 #include <sys/types.h> 41 #include <usb/ dev/hc.h>41 #include <usb/hc.h> 42 42 43 43 int usb_hc_new_device_wrapper(ddf_dev_t *, usb_hc_connection_t *, usb_speed_t, … … 63 63 const usb_hc_attached_device_t *); 64 64 int usb_hc_unregister_device(usb_hc_connection_t *, usb_address_t); 65 int usb_hc_get_handle_by_address(usb_hc_connection_t *, usb_address_t,66 devman_handle_t *);67 65 68 66 #endif -
uspace/lib/usbdev/include/usb/dev/pipes.h
ra60afd0 r0edf7c7 38 38 #include <sys/types.h> 39 39 #include <usb/usb.h> 40 #include <usb/ dev/hc.h>40 #include <usb/hc.h> 41 41 #include <usb/descriptor.h> 42 42 #include <ipc/devman.h> -
uspace/lib/usbdev/src/hub.c
ra60afd0 r0edf7c7 120 120 } 121 121 122 /** Get handle of USB device with given address.123 *124 * @param[in] connection Opened connection to host controller.125 * @param[in] address Address of device in question.126 * @param[out] handle Where to write the device handle.127 * @return Error code.128 */129 int usb_hc_get_handle_by_address(usb_hc_connection_t *connection,130 usb_address_t address, devman_handle_t *handle)131 {132 CHECK_CONNECTION(connection);133 134 sysarg_t tmp;135 int rc = async_req_2_1(connection->hc_phone,136 DEV_IFACE_ID(USBHC_DEV_IFACE),137 IPC_M_USBHC_GET_HANDLE_BY_ADDRESS,138 address, &tmp);139 if ((rc == EOK) && (handle != NULL)) {140 *handle = tmp;141 }142 143 return rc;144 }145 122 146 123 static void unregister_control_endpoint_on_default_address(
Note:
See TracChangeset
for help on using the changeset viewer.