aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <IvDoorn@gmail.com>2008-01-24 04:56:25 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:07 -0500
commit08992f7fb139c7dbaf593402312ee5a055352f05 (patch)
treecfa1459e4940cf493438a3db950b5339dae4ca88 /drivers/net/wireless/rt2x00/rt2500usb.c
parent22c96c28b47ce74d78aad1afbed88b26f43ce24b (diff)
rt2x00: Add skb descriptor
Use the skb->cb field to add a frame description that can be used to transfer information passed each rt2x00 layer. This reduces the required arguments for rt2x00lib_write_tx_desc(). Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 15ab4b20d067..2a38388a79e1 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1686,8 +1686,8 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
1686 struct rt2x00_dev *rt2x00dev = hw->priv; 1686 struct rt2x00_dev *rt2x00dev = hw->priv;
1687 struct usb_device *usb_dev = 1687 struct usb_device *usb_dev =
1688 interface_to_usbdev(rt2x00dev_usb(rt2x00dev)); 1688 interface_to_usbdev(rt2x00dev_usb(rt2x00dev));
1689 struct data_ring *ring = 1689 struct skb_desc *desc;
1690 rt2x00lib_get_ring(rt2x00dev, IEEE80211_TX_QUEUE_BEACON); 1690 struct data_ring *ring;
1691 struct data_entry *beacon; 1691 struct data_entry *beacon;
1692 struct data_entry *guardian; 1692 struct data_entry *guardian;
1693 int pipe = usb_sndbulkpipe(usb_dev, 1); 1693 int pipe = usb_sndbulkpipe(usb_dev, 1);
@@ -1699,6 +1699,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
1699 * initialization. 1699 * initialization.
1700 */ 1700 */
1701 control->queue = IEEE80211_TX_QUEUE_BEACON; 1701 control->queue = IEEE80211_TX_QUEUE_BEACON;
1702 ring = rt2x00lib_get_ring(rt2x00dev, control->queue);
1702 1703
1703 /* 1704 /*
1704 * Obtain 2 entries, one for the guardian byte, 1705 * Obtain 2 entries, one for the guardian byte,
@@ -1709,23 +1710,34 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
1709 beacon = rt2x00_get_data_entry(ring); 1710 beacon = rt2x00_get_data_entry(ring);
1710 1711
1711 /* 1712 /*
1712 * First we create the beacon. 1713 * Add the descriptor in front of the skb.
1713 */ 1714 */
1714 skb_push(skb, ring->desc_size); 1715 skb_push(skb, ring->desc_size);
1715 memset(skb->data, 0, ring->desc_size); 1716 memset(skb->data, 0, ring->desc_size);
1716 1717
1717 rt2x00lib_write_tx_desc(rt2x00dev, (__le32 *)skb->data, 1718 /*
1718 (struct ieee80211_hdr *)(skb->data + 1719 * Fill in skb descriptor
1719 ring->desc_size), 1720 */
1720 skb->len - ring->desc_size, control); 1721 desc = get_skb_desc(skb);
1722 desc->desc_len = ring->desc_size;
1723 desc->data_len = skb->len - ring->desc_size;
1724 desc->desc = skb->data;
1725 desc->data = skb->data + ring->desc_size;
1726 desc->ring = ring;
1727 desc->entry = beacon;
1728
1729 rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
1721 1730
1731 /*
1732 * USB devices cannot blindly pass the skb->len as the
1733 * length of the data to usb_fill_bulk_urb. Pass the skb
1734 * to the driver to determine what the length should be.
1735 */
1722 length = rt2500usb_get_tx_data_len(rt2x00dev, skb); 1736 length = rt2500usb_get_tx_data_len(rt2x00dev, skb);
1723 1737
1724 usb_fill_bulk_urb(beacon->priv, usb_dev, pipe, 1738 usb_fill_bulk_urb(beacon->priv, usb_dev, pipe,
1725 skb->data, length, rt2500usb_beacondone, beacon); 1739 skb->data, length, rt2500usb_beacondone, beacon);
1726 1740
1727 beacon->skb = skb;
1728
1729 /* 1741 /*
1730 * Second we need to create the guardian byte. 1742 * Second we need to create the guardian byte.
1731 * We only need a single byte, so lets recycle 1743 * We only need a single byte, so lets recycle