From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] fix 16550A for 2.4
Date: Sun, 18 Dec 2005 19:06:35 +0100 [thread overview]
Message-ID: <43A5A52B.2000600@domain.hid> (raw)
In-Reply-To: <43A536FB.1010806@domain.hid>
Jan Kiszka wrote:
> Hi,
>
> it takes more to get the serial driver running on 2.4 kernels. The
> current trunk version does not let the user set any module parameter
> (effectively commented out). This patch fixes it.
Applied, thanks.
>
> Jan
>
>
>
> ------------------------------------------------------------------------
>
> Index: ksrc/drivers/16550A/16550A.c
> ===================================================================
> --- ksrc/drivers/16550A/16550A.c (Revision 287)
> +++ ksrc/drivers/16550A/16550A.c (Arbeitskopie)
> @@ -114,26 +114,34 @@
> static struct rtdm_device *device[MAX_DEVICES];
>
> static unsigned long ioaddr[MAX_DEVICES];
> -static int ioaddr_c;
> static unsigned int irq[MAX_DEVICES];
> -static int irq_c;
> static unsigned int baud_base[MAX_DEVICES];
> -static int baud_base_c;
> static int tx_fifo[MAX_DEVICES];
> -static int tx_fifo_c;
> static unsigned int start_index;
>
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
> +static int ioaddr_c;
> +static int irq_c;
> +static int baud_base_c;
> +static int tx_fifo_c;
> +
> module_param_array(ioaddr, ulong, &ioaddr_c, 0400);
> +module_param_array(irq, uint, &irq_c, 0400);
> +module_param_array(baud_base, uint, &baud_base_c, 0400);
> +module_param_array(tx_fifo, int, &tx_fifo_c, 0400);
> +#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) */
> +MODULE_PARM(ioaddr, "1-" __MODULE_STRING(MAX_DEVICES) "i");
> +MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_DEVICES) "i");
> +MODULE_PARM(baud_base, "1-" __MODULE_STRING(MAX_DEVICES) "i");
> +MODULE_PARM(tx_fifo, "1-" __MODULE_STRING(MAX_DEVICES) "i");
> +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */
> +
> MODULE_PARM_DESC(ioaddr, "I/O addresses of the serial devices");
> -module_param_array(irq, uint, &irq_c, 0400);
> MODULE_PARM_DESC(irq, "IRQ numbers of the serial devices");
> -module_param_array(baud_base, uint, &baud_base_c, 0400);
> MODULE_PARM_DESC(baud_base,
> "Maximum baud rate of the serial device (internal clock rate / 16)");
> -module_param_array(tx_fifo, int, &tx_fifo_c, 0400);
> MODULE_PARM_DESC(tx_fifo, "Transmitter FIFO size");
> -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */
> +
> module_param(start_index, uint, 0400);
> MODULE_PARM_DESC(start_index, "First device instance number to be used");
>
> @@ -1026,7 +1034,7 @@
> device_class: RTDM_CLASS_SERIAL,
> device_sub_class: RTDM_SUBCLASS_16550A,
> driver_name: "xeno_16550A",
> - driver_version: RTDM_DRIVER_VER(1, 2, 1),
> + driver_version: RTDM_DRIVER_VER(1, 2, 2),
> peripheral_name: "UART 16550A",
> provider_name: "Jan Kiszka",
> };
> @@ -1040,10 +1048,15 @@
> int i;
>
>
> - if (irq_c < ioaddr_c)
> - return -EINVAL;
> + for (i = 0; i < MAX_DEVICES; i++) {
> + if (!ioaddr[i])
> + continue;
>
> - for (i = 0; i < ioaddr_c; i++) {
> + ret = -EINVAL;
> + if (!irq[i]) {
> + goto cleanup_out;
> + }
> +
> dev = kmalloc(sizeof(struct rtdm_device), GFP_KERNEL);
> ret = -ENOMEM;
> if (!dev)
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
--
Philippe.
prev parent reply other threads:[~2005-12-18 18:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-18 10:16 [Xenomai-core] [PATCH] fix 16550A for 2.4 Jan Kiszka
2005-12-18 18:06 ` Philippe Gerum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43A5A52B.2000600@domain.hid \
--to=rpm@xenomai.org \
--cc=jan.kiszka@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.