/* * Initial register settings functions * * Copyright (c) 2004-2007 Reyk Floeter <[email protected]> * Copyright (c) 2006-2009 Nick Kossifidis <[email protected]> * Copyright (c) 2007-2008 Jiri Slaby <[email protected]> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #define pr_fmt(fmt) … #include "ath5k.h" #include "reg.h" #include "debug.h" /** * struct ath5k_ini - Mode-independent initial register writes * @ini_register: Register address * @ini_value: Default value * @ini_mode: 0 to write 1 to read (and clear) */ struct ath5k_ini { … }; /** * struct ath5k_ini_mode - Mode specific initial register values * @mode_register: Register address * @mode_value: Set of values for each enum ath5k_driver_mode */ struct ath5k_ini_mode { … }; /* Initial register settings for AR5210 */ static const struct ath5k_ini ar5210_ini[] = …; /* Initial register settings for AR5211 */ static const struct ath5k_ini ar5211_ini[] = …; /* Initial mode-specific settings for AR5211 * 5211 supports OFDM-only g (draft g) but we * need to test it ! */ static const struct ath5k_ini_mode ar5211_ini_mode[] = …; /* Initial register settings for AR5212 and newer chips */ static const struct ath5k_ini ar5212_ini_common_start[] = …; /* Initial mode-specific settings for AR5212 (Written before ar5212_ini) */ static const struct ath5k_ini_mode ar5212_ini_mode_start[] = …; /* Initial mode-specific settings for AR5212 + RF5111 * (Written after ar5212_ini) */ static const struct ath5k_ini_mode rf5111_ini_mode_end[] = …; /* Common for all modes */ static const struct ath5k_ini rf5111_ini_common_end[] = …; /* Initial mode-specific settings for AR5212 + RF5112 * (Written after ar5212_ini) */ static const struct ath5k_ini_mode rf5112_ini_mode_end[] = …; static const struct ath5k_ini rf5112_ini_common_end[] = …; /* Initial mode-specific settings for RF5413/5414 * (Written after ar5212_ini) */ static const struct ath5k_ini_mode rf5413_ini_mode_end[] = …; static const struct ath5k_ini rf5413_ini_common_end[] = …; /* Initial mode-specific settings for RF2413/2414 * (Written after ar5212_ini) */ /* XXX: a mode ? */ static const struct ath5k_ini_mode rf2413_ini_mode_end[] = …; static const struct ath5k_ini rf2413_ini_common_end[] = …; /* Initial mode-specific settings for RF2425 * (Written after ar5212_ini) */ /* XXX: a mode ? */ static const struct ath5k_ini_mode rf2425_ini_mode_end[] = …; static const struct ath5k_ini rf2425_ini_common_end[] = …; /* * Initial BaseBand Gain settings for RF5111/5112 (AR5210 comes with * RF5110 only so initial BB Gain settings are included in AR5K_AR5210_INI) */ /* RF5111 Initial BaseBand Gain settings */ static const struct ath5k_ini rf5111_ini_bbgain[] = …; /* RF5112 Initial BaseBand Gain settings (Same for RF5413/5414+) */ static const struct ath5k_ini rf5112_ini_bbgain[] = …; /** * ath5k_hw_ini_registers() - Write initial register dump common for all modes * @ah: The &struct ath5k_hw * @size: Dump size * @ini_regs: The array of &struct ath5k_ini * @skip_pcu: Skip PCU registers */ static void ath5k_hw_ini_registers(struct ath5k_hw *ah, unsigned int size, const struct ath5k_ini *ini_regs, bool skip_pcu) { … } /** * ath5k_hw_ini_mode_registers() - Write initial mode-specific register dump * @ah: The &struct ath5k_hw * @size: Dump size * @ini_mode: The array of &struct ath5k_ini_mode * @mode: One of enum ath5k_driver_mode */ static void ath5k_hw_ini_mode_registers(struct ath5k_hw *ah, unsigned int size, const struct ath5k_ini_mode *ini_mode, u8 mode) { … } /** * ath5k_hw_write_initvals() - Write initial chip-specific register dump * @ah: The &struct ath5k_hw * @mode: One of enum ath5k_driver_mode * @skip_pcu: Skip PCU registers * * Write initial chip-specific register dump, to get the chipset on a * clean and ready-to-work state after warm reset. */ int ath5k_hw_write_initvals(struct ath5k_hw *ah, u8 mode, bool skip_pcu) { … }