net/bnxt: add conditional processing of templates
[dpdk.git] / drivers / net / bnxt / tf_core / tf_device.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019-2021 Broadcom
3  * All rights reserved.
4  */
5
6 #ifndef _TF_DEVICE_H_
7 #define _TF_DEVICE_H_
8
9 #include "tf_core.h"
10 #include "tf_identifier.h"
11 #include "tf_tbl.h"
12 #include "tf_tcam.h"
13 #ifdef TF_TCAM_SHARED
14 #include "tf_tcam_shared.h"
15 #endif
16 #include "tf_if_tbl.h"
17 #include "tf_global_cfg.h"
18
19 struct tf;
20 struct tf_session;
21
22 /**
23  * The Device module provides a general device template. A supported
24  * device type should implement one or more of the listed function
25  * pointers according to its capabilities.
26  *
27  * If a device function pointer is NULL the device capability is not
28  * supported.
29  */
30
31 /**
32  * TF device information
33  */
34 struct tf_dev_info {
35         enum tf_device_type type;
36         const struct tf_dev_ops *ops;
37 };
38
39 /**
40  * @page device Device
41  *
42  * @ref tf_dev_bind
43  *
44  * @ref tf_dev_unbind
45  */
46
47 /**
48  * Device bind handles the initialization of the specified device
49  * type.
50  *
51  * [in] tfp
52  *   Pointer to TF handle
53  *
54  * [in] type
55  *   Device type
56  *
57  * [in] resources
58  *   Pointer to resource allocation information
59  *
60  * [out] dev_handle
61  *   Device handle
62  *
63  * Returns
64  *   - (0) if successful.
65  *   - (-EINVAL) parameter failure.
66  *   - (-ENODEV) no such device supported.
67  */
68 int tf_dev_bind(struct tf *tfp,
69                 enum tf_device_type type,
70                 bool shadow_copy,
71                 struct tf_session_resources *resources,
72                 struct tf_dev_info *dev_handle);
73
74 /**
75  * Device release handles cleanup of the device specific information.
76  *
77  * [in] tfp
78  *   Pointer to TF handle
79  *
80  * [in] dev_handle
81  *   Device handle
82  *
83  * Returns
84  *   - (0) if successful.
85  *   - (-EINVAL) parameter failure.
86  *   - (-ENODEV) no such device supported.
87  */
88 int tf_dev_unbind(struct tf *tfp,
89                   struct tf_dev_info *dev_handle);
90
91 int
92 tf_dev_bind_ops(enum tf_device_type type,
93                 struct tf_dev_info *dev_handle);
94
95 /**
96  * Truflow device specific function hooks structure
97  *
98  * The following device hooks can be defined; unless noted otherwise,
99  * they are optional and can be filled with a null pointer. The
100  * purpose of these hooks is to support Truflow device operations for
101  * different device variants.
102  */
103 struct tf_dev_ops {
104         /**
105          * Retrieves the MAX number of resource types that the device
106          * supports.
107          *
108          * [in] tfp
109          *   Pointer to TF handle
110          *
111          * [out] max_types
112          *   Pointer to MAX number of types the device supports
113          *
114          * Returns
115          *   - (0) if successful.
116          *   - (-EINVAL) on failure.
117          */
118         int (*tf_dev_get_max_types)(struct tf *tfp,
119                                     uint16_t *max_types);
120
121         /**
122          * Retrieves the string description for the CFA resource
123          * type
124          *
125          * [in] tfp
126          *   Pointer to TF handle
127          *
128          * [in] resource_id
129          *   HCAPI cfa resource type id
130          *
131          * [out] resource_str
132          *   Pointer to a string
133          *
134          * Returns
135          *   - (0) if successful.
136          *   - (-EINVAL) on failure.
137          */
138         int (*tf_dev_get_resource_str)(struct tf *tfp,
139                                        uint16_t resource_id,
140                                        const char **resource_str);
141
142         /**
143          * Retrieves the WC TCAM slice information that the device
144          * supports.
145          *
146          * [in] tfp
147          *   Pointer to TF handle
148          *
149          * [in] type
150          *   TCAM table type
151          *
152          * [in] key_sz
153          *   Key size
154          *
155          * [out] num_slices_per_row
156          *   Pointer to number of slices per row the device supports
157          *
158          * Returns
159          *   - (0) if successful.
160          *   - (-EINVAL) on failure.
161          */
162         int (*tf_dev_get_tcam_slice_info)(struct tf *tfp,
163                                           enum tf_tcam_tbl_type type,
164                                           uint16_t key_sz,
165                                           uint16_t *num_slices_per_row);
166
167         /**
168          * Allocation of an identifier element.
169          *
170          * This API allocates the specified identifier element from a
171          * device specific identifier DB. The allocated element is
172          * returned.
173          *
174          * [in] tfp
175          *   Pointer to TF handle
176          *
177          * [in] parms
178          *   Pointer to identifier allocation parameters
179          *
180          * Returns
181          *   - (0) if successful.
182          *   - (-EINVAL) on failure.
183          */
184         int (*tf_dev_alloc_ident)(struct tf *tfp,
185                                   struct tf_ident_alloc_parms *parms);
186
187         /**
188          * Free of an identifier element.
189          *
190          * This API free's a previous allocated identifier element from a
191          * device specific identifier DB.
192          *
193          * [in] tfp
194          *   Pointer to TF handle
195          *
196          * [in] parms
197          *   Pointer to identifier free parameters
198          *
199          * Returns
200          *   - (0) if successful.
201          *   - (-EINVAL) on failure.
202          */
203         int (*tf_dev_free_ident)(struct tf *tfp,
204                                  struct tf_ident_free_parms *parms);
205
206         /**
207          * Search of an identifier element.
208          *
209          * This API search the specified identifier element from a
210          * device specific identifier shadow DB. The allocated element
211          * is returned.
212          *
213          * [in] tfp
214          *   Pointer to TF handle
215          *
216          * [in] parms
217          *   Pointer to identifier search parameters
218          *
219          * Returns
220          *   - (0) if successful.
221          *   - (-EINVAL) on failure.
222          */
223         int (*tf_dev_search_ident)(struct tf *tfp,
224                                    struct tf_ident_search_parms *parms);
225
226         /**
227          * Retrieves the identifier resource info.
228          *
229          * This API retrieves the identifier resource info from the rm db.
230          *
231          * [in] tfp
232          *   Pointer to TF handle
233          *
234          * [in] parms
235          *   Pointer to identifier info
236          *
237          * Returns
238          *   - (0) if successful.
239          *   - (-EINVAL) on failure.
240          */
241         int (*tf_dev_get_ident_resc_info)(struct tf *tfp,
242                                           struct tf_identifier_resource_info *parms);
243
244         /**
245          * Get SRAM table information.
246          *
247          * Converts an internal RM allocated element offset to
248          * a user address and vice versa.
249          *
250          * [in] tfp
251          *   Pointer to TF handle
252          *
253          * [in] type
254          *   Truflow index table type, e.g. TF_TYPE_FULL_ACT_RECORD
255          *
256          * [in/out] base
257          *   Pointer to the base address of the associated table type.
258          *
259          * [in/out] shift
260          *   Pointer to any shift required for the associated table type.
261          *
262          * Returns
263          *   - (0) if successful.
264          *   - (-EINVAL) on failure.
265          */
266         int (*tf_dev_get_tbl_info)(struct tf *tfp,
267                                    void *tbl_db,
268                                    enum tf_tbl_type type,
269                                    uint16_t *base,
270                                    uint16_t *shift);
271
272         /**
273          * Allocation of an index table type element.
274          *
275          * This API allocates the specified table type element from a
276          * device specific table type DB. The allocated element is
277          * returned.
278          *
279          * [in] tfp
280          *   Pointer to TF handle
281          *
282          * [in] parms
283          *   Pointer to table allocation parameters
284          *
285          * Returns
286          *   - (0) if successful.
287          *   - (-EINVAL) on failure.
288          */
289         int (*tf_dev_alloc_tbl)(struct tf *tfp,
290                                 struct tf_tbl_alloc_parms *parms);
291
292         /**
293          * Allocation of a external table type element.
294          *
295          * This API allocates the specified table type element from a
296          * device specific table type DB. The allocated element is
297          * returned.
298          *
299          * [in] tfp
300          *   Pointer to TF handle
301          *
302          * [in] parms
303          *   Pointer to table allocation parameters
304          *
305          * Returns
306          *   - (0) if successful.
307          *   - (-EINVAL) on failure.
308          */
309         int (*tf_dev_alloc_ext_tbl)(struct tf *tfp,
310                                     struct tf_tbl_alloc_parms *parms);
311
312         /**
313          * Free of a table type element.
314          *
315          * This API free's a previous allocated table type element from a
316          * device specific table type DB.
317          *
318          * [in] tfp
319          *   Pointer to TF handle
320          *
321          * [in] parms
322          *   Pointer to table free parameters
323          *
324          * Returns
325          *   - (0) if successful.
326          *   - (-EINVAL) on failure.
327          */
328         int (*tf_dev_free_tbl)(struct tf *tfp,
329                                struct tf_tbl_free_parms *parms);
330
331         /**
332          * Free of a external table type element.
333          *
334          * This API free's a previous allocated table type element from a
335          * device specific table type DB.
336          *
337          * [in] tfp
338          *   Pointer to TF handle
339          *
340          * [in] parms
341          *   Pointer to table free parameters
342          *
343          * Returns
344          *   - (0) if successful.
345          *   - (-EINVAL) on failure.
346          */
347         int (*tf_dev_free_ext_tbl)(struct tf *tfp,
348                                    struct tf_tbl_free_parms *parms);
349
350         /**
351          * Searches for the specified table type element in a shadow DB.
352          *
353          * This API searches for the specified table type element in a
354          * device specific shadow DB. If the element is found the
355          * reference count for the element is updated. If the element
356          * is not found a new element is allocated from the table type
357          * DB and then inserted into the shadow DB.
358          *
359          * [in] tfp
360          *   Pointer to TF handle
361          *
362          * [in] parms
363          *   Pointer to table allocation and search parameters
364          *
365          * Returns
366          *   - (0) if successful.
367          *   - (-EINVAL) on failure.
368          */
369         int (*tf_dev_alloc_search_tbl)(struct tf *tfp,
370                                        struct tf_tbl_alloc_search_parms *parms);
371
372         /**
373          * Sets the specified table type element.
374          *
375          * This API sets the specified element data by invoking the
376          * firmware.
377          *
378          * [in] tfp
379          *   Pointer to TF handle
380          *
381          * [in] parms
382          *   Pointer to table set parameters
383          *
384          * Returns
385          *   - (0) if successful.
386          *   - (-EINVAL) on failure.
387          */
388         int (*tf_dev_set_tbl)(struct tf *tfp,
389                               struct tf_tbl_set_parms *parms);
390
391         /**
392          * Sets the specified external table type element.
393          *
394          * This API sets the specified element data by invoking the
395          * firmware.
396          *
397          * [in] tfp
398          *   Pointer to TF handle
399          *
400          * [in] parms
401          *   Pointer to table set parameters
402          *
403          * Returns
404          *   - (0) if successful.
405          *   - (-EINVAL) on failure.
406          */
407         int (*tf_dev_set_ext_tbl)(struct tf *tfp,
408                                   struct tf_tbl_set_parms *parms);
409
410         /**
411          * Retrieves the specified table type element.
412          *
413          * This API retrieves the specified element data by invoking the
414          * firmware.
415          *
416          * [in] tfp
417          *   Pointer to TF handle
418          *
419          * [in] parms
420          *   Pointer to table get parameters
421          *
422          * Returns
423          *   - (0) if successful.
424          *   - (-EINVAL) on failure.
425          */
426         int (*tf_dev_get_tbl)(struct tf *tfp,
427                               struct tf_tbl_get_parms *parms);
428
429         /**
430          * Retrieves the specified table type element using 'bulk'
431          * mechanism.
432          *
433          * This API retrieves the specified element data by invoking the
434          * firmware.
435          *
436          * [in] tfp
437          *   Pointer to TF handle
438          *
439          * [in] parms
440          *   Pointer to table get bulk parameters
441          *
442          * Returns
443          *   - (0) if successful.
444          *   - (-EINVAL) on failure.
445          */
446         int (*tf_dev_get_bulk_tbl)(struct tf *tfp,
447                                    struct tf_tbl_get_bulk_parms *parms);
448
449         /**
450          * Gets the increment value to add to the shared session resource
451          * start offset by for each count in the "stride"
452          *
453          * [in] tfp
454          *   Pointer to TF handle
455          *
456          * [in] parms
457          *   Pointer to get shared tbl increment parameters
458          *
459          * Returns
460          *   - (0) if successful.
461          *   - (-EINVAL) on failure.
462          */
463         int (*tf_dev_get_shared_tbl_increment)(struct tf *tfp,
464                                 struct tf_get_shared_tbl_increment_parms *parms);
465
466         /**
467          * Retrieves the table resource info.
468          *
469          * This API retrieves the table resource info from the rm db.
470          *
471          * [in] tfp
472          *   Pointer to TF handle
473          *
474          * [in] parms
475          *   Pointer to tbl info
476          *
477          * Returns
478          *   - (0) if successful.
479          *   - (-EINVAL) on failure.
480          */
481         int (*tf_dev_get_tbl_resc_info)(struct tf *tfp,
482                                          struct tf_tbl_resource_info *parms);
483
484         /**
485          * Allocation of a tcam element.
486          *
487          * This API allocates the specified tcam element from a device
488          * specific tcam DB. The allocated element is returned.
489          *
490          * [in] tfp
491          *   Pointer to TF handle
492          *
493          * [in] parms
494          *   Pointer to tcam allocation parameters
495          *
496          * Returns
497          *   - (0) if successful.
498          *   - (-EINVAL) on failure.
499          */
500         int (*tf_dev_alloc_tcam)(struct tf *tfp,
501                                  struct tf_tcam_alloc_parms *parms);
502
503         /**
504          * Free of a tcam element.
505          *
506          * This API free's a previous allocated tcam element from a
507          * device specific tcam DB.
508          *
509          * [in] tfp
510          *   Pointer to TF handle
511          *
512          * [in] parms
513          *   Pointer to tcam free parameters
514          *
515          * Returns
516          *   - (0) if successful.
517          *   - (-EINVAL) on failure.
518          */
519         int (*tf_dev_free_tcam)(struct tf *tfp,
520                                 struct tf_tcam_free_parms *parms);
521
522         /**
523          * Searches for the specified tcam element in a shadow DB.
524          *
525          * This API searches for the specified tcam element in a
526          * device specific shadow DB. If the element is found the
527          * reference count for the element is updated. If the element
528          * is not found a new element is allocated from the tcam DB
529          * and then inserted into the shadow DB.
530          *
531          * [in] tfp
532          *   Pointer to TF handle
533          *
534          * [in] parms
535          *   Pointer to tcam allocation and search parameters
536          *
537          * Returns
538          *   - (0) if successful.
539          *   - (-EINVAL) on failure.
540          */
541         int (*tf_dev_alloc_search_tcam)
542                         (struct tf *tfp,
543                         struct tf_tcam_alloc_search_parms *parms);
544
545         /**
546          * Sets the specified tcam element.
547          *
548          * This API sets the specified element data by invoking the
549          * firmware.
550          *
551          * [in] tfp
552          *   Pointer to TF handle
553          *
554          * [in] parms
555          *   Pointer to tcam set parameters
556          *
557          * Returns
558          *   - (0) if successful.
559          *   - (-EINVAL) on failure.
560          */
561         int (*tf_dev_set_tcam)(struct tf *tfp,
562                                struct tf_tcam_set_parms *parms);
563
564         /**
565          * Retrieves the specified tcam element.
566          *
567          * This API retrieves the specified element data by invoking the
568          * firmware.
569          *
570          * [in] tfp
571          *   Pointer to TF handle
572          *
573          * [in] parms
574          *   Pointer to tcam get parameters
575          *
576          * Returns
577          *   - (0) if successful.
578          *   - (-EINVAL) on failure.
579          */
580         int (*tf_dev_get_tcam)(struct tf *tfp,
581                                struct tf_tcam_get_parms *parms);
582
583 #ifdef TF_TCAM_SHARED
584         /**
585          * Move TCAM shared entries
586          *
587          * [in] tfp
588          *   Pointer to TF handle
589          *
590          * [in] parms
591          *   Pointer to parameters
592          *
593          *    returns:
594          *    0       - Success
595          *    -EINVAL - Error
596          */
597         int (*tf_dev_move_tcam)(struct tf *tfp,
598                                struct tf_move_tcam_shared_entries_parms *parms);
599
600         /**
601          * Move TCAM shared entries
602          *
603          * [in] tfp
604          *   Pointer to TF handle
605          *
606          * [in] parms
607          *   Pointer to parameters
608          *
609          *    returns:
610          *    0       - Success
611          *    -EINVAL - Error
612          */
613         int (*tf_dev_clear_tcam)(struct tf *tfp,
614                               struct tf_clear_tcam_shared_entries_parms *parms);
615
616 #endif /* TF_TCAM_SHARED */
617
618         /**
619          * Retrieves the tcam resource info.
620          *
621          * This API retrieves the tcam resource info from the rm db.
622          *
623          * [in] tfp
624          *   Pointer to TF handle
625          *
626          * [in] parms
627          *   Pointer to tcam info
628          *
629          * Returns
630          *   - (0) if successful.
631          *   - (-EINVAL) on failure.
632          */
633         int (*tf_dev_get_tcam_resc_info)(struct tf *tfp,
634                                          struct tf_tcam_resource_info *parms);
635
636         /**
637          * Insert EM hash entry API
638          *
639          * [in] tfp
640          *   Pointer to TF handle
641          *
642          * [in] parms
643          *   Pointer to E/EM insert parameters
644          *
645          *  Returns:
646          *    0       - Success
647          *    -EINVAL - Error
648          */
649         int (*tf_dev_insert_int_em_entry)(struct tf *tfp,
650                                           struct tf_insert_em_entry_parms *parms);
651
652         /**
653          * Delete EM hash entry API
654          *
655          * [in] tfp
656          *   Pointer to TF handle
657          *
658          * [in] parms
659          *   Pointer to E/EM delete parameters
660          *
661          *    returns:
662          *    0       - Success
663          *    -EINVAL - Error
664          */
665         int (*tf_dev_delete_int_em_entry)(struct tf *tfp,
666                                           struct tf_delete_em_entry_parms *parms);
667
668         /**
669          * Move EM hash entry API
670          *
671          * [in] tfp
672          *   Pointer to TF handle
673          *
674          * [in] parms
675          *   Pointer to E/EM move parameters
676          *
677          *    returns:
678          *    0       - Success
679          *    -EINVAL - Error
680          */
681         int (*tf_dev_move_int_em_entry)(struct tf *tfp,
682                                         struct tf_move_em_entry_parms *parms);
683
684         /**
685          * Insert EEM hash entry API
686          *
687          * [in] tfp
688          *   Pointer to TF handle
689          *
690          * [in] parms
691          *   Pointer to E/EM insert parameters
692          *
693          *  Returns:
694          *    0       - Success
695          *    -EINVAL - Error
696          */
697         int (*tf_dev_insert_ext_em_entry)(struct tf *tfp,
698                                           struct tf_insert_em_entry_parms *parms);
699
700         /**
701          * Delete EEM hash entry API
702          *
703          * [in] tfp
704          *   Pointer to TF handle
705          *
706          * [in] parms
707          *   Pointer to E/EM delete parameters
708          *
709          *    returns:
710          *    0       - Success
711          *    -EINVAL - Error
712          */
713         int (*tf_dev_delete_ext_em_entry)(struct tf *tfp,
714                                           struct tf_delete_em_entry_parms *parms);
715
716         /**
717          * Retrieves the em resource info.
718          *
719          * This API retrieves the em resource info from the rm db.
720          *
721          * [in] tfp
722          *   Pointer to TF handle
723          *
724          * [in] parms
725          *   Pointer to em info
726          *
727          * Returns
728          *   - (0) if successful.
729          *   - (-EINVAL) on failure.
730          */
731         int (*tf_dev_get_em_resc_info)(struct tf *tfp,
732                                        struct tf_em_resource_info *parms);
733
734         /**
735          * Move EEM hash entry API
736          *
737          *   Pointer to E/EM move parameters
738          *
739          * [in] tfp
740          *   Pointer to TF handle
741          *
742          * [in] parms
743          *   Pointer to em info
744          *
745          *    returns:
746          *    0       - Success
747          *    -EINVAL - Error
748          */
749         int (*tf_dev_move_ext_em_entry)(struct tf *tfp,
750                                         struct tf_move_em_entry_parms *parms);
751
752         /**
753          * Allocate EEM table scope
754          *
755          * [in] tfp
756          *   Pointer to TF handle
757          *
758          * [in] parms
759          *   Pointer to table scope alloc parameters
760          *
761          *    returns:
762          *    0       - Success
763          *    -EINVAL - Error
764          */
765         int (*tf_dev_alloc_tbl_scope)(struct tf *tfp,
766                                       struct tf_alloc_tbl_scope_parms *parms);
767         /**
768          * Map EEM parif
769          *
770          * [in] tfp
771          *   Pointer to TF handle
772          *
773          * [in] pf
774          * PF associated with the table scope
775          *
776          * [in] parif_bitmask
777          * Bitmask of PARIFs to enable
778          *
779          * [in/out] pointer to the parif_2_pf data to be updated
780          *
781          * [in/out] pointer to the parif_2_pf mask to be updated
782          *
783          * [in] sz_in_bytes - number of bytes to be written
784          *
785          *    returns:
786          *    0       - Success
787          *    -EINVAL - Error
788          */
789         int (*tf_dev_map_parif)(struct tf *tfp,
790                                 uint16_t parif_bitmask,
791                                 uint16_t pf,
792                                 uint8_t *data,
793                                 uint8_t *mask,
794                                 uint16_t sz_in_bytes);
795         /**
796          * Map EEM table scope
797          *
798          * [in] tfp
799          *   Pointer to TF handle
800          *
801          * [in] parms
802          *   Pointer to table scope map parameters
803          *
804          *    returns:
805          *    0       - Success
806          *    -EINVAL - Error
807          */
808         int (*tf_dev_map_tbl_scope)(struct tf *tfp,
809                                     struct tf_map_tbl_scope_parms *parms);
810
811         /**
812          * Free EEM table scope
813          *
814          * [in] tfp
815          *   Pointer to TF handle
816          *
817          * [in] parms
818          *   Pointer to table scope free parameters
819          *
820          *    returns:
821          *    0       - Success
822          *    -EINVAL - Error
823          */
824         int (*tf_dev_free_tbl_scope)(struct tf *tfp,
825                                      struct tf_free_tbl_scope_parms *parms);
826
827         /**
828          * Sets the specified interface table type element.
829          *
830          * This API sets the specified element data by invoking the
831          * firmware.
832          *
833          * [in] tfp
834          *   Pointer to TF handle
835          *
836          * [in] parms
837          *   Pointer to interface table set parameters
838          *
839          * Returns
840          *   - (0) if successful.
841          *   - (-EINVAL) on failure.
842          */
843         int (*tf_dev_set_if_tbl)(struct tf *tfp,
844                                  struct tf_if_tbl_set_parms *parms);
845
846         /**
847          * Retrieves the specified interface table type element.
848          *
849          * This API retrieves the specified element data by invoking the
850          * firmware.
851          *
852          * [in] tfp
853          *   Pointer to TF handle
854          *
855          * [in] parms
856          *   Pointer to table get parameters
857          *
858          * Returns
859          *   - (0) if successful.
860          *   - (-EINVAL) on failure.
861          */
862         int (*tf_dev_get_if_tbl)(struct tf *tfp,
863                                  struct tf_if_tbl_get_parms *parms);
864
865         /**
866          * Update global cfg
867          *
868          * [in] tfp
869          *   Pointer to TF handle
870          *
871          * [in] parms
872          *   Pointer to global cfg parameters
873          *
874          *    returns:
875          *    0       - Success
876          *    -EINVAL - Error
877          */
878         int (*tf_dev_set_global_cfg)(struct tf *tfp,
879                                      struct tf_global_cfg_parms *parms);
880
881         /**
882          * Get global cfg
883          *
884          * [in] tfp
885          *   Pointer to TF handle
886          *
887          * [in] parms
888          *   Pointer to global cfg parameters
889          *
890          *    returns:
891          *    0       - Success
892          *    -EINVAL - Error
893          */
894         int (*tf_dev_get_global_cfg)(struct tf *tfp,
895                                      struct tf_global_cfg_parms *parms);
896
897         /**
898          * Get mailbox
899          *
900          *    returns:
901          *      mailbox
902          */
903         int (*tf_dev_get_mailbox)(void);
904
905         /**
906          * Convert length in bit to length in byte and align to word.
907          * The word length depends on device type.
908          *
909          * [in] size
910          *   Size in bit
911          *
912          * Returns
913          *   Size in byte
914          */
915         int (*tf_dev_word_align)(uint16_t size);
916
917         /**
918          * Hash key using crc32 and lookup3
919          *
920          * [in] key_data
921          *   Pointer to key
922          *
923          * [in] bitlen
924          *   Number of key bits
925          *
926          * Returns
927          *   Hashes
928          */
929         uint64_t (*tf_dev_cfa_key_hash)(uint64_t *key_data,
930                                           uint16_t bitlen);
931 };
932
933 /**
934  * Supported device operation structures
935  */
936 extern const struct tf_dev_ops tf_dev_ops_p4_init;
937 extern const struct tf_dev_ops tf_dev_ops_p4;
938 extern const struct tf_dev_ops tf_dev_ops_p58_init;
939 extern const struct tf_dev_ops tf_dev_ops_p58;
940
941 #endif /* _TF_DEVICE_H_ */