Changeset 96e368a in mainline


Ignore:
Timestamp:
2014-07-21T17:15:31Z (10 years ago)
Author:
Agnieszka Tabaka <nufcia@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cbfece7
Parents:
278fede
Message:

Implement MAC address changing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/rtl8169/driver.c

    r278fede r96e368a  
    7979static inline int rtl8169_register_int_handler(nic_t *nic_data);
    8080static inline void rtl8169_get_hwaddr(rtl8169_t *rtl8169, nic_address_t *addr);
    81 static inline void rtl8169_set_hwaddr(rtl8169_t *rtl8169, nic_address_t *addr);
     81static inline void rtl8169_set_hwaddr(rtl8169_t *rtl8169, const nic_address_t *addr);
    8282
    8383static void rtl8169_reset(rtl8169_t *rtl8169);
     
    469469static int rtl8169_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
    470470{
     471        nic_t *nic_data = nic_get_from_ddf_fun(fun);
     472        rtl8169_t *rtl8169 = nic_get_specific(nic_data);
     473        int rc;
     474
     475        rtl8169_set_hwaddr(rtl8169, addr);
     476
     477        rc = nic_report_address(nic_data, addr);
     478        if (rc != EOK)
     479                return rc;
     480
    471481        return EOK;
    472482}
     
    476486
    477487        str_cpy(info->vendor_name, NIC_VENDOR_MAX_LENGTH, "Realtek");
     488        str_cpy(info->model_name, NIC_MODEL_MAX_LENGTH, "RTL8169");
    478489
    479490        return EOK;
     
    967978}
    968979
    969 static inline void rtl8169_set_hwaddr(rtl8169_t *rtl8169, nic_address_t *addr)
     980static inline void rtl8169_set_hwaddr(rtl8169_t *rtl8169, const nic_address_t *addr)
    970981{
    971982        int i;
     
    975986
    976987        for (i = 0; i < 6; i++)
    977                 addr->address[i] = pio_read_8(rtl8169->regs + MAC0 + i);
     988                pio_write_8(rtl8169->regs + MAC0 + i, addr->address[i]);
    978989}
    979990
Note: See TracChangeset for help on using the changeset viewer.