lo.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef B43_LO_H_
  2. #define B43_LO_H_
  3. /* G-PHY Local Oscillator */
  4. #include "phy_g.h"
  5. struct b43_wldev;
  6. /* Local Oscillator control value-pair. */
  7. struct b43_loctl {
  8. /* Control values. */
  9. s8 i;
  10. s8 q;
  11. };
  12. /* Debugging: Poison value for i and q values. */
  13. #define B43_LOCTL_POISON 111
  14. /* This struct holds calibrated LO settings for a set of
  15. * Baseband and RF attenuation settings. */
  16. struct b43_lo_calib {
  17. /* The set of attenuation values this set of LO
  18. * control values is calibrated for. */
  19. struct b43_bbatt bbatt;
  20. struct b43_rfatt rfatt;
  21. /* The set of control values for the LO. */
  22. struct b43_loctl ctl;
  23. /* The time when these settings were calibrated (in jiffies) */
  24. unsigned long calib_time;
  25. /* List. */
  26. struct list_head list;
  27. };
  28. /* Size of the DC Lookup Table in 16bit words. */
  29. #define B43_DC_LT_SIZE 32
  30. /* Local Oscillator calibration information */
  31. struct b43_txpower_lo_control {
  32. /* Lists of RF and BB attenuation values for this device.
  33. * Used for building hardware power control tables. */
  34. struct b43_rfatt_list rfatt_list;
  35. struct b43_bbatt_list bbatt_list;
  36. /* The DC Lookup Table is cached in memory here.
  37. * Note that this is only used for Hardware Power Control. */
  38. u16 dc_lt[B43_DC_LT_SIZE];
  39. /* List of calibrated control values (struct b43_lo_calib). */
  40. struct list_head calib_list;
  41. /* Last time the power vector was read (jiffies). */
  42. unsigned long pwr_vec_read_time;
  43. /* Last time the txctl values were measured (jiffies). */
  44. unsigned long txctl_measured_time;
  45. /* Current TX Bias value */
  46. u8 tx_bias;
  47. /* Current TX Magnification Value (if used by the device) */
  48. u8 tx_magn;
  49. /* Saved device PowerVector */
  50. u64 power_vector;
  51. };
  52. /* Calibration expire timeouts.
  53. * Timeouts must be multiple of 15 seconds. To make sure
  54. * the item really expired when the 15 second timer hits, we
  55. * subtract two additional seconds from the timeout. */
  56. #define B43_LO_CALIB_EXPIRE (HZ * (30 - 2))
  57. #define B43_LO_PWRVEC_EXPIRE (HZ * (30 - 2))
  58. #define B43_LO_TXCTL_EXPIRE (HZ * (180 - 4))
  59. /* Adjust the Local Oscillator to the saved attenuation
  60. * and txctl values.
  61. */
  62. void b43_lo_g_adjust(struct b43_wldev *dev);
  63. /* Adjust to specific values. */
  64. void b43_lo_g_adjust_to(struct b43_wldev *dev,
  65. u16 rfatt, u16 bbatt, u16 tx_control);
  66. void b43_gphy_dc_lt_init(struct b43_wldev *dev, bool update_all);
  67. void b43_lo_g_maintenance_work(struct b43_wldev *dev);
  68. void b43_lo_g_cleanup(struct b43_wldev *dev);
  69. void b43_lo_g_init(struct b43_wldev *dev);
  70. #endif /* B43_LO_H_ */