Skip to content

Commit

Permalink
rt2x00: rt2800lib: add rt2800_hw_beacon_base helper
Browse files Browse the repository at this point in the history
The HW_BEACON_BASE() macro returns the base address
of a given beacon, however the returned values are
not usable on all chipsets. On devices which have
selectable shared memory parts, some beacon may be
located in the high part of the shared memory.

Instead of extending the already complicated macro,
add a new helper function and use that to get the
base address of a given beacon.

The actual patch contains no functional changes, the
helper function will be extended in a further patch
to handle different chipsets' requirements.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Gabor Juhos authored and John W. Linville committed Aug 26, 2013
1 parent 20c7d42 commit 21c6af6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/net/wireless/rt2x00/rt2800lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,12 @@ void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi)
}
EXPORT_SYMBOL_GPL(rt2800_txdone_entry);

static unsigned int rt2800_hw_beacon_base(struct rt2x00_dev *rt2x00dev,
unsigned int index)
{
return HW_BEACON_BASE(index);
}

void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
Expand Down Expand Up @@ -992,7 +998,8 @@ void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc)
return;
}

beacon_base = HW_BEACON_BASE(entry->entry_idx);
beacon_base = rt2800_hw_beacon_base(rt2x00dev, entry->entry_idx);

rt2800_register_multiwrite(rt2x00dev, beacon_base, entry->skb->data,
entry->skb->len + padding_len);

Expand All @@ -1017,7 +1024,7 @@ static inline void rt2800_clear_beacon_register(struct rt2x00_dev *rt2x00dev,
const int txwi_desc_size = rt2x00dev->bcn->winfo_size;
unsigned int beacon_base;

beacon_base = HW_BEACON_BASE(index);
beacon_base = rt2800_hw_beacon_base(rt2x00dev, index);

/*
* For the Beacon base registers we only need to clear
Expand Down

0 comments on commit 21c6af6

Please sign in to comment.