Commit dd3193e1 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by David S. Miller

rt2x00: Cleanup write_tx_desc() arguments

Send the skb structure with write_tx_desc() and use
the skbdesc structure to read all information about
the frame. This saves several arguments in the function
definition and it is easier to send more information
later as well.
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3c4f2085
...@@ -1012,19 +1012,19 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1012,19 +1012,19 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev,
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
__le32 *txd, struct sk_buff *skb,
struct txdata_entry_desc *desc, struct txdata_entry_desc *desc,
struct ieee80211_hdr *ieee80211hdr,
unsigned int length,
struct ieee80211_tx_control *control) struct ieee80211_tx_control *control)
{ {
struct skb_desc *skbdesc = get_skb_desc(skb);
__le32 *txd = skbdesc->desc;
u32 word; u32 word;
/* /*
* Start writing the descriptor words. * Start writing the descriptor words.
*/ */
rt2x00_desc_read(txd, 2, &word); rt2x00_desc_read(txd, 2, &word);
rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, length); rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, skbdesc->data_len);
rt2x00_desc_write(txd, 2, word); rt2x00_desc_write(txd, 2, word);
rt2x00_desc_read(txd, 3, &word); rt2x00_desc_read(txd, 3, &word);
......
...@@ -1162,12 +1162,12 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1162,12 +1162,12 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
__le32 *txd, struct sk_buff *skb,
struct txdata_entry_desc *desc, struct txdata_entry_desc *desc,
struct ieee80211_hdr *ieee80211hdr,
unsigned int length,
struct ieee80211_tx_control *control) struct ieee80211_tx_control *control)
{ {
struct skb_desc *skbdesc = get_skb_desc(skb);
__le32 *txd = skbdesc->desc;
u32 word; u32 word;
/* /*
...@@ -1208,7 +1208,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1208,7 +1208,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
!!(control->flags & !!(control->flags &
IEEE80211_TXCTL_LONG_RETRY_LIMIT)); IEEE80211_TXCTL_LONG_RETRY_LIMIT));
rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length); rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
rt2x00_desc_write(txd, 0, word); rt2x00_desc_write(txd, 0, word);
} }
......
...@@ -1024,12 +1024,12 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1024,12 +1024,12 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev,
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
__le32 *txd, struct sk_buff *skb,
struct txdata_entry_desc *desc, struct txdata_entry_desc *desc,
struct ieee80211_hdr *ieee80211hdr,
unsigned int length,
struct ieee80211_tx_control *control) struct ieee80211_tx_control *control)
{ {
struct skb_desc *skbdesc = get_skb_desc(skb);
__le32 *txd = skbdesc->desc;
u32 word; u32 word;
/* /*
...@@ -1062,7 +1062,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1062,7 +1062,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W0_NEW_SEQ, rt2x00_set_field32(&word, TXD_W0_NEW_SEQ,
!!(control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT)); !!(control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT));
rt2x00_set_field32(&word, TXD_W0_IFS, desc->ifs); rt2x00_set_field32(&word, TXD_W0_IFS, desc->ifs);
rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length); rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
rt2x00_set_field32(&word, TXD_W0_CIPHER, CIPHER_NONE); rt2x00_set_field32(&word, TXD_W0_CIPHER, CIPHER_NONE);
rt2x00_desc_write(txd, 0, word); rt2x00_desc_write(txd, 0, word);
} }
......
...@@ -488,10 +488,8 @@ struct rt2x00lib_ops { ...@@ -488,10 +488,8 @@ struct rt2x00lib_ops {
* TX control handlers * TX control handlers
*/ */
void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev, void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev,
__le32 *txd, struct sk_buff *skb,
struct txdata_entry_desc *desc, struct txdata_entry_desc *desc,
struct ieee80211_hdr *ieee80211hdr,
unsigned int length,
struct ieee80211_tx_control *control); struct ieee80211_tx_control *control);
int (*write_tx_data) (struct rt2x00_dev *rt2x00dev, int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
struct data_ring *ring, struct sk_buff *skb, struct data_ring *ring, struct sk_buff *skb,
......
...@@ -601,7 +601,6 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -601,7 +601,6 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
struct txdata_entry_desc desc; struct txdata_entry_desc desc;
struct skb_desc *skbdesc = get_skb_desc(skb); struct skb_desc *skbdesc = get_skb_desc(skb);
struct ieee80211_hdr *ieee80211hdr = skbdesc->data; struct ieee80211_hdr *ieee80211hdr = skbdesc->data;
__le32 *txd = skbdesc->desc;
int tx_rate; int tx_rate;
int bitrate; int bitrate;
int length; int length;
...@@ -729,8 +728,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -729,8 +728,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
desc.signal |= 0x08; desc.signal |= 0x08;
} }
rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, txd, &desc, ieee80211hdr, rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, skb, &desc, control);
skbdesc->data_len, control);
/* /*
* Update ring entry. * Update ring entry.
......
...@@ -1533,12 +1533,12 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1533,12 +1533,12 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev,
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
__le32 *txd, struct sk_buff *skb,
struct txdata_entry_desc *desc, struct txdata_entry_desc *desc,
struct ieee80211_hdr *ieee80211hdr,
unsigned int length,
struct ieee80211_tx_control *control) struct ieee80211_tx_control *control)
{ {
struct skb_desc *skbdesc = get_skb_desc(skb);
__le32 *txd = skbdesc->desc;
u32 word; u32 word;
/* /*
...@@ -1567,7 +1567,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1567,7 +1567,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_desc_write(txd, 5, word); rt2x00_desc_write(txd, 5, word);
rt2x00_desc_read(txd, 11, &word); rt2x00_desc_read(txd, 11, &word);
rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, length); rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, skbdesc->data_len);
rt2x00_desc_write(txd, 11, word); rt2x00_desc_write(txd, 11, word);
rt2x00_desc_read(txd, 0, &word); rt2x00_desc_read(txd, 0, &word);
...@@ -1586,7 +1586,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1586,7 +1586,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
!!(control->flags & !!(control->flags &
IEEE80211_TXCTL_LONG_RETRY_LIMIT)); IEEE80211_TXCTL_LONG_RETRY_LIMIT));
rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0); rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0);
rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length); rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
rt2x00_set_field32(&word, TXD_W0_BURST, rt2x00_set_field32(&word, TXD_W0_BURST,
test_bit(ENTRY_TXD_BURST, &desc->flags)); test_bit(ENTRY_TXD_BURST, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
......
...@@ -1231,12 +1231,12 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1231,12 +1231,12 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev,
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
__le32 *txd, struct sk_buff *skb,
struct txdata_entry_desc *desc, struct txdata_entry_desc *desc,
struct ieee80211_hdr *ieee80211hdr,
unsigned int length,
struct ieee80211_tx_control *control) struct ieee80211_tx_control *control)
{ {
struct skb_desc *skbdesc = get_skb_desc(skb);
__le32 *txd = skbdesc->desc;
u32 word; u32 word;
/* /*
...@@ -1281,7 +1281,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1281,7 +1281,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
!!(control->flags & !!(control->flags &
IEEE80211_TXCTL_LONG_RETRY_LIMIT)); IEEE80211_TXCTL_LONG_RETRY_LIMIT));
rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0); rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0);
rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length); rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
rt2x00_set_field32(&word, TXD_W0_BURST2, rt2x00_set_field32(&word, TXD_W0_BURST2,
test_bit(ENTRY_TXD_BURST, &desc->flags)); test_bit(ENTRY_TXD_BURST, &desc->flags));
rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment