diff mbox series

mac802154_hwsim: define perm_extended_addr initialization

Message ID 20250329142010.17389-1-ramonreisfontes@gmail.com (mailing list archive)
State New
Headers show
Series mac802154_hwsim: define perm_extended_addr initialization | expand

Commit Message

Ramon Fontes March 29, 2025, 2:20 p.m. UTC
This establishes an initialization method for perm_extended_addr,
aligning it with the approach used in mac80211_hwsim.

Signed-off-by: Ramon Fontes <ramonreisfontes@gmail.com>
---
 drivers/net/ieee802154/mac802154_hwsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Miquel Raynal March 31, 2025, 8:15 a.m. UTC | #1
On 29/03/2025 at 11:20:10 -03, Ramon Fontes <ramonreisfontes@gmail.com> wrote:

> This establishes an initialization method for perm_extended_addr,
> aligning it with the approach used in mac80211_hwsim.
>
> Signed-off-by: Ramon Fontes <ramonreisfontes@gmail.com>

Yeah, that's simpler, thanks Alex.

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
diff mbox series

Patch

diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
index 1cab20b5a..2f7520454 100644
--- a/drivers/net/ieee802154/mac802154_hwsim.c
+++ b/drivers/net/ieee802154/mac802154_hwsim.c
@@ -942,7 +942,7 @@  static int hwsim_add_one(struct genl_info *info, struct device *dev,
 	/* 950 MHz GFSK 802.15.4d-2009 */
 	hw->phy->supported.channels[6] |= 0x3ffc00;
 
-	ieee802154_random_extended_addr(&hw->phy->perm_extended_addr);
+	hw->phy->perm_extended_addr = cpu_to_le64(((u64)0x02 << 56) | ((u64)idx));
 
 	/* hwsim phy channel 13 as default */
 	hw->phy->current_channel = 13;