On Fri, Jul 31, 2009 at 11:02 AM, Nick Kossifidis<mick@xxxxxxxxxxxxxxxxxxx> wrote: > * Read PCI-E infos offset from EEPROM and if it points to > serdes section (0x40), enable serdes programming (further > tweaking of serdes values during attach). This follows > Legacy and Sam's HAL sources. > > --- > drivers/net/wireless/ath/ath5k/attach.c | 56 +++++++++++++++++++------------ > drivers/net/wireless/ath/ath5k/eeprom.c | 10 +++++ > drivers/net/wireless/ath/ath5k/eeprom.h | 4 ++ > 3 files changed, 48 insertions(+), 22 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c > index 9a84d94..6263065 100644 > --- a/drivers/net/wireless/ath/ath5k/attach.c > +++ b/drivers/net/wireless/ath/ath5k/attach.c > @@ -253,28 +253,6 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) > } > > /* > - * Write PCI-E power save settings > - */ > - if ((ah->ah_version == AR5K_AR5212) && (pdev->is_pcie)) { > - ath5k_hw_reg_write(ah, 0x9248fc00, AR5K_PCIE_SERDES); > - ath5k_hw_reg_write(ah, 0x24924924, AR5K_PCIE_SERDES); > - /* Shut off RX when elecidle is asserted */ > - ath5k_hw_reg_write(ah, 0x28000039, AR5K_PCIE_SERDES); > - ath5k_hw_reg_write(ah, 0x53160824, AR5K_PCIE_SERDES); > - /* TODO: EEPROM work */ > - ath5k_hw_reg_write(ah, 0xe5980579, AR5K_PCIE_SERDES); > - /* Shut off PLL and CLKREQ active in L1 */ > - ath5k_hw_reg_write(ah, 0x001defff, AR5K_PCIE_SERDES); > - /* Preserce other settings */ > - ath5k_hw_reg_write(ah, 0x1aaabe40, AR5K_PCIE_SERDES); > - ath5k_hw_reg_write(ah, 0xbe105554, AR5K_PCIE_SERDES); > - ath5k_hw_reg_write(ah, 0x000e3007, AR5K_PCIE_SERDES); > - /* Reset SERDES to load new settings */ > - ath5k_hw_reg_write(ah, 0x00000000, AR5K_PCIE_SERDES_RESET); > - mdelay(1); > - } > - > - /* > * POST > */ > ret = ath5k_hw_post(ah); Can the changes for the code be done before the move, or after so that way the actual code changes to the section can be easily readable? > @@ -295,6 +273,40 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) > goto err_free; > } > > + /* > + * Write PCI-E power save settings > + */ > + if ((ah->ah_version == AR5K_AR5212) && (pdev->is_pcie)) { > + struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; > + > + ath5k_hw_reg_write(ah, 0x9248fc00, AR5K_PCIE_SERDES); > + ath5k_hw_reg_write(ah, 0x24924924, AR5K_PCIE_SERDES); > + > + /* Shut off RX when elecidle is asserted */ > + ath5k_hw_reg_write(ah, 0x28000039, AR5K_PCIE_SERDES); > + ath5k_hw_reg_write(ah, 0x53160824, AR5K_PCIE_SERDES); > + > + /* If serdes programing is enabled, increase PCI-E > + * tx power for systems with long trace from host > + * to minicard connector. */ This is just comment-picky mind using this style for comments for > 1 lines? /* * foo bleh buh * bar * qwerty */ Luis -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html