Skip to content

Commit 3b7610e

Browse files
pdgendtdkalowsk
authored andcommitted
drivers: ethernet: stm32: Set LAA bit on MAC address based on device ID
The MAC addressed derived from the device ID is not assigned by the manufacturer and therefor the Locally Administered Address (LAA) bit should be set. Signed-off-by: Pieter De Gendt <[email protected]> (cherry picked from commit 300016c)
1 parent 2b0f179 commit 3b7610e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/ethernet/eth_stm32_hal.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,12 @@ static void generate_mac(uint8_t *mac_addr)
815815
result_mac_32_bits = crc32_ieee((uint8_t *)unique_device_ID_12_bytes, 12);
816816
memcpy(&mac_addr[3], &result_mac_32_bits, 3);
817817

818+
/**
819+
* Set MAC address locally administered bit (LAA) as this is not assigned by the
820+
* manufacturer
821+
*/
822+
mac_addr[0] |= 0x02;
823+
818824
#endif /* NODE_HAS_VALID_MAC_ADDR(DT_DRV_INST(0))) */
819825
#endif
820826
}

0 commit comments

Comments
 (0)