1*4882a593Smuzhiyun /****************************************************************************** 2*4882a593Smuzhiyun * 3*4882a593Smuzhiyun * Copyright(c) 2019 Realtek Corporation. 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * This program is free software; you can redistribute it and/or modify it 6*4882a593Smuzhiyun * under the terms of version 2 of the GNU General Public License as 7*4882a593Smuzhiyun * published by the Free Software Foundation. 8*4882a593Smuzhiyun * 9*4882a593Smuzhiyun * This program is distributed in the hope that it will be useful, but WITHOUT 10*4882a593Smuzhiyun * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11*4882a593Smuzhiyun * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12*4882a593Smuzhiyun * more details. 13*4882a593Smuzhiyun * 14*4882a593Smuzhiyun *****************************************************************************/ 15*4882a593Smuzhiyun #ifndef _PHL_API_H_ 16*4882a593Smuzhiyun #define _PHL_API_H_ 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun u8 rtw_phl_read8(void *phl, u32 addr); 19*4882a593Smuzhiyun u16 rtw_phl_read16(void *phl, u32 addr); 20*4882a593Smuzhiyun u32 rtw_phl_read32(void *phl, u32 addr); 21*4882a593Smuzhiyun void rtw_phl_write8(void *phl, u32 addr, u8 val); 22*4882a593Smuzhiyun void rtw_phl_write16(void *phl, u32 addr, u16 val); 23*4882a593Smuzhiyun void rtw_phl_write32(void *phl, u32 addr, u32 val); 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun u32 rtw_phl_read_macreg(void *phl, u32 offset, u32 bit_mask); 26*4882a593Smuzhiyun void rtw_phl_write_macreg(void *phl, 27*4882a593Smuzhiyun u32 offset, u32 bit_mask, u32 data); 28*4882a593Smuzhiyun u32 rtw_phl_read_bbreg(void *phl, u32 offset, u32 bit_mask); 29*4882a593Smuzhiyun void rtw_phl_write_bbreg(void *phl, 30*4882a593Smuzhiyun u32 offset, u32 bit_mask, u32 data); 31*4882a593Smuzhiyun u32 rtw_phl_read_rfreg(void *phl, 32*4882a593Smuzhiyun enum rf_path path, u32 offset, u32 bit_mask); 33*4882a593Smuzhiyun void rtw_phl_write_rfreg(void *phl, 34*4882a593Smuzhiyun enum rf_path path, u32 offset, u32 bit_mask, u32 data); 35*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_interrupt_handler(void *phl); 36*4882a593Smuzhiyun void rtw_phl_enable_interrupt(void *phl); 37*4882a593Smuzhiyun void rtw_phl_disable_interrupt(void *phl); 38*4882a593Smuzhiyun bool rtw_phl_recognize_interrupt(void *phl); 39*4882a593Smuzhiyun void rtw_phl_clear_interrupt(void *phl); 40*4882a593Smuzhiyun void rtw_phl_restore_interrupt(void *phl); 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun #ifdef PHL_PLATFORM_LINUX 44*4882a593Smuzhiyun void rtw_phl_mac_reg_dump(void *sel, void *phl); 45*4882a593Smuzhiyun void rtw_phl_bb_reg_dump(void *sel, void *phl); 46*4882a593Smuzhiyun void rtw_phl_bb_reg_dump_ex(void *sel, void *phl); 47*4882a593Smuzhiyun void rtw_phl_rf_reg_dump(void *sel, void *phl); 48*4882a593Smuzhiyun #endif 49*4882a593Smuzhiyun bool rtw_phl_get_sec_cam(void *phl, u16 num, u8 *buf, u16 size); 50*4882a593Smuzhiyun bool rtw_phl_get_addr_cam(void *phl, u16 num, u8 *buf, u16 size); 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun struct rtw_phl_com_t *rtw_phl_get_com(void *phl); 53*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_init(void *drv_priv, void **phl, 54*4882a593Smuzhiyun struct rtw_ic_info *ic_info); 55*4882a593Smuzhiyun void rtw_phl_deinit(void *phl); 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun void rtw_phl_watchdog_init(void *phl, 58*4882a593Smuzhiyun u16 period, 59*4882a593Smuzhiyun void (*core_sw_wdog)(void *drv_priv), 60*4882a593Smuzhiyun void (*core_hw_wdog)(void *drv_priv)); 61*4882a593Smuzhiyun void rtw_phl_watchdog_deinit(void *phl); 62*4882a593Smuzhiyun void rtw_phl_watchdog_start(void *phl); 63*4882a593Smuzhiyun void rtw_phl_watchdog_stop(void *phl); 64*4882a593Smuzhiyun 65*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_trx_alloc(void *phl); 66*4882a593Smuzhiyun void rtw_phl_trx_free(void *phl); 67*4882a593Smuzhiyun void rtw_phl_trx_free_handler(void *phl); 68*4882a593Smuzhiyun void rtw_phl_trx_free_sw_rsc(void *phl); 69*4882a593Smuzhiyun void rtw_phl_cap_pre_config(void *phl); 70*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_preload(void *phl); 71*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_start(void *phl); 72*4882a593Smuzhiyun void rtw_phl_stop(void *phl); 73*4882a593Smuzhiyun bool rtw_phl_is_init_completed(void *phl); 74*4882a593Smuzhiyun 75*4882a593Smuzhiyun void rtw_phl_ps_set_rt_cap(void *phl, u8 band_idx, bool ps_allow, enum phl_ps_rt_rson rt_rson); 76*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_ps_set_rf_state(void *phl, u8 band_idx, enum rtw_rf_state rf_state); 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_suspend(void *phl, struct rtw_phl_stainfo_t *sta, u8 wow_en); 79*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_resume(void *phl, struct rtw_phl_stainfo_t *sta, u8 *hw_reinit); 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_tx_req_notify(void *phl); 82*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_add_tx_req(void *phl, struct rtw_xmit_req *tx_req); 83*4882a593Smuzhiyun void rtw_phl_tx_stop(void *phl); 84*4882a593Smuzhiyun void rtw_phl_tx_resume(void *phl); 85*4882a593Smuzhiyun u16 rtw_phl_tring_rsc(void *phl, u16 macid, u8 tid); 86*4882a593Smuzhiyun u16 rtw_phl_query_new_rx_num(void *phl); 87*4882a593Smuzhiyun struct rtw_recv_pkt *rtw_phl_query_rx_pkt(void *phl); 88*4882a593Smuzhiyun 89*4882a593Smuzhiyun void rtw_phl_rx_deferred_In_token(void *phl); 90*4882a593Smuzhiyun void rtw_phl_post_in_complete(void *phl, void *rxobj, u32 inbuf_len, u8 status_code); 91*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_return_rxbuf(void *phl, u8* rxpkt); 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_recycle_tx_buf(void *phl, u8 *tx_buf_ptr); 94*4882a593Smuzhiyun 95*4882a593Smuzhiyun enum rtw_phl_status 96*4882a593Smuzhiyun rtw_phl_cmd_cfg_ampdu(void *phl, 97*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole, 98*4882a593Smuzhiyun struct rtw_phl_stainfo_t *sta, 99*4882a593Smuzhiyun enum phl_cmd_type cmd_type, 100*4882a593Smuzhiyun u32 cmd_timeout); 101*4882a593Smuzhiyun 102*4882a593Smuzhiyun void rtw_phl_proc_cmd(void *phl, char proc_cmd, 103*4882a593Smuzhiyun struct rtw_proc_cmd *incmd, char *output, u32 out_len); 104*4882a593Smuzhiyun 105*4882a593Smuzhiyun void rtw_phl_get_fw_ver(void *phl, char *ver_str, u16 len); 106*4882a593Smuzhiyun 107*4882a593Smuzhiyun enum rtw_fw_status rtw_phl_get_fw_status(void *phl); 108*4882a593Smuzhiyun 109*4882a593Smuzhiyun /* command thread jobs */ 110*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_job_run_func(void *phl, 111*4882a593Smuzhiyun void *func, void *priv, void *parm, char *name); 112*4882a593Smuzhiyun 113*4882a593Smuzhiyun /*WIFI Role management section*/ 114*4882a593Smuzhiyun u8 rtw_phl_wifi_role_alloc(void *phl, u8 *mac_addr, enum role_type type, 115*4882a593Smuzhiyun u8 ridx, struct rtw_wifi_role_t **wifi_role, bool ignore_hw_fail); 116*4882a593Smuzhiyun 117*4882a593Smuzhiyun enum rtw_phl_status 118*4882a593Smuzhiyun rtw_phl_cmd_wrole_change(void *phl, 119*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole, 120*4882a593Smuzhiyun enum wr_chg_id chg_id, u8 *chg_info, u8 chg_info_len, 121*4882a593Smuzhiyun enum phl_cmd_type cmd_type, u32 cmd_timeout); 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun void rtw_phl_wifi_role_free(void *phl, u8 role_idx); 124*4882a593Smuzhiyun 125*4882a593Smuzhiyun /*WIFI sta_info management section*/ 126*4882a593Smuzhiyun struct rtw_phl_stainfo_t * 127*4882a593Smuzhiyun rtw_phl_alloc_stainfo_sw(void *phl, 128*4882a593Smuzhiyun u8 *sta_addr, 129*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole); 130*4882a593Smuzhiyun 131*4882a593Smuzhiyun enum rtw_phl_status 132*4882a593Smuzhiyun rtw_phl_free_stainfo_sw(void *phl, struct rtw_phl_stainfo_t *sta); 133*4882a593Smuzhiyun 134*4882a593Smuzhiyun enum rtw_phl_status 135*4882a593Smuzhiyun rtw_phl_cmd_alloc_stainfo(void *phl, 136*4882a593Smuzhiyun struct rtw_phl_stainfo_t **sta, 137*4882a593Smuzhiyun u8 *sta_addr, 138*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole, 139*4882a593Smuzhiyun bool alloc, 140*4882a593Smuzhiyun bool only_hw, 141*4882a593Smuzhiyun enum phl_cmd_type cmd_type, 142*4882a593Smuzhiyun u32 cmd_timeout); 143*4882a593Smuzhiyun 144*4882a593Smuzhiyun enum rtw_phl_status 145*4882a593Smuzhiyun rtw_phl_cmd_change_stainfo(void *phl, 146*4882a593Smuzhiyun struct rtw_phl_stainfo_t *sta, enum sta_chg_id chg_id, 147*4882a593Smuzhiyun u8 *chg_info, u8 chg_info_len, 148*4882a593Smuzhiyun enum phl_cmd_type cmd_type, u32 cmd_timeout); 149*4882a593Smuzhiyun 150*4882a593Smuzhiyun enum rtw_phl_status 151*4882a593Smuzhiyun rtw_phl_cmd_update_media_status(void *phl, 152*4882a593Smuzhiyun struct rtw_phl_stainfo_t *sta, 153*4882a593Smuzhiyun u8 *sta_addr, 154*4882a593Smuzhiyun bool is_connect, 155*4882a593Smuzhiyun enum phl_cmd_type cmd_type, 156*4882a593Smuzhiyun u32 cmd_timeout); 157*4882a593Smuzhiyun 158*4882a593Smuzhiyun struct rtw_phl_stainfo_t * 159*4882a593Smuzhiyun rtw_phl_get_stainfo_self(void *phl, struct rtw_wifi_role_t *wrole); 160*4882a593Smuzhiyun 161*4882a593Smuzhiyun struct rtw_phl_stainfo_t * 162*4882a593Smuzhiyun rtw_phl_get_stainfo_by_addr(void *phl, struct rtw_wifi_role_t *wrole, u8 *addr); 163*4882a593Smuzhiyun 164*4882a593Smuzhiyun struct rtw_phl_stainfo_t * 165*4882a593Smuzhiyun rtw_phl_get_stainfo_by_macid(void *phl, u16 macid); 166*4882a593Smuzhiyun 167*4882a593Smuzhiyun u8 168*4882a593Smuzhiyun rtw_phl_get_sta_rssi(struct rtw_phl_stainfo_t *sta); 169*4882a593Smuzhiyun 170*4882a593Smuzhiyun enum rtw_phl_status 171*4882a593Smuzhiyun rtw_phl_query_rainfo(void *phl, struct rtw_phl_stainfo_t *phl_sta, 172*4882a593Smuzhiyun struct rtw_phl_rainfo *ra_info); 173*4882a593Smuzhiyun enum rtw_phl_status 174*4882a593Smuzhiyun rtw_phl_get_rx_stat(void *phl, struct rtw_phl_stainfo_t *phl_sta, 175*4882a593Smuzhiyun u16 *rx_rate, u8 *bw, u8 *gi_ltf); 176*4882a593Smuzhiyun 177*4882a593Smuzhiyun void rtw_phl_sta_up_rx_bcn(void *phl, struct rtw_bcn_pkt_info *info); 178*4882a593Smuzhiyun 179*4882a593Smuzhiyun /*macid management section, temporary for debuge*/ 180*4882a593Smuzhiyun u16 181*4882a593Smuzhiyun rtw_phl_get_macid_max_num(void *phl); 182*4882a593Smuzhiyun 183*4882a593Smuzhiyun u16 184*4882a593Smuzhiyun rtw_phl_wrole_bcmc_id_get(void *phl, struct rtw_wifi_role_t *wrole); 185*4882a593Smuzhiyun 186*4882a593Smuzhiyun u8 187*4882a593Smuzhiyun rtw_phl_macid_is_bmc(void *phl, u16 macid); 188*4882a593Smuzhiyun 189*4882a593Smuzhiyun u8 190*4882a593Smuzhiyun rtw_phl_macid_is_used(void *phl, u16 macid); 191*4882a593Smuzhiyun 192*4882a593Smuzhiyun enum rtw_phl_status 193*4882a593Smuzhiyun rtw_phl_cmd_add_key(void *phl, 194*4882a593Smuzhiyun struct rtw_phl_stainfo_t *sta, 195*4882a593Smuzhiyun struct phl_sec_param_h *crypt, 196*4882a593Smuzhiyun u8 *keybuf, 197*4882a593Smuzhiyun enum phl_cmd_type cmd_type, 198*4882a593Smuzhiyun u32 cmd_timeout); 199*4882a593Smuzhiyun 200*4882a593Smuzhiyun enum rtw_phl_status 201*4882a593Smuzhiyun rtw_phl_cmd_del_key(void *phl, 202*4882a593Smuzhiyun struct rtw_phl_stainfo_t *sta, 203*4882a593Smuzhiyun struct phl_sec_param_h *crypt, 204*4882a593Smuzhiyun enum phl_cmd_type cmd_type, 205*4882a593Smuzhiyun u32 cmd_timeout); 206*4882a593Smuzhiyun /* phy msg forwarder functions*/ 207*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_msg_hub_register_recver(void* phl, 208*4882a593Smuzhiyun struct phl_msg_receiver* ctx, enum phl_msg_recver_layer layer); 209*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_msg_hub_update_recver_mask(void* phl, 210*4882a593Smuzhiyun enum phl_msg_recver_layer layer, u8* mdl_id, u32 len, u8 clr); 211*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_msg_hub_deregister_recver(void* phl, 212*4882a593Smuzhiyun enum phl_msg_recver_layer layer); 213*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_msg_hub_send(void* phl, 214*4882a593Smuzhiyun struct phl_msg_attribute* attr, struct phl_msg* msg); 215*4882a593Smuzhiyun 216*4882a593Smuzhiyun 217*4882a593Smuzhiyun u8 rtw_phl_trans_sec_mode(u8 unicast, u8 multicast); 218*4882a593Smuzhiyun 219*4882a593Smuzhiyun u8 rtw_phl_get_sec_cam_idx(void *phl, struct rtw_phl_stainfo_t *sta, 220*4882a593Smuzhiyun u8 keyid, u8 key_type); 221*4882a593Smuzhiyun 222*4882a593Smuzhiyun void rtw_phl_test_txtb_cfg(struct rtw_phl_com_t* phl_com, void *buf, 223*4882a593Smuzhiyun u32 buf_len, u8 *cfg_bssid, u16 cfg_aid, u8 cfg_bsscolor); 224*4882a593Smuzhiyun /* command dispatcher module section*/ 225*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_register_module(void *phl, u8 band_idx, 226*4882a593Smuzhiyun enum phl_module_id id, 227*4882a593Smuzhiyun struct phl_bk_module_ops* ops); 228*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_deregister_module(void *phl,u8 band_idx, 229*4882a593Smuzhiyun enum phl_module_id id); 230*4882a593Smuzhiyun u8 rtw_phl_is_fg_empty(void *phl, u8 band_idx); 231*4882a593Smuzhiyun /* opt: refer to enum phl_msg_opt */ 232*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_send_msg_to_dispr(void *phl, struct phl_msg* msg, 233*4882a593Smuzhiyun struct phl_msg_attribute* attr, u32* msg_hdl); 234*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_cancel_dispr_msg(void *phl, u8 band_idx, u32* msg_hdl); 235*4882a593Smuzhiyun 236*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_add_cmd_token_req(void *phl, u8 band_idx, 237*4882a593Smuzhiyun struct phl_cmd_token_req* req, u32* req_hdl); 238*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_cancel_cmd_token(void *phl, u8 band_idx, u32* req_hdl); 239*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_set_cur_cmd_info(void *phl, u8 band_idx, 240*4882a593Smuzhiyun struct phl_module_op_info* op_info); 241*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_query_cur_cmd_info(void *phl, u8 band_idx, 242*4882a593Smuzhiyun struct phl_module_op_info* op_info); 243*4882a593Smuzhiyun 244*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_free_cmd_token(void *phl, u8 band_idx, u32* req_hdl); 245*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_set_bk_module_info(void *phl, u8 band_idx, 246*4882a593Smuzhiyun enum phl_module_id id, struct phl_module_op_info* op_info); 247*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_query_bk_module_info(void *phl, u8 band_idx, 248*4882a593Smuzhiyun enum phl_module_id id, struct phl_module_op_info* op_info); 249*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_set_msg_disp_seq(void *phl, 250*4882a593Smuzhiyun struct phl_msg_attribute *attr, 251*4882a593Smuzhiyun struct msg_self_def_seq* seq); 252*4882a593Smuzhiyun 253*4882a593Smuzhiyun /* BA session management */ 254*4882a593Smuzhiyun void rtw_phl_stop_rx_ba_session(void *phl, struct rtw_phl_stainfo_t *sta, 255*4882a593Smuzhiyun u16 tid); 256*4882a593Smuzhiyun enum rtw_phl_status 257*4882a593Smuzhiyun rtw_phl_start_rx_ba_session(void *phl, struct rtw_phl_stainfo_t *sta, 258*4882a593Smuzhiyun u8 dialog_token, u16 timeout, u16 start_seq_num, 259*4882a593Smuzhiyun u16 ba_policy, u16 tid, u16 buf_size); 260*4882a593Smuzhiyun void rtw_phl_rx_bar(void *phl, struct rtw_phl_stainfo_t *sta, u8 tid, u16 seq); 261*4882a593Smuzhiyun void rtw_phl_flush_reorder_buf(void *phl, struct rtw_phl_stainfo_t *sta); 262*4882a593Smuzhiyun enum rtw_phl_status 263*4882a593Smuzhiyun rtw_phl_enter_mon_mode(void *phl, struct rtw_wifi_role_t *wrole); 264*4882a593Smuzhiyun enum rtw_phl_status 265*4882a593Smuzhiyun rtw_phl_leave_mon_mode(void *phl, struct rtw_wifi_role_t *wrole); 266*4882a593Smuzhiyun #ifdef RTW_PHL_BCN 267*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_free_bcn_entry(void *phl, struct rtw_wifi_role_t *wrole); 268*4882a593Smuzhiyun enum rtw_phl_status 269*4882a593Smuzhiyun rtw_phl_cmd_issue_beacon(void *phl, 270*4882a593Smuzhiyun struct rtw_wifi_role_t *wifi_role, 271*4882a593Smuzhiyun struct rtw_bcn_info_cmn *bcn_cmn, 272*4882a593Smuzhiyun enum phl_cmd_type cmd_type, 273*4882a593Smuzhiyun u32 cmd_timeout); 274*4882a593Smuzhiyun enum rtw_phl_status 275*4882a593Smuzhiyun rtw_phl_cmd_stop_beacon(void *phl, 276*4882a593Smuzhiyun struct rtw_wifi_role_t *wifi_role, 277*4882a593Smuzhiyun u8 stop, 278*4882a593Smuzhiyun enum phl_cmd_type cmd_type, 279*4882a593Smuzhiyun u32 cmd_timeout); 280*4882a593Smuzhiyun #endif 281*4882a593Smuzhiyun 282*4882a593Smuzhiyun #ifdef CONFIG_CMD_DISP 283*4882a593Smuzhiyun enum rtw_phl_status 284*4882a593Smuzhiyun rtw_phl_cmd_chg_op_chdef(struct rtw_wifi_role_t *wrole, 285*4882a593Smuzhiyun struct rtw_chan_def *new_chdef, bool cmd_wait, u32 cmd_timeout, 286*4882a593Smuzhiyun void (*chg_opch_done)(void *priv, u8 ridx, enum rtw_phl_status status)); 287*4882a593Smuzhiyun 288*4882a593Smuzhiyun 289*4882a593Smuzhiyun enum rtw_phl_status 290*4882a593Smuzhiyun rtw_phl_cmd_set_ch_bw(struct rtw_wifi_role_t *wifi_role, 291*4882a593Smuzhiyun struct rtw_chan_def *chdef, 292*4882a593Smuzhiyun bool do_rfk, 293*4882a593Smuzhiyun enum phl_cmd_type cmd_type, 294*4882a593Smuzhiyun u32 cmd_timeout); 295*4882a593Smuzhiyun 296*4882a593Smuzhiyun enum rtw_phl_status 297*4882a593Smuzhiyun rtw_phl_cmd_enqueue(void *phl, 298*4882a593Smuzhiyun enum phl_band_idx band_idx, 299*4882a593Smuzhiyun enum phl_msg_evt_id evt_id, 300*4882a593Smuzhiyun u8 *cmd_buf, 301*4882a593Smuzhiyun u32 cmd_len, 302*4882a593Smuzhiyun void (*core_cmd_complete)(void *priv, u8 *cmd, u32 cmd_len, enum rtw_phl_status status), 303*4882a593Smuzhiyun enum phl_cmd_type cmd_type, 304*4882a593Smuzhiyun u32 cmd_timeout); 305*4882a593Smuzhiyun 306*4882a593Smuzhiyun #endif /*CONFIG_CMD_DISP*/ 307*4882a593Smuzhiyun 308*4882a593Smuzhiyun u8 rtw_phl_get_cur_ch(struct rtw_wifi_role_t *wifi_role); 309*4882a593Smuzhiyun enum rtw_phl_status 310*4882a593Smuzhiyun rtw_phl_get_cur_hal_chdef(struct rtw_wifi_role_t *wifi_role, 311*4882a593Smuzhiyun struct rtw_chan_def *cur_chandef); 312*4882a593Smuzhiyun 313*4882a593Smuzhiyun enum band_type rtw_phl_get_band_type(u8 chan); 314*4882a593Smuzhiyun u8 rtw_phl_get_center_ch(u8 ch, 315*4882a593Smuzhiyun enum channel_width bw, enum chan_offset offset); 316*4882a593Smuzhiyun 317*4882a593Smuzhiyun enum rtw_phl_status 318*4882a593Smuzhiyun rtw_phl_cmd_dfs_tx_pause(struct rtw_wifi_role_t *wifi_role, bool pause, 319*4882a593Smuzhiyun enum phl_cmd_type cmd_type, u32 cmd_timeout); 320*4882a593Smuzhiyun 321*4882a593Smuzhiyun u8 322*4882a593Smuzhiyun rtw_phl_get_operating_class( 323*4882a593Smuzhiyun struct rtw_chan_def chan_def 324*4882a593Smuzhiyun ); 325*4882a593Smuzhiyun 326*4882a593Smuzhiyun bool 327*4882a593Smuzhiyun rtw_phl_get_chandef_from_operating_class( 328*4882a593Smuzhiyun u8 channel, 329*4882a593Smuzhiyun u8 operating_class, 330*4882a593Smuzhiyun struct rtw_chan_def *chan_def 331*4882a593Smuzhiyun ); 332*4882a593Smuzhiyun /* 333*4882a593Smuzhiyun * export API from sw cap module 334*4882a593Smuzhiyun */ 335*4882a593Smuzhiyun void rtw_phl_final_cap_decision(void *phl); 336*4882a593Smuzhiyun 337*4882a593Smuzhiyun 338*4882a593Smuzhiyun enum rtw_phl_status 339*4882a593Smuzhiyun rtw_phl_get_dft_proto_cap(void *phl, u8 hw_band, enum role_type rtype, 340*4882a593Smuzhiyun struct protocol_cap_t *role_proto_cap); 341*4882a593Smuzhiyun enum rtw_phl_status 342*4882a593Smuzhiyun rtw_phl_get_dft_cap(void *phl, u8 hw_band, struct role_cap_t *role_cap); 343*4882a593Smuzhiyun 344*4882a593Smuzhiyun void rtw_phl_mac_dbg_status_dump(void *phl, u32 *val, u8 *en); 345*4882a593Smuzhiyun 346*4882a593Smuzhiyun #ifdef CONFIG_DBCC_SUPPORT 347*4882a593Smuzhiyun enum rtw_phl_status 348*4882a593Smuzhiyun rtw_phl_dbcc_test(void *phl, enum dbcc_test_id id, void *param); 349*4882a593Smuzhiyun #endif 350*4882a593Smuzhiyun /* 351*4882a593Smuzhiyun * API for config channel info CR 352*4882a593Smuzhiyun */ 353*4882a593Smuzhiyun #ifdef CONFIG_PHL_CHANNEL_INFO 354*4882a593Smuzhiyun enum rtw_phl_status 355*4882a593Smuzhiyun rtw_phl_cmd_cfg_chinfo(void *phl, struct rtw_phl_stainfo_t *sta, 356*4882a593Smuzhiyun u8 enable, enum phl_cmd_type cmd_type, u32 cmd_timeout); 357*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_query_chan_info(void *phl, u32 buf_len, 358*4882a593Smuzhiyun u8* chan_info_buffer, u32 *length, struct csi_header_t *csi_header); 359*4882a593Smuzhiyun #endif /* CONFIG_PHL_CHANNEL_INFO */ 360*4882a593Smuzhiyun 361*4882a593Smuzhiyun void rtw_phl_set_edcca_mode(void *phl, enum rtw_edcca_mode mode); 362*4882a593Smuzhiyun enum rtw_edcca_mode rtw_phl_get_edcca_mode(void *phl); 363*4882a593Smuzhiyun 364*4882a593Smuzhiyun bool rtw_phl_set_user_def_chplan(void *phl, struct rtw_user_def_chplan *udef); 365*4882a593Smuzhiyun bool rtw_phl_valid_regulation_domain(u8 domain); 366*4882a593Smuzhiyun bool rtw_phl_regulation_set_domain(void *phl, u8 domain, 367*4882a593Smuzhiyun enum regulation_rsn reason); 368*4882a593Smuzhiyun bool rtw_phl_regulation_set_country(void *phl, char *country, 369*4882a593Smuzhiyun enum regulation_rsn reason); 370*4882a593Smuzhiyun bool rtw_phl_regulation_set_capability(void *phl, 371*4882a593Smuzhiyun enum rtw_regulation_capability capability); 372*4882a593Smuzhiyun bool rtw_phl_regulation_query_chplan( 373*4882a593Smuzhiyun void *phl, enum rtw_regulation_query type, 374*4882a593Smuzhiyun struct rtw_chlist *filter, 375*4882a593Smuzhiyun struct rtw_regulation_chplan *plan); 376*4882a593Smuzhiyun bool rtw_phl_query_specific_chplan(void *phl, u8 domain, 377*4882a593Smuzhiyun struct rtw_regulation_chplan *plan); 378*4882a593Smuzhiyun bool rtw_phl_query_country_chplan(char *country, 379*4882a593Smuzhiyun struct rtw_regulation_country_chplan *country_chplan); 380*4882a593Smuzhiyun bool rtw_phl_generate_scan_instance(struct instance_strategy *strategy, 381*4882a593Smuzhiyun struct rtw_regulation_chplan *chplan, 382*4882a593Smuzhiyun struct instance *inst); 383*4882a593Smuzhiyun bool rtw_phl_scan_instance_insert_ch(void *phl, struct instance *inst, 384*4882a593Smuzhiyun enum band_type band, u8 channel, 385*4882a593Smuzhiyun u8 strategy_period); 386*4882a593Smuzhiyun bool rtw_phl_regulation_valid_channel(void *phl, enum band_type band, 387*4882a593Smuzhiyun u16 channel, u8 reject); 388*4882a593Smuzhiyun bool rtw_phl_regulation_dfs_channel(void *phl, enum band_type band, 389*4882a593Smuzhiyun u16 channel, bool *dfs); 390*4882a593Smuzhiyun bool rtw_phl_query_regulation_info(void *phl, struct rtw_regulation_info *info); 391*4882a593Smuzhiyun bool rtw_phl_regulation_query_ch(void *phl, enum band_type band, u8 channel, 392*4882a593Smuzhiyun struct rtw_regulation_channel *ch); 393*4882a593Smuzhiyun u8 rtw_phl_get_domain_regulation_2g(u8 domain); 394*4882a593Smuzhiyun u8 rtw_phl_get_domain_regulation_5g(u8 domain); 395*4882a593Smuzhiyun 396*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_get_mac_addr_efuse(void* phl, u8 *addr); 397*4882a593Smuzhiyun 398*4882a593Smuzhiyun /** 399*4882a593Smuzhiyun * rtw_phl_usb_tx_ep_id - query USB tx end point index 400*4882a593Smuzhiyun * identified by macid, tid and band 401*4882a593Smuzhiyun * @macid: input target macid is 0 ~ 127 402*4882a593Smuzhiyun * @tid: input target tid, range is 0 ~ 7 403*4882a593Smuzhiyun * @band: input target band, 0 for band 0 / 1 for band 1 404*4882a593Smuzhiyun * 405*4882a593Smuzhiyun * returns corresponding end point idx of a specific tid 406*4882a593Smuzhiyun */ 407*4882a593Smuzhiyun u8 rtw_phl_usb_tx_ep_id(void *phl, u16 macid, u8 tid, u8 band); 408*4882a593Smuzhiyun 409*4882a593Smuzhiyun enum rtw_phl_status 410*4882a593Smuzhiyun rtw_phl_cfg_trx_path(void* phl, enum rf_path tx, u8 tx_nss, 411*4882a593Smuzhiyun enum rf_path rx, u8 rx_nss); 412*4882a593Smuzhiyun 413*4882a593Smuzhiyun void rtw_phl_reset_stat_ma_rssi(struct rtw_phl_com_t *phl_com); 414*4882a593Smuzhiyun 415*4882a593Smuzhiyun u8 416*4882a593Smuzhiyun rtw_phl_get_ma_rssi(struct rtw_phl_com_t *phl_com, 417*4882a593Smuzhiyun enum rtw_rssi_type rssi_type); 418*4882a593Smuzhiyun 419*4882a593Smuzhiyun bool rtw_phl_chanctx_chk(void *phl, struct rtw_wifi_role_t *wifi_role, 420*4882a593Smuzhiyun u8 chan, enum channel_width bw, enum chan_offset offset); 421*4882a593Smuzhiyun bool rtw_phl_chanctx_add(void *phl, struct rtw_wifi_role_t *wifi_role, 422*4882a593Smuzhiyun u8 *chan, enum channel_width *bw, enum chan_offset *offset); 423*4882a593Smuzhiyun int rtw_phl_chanctx_del(void *phl, struct rtw_wifi_role_t *wifi_role, 424*4882a593Smuzhiyun struct rtw_chan_def *chan_def); 425*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_chanctx_del_no_self(void *phl, struct rtw_wifi_role_t *wifi_role); 426*4882a593Smuzhiyun int rtw_phl_mr_get_chanctx_num(void *phl, struct rtw_wifi_role_t *wifi_role); 427*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_mr_get_chandef(void *phl, struct rtw_wifi_role_t *wifi_role, 428*4882a593Smuzhiyun struct rtw_chan_def *chandef); 429*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_mr_upt_chandef(void *phl, struct rtw_wifi_role_t *wifi_role); 430*4882a593Smuzhiyun 431*4882a593Smuzhiyun #ifdef CONFIG_MCC_SUPPORT 432*4882a593Smuzhiyun u8 rtw_phl_mr_query_mcc_inprogress (void *phl, struct rtw_wifi_role_t *wrole, 433*4882a593Smuzhiyun enum rtw_phl_mcc_chk_inprocess_type check_type); 434*4882a593Smuzhiyun #endif 435*4882a593Smuzhiyun 436*4882a593Smuzhiyun u8 rtw_phl_mr_dump_mac_addr(void *phl, 437*4882a593Smuzhiyun struct rtw_wifi_role_t *wifi_role); 438*4882a593Smuzhiyun u8 rtw_phl_mr_buddy_dump_mac_addr(void *phl, 439*4882a593Smuzhiyun struct rtw_wifi_role_t *wifi_role); 440*4882a593Smuzhiyun enum rtw_phl_status 441*4882a593Smuzhiyun rtw_phl_mr_rx_filter(void *phl, struct rtw_wifi_role_t *wrole); 442*4882a593Smuzhiyun 443*4882a593Smuzhiyun #ifdef CONFIG_FSM 444*4882a593Smuzhiyun enum rtw_phl_status 445*4882a593Smuzhiyun rtw_phl_mr_offch_hdl(void *phl, 446*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole, 447*4882a593Smuzhiyun bool off_ch, 448*4882a593Smuzhiyun void *obj_priv, 449*4882a593Smuzhiyun u8 (*issue_null_data)(void *priv, u8 ridx, bool ps), 450*4882a593Smuzhiyun struct rtw_chan_def *chandef); 451*4882a593Smuzhiyun #endif 452*4882a593Smuzhiyun void rtw_phl_mr_ops_init (void *phl, struct rtw_phl_mr_ops *mr_ops); 453*4882a593Smuzhiyun 454*4882a593Smuzhiyun #ifdef PHL_MR_PROC_CMD 455*4882a593Smuzhiyun void rtw_phl_mr_dump_info(void *phl, bool show_caller); 456*4882a593Smuzhiyun void rtw_phl_mr_dump_band_ctl(void *phl, bool show_caller); 457*4882a593Smuzhiyun bool rtw_phl_chanctx_test(void *phl, struct rtw_wifi_role_t *wifi_role, bool is_add, 458*4882a593Smuzhiyun u8 *chan, enum channel_width *bw, enum chan_offset *offset); 459*4882a593Smuzhiyun #endif 460*4882a593Smuzhiyun void rtw_phl_sta_dump_info(void *phl, bool show_caller, struct rtw_wifi_role_t *wr, u8 mode); 461*4882a593Smuzhiyun 462*4882a593Smuzhiyun bool rtw_phl_mr_query_info(void *phl, struct rtw_wifi_role_t *wrole, 463*4882a593Smuzhiyun struct mr_query_info *info); 464*4882a593Smuzhiyun 465*4882a593Smuzhiyun u8 rtw_phl_mr_get_opch_list(void *phl, struct rtw_wifi_role_t *wifi_role, 466*4882a593Smuzhiyun struct rtw_chan_def *chdef_list, u8 list_size); 467*4882a593Smuzhiyun 468*4882a593Smuzhiyun void rtw_phl_mr_dump_cur_chandef(void *phl, struct rtw_wifi_role_t *wifi_role); 469*4882a593Smuzhiyun 470*4882a593Smuzhiyun enum mr_op_mode 471*4882a593Smuzhiyun rtw_phl_mr_get_opmode(void *phl, struct rtw_wifi_role_t *wrole); 472*4882a593Smuzhiyun 473*4882a593Smuzhiyun void rtw_phl_led_set_ctrl_mode(void *phl, enum rtw_led_id led_id, 474*4882a593Smuzhiyun enum rtw_led_ctrl_mode ctrl_mode); 475*4882a593Smuzhiyun void rtw_phl_led_set_toggle_intervals(void *phl, u8 intervals_idx, 476*4882a593Smuzhiyun u32 *intervals, u8 intervals_len); 477*4882a593Smuzhiyun void rtw_phl_led_set_action(void *phl, enum rtw_led_event event, 478*4882a593Smuzhiyun enum rtw_led_state state_condition, 479*4882a593Smuzhiyun struct rtw_led_action_args_t *action_args_arr, 480*4882a593Smuzhiyun u8 action_args_arr_len, u32 toggle_delay_unit); 481*4882a593Smuzhiyun void rtw_phl_led_control(void *phl, enum rtw_led_event led_event); 482*4882a593Smuzhiyun 483*4882a593Smuzhiyun #ifdef CONFIG_RTW_ACS 484*4882a593Smuzhiyun u16 rtw_phl_acs_get_channel_by_idx(void *phl, u8 ch_idx); 485*4882a593Smuzhiyun u8 rtw_phl_acs_get_clm_ratio_by_idx(void *phl, u8 ch_idx); 486*4882a593Smuzhiyun s8 rtw_phl_noise_query_by_idx(void *phl, u8 ch_idx); 487*4882a593Smuzhiyun #endif /* CONFIG_RTW_ACS */ 488*4882a593Smuzhiyun 489*4882a593Smuzhiyun void rtw_phl_get_env_rpt(void *phl, struct rtw_env_report *env_rpt, struct rtw_wifi_role_t *wrole); 490*4882a593Smuzhiyun 491*4882a593Smuzhiyun #ifdef RTW_WKARD_DYNAMIC_BFEE_CAP 492*4882a593Smuzhiyun enum rtw_phl_status 493*4882a593Smuzhiyun rtw_phl_bfee_ctrl(void *phl, struct rtw_wifi_role_t *wrole, bool ctrl); 494*4882a593Smuzhiyun #endif 495*4882a593Smuzhiyun 496*4882a593Smuzhiyun enum rtw_phl_status 497*4882a593Smuzhiyun rtw_phl_snd_init_ops_send_ndpa(void *phl, 498*4882a593Smuzhiyun enum rtw_phl_status (*snd_send_ndpa)(void *, 499*4882a593Smuzhiyun struct rtw_wifi_role_t *, 500*4882a593Smuzhiyun u8 *, 501*4882a593Smuzhiyun u32 *, 502*4882a593Smuzhiyun enum channel_width)); 503*4882a593Smuzhiyun 504*4882a593Smuzhiyun u8 rtw_phl_snd_chk_in_progress(void *phl); 505*4882a593Smuzhiyun 506*4882a593Smuzhiyun enum rtw_phl_status 507*4882a593Smuzhiyun rtw_phl_sound_start(void *phl, u8 wrole_idx, u8 st_dlg_tkn, u8 period, u8 test_flag); 508*4882a593Smuzhiyun 509*4882a593Smuzhiyun enum rtw_phl_status 510*4882a593Smuzhiyun rtw_phl_sound_abort(void *phl); 511*4882a593Smuzhiyun 512*4882a593Smuzhiyun enum rtw_phl_status 513*4882a593Smuzhiyun rtw_phl_set_power_lmt(void *phl, u8 hw_band); 514*4882a593Smuzhiyun 515*4882a593Smuzhiyun s8 rtw_phl_get_power_limit(void *phl, u8 hw_band, 516*4882a593Smuzhiyun u16 rate, u8 bandwidth, u8 beamforming, u8 tx_num, u8 channel); 517*4882a593Smuzhiyun 518*4882a593Smuzhiyun void 519*4882a593Smuzhiyun rtw_phl_enable_ext_pwr_lmt(void *phl, u8 hw_band, 520*4882a593Smuzhiyun struct rtw_phl_ext_pwr_lmt_info *ext_pwr_lmt_info); 521*4882a593Smuzhiyun void 522*4882a593Smuzhiyun rtw_phl_set_ext_pwr_lmt_en(void *phl, bool enable); 523*4882a593Smuzhiyun 524*4882a593Smuzhiyun void rtw_phl_init_ppdu_sts_para(struct rtw_phl_com_t *phl_com, 525*4882a593Smuzhiyun bool en_psts_per_pkt, bool psts_ampdu, 526*4882a593Smuzhiyun u8 rx_fltr); 527*4882a593Smuzhiyun 528*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_rf_on(void *phl); 529*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_rf_off(void *phl); 530*4882a593Smuzhiyun 531*4882a593Smuzhiyun 532*4882a593Smuzhiyun #ifdef CONFIG_PHL_TWT 533*4882a593Smuzhiyun enum rtw_phl_status 534*4882a593Smuzhiyun rtw_phl_twt_alloc_twt_config(void *phl, struct rtw_wifi_role_t *role, 535*4882a593Smuzhiyun struct rtw_phl_twt_setup_info setup_info, u8 benable, u8 *id); 536*4882a593Smuzhiyun 537*4882a593Smuzhiyun enum rtw_phl_status 538*4882a593Smuzhiyun rtw_phl_twt_free_twt_config(void *phl, u8 id); 539*4882a593Smuzhiyun 540*4882a593Smuzhiyun enum rtw_phl_status 541*4882a593Smuzhiyun rtw_phl_twt_enable_twt_config(void *phl, u8 id); 542*4882a593Smuzhiyun 543*4882a593Smuzhiyun enum rtw_phl_status 544*4882a593Smuzhiyun rtw_phl_twt_free_all_twt_by_role(void *phl, struct rtw_wifi_role_t *role); 545*4882a593Smuzhiyun 546*4882a593Smuzhiyun enum rtw_phl_status 547*4882a593Smuzhiyun rtw_phl_twt_disable_all_twt_by_role(void *phl, struct rtw_wifi_role_t *role); 548*4882a593Smuzhiyun 549*4882a593Smuzhiyun enum rtw_phl_status 550*4882a593Smuzhiyun rtw_phl_twt_enable_all_twt_by_role(void *phl, struct rtw_wifi_role_t *role); 551*4882a593Smuzhiyun 552*4882a593Smuzhiyun enum rtw_phl_status 553*4882a593Smuzhiyun rtw_phl_twt_add_sta_info(void *phl, struct rtw_phl_stainfo_t *phl_sta, 554*4882a593Smuzhiyun u8 config_id, u8 id); 555*4882a593Smuzhiyun 556*4882a593Smuzhiyun enum rtw_phl_status 557*4882a593Smuzhiyun rtw_phl_twt_teardown_sta(void *phl, struct rtw_phl_stainfo_t *phl_sta, 558*4882a593Smuzhiyun struct rtw_phl_twt_flow_field *twt_flow, u8 *bitmap); 559*4882a593Smuzhiyun 560*4882a593Smuzhiyun enum rtw_phl_status 561*4882a593Smuzhiyun rtw_phl_twt_get_new_flow_id(void *phl, struct rtw_phl_stainfo_t *phl_sta, u8 *id); 562*4882a593Smuzhiyun 563*4882a593Smuzhiyun 564*4882a593Smuzhiyun enum rtw_phl_status 565*4882a593Smuzhiyun rtw_phl_twt_accept_for_sta_mode(void *phl, struct rtw_phl_stainfo_t *phl_sta, 566*4882a593Smuzhiyun struct rtw_phl_twt_setup_info *setup_info, u8 *id); 567*4882a593Smuzhiyun 568*4882a593Smuzhiyun enum rtw_phl_status 569*4882a593Smuzhiyun rtw_phl_twt_teardown_for_sta_mode(void *phl, struct rtw_phl_stainfo_t *phl_sta, 570*4882a593Smuzhiyun struct rtw_phl_twt_flow_field *twt_flow); 571*4882a593Smuzhiyun 572*4882a593Smuzhiyun enum rtw_phl_status 573*4882a593Smuzhiyun rtw_phl_twt_delete_all_sta_info(void *phl, struct rtw_phl_stainfo_t *phl_sta, 574*4882a593Smuzhiyun u8 *bitmap); 575*4882a593Smuzhiyun 576*4882a593Smuzhiyun enum rtw_phl_status 577*4882a593Smuzhiyun rtw_phl_twt_get_target_wake_time(void *phl, u8 port, u8 id, u16 offset, u32 *tsf_h, 578*4882a593Smuzhiyun u32 *tsf_l); 579*4882a593Smuzhiyun 580*4882a593Smuzhiyun enum rtw_phl_status 581*4882a593Smuzhiyun rtw_phl_twt_sta_announce_to_fw(void *phl, u16 macid); 582*4882a593Smuzhiyun 583*4882a593Smuzhiyun enum rtw_phl_status 584*4882a593Smuzhiyun rtw_phl_twt_handle_c2h(void *phl_com, void *c); 585*4882a593Smuzhiyun 586*4882a593Smuzhiyun enum rtw_phl_status 587*4882a593Smuzhiyun rtw_phl_twt_fill_twt_element(struct rtw_phl_twt_element *twt_ele, u8 *buf, 588*4882a593Smuzhiyun u8 *length); 589*4882a593Smuzhiyun 590*4882a593Smuzhiyun enum rtw_phl_status 591*4882a593Smuzhiyun rtw_phl_twt_fill_flow_field(struct rtw_phl_twt_flow_field *twt_flow, u8 *buf, 592*4882a593Smuzhiyun u16 *length); 593*4882a593Smuzhiyun enum rtw_phl_status 594*4882a593Smuzhiyun rtw_phl_twt_parse_element(u8 *twt_ele, u16 length, 595*4882a593Smuzhiyun struct rtw_phl_twt_element *twt_element); 596*4882a593Smuzhiyun 597*4882a593Smuzhiyun enum rtw_phl_status 598*4882a593Smuzhiyun rtw_phl_twt_parse_setup_info(u8 *pkt, u16 length, 599*4882a593Smuzhiyun struct rtw_phl_twt_setup_info *setup_info); 600*4882a593Smuzhiyun 601*4882a593Smuzhiyun enum rtw_phl_status 602*4882a593Smuzhiyun rtw_phl_twt_parse_flow_field(u8 *ie_twt_flow, u16 length, 603*4882a593Smuzhiyun struct rtw_phl_twt_flow_field *twt_flow); 604*4882a593Smuzhiyun #endif /* CONFIG_PHL_TWT */ 605*4882a593Smuzhiyun 606*4882a593Smuzhiyun enum rtw_phl_status 607*4882a593Smuzhiyun rtw_phl_snd_cmd_set_vht_gid(void *phl, 608*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole, 609*4882a593Smuzhiyun struct rtw_phl_gid_pos_tbl *tbl); 610*4882a593Smuzhiyun 611*4882a593Smuzhiyun enum rtw_phl_status 612*4882a593Smuzhiyun rtw_phl_snd_cmd_set_aid(void *phl, 613*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole, 614*4882a593Smuzhiyun struct rtw_phl_stainfo_t *sta, 615*4882a593Smuzhiyun u16 aid); 616*4882a593Smuzhiyun 617*4882a593Smuzhiyun #ifdef RTW_WKARD_P2PPS_REFINE 618*4882a593Smuzhiyun #ifdef CONFIG_PHL_P2PPS 619*4882a593Smuzhiyun enum rtw_phl_status 620*4882a593Smuzhiyun rtw_phl_p2pps_noa_update(void *phl, struct rtw_phl_noa_desc *in_desc); 621*4882a593Smuzhiyun 622*4882a593Smuzhiyun void 623*4882a593Smuzhiyun rtw_phl_p2pps_init_ops(void *phl, struct rtw_phl_p2pps_ops *ops); 624*4882a593Smuzhiyun 625*4882a593Smuzhiyun void rtw_phl_p2pps_noa_disable_all(void *phl, struct rtw_wifi_role_t *w_role); 626*4882a593Smuzhiyun #endif 627*4882a593Smuzhiyun #endif 628*4882a593Smuzhiyun enum rtw_phl_status 629*4882a593Smuzhiyun rtw_phl_snd_cmd_set_vht_gid(void *phl, 630*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole, 631*4882a593Smuzhiyun struct rtw_phl_gid_pos_tbl *tbl); 632*4882a593Smuzhiyun 633*4882a593Smuzhiyun void rtw_phl_event_notify(void *phl, enum phl_msg_evt_id event, 634*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole); 635*4882a593Smuzhiyun void rtw_phl_notification(void *phl, 636*4882a593Smuzhiyun enum phl_msg_evt_id event, 637*4882a593Smuzhiyun struct rtw_wifi_role_t *wrole, 638*4882a593Smuzhiyun bool direct); 639*4882a593Smuzhiyun void rtw_phl_dev_terminate_ntf(void *phl); 640*4882a593Smuzhiyun 641*4882a593Smuzhiyun enum rtw_phl_status 642*4882a593Smuzhiyun rtw_phl_cmd_force_usb_switch(void *phl, u32 speed, 643*4882a593Smuzhiyun enum phl_band_idx band_idx, 644*4882a593Smuzhiyun enum phl_cmd_type cmd_type, u32 cmd_timeout); 645*4882a593Smuzhiyun enum rtw_phl_status 646*4882a593Smuzhiyun rtw_phl_cmd_get_usb_speed(void *phl, u32* speed, 647*4882a593Smuzhiyun enum phl_band_idx band_idx, 648*4882a593Smuzhiyun enum phl_cmd_type cmd_type, u32 cmd_timeout); 649*4882a593Smuzhiyun enum rtw_phl_status 650*4882a593Smuzhiyun rtw_phl_cmd_get_usb_support_ability(void *phl, u32* ability, 651*4882a593Smuzhiyun enum phl_band_idx band_idx, 652*4882a593Smuzhiyun enum phl_cmd_type cmd_type, u32 cmd_timeout); 653*4882a593Smuzhiyun u8 rtw_phl_get_sta_mgnt_rssi(struct rtw_phl_stainfo_t *psta); 654*4882a593Smuzhiyun 655*4882a593Smuzhiyun enum rtw_phl_status 656*4882a593Smuzhiyun rtw_phl_txsts_rpt_config(void *phl, struct rtw_phl_stainfo_t *phl_sta); 657*4882a593Smuzhiyun 658*4882a593Smuzhiyun #if defined(CONFIG_USB_HCI) || defined(CONFIG_PCI_HCI) 659*4882a593Smuzhiyun /* tx_ok/tx_fail are from release report*/ 660*4882a593Smuzhiyun enum rtw_phl_status 661*4882a593Smuzhiyun rtw_phl_get_tx_ok_rpt(void *phl, struct rtw_phl_stainfo_t *phl_sta, u32 *tx_ok_cnt, 662*4882a593Smuzhiyun enum phl_ac_queue qsel); 663*4882a593Smuzhiyun 664*4882a593Smuzhiyun enum rtw_phl_status 665*4882a593Smuzhiyun rtw_phl_get_tx_fail_rpt(void *phl, struct rtw_phl_stainfo_t *phl_sta, u32 *tx_fail_cnt, 666*4882a593Smuzhiyun enum phl_ac_queue qsel); 667*4882a593Smuzhiyun 668*4882a593Smuzhiyun /* tx retry is from ra sts report.*/ 669*4882a593Smuzhiyun enum rtw_phl_status 670*4882a593Smuzhiyun rtw_phl_get_tx_retry_rpt(void *phl, struct rtw_phl_stainfo_t *phl_sta, u32 *tx_retry_cnt, 671*4882a593Smuzhiyun enum phl_ac_queue qsel); 672*4882a593Smuzhiyun #endif /* CONFIG_USB_HCI */ 673*4882a593Smuzhiyun 674*4882a593Smuzhiyun enum rtw_rx_status rtw_phl_get_rx_status(void *phl); 675*4882a593Smuzhiyun 676*4882a593Smuzhiyun void rtw_phl_dbg_dump_rx(void *phl, struct rtw_wifi_role_t *wrole); 677*4882a593Smuzhiyun 678*4882a593Smuzhiyun /****************************************************************************** 679*4882a593Smuzhiyun * 680*4882a593Smuzhiyun * TX power APIs 681*4882a593Smuzhiyun * 682*4882a593Smuzhiyun *****************************************************************************/ 683*4882a593Smuzhiyun const char *rtw_phl_get_pw_lmt_regu_type_str(void *phl, enum band_type band); 684*4882a593Smuzhiyun 685*4882a593Smuzhiyun bool rtw_phl_get_pwr_lmt_en(void *phl, u8 band_idx); 686*4882a593Smuzhiyun 687*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_set_tx_power(void *phl, u8 band_idx); 688*4882a593Smuzhiyun 689*4882a593Smuzhiyun enum rtw_phl_status rtw_phl_get_txinfo_pwr(void *phl, s16 *pwr_dbm); 690*4882a593Smuzhiyun /*****************************************************************************/ 691*4882a593Smuzhiyun 692*4882a593Smuzhiyun u32 rtw_phl_get_phy_stat_info(void *phl, enum phl_band_idx hw_band, 693*4882a593Smuzhiyun enum phl_stat_info_query phy_stat); 694*4882a593Smuzhiyun #endif /*_PHL_API_H_*/ 695*4882a593Smuzhiyun 696