Changes in uspace/drv/nic/ne2k/ne2k.c [e86b8f0:6d8455d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ne2k/ne2k.c
re86b8f0 r6d8455d 261 261 /* Note: some frame with previous physical address may slip to NIL here 262 262 * (for a moment the filtering is not exact), but ethernet should be OK with 263 * that. Some framesmay also be lost, but this is not a problem.263 * that. Some packet may also be lost, but this is not a problem. 264 264 */ 265 265 ne2k_set_physical_address((ne2k_t *) nic_get_specific(nic_data), address); … … 338 338 static int ne2k_dev_add(ddf_dev_t *dev) 339 339 { 340 ddf_fun_t *fun;341 342 340 /* Allocate driver data for the device. */ 343 341 nic_t *nic_data = nic_create_and_bind(dev); … … 373 371 } 374 372 373 rc = nic_register_as_ddf_fun(nic_data, &ne2k_dev_ops); 374 if (rc != EOK) { 375 ne2k_dev_cleanup(dev); 376 return rc; 377 } 378 375 379 rc = nic_connect_to_services(nic_data); 376 380 if (rc != EOK) { … … 379 383 } 380 384 381 fun = ddf_fun_create(nic_get_ddf_dev(nic_data), fun_exposed, "port0");382 if (fun == NULL) {383 ne2k_dev_cleanup(dev);384 return ENOMEM;385 }386 nic_set_ddf_fun(nic_data, fun);387 fun->ops = &ne2k_dev_ops;388 fun->driver_data = nic_data;389 390 rc = ddf_fun_bind(fun);391 if (rc != EOK) {392 ddf_fun_destroy(fun);393 ne2k_dev_cleanup(dev);394 return rc;395 }396 397 rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);398 if (rc != EOK) {399 ddf_fun_unbind(fun);400 ddf_fun_destroy(fun);401 return rc;402 }403 404 385 return EOK; 405 386 }
Note:
See TracChangeset
for help on using the changeset viewer.