1b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov/*
2b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * This file is part of wlcore
3b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov *
4b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * Copyright (C) 2011 Texas Instruments Inc.
5b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov *
6b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * This program is free software; you can redistribute it and/or
7b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * modify it under the terms of the GNU General Public License
8b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * version 2 as published by the Free Software Foundation.
9b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov *
10b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * This program is distributed in the hope that it will be useful, but
11b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * WITHOUT ANY WARRANTY; without even the implied warranty of
12b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * General Public License for more details.
14b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov *
15b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * You should have received a copy of the GNU General Public License
16b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * along with this program; if not, write to the Free Software
17b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov * 02110-1301 USA
19b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov *
20b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov */
21b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov
22b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov#ifndef __WLCORE_HW_OPS_H__
23b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov#define __WLCORE_HW_OPS_H__
24b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov
25b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov#include "wlcore.h"
26cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsov#include "rx.h"
27b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov
28b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsovstatic inline u32
29b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsovwlcore_hw_calc_tx_blocks(struct wl1271 *wl, u32 len, u32 spare_blks)
30b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov{
31b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov	if (!wl->ops->calc_tx_blocks)
32b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov		BUG_ON(1);
33b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov
34b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov	return wl->ops->calc_tx_blocks(wl, len, spare_blks);
35b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov}
36b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov
374a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsovstatic inline void
384a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsovwlcore_hw_set_tx_desc_blocks(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc,
394a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsov			     u32 blks, u32 spare_blks)
404a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsov{
414a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsov	if (!wl->ops->set_tx_desc_blocks)
424a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsov		BUG_ON(1);
434a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsov
444a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsov	return wl->ops->set_tx_desc_blocks(wl, desc, blks, spare_blks);
454a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsov}
464a3b97eea216135cd37e6d3a4a6c551c201a6615Arik Nemtsov
476f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsovstatic inline void
486f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsovwlcore_hw_set_tx_desc_data_len(struct wl1271 *wl,
496f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsov			       struct wl1271_tx_hw_descr *desc,
506f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsov			       struct sk_buff *skb)
516f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsov{
526f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsov	if (!wl->ops->set_tx_desc_data_len)
536f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsov		BUG_ON(1);
546f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsov
556f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsov	wl->ops->set_tx_desc_data_len(wl, desc, skb);
566f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsov}
576f266e912c0733e77f63e9ad245db3c966b75942Arik Nemtsov
58cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsovstatic inline enum wl_rx_buf_align
59cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsovwlcore_hw_get_rx_buf_align(struct wl1271 *wl, u32 rx_desc)
60cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsov{
61cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsov
62cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsov	if (!wl->ops->get_rx_buf_align)
63cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsov		BUG_ON(1);
64cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsov
65cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsov	return wl->ops->get_rx_buf_align(wl, rx_desc);
66cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsov}
67cd70f6a48b3fbb841a127361ee4ac0752f9d29a2Arik Nemtsov
68eb96f841b9563ba34969be25615548635728faf5Ido Yarivstatic inline int
69b14684a00439b7b154e63be9446fba19281b8bbcLuciano Coelhowlcore_hw_prepare_read(struct wl1271 *wl, u32 rx_desc, u32 len)
70b14684a00439b7b154e63be9446fba19281b8bbcLuciano Coelho{
71b14684a00439b7b154e63be9446fba19281b8bbcLuciano Coelho	if (wl->ops->prepare_read)
72eb96f841b9563ba34969be25615548635728faf5Ido Yariv		return wl->ops->prepare_read(wl, rx_desc, len);
73eb96f841b9563ba34969be25615548635728faf5Ido Yariv
74eb96f841b9563ba34969be25615548635728faf5Ido Yariv	return 0;
75b14684a00439b7b154e63be9446fba19281b8bbcLuciano Coelho}
76b14684a00439b7b154e63be9446fba19281b8bbcLuciano Coelho
774158149c24e6f933809bc6fe03dbc3fb218b935bArik Nemtsovstatic inline u32
784158149c24e6f933809bc6fe03dbc3fb218b935bArik Nemtsovwlcore_hw_get_rx_packet_len(struct wl1271 *wl, void *rx_data, u32 data_len)
794158149c24e6f933809bc6fe03dbc3fb218b935bArik Nemtsov{
804158149c24e6f933809bc6fe03dbc3fb218b935bArik Nemtsov	if (!wl->ops->get_rx_packet_len)
814158149c24e6f933809bc6fe03dbc3fb218b935bArik Nemtsov		BUG_ON(1);
824158149c24e6f933809bc6fe03dbc3fb218b935bArik Nemtsov
834158149c24e6f933809bc6fe03dbc3fb218b935bArik Nemtsov	return wl->ops->get_rx_packet_len(wl, rx_data, data_len);
844158149c24e6f933809bc6fe03dbc3fb218b935bArik Nemtsov}
854158149c24e6f933809bc6fe03dbc3fb218b935bArik Nemtsov
86045b9b5f4172b2b21af0b9bf5e6dda51146d51a4Ido Yarivstatic inline int wlcore_hw_tx_delayed_compl(struct wl1271 *wl)
8753d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsov{
8853d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsov	if (wl->ops->tx_delayed_compl)
89045b9b5f4172b2b21af0b9bf5e6dda51146d51a4Ido Yariv		return wl->ops->tx_delayed_compl(wl);
90045b9b5f4172b2b21af0b9bf5e6dda51146d51a4Ido Yariv
91045b9b5f4172b2b21af0b9bf5e6dda51146d51a4Ido Yariv	return 0;
9253d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsov}
9353d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsov
9453d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsovstatic inline void wlcore_hw_tx_immediate_compl(struct wl1271 *wl)
9553d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsov{
9653d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsov	if (wl->ops->tx_immediate_compl)
9753d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsov		wl->ops->tx_immediate_compl(wl);
9853d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsov}
9953d67a50cd17aca120dff20eb2a93e1665361688Arik Nemtsov
1008a9affc08d676a9fe627361ab6767cdec0740af3Arik Nemtsovstatic inline int
1018a9affc08d676a9fe627361ab6767cdec0740af3Arik Nemtsovwlcore_hw_init_vif(struct wl1271 *wl, struct wl12xx_vif *wlvif)
1028a9affc08d676a9fe627361ab6767cdec0740af3Arik Nemtsov{
1038a9affc08d676a9fe627361ab6767cdec0740af3Arik Nemtsov	if (wl->ops->init_vif)
1048a9affc08d676a9fe627361ab6767cdec0740af3Arik Nemtsov		return wl->ops->init_vif(wl, wlvif);
1058a9affc08d676a9fe627361ab6767cdec0740af3Arik Nemtsov
1068a9affc08d676a9fe627361ab6767cdec0740af3Arik Nemtsov	return 0;
1078a9affc08d676a9fe627361ab6767cdec0740af3Arik Nemtsov}
1088a9affc08d676a9fe627361ab6767cdec0740af3Arik Nemtsov
10975fb4df7f804229372e073977615a149a4a28dc0Eliad Pellerstatic inline void
11075fb4df7f804229372e073977615a149a4a28dc0Eliad Pellerwlcore_hw_convert_fw_status(struct wl1271 *wl, void *raw_fw_status,
11175fb4df7f804229372e073977615a149a4a28dc0Eliad Peller			    struct wl_fw_status *fw_status)
11275fb4df7f804229372e073977615a149a4a28dc0Eliad Peller{
11375fb4df7f804229372e073977615a149a4a28dc0Eliad Peller	BUG_ON(!wl->ops->convert_fw_status);
11475fb4df7f804229372e073977615a149a4a28dc0Eliad Peller
11575fb4df7f804229372e073977615a149a4a28dc0Eliad Peller	wl->ops->convert_fw_status(wl, raw_fw_status, fw_status);
11675fb4df7f804229372e073977615a149a4a28dc0Eliad Peller}
11775fb4df7f804229372e073977615a149a4a28dc0Eliad Peller
118fa7930afa525e7f481f9d6984a301f69c2255ee4Arik Nemtsovstatic inline u32
119fa7930afa525e7f481f9d6984a301f69c2255ee4Arik Nemtsovwlcore_hw_sta_get_ap_rate_mask(struct wl1271 *wl, struct wl12xx_vif *wlvif)
120fa7930afa525e7f481f9d6984a301f69c2255ee4Arik Nemtsov{
121fa7930afa525e7f481f9d6984a301f69c2255ee4Arik Nemtsov	if (!wl->ops->sta_get_ap_rate_mask)
122fa7930afa525e7f481f9d6984a301f69c2255ee4Arik Nemtsov		BUG_ON(1);
123fa7930afa525e7f481f9d6984a301f69c2255ee4Arik Nemtsov
124fa7930afa525e7f481f9d6984a301f69c2255ee4Arik Nemtsov	return wl->ops->sta_get_ap_rate_mask(wl, wlvif);
125fa7930afa525e7f481f9d6984a301f69c2255ee4Arik Nemtsov}
126fa7930afa525e7f481f9d6984a301f69c2255ee4Arik Nemtsov
12780cd661097f3cb1dcfe45cac983c55d03cdcf64dLuciano Coelhostatic inline int wlcore_identify_fw(struct wl1271 *wl)
12880cd661097f3cb1dcfe45cac983c55d03cdcf64dLuciano Coelho{
12980cd661097f3cb1dcfe45cac983c55d03cdcf64dLuciano Coelho	if (wl->ops->identify_fw)
13080cd661097f3cb1dcfe45cac983c55d03cdcf64dLuciano Coelho		return wl->ops->identify_fw(wl);
13180cd661097f3cb1dcfe45cac983c55d03cdcf64dLuciano Coelho
13280cd661097f3cb1dcfe45cac983c55d03cdcf64dLuciano Coelho	return 0;
13380cd661097f3cb1dcfe45cac983c55d03cdcf64dLuciano Coelho}
13480cd661097f3cb1dcfe45cac983c55d03cdcf64dLuciano Coelho
1352fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsovstatic inline void
1362fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsovwlcore_hw_set_tx_desc_csum(struct wl1271 *wl,
1372fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsov			   struct wl1271_tx_hw_descr *desc,
1382fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsov			   struct sk_buff *skb)
1392fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsov{
1402fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsov	if (!wl->ops->set_tx_desc_csum)
1412fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsov		BUG_ON(1);
1422fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsov
1432fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsov	wl->ops->set_tx_desc_csum(wl, desc, skb);
1442fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsov}
1452fc28de5989e1c40fee4e92e2a8f3bdd47b1b34aArik Nemtsov
146169da04f523bafee46993b1efbddb913641aad56Arik Nemtsovstatic inline void
147169da04f523bafee46993b1efbddb913641aad56Arik Nemtsovwlcore_hw_set_rx_csum(struct wl1271 *wl,
148169da04f523bafee46993b1efbddb913641aad56Arik Nemtsov		      struct wl1271_rx_descriptor *desc,
149169da04f523bafee46993b1efbddb913641aad56Arik Nemtsov		      struct sk_buff *skb)
150169da04f523bafee46993b1efbddb913641aad56Arik Nemtsov{
151169da04f523bafee46993b1efbddb913641aad56Arik Nemtsov	if (wl->ops->set_rx_csum)
152169da04f523bafee46993b1efbddb913641aad56Arik Nemtsov		wl->ops->set_rx_csum(wl, desc, skb);
153169da04f523bafee46993b1efbddb913641aad56Arik Nemtsov}
154169da04f523bafee46993b1efbddb913641aad56Arik Nemtsov
155ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsovstatic inline u32
156ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsovwlcore_hw_ap_get_mimo_wide_rate_mask(struct wl1271 *wl,
157ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsov				     struct wl12xx_vif *wlvif)
158ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsov{
159ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsov	if (wl->ops->ap_get_mimo_wide_rate_mask)
160ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsov		return wl->ops->ap_get_mimo_wide_rate_mask(wl, wlvif);
161ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsov
162ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsov	return 0;
163ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsov}
164ebc7e57ddd01ffa4c996dde7095746259693755dArik Nemtsov
1654987257c304bf5d12e7a5cedde1100ba7f14a8a3Luciano Coelhostatic inline int
1664987257c304bf5d12e7a5cedde1100ba7f14a8a3Luciano Coelhowlcore_debugfs_init(struct wl1271 *wl, struct dentry *rootdir)
1674987257c304bf5d12e7a5cedde1100ba7f14a8a3Luciano Coelho{
1684987257c304bf5d12e7a5cedde1100ba7f14a8a3Luciano Coelho	if (wl->ops->debugfs_init)
1694987257c304bf5d12e7a5cedde1100ba7f14a8a3Luciano Coelho		return wl->ops->debugfs_init(wl, rootdir);
1704987257c304bf5d12e7a5cedde1100ba7f14a8a3Luciano Coelho
1714987257c304bf5d12e7a5cedde1100ba7f14a8a3Luciano Coelho	return 0;
1724987257c304bf5d12e7a5cedde1100ba7f14a8a3Luciano Coelho}
1734987257c304bf5d12e7a5cedde1100ba7f14a8a3Luciano Coelho
1747140df6e51ecca70e8963f18e9836e62090221c2Luciano Coelhostatic inline int
1757140df6e51ecca70e8963f18e9836e62090221c2Luciano Coelhowlcore_handle_static_data(struct wl1271 *wl, void *static_data)
1767140df6e51ecca70e8963f18e9836e62090221c2Luciano Coelho{
1777140df6e51ecca70e8963f18e9836e62090221c2Luciano Coelho	if (wl->ops->handle_static_data)
1787140df6e51ecca70e8963f18e9836e62090221c2Luciano Coelho		return wl->ops->handle_static_data(wl, static_data);
1797140df6e51ecca70e8963f18e9836e62090221c2Luciano Coelho
1807140df6e51ecca70e8963f18e9836e62090221c2Luciano Coelho	return 0;
1817140df6e51ecca70e8963f18e9836e62090221c2Luciano Coelho}
1827140df6e51ecca70e8963f18e9836e62090221c2Luciano Coelho
18332bb2c03f990d015c0fec67e9134ea8625aaf784Arik Nemtsovstatic inline int
18432bb2c03f990d015c0fec67e9134ea8625aaf784Arik Nemtsovwlcore_hw_get_spare_blocks(struct wl1271 *wl, bool is_gem)
18532bb2c03f990d015c0fec67e9134ea8625aaf784Arik Nemtsov{
18632bb2c03f990d015c0fec67e9134ea8625aaf784Arik Nemtsov	if (!wl->ops->get_spare_blocks)
18732bb2c03f990d015c0fec67e9134ea8625aaf784Arik Nemtsov		BUG_ON(1);
18832bb2c03f990d015c0fec67e9134ea8625aaf784Arik Nemtsov
18932bb2c03f990d015c0fec67e9134ea8625aaf784Arik Nemtsov	return wl->ops->get_spare_blocks(wl, is_gem);
19032bb2c03f990d015c0fec67e9134ea8625aaf784Arik Nemtsov}
19132bb2c03f990d015c0fec67e9134ea8625aaf784Arik Nemtsov
192a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsovstatic inline int
193a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsovwlcore_hw_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
194a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov		  struct ieee80211_vif *vif,
195a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov		  struct ieee80211_sta *sta,
196a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov		  struct ieee80211_key_conf *key_conf)
197a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov{
198a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov	if (!wl->ops->set_key)
199a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov		BUG_ON(1);
200a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov
201a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov	return wl->ops->set_key(wl, cmd, vif, sta, key_conf);
202a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov}
203a1c597f2b22cdc228de3c58784b00e80b9b53e03Arik Nemtsov
2049fccc82e19db0d63741cd6c3d2a8829fc8854406Ido Reisstatic inline u32
2059fccc82e19db0d63741cd6c3d2a8829fc8854406Ido Reiswlcore_hw_pre_pkt_send(struct wl1271 *wl, u32 buf_offset, u32 last_len)
2069fccc82e19db0d63741cd6c3d2a8829fc8854406Ido Reis{
2079fccc82e19db0d63741cd6c3d2a8829fc8854406Ido Reis	if (wl->ops->pre_pkt_send)
2089fccc82e19db0d63741cd6c3d2a8829fc8854406Ido Reis		return wl->ops->pre_pkt_send(wl, buf_offset, last_len);
2099fccc82e19db0d63741cd6c3d2a8829fc8854406Ido Reis
2109fccc82e19db0d63741cd6c3d2a8829fc8854406Ido Reis	return buf_offset;
2119fccc82e19db0d63741cd6c3d2a8829fc8854406Ido Reis}
2129fccc82e19db0d63741cd6c3d2a8829fc8854406Ido Reis
2135f9b67770be4201f4449b0f180effecaac4e2686Arik Nemtsovstatic inline void
2145f9b67770be4201f4449b0f180effecaac4e2686Arik Nemtsovwlcore_hw_sta_rc_update(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2155f9b67770be4201f4449b0f180effecaac4e2686Arik Nemtsov			struct ieee80211_sta *sta, u32 changed)
2165f9b67770be4201f4449b0f180effecaac4e2686Arik Nemtsov{
2175f9b67770be4201f4449b0f180effecaac4e2686Arik Nemtsov	if (wl->ops->sta_rc_update)
2185f9b67770be4201f4449b0f180effecaac4e2686Arik Nemtsov		wl->ops->sta_rc_update(wl, wlvif, sta, changed);
2195f9b67770be4201f4449b0f180effecaac4e2686Arik Nemtsov}
2205f9b67770be4201f4449b0f180effecaac4e2686Arik Nemtsov
221530abe195df6918d43c9381fd9a70b7e16d55036Eliad Pellerstatic inline int
222530abe195df6918d43c9381fd9a70b7e16d55036Eliad Pellerwlcore_hw_set_peer_cap(struct wl1271 *wl,
223530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller		       struct ieee80211_sta_ht_cap *ht_cap,
224530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller		       bool allow_ht_operation,
225530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller		       u32 rate_set, u8 hlid)
226530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller{
227530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller	if (wl->ops->set_peer_cap)
228530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller		return wl->ops->set_peer_cap(wl, ht_cap, allow_ht_operation,
229530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller					     rate_set, hlid);
230530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller
231530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller	return 0;
232530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller}
233530abe195df6918d43c9381fd9a70b7e16d55036Eliad Peller
234c83cb8031bdd7923c7c5ea87accede4a5fc3282aIgal Chernobelskystatic inline u32
235c83cb8031bdd7923c7c5ea87accede4a5fc3282aIgal Chernobelskywlcore_hw_convert_hwaddr(struct wl1271 *wl, u32 hwaddr)
236c83cb8031bdd7923c7c5ea87accede4a5fc3282aIgal Chernobelsky{
237c83cb8031bdd7923c7c5ea87accede4a5fc3282aIgal Chernobelsky	if (!wl->ops->convert_hwaddr)
238c83cb8031bdd7923c7c5ea87accede4a5fc3282aIgal Chernobelsky		BUG_ON(1);
239c83cb8031bdd7923c7c5ea87accede4a5fc3282aIgal Chernobelsky
240c83cb8031bdd7923c7c5ea87accede4a5fc3282aIgal Chernobelsky	return wl->ops->convert_hwaddr(wl, hwaddr);
241c83cb8031bdd7923c7c5ea87accede4a5fc3282aIgal Chernobelsky}
242c83cb8031bdd7923c7c5ea87accede4a5fc3282aIgal Chernobelsky
243f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsovstatic inline bool
244f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsovwlcore_hw_lnk_high_prio(struct wl1271 *wl, u8 hlid,
245f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov			struct wl1271_link *lnk)
246f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov{
247f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov	if (!wl->ops->lnk_high_prio)
248f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov		BUG_ON(1);
249f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov
250f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov	return wl->ops->lnk_high_prio(wl, hlid, lnk);
251f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov}
252f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov
253f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsovstatic inline bool
254f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsovwlcore_hw_lnk_low_prio(struct wl1271 *wl, u8 hlid,
255f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov		       struct wl1271_link *lnk)
256f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov{
257f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov	if (!wl->ops->lnk_low_prio)
258f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov		BUG_ON(1);
259f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov
260f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov	return wl->ops->lnk_low_prio(wl, hlid, lnk);
261f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov}
262f1626fd8983a5bc68ce2879865cce297eb96c0b4Arik Nemtsov
263ccb1df948085abcac0a91154e9cabeb563b65833Eliad Pellerstatic inline int
264ccb1df948085abcac0a91154e9cabeb563b65833Eliad Pellerwlcore_smart_config_start(struct wl1271 *wl, u32 group_bitmap)
265ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller{
266ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller	if (!wl->ops->smart_config_start)
267ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller		return -EINVAL;
268ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller
269ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller	return wl->ops->smart_config_start(wl, group_bitmap);
270ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller}
271ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller
272ccb1df948085abcac0a91154e9cabeb563b65833Eliad Pellerstatic inline int
273ccb1df948085abcac0a91154e9cabeb563b65833Eliad Pellerwlcore_smart_config_stop(struct wl1271 *wl)
274ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller{
275ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller	if (!wl->ops->smart_config_stop)
276ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller		return -EINVAL;
277ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller
278ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller	return wl->ops->smart_config_stop(wl);
279ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller}
280ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller
281ccb1df948085abcac0a91154e9cabeb563b65833Eliad Pellerstatic inline int
282ccb1df948085abcac0a91154e9cabeb563b65833Eliad Pellerwlcore_smart_config_set_group_key(struct wl1271 *wl, u16 group_id,
283ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller				  u8 key_len, u8 *key)
284ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller{
285ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller	if (!wl->ops->smart_config_set_group_key)
286ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller		return -EINVAL;
287ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller
288ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller	return wl->ops->smart_config_set_group_key(wl, group_id, key_len, key);
289ccb1df948085abcac0a91154e9cabeb563b65833Eliad Peller}
290b3b4b4b812018a06221b6d7b88a5540fccae2940Arik Nemtsov#endif
291