Changes in uspace/drv/nic/rtl8139/driver.c [cde999a:d51838f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/rtl8139/driver.c
rcde999a 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> … … 217 217 * @param address The place to store the address 218 218 * 219 * @return EOK if succeed, error code otherwise219 * @return EOK if succeed, negative error code otherwise 220 220 */ 221 221 inline static void rtl8139_hw_get_addr(rtl8139_t *rtl8139, … … 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 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 */ 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 … … 1025 1026 * @param hw_resources Devices hardware resources 1026 1027 * 1027 * @return EOK if succeed, error code otherwise1028 * @return EOK if succeed, negative error code otherwise 1028 1029 */ 1029 1030 static int rtl8139_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t … … 1065 1066 * @param dev The device structure 1066 1067 * 1067 * @return EOK if succeed, error code otherwise1068 * @return EOK if succeed, negative error code otherwise 1068 1069 */ 1069 1070 static int rtl8139_get_resource_info(ddf_dev_t *dev) … … 1147 1148 * @param dev The device information 1148 1149 * 1149 * @return EOK if succeed, error code otherwise1150 * @return EOK if succeed, negative error code otherwise 1150 1151 */ 1151 1152 static int rtl8139_device_initialize(ddf_dev_t *dev) … … 1206 1207 * @param dev The RTL8139 device. 1207 1208 * 1208 * @return EOK if successed, error code otherwise1209 * @return EOK if successed, negative error code otherwise 1209 1210 */ 1210 1211 static int rtl8139_pio_enable(ddf_dev_t *dev) … … 1256 1257 * @param dev The RTL8139 device. 1257 1258 * 1258 * @return EOK if added successfully, error code otherwise1259 * @return EOK if added successfully, negative error code otherwise 1259 1260 */ 1260 1261 int rtl8139_dev_add(ddf_dev_t *dev) … … 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 } … … 1339 1340 * @param max_len Maximal addresss length to store 1340 1341 * 1341 * @return EOK if succeed, error code otherwise1342 * @return EOK if succeed, negative error code otherwise 1342 1343 */ 1343 1344 static int rtl8139_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
Note:
See TracChangeset
for help on using the changeset viewer.