1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

gnrc_netif: use gnrc_netif_send where possible

This commit is contained in:
Jose Alamos 2020-03-06 15:22:58 +01:00
parent ca54366712
commit 6143cd800b
6 changed files with 18 additions and 18 deletions

View File

@ -73,7 +73,7 @@ int tx_cmd(int argc, char **argv)
}
gnrc_netapi_set(interface, NETOPT_LORAWAN_TX_PORT, 0, &port, sizeof(port));
gnrc_netapi_send(interface, pkt);
gnrc_netif_send(gnrc_netif_get_by_pid(interface), pkt);
msg_t msg;
/* wait for packet status and check */

View File

@ -285,7 +285,7 @@ static void _send_to_iface(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
return;
}
#endif
if (gnrc_netapi_send(netif->pid, pkt) < 1) {
if (gnrc_netif_send(netif, pkt) < 1) {
DEBUG("ipv6: unable to send packet\n");
gnrc_pktbuf_release(pkt);
}

View File

@ -95,7 +95,7 @@ void gnrc_sixlowpan_dispatch_send(gnrc_pktsnip_t *pkt, void *context,
(void)page;
assert(pkt->type == GNRC_NETTYPE_NETIF);
gnrc_netif_hdr_t *hdr = pkt->data;
if (gnrc_netapi_send(hdr->if_pid, pkt) < 1) {
if (gnrc_netif_send(gnrc_netif_get_by_pid(hdr->if_pid), pkt) < 1) {
DEBUG("6lo: unable to send %p over interface %u\n", (void *)pkt,
hdr->if_pid);
gnrc_pktbuf_release(pkt);

View File

@ -1401,7 +1401,7 @@ int _gnrc_netif_send(int argc, char **argv)
nethdr = (gnrc_netif_hdr_t *)hdr->data;
nethdr->flags = flags;
/* and send it */
if (gnrc_netapi_send(((gnrc_netif_t *)iface)->pid, pkt) < 1) {
if (gnrc_netif_send((gnrc_netif_t *)iface, pkt) < 1) {
puts("error: unable to send");
gnrc_pktbuf_release(pkt);
return 1;

View File

@ -1196,7 +1196,7 @@ static void test_netapi_send__raw_unicast_ethernet_packet(void)
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
TEST_ASSERT_NOT_NULL(netif);
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ethernet_netif->pid, pkt);
gnrc_netif_send(ethernet_netif, pkt);
}
static void test_netapi_send__raw_broadcast_ethernet_packet(void)
@ -1211,7 +1211,7 @@ static void test_netapi_send__raw_broadcast_ethernet_packet(void)
hdr = netif->data;
hdr->flags |= GNRC_NETIF_HDR_FLAGS_BROADCAST;
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ethernet_netif->pid, pkt);
gnrc_netif_send(ethernet_netif, pkt);
}
static void test_netapi_send__raw_unicast_ieee802154_long_long_packet(void)
@ -1224,7 +1224,7 @@ static void test_netapi_send__raw_unicast_ieee802154_long_long_packet(void)
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
TEST_ASSERT_NOT_NULL(netif);
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ieee802154_netif->pid, pkt);
gnrc_netif_send(ieee802154_netif, pkt);
}
static void test_netapi_send__raw_unicast_ieee802154_long_short_packet(void)
@ -1237,7 +1237,7 @@ static void test_netapi_send__raw_unicast_ieee802154_long_short_packet(void)
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
TEST_ASSERT_NOT_NULL(netif);
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ieee802154_netif->pid, pkt);
gnrc_netif_send(ieee802154_netif, pkt);
}
static void test_netapi_send__raw_unicast_ieee802154_short_long_packet1(void)
@ -1255,7 +1255,7 @@ static void test_netapi_send__raw_unicast_ieee802154_short_long_packet1(void)
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
TEST_ASSERT_NOT_NULL(netif);
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ieee802154_netif->pid, pkt);
gnrc_netif_send(ieee802154_netif, pkt);
/* reset src_len */
src_len = 8U;
TEST_ASSERT_EQUAL_INT(sizeof(src_len),
@ -1275,7 +1275,7 @@ static void test_netapi_send__raw_unicast_ieee802154_short_long_packet2(void)
dst, sizeof(dst));
TEST_ASSERT_NOT_NULL(netif);
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ieee802154_netif->pid, pkt);
gnrc_netif_send(ieee802154_netif, pkt);
}
static void test_netapi_send__raw_unicast_ieee802154_short_short_packet(void)
@ -1293,7 +1293,7 @@ static void test_netapi_send__raw_unicast_ieee802154_short_short_packet(void)
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
TEST_ASSERT_NOT_NULL(netif);
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ieee802154_netif->pid, pkt);
gnrc_netif_send(ieee802154_netif, pkt);
/* reset src_len */
src_len = 8U;
TEST_ASSERT_EQUAL_INT(sizeof(src_len),
@ -1313,7 +1313,7 @@ static void test_netapi_send__raw_broadcast_ieee802154_long_packet(void)
hdr = netif->data;
hdr->flags |= GNRC_NETIF_HDR_FLAGS_BROADCAST;
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ieee802154_netif->pid, pkt);
gnrc_netif_send(ieee802154_netif, pkt);
}
static void test_netapi_send__raw_broadcast_ieee802154_short_packet(void)
@ -1333,7 +1333,7 @@ static void test_netapi_send__raw_broadcast_ieee802154_short_packet(void)
hdr = netif->data;
hdr->flags |= GNRC_NETIF_HDR_FLAGS_BROADCAST;
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ieee802154_netif->pid, pkt);
gnrc_netif_send(ieee802154_netif, pkt);
/* reset src_len */
src_len = 8U;
TEST_ASSERT_EQUAL_INT(sizeof(src_len),
@ -1367,7 +1367,7 @@ static void test_netapi_send__ipv6_unicast_ethernet_packet(void)
sizeof(dst_netif));
TEST_ASSERT_NOT_NULL(netif);
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ethernet_netif->pid, pkt);
gnrc_netif_send(ethernet_netif, pkt);
}
static void test_netapi_send__ipv6_multicast_ethernet_packet(void)
@ -1394,7 +1394,7 @@ static void test_netapi_send__ipv6_multicast_ethernet_packet(void)
netif_hdr = netif->data;
netif_hdr->flags |= GNRC_NETIF_HDR_FLAGS_MULTICAST;
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ethernet_netif->pid, pkt);
gnrc_netif_send(ethernet_netif, pkt);
}
static void test_netapi_send__ipv6_unicast_ieee802154_packet(void)
@ -1423,7 +1423,7 @@ static void test_netapi_send__ipv6_unicast_ieee802154_packet(void)
sizeof(dst_netif));
TEST_ASSERT_NOT_NULL(netif);
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ieee802154_netif->pid, pkt);
gnrc_netif_send(ieee802154_netif, pkt);
}
static void test_netapi_send__ipv6_multicast_ieee802154_packet(void)
@ -1450,7 +1450,7 @@ static void test_netapi_send__ipv6_multicast_ieee802154_packet(void)
netif_hdr = netif->data;
netif_hdr->flags |= GNRC_NETIF_HDR_FLAGS_MULTICAST;
LL_PREPEND(pkt, netif);
gnrc_netapi_send(ieee802154_netif->pid, pkt);
gnrc_netif_send(ieee802154_netif, pkt);
}
static void test_netapi_recv__empty_ethernet_payload(void)

View File

@ -115,7 +115,7 @@ static int test_send(void)
return 0;
}
/* send packet to MAC layer */
gnrc_netapi_send(_mac_pid, pkt);
gnrc_netif_send(gnrc_netif_get_by_pid(_mac_pid), pkt);
/* wait for packet status and check */
msg_receive(&msg);
if ((msg.type != GNRC_NETERR_MSG_TYPE) ||