From: Oleksij Rempel Date: Sun, 7 Jul 2013 18:43:07 +0000 (+0200) Subject: if_ath.c: make ath_hal_reg_write_tgt more readable X-Git-Tag: 1.4.0~11^2~9 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=ffd97659858ed6e9bd252ed1baa2243d8a725dd6;p=open-ath9k-htc-firmware.git if_ath.c: make ath_hal_reg_write_tgt more readable Signed-off-by: Oleksij Rempel --- diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index fcbe9c3..896e72b 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -1425,10 +1425,7 @@ static void ath_hal_reg_write_tgt(void *Context, A_UINT16 Command, t = (struct registerWrite *)(data+i); if( t->reg > 0xffff ) { - a_uint32_t *pReg = (a_uint32_t *)t->reg; - - *pReg = t->val; - + HAL_WORD_REG_WRITE(t->reg, t->val); #if defined(PROJECT_K2) if( t->reg == 0x50040 ) { static uint8_t flg=0; @@ -1444,20 +1441,19 @@ static void ath_hal_reg_write_tgt(void *Context, A_UINT16 Command, #if defined(PROJECT_K2) if( t->reg == 0x7014 ) { static uint8_t resetPLL = 0; - a_uint32_t *pReg; if( resetPLL == 0 ) { - t->reg = 0x50044; - pReg = (a_uint32_t *)t->reg; - *pReg = 0; + /* here we write to core register */ + HAL_WORD_REG_WRITE(MAGPIE_REG_RST_PWDN_CTRL_ADDR, 0x0); + /* and here to mac register */ ath_hal_reg_write_target(ah, 0x786c, ath_hal_reg_read_target(ah,0x786c) | 0x6000000); ath_hal_reg_write_target(ah, 0x786c, ath_hal_reg_read_target(ah,0x786c) & (~0x6000000)); - *pReg = 0x20; + + HAL_WORD_REG_WRITE(MAGPIE_REG_RST_PWDN_CTRL_ADDR, 0x20); resetPLL = 1; } - t->reg = 0x7014; } #elif defined(PROJECT_MAGPIE) && !defined (FPGA) if( t->reg == 0x7014 ){