rt2x00: Move code into seperate functions
Some functions have grown rapidly in size over the last time, some of those functions (like the rt2x00queue_create_tx_descriptor) will further increase in size soon, so it is best to start cutting it into logical pieces. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
91581b6272
commit
7b40982e23
@@ -49,9 +49,14 @@ enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key)
|
||||
void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry,
|
||||
struct txentry_desc *txdesc)
|
||||
{
|
||||
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
|
||||
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
|
||||
struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
|
||||
|
||||
if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags) ||
|
||||
!hw_key || entry->skb->do_not_encrypt)
|
||||
return;
|
||||
|
||||
__set_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags);
|
||||
|
||||
txdesc->cipher = rt2x00crypto_key_to_cipher(hw_key);
|
||||
@@ -69,11 +74,17 @@ void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry,
|
||||
__set_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags);
|
||||
}
|
||||
|
||||
unsigned int rt2x00crypto_tx_overhead(struct ieee80211_tx_info *tx_info)
|
||||
unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
|
||||
struct ieee80211_key_conf *key = tx_info->control.hw_key;
|
||||
unsigned int overhead = 0;
|
||||
|
||||
if (!test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags) ||
|
||||
!key || skb->do_not_encrypt)
|
||||
return overhead;
|
||||
|
||||
/*
|
||||
* Extend frame length to include IV/EIV/ICV/MMIC,
|
||||
* note that these lengths should only be added when
|
||||
|
Reference in New Issue
Block a user