Changeset 071a1ddb in mainline for uspace/drv/nic
- Timestamp:
- 2017-12-08T21:17:27Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0722869, 569a51a
- Parents:
- 9233e9d
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 00:30:18)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:17:27)
- Location:
- uspace/drv/nic
- Files:
-
- 4 edited
-
e1k/e1k.c (modified) (3 diffs)
-
ne2k/ne2k.c (modified) (3 diffs)
-
rtl8139/driver.c (modified) (3 diffs)
-
rtl8169/driver.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/e1k/e1k.c
r9233e9d r071a1ddb 1259 1259 * @param nic Driver data 1260 1260 * 1261 * @return IRQ capability handle if the handler was registered 1261 * @param[out] handle IRQ capability handle if the handler was registered 1262 * 1262 1263 * @return Negative error code otherwise 1263 1264 * 1264 1265 */ 1265 inline static int e1000_register_int_handler(nic_t *nic )1266 inline static int e1000_register_int_handler(nic_t *nic, cap_handle_t *handle) 1266 1267 { 1267 1268 e1000_t *e1000 = DRIVER_DATA_NIC(nic); … … 1274 1275 e1000_irq_code.cmds[2].addr = e1000->reg_base_phys + E1000_IMC; 1275 1276 1276 int cap= register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq,1277 e1000_interrupt_handler, &e1000_irq_code );1277 int rc = register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq, 1278 e1000_interrupt_handler, &e1000_irq_code, handle); 1278 1279 1279 1280 fibril_mutex_unlock(&irq_reg_mutex); 1280 return cap;1281 return rc; 1281 1282 } 1282 1283 … … 2164 2165 ddf_fun_set_ops(fun, &e1000_dev_ops); 2165 2166 2166 int irq_cap = e1000_register_int_handler(nic);2167 if (irq_cap < 0) {2168 rc = irq_cap;2167 int irq_cap; 2168 rc = e1000_register_int_handler(nic, &irq_cap); 2169 if (rc != EOK) { 2169 2170 goto err_fun_create; 2170 2171 } -
uspace/drv/nic/ne2k/ne2k.c
r9233e9d r071a1ddb 124 124 static void ne2k_interrupt_handler(ipc_call_t *, ddf_dev_t *); 125 125 126 static int ne2k_register_interrupt(nic_t *nic_data )126 static int ne2k_register_interrupt(nic_t *nic_data, cap_handle_t *handle) 127 127 { 128 128 ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data); … … 160 160 } 161 161 162 int irq_cap = register_interrupt_handler(nic_get_ddf_dev(nic_data), 163 ne2k->irq, ne2k_interrupt_handler, &ne2k->code); 164 return irq_cap; 162 return register_interrupt_handler(nic_get_ddf_dev(nic_data), 163 ne2k->irq, ne2k_interrupt_handler, &ne2k->code, handle); 165 164 } 166 165 … … 228 227 ne2k->probed = true; 229 228 230 int irq_cap = ne2k_register_interrupt(nic_data); 231 if (irq_cap < 0) 229 if (ne2k_register_interrupt(nic_data, NULL) != EOK) 232 230 return EINVAL; 233 231 -
uspace/drv/nic/rtl8139/driver.c
r9233e9d r071a1ddb 842 842 * @param nic_data The driver data 843 843 * 844 * @return IRQ capability handle if the handler was registered. 844 * @param[out] handle IRQ capability handle if the handler was registered. 845 * 845 846 * @return Negative error code otherwise. 846 847 */ 847 inline static int rtl8139_register_int_handler(nic_t *nic_data )848 inline static int rtl8139_register_int_handler(nic_t *nic_data, cap_handle_t *handle) 848 849 { 849 850 rtl8139_t *rtl8139 = nic_get_specific(nic_data); … … 856 857 rtl8139_irq_code.cmds[2].addr = rtl8139->io_addr + ISR; 857 858 rtl8139_irq_code.cmds[3].addr = rtl8139->io_addr + IMR; 858 int cap= register_interrupt_handler(nic_get_ddf_dev(nic_data),859 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); 860 861 861 862 RTL8139_IRQ_STRUCT_UNLOCK(); 862 863 863 return cap;864 return rc; 864 865 } 865 866 … … 1287 1288 1288 1289 /* Register interrupt handler */ 1289 int irq_cap = rtl8139_register_int_handler(nic_data);1290 if (irq_cap < 0) {1291 rc = irq_cap;1290 int irq_cap; 1291 rc = rtl8139_register_int_handler(nic_data, &irq_cap); 1292 if (rc != EOK) { 1292 1293 goto err_pio; 1293 1294 } -
uspace/drv/nic/rtl8169/driver.c
r9233e9d r071a1ddb 73 73 static void rtl8169_send_frame(nic_t *nic_data, void *data, size_t size); 74 74 static void rtl8169_irq_handler(ipc_call_t *icall, ddf_dev_t *dev); 75 static inline int rtl8169_register_int_handler(nic_t *nic_data );75 static inline int rtl8169_register_int_handler(nic_t *nic_data, cap_handle_t *handle); 76 76 static inline void rtl8169_get_hwaddr(rtl8169_t *rtl8169, nic_address_t *addr); 77 77 static inline void rtl8169_set_hwaddr(rtl8169_t *rtl8169, const nic_address_t *addr); … … 359 359 } 360 360 361 inline static int rtl8169_register_int_handler(nic_t *nic_data )361 inline static int rtl8169_register_int_handler(nic_t *nic_data, cap_handle_t *handle) 362 362 { 363 363 rtl8169_t *rtl8169 = nic_get_specific(nic_data); … … 367 367 rtl8169_irq_code.cmds[2].addr = rtl8169->regs + ISR; 368 368 rtl8169_irq_code.cmds[3].addr = rtl8169->regs + IMR; 369 int irq_cap= register_interrupt_handler(nic_get_ddf_dev(nic_data),370 rtl8169->irq, rtl8169_irq_handler, &rtl8169_irq_code );371 372 return irq_cap;369 int rc = register_interrupt_handler(nic_get_ddf_dev(nic_data), 370 rtl8169->irq, rtl8169_irq_handler, &rtl8169_irq_code, handle); 371 372 return rc; 373 373 } 374 374 … … 427 427 goto err_pio; 428 428 429 int irq_cap = rtl8169_register_int_handler(nic_data);430 if (irq_cap < 0) {431 rc = irq_cap;429 int irq_cap; 430 rc = rtl8169_register_int_handler(nic_data, &irq_cap); 431 if (rc != EOK) { 432 432 ddf_msg(LVL_ERROR, "Failed to register IRQ handler (%d)", rc); 433 433 goto err_irq;
Note:
See TracChangeset
for help on using the changeset viewer.
