Changeset cbfece7 in mainline for uspace/drv/nic/rtl8139/driver.c
- Timestamp:
- 2014-07-21T22:10:18Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1f1fa64
- Parents:
- 96e368a (diff), 54a1ca7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/rtl8139/driver.c
r96e368a rcbfece7 27 27 */ 28 28 29 /* XXX Fix this */30 #define _DDF_DATA_IMPLANT31 32 29 #include <assert.h> 33 30 #include <errno.h> … … 35 32 #include <byteorder.h> 36 33 #include <libarch/barrier.h> 37 38 34 #include <as.h> 39 35 #include <ddf/log.h> … … 42 38 #include <nic.h> 43 39 #include <pci_dev_iface.h> 44 45 #include <ipc/irc.h> 46 #include <sysinfo.h> 47 #include <ipc/ns.h> 48 40 #include <irc.h> 41 #include <stdio.h> 49 42 #include <str.h> 50 43 … … 960 953 rtl8139->int_mask = RTL_DEFAULT_INTERRUPTS; 961 954 rtl8139_hw_int_enable(rtl8139); 962 nic_enable_interrupt(nic_data, rtl8139->irq); 955 956 int rc = irc_enable_interrupt(rtl8139->irq); 957 if (rc != EOK) { 958 rtl8139_on_stopped(nic_data); 959 return rc; 960 } 963 961 964 962 ddf_msg(LVL_DEBUG, "Device activated, interrupt %d registered", rtl8139->irq); … … 1325 1323 goto err_pio; 1326 1324 1327 rc = nic_connect_to_services(nic_data);1328 if (rc != EOK) {1329 ddf_msg(LVL_ERROR, "Failed to connect to services (%d)", rc);1330 goto err_irq;1331 }1332 1333 1325 fun = ddf_fun_create(nic_get_ddf_dev(nic_data), fun_exposed, "port0"); 1334 1326 if (fun == NULL) { … … 1336 1328 goto err_srv; 1337 1329 } 1330 1338 1331 nic_set_ddf_fun(nic_data, fun); 1339 1332 ddf_fun_set_ops(fun, &rtl8139_dev_ops); 1340 ddf_fun_data_implant(fun, nic_data);1341 1333 1342 1334 rc = ddf_fun_bind(fun); … … 1361 1353 ddf_fun_destroy(fun); 1362 1354 err_srv: 1363 /* XXX Disconnect from services */1364 err_irq:1365 1355 unregister_interrupt_handler(dev, rtl8139->irq); 1366 1356 err_pio: … … 2180 2170 int main(void) 2181 2171 { 2172 printf("%s: HelenOS RTL8139 network adapter driver\n", NAME); 2173 2182 2174 int rc = nic_driver_init(NAME); 2183 2175 if (rc != EOK) 2184 2176 return rc; 2185 nic_driver_implement( 2186 &rtl8139_driver_ops, &rtl8139_dev_ops, &rtl8139_nic_iface); 2177 2178 nic_driver_implement(&rtl8139_driver_ops, &rtl8139_dev_ops, 2179 &rtl8139_nic_iface); 2187 2180 2188 2181 ddf_log_init(NAME); 2189 ddf_msg(LVL_NOTE, "HelenOS RTL8139 driver started");2190 2182 return ddf_driver_main(&rtl8139_driver); 2191 2183 }
Note:
See TracChangeset
for help on using the changeset viewer.