The iwx Tx ring array is one entry too short due to an off-by-one error.

Fortunately, this bug is harmless. The last Tx agg queue is never used
because ieee80211_classify() only returns TID values in the range 0 - 3.
And iterations over the txq array use nitems() to find the upper bound.

The possiblity of shrinking the txq array by 4 elements to get rid of
unused Tx agg queues could be investigated later.
For now, just fix the off-by-one error.

ok?

diff b19fd44c79660fc69d55de88265e00892505e7ab 
0433237ad58131957ccba3ddd837ed772dbec416
blob - e29148ff81ffa620b806f9244c7ede8f05fb417c
blob + 4f310ad504e6f81a0ee65a11614dc5bd70f79fef
--- sys/dev/pci/if_iwxreg.h
+++ sys/dev/pci/if_iwxreg.h
@@ -1420,6 +1420,7 @@ struct iwx_gen3_bc_tbl {
 #define IWX_MAX_TID_COUNT      8
 #define IWX_FIRST_AGG_TX_QUEUE (IWX_DQA_MGMT_QUEUE + 1)
 #define IWX_LAST_AGG_TX_QUEUE  (IWX_FIRST_AGG_TX_QUEUE + IWX_MAX_TID_COUNT - 1)
+#define IWX_NUM_TX_QUEUES      (IWX_LAST_AGG_TX_QUEUE + 1)
 
 /**
  * Max Tx window size is the max number of contiguous TFDs that the scheduler
blob - 009848fc25471ad90717094d1f67d2f4d22a3d6a
blob + 719d9b6295b9eb9c31b36a98bcb0259a8a2f4cf3
--- sys/dev/pci/if_iwxvar.h
+++ sys/dev/pci/if_iwxvar.h
@@ -497,7 +497,7 @@ struct iwx_softc {
        int sc_msix;
 
        /* TX/RX rings. */
-       struct iwx_tx_ring txq[IWX_LAST_AGG_TX_QUEUE];
+       struct iwx_tx_ring txq[IWX_NUM_TX_QUEUES];
        struct iwx_rx_ring rxq;
        int qfullmsk;
        int qenablemsk;

Reply via email to