bcm43xx_phy.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. u16 bcm43xx_phy_read(struct bcm43xx_private *bcm, u16 offset);
  40. void bcm43xx_phy_write(struct bcm43xx_private *bcm, u16 offset, u16 val);
  41. int bcm43xx_phy_init_tssi2dbm_table(struct bcm43xx_private *bcm);
  42. int bcm43xx_phy_init(struct bcm43xx_private *bcm);
  43. void bcm43xx_phy_set_antenna_diversity(struct bcm43xx_private *bcm);
  44. void bcm43xx_phy_calibrate(struct bcm43xx_private *bcm);
  45. int bcm43xx_phy_connect(struct bcm43xx_private *bcm, int connect);
  46. void bcm43xx_phy_lo_b_measure(struct bcm43xx_private *bcm);
  47. void bcm43xx_phy_lo_g_measure(struct bcm43xx_private *bcm);
  48. void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm);
  49. /* Adjust the LocalOscillator to the saved values.
  50. * "fixed" is only set to 1 once in initialization. Set to 0 otherwise.
  51. */
  52. void bcm43xx_phy_lo_adjust(struct bcm43xx_private *bcm, int fixed);
  53. void bcm43xx_phy_lo_mark_all_unused(struct bcm43xx_private *bcm);
  54. void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm,
  55. u16 baseband_attenuation);
  56. #endif /* BCM43xx_PHY_H_ */