static int wil6210_netdev_poll_tx(struct napi_struct *napi, int budget) { struct wil6210_priv *wil = container_of(napi, struct wil6210_priv, napi_tx); int tx_done = 0; uint i; /* always process ALL Tx complete, regardless budget - it is fast */ for (i = 0; i < WIL6210_MAX_TX_RINGS; i++) { struct vring *vring = &wil->vring_tx[i]; struct vring_tx_data *txdata = &wil->vring_tx_data[i]; if (!vring->va || !txdata->enabled) continue; tx_done += wil_tx_complete(wil, i); } if (tx_done < budget) { napi_complete(napi); wil6210_unmask_irq_tx(wil); wil_dbg_txrx(wil, "NAPI TX complete\n"); } wil_dbg_txrx(wil, "NAPI TX poll(%d) done %d\n", budget, tx_done); return min(tx_done, budget); }
static int wil_set_features(struct net_device *netdev, netdev_features_t features) { struct wil6210_priv *wil = ndev_to_wil(netdev); netdev_features_t changed = features ^ netdev->features; wil_info(wil, "wil_set_features: %x\n", (unsigned int)features); if (changed & NETIF_F_HW_CSUM) wil_dbg_txrx(wil, "Tx checksum offloading changed\n"); else if (changed & NETIF_F_RXCSUM) wil_dbg_txrx(wil, "Rx checksum offloading changed\n"); return 0; }
static int wil6210_netdev_poll_rx(struct napi_struct *napi, int budget) { struct wil6210_priv *wil = container_of(napi, struct wil6210_priv, napi_rx); int quota = budget; int done; wil_rx_handle(wil, "a); done = budget - quota; if (done < budget) { napi_complete(napi); wil6210_unmask_irq_rx(wil); wil_dbg_txrx(wil, "NAPI RX complete\n"); } wil_dbg_txrx(wil, "NAPI RX poll(%d) done %d\n", budget, done); return done; }