Changes in uspace/drv/nic/rtl8139/driver.c [d51838f:cde999a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/rtl8139/driver.c
rd51838f rcde999a 28 28 29 29 #include <assert.h> 30 #include <async.h> 30 31 #include <errno.h> 31 32 #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, negativeerror code otherwise219 * @return EOK if succeed, 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 thread_usleep(1);437 async_usleep(1); 438 438 read_barrier(); 439 439 } … … 816 816 /** Handle device interrupt 817 817 * 818 * @param iid The IPC call id819 818 * @param icall The IPC call structure 820 819 * @param dev The rtl8139 device 821 820 * 822 821 */ 823 static void rtl8139_interrupt_handler(ipc_callid_t iid, ipc_call_t *icall, 824 ddf_dev_t *dev) 822 static void rtl8139_interrupt_handler(ipc_call_t *icall, ddf_dev_t *dev) 825 823 { 826 824 assert(dev); … … 844 842 * @param nic_data The driver data 845 843 * 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 */ 848 inline static int rtl8139_register_int_handler(nic_t *nic_data, cap_handle_t *handle) 850 849 { 851 850 rtl8139_t *rtl8139 = nic_get_specific(nic_data); … … 858 857 rtl8139_irq_code.cmds[2].addr = rtl8139->io_addr + ISR; 859 858 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); 862 861 863 862 RTL8139_IRQ_STRUCT_UNLOCK(); 864 863 865 return cap;864 return rc; 866 865 } 867 866 … … 1026 1025 * @param hw_resources Devices hardware resources 1027 1026 * 1028 * @return EOK if succeed, negativeerror code otherwise1027 * @return EOK if succeed, error code otherwise 1029 1028 */ 1030 1029 static int rtl8139_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t … … 1066 1065 * @param dev The device structure 1067 1066 * 1068 * @return EOK if succeed, negativeerror code otherwise1067 * @return EOK if succeed, error code otherwise 1069 1068 */ 1070 1069 static int rtl8139_get_resource_info(ddf_dev_t *dev) … … 1148 1147 * @param dev The device information 1149 1148 * 1150 * @return EOK if succeed, negativeerror code otherwise1149 * @return EOK if succeed, error code otherwise 1151 1150 */ 1152 1151 static int rtl8139_device_initialize(ddf_dev_t *dev) … … 1207 1206 * @param dev The RTL8139 device. 1208 1207 * 1209 * @return EOK if successed, negativeerror code otherwise1208 * @return EOK if successed, error code otherwise 1210 1209 */ 1211 1210 static int rtl8139_pio_enable(ddf_dev_t *dev) … … 1257 1256 * @param dev The RTL8139 device. 1258 1257 * 1259 * @return EOK if added successfully, negativeerror code otherwise1258 * @return EOK if added successfully, error code otherwise 1260 1259 */ 1261 1260 int rtl8139_dev_add(ddf_dev_t *dev) … … 1289 1288 1290 1289 /* 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) { 1294 1293 goto err_pio; 1295 1294 } … … 1340 1339 * @param max_len Maximal addresss length to store 1341 1340 * 1342 * @return EOK if succeed, negativeerror code otherwise1341 * @return EOK if succeed, error code otherwise 1343 1342 */ 1344 1343 static int rtl8139_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
Note:
See TracChangeset
for help on using the changeset viewer.