1 /****************************************************************************** 2 * 3 * Copyright(c) 2019 Realtek Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of version 2 of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * 9 * This program is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * more details. 13 * 14 *****************************************************************************/ 15 #ifndef _PHL_API_DRV_H_ 16 #define _PHL_API_DRV_H_ 17 18 void *rtw_phl_get_txbd_buf(struct rtw_phl_com_t *phl_com); 19 void *rtw_phl_get_rxbd_buf(struct rtw_phl_com_t *phl_com); 20 21 /** 22 * rtw_phl_query_h2c_pkt - provide h2c buffer for halmac 23 * @phl_com: see struct rtw_phl_com_t 24 * @type: the type of h2c buf 25 * 26 * returns struct rtw_h2c_pkt* 27 */ 28 struct rtw_h2c_pkt *rtw_phl_query_h2c_pkt(struct rtw_phl_com_t *phl_com, 29 enum rtw_h2c_pkt_type type); 30 31 /** 32 * rtw_phl_pltfm_tx - h2c platform transmit 33 * @phl_com: see struct rtw_phl_com_t 34 * @pkt: the h2c pkt 35 * 36 * returns enum RTW_PHL_STATUS 37 */ 38 enum rtw_phl_status rtw_phl_pltfm_tx(struct rtw_phl_com_t *phl_com, 39 struct rtw_h2c_pkt *pkt); 40 41 enum rtw_phl_status rtw_phl_msg_hub_hal_send(struct rtw_phl_com_t *phl_com, 42 struct phl_msg_attribute* attr, struct phl_msg* msg); 43 44 struct rtw_phl_stainfo_t * 45 rtw_phl_get_stainfo_self(void *phl, struct rtw_wifi_role_t *wrole); 46 struct rtw_phl_stainfo_t * 47 rtw_phl_get_stainfo_by_macid(void *phl, u16 macid); 48 49 50 /* For hal wow use */ 51 void rtw_phl_pkt_ofld_reset_all_entry(struct rtw_phl_com_t *phl_com); 52 53 54 bool rtw_phl_query_regulation_info(void *phl, struct rtw_regulation_info *info); 55 56 enum band_type rtw_phl_get_band_type(u8 chan); 57 u8 rtw_phl_get_center_ch(u8 ch, 58 enum channel_width bw, enum chan_offset offset); 59 60 bool rtw_phl_btc_send_cmd(struct rtw_phl_com_t *phl_com, 61 u8 *buf, u32 len, u16 ev_id); 62 63 #ifdef CONFIG_PHL_CHANNEL_INFO 64 /* Channel info queue operation*/ 65 u32 rtw_phl_get_chaninfo_idle_number(void *drvpriv, struct rtw_phl_com_t *phl_com); 66 u32 rtw_phl_get_chaninfo_busy_number(void *drvpriv, struct rtw_phl_com_t *phl_com); 67 struct chan_info_t *rtw_phl_query_idle_chaninfo(void *drvpriv, struct rtw_phl_com_t *phl_com); 68 69 struct chan_info_t *rtw_phl_query_busy_chaninfo(void *drvpriv, struct rtw_phl_com_t *phl_com); 70 71 struct chan_info_t *rtw_phl_query_busy_chaninfo_latest(void *drvpriv, struct rtw_phl_com_t *phl_com); 72 73 void rtw_phl_enqueue_idle_chaninfo(void *drvpriv, struct rtw_phl_com_t *phl_com, 74 struct chan_info_t *chan_info_pkt); 75 76 struct chan_info_t * rtw_phl_recycle_busy_chaninfo(void *drvpriv, struct rtw_phl_com_t *phl_com, 77 struct chan_info_t *chan_info_pkt); 78 #endif /* CONFIG_PHL_CHANNEL_INFO */ 79 80 enum rtw_phl_status rtw_phl_ser_l2_notify(struct rtw_phl_com_t *phl_com); 81 82 struct rtw_wifi_role_t * 83 rtw_phl_get_wrole_by_ridx(struct rtw_phl_com_t *phl_com, u8 rold_idx); 84 85 #ifdef CONFIG_CMD_DISP 86 enum rtw_phl_status 87 rtw_phl_cmd_notify(struct rtw_phl_com_t *phl_com, 88 enum phl_msg_evt_id event, 89 void *hal_cmd, 90 u8 hw_idx); 91 #endif /* CONFIG_CMD_DISP */ 92 93 enum rtw_phl_status phl_ps_hal_pwr_req(struct rtw_phl_com_t *phl_com, u8 src, bool pwr_req); 94 95 #endif /* _PHL_API_DRV_H_ */ 96 97