blob: 6603f341c8746f0b6ed66078ac4d8d02b2ce4f53 [file] [log] [blame]
Randy Dunlap8973a6e2011-04-26 15:25:29 -07001/*
2 * Contains all definitions needed for the Libertas' MESH implementation.
3 */
Holger Schurig5e8e8b52009-11-25 13:09:32 +01004#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"
Daniel Drake49fee692011-07-21 20:43:17 +010012#include "dev.h"
Holger Schurig5e8e8b52009-11-25 13:09:32 +010013
Holger Schurig4143a232009-12-02 15:26:02 +010014#ifdef CONFIG_LIBERTAS_MESH
15
Holger Schurig5e8e8b52009-11-25 13:09:32 +010016struct net_device;
Holger Schurige0e42da2009-11-25 13:10:15 +010017
18int lbs_init_mesh(struct lbs_private *priv);
Daniel Drake49fee692011-07-21 20:43:17 +010019void lbs_start_mesh(struct lbs_private *priv);
Holger Schurige0e42da2009-11-25 13:10:15 +010020int lbs_deinit_mesh(struct lbs_private *priv);
21
Holger Schurige0e42da2009-11-25 13:10:15 +010022void lbs_remove_mesh(struct lbs_private *priv);
23
Daniel Drake49fee692011-07-21 20:43:17 +010024static inline bool lbs_mesh_activated(struct lbs_private *priv)
25{
26 /* Mesh SSID is only programmed after successful init */
27 return priv->mesh_ssid_len != 0;
28}
29
30int lbs_mesh_set_channel(struct lbs_private *priv, u8 channel);
Holger Schurige0e42da2009-11-25 13:10:15 +010031
32/* Sending / Receiving */
33
34struct rxpd;
35struct txpd;
36
37struct net_device *lbs_mesh_set_dev(struct lbs_private *priv,
38 struct net_device *dev, struct rxpd *rxpd);
39void lbs_mesh_set_txpd(struct lbs_private *priv,
40 struct net_device *dev, struct txpd *txpd);
41
42
Holger Schurigece1e3c2009-11-25 13:11:16 +010043/* Command handling */
44
45struct cmd_ds_command;
Holger Schurig55e1ff92009-12-02 15:25:58 +010046struct cmd_ds_mesh_access;
47struct cmd_ds_mesh_config;
Holger Schurigece1e3c2009-11-25 13:11:16 +010048
Holger Schurige0e42da2009-11-25 13:10:15 +010049
Holger Schurigc7fe64c2009-11-25 13:10:49 +010050/* Ethtool statistics */
51
52struct ethtool_stats;
53
54void lbs_mesh_ethtool_get_stats(struct net_device *dev,
55 struct ethtool_stats *stats, uint64_t *data);
56int lbs_mesh_ethtool_get_sset_count(struct net_device *dev, int sset);
57void lbs_mesh_ethtool_get_strings(struct net_device *dev,
58 uint32_t stringset, uint8_t *s);
59
60
Holger Schurig4143a232009-12-02 15:26:02 +010061#else
62
63#define lbs_init_mesh(priv)
64#define lbs_deinit_mesh(priv)
Daniel Drake49fee692011-07-21 20:43:17 +010065#define lbs_start_mesh(priv)
Holger Schurig4143a232009-12-02 15:26:02 +010066#define lbs_add_mesh(priv)
67#define lbs_remove_mesh(priv)
68#define lbs_mesh_set_dev(priv, dev, rxpd) (dev)
69#define lbs_mesh_set_txpd(priv, dev, txpd)
Daniel Drake49fee692011-07-21 20:43:17 +010070#define lbs_mesh_set_channel(priv, channel) (0)
71#define lbs_mesh_activated(priv) (false)
Holger Schurig4143a232009-12-02 15:26:02 +010072
73#endif
74
75
Holger Schurig602114a2009-12-02 15:26:01 +010076
Holger Schurig5e8e8b52009-11-25 13:09:32 +010077#endif