1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 /*
4  *  This file contains declaration referring to
5  *  functions defined in other source files
6  */
7 
8 #ifndef _LBS_DECL_H_
9 #define _LBS_DECL_H_
10 
11 #include <linux/netdevice.h>
12 #include <linux/firmware.h>
13 #include <linux/nl80211.h>
14 
15 /* Should be terminated by a NULL entry */
16 struct lbs_fw_table {
17 	int model;
18 	const char *helper;
19 	const char *fwname;
20 };
21 
22 struct lbs_private;
23 typedef void (*lbs_fw_cb)(struct lbs_private *priv, int ret,
24 		const struct firmware *helper, const struct firmware *mainfw);
25 
26 struct lbs_private;
27 struct sk_buff;
28 struct net_device;
29 struct cmd_ds_command;
30 
31 
32 /* ethtool.c */
33 extern const struct ethtool_ops lbs_ethtool_ops;
34 
35 
36 /* tx.c */
37 void lbs_send_tx_feedback(struct lbs_private *priv, u32 try_count);
38 netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb,
39 				struct net_device *dev);
40 
41 /* rx.c */
42 int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *);
43 
44 
45 /* main.c */
46 struct lbs_private *lbs_add_card(void *card, struct device *dmdev);
47 void lbs_remove_card(struct lbs_private *priv);
48 int lbs_start_card(struct lbs_private *priv);
49 void lbs_stop_card(struct lbs_private *priv);
50 void lbs_host_to_card_done(struct lbs_private *priv);
51 
52 int lbs_start_iface(struct lbs_private *priv);
53 int lbs_stop_iface(struct lbs_private *priv);
54 int lbs_set_iface_type(struct lbs_private *priv, enum nl80211_iftype type);
55 
56 int lbs_rtap_supported(struct lbs_private *priv);
57 
58 int lbs_set_mac_address(struct net_device *dev, void *addr);
59 void lbs_set_multicast_list(struct net_device *dev);
60 void lbs_update_mcast(struct lbs_private *priv);
61 
62 int lbs_suspend(struct lbs_private *priv);
63 int lbs_resume(struct lbs_private *priv);
64 
65 void lbs_queue_event(struct lbs_private *priv, u32 event);
66 void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx);
67 
68 int lbs_enter_auto_deep_sleep(struct lbs_private *priv);
69 int lbs_exit_auto_deep_sleep(struct lbs_private *priv);
70 
71 u32 lbs_fw_index_to_data_rate(u8 index);
72 u8 lbs_data_rate_to_fw_index(u32 rate);
73 
74 int lbs_get_firmware(struct device *dev, u32 card_model,
75 			const struct lbs_fw_table *fw_table,
76 			const struct firmware **helper,
77 			const struct firmware **mainfw);
78 int lbs_get_firmware_async(struct lbs_private *priv, struct device *device,
79 			   u32 card_model, const struct lbs_fw_table *fw_table,
80 			   lbs_fw_cb callback);
81 void lbs_wait_for_firmware_load(struct lbs_private *priv);
82 
83 #endif
84