bcm43xx_radio.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_RADIO_H_
  24. #define BCM43xx_RADIO_H_
  25. #include "bcm43xx.h"
  26. #define BCM43xx_RADIO_DEFAULT_CHANNEL_A 36
  27. #define BCM43xx_RADIO_DEFAULT_CHANNEL_BG 6
  28. /* Force antenna 0. */
  29. #define BCM43xx_RADIO_TXANTENNA_0 0
  30. /* Force antenna 1. */
  31. #define BCM43xx_RADIO_TXANTENNA_1 1
  32. /* Use the RX antenna, that was selected for the most recently
  33. * received good PLCP header.
  34. */
  35. #define BCM43xx_RADIO_TXANTENNA_LASTPLCP 3
  36. #define BCM43xx_RADIO_TXANTENNA_DEFAULT BCM43xx_RADIO_TXANTENNA_LASTPLCP
  37. #define BCM43xx_RADIO_INTERFMODE_NONE 0
  38. #define BCM43xx_RADIO_INTERFMODE_NONWLAN 1
  39. #define BCM43xx_RADIO_INTERFMODE_MANUALWLAN 2
  40. #define BCM43xx_RADIO_INTERFMODE_AUTOWLAN 3
  41. void bcm43xx_radio_lock(struct bcm43xx_private *bcm);
  42. void bcm43xx_radio_unlock(struct bcm43xx_private *bcm);
  43. u16 bcm43xx_radio_read16(struct bcm43xx_private *bcm, u16 offset);
  44. void bcm43xx_radio_write16(struct bcm43xx_private *bcm, u16 offset, u16 val);
  45. u16 bcm43xx_radio_init2050(struct bcm43xx_private *bcm);
  46. void bcm43xx_radio_init2060(struct bcm43xx_private *bcm);
  47. void bcm43xx_radio_turn_on(struct bcm43xx_private *bcm);
  48. void bcm43xx_radio_turn_off(struct bcm43xx_private *bcm);
  49. int bcm43xx_radio_selectchannel(struct bcm43xx_private *bcm, u8 channel,
  50. int synthetic_pu_workaround);
  51. void bcm43xx_radio_set_txpower_a(struct bcm43xx_private *bcm, u16 txpower);
  52. void bcm43xx_radio_set_txpower_bg(struct bcm43xx_private *bcm,
  53. u16 baseband_attenuation, u16 attenuation,
  54. u16 txpower);
  55. u16 bcm43xx_default_baseband_attenuation(struct bcm43xx_private *bcm);
  56. u16 bcm43xx_default_radio_attenuation(struct bcm43xx_private *bcm);
  57. u16 bcm43xx_default_txctl1(struct bcm43xx_private *bcm);
  58. void bcm43xx_radio_set_txantenna(struct bcm43xx_private *bcm, u32 val);
  59. void bcm43xx_radio_clear_tssi(struct bcm43xx_private *bcm);
  60. u8 bcm43xx_radio_aci_detect(struct bcm43xx_private *bcm, u8 channel);
  61. u8 bcm43xx_radio_aci_scan(struct bcm43xx_private *bcm);
  62. int bcm43xx_radio_set_interference_mitigation(struct bcm43xx_private *bcm, int mode);
  63. void bcm43xx_calc_nrssi_slope(struct bcm43xx_private *bcm);
  64. void bcm43xx_calc_nrssi_threshold(struct bcm43xx_private *bcm);
  65. s16 bcm43xx_nrssi_hw_read(struct bcm43xx_private *bcm, u16 offset);
  66. void bcm43xx_nrssi_hw_write(struct bcm43xx_private *bcm, u16 offset, s16 val);
  67. void bcm43xx_nrssi_hw_update(struct bcm43xx_private *bcm, u16 val);
  68. void bcm43xx_nrssi_mem_update(struct bcm43xx_private *bcm);
  69. void bcm43xx_radio_set_tx_iq(struct bcm43xx_private *bcm);
  70. u16 bcm43xx_radio_calibrationvalue(struct bcm43xx_private *bcm);
  71. #endif /* BCM43xx_RADIO_H_ */