aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2011-07-09 11:52:13 -0400
committerMarek Lindner <lindner_marek@yahoo.de>2011-08-22 09:16:19 -0400
commit015758d00251a4dd9287806cdab4b9c1298f97ed (patch)
treef7569640da23701bc5c391afc1033cf89e1626aa /net
parent1a1f37d9257a4792ca17b28b1c2e4ad15fe95b28 (diff)
batman-adv: correct several typ0s in the comments
Several typos have been corrected and some sentences have been rephrased Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/bitarray.c6
-rw-r--r--net/batman-adv/gateway_client.c10
-rw-r--r--net/batman-adv/hard-interface.c4
-rw-r--r--net/batman-adv/main.h4
-rw-r--r--net/batman-adv/routing.c19
-rw-r--r--net/batman-adv/send.c10
-rw-r--r--net/batman-adv/soft-interface.c2
-rw-r--r--net/batman-adv/translation-table.c8
-rw-r--r--net/batman-adv/translation-table.h2
-rw-r--r--net/batman-adv/types.h4
-rw-r--r--net/batman-adv/unicast.h2
-rw-r--r--net/batman-adv/vis.c2
12 files changed, 36 insertions, 37 deletions
diff --git a/net/batman-adv/bitarray.c b/net/batman-adv/bitarray.c
index c1f4bfc09cc3..0be9ff346fa0 100644
--- a/net/batman-adv/bitarray.c
+++ b/net/batman-adv/bitarray.c
@@ -97,12 +97,12 @@ static void bit_shift(unsigned long *seq_bits, int32_t n)
97 (seq_bits[i - word_num - 1] >> 97 (seq_bits[i - word_num - 1] >>
98 (WORD_BIT_SIZE-word_offset)); 98 (WORD_BIT_SIZE-word_offset));
99 /* and the upper part of the right half and shift it left to 99 /* and the upper part of the right half and shift it left to
100 * it's position */ 100 * its position */
101 /* for our example that would be: word[0] = 9800 + 0076 = 101 /* for our example that would be: word[0] = 9800 + 0076 =
102 * 9876 */ 102 * 9876 */
103 } 103 }
104 /* now for our last word, i==word_num, we only have the it's "left" 104 /* now for our last word, i==word_num, we only have its "left" half.
105 * half. that's the 1000 word in our example.*/ 105 * that's the 1000 word in our example.*/
106 106
107 seq_bits[i] = (seq_bits[i - word_num] << word_offset); 107 seq_bits[i] = (seq_bits[i - word_num] << word_offset);
108 108
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 056180ef9e1a..619fb73b3b76 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -532,14 +532,14 @@ static bool is_type_dhcprequest(struct sk_buff *skb, int header_len)
532 pkt_len -= header_len + DHCP_OPTIONS_OFFSET + 1; 532 pkt_len -= header_len + DHCP_OPTIONS_OFFSET + 1;
533 533
534 /* Access the dhcp option lists. Each entry is made up by: 534 /* Access the dhcp option lists. Each entry is made up by:
535 * - octect 1: option type 535 * - octet 1: option type
536 * - octect 2: option data len (only if type != 255 and 0) 536 * - octet 2: option data len (only if type != 255 and 0)
537 * - octect 3: option data */ 537 * - octet 3: option data */
538 while (*p != 255 && !ret) { 538 while (*p != 255 && !ret) {
539 /* p now points to the first octect: option type */ 539 /* p now points to the first octet: option type */
540 if (*p == 53) { 540 if (*p == 53) {
541 /* type 53 is the message type option. 541 /* type 53 is the message type option.
542 * Jump the len octect and go to the data octect */ 542 * Jump the len octet and go to the data octet */
543 if (pkt_len < 2) 543 if (pkt_len < 2)
544 goto out; 544 goto out;
545 p += 2; 545 p += 2;
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index db7aacf1e095..0d73e1e9e3d5 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -249,7 +249,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface)
249 249
250 /** 250 /**
251 * the first active interface becomes our primary interface or 251 * the first active interface becomes our primary interface or
252 * the next active interface after the old primay interface was removed 252 * the next active interface after the old primary interface was removed
253 */ 253 */
254 primary_if = primary_if_get_selected(bat_priv); 254 primary_if = primary_if_get_selected(bat_priv);
255 if (!primary_if) 255 if (!primary_if)
@@ -573,7 +573,7 @@ out:
573 return NOTIFY_DONE; 573 return NOTIFY_DONE;
574} 574}
575 575
576/* receive a packet with the batman ethertype coming on a hard 576/* incoming packets with the batman ethertype received on any active hard
577 * interface */ 577 * interface */
578static int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, 578static int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
579 struct packet_type *ptype, 579 struct packet_type *ptype,
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index a6df61a6933b..3daa9b65a833 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -44,7 +44,7 @@
44#define PURGE_TIMEOUT 200 44#define PURGE_TIMEOUT 200
45#define TT_LOCAL_TIMEOUT 3600 /* in seconds */ 45#define TT_LOCAL_TIMEOUT 3600 /* in seconds */
46#define TT_CLIENT_ROAM_TIMEOUT 600 46#define TT_CLIENT_ROAM_TIMEOUT 600
47/* sliding packet range of received originator messages in squence numbers 47/* sliding packet range of received originator messages in sequence numbers
48 * (should be a multiple of our word size) */ 48 * (should be a multiple of our word size) */
49#define TQ_LOCAL_WINDOW_SIZE 64 49#define TQ_LOCAL_WINDOW_SIZE 64
50#define TT_REQUEST_TIMEOUT 3 /* seconds we have to keep pending tt_req */ 50#define TT_REQUEST_TIMEOUT 3 /* seconds we have to keep pending tt_req */
@@ -133,7 +133,7 @@ enum dbg_level {
133#include <linux/mutex.h> /* mutex */ 133#include <linux/mutex.h> /* mutex */
134#include <linux/module.h> /* needed by all modules */ 134#include <linux/module.h> /* needed by all modules */
135#include <linux/netdevice.h> /* netdevice */ 135#include <linux/netdevice.h> /* netdevice */
136#include <linux/etherdevice.h> /* ethernet address classifaction */ 136#include <linux/etherdevice.h> /* ethernet address classification */
137#include <linux/if_ether.h> /* ethernet header */ 137#include <linux/if_ether.h> /* ethernet header */
138#include <linux/poll.h> /* poll_table */ 138#include <linux/poll.h> /* poll_table */
139#include <linux/kthread.h> /* kernel threads */ 139#include <linux/kthread.h> /* kernel threads */
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 0f32c818874d..ec23f9f7d146 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -75,10 +75,9 @@ static void update_transtable(struct bat_priv *bat_priv,
75 75
76 /* the ttvn increased by one -> we can apply the attached changes */ 76 /* the ttvn increased by one -> we can apply the attached changes */
77 if (ttvn - orig_ttvn == 1) { 77 if (ttvn - orig_ttvn == 1) {
78 /* the OGM could not contain the changes because they were too 78 /* the OGM could not contain the changes due to their size or
79 * many to fit in one frame or because they have already been 79 * because they have already been sent TT_OGM_APPEND_MAX times.
80 * sent TT_OGM_APPEND_MAX times. In this case send a tt 80 * In this case send a tt request */
81 * request */
82 if (!tt_num_changes) { 81 if (!tt_num_changes) {
83 full_table = false; 82 full_table = false;
84 goto request_table; 83 goto request_table;
@@ -87,13 +86,13 @@ static void update_transtable(struct bat_priv *bat_priv,
87 tt_update_changes(bat_priv, orig_node, tt_num_changes, ttvn, 86 tt_update_changes(bat_priv, orig_node, tt_num_changes, ttvn,
88 (struct tt_change *)tt_buff); 87 (struct tt_change *)tt_buff);
89 88
90 /* Even if we received the crc into the OGM, we prefer 89 /* Even if we received the precomputed crc with the OGM, we
91 * to recompute it to spot any possible inconsistency 90 * prefer to recompute it to spot any possible inconsistency
92 * in the global table */ 91 * in the global table */
93 orig_node->tt_crc = tt_global_crc(bat_priv, orig_node); 92 orig_node->tt_crc = tt_global_crc(bat_priv, orig_node);
94 93
95 /* The ttvn alone is not enough to guarantee consistency 94 /* The ttvn alone is not enough to guarantee consistency
96 * because a single value could repesent different states 95 * because a single value could represent different states
97 * (due to the wrap around). Thus a node has to check whether 96 * (due to the wrap around). Thus a node has to check whether
98 * the resulting table (after applying the changes) is still 97 * the resulting table (after applying the changes) is still
99 * consistent or not. E.g. a node could disconnect while its 98 * consistent or not. E.g. a node could disconnect while its
@@ -228,7 +227,7 @@ static int is_bidirectional_neigh(struct orig_node *orig_node,
228 if (!neigh_node) 227 if (!neigh_node)
229 goto out; 228 goto out;
230 229
231 /* if orig_node is direct neighbour update neigh_node last_valid */ 230 /* if orig_node is direct neighbor update neigh_node last_valid */
232 if (orig_node == orig_neigh_node) 231 if (orig_node == orig_neigh_node)
233 neigh_node->last_valid = jiffies; 232 neigh_node->last_valid = jiffies;
234 233
@@ -473,7 +472,7 @@ static void update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
473 if (router && (router->tq_avg > neigh_node->tq_avg)) 472 if (router && (router->tq_avg > neigh_node->tq_avg))
474 goto update_tt; 473 goto update_tt;
475 474
476 /* if the TQ is the same and the link not more symetric we 475 /* if the TQ is the same and the link not more symmetric we
477 * won't consider it either */ 476 * won't consider it either */
478 if (router && (neigh_node->tq_avg == router->tq_avg)) { 477 if (router && (neigh_node->tq_avg == router->tq_avg)) {
479 orig_node_tmp = router->orig_node; 478 orig_node_tmp = router->orig_node;
@@ -1243,7 +1242,7 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
1243 } 1242 }
1244 break; 1243 break;
1245 case TT_RESPONSE: 1244 case TT_RESPONSE:
1246 /* packet needs to be linearised to access the TT changes */ 1245 /* packet needs to be linearized to access the TT changes */
1247 if (skb_linearize(skb) < 0) 1246 if (skb_linearize(skb) < 0)
1248 goto out; 1247 goto out;
1249 1248
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 58d14472068c..57ae80936911 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -135,7 +135,7 @@ static void send_packet_to_if(struct forw_packet *forw_packet,
135 "Forwarding")); 135 "Forwarding"));
136 bat_dbg(DBG_BATMAN, bat_priv, 136 bat_dbg(DBG_BATMAN, bat_priv,
137 "%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d," 137 "%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d,"
138 " IDF %s, hvn %d) on interface %s [%pM]\n", 138 " IDF %s, ttvn %d) on interface %s [%pM]\n",
139 fwd_str, (packet_num > 0 ? "aggregated " : ""), 139 fwd_str, (packet_num > 0 ? "aggregated " : ""),
140 batman_packet->orig, ntohl(batman_packet->seqno), 140 batman_packet->orig, ntohl(batman_packet->seqno),
141 batman_packet->tq, batman_packet->ttl, 141 batman_packet->tq, batman_packet->ttl,
@@ -313,7 +313,7 @@ void schedule_own_packet(struct hard_iface *hard_iface)
313 prepare_packet_buffer(bat_priv, hard_iface); 313 prepare_packet_buffer(bat_priv, hard_iface);
314 } 314 }
315 315
316 /* if the changes have been sent enough times */ 316 /* if the changes have been sent often enough */
317 if (!atomic_dec_not_zero(&bat_priv->tt_ogm_append_cnt)) 317 if (!atomic_dec_not_zero(&bat_priv->tt_ogm_append_cnt))
318 reset_packet_buffer(bat_priv, hard_iface); 318 reset_packet_buffer(bat_priv, hard_iface);
319 } 319 }
@@ -454,7 +454,7 @@ static void _add_bcast_packet_to_list(struct bat_priv *bat_priv,
454} 454}
455 455
456/* add a broadcast packet to the queue and setup timers. broadcast packets 456/* add a broadcast packet to the queue and setup timers. broadcast packets
457 * are sent multiple times to increase probability for beeing received. 457 * are sent multiple times to increase probability for being received.
458 * 458 *
459 * This function returns NETDEV_TX_OK on success and NETDEV_TX_BUSY on 459 * This function returns NETDEV_TX_OK on success and NETDEV_TX_BUSY on
460 * errors. 460 * errors.
@@ -612,7 +612,7 @@ void purge_outstanding_packets(struct bat_priv *bat_priv,
612 &bat_priv->forw_bcast_list, list) { 612 &bat_priv->forw_bcast_list, list) {
613 613
614 /** 614 /**
615 * if purge_outstanding_packets() was called with an argmument 615 * if purge_outstanding_packets() was called with an argument
616 * we delete only packets belonging to the given interface 616 * we delete only packets belonging to the given interface
617 */ 617 */
618 if ((hard_iface) && 618 if ((hard_iface) &&
@@ -641,7 +641,7 @@ void purge_outstanding_packets(struct bat_priv *bat_priv,
641 &bat_priv->forw_bat_list, list) { 641 &bat_priv->forw_bat_list, list) {
642 642
643 /** 643 /**
644 * if purge_outstanding_packets() was called with an argmument 644 * if purge_outstanding_packets() was called with an argument
645 * we delete only packets belonging to the given interface 645 * we delete only packets belonging to the given interface
646 */ 646 */
647 if ((hard_iface) && 647 if ((hard_iface) &&
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 3e2f91ffa4e2..6ba35a2772ff 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -532,7 +532,7 @@ static int interface_set_mac_addr(struct net_device *dev, void *p)
532 if (!is_valid_ether_addr(addr->sa_data)) 532 if (!is_valid_ether_addr(addr->sa_data))
533 return -EADDRNOTAVAIL; 533 return -EADDRNOTAVAIL;
534 534
535 /* only modify transtable if it has been initialised before */ 535 /* only modify transtable if it has been initialized before */
536 if (atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE) { 536 if (atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE) {
537 tt_local_remove(bat_priv, dev->dev_addr, 537 tt_local_remove(bat_priv, dev->dev_addr,
538 "mac address changed", false); 538 "mac address changed", false);
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index fb6931d00cd7..6004cd8eb9c7 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -369,8 +369,8 @@ static void tt_local_set_pending(struct bat_priv *bat_priv,
369 tt_local_event(bat_priv, tt_local_entry->addr, 369 tt_local_event(bat_priv, tt_local_entry->addr,
370 tt_local_entry->flags | flags); 370 tt_local_entry->flags | flags);
371 371
372 /* The local client has to be merked as "pending to be removed" but has 372 /* The local client has to be marked as "pending to be removed" but has
373 * to be kept in the table in order to send it in an full tables 373 * to be kept in the table in order to send it in a full table
374 * response issued before the net ttvn increment (consistency check) */ 374 * response issued before the net ttvn increment (consistency check) */
375 tt_local_entry->flags |= TT_CLIENT_PENDING; 375 tt_local_entry->flags |= TT_CLIENT_PENDING;
376} 376}
@@ -1137,12 +1137,12 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
1137 orig_ttvn = (uint8_t)atomic_read(&req_dst_orig_node->last_ttvn); 1137 orig_ttvn = (uint8_t)atomic_read(&req_dst_orig_node->last_ttvn);
1138 req_ttvn = tt_request->ttvn; 1138 req_ttvn = tt_request->ttvn;
1139 1139
1140 /* I have not the requested data */ 1140 /* I don't have the requested data */
1141 if (orig_ttvn != req_ttvn || 1141 if (orig_ttvn != req_ttvn ||
1142 tt_request->tt_data != req_dst_orig_node->tt_crc) 1142 tt_request->tt_data != req_dst_orig_node->tt_crc)
1143 goto out; 1143 goto out;
1144 1144
1145 /* If it has explicitly been requested the full table */ 1145 /* If the full table has been explicitly requested */
1146 if (tt_request->flags & TT_FULL_TABLE || 1146 if (tt_request->flags & TT_FULL_TABLE ||
1147 !req_dst_orig_node->tt_buff) 1147 !req_dst_orig_node->tt_buff)
1148 full_table = true; 1148 full_table = true;
diff --git a/net/batman-adv/translation-table.h b/net/batman-adv/translation-table.h
index d4122cba53b8..e6b564dfe97c 100644
--- a/net/batman-adv/translation-table.h
+++ b/net/batman-adv/translation-table.h
@@ -49,7 +49,7 @@ uint16_t tt_local_crc(struct bat_priv *bat_priv);
49uint16_t tt_global_crc(struct bat_priv *bat_priv, struct orig_node *orig_node); 49uint16_t tt_global_crc(struct bat_priv *bat_priv, struct orig_node *orig_node);
50void tt_free(struct bat_priv *bat_priv); 50void tt_free(struct bat_priv *bat_priv);
51int send_tt_request(struct bat_priv *bat_priv, 51int send_tt_request(struct bat_priv *bat_priv,
52 struct orig_node *dst_orig_node, uint8_t hvn, 52 struct orig_node *dst_orig_node, uint8_t ttvn,
53 uint16_t tt_crc, bool full_table); 53 uint16_t tt_crc, bool full_table);
54bool send_tt_response(struct bat_priv *bat_priv, 54bool send_tt_response(struct bat_priv *bat_priv,
55 struct tt_query_packet *tt_request); 55 struct tt_query_packet *tt_request);
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 25bd1db35370..bd0ced8a9a9e 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -57,7 +57,7 @@ struct hard_iface {
57 * @batman_seqno_reset: time when the batman seqno window was reset 57 * @batman_seqno_reset: time when the batman seqno window was reset
58 * @gw_flags: flags related to gateway class 58 * @gw_flags: flags related to gateway class
59 * @flags: for now only VIS_SERVER flag 59 * @flags: for now only VIS_SERVER flag
60 * @last_real_seqno: last and best known squence number 60 * @last_real_seqno: last and best known sequence number
61 * @last_ttl: ttl of last received packet 61 * @last_ttl: ttl of last received packet
62 * @last_bcast_seqno: last broadcast sequence number received by this host 62 * @last_bcast_seqno: last broadcast sequence number received by this host
63 * 63 *
@@ -156,7 +156,7 @@ struct bat_priv {
156 atomic_t bcast_seqno; 156 atomic_t bcast_seqno;
157 atomic_t bcast_queue_left; 157 atomic_t bcast_queue_left;
158 atomic_t batman_queue_left; 158 atomic_t batman_queue_left;
159 atomic_t ttvn; /* tranlation table version number */ 159 atomic_t ttvn; /* translation table version number */
160 atomic_t tt_ogm_append_cnt; 160 atomic_t tt_ogm_append_cnt;
161 atomic_t tt_local_changes; /* changes registered in a OGM interval */ 161 atomic_t tt_local_changes; /* changes registered in a OGM interval */
162 /* The tt_poss_change flag is used to detect an ongoing roaming phase. 162 /* The tt_poss_change flag is used to detect an ongoing roaming phase.
diff --git a/net/batman-adv/unicast.h b/net/batman-adv/unicast.h
index 62f54b954625..8fd5535544b9 100644
--- a/net/batman-adv/unicast.h
+++ b/net/batman-adv/unicast.h
@@ -24,7 +24,7 @@
24 24
25#include "packet.h" 25#include "packet.h"
26 26
27#define FRAG_TIMEOUT 10000 /* purge frag list entrys after time in ms */ 27#define FRAG_TIMEOUT 10000 /* purge frag list entries after time in ms */
28#define FRAG_BUFFER_SIZE 6 /* number of list elements in buffer */ 28#define FRAG_BUFFER_SIZE 6 /* number of list elements in buffer */
29 29
30int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, 30int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index 8b75cc562053..fb9b19fc638d 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -131,7 +131,7 @@ static void vis_data_insert_interface(const uint8_t *interface,
131 return; 131 return;
132 } 132 }
133 133
134 /* its a new address, add it to the list */ 134 /* it's a new address, add it to the list */
135 entry = kmalloc(sizeof(*entry), GFP_ATOMIC); 135 entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
136 if (!entry) 136 if (!entry)
137 return; 137 return;