mt76: mt7615: introduce mt7615_txwi_to_txp utility routine

Introduce mt7615_txwi_to_txp utility routine to convert mt76_txwi_cache
into mt7615_txp and remove duplicated code

Signed-off-by: Lorenzo Bianconi <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2019-09-05 17:51:19 +02:00
committed by Felix Fietkau
parent 496c78e4f0
commit 67973788f4
2 changed files with 15 additions and 6 deletions
+13
View File
@@ -317,4 +317,17 @@ enum mt7615_cipher_type {
MT_CIPHER_GCMP_256,
};
static inline struct mt7615_txp *
mt7615_txwi_to_txp(struct mt76_dev *dev, struct mt76_txwi_cache *t)
{
u8 *txwi;
if (!t)
return NULL;
txwi = mt76_get_txwi_ptr(dev, t);
return (struct mt7615_txp *)(txwi + MT_TXD_SIZE);
}
#endif