bcm43xx_phy.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. Broadcom BCM43xx wireless driver
  3. Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>,
  4. Stefano Brivio <st3@riseup.net>
  5. Michael Buesch <mbuesch@freenet.de>
  6. Danny van Dyk <kugelfang@gentoo.org>
  7. Andreas Jaggi <andreas.jaggi@waterwave.ch>
  8. Some parts of the code in this file are derived from the ipw2200
  9. driver Copyright(c) 2003 - 2004 Intel Corporation.
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2 of the License, or
  13. (at your option) any later version.
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. GNU General Public License for more details.
  18. You should have received a copy of the GNU General Public License
  19. along with this program; see the file COPYING. If not, write to
  20. the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
  21. Boston, MA 02110-1301, USA.
  22. */
  23. #ifndef BCM43xx_PHY_H_
  24. #define BCM43xx_PHY_H_
  25. #include <linux/types.h>
  26. struct bcm43xx_private;
  27. void bcm43xx_raw_phy_lock(struct bcm43xx_private *bcm);
  28. #define bcm43xx_phy_lock(bcm, flags) \
  29. do { \
  30. local_irq_save(flags); \
  31. bcm43xx_raw_phy_lock(bcm); \
  32. } while (0)
  33. void bcm43xx_raw_phy_unlock(struct bcm43xx_private *bcm);
  34. #define bcm43xx_phy_unlock(bcm, flags) \
  35. do { \
  36. bcm43xx_raw_phy_unlock(bcm); \
  37. local_irq_restore(flags); \
  38. } while (0)
  39. /* Card uses the loopback gain stuff */
  40. #define has_loopback_gain(phy) \
  41. (((phy)->rev > 1) || ((phy)->connected))
  42. u16 bcm43xx_phy_read(struct bcm43xx_private *bcm, u16 offset);
  43. void bcm43xx_phy_write(struct bcm43xx_private *bcm, u16 offset, u16 val);
  44. int bcm43xx_phy_init_tssi2dbm_table(struct bcm43xx_private *bcm);
  45. int bcm43xx_phy_init(struct bcm43xx_private *bcm);
  46. void bcm43xx_phy_set_antenna_diversity(struct bcm43xx_private *bcm);
  47. void bcm43xx_phy_calibrate(struct bcm43xx_private *bcm);
  48. int bcm43xx_phy_connect(struct bcm43xx_private *bcm, int connect);
  49. void bcm43xx_phy_lo_b_measure(struct bcm43xx_private *bcm);
  50. void bcm43xx_phy_lo_g_measure(struct bcm43xx_private *bcm);
  51. void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm);
  52. /* Adjust the LocalOscillator to the saved values.
  53. * "fixed" is only set to 1 once in initialization. Set to 0 otherwise.
  54. */
  55. void bcm43xx_phy_lo_adjust(struct bcm43xx_private *bcm, int fixed);
  56. void bcm43xx_phy_lo_mark_all_unused(struct bcm43xx_private *bcm);
  57. void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm,
  58. u16 baseband_attenuation);
  59. #endif /* BCM43xx_PHY_H_ */