109 lines
		
	
	
		
			4.0 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			109 lines
		
	
	
		
			4.0 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								/****************************************************************************
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
							 | 
						||
| 
								 | 
							
								be copied by any method or incorporated into another program without
							 | 
						||
| 
								 | 
							
								the express written consent of Aerospace C.Power. This Information or any portion
							 | 
						||
| 
								 | 
							
								thereof remains the property of Aerospace C.Power. The Information contained herein
							 | 
						||
| 
								 | 
							
								is believed to be accurate and Aerospace C.Power assumes no responsibility or
							 | 
						||
| 
								 | 
							
								liability for its use in any way and conveys no license or title under
							 | 
						||
| 
								 | 
							
								any patent or copyright and makes no representation or warranty that this
							 | 
						||
| 
								 | 
							
								Information is free from patent or copyright infringement.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								****************************************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef MAC_RF_SCHED_HW_H
							 | 
						||
| 
								 | 
							
								#define MAC_RF_SCHED_HW_H
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* os shim includes */
							 | 
						||
| 
								 | 
							
								#include "os_types.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac module internal includes */
							 | 
						||
| 
								 | 
							
								#include "mac_rf_vdev.h"
							 | 
						||
| 
								 | 
							
								#include "command_list.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_rf_sched_get_ntb() - get local NTB
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:                pointer to mac rf vdev
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * return:                  local NTB
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								uint32_t mac_rf_sched_get_ntb(void *rf_vdev);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_sched_get_ntb64() - get local NTB 64bit version
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:               pointer to mac rf vdev
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * return:                 local NTB 64bit version
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								uint64_t mac_rf_sched_get_ntb64(void *rf_vdev);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_sched_set_bp_start_ntb() - config start ntb of next beacon period
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:                      pointer to rf mac vdev
							 | 
						||
| 
								 | 
							
								 * @start_ntb:                    start ntb of next beacon period
							 | 
						||
| 
								 | 
							
								 * return:                        void
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								void mac_rf_sched_set_bp_start_ntb(mac_rf_vdev_t *rf_vdev, uint32_t start_ntb);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_rf_sched_set_bp_dur() - config duration of next beacon period
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:                   pointer to mac rf vdev
							 | 
						||
| 
								 | 
							
								 * @bp:                        duration of next beacon period
							 | 
						||
| 
								 | 
							
								 * return:                        void
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								void mac_rf_sched_set_bp_dur(mac_rf_vdev_t *rf_vdev, uint32_t bp);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_sched_get_cmd_list_cnt() - get number of pending command list include
							 | 
						||
| 
								 | 
							
								 *                                the command list being executed.
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:                      pointer to mac rf vdev
							 | 
						||
| 
								 | 
							
								 * return:                        number of pending command list
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								uint8_t mac_rf_sched_get_cmd_list_cnt(mac_rf_vdev_t *rf_vdev);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_rf_sched_trigger_bp() - trigger HW to load the configuration of next
							 | 
						||
| 
								 | 
							
								 *                             beacon period
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:                 - pointer to mac vdev
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								void mac_rf_sched_trigger_bp(mac_rf_vdev_t *rf_vdev);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_sched_enable_bp() - enable or disable HW scheduler
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:             - pointer to mac rf vdev
							 | 
						||
| 
								 | 
							
								 * @enable:              - 0 for disable and 1 for enable
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								void mac_rf_sched_enable_bp(mac_rf_vdev_t *rf_vdev, uint8_t enable);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_rf_sched_set_bp_cmd_list() - enable or disable HW scheduler.
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:                      - pointer to mac rf vdev.
							 | 
						||
| 
								 | 
							
								 * @cmd:                          - the header of cmd.
							 | 
						||
| 
								 | 
							
								 * @cnt:                          - the cnt of cmd.
							 | 
						||
| 
								 | 
							
								 * @return void:                  - void.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								void mac_rf_sched_set_bp_cmd_list(mac_rf_vdev_t *rf_vdev,
							 | 
						||
| 
								 | 
							
								    hw_sched_cmd_t *cmd, uint16_t cnt);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_rf_sched_set_bp_ahead_alert() - enable or disable ahead alert.
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:                         - pointer to mac rf vdev.
							 | 
						||
| 
								 | 
							
								 * @ahead_ms:                        - ahead time ms.
							 | 
						||
| 
								 | 
							
								 * @return void:                     - void.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								void mac_rf_sched_set_bp_ahead_alert(mac_rf_vdev_t *rf_vdev, uint16_t ahead_ms);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_rf_handle_cmdlist_done()      - mac rf handle cmdlist done.
							 | 
						||
| 
								 | 
							
								 * @return uint32_t:                 - uint32_t.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								uint32_t mac_rf_handle_cmdlist_done();
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* mac_rf_sched_get_enable()         - mac rf scheduel get enable or not.
							 | 
						||
| 
								 | 
							
								 * @rf_vdev:                         - pointer to mac rf vdev.
							 | 
						||
| 
								 | 
							
								 * @return uint32_t:                 - enable or not.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								uint32_t mac_rf_sched_get_enable(mac_rf_vdev_t *rf_vdev);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* MAC_SCHED_HW_H */
							 |