Changeset 0e126be7 in mainline
- Timestamp:
- 2010-11-20T13:17:54Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4b4c797
- Parents:
- e27595b
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbkbd/main.c
re27595b r0e126be7 41 41 usb_endpoint_t poll_endpoint = 1; 42 42 43 rc = usb_drv_async_interrupt_in(dev->parent_phone, poll_endpoint, 43 usb_address_t my_address = usb_drv_get_my_address(dev->parent_phone, 44 dev); 45 if (my_address < 0) { 46 return; 47 } 48 49 usb_target_t poll_target = { 50 .address = my_address, 51 .endpoint = poll_endpoint 52 }; 53 54 rc = usb_drv_async_interrupt_in(dev->parent_phone, poll_target, 44 55 buffer, BUFFER_SIZE, &actual_size, &handle); 45 56 if (rc != EOK) { -
uspace/lib/usb/usbdrv.c
re27595b r0e126be7 67 67 } 68 68 69 /** Tell USB address assigned to given device. 70 * 71 * @param phone Phone to my HC. 72 * @param dev Device in question. 73 * @return USB address or error code. 74 */ 75 usb_address_t usb_drv_get_my_address(int phone, device_t *dev) 76 { 77 return ENOTSUP; 78 } 79 69 80 /** Send data to HCD. 70 81 * 71 82 * @param phone Phone to HC. 72 83 * @param method Method used for calling. 73 * @param endpoint Device endpoint.84 * @param target Targeted device. 74 85 * @param buffer Data buffer (NULL to skip data transfer phase). 75 86 * @param size Buffer size (must be zero when @p buffer is NULL). … … 80 91 */ 81 92 static int async_send_buffer(int phone, int method, 82 usb_ endpoint_t endpoint,93 usb_target_t target, 83 94 void *buffer, size_t size, 84 95 usb_handle_t *handle) … … 109 120 int rc; 110 121 111 transfer->request = async_send_ 3(phone,122 transfer->request = async_send_4(phone, 112 123 DEV_IFACE_ID(USB_DEV_IFACE), 113 124 method, 114 endpoint,125 target.address, target.endpoint, 115 126 size, 116 127 &transfer->reply); … … 133 144 * @param phone Opened phone to HCD. 134 145 * @param method Method used for calling. 135 * @param endpoint Device endpoint.146 * @param target Targeted device. 136 147 * @param buffer Buffer where to store retrieved data 137 148 * (NULL to skip data transfer phase). … … 145 156 */ 146 157 static int async_recv_buffer(int phone, int method, 147 usb_ endpoint_t endpoint,158 usb_target_t target, 148 159 void *buffer, size_t size, size_t *actual_size, 149 160 usb_handle_t *handle) … … 172 183 transfer->phone = phone; 173 184 174 transfer->request = async_send_ 3(phone,185 transfer->request = async_send_4(phone, 175 186 DEV_IFACE_ID(USB_DEV_IFACE), 176 187 method, 177 endpoint,188 target.address, target.endpoint, 178 189 size, 179 190 &transfer->reply); … … 289 300 290 301 /** Send interrupt data to device. */ 291 int usb_drv_async_interrupt_out(int phone, usb_ endpoint_t endpoint,302 int usb_drv_async_interrupt_out(int phone, usb_target_t target, 292 303 void *buffer, size_t size, 293 304 usb_handle_t *handle) … … 295 306 return async_send_buffer(phone, 296 307 IPC_M_USB_INTERRUPT_OUT, 297 endpoint,308 target, 298 309 buffer, size, 299 310 handle); … … 301 312 302 313 /** Request interrupt data from device. */ 303 int usb_drv_async_interrupt_in(int phone, usb_ endpoint_t endpoint,314 int usb_drv_async_interrupt_in(int phone, usb_target_t target, 304 315 void *buffer, size_t size, size_t *actual_size, 305 316 usb_handle_t *handle) … … 307 318 return async_recv_buffer(phone, 308 319 IPC_M_USB_INTERRUPT_IN, 309 endpoint,320 target, 310 321 buffer, size, actual_size, 311 322 handle); -
uspace/lib/usb/usbdrv.h
re27595b r0e126be7 41 41 int usb_drv_hc_connect(device_t *, unsigned int); 42 42 43 int usb_drv_async_interrupt_out(int, usb_endpoint_t, 43 usb_address_t usb_drv_get_my_address(int, device_t *); 44 45 int usb_drv_async_interrupt_out(int, usb_target_t, 44 46 void *, size_t, usb_handle_t *); 45 int usb_drv_async_interrupt_in(int, usb_ endpoint_t,47 int usb_drv_async_interrupt_in(int, usb_target_t, 46 48 void *, size_t, size_t *, usb_handle_t *); 47 49
Note:
See TracChangeset
for help on using the changeset viewer.