Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/nic/src/nic_impl.c

    r9cd8165 rcf9cb36  
    8787        }
    8888        if (state == NIC_STATE_ACTIVE) {
    89                 if (nic_data->client_session == NULL) {
     89                if (nic_data->client_session == NULL || nic_data->device_id < 0) {
    9090                        fibril_rwlock_write_unlock(&nic_data->main_lock);
    9191                        return EINVAL;
     
    118118                /* Notify upper layers that we are reseting the MAC */
    119119                int rc = nic_ev_addr_changed(nic_data->client_session,
    120                         &nic_data->default_mac);
     120                        nic_data->device_id, &nic_data->default_mac);
    121121                nic_data->poll_mode = nic_data->default_poll_mode;
    122122                memcpy(&nic_data->poll_period, &nic_data->default_poll_period,
     
    150150        nic_data->state = state;
    151151
    152         nic_ev_device_state(nic_data->client_session, state);
     152        nic_ev_device_state(nic_data->client_session, nic_data->device_id, state);
    153153
    154154        fibril_rwlock_write_unlock(&nic_data->main_lock);
     
    187187 *
    188188 * @param       fun
     189 * @param       device_id       ID of the device as used in higher layers
    189190 *
    190191 * @return EOK          On success, or negative error code.
    191192 */
    192 int nic_callback_create_impl(ddf_fun_t *fun)
     193int nic_callback_create_impl(ddf_fun_t *fun, nic_device_id_t device_id)
    193194{
    194195        nic_t *nic = (nic_t *) fun->driver_data;
    195196        fibril_rwlock_write_lock(&nic->main_lock);
     197       
     198        nic->device_id = device_id;
    196199       
    197200        nic->client_session = async_callback_receive(EXCHANGE_SERIALIZE);
Note: See TracChangeset for help on using the changeset viewer.