Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/rtl8139/driver.c

    rcde999a rd51838f  
    2828
    2929#include <assert.h>
    30 #include <async.h>
    3130#include <errno.h>
    3231#include <align.h>
     32#include <thread.h>
    3333#include <byteorder.h>
    3434#include <libarch/barrier.h>
     
    217217 *  @param address  The place to store the address
    218218 *
    219  *  @return EOK if succeed, error code otherwise
     219 *  @return EOK if succeed, negative error code otherwise
    220220 */
    221221inline static void rtl8139_hw_get_addr(rtl8139_t *rtl8139,
     
    435435        memory_barrier();
    436436        while(pio_read_8(io_base + CR) & CR_RST) {
    437                 async_usleep(1);
     437                thread_usleep(1);
    438438                read_barrier();
    439439        }
     
    816816/** Handle device interrupt
    817817 *
     818 * @param iid    The IPC call id
    818819 * @param icall  The IPC call structure
    819820 * @param dev    The rtl8139 device
    820821 *
    821822 */
    822 static void rtl8139_interrupt_handler(ipc_call_t *icall, ddf_dev_t *dev)
     823static void rtl8139_interrupt_handler(ipc_callid_t iid, ipc_call_t *icall,
     824    ddf_dev_t *dev)
    823825{
    824826        assert(dev);
     
    842844 *  @param nic_data  The driver data
    843845 *
    844  *  @param[out] handle  IRQ capability handle if the handler was registered.
    845  *
    846  *  @return An error code otherwise.
    847  */
    848 inline static int rtl8139_register_int_handler(nic_t *nic_data, cap_handle_t *handle)
     846 *  @return IRQ capability handle if the handler was registered.
     847 *  @return Negative error code otherwise.
     848 */
     849inline static int rtl8139_register_int_handler(nic_t *nic_data)
    849850{
    850851        rtl8139_t *rtl8139 = nic_get_specific(nic_data);
     
    857858        rtl8139_irq_code.cmds[2].addr = rtl8139->io_addr + ISR;
    858859        rtl8139_irq_code.cmds[3].addr = rtl8139->io_addr + IMR;
    859         int rc = register_interrupt_handler(nic_get_ddf_dev(nic_data),
    860             rtl8139->irq, rtl8139_interrupt_handler, &rtl8139_irq_code, handle);
     860        int cap = register_interrupt_handler(nic_get_ddf_dev(nic_data),
     861            rtl8139->irq, rtl8139_interrupt_handler, &rtl8139_irq_code);
    861862
    862863        RTL8139_IRQ_STRUCT_UNLOCK();
    863864
    864         return rc;
     865        return cap;
    865866}
    866867
     
    10251026 *  @param hw_resources  Devices hardware resources
    10261027 *
    1027  *  @return EOK if succeed, error code otherwise
     1028 *  @return EOK if succeed, negative error code otherwise
    10281029 */
    10291030static int rtl8139_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t
     
    10651066 *  @param dev  The device structure
    10661067 *
    1067  *  @return EOK if succeed, error code otherwise
     1068 *  @return EOK if succeed, negative error code otherwise
    10681069 */
    10691070static int rtl8139_get_resource_info(ddf_dev_t *dev)
     
    11471148 *  @param dev  The device information
    11481149 *
    1149  *  @return EOK if succeed, error code otherwise
     1150 *  @return EOK if succeed, negative error code otherwise
    11501151 */
    11511152static int rtl8139_device_initialize(ddf_dev_t *dev)
     
    12061207 * @param dev  The RTL8139 device.
    12071208 *
    1208  * @return EOK if successed, error code otherwise
     1209 * @return EOK if successed, negative error code otherwise
    12091210 */
    12101211static int rtl8139_pio_enable(ddf_dev_t *dev)
     
    12561257 * @param dev  The RTL8139 device.
    12571258 *
    1258  * @return EOK if added successfully, error code otherwise
     1259 * @return EOK if added successfully, negative error code otherwise
    12591260 */
    12601261int rtl8139_dev_add(ddf_dev_t *dev)
     
    12881289
    12891290        /* Register interrupt handler */
    1290         int irq_cap;
    1291         rc = rtl8139_register_int_handler(nic_data, &irq_cap);
    1292         if (rc != EOK) {
     1291        int irq_cap = rtl8139_register_int_handler(nic_data);
     1292        if (irq_cap < 0) {
     1293                rc = irq_cap;
    12931294                goto err_pio;
    12941295        }
     
    13391340 *  @param max_len  Maximal addresss length to store
    13401341 *
    1341  *  @return EOK if succeed, error code otherwise
     1342 *  @return EOK if succeed, negative error code otherwise
    13421343 */
    13431344static int rtl8139_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
Note: See TracChangeset for help on using the changeset viewer.