Changeset aae339e9 in mainline
- Timestamp:
- 2010-11-26T12:47:34Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 172c1682
- Parents:
- 0b749a3
- Location:
- uspace/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r0b749a3 raae339e9 42 42 #define USB_MAX_PAYLOAD_SIZE 1020 43 43 44 static void remote_usbhc_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *); 44 45 static void remote_usbhc_get_buffer(device_t *, void *, ipc_callid_t, ipc_call_t *); 45 46 static void remote_usbhc_interrupt_out(device_t *, void *, ipc_callid_t, ipc_call_t *); … … 49 50 /** Remote USB interface operations. */ 50 51 static remote_iface_func_ptr_t remote_usbhc_iface_ops [] = { 51 &remote_usbhc_get_buffer, 52 &remote_usbhc_interrupt_out, 53 &remote_usbhc_interrupt_in 52 remote_usbhc_get_address, 53 remote_usbhc_get_buffer, 54 remote_usbhc_interrupt_out, 55 remote_usbhc_interrupt_in 54 56 }; 55 57 … … 68 70 } async_transaction_t; 69 71 72 void remote_usbhc_get_address(device_t *device, void *iface, 73 ipc_callid_t callid, ipc_call_t *call) 74 { 75 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 76 77 if (!usb_iface->tell_address) { 78 ipc_answer_0(callid, ENOTSUP); 79 return; 80 } 81 82 devman_handle_t handle = IPC_GET_ARG1(*call); 83 84 usb_address_t address; 85 int rc = usb_iface->tell_address(device, handle, &address); 86 if (rc != EOK) { 87 ipc_answer_0(callid, rc); 88 } else { 89 ipc_answer_1(callid, EOK, address); 90 } 91 } 70 92 71 93 void remote_usbhc_get_buffer(device_t *device, void *iface, -
uspace/lib/drv/include/usbhc_iface.h
r0b749a3 raae339e9 92 92 */ 93 93 typedef enum { 94 /** Tell USB address assigned to device. 95 * Parameters: 96 * - devman handle id 97 * Answer: 98 * - EINVAL - unknown handle or handle not managed by this driver 99 * - ENOTSUP - operation not supported by HC (shall not happen) 100 * - arbitrary error code if returned by remote implementation 101 * - EOK - handle found, first parameter contains the USB address 102 */ 103 IPC_M_USBHC_GET_ADDRESS, 104 94 105 /** Asks for data buffer. 95 106 * See explanation at usb_iface_funcs_t. … … 157 168 /** USB devices communication interface. */ 158 169 typedef struct { 170 int (*tell_address)(device_t *, devman_handle_t, usb_address_t *); 159 171 int (*interrupt_out)(device_t *, usb_target_t, 160 172 void *, size_t, -
uspace/lib/usb/src/usbdrv.c
r0b749a3 raae339e9 75 75 usb_address_t usb_drv_get_my_address(int phone, device_t *dev) 76 76 { 77 return ENOTSUP; 77 ipcarg_t address; 78 int rc = async_req_1_1(phone, IPC_M_USBHC_GET_ADDRESS, 79 dev->handle, &address); 80 81 if (rc != EOK) { 82 return rc; 83 } 84 85 return (usb_address_t) address; 78 86 } 79 87
Note:
See TracChangeset
for help on using the changeset viewer.