Changeset 355f7c2 in mainline for uspace/srv/hw/bus/usb/hcd/virtual/connhost.c
- Timestamp:
- 2010-10-25T07:44:02Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ca07cd3
- Parents:
- 7a7bfeb3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/usb/hcd/virtual/connhost.c
r7a7bfeb3 r355f7c2 56 56 static void out_callback(void * buffer, size_t len, usb_transaction_outcome_t outcome, void * arg) 57 57 { 58 dprintf( "out_callback(buffer, %u, %d, %p)", len, outcome, arg);59 (void)len;58 dprintf(2, "out_callback(buffer, %u, %d, %p)", len, outcome, arg); 59 60 60 transaction_details_t * trans = (transaction_details_t *)arg; 61 61 … … 63 63 64 64 free(trans); 65 free(buffer); 65 if (buffer) { 66 free(buffer); 67 } 66 68 } 67 69 … … 70 72 static void in_callback(void * buffer, size_t len, usb_transaction_outcome_t outcome, void * arg) 71 73 { 72 dprintf( "in_callback(buffer, %u, %d, %p)", len, outcome, arg);74 dprintf(2, "in_callback(buffer, %u, %d, %p)", len, outcome, arg); 73 75 transaction_details_t * trans = (transaction_details_t *)arg; 74 76 … … 116 118 }; 117 119 118 dprintf( "pretending transfer to function (dev=%d:%d)",120 dprintf(1, "pretending transfer to function (dev=%d:%d)", 119 121 target.address, target.endpoint); 120 122 … … 144 146 trans->handle = handle; 145 147 146 dprintf("adding transaction to HC", NAME);147 148 hc_add_transaction_to_device(setup_transaction, target, 148 149 buffer, len, … … 150 151 151 152 ipc_answer_1(iid, EOK, handle); 152 dprintf( "transfer to function scheduled (handle %d)", handle);153 dprintf(2, "transfer to function scheduled (handle %d)", handle); 153 154 } 154 155 … … 163 164 size_t len = IPC_GET_ARG3(icall); 164 165 165 dprintf( "pretending transfer from function (dev=%d:%d)",166 dprintf(1, "pretending transfer from function (dev=%d:%d)", 166 167 target.address, target.endpoint); 167 168 … … 183 184 trans->handle = handle; 184 185 185 dprintf("adding transaction to HC", NAME);186 186 hc_add_transaction_from_device(target, 187 187 buffer, len, … … 189 189 190 190 ipc_answer_1(iid, EOK, handle); 191 dprintf( "transfer from function scheduled (handle %d)", handle);191 dprintf(2, "transfer from function scheduled (handle %d)", handle); 192 192 } 193 193 … … 197 197 * By host is typically meant top-level USB driver. 198 198 * 199 * This function also takes care of proper phone hung-up. 200 * 199 201 * @param phone_hash Incoming phone hash. 200 202 * @param host_phone Callback phone to host. … … 204 206 assert(host_phone > 0); 205 207 206 dprintf( "phone%#x: host connected", phone_hash);208 dprintf(0, "host connected through phone %#x", phone_hash); 207 209 208 210 … … 217 219 ipc_hangup(host_phone); 218 220 ipc_answer_0(callid, EOK); 219 dprintf("phone%#x: host hang-up", phone_hash); 221 dprintf(0, "phone%#x: host hung-up", 222 phone_hash); 220 223 return; 221 224 … … 223 226 ipc_answer_0(callid, ELIMIT); 224 227 break; 225 226 227 case IPC_M_USB_HCD_SEND_DATA:228 handle_data_to_function(callid, call,229 false, host_phone);230 break;231 232 case IPC_M_USB_HCD_RECEIVE_DATA:233 handle_data_from_function(callid, call, host_phone);234 break;235 228 236 229 case IPC_M_USB_HCD_TRANSACTION_SIZE: … … 271 264 272 265 default: 266 dprintf_inval_call(2, call, phone_hash); 273 267 ipc_answer_0(callid, EINVAL); 274 268 break;
Note:
See TracChangeset
for help on using the changeset viewer.