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 2/8] bnx2x: adopt bnx2x_validate_addr() to .ndo_validate_addr changes
    Date
    Adopted bnx2x_validate_addr() to changes in .ndo_validate_addr,
    handle second parameter to be validated.

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

    diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
    index b4afef6..d25ef1e 100644
    --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
    +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
    @@ -10532,12 +10532,19 @@ static void poll_bnx2x(struct net_device *dev)
    }
    #endif

    -static int bnx2x_validate_addr(struct net_device *dev)
    +static int bnx2x_validate_addr(struct net_device *dev, void *addr)
    {
    struct bnx2x *bp = netdev_priv(dev);
    + struct sockaddr *saddr;

    - if (!bnx2x_is_valid_ether_addr(bp, dev->dev_addr))
    - return -EADDRNOTAVAIL;
    + if (addr) {
    + saddr = addr;
    + if (!bnx2x_is_valid_ether_addr(bp, saddr->sa_data))
    + return -EADDRNOTAVAIL;
    + } else {
    + if (!bnx2x_is_valid_ether_addr(bp, dev->dev_addr))
    + return -EADDRNOTAVAIL;
    + }
    return 0;
    }

    --
    1.7.8.3


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