2 * sja1000.c - Philips SJA1000 network device driver
4 * Copyright (c) 2003 Matthias Brukner, Trajet Gmbh, Rebenring 33,
5 * 38106 Braunschweig, GERMANY
7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. 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 * 3. Neither the name of Volkswagen nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
22 * Alternatively, provided that this notice is retained in full, this
23 * software may be distributed under the terms of the GNU General
24 * Public License ("GPL") version 2, in which case the provisions of the
25 * GPL apply INSTEAD OF those given above.
27 * The provided data structures and external interfaces from this code
28 * are not restricted to be used by modules with a GPL compatible license.
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
43 * Send feedback to <socketcan-users@lists.berlios.de>
47 #include <linux/module.h>
48 #include <linux/init.h>
49 #include <linux/kernel.h>
50 #include <linux/version.h>
51 #include <linux/sched.h>
52 #include <linux/types.h>
53 #include <linux/fcntl.h>
54 #include <linux/interrupt.h>
55 #include <linux/ptrace.h>
56 #include <linux/string.h>
57 #include <linux/errno.h>
58 #include <linux/netdevice.h>
59 #include <linux/if_arp.h>
60 #include <linux/if_ether.h>
61 #include <linux/skbuff.h>
62 #include <linux/delay.h>
64 #include <linux/can.h>
65 #include <linux/can/dev.h>
66 #include <linux/can/error.h>
67 #include <linux/can/dev.h>
71 #include <linux/can/version.h> /* for RCSID. Removed by mkpatch script */
72 RCSID("$Id: sja1000.c 531 2007-10-19 07:38:29Z hartkopp $");
74 #define DRV_NAME "sja1000"
76 MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>");
77 MODULE_LICENSE("Dual BSD/GPL");
78 MODULE_DESCRIPTION(DRV_NAME " CAN netdevice driver");
80 #ifdef CONFIG_CAN_DEBUG_DEVICES
81 #define DBG(args...) ((debug > 0) ? printk(args) : 0)
82 /* logging in interrupt context! */
83 #define iDBG(args...) ((debug > 1) ? printk(args) : 0)
84 #define iiDBG(args...) ((debug > 2) ? printk(args) : 0)
88 #define iiDBG(args...)
91 #ifdef CONFIG_CAN_DEBUG_DEVICES
92 static const char *ecc_errors[] = {
112 "tolerate dominant bits",
115 "passive error flag",
120 "acknowledge delimiter",
127 static const char *ecc_types[] = {
131 "other type of error"
135 static struct can_bittiming_const sja1000_bittiming_const = {
148 module_param(debug, int, S_IRUGO | S_IWUSR);
150 MODULE_PARM_DESC(debug, "Set debug mask (default: 0)");
152 static int sja1000_probe_chip(struct net_device *dev)
154 struct sja1000_priv *priv = netdev_priv(dev);
156 if (dev->base_addr && (priv->read_reg(dev, 0) == 0xFF)) {
157 printk(KERN_INFO "%s: probing @0x%lX failed\n",
158 DRV_NAME, dev->base_addr);
164 int set_reset_mode(struct net_device *dev)
166 struct sja1000_priv *priv = netdev_priv(dev);
167 unsigned char status = priv->read_reg(dev, REG_MOD);
170 /* disable interrupts */
171 priv->write_reg(dev, REG_IER, IRQ_OFF);
173 for (i = 0; i < 100; i++) {
174 /* check reset bit */
175 if (status & MOD_RM) {
177 iDBG(KERN_INFO "%s: %s looped %d times\n",
178 dev->name, __func__, i);
180 priv->can.state = CAN_STATE_STOPPED;
184 priv->write_reg(dev, REG_MOD, MOD_RM); /* reset chip */
185 status = priv->read_reg(dev, REG_MOD);
189 dev_err(ND2D(dev), "setting SJA1000 into reset mode failed!\n");
194 static int set_normal_mode(struct net_device *dev)
196 struct sja1000_priv *priv = netdev_priv(dev);
197 unsigned char status = priv->read_reg(dev, REG_MOD);
200 for (i = 0; i < 100; i++) {
201 /* check reset bit */
202 if ((status & MOD_RM) == 0) {
203 #ifdef CONFIG_CAN_DEBUG_DEVICES
205 iDBG(KERN_INFO "%s: %s looped %d times\n",
206 dev->name, __func__, i);
209 priv->can.state = CAN_STATE_ACTIVE;
210 /* enable all interrupts */
211 priv->write_reg(dev, REG_IER, IRQ_ALL);
216 /* set chip to normal mode */
217 priv->write_reg(dev, REG_MOD, 0x00);
218 status = priv->read_reg(dev, REG_MOD);
222 dev_err(ND2D(dev), "setting SJA1000 into normal mode failed!\n");
227 static void sja1000_start(struct net_device *dev)
229 struct sja1000_priv *priv = netdev_priv(dev);
231 iDBG(KERN_INFO "%s: %s()\n", dev->name, __func__);
233 /* leave reset mode */
234 if (priv->can.state != CAN_STATE_STOPPED)
237 /* Clear error counters and error code capture */
238 priv->write_reg(dev, REG_TXERR, 0x0);
239 priv->write_reg(dev, REG_RXERR, 0x0);
240 priv->read_reg(dev, REG_ECC);
242 /* leave reset mode */
243 set_normal_mode(dev);
246 static int sja1000_set_mode(struct net_device *dev, enum can_mode mode)
248 struct sja1000_priv *priv = netdev_priv(dev);
252 DBG("%s: CAN_MODE_START requested\n", __func__);
253 if (!priv->open_time)
257 if (netif_queue_stopped(dev))
258 netif_wake_queue(dev);
268 static int sja1000_get_state(struct net_device *dev, enum can_state *state)
270 struct sja1000_priv *priv = netdev_priv(dev);
273 /* FIXME: inspecting the status register to get the current state
274 * is not really necessary, because state changes are handled by
275 * in the ISR and the variable priv->can.state gets updated. The
276 * CAN devicde interface needs fixing!
279 spin_lock_irq(&priv->can.irq_lock);
281 if (priv->can.state == CAN_STATE_STOPPED) {
282 *state = CAN_STATE_STOPPED;
284 status = priv->read_reg(dev, REG_SR);
286 *state = CAN_STATE_BUS_OFF;
287 else if (status & SR_ES) {
288 if (priv->read_reg(dev, REG_TXERR) > 127 ||
289 priv->read_reg(dev, REG_RXERR) > 127)
290 *state = CAN_STATE_BUS_PASSIVE;
292 *state = CAN_STATE_BUS_WARNING;
294 *state = CAN_STATE_ACTIVE;
296 #ifdef CONFIG_CAN_DEBUG_DEVICES
298 if (*state != priv->can.state)
300 "Oops, state mismatch: hard %d != soft %d\n",
301 *state, priv->can.state);
303 spin_unlock_irq(&priv->can.irq_lock);
307 static int sja1000_set_bittiming(struct net_device *dev)
309 struct sja1000_priv *priv = netdev_priv(dev);
310 struct can_bittiming *bt = &priv->can.bittiming;
313 btr0 = ((bt->brp - 1) & 0x3f) | (((bt->sjw - 1) & 0x3) << 6);
314 btr1 = ((bt->prop_seg + bt->phase_seg1 - 1) & 0xf) |
315 (((bt->phase_seg2 - 1) & 0x7) << 4) |
316 ((priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) << 7);
318 dev_info(ND2D(dev), "BTR0=0x%02x BTR1=0x%02x\n", btr0, btr1);
320 priv->write_reg(dev, REG_BTR0, btr0);
321 priv->write_reg(dev, REG_BTR1, btr1);
327 * initialize SJA1000 chip:
331 * - enable interrupts
332 * - start operating mode
334 static void chipset_init(struct net_device *dev)
336 struct sja1000_priv *priv = netdev_priv(dev);
338 /* set clock divider and output control register */
339 priv->write_reg(dev, REG_CDR, priv->cdr | CDR_PELICAN);
341 /* set acceptance filter (accept all) */
342 priv->write_reg(dev, REG_ACCC0, 0x00);
343 priv->write_reg(dev, REG_ACCC1, 0x00);
344 priv->write_reg(dev, REG_ACCC2, 0x00);
345 priv->write_reg(dev, REG_ACCC3, 0x00);
347 priv->write_reg(dev, REG_ACCM0, 0xFF);
348 priv->write_reg(dev, REG_ACCM1, 0xFF);
349 priv->write_reg(dev, REG_ACCM2, 0xFF);
350 priv->write_reg(dev, REG_ACCM3, 0xFF);
352 priv->write_reg(dev, REG_OCR, priv->ocr | OCR_MODE_NORMAL);
356 * transmit a CAN message
357 * message layout in the sk_buff should be like this:
358 * xx xx xx xx ff ll 00 11 22 33 44 55 66 77
359 * [ can-id ] [flags] [len] [can data (up to 8 bytes]
361 static int sja1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
363 struct sja1000_priv *priv = netdev_priv(dev);
364 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
365 struct net_device_stats *stats = can_get_stats(dev);
367 struct net_device_stats *stats = &dev->stats;
369 struct can_frame *cf = (struct can_frame *)skb->data;
376 netif_stop_queue(dev);
378 fi = dlc = cf->can_dlc;
381 if (id & CAN_RTR_FLAG)
384 if (id & CAN_EFF_FLAG) {
387 priv->write_reg(dev, REG_FI, fi);
388 priv->write_reg(dev, REG_ID1, (id & 0x1fe00000) >> (5 + 16));
389 priv->write_reg(dev, REG_ID2, (id & 0x001fe000) >> (5 + 8));
390 priv->write_reg(dev, REG_ID3, (id & 0x00001fe0) >> 5);
391 priv->write_reg(dev, REG_ID4, (id & 0x0000001f) << 3);
394 priv->write_reg(dev, REG_FI, fi);
395 priv->write_reg(dev, REG_ID1, (id & 0x000007f8) >> 3);
396 priv->write_reg(dev, REG_ID2, (id & 0x00000007) << 5);
399 for (i = 0; i < dlc; i++)
400 priv->write_reg(dev, dreg++, cf->data[i]);
402 stats->tx_bytes += dlc;
403 dev->trans_start = jiffies;
405 can_put_echo_skb(skb, dev, 0);
407 priv->write_reg(dev, REG_CMR, CMD_TR);
412 static void sja1000_rx(struct net_device *dev)
414 struct sja1000_priv *priv = netdev_priv(dev);
415 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
416 struct net_device_stats *stats = can_get_stats(dev);
418 struct net_device_stats *stats = &dev->stats;
420 struct can_frame *cf;
428 skb = dev_alloc_skb(sizeof(struct can_frame));
432 skb->protocol = htons(ETH_P_CAN);
434 fi = priv->read_reg(dev, REG_FI);
438 /* extended frame format (EFF) */
440 id = (priv->read_reg(dev, REG_ID1) << (5 + 16))
441 | (priv->read_reg(dev, REG_ID2) << (5 + 8))
442 | (priv->read_reg(dev, REG_ID3) << 5)
443 | (priv->read_reg(dev, REG_ID4) >> 3);
446 /* standard frame format (SFF) */
448 id = (priv->read_reg(dev, REG_ID1) << 3)
449 | (priv->read_reg(dev, REG_ID2) >> 5);
455 cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
456 memset(cf, 0, sizeof(struct can_frame));
459 for (i = 0; i < dlc; i++)
460 cf->data[i] = priv->read_reg(dev, dreg++);
465 /* release receive buffer */
466 priv->write_reg(dev, REG_CMR, CMD_RRB);
470 dev->last_rx = jiffies;
472 stats->rx_bytes += dlc;
475 static int sja1000_err(struct net_device *dev,
476 uint8_t isrc, uint8_t status, int n)
478 struct sja1000_priv *priv = netdev_priv(dev);
479 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
480 struct net_device_stats *stats = can_get_stats(dev);
482 struct net_device_stats *stats = &dev->stats;
484 struct can_frame *cf;
486 enum can_state state = priv->can.state;
489 skb = dev_alloc_skb(sizeof(struct can_frame));
493 skb->protocol = htons(ETH_P_CAN);
494 cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
495 memset(cf, 0, sizeof(struct can_frame));
496 cf->can_id = CAN_ERR_FLAG;
497 cf->can_dlc = CAN_ERR_DLC;
499 if (isrc & IRQ_DOI) {
500 /* data overrun interrupt */
501 iiDBG(KERN_INFO "%s: data overrun isrc=0x%02X "
502 "status=0x%02X\n", dev->name, isrc, status);
503 iDBG(KERN_INFO "%s: DOI #%d#\n", dev->name, n);
504 cf->can_id |= CAN_ERR_CRTL;
505 cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
506 priv->can.can_stats.data_overrun++;
507 priv->write_reg(dev, REG_CMR, CMD_CDO); /* clear bit */
511 /* error warning interrupt */
512 iiDBG(KERN_INFO "%s: error warning isrc=0x%02X "
513 "status=0x%02X\n", dev->name, isrc, status);
514 iDBG(KERN_INFO "%s: EI #%d#\n", dev->name, n);
515 priv->can.can_stats.error_warning++;
517 if (status & SR_BS) {
518 state = CAN_STATE_BUS_OFF;
519 cf->can_id |= CAN_ERR_BUSOFF;
521 iDBG(KERN_INFO "%s: BUS OFF\n", dev->name);
522 } else if (status & SR_ES) {
523 state = CAN_STATE_BUS_WARNING;
524 iDBG(KERN_INFO "%s: error\n", dev->name);
526 state = CAN_STATE_ACTIVE;
528 if (isrc & IRQ_BEI) {
529 /* bus error interrupt */
530 iiDBG(KERN_INFO "%s: bus error isrc=0x%02X "
531 "status=0x%02X\n", dev->name, isrc, status);
532 iDBG(KERN_INFO "%s: BEI #%d# [%d]\n", dev->name, n,
533 priv->can.can_stats.bus_error);
534 priv->can.can_stats.bus_error++;
535 ecc = priv->read_reg(dev, REG_ECC);
536 iDBG(KERN_INFO "%s: ECC = 0x%02X (%s, %s, %s)\n",
538 (ecc & ECC_DIR) ? "RX" : "TX",
539 ecc_types[ecc >> ECC_ERR],
540 ecc_errors[ecc & ECC_SEG]);
542 cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
544 switch (ecc & ECC_MASK) {
546 cf->data[2] |= CAN_ERR_PROT_BIT;
549 cf->data[2] |= CAN_ERR_PROT_FORM;
552 cf->data[2] |= CAN_ERR_PROT_STUFF;
555 cf->data[2] |= CAN_ERR_PROT_UNSPEC;
556 cf->data[3] = ecc & ECC_SEG;
559 /* Error occured during transmission? */
560 if ((ecc & ECC_DIR) == 0)
561 cf->data[2] |= CAN_ERR_PROT_TX;
563 if (isrc & IRQ_EPI) {
564 /* error passive interrupt */
565 iiDBG(KERN_INFO "%s: error passive isrc=0x%02X"
566 " status=0x%02X\n", dev->name, isrc, status);
567 iDBG(KERN_INFO "%s: EPI #%d#\n", dev->name, n);
568 priv->can.can_stats.error_passive++;
569 if (status & SR_ES) {
570 iDBG(KERN_INFO "%s: ERROR PASSIVE\n", dev->name);
571 state = CAN_STATE_BUS_PASSIVE;
573 iDBG(KERN_INFO "%s: ERROR ACTIVE\n", dev->name);
574 state = CAN_STATE_ACTIVE;
577 if (isrc & IRQ_ALI) {
578 /* arbitration lost interrupt */
579 iiDBG(KERN_INFO "%s: error arbitration lost "
580 "isrc=0x%02X status=0x%02X\n",
581 dev->name, isrc, status);
582 iDBG(KERN_INFO "%s: ALI #%d#\n", dev->name, n);
583 alc = priv->read_reg(dev, REG_ALC);
584 iDBG(KERN_INFO "%s: ALC = 0x%02X\n", dev->name, alc);
585 priv->can.can_stats.arbitration_lost++;
586 cf->can_id |= CAN_ERR_LOSTARB;
587 cf->data[0] = alc & 0x1f;
590 if (state != priv->can.state && (state == CAN_STATE_BUS_WARNING ||
591 state == CAN_STATE_BUS_PASSIVE)) {
592 uint8_t rxerr = priv->read_reg(dev, REG_RXERR);
593 uint8_t txerr = priv->read_reg(dev, REG_TXERR);
594 cf->can_id |= CAN_ERR_CRTL;
595 if (state == CAN_STATE_BUS_WARNING)
596 cf->data[1] = (txerr > rxerr) ?
597 CAN_ERR_CRTL_TX_WARNING :
598 CAN_ERR_CRTL_RX_WARNING;
600 cf->data[1] = (txerr > rxerr) ?
601 CAN_ERR_CRTL_TX_PASSIVE :
602 CAN_ERR_CRTL_RX_PASSIVE;
605 priv->can.state = state;
609 dev->last_rx = jiffies;
611 stats->rx_bytes += cf->can_dlc;
616 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
617 irqreturn_t sja1000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
619 irqreturn_t sja1000_interrupt(int irq, void *dev_id)
622 struct net_device *dev = (struct net_device *)dev_id;
623 struct sja1000_priv *priv = netdev_priv(dev);
624 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
625 struct net_device_stats *stats = can_get_stats(dev);
627 struct net_device_stats *stats = &dev->stats;
629 uint8_t isrc, status;
635 iiDBG(KERN_INFO "%s: interrupt\n", dev->name);
637 if (priv->can.state == CAN_STATE_STOPPED) {
638 iiDBG(KERN_ERR "%s: %s: controller is in reset mode! "
639 "MOD=0x%02X IER=0x%02X IR=0x%02X SR=0x%02X!\n",
640 dev->name, __func__, priv->read_reg(dev, REG_MOD),
641 priv->read_reg(dev, REG_IER), priv->read_reg(dev, REG_IR),
642 priv->read_reg(dev, REG_SR));
646 while ((isrc = priv->read_reg(dev, REG_IR)) && (n < 20)) {
648 status = priv->read_reg(dev, REG_SR);
650 if (isrc & IRQ_WUI) {
651 /* wake-up interrupt */
652 priv->can.can_stats.wakeup++;
655 /* transmission complete interrupt */
657 can_get_echo_skb(dev, 0);
658 netif_wake_queue(dev);
661 /* receive interrupt */
662 while (status & SR_RBS) {
664 status = priv->read_reg(dev, REG_SR);
667 if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) {
668 /* error interrupt */
669 if (sja1000_err(dev, isrc, status, n))
674 iDBG(KERN_INFO "%s: handled %d IRQs\n", dev->name, n);
680 return (n) ? IRQ_HANDLED : IRQ_NONE;
682 EXPORT_SYMBOL_GPL(sja1000_interrupt);
684 static int sja1000_open(struct net_device *dev)
686 struct sja1000_priv *priv = netdev_priv(dev);
689 /* set chip into reset mode */
692 /* determine and set bittime */
693 err = can_set_bittiming(dev);
697 /* register interrupt handler, if not done by the device driver */
698 if (!(priv->flags & SJA1000_CUSTOM_IRQ_HANDLER)) {
699 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
700 err = request_irq(dev->irq, &sja1000_interrupt, SA_SHIRQ,
701 dev->name, (void *)dev);
703 err = request_irq(dev->irq, &sja1000_interrupt, IRQF_SHARED,
704 dev->name, (void *)dev);
710 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
711 /* clear statistics */
712 memset(&priv->can.net_stats, 0, sizeof(priv->can.net_stats));
715 /* init and start chi */
717 priv->open_time = jiffies;
719 netif_start_queue(dev);
724 static int sja1000_close(struct net_device *dev)
726 struct sja1000_priv *priv = netdev_priv(dev);
729 netif_stop_queue(dev);
731 can_close_cleanup(dev);
733 if (!(priv->flags & SJA1000_CUSTOM_IRQ_HANDLER))
734 free_irq(dev->irq, (void *)dev);
739 struct net_device *alloc_sja1000dev(int sizeof_priv)
741 struct net_device *dev;
742 struct sja1000_priv *priv;
744 dev = alloc_candev(sizeof(struct sja1000_priv) + sizeof_priv);
748 priv = netdev_priv(dev);
752 priv->priv = (void *)priv + sizeof(struct sja1000_priv);
756 EXPORT_SYMBOL_GPL(alloc_sja1000dev);
758 void free_sja1000dev(struct net_device *dev)
762 EXPORT_SYMBOL(free_sja1000dev);
764 int register_sja1000dev(struct net_device *dev)
766 struct sja1000_priv *priv = netdev_priv(dev);
769 if (!sja1000_probe_chip(dev))
772 dev->flags |= IFF_ECHO; /* we support local echo */
774 dev->open = sja1000_open;
775 dev->stop = sja1000_close;
777 dev->hard_start_xmit = sja1000_start_xmit;
779 priv->can.bittiming_const = &sja1000_bittiming_const;
780 priv->can.do_set_bittiming = sja1000_set_bittiming;
781 priv->can.do_get_state = sja1000_get_state;
782 priv->can.do_set_mode = sja1000_set_mode;
785 err = register_candev(dev);
788 "%s: registering netdev failed\n", DRV_NAME);
797 EXPORT_SYMBOL(register_sja1000dev);
799 void unregister_sja1000dev(struct net_device *dev)
802 unregister_candev(dev);
804 EXPORT_SYMBOL(unregister_sja1000dev);
806 static __init int sja1000_init(void)
808 printk(KERN_INFO "%s CAN netdevice driver\n", DRV_NAME);
811 printk(KERN_INFO "%s: debug level set to %d.\n",
817 module_init(sja1000_init);
819 static __exit void sja1000_exit(void)
821 printk(KERN_INFO "%s: driver removed\n", DRV_NAME);
824 module_exit(sja1000_exit);