mesh.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #include "host.h"
  9. #include "dev.h"
  10. #ifdef CONFIG_LIBERTAS_MESH
  11. struct net_device;
  12. int lbs_init_mesh(struct lbs_private *priv);
  13. void lbs_start_mesh(struct lbs_private *priv);
  14. int lbs_deinit_mesh(struct lbs_private *priv);
  15. void lbs_remove_mesh(struct lbs_private *priv);
  16. static inline bool lbs_mesh_activated(struct lbs_private *priv)
  17. {
  18. /* Mesh SSID is only programmed after successful init */
  19. return priv->mesh_ssid_len != 0;
  20. }
  21. int lbs_mesh_set_channel(struct lbs_private *priv, u8 channel);
  22. /* Sending / Receiving */
  23. struct rxpd;
  24. struct txpd;
  25. struct net_device *lbs_mesh_set_dev(struct lbs_private *priv,
  26. struct net_device *dev, struct rxpd *rxpd);
  27. void lbs_mesh_set_txpd(struct lbs_private *priv,
  28. struct net_device *dev, struct txpd *txpd);
  29. /* Command handling */
  30. struct cmd_ds_command;
  31. struct cmd_ds_mesh_access;
  32. struct cmd_ds_mesh_config;
  33. /* Ethtool statistics */
  34. struct ethtool_stats;
  35. void lbs_mesh_ethtool_get_stats(struct net_device *dev,
  36. struct ethtool_stats *stats, uint64_t *data);
  37. int lbs_mesh_ethtool_get_sset_count(struct net_device *dev, int sset);
  38. void lbs_mesh_ethtool_get_strings(struct net_device *dev,
  39. uint32_t stringset, uint8_t *s);
  40. #else
  41. #define lbs_init_mesh(priv)
  42. #define lbs_deinit_mesh(priv)
  43. #define lbs_start_mesh(priv)
  44. #define lbs_add_mesh(priv)
  45. #define lbs_remove_mesh(priv)
  46. #define lbs_mesh_set_dev(priv, dev, rxpd) (dev)
  47. #define lbs_mesh_set_txpd(priv, dev, txpd)
  48. #define lbs_mesh_set_channel(priv, channel) (0)
  49. #define lbs_mesh_activated(priv) (false)
  50. #endif
  51. #endif