Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 4f8772d4 in mainline


Ignore:
Timestamp:
2018-05-18T16:29:58Z (3 years ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
904b1bc
Parents:
6ff23ff (diff), 8800b13 (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.
git-author:
Jakub Jermář <jakub@…> (2018-05-18 16:29:58)
git-committer:
GitHub <noreply@…> (2018-05-18 16:29:58)
Message:

Merge pull request #36 from jermar/ar9271

ar9271: Set cable state according to connectedness

File:
1 edited

Legend:

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

    r6ff23ff r4f8772d4  
    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.