Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79381
b: refs/heads/master
c: 0426710
h: refs/heads/master
i:
  79379: fe205ba
v: v3
  • Loading branch information
Ivo van Doorn authored and David S. Miller committed Jan 28, 2008
1 parent 2ac2a83 commit d400c08
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 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: 3867705bb773818b39e0ca8d02ccb71fb4d2ffb8
refs/heads/master: 042671040db95a896c5ca960b9b656692a787892
6 changes: 0 additions & 6 deletions trunk/drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -795,12 +795,6 @@ struct rt2x00_dev {
#define txringall_for_each(__dev, __entry) \
ring_loop(__entry, (__dev)->tx, ring_end(__dev))

/*
* Compute an array index from a pointer to an element and the base pointer.
*/
#define ARRAY_INDEX(__elem, __base) \
( ((char *)(__elem) - (char *)(__base)) / sizeof(*(__elem)) )

/*
* Generic RF access.
* The RF is being accessed by word index.
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/net/wireless/rt2x00/rt2x00debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,8 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
struct sk_buff *skbcopy;
struct rt2x00dump_hdr *dump_hdr;
struct timeval timestamp;
unsigned int ring_index;
unsigned int entry_index;

do_gettimeofday(&timestamp);
ring_index = ARRAY_INDEX(desc->ring, rt2x00dev->rx);
entry_index = ARRAY_INDEX(desc->entry, desc->ring->entry);

if (!test_bit(FRAME_DUMP_FILE_OPEN, &intf->frame_dump_flags))
return;
Expand All @@ -151,8 +147,8 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
dump_hdr->chip_rf = cpu_to_le16(rt2x00dev->chip.rf);
dump_hdr->chip_rev = cpu_to_le32(rt2x00dev->chip.rev);
dump_hdr->type = cpu_to_le16(desc->frame_type);
dump_hdr->ring_index = ring_index;
dump_hdr->entry_index = entry_index;
dump_hdr->ring_index = desc->ring->queue_idx;
dump_hdr->entry_index = desc->entry->entry_idx;
dump_hdr->timestamp_sec = cpu_to_le32(timestamp.tv_sec);
dump_hdr->timestamp_usec = cpu_to_le32(timestamp.tv_usec);

Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@ static int rt2x00lib_alloc_entries(struct data_ring *ring,
entry[i].flags = 0;
entry[i].ring = ring;
entry[i].skb = NULL;
entry[i].entry_idx = i;
}

ring->entry = entry;
Expand Down Expand Up @@ -1115,6 +1116,7 @@ int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev)
static int rt2x00lib_alloc_rings(struct rt2x00_dev *rt2x00dev)
{
struct data_ring *ring;
unsigned int index;

/*
* We need the following rings:
Expand Down Expand Up @@ -1145,8 +1147,10 @@ static int rt2x00lib_alloc_rings(struct rt2x00_dev *rt2x00dev)
* cw_min: 2^5 = 32.
* cw_max: 2^10 = 1024.
*/
index = 0;
ring_for_each(rt2x00dev, ring) {
ring->rt2x00dev = rt2x00dev;
ring->queue_idx = index++;
ring->tx_params.aifs = 2;
ring->tx_params.cw_min = 5;
ring->tx_params.cw_max = 10;
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00ring.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ struct data_entry {
*/
void *data_addr;
dma_addr_t data_dma;

/*
* Entry identification number (index).
*/
unsigned int entry_idx;
};

/*
Expand Down Expand Up @@ -180,6 +185,13 @@ struct data_ring {
dma_addr_t data_dma;
void *data_addr;

/*
* Queue identification number:
* RX: 0
* TX: IEEE80211_TX_*
*/
unsigned int queue_idx;

/*
* Index variables.
*/
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/wireless/rt2x00/rt61pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,10 @@ static void rt61pci_init_txring(struct rt2x00_dev *rt2x00dev, const int queue)
rt2x00_desc_write(txd, 1, word);

rt2x00_desc_read(txd, 5, &word);
rt2x00_set_field32(&word, TXD_W5_PID_TYPE, queue);
rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE, i);
rt2x00_set_field32(&word, TXD_W5_PID_TYPE,
ring->queue_idx);
rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE,
ring->entry[i].entry_idx);
rt2x00_desc_write(txd, 5, word);

rt2x00_desc_read(txd, 6, &word);
Expand Down

0 comments on commit d400c08

Please sign in to comment.