mesh.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /**
  2. * Contains all definitions needed for the Libertas' MESH implementation.
  3. */
  4. #ifndef _LBS_MESH_H_
  5. #define _LBS_MESH_H_
  6. #include <net/iw_handler.h>
  7. #include <net/lib80211.h>
  8. #ifdef CONFIG_LIBERTAS_MESH
  9. /* Mesh statistics */
  10. struct lbs_mesh_stats {
  11. u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */
  12. u32 fwd_unicast_cnt; /* Fwd: Unicast counter */
  13. u32 fwd_drop_ttl; /* Fwd: TTL zero */
  14. u32 fwd_drop_rbt; /* Fwd: Recently Broadcasted */
  15. u32 fwd_drop_noroute; /* Fwd: No route to Destination */
  16. u32 fwd_drop_nobuf; /* Fwd: Run out of internal buffers */
  17. u32 drop_blind; /* Rx: Dropped by blinding table */
  18. u32 tx_failed_cnt; /* Tx: Failed transmissions */
  19. };
  20. struct net_device;
  21. struct lbs_private;
  22. int lbs_init_mesh(struct lbs_private *priv);
  23. int lbs_deinit_mesh(struct lbs_private *priv);
  24. int lbs_add_mesh(struct lbs_private *priv);
  25. void lbs_remove_mesh(struct lbs_private *priv);
  26. /* Sending / Receiving */
  27. struct rxpd;
  28. struct txpd;
  29. struct net_device *lbs_mesh_set_dev(struct lbs_private *priv,
  30. struct net_device *dev, struct rxpd *rxpd);
  31. void lbs_mesh_set_txpd(struct lbs_private *priv,
  32. struct net_device *dev, struct txpd *txpd);
  33. /* Command handling */
  34. struct cmd_ds_command;
  35. struct cmd_ds_mesh_access;
  36. struct cmd_ds_mesh_config;
  37. int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
  38. u16 cmd_action, void *pdata_buf);
  39. int lbs_cmd_fwt_access(struct cmd_ds_command *cmd,
  40. u16 cmd_action, void *pdata_buf);
  41. int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
  42. struct cmd_ds_mesh_access *cmd);
  43. int lbs_mesh_config_send(struct lbs_private *priv,
  44. struct cmd_ds_mesh_config *cmd,
  45. uint16_t action, uint16_t type);
  46. int lbs_mesh_config(struct lbs_private *priv, uint16_t enable, uint16_t chan);
  47. /* Persistent configuration */
  48. void lbs_persist_config_init(struct net_device *net);
  49. void lbs_persist_config_remove(struct net_device *net);
  50. /* WEXT handler */
  51. extern struct iw_handler_def mesh_handler_def;
  52. /* Ethtool statistics */
  53. struct ethtool_stats;
  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. /* Accessors */
  60. #define lbs_mesh_open(priv) (priv->mesh_open)
  61. #define lbs_mesh_connected(priv) (priv->mesh_connect_status == LBS_CONNECTED)
  62. #else
  63. #define lbs_init_mesh(priv)
  64. #define lbs_deinit_mesh(priv)
  65. #define lbs_add_mesh(priv)
  66. #define lbs_remove_mesh(priv)
  67. #define lbs_mesh_set_dev(priv, dev, rxpd) (dev)
  68. #define lbs_mesh_set_txpd(priv, dev, txpd)
  69. #define lbs_mesh_config(priv, enable, chan)
  70. #define lbs_mesh_open(priv) (0)
  71. #define lbs_mesh_connected(priv) (0)
  72. #endif
  73. #endif