Home
last modified time | relevance | path

Searched refs:mac_addr (Results 1 – 25 of 120) sorted by relevance

12345

/Zephyr-latest/drivers/ethernet/
Deth_nxp_imx_netc_priv.h60 gen_random_mac(mac_addr, FREESCALE_OUI_B0, FREESCALE_OUI_B1, FREESCALE_OUI_B2)
66 mac_addr[0] = FREESCALE_OUI_B0; \
67 mac_addr[1] = FREESCALE_OUI_B1; \
69 mac_addr[2] = FREESCALE_OUI_B2 | 0x02; \
70 mac_addr[3] = (id >> 16) & 0xff; \
71 mac_addr[4] = (id >> 8) & 0xff; \
72 mac_addr[5] = (id + n) & 0xff; \
76 static void netc_eth##n##_generate_mac(uint8_t mac_addr[6]) \
82 (ARG_UNUSED(mac_addr))))); \
88 void (*generate_mac)(uint8_t *mac_addr);
[all …]
Deth.h33 static inline void gen_random_mac(uint8_t *mac_addr, uint8_t b0, uint8_t b1, uint8_t b2) in gen_random_mac() argument
35 mac_addr[0] = b0; in gen_random_mac()
36 mac_addr[1] = b1; in gen_random_mac()
37 mac_addr[2] = b2; in gen_random_mac()
40 mac_addr[0] |= 0x02; in gen_random_mac()
42 sys_rand_get(&mac_addr[3], 3U); in gen_random_mac()
Deth_nxp_s32_netc_priv.h66 gen_random_mac(mac_addr, FREESCALE_OUI_B0, FREESCALE_OUI_B1, FREESCALE_OUI_B2)
72 mac_addr[0] = FREESCALE_OUI_B0; \
73 mac_addr[1] = FREESCALE_OUI_B1; \
75 mac_addr[2] = FREESCALE_OUI_B2 | 0x02; \
76 mac_addr[3] = (id >> 16) & 0xff; \
77 mac_addr[4] = (id >> 8) & 0xff; \
78 mac_addr[5] = (id + n) & 0xff; \
82 static void nxp_s32_eth##n##_generate_mac(uint8_t mac_addr[6]) \
88 (ARG_UNUSED(mac_addr))))); \
116 void (*generate_mac)(uint8_t *mac_addr);
[all …]
Deth_ivshmem.c36 uint8_t mac_addr[6]; member
52 void (*generate_mac_addr)(uint8_t mac_addr[6]);
333 cfg_data->generate_mac_addr(dev_data->mac_addr); in eth_ivshmem_initialize()
335 dev_data->mac_addr[0], dev_data->mac_addr[1], in eth_ivshmem_initialize()
336 dev_data->mac_addr[2], dev_data->mac_addr[3], in eth_ivshmem_initialize()
337 dev_data->mac_addr[4], dev_data->mac_addr[5]); in eth_ivshmem_initialize()
366 iface, dev_data->mac_addr, in eth_ivshmem_iface_init()
367 sizeof(dev_data->mac_addr), in eth_ivshmem_iface_init()
391 static void generate_mac_addr_##inst(uint8_t mac_addr[6]) \
393 sys_rand_get(mac_addr, 3U); \
[all …]
Deth_nxp_s32_netc_vsi.c50 Netc_Eth_Ip_SetMacAddr(cfg->si_idx, (const uint8_t *)ctx->mac_addr); in nxp_s32_eth_iface_init()
51 net_if_set_link_addr(iface, ctx->mac_addr, sizeof(ctx->mac_addr), NET_LINK_ETHERNET); in nxp_s32_eth_iface_init()
54 ctx->mac_addr[0], ctx->mac_addr[1], ctx->mac_addr[2], in nxp_s32_eth_iface_init()
55 ctx->mac_addr[3], ctx->mac_addr[4], ctx->mac_addr[5]); in nxp_s32_eth_iface_init()
149 .mac_addr = DT_INST_PROP_OR(n, local_mac_address, {0}), \
Deth_gecko.c494 static void generate_mac(uint8_t mac_addr[6]) in generate_mac()
497 gen_random_mac(mac_addr, SILABS_OUI_B0, SILABS_OUI_B1, SILABS_OUI_B2); in generate_mac()
499 mac_addr[0] = DEVINFO->EUI48H >> 8; in generate_mac()
500 mac_addr[1] = DEVINFO->EUI48H >> 0; in generate_mac()
501 mac_addr[2] = DEVINFO->EUI48L >> 24; in generate_mac()
502 mac_addr[3] = DEVINFO->EUI48L >> 16; in generate_mac()
503 mac_addr[4] = DEVINFO->EUI48L >> 8; in generate_mac()
504 mac_addr[5] = DEVINFO->EUI48L >> 0; in generate_mac()
530 generate_mac(dev_data->mac_addr); in eth_iface_init()
534 dev_data->mac_addr[0], dev_data->mac_addr[1], in eth_iface_init()
[all …]
Deth_nxp_imx_netc.c196 config->generate_mac(&data->mac_addr[0]); in netc_eth_init_common()
198 result = EP_Init(&data->handle, &data->mac_addr[0], &ep_config, &bdr_config); in netc_eth_init_common()
302 memcpy(data->mac_addr, config->mac_address.addr, sizeof(data->mac_addr)); in netc_eth_set_config()
303 result = EP_SetPrimaryMacAddr(&data->handle, (uint8_t *)data->mac_addr); in netc_eth_set_config()
309 net_if_set_link_addr(data->iface, data->mac_addr, sizeof(data->mac_addr), in netc_eth_set_config()
312 data->mac_addr[0], data->mac_addr[1], data->mac_addr[2], data->mac_addr[3], in netc_eth_set_config()
313 data->mac_addr[4], data->mac_addr[5]); in netc_eth_set_config()
Deth_nxp_imx_netc_psi.c69 result = EP_SetPrimaryMacAddr(&data->handle, (uint8_t *)data->mac_addr); in netc_eth_iface_init()
74 net_if_set_link_addr(iface, data->mac_addr, sizeof(data->mac_addr), NET_LINK_ETHERNET); in netc_eth_iface_init()
76 LOG_INF("SI%d MAC: %02x:%02x:%02x:%02x:%02x:%02x", cfg->si_idx, data->mac_addr[0], in netc_eth_iface_init()
77 data->mac_addr[1], data->mac_addr[2], data->mac_addr[3], data->mac_addr[4], in netc_eth_iface_init()
78 data->mac_addr[5]); in netc_eth_iface_init()
177 .mac_addr = DT_INST_PROP_OR(n, local_mac_address, {0}), \
Deth_esp32.c40 uint8_t mac_addr[6]; member
71 memcpy(dev_data->mac_addr, config->mac_address.addr, 6); in eth_esp32_set_config()
72 emac_hal_set_address(&dev_data->hal, dev_data->mac_addr); in eth_esp32_set_config()
73 net_if_set_link_addr(dev_data->iface, dev_data->mac_addr, in eth_esp32_set_config()
74 sizeof(dev_data->mac_addr), in eth_esp32_set_config()
172 static int generate_mac_addr(uint8_t mac_addr[6]) in generate_mac_addr()
176 gen_random_mac(mac_addr, 0x24, 0xD7, 0xEB); in generate_mac_addr()
180 memcpy(mac_addr, addr, sizeof(addr)); in generate_mac_addr()
182 if (esp_read_mac(mac_addr, ESP_MAC_ETH) != ESP_OK) { in generate_mac_addr()
333 res = generate_mac_addr(dev_data->mac_addr); in eth_esp32_initialize()
[all …]
Deth_nxp_s32_netc.c100 cfg->generate_mac(&ctx->mac_addr[0]); in nxp_s32_eth_initialize_common()
294 memcpy(ctx->mac_addr, config->mac_address.addr, sizeof(ctx->mac_addr)); in nxp_s32_eth_set_config()
295 Netc_Eth_Ip_SetMacAddr(cfg->si_idx, (const uint8_t *)ctx->mac_addr); in nxp_s32_eth_set_config()
296 net_if_set_link_addr(ctx->iface, ctx->mac_addr, sizeof(ctx->mac_addr), in nxp_s32_eth_set_config()
299 ctx->mac_addr[0], ctx->mac_addr[1], ctx->mac_addr[2], in nxp_s32_eth_set_config()
300 ctx->mac_addr[3], ctx->mac_addr[4], ctx->mac_addr[5]); in nxp_s32_eth_set_config()
Deth_numaker.c59 uint8_t mac_addr[NU_HWADDR_SIZE]; member
226 static int m_numaker_gmacdev_init(synopGMACdevice *gmacdev, uint8_t *mac_addr, uint32_t gmac_base) in m_numaker_gmacdev_init() argument
300 synopGMAC_set_mac_address(NUMAKER_GMAC_INTF, mac_addr); in m_numaker_gmacdev_init()
514 m_numaker_read_mac_addr(data->mac_addr); in numaker_eth_if_init()
516 net_if_set_link_addr(iface, data->mac_addr, sizeof(data->mac_addr), NET_LINK_ETHERNET); in numaker_eth_if_init()
531 memcpy(data->mac_addr, config->mac_address.addr, sizeof(data->mac_addr)); in numaker_eth_set_config()
532 synopGMAC_set_mac_address(NUMAKER_GMAC_INTF, data->mac_addr); in numaker_eth_set_config()
533 net_if_set_link_addr(data->iface, data->mac_addr, sizeof(data->mac_addr), in numaker_eth_set_config()
535 LOG_DBG("%s MAC set to %02x:%02x:%02x:%02x:%02x:%02x", dev->name, data->mac_addr[0], in numaker_eth_set_config()
536 data->mac_addr[1], data->mac_addr[2], data->mac_addr[3], data->mac_addr[4], in numaker_eth_set_config()
[all …]
Deth_w5500.c355 net_if_set_link_addr(iface, ctx->mac_addr, in w5500_iface_init()
356 sizeof(ctx->mac_addr), in w5500_iface_init()
388 memcpy(ctx->mac_addr, in w5500_set_config()
390 sizeof(ctx->mac_addr)); in w5500_set_config()
391 w5500_spi_write(dev, W5500_SHAR, ctx->mac_addr, sizeof(ctx->mac_addr)); in w5500_set_config()
394 ctx->mac_addr[0], ctx->mac_addr[1], in w5500_set_config()
395 ctx->mac_addr[2], ctx->mac_addr[3], in w5500_set_config()
396 ctx->mac_addr[4], ctx->mac_addr[5]); in w5500_set_config()
399 net_if_set_link_addr(ctx->iface, ctx->mac_addr, in w5500_set_config()
400 sizeof(ctx->mac_addr), in w5500_set_config()
[all …]
/Zephyr-latest/tests/net/wifi/wifi_nm/src/
Dmain.c37 uint8_t mac_addr[6]; member
52 net_if_set_link_addr(iface, context->mac_addr, in wifi_iface_init()
53 sizeof(context->mac_addr), in wifi_iface_init()
82 static void generate_mac(uint8_t *mac_addr) in generate_mac() argument
85 mac_addr[0] = 0x00; in generate_mac()
86 mac_addr[1] = 0x00; in generate_mac()
87 mac_addr[2] = 0x5E; in generate_mac()
88 mac_addr[3] = 0x00; in generate_mac()
89 mac_addr[4] = 0x53; in generate_mac()
90 mac_addr[5] = sys_rand8_get(); in generate_mac()
[all …]
/Zephyr-latest/tests/net/socket/af_packet_ipproto_raw/src/
Dmain.c23 uint8_t mac_addr[sizeof(struct net_eth_addr)]; member
52 if (ctx->mac_addr[2] == 0x00) { in fake_dev_get_mac()
54 ctx->mac_addr[0] = 0x00; in fake_dev_get_mac()
55 ctx->mac_addr[1] = 0x00; in fake_dev_get_mac()
56 ctx->mac_addr[2] = 0x5E; in fake_dev_get_mac()
57 ctx->mac_addr[3] = 0x00; in fake_dev_get_mac()
58 ctx->mac_addr[4] = 0x53; in fake_dev_get_mac()
59 ctx->mac_addr[5] = sys_rand8_get(); in fake_dev_get_mac()
62 return ctx->mac_addr; in fake_dev_get_mac()
/Zephyr-latest/tests/net/lib/dns_dispatcher/src/
Dmain.c68 uint8_t mac_addr[sizeof(struct net_eth_addr)]; member
75 if (data->mac_addr[2] == 0x00) { in net_iface_get_mac()
77 data->mac_addr[0] = 0x00; in net_iface_get_mac()
78 data->mac_addr[1] = 0x00; in net_iface_get_mac()
79 data->mac_addr[2] = 0x5E; in net_iface_get_mac()
80 data->mac_addr[3] = 0x00; in net_iface_get_mac()
81 data->mac_addr[4] = 0x53; in net_iface_get_mac()
82 data->mac_addr[5] = sys_rand8_get(); in net_iface_get_mac()
85 return data->mac_addr; in net_iface_get_mac()
/Zephyr-latest/tests/net/pm/src/
Dmain.c21 uint8_t mac_addr[sizeof(struct net_eth_addr)]; member
62 if (ctx->mac_addr[2] == 0x00) { in fake_dev_get_mac()
64 ctx->mac_addr[0] = 0x00; in fake_dev_get_mac()
65 ctx->mac_addr[1] = 0x00; in fake_dev_get_mac()
66 ctx->mac_addr[2] = 0x5E; in fake_dev_get_mac()
67 ctx->mac_addr[3] = 0x00; in fake_dev_get_mac()
68 ctx->mac_addr[4] = 0x53; in fake_dev_get_mac()
69 ctx->mac_addr[5] = sys_rand8_get(); in fake_dev_get_mac()
72 return ctx->mac_addr; in fake_dev_get_mac()
/Zephyr-latest/tests/net/shell/src/
Dmain.c57 uint8_t mac_addr[sizeof(struct net_eth_addr)]; member
74 if (context->mac_addr[2] == 0x00) { in net_udp_get_mac()
76 context->mac_addr[0] = 0x00; in net_udp_get_mac()
77 context->mac_addr[1] = 0x00; in net_udp_get_mac()
78 context->mac_addr[2] = 0x5E; in net_udp_get_mac()
79 context->mac_addr[3] = 0x00; in net_udp_get_mac()
80 context->mac_addr[4] = 0x53; in net_udp_get_mac()
81 context->mac_addr[5] = sys_rand8_get(); in net_udp_get_mac()
84 return context->mac_addr; in net_udp_get_mac()
/Zephyr-latest/tests/net/icmpv6/src/
Dmain.c68 uint8_t mac_addr[sizeof(struct net_eth_addr)]; member
87 if (context->mac_addr[2] == 0x00) { in net_icmpv6_get_mac()
89 context->mac_addr[0] = 0x00; in net_icmpv6_get_mac()
90 context->mac_addr[1] = 0x00; in net_icmpv6_get_mac()
91 context->mac_addr[2] = 0x5E; in net_icmpv6_get_mac()
92 context->mac_addr[3] = 0x00; in net_icmpv6_get_mac()
93 context->mac_addr[4] = 0x53; in net_icmpv6_get_mac()
94 context->mac_addr[5] = 0x01; in net_icmpv6_get_mac()
97 return context->mac_addr; in net_icmpv6_get_mac()
/Zephyr-latest/drivers/wifi/nrf_wifi/off_raw_tx/src/
Doff_raw_tx_api.c131 int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) in nrf70_off_raw_tx_init() argument
216 if (mac_addr) { in nrf70_off_raw_tx_init()
217 memcpy(rpu_ctx_zep->mac_addr, mac_addr, 6); in nrf70_off_raw_tx_init()
222 ret = bytes_from_str(rpu_ctx_zep->mac_addr, in nrf70_off_raw_tx_init()
234 rpu_ctx_zep->mac_addr); in nrf70_off_raw_tx_init()
242 if (!nrf_wifi_utils_is_mac_addr_valid(rpu_ctx_zep->mac_addr)) { in nrf70_off_raw_tx_init()
245 rpu_ctx_zep->mac_addr[0], in nrf70_off_raw_tx_init()
246 rpu_ctx_zep->mac_addr[1], in nrf70_off_raw_tx_init()
247 rpu_ctx_zep->mac_addr[2], in nrf70_off_raw_tx_init()
248 rpu_ctx_zep->mac_addr[3], in nrf70_off_raw_tx_init()
[all …]
/Zephyr-latest/drivers/ethernet/nxp_enet/
Deth_nxp_enet.c100 uint8_t mac_addr[6]; member
288 memcpy(data->mac_addr, in eth_nxp_enet_set_config()
290 sizeof(data->mac_addr)); in eth_nxp_enet_set_config()
291 ENET_SetMacAddr(data->base, data->mac_addr); in eth_nxp_enet_set_config()
292 net_if_set_link_addr(data->iface, data->mac_addr, in eth_nxp_enet_set_config()
293 sizeof(data->mac_addr), in eth_nxp_enet_set_config()
297 data->mac_addr[0], data->mac_addr[1], in eth_nxp_enet_set_config()
298 data->mac_addr[2], data->mac_addr[3], in eth_nxp_enet_set_config()
299 data->mac_addr[4], data->mac_addr[5]); in eth_nxp_enet_set_config()
528 net_if_set_link_addr(iface, data->mac_addr,
[all …]
/Zephyr-latest/drivers/ethernet/eth_nxp_enet_qos/
Deth_nxp_enet_qos_mac.c45 net_if_set_link_addr(iface, data->mac_addr.addr, in eth_nxp_enet_qos_iface_init()
369 data->mac_addr.addr[5] << 8 | in enet_qos_mac_config_init()
370 data->mac_addr.addr[4]); in enet_qos_mac_config_init()
373 data->mac_addr.addr[3] << 24 | in enet_qos_mac_config_init()
374 data->mac_addr.addr[2] << 16 | in enet_qos_mac_config_init()
375 data->mac_addr.addr[1] << 8 | in enet_qos_mac_config_init()
376 data->mac_addr.addr[0]); in enet_qos_mac_config_init()
501 gen_random_mac(data->mac_addr.addr, in eth_nxp_enet_qos_mac_init()
586 memcpy(data->mac_addr.addr, in eth_nxp_enet_qos_set_config()
588 sizeof(data->mac_addr.addr)); in eth_nxp_enet_qos_set_config()
[all …]
/Zephyr-latest/samples/net/wpan_serial/src/
Dmain.c61 uint8_t mac_addr[8]; /* in little endian */ variable
207 sys_memcpy_swap(mac, mac_addr, sizeof(mac)); in get_ieee_addr()
451 mac_addr[7] = 0x00; in get_mac()
452 mac_addr[6] = 0x12; in get_mac()
453 mac_addr[5] = 0x4b; in get_mac()
454 mac_addr[4] = 0x00; in get_mac()
456 sys_rand_get(mac_addr, 4U); in get_mac()
458 mac_addr[0] = (mac_addr[0] & ~0x01) | 0x02; in get_mac()
460 return mac_addr; in get_mac()
485 short_addr = (mac_addr[0] << 8) + mac_addr[1]; in init_ieee802154()
[all …]
/Zephyr-latest/drivers/ieee802154/
Dieee802154_uart_pipe.c354 upipe->mac_addr[0] = 0x00; in get_mac()
355 upipe->mac_addr[1] = 0x10; in get_mac()
356 upipe->mac_addr[2] = 0x20; in get_mac()
357 upipe->mac_addr[3] = 0x30; in get_mac()
360 sys_rand_get(&upipe->mac_addr[4], 4U); in get_mac()
362 upipe->mac_addr[4] = CONFIG_IEEE802154_UPIPE_MAC4; in get_mac()
363 upipe->mac_addr[5] = CONFIG_IEEE802154_UPIPE_MAC5; in get_mac()
364 upipe->mac_addr[6] = CONFIG_IEEE802154_UPIPE_MAC6; in get_mac()
365 upipe->mac_addr[7] = CONFIG_IEEE802154_UPIPE_MAC7; in get_mac()
368 return upipe->mac_addr; in get_mac()
/Zephyr-latest/tests/net/hostname/src/
Dmain.c70 uint8_t mac_addr[sizeof(struct net_eth_addr)]; member
78 if (data->mac_addr[2] == 0x00) { in net_iface_get_mac()
80 data->mac_addr[0] = 0x00; in net_iface_get_mac()
81 data->mac_addr[1] = 0x00; in net_iface_get_mac()
82 data->mac_addr[2] = 0x5E; in net_iface_get_mac()
83 data->mac_addr[3] = 0x00; in net_iface_get_mac()
84 data->mac_addr[4] = 0x53; in net_iface_get_mac()
85 data->mac_addr[5] = sys_rand8_get(); in net_iface_get_mac()
88 data->ll_addr.addr = data->mac_addr; in net_iface_get_mac()
91 return data->mac_addr; in net_iface_get_mac()
/Zephyr-latest/tests/net/tx_timestamp/src/
Dmain.c83 uint8_t mac_addr[6]; member
94 net_if_set_link_addr(iface, context->mac_addr, in eth_iface_init()
95 sizeof(context->mac_addr), in eth_iface_init()
136 static void generate_mac(uint8_t *mac_addr) in generate_mac() argument
139 mac_addr[0] = 0x00; in generate_mac()
140 mac_addr[1] = 0x00; in generate_mac()
141 mac_addr[2] = 0x5E; in generate_mac()
142 mac_addr[3] = 0x00; in generate_mac()
143 mac_addr[4] = 0x53; in generate_mac()
144 mac_addr[5] = sys_rand8_get(); in generate_mac()
[all …]

12345