Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'batadv-next-pullrequest-20250313' of git://git.open-mesh.org/linux-merge

Simon Wunderlich says:

====================
This feature/cleanup patchset includes the following patches:

- bump version strings, by Simon Wunderlich

- drop batadv_priv_debug_log struct, by Sven Eckelmann

- adopt netdev_hold() / netdev_put(), by Eric Dumazet

- add support for jumbo frames, by Sven Eckelmann

- use consistent name for mesh interface, by Sven Eckelmann

- cleanup B.A.T.M.A.N. IV OGM aggregation handling,
by Sven Eckelmann (4 patches)

- add missing newlines for log macros, by Sven Eckelmann

* tag 'batadv-next-pullrequest-20250313' of git://git.open-mesh.org/linux-merge:
batman-adv: add missing newlines for log macros
batman-adv: Limit aggregation size to outgoing MTU
batman-adv: Use actual packet count for aggregated packets
batman-adv: Switch to bitmap helper for aggregation handling
batman-adv: Limit number of aggregated packets directly
batman-adv: Use consistent name for mesh interface
batman-adv: Add support for jumbo frames
batman-adv: adopt netdev_hold() / netdev_put()
batman-adv: Drop batadv_priv_debug_log struct
batman-adv: Start new development cycle
====================

Link: https://patch.msgid.link/20250313164519.72808-1-sw@simonwunderlich.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+948 -966
+1 -1
Documentation/networking/batman-adv.rst
··· 27 27 $ insmod batman-adv.ko 28 28 29 29 The module is now waiting for activation. You must add some interfaces on which 30 - batman-adv can operate. The batman-adv soft-interface can be created using the 30 + batman-adv can operate. The batman-adv mesh-interface can be created using the 31 31 iproute2 tool ``ip``:: 32 32 33 33 $ ip link add name bat0 type batadv
+9 -9
include/uapi/linux/batman_adv.h
··· 342 342 BATADV_ATTR_MCAST_FLAGS_PRIV, 343 343 344 344 /** 345 - * @BATADV_ATTR_VLANID: VLAN id on top of soft interface 345 + * @BATADV_ATTR_VLANID: VLAN id on top of mesh interface 346 346 */ 347 347 BATADV_ATTR_VLANID, 348 348 ··· 380 380 /** 381 381 * @BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED: whether the bridge loop 382 382 * avoidance feature is enabled. This feature detects and avoids loops 383 - * between the mesh and devices bridged with the soft interface 383 + * between the mesh and devices bridged with the mesh interface 384 384 */ 385 385 BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED, 386 386 ··· 509 509 BATADV_CMD_UNSPEC, 510 510 511 511 /** 512 - * @BATADV_CMD_GET_MESH: Get attributes from softif/mesh 512 + * @BATADV_CMD_GET_MESH: Get attributes from mesh(if) 513 513 */ 514 514 BATADV_CMD_GET_MESH, 515 515 ··· 535 535 536 536 /** 537 537 * @BATADV_CMD_GET_HARDIF: Get attributes from a hardif of the 538 - * current softif 538 + * current mesh(if) 539 539 */ 540 540 BATADV_CMD_GET_HARDIF, 541 541 ··· 591 591 BATADV_CMD_GET_MCAST_FLAGS, 592 592 593 593 /** 594 - * @BATADV_CMD_SET_MESH: Set attributes for softif/mesh 594 + * @BATADV_CMD_SET_MESH: Set attributes for mesh(if) 595 595 */ 596 596 BATADV_CMD_SET_MESH, 597 597 598 598 /** 599 599 * @BATADV_CMD_SET_HARDIF: Set attributes for hardif of the 600 - * current softif 600 + * current mesh(if) 601 601 */ 602 602 BATADV_CMD_SET_HARDIF, 603 603 604 604 /** 605 605 * @BATADV_CMD_GET_VLAN: Get attributes from a VLAN of the 606 - * current softif 606 + * current mesh(if) 607 607 */ 608 608 BATADV_CMD_GET_VLAN, 609 609 610 610 /** 611 611 * @BATADV_CMD_SET_VLAN: Set attributes for VLAN of the 612 - * current softif 612 + * current mesh(if) 613 613 */ 614 614 BATADV_CMD_SET_VLAN, 615 615 ··· 691 691 */ 692 692 IFLA_BATADV_ALGO_NAME, 693 693 694 - /* add attributes above here, update the policy in soft-interface.c */ 694 + /* add attributes above here, update the policy in mesh-interface.c */ 695 695 696 696 /** 697 697 * @__IFLA_BATADV_MAX: internal use
+1 -1
net/batman-adv/Makefile
··· 19 19 batman-adv-y += hash.o 20 20 batman-adv-$(CONFIG_BATMAN_ADV_DEBUG) += log.o 21 21 batman-adv-y += main.o 22 + batman-adv-y += mesh-interface.o 22 23 batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast.o 23 24 batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast_forw.o 24 25 batman-adv-y += netlink.o ··· 27 26 batman-adv-y += originator.o 28 27 batman-adv-y += routing.o 29 28 batman-adv-y += send.o 30 - batman-adv-y += soft-interface.o 31 29 batman-adv-$(CONFIG_BATMAN_ADV_TRACING) += trace.o 32 30 batman-adv-y += tp_meter.o 33 31 batman-adv-y += translation-table.o
+4 -4
net/batman-adv/bat_algo.c
··· 90 90 } 91 91 92 92 /** 93 - * batadv_algo_select() - Select algorithm of soft interface 94 - * @bat_priv: the bat priv with all the soft interface information 93 + * batadv_algo_select() - Select algorithm of mesh interface 94 + * @bat_priv: the bat priv with all the mesh interface information 95 95 * @name: name of the algorithm to select 96 96 * 97 - * The algorithm callbacks for the soft interface will be set when the algorithm 97 + * The algorithm callbacks for the mesh interface will be set when the algorithm 98 98 * with the correct name was found. Any previous selected algorithm will not be 99 99 * deinitialized and the new selected algorithm will also not be initialized. 100 100 * It is therefore not allowed to call batadv_algo_select outside the creation 101 - * function of the soft interface. 101 + * function of the mesh interface. 102 102 * 103 103 * Return: 0 on success or negative error number in case of failure 104 104 */
+57 -48
net/batman-adv/bat_iv_ogm.c
··· 23 23 #include <linux/kref.h> 24 24 #include <linux/list.h> 25 25 #include <linux/lockdep.h> 26 + #include <linux/minmax.h> 26 27 #include <linux/mutex.h> 27 28 #include <linux/netdevice.h> 28 29 #include <linux/netlink.h> ··· 130 129 /** 131 130 * batadv_iv_ogm_orig_get() - retrieve or create (if does not exist) an 132 131 * originator 133 - * @bat_priv: the bat priv with all the soft interface information 132 + * @bat_priv: the bat priv with all the mesh interface information 134 133 * @addr: mac address of the originator 135 134 * 136 135 * Return: the originator object corresponding to the passed mac address or NULL ··· 334 333 static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet, 335 334 struct batadv_hard_iface *hard_iface) 336 335 { 337 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 336 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 338 337 const char *fwd_str; 339 338 u8 packet_num; 340 339 s16 buff_pos; ··· 356 355 /* we might have aggregated direct link packets with an 357 356 * ordinary base packet 358 357 */ 359 - if (forw_packet->direct_link_flags & BIT(packet_num) && 358 + if (test_bit(packet_num, forw_packet->direct_link_flags) && 360 359 forw_packet->if_incoming == hard_iface) 361 360 batadv_ogm_packet->flags |= BATADV_DIRECTLINK; 362 361 else ··· 397 396 /* send a batman ogm packet */ 398 397 static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet) 399 398 { 400 - struct net_device *soft_iface; 399 + struct net_device *mesh_iface; 401 400 402 401 if (!forw_packet->if_incoming) { 403 402 pr_err("Error - can't forward packet: incoming iface not specified\n"); 404 403 return; 405 404 } 406 405 407 - soft_iface = forw_packet->if_incoming->soft_iface; 406 + mesh_iface = forw_packet->if_incoming->mesh_iface; 408 407 409 408 if (WARN_ON(!forw_packet->if_outgoing)) 410 409 return; 411 410 412 - if (forw_packet->if_outgoing->soft_iface != soft_iface) { 413 - pr_warn("%s: soft interface switch for queued OGM\n", __func__); 411 + if (forw_packet->if_outgoing->mesh_iface != mesh_iface) { 412 + pr_warn("%s: mesh interface switch for queued OGM\n", __func__); 414 413 return; 415 414 } 416 415 ··· 425 424 * batadv_iv_ogm_can_aggregate() - find out if an OGM can be aggregated on an 426 425 * existing forward packet 427 426 * @new_bat_ogm_packet: OGM packet to be aggregated 428 - * @bat_priv: the bat priv with all the soft interface information 427 + * @bat_priv: the bat priv with all the mesh interface information 429 428 * @packet_len: (total) length of the OGM 430 429 * @send_time: timestamp (jiffies) when the packet is to be sent 431 430 * @directlink: true if this is a direct link packet ··· 445 444 const struct batadv_forw_packet *forw_packet) 446 445 { 447 446 struct batadv_ogm_packet *batadv_ogm_packet; 448 - int aggregated_bytes = forw_packet->packet_len + packet_len; 447 + unsigned int aggregated_bytes = forw_packet->packet_len + packet_len; 449 448 struct batadv_hard_iface *primary_if = NULL; 449 + u8 packet_num = forw_packet->num_packets; 450 450 bool res = false; 451 451 unsigned long aggregation_end_time; 452 + unsigned int max_bytes; 452 453 453 454 batadv_ogm_packet = (struct batadv_ogm_packet *)forw_packet->skb->data; 454 455 aggregation_end_time = send_time; 455 456 aggregation_end_time += msecs_to_jiffies(BATADV_MAX_AGGREGATION_MS); 457 + 458 + max_bytes = min_t(unsigned int, if_outgoing->net_dev->mtu, 459 + BATADV_MAX_AGGREGATION_BYTES); 456 460 457 461 /* we can aggregate the current packet to this aggregated packet 458 462 * if: 459 463 * 460 464 * - the send time is within our MAX_AGGREGATION_MS time 461 465 * - the resulting packet won't be bigger than 462 - * MAX_AGGREGATION_BYTES 466 + * MAX_AGGREGATION_BYTES and MTU of the outgoing interface 467 + * - the number of packets is lower than MAX_AGGREGATION_PACKETS 463 468 * otherwise aggregation is not possible 464 469 */ 465 470 if (!time_before(send_time, forw_packet->send_time) || 466 471 !time_after_eq(aggregation_end_time, forw_packet->send_time)) 467 472 return false; 468 473 469 - if (aggregated_bytes > BATADV_MAX_AGGREGATION_BYTES) 474 + if (aggregated_bytes > max_bytes) 475 + return false; 476 + 477 + if (packet_num >= BATADV_MAX_AGGREGATION_PACKETS) 470 478 return false; 471 479 472 480 /* packet is not leaving on the same interface. */ ··· 550 540 struct batadv_hard_iface *if_outgoing, 551 541 int own_packet) 552 542 { 553 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 543 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 554 544 struct batadv_forw_packet *forw_packet_aggr; 555 545 struct sk_buff *skb; 556 546 unsigned char *skb_buff; 557 547 unsigned int skb_size; 558 548 atomic_t *queue_left = own_packet ? NULL : &bat_priv->batman_queue_left; 559 549 560 - if (atomic_read(&bat_priv->aggregated_ogms) && 561 - packet_len < BATADV_MAX_AGGREGATION_BYTES) 562 - skb_size = BATADV_MAX_AGGREGATION_BYTES; 550 + if (atomic_read(&bat_priv->aggregated_ogms)) 551 + skb_size = max_t(unsigned int, BATADV_MAX_AGGREGATION_BYTES, 552 + packet_len); 563 553 else 564 554 skb_size = packet_len; 565 555 ··· 584 574 memcpy(skb_buff, packet_buff, packet_len); 585 575 586 576 forw_packet_aggr->own = own_packet; 587 - forw_packet_aggr->direct_link_flags = BATADV_NO_FLAGS; 577 + bitmap_zero(forw_packet_aggr->direct_link_flags, 578 + BATADV_MAX_AGGREGATION_PACKETS); 588 579 forw_packet_aggr->send_time = send_time; 589 580 590 581 /* save packet direct link flag status */ 591 582 if (direct_link) 592 - forw_packet_aggr->direct_link_flags |= 1; 583 + set_bit(0, forw_packet_aggr->direct_link_flags); 593 584 594 585 INIT_DELAYED_WORK(&forw_packet_aggr->delayed_work, 595 586 batadv_iv_send_outstanding_bat_ogm_packet); ··· 603 592 const unsigned char *packet_buff, 604 593 int packet_len, bool direct_link) 605 594 { 606 - unsigned long new_direct_link_flag; 607 - 608 595 skb_put_data(forw_packet_aggr->skb, packet_buff, packet_len); 609 596 forw_packet_aggr->packet_len += packet_len; 610 - forw_packet_aggr->num_packets++; 611 597 612 598 /* save packet direct link flag status */ 613 - if (direct_link) { 614 - new_direct_link_flag = BIT(forw_packet_aggr->num_packets); 615 - forw_packet_aggr->direct_link_flags |= new_direct_link_flag; 616 - } 599 + if (direct_link) 600 + set_bit(forw_packet_aggr->num_packets, 601 + forw_packet_aggr->direct_link_flags); 602 + 603 + forw_packet_aggr->num_packets++; 617 604 } 618 605 619 606 /** 620 607 * batadv_iv_ogm_queue_add() - queue up an OGM for transmission 621 - * @bat_priv: the bat priv with all the soft interface information 608 + * @bat_priv: the bat priv with all the mesh interface information 622 609 * @packet_buff: pointer to the OGM 623 610 * @packet_len: (total) length of the OGM 624 611 * @if_incoming: interface where the packet was received ··· 695 686 struct batadv_hard_iface *if_incoming, 696 687 struct batadv_hard_iface *if_outgoing) 697 688 { 698 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 689 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 699 690 u16 tvlv_len; 700 691 701 692 if (batadv_ogm_packet->ttl <= 1) { ··· 748 739 static void 749 740 batadv_iv_ogm_slide_own_bcast_window(struct batadv_hard_iface *hard_iface) 750 741 { 751 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 742 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 752 743 struct batadv_hashtable *hash = bat_priv->orig_hash; 753 744 struct hlist_head *head; 754 745 struct batadv_orig_node *orig_node; ··· 787 778 */ 788 779 static void batadv_iv_ogm_schedule_buff(struct batadv_hard_iface *hard_iface) 789 780 { 790 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 781 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 791 782 unsigned char **ogm_buff = &hard_iface->bat_iv.ogm_buff; 792 783 struct batadv_ogm_packet *batadv_ogm_packet; 793 784 struct batadv_hard_iface *primary_if, *tmp_hard_iface; ··· 849 840 */ 850 841 rcu_read_lock(); 851 842 list_for_each_entry_rcu(tmp_hard_iface, &batadv_hardif_list, list) { 852 - if (tmp_hard_iface->soft_iface != hard_iface->soft_iface) 843 + if (tmp_hard_iface->mesh_iface != hard_iface->mesh_iface) 853 844 continue; 854 845 855 846 if (!kref_get_unless_zero(&tmp_hard_iface->refcount)) ··· 910 901 /** 911 902 * batadv_iv_ogm_orig_update() - use OGM to update corresponding data in an 912 903 * originator 913 - * @bat_priv: the bat priv with all the soft interface information 904 + * @bat_priv: the bat priv with all the mesh interface information 914 905 * @orig_node: the orig node who originally emitted the ogm packet 915 906 * @orig_ifinfo: ifinfo for the outgoing interface of the orig_node 916 907 * @ethhdr: Ethernet header of the OGM ··· 1074 1065 struct batadv_hard_iface *if_incoming, 1075 1066 struct batadv_hard_iface *if_outgoing) 1076 1067 { 1077 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 1068 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 1078 1069 struct batadv_neigh_node *neigh_node = NULL, *tmp_neigh_node; 1079 1070 struct batadv_neigh_ifinfo *neigh_ifinfo; 1080 1071 u8 total_count; ··· 1216 1207 const struct batadv_hard_iface *if_incoming, 1217 1208 struct batadv_hard_iface *if_outgoing) 1218 1209 { 1219 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 1210 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 1220 1211 struct batadv_orig_node *orig_node; 1221 1212 struct batadv_orig_ifinfo *orig_ifinfo = NULL; 1222 1213 struct batadv_neigh_node *neigh_node; ··· 1318 1309 struct batadv_hard_iface *if_incoming, 1319 1310 struct batadv_hard_iface *if_outgoing) 1320 1311 { 1321 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 1312 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 1322 1313 struct batadv_hardif_neigh_node *hardif_neigh = NULL; 1323 1314 struct batadv_neigh_node *router = NULL; 1324 1315 struct batadv_neigh_node *router_router = NULL; ··· 1558 1549 static void batadv_iv_ogm_process(const struct sk_buff *skb, int ogm_offset, 1559 1550 struct batadv_hard_iface *if_incoming) 1560 1551 { 1561 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 1552 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 1562 1553 struct batadv_orig_node *orig_neigh_node, *orig_node; 1563 1554 struct batadv_hard_iface *hard_iface; 1564 1555 struct batadv_ogm_packet *ogm_packet; ··· 1608 1599 if (hard_iface->if_status != BATADV_IF_ACTIVE) 1609 1600 continue; 1610 1601 1611 - if (hard_iface->soft_iface != if_incoming->soft_iface) 1602 + if (hard_iface->mesh_iface != if_incoming->mesh_iface) 1612 1603 continue; 1613 1604 1614 1605 if (batadv_compare_eth(ethhdr->h_source, ··· 1673 1664 if (hard_iface->if_status != BATADV_IF_ACTIVE) 1674 1665 continue; 1675 1666 1676 - if (hard_iface->soft_iface != bat_priv->soft_iface) 1667 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 1677 1668 continue; 1678 1669 1679 1670 if (!kref_get_unless_zero(&hard_iface->refcount)) ··· 1699 1690 delayed_work = to_delayed_work(work); 1700 1691 forw_packet = container_of(delayed_work, struct batadv_forw_packet, 1701 1692 delayed_work); 1702 - bat_priv = netdev_priv(forw_packet->if_incoming->soft_iface); 1693 + bat_priv = netdev_priv(forw_packet->if_incoming->mesh_iface); 1703 1694 1704 1695 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_DEACTIVATING) { 1705 1696 dropped = true; ··· 1730 1721 static int batadv_iv_ogm_receive(struct sk_buff *skb, 1731 1722 struct batadv_hard_iface *if_incoming) 1732 1723 { 1733 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 1724 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 1734 1725 struct batadv_ogm_packet *ogm_packet; 1735 1726 u8 *packet_pos; 1736 1727 int ogm_offset; ··· 1809 1800 * @msg: Netlink message to dump into 1810 1801 * @portid: Port making netlink request 1811 1802 * @seq: Sequence number of netlink message 1812 - * @bat_priv: The bat priv with all the soft interface information 1803 + * @bat_priv: The bat priv with all the mesh interface information 1813 1804 * @if_outgoing: Limit dump to entries with this outgoing interface 1814 1805 * @orig_node: Originator to dump 1815 1806 * @neigh_node: Single hops neighbour ··· 1872 1863 * @msg: Netlink message to dump into 1873 1864 * @portid: Port making netlink request 1874 1865 * @seq: Sequence number of netlink message 1875 - * @bat_priv: The bat priv with all the soft interface information 1866 + * @bat_priv: The bat priv with all the mesh interface information 1876 1867 * @if_outgoing: Limit dump to entries with this outgoing interface 1877 1868 * @orig_node: Originator to dump 1878 1869 * @sub_s: Number of sub entries to skip ··· 1934 1925 * @msg: Netlink message to dump into 1935 1926 * @portid: Port making netlink request 1936 1927 * @seq: Sequence number of netlink message 1937 - * @bat_priv: The bat priv with all the soft interface information 1928 + * @bat_priv: The bat priv with all the mesh interface information 1938 1929 * @if_outgoing: Limit dump to entries with this outgoing interface 1939 1930 * @head: Bucket to be dumped 1940 1931 * @idx_s: Number of entries to be skipped ··· 1975 1966 * batadv_iv_ogm_orig_dump() - Dump the originators into a message 1976 1967 * @msg: Netlink message to dump into 1977 1968 * @cb: Control block containing additional options 1978 - * @bat_priv: The bat priv with all the soft interface information 1969 + * @bat_priv: The bat priv with all the mesh interface information 1979 1970 * @if_outgoing: Limit dump to entries with this outgoing interface 1980 1971 */ 1981 1972 static void ··· 2097 2088 * @msg: Netlink message to dump into 2098 2089 * @portid: Port making netlink request 2099 2090 * @seq: Sequence number of netlink message 2100 - * @bat_priv: The bat priv with all the soft interface information 2091 + * @bat_priv: The bat priv with all the mesh interface information 2101 2092 * @hard_iface: Hard interface to dump the neighbours for 2102 2093 * @idx_s: Number of entries to skip 2103 2094 * ··· 2134 2125 * batadv_iv_ogm_neigh_dump() - Dump the neighbours into a message 2135 2126 * @msg: Netlink message to dump into 2136 2127 * @cb: Control block containing additional options 2137 - * @bat_priv: The bat priv with all the soft interface information 2128 + * @bat_priv: The bat priv with all the mesh interface information 2138 2129 * @single_hardif: Limit dump to this hard interface 2139 2130 */ 2140 2131 static void ··· 2161 2152 } else { 2162 2153 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, 2163 2154 list) { 2164 - if (hard_iface->soft_iface != bat_priv->soft_iface) 2155 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 2165 2156 continue; 2166 2157 2167 2158 if (i_hardif++ < i_hardif_s) ··· 2245 2236 2246 2237 /** 2247 2238 * batadv_iv_init_sel_class() - initialize GW selection class 2248 - * @bat_priv: the bat priv with all the soft interface information 2239 + * @bat_priv: the bat priv with all the mesh interface information 2249 2240 */ 2250 2241 static void batadv_iv_init_sel_class(struct batadv_priv *bat_priv) 2251 2242 { ··· 2400 2391 * @msg: Netlink message to dump into 2401 2392 * @portid: Port making netlink request 2402 2393 * @cb: Control block containing additional options 2403 - * @bat_priv: The bat priv with all the soft interface information 2394 + * @bat_priv: The bat priv with all the mesh interface information 2404 2395 * @gw_node: Gateway to be dumped 2405 2396 * 2406 2397 * Return: Error code, or 0 on success ··· 2475 2466 * batadv_iv_gw_dump() - Dump gateways into a message 2476 2467 * @msg: Netlink message to dump into 2477 2468 * @cb: Control block containing additional options 2478 - * @bat_priv: The bat priv with all the soft interface information 2469 + * @bat_priv: The bat priv with all the mesh interface information 2479 2470 */ 2480 2471 static void batadv_iv_gw_dump(struct sk_buff *msg, struct netlink_callback *cb, 2481 2472 struct batadv_priv *bat_priv)
+14 -14
net/batman-adv/bat_v.c
··· 43 43 44 44 static void batadv_v_iface_activate(struct batadv_hard_iface *hard_iface) 45 45 { 46 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 46 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 47 47 struct batadv_hard_iface *primary_if; 48 48 49 49 primary_if = batadv_primary_if_get_selected(bat_priv); ··· 97 97 */ 98 98 static void batadv_v_iface_update_mac(struct batadv_hard_iface *hard_iface) 99 99 { 100 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 100 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 101 101 struct batadv_hard_iface *primary_if; 102 102 103 103 primary_if = batadv_primary_if_get_selected(bat_priv); ··· 166 166 * @msg: Netlink message to dump into 167 167 * @portid: Port making netlink request 168 168 * @seq: Sequence number of netlink message 169 - * @bat_priv: The bat priv with all the soft interface information 169 + * @bat_priv: The bat priv with all the mesh interface information 170 170 * @hard_iface: The hard interface to be dumped 171 171 * @idx_s: Entries to be skipped 172 172 * ··· 203 203 * message 204 204 * @msg: Netlink message to dump into 205 205 * @cb: Control block containing additional options 206 - * @bat_priv: The bat priv with all the soft interface information 206 + * @bat_priv: The bat priv with all the mesh interface information 207 207 * @single_hardif: Limit dumping to this hard interface 208 208 */ 209 209 static void ··· 228 228 } 229 229 } else { 230 230 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { 231 - if (hard_iface->soft_iface != bat_priv->soft_iface) 231 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 232 232 continue; 233 233 234 234 if (i_hardif++ < i_hardif_s) ··· 254 254 * @msg: Netlink message to dump into 255 255 * @portid: Port making netlink request 256 256 * @seq: Sequence number of netlink message 257 - * @bat_priv: The bat priv with all the soft interface information 257 + * @bat_priv: The bat priv with all the mesh interface information 258 258 * @if_outgoing: Limit dump to entries with this outgoing interface 259 259 * @orig_node: Originator to dump 260 260 * @neigh_node: Single hops neighbour ··· 322 322 * @msg: Netlink message to dump into 323 323 * @portid: Port making netlink request 324 324 * @seq: Sequence number of netlink message 325 - * @bat_priv: The bat priv with all the soft interface information 325 + * @bat_priv: The bat priv with all the mesh interface information 326 326 * @if_outgoing: Limit dump to entries with this outgoing interface 327 327 * @orig_node: Originator to dump 328 328 * @sub_s: Number of sub entries to skip ··· 374 374 * @msg: Netlink message to dump into 375 375 * @portid: Port making netlink request 376 376 * @seq: Sequence number of netlink message 377 - * @bat_priv: The bat priv with all the soft interface information 377 + * @bat_priv: The bat priv with all the mesh interface information 378 378 * @if_outgoing: Limit dump to entries with this outgoing interface 379 379 * @head: Bucket to be dumped 380 380 * @idx_s: Number of entries to be skipped ··· 414 414 * batadv_v_orig_dump() - Dump the originators into a message 415 415 * @msg: Netlink message to dump into 416 416 * @cb: Control block containing additional options 417 - * @bat_priv: The bat priv with all the soft interface information 417 + * @bat_priv: The bat priv with all the mesh interface information 418 418 * @if_outgoing: Limit dump to entries with this outgoing interface 419 419 */ 420 420 static void ··· 502 502 503 503 /** 504 504 * batadv_v_init_sel_class() - initialize GW selection class 505 - * @bat_priv: the bat priv with all the soft interface information 505 + * @bat_priv: the bat priv with all the mesh interface information 506 506 */ 507 507 static void batadv_v_init_sel_class(struct batadv_priv *bat_priv) 508 508 { ··· 553 553 554 554 /** 555 555 * batadv_v_gw_get_best_gw_node() - retrieve the best GW node 556 - * @bat_priv: the bat priv with all the soft interface information 556 + * @bat_priv: the bat priv with all the mesh interface information 557 557 * 558 558 * Return: the GW node having the best GW-metric, NULL if no GW is known 559 559 */ ··· 590 590 591 591 /** 592 592 * batadv_v_gw_is_eligible() - check if a originator would be selected as GW 593 - * @bat_priv: the bat priv with all the soft interface information 593 + * @bat_priv: the bat priv with all the mesh interface information 594 594 * @curr_gw_orig: originator representing the currently selected GW 595 595 * @orig_node: the originator representing the new candidate 596 596 * ··· 647 647 * @msg: Netlink message to dump into 648 648 * @portid: Port making netlink request 649 649 * @cb: Control block containing additional options 650 - * @bat_priv: The bat priv with all the soft interface information 650 + * @bat_priv: The bat priv with all the mesh interface information 651 651 * @gw_node: Gateway to be dumped 652 652 * 653 653 * Return: Error code, or 0 on success ··· 746 746 * batadv_v_gw_dump() - Dump gateways into a message 747 747 * @msg: Netlink message to dump into 748 748 * @cb: Control block containing additional options 749 - * @bat_priv: The bat priv with all the soft interface information 749 + * @bat_priv: The bat priv with all the mesh interface information 750 750 */ 751 751 static void batadv_v_gw_dump(struct sk_buff *msg, struct netlink_callback *cb, 752 752 struct batadv_priv *bat_priv)
+8 -8
net/batman-adv/bat_v_elp.c
··· 82 82 u32 *pthroughput) 83 83 { 84 84 struct batadv_hard_iface *hard_iface = neigh->if_incoming; 85 - struct net_device *soft_iface = hard_iface->soft_iface; 85 + struct net_device *mesh_iface = hard_iface->mesh_iface; 86 86 struct ethtool_link_ksettings link_settings; 87 87 struct net_device *real_netdev; 88 88 struct station_info sinfo; ··· 92 92 /* don't query throughput when no longer associated with any 93 93 * batman-adv interface 94 94 */ 95 - if (!soft_iface) 95 + if (!mesh_iface) 96 96 return false; 97 97 98 98 /* if the user specified a customised value for this interface, then ··· 180 180 181 181 default_throughput: 182 182 if (!(hard_iface->bat_v.flags & BATADV_WARNING_DEFAULT)) { 183 - batadv_info(soft_iface, 183 + batadv_info(mesh_iface, 184 184 "WiFi driver or ethtool info does not provide information about link speeds on interface %s, therefore defaulting to hardcoded throughput values of %u.%1u Mbps. Consider overriding the throughput manually or checking your driver.\n", 185 185 hard_iface->net_dev->name, 186 186 BATADV_THROUGHPUT_DEFAULT_VALUE / 10, ··· 226 226 batadv_v_elp_wifi_neigh_probe(struct batadv_hardif_neigh_node *neigh) 227 227 { 228 228 struct batadv_hard_iface *hard_iface = neigh->if_incoming; 229 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 229 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 230 230 unsigned long last_tx_diff; 231 231 struct sk_buff *skb; 232 232 int probe_len, i; ··· 295 295 296 296 bat_v = container_of(work, struct batadv_hard_iface_bat_v, elp_wq.work); 297 297 hard_iface = container_of(bat_v, struct batadv_hard_iface, bat_v); 298 - bat_priv = netdev_priv(hard_iface->soft_iface); 298 + bat_priv = netdev_priv(hard_iface->mesh_iface); 299 299 300 300 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_DEACTIVATING) 301 301 goto out; ··· 476 476 /* update orig field of every elp iface belonging to this mesh */ 477 477 rcu_read_lock(); 478 478 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { 479 - if (primary_iface->soft_iface != hard_iface->soft_iface) 479 + if (primary_iface->mesh_iface != hard_iface->mesh_iface) 480 480 continue; 481 481 482 482 batadv_v_elp_iface_activate(primary_iface, hard_iface); ··· 486 486 487 487 /** 488 488 * batadv_v_elp_neigh_update() - update an ELP neighbour node 489 - * @bat_priv: the bat priv with all the soft interface information 489 + * @bat_priv: the bat priv with all the mesh interface information 490 490 * @neigh_addr: the neighbour interface address 491 491 * @if_incoming: the interface the packet was received through 492 492 * @elp_packet: the received ELP packet ··· 552 552 int batadv_v_elp_packet_recv(struct sk_buff *skb, 553 553 struct batadv_hard_iface *if_incoming) 554 554 { 555 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 555 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 556 556 struct batadv_elp_packet *elp_packet; 557 557 struct batadv_hard_iface *primary_if; 558 558 struct ethhdr *ethhdr;
+21 -21
net/batman-adv/bat_v_ogm.c
··· 45 45 46 46 /** 47 47 * batadv_v_ogm_orig_get() - retrieve and possibly create an originator node 48 - * @bat_priv: the bat priv with all the soft interface information 48 + * @bat_priv: the bat priv with all the mesh interface information 49 49 * @addr: the address of the originator 50 50 * 51 51 * Return: the orig_node corresponding to the specified address. If such an ··· 96 96 97 97 /** 98 98 * batadv_v_ogm_start_timer() - restart the OGM sending timer 99 - * @bat_priv: the bat priv with all the soft interface information 99 + * @bat_priv: the bat priv with all the mesh interface information 100 100 */ 101 101 static void batadv_v_ogm_start_timer(struct batadv_priv *bat_priv) 102 102 { ··· 121 121 static void batadv_v_ogm_send_to_if(struct sk_buff *skb, 122 122 struct batadv_hard_iface *hard_iface) 123 123 { 124 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 124 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 125 125 126 126 if (hard_iface->if_status != BATADV_IF_ACTIVE) { 127 127 kfree_skb(skb); ··· 239 239 static void batadv_v_ogm_queue_on_if(struct sk_buff *skb, 240 240 struct batadv_hard_iface *hard_iface) 241 241 { 242 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 242 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 243 243 244 244 if (!atomic_read(&bat_priv->aggregated_ogms)) { 245 245 batadv_v_ogm_send_to_if(skb, hard_iface); ··· 256 256 } 257 257 258 258 /** 259 - * batadv_v_ogm_send_softif() - periodic worker broadcasting the own OGM 260 - * @bat_priv: the bat priv with all the soft interface information 259 + * batadv_v_ogm_send_meshif() - periodic worker broadcasting the own OGM 260 + * @bat_priv: the bat priv with all the mesh interface information 261 261 */ 262 - static void batadv_v_ogm_send_softif(struct batadv_priv *bat_priv) 262 + static void batadv_v_ogm_send_meshif(struct batadv_priv *bat_priv) 263 263 { 264 264 struct batadv_hard_iface *hard_iface; 265 265 struct batadv_ogm2_packet *ogm_packet; ··· 302 302 /* broadcast on every interface */ 303 303 rcu_read_lock(); 304 304 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { 305 - if (hard_iface->soft_iface != bat_priv->soft_iface) 305 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 306 306 continue; 307 307 308 308 if (!kref_get_unless_zero(&hard_iface->refcount)) ··· 373 373 bat_priv = container_of(bat_v, struct batadv_priv, bat_v); 374 374 375 375 mutex_lock(&bat_priv->bat_v.ogm_buff_mutex); 376 - batadv_v_ogm_send_softif(bat_priv); 376 + batadv_v_ogm_send_meshif(bat_priv); 377 377 mutex_unlock(&bat_priv->bat_v.ogm_buff_mutex); 378 378 } 379 379 ··· 408 408 */ 409 409 int batadv_v_ogm_iface_enable(struct batadv_hard_iface *hard_iface) 410 410 { 411 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 411 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 412 412 413 413 batadv_v_ogm_start_queue_timer(hard_iface); 414 414 batadv_v_ogm_start_timer(bat_priv); ··· 435 435 */ 436 436 void batadv_v_ogm_primary_iface_set(struct batadv_hard_iface *primary_iface) 437 437 { 438 - struct batadv_priv *bat_priv = netdev_priv(primary_iface->soft_iface); 438 + struct batadv_priv *bat_priv = netdev_priv(primary_iface->mesh_iface); 439 439 struct batadv_ogm2_packet *ogm_packet; 440 440 441 441 mutex_lock(&bat_priv->bat_v.ogm_buff_mutex); ··· 452 452 /** 453 453 * batadv_v_forward_penalty() - apply a penalty to the throughput metric 454 454 * forwarded with B.A.T.M.A.N. V OGMs 455 - * @bat_priv: the bat priv with all the soft interface information 455 + * @bat_priv: the bat priv with all the mesh interface information 456 456 * @if_incoming: the interface where the OGM has been received 457 457 * @if_outgoing: the interface where the OGM has to be forwarded to 458 458 * @throughput: the current throughput ··· 505 505 /** 506 506 * batadv_v_ogm_forward() - check conditions and forward an OGM to the given 507 507 * outgoing interface 508 - * @bat_priv: the bat priv with all the soft interface information 508 + * @bat_priv: the bat priv with all the mesh interface information 509 509 * @ogm_received: previously received OGM to be forwarded 510 510 * @orig_node: the originator which has been updated 511 511 * @neigh_node: the neigh_node through with the OGM has been received ··· 592 592 593 593 /** 594 594 * batadv_v_ogm_metric_update() - update route metric based on OGM 595 - * @bat_priv: the bat priv with all the soft interface information 595 + * @bat_priv: the bat priv with all the mesh interface information 596 596 * @ogm2: OGM2 structure 597 597 * @orig_node: Originator structure for which the OGM has been received 598 598 * @neigh_node: the neigh_node through with the OGM has been received ··· 675 675 676 676 /** 677 677 * batadv_v_ogm_route_update() - update routes based on OGM 678 - * @bat_priv: the bat priv with all the soft interface information 678 + * @bat_priv: the bat priv with all the mesh interface information 679 679 * @ethhdr: the Ethernet header of the OGM2 680 680 * @ogm2: OGM2 structure 681 681 * @orig_node: Originator structure for which the OGM has been received ··· 770 770 771 771 /** 772 772 * batadv_v_ogm_process_per_outif() - process a batman v OGM for an outgoing if 773 - * @bat_priv: the bat priv with all the soft interface information 773 + * @bat_priv: the bat priv with all the mesh interface information 774 774 * @ethhdr: the Ethernet header of the OGM2 775 775 * @ogm2: OGM2 structure 776 776 * @orig_node: Originator structure for which the OGM has been received ··· 852 852 static void batadv_v_ogm_process(const struct sk_buff *skb, int ogm_offset, 853 853 struct batadv_hard_iface *if_incoming) 854 854 { 855 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 855 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 856 856 struct ethhdr *ethhdr; 857 857 struct batadv_orig_node *orig_node = NULL; 858 858 struct batadv_hardif_neigh_node *hardif_neigh = NULL; ··· 926 926 if (hard_iface->if_status != BATADV_IF_ACTIVE) 927 927 continue; 928 928 929 - if (hard_iface->soft_iface != bat_priv->soft_iface) 929 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 930 930 continue; 931 931 932 932 if (!kref_get_unless_zero(&hard_iface->refcount)) ··· 985 985 int batadv_v_ogm_packet_recv(struct sk_buff *skb, 986 986 struct batadv_hard_iface *if_incoming) 987 987 { 988 - struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); 988 + struct batadv_priv *bat_priv = netdev_priv(if_incoming->mesh_iface); 989 989 struct batadv_ogm2_packet *ogm_packet; 990 990 struct ethhdr *ethhdr; 991 991 int ogm_offset; ··· 1036 1036 1037 1037 /** 1038 1038 * batadv_v_ogm_init() - initialise the OGM2 engine 1039 - * @bat_priv: the bat priv with all the soft interface information 1039 + * @bat_priv: the bat priv with all the mesh interface information 1040 1040 * 1041 1041 * Return: 0 on success or a negative error code in case of failure 1042 1042 */ ··· 1071 1071 1072 1072 /** 1073 1073 * batadv_v_ogm_free() - free OGM private resources 1074 - * @bat_priv: the bat priv with all the soft interface information 1074 + * @bat_priv: the bat priv with all the mesh interface information 1075 1075 */ 1076 1076 void batadv_v_ogm_free(struct batadv_priv *bat_priv) 1077 1077 {
+1 -1
net/batman-adv/bitarray.c
··· 23 23 /** 24 24 * batadv_bit_get_packet() - receive and process one packet within the sequence 25 25 * number window 26 - * @priv: the bat priv with all the soft interface information 26 + * @priv: the bat priv with all the mesh interface information 27 27 * @seq_bits: pointer to the sequence number receive packet 28 28 * @seq_num_diff: difference between the current/received sequence number and 29 29 * the last sequence number
+53 -53
net/batman-adv/bridge_loop_avoidance.c
··· 209 209 210 210 /** 211 211 * batadv_claim_hash_find() - looks for a claim in the claim hash 212 - * @bat_priv: the bat priv with all the soft interface information 212 + * @bat_priv: the bat priv with all the mesh interface information 213 213 * @data: search data (may be local/static data) 214 214 * 215 215 * Return: claim if found or NULL otherwise. ··· 248 248 249 249 /** 250 250 * batadv_backbone_hash_find() - looks for a backbone gateway in the hash 251 - * @bat_priv: the bat priv with all the soft interface information 251 + * @bat_priv: the bat priv with all the mesh interface information 252 252 * @addr: the address of the originator 253 253 * @vid: the VLAN ID 254 254 * ··· 332 332 333 333 /** 334 334 * batadv_bla_send_claim() - sends a claim frame according to the provided info 335 - * @bat_priv: the bat priv with all the soft interface information 335 + * @bat_priv: the bat priv with all the mesh interface information 336 336 * @mac: the mac address to be announced within the claim 337 337 * @vid: the VLAN ID 338 338 * @claimtype: the type of the claim (CLAIM, UNCLAIM, ANNOUNCE, ...) ··· 343 343 struct sk_buff *skb; 344 344 struct ethhdr *ethhdr; 345 345 struct batadv_hard_iface *primary_if; 346 - struct net_device *soft_iface; 346 + struct net_device *mesh_iface; 347 347 u8 *hw_src; 348 348 struct batadv_bla_claim_dst local_claim_dest; 349 349 __be32 zeroip = 0; ··· 356 356 sizeof(local_claim_dest)); 357 357 local_claim_dest.type = claimtype; 358 358 359 - soft_iface = primary_if->soft_iface; 359 + mesh_iface = primary_if->mesh_iface; 360 360 361 361 skb = arp_create(ARPOP_REPLY, ETH_P_ARP, 362 362 /* IP DST: 0.0.0.0 */ 363 363 zeroip, 364 - primary_if->soft_iface, 364 + primary_if->mesh_iface, 365 365 /* IP SRC: 0.0.0.0 */ 366 366 zeroip, 367 367 /* Ethernet DST: Broadcast */ ··· 439 439 } 440 440 441 441 skb_reset_mac_header(skb); 442 - skb->protocol = eth_type_trans(skb, soft_iface); 442 + skb->protocol = eth_type_trans(skb, mesh_iface); 443 443 batadv_inc_counter(bat_priv, BATADV_CNT_RX); 444 444 batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES, 445 445 skb->len + ETH_HLEN); ··· 466 466 report_work); 467 467 bat_priv = backbone_gw->bat_priv; 468 468 469 - batadv_info(bat_priv->soft_iface, 469 + batadv_info(bat_priv->mesh_iface, 470 470 "Possible loop on VLAN %d detected which can't be handled by BLA - please check your network setup!\n", 471 471 batadv_print_vid(backbone_gw->vid)); 472 472 snprintf(vid_str, sizeof(vid_str), "%d", ··· 481 481 482 482 /** 483 483 * batadv_bla_get_backbone_gw() - finds or creates a backbone gateway 484 - * @bat_priv: the bat priv with all the soft interface information 484 + * @bat_priv: the bat priv with all the mesh interface information 485 485 * @orig: the mac address of the originator 486 486 * @vid: the VLAN ID 487 487 * @own_backbone: set if the requested backbone is local ··· 554 554 555 555 /** 556 556 * batadv_bla_update_own_backbone_gw() - updates the own backbone gw for a VLAN 557 - * @bat_priv: the bat priv with all the soft interface information 557 + * @bat_priv: the bat priv with all the mesh interface information 558 558 * @primary_if: the selected primary interface 559 559 * @vid: VLAN identifier 560 560 * ··· 580 580 581 581 /** 582 582 * batadv_bla_answer_request() - answer a bla request by sending own claims 583 - * @bat_priv: the bat priv with all the soft interface information 583 + * @bat_priv: the bat priv with all the mesh interface information 584 584 * @primary_if: interface where the request came on 585 585 * @vid: the vid where the request came on 586 586 * ··· 657 657 658 658 /** 659 659 * batadv_bla_send_announce() - Send an announcement frame 660 - * @bat_priv: the bat priv with all the soft interface information 660 + * @bat_priv: the bat priv with all the mesh interface information 661 661 * @backbone_gw: our backbone gateway which should be announced 662 662 */ 663 663 static void batadv_bla_send_announce(struct batadv_priv *bat_priv, ··· 678 678 679 679 /** 680 680 * batadv_bla_add_claim() - Adds a claim in the claim hash 681 - * @bat_priv: the bat priv with all the soft interface information 681 + * @bat_priv: the bat priv with all the mesh interface information 682 682 * @mac: the mac address of the claim 683 683 * @vid: the VLAN ID of the frame 684 684 * @backbone_gw: the backbone gateway which claims it ··· 788 788 789 789 /** 790 790 * batadv_bla_del_claim() - delete a claim from the claim hash 791 - * @bat_priv: the bat priv with all the soft interface information 791 + * @bat_priv: the bat priv with all the mesh interface information 792 792 * @mac: mac address of the claim to be removed 793 793 * @vid: VLAN id for the claim to be removed 794 794 */ ··· 826 826 827 827 /** 828 828 * batadv_handle_announce() - check for ANNOUNCE frame 829 - * @bat_priv: the bat priv with all the soft interface information 829 + * @bat_priv: the bat priv with all the mesh interface information 830 830 * @an_addr: announcement mac address (ARP Sender HW address) 831 831 * @backbone_addr: originator address of the sender (Ethernet source MAC) 832 832 * @vid: the VLAN ID of the frame ··· 884 884 885 885 /** 886 886 * batadv_handle_request() - check for REQUEST frame 887 - * @bat_priv: the bat priv with all the soft interface information 888 - * @primary_if: the primary hard interface of this batman soft interface 887 + * @bat_priv: the bat priv with all the mesh interface information 888 + * @primary_if: the primary hard interface of this batman mesh interface 889 889 * @backbone_addr: backbone address to be requested (ARP sender HW MAC) 890 890 * @ethhdr: ethernet header of a packet 891 891 * @vid: the VLAN ID of the frame ··· 917 917 918 918 /** 919 919 * batadv_handle_unclaim() - check for UNCLAIM frame 920 - * @bat_priv: the bat priv with all the soft interface information 921 - * @primary_if: the primary hard interface of this batman soft interface 920 + * @bat_priv: the bat priv with all the mesh interface information 921 + * @primary_if: the primary hard interface of this batman mesh interface 922 922 * @backbone_addr: originator address of the backbone (Ethernet source) 923 923 * @claim_addr: Client to be unclaimed (ARP sender HW MAC) 924 924 * @vid: the VLAN ID of the frame ··· 955 955 956 956 /** 957 957 * batadv_handle_claim() - check for CLAIM frame 958 - * @bat_priv: the bat priv with all the soft interface information 959 - * @primary_if: the primary hard interface of this batman soft interface 958 + * @bat_priv: the bat priv with all the mesh interface information 959 + * @primary_if: the primary hard interface of this batman mesh interface 960 960 * @backbone_addr: originator address of the backbone (Ethernet Source) 961 961 * @claim_addr: client mac address to be claimed (ARP sender HW MAC) 962 962 * @vid: the VLAN ID of the frame ··· 992 992 993 993 /** 994 994 * batadv_check_claim_group() - check for claim group membership 995 - * @bat_priv: the bat priv with all the soft interface information 995 + * @bat_priv: the bat priv with all the mesh interface information 996 996 * @primary_if: the primary interface of this batman interface 997 997 * @hw_src: the Hardware source in the ARP Header 998 998 * @hw_dst: the Hardware destination in the ARP Header ··· 1067 1067 1068 1068 /** 1069 1069 * batadv_bla_process_claim() - Check if this is a claim frame, and process it 1070 - * @bat_priv: the bat priv with all the soft interface information 1071 - * @primary_if: the primary hard interface of this batman soft interface 1070 + * @bat_priv: the bat priv with all the mesh interface information 1071 + * @primary_if: the primary hard interface of this batman mesh interface 1072 1072 * @skb: the frame to be checked 1073 1073 * 1074 1074 * Return: true if it was a claim frame, otherwise return false to ··· 1210 1210 /** 1211 1211 * batadv_bla_purge_backbone_gw() - Remove backbone gateways after a timeout or 1212 1212 * immediately 1213 - * @bat_priv: the bat priv with all the soft interface information 1213 + * @bat_priv: the bat priv with all the mesh interface information 1214 1214 * @now: whether the whole hash shall be wiped now 1215 1215 * 1216 1216 * Check when we last heard from other nodes, and remove them in case of ··· 1262 1262 1263 1263 /** 1264 1264 * batadv_bla_purge_claims() - Remove claims after a timeout or immediately 1265 - * @bat_priv: the bat priv with all the soft interface information 1265 + * @bat_priv: the bat priv with all the mesh interface information 1266 1266 * @primary_if: the selected primary interface, may be NULL if now is set 1267 1267 * @now: whether the whole hash shall be wiped now 1268 1268 * ··· 1321 1321 /** 1322 1322 * batadv_bla_update_orig_address() - Update the backbone gateways when the own 1323 1323 * originator address changes 1324 - * @bat_priv: the bat priv with all the soft interface information 1324 + * @bat_priv: the bat priv with all the mesh interface information 1325 1325 * @primary_if: the new selected primary_if 1326 1326 * @oldif: the old primary interface, may be NULL 1327 1327 */ ··· 1376 1376 1377 1377 /** 1378 1378 * batadv_bla_send_loopdetect() - send a loopdetect frame 1379 - * @bat_priv: the bat priv with all the soft interface information 1379 + * @bat_priv: the bat priv with all the mesh interface information 1380 1380 * @backbone_gw: the backbone gateway for which a loop should be detected 1381 1381 * 1382 1382 * To detect loops that the bridge loop avoidance can't handle, send a loop ··· 1396 1396 1397 1397 /** 1398 1398 * batadv_bla_status_update() - purge bla interfaces if necessary 1399 - * @net_dev: the soft interface net device 1399 + * @net_dev: the mesh interface net device 1400 1400 */ 1401 1401 void batadv_bla_status_update(struct net_device *net_dev) 1402 1402 { ··· 1520 1520 1521 1521 /** 1522 1522 * batadv_bla_init() - initialize all bla structures 1523 - * @bat_priv: the bat priv with all the soft interface information 1523 + * @bat_priv: the bat priv with all the mesh interface information 1524 1524 * 1525 1525 * Return: 0 on success, < 0 on error. 1526 1526 */ ··· 1586 1586 1587 1587 /** 1588 1588 * batadv_bla_check_duplist() - Check if a frame is in the broadcast dup. 1589 - * @bat_priv: the bat priv with all the soft interface information 1589 + * @bat_priv: the bat priv with all the mesh interface information 1590 1590 * @skb: contains the multicast packet to be checked 1591 1591 * @payload_ptr: pointer to position inside the head buffer of the skb 1592 1592 * marking the start of the data to be CRC'ed ··· 1680 1680 1681 1681 /** 1682 1682 * batadv_bla_check_ucast_duplist() - Check if a frame is in the broadcast dup. 1683 - * @bat_priv: the bat priv with all the soft interface information 1683 + * @bat_priv: the bat priv with all the mesh interface information 1684 1684 * @skb: contains the multicast packet to be checked, decapsulated from a 1685 1685 * unicast_packet 1686 1686 * ··· 1698 1698 1699 1699 /** 1700 1700 * batadv_bla_check_bcast_duplist() - Check if a frame is in the broadcast dup. 1701 - * @bat_priv: the bat priv with all the soft interface information 1701 + * @bat_priv: the bat priv with all the mesh interface information 1702 1702 * @skb: contains the bcast_packet to be checked 1703 1703 * 1704 1704 * Check if it is on our broadcast list. Another gateway might have sent the ··· 1723 1723 /** 1724 1724 * batadv_bla_is_backbone_gw_orig() - Check if the originator is a gateway for 1725 1725 * the VLAN identified by vid. 1726 - * @bat_priv: the bat priv with all the soft interface information 1726 + * @bat_priv: the bat priv with all the mesh interface information 1727 1727 * @orig: originator mac address 1728 1728 * @vid: VLAN identifier 1729 1729 * ··· 1766 1766 * @orig_node: the orig_node of the frame 1767 1767 * @hdr_size: maximum length of the frame 1768 1768 * 1769 - * Return: true if the orig_node is also a gateway on the soft interface, 1769 + * Return: true if the orig_node is also a gateway on the mesh interface, 1770 1770 * otherwise it returns false. 1771 1771 */ 1772 1772 bool batadv_bla_is_backbone_gw(struct sk_buff *skb, ··· 1796 1796 1797 1797 /** 1798 1798 * batadv_bla_free() - free all bla structures 1799 - * @bat_priv: the bat priv with all the soft interface information 1799 + * @bat_priv: the bat priv with all the mesh interface information 1800 1800 * 1801 - * for softinterface free or module unload 1801 + * for meshinterface free or module unload 1802 1802 */ 1803 1803 void batadv_bla_free(struct batadv_priv *bat_priv) 1804 1804 { ··· 1822 1822 1823 1823 /** 1824 1824 * batadv_bla_loopdetect_check() - check and handle a detected loop 1825 - * @bat_priv: the bat priv with all the soft interface information 1825 + * @bat_priv: the bat priv with all the mesh interface information 1826 1826 * @skb: the packet to check 1827 1827 * @primary_if: interface where the request came on 1828 1828 * @vid: the VLAN ID of the frame ··· 1877 1877 1878 1878 /** 1879 1879 * batadv_bla_rx() - check packets coming from the mesh. 1880 - * @bat_priv: the bat priv with all the soft interface information 1880 + * @bat_priv: the bat priv with all the mesh interface information 1881 1881 * @skb: the frame to be checked 1882 1882 * @vid: the VLAN ID of the frame 1883 1883 * @packet_type: the batman packet type this frame came in ··· 2010 2010 2011 2011 /** 2012 2012 * batadv_bla_tx() - check packets going into the mesh 2013 - * @bat_priv: the bat priv with all the soft interface information 2013 + * @bat_priv: the bat priv with all the mesh interface information 2014 2014 * @skb: the frame to be checked 2015 2015 * @vid: the VLAN ID of the frame 2016 2016 * ··· 2232 2232 { 2233 2233 struct batadv_hard_iface *primary_if = NULL; 2234 2234 int portid = NETLINK_CB(cb->skb).portid; 2235 - struct net_device *soft_iface; 2235 + struct net_device *mesh_iface; 2236 2236 struct batadv_hashtable *hash; 2237 2237 struct batadv_priv *bat_priv; 2238 2238 int bucket = cb->args[0]; 2239 2239 int idx = cb->args[1]; 2240 2240 int ret = 0; 2241 2241 2242 - soft_iface = batadv_netlink_get_softif(cb); 2243 - if (IS_ERR(soft_iface)) 2244 - return PTR_ERR(soft_iface); 2242 + mesh_iface = batadv_netlink_get_meshif(cb); 2243 + if (IS_ERR(mesh_iface)) 2244 + return PTR_ERR(mesh_iface); 2245 2245 2246 - bat_priv = netdev_priv(soft_iface); 2246 + bat_priv = netdev_priv(mesh_iface); 2247 2247 hash = bat_priv->bla.claim_hash; 2248 2248 2249 2249 primary_if = batadv_primary_if_get_selected(bat_priv); ··· 2267 2267 out: 2268 2268 batadv_hardif_put(primary_if); 2269 2269 2270 - dev_put(soft_iface); 2270 + dev_put(mesh_iface); 2271 2271 2272 2272 return ret; 2273 2273 } ··· 2393 2393 { 2394 2394 struct batadv_hard_iface *primary_if = NULL; 2395 2395 int portid = NETLINK_CB(cb->skb).portid; 2396 - struct net_device *soft_iface; 2396 + struct net_device *mesh_iface; 2397 2397 struct batadv_hashtable *hash; 2398 2398 struct batadv_priv *bat_priv; 2399 2399 int bucket = cb->args[0]; 2400 2400 int idx = cb->args[1]; 2401 2401 int ret = 0; 2402 2402 2403 - soft_iface = batadv_netlink_get_softif(cb); 2404 - if (IS_ERR(soft_iface)) 2405 - return PTR_ERR(soft_iface); 2403 + mesh_iface = batadv_netlink_get_meshif(cb); 2404 + if (IS_ERR(mesh_iface)) 2405 + return PTR_ERR(mesh_iface); 2406 2406 2407 - bat_priv = netdev_priv(soft_iface); 2407 + bat_priv = netdev_priv(mesh_iface); 2408 2408 hash = bat_priv->bla.backbone_hash; 2409 2409 2410 2410 primary_if = batadv_primary_if_get_selected(bat_priv); ··· 2428 2428 out: 2429 2429 batadv_hardif_put(primary_if); 2430 2430 2431 - dev_put(soft_iface); 2431 + dev_put(mesh_iface); 2432 2432 2433 2433 return ret; 2434 2434 } ··· 2437 2437 /** 2438 2438 * batadv_bla_check_claim() - check if address is claimed 2439 2439 * 2440 - * @bat_priv: the bat priv with all the soft interface information 2440 + * @bat_priv: the bat priv with all the mesh interface information 2441 2441 * @addr: mac address of which the claim status is checked 2442 2442 * @vid: the VLAN ID 2443 2443 *
+34 -34
net/batman-adv/distributed-arp-table.c
··· 96 96 97 97 /** 98 98 * batadv_dat_start_timer() - initialise the DAT periodic worker 99 - * @bat_priv: the bat priv with all the soft interface information 99 + * @bat_priv: the bat priv with all the mesh interface information 100 100 */ 101 101 static void batadv_dat_start_timer(struct batadv_priv *bat_priv) 102 102 { ··· 145 145 146 146 /** 147 147 * __batadv_dat_purge() - delete entries from the DAT local storage 148 - * @bat_priv: the bat priv with all the soft interface information 148 + * @bat_priv: the bat priv with all the mesh interface information 149 149 * @to_purge: function in charge to decide whether an entry has to be purged or 150 150 * not. This function takes the dat_entry as argument and has to 151 151 * returns a boolean value: true is the entry has to be deleted, ··· 315 315 /** 316 316 * batadv_dat_entry_hash_find() - look for a given dat_entry in the local hash 317 317 * table 318 - * @bat_priv: the bat priv with all the soft interface information 318 + * @bat_priv: the bat priv with all the mesh interface information 319 319 * @ip: search key 320 320 * @vid: VLAN identifier 321 321 * ··· 357 357 358 358 /** 359 359 * batadv_dat_entry_add() - add a new dat entry or update it if already exists 360 - * @bat_priv: the bat priv with all the soft interface information 360 + * @bat_priv: the bat priv with all the mesh interface information 361 361 * @ip: ipv4 to add/edit 362 362 * @mac_addr: mac address to assign to the given ipv4 363 363 * @vid: VLAN identifier ··· 414 414 /** 415 415 * batadv_dbg_arp() - print a debug message containing all the ARP packet 416 416 * details 417 - * @bat_priv: the bat priv with all the soft interface information 417 + * @bat_priv: the bat priv with all the mesh interface information 418 418 * @skb: ARP packet 419 419 * @hdr_size: size of the possible header before the ARP packet 420 420 * @msg: message to print together with the debugging information ··· 549 549 550 550 /** 551 551 * batadv_choose_next_candidate() - select the next DHT candidate 552 - * @bat_priv: the bat priv with all the soft interface information 552 + * @bat_priv: the bat priv with all the mesh interface information 553 553 * @cands: candidates array 554 554 * @select: number of candidates already present in the array 555 555 * @ip_key: key to look up in the DHT ··· 613 613 /** 614 614 * batadv_dat_select_candidates() - select the nodes which the DHT message has 615 615 * to be sent to 616 - * @bat_priv: the bat priv with all the soft interface information 616 + * @bat_priv: the bat priv with all the mesh interface information 617 617 * @ip_dst: ipv4 to look up in the DHT 618 618 * @vid: VLAN identifier 619 619 * ··· 658 658 659 659 /** 660 660 * batadv_dat_forward_data() - copy and send payload to the selected candidates 661 - * @bat_priv: the bat priv with all the soft interface information 661 + * @bat_priv: the bat priv with all the mesh interface information 662 662 * @skb: payload to send 663 663 * @ip: the DHT key 664 664 * @vid: VLAN identifier ··· 734 734 /** 735 735 * batadv_dat_tvlv_container_update() - update the dat tvlv container after dat 736 736 * setting change 737 - * @bat_priv: the bat priv with all the soft interface information 737 + * @bat_priv: the bat priv with all the mesh interface information 738 738 */ 739 739 static void batadv_dat_tvlv_container_update(struct batadv_priv *bat_priv) 740 740 { ··· 756 756 /** 757 757 * batadv_dat_status_update() - update the dat tvlv container after dat 758 758 * setting change 759 - * @net_dev: the soft interface net device 759 + * @net_dev: the mesh interface net device 760 760 */ 761 761 void batadv_dat_status_update(struct net_device *net_dev) 762 762 { ··· 767 767 768 768 /** 769 769 * batadv_dat_tvlv_ogm_handler_v1() - process incoming dat tvlv container 770 - * @bat_priv: the bat priv with all the soft interface information 770 + * @bat_priv: the bat priv with all the mesh interface information 771 771 * @orig: the orig_node of the ogm 772 772 * @flags: flags indicating the tvlv state (see batadv_tvlv_handler_flags) 773 773 * @tvlv_value: tvlv buffer containing the gateway data ··· 786 786 787 787 /** 788 788 * batadv_dat_hash_free() - free the local DAT hash table 789 - * @bat_priv: the bat priv with all the soft interface information 789 + * @bat_priv: the bat priv with all the mesh interface information 790 790 */ 791 791 static void batadv_dat_hash_free(struct batadv_priv *bat_priv) 792 792 { ··· 802 802 803 803 /** 804 804 * batadv_dat_init() - initialise the DAT internals 805 - * @bat_priv: the bat priv with all the soft interface information 805 + * @bat_priv: the bat priv with all the mesh interface information 806 806 * 807 807 * Return: 0 in case of success, a negative error code otherwise 808 808 */ ··· 828 828 829 829 /** 830 830 * batadv_dat_free() - free the DAT internals 831 - * @bat_priv: the bat priv with all the soft interface information 831 + * @bat_priv: the bat priv with all the mesh interface information 832 832 */ 833 833 void batadv_dat_free(struct batadv_priv *bat_priv) 834 834 { ··· 936 936 { 937 937 struct batadv_hard_iface *primary_if = NULL; 938 938 int portid = NETLINK_CB(cb->skb).portid; 939 - struct net_device *soft_iface; 939 + struct net_device *mesh_iface; 940 940 struct batadv_hashtable *hash; 941 941 struct batadv_priv *bat_priv; 942 942 int bucket = cb->args[0]; 943 943 int idx = cb->args[1]; 944 944 int ret = 0; 945 945 946 - soft_iface = batadv_netlink_get_softif(cb); 947 - if (IS_ERR(soft_iface)) 948 - return PTR_ERR(soft_iface); 946 + mesh_iface = batadv_netlink_get_meshif(cb); 947 + if (IS_ERR(mesh_iface)) 948 + return PTR_ERR(mesh_iface); 949 949 950 - bat_priv = netdev_priv(soft_iface); 950 + bat_priv = netdev_priv(mesh_iface); 951 951 hash = bat_priv->dat.hash; 952 952 953 953 primary_if = batadv_primary_if_get_selected(bat_priv); ··· 973 973 out: 974 974 batadv_hardif_put(primary_if); 975 975 976 - dev_put(soft_iface); 976 + dev_put(mesh_iface); 977 977 978 978 return ret; 979 979 } 980 980 981 981 /** 982 982 * batadv_arp_get_type() - parse an ARP packet and gets the type 983 - * @bat_priv: the bat priv with all the soft interface information 983 + * @bat_priv: the bat priv with all the mesh interface information 984 984 * @skb: packet to analyse 985 985 * @hdr_size: size of the possible header before the ARP packet in the skb 986 986 * ··· 1080 1080 1081 1081 /** 1082 1082 * batadv_dat_arp_create_reply() - create an ARP Reply 1083 - * @bat_priv: the bat priv with all the soft interface information 1083 + * @bat_priv: the bat priv with all the mesh interface information 1084 1084 * @ip_src: ARP sender IP 1085 1085 * @ip_dst: ARP target IP 1086 1086 * @hw_src: Ethernet source and ARP sender MAC ··· 1099 1099 { 1100 1100 struct sk_buff *skb; 1101 1101 1102 - skb = arp_create(ARPOP_REPLY, ETH_P_ARP, ip_dst, bat_priv->soft_iface, 1102 + skb = arp_create(ARPOP_REPLY, ETH_P_ARP, ip_dst, bat_priv->mesh_iface, 1103 1103 ip_src, hw_dst, hw_src, hw_dst); 1104 1104 if (!skb) 1105 1105 return NULL; ··· 1116 1116 /** 1117 1117 * batadv_dat_snoop_outgoing_arp_request() - snoop the ARP request and try to 1118 1118 * answer using DAT 1119 - * @bat_priv: the bat priv with all the soft interface information 1119 + * @bat_priv: the bat priv with all the mesh interface information 1120 1120 * @skb: packet to check 1121 1121 * 1122 1122 * Return: true if the message has been sent to the dht candidates, false ··· 1132 1132 bool ret = false; 1133 1133 struct batadv_dat_entry *dat_entry = NULL; 1134 1134 struct sk_buff *skb_new; 1135 - struct net_device *soft_iface = bat_priv->soft_iface; 1135 + struct net_device *mesh_iface = bat_priv->mesh_iface; 1136 1136 int hdr_size = 0; 1137 1137 unsigned short vid; 1138 1138 ··· 1162 1162 * client will answer itself. DAT would only generate a 1163 1163 * duplicate packet. 1164 1164 * 1165 - * Moreover, if the soft-interface is enslaved into a bridge, an 1165 + * Moreover, if the mesh-interface is enslaved into a bridge, an 1166 1166 * additional DAT answer may trigger kernel warnings about 1167 1167 * a packet coming from the wrong port. 1168 1168 */ ··· 1191 1191 if (!skb_new) 1192 1192 goto out; 1193 1193 1194 - skb_new->protocol = eth_type_trans(skb_new, soft_iface); 1194 + skb_new->protocol = eth_type_trans(skb_new, mesh_iface); 1195 1195 1196 1196 batadv_inc_counter(bat_priv, BATADV_CNT_RX); 1197 1197 batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES, ··· 1213 1213 /** 1214 1214 * batadv_dat_snoop_incoming_arp_request() - snoop the ARP request and try to 1215 1215 * answer using the local DAT storage 1216 - * @bat_priv: the bat priv with all the soft interface information 1216 + * @bat_priv: the bat priv with all the mesh interface information 1217 1217 * @skb: packet to check 1218 1218 * @hdr_size: size of the encapsulation header 1219 1219 * ··· 1281 1281 1282 1282 /** 1283 1283 * batadv_dat_snoop_outgoing_arp_reply() - snoop the ARP reply and fill the DHT 1284 - * @bat_priv: the bat priv with all the soft interface information 1284 + * @bat_priv: the bat priv with all the mesh interface information 1285 1285 * @skb: packet to check 1286 1286 */ 1287 1287 void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv, ··· 1324 1324 /** 1325 1325 * batadv_dat_snoop_incoming_arp_reply() - snoop the ARP reply and fill the 1326 1326 * local DAT storage only 1327 - * @bat_priv: the bat priv with all the soft interface information 1327 + * @bat_priv: the bat priv with all the mesh interface information 1328 1328 * @skb: packet to check 1329 1329 * @hdr_size: size of the encapsulation header 1330 1330 * ··· 1605 1605 /** 1606 1606 * batadv_dat_put_dhcp() - puts addresses from a DHCP packet into the DHT and 1607 1607 * DAT cache 1608 - * @bat_priv: the bat priv with all the soft interface information 1608 + * @bat_priv: the bat priv with all the mesh interface information 1609 1609 * @chaddr: the DHCP client MAC address 1610 1610 * @yiaddr: the DHCP client IP address 1611 1611 * @hw_dst: the DHCP server MAC address ··· 1690 1690 1691 1691 /** 1692 1692 * batadv_dat_snoop_outgoing_dhcp_ack() - snoop DHCPACK and fill DAT with it 1693 - * @bat_priv: the bat priv with all the soft interface information 1693 + * @bat_priv: the bat priv with all the mesh interface information 1694 1694 * @skb: the packet to snoop 1695 1695 * @proto: ethernet protocol hint (behind a potential vlan) 1696 1696 * @vid: VLAN identifier ··· 1723 1723 1724 1724 /** 1725 1725 * batadv_dat_snoop_incoming_dhcp_ack() - snoop DHCPACK and fill DAT cache 1726 - * @bat_priv: the bat priv with all the soft interface information 1726 + * @bat_priv: the bat priv with all the mesh interface information 1727 1727 * @skb: the packet to snoop 1728 1728 * @hdr_size: header size, up to the tail of the batman-adv header 1729 1729 * ··· 1771 1771 /** 1772 1772 * batadv_dat_drop_broadcast_packet() - check if an ARP request has to be 1773 1773 * dropped (because the node has already obtained the reply via DAT) or not 1774 - * @bat_priv: the bat priv with all the soft interface information 1774 + * @bat_priv: the bat priv with all the mesh interface information 1775 1775 * @forw_packet: the broadcast packet 1776 1776 * 1777 1777 * Return: true if the node can drop the packet, false otherwise.
+2 -2
net/batman-adv/distributed-arp-table.h
··· 56 56 57 57 /** 58 58 * batadv_dat_init_own_addr() - assign a DAT address to the node itself 59 - * @bat_priv: the bat priv with all the soft interface information 59 + * @bat_priv: the bat priv with all the mesh interface information 60 60 * @primary_if: a pointer to the primary interface 61 61 */ 62 62 static inline void ··· 77 77 78 78 /** 79 79 * batadv_dat_inc_counter() - increment the correct DAT packet counter 80 - * @bat_priv: the bat priv with all the soft interface information 80 + * @bat_priv: the bat priv with all the mesh interface information 81 81 * @subtype: the 4addr subtype of the packet to be counted 82 82 * 83 83 * Updates the ethtool statistics for the received packet if it is a DAT subtype
+1 -1
net/batman-adv/fragmentation.c
··· 349 349 struct batadv_hard_iface *recv_if, 350 350 struct batadv_orig_node *orig_node_src) 351 351 { 352 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 352 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 353 353 struct batadv_neigh_node *neigh_node = NULL; 354 354 struct batadv_frag_packet *packet; 355 355 u16 total_size;
+19 -19
net/batman-adv/gateway_client.c
··· 71 71 72 72 /** 73 73 * batadv_gw_get_selected_gw_node() - Get currently selected gateway 74 - * @bat_priv: the bat priv with all the soft interface information 74 + * @bat_priv: the bat priv with all the mesh interface information 75 75 * 76 76 * Return: selected gateway (with increased refcnt), NULL on errors 77 77 */ ··· 95 95 96 96 /** 97 97 * batadv_gw_get_selected_orig() - Get originator of currently selected gateway 98 - * @bat_priv: the bat priv with all the soft interface information 98 + * @bat_priv: the bat priv with all the mesh interface information 99 99 * 100 100 * Return: orig_node of selected gateway (with increased refcnt), NULL on errors 101 101 */ ··· 144 144 145 145 /** 146 146 * batadv_gw_reselect() - force a gateway reselection 147 - * @bat_priv: the bat priv with all the soft interface information 147 + * @bat_priv: the bat priv with all the mesh interface information 148 148 * 149 149 * Set a flag to remind the GW component to perform a new gateway reselection. 150 150 * However this function does not ensure that the current gateway is going to be ··· 160 160 161 161 /** 162 162 * batadv_gw_check_client_stop() - check if client mode has been switched off 163 - * @bat_priv: the bat priv with all the soft interface information 163 + * @bat_priv: the bat priv with all the mesh interface information 164 164 * 165 165 * This function assumes the caller has checked that the gw state *is actually 166 166 * changing*. This function is not supposed to be called when there is no state ··· 192 192 193 193 /** 194 194 * batadv_gw_election() - Elect the best gateway 195 - * @bat_priv: the bat priv with all the soft interface information 195 + * @bat_priv: the bat priv with all the mesh interface information 196 196 */ 197 197 void batadv_gw_election(struct batadv_priv *bat_priv) 198 198 { ··· 280 280 281 281 /** 282 282 * batadv_gw_check_election() - Elect orig node as best gateway when eligible 283 - * @bat_priv: the bat priv with all the soft interface information 283 + * @bat_priv: the bat priv with all the mesh interface information 284 284 * @orig_node: orig node which is to be checked 285 285 */ 286 286 void batadv_gw_check_election(struct batadv_priv *bat_priv, ··· 314 314 315 315 /** 316 316 * batadv_gw_node_add() - add gateway node to list of available gateways 317 - * @bat_priv: the bat priv with all the soft interface information 317 + * @bat_priv: the bat priv with all the mesh interface information 318 318 * @orig_node: originator announcing gateway capabilities 319 319 * @gateway: announced bandwidth information 320 320 * ··· 361 361 362 362 /** 363 363 * batadv_gw_node_get() - retrieve gateway node from list of available gateways 364 - * @bat_priv: the bat priv with all the soft interface information 364 + * @bat_priv: the bat priv with all the mesh interface information 365 365 * @orig_node: originator announcing gateway capabilities 366 366 * 367 367 * Return: gateway node if found or NULL otherwise. ··· 391 391 /** 392 392 * batadv_gw_node_update() - update list of available gateways with changed 393 393 * bandwidth information 394 - * @bat_priv: the bat priv with all the soft interface information 394 + * @bat_priv: the bat priv with all the mesh interface information 395 395 * @orig_node: originator announcing gateway capabilities 396 396 * @gateway: announced bandwidth information 397 397 */ ··· 458 458 459 459 /** 460 460 * batadv_gw_node_delete() - Remove orig_node from gateway list 461 - * @bat_priv: the bat priv with all the soft interface information 461 + * @bat_priv: the bat priv with all the mesh interface information 462 462 * @orig_node: orig node which is currently in process of being removed 463 463 */ 464 464 void batadv_gw_node_delete(struct batadv_priv *bat_priv, ··· 473 473 } 474 474 475 475 /** 476 - * batadv_gw_node_free() - Free gateway information from soft interface 477 - * @bat_priv: the bat priv with all the soft interface information 476 + * batadv_gw_node_free() - Free gateway information from mesh interface 477 + * @bat_priv: the bat priv with all the mesh interface information 478 478 */ 479 479 void batadv_gw_node_free(struct batadv_priv *bat_priv) 480 480 { ··· 501 501 int batadv_gw_dump(struct sk_buff *msg, struct netlink_callback *cb) 502 502 { 503 503 struct batadv_hard_iface *primary_if = NULL; 504 - struct net_device *soft_iface; 504 + struct net_device *mesh_iface; 505 505 struct batadv_priv *bat_priv; 506 506 int ret; 507 507 508 - soft_iface = batadv_netlink_get_softif(cb); 509 - if (IS_ERR(soft_iface)) 510 - return PTR_ERR(soft_iface); 508 + mesh_iface = batadv_netlink_get_meshif(cb); 509 + if (IS_ERR(mesh_iface)) 510 + return PTR_ERR(mesh_iface); 511 511 512 - bat_priv = netdev_priv(soft_iface); 512 + bat_priv = netdev_priv(mesh_iface); 513 513 514 514 primary_if = batadv_primary_if_get_selected(bat_priv); 515 515 if (!primary_if || primary_if->if_status != BATADV_IF_ACTIVE) { ··· 528 528 529 529 out: 530 530 batadv_hardif_put(primary_if); 531 - dev_put(soft_iface); 531 + dev_put(mesh_iface); 532 532 533 533 return ret; 534 534 } ··· 657 657 /** 658 658 * batadv_gw_out_of_range() - check if the dhcp request destination is the best 659 659 * gateway 660 - * @bat_priv: the bat priv with all the soft interface information 660 + * @bat_priv: the bat priv with all the mesh interface information 661 661 * @skb: the outgoing packet 662 662 * 663 663 * Check if the skb is a DHCP request and if it is sent to the current best GW
+4 -4
net/batman-adv/gateway_common.c
··· 20 20 /** 21 21 * batadv_gw_tvlv_container_update() - update the gw tvlv container after 22 22 * gateway setting change 23 - * @bat_priv: the bat priv with all the soft interface information 23 + * @bat_priv: the bat priv with all the mesh interface information 24 24 */ 25 25 void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv) 26 26 { ··· 48 48 49 49 /** 50 50 * batadv_gw_tvlv_ogm_handler_v1() - process incoming gateway tvlv container 51 - * @bat_priv: the bat priv with all the soft interface information 51 + * @bat_priv: the bat priv with all the mesh interface information 52 52 * @orig: the orig_node of the ogm 53 53 * @flags: flags indicating the tvlv state (see batadv_tvlv_handler_flags) 54 54 * @tvlv_value: tvlv buffer containing the gateway data ··· 89 89 90 90 /** 91 91 * batadv_gw_init() - initialise the gateway handling internals 92 - * @bat_priv: the bat priv with all the soft interface information 92 + * @bat_priv: the bat priv with all the mesh interface information 93 93 */ 94 94 void batadv_gw_init(struct batadv_priv *bat_priv) 95 95 { ··· 105 105 106 106 /** 107 107 * batadv_gw_free() - free the gateway handling internals 108 - * @bat_priv: the bat priv with all the soft interface information 108 + * @bat_priv: the bat priv with all the mesh interface information 109 109 */ 110 110 void batadv_gw_free(struct batadv_priv *bat_priv) 111 111 {
+76 -82
net/batman-adv/hard-interface.c
··· 36 36 #include "distributed-arp-table.h" 37 37 #include "gateway_client.h" 38 38 #include "log.h" 39 + #include "mesh-interface.h" 39 40 #include "originator.h" 40 41 #include "send.h" 41 - #include "soft-interface.h" 42 42 #include "translation-table.h" 43 43 44 44 /** ··· 51 51 struct batadv_hard_iface *hard_iface; 52 52 53 53 hard_iface = container_of(ref, struct batadv_hard_iface, refcount); 54 - dev_put(hard_iface->net_dev); 54 + netdev_put(hard_iface->net_dev, &hard_iface->dev_tracker); 55 55 56 56 kfree_rcu(hard_iface, rcu); 57 57 } ··· 141 141 * is important to prevent this new interface from being used to create a new 142 142 * mesh network (this behaviour would lead to a batman-over-batman 143 143 * configuration). This function recursively checks all the fathers of the 144 - * device passed as argument looking for a batman-adv soft interface. 144 + * device passed as argument looking for a batman-adv mesh interface. 145 145 * 146 146 * Return: true if the device is descendant of a batman-adv mesh interface (or 147 147 * if it is a batman-adv interface itself), false otherwise ··· 155 155 bool ret; 156 156 157 157 /* check if this is a batman-adv mesh interface */ 158 - if (batadv_softif_is_valid(net_dev)) 158 + if (batadv_meshif_is_valid(net_dev)) 159 159 return true; 160 160 161 161 iflink = dev_get_iflink(net_dev); ··· 233 233 } 234 234 235 235 hard_iface = batadv_hardif_get_by_netdev(netdev); 236 - if (!hard_iface || !hard_iface->soft_iface) 236 + if (!hard_iface || !hard_iface->mesh_iface) 237 237 goto out; 238 238 239 - net = dev_net(hard_iface->soft_iface); 239 + net = dev_net(hard_iface->mesh_iface); 240 240 real_net = batadv_getlink_net(netdev, net); 241 241 242 242 /* iflink to itself, most likely physical device */ ··· 438 438 } 439 439 440 440 static struct batadv_hard_iface * 441 - batadv_hardif_get_active(const struct net_device *soft_iface) 441 + batadv_hardif_get_active(const struct net_device *mesh_iface) 442 442 { 443 443 struct batadv_hard_iface *hard_iface; 444 444 445 445 rcu_read_lock(); 446 446 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { 447 - if (hard_iface->soft_iface != soft_iface) 447 + if (hard_iface->mesh_iface != mesh_iface) 448 448 continue; 449 449 450 450 if (hard_iface->if_status == BATADV_IF_ACTIVE && ··· 532 532 533 533 /** 534 534 * batadv_hardif_recalc_extra_skbroom() - Recalculate skbuff extra head/tailroom 535 - * @soft_iface: netdev struct of the mesh interface 535 + * @mesh_iface: netdev struct of the mesh interface 536 536 */ 537 - static void batadv_hardif_recalc_extra_skbroom(struct net_device *soft_iface) 537 + static void batadv_hardif_recalc_extra_skbroom(struct net_device *mesh_iface) 538 538 { 539 539 const struct batadv_hard_iface *hard_iface; 540 540 unsigned short lower_header_len = ETH_HLEN; ··· 547 547 if (hard_iface->if_status == BATADV_IF_NOT_IN_USE) 548 548 continue; 549 549 550 - if (hard_iface->soft_iface != soft_iface) 550 + if (hard_iface->mesh_iface != mesh_iface) 551 551 continue; 552 552 553 553 lower_header_len = max_t(unsigned short, lower_header_len, ··· 567 567 /* fragmentation headers don't strip the unicast/... header */ 568 568 needed_headroom += sizeof(struct batadv_frag_packet); 569 569 570 - soft_iface->needed_headroom = needed_headroom; 571 - soft_iface->needed_tailroom = lower_tailroom; 570 + mesh_iface->needed_headroom = needed_headroom; 571 + mesh_iface->needed_tailroom = lower_tailroom; 572 572 } 573 573 574 574 /** 575 - * batadv_hardif_min_mtu() - Calculate maximum MTU for soft interface 576 - * @soft_iface: netdev struct of the soft interface 575 + * batadv_hardif_min_mtu() - Calculate maximum MTU for mesh interface 576 + * @mesh_iface: netdev struct of the mesh interface 577 577 * 578 - * Return: MTU for the soft-interface (limited by the minimal MTU of all active 578 + * Return: MTU for the mesh-interface (limited by the minimal MTU of all active 579 579 * slave interfaces) 580 580 */ 581 - int batadv_hardif_min_mtu(struct net_device *soft_iface) 581 + int batadv_hardif_min_mtu(struct net_device *mesh_iface) 582 582 { 583 - struct batadv_priv *bat_priv = netdev_priv(soft_iface); 583 + struct batadv_priv *bat_priv = netdev_priv(mesh_iface); 584 584 const struct batadv_hard_iface *hard_iface; 585 585 int min_mtu = INT_MAX; 586 586 ··· 590 590 hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED) 591 591 continue; 592 592 593 - if (hard_iface->soft_iface != soft_iface) 593 + if (hard_iface->mesh_iface != mesh_iface) 594 594 continue; 595 595 596 596 min_mtu = min_t(int, hard_iface->net_dev->mtu, min_mtu); ··· 616 616 */ 617 617 atomic_set(&bat_priv->packet_size_max, min_mtu); 618 618 619 - /* the real soft-interface MTU is computed by removing the payload 619 + /* the real mesh-interface MTU is computed by removing the payload 620 620 * overhead from the maximum amount of bytes that was just computed. 621 - * 622 - * However batman-adv does not support MTUs bigger than ETH_DATA_LEN 623 621 */ 624 - return min_t(int, min_mtu - batadv_max_header_len(), ETH_DATA_LEN); 622 + return min_t(int, min_mtu - batadv_max_header_len(), BATADV_MAX_MTU); 625 623 } 626 624 627 625 /** 628 626 * batadv_update_min_mtu() - Adjusts the MTU if a new interface with a smaller 629 627 * MTU appeared 630 - * @soft_iface: netdev struct of the soft interface 628 + * @mesh_iface: netdev struct of the mesh interface 631 629 */ 632 - void batadv_update_min_mtu(struct net_device *soft_iface) 630 + void batadv_update_min_mtu(struct net_device *mesh_iface) 633 631 { 634 - struct batadv_priv *bat_priv = netdev_priv(soft_iface); 632 + struct batadv_priv *bat_priv = netdev_priv(mesh_iface); 635 633 int limit_mtu; 636 634 int mtu; 637 635 638 - mtu = batadv_hardif_min_mtu(soft_iface); 636 + mtu = batadv_hardif_min_mtu(mesh_iface); 639 637 640 638 if (bat_priv->mtu_set_by_user) 641 639 limit_mtu = bat_priv->mtu_set_by_user; ··· 641 643 limit_mtu = ETH_DATA_LEN; 642 644 643 645 mtu = min(mtu, limit_mtu); 644 - dev_set_mtu(soft_iface, mtu); 646 + dev_set_mtu(mesh_iface, mtu); 645 647 646 648 /* Check if the local translate table should be cleaned up to match a 647 649 * new (and smaller) MTU. 648 650 */ 649 - batadv_tt_local_resize_to_mtu(soft_iface); 651 + batadv_tt_local_resize_to_mtu(mesh_iface); 650 652 } 651 653 652 654 static void ··· 658 660 if (hard_iface->if_status != BATADV_IF_INACTIVE) 659 661 goto out; 660 662 661 - bat_priv = netdev_priv(hard_iface->soft_iface); 663 + bat_priv = netdev_priv(hard_iface->mesh_iface); 662 664 663 665 bat_priv->algo_ops->iface.update_mac(hard_iface); 664 666 hard_iface->if_status = BATADV_IF_TO_BE_ACTIVATED; ··· 670 672 if (!primary_if) 671 673 batadv_primary_if_select(bat_priv, hard_iface); 672 674 673 - batadv_info(hard_iface->soft_iface, "Interface activated: %s\n", 675 + batadv_info(hard_iface->mesh_iface, "Interface activated: %s\n", 674 676 hard_iface->net_dev->name); 675 677 676 - batadv_update_min_mtu(hard_iface->soft_iface); 678 + batadv_update_min_mtu(hard_iface->mesh_iface); 677 679 678 680 if (bat_priv->algo_ops->iface.activate) 679 681 bat_priv->algo_ops->iface.activate(hard_iface); ··· 691 693 692 694 hard_iface->if_status = BATADV_IF_INACTIVE; 693 695 694 - batadv_info(hard_iface->soft_iface, "Interface deactivated: %s\n", 696 + batadv_info(hard_iface->mesh_iface, "Interface deactivated: %s\n", 695 697 hard_iface->net_dev->name); 696 698 697 - batadv_update_min_mtu(hard_iface->soft_iface); 699 + batadv_update_min_mtu(hard_iface->mesh_iface); 698 700 } 699 701 700 702 /** 701 - * batadv_hardif_enable_interface() - Enslave hard interface to soft interface 702 - * @hard_iface: hard interface to add to soft interface 703 - * @soft_iface: netdev struct of the mesh interface 703 + * batadv_hardif_enable_interface() - Enslave hard interface to mesh interface 704 + * @hard_iface: hard interface to add to mesh interface 705 + * @mesh_iface: netdev struct of the mesh interface 704 706 * 705 707 * Return: 0 on success or negative error number in case of failure 706 708 */ 707 709 int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, 708 - struct net_device *soft_iface) 710 + struct net_device *mesh_iface) 709 711 { 710 712 struct batadv_priv *bat_priv; 711 713 __be16 ethertype = htons(ETH_P_BATMAN); ··· 715 717 int ret; 716 718 717 719 hardif_mtu = READ_ONCE(hard_iface->net_dev->mtu); 718 - required_mtu = READ_ONCE(soft_iface->mtu) + max_header_len; 720 + required_mtu = READ_ONCE(mesh_iface->mtu) + max_header_len; 719 721 720 722 if (hardif_mtu < ETH_MIN_MTU + max_header_len) 721 723 return -EINVAL; ··· 725 727 726 728 kref_get(&hard_iface->refcount); 727 729 728 - dev_hold(soft_iface); 729 - hard_iface->soft_iface = soft_iface; 730 - bat_priv = netdev_priv(hard_iface->soft_iface); 730 + dev_hold(mesh_iface); 731 + netdev_hold(mesh_iface, &hard_iface->meshif_dev_tracker, GFP_ATOMIC); 732 + hard_iface->mesh_iface = mesh_iface; 733 + bat_priv = netdev_priv(hard_iface->mesh_iface); 731 734 732 735 ret = netdev_master_upper_dev_link(hard_iface->net_dev, 733 - soft_iface, NULL, NULL, NULL); 736 + mesh_iface, NULL, NULL, NULL); 734 737 if (ret) 735 738 goto err_dev; 736 739 ··· 747 748 hard_iface->batman_adv_ptype.dev = hard_iface->net_dev; 748 749 dev_add_pack(&hard_iface->batman_adv_ptype); 749 750 750 - batadv_info(hard_iface->soft_iface, "Adding interface: %s\n", 751 + batadv_info(hard_iface->mesh_iface, "Adding interface: %s\n", 751 752 hard_iface->net_dev->name); 752 753 753 754 if (atomic_read(&bat_priv->fragmentation) && 754 755 hardif_mtu < required_mtu) 755 - batadv_info(hard_iface->soft_iface, 756 + batadv_info(hard_iface->mesh_iface, 756 757 "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to %i would solve the problem.\n", 757 758 hard_iface->net_dev->name, hardif_mtu, 758 759 required_mtu); 759 760 760 761 if (!atomic_read(&bat_priv->fragmentation) && 761 762 hardif_mtu < required_mtu) 762 - batadv_info(hard_iface->soft_iface, 763 + batadv_info(hard_iface->mesh_iface, 763 764 "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. If you experience problems getting traffic through try increasing the MTU to %i.\n", 764 765 hard_iface->net_dev->name, hardif_mtu, 765 766 required_mtu); ··· 767 768 if (batadv_hardif_is_iface_up(hard_iface)) 768 769 batadv_hardif_activate_interface(hard_iface); 769 770 else 770 - batadv_err(hard_iface->soft_iface, 771 + batadv_err(hard_iface->mesh_iface, 771 772 "Not using interface %s (retrying later): interface not active\n", 772 773 hard_iface->net_dev->name); 773 774 774 - batadv_hardif_recalc_extra_skbroom(soft_iface); 775 + batadv_hardif_recalc_extra_skbroom(mesh_iface); 775 776 776 777 if (bat_priv->algo_ops->iface.enabled) 777 778 bat_priv->algo_ops->iface.enabled(hard_iface); ··· 780 781 return 0; 781 782 782 783 err_upper: 783 - netdev_upper_dev_unlink(hard_iface->net_dev, soft_iface); 784 + netdev_upper_dev_unlink(hard_iface->net_dev, mesh_iface); 784 785 err_dev: 785 - hard_iface->soft_iface = NULL; 786 - dev_put(soft_iface); 786 + hard_iface->mesh_iface = NULL; 787 + netdev_put(mesh_iface, &hard_iface->meshif_dev_tracker); 787 788 batadv_hardif_put(hard_iface); 788 789 return ret; 789 790 } 790 791 791 792 /** 792 - * batadv_hardif_cnt() - get number of interfaces enslaved to soft interface 793 - * @soft_iface: soft interface to check 793 + * batadv_hardif_cnt() - get number of interfaces enslaved to mesh interface 794 + * @mesh_iface: mesh interface to check 794 795 * 795 796 * This function is only using RCU for locking - the result can therefore be 796 797 * off when another function is modifying the list at the same time. The ··· 798 799 * 799 800 * Return: number of connected/enslaved hard interfaces 800 801 */ 801 - static size_t batadv_hardif_cnt(const struct net_device *soft_iface) 802 + static size_t batadv_hardif_cnt(const struct net_device *mesh_iface) 802 803 { 803 804 struct batadv_hard_iface *hard_iface; 804 805 size_t count = 0; 805 806 806 807 rcu_read_lock(); 807 808 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { 808 - if (hard_iface->soft_iface != soft_iface) 809 + if (hard_iface->mesh_iface != mesh_iface) 809 810 continue; 810 811 811 812 count++; ··· 816 817 } 817 818 818 819 /** 819 - * batadv_hardif_disable_interface() - Remove hard interface from soft interface 820 + * batadv_hardif_disable_interface() - Remove hard interface from mesh interface 820 821 * @hard_iface: hard interface to be removed 821 822 */ 822 823 void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface) 823 824 { 824 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 825 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 825 826 struct batadv_hard_iface *primary_if = NULL; 826 827 827 828 batadv_hardif_deactivate_interface(hard_iface); ··· 829 830 if (hard_iface->if_status != BATADV_IF_INACTIVE) 830 831 goto out; 831 832 832 - batadv_info(hard_iface->soft_iface, "Removing interface: %s\n", 833 + batadv_info(hard_iface->mesh_iface, "Removing interface: %s\n", 833 834 hard_iface->net_dev->name); 834 835 dev_remove_pack(&hard_iface->batman_adv_ptype); 835 836 batadv_hardif_put(hard_iface); ··· 838 839 if (hard_iface == primary_if) { 839 840 struct batadv_hard_iface *new_if; 840 841 841 - new_if = batadv_hardif_get_active(hard_iface->soft_iface); 842 + new_if = batadv_hardif_get_active(hard_iface->mesh_iface); 842 843 batadv_primary_if_select(bat_priv, new_if); 843 844 844 845 batadv_hardif_put(new_if); ··· 850 851 /* delete all references to this hard_iface */ 851 852 batadv_purge_orig_ref(bat_priv); 852 853 batadv_purge_outstanding_packets(bat_priv, hard_iface); 853 - dev_put(hard_iface->soft_iface); 854 + netdev_put(hard_iface->mesh_iface, &hard_iface->meshif_dev_tracker); 854 855 855 - netdev_upper_dev_unlink(hard_iface->net_dev, hard_iface->soft_iface); 856 - batadv_hardif_recalc_extra_skbroom(hard_iface->soft_iface); 856 + netdev_upper_dev_unlink(hard_iface->net_dev, hard_iface->mesh_iface); 857 + batadv_hardif_recalc_extra_skbroom(hard_iface->mesh_iface); 857 858 858 859 /* nobody uses this interface anymore */ 859 - if (batadv_hardif_cnt(hard_iface->soft_iface) <= 1) 860 + if (batadv_hardif_cnt(hard_iface->mesh_iface) <= 1) 860 861 batadv_gw_check_client_stop(bat_priv); 861 862 862 - hard_iface->soft_iface = NULL; 863 + hard_iface->mesh_iface = NULL; 863 864 batadv_hardif_put(hard_iface); 864 865 865 866 out: ··· 874 875 ASSERT_RTNL(); 875 876 876 877 if (!batadv_is_valid_iface(net_dev)) 877 - goto out; 878 - 879 - dev_hold(net_dev); 878 + return NULL; 880 879 881 880 hard_iface = kzalloc(sizeof(*hard_iface), GFP_ATOMIC); 882 881 if (!hard_iface) 883 - goto release_dev; 882 + return NULL; 884 883 884 + netdev_hold(net_dev, &hard_iface->dev_tracker, GFP_ATOMIC); 885 885 hard_iface->net_dev = net_dev; 886 - hard_iface->soft_iface = NULL; 886 + 887 + hard_iface->mesh_iface = NULL; 887 888 hard_iface->if_status = BATADV_IF_NOT_IN_USE; 888 889 889 890 INIT_LIST_HEAD(&hard_iface->list); ··· 908 909 batadv_hardif_generation++; 909 910 910 911 return hard_iface; 911 - 912 - release_dev: 913 - dev_put(net_dev); 914 - out: 915 - return NULL; 916 912 } 917 913 918 914 static void batadv_hardif_remove_interface(struct batadv_hard_iface *hard_iface) ··· 926 932 } 927 933 928 934 /** 929 - * batadv_hard_if_event_softif() - Handle events for soft interfaces 935 + * batadv_hard_if_event_meshif() - Handle events for mesh interfaces 930 936 * @event: NETDEV_* event to handle 931 937 * @net_dev: net_device which generated an event 932 938 * 933 939 * Return: NOTIFY_* result 934 940 */ 935 - static int batadv_hard_if_event_softif(unsigned long event, 941 + static int batadv_hard_if_event_meshif(unsigned long event, 936 942 struct net_device *net_dev) 937 943 { 938 944 struct batadv_priv *bat_priv; ··· 940 946 switch (event) { 941 947 case NETDEV_REGISTER: 942 948 bat_priv = netdev_priv(net_dev); 943 - batadv_softif_create_vlan(bat_priv, BATADV_NO_FLAGS); 949 + batadv_meshif_create_vlan(bat_priv, BATADV_NO_FLAGS); 944 950 break; 945 951 } 946 952 ··· 955 961 struct batadv_hard_iface *primary_if = NULL; 956 962 struct batadv_priv *bat_priv; 957 963 958 - if (batadv_softif_is_valid(net_dev)) 959 - return batadv_hard_if_event_softif(event, net_dev); 964 + if (batadv_meshif_is_valid(net_dev)) 965 + return batadv_hard_if_event_meshif(event, net_dev); 960 966 961 967 hard_iface = batadv_hardif_get_by_netdev(net_dev); 962 968 if (!hard_iface && (event == NETDEV_REGISTER || ··· 982 988 batadv_hardif_remove_interface(hard_iface); 983 989 break; 984 990 case NETDEV_CHANGEMTU: 985 - if (hard_iface->soft_iface) 986 - batadv_update_min_mtu(hard_iface->soft_iface); 991 + if (hard_iface->mesh_iface) 992 + batadv_update_min_mtu(hard_iface->mesh_iface); 987 993 break; 988 994 case NETDEV_CHANGEADDR: 989 995 if (hard_iface->if_status == BATADV_IF_NOT_IN_USE) ··· 991 997 992 998 batadv_check_known_mac_addr(hard_iface->net_dev); 993 999 994 - bat_priv = netdev_priv(hard_iface->soft_iface); 1000 + bat_priv = netdev_priv(hard_iface->mesh_iface); 995 1001 bat_priv->algo_ops->iface.update_mac(hard_iface); 996 1002 997 1003 primary_if = batadv_primary_if_get_selected(bat_priv);
+6 -6
net/batman-adv/hard-interface.h
··· 23 23 enum batadv_hard_if_state { 24 24 /** 25 25 * @BATADV_IF_NOT_IN_USE: interface is not used as slave interface of a 26 - * batman-adv soft interface 26 + * batman-adv mesh interface 27 27 */ 28 28 BATADV_IF_NOT_IN_USE, 29 29 30 30 /** 31 - * @BATADV_IF_TO_BE_REMOVED: interface will be removed from soft 31 + * @BATADV_IF_TO_BE_REMOVED: interface will be removed from mesh 32 32 * interface 33 33 */ 34 34 BATADV_IF_TO_BE_REMOVED, ··· 74 74 struct batadv_hard_iface* 75 75 batadv_hardif_get_by_netdev(const struct net_device *net_dev); 76 76 int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, 77 - struct net_device *soft_iface); 77 + struct net_device *mesh_iface); 78 78 void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface); 79 - int batadv_hardif_min_mtu(struct net_device *soft_iface); 80 - void batadv_update_min_mtu(struct net_device *soft_iface); 79 + int batadv_hardif_min_mtu(struct net_device *mesh_iface); 80 + void batadv_update_min_mtu(struct net_device *mesh_iface); 81 81 void batadv_hardif_release(struct kref *ref); 82 82 int batadv_hardif_no_broadcast(struct batadv_hard_iface *if_outgoing, 83 83 u8 *orig_addr, u8 *orig_neigh); ··· 97 97 98 98 /** 99 99 * batadv_primary_if_get_selected() - Get reference to primary interface 100 - * @bat_priv: the bat priv with all the soft interface information 100 + * @bat_priv: the bat priv with all the mesh interface information 101 101 * 102 102 * Return: primary interface (with increased refcnt), otherwise NULL 103 103 */
+1 -1
net/batman-adv/log.c
··· 13 13 14 14 /** 15 15 * batadv_debug_log() - Add debug log entry 16 - * @bat_priv: the bat priv with all the soft interface information 16 + * @bat_priv: the bat priv with all the mesh interface information 17 17 * @fmt: format string 18 18 * 19 19 * Return: 0 on success or negative error number in case of failure
+5 -5
net/batman-adv/log.h
··· 71 71 /** 72 72 * _batadv_dbg() - Store debug output with(out) rate limiting 73 73 * @type: type of debug message 74 - * @bat_priv: the bat priv with all the soft interface information 74 + * @bat_priv: the bat priv with all the mesh interface information 75 75 * @ratelimited: whether output should be rate limited 76 76 * @fmt: format string 77 77 * @arg: variable arguments ··· 97 97 /** 98 98 * batadv_dbg() - Store debug output without rate limiting 99 99 * @type: type of debug message 100 - * @bat_priv: the bat priv with all the soft interface information 100 + * @bat_priv: the bat priv with all the mesh interface information 101 101 * @arg: format string and variable arguments 102 102 */ 103 103 #define batadv_dbg(type, bat_priv, arg...) \ ··· 106 106 /** 107 107 * batadv_dbg_ratelimited() - Store debug output with rate limiting 108 108 * @type: type of debug message 109 - * @bat_priv: the bat priv with all the soft interface information 109 + * @bat_priv: the bat priv with all the mesh interface information 110 110 * @arg: format string and variable arguments 111 111 */ 112 112 #define batadv_dbg_ratelimited(type, bat_priv, arg...) \ ··· 114 114 115 115 /** 116 116 * batadv_info() - Store message in debug buffer and print it to kmsg buffer 117 - * @net_dev: the soft interface net device 117 + * @net_dev: the mesh interface net device 118 118 * @fmt: format string 119 119 * @arg: variable arguments 120 120 */ ··· 128 128 129 129 /** 130 130 * batadv_err() - Store error in debug buffer and print it to kmsg buffer 131 - * @net_dev: the soft interface net device 131 + * @net_dev: the mesh interface net device 132 132 * @fmt: format string 133 133 * @arg: variable arguments 134 134 */
+21 -21
net/batman-adv/main.c
··· 51 51 #include "gateway_common.h" 52 52 #include "hard-interface.h" 53 53 #include "log.h" 54 + #include "mesh-interface.h" 54 55 #include "multicast.h" 55 56 #include "netlink.h" 56 57 #include "network-coding.h" 57 58 #include "originator.h" 58 59 #include "routing.h" 59 60 #include "send.h" 60 - #include "soft-interface.h" 61 61 #include "tp_meter.h" 62 62 #include "translation-table.h" 63 63 ··· 143 143 } 144 144 145 145 /** 146 - * batadv_mesh_init() - Initialize soft interface 147 - * @soft_iface: netdev struct of the soft interface 146 + * batadv_mesh_init() - Initialize mesh interface 147 + * @mesh_iface: netdev struct of the mesh interface 148 148 * 149 149 * Return: 0 on success or negative error number in case of failure 150 150 */ 151 - int batadv_mesh_init(struct net_device *soft_iface) 151 + int batadv_mesh_init(struct net_device *mesh_iface) 152 152 { 153 - struct batadv_priv *bat_priv = netdev_priv(soft_iface); 153 + struct batadv_priv *bat_priv = netdev_priv(mesh_iface); 154 154 int ret; 155 155 156 156 spin_lock_init(&bat_priv->forw_bat_list_lock); ··· 167 167 #endif 168 168 spin_lock_init(&bat_priv->tvlv.container_list_lock); 169 169 spin_lock_init(&bat_priv->tvlv.handler_list_lock); 170 - spin_lock_init(&bat_priv->softif_vlan_list_lock); 170 + spin_lock_init(&bat_priv->meshif_vlan_list_lock); 171 171 spin_lock_init(&bat_priv->tp_list_lock); 172 172 173 173 INIT_HLIST_HEAD(&bat_priv->forw_bat_list); ··· 186 186 #endif 187 187 INIT_HLIST_HEAD(&bat_priv->tvlv.container_list); 188 188 INIT_HLIST_HEAD(&bat_priv->tvlv.handler_list); 189 - INIT_HLIST_HEAD(&bat_priv->softif_vlan_list); 189 + INIT_HLIST_HEAD(&bat_priv->meshif_vlan_list); 190 190 INIT_HLIST_HEAD(&bat_priv->tp_list); 191 191 192 192 bat_priv->gw.generation = 0; ··· 253 253 } 254 254 255 255 /** 256 - * batadv_mesh_free() - Deinitialize soft interface 257 - * @soft_iface: netdev struct of the soft interface 256 + * batadv_mesh_free() - Deinitialize mesh interface 257 + * @mesh_iface: netdev struct of the mesh interface 258 258 */ 259 - void batadv_mesh_free(struct net_device *soft_iface) 259 + void batadv_mesh_free(struct net_device *mesh_iface) 260 260 { 261 - struct batadv_priv *bat_priv = netdev_priv(soft_iface); 261 + struct batadv_priv *bat_priv = netdev_priv(mesh_iface); 262 262 263 263 atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING); 264 264 ··· 297 297 /** 298 298 * batadv_is_my_mac() - check if the given mac address belongs to any of the 299 299 * real interfaces in the current mesh 300 - * @bat_priv: the bat priv with all the soft interface information 300 + * @bat_priv: the bat priv with all the mesh interface information 301 301 * @addr: the address to check 302 302 * 303 303 * Return: 'true' if the mac address was found, false otherwise. ··· 312 312 if (hard_iface->if_status != BATADV_IF_ACTIVE) 313 313 continue; 314 314 315 - if (hard_iface->soft_iface != bat_priv->soft_iface) 315 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 316 316 continue; 317 317 318 318 if (batadv_compare_eth(hard_iface->net_dev->dev_addr, addr)) { ··· 457 457 if (unlikely(skb->mac_len != ETH_HLEN || !skb_mac_header(skb))) 458 458 goto err_free; 459 459 460 - if (!hard_iface->soft_iface) 460 + if (!hard_iface->mesh_iface) 461 461 goto err_free; 462 462 463 - bat_priv = netdev_priv(hard_iface->soft_iface); 463 + bat_priv = netdev_priv(hard_iface->mesh_iface); 464 464 465 465 if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) 466 466 goto err_free; ··· 651 651 652 652 /** 653 653 * batadv_vlan_ap_isola_get() - return AP isolation status for the given vlan 654 - * @bat_priv: the bat priv with all the soft interface information 654 + * @bat_priv: the bat priv with all the mesh interface information 655 655 * @vid: the VLAN identifier for which the AP isolation attributed as to be 656 656 * looked up 657 657 * ··· 661 661 bool batadv_vlan_ap_isola_get(struct batadv_priv *bat_priv, unsigned short vid) 662 662 { 663 663 bool ap_isolation_enabled = false; 664 - struct batadv_softif_vlan *vlan; 664 + struct batadv_meshif_vlan *vlan; 665 665 666 666 /* if the AP isolation is requested on a VLAN, then check for its 667 667 * setting in the proper VLAN private data structure 668 668 */ 669 - vlan = batadv_softif_vlan_get(bat_priv, vid); 669 + vlan = batadv_meshif_vlan_get(bat_priv, vid); 670 670 if (vlan) { 671 671 ap_isolation_enabled = atomic_read(&vlan->ap_isolation); 672 - batadv_softif_vlan_put(vlan); 672 + batadv_meshif_vlan_put(vlan); 673 673 } 674 674 675 675 return ap_isolation_enabled; ··· 677 677 678 678 /** 679 679 * batadv_throw_uevent() - Send an uevent with batman-adv specific env data 680 - * @bat_priv: the bat priv with all the soft interface information 680 + * @bat_priv: the bat priv with all the mesh interface information 681 681 * @type: subsystem type of event. Stored in uevent's BATTYPE 682 682 * @action: action type of event. Stored in uevent's BATACTION 683 683 * @data: string with additional information to the event (ignored for ··· 692 692 struct kobject *bat_kobj; 693 693 char *uevent_env[4] = { NULL, NULL, NULL, NULL }; 694 694 695 - bat_kobj = &bat_priv->soft_iface->dev.kobj; 695 + bat_kobj = &bat_priv->mesh_iface->dev.kobj; 696 696 697 697 uevent_env[0] = kasprintf(GFP_ATOMIC, 698 698 "%s%s", BATADV_UEV_TYPE_VAR,
+12 -12
net/batman-adv/main.h
··· 13 13 #define BATADV_DRIVER_DEVICE "batman-adv" 14 14 15 15 #ifndef BATADV_SOURCE_VERSION 16 - #define BATADV_SOURCE_VERSION "2025.0" 16 + #define BATADV_SOURCE_VERSION "2025.1" 17 17 #endif 18 18 19 19 /* B.A.T.M.A.N. parameters */ ··· 21 21 #define BATADV_TQ_MAX_VALUE 255 22 22 #define BATADV_THROUGHPUT_MAX_VALUE 0xFFFFFFFF 23 23 #define BATADV_JITTER 20 24 + 25 + #define BATADV_MAX_MTU (ETH_MAX_MTU - batadv_max_header_len()) 24 26 25 27 /* Time To Live of broadcast messages */ 26 28 #define BATADV_TTL 50 ··· 104 102 */ 105 103 #define BATADV_TQ_SIMILARITY_THRESHOLD 50 106 104 107 - /* should not be bigger than 512 bytes or change the size of 108 - * forw_packet->direct_link_flags 109 - */ 105 + #define BATADV_MAX_AGGREGATION_PACKETS 32 110 106 #define BATADV_MAX_AGGREGATION_BYTES 512 111 107 #define BATADV_MAX_AGGREGATION_MS 100 112 108 ··· 129 129 #define BATADV_TP_MAX_NUM 5 130 130 131 131 /** 132 - * enum batadv_mesh_state - State of a soft interface 132 + * enum batadv_mesh_state - State of a mesh interface 133 133 */ 134 134 enum batadv_mesh_state { 135 - /** @BATADV_MESH_INACTIVE: soft interface is not yet running */ 135 + /** @BATADV_MESH_INACTIVE: mesh interface is not yet running */ 136 136 BATADV_MESH_INACTIVE, 137 137 138 138 /** @BATADV_MESH_ACTIVE: interface is up and running */ ··· 238 238 extern unsigned char batadv_broadcast_addr[]; 239 239 extern struct workqueue_struct *batadv_event_workqueue; 240 240 241 - int batadv_mesh_init(struct net_device *soft_iface); 242 - void batadv_mesh_free(struct net_device *soft_iface); 241 + int batadv_mesh_init(struct net_device *mesh_iface); 242 + void batadv_mesh_free(struct net_device *mesh_iface); 243 243 bool batadv_is_my_mac(struct batadv_priv *bat_priv, const u8 *addr); 244 244 int batadv_max_header_len(void); 245 245 void batadv_skb_set_priority(struct sk_buff *skb, int offset); ··· 345 345 #define batadv_seq_after(x, y) batadv_seq_before(y, x) 346 346 347 347 /** 348 - * batadv_add_counter() - Add to per cpu statistics counter of soft interface 349 - * @bat_priv: the bat priv with all the soft interface information 348 + * batadv_add_counter() - Add to per cpu statistics counter of mesh interface 349 + * @bat_priv: the bat priv with all the mesh interface information 350 350 * @idx: counter index which should be modified 351 351 * @count: value to increase counter by 352 352 * ··· 359 359 } 360 360 361 361 /** 362 - * batadv_inc_counter() - Increase per cpu statistics counter of soft interface 363 - * @b: the bat priv with all the soft interface information 362 + * batadv_inc_counter() - Increase per cpu statistics counter of mesh interface 363 + * @b: the bat priv with all the mesh interface information 364 364 * @i: counter index which should be modified 365 365 */ 366 366 #define batadv_inc_counter(b, i) batadv_add_counter(b, i, 1)
+42
net/batman-adv/mesh-interface.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* Copyright (C) B.A.T.M.A.N. contributors: 3 + * 4 + * Marek Lindner 5 + */ 6 + 7 + #ifndef _NET_BATMAN_ADV_MESH_INTERFACE_H_ 8 + #define _NET_BATMAN_ADV_MESH_INTERFACE_H_ 9 + 10 + #include "main.h" 11 + 12 + #include <linux/kref.h> 13 + #include <linux/netdevice.h> 14 + #include <linux/skbuff.h> 15 + #include <linux/types.h> 16 + #include <net/rtnetlink.h> 17 + 18 + int batadv_skb_head_push(struct sk_buff *skb, unsigned int len); 19 + void batadv_interface_rx(struct net_device *mesh_iface, 20 + struct sk_buff *skb, int hdr_size, 21 + struct batadv_orig_node *orig_node); 22 + bool batadv_meshif_is_valid(const struct net_device *net_dev); 23 + extern struct rtnl_link_ops batadv_link_ops; 24 + int batadv_meshif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid); 25 + void batadv_meshif_vlan_release(struct kref *ref); 26 + struct batadv_meshif_vlan *batadv_meshif_vlan_get(struct batadv_priv *bat_priv, 27 + unsigned short vid); 28 + 29 + /** 30 + * batadv_meshif_vlan_put() - decrease the vlan object refcounter and 31 + * possibly release it 32 + * @vlan: the vlan object to release 33 + */ 34 + static inline void batadv_meshif_vlan_put(struct batadv_meshif_vlan *vlan) 35 + { 36 + if (!vlan) 37 + return; 38 + 39 + kref_put(&vlan->refcount, batadv_meshif_vlan_release); 40 + } 41 + 42 + #endif /* _NET_BATMAN_ADV_MESH_INTERFACE_H_ */
+91 -91
net/batman-adv/multicast.c
··· 63 63 64 64 /** 65 65 * batadv_mcast_start_timer() - schedule the multicast periodic worker 66 - * @bat_priv: the bat priv with all the soft interface information 66 + * @bat_priv: the bat priv with all the mesh interface information 67 67 */ 68 68 static void batadv_mcast_start_timer(struct batadv_priv *bat_priv) 69 69 { ··· 72 72 } 73 73 74 74 /** 75 - * batadv_mcast_get_bridge() - get the bridge on top of the softif if it exists 76 - * @soft_iface: netdev struct of the mesh interface 75 + * batadv_mcast_get_bridge() - get the bridge on top of the meshif if it exists 76 + * @mesh_iface: netdev struct of the mesh interface 77 77 * 78 - * If the given soft interface has a bridge on top then the refcount 78 + * If the given mesh interface has a bridge on top then the refcount 79 79 * of the according net device is increased. 80 80 * 81 81 * Return: NULL if no such bridge exists. Otherwise the net device of the 82 82 * bridge. 83 83 */ 84 - static struct net_device *batadv_mcast_get_bridge(struct net_device *soft_iface) 84 + static struct net_device *batadv_mcast_get_bridge(struct net_device *mesh_iface) 85 85 { 86 - struct net_device *upper = soft_iface; 86 + struct net_device *upper = mesh_iface; 87 87 88 88 rcu_read_lock(); 89 89 do { ··· 97 97 } 98 98 99 99 /** 100 - * batadv_mcast_mla_rtr_flags_softif_get_ipv4() - get mcast router flags from 100 + * batadv_mcast_mla_rtr_flags_meshif_get_ipv4() - get mcast router flags from 101 101 * node for IPv4 102 102 * @dev: the interface to check 103 103 * ··· 107 107 * 108 108 * Return: BATADV_NO_FLAGS if present, BATADV_MCAST_WANT_NO_RTR4 otherwise. 109 109 */ 110 - static u8 batadv_mcast_mla_rtr_flags_softif_get_ipv4(struct net_device *dev) 110 + static u8 batadv_mcast_mla_rtr_flags_meshif_get_ipv4(struct net_device *dev) 111 111 { 112 112 struct in_device *in_dev = __in_dev_get_rcu(dev); 113 113 ··· 118 118 } 119 119 120 120 /** 121 - * batadv_mcast_mla_rtr_flags_softif_get_ipv6() - get mcast router flags from 121 + * batadv_mcast_mla_rtr_flags_meshif_get_ipv6() - get mcast router flags from 122 122 * node for IPv6 123 123 * @dev: the interface to check 124 124 * ··· 129 129 * Return: BATADV_NO_FLAGS if present, BATADV_MCAST_WANT_NO_RTR6 otherwise. 130 130 */ 131 131 #if IS_ENABLED(CONFIG_IPV6_MROUTE) 132 - static u8 batadv_mcast_mla_rtr_flags_softif_get_ipv6(struct net_device *dev) 132 + static u8 batadv_mcast_mla_rtr_flags_meshif_get_ipv6(struct net_device *dev) 133 133 { 134 134 struct inet6_dev *in6_dev = __in6_dev_get(dev); 135 135 ··· 140 140 } 141 141 #else 142 142 static inline u8 143 - batadv_mcast_mla_rtr_flags_softif_get_ipv6(struct net_device *dev) 143 + batadv_mcast_mla_rtr_flags_meshif_get_ipv6(struct net_device *dev) 144 144 { 145 145 return BATADV_MCAST_WANT_NO_RTR6; 146 146 } 147 147 #endif 148 148 149 149 /** 150 - * batadv_mcast_mla_rtr_flags_softif_get() - get mcast router flags from node 151 - * @bat_priv: the bat priv with all the soft interface information 152 - * @bridge: bridge interface on top of the soft_iface if present, 150 + * batadv_mcast_mla_rtr_flags_meshif_get() - get mcast router flags from node 151 + * @bat_priv: the bat priv with all the mesh interface information 152 + * @bridge: bridge interface on top of the mesh_iface if present, 153 153 * otherwise pass NULL 154 154 * 155 155 * Checks the presence of IPv4 and IPv6 multicast routers on this ··· 161 161 * BATADV_MCAST_WANT_NO_RTR6: No IPv6 multicast router is present 162 162 * The former two OR'd: no multicast router is present 163 163 */ 164 - static u8 batadv_mcast_mla_rtr_flags_softif_get(struct batadv_priv *bat_priv, 164 + static u8 batadv_mcast_mla_rtr_flags_meshif_get(struct batadv_priv *bat_priv, 165 165 struct net_device *bridge) 166 166 { 167 - struct net_device *dev = bridge ? bridge : bat_priv->soft_iface; 167 + struct net_device *dev = bridge ? bridge : bat_priv->mesh_iface; 168 168 u8 flags = BATADV_NO_FLAGS; 169 169 170 170 rcu_read_lock(); 171 171 172 - flags |= batadv_mcast_mla_rtr_flags_softif_get_ipv4(dev); 173 - flags |= batadv_mcast_mla_rtr_flags_softif_get_ipv6(dev); 172 + flags |= batadv_mcast_mla_rtr_flags_meshif_get_ipv4(dev); 173 + flags |= batadv_mcast_mla_rtr_flags_meshif_get_ipv6(dev); 174 174 175 175 rcu_read_unlock(); 176 176 ··· 179 179 180 180 /** 181 181 * batadv_mcast_mla_rtr_flags_bridge_get() - get mcast router flags from bridge 182 - * @bat_priv: the bat priv with all the soft interface information 183 - * @bridge: bridge interface on top of the soft_iface if present, 182 + * @bat_priv: the bat priv with all the mesh interface information 183 + * @bridge: bridge interface on top of the mesh_iface if present, 184 184 * otherwise pass NULL 185 185 * 186 186 * Checks the presence of IPv4 and IPv6 multicast routers behind a bridge. ··· 194 194 static u8 batadv_mcast_mla_rtr_flags_bridge_get(struct batadv_priv *bat_priv, 195 195 struct net_device *bridge) 196 196 { 197 - struct net_device *dev = bat_priv->soft_iface; 197 + struct net_device *dev = bat_priv->mesh_iface; 198 198 u8 flags = BATADV_NO_FLAGS; 199 199 200 200 if (!bridge) ··· 210 210 211 211 /** 212 212 * batadv_mcast_mla_rtr_flags_get() - get multicast router flags 213 - * @bat_priv: the bat priv with all the soft interface information 214 - * @bridge: bridge interface on top of the soft_iface if present, 213 + * @bat_priv: the bat priv with all the mesh interface information 214 + * @bridge: bridge interface on top of the mesh_iface if present, 215 215 * otherwise pass NULL 216 216 * 217 217 * Checks the presence of IPv4 and IPv6 multicast routers on this ··· 228 228 { 229 229 u8 flags = BATADV_MCAST_WANT_NO_RTR4 | BATADV_MCAST_WANT_NO_RTR6; 230 230 231 - flags &= batadv_mcast_mla_rtr_flags_softif_get(bat_priv, bridge); 231 + flags &= batadv_mcast_mla_rtr_flags_meshif_get(bat_priv, bridge); 232 232 flags &= batadv_mcast_mla_rtr_flags_bridge_get(bat_priv, bridge); 233 233 234 234 return flags; ··· 236 236 237 237 /** 238 238 * batadv_mcast_mla_forw_flags_get() - get multicast forwarding flags 239 - * @bat_priv: the bat priv with all the soft interface information 239 + * @bat_priv: the bat priv with all the mesh interface information 240 240 * 241 241 * Checks if all active hard interfaces have an MTU larger or equal to 1280 242 242 * bytes (IPv6 minimum MTU). ··· 252 252 if (hard_iface->if_status != BATADV_IF_ACTIVE) 253 253 continue; 254 254 255 - if (hard_iface->soft_iface != bat_priv->soft_iface) 255 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 256 256 continue; 257 257 258 258 if (hard_iface->net_dev->mtu < IPV6_MIN_MTU) { ··· 267 267 268 268 /** 269 269 * batadv_mcast_mla_flags_get() - get the new multicast flags 270 - * @bat_priv: the bat priv with all the soft interface information 270 + * @bat_priv: the bat priv with all the mesh interface information 271 271 * 272 272 * Return: A set of flags for the current/next TVLV, querier and 273 273 * bridge state. ··· 275 275 static struct batadv_mcast_mla_flags 276 276 batadv_mcast_mla_flags_get(struct batadv_priv *bat_priv) 277 277 { 278 - struct net_device *dev = bat_priv->soft_iface; 278 + struct net_device *dev = bat_priv->mesh_iface; 279 279 struct batadv_mcast_querier_state *qr4, *qr6; 280 280 struct batadv_mcast_mla_flags mla_flags; 281 281 struct net_device *bridge; ··· 351 351 } 352 352 353 353 /** 354 - * batadv_mcast_mla_softif_get_ipv4() - get softif IPv4 multicast listeners 354 + * batadv_mcast_mla_meshif_get_ipv4() - get meshif IPv4 multicast listeners 355 355 * @dev: the device to collect multicast addresses from 356 356 * @mcast_list: a list to put found addresses into 357 357 * @flags: flags indicating the new multicast state 358 358 * 359 359 * Collects multicast addresses of IPv4 multicast listeners residing 360 - * on this kernel on the given soft interface, dev, in 360 + * on this kernel on the given mesh interface, dev, in 361 361 * the given mcast_list. In general, multicast listeners provided by 362 362 * your multicast receiving applications run directly on this node. 363 363 * ··· 365 365 * items added to the mcast_list otherwise. 366 366 */ 367 367 static int 368 - batadv_mcast_mla_softif_get_ipv4(struct net_device *dev, 368 + batadv_mcast_mla_meshif_get_ipv4(struct net_device *dev, 369 369 struct hlist_head *mcast_list, 370 370 struct batadv_mcast_mla_flags *flags) 371 371 { ··· 417 417 } 418 418 419 419 /** 420 - * batadv_mcast_mla_softif_get_ipv6() - get softif IPv6 multicast listeners 420 + * batadv_mcast_mla_meshif_get_ipv6() - get meshif IPv6 multicast listeners 421 421 * @dev: the device to collect multicast addresses from 422 422 * @mcast_list: a list to put found addresses into 423 423 * @flags: flags indicating the new multicast state 424 424 * 425 425 * Collects multicast addresses of IPv6 multicast listeners residing 426 - * on this kernel on the given soft interface, dev, in 426 + * on this kernel on the given mesh interface, dev, in 427 427 * the given mcast_list. In general, multicast listeners provided by 428 428 * your multicast receiving applications run directly on this node. 429 429 * ··· 432 432 */ 433 433 #if IS_ENABLED(CONFIG_IPV6) 434 434 static int 435 - batadv_mcast_mla_softif_get_ipv6(struct net_device *dev, 435 + batadv_mcast_mla_meshif_get_ipv6(struct net_device *dev, 436 436 struct hlist_head *mcast_list, 437 437 struct batadv_mcast_mla_flags *flags) 438 438 { ··· 490 490 } 491 491 #else 492 492 static inline int 493 - batadv_mcast_mla_softif_get_ipv6(struct net_device *dev, 493 + batadv_mcast_mla_meshif_get_ipv6(struct net_device *dev, 494 494 struct hlist_head *mcast_list, 495 495 struct batadv_mcast_mla_flags *flags) 496 496 { ··· 499 499 #endif 500 500 501 501 /** 502 - * batadv_mcast_mla_softif_get() - get softif multicast listeners 502 + * batadv_mcast_mla_meshif_get() - get meshif multicast listeners 503 503 * @dev: the device to collect multicast addresses from 504 504 * @mcast_list: a list to put found addresses into 505 505 * @flags: flags indicating the new multicast state 506 506 * 507 507 * Collects multicast addresses of multicast listeners residing 508 - * on this kernel on the given soft interface, dev, in 508 + * on this kernel on the given mesh interface, dev, in 509 509 * the given mcast_list. In general, multicast listeners provided by 510 510 * your multicast receiving applications run directly on this node. 511 511 * ··· 518 518 * items added to the mcast_list otherwise. 519 519 */ 520 520 static int 521 - batadv_mcast_mla_softif_get(struct net_device *dev, 521 + batadv_mcast_mla_meshif_get(struct net_device *dev, 522 522 struct hlist_head *mcast_list, 523 523 struct batadv_mcast_mla_flags *flags) 524 524 { ··· 528 528 if (bridge) 529 529 dev = bridge; 530 530 531 - ret4 = batadv_mcast_mla_softif_get_ipv4(dev, mcast_list, flags); 531 + ret4 = batadv_mcast_mla_meshif_get_ipv4(dev, mcast_list, flags); 532 532 if (ret4 < 0) 533 533 goto out; 534 534 535 - ret6 = batadv_mcast_mla_softif_get_ipv6(dev, mcast_list, flags); 535 + ret6 = batadv_mcast_mla_meshif_get_ipv6(dev, mcast_list, flags); 536 536 if (ret6 < 0) { 537 537 ret4 = 0; 538 538 goto out; ··· 576 576 * 577 577 * Collects multicast addresses of multicast listeners residing 578 578 * on foreign, non-mesh devices which we gave access to our mesh via 579 - * a bridge on top of the given soft interface, dev, in the given 579 + * a bridge on top of the given mesh interface, dev, in the given 580 580 * mcast_list. 581 581 * 582 582 * Return: -ENOMEM on memory allocation error or the number of ··· 672 672 673 673 /** 674 674 * batadv_mcast_mla_tt_retract() - clean up multicast listener announcements 675 - * @bat_priv: the bat priv with all the soft interface information 675 + * @bat_priv: the bat priv with all the mesh interface information 676 676 * @mcast_list: a list of addresses which should _not_ be removed 677 677 * 678 678 * Retracts the announcement of any multicast listener from the ··· 704 704 705 705 /** 706 706 * batadv_mcast_mla_tt_add() - add multicast listener announcements 707 - * @bat_priv: the bat priv with all the soft interface information 707 + * @bat_priv: the bat priv with all the mesh interface information 708 708 * @mcast_list: a list of addresses which are going to get added 709 709 * 710 710 * Adds multicast listener announcements from the given mcast_list to the ··· 724 724 &bat_priv->mcast.mla_list)) 725 725 continue; 726 726 727 - if (!batadv_tt_local_add(bat_priv->soft_iface, 727 + if (!batadv_tt_local_add(bat_priv->mesh_iface, 728 728 mcast_entry->addr, BATADV_NO_FLAGS, 729 729 BATADV_NULL_IFINDEX, BATADV_NO_MARK)) 730 730 continue; ··· 737 737 /** 738 738 * batadv_mcast_querier_log() - debug output regarding the querier status on 739 739 * link 740 - * @bat_priv: the bat priv with all the soft interface information 740 + * @bat_priv: the bat priv with all the mesh interface information 741 741 * @str_proto: a string for the querier protocol (e.g. "IGMP" or "MLD") 742 742 * @old_state: the previous querier state on our link 743 743 * @new_state: the new querier state on our link ··· 754 754 * potentially shadowing listeners from us then. 755 755 * 756 756 * This is only interesting for nodes with a bridge on top of their 757 - * soft interface. 757 + * mesh interface. 758 758 */ 759 759 static void 760 760 batadv_mcast_querier_log(struct batadv_priv *bat_priv, char *str_proto, ··· 762 762 struct batadv_mcast_querier_state *new_state) 763 763 { 764 764 if (!old_state->exists && new_state->exists) 765 - batadv_info(bat_priv->soft_iface, "%s Querier appeared\n", 765 + batadv_info(bat_priv->mesh_iface, "%s Querier appeared\n", 766 766 str_proto); 767 767 else if (old_state->exists && !new_state->exists) 768 - batadv_info(bat_priv->soft_iface, 768 + batadv_info(bat_priv->mesh_iface, 769 769 "%s Querier disappeared - multicast optimizations disabled\n", 770 770 str_proto); 771 771 else if (!bat_priv->mcast.mla_flags.bridged && !new_state->exists) 772 - batadv_info(bat_priv->soft_iface, 772 + batadv_info(bat_priv->mesh_iface, 773 773 "No %s Querier present - multicast optimizations disabled\n", 774 774 str_proto); 775 775 ··· 789 789 /** 790 790 * batadv_mcast_bridge_log() - debug output for topology changes in bridged 791 791 * setups 792 - * @bat_priv: the bat priv with all the soft interface information 792 + * @bat_priv: the bat priv with all the mesh interface information 793 793 * @new_flags: flags indicating the new multicast state 794 794 * 795 795 * If no bridges are ever used on this node, then this function does nothing. ··· 798 798 * which might be relevant to our multicast optimizations. 799 799 * 800 800 * More precisely, it outputs information when a bridge interface is added or 801 - * removed from a soft interface. And when a bridge is present, it further 801 + * removed from a mesh interface. And when a bridge is present, it further 802 802 * outputs information about the querier state which is relevant for the 803 803 * multicast flags this node is going to set. 804 804 */ ··· 827 827 828 828 /** 829 829 * batadv_mcast_flags_log() - output debug information about mcast flag changes 830 - * @bat_priv: the bat priv with all the soft interface information 830 + * @bat_priv: the bat priv with all the mesh interface information 831 831 * @flags: TVLV flags indicating the new multicast state 832 832 * 833 833 * Whenever the multicast TVLV flags this node announces change, this function ··· 860 860 861 861 /** 862 862 * batadv_mcast_mla_flags_update() - update multicast flags 863 - * @bat_priv: the bat priv with all the soft interface information 863 + * @bat_priv: the bat priv with all the mesh interface information 864 864 * @flags: flags indicating the new multicast state 865 865 * 866 866 * Updates the own multicast tvlv with our current multicast related settings, ··· 889 889 890 890 /** 891 891 * __batadv_mcast_mla_update() - update the own MLAs 892 - * @bat_priv: the bat priv with all the soft interface information 892 + * @bat_priv: the bat priv with all the mesh interface information 893 893 * 894 894 * Updates the own multicast listener announcements in the translation 895 895 * table as well as the own, announced multicast tvlv container. ··· 901 901 */ 902 902 static void __batadv_mcast_mla_update(struct batadv_priv *bat_priv) 903 903 { 904 - struct net_device *soft_iface = bat_priv->soft_iface; 904 + struct net_device *mesh_iface = bat_priv->mesh_iface; 905 905 struct hlist_head mcast_list = HLIST_HEAD_INIT; 906 906 struct batadv_mcast_mla_flags flags; 907 907 int ret; 908 908 909 909 flags = batadv_mcast_mla_flags_get(bat_priv); 910 910 911 - ret = batadv_mcast_mla_softif_get(soft_iface, &mcast_list, &flags); 911 + ret = batadv_mcast_mla_meshif_get(mesh_iface, &mcast_list, &flags); 912 912 if (ret < 0) 913 913 goto out; 914 914 915 - ret = batadv_mcast_mla_bridge_get(soft_iface, &mcast_list, &flags); 915 + ret = batadv_mcast_mla_bridge_get(mesh_iface, &mcast_list, &flags); 916 916 if (ret < 0) 917 917 goto out; 918 918 ··· 977 977 /** 978 978 * batadv_mcast_forw_mode_check_ipv4() - check for optimized forwarding 979 979 * potential 980 - * @bat_priv: the bat priv with all the soft interface information 980 + * @bat_priv: the bat priv with all the mesh interface information 981 981 * @skb: the IPv4 packet to check 982 982 * @is_unsnoopable: stores whether the destination is snoopable 983 983 * @is_routable: stores whether the destination is routable ··· 1042 1042 /** 1043 1043 * batadv_mcast_forw_mode_check_ipv6() - check for optimized forwarding 1044 1044 * potential 1045 - * @bat_priv: the bat priv with all the soft interface information 1045 + * @bat_priv: the bat priv with all the mesh interface information 1046 1046 * @skb: the IPv6 packet to check 1047 1047 * @is_unsnoopable: stores whether the destination is snoopable 1048 1048 * @is_routable: stores whether the destination is routable ··· 1084 1084 1085 1085 /** 1086 1086 * batadv_mcast_forw_mode_check() - check for optimized forwarding potential 1087 - * @bat_priv: the bat priv with all the soft interface information 1087 + * @bat_priv: the bat priv with all the mesh interface information 1088 1088 * @skb: the multicast frame to check 1089 1089 * @is_unsnoopable: stores whether the destination is snoopable 1090 1090 * @is_routable: stores whether the destination is routable ··· 1124 1124 /** 1125 1125 * batadv_mcast_forw_want_all_ip_count() - count nodes with unspecific mcast 1126 1126 * interest 1127 - * @bat_priv: the bat priv with all the soft interface information 1127 + * @bat_priv: the bat priv with all the mesh interface information 1128 1128 * @ethhdr: ethernet header of a packet 1129 1129 * 1130 1130 * Return: the number of nodes which want all IPv4 multicast traffic if the ··· 1147 1147 1148 1148 /** 1149 1149 * batadv_mcast_forw_rtr_count() - count nodes with a multicast router 1150 - * @bat_priv: the bat priv with all the soft interface information 1150 + * @bat_priv: the bat priv with all the mesh interface information 1151 1151 * @protocol: the ethernet protocol type to count multicast routers for 1152 1152 * 1153 1153 * Return: the number of nodes which want all routable IPv4 multicast traffic ··· 1170 1170 1171 1171 /** 1172 1172 * batadv_mcast_forw_mode_by_count() - get forwarding mode by count 1173 - * @bat_priv: the bat priv with all the soft interface information 1173 + * @bat_priv: the bat priv with all the mesh interface information 1174 1174 * @skb: the multicast packet to check 1175 1175 * @vid: the vlan identifier 1176 1176 * @is_routable: stores whether the destination is routable ··· 1214 1214 1215 1215 /** 1216 1216 * batadv_mcast_forw_mode() - check on how to forward a multicast packet 1217 - * @bat_priv: the bat priv with all the soft interface information 1217 + * @bat_priv: the bat priv with all the mesh interface information 1218 1218 * @skb: the multicast packet to check 1219 1219 * @vid: the vlan identifier 1220 1220 * @is_routable: stores whether the destination is routable ··· 1259 1259 1260 1260 /** 1261 1261 * batadv_mcast_forw_send_orig() - send a multicast packet to an originator 1262 - * @bat_priv: the bat priv with all the soft interface information 1262 + * @bat_priv: the bat priv with all the mesh interface information 1263 1263 * @skb: the multicast packet to send 1264 1264 * @vid: the vlan identifier 1265 1265 * @orig_node: the originator to send the packet to ··· 1288 1288 1289 1289 /** 1290 1290 * batadv_mcast_forw_tt() - forwards a packet to multicast listeners 1291 - * @bat_priv: the bat priv with all the soft interface information 1291 + * @bat_priv: the bat priv with all the mesh interface information 1292 1292 * @skb: the multicast packet to transmit 1293 1293 * @vid: the vlan identifier 1294 1294 * ··· 1336 1336 1337 1337 /** 1338 1338 * batadv_mcast_forw_want_all_ipv4() - forward to nodes with want-all-ipv4 1339 - * @bat_priv: the bat priv with all the soft interface information 1339 + * @bat_priv: the bat priv with all the mesh interface information 1340 1340 * @skb: the multicast packet to transmit 1341 1341 * @vid: the vlan identifier 1342 1342 * ··· 1373 1373 1374 1374 /** 1375 1375 * batadv_mcast_forw_want_all_ipv6() - forward to nodes with want-all-ipv6 1376 - * @bat_priv: the bat priv with all the soft interface information 1376 + * @bat_priv: the bat priv with all the mesh interface information 1377 1377 * @skb: The multicast packet to transmit 1378 1378 * @vid: the vlan identifier 1379 1379 * ··· 1410 1410 1411 1411 /** 1412 1412 * batadv_mcast_forw_want_all() - forward packet to nodes in a want-all list 1413 - * @bat_priv: the bat priv with all the soft interface information 1413 + * @bat_priv: the bat priv with all the mesh interface information 1414 1414 * @skb: the multicast packet to transmit 1415 1415 * @vid: the vlan identifier 1416 1416 * ··· 1439 1439 1440 1440 /** 1441 1441 * batadv_mcast_forw_want_all_rtr4() - forward to nodes with want-all-rtr4 1442 - * @bat_priv: the bat priv with all the soft interface information 1442 + * @bat_priv: the bat priv with all the mesh interface information 1443 1443 * @skb: the multicast packet to transmit 1444 1444 * @vid: the vlan identifier 1445 1445 * ··· 1476 1476 1477 1477 /** 1478 1478 * batadv_mcast_forw_want_all_rtr6() - forward to nodes with want-all-rtr6 1479 - * @bat_priv: the bat priv with all the soft interface information 1479 + * @bat_priv: the bat priv with all the mesh interface information 1480 1480 * @skb: The multicast packet to transmit 1481 1481 * @vid: the vlan identifier 1482 1482 * ··· 1513 1513 1514 1514 /** 1515 1515 * batadv_mcast_forw_want_rtr() - forward packet to nodes in a want-all-rtr list 1516 - * @bat_priv: the bat priv with all the soft interface information 1516 + * @bat_priv: the bat priv with all the mesh interface information 1517 1517 * @skb: the multicast packet to transmit 1518 1518 * @vid: the vlan identifier 1519 1519 * ··· 1542 1542 1543 1543 /** 1544 1544 * batadv_mcast_forw_send() - send packet to any detected multicast recipient 1545 - * @bat_priv: the bat priv with all the soft interface information 1545 + * @bat_priv: the bat priv with all the mesh interface information 1546 1546 * @skb: the multicast packet to transmit 1547 1547 * @vid: the vlan identifier 1548 1548 * @is_routable: stores whether the destination is routable ··· 1590 1590 1591 1591 /** 1592 1592 * batadv_mcast_want_unsnoop_update() - update unsnoop counter and list 1593 - * @bat_priv: the bat priv with all the soft interface information 1593 + * @bat_priv: the bat priv with all the mesh interface information 1594 1594 * @orig: the orig_node which multicast state might have changed of 1595 1595 * @mcast_flags: flags indicating the new multicast state 1596 1596 * ··· 1636 1636 1637 1637 /** 1638 1638 * batadv_mcast_want_ipv4_update() - update want-all-ipv4 counter and list 1639 - * @bat_priv: the bat priv with all the soft interface information 1639 + * @bat_priv: the bat priv with all the mesh interface information 1640 1640 * @orig: the orig_node which multicast state might have changed of 1641 1641 * @mcast_flags: flags indicating the new multicast state 1642 1642 * ··· 1681 1681 1682 1682 /** 1683 1683 * batadv_mcast_want_ipv6_update() - update want-all-ipv6 counter and list 1684 - * @bat_priv: the bat priv with all the soft interface information 1684 + * @bat_priv: the bat priv with all the mesh interface information 1685 1685 * @orig: the orig_node which multicast state might have changed of 1686 1686 * @mcast_flags: flags indicating the new multicast state 1687 1687 * ··· 1726 1726 1727 1727 /** 1728 1728 * batadv_mcast_want_rtr4_update() - update want-all-rtr4 counter and list 1729 - * @bat_priv: the bat priv with all the soft interface information 1729 + * @bat_priv: the bat priv with all the mesh interface information 1730 1730 * @orig: the orig_node which multicast state might have changed of 1731 1731 * @mcast_flags: flags indicating the new multicast state 1732 1732 * ··· 1771 1771 1772 1772 /** 1773 1773 * batadv_mcast_want_rtr6_update() - update want-all-rtr6 counter and list 1774 - * @bat_priv: the bat priv with all the soft interface information 1774 + * @bat_priv: the bat priv with all the mesh interface information 1775 1775 * @orig: the orig_node which multicast state might have changed of 1776 1776 * @mcast_flags: flags indicating the new multicast state 1777 1777 * ··· 1816 1816 1817 1817 /** 1818 1818 * batadv_mcast_have_mc_ptype_update() - update multicast packet type counter 1819 - * @bat_priv: the bat priv with all the soft interface information 1819 + * @bat_priv: the bat priv with all the mesh interface information 1820 1820 * @orig: the orig_node which multicast state might have changed of 1821 1821 * @mcast_flags: flags indicating the new multicast state 1822 1822 * ··· 1872 1872 1873 1873 /** 1874 1874 * batadv_mcast_tvlv_ogm_handler() - process incoming multicast tvlv container 1875 - * @bat_priv: the bat priv with all the soft interface information 1875 + * @bat_priv: the bat priv with all the mesh interface information 1876 1876 * @orig: the orig_node of the ogm 1877 1877 * @flags: flags indicating the tvlv state (see batadv_tvlv_handler_flags) 1878 1878 * @tvlv_value: tvlv buffer containing the multicast data ··· 1915 1915 1916 1916 /** 1917 1917 * batadv_mcast_init() - initialize the multicast optimizations structures 1918 - * @bat_priv: the bat priv with all the soft interface information 1918 + * @bat_priv: the bat priv with all the mesh interface information 1919 1919 */ 1920 1920 void batadv_mcast_init(struct batadv_priv *bat_priv) 1921 1921 { ··· 1934 1934 /** 1935 1935 * batadv_mcast_mesh_info_put() - put multicast info into a netlink message 1936 1936 * @msg: buffer for the message 1937 - * @bat_priv: the bat priv with all the soft interface information 1937 + * @bat_priv: the bat priv with all the mesh interface information 1938 1938 * 1939 1939 * Return: 0 or error code. 1940 1940 */ ··· 2060 2060 * @msg: buffer for the message 2061 2061 * @portid: netlink port 2062 2062 * @cb: Control block containing additional options 2063 - * @bat_priv: the bat priv with all the soft interface information 2063 + * @bat_priv: the bat priv with all the mesh interface information 2064 2064 * @bucket: current bucket to dump 2065 2065 * @idx: index in current bucket to the next entry to dump 2066 2066 * ··· 2103 2103 struct batadv_hard_iface **primary_if) 2104 2104 { 2105 2105 struct batadv_hard_iface *hard_iface = NULL; 2106 - struct net_device *soft_iface; 2106 + struct net_device *mesh_iface; 2107 2107 struct batadv_priv *bat_priv; 2108 2108 int ret = 0; 2109 2109 2110 - soft_iface = batadv_netlink_get_softif(cb); 2111 - if (IS_ERR(soft_iface)) 2112 - return PTR_ERR(soft_iface); 2110 + mesh_iface = batadv_netlink_get_meshif(cb); 2111 + if (IS_ERR(mesh_iface)) 2112 + return PTR_ERR(mesh_iface); 2113 2113 2114 - bat_priv = netdev_priv(soft_iface); 2114 + bat_priv = netdev_priv(mesh_iface); 2115 2115 2116 2116 hard_iface = batadv_primary_if_get_selected(bat_priv); 2117 2117 if (!hard_iface || hard_iface->if_status != BATADV_IF_ACTIVE) { ··· 2120 2120 } 2121 2121 2122 2122 out: 2123 - dev_put(soft_iface); 2123 + dev_put(mesh_iface); 2124 2124 2125 2125 if (!ret && primary_if) 2126 2126 *primary_if = hard_iface; ··· 2150 2150 if (ret) 2151 2151 return ret; 2152 2152 2153 - bat_priv = netdev_priv(primary_if->soft_iface); 2153 + bat_priv = netdev_priv(primary_if->mesh_iface); 2154 2154 ret = __batadv_mcast_flags_dump(msg, portid, cb, bat_priv, bucket, idx); 2155 2155 2156 2156 batadv_hardif_put(primary_if); ··· 2159 2159 2160 2160 /** 2161 2161 * batadv_mcast_free() - free the multicast optimizations structures 2162 - * @bat_priv: the bat priv with all the soft interface information 2162 + * @bat_priv: the bat priv with all the mesh interface information 2163 2163 */ 2164 2164 void batadv_mcast_free(struct batadv_priv *bat_priv) 2165 2165 {
+15 -15
net/batman-adv/multicast_forw.c
··· 131 131 132 132 /** 133 133 * batadv_mcast_forw_push_dest() - push an originator MAC address onto an skb 134 - * @bat_priv: the bat priv with all the soft interface information 134 + * @bat_priv: the bat priv with all the mesh interface information 135 135 * @skb: the skb to push the destination address onto 136 136 * @vid: the vlan identifier 137 137 * @orig_node: the originator node to get the MAC address from ··· 174 174 175 175 /** 176 176 * batadv_mcast_forw_push_dests_list() - push originators from list onto an skb 177 - * @bat_priv: the bat priv with all the soft interface information 177 + * @bat_priv: the bat priv with all the mesh interface information 178 178 * @skb: the skb to push the destination addresses onto 179 179 * @vid: the vlan identifier 180 180 * @head: the list to gather originators from ··· 215 215 216 216 /** 217 217 * batadv_mcast_forw_push_tt() - push originators with interest through TT 218 - * @bat_priv: the bat priv with all the soft interface information 218 + * @bat_priv: the bat priv with all the mesh interface information 219 219 * @skb: the skb to push the destination addresses onto 220 220 * @vid: the vlan identifier 221 221 * @num_dests: a pointer to store the number of pushed addresses in ··· 262 262 263 263 /** 264 264 * batadv_mcast_forw_push_want_all() - push originators with want-all flag 265 - * @bat_priv: the bat priv with all the soft interface information 265 + * @bat_priv: the bat priv with all the mesh interface information 266 266 * @skb: the skb to push the destination addresses onto 267 267 * @vid: the vlan identifier 268 268 * @num_dests: a pointer to store the number of pushed addresses in ··· 308 308 309 309 /** 310 310 * batadv_mcast_forw_push_want_rtr() - push originators with want-router flag 311 - * @bat_priv: the bat priv with all the soft interface information 311 + * @bat_priv: the bat priv with all the mesh interface information 312 312 * @skb: the skb to push the destination addresses onto 313 313 * @vid: the vlan identifier 314 314 * @num_dests: a pointer to store the number of pushed addresses in ··· 475 475 476 476 /** 477 477 * batadv_mcast_forw_push_dests() - push originator addresses onto an skb 478 - * @bat_priv: the bat priv with all the soft interface information 478 + * @bat_priv: the bat priv with all the mesh interface information 479 479 * @skb: the skb to push the destination addresses onto 480 480 * @vid: the vlan identifier 481 481 * @is_routable: indicates whether the destination is routable ··· 567 567 568 568 /** 569 569 * batadv_mcast_forw_push_tvlvs() - push a multicast tracker TVLV onto an skb 570 - * @bat_priv: the bat priv with all the soft interface information 570 + * @bat_priv: the bat priv with all the mesh interface information 571 571 * @skb: the skb to push the tracker TVLV onto 572 572 * @vid: the vlan identifier 573 573 * @is_routable: indicates whether the destination is routable ··· 634 634 635 635 /** 636 636 * batadv_mcast_forw_scrub_dests() - scrub destinations in a tracker TVLV 637 - * @bat_priv: the bat priv with all the soft interface information 637 + * @bat_priv: the bat priv with all the mesh interface information 638 638 * @comp_neigh: next hop neighbor to scrub+collect destinations for 639 639 * @dest: start MAC entry in original skb's tracker TVLV 640 640 * @next_dest: start MAC entry in to be sent skb's tracker TVLV ··· 905 905 906 906 /** 907 907 * batadv_mcast_forw_packet() - forward a batman-adv multicast packet 908 - * @bat_priv: the bat priv with all the soft interface information 908 + * @bat_priv: the bat priv with all the mesh interface information 909 909 * @skb: the received or locally generated batman-adv multicast packet 910 910 * @local_xmit: indicates that the packet was locally generated and not received 911 911 * ··· 920 920 * 921 921 * Return: NET_RX_SUCCESS or NET_RX_DROP on success or a negative error 922 922 * code on failure. NET_RX_SUCCESS if the received packet is supposed to be 923 - * decapsulated and forwarded to the own soft interface, NET_RX_DROP otherwise. 923 + * decapsulated and forwarded to the own mesh interface, NET_RX_DROP otherwise. 924 924 */ 925 925 static int batadv_mcast_forw_packet(struct batadv_priv *bat_priv, 926 926 struct sk_buff *skb, bool local_xmit) ··· 1028 1028 1029 1029 /** 1030 1030 * batadv_mcast_forw_tracker_tvlv_handler() - handle an mcast tracker tvlv 1031 - * @bat_priv: the bat priv with all the soft interface information 1031 + * @bat_priv: the bat priv with all the mesh interface information 1032 1032 * @skb: the received batman-adv multicast packet 1033 1033 * 1034 1034 * Parses the tracker TVLV of an incoming batman-adv multicast packet and ··· 1042 1042 * 1043 1043 * Return: NET_RX_SUCCESS or NET_RX_DROP on success or a negative error 1044 1044 * code on failure. NET_RX_SUCCESS if the received packet is supposed to be 1045 - * decapsulated and forwarded to the own soft interface, NET_RX_DROP otherwise. 1045 + * decapsulated and forwarded to the own mesh interface, NET_RX_DROP otherwise. 1046 1046 */ 1047 1047 int batadv_mcast_forw_tracker_tvlv_handler(struct batadv_priv *bat_priv, 1048 1048 struct sk_buff *skb) ··· 1075 1075 1076 1076 /** 1077 1077 * batadv_mcast_forw_expand_head() - expand headroom for an mcast packet 1078 - * @bat_priv: the bat priv with all the soft interface information 1078 + * @bat_priv: the bat priv with all the mesh interface information 1079 1079 * @skb: the multicast packet to send 1080 1080 * 1081 1081 * Tries to expand an skb's headroom so that its head to tail is 1298 ··· 1110 1110 1111 1111 /** 1112 1112 * batadv_mcast_forw_push() - encapsulate skb in a batman-adv multicast packet 1113 - * @bat_priv: the bat priv with all the soft interface information 1113 + * @bat_priv: the bat priv with all the mesh interface information 1114 1114 * @skb: the multicast packet to encapsulate and send 1115 1115 * @vid: the vlan identifier 1116 1116 * @is_routable: indicates whether the destination is routable ··· 1154 1154 1155 1155 /** 1156 1156 * batadv_mcast_forw_mcsend() - send a self prepared batman-adv multicast packet 1157 - * @bat_priv: the bat priv with all the soft interface information 1157 + * @bat_priv: the bat priv with all the mesh interface information 1158 1158 * @skb: the multicast packet to encapsulate and send 1159 1159 * 1160 1160 * Transmits a batman-adv multicast packet that was locally prepared and
+90 -90
net/batman-adv/netlink.c
··· 43 43 #include "gateway_common.h" 44 44 #include "hard-interface.h" 45 45 #include "log.h" 46 + #include "mesh-interface.h" 46 47 #include "multicast.h" 47 48 #include "network-coding.h" 48 49 #include "originator.h" 49 - #include "soft-interface.h" 50 50 #include "tp_meter.h" 51 51 #include "translation-table.h" 52 52 ··· 63 63 */ 64 64 enum batadv_genl_ops_flags { 65 65 /** 66 - * @BATADV_FLAG_NEED_MESH: request requires valid soft interface in 66 + * @BATADV_FLAG_NEED_MESH: request requires valid mesh interface in 67 67 * attribute BATADV_ATTR_MESH_IFINDEX and expects a pointer to it to be 68 68 * saved in info->user_ptr[0] 69 69 */ ··· 166 166 } 167 167 168 168 /** 169 - * batadv_netlink_mesh_fill_ap_isolation() - Add ap_isolation softif attribute 169 + * batadv_netlink_mesh_fill_ap_isolation() - Add ap_isolation meshif attribute 170 170 * @msg: Netlink message to dump into 171 - * @bat_priv: the bat priv with all the soft interface information 171 + * @bat_priv: the bat priv with all the mesh interface information 172 172 * 173 173 * Return: 0 on success or negative error number in case of failure 174 174 */ 175 175 static int batadv_netlink_mesh_fill_ap_isolation(struct sk_buff *msg, 176 176 struct batadv_priv *bat_priv) 177 177 { 178 - struct batadv_softif_vlan *vlan; 178 + struct batadv_meshif_vlan *vlan; 179 179 u8 ap_isolation; 180 180 181 - vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); 181 + vlan = batadv_meshif_vlan_get(bat_priv, BATADV_NO_FLAGS); 182 182 if (!vlan) 183 183 return 0; 184 184 185 185 ap_isolation = atomic_read(&vlan->ap_isolation); 186 - batadv_softif_vlan_put(vlan); 186 + batadv_meshif_vlan_put(vlan); 187 187 188 188 return nla_put_u8(msg, BATADV_ATTR_AP_ISOLATION_ENABLED, 189 189 !!ap_isolation); ··· 192 192 /** 193 193 * batadv_netlink_set_mesh_ap_isolation() - Set ap_isolation from genl msg 194 194 * @attr: parsed BATADV_ATTR_AP_ISOLATION_ENABLED attribute 195 - * @bat_priv: the bat priv with all the soft interface information 195 + * @bat_priv: the bat priv with all the mesh interface information 196 196 * 197 197 * Return: 0 on success or negative error number in case of failure 198 198 */ 199 199 static int batadv_netlink_set_mesh_ap_isolation(struct nlattr *attr, 200 200 struct batadv_priv *bat_priv) 201 201 { 202 - struct batadv_softif_vlan *vlan; 202 + struct batadv_meshif_vlan *vlan; 203 203 204 - vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); 204 + vlan = batadv_meshif_vlan_get(bat_priv, BATADV_NO_FLAGS); 205 205 if (!vlan) 206 206 return -ENOENT; 207 207 208 208 atomic_set(&vlan->ap_isolation, !!nla_get_u8(attr)); 209 - batadv_softif_vlan_put(vlan); 209 + batadv_meshif_vlan_put(vlan); 210 210 211 211 return 0; 212 212 } ··· 214 214 /** 215 215 * batadv_netlink_mesh_fill() - Fill message with mesh attributes 216 216 * @msg: Netlink message to dump into 217 - * @bat_priv: the bat priv with all the soft interface information 217 + * @bat_priv: the bat priv with all the mesh interface information 218 218 * @cmd: type of message to generate 219 219 * @portid: Port making netlink request 220 220 * @seq: sequence number for message ··· 227 227 enum batadv_nl_commands cmd, 228 228 u32 portid, u32 seq, int flags) 229 229 { 230 - struct net_device *soft_iface = bat_priv->soft_iface; 230 + struct net_device *mesh_iface = bat_priv->mesh_iface; 231 231 struct batadv_hard_iface *primary_if = NULL; 232 232 struct net_device *hard_iface; 233 233 void *hdr; ··· 239 239 if (nla_put_string(msg, BATADV_ATTR_VERSION, BATADV_SOURCE_VERSION) || 240 240 nla_put_string(msg, BATADV_ATTR_ALGO_NAME, 241 241 bat_priv->algo_ops->name) || 242 - nla_put_u32(msg, BATADV_ATTR_MESH_IFINDEX, soft_iface->ifindex) || 243 - nla_put_string(msg, BATADV_ATTR_MESH_IFNAME, soft_iface->name) || 242 + nla_put_u32(msg, BATADV_ATTR_MESH_IFINDEX, mesh_iface->ifindex) || 243 + nla_put_string(msg, BATADV_ATTR_MESH_IFNAME, mesh_iface->name) || 244 244 nla_put(msg, BATADV_ATTR_MESH_ADDRESS, ETH_ALEN, 245 - soft_iface->dev_addr) || 245 + mesh_iface->dev_addr) || 246 246 nla_put_u8(msg, BATADV_ATTR_TT_TTVN, 247 247 (u8)atomic_read(&bat_priv->tt.vn))) 248 248 goto nla_put_failure; ··· 369 369 } 370 370 371 371 /** 372 - * batadv_netlink_notify_mesh() - send softif attributes to listener 373 - * @bat_priv: the bat priv with all the soft interface information 372 + * batadv_netlink_notify_mesh() - send meshif attributes to listener 373 + * @bat_priv: the bat priv with all the mesh interface information 374 374 * 375 375 * Return: 0 on success, < 0 on error 376 376 */ ··· 391 391 } 392 392 393 393 genlmsg_multicast_netns(&batadv_netlink_family, 394 - dev_net(bat_priv->soft_iface), msg, 0, 394 + dev_net(bat_priv->mesh_iface), msg, 0, 395 395 BATADV_NL_MCGRP_CONFIG, GFP_KERNEL); 396 396 397 397 return 0; 398 398 } 399 399 400 400 /** 401 - * batadv_netlink_get_mesh() - Get softif attributes 401 + * batadv_netlink_get_mesh() - Get meshif attributes 402 402 * @skb: Netlink message with request data 403 403 * @info: receiver information 404 404 * ··· 427 427 } 428 428 429 429 /** 430 - * batadv_netlink_set_mesh() - Set softif attributes 430 + * batadv_netlink_set_mesh() - Set meshif attributes 431 431 * @skb: Netlink message with request data 432 432 * @info: receiver information 433 433 * ··· 474 474 475 475 atomic_set(&bat_priv->bridge_loop_avoidance, 476 476 !!nla_get_u8(attr)); 477 - batadv_bla_status_update(bat_priv->soft_iface); 477 + batadv_bla_status_update(bat_priv->mesh_iface); 478 478 } 479 479 #endif /* CONFIG_BATMAN_ADV_BLA */ 480 480 ··· 484 484 485 485 atomic_set(&bat_priv->distributed_arp_table, 486 486 !!nla_get_u8(attr)); 487 - batadv_dat_status_update(bat_priv->soft_iface); 487 + batadv_dat_status_update(bat_priv->mesh_iface); 488 488 } 489 489 #endif /* CONFIG_BATMAN_ADV_DAT */ 490 490 ··· 494 494 atomic_set(&bat_priv->fragmentation, !!nla_get_u8(attr)); 495 495 496 496 rtnl_lock(); 497 - batadv_update_min_mtu(bat_priv->soft_iface); 497 + batadv_update_min_mtu(bat_priv->mesh_iface); 498 498 rtnl_unlock(); 499 499 } 500 500 ··· 594 594 attr = info->attrs[BATADV_ATTR_NETWORK_CODING_ENABLED]; 595 595 596 596 atomic_set(&bat_priv->network_coding, !!nla_get_u8(attr)); 597 - batadv_nc_status_update(bat_priv->soft_iface); 597 + batadv_nc_status_update(bat_priv->mesh_iface); 598 598 } 599 599 #endif /* CONFIG_BATMAN_ADV_NC */ 600 600 ··· 633 633 634 634 /** 635 635 * batadv_netlink_tpmeter_notify() - send tp_meter result via netlink to client 636 - * @bat_priv: the bat priv with all the soft interface information 636 + * @bat_priv: the bat priv with all the mesh interface information 637 637 * @dst: destination of tp_meter session 638 638 * @result: reason for tp meter session stop 639 639 * @test_time: total time of the tp_meter session ··· 680 680 genlmsg_end(msg, hdr); 681 681 682 682 genlmsg_multicast_netns(&batadv_netlink_family, 683 - dev_net(bat_priv->soft_iface), msg, 0, 683 + dev_net(bat_priv->mesh_iface), msg, 0, 684 684 BATADV_NL_MCGRP_TPMETER, GFP_KERNEL); 685 685 686 686 return 0; ··· 778 778 /** 779 779 * batadv_netlink_hardif_fill() - Fill message with hardif attributes 780 780 * @msg: Netlink message to dump into 781 - * @bat_priv: the bat priv with all the soft interface information 781 + * @bat_priv: the bat priv with all the mesh interface information 782 782 * @hard_iface: hard interface which was modified 783 783 * @cmd: type of message to generate 784 784 * @portid: Port making netlink request ··· 806 806 genl_dump_check_consistent(cb, hdr); 807 807 808 808 if (nla_put_u32(msg, BATADV_ATTR_MESH_IFINDEX, 809 - bat_priv->soft_iface->ifindex)) 809 + bat_priv->mesh_iface->ifindex)) 810 810 goto nla_put_failure; 811 811 812 812 if (nla_put_string(msg, BATADV_ATTR_MESH_IFNAME, 813 - bat_priv->soft_iface->name)) 813 + bat_priv->mesh_iface->name)) 814 814 goto nla_put_failure; 815 815 816 816 if (nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX, ··· 850 850 851 851 /** 852 852 * batadv_netlink_notify_hardif() - send hardif attributes to listener 853 - * @bat_priv: the bat priv with all the soft interface information 853 + * @bat_priv: the bat priv with all the mesh interface information 854 854 * @hard_iface: hard interface which was modified 855 855 * 856 856 * Return: 0 on success, < 0 on error ··· 873 873 } 874 874 875 875 genlmsg_multicast_netns(&batadv_netlink_family, 876 - dev_net(bat_priv->soft_iface), msg, 0, 876 + dev_net(bat_priv->mesh_iface), msg, 0, 877 877 BATADV_NL_MCGRP_CONFIG, GFP_KERNEL); 878 878 879 879 return 0; ··· 963 963 static int 964 964 batadv_netlink_dump_hardif(struct sk_buff *msg, struct netlink_callback *cb) 965 965 { 966 - struct net_device *soft_iface; 966 + struct net_device *mesh_iface; 967 967 struct batadv_hard_iface *hard_iface; 968 968 struct batadv_priv *bat_priv; 969 969 int portid = NETLINK_CB(cb->skb).portid; 970 970 int skip = cb->args[0]; 971 971 int i = 0; 972 972 973 - soft_iface = batadv_netlink_get_softif(cb); 974 - if (IS_ERR(soft_iface)) 975 - return PTR_ERR(soft_iface); 973 + mesh_iface = batadv_netlink_get_meshif(cb); 974 + if (IS_ERR(mesh_iface)) 975 + return PTR_ERR(mesh_iface); 976 976 977 - bat_priv = netdev_priv(soft_iface); 977 + bat_priv = netdev_priv(mesh_iface); 978 978 979 979 rtnl_lock(); 980 980 cb->seq = batadv_hardif_generation << 1 | 1; 981 981 982 982 list_for_each_entry(hard_iface, &batadv_hardif_list, list) { 983 - if (hard_iface->soft_iface != soft_iface) 983 + if (hard_iface->mesh_iface != mesh_iface) 984 984 continue; 985 985 986 986 if (i++ < skip) ··· 997 997 998 998 rtnl_unlock(); 999 999 1000 - dev_put(soft_iface); 1000 + dev_put(mesh_iface); 1001 1001 1002 1002 cb->args[0] = i; 1003 1003 ··· 1007 1007 /** 1008 1008 * batadv_netlink_vlan_fill() - Fill message with vlan attributes 1009 1009 * @msg: Netlink message to dump into 1010 - * @bat_priv: the bat priv with all the soft interface information 1010 + * @bat_priv: the bat priv with all the mesh interface information 1011 1011 * @vlan: vlan which was modified 1012 1012 * @cmd: type of message to generate 1013 1013 * @portid: Port making netlink request ··· 1018 1018 */ 1019 1019 static int batadv_netlink_vlan_fill(struct sk_buff *msg, 1020 1020 struct batadv_priv *bat_priv, 1021 - struct batadv_softif_vlan *vlan, 1021 + struct batadv_meshif_vlan *vlan, 1022 1022 enum batadv_nl_commands cmd, 1023 1023 u32 portid, u32 seq, int flags) 1024 1024 { ··· 1029 1029 return -ENOBUFS; 1030 1030 1031 1031 if (nla_put_u32(msg, BATADV_ATTR_MESH_IFINDEX, 1032 - bat_priv->soft_iface->ifindex)) 1032 + bat_priv->mesh_iface->ifindex)) 1033 1033 goto nla_put_failure; 1034 1034 1035 1035 if (nla_put_string(msg, BATADV_ATTR_MESH_IFNAME, 1036 - bat_priv->soft_iface->name)) 1036 + bat_priv->mesh_iface->name)) 1037 1037 goto nla_put_failure; 1038 1038 1039 1039 if (nla_put_u32(msg, BATADV_ATTR_VLANID, vlan->vid & VLAN_VID_MASK)) ··· 1053 1053 1054 1054 /** 1055 1055 * batadv_netlink_notify_vlan() - send vlan attributes to listener 1056 - * @bat_priv: the bat priv with all the soft interface information 1056 + * @bat_priv: the bat priv with all the mesh interface information 1057 1057 * @vlan: vlan which was modified 1058 1058 * 1059 1059 * Return: 0 on success, < 0 on error 1060 1060 */ 1061 1061 static int batadv_netlink_notify_vlan(struct batadv_priv *bat_priv, 1062 - struct batadv_softif_vlan *vlan) 1062 + struct batadv_meshif_vlan *vlan) 1063 1063 { 1064 1064 struct sk_buff *msg; 1065 1065 int ret; ··· 1076 1076 } 1077 1077 1078 1078 genlmsg_multicast_netns(&batadv_netlink_family, 1079 - dev_net(bat_priv->soft_iface), msg, 0, 1079 + dev_net(bat_priv->mesh_iface), msg, 0, 1080 1080 BATADV_NL_MCGRP_CONFIG, GFP_KERNEL); 1081 1081 1082 1082 return 0; ··· 1091 1091 */ 1092 1092 static int batadv_netlink_get_vlan(struct sk_buff *skb, struct genl_info *info) 1093 1093 { 1094 - struct batadv_softif_vlan *vlan = info->user_ptr[1]; 1094 + struct batadv_meshif_vlan *vlan = info->user_ptr[1]; 1095 1095 struct batadv_priv *bat_priv = info->user_ptr[0]; 1096 1096 struct sk_buff *msg; 1097 1097 int ret; ··· 1121 1121 */ 1122 1122 static int batadv_netlink_set_vlan(struct sk_buff *skb, struct genl_info *info) 1123 1123 { 1124 - struct batadv_softif_vlan *vlan = info->user_ptr[1]; 1124 + struct batadv_meshif_vlan *vlan = info->user_ptr[1]; 1125 1125 struct batadv_priv *bat_priv = info->user_ptr[0]; 1126 1126 struct nlattr *attr; 1127 1127 ··· 1137 1137 } 1138 1138 1139 1139 /** 1140 - * batadv_netlink_get_softif_from_ifindex() - Get soft-iface from ifindex 1140 + * batadv_netlink_get_meshif_from_ifindex() - Get mesh-iface from ifindex 1141 1141 * @net: the applicable net namespace 1142 - * @ifindex: index of the soft interface 1142 + * @ifindex: index of the mesh interface 1143 1143 * 1144 - * Return: Pointer to soft interface (with increased refcnt) on success, error 1144 + * Return: Pointer to mesh interface (with increased refcnt) on success, error 1145 1145 * pointer on error 1146 1146 */ 1147 1147 static struct net_device * 1148 - batadv_netlink_get_softif_from_ifindex(struct net *net, int ifindex) 1148 + batadv_netlink_get_meshif_from_ifindex(struct net *net, int ifindex) 1149 1149 { 1150 - struct net_device *soft_iface; 1150 + struct net_device *mesh_iface; 1151 1151 1152 - soft_iface = dev_get_by_index(net, ifindex); 1153 - if (!soft_iface) 1152 + mesh_iface = dev_get_by_index(net, ifindex); 1153 + if (!mesh_iface) 1154 1154 return ERR_PTR(-ENODEV); 1155 1155 1156 - if (!batadv_softif_is_valid(soft_iface)) 1157 - goto err_put_softif; 1156 + if (!batadv_meshif_is_valid(mesh_iface)) 1157 + goto err_put_meshif; 1158 1158 1159 - return soft_iface; 1159 + return mesh_iface; 1160 1160 1161 - err_put_softif: 1162 - dev_put(soft_iface); 1161 + err_put_meshif: 1162 + dev_put(mesh_iface); 1163 1163 1164 1164 return ERR_PTR(-EINVAL); 1165 1165 } 1166 1166 1167 1167 /** 1168 - * batadv_netlink_get_softif_from_info() - Get soft-iface from genl attributes 1168 + * batadv_netlink_get_meshif_from_info() - Get mesh-iface from genl attributes 1169 1169 * @net: the applicable net namespace 1170 1170 * @info: receiver information 1171 1171 * 1172 - * Return: Pointer to soft interface (with increased refcnt) on success, error 1172 + * Return: Pointer to mesh interface (with increased refcnt) on success, error 1173 1173 * pointer on error 1174 1174 */ 1175 1175 static struct net_device * 1176 - batadv_netlink_get_softif_from_info(struct net *net, struct genl_info *info) 1176 + batadv_netlink_get_meshif_from_info(struct net *net, struct genl_info *info) 1177 1177 { 1178 1178 int ifindex; 1179 1179 ··· 1182 1182 1183 1183 ifindex = nla_get_u32(info->attrs[BATADV_ATTR_MESH_IFINDEX]); 1184 1184 1185 - return batadv_netlink_get_softif_from_ifindex(net, ifindex); 1185 + return batadv_netlink_get_meshif_from_ifindex(net, ifindex); 1186 1186 } 1187 1187 1188 1188 /** 1189 - * batadv_netlink_get_softif() - Retrieve soft interface from netlink callback 1189 + * batadv_netlink_get_meshif() - Retrieve mesh interface from netlink callback 1190 1190 * @cb: callback structure containing arguments 1191 1191 * 1192 - * Return: Pointer to soft interface (with increased refcnt) on success, error 1192 + * Return: Pointer to mesh interface (with increased refcnt) on success, error 1193 1193 * pointer on error 1194 1194 */ 1195 - struct net_device *batadv_netlink_get_softif(struct netlink_callback *cb) 1195 + struct net_device *batadv_netlink_get_meshif(struct netlink_callback *cb) 1196 1196 { 1197 1197 int ifindex = batadv_netlink_get_ifindex(cb->nlh, 1198 1198 BATADV_ATTR_MESH_IFINDEX); 1199 1199 if (!ifindex) 1200 1200 return ERR_PTR(-ENONET); 1201 1201 1202 - return batadv_netlink_get_softif_from_ifindex(sock_net(cb->skb->sk), 1202 + return batadv_netlink_get_meshif_from_ifindex(sock_net(cb->skb->sk), 1203 1203 ifindex); 1204 1204 } 1205 1205 1206 1206 /** 1207 1207 * batadv_netlink_get_hardif_from_ifindex() - Get hard-iface from ifindex 1208 - * @bat_priv: the bat priv with all the soft interface information 1208 + * @bat_priv: the bat priv with all the mesh interface information 1209 1209 * @net: the applicable net namespace 1210 1210 * @ifindex: index of the hard interface 1211 1211 * ··· 1227 1227 if (!hard_iface) 1228 1228 goto err_put_harddev; 1229 1229 1230 - if (hard_iface->soft_iface != bat_priv->soft_iface) 1230 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 1231 1231 goto err_put_hardif; 1232 1232 1233 1233 /* hard_dev is referenced by hard_iface and not needed here */ ··· 1245 1245 1246 1246 /** 1247 1247 * batadv_netlink_get_hardif_from_info() - Get hard-iface from genl attributes 1248 - * @bat_priv: the bat priv with all the soft interface information 1248 + * @bat_priv: the bat priv with all the mesh interface information 1249 1249 * @net: the applicable net namespace 1250 1250 * @info: receiver information 1251 1251 * ··· 1268 1268 1269 1269 /** 1270 1270 * batadv_netlink_get_hardif() - Retrieve hard interface from netlink callback 1271 - * @bat_priv: the bat priv with all the soft interface information 1271 + * @bat_priv: the bat priv with all the mesh interface information 1272 1272 * @cb: callback structure containing arguments 1273 1273 * 1274 1274 * Return: Pointer to hard interface (with increased refcnt) on success, error ··· 1290 1290 1291 1291 /** 1292 1292 * batadv_get_vlan_from_info() - Retrieve vlan from genl attributes 1293 - * @bat_priv: the bat priv with all the soft interface information 1293 + * @bat_priv: the bat priv with all the mesh interface information 1294 1294 * @net: the applicable net namespace 1295 1295 * @info: receiver information 1296 1296 * 1297 1297 * Return: Pointer to vlan on success (with increased refcnt), error pointer 1298 1298 * on error 1299 1299 */ 1300 - static struct batadv_softif_vlan * 1300 + static struct batadv_meshif_vlan * 1301 1301 batadv_get_vlan_from_info(struct batadv_priv *bat_priv, struct net *net, 1302 1302 struct genl_info *info) 1303 1303 { 1304 - struct batadv_softif_vlan *vlan; 1304 + struct batadv_meshif_vlan *vlan; 1305 1305 u16 vid; 1306 1306 1307 1307 if (!info->attrs[BATADV_ATTR_VLANID]) ··· 1309 1309 1310 1310 vid = nla_get_u16(info->attrs[BATADV_ATTR_VLANID]); 1311 1311 1312 - vlan = batadv_softif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG); 1312 + vlan = batadv_meshif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG); 1313 1313 if (!vlan) 1314 1314 return ERR_PTR(-ENOENT); 1315 1315 ··· 1331 1331 struct net *net = genl_info_net(info); 1332 1332 struct batadv_hard_iface *hard_iface; 1333 1333 struct batadv_priv *bat_priv = NULL; 1334 - struct batadv_softif_vlan *vlan; 1335 - struct net_device *soft_iface; 1334 + struct batadv_meshif_vlan *vlan; 1335 + struct net_device *mesh_iface; 1336 1336 u8 user_ptr1_flags; 1337 1337 u8 mesh_dep_flags; 1338 1338 int ret; ··· 1347 1347 return -EINVAL; 1348 1348 1349 1349 if (ops->internal_flags & BATADV_FLAG_NEED_MESH) { 1350 - soft_iface = batadv_netlink_get_softif_from_info(net, info); 1351 - if (IS_ERR(soft_iface)) 1352 - return PTR_ERR(soft_iface); 1350 + mesh_iface = batadv_netlink_get_meshif_from_info(net, info); 1351 + if (IS_ERR(mesh_iface)) 1352 + return PTR_ERR(mesh_iface); 1353 1353 1354 - bat_priv = netdev_priv(soft_iface); 1354 + bat_priv = netdev_priv(mesh_iface); 1355 1355 info->user_ptr[0] = bat_priv; 1356 1356 } 1357 1357 ··· 1360 1360 info); 1361 1361 if (IS_ERR(hard_iface)) { 1362 1362 ret = PTR_ERR(hard_iface); 1363 - goto err_put_softif; 1363 + goto err_put_meshif; 1364 1364 } 1365 1365 1366 1366 info->user_ptr[1] = hard_iface; ··· 1370 1370 vlan = batadv_get_vlan_from_info(bat_priv, net, info); 1371 1371 if (IS_ERR(vlan)) { 1372 1372 ret = PTR_ERR(vlan); 1373 - goto err_put_softif; 1373 + goto err_put_meshif; 1374 1374 } 1375 1375 1376 1376 info->user_ptr[1] = vlan; ··· 1378 1378 1379 1379 return 0; 1380 1380 1381 - err_put_softif: 1381 + err_put_meshif: 1382 1382 if (bat_priv) 1383 - dev_put(bat_priv->soft_iface); 1383 + dev_put(bat_priv->mesh_iface); 1384 1384 1385 1385 return ret; 1386 1386 } ··· 1396 1396 struct genl_info *info) 1397 1397 { 1398 1398 struct batadv_hard_iface *hard_iface; 1399 - struct batadv_softif_vlan *vlan; 1399 + struct batadv_meshif_vlan *vlan; 1400 1400 struct batadv_priv *bat_priv; 1401 1401 1402 1402 if (ops->internal_flags & BATADV_FLAG_NEED_HARDIF && ··· 1408 1408 1409 1409 if (ops->internal_flags & BATADV_FLAG_NEED_VLAN && info->user_ptr[1]) { 1410 1410 vlan = info->user_ptr[1]; 1411 - batadv_softif_vlan_put(vlan); 1411 + batadv_meshif_vlan_put(vlan); 1412 1412 } 1413 1413 1414 1414 if (ops->internal_flags & BATADV_FLAG_NEED_MESH && info->user_ptr[0]) { 1415 1415 bat_priv = info->user_ptr[0]; 1416 - dev_put(bat_priv->soft_iface); 1416 + dev_put(bat_priv->mesh_iface); 1417 1417 } 1418 1418 } 1419 1419 ··· 1567 1567 1568 1568 ret = genl_register_family(&batadv_netlink_family); 1569 1569 if (ret) 1570 - pr_warn("unable to register netlink family"); 1570 + pr_warn("unable to register netlink family\n"); 1571 1571 } 1572 1572 1573 1573 /**
+1 -1
net/batman-adv/netlink.h
··· 15 15 16 16 void batadv_netlink_register(void); 17 17 void batadv_netlink_unregister(void); 18 - struct net_device *batadv_netlink_get_softif(struct netlink_callback *cb); 18 + struct net_device *batadv_netlink_get_meshif(struct netlink_callback *cb); 19 19 struct batadv_hard_iface * 20 20 batadv_netlink_get_hardif(struct batadv_priv *bat_priv, 21 21 struct netlink_callback *cb);
+32 -32
net/batman-adv/network-coding.c
··· 65 65 66 66 /** 67 67 * batadv_nc_start_timer() - initialise the nc periodic worker 68 - * @bat_priv: the bat priv with all the soft interface information 68 + * @bat_priv: the bat priv with all the mesh interface information 69 69 */ 70 70 static void batadv_nc_start_timer(struct batadv_priv *bat_priv) 71 71 { ··· 76 76 /** 77 77 * batadv_nc_tvlv_container_update() - update the network coding tvlv container 78 78 * after network coding setting change 79 - * @bat_priv: the bat priv with all the soft interface information 79 + * @bat_priv: the bat priv with all the mesh interface information 80 80 */ 81 81 static void batadv_nc_tvlv_container_update(struct batadv_priv *bat_priv) 82 82 { ··· 98 98 /** 99 99 * batadv_nc_status_update() - update the network coding tvlv container after 100 100 * network coding setting change 101 - * @net_dev: the soft interface net device 101 + * @net_dev: the mesh interface net device 102 102 */ 103 103 void batadv_nc_status_update(struct net_device *net_dev) 104 104 { ··· 109 109 110 110 /** 111 111 * batadv_nc_tvlv_ogm_handler_v1() - process incoming nc tvlv container 112 - * @bat_priv: the bat priv with all the soft interface information 112 + * @bat_priv: the bat priv with all the mesh interface information 113 113 * @orig: the orig_node of the ogm 114 114 * @flags: flags indicating the tvlv state (see batadv_tvlv_handler_flags) 115 115 * @tvlv_value: tvlv buffer containing the gateway data ··· 128 128 129 129 /** 130 130 * batadv_nc_mesh_init() - initialise coding hash table and start housekeeping 131 - * @bat_priv: the bat priv with all the soft interface information 131 + * @bat_priv: the bat priv with all the mesh interface information 132 132 * 133 133 * Return: 0 on success or negative error number in case of failure 134 134 */ ··· 171 171 172 172 /** 173 173 * batadv_nc_init_bat_priv() - initialise the nc specific bat_priv variables 174 - * @bat_priv: the bat priv with all the soft interface information 174 + * @bat_priv: the bat priv with all the mesh interface information 175 175 */ 176 176 void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv) 177 177 { ··· 267 267 268 268 /** 269 269 * batadv_nc_to_purge_nc_node() - checks whether an nc node has to be purged 270 - * @bat_priv: the bat priv with all the soft interface information 270 + * @bat_priv: the bat priv with all the mesh interface information 271 271 * @nc_node: the nc node to check 272 272 * 273 273 * Return: true if the entry has to be purged now, false otherwise ··· 283 283 284 284 /** 285 285 * batadv_nc_to_purge_nc_path_coding() - checks whether an nc path has timed out 286 - * @bat_priv: the bat priv with all the soft interface information 286 + * @bat_priv: the bat priv with all the mesh interface information 287 287 * @nc_path: the nc path to check 288 288 * 289 289 * Return: true if the entry has to be purged now, false otherwise ··· 304 304 /** 305 305 * batadv_nc_to_purge_nc_path_decoding() - checks whether an nc path has timed 306 306 * out 307 - * @bat_priv: the bat priv with all the soft interface information 307 + * @bat_priv: the bat priv with all the mesh interface information 308 308 * @nc_path: the nc path to check 309 309 * 310 310 * Return: true if the entry has to be purged now, false otherwise ··· 325 325 /** 326 326 * batadv_nc_purge_orig_nc_nodes() - go through list of nc nodes and purge stale 327 327 * entries 328 - * @bat_priv: the bat priv with all the soft interface information 328 + * @bat_priv: the bat priv with all the mesh interface information 329 329 * @list: list of nc nodes 330 330 * @lock: nc node list lock 331 331 * @to_purge: function in charge to decide whether an entry has to be purged or ··· 363 363 /** 364 364 * batadv_nc_purge_orig() - purges all nc node data attached of the given 365 365 * originator 366 - * @bat_priv: the bat priv with all the soft interface information 366 + * @bat_priv: the bat priv with all the mesh interface information 367 367 * @orig_node: orig_node with the nc node entries to be purged 368 368 * @to_purge: function in charge to decide whether an entry has to be purged or 369 369 * not. This function takes the nc node as argument and has to return ··· 389 389 /** 390 390 * batadv_nc_purge_orig_hash() - traverse entire originator hash to check if 391 391 * they have timed out nc nodes 392 - * @bat_priv: the bat priv with all the soft interface information 392 + * @bat_priv: the bat priv with all the mesh interface information 393 393 */ 394 394 static void batadv_nc_purge_orig_hash(struct batadv_priv *bat_priv) 395 395 { ··· 416 416 /** 417 417 * batadv_nc_purge_paths() - traverse all nc paths part of the hash and remove 418 418 * unused ones 419 - * @bat_priv: the bat priv with all the soft interface information 419 + * @bat_priv: the bat priv with all the mesh interface information 420 420 * @hash: hash table containing the nc paths to check 421 421 * @to_purge: function in charge to decide whether an entry has to be purged or 422 422 * not. This function takes the nc node as argument and has to return ··· 579 579 580 580 /** 581 581 * batadv_nc_sniffed_purge() - Checks timestamp of given sniffed nc_packet. 582 - * @bat_priv: the bat priv with all the soft interface information 582 + * @bat_priv: the bat priv with all the mesh interface information 583 583 * @nc_path: the nc path the packet belongs to 584 584 * @nc_packet: the nc packet to be checked 585 585 * ··· 618 618 619 619 /** 620 620 * batadv_nc_fwd_flush() - Checks the timestamp of the given nc packet. 621 - * @bat_priv: the bat priv with all the soft interface information 621 + * @bat_priv: the bat priv with all the mesh interface information 622 622 * @nc_path: the nc path the packet belongs to 623 623 * @nc_packet: the nc packet to be checked 624 624 * ··· 657 657 /** 658 658 * batadv_nc_process_nc_paths() - traverse given nc packet pool and free timed 659 659 * out nc packets 660 - * @bat_priv: the bat priv with all the soft interface information 660 + * @bat_priv: the bat priv with all the mesh interface information 661 661 * @hash: to be processed hash table 662 662 * @process_fn: Function called to process given nc packet. Should return true 663 663 * to encourage this function to proceed with the next packet. ··· 744 744 /** 745 745 * batadv_can_nc_with_orig() - checks whether the given orig node is suitable 746 746 * for coding or not 747 - * @bat_priv: the bat priv with all the soft interface information 747 + * @bat_priv: the bat priv with all the mesh interface information 748 748 * @orig_node: neighboring orig node which may be used as nc candidate 749 749 * @ogm_packet: incoming ogm packet also used for the checks 750 750 * ··· 825 825 /** 826 826 * batadv_nc_get_nc_node() - retrieves an nc node or creates the entry if it was 827 827 * not found 828 - * @bat_priv: the bat priv with all the soft interface information 828 + * @bat_priv: the bat priv with all the mesh interface information 829 829 * @orig_node: orig node originating the ogm packet 830 830 * @orig_neigh_node: neighboring orig node from which we received the ogm packet 831 831 * (can be equal to orig_node) ··· 888 888 /** 889 889 * batadv_nc_update_nc_node() - updates stored incoming and outgoing nc node 890 890 * structs (best called on incoming OGMs) 891 - * @bat_priv: the bat priv with all the soft interface information 891 + * @bat_priv: the bat priv with all the mesh interface information 892 892 * @orig_node: orig node originating the ogm packet 893 893 * @orig_neigh_node: neighboring orig node from which we received the ogm packet 894 894 * (can be equal to orig_node) ··· 940 940 941 941 /** 942 942 * batadv_nc_get_path() - get existing nc_path or allocate a new one 943 - * @bat_priv: the bat priv with all the soft interface information 943 + * @bat_priv: the bat priv with all the mesh interface information 944 944 * @hash: hash table containing the nc path 945 945 * @src: ethernet source address - first half of the nc path search key 946 946 * @dst: ethernet destination address - second half of the nc path search key ··· 1032 1032 /** 1033 1033 * batadv_nc_code_packets() - code a received unicast_packet with an nc packet 1034 1034 * into a coded_packet and send it 1035 - * @bat_priv: the bat priv with all the soft interface information 1035 + * @bat_priv: the bat priv with all the mesh interface information 1036 1036 * @skb: data skb to forward 1037 1037 * @ethhdr: pointer to the ethernet header inside the skb 1038 1038 * @nc_packet: structure containing the packet to the skb can be coded with ··· 1245 1245 /** 1246 1246 * batadv_nc_path_search() - Find the coding path matching in_nc_node and 1247 1247 * out_nc_node to retrieve a buffered packet that can be used for coding. 1248 - * @bat_priv: the bat priv with all the soft interface information 1248 + * @bat_priv: the bat priv with all the mesh interface information 1249 1249 * @in_nc_node: pointer to skb next hop's neighbor nc node 1250 1250 * @out_nc_node: pointer to skb source's neighbor nc node 1251 1251 * @skb: data skb to forward ··· 1313 1313 /** 1314 1314 * batadv_nc_skb_src_search() - Loops through the list of neighboring nodes of 1315 1315 * the skb's sender (may be equal to the originator). 1316 - * @bat_priv: the bat priv with all the soft interface information 1316 + * @bat_priv: the bat priv with all the mesh interface information 1317 1317 * @skb: data skb to forward 1318 1318 * @eth_dst: next hop mac address of skb 1319 1319 * @eth_src: source mac address of skb ··· 1359 1359 /** 1360 1360 * batadv_nc_skb_store_before_coding() - set the ethernet src and dst of the 1361 1361 * unicast skb before it is stored for use in later decoding 1362 - * @bat_priv: the bat priv with all the soft interface information 1362 + * @bat_priv: the bat priv with all the mesh interface information 1363 1363 * @skb: data skb to store 1364 1364 * @eth_dst_new: new destination mac address of skb 1365 1365 */ ··· 1408 1408 struct batadv_neigh_node *neigh_node, 1409 1409 struct ethhdr *ethhdr) 1410 1410 { 1411 - struct net_device *netdev = neigh_node->if_incoming->soft_iface; 1411 + struct net_device *netdev = neigh_node->if_incoming->mesh_iface; 1412 1412 struct batadv_priv *bat_priv = netdev_priv(netdev); 1413 1413 struct batadv_orig_node *orig_node = neigh_node->orig_node; 1414 1414 struct batadv_nc_node *nc_node; ··· 1495 1495 bool batadv_nc_skb_forward(struct sk_buff *skb, 1496 1496 struct batadv_neigh_node *neigh_node) 1497 1497 { 1498 - const struct net_device *netdev = neigh_node->if_incoming->soft_iface; 1498 + const struct net_device *netdev = neigh_node->if_incoming->mesh_iface; 1499 1499 struct batadv_priv *bat_priv = netdev_priv(netdev); 1500 1500 struct batadv_unicast_packet *packet; 1501 1501 struct batadv_nc_path *nc_path; ··· 1544 1544 /** 1545 1545 * batadv_nc_skb_store_for_decoding() - save a clone of the skb which can be 1546 1546 * used when decoding coded packets 1547 - * @bat_priv: the bat priv with all the soft interface information 1547 + * @bat_priv: the bat priv with all the mesh interface information 1548 1548 * @skb: data skb to store 1549 1549 */ 1550 1550 void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv, ··· 1605 1605 /** 1606 1606 * batadv_nc_skb_store_sniffed_unicast() - check if a received unicast packet 1607 1607 * should be saved in the decoding buffer and, if so, store it there 1608 - * @bat_priv: the bat priv with all the soft interface information 1608 + * @bat_priv: the bat priv with all the mesh interface information 1609 1609 * @skb: unicast skb to store 1610 1610 */ 1611 1611 void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv, ··· 1625 1625 /** 1626 1626 * batadv_nc_skb_decode_packet() - decode given skb using the decode data stored 1627 1627 * in nc_packet 1628 - * @bat_priv: the bat priv with all the soft interface information 1628 + * @bat_priv: the bat priv with all the mesh interface information 1629 1629 * @skb: unicast skb to decode 1630 1630 * @nc_packet: decode data needed to decode the skb 1631 1631 * ··· 1719 1719 /** 1720 1720 * batadv_nc_find_decoding_packet() - search through buffered decoding data to 1721 1721 * find the data needed to decode the coded packet 1722 - * @bat_priv: the bat priv with all the soft interface information 1722 + * @bat_priv: the bat priv with all the mesh interface information 1723 1723 * @ethhdr: pointer to the ethernet header inside the coded packet 1724 1724 * @coded: coded packet we try to find decode data for 1725 1725 * ··· 1793 1793 static int batadv_nc_recv_coded_packet(struct sk_buff *skb, 1794 1794 struct batadv_hard_iface *recv_if) 1795 1795 { 1796 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 1796 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 1797 1797 struct batadv_unicast_packet *unicast_packet; 1798 1798 struct batadv_coded_packet *coded_packet; 1799 1799 struct batadv_nc_packet *nc_packet; ··· 1858 1858 1859 1859 /** 1860 1860 * batadv_nc_mesh_free() - clean up network coding memory 1861 - * @bat_priv: the bat priv with all the soft interface information 1861 + * @bat_priv: the bat priv with all the mesh interface information 1862 1862 */ 1863 1863 void batadv_nc_mesh_free(struct batadv_priv *bat_priv) 1864 1864 {
+29 -29
net/batman-adv/originator.c
··· 47 47 48 48 /** 49 49 * batadv_orig_hash_find() - Find and return originator from orig_hash 50 - * @bat_priv: the bat priv with all the soft interface information 50 + * @bat_priv: the bat priv with all the mesh interface information 51 51 * @data: mac address of the originator 52 52 * 53 53 * Return: orig_node (with increased refcnt), NULL on errors ··· 213 213 214 214 /** 215 215 * batadv_originator_init() - Initialize all originator structures 216 - * @bat_priv: the bat priv with all the soft interface information 216 + * @bat_priv: the bat priv with all the mesh interface information 217 217 * 218 218 * Return: 0 on success or negative error number in case of failure 219 219 */ ··· 338 338 339 339 /** 340 340 * batadv_orig_to_router() - get next hop neighbor to an orig address 341 - * @bat_priv: the bat priv with all the soft interface information 341 + * @bat_priv: the bat priv with all the mesh interface information 342 342 * @orig_addr: the originator MAC address to search the best next hop router for 343 343 * @if_outgoing: the interface where the payload packet has been received or 344 344 * the OGM should be sent to ··· 567 567 const u8 *neigh_addr, 568 568 struct batadv_orig_node *orig_node) 569 569 { 570 - struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 570 + struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface); 571 571 struct batadv_hardif_neigh_node *hardif_neigh; 572 572 573 573 spin_lock_bh(&hard_iface->neigh_list_lock); ··· 754 754 int batadv_hardif_neigh_dump(struct sk_buff *msg, struct netlink_callback *cb) 755 755 { 756 756 struct batadv_hard_iface *primary_if, *hard_iface; 757 - struct net_device *soft_iface; 757 + struct net_device *mesh_iface; 758 758 struct batadv_priv *bat_priv; 759 759 int ret; 760 760 761 - soft_iface = batadv_netlink_get_softif(cb); 762 - if (IS_ERR(soft_iface)) 763 - return PTR_ERR(soft_iface); 761 + mesh_iface = batadv_netlink_get_meshif(cb); 762 + if (IS_ERR(mesh_iface)) 763 + return PTR_ERR(mesh_iface); 764 764 765 - bat_priv = netdev_priv(soft_iface); 765 + bat_priv = netdev_priv(mesh_iface); 766 766 767 767 primary_if = batadv_primary_if_get_selected(bat_priv); 768 768 if (!primary_if || primary_if->if_status != BATADV_IF_ACTIVE) { 769 769 ret = -ENOENT; 770 - goto out_put_soft_iface; 770 + goto out_put_mesh_iface; 771 771 } 772 772 773 773 hard_iface = batadv_netlink_get_hardif(bat_priv, cb); ··· 794 794 batadv_hardif_put(hard_iface); 795 795 out_put_primary_if: 796 796 batadv_hardif_put(primary_if); 797 - out_put_soft_iface: 798 - dev_put(soft_iface); 797 + out_put_mesh_iface: 798 + dev_put(mesh_iface); 799 799 800 800 return ret; 801 801 } ··· 892 892 893 893 /** 894 894 * batadv_originator_free() - Free all originator structures 895 - * @bat_priv: the bat priv with all the soft interface information 895 + * @bat_priv: the bat priv with all the mesh interface information 896 896 */ 897 897 void batadv_originator_free(struct batadv_priv *bat_priv) 898 898 { ··· 928 928 929 929 /** 930 930 * batadv_orig_node_new() - creates a new orig_node 931 - * @bat_priv: the bat priv with all the soft interface information 931 + * @bat_priv: the bat priv with all the mesh interface information 932 932 * @addr: the mac address of the originator 933 933 * 934 934 * Creates a new originator object and initialises all the generic fields. ··· 1009 1009 1010 1010 /** 1011 1011 * batadv_purge_neigh_ifinfo() - purge obsolete ifinfo entries from neighbor 1012 - * @bat_priv: the bat priv with all the soft interface information 1012 + * @bat_priv: the bat priv with all the mesh interface information 1013 1013 * @neigh: orig node which is to be checked 1014 1014 */ 1015 1015 static void ··· 1050 1050 1051 1051 /** 1052 1052 * batadv_purge_orig_ifinfo() - purge obsolete ifinfo entries from originator 1053 - * @bat_priv: the bat priv with all the soft interface information 1053 + * @bat_priv: the bat priv with all the mesh interface information 1054 1054 * @orig_node: orig node which is to be checked 1055 1055 * 1056 1056 * Return: true if any ifinfo entry was purged, false otherwise. ··· 1102 1102 1103 1103 /** 1104 1104 * batadv_purge_orig_neighbors() - purges neighbors from originator 1105 - * @bat_priv: the bat priv with all the soft interface information 1105 + * @bat_priv: the bat priv with all the mesh interface information 1106 1106 * @orig_node: orig node which is to be checked 1107 1107 * 1108 1108 * Return: true if any neighbor was purged, false otherwise ··· 1160 1160 1161 1161 /** 1162 1162 * batadv_find_best_neighbor() - finds the best neighbor after purging 1163 - * @bat_priv: the bat priv with all the soft interface information 1163 + * @bat_priv: the bat priv with all the mesh interface information 1164 1164 * @orig_node: orig node which is to be checked 1165 1165 * @if_outgoing: the interface for which the metric should be compared 1166 1166 * ··· 1194 1194 1195 1195 /** 1196 1196 * batadv_purge_orig_node() - purges obsolete information from an orig_node 1197 - * @bat_priv: the bat priv with all the soft interface information 1197 + * @bat_priv: the bat priv with all the mesh interface information 1198 1198 * @orig_node: orig node which is to be checked 1199 1199 * 1200 1200 * This function checks if the orig_node or substructures of it have become ··· 1236 1236 if (hard_iface->if_status != BATADV_IF_ACTIVE) 1237 1237 continue; 1238 1238 1239 - if (hard_iface->soft_iface != bat_priv->soft_iface) 1239 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 1240 1240 continue; 1241 1241 1242 1242 if (!kref_get_unless_zero(&hard_iface->refcount)) ··· 1258 1258 1259 1259 /** 1260 1260 * batadv_purge_orig_ref() - Purge all outdated originators 1261 - * @bat_priv: the bat priv with all the soft interface information 1261 + * @bat_priv: the bat priv with all the mesh interface information 1262 1262 */ 1263 1263 void batadv_purge_orig_ref(struct batadv_priv *bat_priv) 1264 1264 { ··· 1325 1325 int batadv_orig_dump(struct sk_buff *msg, struct netlink_callback *cb) 1326 1326 { 1327 1327 struct batadv_hard_iface *primary_if, *hard_iface; 1328 - struct net_device *soft_iface; 1328 + struct net_device *mesh_iface; 1329 1329 struct batadv_priv *bat_priv; 1330 1330 int ret; 1331 1331 1332 - soft_iface = batadv_netlink_get_softif(cb); 1333 - if (IS_ERR(soft_iface)) 1334 - return PTR_ERR(soft_iface); 1332 + mesh_iface = batadv_netlink_get_meshif(cb); 1333 + if (IS_ERR(mesh_iface)) 1334 + return PTR_ERR(mesh_iface); 1335 1335 1336 - bat_priv = netdev_priv(soft_iface); 1336 + bat_priv = netdev_priv(mesh_iface); 1337 1337 1338 1338 primary_if = batadv_primary_if_get_selected(bat_priv); 1339 1339 if (!primary_if || primary_if->if_status != BATADV_IF_ACTIVE) { 1340 1340 ret = -ENOENT; 1341 - goto out_put_soft_iface; 1341 + goto out_put_mesh_iface; 1342 1342 } 1343 1343 1344 1344 hard_iface = batadv_netlink_get_hardif(bat_priv, cb); ··· 1365 1365 batadv_hardif_put(hard_iface); 1366 1366 out_put_primary_if: 1367 1367 batadv_hardif_put(primary_if); 1368 - out_put_soft_iface: 1369 - dev_put(soft_iface); 1368 + out_put_mesh_iface: 1369 + dev_put(mesh_iface); 1370 1370 1371 1371 return ret; 1372 1372 }
+21 -21
net/batman-adv/routing.c
··· 30 30 #include "fragmentation.h" 31 31 #include "hard-interface.h" 32 32 #include "log.h" 33 + #include "mesh-interface.h" 33 34 #include "network-coding.h" 34 35 #include "originator.h" 35 36 #include "send.h" 36 - #include "soft-interface.h" 37 37 #include "tp_meter.h" 38 38 #include "translation-table.h" 39 39 #include "tvlv.h" ··· 43 43 44 44 /** 45 45 * _batadv_update_route() - set the router for this originator 46 - * @bat_priv: the bat priv with all the soft interface information 46 + * @bat_priv: the bat priv with all the mesh interface information 47 47 * @orig_node: orig node which is to be configured 48 48 * @recv_if: the receive interface for which this route is set 49 49 * @neigh_node: neighbor which should be the next router ··· 106 106 107 107 /** 108 108 * batadv_update_route() - set the router for this originator 109 - * @bat_priv: the bat priv with all the soft interface information 109 + * @bat_priv: the bat priv with all the mesh interface information 110 110 * @orig_node: orig node which is to be configured 111 111 * @recv_if: the receive interface for which this route is set 112 112 * @neigh_node: neighbor which should be the next router ··· 133 133 /** 134 134 * batadv_window_protected() - checks whether the host restarted and is in the 135 135 * protection time. 136 - * @bat_priv: the bat priv with all the soft interface information 136 + * @bat_priv: the bat priv with all the mesh interface information 137 137 * @seq_num_diff: difference between the current/received sequence number and 138 138 * the last sequence number 139 139 * @seq_old_max_diff: maximum age of sequence number not considered as restart ··· 207 207 208 208 /** 209 209 * batadv_recv_my_icmp_packet() - receive an icmp packet locally 210 - * @bat_priv: the bat priv with all the soft interface information 210 + * @bat_priv: the bat priv with all the mesh interface information 211 211 * @skb: icmp packet to process 212 212 * 213 213 * Return: NET_RX_SUCCESS if the packet has been consumed or NET_RX_DROP ··· 338 338 int batadv_recv_icmp_packet(struct sk_buff *skb, 339 339 struct batadv_hard_iface *recv_if) 340 340 { 341 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 341 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 342 342 struct batadv_icmp_header *icmph; 343 343 struct batadv_icmp_packet_rr *icmp_packet_rr; 344 344 struct ethhdr *ethhdr; ··· 428 428 429 429 /** 430 430 * batadv_check_unicast_packet() - Check for malformed unicast packets 431 - * @bat_priv: the bat priv with all the soft interface information 431 + * @bat_priv: the bat priv with all the mesh interface information 432 432 * @skb: packet to check 433 433 * @hdr_size: size of header to pull 434 434 * ··· 511 511 512 512 /** 513 513 * batadv_find_router() - find a suitable router for this originator 514 - * @bat_priv: the bat priv with all the soft interface information 514 + * @bat_priv: the bat priv with all the mesh interface information 515 515 * @orig_node: the destination node 516 516 * @recv_if: pointer to interface this packet was received on 517 517 * ··· 656 656 static int batadv_route_unicast_packet(struct sk_buff *skb, 657 657 struct batadv_hard_iface *recv_if) 658 658 { 659 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 659 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 660 660 struct batadv_orig_node *orig_node = NULL; 661 661 struct batadv_unicast_packet *unicast_packet; 662 662 struct ethhdr *ethhdr = eth_hdr(skb); ··· 727 727 728 728 /** 729 729 * batadv_reroute_unicast_packet() - update the unicast header for re-routing 730 - * @bat_priv: the bat priv with all the soft interface information 730 + * @bat_priv: the bat priv with all the mesh interface information 731 731 * @skb: unicast packet to process 732 732 * @unicast_packet: the unicast header to be updated 733 733 * @dst_addr: the payload destination ··· 879 879 return false; 880 880 881 881 /* update the header in order to let the packet be delivered to this 882 - * node's soft interface 882 + * node's mesh interface 883 883 */ 884 884 primary_if = batadv_primary_if_get_selected(bat_priv); 885 885 if (!primary_if) ··· 909 909 struct batadv_hard_iface *recv_if) 910 910 { 911 911 struct batadv_unicast_packet *unicast_packet; 912 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 912 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 913 913 int check, hdr_size = sizeof(*unicast_packet); 914 914 915 915 check = batadv_check_unicast_packet(bat_priv, skb, hdr_size); ··· 938 938 int batadv_recv_unicast_packet(struct sk_buff *skb, 939 939 struct batadv_hard_iface *recv_if) 940 940 { 941 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 941 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 942 942 struct batadv_unicast_packet *unicast_packet; 943 943 struct batadv_unicast_4addr_packet *unicast_4addr_packet; 944 944 u8 *orig_addr, *orig_addr_gw; ··· 1017 1017 1018 1018 batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size); 1019 1019 1020 - batadv_interface_rx(recv_if->soft_iface, skb, hdr_size, 1020 + batadv_interface_rx(recv_if->mesh_iface, skb, hdr_size, 1021 1021 orig_node); 1022 1022 1023 1023 rx_success: ··· 1047 1047 int batadv_recv_unicast_tvlv(struct sk_buff *skb, 1048 1048 struct batadv_hard_iface *recv_if) 1049 1049 { 1050 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 1050 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 1051 1051 struct batadv_unicast_tvlv_packet *unicast_tvlv_packet; 1052 1052 unsigned char *tvlv_buff; 1053 1053 u16 tvlv_buff_len; ··· 1103 1103 int batadv_recv_frag_packet(struct sk_buff *skb, 1104 1104 struct batadv_hard_iface *recv_if) 1105 1105 { 1106 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 1106 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 1107 1107 struct batadv_orig_node *orig_node_src = NULL; 1108 1108 struct batadv_frag_packet *frag_packet; 1109 1109 int ret = NET_RX_DROP; ··· 1165 1165 int batadv_recv_bcast_packet(struct sk_buff *skb, 1166 1166 struct batadv_hard_iface *recv_if) 1167 1167 { 1168 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 1168 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 1169 1169 struct batadv_orig_node *orig_node = NULL; 1170 1170 struct batadv_bcast_packet *bcast_packet; 1171 1171 struct ethhdr *ethhdr; ··· 1255 1255 batadv_dat_snoop_incoming_dhcp_ack(bat_priv, skb, hdr_size); 1256 1256 1257 1257 /* broadcast for me */ 1258 - batadv_interface_rx(recv_if->soft_iface, skb, hdr_size, orig_node); 1258 + batadv_interface_rx(recv_if->mesh_iface, skb, hdr_size, orig_node); 1259 1259 1260 1260 rx_success: 1261 1261 ret = NET_RX_SUCCESS; ··· 1279 1279 * 1280 1280 * Parses the given, received batman-adv multicast packet. Depending on the 1281 1281 * contents of its TVLV forwards it and/or decapsulates it to hand it to the 1282 - * soft interface. 1282 + * mesh interface. 1283 1283 * 1284 1284 * Return: NET_RX_DROP if the skb is not consumed, NET_RX_SUCCESS otherwise. 1285 1285 */ 1286 1286 int batadv_recv_mcast_packet(struct sk_buff *skb, 1287 1287 struct batadv_hard_iface *recv_if) 1288 1288 { 1289 - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 1289 + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface); 1290 1290 struct batadv_mcast_packet *mcast_packet; 1291 1291 int hdr_size = sizeof(*mcast_packet); 1292 1292 unsigned char *tvlv_buff; ··· 1329 1329 batadv_add_counter(bat_priv, BATADV_CNT_MCAST_RX_LOCAL_BYTES, 1330 1330 skb->len - hdr_size); 1331 1331 1332 - batadv_interface_rx(bat_priv->soft_iface, skb, hdr_size, NULL); 1332 + batadv_interface_rx(bat_priv->mesh_iface, skb, hdr_size, NULL); 1333 1333 /* skb was consumed */ 1334 1334 skb = NULL; 1335 1335 }
+18 -18
net/batman-adv/send.c
··· 34 34 #include "gateway_client.h" 35 35 #include "hard-interface.h" 36 36 #include "log.h" 37 + #include "mesh-interface.h" 37 38 #include "network-coding.h" 38 39 #include "originator.h" 39 40 #include "routing.h" 40 - #include "soft-interface.h" 41 41 #include "translation-table.h" 42 42 43 43 static void batadv_send_outstanding_bcast_packet(struct work_struct *work); ··· 68 68 struct ethhdr *ethhdr; 69 69 int ret; 70 70 71 - bat_priv = netdev_priv(hard_iface->soft_iface); 71 + bat_priv = netdev_priv(hard_iface->mesh_iface); 72 72 73 73 if (hard_iface->if_status != BATADV_IF_ACTIVE) 74 74 goto send_skb_err; ··· 272 272 /** 273 273 * batadv_send_skb_prepare_unicast_4addr() - encapsulate an skb with a 274 274 * unicast 4addr header 275 - * @bat_priv: the bat priv with all the soft interface information 275 + * @bat_priv: the bat priv with all the mesh interface information 276 276 * @skb: the skb containing the payload to encapsulate 277 277 * @orig: the destination node 278 278 * @packet_subtype: the unicast 4addr packet subtype to use ··· 314 314 315 315 /** 316 316 * batadv_send_skb_unicast() - encapsulate and send an skb via unicast 317 - * @bat_priv: the bat priv with all the soft interface information 317 + * @bat_priv: the bat priv with all the mesh interface information 318 318 * @skb: payload to send 319 319 * @packet_type: the batman unicast packet type to use 320 320 * @packet_subtype: the unicast 4addr packet subtype (only relevant for unicast ··· 384 384 385 385 /** 386 386 * batadv_send_skb_via_tt_generic() - send an skb via TT lookup 387 - * @bat_priv: the bat priv with all the soft interface information 387 + * @bat_priv: the bat priv with all the mesh interface information 388 388 * @skb: payload to send 389 389 * @packet_type: the batman unicast packet type to use 390 390 * @packet_subtype: the unicast 4addr packet subtype (only relevant for unicast ··· 430 430 431 431 /** 432 432 * batadv_send_skb_via_gw() - send an skb via gateway lookup 433 - * @bat_priv: the bat priv with all the soft interface information 433 + * @bat_priv: the bat priv with all the mesh interface information 434 434 * @skb: payload to send 435 435 * @vid: the vid to be used to search the translation table 436 436 * ··· 532 532 forw_packet->queue_left = queue_left; 533 533 forw_packet->if_incoming = if_incoming; 534 534 forw_packet->if_outgoing = if_outgoing; 535 - forw_packet->num_packets = 0; 535 + forw_packet->num_packets = 1; 536 536 537 537 return forw_packet; 538 538 ··· 695 695 696 696 /** 697 697 * batadv_forw_packet_bcast_queue() - try to queue a broadcast packet 698 - * @bat_priv: the bat priv with all the soft interface information 698 + * @bat_priv: the bat priv with all the mesh interface information 699 699 * @forw_packet: the forwarding packet to queue 700 700 * @send_time: timestamp (jiffies) when the packet is to be sent 701 701 * ··· 714 714 715 715 /** 716 716 * batadv_forw_packet_ogmv1_queue() - try to queue an OGMv1 packet 717 - * @bat_priv: the bat priv with all the soft interface information 717 + * @bat_priv: the bat priv with all the mesh interface information 718 718 * @forw_packet: the forwarding packet to queue 719 719 * @send_time: timestamp (jiffies) when the packet is to be sent 720 720 * ··· 732 732 733 733 /** 734 734 * batadv_forw_bcast_packet_to_list() - queue broadcast packet for transmissions 735 - * @bat_priv: the bat priv with all the soft interface information 735 + * @bat_priv: the bat priv with all the mesh interface information 736 736 * @skb: broadcast packet to add 737 737 * @delay: number of jiffies to wait before sending 738 738 * @own_packet: true if it is a self-generated broadcast packet ··· 787 787 788 788 /** 789 789 * batadv_forw_bcast_packet_if() - forward and queue a broadcast packet 790 - * @bat_priv: the bat priv with all the soft interface information 790 + * @bat_priv: the bat priv with all the mesh interface information 791 791 * @skb: broadcast packet to add 792 792 * @delay: number of jiffies to wait before sending 793 793 * @own_packet: true if it is a self-generated broadcast packet ··· 838 838 839 839 /** 840 840 * batadv_send_no_broadcast() - check whether (re)broadcast is necessary 841 - * @bat_priv: the bat priv with all the soft interface information 841 + * @bat_priv: the bat priv with all the mesh interface information 842 842 * @skb: broadcast packet to check 843 843 * @own_packet: true if it is a self-generated broadcast packet 844 844 * @if_out: the outgoing interface checked and considered for (re)broadcast ··· 900 900 901 901 /** 902 902 * __batadv_forw_bcast_packet() - forward and queue a broadcast packet 903 - * @bat_priv: the bat priv with all the soft interface information 903 + * @bat_priv: the bat priv with all the mesh interface information 904 904 * @skb: broadcast packet to add 905 905 * @delay: number of jiffies to wait before sending 906 906 * @own_packet: true if it is a self-generated broadcast packet ··· 930 930 931 931 rcu_read_lock(); 932 932 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { 933 - if (hard_iface->soft_iface != bat_priv->soft_iface) 933 + if (hard_iface->mesh_iface != bat_priv->mesh_iface) 934 934 continue; 935 935 936 936 if (!kref_get_unless_zero(&hard_iface->refcount)) ··· 958 958 959 959 /** 960 960 * batadv_forw_bcast_packet() - forward and queue a broadcast packet 961 - * @bat_priv: the bat priv with all the soft interface information 961 + * @bat_priv: the bat priv with all the mesh interface information 962 962 * @skb: broadcast packet to add 963 963 * @delay: number of jiffies to wait before sending 964 964 * @own_packet: true if it is a self-generated broadcast packet ··· 979 979 980 980 /** 981 981 * batadv_send_bcast_packet() - send and queue a broadcast packet 982 - * @bat_priv: the bat priv with all the soft interface information 982 + * @bat_priv: the bat priv with all the mesh interface information 983 983 * @skb: broadcast packet to add 984 984 * @delay: number of jiffies to wait before sending 985 985 * @own_packet: true if it is a self-generated broadcast packet ··· 1060 1060 delayed_work = to_delayed_work(work); 1061 1061 forw_packet = container_of(delayed_work, struct batadv_forw_packet, 1062 1062 delayed_work); 1063 - bat_priv = netdev_priv(forw_packet->if_incoming->soft_iface); 1063 + bat_priv = netdev_priv(forw_packet->if_incoming->mesh_iface); 1064 1064 1065 1065 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_DEACTIVATING) { 1066 1066 dropped = true; ··· 1095 1095 1096 1096 /** 1097 1097 * batadv_purge_outstanding_packets() - stop/purge scheduled bcast/OGMv1 packets 1098 - * @bat_priv: the bat priv with all the soft interface information 1098 + * @bat_priv: the bat priv with all the mesh interface information 1099 1099 * @hard_iface: the hard interface to cancel and purge bcast/ogm packets on 1100 1100 * 1101 1101 * This method cancels and purges any broadcast and OGMv1 packet on the given
+2 -2
net/batman-adv/send.h
··· 68 68 69 69 /** 70 70 * batadv_send_skb_via_tt() - send an skb via TT lookup 71 - * @bat_priv: the bat priv with all the soft interface information 71 + * @bat_priv: the bat priv with all the mesh interface information 72 72 * @skb: the payload to send 73 73 * @dst_hint: can be used to override the destination contained in the skb 74 74 * @vid: the vid to be used to search the translation table ··· 89 89 90 90 /** 91 91 * batadv_send_skb_via_tt_4addr() - send an skb via TT lookup 92 - * @bat_priv: the bat priv with all the soft interface information 92 + * @bat_priv: the bat priv with all the mesh interface information 93 93 * @skb: the payload to send 94 94 * @packet_subtype: the unicast 4addr packet subtype to use 95 95 * @dst_hint: can be used to override the destination contained in the skb
+99 -98
net/batman-adv/soft-interface.c net/batman-adv/mesh-interface.c
··· 4 4 * Marek Lindner, Simon Wunderlich 5 5 */ 6 6 7 - #include "soft-interface.h" 7 + #include "mesh-interface.h" 8 8 #include "main.h" 9 9 10 10 #include <linux/atomic.h> ··· 91 91 92 92 /** 93 93 * batadv_sum_counter() - Sum the cpu-local counters for index 'idx' 94 - * @bat_priv: the bat priv with all the soft interface information 94 + * @bat_priv: the bat priv with all the mesh interface information 95 95 * @idx: index of counter to sum up 96 96 * 97 97 * Return: sum of all cpu-local counters ··· 125 125 static int batadv_interface_set_mac_addr(struct net_device *dev, void *p) 126 126 { 127 127 struct batadv_priv *bat_priv = netdev_priv(dev); 128 - struct batadv_softif_vlan *vlan; 128 + struct batadv_meshif_vlan *vlan; 129 129 struct sockaddr *addr = p; 130 130 u8 old_addr[ETH_ALEN]; 131 131 ··· 140 140 return 0; 141 141 142 142 rcu_read_lock(); 143 - hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) { 143 + hlist_for_each_entry_rcu(vlan, &bat_priv->meshif_vlan_list, list) { 144 144 batadv_tt_local_remove(bat_priv, old_addr, vlan->vid, 145 145 "mac address changed", false); 146 146 batadv_tt_local_add(dev, addr->sa_data, vlan->vid, ··· 170 170 * @dev: registered network device to modify 171 171 * 172 172 * We do not actually need to set any rx filters for the virtual batman 173 - * soft interface. However a dummy handler enables a user to set static 173 + * mesh interface. However a dummy handler enables a user to set static 174 174 * multicast listeners for instance. 175 175 */ 176 176 static void batadv_interface_set_rx_mode(struct net_device *dev) ··· 178 178 } 179 179 180 180 static netdev_tx_t batadv_interface_tx(struct sk_buff *skb, 181 - struct net_device *soft_iface) 181 + struct net_device *mesh_iface) 182 182 { 183 183 struct ethhdr *ethhdr; 184 - struct batadv_priv *bat_priv = netdev_priv(soft_iface); 184 + struct batadv_priv *bat_priv = netdev_priv(mesh_iface); 185 185 struct batadv_hard_iface *primary_if = NULL; 186 186 struct batadv_bcast_packet *bcast_packet; 187 187 static const u8 stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00, ··· 209 209 /* reset control block to avoid left overs from previous users */ 210 210 memset(skb->cb, 0, sizeof(struct batadv_skb_cb)); 211 211 212 - netif_trans_update(soft_iface); 212 + netif_trans_update(mesh_iface); 213 213 vid = batadv_get_vid(skb, 0); 214 214 215 215 skb_reset_mac_header(skb); ··· 246 246 /* Register the client MAC in the transtable */ 247 247 if (!is_multicast_ether_addr(ethhdr->h_source) && 248 248 !batadv_bla_is_loopdetect_mac(ethhdr->h_source)) { 249 - client_added = batadv_tt_local_add(soft_iface, ethhdr->h_source, 249 + client_added = batadv_tt_local_add(mesh_iface, ethhdr->h_source, 250 250 vid, skb->skb_iif, 251 251 skb->mark); 252 252 if (!client_added) ··· 397 397 398 398 /** 399 399 * batadv_interface_rx() - receive ethernet frame on local batman-adv interface 400 - * @soft_iface: local interface which will receive the ethernet frame 401 - * @skb: ethernet frame for @soft_iface 400 + * @mesh_iface: local interface which will receive the ethernet frame 401 + * @skb: ethernet frame for @mesh_iface 402 402 * @hdr_size: size of already parsed batman-adv header 403 403 * @orig_node: originator from which the batman-adv packet was sent 404 404 * 405 - * Sends an ethernet frame to the receive path of the local @soft_iface. 405 + * Sends an ethernet frame to the receive path of the local @mesh_iface. 406 406 * skb->data has still point to the batman-adv header with the size @hdr_size. 407 407 * The caller has to have parsed this header already and made sure that at least 408 408 * @hdr_size bytes are still available for pull in @skb. ··· 412 412 * unicast packets will be dropped directly when it was sent between two 413 413 * isolated clients. 414 414 */ 415 - void batadv_interface_rx(struct net_device *soft_iface, 415 + void batadv_interface_rx(struct net_device *mesh_iface, 416 416 struct sk_buff *skb, int hdr_size, 417 417 struct batadv_orig_node *orig_node) 418 418 { 419 419 struct batadv_bcast_packet *batadv_bcast_packet; 420 - struct batadv_priv *bat_priv = netdev_priv(soft_iface); 420 + struct batadv_priv *bat_priv = netdev_priv(mesh_iface); 421 421 struct vlan_ethhdr *vhdr; 422 422 struct ethhdr *ethhdr; 423 423 unsigned short vid; ··· 457 457 } 458 458 459 459 /* skb->dev & skb->pkt_type are set here */ 460 - skb->protocol = eth_type_trans(skb, soft_iface); 460 + skb->protocol = eth_type_trans(skb, mesh_iface); 461 461 skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN); 462 462 463 463 batadv_inc_counter(bat_priv, BATADV_CNT_RX); ··· 502 502 } 503 503 504 504 /** 505 - * batadv_softif_vlan_release() - release vlan from lists and queue for free 505 + * batadv_meshif_vlan_release() - release vlan from lists and queue for free 506 506 * after rcu grace period 507 507 * @ref: kref pointer of the vlan object 508 508 */ 509 - void batadv_softif_vlan_release(struct kref *ref) 509 + void batadv_meshif_vlan_release(struct kref *ref) 510 510 { 511 - struct batadv_softif_vlan *vlan; 511 + struct batadv_meshif_vlan *vlan; 512 512 513 - vlan = container_of(ref, struct batadv_softif_vlan, refcount); 513 + vlan = container_of(ref, struct batadv_meshif_vlan, refcount); 514 514 515 - spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock); 515 + spin_lock_bh(&vlan->bat_priv->meshif_vlan_list_lock); 516 516 hlist_del_rcu(&vlan->list); 517 - spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock); 517 + spin_unlock_bh(&vlan->bat_priv->meshif_vlan_list_lock); 518 518 519 519 kfree_rcu(vlan, rcu); 520 520 } 521 521 522 522 /** 523 - * batadv_softif_vlan_get() - get the vlan object for a specific vid 524 - * @bat_priv: the bat priv with all the soft interface information 523 + * batadv_meshif_vlan_get() - get the vlan object for a specific vid 524 + * @bat_priv: the bat priv with all the mesh interface information 525 525 * @vid: the identifier of the vlan object to retrieve 526 526 * 527 527 * Return: the private data of the vlan matching the vid passed as argument or 528 528 * NULL otherwise. The refcounter of the returned object is incremented by 1. 529 529 */ 530 - struct batadv_softif_vlan *batadv_softif_vlan_get(struct batadv_priv *bat_priv, 530 + struct batadv_meshif_vlan *batadv_meshif_vlan_get(struct batadv_priv *bat_priv, 531 531 unsigned short vid) 532 532 { 533 - struct batadv_softif_vlan *vlan_tmp, *vlan = NULL; 533 + struct batadv_meshif_vlan *vlan_tmp, *vlan = NULL; 534 534 535 535 rcu_read_lock(); 536 - hlist_for_each_entry_rcu(vlan_tmp, &bat_priv->softif_vlan_list, list) { 536 + hlist_for_each_entry_rcu(vlan_tmp, &bat_priv->meshif_vlan_list, list) { 537 537 if (vlan_tmp->vid != vid) 538 538 continue; 539 539 ··· 549 549 } 550 550 551 551 /** 552 - * batadv_softif_create_vlan() - allocate the needed resources for a new vlan 553 - * @bat_priv: the bat priv with all the soft interface information 552 + * batadv_meshif_create_vlan() - allocate the needed resources for a new vlan 553 + * @bat_priv: the bat priv with all the mesh interface information 554 554 * @vid: the VLAN identifier 555 555 * 556 556 * Return: 0 on success, a negative error otherwise. 557 557 */ 558 - int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid) 558 + int batadv_meshif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid) 559 559 { 560 - struct batadv_softif_vlan *vlan; 560 + struct batadv_meshif_vlan *vlan; 561 561 562 - spin_lock_bh(&bat_priv->softif_vlan_list_lock); 562 + spin_lock_bh(&bat_priv->meshif_vlan_list_lock); 563 563 564 - vlan = batadv_softif_vlan_get(bat_priv, vid); 564 + vlan = batadv_meshif_vlan_get(bat_priv, vid); 565 565 if (vlan) { 566 - batadv_softif_vlan_put(vlan); 567 - spin_unlock_bh(&bat_priv->softif_vlan_list_lock); 566 + batadv_meshif_vlan_put(vlan); 567 + spin_unlock_bh(&bat_priv->meshif_vlan_list_lock); 568 568 return -EEXIST; 569 569 } 570 570 571 571 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC); 572 572 if (!vlan) { 573 - spin_unlock_bh(&bat_priv->softif_vlan_list_lock); 573 + spin_unlock_bh(&bat_priv->meshif_vlan_list_lock); 574 574 return -ENOMEM; 575 575 } 576 576 ··· 581 581 atomic_set(&vlan->ap_isolation, 0); 582 582 583 583 kref_get(&vlan->refcount); 584 - hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list); 585 - spin_unlock_bh(&bat_priv->softif_vlan_list_lock); 584 + hlist_add_head_rcu(&vlan->list, &bat_priv->meshif_vlan_list); 585 + spin_unlock_bh(&bat_priv->meshif_vlan_list_lock); 586 586 587 587 /* add a new TT local entry. This one will be marked with the NOPURGE 588 588 * flag 589 589 */ 590 - batadv_tt_local_add(bat_priv->soft_iface, 591 - bat_priv->soft_iface->dev_addr, vid, 590 + batadv_tt_local_add(bat_priv->mesh_iface, 591 + bat_priv->mesh_iface->dev_addr, vid, 592 592 BATADV_NULL_IFINDEX, BATADV_NO_MARK); 593 593 594 - /* don't return reference to new softif_vlan */ 595 - batadv_softif_vlan_put(vlan); 594 + /* don't return reference to new meshif_vlan */ 595 + batadv_meshif_vlan_put(vlan); 596 596 597 597 return 0; 598 598 } 599 599 600 600 /** 601 - * batadv_softif_destroy_vlan() - remove and destroy a softif_vlan object 602 - * @bat_priv: the bat priv with all the soft interface information 601 + * batadv_meshif_destroy_vlan() - remove and destroy a meshif_vlan object 602 + * @bat_priv: the bat priv with all the mesh interface information 603 603 * @vlan: the object to remove 604 604 */ 605 - static void batadv_softif_destroy_vlan(struct batadv_priv *bat_priv, 606 - struct batadv_softif_vlan *vlan) 605 + static void batadv_meshif_destroy_vlan(struct batadv_priv *bat_priv, 606 + struct batadv_meshif_vlan *vlan) 607 607 { 608 608 /* explicitly remove the associated TT local entry because it is marked 609 609 * with the NOPURGE flag 610 610 */ 611 - batadv_tt_local_remove(bat_priv, bat_priv->soft_iface->dev_addr, 611 + batadv_tt_local_remove(bat_priv, bat_priv->mesh_iface->dev_addr, 612 612 vlan->vid, "vlan interface destroyed", false); 613 613 614 - batadv_softif_vlan_put(vlan); 614 + batadv_meshif_vlan_put(vlan); 615 615 } 616 616 617 617 /** ··· 629 629 unsigned short vid) 630 630 { 631 631 struct batadv_priv *bat_priv = netdev_priv(dev); 632 - struct batadv_softif_vlan *vlan; 632 + struct batadv_meshif_vlan *vlan; 633 633 634 634 /* only 802.1Q vlans are supported. 635 635 * batman-adv does not know how to handle other types ··· 648 648 vid |= BATADV_VLAN_HAS_TAG; 649 649 650 650 /* if a new vlan is getting created and it already exists, it means that 651 - * it was not deleted yet. batadv_softif_vlan_get() increases the 651 + * it was not deleted yet. batadv_meshif_vlan_get() increases the 652 652 * refcount in order to revive the object. 653 653 * 654 654 * if it does not exist then create it. 655 655 */ 656 - vlan = batadv_softif_vlan_get(bat_priv, vid); 656 + vlan = batadv_meshif_vlan_get(bat_priv, vid); 657 657 if (!vlan) 658 - return batadv_softif_create_vlan(bat_priv, vid); 658 + return batadv_meshif_create_vlan(bat_priv, vid); 659 659 660 660 /* add a new TT local entry. This one will be marked with the NOPURGE 661 661 * flag. This must be added again, even if the vlan object already 662 662 * exists, because the entry was deleted by kill_vid() 663 663 */ 664 - batadv_tt_local_add(bat_priv->soft_iface, 665 - bat_priv->soft_iface->dev_addr, vid, 664 + batadv_tt_local_add(bat_priv->mesh_iface, 665 + bat_priv->mesh_iface->dev_addr, vid, 666 666 BATADV_NULL_IFINDEX, BATADV_NO_MARK); 667 667 668 668 return 0; ··· 684 684 unsigned short vid) 685 685 { 686 686 struct batadv_priv *bat_priv = netdev_priv(dev); 687 - struct batadv_softif_vlan *vlan; 687 + struct batadv_meshif_vlan *vlan; 688 688 689 689 /* only 802.1Q vlans are supported. batman-adv does not know how to 690 690 * handle other types ··· 693 693 return -EINVAL; 694 694 695 695 /* "priority tag" frames are handled like "untagged" frames 696 - * and no softif_vlan needs to be destroyed 696 + * and no meshif_vlan needs to be destroyed 697 697 */ 698 698 if (vid == 0) 699 699 return 0; 700 700 701 - vlan = batadv_softif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG); 701 + vlan = batadv_meshif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG); 702 702 if (!vlan) 703 703 return -ENOENT; 704 704 705 - batadv_softif_destroy_vlan(bat_priv, vlan); 705 + batadv_meshif_destroy_vlan(bat_priv, vlan); 706 706 707 707 /* finally free the vlan object */ 708 - batadv_softif_vlan_put(vlan); 708 + batadv_meshif_vlan_put(vlan); 709 709 710 710 return 0; 711 711 } ··· 741 741 } 742 742 743 743 /** 744 - * batadv_softif_init_late() - late stage initialization of soft interface 744 + * batadv_meshif_init_late() - late stage initialization of mesh interface 745 745 * @dev: registered network device to modify 746 746 * 747 747 * Return: error code on failures 748 748 */ 749 - static int batadv_softif_init_late(struct net_device *dev) 749 + static int batadv_meshif_init_late(struct net_device *dev) 750 750 { 751 751 struct batadv_priv *bat_priv; 752 752 u32 random_seqno; ··· 756 756 batadv_set_lockdep_class(dev); 757 757 758 758 bat_priv = netdev_priv(dev); 759 - bat_priv->soft_iface = dev; 759 + bat_priv->mesh_iface = dev; 760 760 761 761 /* batadv_interface_stats() needs to be available as soon as 762 762 * register_netdevice() has been called ··· 790 790 atomic_set(&bat_priv->log_level, 0); 791 791 #endif 792 792 atomic_set(&bat_priv->fragmentation, 1); 793 - atomic_set(&bat_priv->packet_size_max, ETH_DATA_LEN); 793 + atomic_set(&bat_priv->packet_size_max, BATADV_MAX_MTU); 794 794 atomic_set(&bat_priv->bcast_queue_left, BATADV_BCAST_QUEUE_LEN); 795 795 atomic_set(&bat_priv->batman_queue_left, BATADV_BATMAN_QUEUE_LEN); 796 796 ··· 837 837 } 838 838 839 839 /** 840 - * batadv_softif_slave_add() - Add a slave interface to a batadv_soft_interface 841 - * @dev: batadv_soft_interface used as master interface 840 + * batadv_meshif_slave_add() - Add a slave interface to a batadv_mesh_interface 841 + * @dev: batadv_mesh_interface used as master interface 842 842 * @slave_dev: net_device which should become the slave interface 843 843 * @extack: extended ACK report struct 844 844 * 845 845 * Return: 0 if successful or error otherwise. 846 846 */ 847 - static int batadv_softif_slave_add(struct net_device *dev, 847 + static int batadv_meshif_slave_add(struct net_device *dev, 848 848 struct net_device *slave_dev, 849 849 struct netlink_ext_ack *extack) 850 850 { ··· 852 852 int ret = -EINVAL; 853 853 854 854 hard_iface = batadv_hardif_get_by_netdev(slave_dev); 855 - if (!hard_iface || hard_iface->soft_iface) 855 + if (!hard_iface || hard_iface->mesh_iface) 856 856 goto out; 857 857 858 858 ret = batadv_hardif_enable_interface(hard_iface, dev); ··· 863 863 } 864 864 865 865 /** 866 - * batadv_softif_slave_del() - Delete a slave iface from a batadv_soft_interface 867 - * @dev: batadv_soft_interface used as master interface 866 + * batadv_meshif_slave_del() - Delete a slave iface from a batadv_mesh_interface 867 + * @dev: batadv_mesh_interface used as master interface 868 868 * @slave_dev: net_device which should be removed from the master interface 869 869 * 870 870 * Return: 0 if successful or error otherwise. 871 871 */ 872 - static int batadv_softif_slave_del(struct net_device *dev, 872 + static int batadv_meshif_slave_del(struct net_device *dev, 873 873 struct net_device *slave_dev) 874 874 { 875 875 struct batadv_hard_iface *hard_iface; ··· 877 877 878 878 hard_iface = batadv_hardif_get_by_netdev(slave_dev); 879 879 880 - if (!hard_iface || hard_iface->soft_iface != dev) 880 + if (!hard_iface || hard_iface->mesh_iface != dev) 881 881 goto out; 882 882 883 883 batadv_hardif_disable_interface(hard_iface); ··· 889 889 } 890 890 891 891 static const struct net_device_ops batadv_netdev_ops = { 892 - .ndo_init = batadv_softif_init_late, 892 + .ndo_init = batadv_meshif_init_late, 893 893 .ndo_open = batadv_interface_open, 894 894 .ndo_stop = batadv_interface_release, 895 895 .ndo_get_stats = batadv_interface_stats, ··· 900 900 .ndo_set_rx_mode = batadv_interface_set_rx_mode, 901 901 .ndo_start_xmit = batadv_interface_tx, 902 902 .ndo_validate_addr = eth_validate_addr, 903 - .ndo_add_slave = batadv_softif_slave_add, 904 - .ndo_del_slave = batadv_softif_slave_del, 903 + .ndo_add_slave = batadv_meshif_slave_add, 904 + .ndo_del_slave = batadv_meshif_slave_del, 905 905 }; 906 906 907 907 static void batadv_get_drvinfo(struct net_device *dev, ··· 1009 1009 }; 1010 1010 1011 1011 /** 1012 - * batadv_softif_free() - Deconstructor of batadv_soft_interface 1012 + * batadv_meshif_free() - Deconstructor of batadv_mesh_interface 1013 1013 * @dev: Device to cleanup and remove 1014 1014 */ 1015 - static void batadv_softif_free(struct net_device *dev) 1015 + static void batadv_meshif_free(struct net_device *dev) 1016 1016 { 1017 1017 batadv_mesh_free(dev); 1018 1018 ··· 1024 1024 } 1025 1025 1026 1026 /** 1027 - * batadv_softif_init_early() - early stage initialization of soft interface 1027 + * batadv_meshif_init_early() - early stage initialization of mesh interface 1028 1028 * @dev: registered network device to modify 1029 1029 */ 1030 - static void batadv_softif_init_early(struct net_device *dev) 1030 + static void batadv_meshif_init_early(struct net_device *dev) 1031 1031 { 1032 1032 ether_setup(dev); 1033 1033 1034 1034 dev->netdev_ops = &batadv_netdev_ops; 1035 1035 dev->needs_free_netdev = true; 1036 - dev->priv_destructor = batadv_softif_free; 1036 + dev->priv_destructor = batadv_meshif_free; 1037 1037 dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; 1038 1038 dev->priv_flags |= IFF_NO_QUEUE; 1039 1039 dev->lltx = true; ··· 1043 1043 * have not been initialized yet 1044 1044 */ 1045 1045 dev->mtu = ETH_DATA_LEN; 1046 + dev->max_mtu = BATADV_MAX_MTU; 1046 1047 1047 1048 /* generate random address */ 1048 1049 eth_hw_addr_random(dev); ··· 1052 1051 } 1053 1052 1054 1053 /** 1055 - * batadv_softif_validate() - validate configuration of new batadv link 1054 + * batadv_meshif_validate() - validate configuration of new batadv link 1056 1055 * @tb: IFLA_INFO_DATA netlink attributes 1057 1056 * @data: enum batadv_ifla_attrs attributes 1058 1057 * @extack: extended ACK report struct 1059 1058 * 1060 1059 * Return: 0 if successful or error otherwise. 1061 1060 */ 1062 - static int batadv_softif_validate(struct nlattr *tb[], struct nlattr *data[], 1061 + static int batadv_meshif_validate(struct nlattr *tb[], struct nlattr *data[], 1063 1062 struct netlink_ext_ack *extack) 1064 1063 { 1065 1064 struct batadv_algo_ops *algo_ops; ··· 1077 1076 } 1078 1077 1079 1078 /** 1080 - * batadv_softif_newlink() - pre-initialize and register new batadv link 1079 + * batadv_meshif_newlink() - pre-initialize and register new batadv link 1081 1080 * @dev: network device to register 1082 1081 * @params: rtnl newlink parameters 1083 1082 * @extack: extended ACK report struct 1084 1083 * 1085 1084 * Return: 0 if successful or error otherwise. 1086 1085 */ 1087 - static int batadv_softif_newlink(struct net_device *dev, 1086 + static int batadv_meshif_newlink(struct net_device *dev, 1088 1087 struct rtnl_newlink_params *params, 1089 1088 struct netlink_ext_ack *extack) 1090 1089 { ··· 1104 1103 } 1105 1104 1106 1105 /** 1107 - * batadv_softif_destroy_netlink() - deletion of batadv_soft_interface via 1106 + * batadv_meshif_destroy_netlink() - deletion of batadv_mesh_interface via 1108 1107 * netlink 1109 - * @soft_iface: the to-be-removed batman-adv interface 1108 + * @mesh_iface: the to-be-removed batman-adv interface 1110 1109 * @head: list pointer 1111 1110 */ 1112 - static void batadv_softif_destroy_netlink(struct net_device *soft_iface, 1111 + static void batadv_meshif_destroy_netlink(struct net_device *mesh_iface, 1113 1112 struct list_head *head) 1114 1113 { 1115 - struct batadv_priv *bat_priv = netdev_priv(soft_iface); 1114 + struct batadv_priv *bat_priv = netdev_priv(mesh_iface); 1116 1115 struct batadv_hard_iface *hard_iface; 1117 - struct batadv_softif_vlan *vlan; 1116 + struct batadv_meshif_vlan *vlan; 1118 1117 1119 1118 list_for_each_entry(hard_iface, &batadv_hardif_list, list) { 1120 - if (hard_iface->soft_iface == soft_iface) 1119 + if (hard_iface->mesh_iface == mesh_iface) 1121 1120 batadv_hardif_disable_interface(hard_iface); 1122 1121 } 1123 1122 1124 1123 /* destroy the "untagged" VLAN */ 1125 - vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); 1124 + vlan = batadv_meshif_vlan_get(bat_priv, BATADV_NO_FLAGS); 1126 1125 if (vlan) { 1127 - batadv_softif_destroy_vlan(bat_priv, vlan); 1128 - batadv_softif_vlan_put(vlan); 1126 + batadv_meshif_destroy_vlan(bat_priv, vlan); 1127 + batadv_meshif_vlan_put(vlan); 1129 1128 } 1130 1129 1131 - unregister_netdevice_queue(soft_iface, head); 1130 + unregister_netdevice_queue(mesh_iface, head); 1132 1131 } 1133 1132 1134 1133 /** 1135 - * batadv_softif_is_valid() - Check whether device is a batadv soft interface 1134 + * batadv_meshif_is_valid() - Check whether device is a batadv mesh interface 1136 1135 * @net_dev: device which should be checked 1137 1136 * 1138 1137 * Return: true when net_dev is a batman-adv interface, false otherwise 1139 1138 */ 1140 - bool batadv_softif_is_valid(const struct net_device *net_dev) 1139 + bool batadv_meshif_is_valid(const struct net_device *net_dev) 1141 1140 { 1142 1141 if (net_dev->netdev_ops->ndo_start_xmit == batadv_interface_tx) 1143 1142 return true; ··· 1152 1151 struct rtnl_link_ops batadv_link_ops __read_mostly = { 1153 1152 .kind = "batadv", 1154 1153 .priv_size = sizeof(struct batadv_priv), 1155 - .setup = batadv_softif_init_early, 1154 + .setup = batadv_meshif_init_early, 1156 1155 .maxtype = IFLA_BATADV_MAX, 1157 1156 .policy = batadv_ifla_policy, 1158 - .validate = batadv_softif_validate, 1159 - .newlink = batadv_softif_newlink, 1160 - .dellink = batadv_softif_destroy_netlink, 1157 + .validate = batadv_meshif_validate, 1158 + .newlink = batadv_meshif_newlink, 1159 + .dellink = batadv_meshif_destroy_netlink, 1161 1160 };
-42
net/batman-adv/soft-interface.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* Copyright (C) B.A.T.M.A.N. contributors: 3 - * 4 - * Marek Lindner 5 - */ 6 - 7 - #ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_ 8 - #define _NET_BATMAN_ADV_SOFT_INTERFACE_H_ 9 - 10 - #include "main.h" 11 - 12 - #include <linux/kref.h> 13 - #include <linux/netdevice.h> 14 - #include <linux/skbuff.h> 15 - #include <linux/types.h> 16 - #include <net/rtnetlink.h> 17 - 18 - int batadv_skb_head_push(struct sk_buff *skb, unsigned int len); 19 - void batadv_interface_rx(struct net_device *soft_iface, 20 - struct sk_buff *skb, int hdr_size, 21 - struct batadv_orig_node *orig_node); 22 - bool batadv_softif_is_valid(const struct net_device *net_dev); 23 - extern struct rtnl_link_ops batadv_link_ops; 24 - int batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid); 25 - void batadv_softif_vlan_release(struct kref *ref); 26 - struct batadv_softif_vlan *batadv_softif_vlan_get(struct batadv_priv *bat_priv, 27 - unsigned short vid); 28 - 29 - /** 30 - * batadv_softif_vlan_put() - decrease the vlan object refcounter and 31 - * possibly release it 32 - * @vlan: the vlan object to release 33 - */ 34 - static inline void batadv_softif_vlan_put(struct batadv_softif_vlan *vlan) 35 - { 36 - if (!vlan) 37 - return; 38 - 39 - kref_put(&vlan->refcount, batadv_softif_vlan_release); 40 - } 41 - 42 - #endif /* _NET_BATMAN_ADV_SOFT_INTERFACE_H_ */
+15 -15
net/batman-adv/tp_meter.c
··· 206 206 * batadv_tp_batctl_notify() - send client status result to client 207 207 * @reason: reason for tp meter session stop 208 208 * @dst: destination of tp_meter session 209 - * @bat_priv: the bat priv with all the soft interface information 209 + * @bat_priv: the bat priv with all the mesh interface information 210 210 * @start_time: start of transmission in jiffies 211 211 * @total_sent: bytes acked to the receiver 212 212 * @cookie: cookie of tp_meter session ··· 238 238 * batadv_tp_batctl_error_notify() - send client error result to client 239 239 * @reason: reason for tp meter session stop 240 240 * @dst: destination of tp_meter session 241 - * @bat_priv: the bat priv with all the soft interface information 241 + * @bat_priv: the bat priv with all the mesh interface information 242 242 * @cookie: cookie of tp_meter session 243 243 */ 244 244 static void batadv_tp_batctl_error_notify(enum batadv_tp_meter_reason reason, ··· 251 251 252 252 /** 253 253 * batadv_tp_list_find() - find a tp_vars object in the global list 254 - * @bat_priv: the bat priv with all the soft interface information 254 + * @bat_priv: the bat priv with all the mesh interface information 255 255 * @dst: the other endpoint MAC address to look for 256 256 * 257 257 * Look for a tp_vars object matching dst as end_point and return it after ··· 287 287 /** 288 288 * batadv_tp_list_find_session() - find tp_vars session object in the global 289 289 * list 290 - * @bat_priv: the bat priv with all the soft interface information 290 + * @bat_priv: the bat priv with all the mesh interface information 291 291 * @dst: the other endpoint MAC address to look for 292 292 * @session: session identifier 293 293 * ··· 366 366 367 367 /** 368 368 * batadv_tp_sender_cleanup() - cleanup sender data and drop and timer 369 - * @bat_priv: the bat priv with all the soft interface information 369 + * @bat_priv: the bat priv with all the mesh interface information 370 370 * @tp_vars: the private data of the current TP meter session to cleanup 371 371 */ 372 372 static void batadv_tp_sender_cleanup(struct batadv_priv *bat_priv, ··· 396 396 397 397 /** 398 398 * batadv_tp_sender_end() - print info about ended session and inform client 399 - * @bat_priv: the bat priv with all the soft interface information 399 + * @bat_priv: the bat priv with all the mesh interface information 400 400 * @tp_vars: the private data of the current TP meter session 401 401 */ 402 402 static void batadv_tp_sender_end(struct batadv_priv *bat_priv, ··· 619 619 620 620 /** 621 621 * batadv_tp_recv_ack() - ACK receiving function 622 - * @bat_priv: the bat priv with all the soft interface information 622 + * @bat_priv: the bat priv with all the mesh interface information 623 623 * @skb: the buffer containing the received packet 624 624 * 625 625 * Process a received TP ACK packet ··· 832 832 } 833 833 834 834 /* assume that all the hard_interfaces have a correctly 835 - * configured MTU, so use the soft_iface MTU as MSS. 835 + * configured MTU, so use the mesh_iface MTU as MSS. 836 836 * This might not be true and in that case the fragmentation 837 837 * should be used. 838 838 * Now, try to send the packet as it is ··· 927 927 928 928 /** 929 929 * batadv_tp_start() - start a new tp meter session 930 - * @bat_priv: the bat priv with all the soft interface information 930 + * @bat_priv: the bat priv with all the mesh interface information 931 931 * @dst: the receiver MAC address 932 932 * @test_length: test length in milliseconds 933 933 * @cookie: session cookie ··· 993 993 994 994 /* initialise the CWND to 3*MSS (Section 3.1 in RFC5681). 995 995 * For batman-adv the MSS is the size of the payload received by the 996 - * soft_interface, hence its MTU 996 + * mesh_interface, hence its MTU 997 997 */ 998 998 tp_vars->cwnd = BATADV_TP_PLEN * 3; 999 999 /* at the beginning initialise the SS threshold to the biggest possible ··· 1052 1052 1053 1053 /** 1054 1054 * batadv_tp_stop() - stop currently running tp meter session 1055 - * @bat_priv: the bat priv with all the soft interface information 1055 + * @bat_priv: the bat priv with all the mesh interface information 1056 1056 * @dst: the receiver MAC address 1057 1057 * @return_value: reason for tp meter session stop 1058 1058 */ ··· 1141 1141 1142 1142 /** 1143 1143 * batadv_tp_send_ack() - send an ACK packet 1144 - * @bat_priv: the bat priv with all the soft interface information 1144 + * @bat_priv: the bat priv with all the mesh interface information 1145 1145 * @dst: the mac address of the destination originator 1146 1146 * @seq: the sequence number to ACK 1147 1147 * @timestamp: the timestamp to echo back in the ACK ··· 1320 1320 1321 1321 /** 1322 1322 * batadv_tp_init_recv() - return matching or create new receiver tp_vars 1323 - * @bat_priv: the bat priv with all the soft interface information 1323 + * @bat_priv: the bat priv with all the mesh interface information 1324 1324 * @icmp: received icmp tp msg 1325 1325 * 1326 1326 * Return: corresponding tp_vars or NULL on errors ··· 1373 1373 1374 1374 /** 1375 1375 * batadv_tp_recv_msg() - process a single data message 1376 - * @bat_priv: the bat priv with all the soft interface information 1376 + * @bat_priv: the bat priv with all the mesh interface information 1377 1377 * @skb: the buffer containing the received packet 1378 1378 * 1379 1379 * Process a received TP MSG packet ··· 1457 1457 1458 1458 /** 1459 1459 * batadv_tp_meter_recv() - main TP Meter receiving function 1460 - * @bat_priv: the bat priv with all the soft interface information 1460 + * @bat_priv: the bat priv with all the mesh interface information 1461 1461 * @skb: the buffer containing the received packet 1462 1462 */ 1463 1463 void batadv_tp_meter_recv(struct batadv_priv *bat_priv, struct sk_buff *skb)
+1 -1
net/batman-adv/trace.h
··· 34 34 TP_ARGS(bat_priv, vaf), 35 35 36 36 TP_STRUCT__entry( 37 - __string(device, bat_priv->soft_iface->name) 37 + __string(device, bat_priv->mesh_iface->name) 38 38 __string(driver, KBUILD_MODNAME) 39 39 __vstring(msg, vaf->fmt, vaf->va) 40 40 ),
+99 -99
net/batman-adv/translation-table.c
··· 47 47 #include "hard-interface.h" 48 48 #include "hash.h" 49 49 #include "log.h" 50 + #include "mesh-interface.h" 50 51 #include "netlink.h" 51 52 #include "originator.h" 52 - #include "soft-interface.h" 53 53 #include "tvlv.h" 54 54 55 55 static struct kmem_cache *batadv_tl_cache __read_mostly; ··· 161 161 162 162 /** 163 163 * batadv_tt_local_hash_find() - search the local table for a given client 164 - * @bat_priv: the bat priv with all the soft interface information 164 + * @bat_priv: the bat priv with all the mesh interface information 165 165 * @addr: the mac address of the client to look for 166 166 * @vid: VLAN identifier 167 167 * ··· 186 186 187 187 /** 188 188 * batadv_tt_global_hash_find() - search the global table for a given client 189 - * @bat_priv: the bat priv with all the soft interface information 189 + * @bat_priv: the bat priv with all the mesh interface information 190 190 * @addr: the mac address of the client to look for 191 191 * @vid: VLAN identifier 192 192 * ··· 221 221 tt_local_entry = container_of(ref, struct batadv_tt_local_entry, 222 222 common.refcount); 223 223 224 - batadv_softif_vlan_put(tt_local_entry->vlan); 224 + batadv_meshif_vlan_put(tt_local_entry->vlan); 225 225 226 226 kfree_rcu(tt_local_entry, common.rcu); 227 227 } ··· 260 260 261 261 /** 262 262 * batadv_tt_global_hash_count() - count the number of orig entries 263 - * @bat_priv: the bat priv with all the soft interface information 263 + * @bat_priv: the bat priv with all the mesh interface information 264 264 * @addr: the mac address of the client to count entries for 265 265 * @vid: VLAN identifier 266 266 * ··· 286 286 /** 287 287 * batadv_tt_local_size_mod() - change the size by v of the local table 288 288 * identified by vid 289 - * @bat_priv: the bat priv with all the soft interface information 289 + * @bat_priv: the bat priv with all the mesh interface information 290 290 * @vid: the VLAN identifier of the sub-table to change 291 291 * @v: the amount to sum to the local table size 292 292 */ 293 293 static void batadv_tt_local_size_mod(struct batadv_priv *bat_priv, 294 294 unsigned short vid, int v) 295 295 { 296 - struct batadv_softif_vlan *vlan; 296 + struct batadv_meshif_vlan *vlan; 297 297 298 - vlan = batadv_softif_vlan_get(bat_priv, vid); 298 + vlan = batadv_meshif_vlan_get(bat_priv, vid); 299 299 if (!vlan) 300 300 return; 301 301 302 302 atomic_add(v, &vlan->tt.num_entries); 303 303 304 - batadv_softif_vlan_put(vlan); 304 + batadv_meshif_vlan_put(vlan); 305 305 } 306 306 307 307 /** 308 308 * batadv_tt_local_size_inc() - increase by one the local table size for the 309 309 * given vid 310 - * @bat_priv: the bat priv with all the soft interface information 310 + * @bat_priv: the bat priv with all the mesh interface information 311 311 * @vid: the VLAN identifier 312 312 */ 313 313 static void batadv_tt_local_size_inc(struct batadv_priv *bat_priv, ··· 319 319 /** 320 320 * batadv_tt_local_size_dec() - decrease by one the local table size for the 321 321 * given vid 322 - * @bat_priv: the bat priv with all the soft interface information 322 + * @bat_priv: the bat priv with all the mesh interface information 323 323 * @vid: the VLAN identifier 324 324 */ 325 325 static void batadv_tt_local_size_dec(struct batadv_priv *bat_priv, ··· 412 412 413 413 /** 414 414 * batadv_tt_local_event() - store a local TT event (ADD/DEL) 415 - * @bat_priv: the bat priv with all the soft interface information 415 + * @bat_priv: the bat priv with all the mesh interface information 416 416 * @tt_local_entry: the TT entry involved in the event 417 417 * @event_flags: flags to store in the event structure 418 418 */ ··· 504 504 /** 505 505 * batadv_tt_local_table_transmit_size() - calculates the local translation 506 506 * table size when transmitted over the air 507 - * @bat_priv: the bat priv with all the soft interface information 507 + * @bat_priv: the bat priv with all the mesh interface information 508 508 * 509 509 * Return: local translation table size in bytes. 510 510 */ ··· 512 512 { 513 513 u16 num_vlan = 0; 514 514 u16 tt_local_entries = 0; 515 - struct batadv_softif_vlan *vlan; 515 + struct batadv_meshif_vlan *vlan; 516 516 int hdr_size; 517 517 518 518 rcu_read_lock(); 519 - hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) { 519 + hlist_for_each_entry_rcu(vlan, &bat_priv->meshif_vlan_list, list) { 520 520 num_vlan++; 521 521 tt_local_entries += atomic_read(&vlan->tt.num_entries); 522 522 } ··· 576 576 /** 577 577 * batadv_tt_local_add() - add a new client to the local table or update an 578 578 * existing client 579 - * @soft_iface: netdev struct of the mesh interface 579 + * @mesh_iface: netdev struct of the mesh interface 580 580 * @addr: the mac address of the client to add 581 581 * @vid: VLAN identifier 582 582 * @ifindex: index of the interface where the client is connected to (useful to ··· 586 586 * 587 587 * Return: true if the client was successfully added, false otherwise. 588 588 */ 589 - bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr, 589 + bool batadv_tt_local_add(struct net_device *mesh_iface, const u8 *addr, 590 590 unsigned short vid, int ifindex, u32 mark) 591 591 { 592 - struct batadv_priv *bat_priv = netdev_priv(soft_iface); 592 + struct batadv_priv *bat_priv = netdev_priv(mesh_iface); 593 593 struct batadv_tt_local_entry *tt_local; 594 594 struct batadv_tt_global_entry *tt_global = NULL; 595 - struct net *net = dev_net(soft_iface); 596 - struct batadv_softif_vlan *vlan; 595 + struct net *net = dev_net(mesh_iface); 596 + struct batadv_meshif_vlan *vlan; 597 597 struct net_device *in_dev = NULL; 598 598 struct batadv_hard_iface *in_hardif = NULL; 599 599 struct hlist_head *head; ··· 650 650 table_size += batadv_tt_len(1); 651 651 packet_size_max = atomic_read(&bat_priv->packet_size_max); 652 652 if (table_size > packet_size_max) { 653 - net_ratelimited_function(batadv_info, soft_iface, 653 + net_ratelimited_function(batadv_info, mesh_iface, 654 654 "Local translation table size (%i) exceeds maximum packet size (%i); Ignoring new local tt entry: %pM\n", 655 655 table_size, packet_size_max, addr); 656 656 goto out; ··· 661 661 goto out; 662 662 663 663 /* increase the refcounter of the related vlan */ 664 - vlan = batadv_softif_vlan_get(bat_priv, vid); 664 + vlan = batadv_meshif_vlan_get(bat_priv, vid); 665 665 if (!vlan) { 666 - net_ratelimited_function(batadv_info, soft_iface, 666 + net_ratelimited_function(batadv_info, mesh_iface, 667 667 "adding TT local entry %pM to non-existent VLAN %d\n", 668 668 addr, batadv_print_vid(vid)); 669 669 kmem_cache_free(batadv_tl_cache, tt_local); ··· 693 693 /* the batman interface mac and multicast addresses should never be 694 694 * purged 695 695 */ 696 - if (batadv_compare_eth(addr, soft_iface->dev_addr) || 696 + if (batadv_compare_eth(addr, mesh_iface->dev_addr) || 697 697 is_multicast_ether_addr(addr)) 698 698 tt_local->common.flags |= BATADV_TT_CLIENT_NOPURGE; 699 699 ··· 849 849 /** 850 850 * batadv_tt_prepare_tvlv_local_data() - allocate and prepare the TT TVLV for 851 851 * this node 852 - * @bat_priv: the bat priv with all the soft interface information 852 + * @bat_priv: the bat priv with all the mesh interface information 853 853 * @tt_data: uninitialised pointer to the address of the TVLV buffer 854 854 * @tt_change: uninitialised pointer to the address of the area where the TT 855 855 * changes can be stored ··· 871 871 s32 *tt_len) 872 872 { 873 873 struct batadv_tvlv_tt_vlan_data *tt_vlan; 874 - struct batadv_softif_vlan *vlan; 874 + struct batadv_meshif_vlan *vlan; 875 875 u16 num_vlan = 0; 876 876 u16 vlan_entries = 0; 877 877 u16 total_entries = 0; ··· 879 879 u8 *tt_change_ptr; 880 880 int change_offset; 881 881 882 - spin_lock_bh(&bat_priv->softif_vlan_list_lock); 883 - hlist_for_each_entry(vlan, &bat_priv->softif_vlan_list, list) { 882 + spin_lock_bh(&bat_priv->meshif_vlan_list_lock); 883 + hlist_for_each_entry(vlan, &bat_priv->meshif_vlan_list, list) { 884 884 vlan_entries = atomic_read(&vlan->tt.num_entries); 885 885 if (vlan_entries < 1) 886 886 continue; ··· 909 909 (*tt_data)->num_vlan = htons(num_vlan); 910 910 911 911 tt_vlan = (*tt_data)->vlan_data; 912 - hlist_for_each_entry(vlan, &bat_priv->softif_vlan_list, list) { 912 + hlist_for_each_entry(vlan, &bat_priv->meshif_vlan_list, list) { 913 913 vlan_entries = atomic_read(&vlan->tt.num_entries); 914 914 if (vlan_entries < 1) 915 915 continue; ··· 925 925 *tt_change = (struct batadv_tvlv_tt_change *)tt_change_ptr; 926 926 927 927 out: 928 - spin_unlock_bh(&bat_priv->softif_vlan_list_lock); 928 + spin_unlock_bh(&bat_priv->meshif_vlan_list_lock); 929 929 return tvlv_len; 930 930 } 931 931 932 932 /** 933 933 * batadv_tt_tvlv_container_update() - update the translation table tvlv 934 934 * container after local tt changes have been committed 935 - * @bat_priv: the bat priv with all the soft interface information 935 + * @bat_priv: the bat priv with all the mesh interface information 936 936 */ 937 937 static void batadv_tt_tvlv_container_update(struct batadv_priv *bat_priv) 938 938 { ··· 956 956 * The local change history should still be cleaned up so the next 957 957 * TT round can start again with a clean state. 958 958 */ 959 - if (tt_diff_len > bat_priv->soft_iface->mtu) { 959 + if (tt_diff_len > bat_priv->mesh_iface->mtu) { 960 960 tt_diff_len = 0; 961 961 tt_diff_entries_num = 0; 962 962 drop_changes = true; ··· 1025 1025 * @msg :Netlink message to dump into 1026 1026 * @portid: Port making netlink request 1027 1027 * @cb: Control block containing additional options 1028 - * @bat_priv: The bat priv with all the soft interface information 1028 + * @bat_priv: The bat priv with all the mesh interface information 1029 1029 * @common: tt local & tt global common data 1030 1030 * 1031 1031 * Return: Error code, or 0 on success ··· 1037 1037 struct batadv_tt_common_entry *common) 1038 1038 { 1039 1039 void *hdr; 1040 - struct batadv_softif_vlan *vlan; 1040 + struct batadv_meshif_vlan *vlan; 1041 1041 struct batadv_tt_local_entry *local; 1042 1042 unsigned int last_seen_msecs; 1043 1043 u32 crc; ··· 1045 1045 local = container_of(common, struct batadv_tt_local_entry, common); 1046 1046 last_seen_msecs = jiffies_to_msecs(jiffies - local->last_seen); 1047 1047 1048 - vlan = batadv_softif_vlan_get(bat_priv, common->vid); 1048 + vlan = batadv_meshif_vlan_get(bat_priv, common->vid); 1049 1049 if (!vlan) 1050 1050 return 0; 1051 1051 1052 1052 crc = vlan->tt.crc; 1053 1053 1054 - batadv_softif_vlan_put(vlan); 1054 + batadv_meshif_vlan_put(vlan); 1055 1055 1056 1056 hdr = genlmsg_put(msg, portid, cb->nlh->nlmsg_seq, 1057 1057 &batadv_netlink_family, NLM_F_MULTI, ··· 1084 1084 * @msg: Netlink message to dump into 1085 1085 * @portid: Port making netlink request 1086 1086 * @cb: Control block containing additional options 1087 - * @bat_priv: The bat priv with all the soft interface information 1087 + * @bat_priv: The bat priv with all the mesh interface information 1088 1088 * @hash: hash to dump 1089 1089 * @bucket: bucket index to dump 1090 1090 * @idx_s: Number of entries to skip ··· 1130 1130 */ 1131 1131 int batadv_tt_local_dump(struct sk_buff *msg, struct netlink_callback *cb) 1132 1132 { 1133 - struct net_device *soft_iface; 1133 + struct net_device *mesh_iface; 1134 1134 struct batadv_priv *bat_priv; 1135 1135 struct batadv_hard_iface *primary_if = NULL; 1136 1136 struct batadv_hashtable *hash; ··· 1139 1139 int idx = cb->args[1]; 1140 1140 int portid = NETLINK_CB(cb->skb).portid; 1141 1141 1142 - soft_iface = batadv_netlink_get_softif(cb); 1143 - if (IS_ERR(soft_iface)) 1144 - return PTR_ERR(soft_iface); 1142 + mesh_iface = batadv_netlink_get_meshif(cb); 1143 + if (IS_ERR(mesh_iface)) 1144 + return PTR_ERR(mesh_iface); 1145 1145 1146 - bat_priv = netdev_priv(soft_iface); 1146 + bat_priv = netdev_priv(mesh_iface); 1147 1147 1148 1148 primary_if = batadv_primary_if_get_selected(bat_priv); 1149 1149 if (!primary_if || primary_if->if_status != BATADV_IF_ACTIVE) { ··· 1165 1165 1166 1166 out: 1167 1167 batadv_hardif_put(primary_if); 1168 - dev_put(soft_iface); 1168 + dev_put(mesh_iface); 1169 1169 1170 1170 cb->args[0] = bucket; 1171 1171 cb->args[1] = idx; ··· 1194 1194 1195 1195 /** 1196 1196 * batadv_tt_local_remove() - logically remove an entry from the local table 1197 - * @bat_priv: the bat priv with all the soft interface information 1197 + * @bat_priv: the bat priv with all the mesh interface information 1198 1198 * @addr: the MAC address of the client to remove 1199 1199 * @vid: VLAN identifier 1200 1200 * @message: message to append to the log on deletion ··· 1259 1259 1260 1260 /** 1261 1261 * batadv_tt_local_purge_list() - purge inactive tt local entries 1262 - * @bat_priv: the bat priv with all the soft interface information 1262 + * @bat_priv: the bat priv with all the mesh interface information 1263 1263 * @head: pointer to the list containing the local tt entries 1264 1264 * @timeout: parameter deciding whether a given tt local entry is considered 1265 1265 * inactive or not ··· 1294 1294 1295 1295 /** 1296 1296 * batadv_tt_local_purge() - purge inactive tt local entries 1297 - * @bat_priv: the bat priv with all the soft interface information 1297 + * @bat_priv: the bat priv with all the mesh interface information 1298 1298 * @timeout: parameter deciding whether a given tt local entry is considered 1299 1299 * inactive or not 1300 1300 */ ··· 1529 1529 1530 1530 /** 1531 1531 * batadv_tt_global_add() - add a new TT global entry or update an existing one 1532 - * @bat_priv: the bat priv with all the soft interface information 1532 + * @bat_priv: the bat priv with all the mesh interface information 1533 1533 * @orig_node: the originator announcing the client 1534 1534 * @tt_addr: the mac address of the non-mesh client 1535 1535 * @vid: VLAN identifier ··· 1702 1702 1703 1703 /** 1704 1704 * batadv_transtable_best_orig() - Get best originator list entry from tt entry 1705 - * @bat_priv: the bat priv with all the soft interface information 1705 + * @bat_priv: the bat priv with all the mesh interface information 1706 1706 * @tt_global_entry: global translation table entry to be analyzed 1707 1707 * 1708 1708 * This function assumes the caller holds rcu_read_lock(). ··· 1809 1809 * @msg: Netlink message to dump into 1810 1810 * @portid: Port making netlink request 1811 1811 * @seq: Sequence number of netlink message 1812 - * @bat_priv: The bat priv with all the soft interface information 1812 + * @bat_priv: The bat priv with all the mesh interface information 1813 1813 * @common: tt local & tt global common data 1814 1814 * @sub_s: Number of entries to skip 1815 1815 * ··· 1854 1854 * @msg: Netlink message to dump into 1855 1855 * @portid: Port making netlink request 1856 1856 * @seq: Sequence number of netlink message 1857 - * @bat_priv: The bat priv with all the soft interface information 1857 + * @bat_priv: The bat priv with all the mesh interface information 1858 1858 * @head: Pointer to the list containing the global tt entries 1859 1859 * @idx_s: Number of entries to skip 1860 1860 * @sub: Number of entries to skip ··· 1897 1897 */ 1898 1898 int batadv_tt_global_dump(struct sk_buff *msg, struct netlink_callback *cb) 1899 1899 { 1900 - struct net_device *soft_iface; 1900 + struct net_device *mesh_iface; 1901 1901 struct batadv_priv *bat_priv; 1902 1902 struct batadv_hard_iface *primary_if = NULL; 1903 1903 struct batadv_hashtable *hash; ··· 1908 1908 int sub = cb->args[2]; 1909 1909 int portid = NETLINK_CB(cb->skb).portid; 1910 1910 1911 - soft_iface = batadv_netlink_get_softif(cb); 1912 - if (IS_ERR(soft_iface)) 1913 - return PTR_ERR(soft_iface); 1911 + mesh_iface = batadv_netlink_get_meshif(cb); 1912 + if (IS_ERR(mesh_iface)) 1913 + return PTR_ERR(mesh_iface); 1914 1914 1915 - bat_priv = netdev_priv(soft_iface); 1915 + bat_priv = netdev_priv(mesh_iface); 1916 1916 1917 1917 primary_if = batadv_primary_if_get_selected(bat_priv); 1918 1918 if (!primary_if || primary_if->if_status != BATADV_IF_ACTIVE) { ··· 1937 1937 1938 1938 out: 1939 1939 batadv_hardif_put(primary_if); 1940 - dev_put(soft_iface); 1940 + dev_put(mesh_iface); 1941 1941 1942 1942 cb->args[0] = bucket; 1943 1943 cb->args[1] = idx; ··· 1990 1990 1991 1991 /** 1992 1992 * batadv_tt_global_del_orig_node() - remove orig_node from a global tt entry 1993 - * @bat_priv: the bat priv with all the soft interface information 1993 + * @bat_priv: the bat priv with all the mesh interface information 1994 1994 * @tt_global_entry: the global entry to remove the orig_node from 1995 1995 * @orig_node: the originator announcing the client 1996 1996 * @message: message to append to the log on deletion ··· 2069 2069 2070 2070 /** 2071 2071 * batadv_tt_global_del() - remove a client from the global table 2072 - * @bat_priv: the bat priv with all the soft interface information 2072 + * @bat_priv: the bat priv with all the mesh interface information 2073 2073 * @orig_node: an originator serving this client 2074 2074 * @addr: the mac address of the client 2075 2075 * @vid: VLAN identifier ··· 2134 2134 /** 2135 2135 * batadv_tt_global_del_orig() - remove all the TT global entries belonging to 2136 2136 * the given originator matching the provided vid 2137 - * @bat_priv: the bat priv with all the soft interface information 2137 + * @bat_priv: the bat priv with all the mesh interface information 2138 2138 * @orig_node: the originator owning the entries to remove 2139 2139 * @match_vid: the VLAN identifier to match. If negative all the entries will be 2140 2140 * removed ··· 2305 2305 2306 2306 /** 2307 2307 * batadv_transtable_search() - get the mesh destination for a given client 2308 - * @bat_priv: the bat priv with all the soft interface information 2308 + * @bat_priv: the bat priv with all the mesh interface information 2309 2309 * @src: mac address of the source client 2310 2310 * @addr: mac address of the destination client 2311 2311 * @vid: VLAN identifier ··· 2364 2364 /** 2365 2365 * batadv_tt_global_crc() - calculates the checksum of the local table belonging 2366 2366 * to the given orig_node 2367 - * @bat_priv: the bat priv with all the soft interface information 2367 + * @bat_priv: the bat priv with all the mesh interface information 2368 2368 * @orig_node: originator for which the CRC should be computed 2369 2369 * @vid: VLAN identifier for which the CRC32 has to be computed 2370 2370 * ··· 2458 2458 2459 2459 /** 2460 2460 * batadv_tt_local_crc() - calculates the checksum of the local table 2461 - * @bat_priv: the bat priv with all the soft interface information 2461 + * @bat_priv: the bat priv with all the mesh interface information 2462 2462 * @vid: VLAN identifier for which the CRC32 has to be computed 2463 2463 * 2464 2464 * For details about the computation, please refer to the documentation for ··· 2593 2593 2594 2594 /** 2595 2595 * batadv_tt_req_node_new() - search and possibly create a tt_req_node object 2596 - * @bat_priv: the bat priv with all the soft interface information 2596 + * @bat_priv: the bat priv with all the mesh interface information 2597 2597 * @orig_node: orig node this request is being issued for 2598 2598 * 2599 2599 * Return: the pointer to the new tt_req_node struct if no request ··· 2689 2689 /** 2690 2690 * batadv_tt_tvlv_generate() - fill the tvlv buff with the tt entries from the 2691 2691 * specified tt hash 2692 - * @bat_priv: the bat priv with all the soft interface information 2692 + * @bat_priv: the bat priv with all the mesh interface information 2693 2693 * @hash: hash table containing the tt entries 2694 2694 * @tt_len: expected tvlv tt data buffer length in number of bytes 2695 2695 * @tvlv_buff: pointer to the buffer to fill with the TT data ··· 2810 2810 2811 2811 /** 2812 2812 * batadv_tt_local_update_crc() - update all the local CRCs 2813 - * @bat_priv: the bat priv with all the soft interface information 2813 + * @bat_priv: the bat priv with all the mesh interface information 2814 2814 */ 2815 2815 static void batadv_tt_local_update_crc(struct batadv_priv *bat_priv) 2816 2816 { 2817 - struct batadv_softif_vlan *vlan; 2817 + struct batadv_meshif_vlan *vlan; 2818 2818 2819 2819 /* recompute the global CRC for each VLAN */ 2820 2820 rcu_read_lock(); 2821 - hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) { 2821 + hlist_for_each_entry_rcu(vlan, &bat_priv->meshif_vlan_list, list) { 2822 2822 vlan->tt.crc = batadv_tt_local_crc(bat_priv, vlan->vid); 2823 2823 } 2824 2824 rcu_read_unlock(); ··· 2826 2826 2827 2827 /** 2828 2828 * batadv_tt_global_update_crc() - update all the global CRCs for this orig_node 2829 - * @bat_priv: the bat priv with all the soft interface information 2829 + * @bat_priv: the bat priv with all the mesh interface information 2830 2830 * @orig_node: the orig_node for which the CRCs have to be updated 2831 2831 */ 2832 2832 static void batadv_tt_global_update_crc(struct batadv_priv *bat_priv, ··· 2853 2853 2854 2854 /** 2855 2855 * batadv_send_tt_request() - send a TT Request message to a given node 2856 - * @bat_priv: the bat priv with all the soft interface information 2856 + * @bat_priv: the bat priv with all the mesh interface information 2857 2857 * @dst_orig_node: the destination of the message 2858 2858 * @ttvn: the version number that the source of the message is looking for 2859 2859 * @tt_vlan: pointer to the first tvlv VLAN object to request ··· 2938 2938 /** 2939 2939 * batadv_send_other_tt_response() - send reply to tt request concerning another 2940 2940 * node's translation table 2941 - * @bat_priv: the bat priv with all the soft interface information 2941 + * @bat_priv: the bat priv with all the mesh interface information 2942 2942 * @tt_data: tt data containing the tt request information 2943 2943 * @req_src: mac address of tt request sender 2944 2944 * @req_dst: mac address of tt request recipient ··· 3029 3029 /* Don't send the response, if larger than fragmented packet. */ 3030 3030 tt_len = sizeof(struct batadv_unicast_tvlv_packet) + tvlv_len; 3031 3031 if (tt_len > atomic_read(&bat_priv->packet_size_max)) { 3032 - net_ratelimited_function(batadv_info, bat_priv->soft_iface, 3032 + net_ratelimited_function(batadv_info, bat_priv->mesh_iface, 3033 3033 "Ignoring TT_REQUEST from %pM; Response size exceeds max packet size.\n", 3034 3034 res_dst_orig_node->orig); 3035 3035 goto out; ··· 3068 3068 /** 3069 3069 * batadv_send_my_tt_response() - send reply to tt request concerning this 3070 3070 * node's translation table 3071 - * @bat_priv: the bat priv with all the soft interface information 3071 + * @bat_priv: the bat priv with all the mesh interface information 3072 3072 * @tt_data: tt data containing the tt request information 3073 3073 * @req_src: mac address of tt request sender 3074 3074 * ··· 3185 3185 3186 3186 /** 3187 3187 * batadv_send_tt_response() - send reply to tt request 3188 - * @bat_priv: the bat priv with all the soft interface information 3188 + * @bat_priv: the bat priv with all the mesh interface information 3189 3189 * @tt_data: tt data containing the tt request information 3190 3190 * @req_src: mac address of tt request sender 3191 3191 * @req_dst: mac address of tt request recipient ··· 3280 3280 3281 3281 /** 3282 3282 * batadv_is_my_client() - check if a client is served by the local node 3283 - * @bat_priv: the bat priv with all the soft interface information 3283 + * @bat_priv: the bat priv with all the mesh interface information 3284 3284 * @addr: the mac address of the client to check 3285 3285 * @vid: VLAN identifier 3286 3286 * ··· 3309 3309 3310 3310 /** 3311 3311 * batadv_handle_tt_response() - process incoming tt reply 3312 - * @bat_priv: the bat priv with all the soft interface information 3312 + * @bat_priv: the bat priv with all the mesh interface information 3313 3313 * @tt_data: tt data containing the tt request information 3314 3314 * @resp_src: mac address of tt reply sender 3315 3315 * @num_entries: number of tt change entries appended to the tt data ··· 3397 3397 3398 3398 /** 3399 3399 * batadv_tt_check_roam_count() - check if a client has roamed too frequently 3400 - * @bat_priv: the bat priv with all the soft interface information 3400 + * @bat_priv: the bat priv with all the mesh interface information 3401 3401 * @client: mac address of the roaming client 3402 3402 * 3403 3403 * This function checks whether the client already reached the ··· 3452 3452 3453 3453 /** 3454 3454 * batadv_send_roam_adv() - send a roaming advertisement message 3455 - * @bat_priv: the bat priv with all the soft interface information 3455 + * @bat_priv: the bat priv with all the mesh interface information 3456 3456 * @client: mac address of the roaming client 3457 3457 * @vid: VLAN identifier 3458 3458 * @orig_node: message destination ··· 3516 3516 } 3517 3517 3518 3518 /** 3519 - * batadv_tt_free() - Free translation table of soft interface 3520 - * @bat_priv: the bat priv with all the soft interface information 3519 + * batadv_tt_free() - Free translation table of mesh interface 3520 + * @bat_priv: the bat priv with all the mesh interface information 3521 3521 */ 3522 3522 void batadv_tt_free(struct batadv_priv *bat_priv) 3523 3523 { ··· 3540 3540 /** 3541 3541 * batadv_tt_local_set_flags() - set or unset the specified flags on the local 3542 3542 * table and possibly count them in the TT size 3543 - * @bat_priv: the bat priv with all the soft interface information 3543 + * @bat_priv: the bat priv with all the mesh interface information 3544 3544 * @flags: the flag to switch 3545 3545 * @enable: whether to set or unset the flag 3546 3546 * @count: whether to increase the TT size by the number of changed entries ··· 3626 3626 /** 3627 3627 * batadv_tt_local_commit_changes_nolock() - commit all pending local tt changes 3628 3628 * which have been queued in the time since the last commit 3629 - * @bat_priv: the bat priv with all the soft interface information 3629 + * @bat_priv: the bat priv with all the mesh interface information 3630 3630 * 3631 3631 * Caller must hold tt->commit_lock. 3632 3632 */ ··· 3659 3659 /** 3660 3660 * batadv_tt_local_commit_changes() - commit all pending local tt changes which 3661 3661 * have been queued in the time since the last commit 3662 - * @bat_priv: the bat priv with all the soft interface information 3662 + * @bat_priv: the bat priv with all the mesh interface information 3663 3663 */ 3664 3664 void batadv_tt_local_commit_changes(struct batadv_priv *bat_priv) 3665 3665 { ··· 3670 3670 3671 3671 /** 3672 3672 * batadv_is_ap_isolated() - Check if packet from upper layer should be dropped 3673 - * @bat_priv: the bat priv with all the soft interface information 3673 + * @bat_priv: the bat priv with all the mesh interface information 3674 3674 * @src: source mac address of packet 3675 3675 * @dst: destination mac address of packet 3676 3676 * @vid: vlan id of packet ··· 3682 3682 { 3683 3683 struct batadv_tt_local_entry *tt_local_entry; 3684 3684 struct batadv_tt_global_entry *tt_global_entry; 3685 - struct batadv_softif_vlan *vlan; 3685 + struct batadv_meshif_vlan *vlan; 3686 3686 bool ret = false; 3687 3687 3688 - vlan = batadv_softif_vlan_get(bat_priv, vid); 3688 + vlan = batadv_meshif_vlan_get(bat_priv, vid); 3689 3689 if (!vlan) 3690 3690 return false; 3691 3691 ··· 3707 3707 local_entry_put: 3708 3708 batadv_tt_local_entry_put(tt_local_entry); 3709 3709 vlan_put: 3710 - batadv_softif_vlan_put(vlan); 3710 + batadv_meshif_vlan_put(vlan); 3711 3711 return ret; 3712 3712 } 3713 3713 3714 3714 /** 3715 3715 * batadv_tt_update_orig() - update global translation table with new tt 3716 3716 * information received via ogms 3717 - * @bat_priv: the bat priv with all the soft interface information 3717 + * @bat_priv: the bat priv with all the mesh interface information 3718 3718 * @orig_node: the orig_node of the ogm 3719 3719 * @tt_buff: pointer to the first tvlv VLAN entry 3720 3720 * @tt_num_vlan: number of tvlv VLAN entries ··· 3798 3798 3799 3799 /** 3800 3800 * batadv_tt_global_client_is_roaming() - check if a client is marked as roaming 3801 - * @bat_priv: the bat priv with all the soft interface information 3801 + * @bat_priv: the bat priv with all the mesh interface information 3802 3802 * @addr: the mac address of the client to check 3803 3803 * @vid: VLAN identifier 3804 3804 * ··· 3824 3824 3825 3825 /** 3826 3826 * batadv_tt_local_client_is_roaming() - tells whether the client is roaming 3827 - * @bat_priv: the bat priv with all the soft interface information 3827 + * @bat_priv: the bat priv with all the mesh interface information 3828 3828 * @addr: the mac address of the local client to query 3829 3829 * @vid: VLAN identifier 3830 3830 * ··· 3850 3850 3851 3851 /** 3852 3852 * batadv_tt_add_temporary_global_entry() - Add temporary entry to global TT 3853 - * @bat_priv: the bat priv with all the soft interface information 3853 + * @bat_priv: the bat priv with all the mesh interface information 3854 3854 * @orig_node: orig node which the temporary entry should be associated with 3855 3855 * @addr: mac address of the client 3856 3856 * @vid: VLAN id of the new temporary global translation table ··· 3883 3883 /** 3884 3884 * batadv_tt_local_resize_to_mtu() - resize the local translation table fit the 3885 3885 * maximum packet size that can be transported through the mesh 3886 - * @soft_iface: netdev struct of the mesh interface 3886 + * @mesh_iface: netdev struct of the mesh interface 3887 3887 * 3888 3888 * Remove entries older than 'timeout' and half timeout if more entries need 3889 3889 * to be removed. 3890 3890 */ 3891 - void batadv_tt_local_resize_to_mtu(struct net_device *soft_iface) 3891 + void batadv_tt_local_resize_to_mtu(struct net_device *mesh_iface) 3892 3892 { 3893 - struct batadv_priv *bat_priv = netdev_priv(soft_iface); 3893 + struct batadv_priv *bat_priv = netdev_priv(mesh_iface); 3894 3894 int packet_size_max = atomic_read(&bat_priv->packet_size_max); 3895 3895 int table_size, timeout = BATADV_TT_LOCAL_TIMEOUT / 2; 3896 3896 bool reduced = false; ··· 3907 3907 3908 3908 timeout /= 2; 3909 3909 reduced = true; 3910 - net_ratelimited_function(batadv_info, soft_iface, 3910 + net_ratelimited_function(batadv_info, mesh_iface, 3911 3911 "Forced to purge local tt entries to fit new maximum fragment MTU (%i)\n", 3912 3912 packet_size_max); 3913 3913 } ··· 3923 3923 3924 3924 /** 3925 3925 * batadv_tt_tvlv_ogm_handler_v1() - process incoming tt tvlv container 3926 - * @bat_priv: the bat priv with all the soft interface information 3926 + * @bat_priv: the bat priv with all the mesh interface information 3927 3927 * @orig: the orig_node of the ogm 3928 3928 * @flags: flags indicating the tvlv state (see batadv_tvlv_handler_flags) 3929 3929 * @tvlv_value: tvlv buffer containing the gateway data ··· 3962 3962 /** 3963 3963 * batadv_tt_tvlv_unicast_handler_v1() - process incoming (unicast) tt tvlv 3964 3964 * container 3965 - * @bat_priv: the bat priv with all the soft interface information 3965 + * @bat_priv: the bat priv with all the mesh interface information 3966 3966 * @src: mac address of tt tvlv sender 3967 3967 * @dst: mac address of tt tvlv recipient 3968 3968 * @tvlv_value: tvlv buffer containing the tt data ··· 4044 4044 /** 4045 4045 * batadv_roam_tvlv_unicast_handler_v1() - process incoming tt roam tvlv 4046 4046 * container 4047 - * @bat_priv: the bat priv with all the soft interface information 4047 + * @bat_priv: the bat priv with all the mesh interface information 4048 4048 * @src: mac address of tt tvlv sender 4049 4049 * @dst: mac address of tt tvlv recipient 4050 4050 * @tvlv_value: tvlv buffer containing the tt data ··· 4093 4093 4094 4094 /** 4095 4095 * batadv_tt_init() - initialise the translation table internals 4096 - * @bat_priv: the bat priv with all the soft interface information 4096 + * @bat_priv: the bat priv with all the mesh interface information 4097 4097 * 4098 4098 * Return: 0 on success or negative error number in case of failure. 4099 4099 */ ··· 4131 4131 4132 4132 /** 4133 4133 * batadv_tt_global_is_isolated() - check if a client is marked as isolated 4134 - * @bat_priv: the bat priv with all the soft interface information 4134 + * @bat_priv: the bat priv with all the mesh interface information 4135 4135 * @addr: the mac address of the client 4136 4136 * @vid: the identifier of the VLAN where this client is connected 4137 4137 *
+2 -2
net/batman-adv/translation-table.h
··· 16 16 #include <linux/types.h> 17 17 18 18 int batadv_tt_init(struct batadv_priv *bat_priv); 19 - bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr, 19 + bool batadv_tt_local_add(struct net_device *mesh_iface, const u8 *addr, 20 20 unsigned short vid, int ifindex, u32 mark); 21 21 u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, 22 22 const u8 *addr, unsigned short vid, ··· 45 45 u8 *addr, unsigned short vid); 46 46 bool batadv_tt_local_client_is_roaming(struct batadv_priv *bat_priv, 47 47 u8 *addr, unsigned short vid); 48 - void batadv_tt_local_resize_to_mtu(struct net_device *soft_iface); 48 + void batadv_tt_local_resize_to_mtu(struct net_device *mesh_iface); 49 49 bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv, 50 50 struct batadv_orig_node *orig_node, 51 51 const unsigned char *addr,
+13 -13
net/batman-adv/tvlv.c
··· 59 59 /** 60 60 * batadv_tvlv_handler_get() - retrieve tvlv handler from the tvlv handler list 61 61 * based on the provided type and version (both need to match) 62 - * @bat_priv: the bat priv with all the soft interface information 62 + * @bat_priv: the bat priv with all the mesh interface information 63 63 * @type: tvlv handler type to look for 64 64 * @version: tvlv handler version to look for 65 65 * ··· 118 118 /** 119 119 * batadv_tvlv_container_get() - retrieve tvlv container from the tvlv container 120 120 * list based on the provided type and version (both need to match) 121 - * @bat_priv: the bat priv with all the soft interface information 121 + * @bat_priv: the bat priv with all the mesh interface information 122 122 * @type: tvlv container type to look for 123 123 * @version: tvlv container version to look for 124 124 * ··· 152 152 /** 153 153 * batadv_tvlv_container_list_size() - calculate the size of the tvlv container 154 154 * list entries 155 - * @bat_priv: the bat priv with all the soft interface information 155 + * @bat_priv: the bat priv with all the mesh interface information 156 156 * 157 157 * Has to be called with the appropriate locks being acquired 158 158 * (tvlv.container_list_lock). ··· 177 177 /** 178 178 * batadv_tvlv_container_remove() - remove tvlv container from the tvlv 179 179 * container list 180 - * @bat_priv: the bat priv with all the soft interface information 180 + * @bat_priv: the bat priv with all the mesh interface information 181 181 * @tvlv: the to be removed tvlv container 182 182 * 183 183 * Has to be called with the appropriate locks being acquired ··· 201 201 /** 202 202 * batadv_tvlv_container_unregister() - unregister tvlv container based on the 203 203 * provided type and version (both need to match) 204 - * @bat_priv: the bat priv with all the soft interface information 204 + * @bat_priv: the bat priv with all the mesh interface information 205 205 * @type: tvlv container type to unregister 206 206 * @version: tvlv container type to unregister 207 207 */ ··· 219 219 /** 220 220 * batadv_tvlv_container_register() - register tvlv type, version and content 221 221 * to be propagated with each (primary interface) OGM 222 - * @bat_priv: the bat priv with all the soft interface information 222 + * @bat_priv: the bat priv with all the mesh interface information 223 223 * @type: tvlv container type 224 224 * @version: tvlv container version 225 225 * @tvlv_value: tvlv container content ··· 297 297 /** 298 298 * batadv_tvlv_container_ogm_append() - append tvlv container content to given 299 299 * OGM packet buffer 300 - * @bat_priv: the bat priv with all the soft interface information 300 + * @bat_priv: the bat priv with all the mesh interface information 301 301 * @packet_buff: ogm packet buffer 302 302 * @packet_buff_len: ogm packet buffer size including ogm header and tvlv 303 303 * content ··· 350 350 /** 351 351 * batadv_tvlv_call_handler() - parse the given tvlv buffer to call the 352 352 * appropriate handlers 353 - * @bat_priv: the bat priv with all the soft interface information 353 + * @bat_priv: the bat priv with all the mesh interface information 354 354 * @tvlv_handler: tvlv callback function handling the tvlv content 355 355 * @packet_type: indicates for which packet type the TVLV handler is called 356 356 * @orig_node: orig node emitting the ogm packet ··· 421 421 /** 422 422 * batadv_tvlv_containers_process() - parse the given tvlv buffer to call the 423 423 * appropriate handlers 424 - * @bat_priv: the bat priv with all the soft interface information 424 + * @bat_priv: the bat priv with all the mesh interface information 425 425 * @packet_type: indicates for which packet type the TVLV handler is called 426 426 * @orig_node: orig node emitting the ogm packet 427 427 * @skb: the skb the TVLV handler is called for ··· 490 490 /** 491 491 * batadv_tvlv_ogm_receive() - process an incoming ogm and call the appropriate 492 492 * handlers 493 - * @bat_priv: the bat priv with all the soft interface information 493 + * @bat_priv: the bat priv with all the mesh interface information 494 494 * @batadv_ogm_packet: ogm packet containing the tvlv containers 495 495 * @orig_node: orig node emitting the ogm packet 496 496 */ ··· 518 518 * batadv_tvlv_handler_register() - register tvlv handler based on the provided 519 519 * type and version (both need to match) for ogm tvlv payload and/or unicast 520 520 * payload 521 - * @bat_priv: the bat priv with all the soft interface information 521 + * @bat_priv: the bat priv with all the mesh interface information 522 522 * @optr: ogm tvlv handler callback function. This function receives the orig 523 523 * node, flags and the tvlv content as argument to process. 524 524 * @uptr: unicast tvlv handler callback function. This function receives the ··· 583 583 /** 584 584 * batadv_tvlv_handler_unregister() - unregister tvlv handler based on the 585 585 * provided type and version (both need to match) 586 - * @bat_priv: the bat priv with all the soft interface information 586 + * @bat_priv: the bat priv with all the mesh interface information 587 587 * @type: tvlv handler type to be unregistered 588 588 * @version: tvlv handler version to be unregistered 589 589 */ ··· 606 606 /** 607 607 * batadv_tvlv_unicast_send() - send a unicast packet with tvlv payload to the 608 608 * specified host 609 - * @bat_priv: the bat priv with all the soft interface information 609 + * @bat_priv: the bat priv with all the mesh interface information 610 610 * @src: source mac address of the unicast packet 611 611 * @dst: destination mac address of the unicast packet 612 612 * @type: tvlv type
+28 -50
net/batman-adv/types.h
··· 186 186 /** @net_dev: pointer to the net_device */ 187 187 struct net_device *net_dev; 188 188 189 + /** @dev_tracker: device tracker for @net_dev */ 190 + netdevice_tracker dev_tracker; 191 + 189 192 /** @refcount: number of contexts the object is used */ 190 193 struct kref refcount; 191 194 ··· 199 196 struct packet_type batman_adv_ptype; 200 197 201 198 /** 202 - * @soft_iface: the batman-adv interface which uses this network 199 + * @mesh_iface: the batman-adv interface which uses this network 203 200 * interface 204 201 */ 205 - struct net_device *soft_iface; 202 + struct net_device *mesh_iface; 203 + 204 + /** @meshif_dev_tracker: device tracker for @mesh_iface */ 205 + netdevice_tracker meshif_dev_tracker; 206 206 207 207 /** @rcu: struct used for freeing in an RCU-safe manner */ 208 208 struct rcu_head rcu; ··· 493 487 /** @hash_entry: hlist node for &batadv_priv.orig_hash */ 494 488 struct hlist_node hash_entry; 495 489 496 - /** @bat_priv: pointer to soft_iface this orig node belongs to */ 490 + /** @bat_priv: pointer to mesh_iface this orig node belongs to */ 497 491 struct batadv_priv *bat_priv; 498 492 499 493 /** @bcast_seqno_lock: lock protecting bcast_bits & last_bcast_seqno */ ··· 905 899 906 900 /** 907 901 * @BATADV_CNT_MCAST_RX_LOCAL: counter for received batman-adv multicast 908 - * packets which were forwarded to the local soft interface 902 + * packets which were forwarded to the local mesh interface 909 903 */ 910 904 BATADV_CNT_MCAST_RX_LOCAL, 911 905 912 906 /** 913 907 * @BATADV_CNT_MCAST_RX_LOCAL_BYTES: bytes counter for received 914 - * batman-adv multicast packets which were forwarded to the local soft 908 + * batman-adv multicast packets which were forwarded to the local mesh 915 909 * interface 916 910 */ 917 911 BATADV_CNT_MCAST_RX_LOCAL_BYTES, ··· 1143 1137 }; 1144 1138 #endif 1145 1139 1146 - #ifdef CONFIG_BATMAN_ADV_DEBUG 1147 - 1148 - /** 1149 - * struct batadv_priv_debug_log - debug logging data 1150 - */ 1151 - struct batadv_priv_debug_log { 1152 - /** @log_buff: buffer holding the logs (ring buffer) */ 1153 - char log_buff[BATADV_LOG_BUF_LEN]; 1154 - 1155 - /** @log_start: index of next character to read */ 1156 - unsigned long log_start; 1157 - 1158 - /** @log_end: index of next character to write */ 1159 - unsigned long log_end; 1160 - 1161 - /** @lock: lock protecting log_buff, log_start & log_end */ 1162 - spinlock_t lock; 1163 - 1164 - /** @queue_wait: log reader's wait queue */ 1165 - wait_queue_head_t queue_wait; 1166 - }; 1167 - #endif 1168 - 1169 1140 /** 1170 1141 * struct batadv_priv_gw - per mesh interface gateway data 1171 1142 */ ··· 1247 1264 /** @enabled: whether the multicast tvlv is currently enabled */ 1248 1265 unsigned char enabled:1; 1249 1266 1250 - /** @bridged: whether the soft interface has a bridge on top */ 1267 + /** @bridged: whether the mesh interface has a bridge on top */ 1251 1268 unsigned char bridged:1; 1252 1269 1253 1270 /** @tvlv_flags: the flags we have last sent in our mcast tvlv */ ··· 1383 1400 /** 1384 1401 * @decoding_hash: Hash table used to buffer skbs that might be needed 1385 1402 * to decode a received coded skb. The buffer is used for 1) skbs 1386 - * arriving on the soft-interface; 2) skbs overheard on the 1403 + * arriving on the mesh-interface; 2) skbs overheard on the 1387 1404 * hard-interface; and 3) skbs forwarded by batman-adv. 1388 1405 */ 1389 1406 struct batadv_hashtable *decoding_hash; ··· 1536 1553 }; 1537 1554 1538 1555 /** 1539 - * struct batadv_softif_vlan - per VLAN attributes set 1556 + * struct batadv_meshif_vlan - per VLAN attributes set 1540 1557 */ 1541 - struct batadv_softif_vlan { 1558 + struct batadv_meshif_vlan { 1542 1559 /** @bat_priv: pointer to the mesh object */ 1543 1560 struct batadv_priv *bat_priv; 1544 1561 ··· 1551 1568 /** @tt: TT private attributes (VLAN specific) */ 1552 1569 struct batadv_vlan_tt tt; 1553 1570 1554 - /** @list: list node for &bat_priv.softif_vlan_list */ 1571 + /** @list: list node for &bat_priv.meshif_vlan_list */ 1555 1572 struct hlist_node list; 1556 1573 1557 1574 /** ··· 1564 1581 }; 1565 1582 1566 1583 /** 1567 - * struct batadv_priv_bat_v - B.A.T.M.A.N. V per soft-interface private data 1584 + * struct batadv_priv_bat_v - B.A.T.M.A.N. V per mesh-interface private data 1568 1585 */ 1569 1586 struct batadv_priv_bat_v { 1570 1587 /** @ogm_buff: buffer holding the OGM packet */ ··· 1593 1610 */ 1594 1611 atomic_t mesh_state; 1595 1612 1596 - /** @soft_iface: net device which holds this struct as private data */ 1597 - struct net_device *soft_iface; 1613 + /** @mesh_iface: net device which holds this struct as private data */ 1614 + struct net_device *mesh_iface; 1598 1615 1599 1616 /** 1600 1617 * @mtu_set_by_user: MTU was set once by user ··· 1743 1760 struct batadv_algo_ops *algo_ops; 1744 1761 1745 1762 /** 1746 - * @softif_vlan_list: a list of softif_vlan structs, one per VLAN 1763 + * @meshif_vlan_list: a list of meshif_vlan structs, one per VLAN 1747 1764 * created on top of the mesh interface represented by this object 1748 1765 */ 1749 - struct hlist_head softif_vlan_list; 1766 + struct hlist_head meshif_vlan_list; 1750 1767 1751 - /** @softif_vlan_list_lock: lock protecting softif_vlan_list */ 1752 - spinlock_t softif_vlan_list_lock; 1768 + /** @meshif_vlan_list_lock: lock protecting meshif_vlan_list */ 1769 + spinlock_t meshif_vlan_list_lock; 1753 1770 1754 1771 #ifdef CONFIG_BATMAN_ADV_BLA 1755 1772 /** @bla: bridge loop avoidance data */ 1756 1773 struct batadv_priv_bla bla; 1757 - #endif 1758 - 1759 - #ifdef CONFIG_BATMAN_ADV_DEBUG 1760 - /** @debug_log: holding debug logging relevant data */ 1761 - struct batadv_priv_debug_log *debug_log; 1762 1774 #endif 1763 1775 1764 1776 /** @gw: gateway data */ ··· 1786 1808 #endif /* CONFIG_BATMAN_ADV_NC */ 1787 1809 1788 1810 #ifdef CONFIG_BATMAN_ADV_BATMAN_V 1789 - /** @bat_v: B.A.T.M.A.N. V per soft-interface private data */ 1811 + /** @bat_v: B.A.T.M.A.N. V per mesh-interface private data */ 1790 1812 struct batadv_priv_bat_v bat_v; 1791 1813 #endif 1792 1814 }; ··· 1809 1831 /** @hash_entry: hlist node for &batadv_priv_bla.backbone_hash */ 1810 1832 struct hlist_node hash_entry; 1811 1833 1812 - /** @bat_priv: pointer to soft_iface this backbone gateway belongs to */ 1834 + /** @bat_priv: pointer to mesh_iface this backbone gateway belongs to */ 1813 1835 struct batadv_priv *bat_priv; 1814 1836 1815 1837 /** @lasttime: last time we heard of this backbone gw */ ··· 1914 1936 /** @last_seen: timestamp used for purging stale tt local entries */ 1915 1937 unsigned long last_seen; 1916 1938 1917 - /** @vlan: soft-interface vlan of the entry */ 1918 - struct batadv_softif_vlan *vlan; 1939 + /** @vlan: mesh-interface vlan of the entry */ 1940 + struct batadv_meshif_vlan *vlan; 1919 1941 }; 1920 1942 1921 1943 /** ··· 2139 2161 u16 packet_len; 2140 2162 2141 2163 /** @direct_link_flags: direct link flags for aggregated OGM packets */ 2142 - u32 direct_link_flags; 2164 + DECLARE_BITMAP(direct_link_flags, BATADV_MAX_AGGREGATION_PACKETS); 2143 2165 2144 2166 /** @num_packets: counter for aggregated OGMv1 packets */ 2145 2167 u8 num_packets;