@@ -464,6 +464,7 @@ struct mt76_sdio {
struct work_struct stat_work;
struct sdio_func *func;
+ void *intr_data;
struct {
struct mutex lock;
@@ -379,6 +379,14 @@ static int mt7663s_probe(struct sdio_func *func,
(mt76_rr(dev, MT_HW_REV) & 0xff);
dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev);
+ mdev->sdio.intr_data = devm_kmalloc(mdev->dev,
+ sizeof(struct mt76s_intr),
+ GFP_KERNEL);
+ if (!mdev->sdio.intr_data) {
+ ret = -ENOMEM;
+ goto err_deinit;
+ }
+
ret = mt76s_alloc_queues(&dev->mt76);
if (ret)
goto err_deinit;
@@ -221,35 +221,35 @@ void mt7663s_rx_work(struct work_struct *work)
struct mt76_sdio *sdio = container_of(work, struct mt76_sdio,
rx.recv_work);
struct mt76_dev *dev = container_of(sdio, struct mt76_dev, sdio);
- struct mt76s_intr intr;
+ struct mt76s_intr *intr = sdio->intr_data;
int nframes = 0, ret;
/* disable interrupt */
sdio_claim_host(sdio->func);
sdio_writel(sdio->func, WHLPCR_INT_EN_CLR, MCR_WHLPCR, 0);
- sdio_readsb(sdio->func, &intr, MCR_WHISR, sizeof(struct mt76s_intr));
+ sdio_readsb(sdio->func, intr, MCR_WHISR, sizeof(struct mt76s_intr));
sdio_release_host(sdio->func);
- trace_dev_irq(dev, intr.isr, 0);
+ trace_dev_irq(dev, intr->isr, 0);
- if (intr.isr & WHIER_RX0_DONE_INT_EN) {
- ret = mt7663s_rx_run_queue(dev, 0, &intr);
+ if (intr->isr & WHIER_RX0_DONE_INT_EN) {
+ ret = mt7663s_rx_run_queue(dev, 0, intr);
if (ret > 0) {
queue_work(sdio->txrx_wq, &sdio->rx.net_work);
nframes += ret;
}
}
- if (intr.isr & WHIER_RX1_DONE_INT_EN) {
- ret = mt7663s_rx_run_queue(dev, 1, &intr);
+ if (intr->isr & WHIER_RX1_DONE_INT_EN) {
+ ret = mt7663s_rx_run_queue(dev, 1, intr);
if (ret > 0) {
queue_work(sdio->txrx_wq, &sdio->rx.net_work);
nframes += ret;
}
}
- if (intr.isr & WHIER_TX_DONE_INT_EN) {
- mt7663s_refill_sched_quota(dev, intr.tx.wtqcr);
+ if (intr->isr & WHIER_TX_DONE_INT_EN) {
+ mt7663s_refill_sched_quota(dev, intr->tx.wtqcr);
queue_work(sdio->txrx_wq, &sdio->tx.xmit_work);
}