diff options
-rw-r--r-- | drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 01f1b79c165e..267a80b50630 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -47,29 +47,19 @@ static void _FWDownloadEnable(struct rtw_adapter *padapter, bool enable) } } -static int _BlockWrite(struct rtw_adapter *padapter, void *buffer, u32 buffSize) -{ - int ret; - - if (buffSize > MAX_PAGE_SIZE) - return _FAIL; - - ret = rtl8723au_writeN(padapter, FW_8723A_START_ADDRESS, - buffSize, buffer); - - return ret; -} - static int _PageWrite(struct rtw_adapter *padapter, u32 page, void *buffer, u32 size) { u8 value8; u8 u8Page = (u8) (page & 0x07); + if (size > MAX_PAGE_SIZE) + return _FAIL; + value8 = (rtl8723au_read8(padapter, REG_MCUFWDL + 2) & 0xF8) | u8Page; rtl8723au_write8(padapter, REG_MCUFWDL + 2, value8); - return _BlockWrite(padapter, buffer, size); + return rtl8723au_writeN(padapter, FW_8723A_START_ADDRESS, size, buffer); } static int _WriteFW(struct rtw_adapter *padapter, void *buffer, u32 size) |