提交 ce39defb 编写于 作者: L Luciano Coelho

wl12xx: change blocksize alignment quirk to negative

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: NLuciano Coelho <coelho@ti.com>
上级 2f8e81ad
...@@ -501,7 +501,7 @@ int wl1271_chip_specific_init(struct wl1271 *wl) ...@@ -501,7 +501,7 @@ int wl1271_chip_specific_init(struct wl1271 *wl)
if (wl->chip.id == CHIP_ID_1283_PG20) { if (wl->chip.id == CHIP_ID_1283_PG20) {
u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE; 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 */ /* Enable SDIO padding */
host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK; host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK;
......
...@@ -1323,7 +1323,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) ...@@ -1323,7 +1323,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
ret = wl1271_setup(wl); ret = wl1271_setup(wl);
if (ret < 0) if (ret < 0)
goto out; goto out;
wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
break; break;
case CHIP_ID_1271_PG20: case CHIP_ID_1271_PG20:
wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)",
wl->chip.id); wl->chip.id);
...@@ -1331,7 +1333,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) ...@@ -1331,7 +1333,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
ret = wl1271_setup(wl); ret = wl1271_setup(wl);
if (ret < 0) if (ret < 0)
goto out; goto out;
wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
break; break;
case CHIP_ID_1283_PG20: case CHIP_ID_1283_PG20:
wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1283 PG20)", wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1283 PG20)",
wl->chip.id); wl->chip.id);
...@@ -1340,8 +1344,8 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) ...@@ -1340,8 +1344,8 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
if (ret < 0) if (ret < 0)
goto out; goto out;
if (wl1271_set_block_size(wl)) if (!wl1271_set_block_size(wl))
wl->quirks |= WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT; wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
break; break;
case CHIP_ID_1283_PG10: case CHIP_ID_1283_PG10:
default: default:
......
...@@ -201,10 +201,10 @@ u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif, ...@@ -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, static unsigned int wl12xx_calc_packet_alignment(struct wl1271 *wl,
unsigned int packet_length) unsigned int packet_length)
{ {
if (wl->quirks & WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT) if (wl->quirks & WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT)
return ALIGN(packet_length, WL12XX_BUS_BLOCK_SIZE);
else
return ALIGN(packet_length, WL1271_TX_ALIGN_TO); 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, static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif,
......
...@@ -669,8 +669,8 @@ size_t wl12xx_copy_fwlog(struct wl1271 *wl, u8 *memblock, size_t maxlen); ...@@ -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 */ /* Each RX/TX transaction requires an end-of-transaction transfer */
#define WL12XX_QUIRK_END_OF_TRANSACTION BIT(0) #define WL12XX_QUIRK_END_OF_TRANSACTION BIT(0)
/* WL128X requires aggregated packets to be aligned to the SDIO block size */ /* wl127x and SPI don't support SDIO block size alignment */
#define WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT BIT(2) #define WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT BIT(2)
/* Older firmwares did not implement the FW logger over bus feature */ /* Older firmwares did not implement the FW logger over bus feature */
#define WL12XX_QUIRK_FWLOG_NOT_IMPLEMENTED BIT(4) #define WL12XX_QUIRK_FWLOG_NOT_IMPLEMENTED BIT(4)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册