blob: afb2e8dead3f25c38fd4dedc8f12531bcccb2774 [file] [log] [blame]
Holger Schurig5e8e8b52009-11-25 13:09:32 +01001/**
2 * Contains all definitions needed for the Libertas' MESH implementation.
3 */
4#ifndef _LBS_MESH_H_
5#define _LBS_MESH_H_
6
7
8#include <net/iw_handler.h>
Holger Schurigece1e3c2009-11-25 13:11:16 +01009#include <net/lib80211.h>
Holger Schurig5e8e8b52009-11-25 13:09:32 +010010
Dan Williamsa6bb1bc2010-07-27 13:03:46 -070011#include "host.h"
Holger Schurig5e8e8b52009-11-25 13:09:32 +010012
Holger Schurig4143a232009-12-02 15:26:02 +010013#ifdef CONFIG_LIBERTAS_MESH
14
Holger Schurig5e8e8b52009-11-25 13:09:32 +010015/* Mesh statistics */
16struct lbs_mesh_stats {
17 u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */
18 u32 fwd_unicast_cnt; /* Fwd: Unicast counter */
19 u32 fwd_drop_ttl; /* Fwd: TTL zero */
20 u32 fwd_drop_rbt; /* Fwd: Recently Broadcasted */
21 u32 fwd_drop_noroute; /* Fwd: No route to Destination */
22 u32 fwd_drop_nobuf; /* Fwd: Run out of internal buffers */
23 u32 drop_blind; /* Rx: Dropped by blinding table */
24 u32 tx_failed_cnt; /* Tx: Failed transmissions */
25};
26
27
28struct net_device;
Holger Schurige0e42da2009-11-25 13:10:15 +010029struct lbs_private;
30
31int lbs_init_mesh(struct lbs_private *priv);
32int lbs_deinit_mesh(struct lbs_private *priv);
33
34int lbs_add_mesh(struct lbs_private *priv);
35void lbs_remove_mesh(struct lbs_private *priv);
36
37
38/* Sending / Receiving */
39
40struct rxpd;
41struct txpd;
42
43struct net_device *lbs_mesh_set_dev(struct lbs_private *priv,
44 struct net_device *dev, struct rxpd *rxpd);
45void lbs_mesh_set_txpd(struct lbs_private *priv,
46 struct net_device *dev, struct txpd *txpd);
47
48
Holger Schurigece1e3c2009-11-25 13:11:16 +010049/* Command handling */
50
51struct cmd_ds_command;
Holger Schurig55e1ff92009-12-02 15:25:58 +010052struct cmd_ds_mesh_access;
53struct cmd_ds_mesh_config;
Holger Schurigece1e3c2009-11-25 13:11:16 +010054
Dan Williams52148652010-07-27 13:01:47 -070055int lbs_mesh_bt_add_del(struct lbs_private *priv, bool add, u8 *addr1);
56int lbs_mesh_bt_reset(struct lbs_private *priv);
57int lbs_mesh_bt_get_inverted(struct lbs_private *priv, bool *inverted);
58int lbs_mesh_bt_set_inverted(struct lbs_private *priv, bool inverted);
59int lbs_mesh_bt_get_entry(struct lbs_private *priv, u32 id, u8 *addr1);
60
Dan Williamsa6bb1bc2010-07-27 13:03:46 -070061int lbs_cmd_fwt_access(struct lbs_private *priv, u16 cmd_action,
62 struct cmd_ds_fwt_access *cmd);
63
Holger Schurig55e1ff92009-12-02 15:25:58 +010064int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
65 struct cmd_ds_mesh_access *cmd);
66int lbs_mesh_config_send(struct lbs_private *priv,
67 struct cmd_ds_mesh_config *cmd,
68 uint16_t action, uint16_t type);
69int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan);
70
Holger Schurigece1e3c2009-11-25 13:11:16 +010071
72
Holger Schurige0e42da2009-11-25 13:10:15 +010073/* Persistent configuration */
Holger Schurig5e8e8b52009-11-25 13:09:32 +010074
75void lbs_persist_config_init(struct net_device *net);
76void lbs_persist_config_remove(struct net_device *net);
77
Holger Schurige0e42da2009-11-25 13:10:15 +010078
Holger Schurigc7fe64c2009-11-25 13:10:49 +010079/* Ethtool statistics */
80
81struct ethtool_stats;
82
83void lbs_mesh_ethtool_get_stats(struct net_device *dev,
84 struct ethtool_stats *stats, uint64_t *data);
85int lbs_mesh_ethtool_get_sset_count(struct net_device *dev, int sset);
86void lbs_mesh_ethtool_get_strings(struct net_device *dev,
87 uint32_t stringset, uint8_t *s);
88
89
Holger Schurig602114a2009-12-02 15:26:01 +010090/* Accessors */
91
92#define lbs_mesh_open(priv) (priv->mesh_open)
93#define lbs_mesh_connected(priv) (priv->mesh_connect_status == LBS_CONNECTED)
94
Holger Schurig4143a232009-12-02 15:26:02 +010095#else
96
97#define lbs_init_mesh(priv)
98#define lbs_deinit_mesh(priv)
99#define lbs_add_mesh(priv)
100#define lbs_remove_mesh(priv)
101#define lbs_mesh_set_dev(priv, dev, rxpd) (dev)
102#define lbs_mesh_set_txpd(priv, dev, txpd)
103#define lbs_mesh_config(priv, enable, chan)
104#define lbs_mesh_open(priv) (0)
105#define lbs_mesh_connected(priv) (0)
106
107#endif
108
109
Holger Schurig602114a2009-12-02 15:26:01 +0100110
Holger Schurig5e8e8b52009-11-25 13:09:32 +0100111#endif