diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2011-03-03 19:38:55 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-04 14:06:46 -0500 |
commit | 11f818e0eb50864c7e6f8af38d8f8822f992906a (patch) | |
tree | 25e5da8f41a1304240c164d26128805e42cf7832 /drivers/net/wireless/rt2x00/rt2x00.h | |
parent | adde5882bc6c21de7ee80ee15dfd58c7e9a472ac (diff) | |
download | kernel_samsung_smdk4412-11f818e0eb50864c7e6f8af38d8f8822f992906a.tar.gz kernel_samsung_smdk4412-11f818e0eb50864c7e6f8af38d8f8822f992906a.tar.bz2 kernel_samsung_smdk4412-11f818e0eb50864c7e6f8af38d8f8822f992906a.zip |
rt2x00: Optimize calls to rt2x00queue_get_queue
In some cases (tx path for example) we don't need to check for non-tx
queues in rt2x00queue_get_queue. Hence, introduce a new method
rt2x00queue_get_tx_queue that is only valid for tx queues and use it in
places where only tx queues are valid.
Furthermore, this new method is quite short and as such can be inlined
to avoid the function call overhead.
This only converts the txdone functions of drivers that don't use an ATIM
queue and the generic tx path.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 19453d23e90..2f5d8de5ef1 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h @@ -1063,6 +1063,23 @@ void rt2x00queue_map_txskb(struct queue_entry *entry); void rt2x00queue_unmap_skb(struct queue_entry *entry); /** + * rt2x00queue_get_tx_queue - Convert tx queue index to queue pointer + * @rt2x00dev: Pointer to &struct rt2x00_dev. + * @queue: rt2x00 queue index (see &enum data_queue_qid). + * + * Returns NULL for non tx queues. + */ +static inline struct data_queue * +rt2x00queue_get_tx_queue(struct rt2x00_dev *rt2x00dev, + const enum data_queue_qid queue) +{ + if (queue < rt2x00dev->ops->tx_queues && rt2x00dev->tx) + return &rt2x00dev->tx[queue]; + + return NULL; +} + +/** * rt2x00queue_get_queue - Convert queue index to queue pointer * @rt2x00dev: Pointer to &struct rt2x00_dev. * @queue: rt2x00 queue index (see &enum data_queue_qid). |