drivers: can: allow calling can_set_bitrate() from userspace
Add syscall to allow calling can_set_bitrate() from userspace. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
e5848129be
commit
d5f3f20edb
3 changed files with 11 additions and 2 deletions
|
@ -207,7 +207,7 @@ uint16_t sample_point_for_bitrate(uint32_t bitrate)
|
|||
return sample_pnt;
|
||||
}
|
||||
|
||||
int can_set_bitrate(const struct device *dev, uint32_t bitrate, uint32_t bitrate_data)
|
||||
int z_impl_can_set_bitrate(const struct device *dev, uint32_t bitrate, uint32_t bitrate_data)
|
||||
{
|
||||
struct can_timing timing;
|
||||
#ifdef CONFIG_CAN_FD_MODE
|
||||
|
|
|
@ -123,6 +123,15 @@ static inline int z_vrfy_can_set_mode(const struct device *dev, enum can_mode mo
|
|||
}
|
||||
#include <syscalls/can_set_mode_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_can_set_bitrate(const struct device *dev, uint32_t bitrate,
|
||||
uint32_t bitrate_data)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, set_timing));
|
||||
|
||||
return z_impl_can_set_bitrate(dev, bitrate, bitrate_data);
|
||||
}
|
||||
#include <syscalls/can_set_bitrate_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_can_send(const struct device *dev,
|
||||
const struct zcan_frame *frame,
|
||||
k_timeout_t timeout,
|
||||
|
|
|
@ -867,7 +867,7 @@ static inline int z_impl_can_set_mode(const struct device *dev, enum can_mode mo
|
|||
* @retval -EINVAL bitrate/sample point cannot be met.
|
||||
* @retval -EIO General input/output error, failed to set bitrate.
|
||||
*/
|
||||
int can_set_bitrate(const struct device *dev, uint32_t bitrate, uint32_t bitrate_data);
|
||||
__syscall int can_set_bitrate(const struct device *dev, uint32_t bitrate, uint32_t bitrate_data);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue