| .. | .. |
|---|
| 35 | 35 | |
|---|
| 36 | 36 | #ifdef CONFIG_MLX5_FPGA |
|---|
| 37 | 37 | |
|---|
| 38 | +#include <linux/mlx5/eq.h> |
|---|
| 39 | + |
|---|
| 40 | +#include "mlx5_core.h" |
|---|
| 41 | +#include "lib/eq.h" |
|---|
| 38 | 42 | #include "fpga/cmd.h" |
|---|
| 39 | 43 | |
|---|
| 40 | 44 | /* Represents an Innova device */ |
|---|
| 41 | 45 | struct mlx5_fpga_device { |
|---|
| 42 | 46 | struct mlx5_core_dev *mdev; |
|---|
| 47 | + struct mlx5_nb fpga_err_nb; |
|---|
| 48 | + struct mlx5_nb fpga_qp_err_nb; |
|---|
| 43 | 49 | spinlock_t state_lock; /* Protects state transitions */ |
|---|
| 44 | 50 | enum mlx5_fpga_status state; |
|---|
| 45 | 51 | enum mlx5_fpga_image last_admin_image; |
|---|
| .. | .. |
|---|
| 57 | 63 | }; |
|---|
| 58 | 64 | |
|---|
| 59 | 65 | #define mlx5_fpga_dbg(__adev, format, ...) \ |
|---|
| 60 | | - dev_dbg(&(__adev)->mdev->pdev->dev, "FPGA: %s:%d:(pid %d): " format, \ |
|---|
| 61 | | - __func__, __LINE__, current->pid, ##__VA_ARGS__) |
|---|
| 66 | + mlx5_core_dbg((__adev)->mdev, "FPGA: %s:%d:(pid %d): " format, \ |
|---|
| 67 | + __func__, __LINE__, current->pid, ##__VA_ARGS__) |
|---|
| 62 | 68 | |
|---|
| 63 | 69 | #define mlx5_fpga_err(__adev, format, ...) \ |
|---|
| 64 | | - dev_err(&(__adev)->mdev->pdev->dev, "FPGA: %s:%d:(pid %d): " format, \ |
|---|
| 65 | | - __func__, __LINE__, current->pid, ##__VA_ARGS__) |
|---|
| 70 | + mlx5_core_err((__adev)->mdev, "FPGA: %s:%d:(pid %d): " format, \ |
|---|
| 71 | + __func__, __LINE__, current->pid, ##__VA_ARGS__) |
|---|
| 66 | 72 | |
|---|
| 67 | 73 | #define mlx5_fpga_warn(__adev, format, ...) \ |
|---|
| 68 | | - dev_warn(&(__adev)->mdev->pdev->dev, "FPGA: %s:%d:(pid %d): " format, \ |
|---|
| 69 | | - __func__, __LINE__, current->pid, ##__VA_ARGS__) |
|---|
| 74 | + mlx5_core_warn((__adev)->mdev, "FPGA: %s:%d:(pid %d): " format, \ |
|---|
| 75 | + __func__, __LINE__, current->pid, ##__VA_ARGS__) |
|---|
| 70 | 76 | |
|---|
| 71 | 77 | #define mlx5_fpga_warn_ratelimited(__adev, format, ...) \ |
|---|
| 72 | | - dev_warn_ratelimited(&(__adev)->mdev->pdev->dev, "FPGA: %s:%d: " \ |
|---|
| 73 | | - format, __func__, __LINE__, ##__VA_ARGS__) |
|---|
| 78 | + mlx5_core_err_rl((__adev)->mdev, "FPGA: %s:%d: " \ |
|---|
| 79 | + format, __func__, __LINE__, ##__VA_ARGS__) |
|---|
| 74 | 80 | |
|---|
| 75 | 81 | #define mlx5_fpga_notice(__adev, format, ...) \ |
|---|
| 76 | | - dev_notice(&(__adev)->mdev->pdev->dev, "FPGA: " format, ##__VA_ARGS__) |
|---|
| 82 | + mlx5_core_info((__adev)->mdev, "FPGA: " format, ##__VA_ARGS__) |
|---|
| 77 | 83 | |
|---|
| 78 | 84 | #define mlx5_fpga_info(__adev, format, ...) \ |
|---|
| 79 | | - dev_info(&(__adev)->mdev->pdev->dev, "FPGA: " format, ##__VA_ARGS__) |
|---|
| 85 | + mlx5_core_info((__adev)->mdev, "FPGA: " format, ##__VA_ARGS__) |
|---|
| 80 | 86 | |
|---|
| 81 | 87 | int mlx5_fpga_init(struct mlx5_core_dev *mdev); |
|---|
| 82 | 88 | void mlx5_fpga_cleanup(struct mlx5_core_dev *mdev); |
|---|
| 83 | 89 | int mlx5_fpga_device_start(struct mlx5_core_dev *mdev); |
|---|
| 84 | 90 | void mlx5_fpga_device_stop(struct mlx5_core_dev *mdev); |
|---|
| 85 | | -void mlx5_fpga_event(struct mlx5_core_dev *mdev, u8 event, void *data); |
|---|
| 86 | 91 | |
|---|
| 87 | 92 | #else |
|---|
| 88 | 93 | |
|---|
| .. | .. |
|---|
| 101 | 106 | } |
|---|
| 102 | 107 | |
|---|
| 103 | 108 | static inline void mlx5_fpga_device_stop(struct mlx5_core_dev *mdev) |
|---|
| 104 | | -{ |
|---|
| 105 | | -} |
|---|
| 106 | | - |
|---|
| 107 | | -static inline void mlx5_fpga_event(struct mlx5_core_dev *mdev, u8 event, |
|---|
| 108 | | - void *data) |
|---|
| 109 | 109 | { |
|---|
| 110 | 110 | } |
|---|
| 111 | 111 | |
|---|