Ignore:
File:
1 edited

Legend:

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

    rd51838f rcde999a  
    2828
    2929#include <assert.h>
     30#include <async.h>
    3031#include <errno.h>
    3132#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, negative error code otherwise
     219 *  @return EOK if succeed, 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                 thread_usleep(1);
     437                async_usleep(1);
    438438                read_barrier();
    439439        }
     
    816816/** Handle device interrupt
    817817 *
    818  * @param iid    The IPC call id
    819818 * @param icall  The IPC call structure
    820819 * @param dev    The rtl8139 device
    821820 *
    822821 */
    823 static void rtl8139_interrupt_handler(ipc_callid_t iid, ipc_call_t *icall,
    824     ddf_dev_t *dev)
     822static void rtl8139_interrupt_handler(ipc_call_t *icall, ddf_dev_t *dev)
    825823{
    826824        assert(dev);
     
    844842 *  @param nic_data  The driver data
    845843 *
    846  *  @return IRQ capability handle if the handler was registered.
    847  *  @return Negative error code otherwise.
    848  */
    849 inline static int rtl8139_register_int_handler(nic_t *nic_data)
     844 *  @param[out] handle  IRQ capability handle if the handler was registered.
     845 *
     846 *  @return An error code otherwise.
     847 */
     848inline static int rtl8139_register_int_handler(nic_t *nic_data, cap_handle_t *handle)
    850849{
    851850        rtl8139_t *rtl8139 = nic_get_specific(nic_data);
     
    858857        rtl8139_irq_code.cmds[2].addr = rtl8139->io_addr + ISR;
    859858        rtl8139_irq_code.cmds[3].addr = rtl8139->io_addr + IMR;
    860         int cap = register_interrupt_handler(nic_get_ddf_dev(nic_data),
    861             rtl8139->irq, rtl8139_interrupt_handler, &rtl8139_irq_code);
     859        int rc = register_interrupt_handler(nic_get_ddf_dev(nic_data),
     860            rtl8139->irq, rtl8139_interrupt_handler, &rtl8139_irq_code, handle);
    862861
    863862        RTL8139_IRQ_STRUCT_UNLOCK();
    864863
    865         return cap;
     864        return rc;
    866865}
    867866
     
    10261025 *  @param hw_resources  Devices hardware resources
    10271026 *
    1028  *  @return EOK if succeed, negative error code otherwise
     1027 *  @return EOK if succeed, error code otherwise
    10291028 */
    10301029static int rtl8139_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t
     
    10661065 *  @param dev  The device structure
    10671066 *
    1068  *  @return EOK if succeed, negative error code otherwise
     1067 *  @return EOK if succeed, error code otherwise
    10691068 */
    10701069static int rtl8139_get_resource_info(ddf_dev_t *dev)
     
    11481147 *  @param dev  The device information
    11491148 *
    1150  *  @return EOK if succeed, negative error code otherwise
     1149 *  @return EOK if succeed, error code otherwise
    11511150 */
    11521151static int rtl8139_device_initialize(ddf_dev_t *dev)
     
    12071206 * @param dev  The RTL8139 device.
    12081207 *
    1209  * @return EOK if successed, negative error code otherwise
     1208 * @return EOK if successed, error code otherwise
    12101209 */
    12111210static int rtl8139_pio_enable(ddf_dev_t *dev)
     
    12571256 * @param dev  The RTL8139 device.
    12581257 *
    1259  * @return EOK if added successfully, negative error code otherwise
     1258 * @return EOK if added successfully, error code otherwise
    12601259 */
    12611260int rtl8139_dev_add(ddf_dev_t *dev)
     
    12891288
    12901289        /* Register interrupt handler */
    1291         int irq_cap = rtl8139_register_int_handler(nic_data);
    1292         if (irq_cap < 0) {
    1293                 rc = irq_cap;
     1290        int irq_cap;
     1291        rc = rtl8139_register_int_handler(nic_data, &irq_cap);
     1292        if (rc != EOK) {
    12941293                goto err_pio;
    12951294        }
     
    13401339 *  @param max_len  Maximal addresss length to store
    13411340 *
    1342  *  @return EOK if succeed, negative error code otherwise
     1341 *  @return EOK if succeed, error code otherwise
    13431342 */
    13441343static int rtl8139_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
Note: See TracChangeset for help on using the changeset viewer.