aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-01-06 17:41:10 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:26 -0500
commitdd3193e1c25ffbc66b684edb52273ae10695909d (patch)
treeec1594e6a992e924e601495fb04374409a71ee3d
parent3c4f2085e5d82639004406795653e1e4dd6720e0 (diff)
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: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c8
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c8
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c8
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c14
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c12
7 files changed, 27 insertions, 31 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index b042eb551cde..ffc7e208f9b2 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1012,19 +1012,19 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev,
1012 * TX descriptor initialization 1012 * TX descriptor initialization
1013 */ 1013 */
1014static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, 1014static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1015 __le32 *txd, 1015 struct sk_buff *skb,
1016 struct txdata_entry_desc *desc, 1016 struct txdata_entry_desc *desc,
1017 struct ieee80211_hdr *ieee80211hdr,
1018 unsigned int length,
1019 struct ieee80211_tx_control *control) 1017 struct ieee80211_tx_control *control)
1020{ 1018{
1019 struct skb_desc *skbdesc = get_skb_desc(skb);
1020 __le32 *txd = skbdesc->desc;
1021 u32 word; 1021 u32 word;
1022 1022
1023 /* 1023 /*
1024 * Start writing the descriptor words. 1024 * Start writing the descriptor words.
1025 */ 1025 */
1026 rt2x00_desc_read(txd, 2, &word); 1026 rt2x00_desc_read(txd, 2, &word);
1027 rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, length); 1027 rt2x00_set_field32(&word, TXD_W2_DATABYTE_COUNT, skbdesc->data_len);
1028 rt2x00_desc_write(txd, 2, word); 1028 rt2x00_desc_write(txd, 2, word);
1029 1029
1030 rt2x00_desc_read(txd, 3, &word); 1030 rt2x00_desc_read(txd, 3, &word);
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index c92163d2d9ab..81a48e88f2a0 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1162,12 +1162,12 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
1162 * TX descriptor initialization 1162 * TX descriptor initialization
1163 */ 1163 */
1164static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, 1164static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1165 __le32 *txd, 1165 struct sk_buff *skb,
1166 struct txdata_entry_desc *desc, 1166 struct txdata_entry_desc *desc,
1167 struct ieee80211_hdr *ieee80211hdr,
1168 unsigned int length,
1169 struct ieee80211_tx_control *control) 1167 struct ieee80211_tx_control *control)
1170{ 1168{
1169 struct skb_desc *skbdesc = get_skb_desc(skb);
1170 __le32 *txd = skbdesc->desc;
1171 u32 word; 1171 u32 word;
1172 1172
1173 /* 1173 /*
@@ -1208,7 +1208,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1208 rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, 1208 rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
1209 !!(control->flags & 1209 !!(control->flags &
1210 IEEE80211_TXCTL_LONG_RETRY_LIMIT)); 1210 IEEE80211_TXCTL_LONG_RETRY_LIMIT));
1211 rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length); 1211 rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
1212 rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); 1212 rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
1213 rt2x00_desc_write(txd, 0, word); 1213 rt2x00_desc_write(txd, 0, word);
1214} 1214}
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 3dca09d6e319..86eefb453606 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1024,12 +1024,12 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev,
1024 * TX descriptor initialization 1024 * TX descriptor initialization
1025 */ 1025 */
1026static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, 1026static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1027 __le32 *txd, 1027 struct sk_buff *skb,
1028 struct txdata_entry_desc *desc, 1028 struct txdata_entry_desc *desc,
1029 struct ieee80211_hdr *ieee80211hdr,
1030 unsigned int length,
1031 struct ieee80211_tx_control *control) 1029 struct ieee80211_tx_control *control)
1032{ 1030{
1031 struct skb_desc *skbdesc = get_skb_desc(skb);
1032 __le32 *txd = skbdesc->desc;
1033 u32 word; 1033 u32 word;
1034 1034
1035 /* 1035 /*
@@ -1062,7 +1062,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1062 rt2x00_set_field32(&word, TXD_W0_NEW_SEQ, 1062 rt2x00_set_field32(&word, TXD_W0_NEW_SEQ,
1063 !!(control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT)); 1063 !!(control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT));
1064 rt2x00_set_field32(&word, TXD_W0_IFS, desc->ifs); 1064 rt2x00_set_field32(&word, TXD_W0_IFS, desc->ifs);
1065 rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length); 1065 rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
1066 rt2x00_set_field32(&word, TXD_W0_CIPHER, CIPHER_NONE); 1066 rt2x00_set_field32(&word, TXD_W0_CIPHER, CIPHER_NONE);
1067 rt2x00_desc_write(txd, 0, word); 1067 rt2x00_desc_write(txd, 0, word);
1068} 1068}
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index be1fc0aebadc..0cd847c5241e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -488,10 +488,8 @@ struct rt2x00lib_ops {
488 * TX control handlers 488 * TX control handlers
489 */ 489 */
490 void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev, 490 void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev,
491 __le32 *txd, 491 struct sk_buff *skb,
492 struct txdata_entry_desc *desc, 492 struct txdata_entry_desc *desc,
493 struct ieee80211_hdr *ieee80211hdr,
494 unsigned int length,
495 struct ieee80211_tx_control *control); 493 struct ieee80211_tx_control *control);
496 int (*write_tx_data) (struct rt2x00_dev *rt2x00dev, 494 int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
497 struct data_ring *ring, struct sk_buff *skb, 495 struct data_ring *ring, struct sk_buff *skb,
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 911060df8037..a95cf531f083 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -601,7 +601,6 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
601 struct txdata_entry_desc desc; 601 struct txdata_entry_desc desc;
602 struct skb_desc *skbdesc = get_skb_desc(skb); 602 struct skb_desc *skbdesc = get_skb_desc(skb);
603 struct ieee80211_hdr *ieee80211hdr = skbdesc->data; 603 struct ieee80211_hdr *ieee80211hdr = skbdesc->data;
604 __le32 *txd = skbdesc->desc;
605 int tx_rate; 604 int tx_rate;
606 int bitrate; 605 int bitrate;
607 int length; 606 int length;
@@ -729,8 +728,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
729 desc.signal |= 0x08; 728 desc.signal |= 0x08;
730 } 729 }
731 730
732 rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, txd, &desc, ieee80211hdr, 731 rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, skb, &desc, control);
733 skbdesc->data_len, control);
734 732
735 /* 733 /*
736 * Update ring entry. 734 * Update ring entry.
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 5c78c4cf80ae..35e7607cf164 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1533,12 +1533,12 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev,
1533 * TX descriptor initialization 1533 * TX descriptor initialization
1534 */ 1534 */
1535static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, 1535static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1536 __le32 *txd, 1536 struct sk_buff *skb,
1537 struct txdata_entry_desc *desc, 1537 struct txdata_entry_desc *desc,
1538 struct ieee80211_hdr *ieee80211hdr, 1538 struct ieee80211_tx_control *control)
1539 unsigned int length,
1540 struct ieee80211_tx_control *control)
1541{ 1539{
1540 struct skb_desc *skbdesc = get_skb_desc(skb);
1541 __le32 *txd = skbdesc->desc;
1542 u32 word; 1542 u32 word;
1543 1543
1544 /* 1544 /*
@@ -1567,7 +1567,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1567 rt2x00_desc_write(txd, 5, word); 1567 rt2x00_desc_write(txd, 5, word);
1568 1568
1569 rt2x00_desc_read(txd, 11, &word); 1569 rt2x00_desc_read(txd, 11, &word);
1570 rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, length); 1570 rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, skbdesc->data_len);
1571 rt2x00_desc_write(txd, 11, word); 1571 rt2x00_desc_write(txd, 11, word);
1572 1572
1573 rt2x00_desc_read(txd, 0, &word); 1573 rt2x00_desc_read(txd, 0, &word);
@@ -1586,7 +1586,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1586 !!(control->flags & 1586 !!(control->flags &
1587 IEEE80211_TXCTL_LONG_RETRY_LIMIT)); 1587 IEEE80211_TXCTL_LONG_RETRY_LIMIT));
1588 rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0); 1588 rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0);
1589 rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length); 1589 rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
1590 rt2x00_set_field32(&word, TXD_W0_BURST, 1590 rt2x00_set_field32(&word, TXD_W0_BURST,
1591 test_bit(ENTRY_TXD_BURST, &desc->flags)); 1591 test_bit(ENTRY_TXD_BURST, &desc->flags));
1592 rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); 1592 rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index f2d1810fb3fe..29824701e703 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1231,12 +1231,12 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev,
1231 * TX descriptor initialization 1231 * TX descriptor initialization
1232 */ 1232 */
1233static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, 1233static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1234 __le32 *txd, 1234 struct sk_buff *skb,
1235 struct txdata_entry_desc *desc, 1235 struct txdata_entry_desc *desc,
1236 struct ieee80211_hdr *ieee80211hdr, 1236 struct ieee80211_tx_control *control)
1237 unsigned int length,
1238 struct ieee80211_tx_control *control)
1239{ 1237{
1238 struct skb_desc *skbdesc = get_skb_desc(skb);
1239 __le32 *txd = skbdesc->desc;
1240 u32 word; 1240 u32 word;
1241 1241
1242 /* 1242 /*
@@ -1281,7 +1281,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1281 !!(control->flags & 1281 !!(control->flags &
1282 IEEE80211_TXCTL_LONG_RETRY_LIMIT)); 1282 IEEE80211_TXCTL_LONG_RETRY_LIMIT));
1283 rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0); 1283 rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, 0);
1284 rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, length); 1284 rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skbdesc->data_len);
1285 rt2x00_set_field32(&word, TXD_W0_BURST2, 1285 rt2x00_set_field32(&word, TXD_W0_BURST2,
1286 test_bit(ENTRY_TXD_BURST, &desc->flags)); 1286 test_bit(ENTRY_TXD_BURST, &desc->flags));
1287 rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); 1287 rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);