common.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Copyright (c) 2014 Broadcom Corporation
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. #ifndef BRCMFMAC_COMMON_H
  16. #define BRCMFMAC_COMMON_H
  17. #include <linux/platform_device.h>
  18. #include <linux/platform_data/brcmfmac.h>
  19. #include "fwil_types.h"
  20. extern const u8 ALLFFMAC[ETH_ALEN];
  21. #define BRCMF_FW_ALTPATH_LEN 256
  22. /* Definitions for the module global and device specific settings are defined
  23. * here. Two structs are used for them. brcmf_mp_global_t and brcmf_mp_device.
  24. * The mp_global is instantiated once in a global struct and gets initialized
  25. * by the common_attach function which should be called before any other
  26. * (module) initiliazation takes place. The device specific settings is part
  27. * of the drvr struct and should be initialized on every brcmf_attach.
  28. */
  29. /**
  30. * struct brcmf_mp_global_t - Global module paramaters.
  31. *
  32. * @firmware_path: Alternative firmware path.
  33. */
  34. struct brcmf_mp_global_t {
  35. char firmware_path[BRCMF_FW_ALTPATH_LEN];
  36. };
  37. extern struct brcmf_mp_global_t brcmf_mp_global;
  38. /**
  39. * struct brcmf_mp_device - Device module paramaters.
  40. *
  41. * @p2p_enable: Legacy P2P0 enable (old wpa_supplicant).
  42. * @feature_disable: Feature_disable bitmask.
  43. * @fcmode: FWS flow control.
  44. * @roamoff: Firmware roaming off?
  45. * @ignore_probe_fail: Ignore probe failure.
  46. * @country_codes: If available, pointer to struct for translating country codes
  47. * @bus: Bus specific platform data. Only SDIO at the mmoment.
  48. */
  49. struct brcmf_mp_device {
  50. bool p2p_enable;
  51. unsigned int feature_disable;
  52. int fcmode;
  53. bool roamoff;
  54. bool ignore_probe_fail;
  55. struct brcmfmac_pd_cc *country_codes;
  56. union {
  57. struct brcmfmac_sdio_pd sdio;
  58. } bus;
  59. };
  60. void brcmf_c_set_joinpref_default(struct brcmf_if *ifp);
  61. struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
  62. enum brcmf_bus_type bus_type,
  63. u32 chip, u32 chiprev);
  64. void brcmf_release_module_param(struct brcmf_mp_device *module_param);
  65. /* Sets dongle media info (drv_version, mac address). */
  66. int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
  67. #endif /* BRCMFMAC_COMMON_H */