1 /* ZD1211 USB-WLAN driver for Linux
3 * Copyright (C) 2005-2007 Ulrich Kunitz <kune@deine-taler.de>
4 * Copyright (C) 2006-2007 Daniel Drake <dsd@gentoo.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #define AL7230B_RF 0x5 /* a,b,g */
30 #define MAXIM_NEW_RF 0x8
32 #define AL2230S_RF 0xa
34 #define INTERSIL_RF 0xc
36 #define MAXIM_NEW2_RF 0xe
37 #define PHILIPS_RF 0xf
39 #define RF_CHANNEL(ch) [(ch)-1]
41 /* Provides functions of the RF transceiver. */
46 RF_RV_BITS
= RF_REG_BITS
+ RF_VALUE_BITS
,
54 /* whether channel integration and calibration should be updated
55 * defaults to 1 (yes) */
56 u8 update_channel_int
:1;
58 /* whether CR47 should be patched from the EEPROM, if the appropriate
59 * flag is set in the POD. The vendor driver suggests that this should
60 * be done for all RF's, but a bug in their code prevents but their
61 * HW_OverWritePhyRegFromE2P() routine from ever taking effect. */
64 /* private RF driver data */
67 /* RF-specific functions */
68 int (*init_hw
)(struct zd_rf
*rf
);
69 int (*set_channel
)(struct zd_rf
*rf
, u8 channel
);
70 int (*switch_radio_on
)(struct zd_rf
*rf
);
71 int (*switch_radio_off
)(struct zd_rf
*rf
);
72 int (*patch_6m_band_edge
)(struct zd_rf
*rf
, u8 channel
);
73 void (*clear
)(struct zd_rf
*rf
);
76 const char *zd_rf_name(u8 type
);
77 void zd_rf_init(struct zd_rf
*rf
);
78 void zd_rf_clear(struct zd_rf
*rf
);
79 int zd_rf_init_hw(struct zd_rf
*rf
, u8 type
);
81 int zd_rf_scnprint_id(struct zd_rf
*rf
, char *buffer
, size_t size
);
83 int zd_rf_set_channel(struct zd_rf
*rf
, u8 channel
);
85 int zd_switch_radio_on(struct zd_rf
*rf
);
86 int zd_switch_radio_off(struct zd_rf
*rf
);
88 int zd_rf_patch_6m_band_edge(struct zd_rf
*rf
, u8 channel
);
89 int zd_rf_generic_patch_6m(struct zd_rf
*rf
, u8 channel
);
91 static inline int zd_rf_should_update_pwr_int(struct zd_rf
*rf
)
93 return rf
->update_channel_int
;
96 static inline int zd_rf_should_patch_cck_gain(struct zd_rf
*rf
)
98 return rf
->patch_cck_gain
;
101 int zd_rf_patch_6m_band_edge(struct zd_rf
*rf
, u8 channel
);
102 int zd_rf_generic_patch_6m(struct zd_rf
*rf
, u8 channel
);
104 /* Functions for individual RF chips */
106 int zd_rf_init_rf2959(struct zd_rf
*rf
);
107 int zd_rf_init_al2230(struct zd_rf
*rf
);
108 int zd_rf_init_al7230b(struct zd_rf
*rf
);
109 int zd_rf_init_uw2453(struct zd_rf
*rf
);
111 #endif /* _ZD_RF_H */