diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2013-04-18 07:33:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-04-22 15:20:25 -0400 |
commit | 4fc4118cdb29ab946b8a586fc766ebb6ae1e1c90 (patch) | |
tree | b72a4d57944c55dc48baedc87dd5aaf5973487b0 | |
parent | 4de41bef3e075dbc787f7c53b3562f23295f1d6d (diff) |
wil6210: more Rx descriptor accessor functions
Helpers to fetch various fields from the Rx descriptor
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/txrx.h | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h index f0cc48afd861..adef12fb2aee 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.h +++ b/drivers/net/wireless/ath/wil6210/txrx.h | |||
@@ -339,19 +339,19 @@ union vring_desc { | |||
339 | struct vring_rx_desc rx; | 339 | struct vring_rx_desc rx; |
340 | } __packed; | 340 | } __packed; |
341 | 341 | ||
342 | static inline int wil_rxdesc_phy_length(struct vring_rx_desc *d) | 342 | static inline int wil_rxdesc_tid(struct vring_rx_desc *d) |
343 | { | 343 | { |
344 | return WIL_GET_BITS(d->dma.d0, 16, 29); | 344 | return WIL_GET_BITS(d->mac.d0, 0, 3); |
345 | } | 345 | } |
346 | 346 | ||
347 | static inline int wil_rxdesc_mcs(struct vring_rx_desc *d) | 347 | static inline int wil_rxdesc_cid(struct vring_rx_desc *d) |
348 | { | 348 | { |
349 | return WIL_GET_BITS(d->mac.d1, 21, 24); | 349 | return WIL_GET_BITS(d->mac.d0, 4, 6); |
350 | } | 350 | } |
351 | 351 | ||
352 | static inline int wil_rxdesc_ds_bits(struct vring_rx_desc *d) | 352 | static inline int wil_rxdesc_mid(struct vring_rx_desc *d) |
353 | { | 353 | { |
354 | return WIL_GET_BITS(d->mac.d1, 8, 9); | 354 | return WIL_GET_BITS(d->mac.d0, 8, 9); |
355 | } | 355 | } |
356 | 356 | ||
357 | static inline int wil_rxdesc_ftype(struct vring_rx_desc *d) | 357 | static inline int wil_rxdesc_ftype(struct vring_rx_desc *d) |
@@ -359,6 +359,36 @@ static inline int wil_rxdesc_ftype(struct vring_rx_desc *d) | |||
359 | return WIL_GET_BITS(d->mac.d0, 10, 11); | 359 | return WIL_GET_BITS(d->mac.d0, 10, 11); |
360 | } | 360 | } |
361 | 361 | ||
362 | static inline int wil_rxdesc_subtype(struct vring_rx_desc *d) | ||
363 | { | ||
364 | return WIL_GET_BITS(d->mac.d0, 12, 15); | ||
365 | } | ||
366 | |||
367 | static inline int wil_rxdesc_seq(struct vring_rx_desc *d) | ||
368 | { | ||
369 | return WIL_GET_BITS(d->mac.d0, 16, 27); | ||
370 | } | ||
371 | |||
372 | static inline int wil_rxdesc_ext_subtype(struct vring_rx_desc *d) | ||
373 | { | ||
374 | return WIL_GET_BITS(d->mac.d0, 28, 31); | ||
375 | } | ||
376 | |||
377 | static inline int wil_rxdesc_ds_bits(struct vring_rx_desc *d) | ||
378 | { | ||
379 | return WIL_GET_BITS(d->mac.d1, 8, 9); | ||
380 | } | ||
381 | |||
382 | static inline int wil_rxdesc_mcs(struct vring_rx_desc *d) | ||
383 | { | ||
384 | return WIL_GET_BITS(d->mac.d1, 21, 24); | ||
385 | } | ||
386 | |||
387 | static inline int wil_rxdesc_phy_length(struct vring_rx_desc *d) | ||
388 | { | ||
389 | return WIL_GET_BITS(d->dma.d0, 16, 29); | ||
390 | } | ||
391 | |||
362 | static inline struct vring_rx_desc *wil_skb_rxdesc(struct sk_buff *skb) | 392 | static inline struct vring_rx_desc *wil_skb_rxdesc(struct sk_buff *skb) |
363 | { | 393 | { |
364 | return (void *)skb->cb; | 394 | return (void *)skb->cb; |