[97] | 1 | /*
|
---|
| 2 | ** Copyright 2012 by Kvaser AB, Mölndal, Sweden
|
---|
| 3 | ** http://www.kvaser.com
|
---|
| 4 | **
|
---|
| 5 | ** This software is dual licensed under the following two licenses:
|
---|
| 6 | ** BSD-new and GPLv2. You may use either one. See the included
|
---|
| 7 | ** COPYING file for details.
|
---|
| 8 | **
|
---|
| 9 | ** License: BSD-new
|
---|
| 10 | ** ===============================================================================
|
---|
| 11 | ** Redistribution and use in source and binary forms, with or without
|
---|
| 12 | ** modification, are permitted provided that the following conditions are met:
|
---|
| 13 | ** * Redistributions of source code must retain the above copyright
|
---|
| 14 | ** notice, this list of conditions and the following disclaimer.
|
---|
| 15 | ** * Redistributions in binary form must reproduce the above copyright
|
---|
| 16 | ** notice, this list of conditions and the following disclaimer in the
|
---|
| 17 | ** documentation and/or other materials provided with the distribution.
|
---|
| 18 | ** * Neither the name of the <organization> nor the
|
---|
| 19 | ** names of its contributors may be used to endorse or promote products
|
---|
| 20 | ** derived from this software without specific prior written permission.
|
---|
| 21 | **
|
---|
| 22 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
---|
| 23 | ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
---|
| 24 | ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
| 25 | ** DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
---|
| 26 | ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
---|
| 27 | ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
---|
| 28 | ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
| 29 | ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 30 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
---|
| 31 | ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 32 | **
|
---|
| 33 | **
|
---|
| 34 | ** License: GPLv2
|
---|
| 35 | ** ===============================================================================
|
---|
| 36 | ** This program is free software; you can redistribute it and/or
|
---|
| 37 | ** modify it under the terms of the GNU General Public License
|
---|
| 38 | ** as published by the Free Software Foundation; either version 2
|
---|
| 39 | ** of the License, or (at your option) any later version.
|
---|
| 40 | **
|
---|
| 41 | ** This program is distributed in the hope that it will be useful,
|
---|
| 42 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 43 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 44 | ** GNU General Public License for more details.
|
---|
| 45 | **
|
---|
| 46 | ** You should have received a copy of the GNU General Public License
|
---|
| 47 | ** along with this program; if not, write to the Free Software
|
---|
| 48 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
---|
| 49 | **
|
---|
| 50 | ** ---------------------------------------------------------------------------
|
---|
| 51 | **/
|
---|
| 52 |
|
---|
| 53 | #ifndef _CANIF_DATA_H_
|
---|
| 54 | #define _CANIF_DATA_H_
|
---|
| 55 |
|
---|
| 56 | #include <linux/types.h>
|
---|
| 57 |
|
---|
| 58 | /* Used as interface datatype */
|
---|
| 59 | typedef struct FilterData
|
---|
| 60 | {
|
---|
| 61 | __u32 cmdNr;
|
---|
| 62 | __s32 cmdNrMask;
|
---|
| 63 | __u8 chanNr;
|
---|
| 64 | __s8 chanNrMask;
|
---|
| 65 | __u8 flags;
|
---|
| 66 | __s8 flagsMask;
|
---|
| 67 | __u8 isPass;
|
---|
| 68 | } FilterData;
|
---|
| 69 |
|
---|
| 70 | typedef struct CanIfStat
|
---|
| 71 | {
|
---|
| 72 | __u32 overruns;
|
---|
| 73 | __u16 statSize;
|
---|
| 74 | __u16 sendQL;
|
---|
| 75 | __u16 rcvQL;
|
---|
| 76 | } CanIfStat;
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 | typedef struct {
|
---|
| 80 | __s32 freq;
|
---|
| 81 | __u32 sjw;
|
---|
| 82 | __u32 tseg1;
|
---|
| 83 | __u32 tseg2;
|
---|
| 84 | __u32 samp3;
|
---|
| 85 | // After bit rate switch (CAN FD)
|
---|
| 86 | __s32 freq_brs;
|
---|
| 87 | __u32 sjw_brs;
|
---|
| 88 | __u32 tseg1_brs;
|
---|
| 89 | __u32 tseg2_brs;
|
---|
| 90 | } VCanBusParams;
|
---|
| 91 |
|
---|
| 92 | typedef struct {
|
---|
| 93 | __u8 eventMask;
|
---|
| 94 | //__u8 msgFlags;
|
---|
| 95 | //__u8 flagsMask;
|
---|
| 96 | __u64 stdId;
|
---|
| 97 | __u64 stdMask;
|
---|
| 98 | __u64 extId;
|
---|
| 99 | __u64 extMask;
|
---|
| 100 | __u8 typeBlock;
|
---|
| 101 | } VCanMsgFilter;
|
---|
| 102 |
|
---|
| 103 | typedef struct {
|
---|
| 104 | __u32 buffer_number;
|
---|
| 105 | __u32 acc_code;
|
---|
| 106 | __u32 acc_mask;
|
---|
| 107 | __u32 flags;
|
---|
| 108 | __u32 type;
|
---|
| 109 | __u32 period;
|
---|
| 110 | // __u32 reserved[16]; // For future usage
|
---|
| 111 | } KCanObjbufAdminData;
|
---|
| 112 |
|
---|
| 113 |
|
---|
| 114 | typedef struct {
|
---|
| 115 | __u32 buffer_number;
|
---|
| 116 | __u32 id;
|
---|
| 117 | __u32 dlc;
|
---|
| 118 | __u8 data[128]; // CAN FD/EF
|
---|
| 119 | __u32 flags;
|
---|
| 120 | } KCanObjbufBufferData;
|
---|
| 121 |
|
---|
| 122 | #endif /* _CANIF_DATA_H_ */
|
---|
| 123 |
|
---|