baseband.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. *
  16. * File: baseband.h
  17. *
  18. * Purpose: Implement functions to access baseband
  19. *
  20. * Author: Jerry Chen
  21. *
  22. * Date: Jun. 5, 2002
  23. *
  24. * Revision History:
  25. * 06-10-2003 Bryan YC Fan: Re-write codes to support VT3253 spec.
  26. * 08-26-2003 Kyle Hsu : Add defines of packet type and TX rate.
  27. */
  28. #ifndef __BASEBAND_H__
  29. #define __BASEBAND_H__
  30. #include "device.h"
  31. #define PREAMBLE_LONG 0
  32. #define PREAMBLE_SHORT 1
  33. /*
  34. * Registers in the BASEBAND
  35. */
  36. #define BB_MAX_CONTEXT_SIZE 256
  37. #define C_SIFS_A 16 /* usec */
  38. #define C_SIFS_BG 10
  39. #define C_EIFS 80 /* usec */
  40. #define C_SLOT_SHORT 9 /* usec */
  41. #define C_SLOT_LONG 20
  42. #define C_CWMIN_A 15 /* slot time */
  43. #define C_CWMIN_B 31
  44. #define C_CWMAX 1023 /* slot time */
  45. /* 0:11A 1:11B 2:11G */
  46. #define BB_TYPE_11A 0
  47. #define BB_TYPE_11B 1
  48. #define BB_TYPE_11G 2
  49. /* 0:11a, 1:11b, 2:11gb (only CCK in BasicRate), 3:11ga (OFDM in BasicRate) */
  50. #define PK_TYPE_11A 0
  51. #define PK_TYPE_11B 1
  52. #define PK_TYPE_11GB 2
  53. #define PK_TYPE_11GA 3
  54. #define TOP_RATE_54M 0x80000000
  55. #define TOP_RATE_48M 0x40000000
  56. #define TOP_RATE_36M 0x20000000
  57. #define TOP_RATE_24M 0x10000000
  58. #define TOP_RATE_18M 0x08000000
  59. #define TOP_RATE_12M 0x04000000
  60. #define TOP_RATE_11M 0x02000000
  61. #define TOP_RATE_9M 0x01000000
  62. #define TOP_RATE_6M 0x00800000
  63. #define TOP_RATE_55M 0x00400000
  64. #define TOP_RATE_2M 0x00200000
  65. #define TOP_RATE_1M 0x00100000
  66. /* Length, Service, and Signal fields of Phy for Tx */
  67. struct vnt_phy_field {
  68. u8 signal;
  69. u8 service;
  70. __le16 len;
  71. } __packed;
  72. unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
  73. unsigned int frame_length, u16 tx_rate);
  74. void vnt_get_phy_field(struct vnt_private *, u32 frame_length,
  75. u16 tx_rate, u8 pkt_type, struct vnt_phy_field *);
  76. void vnt_set_short_slot_time(struct vnt_private *);
  77. void vnt_set_vga_gain_offset(struct vnt_private *, u8);
  78. void vnt_set_antenna_mode(struct vnt_private *, u8);
  79. int vnt_vt3184_init(struct vnt_private *);
  80. void vnt_set_deep_sleep(struct vnt_private *);
  81. void vnt_exit_deep_sleep(struct vnt_private *);
  82. void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning);
  83. #endif /* __BASEBAND_H__ */