Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
231f6ea
net: Namespace network symbols to avoid conflicts with Posix/libc
jukkar Nov 7, 2025
6c33628
modules: openthread: Remove SOCK_NONBLOCK as it is not supported
jukkar Nov 14, 2025
80abf98
net: Convert network codebase to use renamed network APIs
jukkar Nov 7, 2025
f9393fd
net: Convert network drivers to use renamed network APIs
jukkar Nov 7, 2025
382d281
net: Convert Ethernet drivers to use renamed network APIs
jukkar Nov 7, 2025
9f0d54a
net: Convert IEEE 802.15.4 drivers to use renamed network APIs
jukkar Nov 7, 2025
9582e4b
net: Convert modem drivers to use renamed network APIs
jukkar Nov 7, 2025
70c7300
net: Convert usb drivers to use renamed network APIs
jukkar Nov 7, 2025
65cddf3
net: Convert wifi drivers to use renamed network APIs
jukkar Nov 7, 2025
48b1daa
net: socket: Network should not include any Posix header
jukkar Nov 10, 2025
990aaed
net: sockets: Remove Posix header file includes
jukkar Nov 10, 2025
6f1d291
lib: posix: net: Add support for namespaced network symbols
jukkar Nov 10, 2025
de01531
samples: net: Add relevant Posix headers for networking
jukkar Nov 11, 2025
d1078c0
tests: net: Add relevant Posix headers for networking
jukkar Nov 13, 2025
a0c87ad
tests: net: socket: tls_configurations: err variable might be unused
jukkar Nov 13, 2025
1812517
net: zperf: Change old code to pass compliance checker
jukkar Nov 13, 2025
6b7d121
log: backend: net: Remove Posix dependency
jukkar Nov 13, 2025
eea9c41
tests: net: all: Add more compilation support
jukkar Nov 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion doc/connectivity/networking/api/coap_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The following is an example of a CoAP client initialization and request sending:
req.payload = NULL;
req.len = 0;

/* Sock is a file descriptor referencing a socket, address is the sockaddr struct for the
/* Sock is a file descriptor referencing a socket, address is the net_sockaddr struct for the
* destination address of the request or NULL if the socket is already connected.
*/
ret = coap_client_req(&client, sock, &address, &req, -1);
Expand Down
8 changes: 4 additions & 4 deletions doc/connectivity/networking/api/coap_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The following is an example of a CoAP resource registered with our service:
#include <zephyr/net/coap_service.h>

static int my_get(struct coap_resource *resource, struct coap_packet *request,
struct sockaddr *addr, socklen_t addr_len)
struct net_sockaddr *addr, socklen_t addr_len)
{
static const char *msg = "Hello, world!";
uint8_t data[CONFIG_COAP_SERVER_MESSAGE_SIZE];
Expand Down Expand Up @@ -106,7 +106,7 @@ The following is an example of a CoAP resource registered with our service:
}

static int my_put(struct coap_resource *resource, struct coap_packet *request,
struct sockaddr *addr, socklen_t addr_len)
struct net_sockaddr *addr, socklen_t addr_len)
{
/* ... Handle the incoming request ... */

Expand Down Expand Up @@ -142,7 +142,7 @@ of CoAP services. An example using a temperature sensor can look like:
K_WORK_DELAYABLE_DEFINE(temp_work, notify_observers);

static int send_temperature(struct coap_resource *resource,
const struct sockaddr *addr, socklen_t addr_len,
const struct net_sockaddr *addr, socklen_t addr_len,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

socklen_t should probably also be changed to uint32_t within the network subsystem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not go that route, but just changed socklen_t to net_socklen_t. Not sure if we should do that uint32_t change as now it is easy to map the socklen variable between the network and Posix apis (because the naming is similar).
What other reviewers think about this, I am open to replace net_socklen_t if there are good arguments for it.

uint16_t age, uint16_t id, const uint8_t *token, uint8_t tkl,
bool is_response)
{
Expand Down Expand Up @@ -187,7 +187,7 @@ of CoAP services. An example using a temperature sensor can look like:
}

static int temp_get(struct coap_resource *resource, struct coap_packet *request,
struct sockaddr *addr, socklen_t addr_len)
struct net_sockaddr *addr, socklen_t addr_len)
{
uint8_t token[COAP_TOKEN_MAX_LEN];
uint16_t id;
Expand Down
8 changes: 4 additions & 4 deletions doc/connectivity/networking/api/dns_resolve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ Example:
if (status == DNS_EAI_INPROGRESS && info) {
char str[MAX_STR_LEN + 1];

if (info->ai_family == AF_INET) {
net_addr_ntop(AF_INET,
if (info->ai_family == NET_AF_INET) {
net_addr_ntop(NET_AF_INET,
&net_sin(&info->ai_addr)->sin_addr,
str, NET_IPV4_ADDR_LEN);
} else if (info->ai_family == AF_INET6) {
net_addr_ntop(AF_INET6,
} else if (info->ai_family == NET_AF_INET6) {
net_addr_ntop(NET_AF_INET6,
&net_sin6(&info->ai_addr)->sin6_addr,
str, NET_IPV6_ADDR_LEN);
} else if (info->ai_family == AF_LOCAL) {
Expand Down
4 changes: 2 additions & 2 deletions doc/connectivity/networking/api/http_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ To use custom socket creation:

The custom socket creation function receives:
- ``svc``: Pointer to the service descriptor
- ``af``: Address family (AF_INET or AF_INET6)
- ``proto``: Protocol (IPPROTO_TCP or IPPROTO_TLS_1_2 for HTTPS)
- ``af``: Address family (NET_AF_INET or NET_AF_INET6)
- ``proto``: Protocol (NET_IPPROTO_TCP or NET_IPPROTO_TLS_1_2 for HTTPS)

The function should return the socket file descriptor on success, or a negative error code on failure.

Expand Down
2 changes: 1 addition & 1 deletion doc/connectivity/networking/api/mqtt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ of the MQTT client and can be shared among MQTT clients:
.. code-block:: c

/* MQTT Broker address information. */
static struct sockaddr_storage broker;
static struct net_sockaddr_storage broker;

An MQTT client library will notify MQTT events to the application through a
callback function created to handle respective events:
Expand Down
4 changes: 2 additions & 2 deletions doc/connectivity/networking/api/mqtt_sn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ used. An example configuration for UDP transport is shown below:
.. code-block:: c

struct mqtt_sn_data client_id = MQTT_SN_DATA_STRING_LITERAL("ZEPHYR");
struct sockaddr_in gateway = {0};
struct net_sockaddr_in gateway = {0};

uint8_t tx_buf[256];
uint8_t rx_buf[256];

mqtt_sn_transport_udp_init(&tp, (struct sockaddr*)&gateway, sizeof((gateway)));
mqtt_sn_transport_udp_init(&tp, (struct net_sockaddr*)&gateway, sizeof((gateway)));

mqtt_sn_client_init(&client, &client_id, &tp.tp, evt_cb, tx_buf, sizeof(tx_buf), rx_buf, sizeof(rx_buf));

Expand Down
4 changes: 2 additions & 2 deletions doc/connectivity/networking/api/net_pkt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ bytes:

.. code-block:: c

pkt = net_pkt_alloc_with_buffer(iface, 800, AF_INET4, IPPROTO_UDP, K_FOREVER);
pkt = net_pkt_alloc_with_buffer(iface, 800, NET_AF_INET4, IPPROTO_UDP, K_FOREVER);

will successfully allocate 800 + 20 + 8 bytes of buffer for the new
net_pkt where:

.. code-block:: c

pkt = net_pkt_alloc_with_buffer(iface, 1600, AF_INET4, IPPROTO_UDP, K_FOREVER);
pkt = net_pkt_alloc_with_buffer(iface, 1600, NET_AF_INET4, IPPROTO_UDP, K_FOREVER);

will successfully allocate 1500 bytes, and where 20 + 8 bytes (IPv4 +
UDP headers) will not be used for the payload.
Expand Down
20 changes: 10 additions & 10 deletions drivers/ethernet/eth_adin2111.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ int eth_adin2111_oa_data_read(const struct device *dev, const uint16_t port_idx)

if (ftr & ADIN2111_OA_DATA_FTR_EV) {
pkt = net_pkt_rx_alloc_with_buffer(iface, CONFIG_ETH_ADIN2111_BUFFER_SIZE,
AF_UNSPEC, 0,
NET_AF_UNSPEC, 0,
K_MSEC(CONFIG_ETH_ADIN2111_TIMEOUT));
if (!pkt) {
LOG_ERR("OA RX: cannot allcate packet space, skipping.");
Expand Down Expand Up @@ -439,7 +439,7 @@ static int eth_adin2111_reg_read_generic(const struct device *dev,
#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */

/* spi header */
*(uint16_t *)buf = htons((ADIN2111_READ_TXN_CTRL | reg));
*(uint16_t *)buf = net_htons((ADIN2111_READ_TXN_CTRL | reg));
#if CONFIG_ETH_ADIN2111_SPI_CFG0
buf[2] = crc8_ccitt(0, buf, ADIN2111_SPI_HEADER_SIZE);
/* TA */
Expand Down Expand Up @@ -471,7 +471,7 @@ static int eth_adin2111_reg_read_generic(const struct device *dev,
}
#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */

*val = ntohl((*(uint32_t *)(&buf[header_len])));
*val = net_ntohl((*(uint32_t *)(&buf[header_len])));

return ret;
}
Expand All @@ -490,14 +490,14 @@ static int eth_adin2111_reg_write_generic(const struct device *dev,
#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */

/* spi header */
*(uint16_t *)buf = htons((ADIN2111_WRITE_TXN_CTRL | reg));
*(uint16_t *)buf = net_htons((ADIN2111_WRITE_TXN_CTRL | reg));
#if CONFIG_ETH_ADIN2111_SPI_CFG0
buf[2] = crc8_ccitt(0, buf, header_size);
++header_size;
#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */

/* reg */
*(uint32_t *)(buf + header_size) = htonl(val);
*(uint32_t *)(buf + header_size) = net_htonl(val);
#if CONFIG_ETH_ADIN2111_SPI_CFG0
buf[header_size + data_size] = crc8_ccitt(0, &buf[header_size], data_size);
++data_size;
Expand Down Expand Up @@ -576,7 +576,7 @@ static int adin2111_read_fifo(const struct device *dev, const uint16_t port_idx)
fsize -= ADIN2111_FRAME_HEADER_SIZE;

/* spi header */
*(uint16_t *)cmd_buf = htons((ADIN2111_READ_TXN_CTRL | rx_reg));
*(uint16_t *)cmd_buf = net_htons((ADIN2111_READ_TXN_CTRL | rx_reg));
#if CONFIG_ETH_ADIN2111_SPI_CFG0
cmd_buf[2] = crc8_ccitt(0, cmd_buf, ADIN2111_SPI_HEADER_SIZE);
/* TA */
Expand Down Expand Up @@ -608,7 +608,7 @@ static int adin2111_read_fifo(const struct device *dev, const uint16_t port_idx)
/* remove CRC32 and pass to the stack */
fsize_real = fsize - sizeof(uint32_t);

pkt = net_pkt_rx_alloc_with_buffer(iface, fsize_real, AF_UNSPEC, 0,
pkt = net_pkt_rx_alloc_with_buffer(iface, fsize_real, NET_AF_UNSPEC, 0,
K_MSEC(CONFIG_ETH_ADIN2111_TIMEOUT));
if (!pkt) {
eth_stats_update_errors_rx(iface);
Expand Down Expand Up @@ -838,7 +838,7 @@ static int adin2111_port_send(const struct device *dev, struct net_pkt *pkt)
eth_adin2111_lock(adin, K_FOREVER);
}

ret = eth_adin2111_send_oa_frame(cfg->adin, pkt, htons(cfg->port_idx));
ret = eth_adin2111_send_oa_frame(cfg->adin, pkt, net_htons(cfg->port_idx));

goto end_check;
}
Expand Down Expand Up @@ -887,14 +887,14 @@ static int adin2111_port_send(const struct device *dev, struct net_pkt *pkt)
memset(ctx->buf, 0, burst_size + ADIN2111_WRITE_HEADER_SIZE);

/* spi header */
*(uint16_t *)ctx->buf = htons(ADIN2111_TXN_CTRL_TX_REG);
*(uint16_t *)ctx->buf = net_htons(ADIN2111_TXN_CTRL_TX_REG);
#if CONFIG_ETH_ADIN2111_SPI_CFG0
ctx->buf[2] = crc8_ccitt(0, ctx->buf, header_size);
++header_size;
#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */

/* frame header */
*(uint16_t *)(ctx->buf + header_size) = htons(cfg->port_idx);
*(uint16_t *)(ctx->buf + header_size) = net_htons(cfg->port_idx);

/* read pkt into tx buffer */
ret = net_pkt_read(pkt,
Expand Down
3 changes: 2 additions & 1 deletion drivers/ethernet/eth_cyclonev.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,8 @@ static void eth_cyclonev_receive(struct eth_cyclonev_priv *p)
p->rx_current_desc_number = last_desc_index;

/* Allocate packet with buffer */
pkt = net_pkt_rx_alloc_with_buffer(p->iface, frame_length, AF_UNSPEC, 0, K_NO_WAIT);
pkt = net_pkt_rx_alloc_with_buffer(p->iface, frame_length,
NET_AF_UNSPEC, 0, K_NO_WAIT);
if (!pkt) {
LOG_ERR("net_pkt_rx_alloc_with_buffer() failed");
eth_stats_update_errors_rx(p->iface);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_e1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static struct net_pkt *e1000_rx(struct e1000_dev *dev)

hexdump(buf, len, "%zd byte(s)", len);

pkt = net_pkt_rx_alloc_with_buffer(dev->iface, len, AF_UNSPEC, 0,
pkt = net_pkt_rx_alloc_with_buffer(dev->iface, len, NET_AF_UNSPEC, 0,
K_NO_WAIT);
if (!pkt) {
LOG_ERR("Out of buffers");
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_enc28j60.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ static void enc28j60_read_packet(const struct device *dev, uint16_t frm_len)

/* Get the frame from the buffer */
pkt = net_pkt_rx_alloc_with_buffer(get_iface(context), frm_len,
AF_UNSPEC, 0, K_MSEC(config->timeout));
NET_AF_UNSPEC, 0, K_MSEC(config->timeout));
if (!pkt) {
LOG_ERR("%s: Could not allocate rx buffer", dev->name);
eth_stats_update_errors_rx(get_iface(context));
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_enc424j600.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ static int enc424j600_rx(const struct device *dev)

/* Get the frame from the buffer */
pkt = net_pkt_rx_alloc_with_buffer(context->iface, frm_len,
AF_UNSPEC, 0,
NET_AF_UNSPEC, 0,
K_MSEC(config->timeout));
if (!pkt) {
LOG_ERR("Could not allocate rx buffer");
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static struct net_pkt *eth_esp32_rx(
}

struct net_pkt *pkt = net_pkt_rx_alloc_with_buffer(
dev_data->iface, receive_len, AF_UNSPEC, 0, K_MSEC(100));
dev_data->iface, receive_len, NET_AF_UNSPEC, 0, K_MSEC(100));
if (pkt == NULL) {
eth_stats_update_errors_rx(dev_data->iface);
LOG_ERR("Could not allocate rx buffer");
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_gecko.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static struct net_pkt *frame_get(const struct device *dev)
if (eofIdx != UINT32_MAX) {
/* Allocate room for full frame */
rx_frame = net_pkt_rx_alloc_with_buffer(dev_data->iface,
total_len, AF_UNSPEC, 0, K_NO_WAIT);
total_len, NET_AF_UNSPEC, 0, K_NO_WAIT);
if (!rx_frame) {
LOG_ERR("Failed to obtain RX buffer");
ETH_RX_DISABLE(eth);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_ivshmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static struct net_pkt *eth_ivshmem_rx(const struct device *dev)
}

struct net_pkt *pkt = net_pkt_rx_alloc_with_buffer(
dev_data->iface, rx_len, AF_UNSPEC, 0, K_MSEC(100));
dev_data->iface, rx_len, NET_AF_UNSPEC, 0, K_MSEC(100));
if (pkt == NULL) {
LOG_ERR("Failed to allocate rx buffer");
eth_stats_update_errors_rx(dev_data->iface);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_lan9250.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ static int lan9250_rx(const struct device *dev)
}

/* Get the frame from the buffer */
pkt = net_pkt_rx_alloc_with_buffer(ctx->iface, pkt_len, AF_UNSPEC, 0,
pkt = net_pkt_rx_alloc_with_buffer(ctx->iface, pkt_len, NET_AF_UNSPEC, 0,
K_MSEC(config->timeout));
if (!pkt) {
LOG_ERR("%s: Could not allocate rx buffer", dev->name);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_litex_liteeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void eth_rx(const struct device *port)
rxslot = litex_read8(config->rx_slot_addr);

/* obtain rx buffer */
pkt = net_pkt_rx_alloc_with_buffer(context->iface, len, AF_UNSPEC, 0,
pkt = net_pkt_rx_alloc_with_buffer(context->iface, len, NET_AF_UNSPEC, 0,
K_NO_WAIT);
if (pkt == NULL) {
LOG_ERR("Failed to obtain RX buffer of length %u", len);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_native_tap.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static struct net_pkt *prepare_pkt(struct eth_context *ctx,
struct net_pkt *pkt;

pkt = net_pkt_rx_alloc_with_buffer(ctx->iface, count,
AF_UNSPEC, 0, NET_BUF_TIMEOUT);
NET_AF_UNSPEC, 0, NET_BUF_TIMEOUT);
if (!pkt) {
*status = -ENOMEM;
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_numaker.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static void m_numaker_gmacdev_packet_rx(const struct device *dev)
/* Allocate a memory buffer chain from buffer pool
* Using root iface. It will be updated in net_recv_data()
*/
pkt = net_pkt_rx_alloc_with_buffer(data->iface, len, AF_UNSPEC, 0, K_NO_WAIT);
pkt = net_pkt_rx_alloc_with_buffer(data->iface, len, NET_AF_UNSPEC, 0, K_NO_WAIT);
if (!pkt) {
LOG_ERR("pkt alloc frame-len=%d failed", len);
goto next;
Expand Down
6 changes: 3 additions & 3 deletions drivers/ethernet/eth_nxp_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ static bool eth_get_ptp_data(struct net_if *iface, struct net_pkt *pkt)
bool pkt_is_ptp;

if (net_eth_is_vlan_enabled(eth_ctx, iface)) {
pkt_is_ptp = ntohs(hdr_vlan->type) == NET_ETH_PTYPE_PTP;
pkt_is_ptp = net_ntohs(hdr_vlan->type) == NET_ETH_PTYPE_PTP;
} else {
pkt_is_ptp = ntohs(NET_ETH_HDR(pkt)->type) == NET_ETH_PTYPE_PTP;
pkt_is_ptp = net_ntohs(NET_ETH_HDR(pkt)->type) == NET_ETH_PTYPE_PTP;
}

if (pkt_is_ptp) {
Expand Down Expand Up @@ -376,7 +376,7 @@ static int eth_nxp_enet_rx(const struct device *dev)

/* Using root iface. It will be updated in net_recv_data() */
pkt = net_pkt_rx_alloc_with_buffer(data->iface, frame_length,
AF_UNSPEC, 0, K_NO_WAIT);
NET_AF_UNSPEC, 0, K_NO_WAIT);
if (!pkt) {
goto flush;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_nxp_s32_gmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static struct net_pkt *eth_nxp_s32_get_pkt(const struct device *dev,

/* Using root iface, it will be updated in net_recv_data() */
pkt = net_pkt_rx_alloc_with_buffer(ctx->iface, rx_info->PktLen,
AF_UNSPEC, 0, ETH_NXP_S32_BUF_TIMEOUT);
NET_AF_UNSPEC, 0, ETH_NXP_S32_BUF_TIMEOUT);
if (!pkt) {
LOG_ERR("Failed to allocate rx buffer of length %u", rx_info->PktLen);
goto exit;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_nxp_s32_netc.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static struct net_pkt *nxp_s32_eth_get_pkt(const struct device *dev,

/* Use root iface, it will be updated later in net_recv_data() */
pkt = net_pkt_rx_alloc_with_buffer(ctx->iface, buf->length,
AF_UNSPEC, 0, NETC_TIMEOUT);
NET_AF_UNSPEC, 0, NETC_TIMEOUT);
if (!pkt) {
goto exit;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_renesas_ra.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static struct net_pkt *renesas_ra_eth_rx(const struct device *dev)
goto out;
}

pkt = net_pkt_rx_alloc_with_buffer(ctx->iface, len, AF_UNSPEC, 0, K_MSEC(100));
pkt = net_pkt_rx_alloc_with_buffer(ctx->iface, len, NET_AF_UNSPEC, 0, K_MSEC(100));
if (!pkt) {
LOG_ERR("Failed to obtain RX buffer");
goto out;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_sam_gmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ static struct gptp_hdr *check_gptp_msg(struct net_if *iface,
struct net_eth_hdr *hdr;

hdr = (struct net_eth_hdr *)msg_start;
if (ntohs(hdr->type) != NET_ETH_PTYPE_PTP) {
if (net_ntohs(hdr->type) != NET_ETH_PTYPE_PTP) {
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_sensry_sy1xx_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ static int sy1xx_mac_receive_data(const struct device *dev, uint8_t *rx, uint16_
struct net_pkt *rx_pkt;
int ret;

rx_pkt = net_pkt_alloc_with_buffer(data->iface, len, AF_UNSPEC, 0, K_FOREVER);
rx_pkt = net_pkt_alloc_with_buffer(data->iface, len, NET_AF_UNSPEC, 0, K_FOREVER);
if (rx_pkt == NULL) {
LOG_ERR("rx packet allocation failed");
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_smsc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ static struct net_pkt *smsc_recv_pkt(const struct device *dev,
rem_size -= 4U;

pkt = net_pkt_rx_alloc_with_buffer(context->iface, rem_size,
AF_UNSPEC, 0, K_NO_WAIT);
NET_AF_UNSPEC, 0, K_NO_WAIT);
if (!pkt) {
LOG_ERR("Failed to obtain RX buffer");
smsc_discard_pkt();
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_smsc91x.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ static void smsc_recv_pkt(struct eth_context *data)
rx_buffer[len - 1] = smsc_read_1(sc, DATA0);
}

pkt = net_pkt_rx_alloc_with_buffer(data->iface, len, AF_UNSPEC, 0,
pkt = net_pkt_rx_alloc_with_buffer(data->iface, len, NET_AF_UNSPEC, 0,
K_NO_WAIT);
if (!pkt) {
LOG_ERR("Failed to obtain RX buffer");
Expand Down
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_stellaris.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static struct net_pkt *eth_stellaris_rx_pkt(const struct device *dev,
frame_len = reg_val & 0x0000ffff;

pkt = net_pkt_rx_alloc_with_buffer(iface, frame_len,
AF_UNSPEC, 0, K_NO_WAIT);
NET_AF_UNSPEC, 0, K_NO_WAIT);
if (!pkt) {
return NULL;
}
Expand Down
Loading
Loading