1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2016 Cavium, Inc.
6 #ifndef __REQUEST_MANAGER_H
7 #define __REQUEST_MANAGER_H
9 #include "cpt_common.h"
11 #define TIME_IN_RESET_COUNT 5
12 #define COMPLETION_CODE_SIZE 8
13 #define COMPLETION_CODE_INIT 0
14 #define PENDING_THOLD 100
15 #define MAX_SG_IN_CNT 12
16 #define MAX_SG_OUT_CNT 13
17 #define SG_LIST_HDR_SIZE 8
18 #define MAX_BUF_CNT 16
23 #if defined(__BIG_ENDIAN_BITFIELD)
25 u32 grp
:3; /* Group bits */
26 u32 dma_mode
:2; /* DMA mode */
27 u32 se_req
:1;/* To SE core */
29 u32 se_req
:1; /* To SE core */
30 u32 dma_mode
:2; /* DMA mode */
31 u32 grp
:3; /* Group bits */
45 struct cptvf_request
{
46 union opcode_info opcode
;
58 struct cpt_request_info
{
59 u8 incnt
; /* Number of input buffers */
60 u8 outcnt
; /* Number of output buffers */
61 u16 rlen
; /* Output length */
62 union ctrl_info ctrl
; /* User control information */
63 struct cptvf_request req
; /* Request Information (Core specific) */
67 struct buf_ptr in
[MAX_BUF_CNT
];
68 struct buf_ptr out
[MAX_BUF_CNT
];
70 void (*callback
)(int, void *); /* Kernel ASYNC request callabck */
71 void *callback_arg
; /* Kernel ASYNC request callabck arg */
74 struct sglist_component
{
90 struct cpt_info_buffer
{
92 unsigned long time_in
;
95 struct cpt_request_info
*req
;
96 dma_addr_t dptr_baddr
;
98 dma_addr_t rptr_baddr
;
99 dma_addr_t comp_baddr
;
102 u8
*gather_components
;
103 u8
*scatter_components
;
105 struct pending_entry
*pentry
;
106 volatile u64
*completion_addr
;
107 volatile u64
*alternate_caddr
;
111 * CPT_INST_S software command definitions
127 #if defined(__BIG_ENDIAN_BITFIELD)
137 struct cpt_vq_command
{
138 union vq_cmd_word0 cmd
;
141 union vq_cmd_word3 cptr
;
144 void vq_post_process(struct cpt_vf
*cptvf
, u32 qno
);
145 int process_request(struct cpt_vf
*cptvf
, struct cpt_request_info
*req
);
146 #endif /* __REQUEST_MANAGER_H */