From: Marc Kleine-Budde <mkl@pengutronix.de>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH v2 06/18] ath9k: add new function ath9k_hw_read_array
Date: Sat, 21 Mar 2015 11:04:59 +0100 [thread overview]
Message-ID: <550D424B.9020005@pengutronix.de> (raw)
In-Reply-To: <1426927641-18474-7-git-send-email-linux@rempel-privat.de>
On 03/21/2015 09:47 AM, Oleksij Rempel wrote:
> REG_READ generate most overhead on usb bus. It send and read micro packages
> and reduce usb bandwidth. To reduce this overhead we should read in batches.
>
> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
> ---
> drivers/net/wireless/ath/ath9k/hw.c | 20 ++++++++++++++++++++
> drivers/net/wireless/ath/ath9k/hw.h | 3 +++
> 2 files changed, 23 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
> index 60aa8d7..15433c7 100644
> --- a/drivers/net/wireless/ath/ath9k/hw.c
> +++ b/drivers/net/wireless/ath/ath9k/hw.c
> @@ -121,6 +121,26 @@ void ath9k_hw_write_array(struct ath_hw *ah, const struct ar5416IniArray *array,
> REGWRITE_BUFFER_FLUSH(ah);
> }
>
> +void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size)
> +{
> + u32 *tmp_reg_list, *tmp_data;
> + int i;
> +
> + tmp_reg_list = kmalloc(size * sizeof(u32), GFP_KERNEL);
> + tmp_data = kmalloc(size * sizeof(u32), GFP_KERNEL);
You probably want to check for kmalloc returning NULL here.
> +
> + for (i = 0; i < size; i++)
> + tmp_reg_list[i] = array[i][0];
> +
> + REG_READ_MULTI(ah, tmp_reg_list, tmp_data, size);
> +
> + for (i = 0; i < size; i++)
> + array[i][1] = tmp_data[i];
> +
> + kfree(tmp_reg_list);
> + kfree(tmp_data);
> +}
> +
> u32 ath9k_hw_reverse_bits(u32 val, u32 n)
> {
> u32 retval;
> diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
> index f1864cc..66aba10 100644
> --- a/drivers/net/wireless/ath/ath9k/hw.h
> +++ b/drivers/net/wireless/ath/ath9k/hw.h
> @@ -138,6 +138,8 @@
>
> #define REG_WRITE_ARRAY(iniarray, column, regWr) \
> ath9k_hw_write_array(ah, iniarray, column, &(regWr))
> +#define REG_READ_ARRAY(ah, array, size) \
> + ath9k_hw_read_array(ah, array, size)
>
> #define AR_GPIO_OUTPUT_MUX_AS_OUTPUT 0
> #define AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED 1
> @@ -1020,6 +1022,7 @@ void ath9k_hw_synth_delay(struct ath_hw *ah, struct ath9k_channel *chan,
> bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout);
> void ath9k_hw_write_array(struct ath_hw *ah, const struct ar5416IniArray *array,
> int column, unsigned int *writecnt);
> +void ath9k_hw_read_array(struct ath_hw *ah, u32 array[][2], int size);
> u32 ath9k_hw_reverse_bits(u32 val, u32 n);
> u16 ath9k_hw_computetxtime(struct ath_hw *ah,
> u8 phy, int kbps,
>
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20150321/4e40bd16/attachment.pgp
next prev parent reply other threads:[~2015-03-21 10:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-21 8:47 [ath9k-devel] [PATCH v2 00/18] reduce some of ath9k_htc performance problems Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 01/18] ath9k_htc: add new WMI_REG_RMW_CMDID command Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 02/18] ath9k: ar9271_hw_pa_cal - use defs instead of magin numbers Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 03/18] ath9k: ar9271_hw_pa_cal: use proper makroses Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 04/18] ath9k: ar9271_hw_pa_cal: use RMW buffer Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 05/18] ath9k: add multi_read to be compatible with ath9k_htc Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 06/18] ath9k: add new function ath9k_hw_read_array Oleksij Rempel
2015-03-21 10:04 ` Marc Kleine-Budde [this message]
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 07/18] ath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 08/18] ath9k: use one shot read in ath9k_hw_update_mibstats Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 09/18] ath9k: ath9k_hw_loadnf: use REG_RMW Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 10/18] ath9k: write buffer related optimisation in ar5008_hw_set_channel_regs Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 11/18] ath9k: ath9k_hw_set_4k_power_cal_tabl: use rmw buffer Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 12/18] ath9k: use rmw buffer in ath9k_hw_set_operating_mode and ath9k_hw_reset Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 13/18] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 14/18] ath9k: ath9k_hw_analog_shift_rmw: use REG_RMW Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 15/18] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 16/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_gain Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 17/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_board_values Oleksij Rempel
2015-03-21 8:47 ` [ath9k-devel] [PATCH v2 18/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_def_set_gain Oleksij Rempel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=550D424B.9020005@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=ath9k-devel@lists.ath9k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox