22 #ifndef __WLCORE_HW_OPS_H__
23 #define __WLCORE_HW_OPS_H__
29 wlcore_hw_calc_tx_blocks(
struct wl1271 *wl,
u32 len,
u32 spare_blks)
31 if (!wl->
ops->calc_tx_blocks)
34 return wl->
ops->calc_tx_blocks(wl, len, spare_blks);
41 if (!wl->
ops->set_tx_desc_blocks)
44 return wl->
ops->set_tx_desc_blocks(wl, desc, blks, spare_blks);
48 wlcore_hw_set_tx_desc_data_len(
struct wl1271 *wl,
52 if (!wl->
ops->set_tx_desc_data_len)
55 wl->
ops->set_tx_desc_data_len(wl, desc, skb);
62 if (!wl->
ops->get_rx_buf_align)
65 return wl->
ops->get_rx_buf_align(wl, rx_desc);
69 wlcore_hw_prepare_read(
struct wl1271 *wl,
u32 rx_desc,
u32 len)
71 if (wl->
ops->prepare_read)
72 return wl->
ops->prepare_read(wl, rx_desc, len);
80 if (!wl->
ops->get_rx_packet_len)
83 return wl->
ops->get_rx_packet_len(wl, rx_data, data_len);
86 static inline int wlcore_hw_tx_delayed_compl(
struct wl1271 *wl)
88 if (wl->
ops->tx_delayed_compl)
89 return wl->
ops->tx_delayed_compl(wl);
94 static inline void wlcore_hw_tx_immediate_compl(
struct wl1271 *wl)
96 if (wl->
ops->tx_immediate_compl)
97 wl->
ops->tx_immediate_compl(wl);
103 if (wl->
ops->init_vif)
104 return wl->
ops->init_vif(wl, wlvif);
112 if (!wl->
ops->sta_get_ap_rate_mask)
115 return wl->
ops->sta_get_ap_rate_mask(wl, wlvif);
118 static inline int wlcore_identify_fw(
struct wl1271 *wl)
120 if (wl->
ops->identify_fw)
121 return wl->
ops->identify_fw(wl);
127 wlcore_hw_set_tx_desc_csum(
struct wl1271 *wl,
131 if (!wl->
ops->set_tx_desc_csum)
134 wl->
ops->set_tx_desc_csum(wl, desc, skb);
138 wlcore_hw_set_rx_csum(
struct wl1271 *wl,
142 if (wl->
ops->set_rx_csum)
143 wl->
ops->set_rx_csum(wl, desc, skb);
147 wlcore_hw_ap_get_mimo_wide_rate_mask(
struct wl1271 *wl,
150 if (wl->
ops->ap_get_mimo_wide_rate_mask)
151 return wl->
ops->ap_get_mimo_wide_rate_mask(wl, wlvif);
157 wlcore_debugfs_init(
struct wl1271 *wl,
struct dentry *rootdir)
159 if (wl->
ops->debugfs_init)
160 return wl->
ops->debugfs_init(wl, rootdir);
166 wlcore_handle_static_data(
struct wl1271 *wl,
void *static_data)
168 if (wl->
ops->handle_static_data)
169 return wl->
ops->handle_static_data(wl, static_data);
175 wlcore_hw_get_spare_blocks(
struct wl1271 *wl,
bool is_gem)
177 if (!wl->
ops->get_spare_blocks)
180 return wl->
ops->get_spare_blocks(wl, is_gem);
189 if (!wl->
ops->set_key)
192 return wl->
ops->set_key(wl, cmd, vif, sta, key_conf);
196 wlcore_hw_pre_pkt_send(
struct wl1271 *wl,
u32 buf_offset,
u32 last_len)
198 if (wl->
ops->pre_pkt_send)
199 return wl->
ops->pre_pkt_send(wl, buf_offset, last_len);