blob: 388c39281b7d017cf4e595a1b218b2507fc8a122 [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
11
12/* Mesh statistics */
13struct lbs_mesh_stats {
14 u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */
15 u32 fwd_unicast_cnt; /* Fwd: Unicast counter */
16 u32 fwd_drop_ttl; /* Fwd: TTL zero */
17 u32 fwd_drop_rbt; /* Fwd: Recently Broadcasted */
18 u32 fwd_drop_noroute; /* Fwd: No route to Destination */
19 u32 fwd_drop_nobuf; /* Fwd: Run out of internal buffers */
20 u32 drop_blind; /* Rx: Dropped by blinding table */
21 u32 tx_failed_cnt; /* Tx: Failed transmissions */
22};
23
24
25struct net_device;
Holger Schurige0e42da2009-11-25 13:10:15 +010026struct lbs_private;
27
28int lbs_init_mesh(struct lbs_private *priv);
29int lbs_deinit_mesh(struct lbs_private *priv);
30
31int lbs_add_mesh(struct lbs_private *priv);
32void lbs_remove_mesh(struct lbs_private *priv);
33
34
35/* Sending / Receiving */
36
37struct rxpd;
38struct txpd;
39
40struct net_device *lbs_mesh_set_dev(struct lbs_private *priv,
41 struct net_device *dev, struct rxpd *rxpd);
42void lbs_mesh_set_txpd(struct lbs_private *priv,
43 struct net_device *dev, struct txpd *txpd);
44
45
Holger Schurigece1e3c2009-11-25 13:11:16 +010046/* Command handling */
47
48struct cmd_ds_command;
Holger Schurig55e1ff92009-12-02 15:25:58 +010049struct cmd_ds_mesh_access;
50struct cmd_ds_mesh_config;
Holger Schurigece1e3c2009-11-25 13:11:16 +010051
52int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
53 u16 cmd_action, void *pdata_buf);
54int lbs_cmd_fwt_access(struct cmd_ds_command *cmd,
55 u16 cmd_action, void *pdata_buf);
Holger Schurig55e1ff92009-12-02 15:25:58 +010056int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
57 struct cmd_ds_mesh_access *cmd);
58int lbs_mesh_config_send(struct lbs_private *priv,
59 struct cmd_ds_mesh_config *cmd,
60 uint16_t action, uint16_t type);
61int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan);
62
Holger Schurigece1e3c2009-11-25 13:11:16 +010063
64
Holger Schurige0e42da2009-11-25 13:10:15 +010065/* Persistent configuration */
Holger Schurig5e8e8b52009-11-25 13:09:32 +010066
67void lbs_persist_config_init(struct net_device *net);
68void lbs_persist_config_remove(struct net_device *net);
69
Holger Schurige0e42da2009-11-25 13:10:15 +010070
71/* WEXT handler */
72
Holger Schurig5e8e8b52009-11-25 13:09:32 +010073extern struct iw_handler_def mesh_handler_def;
74
75
Holger Schurigc7fe64c2009-11-25 13:10:49 +010076/* Ethtool statistics */
77
78struct ethtool_stats;
79
80void lbs_mesh_ethtool_get_stats(struct net_device *dev,
81 struct ethtool_stats *stats, uint64_t *data);
82int lbs_mesh_ethtool_get_sset_count(struct net_device *dev, int sset);
83void lbs_mesh_ethtool_get_strings(struct net_device *dev,
84 uint32_t stringset, uint8_t *s);
85
86
Holger Schurig602114a2009-12-02 15:26:01 +010087/* Accessors */
88
89#define lbs_mesh_open(priv) (priv->mesh_open)
90#define lbs_mesh_connected(priv) (priv->mesh_connect_status == LBS_CONNECTED)
91
92
Holger Schurig5e8e8b52009-11-25 13:09:32 +010093#endif