@@ -1716,6 +1716,9 @@ int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,
for (i = 0; i < NQUEUES; i++)
skb_queue_head_init(&wl->txq[i]);
+ skb_queue_head_init(&wl->chipq);
+ wl->chipq_bytes = 0;
+
INIT_LIST_HEAD(&wl->rxq_head.list);
INIT_LIST_HEAD(&wl->vif_list);
@@ -261,6 +261,24 @@ struct wilc {
struct wilc_tx_queue_status tx_q_limit;
struct rxq_entry_t rxq_head;
+ /* The chip queue contains sk_buffs that are ready to be
+ * transferred to the wilc1000 chip. In particular, they
+ * already have the VMM and Ethernet headers (for net packets)
+ * and they are padded to a size that is an integer-multiple
+ * of 4 bytes.
+ *
+ * This queue is usually empty on return from
+ * wilc_wlan_handle_txq(). However, when the chip does fill
+ * up, the packets that didn't fit will be held until there is
+ * space again.
+ *
+ * This queue is only accessed by the txq handler thread, so
+ * no locking is required.
+ */
+ struct sk_buff_head chipq;
+ /* Total number of bytes queued on the chipq: */
+ int chipq_bytes;
+
const struct firmware *firmware;
struct device *dev;
@@ -1263,6 +1263,11 @@ void wilc_wlan_cleanup(struct net_device *dev)
struct wilc *wilc = vif->wilc;
wilc->quit = 1;
+
+ while ((tqe = __skb_dequeue(&wilc->chipq)))
+ wilc_wlan_tx_packet_done(tqe, 0);
+ wilc->chipq_bytes = 0;
+
for (ac = 0; ac < NQUEUES; ac++) {
while ((tqe = skb_dequeue(&wilc->txq[ac])))
wilc_wlan_tx_packet_done(tqe, 0);
This introduces a chip queue that will hold packets ready to be transferred to the chip. A later patch will start using it. Signed-off-by: David Mosberger-Tang <davidm@egauge.net> --- .../net/wireless/microchip/wilc1000/cfg80211.c | 3 +++ .../net/wireless/microchip/wilc1000/netdev.h | 18 ++++++++++++++++++ drivers/net/wireless/microchip/wilc1000/wlan.c | 5 +++++ 3 files changed, 26 insertions(+)