OSDN Git Service

mac802154: set short address filter on ifup
authorAlexander Aring <alex.aring@gmail.com>
Sun, 2 Nov 2014 03:18:42 +0000 (04:18 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 2 Nov 2014 03:51:07 +0000 (04:51 +0100)
This patch moves the setting of hardware short address filtering
inside of interface up instead doing it it directly inside of netlink
interface. The netlink call which can only be called when netif isn't
running sets only the necessary short_addr value in sdata. After an
interface up the address filter will be set with this value.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/mac802154/iface.c
net/mac802154/mib.c

index a509a71..1bae29d 100644 (file)
@@ -208,6 +208,10 @@ static int mac802154_wpan_open(struct net_device *dev)
                rc = drv_set_extended_addr(local, sdata->extended_addr);
                if (rc < 0)
                        goto out;
+
+               rc = drv_set_short_addr(local, sdata->short_addr);
+               if (rc < 0)
+                       goto out;
        }
 
        if (local->hw.flags & IEEE802154_HW_TXPOWER) {
index cfd4f65..755befd 100644 (file)
@@ -80,12 +80,6 @@ void mac802154_dev_set_short_addr(struct net_device *dev, __le16 val)
        spin_lock_bh(&sdata->mib_lock);
        sdata->short_addr = val;
        spin_unlock_bh(&sdata->mib_lock);
-
-       if ((sdata->local->ops->set_hw_addr_filt) &&
-           (sdata->local->hw.hw_filt.short_addr != sdata->short_addr)) {
-               sdata->local->hw.hw_filt.short_addr = sdata->short_addr;
-               set_hw_addr_filt(dev, IEEE802154_AFILT_SADDR_CHANGED);
-       }
 }
 
 __le16 mac802154_dev_get_short_addr(const struct net_device *dev)