From: Kalle Valo Date: Mon, 22 Apr 2013 13:12:10 +0300 Subject: [ath9k-devel] [PATCH] ath10k: add bmi_read32/bmi_write32 functions In-Reply-To: <1366287711-24307-1-git-send-email-janusz.dziedzic@tieto.com> (Janusz Dziedzic's message of "Thu, 18 Apr 2013 14:21:51 +0200") References: <1366287711-24307-1-git-send-email-janusz.dziedzic@tieto.com> Message-ID: <87d2tmj2md.fsf@kamboji.qca.qualcomm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org Janusz Dziedzic writes: > Add ath10k_bmi_read32/ath10k_bmi_write32 functions > and use them in core layer when read32/write32. > > Signed-off-by: Janusz Dziedzic Thanks, applied. But can you do a followup patch, please: > + param_host = HTC_PROTOCOL_VERSION; > + ret = ath10k_bmi_write32(ar, hi_app_host_interest, param_host); [...] > + param_host = 0; > /* We do all byte-swapping on the host */ > - host_addr = host_interest_item_address(ar->target_type, > - HI_ITEM(hi_be)); > - ret = ath10k_bmi_write_memory(ar, host_addr, (u8 *)¶m_target, 4); > + ret = ath10k_bmi_write32(ar, hi_be, param_host); [...] > + param_host = 0; > + ret = ath10k_bmi_write32(ar, hi_fw_swap, param_host); [...] > + param_host = (board_ext_data_size << 16) | 1; > + ath10k_bmi_write32(ar, hi_board_ext_data_config, param_host); [...] > + param_host = 1; > + ath10k_bmi_write32(ar, hi_board_data_initialized, param_host); [...] > + param_host = 7; > + ath10k_bmi_write32(ar, hi_dbg_uart_txpin, param_host); > + > + param_host = 1; > + ath10k_bmi_write32(ar, hi_serial_enable, param_host); [...] > + param_host = 0; > + ath10k_bmi_write32(ar, hi_serial_enable, param_host); In the cases above the use of param_host variable is not really needed. For example, in the last case you can simplify the code like this: ath10k_bmi_write32(ar, hi_serial_enable, 0); It's a lot more comfortable to read code like that. -- Kalle Valo