BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012)
};
+#define TXCTL_CREDITS 2
+
static void pkt_align(struct sk_buff *p, int len, int align)
{
uint datalign;
/* To check if there's window offered */
static bool data_ok(struct brcmf_sdio *bus)
{
- return (u8)(bus->tx_max - bus->tx_seq) != 0 &&
- ((u8)(bus->tx_max - bus->tx_seq) & 0x80) == 0;
+ /* Reserve TXCTL_CREDITS credits for txctl */
+ return (bus->tx_max - bus->tx_seq) > TXCTL_CREDITS &&
+ ((bus->tx_max - bus->tx_seq) & 0x80) == 0;
+}
+
+/* To check if there's window offered */
+static bool txctl_ok(struct brcmf_sdio *bus)
+{
+ return (bus->tx_max - bus->tx_seq) != 0 &&
+ ((bus->tx_max - bus->tx_seq) & 0x80) == 0;
}
static int
brcmf_sdio_clrintr(bus);
if (bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL) &&
- data_ok(bus)) {
+ txctl_ok(bus)) {
sdio_claim_host(bus->sdiodev->func1);
if (bus->ctrl_frame_stat) {
err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf,
bus->ctrl_frame_err = err;
wmb();
bus->ctrl_frame_stat = false;
+ if (err)
+ brcmf_err("sdio ctrlframe tx failed err=%d\n",
+ err);
}
sdio_release_host(bus->sdiodev->func1);
brcmf_sdio_wait_event_wakeup(bus);