iwlwifi: pcie: don't init a Tx queue with an SSN > size of the queue
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 13 Jul 2017 06:49:32 +0000 (09:49 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 9 Aug 2017 18:14:42 +0000 (21:14 +0300)
commit39fff7599397e1c9fdf54093f1f4c3146066c24b
treee41cdd543ec2821c5b07046df52823ced3719c91
parent732d06e9d9cf96c39cd1c0cd16472930a5583bb7
iwlwifi: pcie: don't init a Tx queue with an SSN > size of the queue

The TVQM tells us the initial write pointer for a queue,
but that write pointer is in WiFi sequence number unit
and not in TFD index unit. Which means that the write
pointer in the TVQM's response can be bigger than the
Tx queue ring size.

Fix that by modulo'ing the write pointer from the TVQM
with the Tx queue size.

Fixes: 66128fa08806 ("iwlwifi: move to TVQM mode")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c