From 15bfaf777712f62e5d0c99b78e27978dab9a56c1 Mon Sep 17 00:00:00 2001 From: Joshua Abraham Date: Tue, 7 Nov 2017 13:24:25 -0500 Subject: staging: dgnc: Fix usleep_range is preferred over udelay This patch fixes the issue: CHECK: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt Signed-off-by: Joshua Abraham Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_cls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 9639035fddd1..e264fe11cba4 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -397,7 +397,7 @@ static void cls_assert_modem_signals(struct channel_t *ch) writeb(out, &ch->ch_cls_uart->mcr); /* Give time for the UART to actually drop the signals */ - udelay(10); + usleep_range(10, 20); } static void cls_copy_data_from_queue_to_uart(struct channel_t *ch) -- cgit v1.2.3 From 7e739297cdbe8383bf4a5e423959107eccc01fa1 Mon Sep 17 00:00:00 2001 From: Ashish Kalra Date: Fri, 1 Dec 2017 22:56:29 +0530 Subject: staging: dgnc: add identifiers to function parameters Fix checkpatch.pl warnings of the form "function definition argument 'foo' should also have an identifier name". Signed-off-by: Ashish Kalra Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index efdb11a5e27f..924357120b0c 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -88,12 +88,12 @@ struct board_ops { void (*flush_uart_read)(struct channel_t *ch); void (*disable_receiver)(struct channel_t *ch); void (*enable_receiver)(struct channel_t *ch); - void (*send_break)(struct channel_t *ch, int); + void (*send_break)(struct channel_t *ch, int msec); void (*send_start_character)(struct channel_t *ch); void (*send_stop_character)(struct channel_t *ch); void (*copy_data_from_queue_to_uart)(struct channel_t *ch); uint (*get_uart_bytes_left)(struct channel_t *ch); - void (*send_immediate_char)(struct channel_t *ch, unsigned char); + void (*send_immediate_char)(struct channel_t *ch, unsigned char c); }; /* Device flag definitions for bd_flags. */ -- cgit v1.2.3 From 0efdb6da56cdd3a4480de78278eaddb11af1c818 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Jan 2018 11:08:48 +0100 Subject: staging: dgnc: add SPDX identifier. It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Fix up the staging dgnc driver to have a proper SPDX identifier, based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner Cc: Kate Stewart Cc: Philippe Ombredanne Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_cls.c | 1 + drivers/staging/dgnc/dgnc_cls.h | 1 + drivers/staging/dgnc/dgnc_driver.c | 1 + drivers/staging/dgnc/dgnc_driver.h | 1 + drivers/staging/dgnc/dgnc_mgmt.c | 1 + drivers/staging/dgnc/dgnc_mgmt.h | 1 + drivers/staging/dgnc/dgnc_neo.c | 1 + drivers/staging/dgnc/dgnc_neo.h | 1 + drivers/staging/dgnc/dgnc_pci.h | 1 + drivers/staging/dgnc/dgnc_tty.c | 1 + drivers/staging/dgnc/dgnc_tty.h | 1 + drivers/staging/dgnc/digi.h | 1 + 12 files changed, 12 insertions(+) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index e264fe11cba4..d05186983d52 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_cls.h b/drivers/staging/dgnc/dgnc_cls.h index 9dfa9682a897..dc88d9be4f7d 100644 --- a/drivers/staging/dgnc/dgnc_cls.h +++ b/drivers/staging/dgnc/dgnc_cls.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index d9bf5da1b8e5..6e70c6afde8d 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 924357120b0c..126441dc0d72 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c index 3ca473b47daf..dc3d038e04e8 100644 --- a/drivers/staging/dgnc/dgnc_mgmt.c +++ b/drivers/staging/dgnc/dgnc_mgmt.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_mgmt.h b/drivers/staging/dgnc/dgnc_mgmt.h index a7a5770d7630..db16a576edda 100644 --- a/drivers/staging/dgnc/dgnc_mgmt.h +++ b/drivers/staging/dgnc/dgnc_mgmt.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 0ae229c3aaaa..834fa75861aa 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_neo.h b/drivers/staging/dgnc/dgnc_neo.h index c30a2c2b5eea..005fb422f79c 100644 --- a/drivers/staging/dgnc/dgnc_neo.h +++ b/drivers/staging/dgnc/dgnc_neo.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_pci.h b/drivers/staging/dgnc/dgnc_pci.h index 59845916d90c..478b69fbf06e 100644 --- a/drivers/staging/dgnc/dgnc_pci.h +++ b/drivers/staging/dgnc/dgnc_pci.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index d3736daf8cf2..c528b11663de 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/dgnc_tty.h b/drivers/staging/dgnc/dgnc_tty.h index 6c58f1b3461a..56c67b72e5db 100644 --- a/drivers/staging/dgnc/dgnc_tty.h +++ b/drivers/staging/dgnc/dgnc_tty.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h index 46b06b07bbf2..6d9d5bdeb0ec 100644 --- a/drivers/staging/dgnc/digi.h +++ b/drivers/staging/dgnc/digi.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau -- cgit v1.2.3 From ac1eedf236c8214a1d9e76f8c2ea931d65733092 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Jan 2018 11:08:49 +0100 Subject: staging: dgnc: remove redundant license text Now that the SPDX tag is in all drivers/staging/dgnc files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_cls.c | 10 ---------- drivers/staging/dgnc/dgnc_cls.h | 10 ---------- drivers/staging/dgnc/dgnc_driver.c | 10 ---------- drivers/staging/dgnc/dgnc_driver.h | 10 ---------- drivers/staging/dgnc/dgnc_mgmt.c | 10 ---------- drivers/staging/dgnc/dgnc_mgmt.h | 10 ---------- drivers/staging/dgnc/dgnc_neo.c | 10 ---------- drivers/staging/dgnc/dgnc_neo.h | 10 ---------- drivers/staging/dgnc/dgnc_pci.h | 10 ---------- drivers/staging/dgnc/dgnc_tty.c | 10 ---------- drivers/staging/dgnc/dgnc_tty.h | 10 ---------- drivers/staging/dgnc/digi.h | 10 ---------- 12 files changed, 120 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index d05186983d52..bbb3673618a9 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #include diff --git a/drivers/staging/dgnc/dgnc_cls.h b/drivers/staging/dgnc/dgnc_cls.h index dc88d9be4f7d..d31508542261 100644 --- a/drivers/staging/dgnc/dgnc_cls.h +++ b/drivers/staging/dgnc/dgnc_cls.h @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #ifndef _DGNC_CLS_H diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 6e70c6afde8d..3e49a4ed24fd 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #include diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 126441dc0d72..8389b6cf5317 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #ifndef _DGNC_DRIVER_H diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c index dc3d038e04e8..47b10168560d 100644 --- a/drivers/staging/dgnc/dgnc_mgmt.c +++ b/drivers/staging/dgnc/dgnc_mgmt.c @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ /* diff --git a/drivers/staging/dgnc/dgnc_mgmt.h b/drivers/staging/dgnc/dgnc_mgmt.h index db16a576edda..af5d65d0de18 100644 --- a/drivers/staging/dgnc/dgnc_mgmt.h +++ b/drivers/staging/dgnc/dgnc_mgmt.h @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #ifndef _DGNC_MGMT_H diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 834fa75861aa..ced1c22f0d0c 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #include diff --git a/drivers/staging/dgnc/dgnc_neo.h b/drivers/staging/dgnc/dgnc_neo.h index 005fb422f79c..acde3ea238b4 100644 --- a/drivers/staging/dgnc/dgnc_neo.h +++ b/drivers/staging/dgnc/dgnc_neo.h @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #ifndef _DGNC_NEO_H diff --git a/drivers/staging/dgnc/dgnc_pci.h b/drivers/staging/dgnc/dgnc_pci.h index 478b69fbf06e..b9e642f3e8fd 100644 --- a/drivers/staging/dgnc/dgnc_pci.h +++ b/drivers/staging/dgnc/dgnc_pci.h @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #ifndef _DGNC_PCI_H diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index c528b11663de..d2809f6bfe69 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ /* diff --git a/drivers/staging/dgnc/dgnc_tty.h b/drivers/staging/dgnc/dgnc_tty.h index 56c67b72e5db..00e31035b83d 100644 --- a/drivers/staging/dgnc/dgnc_tty.h +++ b/drivers/staging/dgnc/dgnc_tty.h @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #ifndef _DGNC_TTY_H diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h index 6d9d5bdeb0ec..347abaab6d98 100644 --- a/drivers/staging/dgnc/digi.h +++ b/drivers/staging/dgnc/digi.h @@ -2,16 +2,6 @@ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. */ #ifndef _DIGI_H -- cgit v1.2.3 From f75c1b2953766623052dbe5e297decca6a730772 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Jan 2018 17:50:16 +0100 Subject: staging: dgnc: delete dgnc_utils.c There was just one function in it, and it duplicated what msleep_interruptable() was doing, which is pointless, so delete it and fix up the one calling site. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/Makefile | 2 +- drivers/staging/dgnc/dgnc_tty.c | 3 +-- drivers/staging/dgnc/dgnc_utils.c | 17 ----------------- drivers/staging/dgnc/dgnc_utils.h | 7 ------- 4 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 drivers/staging/dgnc/dgnc_utils.c delete mode 100644 drivers/staging/dgnc/dgnc_utils.h (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile index 40ff0d007695..6db58475efb0 100644 --- a/drivers/staging/dgnc/Makefile +++ b/drivers/staging/dgnc/Makefile @@ -2,4 +2,4 @@ obj-$(CONFIG_DGNC) += dgnc.o dgnc-objs := dgnc_cls.o dgnc_driver.o\ dgnc_mgmt.o dgnc_neo.o\ - dgnc_tty.o dgnc_utils.o + dgnc_tty.o diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index d2809f6bfe69..1323d7f68ab8 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -26,7 +26,6 @@ #include "dgnc_tty.h" #include "dgnc_neo.h" #include "dgnc_cls.h" -#include "dgnc_utils.h" /* Default transparent print information. */ @@ -1229,7 +1228,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file) if (ch->ch_close_delay) { spin_unlock_irqrestore(&ch->ch_lock, flags); - dgnc_ms_sleep(ch->ch_close_delay); + msleep_interruptible(ch->ch_close_delay); spin_lock_irqsave(&ch->ch_lock, flags); } } diff --git a/drivers/staging/dgnc/dgnc_utils.c b/drivers/staging/dgnc/dgnc_utils.c deleted file mode 100644 index 620f5741a1ed..000000000000 --- a/drivers/staging/dgnc/dgnc_utils.c +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include -#include "dgnc_utils.h" - -/** - * dgnc_ms_sleep - Put the driver to sleep - * @ms - milliseconds to sleep - * - * Return: 0 if timed out, if interrupted by a signal return signal. - */ -int dgnc_ms_sleep(ulong ms) -{ - __set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout((ms * HZ) / 1000); - return signal_pending(current); -} diff --git a/drivers/staging/dgnc/dgnc_utils.h b/drivers/staging/dgnc/dgnc_utils.h deleted file mode 100644 index b30527f0889d..000000000000 --- a/drivers/staging/dgnc/dgnc_utils.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _DGNC_UTILS_H -#define _DGNC_UTILS_H - -int dgnc_ms_sleep(ulong ms); - -#endif /* _DGNC_UTILS_H */ -- cgit v1.2.3 From 37034c1b42b087a60c4ba088edc07252d83ce2cf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Jan 2018 17:50:17 +0100 Subject: staging: dgnc: remove crazy "management" device node There's no need for a special character device just to get some random information out of a single serial port driver. So remove the dgnc_mgmt.c file, and some structures and ioctl definitions that only it was using. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/Makefile | 2 +- drivers/staging/dgnc/dgnc_driver.c | 47 -------- drivers/staging/dgnc/dgnc_mgmt.c | 239 ------------------------------------- drivers/staging/dgnc/dgnc_mgmt.h | 17 --- drivers/staging/dgnc/digi.h | 44 ------- 5 files changed, 1 insertion(+), 348 deletions(-) delete mode 100644 drivers/staging/dgnc/dgnc_mgmt.c delete mode 100644 drivers/staging/dgnc/dgnc_mgmt.h (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile index 6db58475efb0..818e2ea3d1b0 100644 --- a/drivers/staging/dgnc/Makefile +++ b/drivers/staging/dgnc/Makefile @@ -1,5 +1,5 @@ obj-$(CONFIG_DGNC) += dgnc.o dgnc-objs := dgnc_cls.o dgnc_driver.o\ - dgnc_mgmt.o dgnc_neo.o\ + dgnc_neo.o\ dgnc_tty.o diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 3e49a4ed24fd..64967048d478 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -11,7 +11,6 @@ #include #include "dgnc_driver.h" #include "dgnc_pci.h" -#include "dgnc_mgmt.h" #include "dgnc_tty.h" #include "dgnc_cls.h" #include "dgnc_neo.h" @@ -21,22 +20,12 @@ MODULE_AUTHOR("Digi International, http://www.digi.com"); MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI based product line"); MODULE_SUPPORTED_DEVICE("dgnc"); -static const struct file_operations dgnc_board_fops = { - .owner = THIS_MODULE, - .unlocked_ioctl = dgnc_mgmt_ioctl, - .open = dgnc_mgmt_open, - .release = dgnc_mgmt_close -}; - uint dgnc_num_boards; struct dgnc_board *dgnc_board[MAXBOARDS]; DEFINE_SPINLOCK(dgnc_global_lock); DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */ -uint dgnc_major; int dgnc_poll_tick = 20; /* Poll interval - 20 ms */ -static struct class *dgnc_class; - static ulong dgnc_poll_time; /* Time of next poll */ static uint dgnc_poll_stop; /* Used to tell poller to stop */ static struct timer_list dgnc_poll_timer; @@ -379,32 +368,7 @@ static struct pci_driver dgnc_driver = { static int dgnc_start(void) { - int rc = 0; unsigned long flags; - struct device *dev; - - rc = register_chrdev(0, "dgnc", &dgnc_board_fops); - if (rc < 0) { - pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc); - return rc; - } - dgnc_major = rc; - - dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt"); - if (IS_ERR(dgnc_class)) { - rc = PTR_ERR(dgnc_class); - pr_err(DRVSTR ": Can't create dgnc_mgmt class (%d)\n", rc); - goto failed_class; - } - - dev = device_create(dgnc_class, NULL, - MKDEV(dgnc_major, 0), - NULL, "dgnc_mgmt"); - if (IS_ERR(dev)) { - rc = PTR_ERR(dev); - pr_err(DRVSTR ": Can't create device (%d)\n", rc); - goto failed_device; - } /* Start the poller */ spin_lock_irqsave(&dgnc_poll_lock, flags); @@ -416,13 +380,6 @@ static int dgnc_start(void) add_timer(&dgnc_poll_timer); return 0; - -failed_device: - class_destroy(dgnc_class); -failed_class: - unregister_chrdev(dgnc_major, "dgnc"); - - return rc; } /* Free all the memory associated with a board */ @@ -486,10 +443,6 @@ static void cleanup(void) /* Turn off poller right away. */ del_timer_sync(&dgnc_poll_timer); - device_destroy(dgnc_class, MKDEV(dgnc_major, 0)); - class_destroy(dgnc_class); - unregister_chrdev(dgnc_major, "dgnc"); - for (i = 0; i < dgnc_num_boards; ++i) { dgnc_cleanup_tty(dgnc_board[i]); dgnc_cleanup_board(dgnc_board[i]); diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c deleted file mode 100644 index 47b10168560d..000000000000 --- a/drivers/staging/dgnc/dgnc_mgmt.c +++ /dev/null @@ -1,239 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright 2003 Digi International (www.digi.com) - * Scott H Kilau - */ - -/* - * This file implements the mgmt functionality for the - * Neo and ClassicBoard based product lines. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "dgnc_driver.h" -#include "dgnc_pci.h" -#include "dgnc_mgmt.h" - -/* Our "in use" variables, to enforce 1 open only */ -static int dgnc_mgmt_in_use[MAXMGMTDEVICES]; - -/** - * dgnc_mgmt_open() - Open the mgmt/downld/dpa device. - */ -int dgnc_mgmt_open(struct inode *inode, struct file *file) -{ - unsigned long flags; - unsigned int minor = iminor(inode); - int rc = 0; - - spin_lock_irqsave(&dgnc_global_lock, flags); - - if (minor >= MAXMGMTDEVICES) { - rc = -ENXIO; - goto out; - } - /* Only allow 1 open at a time on mgmt device */ - if (dgnc_mgmt_in_use[minor]) { - rc = -EBUSY; - goto out; - } - dgnc_mgmt_in_use[minor]++; - -out: - spin_unlock_irqrestore(&dgnc_global_lock, flags); - - return rc; -} - -/** - * dgnc_mgmt_close() - Close the mgmt/dpa device - */ -int dgnc_mgmt_close(struct inode *inode, struct file *file) -{ - unsigned long flags; - unsigned int minor = iminor(inode); - int rc = 0; - - spin_lock_irqsave(&dgnc_global_lock, flags); - - if (minor >= MAXMGMTDEVICES) { - rc = -ENXIO; - goto out; - } - dgnc_mgmt_in_use[minor] = 0; - -out: - spin_unlock_irqrestore(&dgnc_global_lock, flags); - - return rc; -} - -/** - * dgnc_mgmt_ioctl() - Ioctl the mgmt/dpa device. - */ -long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - unsigned long flags; - void __user *uarg = (void __user *)arg; - - switch (cmd) { - case DIGI_GETDD: - { - /* - * This returns the total number of boards - * in the system, as well as driver version - * and has space for a reserved entry - */ - struct digi_dinfo ddi; - - spin_lock_irqsave(&dgnc_global_lock, flags); - - memset(&ddi, 0, sizeof(ddi)); - ddi.dinfo_nboards = dgnc_num_boards; - sprintf(ddi.dinfo_version, "%s", DG_PART); - - spin_unlock_irqrestore(&dgnc_global_lock, flags); - - if (copy_to_user(uarg, &ddi, sizeof(ddi))) - return -EFAULT; - - break; - } - - case DIGI_GETBD: - { - int brd; - - struct digi_info di; - - if (copy_from_user(&brd, uarg, sizeof(int))) - return -EFAULT; - - if (brd < 0 || brd >= dgnc_num_boards) - return -ENODEV; - - memset(&di, 0, sizeof(di)); - - di.info_bdnum = brd; - - spin_lock_irqsave(&dgnc_board[brd]->bd_lock, flags); - - di.info_bdtype = dgnc_board[brd]->dpatype; - di.info_bdstate = dgnc_board[brd]->dpastatus; - di.info_ioport = 0; - di.info_physaddr = (ulong)dgnc_board[brd]->membase; - di.info_physsize = (ulong)dgnc_board[brd]->membase - - dgnc_board[brd]->membase_end; - if (dgnc_board[brd]->state != BOARD_FAILED) - di.info_nports = dgnc_board[brd]->nasync; - else - di.info_nports = 0; - - spin_unlock_irqrestore(&dgnc_board[brd]->bd_lock, flags); - - if (copy_to_user(uarg, &di, sizeof(di))) - return -EFAULT; - - break; - } - - case DIGI_GET_NI_INFO: - { - struct channel_t *ch; - struct ni_info ni; - unsigned char mstat = 0; - uint board = 0; - uint channel = 0; - - if (copy_from_user(&ni, uarg, sizeof(ni))) - return -EFAULT; - - board = ni.board; - channel = ni.channel; - - if (board >= dgnc_num_boards) - return -ENODEV; - - if (channel >= dgnc_board[board]->nasync) - return -ENODEV; - - ch = dgnc_board[board]->channels[channel]; - - if (!ch) - return -ENODEV; - - memset(&ni, 0, sizeof(ni)); - ni.board = board; - ni.channel = channel; - - spin_lock_irqsave(&ch->ch_lock, flags); - - mstat = ch->ch_mostat | ch->ch_mistat; - - if (mstat & UART_MCR_DTR) { - ni.mstat |= TIOCM_DTR; - ni.dtr = TIOCM_DTR; - } - if (mstat & UART_MCR_RTS) { - ni.mstat |= TIOCM_RTS; - ni.rts = TIOCM_RTS; - } - if (mstat & UART_MSR_CTS) { - ni.mstat |= TIOCM_CTS; - ni.cts = TIOCM_CTS; - } - if (mstat & UART_MSR_RI) { - ni.mstat |= TIOCM_RI; - ni.ri = TIOCM_RI; - } - if (mstat & UART_MSR_DCD) { - ni.mstat |= TIOCM_CD; - ni.dcd = TIOCM_CD; - } - if (mstat & UART_MSR_DSR) - ni.mstat |= TIOCM_DSR; - - ni.iflag = ch->ch_c_iflag; - ni.oflag = ch->ch_c_oflag; - ni.cflag = ch->ch_c_cflag; - ni.lflag = ch->ch_c_lflag; - - if (ch->ch_digi.digi_flags & CTSPACE || - ch->ch_c_cflag & CRTSCTS) - ni.hflow = 1; - else - ni.hflow = 0; - - if ((ch->ch_flags & CH_STOPI) || - (ch->ch_flags & CH_FORCED_STOPI)) - ni.recv_stopped = 1; - else - ni.recv_stopped = 0; - - if ((ch->ch_flags & CH_STOP) || (ch->ch_flags & CH_FORCED_STOP)) - ni.xmit_stopped = 1; - else - ni.xmit_stopped = 0; - - ni.curtx = ch->ch_txcount; - ni.currx = ch->ch_rxcount; - - ni.baud = ch->ch_old_baud; - - spin_unlock_irqrestore(&ch->ch_lock, flags); - - if (copy_to_user(uarg, &ni, sizeof(ni))) - return -EFAULT; - - break; - } - } - return 0; -} diff --git a/drivers/staging/dgnc/dgnc_mgmt.h b/drivers/staging/dgnc/dgnc_mgmt.h deleted file mode 100644 index af5d65d0de18..000000000000 --- a/drivers/staging/dgnc/dgnc_mgmt.h +++ /dev/null @@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright 2003 Digi International (www.digi.com) - * Scott H Kilau - */ - -#ifndef _DGNC_MGMT_H -#define _DGNC_MGMT_H - -#define MAXMGMTDEVICES 8 - -int dgnc_mgmt_open(struct inode *inode, struct file *file); -int dgnc_mgmt_close(struct inode *inode, struct file *file); -long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg); - -#endif /* _DGNC_MGMT_H */ - diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h index 347abaab6d98..6cb541fe8422 100644 --- a/drivers/staging/dgnc/digi.h +++ b/drivers/staging/dgnc/digi.h @@ -35,7 +35,6 @@ #define DIGI_SETA (('e' << 8) | 95) /* Set params */ #define DIGI_SETAW (('e' << 8) | 96) /* Drain & set params */ #define DIGI_SETAF (('e' << 8) | 97) /* Drain, flush & set params */ -#define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */ #define DIGI_LOOPBACK (('d' << 8) | 252) /* Enable/disable UART * internal loopback */ @@ -78,49 +77,6 @@ struct digi_t { char digi_term[DIGI_TSIZ]; }; -/** - * struct digi_dinfo - Driver status information. - * @dinfo_nboards: Number of boards configured. - * @dinfo_reserved: Not used, for future expansion. - * @dinfio_version: Driver version. - */ -struct digi_dinfo { - unsigned int dinfo_nboards; - char dinfo_reserved[12]; - char dinfo_version[16]; -}; - -#define DIGI_GETDD (('d' << 8) | 248) /* get driver info */ - -/** - * struct digi_info - Ioctl commands for per board information. - * - * Physsize and memsize differ when board has "windowed" memory. - * - * @info_bdnum: Board number (0 based). - * @info_ioport: IO port address. - * @indo_physaddr: Memory address. - * @info_physize: Size of host memory window. - * @info_memsize: Amount of dual-port memory on board. - * @info_bdtype: Board type. - * @info_nports: Number of ports. - * @info_bdstate: Board state. - * @info_reserved: Not used, for future expansion. - */ -struct digi_info { - unsigned int info_bdnum; - unsigned int info_ioport; - unsigned int info_physaddr; - unsigned int info_physsize; - unsigned int info_memsize; - unsigned short info_bdtype; - unsigned short info_nports; - char info_bdstate; - char info_reserved[7]; -}; - -#define DIGI_GETBD (('d' << 8) | 249) /* get board info */ - /** * struct digi_getbuffer - Holds buffer use counts. */ -- cgit v1.2.3 From 197c3196e562b83dc3e9b4efe5ec8599e9136d3c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Jan 2018 17:50:18 +0100 Subject: staging: dgnc: make dgnc_num_boards static There's no need for the world to know the number of dgnc boards in the system, so just make it a static variable. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 2 +- drivers/staging/dgnc/dgnc_driver.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 64967048d478..ce9090a95d84 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -20,7 +20,7 @@ MODULE_AUTHOR("Digi International, http://www.digi.com"); MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI based product line"); MODULE_SUPPORTED_DEVICE("dgnc"); -uint dgnc_num_boards; +static unsigned int dgnc_num_boards; struct dgnc_board *dgnc_board[MAXBOARDS]; DEFINE_SPINLOCK(dgnc_global_lock); DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */ diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 8389b6cf5317..691c79c979f6 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -376,7 +376,6 @@ extern uint dgnc_major; /* Our driver/mgmt major */ extern int dgnc_poll_tick; /* Poll interval - 20 ms */ extern spinlock_t dgnc_global_lock; /* Driver global spinlock */ extern spinlock_t dgnc_poll_lock; /* Poll scheduling lock */ -extern uint dgnc_num_boards; /* Total number of boards */ extern struct dgnc_board *dgnc_board[MAXBOARDS];/* Array of boards */ #endif /* _DGNC_DRIVER_H */ -- cgit v1.2.3 From f5b612d6e300b2073c70a277b7c2c394f7f2ee11 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Jan 2018 17:50:19 +0100 Subject: staging: dgnc: make dgnc_poll_lock static There's no need for this spinlock to be global, so make it a static variable. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 2 +- drivers/staging/dgnc/dgnc_driver.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index ce9090a95d84..ae3767315ef5 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -23,7 +23,7 @@ MODULE_SUPPORTED_DEVICE("dgnc"); static unsigned int dgnc_num_boards; struct dgnc_board *dgnc_board[MAXBOARDS]; DEFINE_SPINLOCK(dgnc_global_lock); -DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */ +static DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */ int dgnc_poll_tick = 20; /* Poll interval - 20 ms */ static ulong dgnc_poll_time; /* Time of next poll */ diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 691c79c979f6..ebd46895f5a9 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -375,7 +375,6 @@ struct channel_t { extern uint dgnc_major; /* Our driver/mgmt major */ extern int dgnc_poll_tick; /* Poll interval - 20 ms */ extern spinlock_t dgnc_global_lock; /* Driver global spinlock */ -extern spinlock_t dgnc_poll_lock; /* Poll scheduling lock */ extern struct dgnc_board *dgnc_board[MAXBOARDS];/* Array of boards */ #endif /* _DGNC_DRIVER_H */ -- cgit v1.2.3 From 373aa75a93c198ea58a2ee9cb4554089e61a36b5 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Jan 2018 17:50:20 +0100 Subject: staging: dgnc: remove some global variables There were some global variables not being used at all, so just delete them. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 1 - drivers/staging/dgnc/dgnc_driver.h | 2 -- 2 files changed, 3 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index ae3767315ef5..3f2815c16ea7 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -22,7 +22,6 @@ MODULE_SUPPORTED_DEVICE("dgnc"); static unsigned int dgnc_num_boards; struct dgnc_board *dgnc_board[MAXBOARDS]; -DEFINE_SPINLOCK(dgnc_global_lock); static DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */ int dgnc_poll_tick = 20; /* Poll interval - 20 ms */ diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index ebd46895f5a9..a6bfe15bd499 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -372,9 +372,7 @@ struct channel_t { ulong ch_xoff_sends; }; -extern uint dgnc_major; /* Our driver/mgmt major */ extern int dgnc_poll_tick; /* Poll interval - 20 ms */ -extern spinlock_t dgnc_global_lock; /* Driver global spinlock */ extern struct dgnc_board *dgnc_board[MAXBOARDS];/* Array of boards */ #endif /* _DGNC_DRIVER_H */ -- cgit v1.2.3 From df5dee80a75af1fba4dbdd0ea6041456d500beba Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Jan 2018 17:50:21 +0100 Subject: staging: dgnc: make dgnc_poll_tick static No one needs to see this global variable, so make it static. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 2 +- drivers/staging/dgnc/dgnc_driver.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 3f2815c16ea7..801966282bdd 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -23,8 +23,8 @@ MODULE_SUPPORTED_DEVICE("dgnc"); static unsigned int dgnc_num_boards; struct dgnc_board *dgnc_board[MAXBOARDS]; static DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */ -int dgnc_poll_tick = 20; /* Poll interval - 20 ms */ +static int dgnc_poll_tick = 20; /* Poll interval - 20 ms */ static ulong dgnc_poll_time; /* Time of next poll */ static uint dgnc_poll_stop; /* Used to tell poller to stop */ static struct timer_list dgnc_poll_timer; diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index a6bfe15bd499..b71e6d1d4ec4 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -372,7 +372,6 @@ struct channel_t { ulong ch_xoff_sends; }; -extern int dgnc_poll_tick; /* Poll interval - 20 ms */ extern struct dgnc_board *dgnc_board[MAXBOARDS];/* Array of boards */ #endif /* _DGNC_DRIVER_H */ -- cgit v1.2.3 From 0f45b23aedf91ae66890d13320c5147c15013a0c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 11 Jan 2018 17:50:22 +0100 Subject: staging: dgnc: remove duplicated tty defines The dgnc driver defined numerous TTY defines that the core kernel already defines. So just remove this duplication. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/digi.h | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h index 6cb541fe8422..6a09bd32e349 100644 --- a/drivers/staging/dgnc/digi.h +++ b/drivers/staging/dgnc/digi.h @@ -7,30 +7,6 @@ #ifndef _DIGI_H #define _DIGI_H -#ifndef TIOCM_LE -#define TIOCM_LE 0x01 /* line enable */ -#define TIOCM_DTR 0x02 /* data terminal ready */ -#define TIOCM_RTS 0x04 /* request to send */ -#define TIOCM_ST 0x08 /* secondary transmit */ -#define TIOCM_SR 0x10 /* secondary receive */ -#define TIOCM_CTS 0x20 /* clear to send */ -#define TIOCM_CAR 0x40 /* carrier detect */ -#define TIOCM_RNG 0x80 /* ring indicator */ -#define TIOCM_DSR 0x100 /* data set ready */ -#define TIOCM_RI TIOCM_RNG /* ring (alternate) */ -#define TIOCM_CD TIOCM_CAR /* carrier detect (alt) */ -#endif - -#if !defined(TIOCMSET) -#define TIOCMSET (('d' << 8) | 252) /* set modem ctrl state */ -#define TIOCMGET (('d' << 8) | 253) /* set modem ctrl state */ -#endif - -#if !defined(TIOCMBIC) -#define TIOCMBIC (('d' << 8) | 254) /* set modem ctrl state */ -#define TIOCMBIS (('d' << 8) | 255) /* set modem ctrl state */ -#endif - #define DIGI_GETA (('e' << 8) | 94) /* Read params */ #define DIGI_SETA (('e' << 8) | 95) /* Set params */ #define DIGI_SETAW (('e' << 8) | 96) /* Drain & set params */ -- cgit v1.2.3 From 2238965f42d62184af01c3d38d575b8395fca1aa Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 20:59:59 +0100 Subject: staging: dgnc: remove PCI_DEVICE_NEO stuff The "Neo" devices are never allowed to be bound to this driver, as they are not in the valid list of PCI ids, so delete them from the driver as the code in the probe function has no way to ever run. Also delete the defines that are no longer used in relation to the Neo devices, as they are not needed anymore. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 62 -------------------------------------- drivers/staging/dgnc/dgnc_pci.h | 29 ------------------ 2 files changed, 91 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 801966282bdd..e27794b133b4 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -49,19 +49,6 @@ static const struct board_id dgnc_ids[] = { { PCI_DEVICE_CLASSIC_4_422_PCI_NAME, 4, 0 }, { PCI_DEVICE_CLASSIC_8_PCI_NAME, 8, 0 }, { PCI_DEVICE_CLASSIC_8_422_PCI_NAME, 8, 0 }, - { PCI_DEVICE_NEO_4_PCI_NAME, 4, 0 }, - { PCI_DEVICE_NEO_8_PCI_NAME, 8, 0 }, - { PCI_DEVICE_NEO_2DB9_PCI_NAME, 2, 0 }, - { PCI_DEVICE_NEO_2DB9PRI_PCI_NAME, 2, 0 }, - { PCI_DEVICE_NEO_2RJ45_PCI_NAME, 2, 0 }, - { PCI_DEVICE_NEO_2RJ45PRI_PCI_NAME, 2, 0 }, - { PCI_DEVICE_NEO_1_422_PCI_NAME, 1, 0 }, - { PCI_DEVICE_NEO_1_422_485_PCI_NAME, 1, 0 }, - { PCI_DEVICE_NEO_2_422_485_PCI_NAME, 2, 0 }, - { PCI_DEVICE_NEO_EXPRESS_8_PCI_NAME, 8, 1 }, - { PCI_DEVICE_NEO_EXPRESS_4_PCI_NAME, 4, 1 }, - { PCI_DEVICE_NEO_EXPRESS_4RJ45_PCI_NAME, 4, 1 }, - { PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME, 8, 1 }, { NULL, 0, 0 } }; @@ -173,55 +160,6 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id) break; - case PCI_DEVICE_NEO_4_DID: - case PCI_DEVICE_NEO_8_DID: - case PCI_DEVICE_NEO_2DB9_DID: - case PCI_DEVICE_NEO_2DB9PRI_DID: - case PCI_DEVICE_NEO_2RJ45_DID: - case PCI_DEVICE_NEO_2RJ45PRI_DID: - case PCI_DEVICE_NEO_1_422_DID: - case PCI_DEVICE_NEO_1_422_485_DID: - case PCI_DEVICE_NEO_2_422_485_DID: - case PCI_DEVICE_NEO_EXPRESS_8_DID: - case PCI_DEVICE_NEO_EXPRESS_4_DID: - case PCI_DEVICE_NEO_EXPRESS_4RJ45_DID: - case PCI_DEVICE_NEO_EXPRESS_8RJ45_DID: - - /* - * This chip is set up 100% when we get to it. - * No need to enable global interrupts or anything. - */ - if (brd->bd_flags & BD_IS_PCI_EXPRESS) - brd->dpatype = T_NEO_EXPRESS | T_PCIBUS; - else - brd->dpatype = T_NEO | T_PCIBUS; - - brd->membase = pci_resource_start(pdev, 0); - brd->membase_end = pci_resource_end(pdev, 0); - - if (brd->membase & 1) - brd->membase &= ~3; - else - brd->membase &= ~15; - - brd->bd_ops = &dgnc_neo_ops; - - brd->bd_uart_offset = 0x200; - brd->bd_dividend = 921600; - - rc = dgnc_do_remap(brd); - - if (rc < 0) - goto failed; - - /* Read and store the dvid after remapping */ - brd->dvid = readb(brd->re_map_membase + 0x8D); - - /* Get and store the board VPD, if it exists */ - brd->bd_ops->vpd(brd); - - break; - default: dev_err(&brd->pdev->dev, "Didn't find any compatible Neo/Classic PCI boards.\n"); diff --git a/drivers/staging/dgnc/dgnc_pci.h b/drivers/staging/dgnc/dgnc_pci.h index b9e642f3e8fd..33595fad66c5 100644 --- a/drivers/staging/dgnc/dgnc_pci.h +++ b/drivers/staging/dgnc/dgnc_pci.h @@ -16,40 +16,11 @@ #define PCI_DEVICE_CLASSIC_8_DID 0x0029 #define PCI_DEVICE_CLASSIC_4_422_DID 0x00D0 #define PCI_DEVICE_CLASSIC_8_422_DID 0x00D1 -#define PCI_DEVICE_NEO_4_DID 0x00B0 -#define PCI_DEVICE_NEO_8_DID 0x00B1 -#define PCI_DEVICE_NEO_2DB9_DID 0x00C8 -#define PCI_DEVICE_NEO_2DB9PRI_DID 0x00C9 -#define PCI_DEVICE_NEO_2RJ45_DID 0x00CA -#define PCI_DEVICE_NEO_2RJ45PRI_DID 0x00CB -#define PCI_DEVICE_NEO_1_422_DID 0x00CC -#define PCI_DEVICE_NEO_1_422_485_DID 0x00CD -#define PCI_DEVICE_NEO_2_422_485_DID 0x00CE -#define PCI_DEVICE_NEO_EXPRESS_8_DID 0x00F0 -#define PCI_DEVICE_NEO_EXPRESS_4_DID 0x00F1 -#define PCI_DEVICE_NEO_EXPRESS_4RJ45_DID 0x00F2 -#define PCI_DEVICE_NEO_EXPRESS_8RJ45_DID 0x00F3 -#define PCI_DEVICE_NEO_EXPRESS_4_IBM_DID 0x00F4 #define PCI_DEVICE_CLASSIC_4_PCI_NAME "ClassicBoard 4 PCI" #define PCI_DEVICE_CLASSIC_8_PCI_NAME "ClassicBoard 8 PCI" #define PCI_DEVICE_CLASSIC_4_422_PCI_NAME "ClassicBoard 4 422 PCI" #define PCI_DEVICE_CLASSIC_8_422_PCI_NAME "ClassicBoard 8 422 PCI" -#define PCI_DEVICE_NEO_4_PCI_NAME "Neo 4 PCI" -#define PCI_DEVICE_NEO_8_PCI_NAME "Neo 8 PCI" -#define PCI_DEVICE_NEO_2DB9_PCI_NAME "Neo 2 - DB9 Universal PCI" -#define PCI_DEVICE_NEO_2DB9PRI_PCI_NAME "Neo 2 - DB9 Universal PCI - Powered Ring Indicator" -#define PCI_DEVICE_NEO_2RJ45_PCI_NAME "Neo 2 - RJ45 Universal PCI" -#define PCI_DEVICE_NEO_2RJ45PRI_PCI_NAME "Neo 2 - RJ45 Universal PCI - Powered Ring Indicator" -#define PCI_DEVICE_NEO_1_422_PCI_NAME "Neo 1 422 PCI" -#define PCI_DEVICE_NEO_1_422_485_PCI_NAME "Neo 1 422/485 PCI" -#define PCI_DEVICE_NEO_2_422_485_PCI_NAME "Neo 2 422/485 PCI" - -#define PCI_DEVICE_NEO_EXPRESS_8_PCI_NAME "Neo 8 PCI Express" -#define PCI_DEVICE_NEO_EXPRESS_4_PCI_NAME "Neo 4 PCI Express" -#define PCI_DEVICE_NEO_EXPRESS_4RJ45_PCI_NAME "Neo 4 PCI Express RJ45" -#define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME "Neo 8 PCI Express RJ45" -#define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME "Neo 4 PCI Express IBM" /* Size of memory and I/O for PCI (4 K) */ #define PCI_RAM_SIZE 0x1000 -- cgit v1.2.3 From 945d2a60b5d041ffb35b332af0eeca8ed690deaa Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 21:00:00 +0100 Subject: staging: dgnc: delete dgnc_neo.* files As the Neo devices were never actually supported by the driver, delete the files that purported to control that type of device as they are not needed. This will let us shrink the driver a lot over time. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/Makefile | 1 - drivers/staging/dgnc/dgnc_driver.c | 1 - drivers/staging/dgnc/dgnc_neo.c | 1681 ------------------------------------ drivers/staging/dgnc/dgnc_neo.h | 166 ---- drivers/staging/dgnc/dgnc_tty.c | 1 - 5 files changed, 1850 deletions(-) delete mode 100644 drivers/staging/dgnc/dgnc_neo.c delete mode 100644 drivers/staging/dgnc/dgnc_neo.h (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile index 818e2ea3d1b0..49633042fcc9 100644 --- a/drivers/staging/dgnc/Makefile +++ b/drivers/staging/dgnc/Makefile @@ -1,5 +1,4 @@ obj-$(CONFIG_DGNC) += dgnc.o dgnc-objs := dgnc_cls.o dgnc_driver.o\ - dgnc_neo.o\ dgnc_tty.o diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index e27794b133b4..a6a4119f083b 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -13,7 +13,6 @@ #include "dgnc_pci.h" #include "dgnc_tty.h" #include "dgnc_cls.h" -#include "dgnc_neo.h" MODULE_LICENSE("GPL"); MODULE_AUTHOR("Digi International, http://www.digi.com"); diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c deleted file mode 100644 index ced1c22f0d0c..000000000000 --- a/drivers/staging/dgnc/dgnc_neo.c +++ /dev/null @@ -1,1681 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright 2003 Digi International (www.digi.com) - * Scott H Kilau - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "dgnc_driver.h" -#include "dgnc_neo.h" -#include "dgnc_tty.h" - -static inline void neo_parse_lsr(struct dgnc_board *brd, uint port); -static inline void neo_parse_isr(struct dgnc_board *brd, uint port); -static void neo_copy_data_from_uart_to_queue(struct channel_t *ch); -static inline void neo_clear_break(struct channel_t *ch, int force); -static inline void neo_set_cts_flow_control(struct channel_t *ch); -static inline void neo_set_rts_flow_control(struct channel_t *ch); -static inline void neo_set_ixon_flow_control(struct channel_t *ch); -static inline void neo_set_ixoff_flow_control(struct channel_t *ch); -static inline void neo_set_no_output_flow_control(struct channel_t *ch); -static inline void neo_set_no_input_flow_control(struct channel_t *ch); -static inline void neo_set_new_start_stop_chars(struct channel_t *ch); -static void neo_parse_modem(struct channel_t *ch, unsigned char signals); -static void neo_tasklet(unsigned long data); -static void neo_vpd(struct dgnc_board *brd); -static void neo_uart_init(struct channel_t *ch); -static void neo_uart_off(struct channel_t *ch); -static int neo_drain(struct tty_struct *tty, uint seconds); -static void neo_param(struct tty_struct *tty); -static void neo_assert_modem_signals(struct channel_t *ch); -static void neo_flush_uart_write(struct channel_t *ch); -static void neo_flush_uart_read(struct channel_t *ch); -static void neo_disable_receiver(struct channel_t *ch); -static void neo_enable_receiver(struct channel_t *ch); -static void neo_send_break(struct channel_t *ch, int msecs); -static void neo_send_start_character(struct channel_t *ch); -static void neo_send_stop_character(struct channel_t *ch); -static void neo_copy_data_from_queue_to_uart(struct channel_t *ch); -static uint neo_get_uart_bytes_left(struct channel_t *ch); -static void neo_send_immediate_char(struct channel_t *ch, unsigned char c); -static irqreturn_t neo_intr(int irq, void *voidbrd); - -struct board_ops dgnc_neo_ops = { - .tasklet = neo_tasklet, - .intr = neo_intr, - .uart_init = neo_uart_init, - .uart_off = neo_uart_off, - .drain = neo_drain, - .param = neo_param, - .vpd = neo_vpd, - .assert_modem_signals = neo_assert_modem_signals, - .flush_uart_write = neo_flush_uart_write, - .flush_uart_read = neo_flush_uart_read, - .disable_receiver = neo_disable_receiver, - .enable_receiver = neo_enable_receiver, - .send_break = neo_send_break, - .send_start_character = neo_send_start_character, - .send_stop_character = neo_send_stop_character, - .copy_data_from_queue_to_uart = neo_copy_data_from_queue_to_uart, - .get_uart_bytes_left = neo_get_uart_bytes_left, - .send_immediate_char = neo_send_immediate_char -}; - -/* - * This function allows calls to ensure that all outstanding - * PCI writes have been completed, by doing a PCI read against - * a non-destructive, read-only location on the Neo card. - * - * In this case, we are reading the DVID (Read-only Device Identification) - * value of the Neo card. - */ -static inline void neo_pci_posting_flush(struct dgnc_board *bd) -{ - readb(bd->re_map_membase + 0x8D); -} - -static inline void neo_set_cts_flow_control(struct channel_t *ch) -{ - unsigned char ier = readb(&ch->ch_neo_uart->ier); - unsigned char efr = readb(&ch->ch_neo_uart->efr); - - /* Turn on auto CTS flow control */ - ier |= UART_17158_IER_CTSDSR; - efr |= (UART_17158_EFR_ECB | UART_17158_EFR_CTSDSR); - - /* Turn off auto Xon flow control */ - efr &= ~UART_17158_EFR_IXON; - - /* - * Why? Because Exar's spec says we have to zero it - * out before setting it - */ - writeb(0, &ch->ch_neo_uart->efr); - - /* Turn on UART enhanced bits */ - writeb(efr, &ch->ch_neo_uart->efr); - - /* Turn on table D, with 8 char hi/low watermarks */ - writeb(UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY, - &ch->ch_neo_uart->fctr); - - /* Feed the UART our trigger levels */ - writeb(8, &ch->ch_neo_uart->tfifo); - ch->ch_t_tlevel = 8; - - writeb(ier, &ch->ch_neo_uart->ier); - - neo_pci_posting_flush(ch->ch_bd); -} - -static inline void neo_set_rts_flow_control(struct channel_t *ch) -{ - unsigned char ier = readb(&ch->ch_neo_uart->ier); - unsigned char efr = readb(&ch->ch_neo_uart->efr); - - /* Turn on auto RTS flow control */ - ier |= UART_17158_IER_RTSDTR; - efr |= (UART_17158_EFR_ECB | UART_17158_EFR_RTSDTR); - - /* Turn off auto Xoff flow control */ - ier &= ~UART_17158_IER_XOFF; - efr &= ~UART_17158_EFR_IXOFF; - - /* - * Why? Because Exar's spec says we have to zero it - * out before setting it - */ - writeb(0, &ch->ch_neo_uart->efr); - - /* Turn on UART enhanced bits */ - writeb(efr, &ch->ch_neo_uart->efr); - - writeb(UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY, - &ch->ch_neo_uart->fctr); - ch->ch_r_watermark = 4; - - writeb(32, &ch->ch_neo_uart->rfifo); - ch->ch_r_tlevel = 32; - - writeb(ier, &ch->ch_neo_uart->ier); - - /* - * From the Neo UART spec sheet: - * The auto RTS/DTR function must be started by asserting - * RTS/DTR# output pin (MCR bit-0 or 1 to logic 1 after - * it is enabled. - */ - ch->ch_mostat |= UART_MCR_RTS; - - neo_pci_posting_flush(ch->ch_bd); -} - -static inline void neo_set_ixon_flow_control(struct channel_t *ch) -{ - unsigned char ier = readb(&ch->ch_neo_uart->ier); - unsigned char efr = readb(&ch->ch_neo_uart->efr); - - /* Turn off auto CTS flow control */ - ier &= ~UART_17158_IER_CTSDSR; - efr &= ~UART_17158_EFR_CTSDSR; - - /* Turn on auto Xon flow control */ - efr |= (UART_17158_EFR_ECB | UART_17158_EFR_IXON); - - /* - * Why? Because Exar's spec says we have to zero it - * out before setting it - */ - writeb(0, &ch->ch_neo_uart->efr); - - /* Turn on UART enhanced bits */ - writeb(efr, &ch->ch_neo_uart->efr); - - writeb(UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY, - &ch->ch_neo_uart->fctr); - ch->ch_r_watermark = 4; - - writeb(32, &ch->ch_neo_uart->rfifo); - ch->ch_r_tlevel = 32; - - /* Tell UART what start/stop chars it should be looking for */ - writeb(ch->ch_startc, &ch->ch_neo_uart->xonchar1); - writeb(0, &ch->ch_neo_uart->xonchar2); - - writeb(ch->ch_stopc, &ch->ch_neo_uart->xoffchar1); - writeb(0, &ch->ch_neo_uart->xoffchar2); - - writeb(ier, &ch->ch_neo_uart->ier); - - neo_pci_posting_flush(ch->ch_bd); -} - -static inline void neo_set_ixoff_flow_control(struct channel_t *ch) -{ - unsigned char ier = readb(&ch->ch_neo_uart->ier); - unsigned char efr = readb(&ch->ch_neo_uart->efr); - - /* Turn off auto RTS flow control */ - ier &= ~UART_17158_IER_RTSDTR; - efr &= ~UART_17158_EFR_RTSDTR; - - /* Turn on auto Xoff flow control */ - ier |= UART_17158_IER_XOFF; - efr |= (UART_17158_EFR_ECB | UART_17158_EFR_IXOFF); - - /* - * Why? Because Exar's spec says we have to zero it - * out before setting it - */ - writeb(0, &ch->ch_neo_uart->efr); - - /* Turn on UART enhanced bits */ - writeb(efr, &ch->ch_neo_uart->efr); - - /* Turn on table D, with 8 char hi/low watermarks */ - writeb(UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY, - &ch->ch_neo_uart->fctr); - - writeb(8, &ch->ch_neo_uart->tfifo); - ch->ch_t_tlevel = 8; - - /* Tell UART what start/stop chars it should be looking for */ - writeb(ch->ch_startc, &ch->ch_neo_uart->xonchar1); - writeb(0, &ch->ch_neo_uart->xonchar2); - - writeb(ch->ch_stopc, &ch->ch_neo_uart->xoffchar1); - writeb(0, &ch->ch_neo_uart->xoffchar2); - - writeb(ier, &ch->ch_neo_uart->ier); - - neo_pci_posting_flush(ch->ch_bd); -} - -static inline void neo_set_no_input_flow_control(struct channel_t *ch) -{ - unsigned char ier = readb(&ch->ch_neo_uart->ier); - unsigned char efr = readb(&ch->ch_neo_uart->efr); - - /* Turn off auto RTS flow control */ - ier &= ~UART_17158_IER_RTSDTR; - efr &= ~UART_17158_EFR_RTSDTR; - - /* Turn off auto Xoff flow control */ - ier &= ~UART_17158_IER_XOFF; - if (ch->ch_c_iflag & IXON) - efr &= ~(UART_17158_EFR_IXOFF); - else - efr &= ~(UART_17158_EFR_ECB | UART_17158_EFR_IXOFF); - - /* - * Why? Because Exar's spec says we have to zero - * it out before setting it - */ - writeb(0, &ch->ch_neo_uart->efr); - - /* Turn on UART enhanced bits */ - writeb(efr, &ch->ch_neo_uart->efr); - - /* Turn on table D, with 8 char hi/low watermarks */ - writeb(UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY, - &ch->ch_neo_uart->fctr); - - ch->ch_r_watermark = 0; - - writeb(16, &ch->ch_neo_uart->tfifo); - ch->ch_t_tlevel = 16; - - writeb(16, &ch->ch_neo_uart->rfifo); - ch->ch_r_tlevel = 16; - - writeb(ier, &ch->ch_neo_uart->ier); - - neo_pci_posting_flush(ch->ch_bd); -} - -static inline void neo_set_no_output_flow_control(struct channel_t *ch) -{ - unsigned char ier = readb(&ch->ch_neo_uart->ier); - unsigned char efr = readb(&ch->ch_neo_uart->efr); - - /* Turn off auto CTS flow control */ - ier &= ~UART_17158_IER_CTSDSR; - efr &= ~UART_17158_EFR_CTSDSR; - - /* Turn off auto Xon flow control */ - if (ch->ch_c_iflag & IXOFF) - efr &= ~UART_17158_EFR_IXON; - else - efr &= ~(UART_17158_EFR_ECB | UART_17158_EFR_IXON); - - /* - * Why? Because Exar's spec says we have to zero it - * out before setting it - */ - writeb(0, &ch->ch_neo_uart->efr); - - /* Turn on UART enhanced bits */ - writeb(efr, &ch->ch_neo_uart->efr); - - /* Turn on table D, with 8 char hi/low watermarks */ - writeb(UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY, - &ch->ch_neo_uart->fctr); - - ch->ch_r_watermark = 0; - - writeb(16, &ch->ch_neo_uart->tfifo); - ch->ch_t_tlevel = 16; - - writeb(16, &ch->ch_neo_uart->rfifo); - ch->ch_r_tlevel = 16; - - writeb(ier, &ch->ch_neo_uart->ier); - - neo_pci_posting_flush(ch->ch_bd); -} - -/* change UARTs start/stop chars */ -static inline void neo_set_new_start_stop_chars(struct channel_t *ch) -{ - /* if hardware flow control is set, then skip this whole thing */ - if (ch->ch_digi.digi_flags & (CTSPACE | RTSPACE) || - ch->ch_c_cflag & CRTSCTS) - return; - - /* Tell UART what start/stop chars it should be looking for */ - writeb(ch->ch_startc, &ch->ch_neo_uart->xonchar1); - writeb(0, &ch->ch_neo_uart->xonchar2); - - writeb(ch->ch_stopc, &ch->ch_neo_uart->xoffchar1); - writeb(0, &ch->ch_neo_uart->xoffchar2); - - neo_pci_posting_flush(ch->ch_bd); -} - -/* No locks are assumed to be held when calling this function. */ -static inline void neo_clear_break(struct channel_t *ch, int force) -{ - unsigned long flags; - - spin_lock_irqsave(&ch->ch_lock, flags); - - if (!ch->ch_stop_sending_break) { - spin_unlock_irqrestore(&ch->ch_lock, flags); - return; - } - - if (ch->ch_flags & CH_BREAK_SENDING) { - if (force || - time_after_eq(jiffies, ch->ch_stop_sending_break)) { - unsigned char temp = readb(&ch->ch_neo_uart->lcr); - - writeb((temp & ~UART_LCR_SBC), &ch->ch_neo_uart->lcr); - neo_pci_posting_flush(ch->ch_bd); - ch->ch_flags &= ~(CH_BREAK_SENDING); - ch->ch_stop_sending_break = 0; - } - } - spin_unlock_irqrestore(&ch->ch_lock, flags); -} - -/* Parse the ISR register. */ -static inline void neo_parse_isr(struct dgnc_board *brd, uint port) -{ - struct channel_t *ch; - unsigned char isr; - unsigned char cause; - unsigned long flags; - - ch = brd->channels[port]; - if (!ch) - return; - - /* Here we try to figure out what caused the interrupt to happen */ - while (1) { - isr = readb(&ch->ch_neo_uart->isr_fcr); - - if (isr & UART_IIR_NO_INT) - break; - - /* - * Yank off the upper 2 bits, - * which just show that the FIFO's are enabled. - */ - isr &= ~(UART_17158_IIR_FIFO_ENABLED); - - if (isr & (UART_17158_IIR_RDI_TIMEOUT | UART_IIR_RDI)) { - /* Read data from uart -> queue */ - neo_copy_data_from_uart_to_queue(ch); - /* - * Call our tty layer to enforce queue - * flow control if needed. - */ - spin_lock_irqsave(&ch->ch_lock, flags); - dgnc_check_queue_flow_control(ch); - spin_unlock_irqrestore(&ch->ch_lock, flags); - } - - if (isr & UART_IIR_THRI) { - spin_lock_irqsave(&ch->ch_lock, flags); - ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); - spin_unlock_irqrestore(&ch->ch_lock, flags); - neo_copy_data_from_queue_to_uart(ch); - } - - if (isr & UART_17158_IIR_XONXOFF) { - cause = readb(&ch->ch_neo_uart->xoffchar1); - - /* - * Since the UART detected either an XON or - * XOFF match, we need to figure out which - * one it was, so we can suspend or resume data flow. - */ - if (cause == UART_17158_XON_DETECT) { - /* resume output if stopped */ - if (brd->channels[port]->ch_flags & CH_STOP) { - spin_lock_irqsave(&ch->ch_lock, - flags); - ch->ch_flags &= ~(CH_STOP); - spin_unlock_irqrestore(&ch->ch_lock, - flags); - } - } else if (cause == UART_17158_XOFF_DETECT) { - if (!(brd->channels[port]->ch_flags & - CH_STOP)) { - spin_lock_irqsave(&ch->ch_lock, - flags); - ch->ch_flags |= CH_STOP; - spin_unlock_irqrestore(&ch->ch_lock, - flags); - } - } - } - - if (isr & UART_17158_IIR_HWFLOW_STATE_CHANGE) { - /* - * If we get here, this means the hardware is - * doing auto flow control. Check to see whether - * RTS/DTR or CTS/DSR caused this interrupt. - */ - cause = readb(&ch->ch_neo_uart->mcr); - /* Which pin is doing auto flow? RTS or DTR? */ - if ((cause & 0x4) == 0) { - if (cause & UART_MCR_RTS) { - spin_lock_irqsave(&ch->ch_lock, - flags); - ch->ch_mostat |= UART_MCR_RTS; - spin_unlock_irqrestore(&ch->ch_lock, - flags); - } else { - spin_lock_irqsave(&ch->ch_lock, - flags); - ch->ch_mostat &= ~(UART_MCR_RTS); - spin_unlock_irqrestore(&ch->ch_lock, - flags); - } - } else { - if (cause & UART_MCR_DTR) { - spin_lock_irqsave(&ch->ch_lock, - flags); - ch->ch_mostat |= UART_MCR_DTR; - spin_unlock_irqrestore(&ch->ch_lock, - flags); - } else { - spin_lock_irqsave(&ch->ch_lock, - flags); - ch->ch_mostat &= ~(UART_MCR_DTR); - spin_unlock_irqrestore(&ch->ch_lock, - flags); - } - } - } - - neo_parse_modem(ch, readb(&ch->ch_neo_uart->msr)); - } -} - -static inline void neo_parse_lsr(struct dgnc_board *brd, uint port) -{ - struct channel_t *ch; - int linestatus; - unsigned long flags; - - if (!brd) - return; - - if (port >= brd->maxports) - return; - - ch = brd->channels[port]; - if (!ch) - return; - - linestatus = readb(&ch->ch_neo_uart->lsr); - - ch->ch_cached_lsr |= linestatus; - - if (ch->ch_cached_lsr & UART_LSR_DR) { - neo_copy_data_from_uart_to_queue(ch); - spin_lock_irqsave(&ch->ch_lock, flags); - dgnc_check_queue_flow_control(ch); - spin_unlock_irqrestore(&ch->ch_lock, flags); - } - - /* - * The next 3 tests should *NOT* happen, as the above test - * should encapsulate all 3... At least, thats what Exar says. - */ - - if (linestatus & UART_LSR_PE) - ch->ch_err_parity++; - - if (linestatus & UART_LSR_FE) - ch->ch_err_frame++; - - if (linestatus & UART_LSR_BI) - ch->ch_err_break++; - - if (linestatus & UART_LSR_OE) { - /* - * Rx Oruns. Exar says that an orun will NOT corrupt - * the FIFO. It will just replace the holding register - * with this new data byte. So basically just ignore this. - * Probably we should eventually have an orun stat in our - * driver... - */ - ch->ch_err_overrun++; - } - - if (linestatus & UART_LSR_THRE) { - spin_lock_irqsave(&ch->ch_lock, flags); - ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); - spin_unlock_irqrestore(&ch->ch_lock, flags); - - neo_copy_data_from_queue_to_uart(ch); - } else if (linestatus & UART_17158_TX_AND_FIFO_CLR) { - spin_lock_irqsave(&ch->ch_lock, flags); - ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); - spin_unlock_irqrestore(&ch->ch_lock, flags); - - neo_copy_data_from_queue_to_uart(ch); - } -} - -/* Send any/all changes to the line to the UART. */ -static void neo_param(struct tty_struct *tty) -{ - unsigned char lcr = 0; - unsigned char uart_lcr = 0; - unsigned char ier = 0; - unsigned char uart_ier = 0; - uint baud = 9600; - int quot = 0; - struct dgnc_board *bd; - struct channel_t *ch; - struct un_t *un; - - if (!tty) - return; - - un = (struct un_t *)tty->driver_data; - if (!un) - return; - - ch = un->un_ch; - if (!ch) - return; - - bd = ch->ch_bd; - if (!bd) - return; - - /* If baud rate is zero, flush queues, and set mval to drop DTR. */ - if ((ch->ch_c_cflag & (CBAUD)) == 0) { - ch->ch_r_head = 0; - ch->ch_r_tail = 0; - ch->ch_e_head = 0; - ch->ch_e_tail = 0; - ch->ch_w_head = 0; - ch->ch_w_tail = 0; - - neo_flush_uart_write(ch); - neo_flush_uart_read(ch); - - /* The baudrate is B0 so all modem lines are to be dropped. */ - ch->ch_flags |= (CH_BAUD0); - ch->ch_mostat &= ~(UART_MCR_RTS | UART_MCR_DTR); - neo_assert_modem_signals(ch); - ch->ch_old_baud = 0; - return; - - } else if (ch->ch_custom_speed) { - baud = ch->ch_custom_speed; - /* Handle transition from B0 */ - if (ch->ch_flags & CH_BAUD0) { - ch->ch_flags &= ~(CH_BAUD0); - - /* - * Bring back up RTS and DTR... - * Also handle RTS or DTR toggle if set. - */ - if (!(ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE)) - ch->ch_mostat |= (UART_MCR_RTS); - if (!(ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE)) - ch->ch_mostat |= (UART_MCR_DTR); - } - } else { - int iindex = 0; - int jindex = 0; - - ulong bauds[4][16] = { - { /* slowbaud */ - 0, 50, 75, 110, - 134, 150, 200, 300, - 600, 1200, 1800, 2400, - 4800, 9600, 19200, 38400 }, - { /* slowbaud & CBAUDEX */ - 0, 57600, 115200, 230400, - 460800, 150, 200, 921600, - 600, 1200, 1800, 2400, - 4800, 9600, 19200, 38400 }, - { /* fastbaud */ - 0, 57600, 76800, 115200, - 131657, 153600, 230400, 460800, - 921600, 1200, 1800, 2400, - 4800, 9600, 19200, 38400 }, - { /* fastbaud & CBAUDEX */ - 0, 57600, 115200, 230400, - 460800, 150, 200, 921600, - 600, 1200, 1800, 2400, - 4800, 9600, 19200, 38400 } - }; - - /* - * Only use the TXPrint baud rate if the terminal unit - * is NOT open - */ - if (!(ch->ch_tun.un_flags & UN_ISOPEN) && - (un->un_type == DGNC_PRINT)) - baud = C_BAUD(ch->ch_pun.un_tty) & 0xff; - else - baud = C_BAUD(ch->ch_tun.un_tty) & 0xff; - - if (ch->ch_c_cflag & CBAUDEX) - iindex = 1; - - if (ch->ch_digi.digi_flags & DIGI_FAST) - iindex += 2; - - jindex = baud; - - if ((iindex >= 0) && (iindex < 4) && - (jindex >= 0) && (jindex < 16)) - baud = bauds[iindex][jindex]; - else - baud = 0; - - if (baud == 0) - baud = 9600; - - /* Handle transition from B0 */ - if (ch->ch_flags & CH_BAUD0) { - ch->ch_flags &= ~(CH_BAUD0); - - /* - * Bring back up RTS and DTR... - * Also handle RTS or DTR toggle if set. - */ - if (!(ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE)) - ch->ch_mostat |= (UART_MCR_RTS); - if (!(ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE)) - ch->ch_mostat |= (UART_MCR_DTR); - } - } - - if (ch->ch_c_cflag & PARENB) - lcr |= UART_LCR_PARITY; - - if (!(ch->ch_c_cflag & PARODD)) - lcr |= UART_LCR_EPAR; - -#ifdef CMSPAR - if (ch->ch_c_cflag & CMSPAR) - lcr |= UART_LCR_SPAR; -#endif - - if (ch->ch_c_cflag & CSTOPB) - lcr |= UART_LCR_STOP; - - switch (ch->ch_c_cflag & CSIZE) { - case CS5: - lcr |= UART_LCR_WLEN5; - break; - case CS6: - lcr |= UART_LCR_WLEN6; - break; - case CS7: - lcr |= UART_LCR_WLEN7; - break; - case CS8: - default: - lcr |= UART_LCR_WLEN8; - break; - } - - uart_ier = readb(&ch->ch_neo_uart->ier); - ier = uart_ier; - - uart_lcr = readb(&ch->ch_neo_uart->lcr); - - if (baud == 0) - baud = 9600; - - quot = ch->ch_bd->bd_dividend / baud; - - if (quot != 0 && ch->ch_old_baud != baud) { - ch->ch_old_baud = baud; - writeb(UART_LCR_DLAB, &ch->ch_neo_uart->lcr); - writeb((quot & 0xff), &ch->ch_neo_uart->txrx); - writeb((quot >> 8), &ch->ch_neo_uart->ier); - writeb(lcr, &ch->ch_neo_uart->lcr); - } - - if (uart_lcr != lcr) - writeb(lcr, &ch->ch_neo_uart->lcr); - - if (ch->ch_c_cflag & CREAD) - ier |= (UART_IER_RDI | UART_IER_RLSI); - else - ier &= ~(UART_IER_RDI | UART_IER_RLSI); - - /* - * Have the UART interrupt on modem signal changes ONLY when - * we are in hardware flow control mode, or CLOCAL/FORCEDCD is not set. - */ - if ((ch->ch_digi.digi_flags & CTSPACE) || - (ch->ch_digi.digi_flags & RTSPACE) || - (ch->ch_c_cflag & CRTSCTS) || - !(ch->ch_digi.digi_flags & DIGI_FORCEDCD) || - !(ch->ch_c_cflag & CLOCAL)) - ier |= UART_IER_MSI; - else - ier &= ~UART_IER_MSI; - - ier |= UART_IER_THRI; - - if (ier != uart_ier) - writeb(ier, &ch->ch_neo_uart->ier); - - neo_set_new_start_stop_chars(ch); - - if (ch->ch_digi.digi_flags & CTSPACE || ch->ch_c_cflag & CRTSCTS) { - neo_set_cts_flow_control(ch); - } else if (ch->ch_c_iflag & IXON) { - if ((ch->ch_startc == _POSIX_VDISABLE) || - (ch->ch_stopc == _POSIX_VDISABLE)) - neo_set_no_output_flow_control(ch); - else - neo_set_ixon_flow_control(ch); - } else { - neo_set_no_output_flow_control(ch); - } - - if (ch->ch_digi.digi_flags & RTSPACE || ch->ch_c_cflag & CRTSCTS) { - neo_set_rts_flow_control(ch); - } else if (ch->ch_c_iflag & IXOFF) { - if ((ch->ch_startc == _POSIX_VDISABLE) || - (ch->ch_stopc == _POSIX_VDISABLE)) - neo_set_no_input_flow_control(ch); - else - neo_set_ixoff_flow_control(ch); - } else { - neo_set_no_input_flow_control(ch); - } - - /* - * Adjust the RX FIFO Trigger level if baud is less than 9600. - * Not exactly elegant, but this is needed because of the Exar chip's - * delay on firing off the RX FIFO interrupt on slower baud rates. - */ - if (baud < 9600) { - writeb(1, &ch->ch_neo_uart->rfifo); - ch->ch_r_tlevel = 1; - } - - neo_assert_modem_signals(ch); - - neo_parse_modem(ch, readb(&ch->ch_neo_uart->msr)); -} - -/* Board poller function. */ -static void neo_tasklet(unsigned long data) -{ - struct dgnc_board *bd = (struct dgnc_board *)data; - struct channel_t *ch; - unsigned long flags; - int i; - int state = 0; - int ports = 0; - - if (!bd) - return; - - spin_lock_irqsave(&bd->bd_lock, flags); - state = bd->state; - ports = bd->nasync; - spin_unlock_irqrestore(&bd->bd_lock, flags); - - /* - * Do NOT allow the interrupt routine to read the intr registers - * Until we release this lock. - */ - spin_lock_irqsave(&bd->bd_intr_lock, flags); - - if ((state == BOARD_READY) && (ports > 0)) { - for (i = 0; i < ports; i++) { - ch = bd->channels[i]; - if (!ch) - continue; - - /* - * NOTE: Remember you CANNOT hold any channel - * locks when calling the input routine. - * - * During input processing, its possible we - * will call the Linux ld, which might in turn, - * do a callback right back into us, resulting - * in us trying to grab the channel lock twice! - */ - dgnc_input(ch); - - /* - * Channel lock is grabbed and then released - * inside both of these routines, but neither - * call anything else that could call back into us. - */ - neo_copy_data_from_queue_to_uart(ch); - dgnc_wakeup_writes(ch); - - dgnc_carrier(ch); - - /* - * Check to see if we need to turn off a sending break. - * The timing check is done inside clear_break() - */ - if (ch->ch_stop_sending_break) - neo_clear_break(ch, 0); - } - } - - spin_unlock_irqrestore(&bd->bd_intr_lock, flags); -} - -/* Neo specific interrupt handler. */ -static irqreturn_t neo_intr(int irq, void *voidbrd) -{ - struct dgnc_board *brd = voidbrd; - struct channel_t *ch; - int port = 0; - int type; - u32 uart_poll; - unsigned long flags; - unsigned long flags2; - - if (!brd) - return IRQ_NONE; - - /* Lock out the slow poller from running on this board. */ - spin_lock_irqsave(&brd->bd_intr_lock, flags); - - /* - * Read in "extended" IRQ information from the 32bit Neo register. - * Bits 0-7: What port triggered the interrupt. - * Bits 8-31: Each 3bits indicate what type of interrupt occurred. - */ - uart_poll = readl(brd->re_map_membase + UART_17158_POLL_ADDR_OFFSET); - - /* - * If 0, no interrupts pending. - * This can happen if the IRQ is shared among a couple Neo/Classic - * boards. - */ - if (!uart_poll) { - spin_unlock_irqrestore(&brd->bd_intr_lock, flags); - return IRQ_NONE; - } - - while ((uart_poll & 0xff) != 0) { - type = uart_poll >> (8 + (port * 3)); - type &= 0x7; - - uart_poll &= ~(0x01 << port); - - switch (type) { - case UART_17158_RXRDY_TIMEOUT: - /* - * RXRDY Time-out is cleared by reading data in the - * RX FIFO until it falls below the trigger level. - */ - - if (port >= brd->nasync) - break; - - ch = brd->channels[port]; - neo_copy_data_from_uart_to_queue(ch); - - /* - * Call our tty layer to enforce queue flow control if - * needed. - */ - spin_lock_irqsave(&ch->ch_lock, flags2); - dgnc_check_queue_flow_control(ch); - spin_unlock_irqrestore(&ch->ch_lock, flags2); - - break; - - case UART_17158_RX_LINE_STATUS: - - /* RXRDY and RX LINE Status (logic OR of LSR[4:1]) */ - - neo_parse_lsr(brd, port); - break; - - case UART_17158_TXRDY: - /* - * TXRDY interrupt clears after reading ISR register - * for the UART channel. - */ - - /* - * Yes, this is odd... - * Why would I check EVERY possibility of type of - * interrupt, when we know its TXRDY??? - * Becuz for some reason, even tho we got triggered for - * TXRDY, it seems to be occasionally wrong. Instead of - * TX, which it should be, I was getting things like - * RXDY too. Weird. - */ - neo_parse_isr(brd, port); - break; - - case UART_17158_MSR: - /* MSR or flow control was seen. */ - neo_parse_isr(brd, port); - break; - - default: - break; - } - - port++; - } - - tasklet_schedule(&brd->helper_tasklet); - - spin_unlock_irqrestore(&brd->bd_intr_lock, flags); - - return IRQ_HANDLED; -} - -/* - * Neo specific way of turning off the receiver. - * Used as a way to enforce queue flow control when in - * hardware flow control mode. - */ -static void neo_disable_receiver(struct channel_t *ch) -{ - unsigned char tmp = readb(&ch->ch_neo_uart->ier); - - tmp &= ~(UART_IER_RDI); - writeb(tmp, &ch->ch_neo_uart->ier); - neo_pci_posting_flush(ch->ch_bd); -} - -/* - * Neo specific way of turning on the receiver. - * Used as a way to un-enforce queue flow control when in - * hardware flow control mode. - */ -static void neo_enable_receiver(struct channel_t *ch) -{ - unsigned char tmp = readb(&ch->ch_neo_uart->ier); - - tmp |= (UART_IER_RDI); - writeb(tmp, &ch->ch_neo_uart->ier); - neo_pci_posting_flush(ch->ch_bd); -} - -static void neo_copy_data_from_uart_to_queue(struct channel_t *ch) -{ - int qleft = 0; - unsigned char linestatus = 0; - unsigned char error_mask = 0; - int n = 0; - int total = 0; - ushort head; - ushort tail; - unsigned long flags; - - if (!ch) - return; - - spin_lock_irqsave(&ch->ch_lock, flags); - - head = ch->ch_r_head & RQUEUEMASK; - tail = ch->ch_r_tail & RQUEUEMASK; - - linestatus = ch->ch_cached_lsr; - ch->ch_cached_lsr = 0; - - qleft = tail - head - 1; - if (qleft < 0) - qleft += RQUEUEMASK + 1; - - if (!(ch->ch_flags & CH_FIFO_ENABLED)) { - /* force the FIFO copy to NOT be run */ - total = 0; - } else { - total = readb(&ch->ch_neo_uart->rfifo); - - /* - * EXAR chip bug - RX FIFO COUNT - Fudge factor. - * - * This resolves a problem/bug with the Exar chip that sometimes - * returns a bogus value in the rfifo register. - * The count can be any where from 0-3 bytes "off". - * Bizarre, but true. - */ - if ((ch->ch_bd->dvid & 0xf0) >= UART_XR17E158_DVID) - total -= 1; - else - total -= 3; - } - - total = min(total, qleft); - - while (total > 0) { - linestatus = readb(&ch->ch_neo_uart->lsr); - - if (linestatus & UART_17158_RX_FIFO_DATA_ERROR) - break; - - /* Make sure we don't go over the end of our queue */ - n = min(((uint)total), (RQUEUESIZE - (uint)head)); - - /* - * Cut down n even further if needed, this is to fix - * a problem with memcpy_fromio() with the Neo on the - * IBM pSeries platform. - * 15 bytes max appears to be the magic number. - */ - n = min_t(uint, n, 12); - - /* - * Since we are grabbing the linestatus register, which - * will reset some bits after our read, we need to ensure - * we don't miss our TX FIFO emptys. - */ - if (linestatus & (UART_LSR_THRE | UART_17158_TX_AND_FIFO_CLR)) - ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); - - linestatus = 0; - - memcpy_fromio(ch->ch_rqueue + head, - &ch->ch_neo_uart->txrxburst, n); - - /* - * Since RX_FIFO_DATA_ERROR was 0, we are guaranteed - * that all the data currently in the FIFO is free of - * breaks and parity/frame/orun errors. - */ - memset(ch->ch_equeue + head, 0, n); - - head = (head + n) & RQUEUEMASK; - total -= n; - qleft -= n; - ch->ch_rxcount += n; - } - - /* - * Create a mask to determine whether we should - * insert the character (if any) into our queue. - */ - if (ch->ch_c_iflag & IGNBRK) - error_mask |= UART_LSR_BI; - - /* - * Now cleanup any leftover bytes still in the UART. - * Also deal with any possible queue overflow here as well. - */ - while (1) { - /* - * Its possible we have a linestatus from the loop above - * this, so we "OR" on any extra bits. - */ - linestatus |= readb(&ch->ch_neo_uart->lsr); - - /* - * If the chip tells us there is no more data pending to - * be read, we can then leave. - * But before we do, cache the linestatus, just in case. - */ - if (!(linestatus & UART_LSR_DR)) { - ch->ch_cached_lsr = linestatus; - break; - } - - /* No need to store this bit */ - linestatus &= ~UART_LSR_DR; - - /* - * Since we are grabbing the linestatus register, which - * will reset some bits after our read, we need to ensure - * we don't miss our TX FIFO emptys. - */ - if (linestatus & (UART_LSR_THRE | UART_17158_TX_AND_FIFO_CLR)) { - linestatus &= ~(UART_LSR_THRE | - UART_17158_TX_AND_FIFO_CLR); - ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); - } - - if (linestatus & error_mask) { - unsigned char discard; - - linestatus = 0; - memcpy_fromio(&discard, &ch->ch_neo_uart->txrxburst, 1); - continue; - } - - /* - * If our queue is full, we have no choice but to drop - * some data. The assumption is that HWFLOW or SWFLOW - * should have stopped things way way before we got to - * this point. - */ - while (qleft < 1) { - tail = (tail + 1) & RQUEUEMASK; - ch->ch_r_tail = tail; - ch->ch_err_overrun++; - qleft++; - } - - memcpy_fromio(ch->ch_rqueue + head, - &ch->ch_neo_uart->txrxburst, 1); - ch->ch_equeue[head] = (unsigned char)linestatus; - - linestatus = 0; - - head = (head + 1) & RQUEUEMASK; - - qleft--; - ch->ch_rxcount++; - } - - ch->ch_r_head = head & RQUEUEMASK; - ch->ch_e_head = head & EQUEUEMASK; - - spin_unlock_irqrestore(&ch->ch_lock, flags); -} - -/* - * This function basically goes to sleep for secs, or until - * it gets signalled that the port has fully drained. - */ -static int neo_drain(struct tty_struct *tty, uint seconds) -{ - unsigned long flags; - struct channel_t *ch; - struct un_t *un; - - if (!tty) - return -ENXIO; - - un = (struct un_t *)tty->driver_data; - if (!un) - return -ENXIO; - - ch = un->un_ch; - if (!ch) - return -ENXIO; - - spin_lock_irqsave(&ch->ch_lock, flags); - un->un_flags |= UN_EMPTY; - spin_unlock_irqrestore(&ch->ch_lock, flags); - - /* If returned value is non-zero, user ctrl-c'ed us */ - return wait_event_interruptible_timeout(un->un_flags_wait, - ((un->un_flags & UN_EMPTY) == 0), - msecs_to_jiffies(seconds * 1000)); -} - -/* - * Flush the WRITE FIFO on the Neo. - * Channel lock MUST be held before calling this function! - */ -static void neo_flush_uart_write(struct channel_t *ch) -{ - unsigned char tmp = 0; - int i = 0; - - if (!ch) - return; - - writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT), - &ch->ch_neo_uart->isr_fcr); - neo_pci_posting_flush(ch->ch_bd); - - for (i = 0; i < 10; i++) { - /* - * Check to see if the UART completely flushed the FIFO - * FIFO. - */ - tmp = readb(&ch->ch_neo_uart->isr_fcr); - if (tmp & 4) - udelay(10); - else - break; - } - - ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); -} - -/* - * Flush the READ FIFO on the Neo. - * Channel lock MUST be held before calling this function! - */ -static void neo_flush_uart_read(struct channel_t *ch) -{ - unsigned char tmp = 0; - int i = 0; - - if (!ch) - return; - - writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR, - &ch->ch_neo_uart->isr_fcr); - neo_pci_posting_flush(ch->ch_bd); - - for (i = 0; i < 10; i++) { - /* - * Check to see if the UART feels it completely flushed the - * FIFO. - */ - tmp = readb(&ch->ch_neo_uart->isr_fcr); - if (tmp & 2) - udelay(10); - else - break; - } -} - -static void neo_copy_data_from_queue_to_uart(struct channel_t *ch) -{ - ushort head; - ushort tail; - int n; - int s; - int qlen; - uint len_written = 0; - unsigned long flags; - - if (!ch) - return; - - spin_lock_irqsave(&ch->ch_lock, flags); - - if (ch->ch_w_tail == ch->ch_w_head) - goto exit_unlock; - - /* If port is "stopped", don't send any data to the UART */ - if ((ch->ch_flags & CH_FORCED_STOP) || - (ch->ch_flags & CH_BREAK_SENDING)) - goto exit_unlock; - - if (!(ch->ch_flags & CH_FIFO_ENABLED)) { - /* Send data directly to txrx register */ - unsigned char lsrbits = readb(&ch->ch_neo_uart->lsr); - - ch->ch_cached_lsr |= lsrbits; - if (ch->ch_cached_lsr & UART_LSR_THRE) { - ch->ch_cached_lsr &= ~(UART_LSR_THRE); - - /* - * If RTS Toggle mode is on, turn on RTS now if not - * already set, and make sure we get an event when the - * data transfer has completed. - */ - if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) { - if (!(ch->ch_mostat & UART_MCR_RTS)) { - ch->ch_mostat |= (UART_MCR_RTS); - neo_assert_modem_signals(ch); - } - ch->ch_tun.un_flags |= (UN_EMPTY); - } - /* - * If DTR Toggle mode is on, turn on DTR now if not - * already set, and make sure we get an event when the - * data transfer has completed. - */ - if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) { - if (!(ch->ch_mostat & UART_MCR_DTR)) { - ch->ch_mostat |= (UART_MCR_DTR); - neo_assert_modem_signals(ch); - } - ch->ch_tun.un_flags |= (UN_EMPTY); - } - - writeb(ch->ch_wqueue[ch->ch_w_tail], - &ch->ch_neo_uart->txrx); - ch->ch_w_tail++; - ch->ch_w_tail &= WQUEUEMASK; - ch->ch_txcount++; - } - - goto exit_unlock; - } - - /* We have to do it this way, because of the EXAR TXFIFO count bug. */ - - if ((ch->ch_bd->dvid & 0xf0) < UART_XR17E158_DVID) { - if (!(ch->ch_flags & (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM))) - goto exit_unlock; - - len_written = 0; - - n = readb(&ch->ch_neo_uart->tfifo); - - if ((unsigned int)n > ch->ch_t_tlevel) - goto exit_unlock; - - n = UART_17158_TX_FIFOSIZE - ch->ch_t_tlevel; - } else { - n = UART_17158_TX_FIFOSIZE - readb(&ch->ch_neo_uart->tfifo); - } - - head = ch->ch_w_head & WQUEUEMASK; - tail = ch->ch_w_tail & WQUEUEMASK; - qlen = (head - tail) & WQUEUEMASK; - - n = min(n, qlen); - - while (n > 0) { - s = ((head >= tail) ? head : WQUEUESIZE) - tail; - s = min(s, n); - - if (s <= 0) - break; - - /* - * If RTS Toggle mode is on, turn on RTS now if not already set, - * and make sure we get an event when the data transfer has - * completed. - */ - if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) { - if (!(ch->ch_mostat & UART_MCR_RTS)) { - ch->ch_mostat |= (UART_MCR_RTS); - neo_assert_modem_signals(ch); - } - ch->ch_tun.un_flags |= (UN_EMPTY); - } - - /* - * If DTR Toggle mode is on, turn on DTR now if not already set, - * and make sure we get an event when the data transfer has - * completed. - */ - if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) { - if (!(ch->ch_mostat & UART_MCR_DTR)) { - ch->ch_mostat |= (UART_MCR_DTR); - neo_assert_modem_signals(ch); - } - ch->ch_tun.un_flags |= (UN_EMPTY); - } - - memcpy_toio(&ch->ch_neo_uart->txrxburst, - ch->ch_wqueue + tail, s); - - tail = (tail + s) & WQUEUEMASK; - n -= s; - ch->ch_txcount += s; - len_written += s; - } - - ch->ch_w_tail = tail & WQUEUEMASK; - - if (len_written > 0) { - neo_pci_posting_flush(ch->ch_bd); - ch->ch_flags &= ~(CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); - } - -exit_unlock: - spin_unlock_irqrestore(&ch->ch_lock, flags); -} - -static void neo_parse_modem(struct channel_t *ch, unsigned char signals) -{ - unsigned char msignals = signals; - - if (!ch) - return; - - /* - * Do altpin switching. Altpin switches DCD and DSR. - * This prolly breaks DSRPACE, so we should be more clever here. - */ - if (ch->ch_digi.digi_flags & DIGI_ALTPIN) { - unsigned char mswap = msignals; - - if (mswap & UART_MSR_DDCD) { - msignals &= ~UART_MSR_DDCD; - msignals |= UART_MSR_DDSR; - } - if (mswap & UART_MSR_DDSR) { - msignals &= ~UART_MSR_DDSR; - msignals |= UART_MSR_DDCD; - } - if (mswap & UART_MSR_DCD) { - msignals &= ~UART_MSR_DCD; - msignals |= UART_MSR_DSR; - } - if (mswap & UART_MSR_DSR) { - msignals &= ~UART_MSR_DSR; - msignals |= UART_MSR_DCD; - } - } - - /* Scrub off lower bits. They signify delta's */ - msignals &= 0xf0; - - if (msignals & UART_MSR_DCD) - ch->ch_mistat |= UART_MSR_DCD; - else - ch->ch_mistat &= ~UART_MSR_DCD; - - if (msignals & UART_MSR_DSR) - ch->ch_mistat |= UART_MSR_DSR; - else - ch->ch_mistat &= ~UART_MSR_DSR; - - if (msignals & UART_MSR_RI) - ch->ch_mistat |= UART_MSR_RI; - else - ch->ch_mistat &= ~UART_MSR_RI; - - if (msignals & UART_MSR_CTS) - ch->ch_mistat |= UART_MSR_CTS; - else - ch->ch_mistat &= ~UART_MSR_CTS; -} - -/* Make the UART raise any of the output signals we want up */ -static void neo_assert_modem_signals(struct channel_t *ch) -{ - unsigned char out; - - if (!ch) - return; - - out = ch->ch_mostat; - - if (ch->ch_flags & CH_LOOPBACK) - out |= UART_MCR_LOOP; - - writeb(out, &ch->ch_neo_uart->mcr); - neo_pci_posting_flush(ch->ch_bd); - - /* Give time for the UART to actually raise/drop the signals */ - udelay(10); -} - -static void neo_send_start_character(struct channel_t *ch) -{ - if (!ch) - return; - - if (ch->ch_startc != _POSIX_VDISABLE) { - ch->ch_xon_sends++; - writeb(ch->ch_startc, &ch->ch_neo_uart->txrx); - neo_pci_posting_flush(ch->ch_bd); - udelay(10); - } -} - -static void neo_send_stop_character(struct channel_t *ch) -{ - if (!ch) - return; - - if (ch->ch_stopc != _POSIX_VDISABLE) { - ch->ch_xoff_sends++; - writeb(ch->ch_stopc, &ch->ch_neo_uart->txrx); - neo_pci_posting_flush(ch->ch_bd); - udelay(10); - } -} - -/* neo_uart_init */ - -static void neo_uart_init(struct channel_t *ch) -{ - writeb(0, &ch->ch_neo_uart->ier); - writeb(0, &ch->ch_neo_uart->efr); - writeb(UART_EFR_ECB, &ch->ch_neo_uart->efr); - - /* Clear out UART and FIFO */ - readb(&ch->ch_neo_uart->txrx); - writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, - &ch->ch_neo_uart->isr_fcr); - readb(&ch->ch_neo_uart->lsr); - readb(&ch->ch_neo_uart->msr); - - ch->ch_flags |= CH_FIFO_ENABLED; - - /* Assert any signals we want up */ - writeb(ch->ch_mostat, &ch->ch_neo_uart->mcr); - neo_pci_posting_flush(ch->ch_bd); -} - -/* Make the UART completely turn off. */ -static void neo_uart_off(struct channel_t *ch) -{ - /* Turn off UART enhanced bits */ - writeb(0, &ch->ch_neo_uart->efr); - - /* Stop all interrupts from occurring. */ - writeb(0, &ch->ch_neo_uart->ier); - neo_pci_posting_flush(ch->ch_bd); -} - -static uint neo_get_uart_bytes_left(struct channel_t *ch) -{ - unsigned char left = 0; - unsigned char lsr = readb(&ch->ch_neo_uart->lsr); - - /* We must cache the LSR as some of the bits get reset once read... */ - ch->ch_cached_lsr |= lsr; - - /* Determine whether the Transmitter is empty or not */ - if (!(lsr & UART_LSR_TEMT)) { - if (ch->ch_flags & CH_TX_FIFO_EMPTY) - tasklet_schedule(&ch->ch_bd->helper_tasklet); - left = 1; - } else { - ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); - left = 0; - } - - return left; -} - -/* Channel lock MUST be held by the calling function! */ -static void neo_send_break(struct channel_t *ch, int msecs) -{ - /* If we receive a time of 0, this means turn off the break. */ - - if (msecs == 0) { - if (ch->ch_flags & CH_BREAK_SENDING) { - unsigned char temp = readb(&ch->ch_neo_uart->lcr); - - writeb((temp & ~UART_LCR_SBC), &ch->ch_neo_uart->lcr); - neo_pci_posting_flush(ch->ch_bd); - ch->ch_flags &= ~(CH_BREAK_SENDING); - ch->ch_stop_sending_break = 0; - } - return; - } - - /* - * Set the time we should stop sending the break. - * If we are already sending a break, toss away the existing - * time to stop, and use this new value instead. - */ - ch->ch_stop_sending_break = jiffies + dgnc_jiffies_from_ms(msecs); - - /* Tell the UART to start sending the break */ - if (!(ch->ch_flags & CH_BREAK_SENDING)) { - unsigned char temp = readb(&ch->ch_neo_uart->lcr); - - writeb((temp | UART_LCR_SBC), &ch->ch_neo_uart->lcr); - neo_pci_posting_flush(ch->ch_bd); - ch->ch_flags |= (CH_BREAK_SENDING); - } -} - -/* - * Sends a specific character as soon as possible to the UART, - * jumping over any bytes that might be in the write queue. - * - * The channel lock MUST be held by the calling function. - */ -static void neo_send_immediate_char(struct channel_t *ch, unsigned char c) -{ - if (!ch) - return; - - writeb(c, &ch->ch_neo_uart->txrx); - neo_pci_posting_flush(ch->ch_bd); -} - -static unsigned int neo_read_eeprom(unsigned char __iomem *base, - unsigned int address) -{ - unsigned int enable; - unsigned int bits; - unsigned int databit; - unsigned int val; - - /* enable chip select */ - writeb(NEO_EECS, base + NEO_EEREG); - /* READ */ - enable = address | 0x180; - - for (bits = 9; bits--; ) { - databit = (enable & (1 << bits)) ? NEO_EEDI : 0; - /* Set read address */ - writeb(databit | NEO_EECS, base + NEO_EEREG); - writeb(databit | NEO_EECS | NEO_EECK, base + NEO_EEREG); - } - - val = 0; - - for (bits = 17; bits--; ) { - /* clock to EEPROM */ - writeb(NEO_EECS, base + NEO_EEREG); - writeb(NEO_EECS | NEO_EECK, base + NEO_EEREG); - val <<= 1; - /* read EEPROM */ - if (readb(base + NEO_EEREG) & NEO_EEDO) - val |= 1; - } - - /* clock falling edge */ - writeb(NEO_EECS, base + NEO_EEREG); - - /* drop chip select */ - writeb(0x00, base + NEO_EEREG); - - return val; -} - -static void neo_vpd(struct dgnc_board *brd) -{ - unsigned int i = 0; - unsigned int a; - - if (!brd) - return; - - if (!brd->re_map_membase) - return; - - /* Store the VPD into our buffer */ - for (i = 0; i < NEO_VPD_IMAGESIZE; i++) { - a = neo_read_eeprom(brd->re_map_membase, i); - brd->vpd[i * 2] = a & 0xff; - brd->vpd[(i * 2) + 1] = (a >> 8) & 0xff; - } - - /* - * brd->vpd has different name tags by below index. - * 0x08 : long resource name tag - * 0x10 : long resource name tage (PCI-66 files) - * 0x7F : small resource end tag - */ - if (((brd->vpd[0x08] != 0x82) && - (brd->vpd[0x10] != 0x82)) || - (brd->vpd[0x7F] != 0x78)) { - memset(brd->vpd, '\0', NEO_VPD_IMAGESIZE); - } else { - /* Search for the serial number */ - for (i = 0; i < NEO_VPD_IMAGEBYTES - 3; i++) - if (brd->vpd[i] == 'S' && brd->vpd[i + 1] == 'N') - strncpy(brd->serial_num, &brd->vpd[i + 3], 9); - } -} diff --git a/drivers/staging/dgnc/dgnc_neo.h b/drivers/staging/dgnc/dgnc_neo.h deleted file mode 100644 index acde3ea238b4..000000000000 --- a/drivers/staging/dgnc/dgnc_neo.h +++ /dev/null @@ -1,166 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright 2003 Digi International (www.digi.com) - * Scott H Kilau - */ - -#ifndef _DGNC_NEO_H -#define _DGNC_NEO_H - -#include "dgnc_driver.h" - -/** - * struct neo_uart_struct - Per channel/port NEO UART structure - * - * key - W = read write - * - R = read only - * - U = unused - * - * @txrx: (RW) Holding Register. - * @ier: (RW) Interrupt Enable Register. - * @isr_fcr: (RW) Interrupt Status Reg/Fifo Control Register. - * @lcr: (RW) Line Control Register. - * @mcr: (RW) Modem Control Register. - * @lsr: (RW) Line Status Register. - * @msr: (RW) Modem Status Register. - * @spr: (RW) Scratch Pad Register. - * @fctr: (RW) Feature Control Register. - * @efr: (RW) Enhanced Function Register. - * @tfifo: (RW) Transmit FIFO Register. - * @rfifo: (RW) Receive FIFO Register. - * @xoffchar1: (RW) XOff Character 1 Register. - * @xoffchar2: (RW) XOff Character 2 Register. - * @xonchar1: (RW) Xon Character 1 Register. - * @xonchar2: (RW) XOn Character 2 Register. - * @reserved1: (U) Reserved by Exar. - * @txrxburst: (RW) 64 bytes of RX/TX FIFO Data. - * @reserved2: (U) Reserved by Exar. - * @rxburst_with_errors: (R) bytes of RX FIFO Data + LSR. - */ -struct neo_uart_struct { - u8 txrx; - u8 ier; - u8 isr_fcr; - - u8 lcr; - u8 mcr; - u8 lsr; - u8 msr; - u8 spr; - u8 fctr; - u8 efr; - u8 tfifo; - u8 rfifo; - u8 xoffchar1; - u8 xoffchar2; - u8 xonchar1; - u8 xonchar2; - - u8 reserved1[0x2ff - 0x200]; - u8 txrxburst[64]; - u8 reserved2[0x37f - 0x340]; - u8 rxburst_with_errors[64]; -}; - -/* Where to read the extended interrupt register (32bits instead of 8bits) */ -#define UART_17158_POLL_ADDR_OFFSET 0x80 - -/* These are the current dvid's of the Neo boards */ -#define UART_XR17C158_DVID 0x20 -#define UART_XR17D158_DVID 0x20 -#define UART_XR17E158_DVID 0x40 - -#define NEO_EECK 0x10 /* Clock */ -#define NEO_EECS 0x20 /* Chip Select */ -#define NEO_EEDI 0x40 /* Data In is an Output Pin */ -#define NEO_EEDO 0x80 /* Data Out is an Input Pin */ -#define NEO_EEREG 0x8E /* offset to EEPROM control reg */ - -#define NEO_VPD_IMAGESIZE 0x40 /* size of image to read from EEPROM in words */ -#define NEO_VPD_IMAGEBYTES (NEO_VPD_IMAGESIZE * 2) - -/* - * These are the redefinitions for the FCTR on the XR17C158, since - * Exar made them different than their earlier design. (XR16C854) - */ - -/* These are only applicable when table D is selected */ -#define UART_17158_FCTR_RTS_NODELAY 0x00 -#define UART_17158_FCTR_RTS_4DELAY 0x01 -#define UART_17158_FCTR_RTS_6DELAY 0x02 -#define UART_17158_FCTR_RTS_8DELAY 0x03 -#define UART_17158_FCTR_RTS_12DELAY 0x12 -#define UART_17158_FCTR_RTS_16DELAY 0x05 -#define UART_17158_FCTR_RTS_20DELAY 0x13 -#define UART_17158_FCTR_RTS_24DELAY 0x06 -#define UART_17158_FCTR_RTS_28DELAY 0x14 -#define UART_17158_FCTR_RTS_32DELAY 0x07 -#define UART_17158_FCTR_RTS_36DELAY 0x16 -#define UART_17158_FCTR_RTS_40DELAY 0x08 -#define UART_17158_FCTR_RTS_44DELAY 0x09 -#define UART_17158_FCTR_RTS_48DELAY 0x10 -#define UART_17158_FCTR_RTS_52DELAY 0x11 - -#define UART_17158_FCTR_RTS_IRDA 0x10 -#define UART_17158_FCTR_RS485 0x20 -#define UART_17158_FCTR_TRGA 0x00 -#define UART_17158_FCTR_TRGB 0x40 -#define UART_17158_FCTR_TRGC 0x80 -#define UART_17158_FCTR_TRGD 0xC0 - -/* 17158 trigger table selects.. */ -#define UART_17158_FCTR_BIT6 0x40 -#define UART_17158_FCTR_BIT7 0x80 - -/* 17158 TX/RX memmapped buffer offsets */ -#define UART_17158_RX_FIFOSIZE 64 -#define UART_17158_TX_FIFOSIZE 64 - -/* 17158 Extended IIR's */ -#define UART_17158_IIR_RDI_TIMEOUT 0x0C /* Receiver data TIMEOUT */ -#define UART_17158_IIR_XONXOFF 0x10 /* Received an XON/XOFF char */ -#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20 /* CTS/DSR or RTS/DTR - * state change - */ -#define UART_17158_IIR_FIFO_ENABLED 0xC0 /* 16550 FIFOs are Enabled */ - -/* - * These are the extended interrupts that get sent - * back to us from the UART's 32bit interrupt register - */ -#define UART_17158_RX_LINE_STATUS 0x1 /* RX Ready */ -#define UART_17158_RXRDY_TIMEOUT 0x2 /* RX Ready Timeout */ -#define UART_17158_TXRDY 0x3 /* TX Ready */ -#define UART_17158_MSR 0x4 /* Modem State Change */ -#define UART_17158_TX_AND_FIFO_CLR 0x40 /* Transmitter Holding - * Reg Empty - */ -#define UART_17158_RX_FIFO_DATA_ERROR 0x80 /* UART detected an RX FIFO - * Data error - */ - -/* - * These are the EXTENDED definitions for the 17C158's Interrupt - * Enable Register. - */ -#define UART_17158_EFR_ECB 0x10 /* Enhanced control bit */ -#define UART_17158_EFR_IXON 0x2 /* Receiver compares Xon1/Xoff1 */ -#define UART_17158_EFR_IXOFF 0x8 /* Transmit Xon1/Xoff1 */ -#define UART_17158_EFR_RTSDTR 0x40 /* Auto RTS/DTR Flow Control Enable */ -#define UART_17158_EFR_CTSDSR 0x80 /* Auto CTS/DSR Flow Control Enable */ - -#define UART_17158_XOFF_DETECT 0x1 /* Indicates whether chip saw an - * incoming XOFF char - */ -#define UART_17158_XON_DETECT 0x2 /* Indicates whether chip saw an - * incoming XON char - */ - -#define UART_17158_IER_RSVD1 0x10 /* Reserved by Exar */ -#define UART_17158_IER_XOFF 0x20 /* Xoff Interrupt Enable */ -#define UART_17158_IER_RTSDTR 0x40 /* Output Interrupt Enable */ -#define UART_17158_IER_CTSDSR 0x80 /* Input Interrupt Enable */ - -extern struct board_ops dgnc_neo_ops; - -#endif /* _DGNC_NEO_H */ diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 1323d7f68ab8..3390f0f164f6 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -24,7 +24,6 @@ #include #include "dgnc_driver.h" #include "dgnc_tty.h" -#include "dgnc_neo.h" #include "dgnc_cls.h" /* Default transparent print information. */ -- cgit v1.2.3 From 3a6a47b1a88b5d996d25a6ffbcaf6339b53d74d0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 21:00:01 +0100 Subject: staging: dgnc: delete dgnc_pci.h Move the few #defines we actually use into the dgnc_driver.c file, no need to have a .h file for a driver that is only used by a single .c file. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 12 +++++++++++- drivers/staging/dgnc/dgnc_pci.h | 31 ------------------------------- 2 files changed, 11 insertions(+), 32 deletions(-) delete mode 100644 drivers/staging/dgnc/dgnc_pci.h (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index a6a4119f083b..1174aeb209a9 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -10,7 +10,6 @@ #include #include #include "dgnc_driver.h" -#include "dgnc_pci.h" #include "dgnc_tty.h" #include "dgnc_cls.h" @@ -28,6 +27,17 @@ static ulong dgnc_poll_time; /* Time of next poll */ static uint dgnc_poll_stop; /* Used to tell poller to stop */ static struct timer_list dgnc_poll_timer; +#define DIGI_VID 0x114F +#define PCI_DEVICE_CLASSIC_4_DID 0x0028 +#define PCI_DEVICE_CLASSIC_8_DID 0x0029 +#define PCI_DEVICE_CLASSIC_4_422_DID 0x00D0 +#define PCI_DEVICE_CLASSIC_8_422_DID 0x00D1 + +#define PCI_DEVICE_CLASSIC_4_PCI_NAME "ClassicBoard 4 PCI" +#define PCI_DEVICE_CLASSIC_8_PCI_NAME "ClassicBoard 8 PCI" +#define PCI_DEVICE_CLASSIC_4_422_PCI_NAME "ClassicBoard 4 422 PCI" +#define PCI_DEVICE_CLASSIC_8_422_PCI_NAME "ClassicBoard 8 422 PCI" + static const struct pci_device_id dgnc_pci_tbl[] = { {PCI_DEVICE(DIGI_VID, PCI_DEVICE_CLASSIC_4_DID), .driver_data = 0}, {PCI_DEVICE(DIGI_VID, PCI_DEVICE_CLASSIC_4_422_DID), .driver_data = 1}, diff --git a/drivers/staging/dgnc/dgnc_pci.h b/drivers/staging/dgnc/dgnc_pci.h deleted file mode 100644 index 33595fad66c5..000000000000 --- a/drivers/staging/dgnc/dgnc_pci.h +++ /dev/null @@ -1,31 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright 2003 Digi International (www.digi.com) - * Scott H Kilau - */ - -#ifndef _DGNC_PCI_H -#define _DGNC_PCI_H - -/* Maximum number of PCI boards */ -#define PCIMAX 32 - -#define DIGI_VID 0x114F - -#define PCI_DEVICE_CLASSIC_4_DID 0x0028 -#define PCI_DEVICE_CLASSIC_8_DID 0x0029 -#define PCI_DEVICE_CLASSIC_4_422_DID 0x00D0 -#define PCI_DEVICE_CLASSIC_8_422_DID 0x00D1 - -#define PCI_DEVICE_CLASSIC_4_PCI_NAME "ClassicBoard 4 PCI" -#define PCI_DEVICE_CLASSIC_8_PCI_NAME "ClassicBoard 8 PCI" -#define PCI_DEVICE_CLASSIC_4_422_PCI_NAME "ClassicBoard 4 422 PCI" -#define PCI_DEVICE_CLASSIC_8_422_PCI_NAME "ClassicBoard 8 422 PCI" - -/* Size of memory and I/O for PCI (4 K) */ -#define PCI_RAM_SIZE 0x1000 - -/* Size of memory (2MB) */ -#define PCI_MEM_SIZE 0x1000 - -#endif /* _DGNC_PCI_H */ -- cgit v1.2.3 From 40ffac9a3a061b5e7471d3c87b088d6ecb86388e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 21:00:02 +0100 Subject: staging: dgnc: delete dpatype board type variable. It was only set, and never looked at, so drop the thing as no one cares about it. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 3 --- drivers/staging/dgnc/dgnc_driver.h | 2 -- drivers/staging/dgnc/digi.h | 5 ----- 3 files changed, 10 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 1174aeb209a9..172f4fe67489 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -115,9 +115,6 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id) case PCI_DEVICE_CLASSIC_8_DID: case PCI_DEVICE_CLASSIC_4_422_DID: case PCI_DEVICE_CLASSIC_8_422_DID: - - brd->dpatype = T_CLASSIC | T_PCIBUS; - /* * For PCI ClassicBoards * PCI Local Address (i.e. "resource" number) space diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index b71e6d1d4ec4..6c6d7c5df5e1 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -126,7 +126,6 @@ struct board_ops { * @serial_name: Serial driver name. * @print_dirver: Pointer to the print driver. * @print_name: Print driver name. - * @dpatype: Board type as defined by DPA. * @dpastatus: Board status as defined by DPA. * @bd_dividend: Board/UART's specific dividend. * @bd_ops: Pointer to board operations structure. @@ -180,7 +179,6 @@ struct dgnc_board { struct tty_driver *print_driver; char print_name[200]; - u16 dpatype; u16 dpastatus; uint bd_dividend; diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h index 6a09bd32e349..80b0339f33d7 100644 --- a/drivers/staging/dgnc/digi.h +++ b/drivers/staging/dgnc/digi.h @@ -127,11 +127,6 @@ struct ni_info { unsigned int baud; }; -#define T_CLASSIC 0002 -#define T_PCIBUS 0400 -#define T_NEO_EXPRESS 0001 -#define T_NEO 0000 - #define TTY_FLIPBUF_SIZE 512 #endif /* _DIGI_H */ -- cgit v1.2.3 From 874e0ebebb860e93a0f80e8021d7fc41847b586c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 21:00:03 +0100 Subject: staging: dgnc: delete dpastatus board type variable. It was only set, and never looked at, so drop the thing as no one cares about it. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 3 --- drivers/staging/dgnc/dgnc_driver.h | 3 --- drivers/staging/dgnc/digi.h | 4 ---- 3 files changed, 10 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 172f4fe67489..d29e82e6955c 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -94,7 +94,6 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id) brd->maxports = dgnc_ids[id].maxports; if (dgnc_ids[i].is_pci_express) brd->bd_flags |= BD_IS_PCI_EXPRESS; - brd->dpastatus = BD_NOFEP; init_waitqueue_head(&brd->state_wait); spin_lock_init(&brd->bd_lock); @@ -196,7 +195,6 @@ static int dgnc_request_irq(struct dgnc_board *brd) dev_err(&brd->pdev->dev, "Failed to hook IRQ %d\n", brd->irq); brd->state = BOARD_FAILED; - brd->dpastatus = BD_NOFEP; return -ENODEV; } } @@ -287,7 +285,6 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } brd->state = BOARD_READY; - brd->dpastatus = BD_RUNNING; dgnc_board[dgnc_num_boards++] = brd; diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 6c6d7c5df5e1..8cfafc197cb6 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -126,7 +126,6 @@ struct board_ops { * @serial_name: Serial driver name. * @print_dirver: Pointer to the print driver. * @print_name: Print driver name. - * @dpastatus: Board status as defined by DPA. * @bd_dividend: Board/UART's specific dividend. * @bd_ops: Pointer to board operations structure. */ @@ -179,8 +178,6 @@ struct dgnc_board { struct tty_driver *print_driver; char print_name[200]; - u16 dpastatus; - uint bd_dividend; struct board_ops *bd_ops; diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h index 80b0339f33d7..b414ee80db88 100644 --- a/drivers/staging/dgnc/digi.h +++ b/drivers/staging/dgnc/digi.h @@ -84,10 +84,6 @@ struct digi_getcounter { unsigned long tbytes; }; -/* Board State Definitions */ -#define BD_RUNNING 0x0 -#define BD_NOFEP 0x5 - #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int) /* Set integer baud rate */ #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int) /* Get integer baud rate */ -- cgit v1.2.3 From 1d9bc2604cdd2fca1b23fcb6f1c9f5a36475689a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 21:00:04 +0100 Subject: staging: dgnc: delete is_pci_express board type variable. It was only set, and never looked at, so drop the thing as no one cares about it. And when it was set, it was not even set correctly, the index it was using to read from was incorrect, so this has never even been correct... Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 3 --- drivers/staging/dgnc/dgnc_driver.h | 6 ------ 2 files changed, 9 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index d29e82e6955c..0ab8bc6f3662 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -76,7 +76,6 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id) { struct dgnc_board *brd; unsigned int pci_irq; - int i = 0; int rc = 0; brd = kzalloc(sizeof(*brd), GFP_KERNEL); @@ -92,8 +91,6 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id) brd->pci_slot = PCI_SLOT(pdev->devfn); brd->name = dgnc_ids[id].name; brd->maxports = dgnc_ids[id].maxports; - if (dgnc_ids[i].is_pci_express) - brd->bd_flags |= BD_IS_PCI_EXPRESS; init_waitqueue_head(&brd->state_wait); spin_lock_init(&brd->bd_lock); diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 8cfafc197cb6..c269497dca4d 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -87,17 +87,12 @@ struct board_ops { void (*send_immediate_char)(struct channel_t *ch, unsigned char c); }; -/* Device flag definitions for bd_flags. */ - -#define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */ - /** * struct dgnc_board - Per board information. * @boardnum: Board number (0 - 32). * * @name: Product name. * @pdev: Pointer to the pci_dev structure. - * @bd_flags: Board flags. * @vendor: PCI vendor ID. * @device: PCI device ID. * @subvendor: PCI subsystem vendor ID. @@ -133,7 +128,6 @@ struct dgnc_board { int boardnum; char *name; struct pci_dev *pdev; - unsigned long bd_flags; u16 vendor; u16 device; u16 subvendor; -- cgit v1.2.3 From df31d6716d16dc5c1f1962b5087829a5d1272253 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 21:00:05 +0100 Subject: staging: dgnc: delete a bunch of PCI board variables None of these were being used at all, only set and never used again, so remove them from the code. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.c | 8 -------- drivers/staging/dgnc/dgnc_driver.h | 14 -------------- 2 files changed, 22 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 0ab8bc6f3662..32f10bc50d49 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -84,11 +84,8 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id) /* store the info for the board we've found */ brd->boardnum = dgnc_num_boards; - brd->vendor = dgnc_pci_tbl[id].vendor; brd->device = dgnc_pci_tbl[id].device; brd->pdev = pdev; - brd->pci_bus = pdev->bus->number; - brd->pci_slot = PCI_SLOT(pdev->devfn); brd->name = dgnc_ids[id].name; brd->maxports = dgnc_ids[id].maxports; init_waitqueue_head(&brd->state_wait); @@ -98,11 +95,6 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id) brd->state = BOARD_FOUND; - /* store which card & revision we have */ - pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &brd->subvendor); - pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &brd->subdevice); - pci_read_config_byte(pdev, PCI_REVISION_ID, &brd->rev); - pci_irq = pdev->irq; brd->irq = pci_irq; diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index c269497dca4d..043bbe20bf82 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -93,15 +93,8 @@ struct board_ops { * * @name: Product name. * @pdev: Pointer to the pci_dev structure. - * @vendor: PCI vendor ID. * @device: PCI device ID. - * @subvendor: PCI subsystem vendor ID. - * @subdevice: PCI subsystem device ID. - * @rev: PCI revision ID. - * @pci_bus: PCI bus value. - * @pci_slot: PCI slot value. * @maxports: Maximum ports this board can handle. - * @dvid: Board specific device ID. * @vpd: VPD of this board, if found. * @serial_num: Serial number of this board, if found in VPD. * @bd_lock: Used to protect board. @@ -128,15 +121,8 @@ struct dgnc_board { int boardnum; char *name; struct pci_dev *pdev; - u16 vendor; u16 device; - u16 subvendor; - u16 subdevice; - unsigned char rev; - uint pci_bus; - uint pci_slot; uint maxports; - unsigned char dvid; unsigned char vpd[128]; unsigned char serial_num[20]; -- cgit v1.2.3 From 1971a951794855dccc562fc22fd379c684df657d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 21:00:06 +0100 Subject: staging: dgnc: delete serial_num board variable No one was even ever setting the thing, so just remove it. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 043bbe20bf82..ac99cfd1b54b 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -96,7 +96,6 @@ struct board_ops { * @device: PCI device ID. * @maxports: Maximum ports this board can handle. * @vpd: VPD of this board, if found. - * @serial_num: Serial number of this board, if found in VPD. * @bd_lock: Used to protect board. * @bd_intr_lock: Protect poller tasklet and interrupt routine from each other. * @state: State of the card. @@ -124,7 +123,6 @@ struct dgnc_board { u16 device; uint maxports; unsigned char vpd[128]; - unsigned char serial_num[20]; /* used to protect the board */ spinlock_t bd_lock; -- cgit v1.2.3 From e15f51dc1b876d509f25123fbd09da5141f3bcb1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 21:00:07 +0100 Subject: staging: dgnc: remove "vpd" board variable It was only ever read from the device, and spit out to the kernel log for no good reason. So remove it, and the way it was read from the device, and the now unused "board file" callback. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_cls.c | 25 ------------------------- drivers/staging/dgnc/dgnc_driver.c | 3 --- drivers/staging/dgnc/dgnc_driver.h | 3 --- 3 files changed, 31 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index bbb3673618a9..7e6cbfe4e4ee 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -1114,30 +1114,6 @@ static void cls_send_immediate_char(struct channel_t *ch, unsigned char c) writeb(c, &ch->ch_cls_uart->txrx); } -static void cls_vpd(struct dgnc_board *brd) -{ - ulong vpdbase; /* Start of io base of the card */ - u8 __iomem *re_map_vpdbase;/* Remapped memory of the card */ - int i = 0; - - vpdbase = pci_resource_start(brd->pdev, 3); - if (!vpdbase) - return; - - re_map_vpdbase = ioremap(vpdbase, 0x400); - - if (!re_map_vpdbase) - return; - - for (i = 0; i < 0x40; i++) { - brd->vpd[i] = readb(re_map_vpdbase + i); - pr_info("%x ", brd->vpd[i]); - } - pr_info("\n"); - - iounmap(re_map_vpdbase); -} - struct board_ops dgnc_cls_ops = { .tasklet = cls_tasklet, .intr = cls_intr, @@ -1145,7 +1121,6 @@ struct board_ops dgnc_cls_ops = { .uart_off = cls_uart_off, .drain = cls_drain, .param = cls_param, - .vpd = cls_vpd, .assert_modem_signals = cls_assert_modem_signals, .flush_uart_write = cls_flush_uart_write, .flush_uart_read = cls_flush_uart_read, diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 32f10bc50d49..5d8c2d995dcc 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -142,9 +142,6 @@ static struct dgnc_board *dgnc_found_board(struct pci_dev *pdev, int id) if (rc < 0) goto failed; - /* Get and store the board VPD, if it exists */ - brd->bd_ops->vpd(brd); - /* * Enable Local Interrupt 1 (0x1), * Local Interrupt 1 Polarity Active high (0x2), diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index ac99cfd1b54b..3eb2f148b618 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -73,7 +73,6 @@ struct board_ops { void (*uart_off)(struct channel_t *ch); int (*drain)(struct tty_struct *tty, uint seconds); void (*param)(struct tty_struct *tty); - void (*vpd)(struct dgnc_board *brd); void (*assert_modem_signals)(struct channel_t *ch); void (*flush_uart_write)(struct channel_t *ch); void (*flush_uart_read)(struct channel_t *ch); @@ -95,7 +94,6 @@ struct board_ops { * @pdev: Pointer to the pci_dev structure. * @device: PCI device ID. * @maxports: Maximum ports this board can handle. - * @vpd: VPD of this board, if found. * @bd_lock: Used to protect board. * @bd_intr_lock: Protect poller tasklet and interrupt routine from each other. * @state: State of the card. @@ -122,7 +120,6 @@ struct dgnc_board { struct pci_dev *pdev; u16 device; uint maxports; - unsigned char vpd[128]; /* used to protect the board */ spinlock_t bd_lock; -- cgit v1.2.3 From 2744c4dd1d9d3a275993e295b028a98b1600c54c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Jan 2018 21:00:08 +0100 Subject: staging: dgnc: drop unused neo_uart_struct Now that the "neo" portion of the driver is gone (it was never being used), drop the unused neo_uart_struct variable as well. Cc: Lidza Louina Cc: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- drivers/staging/dgnc/dgnc_driver.h | 2 -- drivers/staging/dgnc/dgnc_tty.c | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/staging/dgnc') diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 3eb2f148b618..b4d9f714c60a 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -246,7 +246,6 @@ struct un_t { * @ch_wopen: Waiting for open process count. * @ch_mostat: FEP output modem status. * @ch_mistat: FEP input modem status. - * @chc_neo_uart: Pointer to the mapped neo UART struct * @ch_cls_uart: Pointer to the mapped cls UART struct * @ch_cached_lsr: Cached value of the LSR register. * @ch_rqueue: Read queue buffer, malloc'ed. @@ -305,7 +304,6 @@ struct channel_t { unsigned char ch_mostat; unsigned char ch_mistat; - struct neo_uart_struct __iomem *ch_neo_uart; struct cls_uart_struct __iomem *ch_cls_uart; unsigned char ch_cached_lsr; diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 3390f0f164f6..9f9b9a5b4b27 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -229,10 +229,7 @@ int dgnc_tty_init(struct dgnc_board *brd) ch->ch_pun.un_type = DGNC_PRINT; ch->ch_pun.un_dev = i + 128; - if (brd->bd_uart_offset == 0x200) - ch->ch_neo_uart = vaddr + (brd->bd_uart_offset * i); - else - ch->ch_cls_uart = vaddr + (brd->bd_uart_offset * i); + ch->ch_cls_uart = vaddr + (brd->bd_uart_offset * i); ch->ch_bd = brd; ch->ch_portnum = i; -- cgit v1.2.3