Changeset 36d852c in mainline for uspace/app/tester/devmap/devmap1.c


Ignore:
Timestamp:
2007-12-23T19:45:30Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
654b7db
Parents:
5c786d1
Message:

Rename IPC_M_DATA_SEND to IPC_M_DATA_WRITE. Now, when we also add
IPC_M_DATA_READ, it will not clash and cause confusion with userspace wrappers
such as ipc_data_receive(). Rename the forementioned wrappers to
ipc_data_write_send(), ipc_data_write_receive() and ipc_data_write_deliver().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/devmap/devmap1.c

    r5c786d1 r36d852c  
    5050        int retval;
    5151       
    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));
    5455
    5556        printf("driver_client_connection.\n");
     
    6061                callid = async_get_call(&call);
    6162                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));
    6466                switch (IPC_GET_METHOD(call)) {
    6567                case IPC_M_PHONE_HUNGUP:
     
    6769                        return;
    6870                default:
    69                         printf("Unknown device method %u.\n", IPC_GET_METHOD(call));
     71                        printf("Unknown device method %u.\n",
     72                            IPC_GET_METHOD(call));
    7073                        retval = ENOENT;
    7174                }
     
    8285        handle = (int)arg;
    8386
    84         device_phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, \
    85                 DEVMAP_CONNECT_TO_DEVICE, handle);
     87        device_phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP,
     88            DEVMAP_CONNECT_TO_DEVICE, handle);
    8689
    8790        if (device_phone < 0) {
    88                 printf("Failed to connect to devmap as client (handle = %u).\n", 
    89                         handle);
     91                printf("Failed to connect to devmap as client (handle = %u).\n",
     92                    handle);
    9093                return -1;
    9194        }
     
    130133        ipcarg_t callback_phonehash;
    131134
    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);
    134136
    135137        while (phone < 0) {
    136138                usleep(100000);
    137139                phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP,
    138                         DEVMAP_DRIVER, 0);
     140                    DEVMAP_DRIVER, 0);
    139141        }
    140142       
    141143        req = async_send_2(phone, DEVMAP_DRIVER_REGISTER, 0, 0, &answer);
    142144
    143         retval = ipc_data_send(phone, (char *)name, strlen(name) + 1);
     145        retval = ipc_data_write_send(phone, (char *)name, strlen(name) + 1);
    144146
    145147        if (retval != EOK) {
     
    171173        ipc_call_t answer;
    172174
    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);
    176179
    177180        if (retval != EOK) {
     
    192195                        *handle = (int) IPC_GET_ARG1(answer);
    193196                }
    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));
    195199        } else {
    196200                printf("Failed to get handle for device '%s'.\n", name);
     
    213217        req = async_send_2(driver_phone, DEVMAP_DEVICE_REGISTER, 0, 0, &answer);
    214218
    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);
    216221
    217222        if (retval != EOK) {
     
    232237                        *handle = (int) IPC_GET_ARG1(answer);
    233238                }
    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));
    235241        }
    236242
Note: See TracChangeset for help on using the changeset viewer.