aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-05 14:51:25 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-11-05 15:53:05 -0500
commitdee56d14779b1e01706adafb9e020303318e22e3 (patch)
tree3c949aa001f869107f4239d673256089b495a575 /net/mac802154
parent705cbbbe9ccca260658f971a4369c22f5704db75 (diff)
mac802154: add support for perm_extended_addr
This patch adding support for a perm extended address. This is useful when a device supports an eeprom with a programmed static extended address. If a device doesn't support such eeprom or serial registers then the driver should generate a random extended address. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/iface.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index a1aa09b03d12..97e5bed9f917 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -410,6 +410,7 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata, int type)
410 /* for compatibility, actual default is 3 */ 410 /* for compatibility, actual default is 3 */
411 sdata->mac_params.frame_retries = -1; 411 sdata->mac_params.frame_retries = -1;
412 412
413 ieee802154_be64_to_le64(&sdata->extended_addr, sdata->dev->dev_addr);
413 sdata->pan_id = cpu_to_le16(IEEE802154_PANID_BROADCAST); 414 sdata->pan_id = cpu_to_le16(IEEE802154_PANID_BROADCAST);
414 sdata->short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST); 415 sdata->short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST);
415 416
@@ -471,6 +472,9 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
471 goto err; 472 goto err;
472 } 473 }
473 474
475 ieee802154_le64_to_be64(ndev->perm_addr,
476 &local->hw.phy->perm_extended_addr);
477 memcpy(ndev->dev_addr, ndev->perm_addr, IEEE802154_EXTENDED_ADDR_LEN);
474 /* TODO check this */ 478 /* TODO check this */
475 SET_NETDEV_DEV(ndev, &local->phy->dev); 479 SET_NETDEV_DEV(ndev, &local->phy->dev);
476 sdata = netdev_priv(ndev); 480 sdata = netdev_priv(ndev);