Skip to content

Commit

Permalink
mac80211: QoS related cleanups
Browse files Browse the repository at this point in the history
This
 * makes the queue number passed to drivers a u16
   (as it will be with skb_get_queue_mapping)
 * removes the useless queue number defines
 * splits hw->queues into hw->queues/ampdu_queues
 * removes the debugfs files for per-queue counters
 * removes some dead QoS code
 * removes the beacon queue configuration for IBSS
   so that the drivers now never get a queue number
   bigger than (hw->queues + hw->ampdu_queues - 1)
   for tx and only in the range 0..hw->queues-1 for
   conf_tx.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 7, 2008
1 parent 36fc675 commit e100bb6
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 240 deletions.
3 changes: 1 addition & 2 deletions drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2996,8 +2996,7 @@ static void b43_qos_update_work(struct work_struct *work)
mutex_unlock(&wl->mutex);
}

static int b43_op_conf_tx(struct ieee80211_hw *hw,
int _queue,
static int b43_op_conf_tx(struct ieee80211_hw *hw, u16 _queue,
const struct ieee80211_tx_queue_params *params)
{
struct b43_wl *wl = hw_to_b43_wl(hw);
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/b43legacy/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2383,8 +2383,7 @@ static int b43legacy_op_tx(struct ieee80211_hw *hw,
return NETDEV_TX_OK;
}

static int b43legacy_op_conf_tx(struct ieee80211_hw *hw,
int queue,
static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ static void iwlcore_init_hw(struct iwl_priv *priv)
hw->queues = 4;
#ifdef CONFIG_IWL4965_HT
/* Enhanced value; more queues, to support 11n aggregation */
hw->queues = 16;
hw->ampdu_queues = 12;
#endif /* CONFIG_IWL4965_HT */
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -7143,7 +7143,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
return rc;
}

static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, int queue,
static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
struct iwl3945_priv *priv = hw->priv;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -6339,7 +6339,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
return ret;
}

static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, int queue,
static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
struct iwl_priv *priv = hw->priv;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/p54/p54common.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ static void p54_configure_filter(struct ieee80211_hw *dev,
}
}

static int p54_conf_tx(struct ieee80211_hw *dev, int queue,
static int p54_conf_tx(struct ieee80211_hw *dev, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
struct p54_common *priv = dev->priv;
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/wireless/rt2x00/rt2400pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,8 +1442,7 @@ static int rt2400pci_set_retry_limit(struct ieee80211_hw *hw,
return 0;
}

static int rt2400pci_conf_tx(struct ieee80211_hw *hw,
int queue,
static int rt2400pci_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
struct rt2x00_dev *rt2x00dev = hw->priv;
Expand All @@ -1453,7 +1452,7 @@ static int rt2400pci_conf_tx(struct ieee80211_hw *hw,
* per queue. So by default we only configure the TX queue,
* and ignore all other configurations.
*/
if (queue != IEEE80211_TX_QUEUE_DATA0)
if (queue != 0)
return -EINVAL;

if (rt2x00mac_conf_tx(hw, queue, params))
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf,
u32 changes);
int rt2x00mac_conf_tx(struct ieee80211_hw *hw, int queue,
int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params);

/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rt2x00/rt2x00mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
}
EXPORT_SYMBOL_GPL(rt2x00mac_bss_info_changed);

int rt2x00mac_conf_tx(struct ieee80211_hw *hw, int queue_idx,
int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue_idx,
const struct ieee80211_tx_queue_params *params)
{
struct rt2x00_dev *rt2x00dev = hw->priv;
Expand Down
7 changes: 2 additions & 5 deletions drivers/net/wireless/rt2x00/rt2x00queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,9 @@ enum data_queue_qid {
static inline enum data_queue_qid mac80211_queue_to_qid(unsigned int queue)
{
/* Regular TX queues are mapped directly */
if (queue < NUM_TX_DATA_QUEUES)
if (queue < 4)
return queue;
else if (queue == IEEE80211_TX_QUEUE_BEACON)
return QID_BEACON;
else if (queue == IEEE80211_TX_QUEUE_AFTER_BEACON)
return QID_ATIM;
WARN_ON(1);
return QID_OTHER;
}

Expand Down
66 changes: 24 additions & 42 deletions include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ struct ieee80211_ht_bss_info {
u8 bss_op_mode; /* use IEEE80211_HT_IE_ */
};

/**
* enum ieee80211_max_queues - maximum number of queues
*
* @IEEE80211_MAX_QUEUES: Maximum number of regular device queues.
* @IEEE80211_MAX_AMPDU_QUEUES: Maximum number of queues usable
* for A-MPDU operation.
*/
enum ieee80211_max_queues {
IEEE80211_MAX_QUEUES = 16,
IEEE80211_MAX_AMPDU_QUEUES = 16,
};

/**
* struct ieee80211_tx_queue_params - transmit queue configuration
*
Expand Down Expand Up @@ -129,42 +141,6 @@ struct ieee80211_tx_queue_stats {
unsigned int count;
};

/**
* enum ieee80211_tx_queue - transmit queue number
*
* These constants are used with some callbacks that take a
* queue number to set parameters for a queue.
*
* @IEEE80211_TX_QUEUE_DATA0: data queue 0
* @IEEE80211_TX_QUEUE_DATA1: data queue 1
* @IEEE80211_TX_QUEUE_DATA2: data queue 2
* @IEEE80211_TX_QUEUE_DATA3: data queue 3
* @IEEE80211_TX_QUEUE_DATA4: data queue 4
* @IEEE80211_TX_QUEUE_SVP: ??
* @NUM_TX_DATA_QUEUES: number of data queues
* @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
* sent after a beacon
* @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
* @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU
*/
enum ieee80211_tx_queue {
IEEE80211_TX_QUEUE_DATA0,
IEEE80211_TX_QUEUE_DATA1,
IEEE80211_TX_QUEUE_DATA2,
IEEE80211_TX_QUEUE_DATA3,
IEEE80211_TX_QUEUE_DATA4,
IEEE80211_TX_QUEUE_SVP,

NUM_TX_DATA_QUEUES,

/* due to stupidity in the sub-ioctl userspace interface, the items in
* this struct need to have fixed values. As soon as it is removed, we can
* fix these entries. */
IEEE80211_TX_QUEUE_AFTER_BEACON = 6,
IEEE80211_TX_QUEUE_BEACON = 7,
NUM_TX_DATA_QUEUES_AMPDU = 16
};

struct ieee80211_low_level_stats {
unsigned int dot11ACKFailureCount;
unsigned int dot11RTSFailureCount;
Expand Down Expand Up @@ -315,7 +291,7 @@ struct ieee80211_tx_control {
* position represents antenna number used */
u8 icv_len; /* length of the ICV/MIC field in octets */
u8 iv_len; /* length of the IV field in octets */
u8 queue; /* hardware queue to use for this frame;
u16 queue; /* hardware queue to use for this frame;
* 0 = highest, hw->queues-1 = lowest */
u16 aid; /* Station AID */
int type; /* internal */
Expand Down Expand Up @@ -772,7 +748,14 @@ enum ieee80211_hw_flags {
* @max_noise: like @max_rssi, but for the noise value.
*
* @queues: number of available hardware transmit queues for
* data packets. WMM/QoS requires at least four.
* data packets. WMM/QoS requires at least four, these
* queues need to have configurable access parameters.
*
* @ampdu_queues: number of available hardware transmit queues
* for A-MPDU packets, these have no access parameters
* because they're used only for A-MPDU frames. Note that
* mac80211 will not currently use any of the regular queues
* for aggregation.
*
* @rate_control_algorithm: rate control algorithm for this hardware.
* If unset (NULL), the default algorithm will be used. Must be
Expand All @@ -791,7 +774,7 @@ struct ieee80211_hw {
unsigned int extra_tx_headroom;
int channel_change_time;
int vif_data_size;
u8 queues;
u16 queues, ampdu_queues;
s8 max_rssi;
s8 max_signal;
s8 max_noise;
Expand Down Expand Up @@ -1069,8 +1052,7 @@ enum ieee80211_ampdu_mlme_action {
* of assocaited station or AP.
*
* @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
* bursting) for a hardware TX queue. The @queue parameter uses the
* %IEEE80211_TX_QUEUE_* constants. Must be atomic.
* bursting) for a hardware TX queue. Must be atomic.
*
* @get_tx_stats: Get statistics of the current TX queue status. This is used
* to get number of currently queued packets (queue length), maximum queue
Expand Down Expand Up @@ -1150,7 +1132,7 @@ struct ieee80211_ops {
u32 short_retry, u32 long_retr);
void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
enum sta_notify_cmd, const u8 *addr);
int (*conf_tx)(struct ieee80211_hw *hw, int queue,
int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params);
int (*get_tx_stats)(struct ieee80211_hw *hw,
struct ieee80211_tx_queue_stats *stats);
Expand Down
43 changes: 0 additions & 43 deletions net/mac80211/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,45 +197,6 @@ DEBUGFS_STATS_FILE(rx_handlers_fragments, 20, "%u",
DEBUGFS_STATS_FILE(tx_status_drop, 20, "%u",
local->tx_status_drop);

static ssize_t stats_wme_rx_queue_read(struct file *file,
char __user *userbuf,
size_t count, loff_t *ppos)
{
struct ieee80211_local *local = file->private_data;
char buf[NUM_RX_DATA_QUEUES*15], *p = buf;
int i;

for (i = 0; i < NUM_RX_DATA_QUEUES; i++)
p += scnprintf(p, sizeof(buf)+buf-p,
"%u\n", local->wme_rx_queue[i]);

return simple_read_from_buffer(userbuf, count, ppos, buf, p-buf);
}

static const struct file_operations stats_wme_rx_queue_ops = {
.read = stats_wme_rx_queue_read,
.open = mac80211_open_file_generic,
};

static ssize_t stats_wme_tx_queue_read(struct file *file,
char __user *userbuf,
size_t count, loff_t *ppos)
{
struct ieee80211_local *local = file->private_data;
char buf[NUM_TX_DATA_QUEUES*15], *p = buf;
int i;

for (i = 0; i < NUM_TX_DATA_QUEUES; i++)
p += scnprintf(p, sizeof(buf)+buf-p,
"%u\n", local->wme_tx_queue[i]);

return simple_read_from_buffer(userbuf, count, ppos, buf, p-buf);
}

static const struct file_operations stats_wme_tx_queue_ops = {
.read = stats_wme_tx_queue_read,
.open = mac80211_open_file_generic,
};
#endif

DEBUGFS_DEVSTATS_FILE(dot11ACKFailureCount);
Expand Down Expand Up @@ -303,8 +264,6 @@ void debugfs_hw_add(struct ieee80211_local *local)
DEBUGFS_STATS_ADD(rx_expand_skb_head2);
DEBUGFS_STATS_ADD(rx_handlers_fragments);
DEBUGFS_STATS_ADD(tx_status_drop);
DEBUGFS_STATS_ADD(wme_tx_queue);
DEBUGFS_STATS_ADD(wme_rx_queue);
#endif
DEBUGFS_STATS_ADD(dot11ACKFailureCount);
DEBUGFS_STATS_ADD(dot11RTSFailureCount);
Expand Down Expand Up @@ -356,8 +315,6 @@ void debugfs_hw_del(struct ieee80211_local *local)
DEBUGFS_STATS_DEL(rx_expand_skb_head2);
DEBUGFS_STATS_DEL(rx_handlers_fragments);
DEBUGFS_STATS_DEL(tx_status_drop);
DEBUGFS_STATS_DEL(wme_tx_queue);
DEBUGFS_STATS_DEL(wme_rx_queue);
#endif
DEBUGFS_STATS_DEL(dot11ACKFailureCount);
DEBUGFS_STATS_DEL(dot11RTSFailureCount);
Expand Down
38 changes: 0 additions & 38 deletions net/mac80211/debugfs_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,36 +123,6 @@ static ssize_t sta_last_seq_ctrl_read(struct file *file, char __user *userbuf,
}
STA_OPS(last_seq_ctrl);

#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
static ssize_t sta_wme_rx_queue_read(struct file *file, char __user *userbuf,
size_t count, loff_t *ppos)
{
char buf[15*NUM_RX_DATA_QUEUES], *p = buf;
int i;
struct sta_info *sta = file->private_data;
for (i = 0; i < NUM_RX_DATA_QUEUES; i++)
p += scnprintf(p, sizeof(buf)+buf-p, "%u ",
sta->wme_rx_queue[i]);
p += scnprintf(p, sizeof(buf)+buf-p, "\n");
return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
}
STA_OPS(wme_rx_queue);

static ssize_t sta_wme_tx_queue_read(struct file *file, char __user *userbuf,
size_t count, loff_t *ppos)
{
char buf[15*NUM_TX_DATA_QUEUES], *p = buf;
int i;
struct sta_info *sta = file->private_data;
for (i = 0; i < NUM_TX_DATA_QUEUES; i++)
p += scnprintf(p, sizeof(buf)+buf-p, "%u ",
sta->wme_tx_queue[i]);
p += scnprintf(p, sizeof(buf)+buf-p, "\n");
return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
}
STA_OPS(wme_tx_queue);
#endif

static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf,
size_t count, loff_t *ppos)
{
Expand Down Expand Up @@ -293,10 +263,6 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
DEBUGFS_ADD(num_ps_buf_frames);
DEBUGFS_ADD(inactive_ms);
DEBUGFS_ADD(last_seq_ctrl);
#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
DEBUGFS_ADD(wme_rx_queue);
DEBUGFS_ADD(wme_tx_queue);
#endif
DEBUGFS_ADD(agg_status);
}

Expand All @@ -306,10 +272,6 @@ void ieee80211_sta_debugfs_remove(struct sta_info *sta)
DEBUGFS_DEL(num_ps_buf_frames);
DEBUGFS_DEL(inactive_ms);
DEBUGFS_DEL(last_seq_ctrl);
#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
DEBUGFS_DEL(wme_rx_queue);
DEBUGFS_DEL(wme_tx_queue);
#endif
DEBUGFS_DEL(agg_status);

debugfs_remove(sta->debugfs.dir);
Expand Down
8 changes: 2 additions & 6 deletions net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ struct ieee80211_local {
struct sta_info *sta_hash[STA_HASH_SIZE];
struct timer_list sta_cleanup;

unsigned long state[NUM_TX_DATA_QUEUES_AMPDU];
struct ieee80211_tx_stored_packet pending_packet[NUM_TX_DATA_QUEUES_AMPDU];
unsigned long state[IEEE80211_MAX_AMPDU_QUEUES + IEEE80211_MAX_AMPDU_QUEUES];
struct ieee80211_tx_stored_packet pending_packet[IEEE80211_MAX_AMPDU_QUEUES + IEEE80211_MAX_AMPDU_QUEUES];
struct tasklet_struct tx_pending_tasklet;

/* number of interfaces with corresponding IFF_ flags */
Expand Down Expand Up @@ -705,8 +705,6 @@ struct ieee80211_local {
unsigned int rx_expand_skb_head2;
unsigned int rx_handlers_fragments;
unsigned int tx_status_drop;
unsigned int wme_rx_queue[NUM_RX_DATA_QUEUES];
unsigned int wme_tx_queue[NUM_RX_DATA_QUEUES];
#define I802_DEBUG_INC(c) (c)++
#else /* CONFIG_MAC80211_DEBUG_COUNTERS */
#define I802_DEBUG_INC(c) do { } while (0)
Expand Down Expand Up @@ -764,8 +762,6 @@ struct ieee80211_local {
struct dentry *rx_expand_skb_head2;
struct dentry *rx_handlers_fragments;
struct dentry *tx_status_drop;
struct dentry *wme_tx_queue;
struct dentry *wme_rx_queue;
#endif
struct dentry *dot11ACKFailureCount;
struct dentry *dot11RTSFailureCount;
Expand Down
5 changes: 5 additions & 0 deletions net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1745,6 +1745,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
goto fail_wep;
}

if (hw->queues > IEEE80211_MAX_QUEUES)
hw->queues = IEEE80211_MAX_QUEUES;
if (hw->ampdu_queues > IEEE80211_MAX_AMPDU_QUEUES)
hw->ampdu_queues = IEEE80211_MAX_AMPDU_QUEUES;

ieee80211_install_qdisc(local->mdev);

/* add one default STA interface */
Expand Down
Loading

0 comments on commit e100bb6

Please sign in to comment.