• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Description: hcc queue list.
15  * Author:
16  * Create: 2021-05-13
17  */
18 
19 #ifndef HCC_QUEUE_HEADER
20 #define HCC_QUEUE_HEADER
21 
22 #include "td_type.h"
23 #include "soc_osal.h"
24 #include "osal_list.h"
25 #include "hcc_types.h"
26 #include "hcc_cfg_comm.h"
27 
28 #ifdef __cplusplus
29 #if __cplusplus
30 extern "C" {
31 #endif
32 #endif
33 
34 typedef struct _hcc_data_queue_ {
35     struct osal_list_head  data_queue;
36     td_u32        qlen;
37     osal_spinlock data_queue_lock;
38 } hcc_data_queue;
39 
40 typedef struct _hcc_unc_struc {
41     td_u8 *buf;
42     td_u32 length;
43     td_u8 *user_param;
44     td_u8  service_type : 4;
45     td_u8  sub_type : 4;
46     td_u8  queue_id;
47     td_u16  rsv;
48 #ifdef CONFIG_HCC_SUPPORT_IPC_HOST
49     td_u8 *addr;
50 #endif
51     struct osal_list_head list;
52 } hcc_unc_struc;
53 
54 typedef struct _hcc_trans_queue_ {
55     hcc_data_queue queue_info;  // 队列的操作链表
56     hcc_queue_ctrl *queue_ctrl; // 队列流控配置 //
57     td_u8                queue_id; // 当前队列的ID
58     td_u8                rsv;
59     struct {
60         struct {
61             td_u16 flow_ctrl_open : 1; // 队列流控标记,flow type为 HCC_FLOWCTRL_DATA 时使用   hcc_flowctrl_flag
62             td_u16 is_stopped : 1;  // 队列流控状态,停止业务入列
63             td_u16 fc_on_cnt : 7;
64             td_u16 fc_off_cnt : 7;
65         } fc_back_para;
66 
67         td_u16 credit;  /* flow type为 HCC_FLOWCTRL_CREDIT 时使用, 保存credit值 */
68     } fc_para;
69 
70     hcc_data_queue send_head; /* 实际需要发送的链表 */
71 } hcc_trans_queue;
72 
73 #ifdef __cplusplus
74 #if __cplusplus
75 }
76 #endif
77 #endif
78 
79 #endif /* HCC_QUEUE_HEADER */