/* MIB callbacks */
void mac802154_dev_set_short_addr(struct net_device *dev, __le16 val);
__le16 mac802154_dev_get_short_addr(const struct net_device *dev);
-void mac802154_dev_set_ieee_addr(struct net_device *dev);
__le16 mac802154_dev_get_pan_id(const struct net_device *dev);
void mac802154_dev_set_pan_id(struct net_device *dev, __le16 val);
void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan);
static int mac802154_wpan_mac_addr(struct net_device *dev, void *p)
{
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct sockaddr *addr = p;
if (netif_running(dev))
/* FIXME: validate addr */
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
- mac802154_dev_set_ieee_addr(dev);
+ sdata->extended_addr = ieee802154_netdev_to_extended_addr(dev->dev_addr);
+
return mac802154_wpan_update_llsec(dev);
}
goto out;
}
+ if (local->hw.flags & IEEE802154_HW_AFILT) {
+ rc = drv_set_extended_addr(local, sdata->extended_addr);
+ if (rc < 0)
+ goto out;
+ }
+
if (local->hw.flags & IEEE802154_HW_TXPOWER) {
rc = drv_set_tx_power(local, sdata->mac_params.transmit_power);
if (rc < 0)
mac802154_dev_set_pan_id(dev, addr->pan_id);
mac802154_dev_set_short_addr(dev, addr->short_addr);
- mac802154_dev_set_ieee_addr(dev);
mac802154_dev_set_page_channel(dev, page, channel);
if (ops->llsec) {
return ret;
}
-void mac802154_dev_set_ieee_addr(struct net_device *dev)
-{
- struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
- struct ieee802154_local *local = sdata->local;
-
- sdata->extended_addr = ieee802154_devaddr_from_raw(dev->dev_addr);
-
- if (local->ops->set_hw_addr_filt &&
- local->hw.hw_filt.ieee_addr != sdata->extended_addr) {
- local->hw.hw_filt.ieee_addr = sdata->extended_addr;
- set_hw_addr_filt(dev, IEEE802154_AFILT_IEEEADDR_CHANGED);
- }
-}
-
__le16 mac802154_dev_get_pan_id(const struct net_device *dev)
{
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);