Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369623
b: refs/heads/master
c: f0bda57
h: refs/heads/master
i:
  369621: 03e7a06
  369619: f98c76c
  369615: 291885a
v: v3
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Apr 22, 2013
1 parent 5c9e808 commit 221273e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 26 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: 074f25295b78dca7a0f65b87a16bebe493aab4f9
refs/heads/master: f0bda571047746365569fccaede86adf6c0dfe8a
12 changes: 9 additions & 3 deletions trunk/drivers/net/wireless/rt2x00/rt2800lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,10 @@ void rt2800_process_rxwi(struct queue_entry *entry,
* Convert descriptor AGC value to RSSI value.
*/
rxdesc->rssi = rt2800_agc_to_rssi(entry->queue->rt2x00dev, word);
/*
* Remove RXWI descriptor from start of the buffer.
*/
skb_pull(entry->skb, entry->queue->winfo_size);
}
EXPORT_SYMBOL_GPL(rt2800_process_rxwi);

Expand Down Expand Up @@ -766,6 +770,7 @@ void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc)
unsigned int beacon_base;
unsigned int padding_len;
u32 orig_reg, reg;
const int txwi_desc_size = entry->queue->winfo_size;

/*
* Disable beaconing while we are reloading the beacon data,
Expand All @@ -779,14 +784,14 @@ void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc)
/*
* Add space for the TXWI in front of the skb.
*/
memset(skb_push(entry->skb, TXWI_DESC_SIZE), 0, TXWI_DESC_SIZE);
memset(skb_push(entry->skb, txwi_desc_size), 0, txwi_desc_size);

/*
* Register descriptor details in skb frame descriptor.
*/
skbdesc->flags |= SKBDESC_DESC_IN_SKB;
skbdesc->desc = entry->skb->data;
skbdesc->desc_len = TXWI_DESC_SIZE;
skbdesc->desc_len = txwi_desc_size;

/*
* Add the TXWI for the beacon to the skb.
Expand Down Expand Up @@ -832,13 +837,14 @@ static inline void rt2800_clear_beacon_register(struct rt2x00_dev *rt2x00dev,
unsigned int beacon_base)
{
int i;
const int txwi_desc_size = rt2x00dev->ops->bcn->winfo_size;

/*
* For the Beacon base registers we only need to clear
* the whole TXWI which (when set to 0) will invalidate
* the entire beacon.
*/
for (i = 0; i < TXWI_DESC_SIZE; i += sizeof(__le32))
for (i = 0; i < txwi_desc_size; i += sizeof(__le32))
rt2800_register_write(rt2x00dev, beacon_base + i, 0);
}

Expand Down
10 changes: 4 additions & 6 deletions trunk/drivers/net/wireless/rt2x00/rt2800pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,6 @@ static void rt2800pci_fill_rxdone(struct queue_entry *entry,
* Process the RXWI structure that is at the start of the buffer.
*/
rt2800_process_rxwi(entry, rxdesc);

/*
* Remove RXWI descriptor from start of buffer.
*/
skb_pull(entry->skb, RXWI_DESC_SIZE);
}

/*
Expand Down Expand Up @@ -1197,20 +1192,23 @@ static const struct data_queue_desc rt2800pci_queue_rx = {
.entry_num = 128,
.data_size = AGGREGATION_SIZE,
.desc_size = RXD_DESC_SIZE,
.winfo_size = RXWI_DESC_SIZE,
.priv_size = sizeof(struct queue_entry_priv_mmio),
};

static const struct data_queue_desc rt2800pci_queue_tx = {
.entry_num = 64,
.data_size = AGGREGATION_SIZE,
.desc_size = TXD_DESC_SIZE,
.winfo_size = TXWI_DESC_SIZE,
.priv_size = sizeof(struct queue_entry_priv_mmio),
};

static const struct data_queue_desc rt2800pci_queue_bcn = {
.entry_num = 8,
.data_size = 0, /* No DMA required for beacons */
.desc_size = TXWI_DESC_SIZE,
.desc_size = TXD_DESC_SIZE,
.winfo_size = TXWI_DESC_SIZE,
.priv_size = sizeof(struct queue_entry_priv_mmio),
};

Expand Down
25 changes: 13 additions & 12 deletions trunk/drivers/net/wireless/rt2x00/rt2800usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static void rt2800usb_write_tx_desc(struct queue_entry *entry,
*/
skbdesc->flags |= SKBDESC_DESC_IN_SKB;
skbdesc->desc = txi;
skbdesc->desc_len = entry->queue->desc_size;
skbdesc->desc_len = TXINFO_DESC_SIZE + entry->queue->winfo_size;
}

/*
Expand Down Expand Up @@ -730,11 +730,6 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry,
* Process the RXWI structure.
*/
rt2800_process_rxwi(entry, rxdesc);

/*
* Remove RXWI descriptor from start of buffer.
*/
skb_pull(entry->skb, entry->queue->desc_size - RXINFO_DESC_SIZE);
}

/*
Expand Down Expand Up @@ -858,21 +853,24 @@ static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = {
static const struct data_queue_desc rt2800usb_queue_rx = {
.entry_num = 128,
.data_size = AGGREGATION_SIZE,
.desc_size = RXINFO_DESC_SIZE + RXWI_DESC_SIZE,
.desc_size = RXINFO_DESC_SIZE,
.winfo_size = RXWI_DESC_SIZE,
.priv_size = sizeof(struct queue_entry_priv_usb),
};

static const struct data_queue_desc rt2800usb_queue_tx = {
.entry_num = 16,
.data_size = AGGREGATION_SIZE,
.desc_size = TXINFO_DESC_SIZE + TXWI_DESC_SIZE,
.desc_size = TXINFO_DESC_SIZE,
.winfo_size = TXWI_DESC_SIZE,
.priv_size = sizeof(struct queue_entry_priv_usb),
};

static const struct data_queue_desc rt2800usb_queue_bcn = {
.entry_num = 8,
.data_size = MGMT_FRAME_SIZE,
.desc_size = TXINFO_DESC_SIZE + TXWI_DESC_SIZE,
.desc_size = TXINFO_DESC_SIZE,
.winfo_size = TXWI_DESC_SIZE,
.priv_size = sizeof(struct queue_entry_priv_usb),
};

Expand All @@ -898,21 +896,24 @@ static const struct rt2x00_ops rt2800usb_ops = {
static const struct data_queue_desc rt2800usb_queue_rx_5592 = {
.entry_num = 128,
.data_size = AGGREGATION_SIZE,
.desc_size = RXINFO_DESC_SIZE + RXWI_DESC_SIZE_5592,
.desc_size = RXINFO_DESC_SIZE,
.winfo_size = RXWI_DESC_SIZE_5592,
.priv_size = sizeof(struct queue_entry_priv_usb),
};

static const struct data_queue_desc rt2800usb_queue_tx_5592 = {
.entry_num = 16,
.data_size = AGGREGATION_SIZE,
.desc_size = TXINFO_DESC_SIZE + TXWI_DESC_SIZE_5592,
.desc_size = TXINFO_DESC_SIZE,
.winfo_size = TXWI_DESC_SIZE_5592,
.priv_size = sizeof(struct queue_entry_priv_usb),
};

static const struct data_queue_desc rt2800usb_queue_bcn_5592 = {
.entry_num = 8,
.data_size = MGMT_FRAME_SIZE,
.desc_size = TXINFO_DESC_SIZE + TXWI_DESC_SIZE_5592,
.desc_size = TXINFO_DESC_SIZE,
.winfo_size = TXWI_DESC_SIZE_5592,
.priv_size = sizeof(struct queue_entry_priv_usb),
};

Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/wireless/rt2x00/rt2x00queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry, gfp_t gfp)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
struct data_queue *queue = entry->queue;
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
struct sk_buff *skb;
struct skb_frame_desc *skbdesc;
unsigned int frame_size;
Expand All @@ -46,7 +47,7 @@ struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry, gfp_t gfp)
* The frame size includes descriptor size, because the
* hardware directly receive the frame into the skbuffer.
*/
frame_size = entry->queue->data_size + entry->queue->desc_size;
frame_size = queue->data_size + queue->desc_size + queue->winfo_size;

/*
* The payload should be aligned to a 4-byte boundary,
Expand Down Expand Up @@ -1172,6 +1173,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
queue->threshold = DIV_ROUND_UP(qdesc->entry_num, 10);
queue->data_size = qdesc->data_size;
queue->desc_size = qdesc->desc_size;
queue->winfo_size = qdesc->winfo_size;

/*
* Allocate all queue entries.
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/wireless/rt2x00/rt2x00queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ struct data_queue {
unsigned short cw_max;

unsigned short data_size;
unsigned short desc_size;
unsigned char desc_size;
unsigned char winfo_size;

unsigned short usb_endpoint;
unsigned short usb_maxpacket;
Expand All @@ -499,7 +500,8 @@ struct data_queue {
struct data_queue_desc {
unsigned short entry_num;
unsigned short data_size;
unsigned short desc_size;
unsigned char desc_size;
unsigned char winfo_size;
unsigned short priv_size;
};

Expand Down

0 comments on commit 221273e

Please sign in to comment.