Changeset 67f55e7b in mainline
- Timestamp:
- 2011-10-31T15:51:49Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b17e37
- Parents:
- 0cd8089
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/hc_iface.c
r0cd8089 r67f55e7b 56 56 * @return Error code. 57 57 */ 58 static int request_address(ddf_fun_t *fun, usb_ speed_t speed,59 usb_ address_t *address)58 static int request_address(ddf_fun_t *fun, usb_address_t *address, bool strict, 59 usb_speed_t speed) 60 60 { 61 61 UNSUPPORTED("request_address"); -
uspace/drv/bus/usb/vhc/connhost.c
r0cd8089 r67f55e7b 57 57 * @return Error code. 58 58 */ 59 static int request_address(ddf_fun_t *fun, usb_speed_t speed, 60 usb_address_t *address) 61 { 62 VHC_DATA(vhc, fun); 63 64 usb_address_t addr = 1; 65 const int ret = usb_device_manager_request_address( 66 &vhc->dev_manager, &addr, false, USB_SPEED_HIGH); 67 if (ret < 0) { 68 return ret; 69 } 70 71 if (address != NULL) { 72 *address = addr; 73 } 74 75 return EOK; 59 static int request_address(ddf_fun_t *fun, usb_address_t *address, bool strict, 60 usb_speed_t speed) 61 { 62 VHC_DATA(vhc, fun); 63 64 assert(address); 65 return usb_device_manager_request_address( 66 &vhc->dev_manager, address, strict, speed); 76 67 } 77 68 -
uspace/lib/drv/generic/remote_usbhc.c
r0cd8089 r67f55e7b 118 118 } 119 119 120 usb_speed_t speed = DEV_IPC_GET_ARG1(*call); 121 122 usb_address_t address; 123 int rc = usb_iface->request_address(fun, speed, &address); 120 usb_address_t address = DEV_IPC_GET_ARG1(*call); 121 const bool strict = DEV_IPC_GET_ARG2(*call); 122 const usb_speed_t speed = DEV_IPC_GET_ARG3(*call); 123 124 const int rc = usb_iface->request_address(fun, &address, strict, speed); 124 125 if (rc != EOK) { 125 126 async_answer_0(callid, rc); -
uspace/lib/drv/include/usbhc_iface.h
r0cd8089 r67f55e7b 170 170 /** USB host controller communication interface. */ 171 171 typedef struct { 172 int (*request_address)(ddf_fun_t *, usb_ speed_t, usb_address_t *);172 int (*request_address)(ddf_fun_t *, usb_address_t *, bool, usb_speed_t); 173 173 int (*bind_address)(ddf_fun_t *, usb_address_t, devman_handle_t); 174 174 int (*find_by_address)(ddf_fun_t *, usb_address_t, devman_handle_t *); -
uspace/lib/usbdev/include/usb/dev/hub.h
r0cd8089 r67f55e7b 59 59 } usb_hub_attached_device_t; 60 60 61 usb_address_t usb_hc_request_address(usb_hc_connection_t *, usb_speed_t); 61 usb_address_t usb_hc_request_address(usb_hc_connection_t *, usb_address_t, 62 bool, usb_speed_t); 62 63 int usb_hc_register_device(usb_hc_connection_t *, 63 64 const usb_hub_attached_device_t *); -
uspace/lib/usbdev/src/hub.c
r0cd8089 r67f55e7b 66 66 * 67 67 * @param connection Opened connection to host controller. 68 * @param preferred Preferred SUB address. 69 * @param strict Fail if the preferred address is not avialable. 68 70 * @param speed Speed of the new device (device that will be assigned 69 71 * the returned address). … … 71 73 */ 72 74 usb_address_t usb_hc_request_address(usb_hc_connection_t *connection, 73 usb_ speed_t speed)75 usb_address_t preferred, bool strict, usb_speed_t speed) 74 76 { 75 77 CHECK_CONNECTION(connection); … … 78 80 79 81 sysarg_t address; 80 int rc = async_req_2_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 81 IPC_M_USBHC_REQUEST_ADDRESS, speed, 82 &address); 82 int rc = async_req_4_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 83 IPC_M_USBHC_REQUEST_ADDRESS, preferred, strict, speed, &address); 83 84 84 85 async_exchange_end(exch); … … 223 224 * Request new address. 224 225 */ 225 usb_address_t dev_addr = usb_hc_request_address(&hc_conn, dev_speed); 226 usb_address_t dev_addr = 227 usb_hc_request_address(&hc_conn, 1, false, dev_speed); 226 228 if (dev_addr < 0) { 227 229 rc = EADDRNOTAVAIL; -
uspace/lib/usbhost/src/iface.c
r0cd8089 r67f55e7b 97 97 */ 98 98 static int request_address( 99 ddf_fun_t *fun, usb_ speed_t speed, usb_address_t *address)99 ddf_fun_t *fun, usb_address_t *address, bool strict, usb_speed_t speed) 100 100 { 101 101 assert(fun); … … 106 106 usb_log_debug("Address request speed: %s.\n", usb_str_speed(speed)); 107 107 return usb_device_manager_request_address( 108 &hcd->dev_manager, address, false, speed);108 &hcd->dev_manager, address, strict, speed); 109 109 } 110 110 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.