#define LIN_ID_MAX LIN_ID_MASK
#define LIN_CTRL_FRAME CAN_EFF_FLAG
+#define LIN_DEFAULT_BAUDRATE 19200
+
#define LIN_CANFR_FLAGS_OFFS 6 /* Lower 6 bits in can_id correspond to LIN ID */
/* Save configuration for particular LIN ID */
#define LIN_ID_CONF (1 << LIN_CANFR_FLAGS_OFFS)
#define SLLIN_MAGIC 0x53CA
/* #define BREAK_BY_BAUD */
+static int master = true;
+static int baudrate = 0; /* Use LIN_DEFAULT_BAUDRATE when not set */
+
+module_param(master, bool, 0);
+MODULE_PARM_DESC(master, "LIN interface is Master device");
+module_param(baudrate, int, 0);
+MODULE_PARM_DESC(baudrate, "Baudrate of LIN interface");
+
static int maxdev = 10; /* MAX number of SLLIN channels;
This can be overridden with
insmod sllin.ko maxdev=nnn */
if (!test_bit(SLF_INUSE, &sl->flags)) {
/* Perform the low-level SLLIN initialization. */
- sl->lin_master = true;
+ sl->lin_master = master;
sllin_reset_buffs(sl);
- sl->lin_baud = 19200;
+ sl->lin_baud = (baudrate == 0) ? LIN_DEFAULT_BAUDRATE : baudrate;
+ pr_debug("sllin: Baudrate set to %u\n", sl->lin_baud);
sl->lin_state = SLSTATE_IDLE;