summaryrefslogtreecommitdiff
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2015-11-10 18:50:51 +0100
committerAntonio Quartulli <a@unstable.cc>2016-02-29 16:25:06 +0800
commitc833484e5f3872a38fe232c663586069d5ad9645 (patch)
treed4ab62093f50a411de1fb0ed6bef90634fbe61b1 /net/batman-adv/types.h
parent95d392784dd0a51e4216e075f04a68c922745985 (diff)
downloadlwn-c833484e5f3872a38fe232c663586069d5ad9645.tar.gz
lwn-c833484e5f3872a38fe232c663586069d5ad9645.zip
batman-adv: ELP - compute the metric based on the estimated throughput
In case of wireless interface retrieve the throughput by querying cfg80211. To perform this call a separate work must be scheduled because the function may sleep and this is not allowed within an RCU protected context (RCU in this case is used to iterate over all the neighbours). Use ethtool to retrieve information about an Ethernet link like HALF/FULL_DUPLEX and advertised bandwidth (e.g. 100/10Mbps). The metric is updated each time a new ELP packet is sent, this way it is possible to timely react to a metric variation which can imply (for example) a neighbour disconnection. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r--net/batman-adv/types.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index c56bb8835e60..9abfb3e73c34 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -87,12 +87,25 @@ struct batadv_hard_iface_bat_iv {
};
/**
+ * enum batadv_v_hard_iface_flags - interface flags useful to B.A.T.M.A.N. V
+ * @BATADV_FULL_DUPLEX: tells if the connection over this link is full-duplex
+ * @BATADV_WARNING_DEFAULT: tells whether we have warned the user that no
+ * throughput data is available for this interface and that default values are
+ * assumed.
+ */
+enum batadv_v_hard_iface_flags {
+ BATADV_FULL_DUPLEX = BIT(0),
+ BATADV_WARNING_DEFAULT = BIT(1),
+};
+
+/**
* struct batadv_hard_iface_bat_v - per hard-interface B.A.T.M.A.N. V data
* @elp_interval: time interval between two ELP transmissions
* @elp_seqno: current ELP sequence number
* @elp_skb: base skb containing the ELP message to send
* @elp_wq: workqueue used to schedule ELP transmissions
* @throughput_override: throughput override to disable link auto-detection
+ * @flags: interface specific flags
*/
struct batadv_hard_iface_bat_v {
atomic_t elp_interval;
@@ -100,6 +113,7 @@ struct batadv_hard_iface_bat_v {
struct sk_buff *elp_skb;
struct delayed_work elp_wq;
atomic_t throughput_override;
+ u8 flags;
};
/**
@@ -378,12 +392,14 @@ DECLARE_EWMA(throughput, 1024, 8)
* @elp_interval: time interval between two ELP transmissions
* @elp_latest_seqno: latest and best known ELP sequence number
* @last_unicast_tx: when the last unicast packet has been sent to this neighbor
+ * @metric_work: work queue callback item for metric update
*/
struct batadv_hardif_neigh_node_bat_v {
struct ewma_throughput throughput;
u32 elp_interval;
u32 elp_latest_seqno;
unsigned long last_unicast_tx;
+ struct work_struct metric_work;
};
/**