Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly
@ 2013-06-22 14:31 Gabor Juhos
  2013-06-22 14:31 ` [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines Gabor Juhos
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Gabor Juhos @ 2013-06-22 14:31 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, users, Gabor Juhos

Different chipsets may use different TXWI descriptor
size. Instead of using a hardcoded value, use the
'queue->winfo_size' which holds the correct value for
a given device.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
 drivers/net/wireless/rt2x00/rt2800pci.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 7c74782..e664918 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -637,6 +637,7 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry,
 	struct queue_entry_priv_mmio *entry_priv = entry->priv_data;
 	__le32 *txd = entry_priv->desc;
 	u32 word;
+	const unsigned int txwi_size = entry->queue->winfo_size;
 
 	/*
 	 * The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1
@@ -659,14 +660,14 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry,
 			   !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
 	rt2x00_set_field32(&word, TXD_W1_BURST,
 			   test_bit(ENTRY_TXD_BURST, &txdesc->flags));
-	rt2x00_set_field32(&word, TXD_W1_SD_LEN0, TXWI_DESC_SIZE);
+	rt2x00_set_field32(&word, TXD_W1_SD_LEN0, txwi_size);
 	rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0);
 	rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0);
 	rt2x00_desc_write(txd, 1, word);
 
 	word = 0;
 	rt2x00_set_field32(&word, TXD_W2_SD_PTR1,
-			   skbdesc->skb_dma + TXWI_DESC_SIZE);
+			   skbdesc->skb_dma + txwi_size);
 	rt2x00_desc_write(txd, 2, word);
 
 	word = 0;
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines
  2013-06-22 14:31 [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly Gabor Juhos
@ 2013-06-22 14:31 ` Gabor Juhos
  2013-06-24 15:49   ` [rt2x00-users] " Stanislaw Gruszka
  2013-06-24 17:29   ` Gertjan van Wingerde
  2013-06-24 15:49 ` [rt2x00-users] [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly Stanislaw Gruszka
  2013-06-24 17:29 ` Gertjan van Wingerde
  2 siblings, 2 replies; 6+ messages in thread
From: Gabor Juhos @ 2013-06-22 14:31 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, users, Gabor Juhos

Use common names instead of chip specific ones.
The patch contains no functional changes, but
it makes it easier to add support for further
descriptor sizes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
 drivers/net/wireless/rt2x00/rt2800.h    |   10 ++++++----
 drivers/net/wireless/rt2x00/rt2800pci.c |    6 +++---
 drivers/net/wireless/rt2x00/rt2800usb.c |    8 ++++----
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index a7630d5..fe43d01 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -2625,11 +2625,13 @@ struct mac_iveiv_entry {
 /*
  * DMA descriptor defines.
  */
-#define TXWI_DESC_SIZE			(4 * sizeof(__le32))
-#define RXWI_DESC_SIZE			(4 * sizeof(__le32))
 
-#define TXWI_DESC_SIZE_5592		(5 * sizeof(__le32))
-#define RXWI_DESC_SIZE_5592		(6 * sizeof(__le32))
+#define TXWI_DESC_SIZE_4WORDS		(4 * sizeof(__le32))
+#define TXWI_DESC_SIZE_5WORDS		(5 * sizeof(__le32))
+
+#define RXWI_DESC_SIZE_4WORDS		(4 * sizeof(__le32))
+#define RXWI_DESC_SIZE_6WORDS		(6 * sizeof(__le32))
+
 /*
  * TX WI structure
  */
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index e664918..0005562 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -1194,7 +1194,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
 		queue->limit = 128;
 		queue->data_size = AGGREGATION_SIZE;
 		queue->desc_size = RXD_DESC_SIZE;
-		queue->winfo_size = RXWI_DESC_SIZE;
+		queue->winfo_size = RXWI_DESC_SIZE_4WORDS;
 		queue->priv_size = sizeof(struct queue_entry_priv_mmio);
 		break;
 
@@ -1205,7 +1205,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
 		queue->limit = 64;
 		queue->data_size = AGGREGATION_SIZE;
 		queue->desc_size = TXD_DESC_SIZE;
-		queue->winfo_size = TXWI_DESC_SIZE;
+		queue->winfo_size = TXWI_DESC_SIZE_4WORDS;
 		queue->priv_size = sizeof(struct queue_entry_priv_mmio);
 		break;
 
@@ -1213,7 +1213,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
 		queue->limit = 8;
 		queue->data_size = 0; /* No DMA required for beacons */
 		queue->desc_size = TXD_DESC_SIZE;
-		queue->winfo_size = TXWI_DESC_SIZE;
+		queue->winfo_size = TXWI_DESC_SIZE_4WORDS;
 		queue->priv_size = sizeof(struct queue_entry_priv_mmio);
 		break;
 
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 7edd903..840833b 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -855,11 +855,11 @@ static void rt2800usb_queue_init(struct data_queue *queue)
 	unsigned short txwi_size, rxwi_size;
 
 	if (rt2x00_rt(rt2x00dev, RT5592)) {
-		txwi_size = TXWI_DESC_SIZE_5592;
-		rxwi_size = RXWI_DESC_SIZE_5592;
+		txwi_size = TXWI_DESC_SIZE_5WORDS;
+		rxwi_size = RXWI_DESC_SIZE_6WORDS;
 	} else {
-		txwi_size = TXWI_DESC_SIZE;
-		rxwi_size = RXWI_DESC_SIZE;
+		txwi_size = TXWI_DESC_SIZE_4WORDS;
+		rxwi_size = RXWI_DESC_SIZE_4WORDS;
 	}
 
 	switch (queue->qid) {
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [rt2x00-users] [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly
  2013-06-22 14:31 [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly Gabor Juhos
  2013-06-22 14:31 ` [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines Gabor Juhos
@ 2013-06-24 15:49 ` Stanislaw Gruszka
  2013-06-24 17:29 ` Gertjan van Wingerde
  2 siblings, 0 replies; 6+ messages in thread
From: Stanislaw Gruszka @ 2013-06-24 15:49 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: John Linville, linux-wireless, users

On Sat, Jun 22, 2013 at 04:31:58PM +0200, Gabor Juhos wrote:
> Different chipsets may use different TXWI descriptor
> size. Instead of using a hardcoded value, use the
> 'queue->winfo_size' which holds the correct value for
> a given device.
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rt2x00-users] [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines
  2013-06-22 14:31 ` [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines Gabor Juhos
@ 2013-06-24 15:49   ` Stanislaw Gruszka
  2013-06-24 17:29   ` Gertjan van Wingerde
  1 sibling, 0 replies; 6+ messages in thread
From: Stanislaw Gruszka @ 2013-06-24 15:49 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: John Linville, linux-wireless, users

On Sat, Jun 22, 2013 at 04:31:59PM +0200, Gabor Juhos wrote:
> Use common names instead of chip specific ones.
> The patch contains no functional changes, but
> it makes it easier to add support for further
> descriptor sizes.
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly
  2013-06-22 14:31 [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly Gabor Juhos
  2013-06-22 14:31 ` [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines Gabor Juhos
  2013-06-24 15:49 ` [rt2x00-users] [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly Stanislaw Gruszka
@ 2013-06-24 17:29 ` Gertjan van Wingerde
  2 siblings, 0 replies; 6+ messages in thread
From: Gertjan van Wingerde @ 2013-06-24 17:29 UTC (permalink / raw)
  To: Gabor Juhos
  Cc: John Linville, linux-wireless@vger.kernel.org,
	users@rt2x00.serialmonkey.com, Gabor Juhos



Sent from my iPad

On 22 jun. 2013, at 16:31, Gabor Juhos <juhosg@openwrt.org> wrote:

> Different chipsets may use different TXWI descriptor
> size. Instead of using a hardcoded value, use the
> 'queue->winfo_size' which holds the correct value for
> a given device.
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>

> ---
> drivers/net/wireless/rt2x00/rt2800pci.c |    5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
> index 7c74782..e664918 100644
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -637,6 +637,7 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry,
>    struct queue_entry_priv_mmio *entry_priv = entry->priv_data;
>    __le32 *txd = entry_priv->desc;
>    u32 word;
> +    const unsigned int txwi_size = entry->queue->winfo_size;
> 
>    /*
>     * The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1
> @@ -659,14 +660,14 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry,
>               !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
>    rt2x00_set_field32(&word, TXD_W1_BURST,
>               test_bit(ENTRY_TXD_BURST, &txdesc->flags));
> -    rt2x00_set_field32(&word, TXD_W1_SD_LEN0, TXWI_DESC_SIZE);
> +    rt2x00_set_field32(&word, TXD_W1_SD_LEN0, txwi_size);
>    rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0);
>    rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0);
>    rt2x00_desc_write(txd, 1, word);
> 
>    word = 0;
>    rt2x00_set_field32(&word, TXD_W2_SD_PTR1,
> -               skbdesc->skb_dma + TXWI_DESC_SIZE);
> +               skbdesc->skb_dma + txwi_size);
>    rt2x00_desc_write(txd, 2, word);
> 
>    word = 0;
> -- 
> 1.7.10
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines
  2013-06-22 14:31 ` [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines Gabor Juhos
  2013-06-24 15:49   ` [rt2x00-users] " Stanislaw Gruszka
@ 2013-06-24 17:29   ` Gertjan van Wingerde
  1 sibling, 0 replies; 6+ messages in thread
From: Gertjan van Wingerde @ 2013-06-24 17:29 UTC (permalink / raw)
  To: Gabor Juhos
  Cc: John Linville, linux-wireless@vger.kernel.org,
	users@rt2x00.serialmonkey.com, Gabor Juhos



Sent from my iPad

On 22 jun. 2013, at 16:31, Gabor Juhos <juhosg@openwrt.org> wrote:

> Use common names instead of chip specific ones.
> The patch contains no functional changes, but
> it makes it easier to add support for further
> descriptor sizes.
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>

> ---
> drivers/net/wireless/rt2x00/rt2800.h    |   10 ++++++----
> drivers/net/wireless/rt2x00/rt2800pci.c |    6 +++---
> drivers/net/wireless/rt2x00/rt2800usb.c |    8 ++++----
> 3 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
> index a7630d5..fe43d01 100644
> --- a/drivers/net/wireless/rt2x00/rt2800.h
> +++ b/drivers/net/wireless/rt2x00/rt2800.h
> @@ -2625,11 +2625,13 @@ struct mac_iveiv_entry {
> /*
>  * DMA descriptor defines.
>  */
> -#define TXWI_DESC_SIZE            (4 * sizeof(__le32))
> -#define RXWI_DESC_SIZE            (4 * sizeof(__le32))
> 
> -#define TXWI_DESC_SIZE_5592        (5 * sizeof(__le32))
> -#define RXWI_DESC_SIZE_5592        (6 * sizeof(__le32))
> +#define TXWI_DESC_SIZE_4WORDS        (4 * sizeof(__le32))
> +#define TXWI_DESC_SIZE_5WORDS        (5 * sizeof(__le32))
> +
> +#define RXWI_DESC_SIZE_4WORDS        (4 * sizeof(__le32))
> +#define RXWI_DESC_SIZE_6WORDS        (6 * sizeof(__le32))
> +
> /*
>  * TX WI structure
>  */
> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
> index e664918..0005562 100644
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -1194,7 +1194,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
>        queue->limit = 128;
>        queue->data_size = AGGREGATION_SIZE;
>        queue->desc_size = RXD_DESC_SIZE;
> -        queue->winfo_size = RXWI_DESC_SIZE;
> +        queue->winfo_size = RXWI_DESC_SIZE_4WORDS;
>        queue->priv_size = sizeof(struct queue_entry_priv_mmio);
>        break;
> 
> @@ -1205,7 +1205,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
>        queue->limit = 64;
>        queue->data_size = AGGREGATION_SIZE;
>        queue->desc_size = TXD_DESC_SIZE;
> -        queue->winfo_size = TXWI_DESC_SIZE;
> +        queue->winfo_size = TXWI_DESC_SIZE_4WORDS;
>        queue->priv_size = sizeof(struct queue_entry_priv_mmio);
>        break;
> 
> @@ -1213,7 +1213,7 @@ static void rt2800pci_queue_init(struct data_queue *queue)
>        queue->limit = 8;
>        queue->data_size = 0; /* No DMA required for beacons */
>        queue->desc_size = TXD_DESC_SIZE;
> -        queue->winfo_size = TXWI_DESC_SIZE;
> +        queue->winfo_size = TXWI_DESC_SIZE_4WORDS;
>        queue->priv_size = sizeof(struct queue_entry_priv_mmio);
>        break;
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
> index 7edd903..840833b 100644
> --- a/drivers/net/wireless/rt2x00/rt2800usb.c
> +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
> @@ -855,11 +855,11 @@ static void rt2800usb_queue_init(struct data_queue *queue)
>    unsigned short txwi_size, rxwi_size;
> 
>    if (rt2x00_rt(rt2x00dev, RT5592)) {
> -        txwi_size = TXWI_DESC_SIZE_5592;
> -        rxwi_size = RXWI_DESC_SIZE_5592;
> +        txwi_size = TXWI_DESC_SIZE_5WORDS;
> +        rxwi_size = RXWI_DESC_SIZE_6WORDS;
>    } else {
> -        txwi_size = TXWI_DESC_SIZE;
> -        rxwi_size = RXWI_DESC_SIZE;
> +        txwi_size = TXWI_DESC_SIZE_4WORDS;
> +        rxwi_size = RXWI_DESC_SIZE_4WORDS;
>    }
> 
>    switch (queue->qid) {
> -- 
> 1.7.10
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-24 17:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-22 14:31 [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly Gabor Juhos
2013-06-22 14:31 ` [PATCH 2/2] rt2x00: rt2800: unify [RT]XWI_SIZE defines Gabor Juhos
2013-06-24 15:49   ` [rt2x00-users] " Stanislaw Gruszka
2013-06-24 17:29   ` Gertjan van Wingerde
2013-06-24 15:49 ` [rt2x00-users] [PATCH 1/2] rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly Stanislaw Gruszka
2013-06-24 17:29 ` Gertjan van Wingerde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox