RTEMS CAN/CAN FD Stack
Loading...
Searching...
No Matches
can-bus.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR GPL-2.0-or-later */
2
12/*
13 * Copyright (C) 2023-2024 Michal Lenc <michallenc@seznam.cz>
14 * Implementation is based on original LinCAN - Linux CAN bus driver
15 * Part of OrtCAN project https://ortcan.sourceforge.net/
16 * Copyright (C) 2002-2009 DCE FEE CTU Prague <http://control.fel.cvut.cz>
17 * Copyright (C) 2002-2024 Pavel Pisa <pisa@cmp.felk.cvut.cz>
18 *
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
21 * are met:
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 * 2. Redistributions in binary form must reproduce the above copyright
25 * notice, this list of conditions and the following disclaimer in the
26 * documentation and/or other materials provided with the distribution.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
32 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGE.
39 */
40
41#ifndef _DEV_CAN_CAN_BUS_H
42#define _DEV_CAN_CAN_BUS_H
43
44#include <rtems.h>
45#include <stdint.h>
46#include <stdatomic.h>
47#include <sys/ioccom.h>
48#include <rtems/thread.h>
49
50struct can_chip;
51
59struct can_bus {
65 struct can_chip *chip;
66};
67
68int can_bus_register( struct can_bus *bus, const char *bus_path );
69
70#endif /* _DEV_CAN_CAN_DEVCOMMON_H */
int can_bus_register(struct can_bus *bus, const char *bus_path)
This function registeres CAN device into /dev namespace.
Definition: can-bus.c:780
This structure represents CAN bus device. This is the main structure passed throught file system duri...
Definition: can-bus.h:59
struct can_chip * chip
This member holds the pointer to can_chip structure. Controller specific initialization function shou...
Definition: can-bus.h:65
This structure represents one CAN controller.
Definition: can-devcommon.h:144