move can.h to drivers/can.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit implements a CAN loopback device. This device is used
for testing when no CAN controller is available on the hardware.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
can_attach_workq is an isr wrapper that puts a work item into a workq
whenever a received frame matches the filter. With this function it is
possible to have a callback that is offloaded. This is useful if the
work is too complex for an isr or USERSPACE is enabled.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
can_attach_msgq can be implemented as a wrapper of can_attach_isr.
This is implemented as a common function for all drives and reduces
the complexity of the specific drivers. Since this is common to
multi instances of drivers too, it is removed from the API struct.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit extends the CAN api can_send function by an argument
that is passed to the isr callback.
With this extension it is possible to distinguish between sent masseges
when they use the same callback.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit extends the CAN api attach_isr function by an argument
that is passed to the isr callback.
With this extension it is possible to distinguish between filter matches
when they use the same callback.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
When some header are included into C++ source file, this kind of
compilations errors are generated:
error: invalid conversion from 'void*'
to 'u32_t*' {aka 'unsigned int*'} [-fpermissive]
Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
One of the function parameter in conversion functions can be
make const (because we are not changing it).
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Update reserved function names starting with one underscore, replacing
them as follows:
'_k_' with 'z_'
'_K_' with 'Z_'
'_handler_' with 'z_handl_'
'_Cstart' with 'z_cstart'
'_Swap' with 'z_swap'
This renaming is done on both global and those static function names
in kernel/include and include/. Other static function names in kernel/
are renamed by removing the leading underscore. Other function names
not starting with any prefix listed above are renamed starting with
a 'z_' or 'Z_' prefix.
Function names starting with two or three leading underscores are not
automatcally renamed since these names will collide with the variants
with two or three leading underscores.
Various generator scripts have also been updated as well as perf,
linker and usb files. These are
drivers/serial/uart_handlers.c
include/linker/kobject-text.ld
kernel/include/syscall_handler.h
scripts/gen_kobject_list.py
scripts/gen_syscall_header.py
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
* Registration of interrupt context callbacks from user mode
is forbidden.
- Remove can_attach_isr() as a system call
- Enforce that can_send() has a NULL callback parameter
* k_msgq are kernel objects that do not live in user memory.
Fix the checks for it in can_attach_msgq().
* CAN API documentation was with the API struct typedefs and
not the actual APIs. Moved.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
For sending the zcan_frame can be const, because its only
copied to the registers.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
The error numbers are currently not negative an CAN_TIMEOUT overlapps
with TX errors. Fix that by making the numbers negative and timeout
the first negative number.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
In order to follow the naming from Linux, change the name of
can_msg to zcan_frame, and can_msg_filter to zcan_filter.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add new "struct can_frame" which is compatible with Linux so that it
is easier to port socket-can applications from Linux.
Rename existing can_filter to can_msg_filter so that the name will
not conflict with Linux compatible can_filter struct.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we include this headers files in cpp source code,
the compiler say"error: template with C linkage".
Includes must be moved outside the 'extern "C"' section.
Signed-off-by: Benoit Leforestier <benoit.leforestier@sekurity.fr>
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This adds example and testing code for CAN driver.
Tested on stm32f072b disco.
Examples are given for:
- can_configure
- can_attach_isr
- can_attach_msgq
- can_send
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This API defines following calls
- can_configure
- can_send
- can_attach_isr
- can_attach_msgq
- can_detach
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>