Changeset 00d7e1b in mainline for uspace/lib/c/generic/device/nic.c


Ignore:
Timestamp:
2011-10-07T20:20:33Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
49bd793b
Parents:
e2c50e1
Message:

networking improvements

  • start the networking stack from init
  • add loopback network interface driver (cherrypicked and sanitized from lp:~helenos-nicf/helenos/nicf)
  • add libnic and various small pieces from lp:~helenos-nicf/helenos/nicf
  • fix client side of NIC_GET_ADDRESS
  • net binary overhaul

Note: "ping 127.0.0.1" works, but the first three pings timeout for some reason

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/device/nic.c

    re2c50e1 r00d7e1b  
    137137       
    138138        async_exch_t *exch = async_exchange_begin(dev_sess);
    139        
    140         int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), NIC_GET_ADDRESS);
    141         if (rc != EOK) {
    142                 async_exchange_end(exch);
    143                 return rc;
    144         }
    145        
    146         rc = async_data_read_start(exch, address, sizeof(nic_address_t));
    147        
    148         async_exchange_end(exch);
    149        
    150         return rc;
     139        aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
     140            NIC_GET_ADDRESS, NULL);
     141        int rc = async_data_read_start(exch, address, sizeof(nic_address_t));
     142        async_exchange_end(exch);
     143       
     144        sysarg_t res;
     145        async_wait_for(aid, &res);
     146       
     147        if (rc != EOK)
     148                return rc;
     149       
     150        return (int) res;
    151151}
    152152
     
    164164       
    165165        async_exch_t *exch = async_exchange_begin(dev_sess);
    166         aid_t message_id = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
     166        aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
    167167            NIC_SET_ADDRESS, NULL);
    168168        int rc = async_data_write_start(exch, address, sizeof(nic_address_t));
     
    170170       
    171171        sysarg_t res;
    172         async_wait_for(message_id, &res);
     172        async_wait_for(aid, &res);
    173173       
    174174        if (rc != EOK)
Note: See TracChangeset for help on using the changeset viewer.