Changeset 8800b13 in mainline


Ignore:
Timestamp:
2018-05-15T15:13:02Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4f8772d4
Parents:
47e00b83
Message:

ar9271: Set cable state according to connectedness

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/ar9271/ar9271.c

    r47e00b83 r8800b13  
    166166static errno_t ar9271_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
    167167{
    168         *state = NIC_CS_PLUGGED;
     168        nic_t *nic_data = nic_get_from_ddf_fun(fun);
     169        if (!nic_data)
     170                return ENOENT;
     171        ar9271_t *ar9271 = nic_get_specific(nic_data);
     172        if (!ar9271)
     173                return ENOENT;
     174
     175        if (ieee80211_is_connected(ar9271->ieee80211_dev))
     176                *state = NIC_CS_PLUGGED;
     177        else
     178                *state = NIC_CS_UNPLUGGED;
    169179
    170180        return EOK;
Note: See TracChangeset for help on using the changeset viewer.