Changes in uspace/drv/nic/rtl8139/driver.c [071a1ddb:d51838f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/rtl8139/driver.c
r071a1ddb rd51838f 28 28 29 29 #include <assert.h> 30 #include <async.h>31 30 #include <errno.h> 32 31 #include <align.h> 32 #include <thread.h> 33 33 #include <byteorder.h> 34 34 #include <libarch/barrier.h> … … 435 435 memory_barrier(); 436 436 while(pio_read_8(io_base + CR) & CR_RST) { 437 async_usleep(1);437 thread_usleep(1); 438 438 read_barrier(); 439 439 } … … 816 816 /** Handle device interrupt 817 817 * 818 * @param iid The IPC call id 818 819 * @param icall The IPC call structure 819 820 * @param dev The rtl8139 device 820 821 * 821 822 */ 822 static void rtl8139_interrupt_handler(ipc_call_t *icall, ddf_dev_t *dev) 823 static void rtl8139_interrupt_handler(ipc_callid_t iid, ipc_call_t *icall, 824 ddf_dev_t *dev) 823 825 { 824 826 assert(dev); … … 842 844 * @param nic_data The driver data 843 845 * 844 * @param[out] handle IRQ capability handle if the handler was registered. 845 * 846 * @return IRQ capability handle if the handler was registered. 846 847 * @return Negative error code otherwise. 847 848 */ 848 inline static int rtl8139_register_int_handler(nic_t *nic_data , cap_handle_t *handle)849 inline static int rtl8139_register_int_handler(nic_t *nic_data) 849 850 { 850 851 rtl8139_t *rtl8139 = nic_get_specific(nic_data); … … 857 858 rtl8139_irq_code.cmds[2].addr = rtl8139->io_addr + ISR; 858 859 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); 861 862 862 863 RTL8139_IRQ_STRUCT_UNLOCK(); 863 864 864 return rc;865 return cap; 865 866 } 866 867 … … 1288 1289 1289 1290 /* 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; 1293 1294 goto err_pio; 1294 1295 }
Note:
See TracChangeset
for help on using the changeset viewer.