mesh.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Contains all definitions needed for the Libertas' MESH implementation.
  4. */
  5. #ifndef _LBS_MESH_H_
  6. #define _LBS_MESH_H_
  7. #include <net/iw_handler.h>
  8. #include <net/lib80211.h>
  9. #include "host.h"
  10. #include "dev.h"
  11. #ifdef CONFIG_LIBERTAS_MESH
  12. struct net_device;
  13. int lbs_init_mesh(struct lbs_private *priv);
  14. void lbs_start_mesh(struct lbs_private *priv);
  15. int lbs_deinit_mesh(struct lbs_private *priv);
  16. void lbs_remove_mesh(struct lbs_private *priv);
  17. static inline bool lbs_mesh_activated(struct lbs_private *priv)
  18. {
  19. /* Mesh SSID is only programmed after successful init */
  20. return priv->mesh_ssid_len != 0;
  21. }
  22. int lbs_mesh_set_channel(struct lbs_private *priv, u8 channel);
  23. /* Sending / Receiving */
  24. struct rxpd;
  25. struct txpd;
  26. struct net_device *lbs_mesh_set_dev(struct lbs_private *priv,
  27. struct net_device *dev, struct rxpd *rxpd);
  28. void lbs_mesh_set_txpd(struct lbs_private *priv,
  29. struct net_device *dev, struct txpd *txpd);
  30. /* Command handling */
  31. struct cmd_ds_command;
  32. struct cmd_ds_mesh_access;
  33. struct cmd_ds_mesh_config;
  34. /* Ethtool statistics */
  35. struct ethtool_stats;
  36. void lbs_mesh_ethtool_get_stats(struct net_device *dev,
  37. struct ethtool_stats *stats, uint64_t *data);
  38. int lbs_mesh_ethtool_get_sset_count(struct net_device *dev, int sset);
  39. void lbs_mesh_ethtool_get_strings(struct net_device *dev,
  40. uint32_t stringset, uint8_t *s);
  41. #else
  42. #define lbs_init_mesh(priv)
  43. #define lbs_deinit_mesh(priv)
  44. #define lbs_start_mesh(priv)
  45. #define lbs_add_mesh(priv)
  46. #define lbs_remove_mesh(priv)
  47. #define lbs_mesh_set_dev(priv, dev, rxpd) (dev)
  48. #define lbs_mesh_set_txpd(priv, dev, txpd)
  49. #define lbs_mesh_set_channel(priv, channel) (0)
  50. #define lbs_mesh_activated(priv) (false)
  51. #endif
  52. #endif