]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/net/wireless/ti/wlcore/hw_ops.h
wlcore/wl12xx: add prepare_read hw op for Rx data
[karo-tx-linux.git] / drivers / net / wireless / ti / wlcore / hw_ops.h
1 /*
2  * This file is part of wlcore
3  *
4  * Copyright (C) 2011 Texas Instruments Inc.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * version 2 as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18  * 02110-1301 USA
19  *
20  */
21
22 #ifndef __WLCORE_HW_OPS_H__
23 #define __WLCORE_HW_OPS_H__
24
25 #include "wlcore.h"
26 #include "rx.h"
27
28 static inline u32
29 wlcore_hw_calc_tx_blocks(struct wl1271 *wl, u32 len, u32 spare_blks)
30 {
31         if (!wl->ops->calc_tx_blocks)
32                 BUG_ON(1);
33
34         return wl->ops->calc_tx_blocks(wl, len, spare_blks);
35 }
36
37 static inline void
38 wlcore_hw_set_tx_desc_blocks(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc,
39                              u32 blks, u32 spare_blks)
40 {
41         if (!wl->ops->set_tx_desc_blocks)
42                 BUG_ON(1);
43
44         return wl->ops->set_tx_desc_blocks(wl, desc, blks, spare_blks);
45 }
46
47 static inline void
48 wlcore_hw_set_tx_desc_data_len(struct wl1271 *wl,
49                                struct wl1271_tx_hw_descr *desc,
50                                struct sk_buff *skb)
51 {
52         if (!wl->ops->set_tx_desc_data_len)
53                 BUG_ON(1);
54
55         wl->ops->set_tx_desc_data_len(wl, desc, skb);
56 }
57
58 static inline enum wl_rx_buf_align
59 wlcore_hw_get_rx_buf_align(struct wl1271 *wl, u32 rx_desc)
60 {
61
62         if (!wl->ops->get_rx_buf_align)
63                 BUG_ON(1);
64
65         return wl->ops->get_rx_buf_align(wl, rx_desc);
66 }
67
68 static inline void
69 wlcore_hw_prepare_read(struct wl1271 *wl, u32 rx_desc, u32 len)
70 {
71         if (wl->ops->prepare_read)
72                 wl->ops->prepare_read(wl, rx_desc, len);
73 }
74
75 #endif