| Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 1 | /** | 
 | 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 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 |  | 
 | 11 |  | 
| Holger Schurig | 4143a23 | 2009-12-02 15:26:02 +0100 | [diff] [blame] | 12 | #ifdef CONFIG_LIBERTAS_MESH | 
 | 13 |  | 
| Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 14 | /* Mesh statistics */ | 
 | 15 | struct lbs_mesh_stats { | 
 | 16 | 	u32	fwd_bcast_cnt;		/* Fwd: Broadcast counter */ | 
 | 17 | 	u32	fwd_unicast_cnt;	/* Fwd: Unicast counter */ | 
 | 18 | 	u32	fwd_drop_ttl;		/* Fwd: TTL zero */ | 
 | 19 | 	u32	fwd_drop_rbt;		/* Fwd: Recently Broadcasted */ | 
 | 20 | 	u32	fwd_drop_noroute; 	/* Fwd: No route to Destination */ | 
 | 21 | 	u32	fwd_drop_nobuf;		/* Fwd: Run out of internal buffers */ | 
 | 22 | 	u32	drop_blind;		/* Rx:  Dropped by blinding table */ | 
 | 23 | 	u32	tx_failed_cnt;		/* Tx:  Failed transmissions */ | 
 | 24 | }; | 
 | 25 |  | 
 | 26 |  | 
 | 27 | struct net_device; | 
| Holger Schurig | e0e42da | 2009-11-25 13:10:15 +0100 | [diff] [blame] | 28 | struct lbs_private; | 
 | 29 |  | 
 | 30 | int lbs_init_mesh(struct lbs_private *priv); | 
 | 31 | int lbs_deinit_mesh(struct lbs_private *priv); | 
 | 32 |  | 
 | 33 | int lbs_add_mesh(struct lbs_private *priv); | 
 | 34 | void lbs_remove_mesh(struct lbs_private *priv); | 
 | 35 |  | 
 | 36 |  | 
 | 37 | /* Sending / Receiving */ | 
 | 38 |  | 
 | 39 | struct rxpd; | 
 | 40 | struct txpd; | 
 | 41 |  | 
 | 42 | struct net_device *lbs_mesh_set_dev(struct lbs_private *priv, | 
 | 43 | 	struct net_device *dev, struct rxpd *rxpd); | 
 | 44 | void lbs_mesh_set_txpd(struct lbs_private *priv, | 
 | 45 | 	struct net_device *dev, struct txpd *txpd); | 
 | 46 |  | 
 | 47 |  | 
| Holger Schurig | ece1e3c | 2009-11-25 13:11:16 +0100 | [diff] [blame] | 48 | /* Command handling */ | 
 | 49 |  | 
 | 50 | struct cmd_ds_command; | 
| Holger Schurig | 55e1ff9 | 2009-12-02 15:25:58 +0100 | [diff] [blame] | 51 | struct cmd_ds_mesh_access; | 
 | 52 | struct cmd_ds_mesh_config; | 
| Holger Schurig | ece1e3c | 2009-11-25 13:11:16 +0100 | [diff] [blame] | 53 |  | 
 | 54 | int lbs_cmd_bt_access(struct cmd_ds_command *cmd, | 
 | 55 | 	u16 cmd_action, void *pdata_buf); | 
 | 56 | int lbs_cmd_fwt_access(struct cmd_ds_command *cmd, | 
 | 57 | 	u16 cmd_action, void *pdata_buf); | 
| Holger Schurig | 55e1ff9 | 2009-12-02 15:25:58 +0100 | [diff] [blame] | 58 | int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action, | 
 | 59 | 		    struct cmd_ds_mesh_access *cmd); | 
 | 60 | int lbs_mesh_config_send(struct lbs_private *priv, | 
 | 61 | 			 struct cmd_ds_mesh_config *cmd, | 
 | 62 | 			 uint16_t action, uint16_t type); | 
 | 63 | int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan); | 
 | 64 |  | 
| Holger Schurig | ece1e3c | 2009-11-25 13:11:16 +0100 | [diff] [blame] | 65 |  | 
 | 66 |  | 
| Holger Schurig | e0e42da | 2009-11-25 13:10:15 +0100 | [diff] [blame] | 67 | /* Persistent configuration */ | 
| Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 68 |  | 
 | 69 | void lbs_persist_config_init(struct net_device *net); | 
 | 70 | void lbs_persist_config_remove(struct net_device *net); | 
 | 71 |  | 
| Holger Schurig | e0e42da | 2009-11-25 13:10:15 +0100 | [diff] [blame] | 72 |  | 
 | 73 | /* WEXT handler */ | 
 | 74 |  | 
| Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 75 | extern struct iw_handler_def mesh_handler_def; | 
 | 76 |  | 
 | 77 |  | 
| Holger Schurig | c7fe64c | 2009-11-25 13:10:49 +0100 | [diff] [blame] | 78 | /* Ethtool statistics */ | 
 | 79 |  | 
 | 80 | struct ethtool_stats; | 
 | 81 |  | 
 | 82 | void lbs_mesh_ethtool_get_stats(struct net_device *dev, | 
 | 83 | 	struct ethtool_stats *stats, uint64_t *data); | 
 | 84 | int lbs_mesh_ethtool_get_sset_count(struct net_device *dev, int sset); | 
 | 85 | void lbs_mesh_ethtool_get_strings(struct net_device *dev, | 
 | 86 | 	uint32_t stringset, uint8_t *s); | 
 | 87 |  | 
 | 88 |  | 
| Holger Schurig | 602114a | 2009-12-02 15:26:01 +0100 | [diff] [blame] | 89 | /* Accessors */ | 
 | 90 |  | 
 | 91 | #define lbs_mesh_open(priv) (priv->mesh_open) | 
 | 92 | #define lbs_mesh_connected(priv) (priv->mesh_connect_status == LBS_CONNECTED) | 
 | 93 |  | 
| Holger Schurig | 4143a23 | 2009-12-02 15:26:02 +0100 | [diff] [blame] | 94 | #else | 
 | 95 |  | 
 | 96 | #define lbs_init_mesh(priv) | 
 | 97 | #define lbs_deinit_mesh(priv) | 
 | 98 | #define lbs_add_mesh(priv) | 
 | 99 | #define lbs_remove_mesh(priv) | 
 | 100 | #define lbs_mesh_set_dev(priv, dev, rxpd) (dev) | 
 | 101 | #define lbs_mesh_set_txpd(priv, dev, txpd) | 
 | 102 | #define lbs_mesh_config(priv, enable, chan) | 
 | 103 | #define lbs_mesh_open(priv) (0) | 
 | 104 | #define lbs_mesh_connected(priv) (0) | 
 | 105 |  | 
 | 106 | #endif | 
 | 107 |  | 
 | 108 |  | 
| Holger Schurig | 602114a | 2009-12-02 15:26:01 +0100 | [diff] [blame] | 109 |  | 
| Holger Schurig | 5e8e8b5 | 2009-11-25 13:09:32 +0100 | [diff] [blame] | 110 | #endif |