Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'linux-can-next-for-3.15-20140212' of git://gitorious.org/linux-can/linux-can-next

linux-can-next-for-3.15-20140212

Marc Kleine-Budde says:

====================
this is a pull request of eight patches for net-next/master.

Florian Vaussard contributed a series that merged the sja1000 of_platform
into the platform driver. The of_platform driver is finally removed.
Stephane Grosjean supplied a patch to allocate CANFD skbs. In a patch
by Uwe Kleine-König another missing copyright information was added to
a userspace header. And a patch by Yoann DI RUZZA that adds listen only
mode to the at91_can driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+206 -296
+4
Documentation/devicetree/bindings/net/can/sja1000.txt
··· 12 12 13 13 Optional properties: 14 14 15 + - reg-io-width : Specify the size (in bytes) of the IO accesses that 16 + should be performed on the device. Valid value is 1, 2 or 4. 17 + Default to 1 (8 bits). 18 + 15 19 - nxp,external-clock-frequency : Frequency of the external oscillator 16 20 clock in Hz. Note that the internal clock frequency used by the 17 21 SJA1000 is half of that value. If not specified, a default value
+7 -2
drivers/net/can/at91_can.c
··· 420 420 at91_transceiver_switch(priv, 1); 421 421 422 422 /* enable chip */ 423 - at91_write(priv, AT91_MR, AT91_MR_CANEN); 423 + if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) 424 + reg_mr = AT91_MR_CANEN | AT91_MR_ABM; 425 + else 426 + reg_mr = AT91_MR_CANEN; 427 + at91_write(priv, AT91_MR, reg_mr); 424 428 425 429 priv->can.state = CAN_STATE_ERROR_ACTIVE; 426 430 ··· 1345 1341 priv->can.bittiming_const = &at91_bittiming_const; 1346 1342 priv->can.do_set_mode = at91_set_mode; 1347 1343 priv->can.do_get_berr_counter = at91_get_berr_counter; 1348 - priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES; 1344 + priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | 1345 + CAN_CTRLMODE_LISTENONLY; 1349 1346 priv->dev = dev; 1350 1347 priv->reg_base = addr; 1351 1348 priv->devtype_data = *devtype_data;
+24
drivers/net/can/dev.c
··· 512 512 } 513 513 EXPORT_SYMBOL_GPL(alloc_can_skb); 514 514 515 + struct sk_buff *alloc_canfd_skb(struct net_device *dev, 516 + struct canfd_frame **cfd) 517 + { 518 + struct sk_buff *skb; 519 + 520 + skb = netdev_alloc_skb(dev, sizeof(struct can_skb_priv) + 521 + sizeof(struct canfd_frame)); 522 + if (unlikely(!skb)) 523 + return NULL; 524 + 525 + skb->protocol = htons(ETH_P_CANFD); 526 + skb->pkt_type = PACKET_BROADCAST; 527 + skb->ip_summed = CHECKSUM_UNNECESSARY; 528 + 529 + can_skb_reserve(skb); 530 + can_skb_prv(skb)->ifindex = dev->ifindex; 531 + 532 + *cfd = (struct canfd_frame *)skb_put(skb, sizeof(struct canfd_frame)); 533 + memset(*cfd, 0, sizeof(struct canfd_frame)); 534 + 535 + return skb; 536 + } 537 + EXPORT_SYMBOL_GPL(alloc_canfd_skb); 538 + 515 539 struct sk_buff *alloc_can_err_skb(struct net_device *dev, struct can_frame **cf) 516 540 { 517 541 struct sk_buff *skb;
+3 -10
drivers/net/can/sja1000/Kconfig
··· 17 17 the "platform bus" (Linux abstraction for directly to the 18 18 processor attached devices). Which can be found on various 19 19 boards from Phytec (http://www.phytec.de) like the PCM027, 20 - PCM038. 21 - 22 - config CAN_SJA1000_OF_PLATFORM 23 - tristate "Generic OF Platform Bus based SJA1000 driver" 24 - depends on OF 25 - ---help--- 26 - This driver adds support for the SJA1000 chips connected to 27 - the OpenFirmware "platform bus" found on embedded systems with 28 - OpenFirmware bindings, e.g. if you have a PowerPC based system 29 - you may want to enable this option. 20 + PCM038. It also provides the OpenFirmware "platform bus" found 21 + on embedded systems with OpenFirmware bindings, e.g. if you 22 + have a PowerPC based system you may want to enable this option. 30 23 31 24 config CAN_EMS_PCMCIA 32 25 tristate "EMS CPC-CARD Card"
-1
drivers/net/can/sja1000/Makefile
··· 5 5 obj-$(CONFIG_CAN_SJA1000) += sja1000.o 6 6 obj-$(CONFIG_CAN_SJA1000_ISA) += sja1000_isa.o 7 7 obj-$(CONFIG_CAN_SJA1000_PLATFORM) += sja1000_platform.o 8 - obj-$(CONFIG_CAN_SJA1000_OF_PLATFORM) += sja1000_of_platform.o 9 8 obj-$(CONFIG_CAN_EMS_PCMCIA) += ems_pcmcia.o 10 9 obj-$(CONFIG_CAN_EMS_PCI) += ems_pci.o 11 10 obj-$(CONFIG_CAN_KVASER_PCI) += kvaser_pci.o
+1 -2
drivers/net/can/sja1000/sja1000.c
··· 106 106 struct sja1000_priv *priv = netdev_priv(dev); 107 107 108 108 if (priv->reg_base && sja1000_is_absent(priv)) { 109 - printk(KERN_INFO "%s: probing @0x%lX failed\n", 110 - DRV_NAME, dev->base_addr); 109 + netdev_err(dev, "probing failed\n"); 111 110 return 0; 112 111 } 113 112 return -1;
-220
drivers/net/can/sja1000/sja1000_of_platform.c
··· 1 - /* 2 - * Driver for SJA1000 CAN controllers on the OpenFirmware platform bus 3 - * 4 - * Copyright (C) 2008-2009 Wolfgang Grandegger <wg@grandegger.com> 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the version 2 of the GNU General Public License 8 - * as published by the Free Software Foundation 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 - */ 18 - 19 - /* This is a generic driver for SJA1000 chips on the OpenFirmware platform 20 - * bus found on embedded PowerPC systems. You need a SJA1000 CAN node 21 - * definition in your flattened device tree source (DTS) file similar to: 22 - * 23 - * can@3,100 { 24 - * compatible = "nxp,sja1000"; 25 - * reg = <3 0x100 0x80>; 26 - * interrupts = <2 0>; 27 - * interrupt-parent = <&mpic>; 28 - * nxp,external-clock-frequency = <16000000>; 29 - * }; 30 - * 31 - * See "Documentation/devicetree/bindings/net/can/sja1000.txt" for further 32 - * information. 33 - */ 34 - 35 - #include <linux/kernel.h> 36 - #include <linux/module.h> 37 - #include <linux/interrupt.h> 38 - #include <linux/netdevice.h> 39 - #include <linux/delay.h> 40 - #include <linux/io.h> 41 - #include <linux/can/dev.h> 42 - 43 - #include <linux/of_platform.h> 44 - #include <linux/of_address.h> 45 - #include <linux/of_irq.h> 46 - 47 - #include "sja1000.h" 48 - 49 - #define DRV_NAME "sja1000_of_platform" 50 - 51 - MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>"); 52 - MODULE_DESCRIPTION("Socket-CAN driver for SJA1000 on the OF platform bus"); 53 - MODULE_LICENSE("GPL v2"); 54 - 55 - #define SJA1000_OFP_CAN_CLOCK (16000000 / 2) 56 - 57 - #define SJA1000_OFP_OCR OCR_TX0_PULLDOWN 58 - #define SJA1000_OFP_CDR (CDR_CBP | CDR_CLK_OFF) 59 - 60 - static u8 sja1000_ofp_read_reg(const struct sja1000_priv *priv, int reg) 61 - { 62 - return ioread8(priv->reg_base + reg); 63 - } 64 - 65 - static void sja1000_ofp_write_reg(const struct sja1000_priv *priv, 66 - int reg, u8 val) 67 - { 68 - iowrite8(val, priv->reg_base + reg); 69 - } 70 - 71 - static int sja1000_ofp_remove(struct platform_device *ofdev) 72 - { 73 - struct net_device *dev = platform_get_drvdata(ofdev); 74 - struct sja1000_priv *priv = netdev_priv(dev); 75 - struct device_node *np = ofdev->dev.of_node; 76 - struct resource res; 77 - 78 - unregister_sja1000dev(dev); 79 - free_sja1000dev(dev); 80 - iounmap(priv->reg_base); 81 - irq_dispose_mapping(dev->irq); 82 - 83 - of_address_to_resource(np, 0, &res); 84 - release_mem_region(res.start, resource_size(&res)); 85 - 86 - return 0; 87 - } 88 - 89 - static int sja1000_ofp_probe(struct platform_device *ofdev) 90 - { 91 - struct device_node *np = ofdev->dev.of_node; 92 - struct net_device *dev; 93 - struct sja1000_priv *priv; 94 - struct resource res; 95 - u32 prop; 96 - int err, irq, res_size; 97 - void __iomem *base; 98 - 99 - err = of_address_to_resource(np, 0, &res); 100 - if (err) { 101 - dev_err(&ofdev->dev, "invalid address\n"); 102 - return err; 103 - } 104 - 105 - res_size = resource_size(&res); 106 - 107 - if (!request_mem_region(res.start, res_size, DRV_NAME)) { 108 - dev_err(&ofdev->dev, "couldn't request %pR\n", &res); 109 - return -EBUSY; 110 - } 111 - 112 - base = ioremap_nocache(res.start, res_size); 113 - if (!base) { 114 - dev_err(&ofdev->dev, "couldn't ioremap %pR\n", &res); 115 - err = -ENOMEM; 116 - goto exit_release_mem; 117 - } 118 - 119 - irq = irq_of_parse_and_map(np, 0); 120 - if (irq == 0) { 121 - dev_err(&ofdev->dev, "no irq found\n"); 122 - err = -ENODEV; 123 - goto exit_unmap_mem; 124 - } 125 - 126 - dev = alloc_sja1000dev(0); 127 - if (!dev) { 128 - err = -ENOMEM; 129 - goto exit_dispose_irq; 130 - } 131 - 132 - priv = netdev_priv(dev); 133 - 134 - priv->read_reg = sja1000_ofp_read_reg; 135 - priv->write_reg = sja1000_ofp_write_reg; 136 - 137 - err = of_property_read_u32(np, "nxp,external-clock-frequency", &prop); 138 - if (!err) 139 - priv->can.clock.freq = prop / 2; 140 - else 141 - priv->can.clock.freq = SJA1000_OFP_CAN_CLOCK; /* default */ 142 - 143 - err = of_property_read_u32(np, "nxp,tx-output-mode", &prop); 144 - if (!err) 145 - priv->ocr |= prop & OCR_MODE_MASK; 146 - else 147 - priv->ocr |= OCR_MODE_NORMAL; /* default */ 148 - 149 - err = of_property_read_u32(np, "nxp,tx-output-config", &prop); 150 - if (!err) 151 - priv->ocr |= (prop << OCR_TX_SHIFT) & OCR_TX_MASK; 152 - else 153 - priv->ocr |= OCR_TX0_PULLDOWN; /* default */ 154 - 155 - err = of_property_read_u32(np, "nxp,clock-out-frequency", &prop); 156 - if (!err && prop) { 157 - u32 divider = priv->can.clock.freq * 2 / prop; 158 - 159 - if (divider > 1) 160 - priv->cdr |= divider / 2 - 1; 161 - else 162 - priv->cdr |= CDR_CLKOUT_MASK; 163 - } else { 164 - priv->cdr |= CDR_CLK_OFF; /* default */ 165 - } 166 - 167 - if (!of_property_read_bool(np, "nxp,no-comparator-bypass")) 168 - priv->cdr |= CDR_CBP; /* default */ 169 - 170 - priv->irq_flags = IRQF_SHARED; 171 - priv->reg_base = base; 172 - 173 - dev->irq = irq; 174 - 175 - dev_info(&ofdev->dev, 176 - "reg_base=0x%p irq=%d clock=%d ocr=0x%02x cdr=0x%02x\n", 177 - priv->reg_base, dev->irq, priv->can.clock.freq, 178 - priv->ocr, priv->cdr); 179 - 180 - platform_set_drvdata(ofdev, dev); 181 - SET_NETDEV_DEV(dev, &ofdev->dev); 182 - 183 - err = register_sja1000dev(dev); 184 - if (err) { 185 - dev_err(&ofdev->dev, "registering %s failed (err=%d)\n", 186 - DRV_NAME, err); 187 - goto exit_free_sja1000; 188 - } 189 - 190 - return 0; 191 - 192 - exit_free_sja1000: 193 - free_sja1000dev(dev); 194 - exit_dispose_irq: 195 - irq_dispose_mapping(irq); 196 - exit_unmap_mem: 197 - iounmap(base); 198 - exit_release_mem: 199 - release_mem_region(res.start, res_size); 200 - 201 - return err; 202 - } 203 - 204 - static struct of_device_id sja1000_ofp_table[] = { 205 - {.compatible = "nxp,sja1000"}, 206 - {}, 207 - }; 208 - MODULE_DEVICE_TABLE(of, sja1000_ofp_table); 209 - 210 - static struct platform_driver sja1000_ofp_driver = { 211 - .driver = { 212 - .owner = THIS_MODULE, 213 - .name = DRV_NAME, 214 - .of_match_table = sja1000_ofp_table, 215 - }, 216 - .probe = sja1000_ofp_probe, 217 - .remove = sja1000_ofp_remove, 218 - }; 219 - 220 - module_platform_driver(sja1000_ofp_driver);
+133 -61
drivers/net/can/sja1000/sja1000_platform.c
··· 26 26 #include <linux/can/dev.h> 27 27 #include <linux/can/platform/sja1000.h> 28 28 #include <linux/io.h> 29 + #include <linux/of.h> 30 + #include <linux/of_irq.h> 29 31 30 32 #include "sja1000.h" 31 33 32 34 #define DRV_NAME "sja1000_platform" 35 + #define SP_CAN_CLOCK (16000000 / 2) 33 36 34 37 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>"); 38 + MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>"); 35 39 MODULE_DESCRIPTION("Socket-CAN driver for SJA1000 on the platform bus"); 36 40 MODULE_ALIAS("platform:" DRV_NAME); 37 41 MODULE_LICENSE("GPL v2"); ··· 70 66 iowrite8(val, priv->reg_base + reg * 4); 71 67 } 72 68 73 - static int sp_probe(struct platform_device *pdev) 69 + static void sp_populate(struct sja1000_priv *priv, 70 + struct sja1000_platform_data *pdata, 71 + unsigned long resource_mem_flags) 74 72 { 75 - int err; 76 - void __iomem *addr; 77 - struct net_device *dev; 78 - struct sja1000_priv *priv; 79 - struct resource *res_mem, *res_irq; 80 - struct sja1000_platform_data *pdata; 81 - 82 - pdata = dev_get_platdata(&pdev->dev); 83 - if (!pdata) { 84 - dev_err(&pdev->dev, "No platform data provided!\n"); 85 - err = -ENODEV; 86 - goto exit; 87 - } 88 - 89 - res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 90 - res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 91 - if (!res_mem || !res_irq) { 92 - err = -ENODEV; 93 - goto exit; 94 - } 95 - 96 - if (!request_mem_region(res_mem->start, resource_size(res_mem), 97 - DRV_NAME)) { 98 - err = -EBUSY; 99 - goto exit; 100 - } 101 - 102 - addr = ioremap_nocache(res_mem->start, resource_size(res_mem)); 103 - if (!addr) { 104 - err = -ENOMEM; 105 - goto exit_release; 106 - } 107 - 108 - dev = alloc_sja1000dev(0); 109 - if (!dev) { 110 - err = -ENOMEM; 111 - goto exit_iounmap; 112 - } 113 - priv = netdev_priv(dev); 114 - 115 - dev->irq = res_irq->start; 116 - priv->irq_flags = res_irq->flags & IRQF_TRIGGER_MASK; 117 - if (res_irq->flags & IORESOURCE_IRQ_SHAREABLE) 118 - priv->irq_flags |= IRQF_SHARED; 119 - priv->reg_base = addr; 120 73 /* The CAN clock frequency is half the oscillator clock frequency */ 121 74 priv->can.clock.freq = pdata->osc_freq / 2; 122 75 priv->ocr = pdata->ocr; 123 76 priv->cdr = pdata->cdr; 124 77 125 - switch (res_mem->flags & IORESOURCE_MEM_TYPE_MASK) { 78 + switch (resource_mem_flags & IORESOURCE_MEM_TYPE_MASK) { 126 79 case IORESOURCE_MEM_32BIT: 127 80 priv->read_reg = sp_read_reg32; 128 81 priv->write_reg = sp_write_reg32; ··· 94 133 priv->write_reg = sp_write_reg8; 95 134 break; 96 135 } 136 + } 137 + 138 + static void sp_populate_of(struct sja1000_priv *priv, struct device_node *of) 139 + { 140 + int err; 141 + u32 prop; 142 + 143 + err = of_property_read_u32(of, "reg-io-width", &prop); 144 + if (err) 145 + prop = 1; /* 8 bit is default */ 146 + 147 + switch (prop) { 148 + case 4: 149 + priv->read_reg = sp_read_reg32; 150 + priv->write_reg = sp_write_reg32; 151 + break; 152 + case 2: 153 + priv->read_reg = sp_read_reg16; 154 + priv->write_reg = sp_write_reg16; 155 + break; 156 + case 1: /* fallthrough */ 157 + default: 158 + priv->read_reg = sp_read_reg8; 159 + priv->write_reg = sp_write_reg8; 160 + } 161 + 162 + err = of_property_read_u32(of, "nxp,external-clock-frequency", &prop); 163 + if (!err) 164 + priv->can.clock.freq = prop / 2; 165 + else 166 + priv->can.clock.freq = SP_CAN_CLOCK; /* default */ 167 + 168 + err = of_property_read_u32(of, "nxp,tx-output-mode", &prop); 169 + if (!err) 170 + priv->ocr |= prop & OCR_MODE_MASK; 171 + else 172 + priv->ocr |= OCR_MODE_NORMAL; /* default */ 173 + 174 + err = of_property_read_u32(of, "nxp,tx-output-config", &prop); 175 + if (!err) 176 + priv->ocr |= (prop << OCR_TX_SHIFT) & OCR_TX_MASK; 177 + else 178 + priv->ocr |= OCR_TX0_PULLDOWN; /* default */ 179 + 180 + err = of_property_read_u32(of, "nxp,clock-out-frequency", &prop); 181 + if (!err && prop) { 182 + u32 divider = priv->can.clock.freq * 2 / prop; 183 + 184 + if (divider > 1) 185 + priv->cdr |= divider / 2 - 1; 186 + else 187 + priv->cdr |= CDR_CLKOUT_MASK; 188 + } else { 189 + priv->cdr |= CDR_CLK_OFF; /* default */ 190 + } 191 + 192 + if (!of_property_read_bool(of, "nxp,no-comparator-bypass")) 193 + priv->cdr |= CDR_CBP; /* default */ 194 + } 195 + 196 + static int sp_probe(struct platform_device *pdev) 197 + { 198 + int err, irq = 0; 199 + void __iomem *addr; 200 + struct net_device *dev; 201 + struct sja1000_priv *priv; 202 + struct resource *res_mem, *res_irq = NULL; 203 + struct sja1000_platform_data *pdata; 204 + struct device_node *of = pdev->dev.of_node; 205 + 206 + pdata = dev_get_platdata(&pdev->dev); 207 + if (!pdata && !of) { 208 + dev_err(&pdev->dev, "No platform data provided!\n"); 209 + return -ENODEV; 210 + } 211 + 212 + res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 213 + if (!res_mem) 214 + return -ENODEV; 215 + 216 + if (!devm_request_mem_region(&pdev->dev, res_mem->start, 217 + resource_size(res_mem), DRV_NAME)) 218 + return -EBUSY; 219 + 220 + addr = devm_ioremap_nocache(&pdev->dev, res_mem->start, 221 + resource_size(res_mem)); 222 + if (!addr) 223 + return -ENOMEM; 224 + 225 + if (of) 226 + irq = irq_of_parse_and_map(of, 0); 227 + else 228 + res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 229 + 230 + if (!irq && !res_irq) 231 + return -ENODEV; 232 + 233 + dev = alloc_sja1000dev(0); 234 + if (!dev) 235 + return -ENOMEM; 236 + priv = netdev_priv(dev); 237 + 238 + if (res_irq) { 239 + irq = res_irq->start; 240 + priv->irq_flags = res_irq->flags & IRQF_TRIGGER_MASK; 241 + if (res_irq->flags & IORESOURCE_IRQ_SHAREABLE) 242 + priv->irq_flags |= IRQF_SHARED; 243 + } else { 244 + priv->irq_flags = IRQF_SHARED; 245 + } 246 + 247 + dev->irq = irq; 248 + priv->reg_base = addr; 249 + 250 + if (of) 251 + sp_populate_of(priv, of); 252 + else 253 + sp_populate(priv, pdata, res_mem->flags); 97 254 98 255 platform_set_drvdata(pdev, dev); 99 256 SET_NETDEV_DEV(dev, &pdev->dev); ··· 229 150 230 151 exit_free: 231 152 free_sja1000dev(dev); 232 - exit_iounmap: 233 - iounmap(addr); 234 - exit_release: 235 - release_mem_region(res_mem->start, resource_size(res_mem)); 236 - exit: 237 153 return err; 238 154 } 239 155 240 156 static int sp_remove(struct platform_device *pdev) 241 157 { 242 158 struct net_device *dev = platform_get_drvdata(pdev); 243 - struct sja1000_priv *priv = netdev_priv(dev); 244 - struct resource *res; 245 159 246 160 unregister_sja1000dev(dev); 247 - 248 - if (priv->reg_base) 249 - iounmap(priv->reg_base); 250 - 251 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 252 - release_mem_region(res->start, resource_size(res)); 253 - 254 161 free_sja1000dev(dev); 255 162 256 163 return 0; 257 164 } 165 + 166 + static struct of_device_id sp_of_table[] = { 167 + {.compatible = "nxp,sja1000"}, 168 + {}, 169 + }; 170 + MODULE_DEVICE_TABLE(of, sp_of_table); 258 171 259 172 static struct platform_driver sp_driver = { 260 173 .probe = sp_probe, ··· 254 183 .driver = { 255 184 .name = DRV_NAME, 256 185 .owner = THIS_MODULE, 186 + .of_match_table = sp_of_table, 257 187 }, 258 188 }; 259 189
+2
include/linux/can/dev.h
··· 124 124 void can_free_echo_skb(struct net_device *dev, unsigned int idx); 125 125 126 126 struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf); 127 + struct sk_buff *alloc_canfd_skb(struct net_device *dev, 128 + struct canfd_frame **cfd); 127 129 struct sk_buff *alloc_can_err_skb(struct net_device *dev, 128 130 struct can_frame **cf); 129 131
+32
include/uapi/linux/can.h
··· 8 8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 9 9 * All rights reserved. 10 10 * 11 + * Redistribution and use in source and binary forms, with or without 12 + * modification, are permitted provided that the following conditions 13 + * are met: 14 + * 1. Redistributions of source code must retain the above copyright 15 + * notice, this list of conditions and the following disclaimer. 16 + * 2. Redistributions in binary form must reproduce the above copyright 17 + * notice, this list of conditions and the following disclaimer in the 18 + * documentation and/or other materials provided with the distribution. 19 + * 3. Neither the name of Volkswagen nor the names of its contributors 20 + * may be used to endorse or promote products derived from this software 21 + * without specific prior written permission. 22 + * 23 + * Alternatively, provided that this notice is retained in full, this 24 + * software may be distributed under the terms of the GNU General 25 + * Public License ("GPL") version 2, in which case the provisions of the 26 + * GPL apply INSTEAD OF those given above. 27 + * 28 + * The provided data structures and external interfaces from this code 29 + * are not restricted to be used by modules with a GPL compatible license. 30 + * 31 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 34 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 36 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 37 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 38 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 39 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 40 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 41 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 42 + * DAMAGE. 11 43 */ 12 44 13 45 #ifndef CAN_H