staging: brcm80211: move sdtxqlock codes to dhd_sdio.c
Move sdio specific tx queue lock codes to dhd_sdio.c for fullmac
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index dcfebac..48550f3 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -592,6 +592,8 @@
u8 *ctrl_frame_buf;
u32 ctrl_frame_len;
bool ctrl_frame_stat;
+
+ spinlock_t txqlock;
} dhd_bus_t;
typedef volatile struct _sbconfig {
@@ -1370,7 +1372,7 @@
bus->fcqueued++;
/* Priority based enq */
- dhd_os_sdlock_txq(bus->dhd);
+ spin_lock_bh(&bus->txqlock);
if (dhd_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
skb_pull(pkt, SDPCM_HDRLEN);
dhd_txcomplete(bus->dhd, pkt, false);
@@ -1380,7 +1382,7 @@
} else {
ret = 0;
}
- dhd_os_sdunlock_txq(bus->dhd);
+ spin_unlock_bh(&bus->txqlock);
if (pktq_len(&bus->txq) >= TXHI)
dhd_txflowcontrol(bus->dhd, 0, ON);
@@ -1446,13 +1448,13 @@
/* Send frames until the limit or some other event */
for (cnt = 0; (cnt < maxframes) && DATAOK(bus); cnt++) {
- dhd_os_sdlock_txq(bus->dhd);
+ spin_lock_bh(&bus->txqlock);
pkt = brcmu_pktq_mdeq(&bus->txq, tx_prec_map, &prec_out);
if (pkt == NULL) {
- dhd_os_sdunlock_txq(bus->dhd);
+ spin_unlock_bh(&bus->txqlock);
break;
}
- dhd_os_sdunlock_txq(bus->dhd);
+ spin_unlock_bh(&bus->txqlock);
datalen = pkt->len - SDPCM_HDRLEN;
#ifndef SDTEST
@@ -5264,6 +5266,8 @@
goto fail;
}
+ spin_lock_init(&bus->txqlock);
+
/* Attach to the dhd/OS/network interface */
bus->dhd = dhd_attach(bus, SDPCM_RESERVE);
if (!bus->dhd) {