mesh.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. void 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. return !!priv->mesh_tlv;
  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) do { } while (0)
  42. #define lbs_deinit_mesh(priv) do { } while (0)
  43. #define lbs_start_mesh(priv) do { } while (0)
  44. #define lbs_add_mesh(priv) do { } while (0)
  45. #define lbs_remove_mesh(priv) do { } while (0)
  46. #define lbs_mesh_set_dev(priv, dev, rxpd) (dev)
  47. #define lbs_mesh_set_txpd(priv, dev, txpd) do { } while (0)
  48. #define lbs_mesh_set_channel(priv, channel) (0)
  49. #define lbs_mesh_activated(priv) (false)
  50. #endif
  51. #endif