Error reporting interrupt is very useful to notify users that some errors are detected by the hardware. Once users are notified, they could query hardware logged error states, no need to continuously poll on these states. This patch adds interrupt support for port error reporting sub feature. It follows the common DFL interrupt notification and handling mechanism, implements two ioctl commands below for user to query number of irqs supported, and set/unset interrupt triggers. Ioctls: * DFL_FPGA_PORT_ERR_GET_IRQ_NUM get the number of irqs, which is used to determine whether/how many interrupts error reporting feature supports. * DFL_FPGA_PORT_ERR_SET_IRQ set/unset given eventfds as error interrupt triggers.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -164,6 +164,29 @@ struct dfl_fpga_irq_set { · 163 unmodified lines | |||
| 164 | __s32 evtfds[]; | 164 | __s32 evtfds[]; |
| 165 | }; | 165 | }; |
| 166 | 166 | ||
| 167 | /** | ||
| 168 | * DFL_FPGA_PORT_ERR_GET_IRQ_NUM - _IOR(DFL_FPGA_MAGIC, DFL_PORT_BASE + 5, | ||
| 169 | * __u32 num_irqs) | ||
| 170 | * | ||
| 171 | * Get the number of irqs supported by the fpga port error reporting private | ||
| 172 | * feature. Currently hardware supports up to 1 irq. | ||
| 173 | * Return: 0 on success, -errno on failure. | ||
| 174 | */ | ||
| 175 | #define DFL_FPGA_PORT_ERR_GET_IRQ_NUM _IOR(DFL_FPGA_MAGIC, \ | ||
| 176 | DFL_PORT_BASE + 5, __u32) | ||
| 177 | |||
| 178 | /** | ||
| 179 | * DFL_FPGA_PORT_ERR_SET_IRQ - _IOW(DFL_FPGA_MAGIC, DFL_PORT_BASE + 6, | ||
| 180 | * struct dfl_fpga_irq_set) | ||
| 181 | * | ||
| 182 | * Set fpga port error reporting interrupt trigger if evtfds[n] is valid. | ||
| 183 | * Unset related interrupt trigger if evtfds[n] is a negative value. | ||
| 184 | * Return: 0 on success, -errno on failure. | ||
| 185 | */ | ||
| 186 | #define DFL_FPGA_PORT_ERR_SET_IRQ _IOW(DFL_FPGA_MAGIC, \ | ||
| 187 | DFL_PORT_BASE + 6, \ | ||
| 188 | struct dfl_fpga_irq_set) | ||
| 189 | |||
| 167 | /* IOCTLs for FME file descriptor */ | 190 | /* IOCTLs for FME file descriptor */ |
| 168 | 191 | ||
| 169 | /** | 192 | /** |