Changes in uspace/lib/nic/src/nic_impl.c [8d7ec69d:01380b1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/nic/src/nic_impl.c
r8d7ec69d r01380b1 40 40 #include <ns.h> 41 41 #include "nic_driver.h" 42 #include "nic_ev.h"43 42 #include "nic_impl.h" 44 43 … … 86 85 } 87 86 if (state == NIC_STATE_ACTIVE) { 88 if (nic_data-> client_session == NULL || 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; … … 116 115 if (state == NIC_STATE_STOPPED) { 117 116 /* Notify upper layers that we are reseting the MAC */ 118 int rc = ni c_ev_addr_changed(nic_data->client_session,117 int rc = nil_addr_changed_msg(nic_data->nil_session, 119 118 nic_data->device_id, &nic_data->default_mac); 120 119 nic_data->poll_mode = nic_data->default_poll_mode; … … 149 148 nic_data->state = state; 150 149 151 ni c_ev_device_state(nic_data->client_session, nic_data->device_id, state);150 nil_device_state_msg(nic_data->nil_session, nic_data->device_id, state); 152 151 153 152 fibril_rwlock_write_unlock(&nic_data->main_lock); … … 182 181 183 182 /** 184 * Default implementation of the connect_ clientmethod.185 * C reates callback connection to the client.183 * Default implementation of the connect_to_nil method. 184 * Connects the driver to the NIL service. 186 185 * 187 186 * @param fun 187 * @param nil_service ID of the server implementing the NIL service 188 188 * @param device_id ID of the device as used in higher layers 189 189 * 190 * @return EOK On success, or negative error code. 191 */ 192 int nic_callback_create_impl(ddf_fun_t *fun, nic_device_id_t device_id) 193 { 194 nic_t *nic = (nic_t *) fun->driver_data; 195 fibril_rwlock_write_lock(&nic->main_lock); 190 * @return EOK If the services were bound 191 * @return Negative error code from service_connect_blocking 192 */ 193 int nic_connect_to_nil_impl(ddf_fun_t *fun, services_t nil_service, 194 nic_device_id_t device_id) 195 { 196 nic_t *nic_data = (nic_t *) fun->driver_data; 197 fibril_rwlock_write_lock(&nic_data->main_lock); 196 198 197 nic ->device_id = device_id;199 nic_data->device_id = device_id; 198 200 199 nic->client_session = async_callback_receive(EXCHANGE_SERIALIZE); 200 if (nic->client_session == NULL) { 201 fibril_rwlock_write_unlock(&nic->main_lock); 202 return ENOMEM; 201 nic_data->nil_session = service_connect_blocking(EXCHANGE_SERIALIZE, 202 nil_service, 0, 0); 203 if (nic_data->nil_session != NULL) { 204 fibril_rwlock_write_unlock(&nic_data->main_lock); 205 return EOK; 203 206 } 204 207 205 fibril_rwlock_write_unlock(&nic ->main_lock);206 return E OK;208 fibril_rwlock_write_unlock(&nic_data->main_lock); 209 return EHANGUP; 207 210 } 208 211
Note:
See TracChangeset
for help on using the changeset viewer.