Changeset 47f5a77 in mainline for uspace/lib/c/generic/iplink.c


Ignore:
Timestamp:
2013-07-17T08:46:06Z (11 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a0a4d8
Parents:
cdc3afa (diff), 1d94e21 (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/c/generic/iplink.c

    rcdc3afa r47f5a77  
    8686       
    8787        ipc_call_t answer;
    88         aid_t req = async_send_0(exch, IPLINK_SEND, &answer);
    89        
    90         int rc = async_data_write_start(exch, &sdu->src, sizeof(inet_addr_t));
     88        aid_t req = async_send_2(exch, IPLINK_SEND, (sysarg_t) sdu->src,
     89            (sysarg_t) sdu->dest, &answer);
     90       
     91        int rc = async_data_write_start(exch, sdu->data, sdu->size);
     92       
     93        async_exchange_end(exch);
     94       
     95        if (rc != EOK) {
     96                async_forget(req);
     97                return rc;
     98        }
     99       
     100        sysarg_t retval;
     101        async_wait_for(req, &retval);
     102       
     103        return (int) retval;
     104}
     105
     106int iplink_send6(iplink_t *iplink, iplink_sdu6_t *sdu)
     107{
     108        async_exch_t *exch = async_exchange_begin(iplink->sess);
     109       
     110        ipc_call_t answer;
     111        aid_t req = async_send_0(exch, IPLINK_SEND6, &answer);
     112       
     113        int rc = async_data_write_start(exch, &sdu->dest, sizeof(addr48_t));
    91114        if (rc != EOK) {
    92115                async_exchange_end(exch);
     
    95118        }
    96119       
    97         rc = async_data_write_start(exch, &sdu->dest, sizeof(inet_addr_t));
    98         if (rc != EOK) {
    99                 async_exchange_end(exch);
    100                 async_forget(req);
    101                 return rc;
    102         }
    103        
    104120        rc = async_data_write_start(exch, sdu->data, sdu->size);
    105121       
     
    119135int iplink_get_mtu(iplink_t *iplink, size_t *rmtu)
    120136{
     137        async_exch_t *exch = async_exchange_begin(iplink->sess);
     138       
    121139        sysarg_t mtu;
    122         async_exch_t *exch = async_exchange_begin(iplink->sess);
    123 
    124140        int rc = async_req_0_1(exch, IPLINK_GET_MTU, &mtu);
    125         async_exchange_end(exch);
    126 
     141       
     142        async_exchange_end(exch);
     143       
    127144        if (rc != EOK)
    128145                return rc;
    129 
     146       
    130147        *rmtu = mtu;
    131148        return EOK;
     149}
     150
     151int iplink_get_mac48(iplink_t *iplink, addr48_t *mac)
     152{
     153        async_exch_t *exch = async_exchange_begin(iplink->sess);
     154       
     155        ipc_call_t answer;
     156        aid_t req = async_send_0(exch, IPLINK_GET_MAC48, &answer);
     157       
     158        int rc = async_data_read_start(exch, mac, sizeof(addr48_t));
     159       
     160        loc_exchange_end(exch);
     161       
     162        if (rc != EOK) {
     163                async_forget(req);
     164                return rc;
     165        }
     166       
     167        sysarg_t retval;
     168        async_wait_for(req, &retval);
     169       
     170        return (int) retval;
    132171}
    133172
Note: See TracChangeset for help on using the changeset viewer.