.. | .. |
---|
48 | 48 | |
---|
49 | 49 | void *mlx5_accel_esp_create_hw_context(struct mlx5_core_dev *mdev, |
---|
50 | 50 | struct mlx5_accel_esp_xfrm *xfrm, |
---|
51 | | - const __be32 saddr[4], |
---|
52 | | - const __be32 daddr[4], |
---|
53 | | - const __be32 spi, bool is_ipv6); |
---|
54 | | -void mlx5_accel_esp_free_hw_context(void *context); |
---|
| 51 | + u32 *sa_handle); |
---|
| 52 | +void mlx5_accel_esp_free_hw_context(struct mlx5_core_dev *mdev, void *context); |
---|
55 | 53 | |
---|
56 | | -int mlx5_accel_ipsec_init(struct mlx5_core_dev *mdev); |
---|
| 54 | +void mlx5_accel_ipsec_init(struct mlx5_core_dev *mdev); |
---|
57 | 55 | void mlx5_accel_ipsec_cleanup(struct mlx5_core_dev *mdev); |
---|
| 56 | + |
---|
| 57 | +struct mlx5_accel_ipsec_ops { |
---|
| 58 | + u32 (*device_caps)(struct mlx5_core_dev *mdev); |
---|
| 59 | + unsigned int (*counters_count)(struct mlx5_core_dev *mdev); |
---|
| 60 | + int (*counters_read)(struct mlx5_core_dev *mdev, u64 *counters, unsigned int count); |
---|
| 61 | + void* (*create_hw_context)(struct mlx5_core_dev *mdev, |
---|
| 62 | + struct mlx5_accel_esp_xfrm *xfrm, |
---|
| 63 | + const __be32 saddr[4], const __be32 daddr[4], |
---|
| 64 | + const __be32 spi, bool is_ipv6, u32 *sa_handle); |
---|
| 65 | + void (*free_hw_context)(void *context); |
---|
| 66 | + int (*init)(struct mlx5_core_dev *mdev); |
---|
| 67 | + void (*cleanup)(struct mlx5_core_dev *mdev); |
---|
| 68 | + struct mlx5_accel_esp_xfrm* (*esp_create_xfrm)(struct mlx5_core_dev *mdev, |
---|
| 69 | + const struct mlx5_accel_esp_xfrm_attrs *attrs, |
---|
| 70 | + u32 flags); |
---|
| 71 | + int (*esp_modify_xfrm)(struct mlx5_accel_esp_xfrm *xfrm, |
---|
| 72 | + const struct mlx5_accel_esp_xfrm_attrs *attrs); |
---|
| 73 | + void (*esp_destroy_xfrm)(struct mlx5_accel_esp_xfrm *xfrm); |
---|
| 74 | +}; |
---|
58 | 75 | |
---|
59 | 76 | #else |
---|
60 | 77 | |
---|
.. | .. |
---|
63 | 80 | static inline void * |
---|
64 | 81 | mlx5_accel_esp_create_hw_context(struct mlx5_core_dev *mdev, |
---|
65 | 82 | struct mlx5_accel_esp_xfrm *xfrm, |
---|
66 | | - const __be32 saddr[4], |
---|
67 | | - const __be32 daddr[4], |
---|
68 | | - const __be32 spi, bool is_ipv6) |
---|
| 83 | + u32 *sa_handle) |
---|
69 | 84 | { |
---|
70 | 85 | return NULL; |
---|
71 | 86 | } |
---|
72 | 87 | |
---|
73 | | -static inline void mlx5_accel_esp_free_hw_context(void *context) |
---|
74 | | -{ |
---|
75 | | -} |
---|
| 88 | +static inline void mlx5_accel_esp_free_hw_context(struct mlx5_core_dev *mdev, void *context) {} |
---|
76 | 89 | |
---|
77 | | -static inline int mlx5_accel_ipsec_init(struct mlx5_core_dev *mdev) |
---|
78 | | -{ |
---|
79 | | - return 0; |
---|
80 | | -} |
---|
| 90 | +static inline void mlx5_accel_ipsec_init(struct mlx5_core_dev *mdev) {} |
---|
81 | 91 | |
---|
82 | | -static inline void mlx5_accel_ipsec_cleanup(struct mlx5_core_dev *mdev) |
---|
83 | | -{ |
---|
84 | | -} |
---|
| 92 | +static inline void mlx5_accel_ipsec_cleanup(struct mlx5_core_dev *mdev) {} |
---|
85 | 93 | |
---|
86 | | -#endif |
---|
| 94 | +#endif /* CONFIG_MLX5_ACCEL */ |
---|
87 | 95 | |
---|
88 | 96 | #endif /* __MLX5_ACCEL_IPSEC_H__ */ |
---|