Changeset a1347a7 in mainline for uspace/lib/c/generic


Ignore:
Timestamp:
2012-01-15T13:51:09Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bd79281
Parents:
03e0a244 (diff), f302586 (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

Location:
uspace/lib/c/generic
Files:
4 edited

Legend:

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

    r03e0a244 ra1347a7  
    257257void async_set_client_data_constructor(async_client_data_ctor_t ctor)
    258258{
     259        assert(async_client_data_create == default_client_data_constructor);
    259260        async_client_data_create = ctor;
    260261}
     
    262263void async_set_client_data_destructor(async_client_data_dtor_t dtor)
    263264{
     265        assert(async_client_data_destroy == default_client_data_destructor);
    264266        async_client_data_destroy = dtor;
    265267}
     
    303305void async_set_client_connection(async_client_conn_t conn)
    304306{
     307        assert(client_connection == default_client_connection);
    305308        client_connection = conn;
    306309}
  • uspace/lib/c/generic/device/nic.c

    r03e0a244 ra1347a7  
    4444#include <ipc/services.h>
    4545
    46 /** Send a packet through the device
    47  *
    48  * @param[in] dev_sess
    49  * @param[in] packet_id Id of the sent packet
    50  *
    51  * @return EOK If the operation was successfully completed
    52  *
    53  */
    54 int nic_send_message(async_sess_t *dev_sess, packet_id_t packet_id)
    55 {
    56         async_exch_t *exch = async_exchange_begin(dev_sess);
    57         int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
    58             NIC_SEND_MESSAGE, packet_id);
    59         async_exchange_end(exch);
    60        
    61         return rc;
     46/** Send frame from NIC
     47 *
     48 * @param[in] dev_sess
     49 * @param[in] data     Frame data
     50 * @param[in] size     Frame size in bytes
     51 *
     52 * @return EOK If the operation was successfully completed
     53 *
     54 */
     55int nic_send_frame(async_sess_t *dev_sess, void *data, size_t size)
     56{
     57        async_exch_t *exch = async_exchange_begin(dev_sess);
     58       
     59        ipc_call_t answer;
     60        aid_t req = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
     61            NIC_SEND_MESSAGE, &answer);
     62        sysarg_t retval = async_data_write_start(exch, data, size);
     63       
     64        async_exchange_end(exch);
     65       
     66        if (retval != EOK) {
     67                async_wait_for(req, NULL);
     68                return retval;
     69        }
     70
     71        async_wait_for(req, &retval);
     72        return retval;
    6273}
    6374
  • uspace/lib/c/generic/devman.c

    r03e0a244 ra1347a7  
    177177
    178178/** Register running driver with device manager. */
    179 int devman_driver_register(const char *name, async_client_conn_t conn)
     179int devman_driver_register(const char *name)
    180180{
    181181        async_exch_t *exch = devman_exchange_begin_blocking(DEVMAN_DRIVER);
     
    192192        }
    193193       
    194         async_set_client_connection(conn);
    195        
    196194        exch = devman_exchange_begin(DEVMAN_DRIVER);
    197         async_connect_to_me(exch, 0, 0, 0, conn, NULL);
     195        async_connect_to_me(exch, 0, 0, 0, NULL, NULL);
    198196        devman_exchange_end(exch);
    199197       
  • uspace/lib/c/generic/loc.c

    r03e0a244 ra1347a7  
    242242
    243243/** Register new driver with loc. */
    244 int loc_server_register(const char *name, async_client_conn_t conn)
     244int loc_server_register(const char *name)
    245245{
    246246        async_exch_t *exch = loc_exchange_begin_blocking(LOC_PORT_SUPPLIER);
     
    256256                return retval;
    257257        }
    258        
    259         async_set_client_connection(conn);
    260258       
    261259        exch = loc_exchange_begin(LOC_PORT_SUPPLIER);
Note: See TracChangeset for help on using the changeset viewer.