Changeset 01380b1 in mainline
- Timestamp:
- 2012-01-21T16:59:43Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e98fe28c
- Parents:
- ce7676c
- Location:
- uspace/lib/nic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/nic/include/nic_driver.h
rce7676c r01380b1 80 80 /** Device's default MAC address (assigned the first time, used in STOP) */ 81 81 nic_address_t default_mac; 82 /** Session to SERVICE_NETWORKING */83 async_sess_t *net_session;84 82 /** Session to SERVICE_ETHERNET or SERVICE_NILDUMMY */ 85 83 async_sess_t *nil_session; -
uspace/lib/nic/src/nic_driver.c
rce7676c r01380b1 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> … … 424 423 425 424 /** 426 * 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 427 426 * the add_device handler, thus no locking is required. 428 427 * … … 431 430 * @return EOK If connection was successful. 432 431 * @return EINVAL If the IRC service cannot be determined. 433 * @return EREFUSED If NET orIRC service cannot be connected.432 * @return EREFUSED If IRC service cannot be connected. 434 433 */ 435 434 int nic_connect_to_services(nic_t *nic_data) 436 435 { 437 /* NET service */438 nic_data->net_session = service_connect_blocking(EXCHANGE_SERIALIZE,439 SERVICE_NETWORKING, 0, 0);440 if (nic_data->net_session == NULL)441 return errno;442 443 436 /* IRC service */ 444 437 sysarg_t apic; … … 699 692 nic_data->device_id = NIC_DEVICE_INVALID_ID; 700 693 nic_data->state = NIC_STATE_STOPPED; 701 nic_data->net_session = NULL;702 694 nic_data->nil_session = NULL; 703 695 nic_data->irc_session = NULL; … … 754 746 */ 755 747 static void nic_destroy(nic_t *nic_data) { 756 if (nic_data->net_session != NULL) {757 async_hangup(nic_data->net_session);758 }759 760 748 if (nic_data->nil_session != NULL) { 761 749 async_hangup(nic_data->nil_session); -
uspace/lib/nic/src/nic_impl.c
rce7676c r01380b1 85 85 } 86 86 if (state == NIC_STATE_ACTIVE) { 87 if (nic_data->nil_session == NULL || nic_data->net_session == NULL 88 || nic_data->device_id < 0) { 87 if (nic_data->nil_session == NULL || nic_data->device_id < 0) { 89 88 fibril_rwlock_write_unlock(&nic_data->main_lock); 90 89 return EINVAL;
Note:
See TracChangeset
for help on using the changeset viewer.