Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/generic/generic.c

    r28a3e74 rb01f878  
    3636
    3737#include <generic.h>
     38
    3839#include <async.h>
     40#include <ipc/ipc.h>
    3941#include <ipc/services.h>
     42
    4043#include <net/device.h>
    4144#include <adt/measured_strings.h>
     
    5659    int state, services_t target)
    5760{
    58         async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
    59             (sysarg_t) state, target);
     61        async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
     62            (ipcarg_t) state, target);
    6063       
    6164        return EOK;
     
    7881    int arg2, services_t service)
    7982{
    80         return (int) async_req_3_0(phone, (sysarg_t) message,
    81             (sysarg_t) device_id, (sysarg_t) arg2, (sysarg_t) service);
     83        return (int) async_req_3_0(phone, (ipcarg_t) message,
     84            (ipcarg_t) device_id, (ipcarg_t) arg2, (ipcarg_t) service);
    8285}
    8386
     
    8992 * @param[out] address  The desired address.
    9093 * @param[out] data     The address data container.
    91  * @return              EOK on success.
    92  * @return              EBADMEM if the address parameter and/or the data
     94 * @returns             EOK on success.
     95 * @returns             EBADMEM if the address parameter and/or the data
    9396 *                      parameter is NULL.
    94  * @return              Other error codes as defined for the specific service
     97 * @returns             Other error codes as defined for the specific service
    9598 *                      message.
    9699 */
    97100int
    98101generic_get_addr_req(int phone, int message, device_id_t device_id,
    99     measured_string_t **address, uint8_t **data)
     102    measured_string_ref *address, char ** data)
    100103{
    101104        aid_t message_id;
    102         sysarg_t result;
     105        ipcarg_t result;
    103106        int string;
    104107
     
    106109                return EBADMEM;
    107110
    108         /* Request the address */
    109         message_id = async_send_1(phone, (sysarg_t) message,
    110             (sysarg_t) device_id, NULL);
     111        // request the address
     112        message_id = async_send_1(phone, (ipcarg_t) message,
     113            (ipcarg_t) device_id, NULL);
    111114        string = measured_strings_return(phone, address, data, 1);
    112115        async_wait_for(message_id, &result);
    113116
    114         /* If not successful */
     117        // if not successful
    115118        if ((string == EOK) && (result != EOK)) {
    116                 /* Clear the data */
     119                // clear the data
    117120                free(*address);
    118121                free(*data);
     
    135138int
    136139generic_packet_size_req_remote(int phone, int message, device_id_t device_id,
    137     packet_dimension_t *packet_dimension)
     140    packet_dimension_ref packet_dimension)
    138141{
    139142        if (!packet_dimension)
    140143                return EBADMEM;
    141144       
    142         sysarg_t addr_len;
    143         sysarg_t prefix;
    144         sysarg_t content;
    145         sysarg_t suffix;
    146        
    147         sysarg_t result = async_req_1_4(phone, (sysarg_t) message,
    148             (sysarg_t) device_id, &addr_len, &prefix, &content, &suffix);
     145        ipcarg_t addr_len;
     146        ipcarg_t prefix;
     147        ipcarg_t content;
     148        ipcarg_t suffix;
     149       
     150        ipcarg_t result = async_req_1_4(phone, (ipcarg_t) message,
     151            (ipcarg_t) device_id, &addr_len, &prefix, &content, &suffix);
    149152       
    150153        packet_dimension->prefix = (size_t) prefix;
     
    172175{
    173176        if (error) {
    174                 async_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id,
    175                     (sysarg_t) packet_id, (sysarg_t) target, (sysarg_t) error);
     177                async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id,
     178                    (ipcarg_t) packet_id, (ipcarg_t) target, (ipcarg_t) error);
    176179        } else {
    177                 async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
    178                     (sysarg_t) packet_id, (sysarg_t) target);
     180                async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
     181                    (ipcarg_t) packet_id, (ipcarg_t) target);
    179182        }
    180183       
     
    198201{
    199202        if (error) {
    200                 async_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id,
    201                     (sysarg_t) packet_id, (sysarg_t) sender, (sysarg_t) error);
     203                async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id,
     204                    (ipcarg_t) packet_id, (ipcarg_t) sender, (ipcarg_t) error);
    202205        } else {
    203                 async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
    204                     (sysarg_t) packet_id, (sysarg_t) sender);
     206                async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
     207                    (ipcarg_t) packet_id, (ipcarg_t) sender);
    205208        }
    206209       
     
    220223 * @param[out] translation The translated values.
    221224 * @param[out] data     The translation data container.
    222  * @return              EOK on success.
    223  * @return              EINVAL if the configuration parameter is NULL.
    224  * @return              EINVAL if the count parameter is zero.
    225  * @return              EBADMEM if the translation or the data parameters are
     225 * @returns             EOK on success.
     226 * @returns             EINVAL if the configuration parameter is NULL.
     227 * @returns             EINVAL if the count parameter is zero.
     228 * @returns             EBADMEM if the translation or the data parameters are
    226229 *                      NULL.
    227  * @return              Other error codes as defined for the specific service
     230 * @returns             Other error codes as defined for the specific service
    228231 *                      message.
    229232 */
    230233int
    231234generic_translate_req(int phone, int message, device_id_t device_id,
    232     services_t service, measured_string_t *configuration, size_t count,
    233     measured_string_t **translation, uint8_t **data)
     235    services_t service, measured_string_ref configuration, size_t count,
     236    measured_string_ref *translation, char **data)
    234237{
    235238        aid_t message_id;
    236         sysarg_t result;
     239        ipcarg_t result;
    237240        int string;
    238241
     
    242245                return EBADMEM;
    243246
    244         /* Request the translation */
    245         message_id = async_send_3(phone, (sysarg_t) message,
    246             (sysarg_t) device_id, (sysarg_t) count, (sysarg_t) service, NULL);
     247        // request the translation
     248        message_id = async_send_3(phone, (ipcarg_t) message,
     249            (ipcarg_t) device_id, (ipcarg_t) count, (ipcarg_t) service, NULL);
    247250        measured_strings_send(phone, configuration, count);
    248251        string = measured_strings_return(phone, translation, data, count);
    249252        async_wait_for(message_id, &result);
    250253
    251         /* If not successful */
     254        // if not successful
    252255        if ((string == EOK) && (result != EOK)) {
    253                 /* Clear the data */
     256                // clear the data
    254257                free(*translation);
    255258                free(*data);
Note: See TracChangeset for help on using the changeset viewer.