History

Merge tag 'batadv-next-pullrequest-20260605' of https://git.open-mesh.org/batadv

Simon Wunderlich says: ==================== This cleanup patchset includes the following patches, all by Sven Eckelmann: - tp_meter: initialize last_recv_time during init - convert cancellation of work items to disable helper - clean up wifi detection cache (3 patches) - clean up kernel-doc: corrections, reword, typos (6 patches) * tag 'batadv-next-pullrequest-20260605' of https://git.open-mesh.org/batadv: batman-adv: fix kernel-doc typos and grammar errors batman-adv: fix batadv_v_ogm_packet_recv error handling kernel-doc batman-adv: uapi: keep kernel-doc in struct member order batman-adv: bla: update stale kernel-doc batman-adv: tp_meter: update stale kernel-doc after refactoring batman-adv: correct batadv_wifi_* kernel-doc batman-adv: document cleanup of batadv_wifi_net_devices entries batman-adv: use GFP_KERNEL allocations for the wifi detection cache batman-adv: drop duplicated wifi_flags assignments batman-adv: convert cancellation of work items to disable helper batman-adv: tp_meter: initialize last_recv_time during init ====================

Jakub Kicinski committed 5 months ago

Commit 4ed4f602 parents d337bc6 1e2fa2b23 files · +85 −67Browse files

Unified · Split

23 files
  1. include/uapi/linux/batadv_packet.h +3 −3
  2. net/batman-adv/bat_iv_ogm.c +1 −1
  3. net/batman-adv/bat_v.c +3 −1
  4. net/batman-adv/bat_v_elp.c +3 −3
  5. net/batman-adv/bat_v_ogm.c +9 −7
  6. net/batman-adv/bitarray.c +1 −1
  7. net/batman-adv/bitarray.h +1 −1
  8. net/batman-adv/bridge_loop_avoidance.c +3 −3
  9. net/batman-adv/bridge_loop_avoidance.h +1 −1
  10. net/batman-adv/distributed-arp-table.c +1 −1
  11. net/batman-adv/fragmentation.c +2 −1
  12. net/batman-adv/hard-interface.c +9 −6
  13. net/batman-adv/hard-interface.h +2 −2
  14. net/batman-adv/hash.h +2 −2
  15. net/batman-adv/mesh-interface.c +3 −3
  16. net/batman-adv/multicast.c +1 −1
  17. net/batman-adv/netlink.c +2 −2
  18. net/batman-adv/originator.c +3 −3
  19. net/batman-adv/send.c +1 −1
  20. net/batman-adv/tp_meter.c +16 −12
  21. net/batman-adv/translation-table.c +1 −1
  22. net/batman-adv/tvlv.c +2 −2
  23. net/batman-adv/types.h +15 −9
include/uapi/linux/batadv_packet.h+3−3
@@ -518,16 +518,16 @@ struct batadv_mcast_packet { · 517 unmodified lines
518 * @packet_type: batman-adv packet type, part of the general header518 * @packet_type: batman-adv packet type, part of the general header
519 * @version: batman-adv protocol version, part of the general header519 * @version: batman-adv protocol version, part of the general header
520 * @ttl: time to live for this packet, part of the general header520 * @ttl: time to live for this packet, part of the general header
521 * @first_ttvn: tt-version number of first included packet
521 * @first_source: original source of first included packet522 * @first_source: original source of first included packet
522 * @first_orig_dest: original destination of first included packet523 * @first_orig_dest: original destination of first included packet
523 * @first_crc: checksum of first included packet524 * @first_crc: checksum of first included packet
524 * @first_ttvn: tt-version number of first included packet
525 * @second_ttl: ttl of second packet525 * @second_ttl: ttl of second packet
526 * @second_ttvn: tt version number of second included packet
526 * @second_dest: second receiver of this coded packet527 * @second_dest: second receiver of this coded packet
527 * @second_source: original source of second included packet528 * @second_source: original source of second included packet
528 * @second_orig_dest: original destination of second included packet529 * @second_orig_dest: original destination of second included packet
529 * @second_crc: checksum of second included packet530 * @second_crc: checksum of second included packet
530 * @second_ttvn: tt version number of second included packet
531 * @coded_len: length of network coded part of the payload531 * @coded_len: length of network coded part of the payload
532 */532 */
533struct batadv_coded_packet {533struct batadv_coded_packet {
@@ -554,8 +554,8 @@ struct batadv_coded_packet { · 20 unmodified lines
554 * @version: batman-adv protocol version, part of the general header554 * @version: batman-adv protocol version, part of the general header
555 * @ttl: time to live for this packet, part of the general header555 * @ttl: time to live for this packet, part of the general header
556 * @reserved: reserved field (for packet alignment)556 * @reserved: reserved field (for packet alignment)
557 * @src: address of the source
558 * @dst: address of the destination557 * @dst: address of the destination
558 * @src: address of the source
559 * @tvlv_len: length of tvlv data following the unicast tvlv header559 * @tvlv_len: length of tvlv data following the unicast tvlv header
560 * @align: 2 bytes to align the header to a 4 byte boundary560 * @align: 2 bytes to align the header to a 4 byte boundary
561 */561 */
net/batman-adv/bat_iv_ogm.c+1−1
@@ -230,7 +230,7 @@ static void batadv_iv_ogm_iface_disable(struct batadv_hard_iface *hard_iface) · 229 unmodified lines
230 230
231 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);231 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
232 232
233 cancel_delayed_work_sync(&hard_iface->bat_iv.reschedule_work);233 disable_delayed_work_sync(&hard_iface->bat_iv.reschedule_work);
234}234}
235 235
236static void batadv_iv_ogm_iface_update_mac(struct batadv_hard_iface *hard_iface)236static void batadv_iv_ogm_iface_update_mac(struct batadv_hard_iface *hard_iface)
net/batman-adv/bat_v.c+3−1
@@ -587,7 +587,7 @@ next: · 586 unmodified lines
587}587}
588 588
589/**589/**
590 * batadv_v_gw_is_eligible() - check if a originator would be selected as GW590 * batadv_v_gw_is_eligible() - check if an originator would be selected as GW
591 * @bat_priv: the bat priv with all the mesh interface information591 * @bat_priv: the bat priv with all the mesh interface information
592 * @curr_gw_orig: originator representing the currently selected GW592 * @curr_gw_orig: originator representing the currently selected GW
593 * @orig_node: the originator representing the new candidate593 * @orig_node: the originator representing the new candidate
@@ -819,6 +819,8 @@ void batadv_v_hardif_init(struct batadv_hard_iface *hard_iface) · 225 unmodified lines
819 skb_queue_head_init(&hard_iface->bat_v.aggr_list);819 skb_queue_head_init(&hard_iface->bat_v.aggr_list);
820 INIT_DELAYED_WORK(&hard_iface->bat_v.aggr_wq,820 INIT_DELAYED_WORK(&hard_iface->bat_v.aggr_wq,
821 batadv_v_ogm_aggr_work);821 batadv_v_ogm_aggr_work);
822 /* make sure it doesn't run until interface gets enabled */
823 disable_delayed_work(&hard_iface->bat_v.aggr_wq);
822}824}
823 825
824/**826/**
net/batman-adv/bat_v_elp.c+3−3
@@ -115,7 +115,7 @@ static bool batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh, · 114 unmodified lines
115 goto default_throughput;115 goto default_throughput;
116 116
117 /* only use rtnl_trylock because the elp worker will be cancelled while117 /* only use rtnl_trylock because the elp worker will be cancelled while
118 * the rntl_lock is held. the cancel_delayed_work_sync() would otherwise118 * the rntl_lock is held. the disable_delayed_work_sync() would otherwise
119 * wait forever when the elp work_item was started and it is then also119 * wait forever when the elp work_item was started and it is then also
120 * trying to rtnl_lock120 * trying to rtnl_lock
121 */121 */
@@ -162,7 +162,7 @@ static bool batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh, · 40 unmodified lines
162 }162 }
163 163
164 /* only use rtnl_trylock because the elp worker will be cancelled while164 /* only use rtnl_trylock because the elp worker will be cancelled while
165 * the rntl_lock is held. the cancel_delayed_work_sync() would otherwise165 * the rntl_lock is held. the disable_delayed_work_sync() would otherwise
166 * wait forever when the elp work_item was started and it is then also166 * wait forever when the elp work_item was started and it is then also
167 * trying to rtnl_lock167 * trying to rtnl_lock
168 */168 */
@@ -447,7 +447,7 @@ out: · 278 unmodified lines
447 */447 */
448void batadv_v_elp_iface_disable(struct batadv_hard_iface *hard_iface)448void batadv_v_elp_iface_disable(struct batadv_hard_iface *hard_iface)
449{449{
450 cancel_delayed_work_sync(&hard_iface->bat_v.elp_wq);450 disable_delayed_work_sync(&hard_iface->bat_v.elp_wq);
451 451
452 dev_kfree_skb(hard_iface->bat_v.elp_skb);452 dev_kfree_skb(hard_iface->bat_v.elp_skb);
453 hard_iface->bat_v.elp_skb = NULL;453 hard_iface->bat_v.elp_skb = NULL;
net/batman-adv/bat_v_ogm.c+9−7
@@ -415,6 +415,8 @@ int batadv_v_ogm_iface_enable(struct batadv_hard_iface *hard_iface) · 414 unmodified lines
415{415{
416 struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface);416 struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface);
417 417
418 enable_delayed_work(&hard_iface->bat_v.aggr_wq);
419
418 batadv_v_ogm_start_queue_timer(hard_iface);420 batadv_v_ogm_start_queue_timer(hard_iface);
419 batadv_v_ogm_start_timer(bat_priv);421 batadv_v_ogm_start_timer(bat_priv);
420 422
@@ -427,7 +429,7 @@ int batadv_v_ogm_iface_enable(struct batadv_hard_iface *hard_iface) · 6 unmodified lines
427 */429 */
428void batadv_v_ogm_iface_disable(struct batadv_hard_iface *hard_iface)430void batadv_v_ogm_iface_disable(struct batadv_hard_iface *hard_iface)
429{431{
430 cancel_delayed_work_sync(&hard_iface->bat_v.aggr_wq);432 disable_delayed_work_sync(&hard_iface->bat_v.aggr_wq);
431 433
432 spin_lock_bh(&hard_iface->bat_v.aggr_list.lock);434 spin_lock_bh(&hard_iface->bat_v.aggr_list.lock);
433 batadv_v_ogm_aggr_list_free(hard_iface);435 batadv_v_ogm_aggr_list_free(hard_iface);
@@ -513,7 +515,7 @@ static u32 batadv_v_forward_penalty(struct batadv_priv *bat_priv, · 79 unmodified lines
513 * @bat_priv: the bat priv with all the mesh interface information515 * @bat_priv: the bat priv with all the mesh interface information
514 * @ogm_received: previously received OGM to be forwarded516 * @ogm_received: previously received OGM to be forwarded
515 * @orig_node: the originator which has been updated517 * @orig_node: the originator which has been updated
516 * @neigh_node: the neigh_node through with the OGM has been received518 * @neigh_node: the neigh_node through which the OGM has been received
517 * @if_incoming: the interface on which this OGM was received on519 * @if_incoming: the interface on which this OGM was received on
518 * @if_outgoing: the interface to which the OGM has to be forwarded to520 * @if_outgoing: the interface to which the OGM has to be forwarded to
519 *521 *
@@ -600,7 +602,7 @@ out: · 80 unmodified lines
600 * @bat_priv: the bat priv with all the mesh interface information602 * @bat_priv: the bat priv with all the mesh interface information
601 * @ogm2: OGM2 structure603 * @ogm2: OGM2 structure
602 * @orig_node: Originator structure for which the OGM has been received604 * @orig_node: Originator structure for which the OGM has been received
603 * @neigh_node: the neigh_node through with the OGM has been received605 * @neigh_node: the neigh_node through which the OGM has been received
604 * @if_incoming: the interface where this packet was received606 * @if_incoming: the interface where this packet was received
605 * @if_outgoing: the interface for which the packet should be considered607 * @if_outgoing: the interface for which the packet should be considered
606 *608 *
@@ -684,7 +686,7 @@ out: · 77 unmodified lines
684 * @ethhdr: the Ethernet header of the OGM2686 * @ethhdr: the Ethernet header of the OGM2
685 * @ogm2: OGM2 structure687 * @ogm2: OGM2 structure
686 * @orig_node: Originator structure for which the OGM has been received688 * @orig_node: Originator structure for which the OGM has been received
687 * @neigh_node: the neigh_node through with the OGM has been received689 * @neigh_node: the neigh_node through which the OGM has been received
688 * @if_incoming: the interface where this packet was received690 * @if_incoming: the interface where this packet was received
689 * @if_outgoing: the interface for which the packet should be considered691 * @if_outgoing: the interface for which the packet should be considered
690 *692 *
@@ -779,7 +781,7 @@ out: · 88 unmodified lines
779 * @ethhdr: the Ethernet header of the OGM2781 * @ethhdr: the Ethernet header of the OGM2
780 * @ogm2: OGM2 structure782 * @ogm2: OGM2 structure
781 * @orig_node: Originator structure for which the OGM has been received783 * @orig_node: Originator structure for which the OGM has been received
782 * @neigh_node: the neigh_node through with the OGM has been received784 * @neigh_node: the neigh_node through which the OGM has been received
783 * @if_incoming: the interface where this packet was received785 * @if_incoming: the interface where this packet was received
784 * @if_outgoing: the interface for which the packet should be considered786 * @if_outgoing: the interface for which the packet should be considered
785 */787 */
@@ -982,7 +984,7 @@ out: · 196 unmodified lines
982 * @if_incoming: the interface where this OGM has been received984 * @if_incoming: the interface where this OGM has been received
983 *985 *
984 * Return: NET_RX_SUCCESS and consume the skb on success or returns NET_RX_DROP986 * Return: NET_RX_SUCCESS and consume the skb on success or returns NET_RX_DROP
985 * (without freeing the skb) on failure987 * (freeing the skb) on failure
986 */988 */
987int batadv_v_ogm_packet_recv(struct sk_buff *skb,989int batadv_v_ogm_packet_recv(struct sk_buff *skb,
988 struct batadv_hard_iface *if_incoming)990 struct batadv_hard_iface *if_incoming)
@@ -1080,7 +1082,7 @@ int batadv_v_ogm_init(struct batadv_priv *bat_priv) · 91 unmodified lines
1080 */1082 */
1081void batadv_v_ogm_free(struct batadv_priv *bat_priv)1083void batadv_v_ogm_free(struct batadv_priv *bat_priv)
1082{1084{
1083 cancel_delayed_work_sync(&bat_priv->bat_v.ogm_wq);1085 disable_delayed_work_sync(&bat_priv->bat_v.ogm_wq);
1084 1086
1085 mutex_lock(&bat_priv->bat_v.ogm_buff_mutex);1087 mutex_lock(&bat_priv->bat_v.ogm_buff_mutex);
1086 1088
net/batman-adv/bitarray.c+1−1
@@ -24,7 +24,7 @@ static void batadv_bitmap_shift_left(unsigned long *seq_bits, s32 n) · 23 unmodified lines
24 * batadv_bit_get_packet() - receive and process one packet within the sequence24 * batadv_bit_get_packet() - receive and process one packet within the sequence
25 * number window25 * number window
26 * @priv: the bat priv with all the mesh interface information26 * @priv: the bat priv with all the mesh interface information
27 * @seq_bits: pointer to the sequence number receive packet27 * @seq_bits: pointer to the sequence number bitmap of received packets
28 * @seq_num_diff: difference between the current/received sequence number and28 * @seq_num_diff: difference between the current/received sequence number and
29 * the last sequence number29 * the last sequence number
30 * @set_mark: whether this packet should be marked in seq_bits30 * @set_mark: whether this packet should be marked in seq_bits
net/batman-adv/bitarray.h+1−1
@@ -17,7 +17,7 @@ · 16 unmodified lines
17/**17/**
18 * batadv_test_bit() - check if bit is set in the current window18 * batadv_test_bit() - check if bit is set in the current window
19 *19 *
20 * @seq_bits: pointer to the sequence number receive packet20 * @seq_bits: pointer to the sequence number bitmap of received packets
21 * @last_seqno: latest sequence number in seq_bits21 * @last_seqno: latest sequence number in seq_bits
22 * @curr_seqno: sequence number to test for22 * @curr_seqno: sequence number to test for
23 *23 *
net/batman-adv/bridge_loop_avoidance.c+3−3
@@ -123,7 +123,7 @@ static bool batadv_compare_backbone_gw(const struct hlist_node *node, · 122 unmodified lines
123 * @node: list node of the first entry to compare123 * @node: list node of the first entry to compare
124 * @data2: pointer to the second claims124 * @data2: pointer to the second claims
125 *125 *
126 * Return: true if the claim have the same data, 0 otherwise126 * Return: true if the claims have the same data, false otherwise
127 */127 */
128static bool batadv_compare_claim(const struct hlist_node *node,128static bool batadv_compare_claim(const struct hlist_node *node,
129 const void *data2)129 const void *data2)
@@ -1282,7 +1282,7 @@ purge_now: · 1152 unmodified lines
1282 1282
1283 if (purged) {1283 if (purged) {
1284 /* reference for pending report_work */1284 /* reference for pending report_work */
1285 if (cancel_work_sync(&backbone_gw->report_work))1285 if (disable_work_sync(&backbone_gw->report_work))
1286 batadv_backbone_gw_put(backbone_gw);1286 batadv_backbone_gw_put(backbone_gw);
1287 1287
1288 /* reference for hash_entry */1288 /* reference for hash_entry */
@@ -1850,7 +1850,7 @@ void batadv_bla_free(struct batadv_priv *bat_priv) · 561 unmodified lines
1850{1850{
1851 struct batadv_hard_iface *primary_if;1851 struct batadv_hard_iface *primary_if;
1852 1852
1853 cancel_delayed_work_sync(&bat_priv->bla.work);1853 disable_delayed_work_sync(&bat_priv->bla.work);
1854 primary_if = batadv_primary_if_get_selected(bat_priv);1854 primary_if = batadv_primary_if_get_selected(bat_priv);
1855 1855
1856 if (bat_priv->bla.claim_hash) {1856 if (bat_priv->bla.claim_hash) {
net/batman-adv/bridge_loop_avoidance.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
21 * detect frame sent by bridge loop avoidance21 * detect frame sent by bridge loop avoidance
22 * @mac: mac address to check22 * @mac: mac address to check
23 *23 *
24 * Return: true if the it looks like a loop detect frame24 * Return: true if it looks like a loop detect frame
25 * (mac starts with BA:BE), false otherwise25 * (mac starts with BA:BE), false otherwise
26 */26 */
27static inline bool batadv_bla_is_loopdetect_mac(const uint8_t *mac)27static inline bool batadv_bla_is_loopdetect_mac(const uint8_t *mac)
net/batman-adv/distributed-arp-table.c+1−1
@@ -838,7 +838,7 @@ void batadv_dat_free(struct batadv_priv *bat_priv) · 837 unmodified lines
838 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_DAT, 1);838 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_DAT, 1);
839 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_DAT, 1);839 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_DAT, 1);
840 840
841 cancel_delayed_work_sync(&bat_priv->dat.work);841 disable_delayed_work_sync(&bat_priv->dat.work);
842 842
843 batadv_dat_hash_free(bat_priv);843 batadv_dat_hash_free(bat_priv);
844}844}
net/batman-adv/fragmentation.c+2−1
@@ -309,7 +309,8 @@ free: · 308 unmodified lines
309 * batadv_skb_is_frag() - check if newly merged skb contains unicast fragment309 * batadv_skb_is_frag() - check if newly merged skb contains unicast fragment
310 * @skb: newly merged skb310 * @skb: newly merged skb
311 *311 *
312 * Return: if newly merged skb is of type BATADV_UNICAST_FRAG312 * Return: true if the newly merged skb is of type BATADV_UNICAST_FRAG, false
313 * otherwise
313 */314 */
314static bool batadv_skb_is_frag(struct sk_buff *skb)315static bool batadv_skb_is_frag(struct sk_buff *skb)
315{316{
net/batman-adv/hard-interface.c+9−6
@@ -971,9 +971,9 @@ static int batadv_hard_if_event_meshif(unsigned long event, · 970 unmodified lines
971/**971/**
972 * batadv_wifi_net_device_insert() - save information about wifi net_device972 * batadv_wifi_net_device_insert() - save information about wifi net_device
973 * @net_dev: net_device to add to batadv_wifi_net_devices973 * @net_dev: net_device to add to batadv_wifi_net_devices
974 * @wifi_flags: net_device which generated an event974 * @wifi_flags: extracted batadv_hard_iface_wifi_flags of a net_device
975 *975 *
976 * Return: 0 on result, negative value on error976 * Return: 0 on success, negative value on error
977 */977 */
978static int978static int
979batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)979batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)
@@ -983,12 +983,11 @@ batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags) · 3 unmodified lines
983 983
984 ASSERT_RTNL();984 ASSERT_RTNL();
985 985
986 device_state = kzalloc_obj(*device_state, GFP_ATOMIC);986 device_state = kzalloc_obj(*device_state, GFP_KERNEL);
987 if (!device_state)987 if (!device_state)
988 return -ENOMEM;988 return -ENOMEM;
989 989
990 device_state->wifi_flags = wifi_flags;990 netdev_hold(net_dev, &device_state->dev_tracker, GFP_KERNEL);
991 netdev_hold(net_dev, &device_state->dev_tracker, GFP_ATOMIC);
992 device_state->netdev = net_dev;991 device_state->netdev = net_dev;
993 WRITE_ONCE(device_state->wifi_flags, wifi_flags);992 WRITE_ONCE(device_state->wifi_flags, wifi_flags);
994 993
@@ -1007,7 +1006,7 @@ err_free: · 12 unmodified lines
1007 1006
1008/**1007/**
1009 * batadv_wifi_net_device_remove() - remove information about wifi net_device1008 * batadv_wifi_net_device_remove() - remove information about wifi net_device
1010 * @device_state: wifi net_device state to remove from batadv_wifi_net_device_state1009 * @device_state: wifi net_device state to remove from batadv_wifi_net_devices
1011 */1010 */
1012static void1011static void
1013batadv_wifi_net_device_remove(struct batadv_wifi_net_device_state *device_state)1012batadv_wifi_net_device_remove(struct batadv_wifi_net_device_state *device_state)
@@ -1186,5 +1185,9 @@ int __init batadv_wifi_net_devices_init(void) · 172 unmodified lines
1186 */1185 */
1187void batadv_wifi_net_devices_deinit(void)1186void batadv_wifi_net_devices_deinit(void)
1188{1187{
1188 /* just destroy table. entries should have been removed by
1189 * unregister_netdevice_notifier() and the corresponding
1190 * NETDEV_UNREGISTER events
1191 */
1189 rhashtable_destroy(&batadv_wifi_net_devices);1192 rhashtable_destroy(&batadv_wifi_net_devices);
1190}1193}
net/batman-adv/hard-interface.h+2−2
@@ -126,7 +126,7 @@ out: · 125 unmodified lines
126/**126/**
127 * batadv_is_cfg80211() - check if the given hardif is a cfg80211127 * batadv_is_cfg80211() - check if the given hardif is a cfg80211
128 * wifi interface128 * wifi interface
129 * @wifi_flags: extracted batadv_hard_iface_wifi_flagss of an net_device129 * @wifi_flags: extracted batadv_hard_iface_wifi_flags of a net_device
130 *130 *
131 * Return: true if the net device is a cfg80211 wireless device, false131 * Return: true if the net device is a cfg80211 wireless device, false
132 * otherwise.132 * otherwise.
@@ -143,7 +143,7 @@ static inline bool batadv_is_cfg80211(u32 wifi_flags) · 10 unmodified lines
143 143
144/**144/**
145 * batadv_is_wifi() - check if flags belong to wifi interface145 * batadv_is_wifi() - check if flags belong to wifi interface
146 * @wifi_flags: extracted batadv_hard_iface_wifi_flagss of an net_device146 * @wifi_flags: extracted batadv_hard_iface_wifi_flags of a net_device
147 *147 *
148 * Return: true if the net device is a 802.11 wireless device, false otherwise.148 * Return: true if the net device is a 802.11 wireless device, false otherwise.
149 */149 */
net/batman-adv/hash.h+2−2
@@ -120,10 +120,10 @@ out: · 119 unmodified lines
120 * @choose: callback calculating the hash index120 * @choose: callback calculating the hash index
121 * @data: data passed to the aforementioned callbacks as argument121 * @data: data passed to the aforementioned callbacks as argument
122 *122 *
123 * ata could be the structure you use with just the key filled, we just need123 * data could be the structure you use with just the key filled, we just need
124 * the key for comparing.124 * the key for comparing.
125 *125 *
126 * Return: returns pointer do data on success, so you can remove the used126 * Return: returns pointer to data on success, so you can remove the used
127 * structure yourself, or NULL on error127 * structure yourself, or NULL on error
128 */128 */
129static inline void *batadv_hash_remove(struct batadv_hashtable *hash,129static inline void *batadv_hash_remove(struct batadv_hashtable *hash,
net/batman-adv/mesh-interface.c+3−3
@@ -392,13 +392,13 @@ end: · 391 unmodified lines
392 * @orig_node: originator from which the batman-adv packet was sent392 * @orig_node: originator from which the batman-adv packet was sent
393 *393 *
394 * Sends an ethernet frame to the receive path of the local @mesh_iface.394 * Sends an ethernet frame to the receive path of the local @mesh_iface.
395 * skb->data has still point to the batman-adv header with the size @hdr_size.395 * skb->data must still point to the batman-adv header with the size @hdr_size.
396 * The caller has to have parsed this header already and made sure that at least396 * The caller has to have parsed this header already and made sure that at least
397 * @hdr_size bytes are still available for pull in @skb.397 * @hdr_size bytes are still available for pull in @skb.
398 *398 *
399 * The packet may still get dropped. This can happen when the encapsulated399 * The packet may still get dropped. This can happen when the encapsulated
400 * ethernet frame is invalid or contains again an batman-adv packet. Also400 * ethernet frame is invalid or contains again a batman-adv packet. Also
401 * unicast packets will be dropped directly when it was sent between two401 * unicast packets will be dropped directly when they were sent between two
402 * isolated clients.402 * isolated clients.
403 */403 */
404void batadv_interface_rx(struct net_device *mesh_iface,404void batadv_interface_rx(struct net_device *mesh_iface,
net/batman-adv/multicast.c+1−1
@@ -2161,7 +2161,7 @@ int batadv_mcast_flags_dump(struct sk_buff *msg, struct netlink_callback *cb) · 2160 unmodified lines
2161 */2161 */
2162void batadv_mcast_free(struct batadv_priv *bat_priv)2162void batadv_mcast_free(struct batadv_priv *bat_priv)
2163{2163{
2164 cancel_delayed_work_sync(&bat_priv->mcast.work);2164 disable_delayed_work_sync(&bat_priv->mcast.work);
2165 2165
2166 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_MCAST, 2);2166 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_MCAST, 2);
2167 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST_TRACKER, 1);2167 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST_TRACKER, 1);
net/batman-adv/netlink.c+2−2
@@ -944,7 +944,7 @@ static int batadv_netlink_set_hardif(struct sk_buff *skb, · 943 unmodified lines
944}944}
945 945
946/**946/**
947 * batadv_netlink_dump_hardif() - Dump all hard interface into a messages947 * batadv_netlink_dump_hardif() - Dump all hard interfaces into a message
948 * @msg: Netlink message to dump into948 * @msg: Netlink message to dump into
949 * @cb: Parameters from query949 * @cb: Parameters from query
950 *950 *
@@ -1101,7 +1101,7 @@ static int batadv_netlink_get_vlan(struct sk_buff *skb, struct genl_info *info) · 150 unmodified lines
1101}1101}
1102 1102
1103/**1103/**
1104 * batadv_netlink_set_vlan() - Get vlan attributes1104 * batadv_netlink_set_vlan() - Set vlan attributes
1105 * @skb: Netlink message with request data1105 * @skb: Netlink message with request data
1106 * @info: receiver information1106 * @info: receiver information
1107 *1107 *
net/batman-adv/originator.c+3−3
@@ -439,7 +439,7 @@ out: · 438 unmodified lines
439}439}
440 440
441/**441/**
442 * batadv_neigh_ifinfo_get() - find the ifinfo from an neigh_node442 * batadv_neigh_ifinfo_get() - find the ifinfo from a neigh_node
443 * @neigh: the neigh node to be queried443 * @neigh: the neigh node to be queried
444 * @if_outgoing: the interface for which the ifinfo should be acquired444 * @if_outgoing: the interface for which the ifinfo should be acquired
445 *445 *
@@ -472,7 +472,7 @@ batadv_neigh_ifinfo_get(struct batadv_neigh_node *neigh, · 26 unmodified lines
472}472}
473 473
474/**474/**
475 * batadv_neigh_ifinfo_new() - search and possibly create an neigh_ifinfo object475 * batadv_neigh_ifinfo_new() - search and possibly create a neigh_ifinfo object
476 * @neigh: the neigh node to be queried476 * @neigh: the neigh node to be queried
477 * @if_outgoing: the interface for which the ifinfo should be acquired477 * @if_outgoing: the interface for which the ifinfo should be acquired
478 *478 *
@@ -908,7 +908,7 @@ void batadv_originator_free(struct batadv_priv *bat_priv) · 429 unmodified lines
908 if (!hash)908 if (!hash)
909 return;909 return;
910 910
911 cancel_delayed_work_sync(&bat_priv->orig_work);911 disable_delayed_work_sync(&bat_priv->orig_work);
912 912
913 bat_priv->orig_hash = NULL;913 bat_priv->orig_hash = NULL;
914 914
net/batman-adv/send.c+1−1
@@ -629,7 +629,7 @@ static void batadv_forw_packet_list_free(struct hlist_head *head) · 628 unmodified lines
629 629
630 hlist_for_each_entry_safe(forw_packet, safe_tmp_node, head,630 hlist_for_each_entry_safe(forw_packet, safe_tmp_node, head,
631 cleanup_list) {631 cleanup_list) {
632 cancel_delayed_work_sync(&forw_packet->delayed_work);632 disable_delayed_work_sync(&forw_packet->delayed_work);
633 633
634 hlist_del(&forw_packet->cleanup_list);634 hlist_del(&forw_packet->cleanup_list);
635 batadv_forw_packet_free(forw_packet, true);635 batadv_forw_packet_free(forw_packet, true);
net/batman-adv/tp_meter.c+16−12
@@ -289,7 +289,7 @@ batadv_tp_list_find_sender(struct batadv_priv *bat_priv, const u8 *dst) · 288 unmodified lines
289 * @bat_priv: the bat priv with all the mesh interface information289 * @bat_priv: the bat priv with all the mesh interface information
290 * @dst: the other endpoint MAC address to look for290 * @dst: the other endpoint MAC address to look for
291 *291 *
292 * Return: if matching session with @dst was found292 * Return: true if a matching session with @dst was found, false otherwise
293 */293 */
294static bool batadv_tp_list_active(struct batadv_priv *bat_priv, const u8 *dst)294static bool batadv_tp_list_active(struct batadv_priv *bat_priv, const u8 *dst)
295 __must_hold(&bat_priv->tp_list_lock)295 __must_hold(&bat_priv->tp_list_lock)
@@ -355,7 +355,7 @@ batadv_tp_list_find_sender_session(struct batadv_priv *bat_priv, const u8 *dst, · 59 unmodified lines
355/**355/**
356 * batadv_tp_vars_common_release() - release batadv_tp_vars_common from lists356 * batadv_tp_vars_common_release() - release batadv_tp_vars_common from lists
357 * and queue for free after rcu grace period357 * and queue for free after rcu grace period
358 * @ref: kref pointer of the batadv_tp_vars358 * @ref: kref pointer of the batadv_tp_vars_common
359 */359 */
360static void batadv_tp_vars_common_release(struct kref *ref)360static void batadv_tp_vars_common_release(struct kref *ref)
361{361{
@@ -391,7 +391,7 @@ static void batadv_tp_sender_put(struct batadv_tp_sender *tp_vars) · 29 unmodified lines
391}391}
392 392
393/**393/**
394 * batadv_tp_list_detach() - remove tp receiver session from mesh session list once394 * batadv_tp_list_detach() - remove tp session from mesh session list once
395 * @tp_vars: the private data of the current TP meter session395 * @tp_vars: the private data of the current TP meter session
396 *396 *
397 * Return: whether tp_vars was detached from list and reference must be freed397 * Return: whether tp_vars was detached from list and reference must be freed
@@ -421,7 +421,7 @@ static bool batadv_tp_list_detach(struct batadv_tp_vars_common *tp_vars) · 23 unmodified lines
421 */421 */
422static void batadv_tp_sender_cleanup(struct batadv_tp_sender *tp_vars)422static void batadv_tp_sender_cleanup(struct batadv_tp_sender *tp_vars)
423{423{
424 cancel_delayed_work_sync(&tp_vars->finish_work);424 disable_delayed_work_sync(&tp_vars->finish_work);
425 425
426 if (batadv_tp_list_detach(&tp_vars->common))426 if (batadv_tp_list_detach(&tp_vars->common))
427 batadv_tp_sender_put(tp_vars);427 batadv_tp_sender_put(tp_vars);
@@ -509,7 +509,7 @@ static void batadv_tp_sender_finish(struct work_struct *work) · 81 unmodified lines
509 * batadv_tp_reset_sender_timer() - reschedule the sender timer509 * batadv_tp_reset_sender_timer() - reschedule the sender timer
510 * @tp_vars: the private TP meter data for this session510 * @tp_vars: the private TP meter data for this session
511 *511 *
512 * Reschedule the timer using tp_vars->rto as delay512 * Reschedule the timer using tp_vars->cc.rto as delay
513 */513 */
514static void batadv_tp_reset_sender_timer(struct batadv_tp_sender *tp_vars)514static void batadv_tp_reset_sender_timer(struct batadv_tp_sender *tp_vars)
515{515{
@@ -621,9 +621,9 @@ static void batadv_tp_fill_prerandom(struct batadv_tp_sender *tp_vars, · 105 unmodified lines
621 *621 *
622 * Create and send a single TP Meter message.622 * Create and send a single TP Meter message.
623 *623 *
624 * Return: 0 on success, BATADV_TP_REASON_DST_UNREACHABLE if the destination is624 * Return: 0 on success, BATADV_TP_REASON_MEMORY_ERROR if the packet couldn't
625 * not reachable, BATADV_TP_REASON_MEMORY_ERROR if the packet couldn't be625 * be allocated, BATADV_TP_REASON_CANT_SEND if the packet could not be
626 * allocated626 * transmitted
627 */627 */
628static int batadv_tp_send_msg(struct batadv_tp_sender *tp_vars, const u8 *src,628static int batadv_tp_send_msg(struct batadv_tp_sender *tp_vars, const u8 *src,
629 struct batadv_orig_node *orig_node,629 struct batadv_orig_node *orig_node,
@@ -913,7 +913,7 @@ static int batadv_tp_wait_available(struct batadv_tp_sender *tp_vars, size_t ple · 283 unmodified lines
913 * batadv_tp_send() - main sending thread of a tp meter session913 * batadv_tp_send() - main sending thread of a tp meter session
914 * @arg: address of the related tp_vars914 * @arg: address of the related tp_vars
915 *915 *
916 * Return: nothing, this function never returns916 * Return: 0
917 */917 */
918static int batadv_tp_send(void *arg)918static int batadv_tp_send(void *arg)
919{919{
@@ -1511,8 +1511,10 @@ batadv_tp_init_recv(struct batadv_priv *bat_priv, · 591 unmodified lines
1511 1511
1512 tp_vars = batadv_tp_list_find_receiver_session(bat_priv, icmp->orig,1512 tp_vars = batadv_tp_list_find_receiver_session(bat_priv, icmp->orig,
1513 icmp->session);1513 icmp->session);
1514 if (tp_vars)1514 if (tp_vars) {
1515 tp_vars->last_recv_time = jiffies;
1515 goto out_unlock;1516 goto out_unlock;
1517 }
1516 1518
1517 if (!atomic_add_unless(&bat_priv->tp_num, 1, BATADV_TP_MAX_NUM)) {1519 if (!atomic_add_unless(&bat_priv->tp_num, 1, BATADV_TP_MAX_NUM)) {
1518 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,1520 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
@@ -1539,6 +1541,8 @@ batadv_tp_init_recv(struct batadv_priv *bat_priv, · 20 unmodified lines
1539 kref_get(&tp_vars->common.refcount);1541 kref_get(&tp_vars->common.refcount);
1540 timer_setup(&tp_vars->common.timer, batadv_tp_receiver_shutdown, 0);1542 timer_setup(&tp_vars->common.timer, batadv_tp_receiver_shutdown, 0);
1541 1543
1544 tp_vars->last_recv_time = jiffies;
1545
1542 kref_get(&tp_vars->common.refcount);1546 kref_get(&tp_vars->common.refcount);
1543 hlist_add_head_rcu(&tp_vars->common.list, &bat_priv->tp_receiver_list);1547 hlist_add_head_rcu(&tp_vars->common.list, &bat_priv->tp_receiver_list);
1544 1548
@@ -1587,9 +1591,9 @@ static void batadv_tp_recv_msg(struct batadv_priv *bat_priv, · 42 unmodified lines
1587 icmp->orig);1591 icmp->orig);
1588 goto out;1592 goto out;
1589 }1593 }
1590 }
1591 1594
1592 tp_vars->last_recv_time = jiffies;1595 tp_vars->last_recv_time = jiffies;
1596 }
1593 1597
1594 /* if the packet is a duplicate, it may be the case that an ACK has been1598 /* if the packet is a duplicate, it may be the case that an ACK has been
1595 * lost. Resend the ACK1599 * lost. Resend the ACK
net/batman-adv/translation-table.c+1−1
@@ -3574,7 +3574,7 @@ void batadv_tt_free(struct batadv_priv *bat_priv) · 3573 unmodified lines
3574 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_TT, 1);3574 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_TT, 1);
3575 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_TT, 1);3575 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_TT, 1);
3576 3576
3577 cancel_delayed_work_sync(&bat_priv->tt.work);3577 disable_delayed_work_sync(&bat_priv->tt.work);
3578 3578
3579 batadv_tt_local_table_free(bat_priv);3579 batadv_tt_local_table_free(bat_priv);
3580 batadv_tt_global_table_free(bat_priv);3580 batadv_tt_global_table_free(bat_priv);
net/batman-adv/tvlv.c+2−2
@@ -48,7 +48,7 @@ static void batadv_tvlv_handler_release(struct kref *ref) · 47 unmodified lines
48}48}
49 49
50/**50/**
51 * batadv_tvlv_handler_put() - decrement the tvlv container refcounter and51 * batadv_tvlv_handler_put() - decrement the tvlv handler refcounter and
52 * possibly release it52 * possibly release it
53 * @tvlv_handler: the tvlv handler to free53 * @tvlv_handler: the tvlv handler to free
54 */54 */
@@ -272,7 +272,7 @@ void batadv_tvlv_container_register(struct batadv_priv *bat_priv, · 217 unmodified lines
272 * @additional_packet_len: requested additional packet size on top of minimum272 * @additional_packet_len: requested additional packet size on top of minimum
273 * size273 * size
274 *274 *
275 * Return: true of the packet buffer could be changed to the requested size,275 * Return: true if the packet buffer could be changed to the requested size,
276 * false otherwise.276 * false otherwise.
277 */277 */
278static bool batadv_tvlv_realloc_packet_buff(struct batadv_ogm_buf *ogm_buff,278static bool batadv_tvlv_realloc_packet_buff(struct batadv_ogm_buf *ogm_buff,
net/batman-adv/types.h+15−9
@@ -1331,7 +1331,7 @@ struct batadv_tp_unacked { · 1330 unmodified lines
1331 /** @len: length of the packet */1331 /** @len: length of the packet */
1332 u16 len;1332 u16 len;
1333 1333
1334 /** @list: list node for &batadv_tp_vars.unacked_list */1334 /** @list: list node for &batadv_tp_vars_common.unacked_list */
1335 struct list_head list;1335 struct list_head list;
1336};1336};
1337 1337
@@ -1367,7 +1367,9 @@ struct batadv_tp_vars_common { · 29 unmodified lines
1367 struct rcu_head rcu;1367 struct rcu_head rcu;
1368};1368};
1369 1369
1370/** struct batadv_tp_sender_cc - congestion control variables */1370/**
1371 * struct batadv_tp_sender_cc - congestion control variables
1372 */
1371struct batadv_tp_sender_cc {1373struct batadv_tp_sender_cc {
1372 /** @fast_recovery: true if in Fast Recovery mode */1374 /** @fast_recovery: true if in Fast Recovery mode */
1373 bool fast_recovery:1;1375 bool fast_recovery:1;
@@ -1410,7 +1412,7 @@ struct batadv_tp_sender_cc { · 36 unmodified lines
1410 * struct batadv_tp_sender - sender tp meter private variables per session1412 * struct batadv_tp_sender - sender tp meter private variables per session
1411 */1413 */
1412struct batadv_tp_sender {1414struct batadv_tp_sender {
1413 /** @common: common batadv_tp_vars (best be first member) */1415 /** @common: common batadv_tp_vars_common (must be first member) */
1414 struct batadv_tp_vars_common common;1416 struct batadv_tp_vars_common common;
1415 1417
1416 /** @start_time: start time in jiffies */1418 /** @start_time: start time in jiffies */
@@ -1437,7 +1439,7 @@ struct batadv_tp_sender { · 20 unmodified lines
1437 /** @cc: congestion control variables */1439 /** @cc: congestion control variables */
1438 struct batadv_tp_sender_cc cc;1440 struct batadv_tp_sender_cc cc;
1439 1441
1440 /** @cc_lock: lock do protect @cc */1442 /** @cc_lock: lock to protect @cc */
1441 spinlock_t cc_lock;1443 spinlock_t cc_lock;
1442 1444
1443 /** @tot_sent: amount of data sent/ACKed so far */1445 /** @tot_sent: amount of data sent/ACKed so far */
@@ -1460,7 +1462,7 @@ struct batadv_tp_sender { · 16 unmodified lines
1460 * struct batadv_tp_receiver - receiver tp meter private variables per session1462 * struct batadv_tp_receiver - receiver tp meter private variables per session
1461 */1463 */
1462struct batadv_tp_receiver {1464struct batadv_tp_receiver {
1463 /** @common: common batadv_tp_vars (best be first member) */1465 /** @common: common batadv_tp_vars_common (must be first member) */
1464 struct batadv_tp_vars_common common;1466 struct batadv_tp_vars_common common;
1465 1467
1466 /** @receiving: receiving binary semaphore: 1 if receiving, 0 is not */1468 /** @receiving: receiving binary semaphore: 1 if receiving, 0 is not */
@@ -1662,7 +1664,7 @@ struct batadv_priv { · 195 unmodified lines
1662 /** @forw_bcast_list_lock: lock protecting forw_bcast_list */1664 /** @forw_bcast_list_lock: lock protecting forw_bcast_list */
1663 spinlock_t forw_bcast_list_lock;1665 spinlock_t forw_bcast_list_lock;
1664 1666
1665 /** @tp_list_lock: spinlock protecting @tp_list */1667 /** @tp_list_lock: spinlock protecting @tp_sender_list + @tp_receiver_list */
1666 spinlock_t tp_list_lock;1668 spinlock_t tp_list_lock;
1667 1669
1668 /** @tp_num: number of currently active tp sessions */1670 /** @tp_num: number of currently active tp sessions */
@@ -1721,22 +1723,26 @@ struct batadv_priv { · 52 unmodified lines
1721 1723
1722#ifdef CONFIG_BATMAN_ADV_BLA1724#ifdef CONFIG_BATMAN_ADV_BLA
1723 1725
1726/**
1727 * enum batadv_bla_backbone_gw_state - state of a bridge loop avoidance
1728 * backbone gateway
1729 */
1724enum batadv_bla_backbone_gw_state {1730enum batadv_bla_backbone_gw_state {
1725 /**1731 /**
1726 * @BATADV_BLA_BACKBONE_GW_STOPPED: backbone gw is being removed1732 * @BATADV_BLA_BACKBONE_GW_STOPPED: backbone gw is being removed
1727 * and it must not longer work on requests1733 * and it must no longer work on requests
1728 */1734 */
1729 BATADV_BLA_BACKBONE_GW_STOPPED,1735 BATADV_BLA_BACKBONE_GW_STOPPED,
1730 1736
1731 /**1737 /**
1732 * @BATADV_BLA_BACKBONE_GW_UNSYNCED: backbone was detected out1738 * @BATADV_BLA_BACKBONE_GW_UNSYNCED: backbone was detected out
1733 * of sync and a request was send. No traffic is forwarded until the1739 * of sync and a request was sent. No traffic is forwarded until the
1734 * situation is resolved1740 * situation is resolved
1735 */1741 */
1736 BATADV_BLA_BACKBONE_GW_UNSYNCED,1742 BATADV_BLA_BACKBONE_GW_UNSYNCED,
1737 1743
1738 /**1744 /**
1739 * @BATADV_BLA_BACKBONE_GW_SYNCED: backbone is consider to be in1745 * @BATADV_BLA_BACKBONE_GW_SYNCED: backbone is considered to be in
1740 * sync. traffic can be forwarded1746 * sync. traffic can be forwarded
1741 */1747 */
1742 BATADV_BLA_BACKBONE_GW_SYNCED,1748 BATADV_BLA_BACKBONE_GW_SYNCED,