From: Luciano Coelho <coelho@ti.com>
To: linux-wireless@vger.kernel.org
Cc: arik@wizery.com, coelho@ti.com
Subject: [PATCH 12/24] wlcore/wl12xx: turn no-Tx-align quirk into Tx-align
Date: Wed, 11 Apr 2012 22:53:28 +0300 [thread overview]
Message-ID: <1334174020-18957-13-git-send-email-coelho@ti.com> (raw)
In-Reply-To: <1334174020-18957-1-git-send-email-coelho@ti.com>
From: Arik Nemtsov <arik@wizery.com>
Inverting the quirk flag to indicate Tx-alignment. This aligns it with
the similar Rx-side quirk.
The call to wl1271_set_block_size() decides whether SDIO block size
alignment can be used or not. In case we're using SPI, we can't use
the block size alignment, so the function returns false. So we set
the quirk when wl1271_set_block_size() returns true and let the wl12xx
lower driver unset the bit for wl127x (since it doesn't support this
quirk).
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
drivers/net/wireless/ti/wl12xx/main.c | 13 ++++++++-----
drivers/net/wireless/ti/wlcore/init.c | 2 +-
drivers/net/wireless/ti/wlcore/main.c | 4 ++--
drivers/net/wireless/ti/wlcore/tx.c | 6 +++---
drivers/net/wireless/ti/wlcore/wlcore.h | 2 +-
5 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 6b187d0..00ecd2a 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -272,9 +272,10 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
wl1271_warning("chip id 0x%x (1271 PG10) support is obsolete",
wl->chip.id);
- wl->quirks |= WLCORE_QUIRK_NO_BLOCKSIZE_ALIGNMENT |
- WLCORE_QUIRK_LEGACY_NVS;
- wl->plt_fw_name = WL127X_PLT_FW_NAME;
+ /* clear the alignment quirk, since we don't support it */
+ wl->quirks &= ~WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN;
+
+ wl->quirks |= WLCORE_QUIRK_LEGACY_NVS;
wl->sr_fw_name = WL127X_FW_NAME_SINGLE;
wl->mr_fw_name = WL127X_FW_NAME_MULTI;
@@ -287,8 +288,10 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)",
wl->chip.id);
- wl->quirks |= WLCORE_QUIRK_NO_BLOCKSIZE_ALIGNMENT |
- WLCORE_QUIRK_LEGACY_NVS;
+ /* clear the alignment quirk, since we don't support it */
+ wl->quirks &= ~WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN;
+
+ wl->quirks |= WLCORE_QUIRK_LEGACY_NVS;
wl->plt_fw_name = WL127X_PLT_FW_NAME;
wl->sr_fw_name = WL127X_FW_NAME_SINGLE;
wl->mr_fw_name = WL127X_FW_NAME_MULTI;
diff --git a/drivers/net/wireless/ti/wlcore/init.c b/drivers/net/wireless/ti/wlcore/init.c
index d8c2235..c332da2 100644
--- a/drivers/net/wireless/ti/wlcore/init.c
+++ b/drivers/net/wireless/ti/wlcore/init.c
@@ -500,7 +500,7 @@ int wl1271_chip_specific_init(struct wl1271 *wl)
if (wl->chip.id == CHIP_ID_1283_PG20) {
u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE;
- if (!(wl->quirks & WLCORE_QUIRK_NO_BLOCKSIZE_ALIGNMENT))
+ if (wl->quirks & WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN)
/* Enable SDIO padding */
host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK;
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 0392166..83be5be 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1345,8 +1345,8 @@ static int wl12xx_chip_wakeup(struct wl1271 *wl, bool plt)
* negligible, we use the same block size for all different
* chip types.
*/
- if (!wl1271_set_block_size(wl))
- wl->quirks |= WLCORE_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
+ if (wl1271_set_block_size(wl))
+ wl->quirks |= WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN;
ret = wl->ops->identify_chip(wl);
if (ret < 0)
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index d1811b8..6893bc2 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -176,10 +176,10 @@ u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif,
unsigned int wlcore_calc_packet_alignment(struct wl1271 *wl,
unsigned int packet_length)
{
- if (wl->quirks & WLCORE_QUIRK_NO_BLOCKSIZE_ALIGNMENT)
- return ALIGN(packet_length, WL1271_TX_ALIGN_TO);
- else
+ if (wl->quirks & WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN)
return ALIGN(packet_length, WL12XX_BUS_BLOCK_SIZE);
+ else
+ return ALIGN(packet_length, WL1271_TX_ALIGN_TO);
}
EXPORT_SYMBOL(wlcore_calc_packet_alignment);
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 29b39f9..db7ad71 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -353,7 +353,7 @@ int wlcore_free_hw(struct wl1271 *wl);
#define WLCORE_QUIRK_END_OF_TRANSACTION BIT(0)
/* wl127x and SPI don't support SDIO block size alignment */
-#define WLCORE_QUIRK_NO_BLOCKSIZE_ALIGNMENT BIT(2)
+#define WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN BIT(2)
/* means aggregated Rx packets are aligned to a SDIO block */
#define WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN BIT(3)
--
1.7.5.4
next prev parent reply other threads:[~2012-04-11 19:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-11 19:53 [PATCH 00/24] wl12xx/wl1251/wlcore: reorganize drivers part 2 Luciano Coelho
2012-04-11 19:53 ` [PATCH 01/24] wlcore/wl12xx: set the number of Tx descriptors per chip family Luciano Coelho
2012-04-11 19:53 ` [PATCH 02/24] wlcore/wl12xx: change GEM Tx-spare blocks per-vif Luciano Coelho
2012-04-11 19:53 ` [PATCH 03/24] wlcore/wl12xx: add hw op for calculating hw block count per packet Luciano Coelho
2012-04-11 19:53 ` [PATCH 04/24] wlcore/wl12xx: add hw op for setting blocks in hw_tx_desc Luciano Coelho
2012-04-11 19:53 ` [PATCH 05/24] wlcore/wl12xx: add hw op for setting frame length in tx_hw_desc Luciano Coelho
2012-04-11 19:53 ` [PATCH 06/24] wlcore/wl12xx: add global elements to convert hw-rates to standard rates Luciano Coelho
2012-04-11 19:53 ` [PATCH 07/24] wlcore: introduce Rx block-size alignment HW quirk Luciano Coelho
2012-04-11 19:53 ` [PATCH 08/24] wlcore/wl12xx: add hw op for getting rx buffer data alignment Luciano Coelho
2012-04-11 19:53 ` [PATCH 09/24] wlcore/wl12xx: add prepare_read hw op for Rx data Luciano Coelho
2012-04-11 19:53 ` [PATCH 10/24] wlcore/wl12xx: add hw op for getting rx packet data length Luciano Coelho
2012-04-11 19:53 ` [PATCH 11/24] wlcore/wl12xx: split Tx completion to immediate/delayed Luciano Coelho
2012-04-11 19:53 ` Luciano Coelho [this message]
2012-04-11 19:53 ` [PATCH 13/24] wlcore/wl12xx: add hw_init operation Luciano Coelho
2012-04-11 19:53 ` [PATCH 14/24] wlcore/wl12xx: add hw op for vif init Luciano Coelho
2012-04-11 19:53 ` [PATCH 15/24] wlcore/wl12xx: expand functionality of cmd_trigger HW op Luciano Coelho
2012-04-11 19:53 ` [PATCH 16/24] wlcore/wl12xx: move runtime configuration struct to the lower driver Luciano Coelho
2012-04-11 19:53 ` [PATCH 17/24] wlcore/wl12xx: move extended radio configuration parameters to wl12xx Luciano Coelho
2012-04-11 19:53 ` [PATCH 18/24] wlcore/wl12xx: use a single memory config and reset if using wl127x Luciano Coelho
2012-04-11 19:53 ` [PATCH 19/24] wlcore/wl12xx: add hw op to get rate-mask for AP-link in STA mode Luciano Coelho
2012-04-11 19:53 ` [PATCH 20/24] wlcore/wl12xx: set HT capabilities per chip-family Luciano Coelho
2012-04-11 19:53 ` [PATCH 21/24] wlcore: set max_rx_agg_subframes in mac80211 according to HT conf Luciano Coelho
2012-04-11 19:53 ` [PATCH 22/24] wlcore/wl12xx: move identify firmware function to a lower driver op Luciano Coelho
2012-04-11 19:53 ` [PATCH 23/24] wlcore: add module param to prevent HW recovery Luciano Coelho
2012-04-11 19:53 ` [PATCH 24/24] wlcore/wl12xx: adapt FW status for multiple families Luciano Coelho
2012-04-12 12:43 ` [PATCH 00/24] wl12xx/wl1251/wlcore: reorganize drivers part 2 Luciano Coelho
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=1334174020-18957-13-git-send-email-coelho@ti.com \
--to=coelho@ti.com \
--cc=arik@wizery.com \
--cc=linux-wireless@vger.kernel.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