wl12xx: change blocksize alignment quirk to negative
authorLuciano Coelho <coelho@ti.com>
Thu, 3 Nov 2011 06:44:41 +0000 (08:44 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 8 Nov 2011 13:36:53 +0000 (15:36 +0200)
SDIO blocksize alignment support is now the rule, not the exception.
To simplify the code in patches to come, invert the meaning of the
quirk to be negative (ie. the quirk is set if the device does _not_
support blocksize alignment).

Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/init.c
drivers/net/wireless/wl12xx/main.c
drivers/net/wireless/wl12xx/tx.c
drivers/net/wireless/wl12xx/wl12xx.h

index 14ff01e..c413abd 100644 (file)
@@ -501,7 +501,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 & WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT)
+               if (!(wl->quirks & WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT))
                        /* Enable SDIO padding */
                        host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK;
 
index 51d519f..b9a3fe4 100644 (file)
@@ -1323,7 +1323,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
                ret = wl1271_setup(wl);
                if (ret < 0)
                        goto out;
+               wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
                break;
+
        case CHIP_ID_1271_PG20:
                wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)",
                             wl->chip.id);
@@ -1331,7 +1333,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
                ret = wl1271_setup(wl);
                if (ret < 0)
                        goto out;
+               wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
                break;
+
        case CHIP_ID_1283_PG20:
                wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1283 PG20)",
                             wl->chip.id);
@@ -1340,8 +1344,8 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
                if (ret < 0)
                        goto out;
 
-               if (wl1271_set_block_size(wl))
-                       wl->quirks |= WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT;
+               if (!wl1271_set_block_size(wl))
+                       wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
                break;
        case CHIP_ID_1283_PG10:
        default:
index 3a9d2a6..a07ee82 100644 (file)
@@ -201,10 +201,10 @@ u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif,
 static unsigned int wl12xx_calc_packet_alignment(struct wl1271 *wl,
                                                unsigned int packet_length)
 {
-       if (wl->quirks & WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT)
-               return ALIGN(packet_length, WL12XX_BUS_BLOCK_SIZE);
-       else
+       if (wl->quirks & WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT)
                return ALIGN(packet_length, WL1271_TX_ALIGN_TO);
+       else
+               return ALIGN(packet_length, WL12XX_BUS_BLOCK_SIZE);
 }
 
 static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif,
index b7036df..e58e801 100644 (file)
@@ -669,8 +669,8 @@ size_t wl12xx_copy_fwlog(struct wl1271 *wl, u8 *memblock, size_t maxlen);
 /* Each RX/TX transaction requires an end-of-transaction transfer */
 #define WL12XX_QUIRK_END_OF_TRANSACTION                BIT(0)
 
-/* WL128X requires aggregated packets to be aligned to the SDIO block size */
-#define WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT       BIT(2)
+/* wl127x and SPI don't support SDIO block size alignment */
+#define WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT    BIT(2)
 
 /* Older firmwares did not implement the FW logger over bus feature */
 #define WL12XX_QUIRK_FWLOG_NOT_IMPLEMENTED     BIT(4)