lkml.org 
[lkml]   [2012]   [Feb]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5/8] ethoc: add .ndo_validate_addr to net_device_ops
    Date
    Add eth_validate_addr() to .ndo_validate_addr to get validation
    checks in dev_set_mac_address() working. Remove
    is_valid_ether_addr() from ethoc_set_mac_address() to prevent
    double check.

    Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
    ---
    drivers/net/ethernet/ethoc.c | 4 +---
    1 files changed, 1 insertions(+), 3 deletions(-)

    diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
    index a381678..ca80f19 100644
    --- a/drivers/net/ethernet/ethoc.c
    +++ b/drivers/net/ethernet/ethoc.c
    @@ -776,9 +776,6 @@ static int ethoc_set_mac_address(struct net_device *dev, void *addr)
    struct ethoc *priv = netdev_priv(dev);
    u8 *mac = (u8 *)addr;

    - if (!is_valid_ether_addr(mac))
    - return -EADDRNOTAVAIL;
    -
    ethoc_write(priv, MAC_ADDR0, (mac[2] << 24) | (mac[3] << 16) |
    (mac[4] << 8) | (mac[5] << 0));
    ethoc_write(priv, MAC_ADDR1, (mac[0] << 8) | (mac[1] << 0));
    @@ -899,6 +896,7 @@ static const struct net_device_ops ethoc_netdev_ops = {
    .ndo_change_mtu = ethoc_change_mtu,
    .ndo_tx_timeout = ethoc_tx_timeout,
    .ndo_start_xmit = ethoc_start_xmit,
    + .ndo_validate_addr = eth_validate_addr,
    };

    /**
    --
    1.7.8.3


    \
     
     \ /
      Last update: 2012-02-29 16:47    [W:0.020 / U:0.204 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site