wlcore/wl12xx: turn no-Tx-align quirk into Tx-align
authorArik Nemtsov <arik@wizery.com>
Tue, 13 Dec 2011 10:11:26 +0000 (12:11 +0200)
committerLuciano Coelho <coelho@ti.com>
Thu, 12 Apr 2012 05:44:00 +0000 (08:44 +0300)
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
drivers/net/wireless/ti/wlcore/init.c
drivers/net/wireless/ti/wlcore/main.c
drivers/net/wireless/ti/wlcore/tx.c
drivers/net/wireless/ti/wlcore/wlcore.h

index 6b187d066c512c531eadcda93bcadd8e36ec27c8..00ecd2ad495a33bc5876a85af6ad56101b4e3b3e 100644 (file)
@@ -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;
index d8c22351a73ec4f07b217b5b243372f82ec4eb57..c332da2f1cb94e993d6d5706560df40decb31db9 100644 (file)
@@ -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;
 
index 0392166c430965c2eaafa4ff4637f4f237a5ad1a..83be5be32ff44aa08ec268b52285b99571a12efc 100644 (file)
@@ -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)
index d1811b8b5146624cce7ec3ddab58111e9afa1d54..6893bc2079941e93c8d1d07e265508a30199e9ee 100644 (file)
@@ -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);
 
index 29b39f9b746af717eed1ef54349e354ef4248a79..db7ad71a11e9f466e3202c780730cf003fbbf607 100644 (file)
@@ -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)