Changeset eaa0c3f in mainline for uspace/lib/nic/src/nic_driver.c
- Timestamp:
- 2012-01-21T23:55:03Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c38e417
- Parents:
- 86c71de (diff), e98fe28c (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/lib/nic/src/nic_driver.c
r86c71de reaa0c3f 49 49 #include <devman.h> 50 50 #include <ddf/interrupt.h> 51 #include <net_interface.h>52 51 #include <ops/nic.h> 53 52 #include <errno.h> … … 89 88 nic_iface_t *iface) 90 89 { 91 if (driver_ops) {92 if (!driver_ops->device_added)93 driver_ops->device_added = nic_device_added_impl;94 }95 96 90 if (dev_ops) { 97 91 if (!dev_ops->open) … … 429 423 430 424 /** 431 * Connect to the NET and IRQ services. This function should be called only from425 * Connect to IRC service. This function should be called only from 432 426 * the add_device handler, thus no locking is required. 433 427 * … … 436 430 * @return EOK If connection was successful. 437 431 * @return EINVAL If the IRC service cannot be determined. 438 * @return EREFUSED If NET orIRC service cannot be connected.432 * @return EREFUSED If IRC service cannot be connected. 439 433 */ 440 434 int nic_connect_to_services(nic_t *nic_data) 441 435 { 442 /* NET service */443 nic_data->net_session = service_connect_blocking(EXCHANGE_SERIALIZE,444 SERVICE_NETWORKING, 0, 0);445 if (nic_data->net_session == NULL)446 return errno;447 448 436 /* IRC service */ 449 437 sysarg_t apic; … … 462 450 463 451 return EOK; 464 }465 466 /** Notify the NET service that the device is ready467 *468 * @param nic NICF structure469 *470 * @return EOK on success471 *472 */473 int nic_ready(nic_t *nic)474 {475 fibril_rwlock_read_lock(&nic->main_lock);476 477 async_sess_t *session = nic->net_session;478 devman_handle_t handle = nic->dev->handle;479 480 fibril_rwlock_read_unlock(&nic->main_lock);481 482 if (session == NULL)483 return EINVAL;484 485 return net_driver_ready(session, handle);486 452 } 487 453 … … 726 692 nic_data->device_id = NIC_DEVICE_INVALID_ID; 727 693 nic_data->state = NIC_STATE_STOPPED; 728 nic_data->net_session = NULL;729 694 nic_data->nil_session = NULL; 730 695 nic_data->irc_session = NULL; … … 781 746 */ 782 747 static void nic_destroy(nic_t *nic_data) { 783 if (nic_data->net_session != NULL) {784 async_hangup(nic_data->net_session);785 }786 787 748 if (nic_data->nil_session != NULL) { 788 749 async_hangup(nic_data->nil_session);
Note:
See TracChangeset
for help on using the changeset viewer.