rfbuffer.h (d4bbf7e7759afc172e2bfbc5c416324590049cdd) | rfbuffer.h (c47faa364cfb249d5d7670fb7293a6f9acd8aa9e) |
---|---|
1/* 2 * RF Buffer handling functions 3 * 4 * Copyright (c) 2009 Nick Kossifidis <mickflemm@gmail.com> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. --- 4 unchanged lines hidden (view full) --- 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 */ 19 20 | 1/* 2 * RF Buffer handling functions 3 * 4 * Copyright (c) 2009 Nick Kossifidis <mickflemm@gmail.com> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. --- 4 unchanged lines hidden (view full) --- 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 */ 19 20 |
21/* | 21/** 22 * DOC: RF Buffer registers 23 * |
22 * There are some special registers on the RF chip 23 * that control various operation settings related mostly to 24 * the analog parts (channel, gain adjustment etc). 25 * 26 * We don't write on those registers directly but 27 * we send a data packet on the chip, using a special register, 28 * that holds all the settings we need. After we've sent the 29 * data packet, we write on another special register to notify hw --- 9 unchanged lines hidden (view full) --- 39 * 40 * Also check out reg.h and U.S. Patent 6677779 B1 (about buffer 41 * registers and control registers): 42 * 43 * http://www.google.com/patents?id=qNURAAAAEBAJ 44 */ 45 46 | 24 * There are some special registers on the RF chip 25 * that control various operation settings related mostly to 26 * the analog parts (channel, gain adjustment etc). 27 * 28 * We don't write on those registers directly but 29 * we send a data packet on the chip, using a special register, 30 * that holds all the settings we need. After we've sent the 31 * data packet, we write on another special register to notify hw --- 9 unchanged lines hidden (view full) --- 41 * 42 * Also check out reg.h and U.S. Patent 6677779 B1 (about buffer 43 * registers and control registers): 44 * 45 * http://www.google.com/patents?id=qNURAAAAEBAJ 46 */ 47 48 |
47/* | 49/** 50 * struct ath5k_ini_rfbuffer - Initial RF Buffer settings 51 * @rfb_bank: RF Bank number 52 * @rfb_ctrl_register: RF Buffer control register 53 * @rfb_mode_data: RF Buffer data for each mode 54 * |
48 * Struct to hold default mode specific RF | 55 * Struct to hold default mode specific RF |
49 * register values (RF Banks) | 56 * register values (RF Banks) for each chip. |
50 */ 51struct ath5k_ini_rfbuffer { | 57 */ 58struct ath5k_ini_rfbuffer { |
52 u8 rfb_bank; /* RF Bank number */ 53 u16 rfb_ctrl_register; /* RF Buffer control register */ 54 u32 rfb_mode_data[3]; /* RF Buffer data for each mode */ | 59 u8 rfb_bank; 60 u16 rfb_ctrl_register; 61 u32 rfb_mode_data[3]; |
55}; 56 | 62}; 63 |
57/* | 64/** 65 * struct ath5k_rfb_field - An RF Buffer field (register/value) 66 * @len: Field length 67 * @pos: Offset on the raw packet 68 * @col: Used for shifting 69 * |
58 * Struct to hold RF Buffer field 59 * infos used to access certain RF 60 * analog registers 61 */ 62struct ath5k_rfb_field { | 70 * Struct to hold RF Buffer field 71 * infos used to access certain RF 72 * analog registers 73 */ 74struct ath5k_rfb_field { |
63 u8 len; /* Field length */ 64 u16 pos; /* Offset on the raw packet */ 65 u8 col; /* Column -used for shifting */ | 75 u8 len; 76 u16 pos; 77 u8 col; |
66}; 67 | 78}; 79 |
68/* 69 * RF analog register definition | 80/** 81 * struct ath5k_rf_reg - RF analog register definition 82 * @bank: RF Buffer Bank number 83 * @index: Register's index on ath5k_rf_regx_idx 84 * @field: The &struct ath5k_rfb_field 85 * 86 * We use this struct to define the set of RF registers 87 * on each chip that we want to tweak. Some RF registers 88 * are common between different chip versions so this saves 89 * us space and complexity because we can refer to an rf 90 * register by it's index no matter what chip we work with 91 * as long as it has that register. |
70 */ 71struct ath5k_rf_reg { | 92 */ 93struct ath5k_rf_reg { |
72 u8 bank; /* RF Buffer Bank number */ 73 u8 index; /* Register's index on rf_regs_idx */ 74 struct ath5k_rfb_field field; /* RF Buffer field for this register */ | 94 u8 bank; 95 u8 index; 96 struct ath5k_rfb_field field; |
75}; 76 | 97}; 98 |
77/* Map RF registers to indexes | 99/** 100 * enum ath5k_rf_regs_idx - Map RF registers to indexes 101 * |
78 * We do this to handle common bits and make our 79 * life easier by using an index for each register | 102 * We do this to handle common bits and make our 103 * life easier by using an index for each register |
80 * instead of a full rfb_field */ | 104 * instead of a full rfb_field 105 */ |
81enum ath5k_rf_regs_idx { 82 /* BANK 2 */ 83 AR5K_RF_TURBO = 0, 84 /* BANK 6 */ 85 AR5K_RF_OB_2GHZ, 86 AR5K_RF_OB_5GHZ, 87 AR5K_RF_DB_2GHZ, 88 AR5K_RF_DB_5GHZ, --- 740 unchanged lines hidden --- | 106enum ath5k_rf_regs_idx { 107 /* BANK 2 */ 108 AR5K_RF_TURBO = 0, 109 /* BANK 6 */ 110 AR5K_RF_OB_2GHZ, 111 AR5K_RF_OB_5GHZ, 112 AR5K_RF_DB_2GHZ, 113 AR5K_RF_DB_5GHZ, --- 740 unchanged lines hidden --- |