Changeset b5e68c8 in mainline for uspace/lib/net/generic/generic.c


Ignore:
Timestamp:
2011-05-12T16:49:44Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f36787d7
Parents:
e80329d6 (diff), 750636a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    re80329d6 rb5e68c8  
    3636
    3737#include <generic.h>
    38 
    3938#include <async.h>
    40 #include <ipc/ipc.h>
    4139#include <ipc/services.h>
    42 
    4340#include <net/device.h>
    4441#include <adt/measured_strings.h>
     
    5956    int state, services_t target)
    6057{
    61         async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
    62             (ipcarg_t) state, target);
     58        async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
     59            (sysarg_t) state, target);
    6360       
    6461        return EOK;
     
    8178    int arg2, services_t service)
    8279{
    83         return (int) async_req_3_0(phone, (ipcarg_t) message,
    84             (ipcarg_t) device_id, (ipcarg_t) arg2, (ipcarg_t) service);
     80        return (int) async_req_3_0(phone, (sysarg_t) message,
     81            (sysarg_t) device_id, (sysarg_t) arg2, (sysarg_t) service);
    8582}
    8683
     
    9289 * @param[out] address  The desired address.
    9390 * @param[out] data     The address data container.
    94  * @returns             EOK on success.
    95  * @returns             EBADMEM if the address parameter and/or the data
     91 * @return              EOK on success.
     92 * @return              EBADMEM if the address parameter and/or the data
    9693 *                      parameter is NULL.
    97  * @returns             Other error codes as defined for the specific service
     94 * @return              Other error codes as defined for the specific service
    9895 *                      message.
    9996 */
    10097int
    10198generic_get_addr_req(int phone, int message, device_id_t device_id,
    102     measured_string_ref *address, char ** data)
     99    measured_string_t **address, uint8_t **data)
    103100{
    104101        aid_t message_id;
    105         ipcarg_t result;
     102        sysarg_t result;
    106103        int string;
    107104
     
    109106                return EBADMEM;
    110107
    111         // request the address
    112         message_id = async_send_1(phone, (ipcarg_t) message,
    113             (ipcarg_t) device_id, NULL);
     108        /* Request the address */
     109        message_id = async_send_1(phone, (sysarg_t) message,
     110            (sysarg_t) device_id, NULL);
    114111        string = measured_strings_return(phone, address, data, 1);
    115112        async_wait_for(message_id, &result);
    116113
    117         // if not successful
     114        /* If not successful */
    118115        if ((string == EOK) && (result != EOK)) {
    119                 // clear the data
     116                /* Clear the data */
    120117                free(*address);
    121118                free(*data);
     
    138135int
    139136generic_packet_size_req_remote(int phone, int message, device_id_t device_id,
    140     packet_dimension_ref packet_dimension)
     137    packet_dimension_t *packet_dimension)
    141138{
    142139        if (!packet_dimension)
    143140                return EBADMEM;
    144141       
    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);
     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);
    152149       
    153150        packet_dimension->prefix = (size_t) prefix;
     
    175172{
    176173        if (error) {
    177                 async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id,
    178                     (ipcarg_t) packet_id, (ipcarg_t) target, (ipcarg_t) error);
     174                async_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id,
     175                    (sysarg_t) packet_id, (sysarg_t) target, (sysarg_t) error);
    179176        } else {
    180                 async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
    181                     (ipcarg_t) packet_id, (ipcarg_t) target);
     177                async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
     178                    (sysarg_t) packet_id, (sysarg_t) target);
    182179        }
    183180       
     
    201198{
    202199        if (error) {
    203                 async_msg_4(phone, (ipcarg_t) message, (ipcarg_t) device_id,
    204                     (ipcarg_t) packet_id, (ipcarg_t) sender, (ipcarg_t) error);
     200                async_msg_4(phone, (sysarg_t) message, (sysarg_t) device_id,
     201                    (sysarg_t) packet_id, (sysarg_t) sender, (sysarg_t) error);
    205202        } else {
    206                 async_msg_3(phone, (ipcarg_t) message, (ipcarg_t) device_id,
    207                     (ipcarg_t) packet_id, (ipcarg_t) sender);
     203                async_msg_3(phone, (sysarg_t) message, (sysarg_t) device_id,
     204                    (sysarg_t) packet_id, (sysarg_t) sender);
    208205        }
    209206       
     
    223220 * @param[out] translation The translated values.
    224221 * @param[out] data     The translation data container.
    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
     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
    229226 *                      NULL.
    230  * @returns             Other error codes as defined for the specific service
     227 * @return              Other error codes as defined for the specific service
    231228 *                      message.
    232229 */
    233230int
    234231generic_translate_req(int phone, int message, device_id_t device_id,
    235     services_t service, measured_string_ref configuration, size_t count,
    236     measured_string_ref *translation, char **data)
     232    services_t service, measured_string_t *configuration, size_t count,
     233    measured_string_t **translation, uint8_t **data)
    237234{
    238235        aid_t message_id;
    239         ipcarg_t result;
     236        sysarg_t result;
    240237        int string;
    241238
     
    245242                return EBADMEM;
    246243
    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);
     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);
    250247        measured_strings_send(phone, configuration, count);
    251248        string = measured_strings_return(phone, translation, data, count);
    252249        async_wait_for(message_id, &result);
    253250
    254         // if not successful
     251        /* If not successful */
    255252        if ((string == EOK) && (result != EOK)) {
    256                 // clear the data
     253                /* Clear the data */
    257254                free(*translation);
    258255                free(*data);
Note: See TracChangeset for help on using the changeset viewer.