Adding userspace support for the MC (Management Complex) means exporting an ioctl capable device file representing the root resource container. This new functionality in the fsl-mc bus driver intends to provide userspace applications an interface to interact with the MC firmware. Commands that are composed in userspace are sent to the MC firmware through the FSL_MC_SEND_MC_COMMAND ioctl. By default the implicit MC I/O portal is used for this operation, but if the implicit one is busy, a dynamic portal is allocated and then freed upon execution. The command received through the ioctl interface is checked against a known whitelist of accepted MC commands. Commands that attempt a change in hardware configuration will need CAP_NET_ADMIN, while commands used in debugging do not need it.
Showing the changes to include/uapi (1 of 7 files). Show all
Unified · Split
| @@ -16,10 +16,19 @@ · 15 unmodified lines | |||
| 16 | * struct fsl_mc_command - Management Complex (MC) command structure | 16 | * struct fsl_mc_command - Management Complex (MC) command structure |
| 17 | * @header: MC command header | 17 | * @header: MC command header |
| 18 | * @params: MC command parameters | 18 | * @params: MC command parameters |
| 19 | * | ||
| 20 | * Used by FSL_MC_SEND_MC_COMMAND | ||
| 19 | */ | 21 | */ |
| 20 | struct fsl_mc_command { | 22 | struct fsl_mc_command { |
| 21 | __le64 header; | 23 | __le64 header; |
| 22 | __le64 params[MC_CMD_NUM_OF_PARAMS]; | 24 | __le64 params[MC_CMD_NUM_OF_PARAMS]; |
| 23 | }; | 25 | }; |
| 24 | 26 | ||
| 27 | #define FSL_MC_SEND_CMD_IOCTL_TYPE 'R' | ||
| 28 | #define FSL_MC_SEND_CMD_IOCTL_SEQ 0xE0 | ||
| 29 | |||
| 30 | #define FSL_MC_SEND_MC_COMMAND \ | ||
| 31 | _IOWR(FSL_MC_SEND_CMD_IOCTL_TYPE, FSL_MC_SEND_CMD_IOCTL_SEQ, \ | ||
| 32 | struct fsl_mc_command) | ||
| 33 | |||
| 25 | #endif /* _UAPI_FSL_MC_H_ */ | 34 | #endif /* _UAPI_FSL_MC_H_ */ |