mac80211 & rt2x00 updates
Subsystems (2)
PATCH 1/5 rt2x00: use rate index in TX control
In reply to Ivo van DoornUse the new functions ieee80211_get_tx_rate() andieee80211_get_rts_cts_rate() provided by patch:
mac80211: use rate index in TX control
--- drivers/net/wireless/rt2x00/rt2x00queue.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +6 -3
@@ -33,8 +33,10 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,struct txentry_desc *txdesc, struct ieee80211_tx_control *control) { + struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; -struct ieee80211_rate *rate = control->tx_rate; +struct ieee80211_rate *rate = +ieee80211_get_tx_rate (rt2x00dev->hw, control);const struct rt2x00_rate *hwrate;unsigned int data_length;unsigned int duration;
@@ -77,8 +79,9 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,__set_bit (ENTRY_TXD_CTS_FRAME , &txdesc->flags);__clear_bit (ENTRY_TXD_ACK , &txdesc->flags); } -if (control->rts_cts_rate) - rate = control->rts_cts_rate; +if (control->rts_cts_rate_idx >=0 ) + rate = +ieee80211_get_rts_cts_rate (rt2x00dev->hw, control); }/*
Signature · 1 line
1.5.5.1
cover mac80211 & rt2x00 updates
Hi Johannes,
I have just released rt2x00 2.1.6.
Your mac80211 patches with rt2x00 code changes requires the patches from that release cycle.
This patch series contains rt2x00 updates and fixes for various of your mac80211 patches.
Ivo
PATCH 3/5 rt2x00: use multi-queue master netdevice
Make rt2x00 use the skb mapping functions provided by patch:
mac80211: use multi-queue master netdevice
This also fixes a bug where the ATIM qid to be passed to mac80211 to start the queue again, this would be disallowed by mac80211, but the right queue (Where the skb was mapped to would still be down).
--- drivers/net/wireless/rt2x00/rt2x00mac.c | 10 +++++----- drivers/net/wireless/rt2x00/rt2x00pci.c | 3 ++- drivers/net/wireless/rt2x00/rt2x00queue.h | 13 ------------- drivers/net/wireless/rt2x00/rt2x00usb.c | 3 ++- 4 files changed, 9 insertions(+), 20 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +5 -5
@@ -81,7 +81,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, {struct rt2x00_dev *rt2x00dev = hw->priv;struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data; -enum data_queue_qid qid =mac80211_queue_to_qid (control->queue); +enum data_queue_qid qid =skb_get_queue_mapping (skb);struct data_queue *queue;struct skb_frame_desc *skbdesc;u16 frame_control;
@@ -129,12 +129,12 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, IEEE80211_TXCTL_USE_CTS_PROTECT)) && !rt2x00dev->ops->hw->set_rts_threshold) {if (rt2x00queue_available (queue) <=1 ) { -ieee80211_stop_queue (rt2x00dev->hw, control->queue); +ieee80211_stop_queue (rt2x00dev->hw, qid);return NETDEV_TX_BUSY ; }if (rt2x00mac_tx_rts_cts (rt2x00dev, queue, skb, control)) { -ieee80211_stop_queue (rt2x00dev->hw, control->queue); +ieee80211_stop_queue (rt2x00dev->hw, qid);return NETDEV_TX_BUSY ; } }
@@ -146,12 +146,12 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,memset (skbdesc,0 ,sizeof (*skbdesc));if (rt2x00dev->ops->lib->write_tx_data (rt2x00dev, queue, skb, control)) { -ieee80211_stop_queue (rt2x00dev->hw, control->queue); +ieee80211_stop_queue (rt2x00dev->hw, qid);return NETDEV_TX_BUSY ; }if (rt2x00queue_full (queue)) -ieee80211_stop_queue (rt2x00dev->hw, control->queue); +ieee80211_stop_queue (rt2x00dev->hw, qid);if (rt2x00dev->ops->lib->kick_tx_queue) rt2x00dev->ops->lib->kick_tx_queue (rt2x00dev, qid);
drivers/net/wireless/rt2x00/rt2x00pci.c +2 -1
@@ -164,6 +164,7 @@ void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry, struct txdone_entry_desc *txdesc) {struct queue_entry_priv_pci *entry_priv = entry->priv_data; +enum data_queue_qid qid =skb_get_queue_mapping (entry->skb);u32 word; txdesc->control = &entry_priv->control;
@@ -187,7 +188,7 @@ void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry,* is reenabled when the txdone handler has finished. */ if (!rt2x00queue_full (entry->queue)) -ieee80211_wake_queue (rt2x00dev->hw, entry_priv->control.queue); +ieee80211_wake_queue (rt2x00dev->hw, qid); }EXPORT_SYMBOL_GPL (rt2x00pci_txdone);
drivers/net/wireless/rt2x00/rt2x00queue.h +0 -13
@@ -80,19 +80,6 @@ enum data_queue_qid { };/** -* mac80211_queue_to_qid - Convert mac80211 queue to rt2x00 qid -* @queue: mac80211 queue. -*/ -static inline enum data_queue_qid mac80211_queue_to_qid (unsigned int queue) -{ -/* Regular TX queues are mapped directly */ -if (queue <4 ) -return queue; -WARN_ON (1 ); -return QID_OTHER ; -} - -/** * enum skb_frame_desc_flags: Flags for &struct skb_frame_desc * * @FRAME_DESC_DRIVER_GENERATED: Frame was generated inside driver
drivers/net/wireless/rt2x00/rt2x00usb.c +2 -1
@@ -132,6 +132,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)struct queue_entry_priv_usb *entry_priv = entry->priv_data;struct txdone_entry_desc txdesc;__le32 *txd = (__le32 *)entry->skb->data; +enum data_queue_qid qid =skb_get_queue_mapping (entry->skb);u32 word; if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) ||
@@ -175,7 +176,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)* is reenabled when the txdone handler has finished. */ if (!rt2x00queue_full (entry->queue)) -ieee80211_wake_queue (rt2x00dev->hw, entry_priv->control.queue); +ieee80211_wake_queue (rt2x00dev->hw, qid); } int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
Signature · 1 line
1.5.5.1
PATCH 2/5 mac80211: Initialize sta pointer
In reply to Ivo van Doornpatch: mac80211: rewrite fragmentation code
introduced the following compile warning:
net/mac80211/tx.c: In function 'ieee80211_master_start_xmit':net/mac80211/tx.c:1244: warning: 'sta' may be used uninitialized in this function
sta is allowed to be NULL throughout the rest of the function, so we best initialize it to NULL.
--- net/mac80211/tx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/mac80211/tx.c +1 -1
@@ -1241,7 +1241,7 @@ static bool validate_control(struct ieee80211_local *local,struct ieee80211_sub_if_data *sdata;struct ieee80211_key *key;struct ieee80211_hdr *hdr = (void *)skb->data; -struct sta_info *sta; +struct sta_info *sta =NULL ;u8 *da;list_for_each_entry_rcu (sdata, &local->interfaces, list) {
Signature · 1 line
1.5.5.1
PATCH 4/5 rt2x00: Convert rt2x00 to read control info from skb->cb
In reply to Ivo van DoornConvert rt2x00lib and all drivers to support the mac80211 change to move the tx_control and tx_status information into skb->cb
--- drivers/net/wireless/rt2x00/rt2400pci.c | 14 ++++-- drivers/net/wireless/rt2x00/rt2500pci.c | 14 ++++-- drivers/net/wireless/rt2x00/rt2500usb.c | 15 ++++-- drivers/net/wireless/rt2x00/rt2x00.h | 10 +--- drivers/net/wireless/rt2x00/rt2x00dev.c | 49 +++++++++---------- drivers/net/wireless/rt2x00/rt2x00mac.c | 72 +++++++++++++++-------------- drivers/net/wireless/rt2x00/rt2x00pci.c | 8 +-- drivers/net/wireless/rt2x00/rt2x00pci.h | 6 +-- drivers/net/wireless/rt2x00/rt2x00queue.c | 35 +++++++------- drivers/net/wireless/rt2x00/rt2x00queue.h | 31 +++++++++---- drivers/net/wireless/rt2x00/rt2x00usb.c | 9 +-- drivers/net/wireless/rt2x00/rt2x00usb.h | 9 +--- drivers/net/wireless/rt2x00/rt61pci.c | 14 ++++-- drivers/net/wireless/rt2x00/rt73usb.c | 14 ++++-- 14 files changed, 156 insertions(+), 144 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +9 -5
@@ -1485,11 +1485,11 @@ static u64 rt2400pci_get_tsf(struct ieee80211_hw *hw)return tsf; } -static int rt2400pci_beacon_update (struct ieee80211_hw *hw,struct sk_buff *skb, -struct ieee80211_tx_control *control) +static int rt2400pci_beacon_update (struct ieee80211_hw *hw,struct sk_buff *skb) {struct rt2x00_dev *rt2x00dev = hw->priv; -struct rt2x00_intf *intf =vif_to_intf (control->vif); +struct ieee80211_tx_info *tx_info =get_skb_tx_info (skb); +struct rt2x00_intf *intf =vif_to_intf (tx_info->control.vif);struct queue_entry_priv_pci *entry_priv;struct skb_frame_desc *skbdesc;struct txentry_desc txdesc;
@@ -1505,14 +1505,18 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,* for our information. */ intf->beacon->skb = skb; -rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc, control); +rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc); + +/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ;/* * Fill in skb descriptor */ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ; skbdesc->data = skb->data; skbdesc->data_len = skb->len; skbdesc->desc = entry_priv->desc;
drivers/net/wireless/rt2x00/rt2500pci.c +9 -5
@@ -1799,11 +1799,11 @@ static u64 rt2500pci_get_tsf(struct ieee80211_hw *hw)return tsf; } -static int rt2500pci_beacon_update (struct ieee80211_hw *hw,struct sk_buff *skb, -struct ieee80211_tx_control *control) +static int rt2500pci_beacon_update (struct ieee80211_hw *hw,struct sk_buff *skb) {struct rt2x00_dev *rt2x00dev = hw->priv; -struct rt2x00_intf *intf =vif_to_intf (control->vif); +struct ieee80211_tx_info *tx_info =get_skb_tx_info (skb); +struct rt2x00_intf *intf =vif_to_intf (tx_info->control.vif);struct queue_entry_priv_pci *entry_priv;struct skb_frame_desc *skbdesc;struct txentry_desc txdesc;
@@ -1820,14 +1820,18 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,* for our information. */ intf->beacon->skb = skb; -rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc, control); +rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc); + +/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ;/* * Fill in skb descriptor */ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ; skbdesc->data = skb->data; skbdesc->data_len = skb->len; skbdesc->desc = entry_priv->desc;
drivers/net/wireless/rt2x00/rt2500usb.c +9 -6
@@ -1666,13 +1666,12 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)/* * IEEE80211 stack callback functions. */ -static int rt2500usb_beacon_update (struct ieee80211_hw *hw, -struct sk_buff *skb, -struct ieee80211_tx_control *control) +static int rt2500usb_beacon_update (struct ieee80211_hw *hw,struct sk_buff *skb) {struct rt2x00_dev *rt2x00dev = hw->priv;struct usb_device *usb_dev =rt2x00dev_usb_dev (rt2x00dev); -struct rt2x00_intf *intf =vif_to_intf (control->vif); +struct ieee80211_tx_info *tx_info =get_skb_tx_info (skb); +struct rt2x00_intf *intf =vif_to_intf (tx_info->control.vif);struct queue_entry_priv_usb_bcn *bcn_priv;struct skb_frame_desc *skbdesc;struct txentry_desc txdesc;
@@ -1691,7 +1690,12 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,* for our information. */ intf->beacon->skb = skb; -rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc, control); +rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc); + +/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ;/* * Add the descriptor in front of the skb.
@@ -1704,7 +1708,6 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,*/ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ; skbdesc->data = skb->data + intf->beacon->queue->desc_size; skbdesc->data_len = skb->len - intf->beacon->queue->desc_size; skbdesc->desc = skb->data;
drivers/net/wireless/rt2x00/rt2x00.h +3 -7
@@ -542,8 +542,7 @@ struct rt2x00lib_ops {struct sk_buff *skb, struct txentry_desc *txdesc);int (*write_tx_data) (struct rt2x00_dev *rt2x00dev, -struct data_queue *queue,struct sk_buff *skb, -struct ieee80211_tx_control *control); +struct data_queue *queue,struct sk_buff *skb);int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev,struct sk_buff *skb); void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev,
@@ -930,7 +929,6 @@ static inline u16 get_duration_res(const unsigned int size, const u8 rate)* rt2x00queue_create_tx_descriptor - Create TX descriptor from mac80211 input * @entry: The entry which will be used to transfer the TX frame. * @txdesc: rt2x00 TX descriptor which will be initialized by this function. -* @control: mac80211 TX control structure from where we read the information. * * This function will initialize the &struct txentry_desc based on information * from mac80211. This descriptor can then be used by rt2x00lib and the drivers
@@ -943,8 +941,7 @@ static inline u16 get_duration_res(const unsigned int size, const u8 rate)* the &struct txentry_desc structure. */ void rt2x00queue_create_tx_descriptor (struct queue_entry *entry, -struct txentry_desc *txdesc, -struct ieee80211_tx_control *control); +struct txentry_desc *txdesc);/** * rt2x00queue_write_tx_descriptor - Write TX descriptor to hardware
@@ -1001,8 +998,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry,/* * mac80211 handlers. */ -int rt2x00mac_tx (struct ieee80211_hw *hw,struct sk_buff *skb, -struct ieee80211_tx_control *control); +int rt2x00mac_tx (struct ieee80211_hw *hw,struct sk_buff *skb);int rt2x00mac_start (struct ieee80211_hw *hw);void rt2x00mac_stop (struct ieee80211_hw *hw); int rt2x00mac_add_interface(struct ieee80211_hw *hw,
drivers/net/wireless/rt2x00/rt2x00dev.c +23 -26
87 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00mac.c +38 -34
132 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00pci.c +3 -5
@@ -35,8 +35,7 @@* TX data handlers. */ int rt2x00pci_write_tx_data (struct rt2x00_dev *rt2x00dev, -struct data_queue *queue,struct sk_buff *skb, -struct ieee80211_tx_control *control) +struct data_queue *queue,struct sk_buff *skb) {struct queue_entry *entry =rt2x00queue_get_entry (queue,Q_INDEX );struct queue_entry_priv_pci *entry_priv = entry->priv_data;
@@ -64,19 +63,19 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,* for our information. */ entry->skb = skb; -rt2x00queue_create_tx_descriptor (entry, &txdesc, control); +rt2x00queue_create_tx_descriptor (entry, &txdesc);/* * Fill in skb descriptor */ skbdesc =get_skb_frame_desc (skb); +memset (skbdesc,0 ,sizeof (*skbdesc)); skbdesc->data = skb->data; skbdesc->data_len = skb->len; skbdesc->desc = entry_priv->desc; skbdesc->desc_len = queue->desc_size; skbdesc->entry = entry; -memcpy (&entry_priv->control, control,sizeof (entry_priv->control));memcpy (entry_priv->data, skb->data, skb->len);rt2x00queue_write_tx_descriptor (entry, &txdesc);
@@ -167,7 +166,6 @@ void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry,enum data_queue_qid qid =skb_get_queue_mapping (entry->skb);u32 word; - txdesc->control = &entry_priv->control;rt2x00lib_txdone (entry, txdesc);/*
drivers/net/wireless/rt2x00/rt2x00pci.h +1 -5
@@ -91,8 +91,7 @@ rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev,* TX data handlers. */ int rt2x00pci_write_tx_data (struct rt2x00_dev *rt2x00dev, -struct data_queue *queue,struct sk_buff *skb, -struct ieee80211_tx_control *control); +struct data_queue *queue,struct sk_buff *skb);/** * struct queue_entry_priv_pci: Per entry PCI specific information
@@ -101,7 +100,6 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,* @desc_dma: DMA pointer to &desc. * @data: Pointer to device's entry memory. * @data_dma: DMA pointer to &data. -* @control: mac80211 control structure used to transmit data. */ struct queue_entry_priv_pci {__le32 *desc;
@@ -109,8 +107,6 @@ struct queue_entry_priv_pci {void *data;dma_addr_t data_dma; - -struct ieee80211_tx_control control; };/**
drivers/net/wireless/rt2x00/rt2x00queue.c +17 -18
@@ -30,13 +30,13 @@#include "rt2x00lib.h" void rt2x00queue_create_tx_descriptor (struct queue_entry *entry, -struct txentry_desc *txdesc, -struct ieee80211_tx_control *control) +struct txentry_desc *txdesc) {struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; +struct ieee80211_tx_info *tx_info =get_skb_tx_info (entry->skb);struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data;struct ieee80211_rate *rate = -ieee80211_get_tx_rate (rt2x00dev->hw, control); +ieee80211_get_tx_rate (rt2x00dev->hw, tx_info);const struct rt2x00_rate *hwrate;unsigned int data_length;unsigned int duration;
@@ -64,7 +64,7 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,/* * Check whether this frame is to be acked. */ -if (!(control->flags &IEEE80211_TXCTL_NO_ACK )) +if (!(tx_info->flags &IEEE80211_TX_CTL_NO_ACK ))__set_bit (ENTRY_TXD_ACK , &txdesc->flags);/*
@@ -72,23 +72,20 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,*/ if (is_rts_frame (frame_control) ||is_cts_frame (frame_control)) {__set_bit (ENTRY_TXD_BURST , &txdesc->flags); -if (is_rts_frame (frame_control)) { +if (is_rts_frame (frame_control))__set_bit (ENTRY_TXD_RTS_FRAME , &txdesc->flags); -__set_bit (ENTRY_TXD_ACK , &txdesc->flags); - }else { +else __set_bit (ENTRY_TXD_CTS_FRAME , &txdesc->flags); -__clear_bit (ENTRY_TXD_ACK , &txdesc->flags); - } -if (control->rts_cts_rate_idx >=0 ) +if (tx_info->control.rts_cts_rate_idx >=0 ) rate = -ieee80211_get_rts_cts_rate (rt2x00dev->hw, control); +ieee80211_get_rts_cts_rate (rt2x00dev->hw, tx_info); }/* * Determine retry information. */ - txdesc->retry_limit = control->retry_limit; -if (control->flags &IEEE80211_TXCTL_LONG_RETRY_LIMIT ) + txdesc->retry_limit = tx_info->control.retry_limit; +if (tx_info->flags &IEEE80211_TX_CTL_LONG_RETRY_LIMIT )__set_bit (ENTRY_TXD_RETRY_MODE , &txdesc->flags);/*
@@ -113,7 +110,7 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,*/ if (test_bit (ENTRY_TXD_RTS_FRAME , &txdesc->flags)) { txdesc->ifs =IFS_SIFS ; - }else if (control->flags &IEEE80211_TXCTL_FIRST_FRAGMENT ) { + }else if (tx_info->flags &IEEE80211_TX_CTL_FIRST_FRAGMENT ) {__set_bit (ENTRY_TXD_FIRST_FRAGMENT , &txdesc->flags); txdesc->ifs =IFS_BACKOFF ; }else {
@@ -167,7 +164,7 @@ void rt2x00queue_write_tx_descriptor(struct queue_entry *entry, struct txentry_desc *txdesc) {struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; -struct skb_frame_desc *skbdesc =get_skb_frame_desc (entry->skb); +struct ieee80211_tx_info *tx_info =get_skb_tx_info (entry->skb); rt2x00dev->ops->lib->write_tx_desc (rt2x00dev, entry->skb, txdesc);
@@ -179,11 +176,13 @@ void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,/* * We are done writing the frame to the queue entry, -* if this entry is a RTS of CTS-to-self frame we are done, -* otherwise we need to kick the queue. +* also kick the queue in case the correct flags are set, +* note that this will automatically filter beacons and +* RTS/CTS frames since those frames don't have this flag +* set. */ if (rt2x00dev->ops->lib->kick_tx_queue && - !(skbdesc->flags &FRAME_DESC_DRIVER_GENERATED )) + (tx_info->flags &IEEE80211_TX_CTL_READY_FOR_TX )) rt2x00dev->ops->lib->kick_tx_queue (rt2x00dev, entry->queue->qid); }
drivers/net/wireless/rt2x00/rt2x00queue.h +22 -9
@@ -82,18 +82,19 @@ enum data_queue_qid {/** * enum skb_frame_desc_flags: Flags for &struct skb_frame_desc * -* @FRAME_DESC_DRIVER_GENERATED: Frame was generated inside driver -* and should not be reported back to mac80211 during txdone. +* No flags at this time */ +/* enum skb_frame_desc_flags { -FRAME_DESC_DRIVER_GENERATED =1 <<0 , +}; +*/ /** * struct skb_frame_desc: Descriptor information for the skb buffer * -* This structure is placed over the skb->cb array, this means that -* this structure should not exceed the size of that array (48 bytes). +* This structure is placed over the driver_data array, this means that +* this structure should not exceed the size of that array (40 bytes). * * @flags: Frame flags, see &enum skb_frame_desc_flags. * @data: Pointer to data part of frame (Start of ieee80211 header).
@@ -116,10 +117,24 @@ struct skb_frame_desc {struct queue_entry *entry; }; +/** +* get_skb_tx_info - Obtain the mac80211 TX info from a sk_buff. +* @skb: &struct sk_buff from where we obtain the &struct ieee80211_tx_info +*/ +static inline struct ieee80211_tx_info *get_skb_tx_info (struct sk_buff *skb) +{ +return (struct ieee80211_tx_info *)skb->cb; +} + +/** +* get_skb_frame_desc - Obtain the rt2x00 frame descriptor from a sk_buff. +* @skb: &struct sk_buff from where we obtain the &struct skb_frame_desc +*/ static inline struct skb_frame_desc *get_skb_frame_desc (struct sk_buff *skb) { -BUILD_BUG_ON (sizeof (struct skb_frame_desc ) >sizeof (skb->cb)); -return (struct skb_frame_desc *)&skb->cb[0 ]; +BUILD_BUG_ON (sizeof (struct skb_frame_desc ) > +IEEE80211_TX_INFO_DRIVER_DATA_SIZE ); +return (struct skb_frame_desc *)&get_skb_tx_info (skb)->driver_data; }/**
@@ -176,12 +191,10 @@ enum txdone_entry_desc_flags {* Summary of information that has been read from the TX frame descriptor * after the device is done with transmission. * -* @control: Control structure which was used to transmit the frame. * @flags: TX done flags (See &enum txdone_entry_desc_flags). * @retry: Retry count. */ struct txdone_entry_desc { -struct ieee80211_tx_control *control;unsigned long flags;int retry; };
drivers/net/wireless/rt2x00/rt2x00usb.c +3 -6
@@ -129,7 +129,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) {struct queue_entry *entry = (struct queue_entry *)urb->context;struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; -struct queue_entry_priv_usb *entry_priv = entry->priv_data;struct txdone_entry_desc txdesc;__le32 *txd = (__le32 *)entry->skb->data;enum data_queue_qid qid =skb_get_queue_mapping (entry->skb);
@@ -160,7 +159,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)else __set_bit (TXDONE_FAILURE , &txdesc.flags); txdesc.retry =0 ; - txdesc.control = &entry_priv->control;rt2x00lib_txdone (entry, &txdesc);
@@ -180,8 +178,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) }int rt2x00usb_write_tx_data (struct rt2x00_dev *rt2x00dev, -struct data_queue *queue,struct sk_buff *skb, -struct ieee80211_tx_control *control) +struct data_queue *queue,struct sk_buff *skb) {struct usb_device *usb_dev =rt2x00dev_usb_dev (rt2x00dev);struct queue_entry *entry =rt2x00queue_get_entry (queue,Q_INDEX );
@@ -207,7 +204,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,* for our information. */ entry->skb = skb; -rt2x00queue_create_tx_descriptor (entry, &txdesc, control); +rt2x00queue_create_tx_descriptor (entry, &txdesc);/* * Add the descriptor in front of the skb.
@@ -219,13 +216,13 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,* Fill in skb descriptor */ skbdesc =get_skb_frame_desc (skb); +memset (skbdesc,0 ,sizeof (*skbdesc)); skbdesc->data = skb->data + queue->desc_size; skbdesc->data_len = skb->len - queue->desc_size; skbdesc->desc = skb->data; skbdesc->desc_len = queue->desc_size; skbdesc->entry = entry; -memcpy (&entry_priv->control, control,sizeof (entry_priv->control));rt2x00queue_write_tx_descriptor (entry, &txdesc);/*
drivers/net/wireless/rt2x00/rt2x00usb.h +1 -8
@@ -216,19 +216,15 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev);* TX data handlers. */ int rt2x00usb_write_tx_data (struct rt2x00_dev *rt2x00dev, -struct data_queue *queue,struct sk_buff *skb, -struct ieee80211_tx_control *control); +struct data_queue *queue,struct sk_buff *skb);/** * struct queue_entry_priv_usb: Per entry USB specific information * * @urb: Urb structure used for device communication. -* @control: mac80211 control structure used to transmit data. */ struct queue_entry_priv_usb {struct urb *urb; - -struct ieee80211_tx_control control; };/**
@@ -239,15 +235,12 @@ struct queue_entry_priv_usb {* with beacons. * * @urb: Urb structure used for device communication. -* @control: mac80211 control structure used to transmit data. * @guardian_data: Set to 0, used for sending the guardian data. * @guardian_urb: Urb structure used to send the guardian data. */ struct queue_entry_priv_usb_bcn {struct urb *urb; -struct ieee80211_tx_control control; -unsigned int guardian_data;struct urb *guardian_urb; };
drivers/net/wireless/rt2x00/rt61pci.c +9 -5
@@ -2358,11 +2358,11 @@ static u64 rt61pci_get_tsf(struct ieee80211_hw *hw)return tsf; } -static int rt61pci_beacon_update (struct ieee80211_hw *hw,struct sk_buff *skb, -struct ieee80211_tx_control *control) +static int rt61pci_beacon_update (struct ieee80211_hw *hw,struct sk_buff *skb) {struct rt2x00_dev *rt2x00dev = hw->priv; -struct rt2x00_intf *intf =vif_to_intf (control->vif); +struct ieee80211_tx_info *tx_info =get_skb_tx_info (skb); +struct rt2x00_intf *intf =vif_to_intf (tx_info->control.vif);struct queue_entry_priv_pci *entry_priv;struct skb_frame_desc *skbdesc;struct txentry_desc txdesc;
@@ -2378,7 +2378,12 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,* for our information. */ intf->beacon->skb = skb; -rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc, control); +rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc); + +/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ; entry_priv = intf->beacon->priv_data;memset (entry_priv->desc,0 , intf->beacon->queue->desc_size);
@@ -2388,7 +2393,6 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,*/ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ; skbdesc->data = skb->data; skbdesc->data_len = skb->len; skbdesc->desc = entry_priv->desc;
drivers/net/wireless/rt2x00/rt73usb.c +9 -5
@@ -1949,11 +1949,11 @@ static u64 rt73usb_get_tsf(struct ieee80211_hw *hw)#define rt73usb_get_tsf NULL#endif -static int rt73usb_beacon_update (struct ieee80211_hw *hw,struct sk_buff *skb, -struct ieee80211_tx_control *control) +static int rt73usb_beacon_update (struct ieee80211_hw *hw,struct sk_buff *skb) {struct rt2x00_dev *rt2x00dev = hw->priv; -struct rt2x00_intf *intf =vif_to_intf (control->vif); +struct ieee80211_tx_info *tx_info =get_skb_tx_info (skb); +struct rt2x00_intf *intf =vif_to_intf (tx_info->control.vif);struct skb_frame_desc *skbdesc;struct txentry_desc txdesc;unsigned int beacon_base;
@@ -1968,7 +1968,12 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,* for our information. */ intf->beacon->skb = skb; -rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc, control); +rt2x00queue_create_tx_descriptor (intf->beacon, &txdesc); + +/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ;/* * Add the descriptor in front of the skb.
@@ -1981,7 +1986,6 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,*/ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ; skbdesc->data = skb->data + intf->beacon->queue->desc_size; skbdesc->data_len = skb->len - intf->beacon->queue->desc_size; skbdesc->desc = skb->data;
Signature · 1 line
1.5.5.1
PATCH 5/5 mac80211: Match define names in comments with actual defines
In reply to Ivo van DoornThe defines introduced in patch:
mac80211: tx-info skb->cb
did not match the names wich were mentioned in the comment above the defines.
--- include/net/mac80211.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
include/net/mac80211.h +3 -3
@@ -235,10 +235,10 @@ struct ieee80211_bss_conf {* is handed to a driver. * @IEEE80211_TX_CTL_INJECTED: Frame was injected (NOT for driver use!) * -* @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted +* @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted * because the destination STA was in powersave mode. -* @IEEE80211_TX_STATUS_ACK: Frame was acknowledged -* @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status +* @IEEE80211_TX_STAT_ACK: Frame was acknowledged +* @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status * is for the whole aggregation. */ enum mac80211_tx_control_flags {
Signature · 1 line
1.5.5.1
Johannes Berg
maintainerRe: [PATCH 5/5] mac80211: Match define names in comments with actual defines
Quoted 4 lines · Ivo van Doorn
The defines introduced in patch:
mac80211: tx-info skb->cbdid not match the names wich were mentioned in the comment above the defines.
Thanks, I'll roll this into my patch.
johannes
Johannes Berg
maintainerRe: [PATCH 2/5] mac80211: Initialize sta pointer
In reply to Ivo van DoornQuoted 8 lines · Ivo van Doorn
patch: mac80211: rewrite fragmentation code
introduced the following compile warning:
net/mac80211/tx.c: In function 'ieee80211_master_start_xmit':net/mac80211/tx.c:1244: warning: 'sta' may be used uninitialized in this functionsta is allowed to be NULL throughout the rest of the function, so we best initialize it to NULL.
Thanks. Not sure what's wrong with my compiler :) I'm still working on this patch and it probably won't go into the tree in it's current form since Herbert Xu had reservations.
johannes
Johannes Berg
maintainerRe: [PATCH 4/5] rt2x00: Convert rt2x00 to read control info from skb->cb
In reply to Ivo van Doorndrivers/net/wireless/rt2x00/rt2400pci.c static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, · line 1515
Quoted 12 lines
drivers/net/wireless/rt2x00/rt2400pci.c +4
-1+/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ;/* * Fill in skb descriptor */ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ;
Could you live w/o that change? I'm pondering removing that flag again since it doesn't have any meaning any more with the fragmentation/busy reschedule rewrite I'll do.
johannes
Re: [PATCH 4/5] rt2x00: Convert rt2x00 to read control info from skb->cb
Quoted 6 lines · Johannes Berg
Quoted 6 lines
drivers/net/wireless/rt2x00/rt2400pci.c +4
-0+/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ;
Quoted 10 lines
drivers/net/wireless/rt2x00/rt2400pci.c static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, · line 1515
Quoted 6 lines
drivers/net/wireless/rt2x00/rt2400pci.c +0
-1/* * Fill in skb descriptor */ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ;Could you live w/o that change? I'm pondering removing that flag again since it doesn't have any meaning any more with the fragmentation/busy reschedule rewrite I'll do.
Not a problem, I had already removed a few instances where I used that, and will remove the remaining bits as well.
Ivo
Re: [PATCH 4/5] rt2x00: Convert rt2x00 to read control info from skb->cb
Quoted 18 lines · Ivo van Doorn
Quoted 6 lines · Johannes Berg
Quoted 6 lines
drivers/net/wireless/rt2x00/rt2400pci.c +4
-0+/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ;Quoted 10 lines
drivers/net/wireless/rt2x00/rt2400pci.c static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, · line 1515
Quoted 6 lines
drivers/net/wireless/rt2x00/rt2400pci.c +0
-1/* * Fill in skb descriptor */ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ;Could you live w/o that change? I'm pondering removing that flag again since it doesn't have any meaning any more with the fragmentation/busy reschedule rewrite I'll do.
Quoted 2 lines
Not a problem, I had already removed a few instances where I used that, and will remove the remaining bits as well.
Hmm, things could be much easier for rt2x00 if there was a mac80211 flag that would indicate if the tx_status should be called or not upon txdone.
I used the IEEE80211_TX_CTL_READY_FOR_TX to make sure RTS and CTS frames were not reported to mac80211 when they were send, but would it perhaps be better if I used the flag IEEE80211_TX_CTL_REQ_TX_STATUS for that? I remember that some time ago drivers weren't supposed to check for that flag, or at least not to determine if the tx_status should be called, but has this changed and can the flag be used or should rt2x00 keep track of what should be reported and what not?
Ivo
Johannes Berg
maintainerRe: [PATCH 4/5] rt2x00: Convert rt2x00 to read control info from skb->cb
Quoted 25 lines · Ivo van Doorn
Quoted 18 lines · Ivo van Doorn
Quoted 6 lines · Johannes Berg
Quoted 6 lines
drivers/net/wireless/rt2x00/rt2400pci.c +4
-0+/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ;Quoted 10 lines
drivers/net/wireless/rt2x00/rt2400pci.c static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, · line 1515
Quoted 6 lines
drivers/net/wireless/rt2x00/rt2400pci.c +0
-1/* * Fill in skb descriptor */ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ;Could you live w/o that change? I'm pondering removing that flag again since it doesn't have any meaning any more with the fragmentation/busy reschedule rewrite I'll do.
Quoted 2 lines
Not a problem, I had already removed a few instances where I used that, and will remove the remaining bits as well.
Hmm, things could be much easier for rt2x00 if there was a mac80211 flag that would indicate if the
tx_statusshould be called or not upon txdone.
Quoted 7 lines
I used the
IEEE80211_TX_CTL_READY_FOR_TXto make sure RTS and CTS frames were not reported to mac80211 when they were send, but would it perhaps be better if I used the flagIEEE80211_TX_CTL_REQ_TX_STATUSfor that? I remember that some time ago drivers weren't supposed to check for that flag, or at least not to determine if thetx_statusshould be called, but has this changed and can the flag be used or should rt2x00 keep track of what should be reported and what not?
Yes, it probably would be better, but we haven't figured out useful settings for that flag yet. I'm fine with unconditionally adding it to all frames for now though.
johannes
Re: [PATCH 4/5] rt2x00: Convert rt2x00 to read control info from skb->cb
Quoted 34 lines · Johannes Berg
Quoted 25 lines · Ivo van Doorn
Quoted 18 lines · Ivo van Doorn
Quoted 6 lines · Johannes Berg
Quoted 6 lines
drivers/net/wireless/rt2x00/rt2400pci.c +4
-0+/* +* Don't automatically kick the beacon queue. +*/ + tx_info->flags &= ~IEEE80211_TX_CTL_READY_FOR_TX ;Quoted 10 lines
drivers/net/wireless/rt2x00/rt2400pci.c static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, · line 1515
Quoted 6 lines
drivers/net/wireless/rt2x00/rt2400pci.c +0
-1/* * Fill in skb descriptor */ skbdesc =get_skb_frame_desc (skb);memset (skbdesc,0 ,sizeof (*skbdesc)); - skbdesc->flags |=FRAME_DESC_DRIVER_GENERATED ;Could you live w/o that change? I'm pondering removing that flag again since it doesn't have any meaning any more with the fragmentation/busy reschedule rewrite I'll do.
Quoted 2 lines
Not a problem, I had already removed a few instances where I used that, and will remove the remaining bits as well.
Hmm, things could be much easier for rt2x00 if there was a mac80211 flag that would indicate if the
tx_statusshould be called or not upon txdone.Quoted 7 lines
I used the
IEEE80211_TX_CTL_READY_FOR_TXto make sure RTS and CTS frames were not reported to mac80211 when they were send, but would it perhaps be better if I used the flagIEEE80211_TX_CTL_REQ_TX_STATUSfor that? I remember that some time ago drivers weren't supposed to check for that flag, or at least not to determine if thetx_statusshould be called, but has this changed and can the flag be used or should rt2x00 keep track of what should be reported and what not?
Quoted 3 lines
Yes, it probably would be better, but we haven't figured out useful settings for that flag yet. I'm fine with unconditionally adding it to all frames for now though.
Excellent, I'll prepare a patch that will always set the IEEE80211_TX_CTL_REQ_TX_STATUS flag in mac80211 then. :)
Ivo