1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* ZD1211 USB-WLAN driver for Linux
4 * Copyright (C) 2005-2007 Ulrich Kunitz <kune@deine-taler.de>
5 * Copyright (C) 2006-2007 Daniel Drake <dsd@gentoo.org>
14 #define AL7230B_RF 0x5 /* a,b,g */
17 #define MAXIM_NEW_RF 0x8
19 #define AL2230S_RF 0xa
21 #define INTERSIL_RF 0xc
23 #define MAXIM_NEW2_RF 0xe
24 #define PHILIPS_RF 0xf
26 #define RF_CHANNEL(ch) [(ch)-1]
28 /* Provides functions of the RF transceiver. */
33 RF_RV_BITS = RF_REG_BITS + RF_VALUE_BITS,
41 /* whether channel integration and calibration should be updated
42 * defaults to 1 (yes) */
43 u8 update_channel_int:1;
45 /* whether ZD_CR47 should be patched from the EEPROM, if the appropriate
46 * flag is set in the POD. The vendor driver suggests that this should
47 * be done for all RF's, but a bug in their code prevents but their
48 * HW_OverWritePhyRegFromE2P() routine from ever taking effect. */
51 /* private RF driver data */
54 /* RF-specific functions */
55 int (*init_hw)(struct zd_rf *rf);
56 int (*set_channel)(struct zd_rf *rf, u8 channel);
57 int (*switch_radio_on)(struct zd_rf *rf);
58 int (*switch_radio_off)(struct zd_rf *rf);
59 int (*patch_6m_band_edge)(struct zd_rf *rf, u8 channel);
60 void (*clear)(struct zd_rf *rf);
63 const char *zd_rf_name(u8 type);
64 void zd_rf_init(struct zd_rf *rf);
65 void zd_rf_clear(struct zd_rf *rf);
66 int zd_rf_init_hw(struct zd_rf *rf, u8 type);
68 int zd_rf_scnprint_id(struct zd_rf *rf, char *buffer, size_t size);
70 int zd_rf_set_channel(struct zd_rf *rf, u8 channel);
72 int zd_switch_radio_on(struct zd_rf *rf);
73 int zd_switch_radio_off(struct zd_rf *rf);
75 int zd_rf_patch_6m_band_edge(struct zd_rf *rf, u8 channel);
76 int zd_rf_generic_patch_6m(struct zd_rf *rf, u8 channel);
78 static inline int zd_rf_should_update_pwr_int(struct zd_rf *rf)
80 return rf->update_channel_int;
83 static inline int zd_rf_should_patch_cck_gain(struct zd_rf *rf)
85 return rf->patch_cck_gain;
88 /* Functions for individual RF chips */
90 int zd_rf_init_rf2959(struct zd_rf *rf);
91 int zd_rf_init_al2230(struct zd_rf *rf);
92 int zd_rf_init_al7230b(struct zd_rf *rf);
93 int zd_rf_init_uw2453(struct zd_rf *rf);