Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Contains all definitions needed for the Libertas' MESH implementation. |
| 3 | */ |
Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 4 | #ifndef _LBS_MESH_H_ |
| 5 | #define _LBS_MESH_H_ |
| 6 | |
| 7 | |
| 8 | #include <net/iw_handler.h> |
Holger Schurig | ece1e3c | 2009-11-25 13:11:16 +0100 | [diff] [blame] | 9 | #include <net/lib80211.h> |
Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 10 | |
Dan Williams | a6bb1bc | 2010-07-27 13:03:46 -0700 | [diff] [blame] | 11 | #include "host.h" |
Daniel Drake | 49fee69 | 2011-07-21 20:43:17 +0100 | [diff] [blame] | 12 | #include "dev.h" |
Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 13 | |
Holger Schurig | 4143a23 | 2009-12-02 15:26:02 +0100 | [diff] [blame] | 14 | #ifdef CONFIG_LIBERTAS_MESH |
| 15 | |
Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 16 | struct net_device; |
Holger Schurig | e0e42da | 2009-11-25 13:10:15 +0100 | [diff] [blame] | 17 | |
| 18 | int lbs_init_mesh(struct lbs_private *priv); |
Daniel Drake | 49fee69 | 2011-07-21 20:43:17 +0100 | [diff] [blame] | 19 | void lbs_start_mesh(struct lbs_private *priv); |
Holger Schurig | e0e42da | 2009-11-25 13:10:15 +0100 | [diff] [blame] | 20 | int lbs_deinit_mesh(struct lbs_private *priv); |
| 21 | |
Holger Schurig | e0e42da | 2009-11-25 13:10:15 +0100 | [diff] [blame] | 22 | void lbs_remove_mesh(struct lbs_private *priv); |
| 23 | |
Daniel Drake | 49fee69 | 2011-07-21 20:43:17 +0100 | [diff] [blame] | 24 | static 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 | |
| 30 | int lbs_mesh_set_channel(struct lbs_private *priv, u8 channel); |
Holger Schurig | e0e42da | 2009-11-25 13:10:15 +0100 | [diff] [blame] | 31 | |
| 32 | /* Sending / Receiving */ |
| 33 | |
| 34 | struct rxpd; |
| 35 | struct txpd; |
| 36 | |
| 37 | struct net_device *lbs_mesh_set_dev(struct lbs_private *priv, |
| 38 | struct net_device *dev, struct rxpd *rxpd); |
| 39 | void lbs_mesh_set_txpd(struct lbs_private *priv, |
| 40 | struct net_device *dev, struct txpd *txpd); |
| 41 | |
| 42 | |
Holger Schurig | ece1e3c | 2009-11-25 13:11:16 +0100 | [diff] [blame] | 43 | /* Command handling */ |
| 44 | |
| 45 | struct cmd_ds_command; |
Holger Schurig | 55e1ff9 | 2009-12-02 15:25:58 +0100 | [diff] [blame] | 46 | struct cmd_ds_mesh_access; |
| 47 | struct cmd_ds_mesh_config; |
Holger Schurig | ece1e3c | 2009-11-25 13:11:16 +0100 | [diff] [blame] | 48 | |
Holger Schurig | e0e42da | 2009-11-25 13:10:15 +0100 | [diff] [blame] | 49 | |
Holger Schurig | c7fe64c | 2009-11-25 13:10:49 +0100 | [diff] [blame] | 50 | /* Ethtool statistics */ |
| 51 | |
| 52 | struct ethtool_stats; |
| 53 | |
| 54 | void lbs_mesh_ethtool_get_stats(struct net_device *dev, |
| 55 | struct ethtool_stats *stats, uint64_t *data); |
| 56 | int lbs_mesh_ethtool_get_sset_count(struct net_device *dev, int sset); |
| 57 | void lbs_mesh_ethtool_get_strings(struct net_device *dev, |
| 58 | uint32_t stringset, uint8_t *s); |
| 59 | |
| 60 | |
Holger Schurig | 4143a23 | 2009-12-02 15:26:02 +0100 | [diff] [blame] | 61 | #else |
| 62 | |
| 63 | #define lbs_init_mesh(priv) |
| 64 | #define lbs_deinit_mesh(priv) |
Daniel Drake | 49fee69 | 2011-07-21 20:43:17 +0100 | [diff] [blame] | 65 | #define lbs_start_mesh(priv) |
Holger Schurig | 4143a23 | 2009-12-02 15:26:02 +0100 | [diff] [blame] | 66 | #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 Drake | 49fee69 | 2011-07-21 20:43:17 +0100 | [diff] [blame] | 70 | #define lbs_mesh_set_channel(priv, channel) (0) |
| 71 | #define lbs_mesh_activated(priv) (false) |
Holger Schurig | 4143a23 | 2009-12-02 15:26:02 +0100 | [diff] [blame] | 72 | |
| 73 | #endif |
| 74 | |
| 75 | |
Holger Schurig | 602114a | 2009-12-02 15:26:01 +0100 | [diff] [blame] | 76 | |
Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 77 | #endif |