@@ -317,7 +317,7 @@ int eth_adin2111_oa_data_read(const struct device *dev, const uint16_t port_idx)
317317
318318 if (ftr & ADIN2111_OA_DATA_FTR_EV ) {
319319 pkt = net_pkt_rx_alloc_with_buffer (iface , CONFIG_ETH_ADIN2111_BUFFER_SIZE ,
320- AF_UNSPEC , 0 ,
320+ NET_AF_UNSPEC , 0 ,
321321 K_MSEC (CONFIG_ETH_ADIN2111_TIMEOUT ));
322322 if (!pkt ) {
323323 LOG_ERR ("OA RX: cannot allcate packet space, skipping." );
@@ -439,7 +439,7 @@ static int eth_adin2111_reg_read_generic(const struct device *dev,
439439#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */
440440
441441 /* spi header */
442- * (uint16_t * )buf = htons ((ADIN2111_READ_TXN_CTRL | reg ));
442+ * (uint16_t * )buf = net_htons ((ADIN2111_READ_TXN_CTRL | reg ));
443443#if CONFIG_ETH_ADIN2111_SPI_CFG0
444444 buf [2 ] = crc8_ccitt (0 , buf , ADIN2111_SPI_HEADER_SIZE );
445445 /* TA */
@@ -471,7 +471,7 @@ static int eth_adin2111_reg_read_generic(const struct device *dev,
471471 }
472472#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */
473473
474- * val = ntohl ((* (uint32_t * )(& buf [header_len ])));
474+ * val = net_ntohl ((* (uint32_t * )(& buf [header_len ])));
475475
476476 return ret ;
477477}
@@ -490,14 +490,14 @@ static int eth_adin2111_reg_write_generic(const struct device *dev,
490490#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */
491491
492492 /* spi header */
493- * (uint16_t * )buf = htons ((ADIN2111_WRITE_TXN_CTRL | reg ));
493+ * (uint16_t * )buf = net_htons ((ADIN2111_WRITE_TXN_CTRL | reg ));
494494 #if CONFIG_ETH_ADIN2111_SPI_CFG0
495495 buf [2 ] = crc8_ccitt (0 , buf , header_size );
496496 ++ header_size ;
497497#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */
498498
499499 /* reg */
500- * (uint32_t * )(buf + header_size ) = htonl (val );
500+ * (uint32_t * )(buf + header_size ) = net_htonl (val );
501501#if CONFIG_ETH_ADIN2111_SPI_CFG0
502502 buf [header_size + data_size ] = crc8_ccitt (0 , & buf [header_size ], data_size );
503503 ++ data_size ;
@@ -576,7 +576,7 @@ static int adin2111_read_fifo(const struct device *dev, const uint16_t port_idx)
576576 fsize -= ADIN2111_FRAME_HEADER_SIZE ;
577577
578578 /* spi header */
579- * (uint16_t * )cmd_buf = htons ((ADIN2111_READ_TXN_CTRL | rx_reg ));
579+ * (uint16_t * )cmd_buf = net_htons ((ADIN2111_READ_TXN_CTRL | rx_reg ));
580580#if CONFIG_ETH_ADIN2111_SPI_CFG0
581581 cmd_buf [2 ] = crc8_ccitt (0 , cmd_buf , ADIN2111_SPI_HEADER_SIZE );
582582 /* TA */
@@ -608,7 +608,7 @@ static int adin2111_read_fifo(const struct device *dev, const uint16_t port_idx)
608608 /* remove CRC32 and pass to the stack */
609609 fsize_real = fsize - sizeof (uint32_t );
610610
611- pkt = net_pkt_rx_alloc_with_buffer (iface , fsize_real , AF_UNSPEC , 0 ,
611+ pkt = net_pkt_rx_alloc_with_buffer (iface , fsize_real , NET_AF_UNSPEC , 0 ,
612612 K_MSEC (CONFIG_ETH_ADIN2111_TIMEOUT ));
613613 if (!pkt ) {
614614 eth_stats_update_errors_rx (iface );
@@ -838,7 +838,7 @@ static int adin2111_port_send(const struct device *dev, struct net_pkt *pkt)
838838 eth_adin2111_lock (adin , K_FOREVER );
839839 }
840840
841- ret = eth_adin2111_send_oa_frame (cfg -> adin , pkt , htons (cfg -> port_idx ));
841+ ret = eth_adin2111_send_oa_frame (cfg -> adin , pkt , net_htons (cfg -> port_idx ));
842842
843843 goto end_check ;
844844 }
@@ -887,14 +887,14 @@ static int adin2111_port_send(const struct device *dev, struct net_pkt *pkt)
887887 memset (ctx -> buf , 0 , burst_size + ADIN2111_WRITE_HEADER_SIZE );
888888
889889 /* spi header */
890- * (uint16_t * )ctx -> buf = htons (ADIN2111_TXN_CTRL_TX_REG );
890+ * (uint16_t * )ctx -> buf = net_htons (ADIN2111_TXN_CTRL_TX_REG );
891891#if CONFIG_ETH_ADIN2111_SPI_CFG0
892892 ctx -> buf [2 ] = crc8_ccitt (0 , ctx -> buf , header_size );
893893 ++ header_size ;
894894#endif /* CONFIG_ETH_ADIN2111_SPI_CFG0 */
895895
896896 /* frame header */
897- * (uint16_t * )(ctx -> buf + header_size ) = htons (cfg -> port_idx );
897+ * (uint16_t * )(ctx -> buf + header_size ) = net_htons (cfg -> port_idx );
898898
899899 /* read pkt into tx buffer */
900900 ret = net_pkt_read (pkt ,
0 commit comments