Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102775
b: refs/heads/master
c: e253008
h: refs/heads/master
i:
  102773: 57a829f
  102771: f7e4a83
  102767: 157d24b
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 22, 2008
1 parent 3658733 commit 33592f7
Show file tree
Hide file tree
Showing 22 changed files with 159 additions and 133 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eefce91a384a64c7bbf913eb08c4adfb911c3639
refs/heads/master: e2530083609148a7835b54c431f6b8956407c1f6
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
if (list_empty(&sc->txbuf)) {
ATH5K_ERR(sc, "no further txbuf available, dropping packet\n");
spin_unlock_irqrestore(&sc->txbuflock, flags);
ieee80211_stop_queue(hw, info->queue);
ieee80211_stop_queue(hw, skb_get_queue_mapping(skb));
return -1;
}
bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list);
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/net/wireless/b43/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,8 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA);
} else {
/* Decide by priority where to put this frame. */
ring = select_ring_by_priority(dev, info->queue);
ring = select_ring_by_priority(
dev, skb_get_queue_mapping(skb));
}

spin_lock_irqsave(&ring->lock, flags);
Expand All @@ -1315,7 +1316,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
/* Assign the queue number to the ring (if not already done before)
* so TX status handling can use it. The queue to ring mapping is
* static, so we don't need to store it per frame. */
ring->queue_prio = info->queue;
ring->queue_prio = skb_get_queue_mapping(skb);

err = dma_tx_fragment(ring, skb);
if (unlikely(err == -ENOKEY)) {
Expand All @@ -1333,7 +1334,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
if ((free_slots(ring) < SLOTS_PER_PACKET) ||
should_inject_overflow(ring)) {
/* This TX ring is full. */
ieee80211_stop_queue(dev->wl->hw, info->queue);
ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb));
ring->stopped = 1;
if (b43_debug(dev, B43_DBG_DMAVERBOSE)) {
b43dbg(dev->wl, "Stopped TX ring %d\n", ring->index);
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/b43/pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)
hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA);
} else {
/* Decide by priority where to put this frame. */
q = select_queue_by_priority(dev, info->queue);
q = select_queue_by_priority(dev, skb_get_queue_mapping(skb));
}

spin_lock_irqsave(&q->lock, flags);
Expand All @@ -532,15 +532,15 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)
if (total_len > (q->buffer_size - q->buffer_used)) {
/* Not enough memory on the queue. */
err = -EBUSY;
ieee80211_stop_queue(dev->wl->hw, info->queue);
ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb));
q->stopped = 1;
goto out_unlock;
}

/* Assign the queue number to the ring (if not already done before)
* so TX status handling can use it. The mac80211-queue to b43-queue
* mapping is static, so we don't need to store it per frame. */
q->queue_prio = info->queue;
q->queue_prio = skb_get_queue_mapping(skb);

err = pio_tx_frame(q, skb);
if (unlikely(err == -ENOKEY)) {
Expand All @@ -560,7 +560,7 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)
if (((q->buffer_size - q->buffer_used) < roundup(2 + 2 + 6, 4)) ||
(q->free_packet_slots == 0)) {
/* The queue is full. */
ieee80211_stop_queue(dev->wl->hw, info->queue);
ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb));
q->stopped = 1;
}

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/b43legacy/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,11 +1325,10 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev,
struct sk_buff *skb)
{
struct b43legacy_dmaring *ring;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
int err = 0;
unsigned long flags;

ring = priority_to_txring(dev, info->queue);
ring = priority_to_txring(dev, skb_get_queue_mapping(skb));
spin_lock_irqsave(&ring->lock, flags);
B43legacy_WARN_ON(!ring->tx);
if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct iwl_tfd_frame *tfd;
u32 *control_flags;
int txq_id = info->queue;
int txq_id = skb_get_queue_mapping(skb);
struct iwl_tx_queue *txq = NULL;
struct iwl_queue *q = NULL;
dma_addr_t phys_addr;
Expand Down Expand Up @@ -917,7 +917,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
spin_unlock_irqrestore(&priv->lock, flags);
}

ieee80211_stop_queue(priv->hw, info->queue);
ieee80211_stop_queue(priv->hw, skb_get_queue_mapping(skb));
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct iwl3945_tfd_frame *tfd;
u32 *control_flags;
int txq_id = info->queue;
int txq_id = skb_get_queue_mapping(skb);
struct iwl3945_tx_queue *txq = NULL;
struct iwl3945_queue *q = NULL;
dma_addr_t phys_addr;
Expand Down Expand Up @@ -2765,7 +2765,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
spin_unlock_irqrestore(&priv->lock, flags);
}

ieee80211_stop_queue(priv->hw, info->queue);
ieee80211_stop_queue(priv->hw, skb_get_queue_mapping(skb));
}

return 0;
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/p54/p54common.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
last_addr = range->end_addr;
__skb_unlink(entry, &priv->tx_queue);
memset(&info->status, 0, sizeof(info->status));
priv->tx_stats[info->queue].len--;
priv->tx_stats[skb_get_queue_mapping(skb)].len--;
entry_hdr = (struct p54_control_hdr *) entry->data;
entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data;
if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0)
Expand Down Expand Up @@ -551,13 +551,13 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
size_t padding, len;
u8 rate;

current_queue = &priv->tx_stats[info->queue];
current_queue = &priv->tx_stats[skb_get_queue_mapping(skb)];
if (unlikely(current_queue->len > current_queue->limit))
return NETDEV_TX_BUSY;
current_queue->len++;
current_queue->count++;
if (current_queue->len == current_queue->limit)
ieee80211_stop_queue(dev, info->queue);
ieee80211_stop_queue(dev, skb_get_queue_mapping(skb));

padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3;
len = skb->len;
Expand Down Expand Up @@ -589,7 +589,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
memset(txhdr->rateset, rate, 8);
txhdr->wep_key_present = 0;
txhdr->wep_key_len = 0;
txhdr->frame_type = cpu_to_le32(info->queue + 4);
txhdr->frame_type = cpu_to_le32(skb_get_queue_mapping(skb) + 4);
txhdr->magic4 = 0;
txhdr->antenna = (info->antenna_sel_tx == 0) ?
2 : info->antenna_sel_tx - 1;
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/net/wireless/rt2x00/rt2x00mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
struct rt2x00_dev *rt2x00dev = hw->priv;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data;
enum data_queue_qid qid = mac80211_queue_to_qid(tx_info->queue);
enum data_queue_qid qid = skb_get_queue_mapping(skb);
struct data_queue *queue;
u16 frame_control;

Expand Down Expand Up @@ -149,23 +149,23 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
IEEE80211_TX_CTL_USE_CTS_PROTECT)) &&
!rt2x00dev->ops->hw->set_rts_threshold) {
if (rt2x00queue_available(queue) <= 1) {
ieee80211_stop_queue(rt2x00dev->hw, tx_info->queue);
ieee80211_stop_queue(rt2x00dev->hw, qid);
return NETDEV_TX_BUSY;
}

if (rt2x00mac_tx_rts_cts(rt2x00dev, queue, skb)) {
ieee80211_stop_queue(rt2x00dev->hw, tx_info->queue);
ieee80211_stop_queue(rt2x00dev->hw, qid);
return NETDEV_TX_BUSY;
}
}

if (rt2x00dev->ops->lib->write_tx_data(rt2x00dev, queue, skb)) {
ieee80211_stop_queue(rt2x00dev->hw, tx_info->queue);
ieee80211_stop_queue(rt2x00dev->hw, qid);
return NETDEV_TX_BUSY;
}

if (rt2x00queue_full(queue))
ieee80211_stop_queue(rt2x00dev->hw, tx_info->queue);
ieee80211_stop_queue(rt2x00dev->hw, qid);

if (rt2x00dev->ops->lib->kick_tx_queue)
rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, qid);
Expand Down
13 changes: 0 additions & 13 deletions trunk/drivers/net/wireless/rt2x00/rt2x00queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,6 @@ enum data_queue_qid {
QID_ATIM,
};

/**
* 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
*
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/rtl8180_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
u16 plcp_len = 0;
__le16 rts_duration = 0;

prio = info->queue;
prio = skb_get_queue_mapping(skb);
ring = &priv->tx_ring[prio];

mapping = pci_map_single(priv->pdev, skb->data,
Expand Down Expand Up @@ -298,7 +298,7 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
entry->flags = cpu_to_le32(tx_flags);
__skb_queue_tail(&ring->queue, skb);
if (ring->entries - skb_queue_len(&ring->queue) < 2)
ieee80211_stop_queue(dev, info->queue);
ieee80211_stop_queue(dev, skb_get_queue_mapping(skb));
spin_unlock_irqrestore(&priv->lock, flags);

rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4)));
Expand Down
20 changes: 19 additions & 1 deletion trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ struct ieee80211_tx_info {
s8 tx_rate_idx;
u8 antenna_sel_tx;

u8 queue; /* use skb_queue_mapping soon */
/* 1 byte hole */

union {
struct {
Expand Down Expand Up @@ -802,6 +802,24 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
}

static inline int ieee80211_num_regular_queues(struct ieee80211_hw *hw)
{
#ifdef CONFIG_MAC80211_QOS
return hw->queues;
#else
return 1;
#endif
}

static inline int ieee80211_num_queues(struct ieee80211_hw *hw)
{
#ifdef CONFIG_MAC80211_QOS
return hw->queues + hw->ampdu_queues;
#else
return 1;
#endif
}

static inline struct ieee80211_rate *
ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
const struct ieee80211_tx_info *c)
Expand Down
14 changes: 13 additions & 1 deletion trunk/net/mac80211/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@ config MAC80211
select CRC32
select WIRELESS_EXT
select CFG80211
select NET_SCH_FIFO
---help---
This option enables the hardware independent IEEE 802.11
networking stack.

config MAC80211_QOS
def_bool y
depends on MAC80211
depends on NET_SCHED
depends on NETDEVICES_MULTIQUEUE

comment "QoS/HT support disabled"
depends on MAC80211 && !MAC80211_QOS
comment "QoS/HT support needs CONFIG_NET_SCHED"
depends on MAC80211 && !NET_SCHED
comment "QoS/HT support needs CONFIG_NETDEVICES_MULTIQUEUE"
depends on MAC80211 && !NETDEVICES_MULTIQUEUE

menu "Rate control algorithm selection"
depends on MAC80211 != n

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/mac80211/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mac80211-y := \
event.o

mac80211-$(CONFIG_MAC80211_LEDS) += led.o
mac80211-$(CONFIG_NET_SCHED) += wme.o
mac80211-$(CONFIG_MAC80211_QOS) += wme.o
mac80211-$(CONFIG_MAC80211_DEBUGFS) += \
debugfs.o \
debugfs_sta.o \
Expand Down
16 changes: 10 additions & 6 deletions trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ struct ieee80211_local {
struct sta_info *sta_hash[STA_HASH_SIZE];
struct timer_list sta_cleanup;

unsigned long state[IEEE80211_MAX_QUEUES + IEEE80211_MAX_AMPDU_QUEUES];
unsigned long queues_pending[BITS_TO_LONGS(IEEE80211_MAX_QUEUES)];
struct ieee80211_tx_stored_packet pending_packet[IEEE80211_MAX_QUEUES];
struct tasklet_struct tx_pending_tasklet;

Expand Down Expand Up @@ -758,6 +758,15 @@ struct ieee80211_local {
#endif
};

static inline int ieee80211_is_multiqueue(struct ieee80211_local *local)
{
#ifdef CONFIG_MAC80211_QOS
return netif_is_multiqueue(local->mdev);
#else
return 0;
#endif
}

/* this struct represents 802.11n's RA/TID combination */
struct ieee80211_ra_tid {
u8 ra[ETH_ALEN];
Expand Down Expand Up @@ -827,11 +836,6 @@ static inline struct ieee80211_hw *local_to_hw(
return &local->hw;
}

enum ieee80211_link_state_t {
IEEE80211_LINK_STATE_XOFF = 0,
IEEE80211_LINK_STATE_PENDING,
};

struct sta_attribute {
struct attribute attr;
ssize_t (*show)(const struct sta_info *, char *buf);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
ifsta->flags |= IEEE80211_STA_CREATE_IBSS |
IEEE80211_STA_AUTO_BSSID_SEL |
IEEE80211_STA_AUTO_CHANNEL_SEL;
if (sdata->local->hw.queues >= 4)
if (ieee80211_num_regular_queues(&sdata->local->hw) >= 4)
ifsta->flags |= IEEE80211_STA_WMM_ENABLED;

msdata = IEEE80211_DEV_TO_SUB_IF(sdata->local->mdev);
Expand Down
29 changes: 22 additions & 7 deletions trunk/net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1634,12 +1634,32 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
if (result < 0)
return result;

/*
* We use the number of queues for feature tests (QoS, HT) internally
* so restrict them appropriately.
*/
#ifdef CONFIG_MAC80211_QOS
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;
if (hw->queues < 4)
hw->ampdu_queues = 0;
#else
hw->queues = 1;
hw->ampdu_queues = 0;
#endif

/* for now, mdev needs sub_if_data :/ */
mdev = alloc_netdev(sizeof(struct ieee80211_sub_if_data),
"wmaster%d", ether_setup);
mdev = alloc_netdev_mq(sizeof(struct ieee80211_sub_if_data),
"wmaster%d", ether_setup,
ieee80211_num_queues(hw));
if (!mdev)
goto fail_mdev_alloc;

if (ieee80211_num_queues(hw) > 1)
mdev->features |= NETIF_F_MULTI_QUEUE;

sdata = IEEE80211_DEV_TO_SUB_IF(mdev);
mdev->ieee80211_ptr = &sdata->wdev;
sdata->wdev.wiphy = local->hw.wiphy;
Expand Down Expand Up @@ -1728,11 +1748,6 @@ 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 33592f7

Please sign in to comment.