1/* 2 * Copyright (c) 2010, ETH Zurich. 3 * All rights reserved. 4 * 5 * This file is distributed under the terms in the attached LICENSE file. 6 * If you do not find this file, copies can be found by writing to: 7 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group. 8 */ 9 10 11interface usb_manager "USB Manager Interface" { 12 13 /* transfer setup parameters, keep in sync with struct usb_transfer_setup */ 14 typedef struct { 15 uint32 max_bytes; ///< maximum bytes to to transfer 16 uint32 max_frames; ///< the maximum bumber of frames 17 uint32 interval; ///< the interval for interrupt / isochr 18 uint32 timeout; ///< period till the transfer timeouts 19 uint16 flags; ///< some specific transfer flags 20 uint8 type; ///< the type of the usb pipe 21 uint8 direction; ///< the direction of the data transfer 22 uint8 endpoint; ///< the associated endpoint of the transfer 23 uint8 iface; ///< the itnerface to use 24 } setup_param; 25 26 /* 27 * ---------------------------------------------------------------------- 28 * connecting to the USB manager 29 * ---------------------------------------------------------------------- 30 */ 31 32 rpc connect(in iref driver_iref, in uint16 init_config, out uint32 ret_error, out uint8 ret_desc[length, 2048]); 33 34 rpc device_disconnect_notify(); 35 36 37 /* 38 * ---------------------------------------------------------------------- 39 * Request handling 40 * ---------------------------------------------------------------------- 41 */ 42 43 rpc request_read(in uint8 request[req_length, 2048], 44 out uint8 data[data_length, 2048], 45 out uint32 ret_status); 46 47 rpc request_write(in uint8 request[req_length, 2048], 48 in uint8 data[data_length, 2048], 49 out uint32 ret_status); 50 51 rpc request(in uint8 request[req_length, 2048], out uint32 ret_status); 52 53 54 /* 55 * ---------------------------------------------------------------------- 56 * transfer management 57 * ---------------------------------------------------------------------- 58 */ 59 60 rpc transfer_setup(in uint8 type, in setup_param params, 61 out uint32 ret_error, out uint32 ret_tid); 62 63 rpc transfer_unsetup(in uint32 tid, out uint32 ret_error); 64 65 rpc transfer_start(in uint32 tid, out uint32 ret_error); 66 67 rpc transfer_stop(in uint32 tid, out uint32 ret_error); 68 69 rpc transfer_status(in uint32 tid, out uint32 ret_error, 70 out uint32 ret_actlen, out uint32 ret_length, 71 out uint32 ret_actframes, out uint32 ret_numframes); 72 73 rpc transfer_state(in uint32 tid, out uint32 ret_error, out uint32 ret_state); 74 75 rpc transfer_clear_stall(in uint32 tid, out uint32 ret_error); 76 77 rpc transfer_done_notify(out uint32 tid, out uint32 error, out uint8 data[length, 2048]); 78 79 /* 80 * ---------------------------------------------------------------------- 81 * device management 82 * ---------------------------------------------------------------------- 83 */ 84 85 rpc device_get_speed(out uint8 ret_speed); 86 87 rpc device_get_state(out uint8 ret_state); 88 89 rpc device_suspend(out uint32 ret_error); 90 91 rpc device_resume(out uint32 ret_error); 92 93 rpc device_powersave(in uint8 powerstate, out uint32 ret_error); 94 95 96}; 97