diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-05-10 07:46:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:47:34 -0400 |
commit | 7050ec821c52826b63835dde54ee3d71c7db4262 (patch) | |
tree | f8154413b4ed1e8ff01b6dbb1c79240dcce83dc8 /drivers/net/wireless/rt2x00/rt61pci.c | |
parent | 4de36fe5abe077a4c65bf0b6a309865aa043e055 (diff) |
rt2x00: Split rt2x00lib_write_tx_desc()
Split rt2x00lib_write_tx_desc() up into a TX descriptor initializor
and TX descriptor writer.
This split is required to properly allow mac80211 to move its
tx_control structure into the skb->cb array.
The rt2x00queue_create_tx_descriptor() function will read all tx control
information and convert it into a rt2x00 TX descriptor information structure.
After that function is complete, we have all information we needed from the
tx control structure and are free to start writing into the skb->cb array
for our own purposes.
rt2x00queue_write_tx_descriptor() will be in charge of really sending
the TX descriptor to the hardware and kicking the TX queue.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt61pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index d8e681ec4bb0..d01d5f16bbce 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2361,18 +2361,27 @@ static u64 rt61pci_get_tsf(struct ieee80211_hw *hw) | |||
2361 | } | 2361 | } |
2362 | 2362 | ||
2363 | static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | 2363 | static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, |
2364 | struct ieee80211_tx_control *control) | 2364 | struct ieee80211_tx_control *control) |
2365 | { | 2365 | { |
2366 | struct rt2x00_dev *rt2x00dev = hw->priv; | 2366 | struct rt2x00_dev *rt2x00dev = hw->priv; |
2367 | struct rt2x00_intf *intf = vif_to_intf(control->vif); | 2367 | struct rt2x00_intf *intf = vif_to_intf(control->vif); |
2368 | struct queue_entry_priv_pci_tx *priv_tx; | 2368 | struct queue_entry_priv_pci_tx *priv_tx; |
2369 | struct skb_frame_desc *skbdesc; | 2369 | struct skb_frame_desc *skbdesc; |
2370 | struct txentry_desc txdesc; | ||
2370 | unsigned int beacon_base; | 2371 | unsigned int beacon_base; |
2371 | u32 reg; | 2372 | u32 reg; |
2372 | 2373 | ||
2373 | if (unlikely(!intf->beacon)) | 2374 | if (unlikely(!intf->beacon)) |
2374 | return -ENOBUFS; | 2375 | return -ENOBUFS; |
2375 | 2376 | ||
2377 | /* | ||
2378 | * Copy all TX descriptor information into txdesc, | ||
2379 | * after that we are free to use the skb->cb array | ||
2380 | * for our information. | ||
2381 | */ | ||
2382 | intf->beacon->skb = skb; | ||
2383 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc, control); | ||
2384 | |||
2376 | priv_tx = intf->beacon->priv_data; | 2385 | priv_tx = intf->beacon->priv_data; |
2377 | memset(priv_tx->desc, 0, intf->beacon->queue->desc_size); | 2386 | memset(priv_tx->desc, 0, intf->beacon->queue->desc_size); |
2378 | 2387 | ||
@@ -2402,7 +2411,7 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2402 | * Write entire beacon with descriptor to register, | 2411 | * Write entire beacon with descriptor to register, |
2403 | * and kick the beacon generator. | 2412 | * and kick the beacon generator. |
2404 | */ | 2413 | */ |
2405 | rt2x00lib_write_tx_desc(rt2x00dev, skb, control); | 2414 | rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc); |
2406 | beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); | 2415 | beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); |
2407 | rt2x00pci_register_multiwrite(rt2x00dev, beacon_base, | 2416 | rt2x00pci_register_multiwrite(rt2x00dev, beacon_base, |
2408 | skbdesc->desc, skbdesc->desc_len); | 2417 | skbdesc->desc, skbdesc->desc_len); |