Changeset 36d852c in mainline for uspace/app/tester/devmap/devmap1.c
- Timestamp:
- 2007-12-23T19:45:30Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 654b7db
- Parents:
- 5c786d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/devmap/devmap1.c
r5c786d1 r36d852c 50 50 int retval; 51 51 52 printf("connected: method=%u arg1=%u, arg2=%u arg3=%u.\n", IPC_GET_METHOD(*icall), 53 IPC_GET_ARG1(*icall), IPC_GET_ARG2(*icall), IPC_GET_ARG3(*icall)); 52 printf("connected: method=%u arg1=%u, arg2=%u arg3=%u.\n", 53 IPC_GET_METHOD(*icall), IPC_GET_ARG1(*icall), IPC_GET_ARG2(*icall), 54 IPC_GET_ARG3(*icall)); 54 55 55 56 printf("driver_client_connection.\n"); … … 60 61 callid = async_get_call(&call); 61 62 retval = EOK; 62 printf("method=%u arg1=%u, arg2=%u arg3=%u.\n", IPC_GET_METHOD(call), 63 IPC_GET_ARG1(call), IPC_GET_ARG2(call), IPC_GET_ARG3(call)); 63 printf("method=%u arg1=%u, arg2=%u arg3=%u.\n", 64 IPC_GET_METHOD(call), IPC_GET_ARG1(call), 65 IPC_GET_ARG2(call), IPC_GET_ARG3(call)); 64 66 switch (IPC_GET_METHOD(call)) { 65 67 case IPC_M_PHONE_HUNGUP: … … 67 69 return; 68 70 default: 69 printf("Unknown device method %u.\n", IPC_GET_METHOD(call)); 71 printf("Unknown device method %u.\n", 72 IPC_GET_METHOD(call)); 70 73 retval = ENOENT; 71 74 } … … 82 85 handle = (int)arg; 83 86 84 device_phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, \85 87 device_phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, 88 DEVMAP_CONNECT_TO_DEVICE, handle); 86 89 87 90 if (device_phone < 0) { 88 printf("Failed to connect to devmap as client (handle = %u).\n", 89 91 printf("Failed to connect to devmap as client (handle = %u).\n", 92 handle); 90 93 return -1; 91 94 } … … 130 133 ipcarg_t callback_phonehash; 131 134 132 phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, 133 DEVMAP_DRIVER, 0); 135 phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, DEVMAP_DRIVER, 0); 134 136 135 137 while (phone < 0) { 136 138 usleep(100000); 137 139 phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, 138 140 DEVMAP_DRIVER, 0); 139 141 } 140 142 141 143 req = async_send_2(phone, DEVMAP_DRIVER_REGISTER, 0, 0, &answer); 142 144 143 retval = ipc_data_ send(phone, (char *)name, strlen(name) + 1);145 retval = ipc_data_write_send(phone, (char *)name, strlen(name) + 1); 144 146 145 147 if (retval != EOK) { … … 171 173 ipc_call_t answer; 172 174 173 req = async_send_2(driver_phone, DEVMAP_DEVICE_GET_HANDLE, 0, 0, &answer); 174 175 retval = ipc_data_send(driver_phone, name, strlen(name) + 1); 175 req = async_send_2(driver_phone, DEVMAP_DEVICE_GET_HANDLE, 0, 0, 176 &answer); 177 178 retval = ipc_data_write_send(driver_phone, name, strlen(name) + 1); 176 179 177 180 if (retval != EOK) { … … 192 195 *handle = (int) IPC_GET_ARG1(answer); 193 196 } 194 printf("Device '%s' has handle %u.\n", name, (int) IPC_GET_ARG1(answer)); 197 printf("Device '%s' has handle %u.\n", name, 198 (int) IPC_GET_ARG1(answer)); 195 199 } else { 196 200 printf("Failed to get handle for device '%s'.\n", name); … … 213 217 req = async_send_2(driver_phone, DEVMAP_DEVICE_REGISTER, 0, 0, &answer); 214 218 215 retval = ipc_data_send(driver_phone, (char *)name, strlen(name) + 1); 219 retval = ipc_data_write_send(driver_phone, (char *)name, 220 strlen(name) + 1); 216 221 217 222 if (retval != EOK) { … … 232 237 *handle = (int) IPC_GET_ARG1(answer); 233 238 } 234 printf("Device registered with handle %u.\n", (int) IPC_GET_ARG1(answer)); 239 printf("Device registered with handle %u.\n", 240 (int) IPC_GET_ARG1(answer)); 235 241 } 236 242
Note:
See TracChangeset
for help on using the changeset viewer.