1*73b01e57SJeff Chen /* SPDX-License-Identifier: GPL-2.0-only */
2*73b01e57SJeff Chen /*
3*73b01e57SJeff Chen * nxpwifi: commands and events
4*73b01e57SJeff Chen *
5*73b01e57SJeff Chen * Copyright 2011-2024 NXP
6*73b01e57SJeff Chen */
7*73b01e57SJeff Chen
8*73b01e57SJeff Chen #ifndef _NXPWIFI_CMD_EVT_H_
9*73b01e57SJeff Chen #define _NXPWIFI_CMD_EVT_H_
10*73b01e57SJeff Chen
11*73b01e57SJeff Chen struct nxpwifi_cmd_entry {
12*73b01e57SJeff Chen u16 cmd_no;
13*73b01e57SJeff Chen int (*prepare_cmd)(struct nxpwifi_private *priv,
14*73b01e57SJeff Chen struct host_cmd_ds_command *cmd,
15*73b01e57SJeff Chen u16 cmd_no, void *data_buf,
16*73b01e57SJeff Chen u16 cmd_action, u32 cmd_type);
17*73b01e57SJeff Chen int (*cmd_resp)(struct nxpwifi_private *priv,
18*73b01e57SJeff Chen struct host_cmd_ds_command *resp,
19*73b01e57SJeff Chen u16 cmdresp_no,
20*73b01e57SJeff Chen void *data_buf);
21*73b01e57SJeff Chen };
22*73b01e57SJeff Chen
23*73b01e57SJeff Chen struct nxpwifi_evt_entry {
24*73b01e57SJeff Chen u32 event_cause;
25*73b01e57SJeff Chen int (*event_handler)(struct nxpwifi_private *priv);
26*73b01e57SJeff Chen };
27*73b01e57SJeff Chen
28*73b01e57SJeff Chen static inline int
nxpwifi_cmd_fill_head_only(struct nxpwifi_private * priv,struct host_cmd_ds_command * cmd,u16 cmd_no,void * data_buf,u16 cmd_action,u32 cmd_type)29*73b01e57SJeff Chen nxpwifi_cmd_fill_head_only(struct nxpwifi_private *priv,
30*73b01e57SJeff Chen struct host_cmd_ds_command *cmd,
31*73b01e57SJeff Chen u16 cmd_no, void *data_buf,
32*73b01e57SJeff Chen u16 cmd_action, u32 cmd_type)
33*73b01e57SJeff Chen {
34*73b01e57SJeff Chen cmd->command = cpu_to_le16(cmd_no);
35*73b01e57SJeff Chen cmd->size = cpu_to_le16(S_DS_GEN);
36*73b01e57SJeff Chen
37*73b01e57SJeff Chen return 0;
38*73b01e57SJeff Chen }
39*73b01e57SJeff Chen
40*73b01e57SJeff Chen int nxpwifi_send_cmd(struct nxpwifi_private *priv, u16 cmd_no,
41*73b01e57SJeff Chen u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync);
42*73b01e57SJeff Chen int nxpwifi_sta_prepare_cmd(struct nxpwifi_private *priv,
43*73b01e57SJeff Chen struct cmd_ctrl_node *cmd_node,
44*73b01e57SJeff Chen u16 cmd_action, u32 cmd_oid);
45*73b01e57SJeff Chen int nxpwifi_sta_init_cmd(struct nxpwifi_private *priv, u8 first_sta, bool init);
46*73b01e57SJeff Chen int nxpwifi_uap_prepare_cmd(struct nxpwifi_private *priv,
47*73b01e57SJeff Chen struct cmd_ctrl_node *cmd_node,
48*73b01e57SJeff Chen u16 cmd_action, u32 type);
49*73b01e57SJeff Chen int nxpwifi_set_secure_params(struct nxpwifi_private *priv,
50*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *bss_config,
51*73b01e57SJeff Chen struct cfg80211_ap_settings *params);
52*73b01e57SJeff Chen void nxpwifi_set_ht_params(struct nxpwifi_private *priv,
53*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *bss_cfg,
54*73b01e57SJeff Chen struct cfg80211_ap_settings *params);
55*73b01e57SJeff Chen void nxpwifi_set_vht_params(struct nxpwifi_private *priv,
56*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *bss_cfg,
57*73b01e57SJeff Chen struct cfg80211_ap_settings *params);
58*73b01e57SJeff Chen void nxpwifi_set_tpc_params(struct nxpwifi_private *priv,
59*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *bss_cfg,
60*73b01e57SJeff Chen struct cfg80211_ap_settings *params);
61*73b01e57SJeff Chen void nxpwifi_set_uap_rates(struct nxpwifi_uap_bss_param *bss_cfg,
62*73b01e57SJeff Chen struct cfg80211_ap_settings *params);
63*73b01e57SJeff Chen void nxpwifi_set_vht_width(struct nxpwifi_private *priv,
64*73b01e57SJeff Chen enum nl80211_chan_width width,
65*73b01e57SJeff Chen bool ap_11ac_disable);
66*73b01e57SJeff Chen bool nxpwifi_check_11ax_capability(struct nxpwifi_private *priv,
67*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *bss_cfg,
68*73b01e57SJeff Chen struct cfg80211_ap_settings *params);
69*73b01e57SJeff Chen int nxpwifi_set_11ax_status(struct nxpwifi_private *priv,
70*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *bss_cfg,
71*73b01e57SJeff Chen struct cfg80211_ap_settings *params);
72*73b01e57SJeff Chen void nxpwifi_set_sys_config_invalid_data(struct nxpwifi_uap_bss_param *config);
73*73b01e57SJeff Chen void nxpwifi_set_wmm_params(struct nxpwifi_private *priv,
74*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *bss_cfg,
75*73b01e57SJeff Chen struct cfg80211_ap_settings *params);
76*73b01e57SJeff Chen void nxpwifi_config_uap_11d(struct nxpwifi_private *priv,
77*73b01e57SJeff Chen struct cfg80211_beacon_data *beacon_data);
78*73b01e57SJeff Chen void nxpwifi_uap_set_channel(struct nxpwifi_private *priv,
79*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *bss_cfg,
80*73b01e57SJeff Chen struct cfg80211_chan_def chandef);
81*73b01e57SJeff Chen int nxpwifi_config_start_uap(struct nxpwifi_private *priv,
82*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *bss_cfg);
83*73b01e57SJeff Chen int nxpwifi_process_event(struct nxpwifi_adapter *adapter);
84*73b01e57SJeff Chen int nxpwifi_process_sta_event(struct nxpwifi_private *priv);
85*73b01e57SJeff Chen int nxpwifi_process_uap_event(struct nxpwifi_private *priv);
86*73b01e57SJeff Chen void nxpwifi_reset_connect_state(struct nxpwifi_private *priv, u16 reason,
87*73b01e57SJeff Chen bool from_ap);
88*73b01e57SJeff Chen void nxpwifi_process_multi_chan_event(struct nxpwifi_private *priv,
89*73b01e57SJeff Chen struct sk_buff *event_skb);
90*73b01e57SJeff Chen void nxpwifi_process_tx_pause_event(struct nxpwifi_private *priv,
91*73b01e57SJeff Chen struct sk_buff *event);
92*73b01e57SJeff Chen void nxpwifi_bt_coex_wlan_param_update_event(struct nxpwifi_private *priv,
93*73b01e57SJeff Chen struct sk_buff *event_skb);
94*73b01e57SJeff Chen int nxpwifi_mgmt_frame_reg(struct nxpwifi_private *priv, u32 mask);
95*73b01e57SJeff Chen int nxpwifi_set_uap_sys_cfg(struct nxpwifi_private *priv,
96*73b01e57SJeff Chen struct nxpwifi_uap_bss_param *cfg);
97*73b01e57SJeff Chen int nxpwifi_set_rts(struct nxpwifi_private *priv, u32 rts_thr);
98*73b01e57SJeff Chen int nxpwifi_set_frag(struct nxpwifi_private *priv, u32 frag_thr);
99*73b01e57SJeff Chen int nxpwifi_set_bss_mode(struct nxpwifi_private *priv);
100*73b01e57SJeff Chen int nxpwifi_config_monitor_mode(struct nxpwifi_private *priv,
101*73b01e57SJeff Chen struct nxpwifi_802_11_net_monitor *cfg);
102*73b01e57SJeff Chen int nxpwifi_apply_regdomain(struct nxpwifi_private *priv);
103*73b01e57SJeff Chen int nxpwifi_get_tx_pwr(struct nxpwifi_private *priv);
104*73b01e57SJeff Chen int nxpwifi_get_rssi_info(struct nxpwifi_private *priv);
105*73b01e57SJeff Chen int nxpwifi_get_802_11_snmp_mib(struct nxpwifi_private *priv, u16 oid, void *value);
106*73b01e57SJeff Chen int nxpwifi_set_rf_antenna(struct nxpwifi_private *priv, void *antcfg);
107*73b01e57SJeff Chen int nxpwifi_get_rf_antenna(struct nxpwifi_private *priv, u32 *tx_ant, u32 *rx_ant);
108*73b01e57SJeff Chen int nxpwifi_ap_stop_bss(struct nxpwifi_private *priv);
109*73b01e57SJeff Chen int nxpwifi_ap_sys_reset(struct nxpwifi_private *priv);
110*73b01e57SJeff Chen int nxpwifi_cfg80211_deinit_p2p(struct nxpwifi_private *priv);
111*73b01e57SJeff Chen int nxpwifi_ap_get_sta_list(struct nxpwifi_private *priv);
112*73b01e57SJeff Chen int nxpwifi_set_tx_rate(struct nxpwifi_private *priv, void *bitmap_rates);
113*73b01e57SJeff Chen int nxpwifi_802_11_subscribe_event(struct nxpwifi_private *priv,
114*73b01e57SJeff Chen struct nxpwifi_ds_misc_subsc_evt *subsc_evt);
115*73b01e57SJeff Chen int nxpwifi_uap_sta_deauth(struct nxpwifi_private *priv, u8 *mac);
116*73b01e57SJeff Chen int nxpwifi_bg_scan_config(struct nxpwifi_private *priv, void *bg_scan_cfg);
117*73b01e57SJeff Chen int nxpwifi_mef_cfg(struct nxpwifi_private *priv, void *mef_cfg);
118*73b01e57SJeff Chen int nxpwifi_coalesce_cfg(struct nxpwifi_private *priv, void *coalesce_cfg);
119*73b01e57SJeff Chen int nxpwifi_add_new_station(struct nxpwifi_private *priv, void *add_sta);
120*73b01e57SJeff Chen int nxpwifi_hostcmd(struct nxpwifi_private *priv, struct nxpwifi_ds_misc_cmd *hostcmd);
121*73b01e57SJeff Chen int nxpwifi_chan_report_request(struct nxpwifi_private *priv, void *radar_params);
122*73b01e57SJeff Chen #endif /* !_NXPWIFI_CMD_EVT_H_ */
123