dev_dbg(ND2D(ndev), "received pkt: id: %u dlc: %u data: ",
frame->can_id,frame->can_dlc);
- #ifdef DEBUG
+#ifdef DEBUG
for(i=0; i<frame->can_dlc && !(frame->can_id & CAN_FLAG_RTR ); i++)
- printk( "%2x ",frame->payload.data[i]);
+ printk( "%2x ",frame->data[i]);
printk("\n");
- #endif
+#endif
out_8(®s->canrflg, MSCAN_RXF);
ndev->last_rx = jiffies;
EXTRA_CFLAGS += -I$(KBUILD_EXTMOD)/../../../../include
endif
-obj-m := sja1000-isa.o sja1000-gw2.o
+obj-m := sja1000-isa.o sja1000-gw2.o sja1000-mem.o
+sja1000-mem-objs := mem.o sja1000.o proc.o
sja1000-isa-objs := isa.o sja1000.o proc.o
sja1000-gw2-objs := trajet-gw2.o sja1000.o proc.o
/* array of all can chips */
static struct net_device *can_dev[MAX_CAN];
+static int base_addr_n;
+static int irq_n;
+static int speed_n;
+static int btr_n;
+static int rx_probe_n;
+
+module_param_array(base_addr, int, &base_addr_n, 0);
+module_param_array(irq, int, &irq_n, 0);
+module_param_array(speed, int, &speed_n, 0);
+module_param_array(btr, int, &btr_n, 0);
+module_param_array(rx_probe, int, &rx_probe_n, 0);
+
+module_param(clk, int, 0);
+module_param(debug, int, 0);
+module_param(restart_ms, int, 0);
/* special functions to access the chips registers */
static uint8_t reg_read(struct net_device *dev, int reg)
outb(val, dev->base_addr + reg);
}
-MODULE_PARM(base_addr, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(speed, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(btr, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(rx_probe, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(clk, "i");
-MODULE_PARM(debug, "i");
-MODULE_PARM(restart_ms, "i");
-
static struct net_device* sja1000_isa_probe(uint32_t base, int irq, int speed,
int btr, int rx_probe, int clk,
int debug, int restart_ms)
struct can_priv *priv = netdev_priv(can_dev[i]);
unregister_netdev(can_dev[i]);
del_timer(&priv->timer);
- release_region(base_addr[i], SJA1000_IO_SIZE_ISA);
+ release_region(base_addr[i], SJA1000_IO_SIZE_BASIC);
free_netdev(can_dev[i]);
}
}
for (i = 0; base_addr[i]; i++) {
printk(KERN_DEBUG "%s: checking for %s on address 0x%X ...\n",
chip_name, chip_name, base_addr[i]);
- if (!request_region(base_addr[i], SJA1000_IO_SIZE_ISA, chip_name)) {
+ if (!request_region(base_addr[i], SJA1000_IO_SIZE_BASIC, chip_name)) {
printk(KERN_ERR "%s: memory already in use\n", chip_name);
sja1000_isa_cleanup_module();
return -EBUSY;
sja1000_proc_init(drv_name, can_dev, MAX_CAN);
} else {
can_dev[i] = NULL;
- release_region(base_addr[i], SJA1000_IO_SIZE_ISA);
+ release_region(base_addr[i], SJA1000_IO_SIZE_BASIC);
}
}
return 0;
--- /dev/null
+/*
+ * $Id$
+ *
+ * mem.c - Philips SJA1000 network device driver for IOMEM
+ *
+ * Copyright (c) 2002-2005 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, the following disclaimer and
+ * the referenced file 'COPYING'.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Volkswagen nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this
+ * software may be distributed under the terms of the GNU General
+ * Public License ("GPL") version 2 as distributed in the 'COPYING'
+ * file from the main directory of the linux kernel source.
+ *
+ * The provided data structures and external interfaces from this code
+ * are not restricted to be used by modules with a GPL compatible license.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * Send feedback to <socketcan-users@lists.berlios.de>
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/fcntl.h>
+#include <linux/interrupt.h>
+#include <linux/ptrace.h>
+#include <linux/ioport.h>
+#include <linux/in.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/netdevice.h>
+#include <linux/skbuff.h>
+#include <asm/io.h>
+
+#include <linux/can/can.h>
+#include <linux/can/can_ioctl.h> /* for struct can_device_stats */
+#include "sja1000.h"
+
+#define MAX_CAN 8
+#define CAN_DEV_NAME "can%d"
+#define DRV_NAME "sja1000-mem"
+
+#define DEFAULT_KBIT_PER_SEC 500
+#define SJA1000_HW_CLOCK 16000000
+
+/* driver and version information */
+static const char *drv_name = DRV_NAME;
+static const char *drv_version = "0.0.1";
+static const char *drv_reldate = "2006-08-22";
+static const char *chip_name = SJA1000_CHIP_NAME;
+
+MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>, Pavel Pisa <pisa@cmp.felk.cvut.cz>");
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_DESCRIPTION("LLCF SJA1000 network device driver '" DRV_NAME "'");
+
+/* module parameters */
+static uint32_t base_addr[MAX_CAN] = { (uint32_t)0xda000L, 0};
+
+static int irq[MAX_CAN] = { 9, 0 };
+
+static int speed[MAX_CAN] = { DEFAULT_KBIT_PER_SEC, DEFAULT_KBIT_PER_SEC, 0};
+
+static int btr[MAX_CAN] = { 0 };
+static int rx_probe[MAX_CAN] = { 0 };
+
+static int clk = SJA1000_HW_CLOCK;
+static int debug = 0;
+static int restart_ms = 100;
+
+/* array of all can chips */
+static struct net_device *can_dev[MAX_CAN];
+
+static int base_addr_n;
+static int irq_n;
+static int speed_n;
+static int btr_n;
+static int rx_probe_n;
+
+module_param_array(base_addr, int, &base_addr_n, 0);
+module_param_array(irq, int, &irq_n, 0);
+module_param_array(speed, int, &speed_n, 0);
+module_param_array(btr, int, &btr_n, 0);
+module_param_array(rx_probe, int, &rx_probe_n, 0);
+
+module_param(clk, int, 0);
+module_param(debug, int, 0);
+module_param(restart_ms, int, 0);
+
+/* special functions to access the chips registers */
+static uint8_t reg_read(struct net_device *dev, int reg)
+{
+ static uint8_t val;
+ void __iomem *addr = (void __iomem *)dev->base_addr + reg;
+
+ val = (uint8_t)readw(addr);
+ rmb();
+
+ return val;
+}
+
+static void reg_write(struct net_device *dev, int reg, uint8_t val)
+{
+ void __iomem *addr = (void __iomem *)dev->base_addr + reg;
+
+ writew(val, addr);
+ wmb();
+}
+
+static struct net_device* sja1000_mem_probe(uint32_t base, int irq, int speed,
+ int btr, int rx_probe, int clk,
+ int debug, int restart_ms)
+{
+ struct net_device *dev;
+ struct can_priv *priv;
+
+ if (!(dev = alloc_netdev(sizeof(struct can_priv), CAN_DEV_NAME,
+ sja1000_setup))) {
+ printk(KERN_ERR "%s: out of memory\n", chip_name);
+ return NULL;
+ }
+
+ printk(KERN_INFO "%s: base 0x%X / irq %d / speed %d / btr 0x%X / rx_probe %d\n",
+ chip_name, base, irq, speed, btr, rx_probe);
+
+ /* fill net_device structure */
+
+ priv = netdev_priv(dev);
+
+ dev->irq = irq;
+ dev->base_addr = base;
+
+ priv->reg_read = reg_read;
+ priv->reg_write = reg_write;
+
+ priv->speed = speed;
+ priv->btr = btr;
+ priv->rx_probe = rx_probe;
+ priv->clock = clk;
+ priv->restart_ms = restart_ms;
+ priv->debug = debug;
+
+ if (REG_READ(0) == 0xFF)
+ goto free_dev;
+
+ /* set chip into reset mode */
+ set_reset_mode(dev);
+
+ /* go into Pelican mode, disable clkout, disable comparator */
+ REG_WRITE(REG_CDR, 0xCF);
+
+ /* output control */
+ /* connected to external transceiver */
+ REG_WRITE(REG_OCR, 0x1A);
+
+ printk(KERN_INFO "%s: %s found at 0x%X, irq is %d\n",
+ dev->name, chip_name, (uint32_t)dev->base_addr, dev->irq);
+
+ if (register_netdev(dev) == 0)
+ return dev;
+
+ printk(KERN_INFO "%s: probing failed\n", chip_name);
+ free_dev:
+ free_netdev(dev);
+ return NULL;
+}
+
+static __exit void sja1000_mem_cleanup_module(void)
+{
+ int i;
+
+ for (i = 0; i < MAX_CAN; i++) {
+ if (can_dev[i] != NULL) {
+ struct can_priv *priv = netdev_priv(can_dev[i]);
+ unregister_netdev(can_dev[i]);
+ del_timer(&priv->timer);
+ iounmap((void __iomem *)can_dev[i]->base_addr);
+ release_mem_region(base_addr[i], SJA1000_IO_SIZE_BASIC);
+ free_netdev(can_dev[i]);
+ }
+ }
+ sja1000_proc_delete(drv_name);
+}
+
+static __init int sja1000_mem_init_module(void)
+{
+ int i;
+
+ if (clk < 1000 ) /* MHz command line value */
+ clk *= 1000000;
+
+ if (clk < 1000000 ) /* kHz command line value */
+ clk *= 1000;
+
+ printk(KERN_INFO "%s - %s driver v%s (%s)\n",
+ chip_name, drv_name, drv_version, drv_reldate);
+ printk(KERN_INFO "%s - options [clk %d.%06d MHz] [restart_ms %dms] [debug %d]\n",
+ chip_name, clk/1000000, clk%1000000, restart_ms, debug);
+
+ for (i = 0; base_addr[i]; i++) {
+
+ struct net_device *dev = NULL;
+ void *base;
+
+ printk(KERN_DEBUG "%s: checking for %s on address 0x%X ...\n",
+ chip_name, chip_name, base_addr[i]);
+ if (!request_mem_region(base_addr[i], SJA1000_IO_SIZE_BASIC, chip_name)) {
+ printk(KERN_ERR "%s: memory already in use\n", chip_name);
+ sja1000_mem_cleanup_module();
+ return -EBUSY;
+ }
+
+ base = ioremap(base_addr[i], SJA1000_IO_SIZE_BASIC);
+ if (base)
+ dev = sja1000_mem_probe((uint32_t)base, irq[i], speed[i], btr[i], rx_probe[i], clk, debug, restart_ms);
+ if (dev != NULL) {
+ can_dev[i] = dev;
+ sja1000_proc_init(drv_name, can_dev, MAX_CAN);
+ } else {
+ can_dev[i] = NULL;
+ iounmap(base);
+ release_mem_region(base_addr[i], SJA1000_IO_SIZE_BASIC);
+ }
+ }
+ return 0;
+}
+
+module_init(sja1000_mem_init_module);
+module_exit(sja1000_mem_cleanup_module);
*
*/
+#include <linux/config.h>
#include <linux/module.h>
-
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/netdevice.h>
#include <linux/can/can_ioctl.h>
#include "sja1000.h"
-#define DEBUG
-
-#ifdef DEBUG
+#ifdef CONFIG_CAN_DEBUG_DEVICES
#define DBG(args...) ((priv->debug > 0) ? printk(args) : 0)
#define iDBG(args...) ((priv->debug > 1) ? printk(args) : 0) /* logging in interrupt context */
#define iiDBG(args...) ((priv->debug > 2) ? printk(args) : 0) /* logging in interrupt context */
#define iiDBG(args...)
#endif
-
-static const char *chip_name = SJA1000_CHIP_NAME;
-
+#ifdef CONFIG_CAN_DEBUG_DEVICES
static const char *ecc_errors[] = {
NULL,
NULL,
"stuff error",
"other type of error"
};
+#endif
/* declarations */
static int set_normal_mode(struct net_device *dev)
{
- struct can_priv *priv = netdev_priv(dev);
unsigned char status = REG_READ(REG_MOD);
int i;
for (i = 0; i < 10; i++) {
/* check reset bit */
if ((status & MOD_RM) == 0) {
+#ifdef CONFIG_CAN_DEBUG_DEVICES
if (i > 1) {
+ struct can_priv *priv = netdev_priv(dev);
iDBG(KERN_INFO "%s: %s looped %d times\n",
dev->name, __FUNCTION__, i);
}
+#endif
return 0;
}
static int set_listen_mode(struct net_device *dev)
{
- struct can_priv *priv = netdev_priv(dev);
unsigned char status = REG_READ(REG_MOD);
int i;
for (i = 0; i < 10; i++) {
/* check reset mode bit */
if ((status & MOD_RM) == 0) {
+#ifdef CONFIG_CAN_DEBUG_DEVICES
if (i > 1) {
+ struct can_priv *priv = netdev_priv(dev);
iDBG(KERN_INFO "%s: %s looped %d times\n",
dev->name, __FUNCTION__, i);
}
+#endif
return 0;
}
#define SJA1000_IO_SIZE_BASIC 0x20
#define SJA1000_IO_SIZE_PELICAN 0x80
-#define SJA1000_IO_SIZE_ISA 0x20
-
#define DEFAULT_SPEED 100 /* kBit/s */
#define TX_TIMEOUT (HZ/20) /* 50ms */
void sja1000_proc_init(const char *drv_name, struct net_device **dev, int max);
void sja1000_proc_delete(const char *drv_name);
+int set_reset_mode(struct net_device *dev);
+
#endif /* __SJA1000_H__ */
/* driver and version information */
static const char *drv_name = DRV_NAME;
-static const char *drv_version = "0.0.11";
-static const char *drv_reldate = "2005-10-11";
+static const char *drv_version = "0.0.12";
+static const char *drv_reldate = "2005-08-22";
static const char *chip_name = SJA1000_CHIP_NAME;
MODULE_AUTHOR("Matthias Brukner <M.Brukner@trajet.de>");
/* array of all can chips */
static struct net_device *can_dev[MAX_CAN];
+static int base_addr_n;
+static int irq_n;
+static int speed_n;
+static int btr_n;
+static int rx_probe_n;
+
+module_param_array(base_addr, int, &base_addr_n, 0);
+module_param_array(irq, int, &irq_n, 0);
+module_param_array(speed, int, &speed_n, 0);
+module_param_array(btr, int, &btr_n, 0);
+module_param_array(rx_probe, int, &rx_probe_n, 0);
+
+module_param(clk, int, 0);
+module_param(debug, int, 0);
+module_param(restart_ms, int, 0);
/* special functions to access the chips registers */
static uint8_t reg_read(struct net_device *dev, int reg)
{
static uint8_t val;
+ void __iomem *addr = (void __iomem *)dev->base_addr + reg * (ADDR_GAP + 1) + ADDR_GAP;
- val = (uint8_t)readw(dev->base_addr + reg * (ADDR_GAP + 1) + ADDR_GAP);
+ val = (uint8_t)readw(addr);
rmb();
return val;
static void reg_write(struct net_device *dev, int reg, uint8_t val)
{
- writew(val, dev->base_addr + reg * 2 + 1);
+ void __iomem *addr = (void __iomem *)dev->base_addr + reg * (ADDR_GAP + 1) + ADDR_GAP;
+
+ writew(val, addr);
wmb();
}
-MODULE_PARM(base_addr, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(speed, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(btr, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(rx_probe, "1-" __MODULE_STRING(MAX_CAN)"i");
-MODULE_PARM(clk, "i");
-MODULE_PARM(debug, "i");
-MODULE_PARM(restart_ms, "i");
-
static struct net_device* sja1000_gw2_probe(uint32_t base, int irq, int speed,
int btr, int rx_probe, int clk,
int debug, int restart_ms)
struct can_priv *priv = netdev_priv(can_dev[i]);
unregister_netdev(can_dev[i]);
del_timer(&priv->timer);
- iounmap((void*)can_dev[i]->base_addr);
+ iounmap((void __iomem *)can_dev[i]->base_addr);
release_mem_region(base_addr[i], RSIZE);
free_netdev(can_dev[i]);
}
static __init int sja1000_gw2_init_module(void)
{
int i;
- struct net_device *dev;
- void *base;
if (clk < 1000 ) /* MHz command line value */
clk *= 1000000;
chip_name, clk/1000000, clk%1000000, restart_ms, debug);
for (i = 0; base_addr[i]; i++) {
+
+ struct net_device *dev = NULL;
+ void *base;
+
printk(KERN_DEBUG "%s: checking for %s on address 0x%X ...\n",
chip_name, chip_name, base_addr[i]);
if (!request_mem_region(base_addr[i], RSIZE, chip_name)) {
sja1000_gw2_cleanup_module();
return -EBUSY;
}
+
base = ioremap(base_addr[i], RSIZE);
- dev = sja1000_gw2_probe((uint32_t)base, irq[i], speed[i], btr[i], rx_probe[i], clk, debug, restart_ms);
+ if (base)
+ dev = sja1000_gw2_probe((uint32_t)base, irq[i], speed[i], btr[i], rx_probe[i], clk, debug, restart_ms);
+
if (dev != NULL) {
can_dev[i] = dev;
sja1000_proc_init(drv_name, can_dev, MAX_CAN);
*
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/netdevice.h>
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>");
-#ifdef DEBUG
+#ifdef CONFIG_CAN_DEBUG_DEVICES
static int debug = 0;
module_param(debug, int, S_IRUGO);
#define DBG(args...) (debug & 1 ? \
typedef __u32 canid_t;
struct can_frame {
- canid_t can_id; /* 32 bit CAN_ID + EFF/RTR flags */
- __u8 can_dlc; /* data length code: 0 .. 8 */
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ __u8 can_dlc; /* data length code: 0 .. 8 */
__u8 data[8] __attribute__ ((aligned(8)));
};
#define SIOCGCANSTATE (SIOCDEVPRIVATE+10)
#define SIOCGCANSTATS (SIOCDEVPRIVATE+11)
+#define SIOCSCANERRORCONFIG (SIOCDEVPRIVATE+12)
+#define SIOCGCANERRORCONFIG (SIOCDEVPRIVATE+13)
+
/* parameters for ioctls */
/* SIOC[SG]CANBAUDRATE */
struct can_bittime_btr btr;
};
};
-#define CAN_BAUDRATE_UNCONFIGURED ((__u32)-1)
+
+#define CAN_BAUDRATE_UNCONFIGURED ((__u32) 0xFFFFFFFFU)
#define CAN_BAUDRATE_UNKNOWN 0
/* SIOC[SG]CANMODE */
int bus_error_at_init;
};
+/* SIOC[SG]CANERRORCONFIG */
+
+typedef enum CAN_ERRCFG_TYPE {
+ CAN_ERRCFG_MASK,
+ CAN_ERRCFG_BUSERR,
+ CAN_ERRCFG_BUSOFF
+} can_errcfg_type_t;
+
+/* tbd */
+
#endif /* CAN_IOCTL_H */
socket has several filter options e.g. ID-Masking / Errorframes.
To receive/send raw CAN messages, use AF_CAN with protocol CAN_RAW.
+config CAN_RAW_USER
+ bool "Allow non-root users to access Raw CAN Protocol sockets"
+ depends on CAN_RAW
+ default N
+ ---help---
+ Say Y here if you want non-root users to be able to access CAN_RAW-
+ sockets.
+
config CAN_BCM
tristate "Broadcast Manager (BCM)"
depends on CAN
config CAN_DEBUG_CORE
bool "CAN Core debugging messages"
depends on CAN
- help
+ ---help---
Say Y here if you want the CAN core to produce a bunch of debug
messages to the system log. Select this if you are having a
problem with CAN support and want to see more of what is going on.
*
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kmod.h>
int stats_timer = 1; /* default: on */
module_param(stats_timer, int, S_IRUGO);
-#ifdef DEBUG
+#ifdef CONFIG_CAN_DEBUG_CORE
static int debug = 0;
module_param(debug, int, S_IRUGO);
#define DBG(args...) (debug & 1 ? \
case SOCK_RAW:
switch (protocol) {
case CAN_RAW:
+#ifndef CONFIG_CAN_RAW_USER
if (!capable(CAP_NET_RAW))
return -EPERM;
+#endif
break;
default:
return -EPROTONOSUPPORT;
/* af_can debugging stuff */
/**************************************************/
-#ifdef DEBUG
+#ifdef CONFIG_CAN_DEBUG_CORE
void can_debug_cframe(const char *msg, struct can_frame *cf, ...)
{
*
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/net.h>
RCSID("$Id$");
-#ifdef DEBUG
+#ifdef CONFIG_CAN_DEBUG_CORE
static int debug = 0;
module_param(debug, int, S_IRUGO);
#define DBG(args...) (debug & 1 ? \
#define RX_RECV 0x40 /* received data for this element */
#define RX_THR 0x80 /* this element has not been sent due to throttle functionality */
#define BCM_CAN_DLC_MASK 0x0F /* clean flags by masking with BCM_CAN_DLC_MASK */
+#define BCM_RX_REGMASK (CAN_EFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG)
#define NAME "Broadcast Manager (BCM) for LLCF"
#define IDENT "bcm"
if (sk->sk_bound_dev_if) {
struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if);
if (dev) {
- can_rx_unregister(dev, op->can_id, 0xFFFFFFFFU, bcm_rx_handler, op);
+ can_rx_unregister(dev, op->can_id, BCM_RX_REGMASK, bcm_rx_handler, op);
dev_put(dev);
}
} else
DBG("RX_SETUP: can_rx_register() for can_id <%03X>. rx_op is (%p)\n", op->can_id, op);
if (dev) {
- can_rx_register(dev, op->can_id, 0xFFFFFFFFU, bcm_rx_handler, op, IDENT);
+ can_rx_register(dev, op->can_id, BCM_RX_REGMASK, bcm_rx_handler, op, IDENT);
dev_put(dev);
}
}
if (p->sk->sk_bound_dev_if) {
struct net_device *dev = dev_get_by_index(p->sk->sk_bound_dev_if);
if (dev) {
- can_rx_unregister(dev, p->can_id, 0xFFFFFFFFU, bcm_rx_handler, p);
+ can_rx_unregister(dev, p->can_id, BCM_RX_REGMASK, bcm_rx_handler, p);
dev_put(dev);
}
} else
*
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/init.h>
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>");
-#ifdef DEBUG
+#ifdef CONFIG_CAN_DEBUG_CORE
static int debug = 0;
module_param(debug, int, S_IRUGO);
#define DBG(args...) (debug & 1 ? \