Merge commit '71b25f4df984' from tty/tty-next
This point in gregkh's tty-next tree includes all the samsung_tty changes that were part of v3 of the M1 bring-up series, and have already been merged in. Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
commit
fd3b2aa100
|
@ -289,7 +289,7 @@
|
|||
152 = /dev/kpoll Kernel Poll Driver
|
||||
153 = /dev/mergemem Memory merge device
|
||||
154 = /dev/pmu Macintosh PowerBook power manager
|
||||
155 = /dev/isictl MultiTech ISICom serial control
|
||||
155 =
|
||||
156 = /dev/lcd Front panel LCD display
|
||||
157 = /dev/ac Applicom Intl Profibus card
|
||||
158 = /dev/nwbutton Netwinder external button
|
||||
|
@ -477,11 +477,6 @@
|
|||
18 block Sanyo CD-ROM
|
||||
0 = /dev/sjcd Sanyo CD-ROM
|
||||
|
||||
19 char Cyclades serial card
|
||||
0 = /dev/ttyC0 First Cyclades port
|
||||
...
|
||||
31 = /dev/ttyC31 32nd Cyclades port
|
||||
|
||||
19 block "Double" compressed disk
|
||||
0 = /dev/double0 First compressed disk
|
||||
...
|
||||
|
@ -493,11 +488,6 @@
|
|||
See the Double documentation for the meaning of the
|
||||
mirror devices.
|
||||
|
||||
20 char Cyclades serial card - alternate devices
|
||||
0 = /dev/cub0 Callout device for ttyC0
|
||||
...
|
||||
31 = /dev/cub31 Callout device for ttyC31
|
||||
|
||||
20 block Hitachi CD-ROM (under development)
|
||||
0 = /dev/hitcd Hitachi CD-ROM
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
$id: http://devicetree.org/schemas/serial/samsung_uart.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Samsung S3C, S5P and Exynos SoC UART Controller
|
||||
title: Samsung S3C, S5P, Exynos, and S5L (Apple SoC) SoC UART Controller
|
||||
|
||||
maintainers:
|
||||
- Krzysztof Kozlowski <krzk@kernel.org>
|
||||
|
@ -19,6 +19,7 @@ properties:
|
|||
compatible:
|
||||
items:
|
||||
- enum:
|
||||
- apple,s5l-uart
|
||||
- samsung,s3c2410-uart
|
||||
- samsung,s3c2412-uart
|
||||
- samsung,s3c2440-uart
|
||||
|
@ -51,6 +52,16 @@ properties:
|
|||
- pattern: '^clk_uart_baud[0-3]$'
|
||||
- pattern: '^clk_uart_baud[0-3]$'
|
||||
|
||||
dmas:
|
||||
items:
|
||||
- description: DMA controller phandle and request line for RX
|
||||
- description: DMA controller phandle and request line for TX
|
||||
|
||||
dma-names:
|
||||
items:
|
||||
- const: rx
|
||||
- const: tx
|
||||
|
||||
interrupts:
|
||||
description: RX interrupt and optionally TX interrupt.
|
||||
minItems: 1
|
||||
|
@ -96,6 +107,7 @@ allOf:
|
|||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- apple,s5l-uart
|
||||
- samsung,exynos4210-uart
|
||||
then:
|
||||
properties:
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
================
|
||||
Cyclades-Z notes
|
||||
================
|
||||
|
||||
The Cyclades-Z must have firmware loaded onto the card before it will
|
||||
operate. This operation should be performed during system startup,
|
||||
|
||||
The firmware, loader program and the latest device driver code are
|
||||
available from Cyclades at
|
||||
|
||||
ftp://ftp.cyclades.com/pub/cyclades/cyclades-z/linux/
|
|
@ -17,7 +17,6 @@ Serial drivers
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
cyclades_z
|
||||
moxa-smartio
|
||||
n_gsm
|
||||
rocket
|
||||
|
|
|
@ -1,185 +0,0 @@
|
|||
================================================
|
||||
Comtrol(tm) RocketPort(R)/RocketModem(TM) Series
|
||||
================================================
|
||||
|
||||
Device Driver for the Linux Operating System
|
||||
============================================
|
||||
|
||||
Product overview
|
||||
----------------
|
||||
|
||||
This driver provides a loadable kernel driver for the Comtrol RocketPort
|
||||
and RocketModem PCI boards. These boards provide, 2, 4, 8, 16, or 32
|
||||
high-speed serial ports or modems. This driver supports up to a combination
|
||||
of four RocketPort or RocketModems boards in one machine simultaneously.
|
||||
This file assumes that you are using the RocketPort driver which is
|
||||
integrated into the kernel sources.
|
||||
|
||||
The driver can also be installed as an external module using the usual
|
||||
"make;make install" routine. This external module driver, obtainable
|
||||
from the Comtrol website listed below, is useful for updating the driver
|
||||
or installing it into kernels which do not have the driver configured
|
||||
into them. Installations instructions for the external module
|
||||
are in the included README and HW_INSTALL files.
|
||||
|
||||
RocketPort ISA and RocketModem II PCI boards currently are only supported by
|
||||
this driver in module form.
|
||||
|
||||
The RocketPort ISA board requires I/O ports to be configured by the DIP
|
||||
switches on the board. See the section "ISA Rocketport Boards" below for
|
||||
information on how to set the DIP switches.
|
||||
|
||||
You pass the I/O port to the driver using the following module parameters:
|
||||
|
||||
board1:
|
||||
I/O port for the first ISA board
|
||||
board2:
|
||||
I/O port for the second ISA board
|
||||
board3:
|
||||
I/O port for the third ISA board
|
||||
board4:
|
||||
I/O port for the fourth ISA board
|
||||
|
||||
There is a set of utilities and scripts provided with the external driver
|
||||
(downloadable from http://www.comtrol.com) that ease the configuration and
|
||||
setup of the ISA cards.
|
||||
|
||||
The RocketModem II PCI boards require firmware to be loaded into the card
|
||||
before it will function. The driver has only been tested as a module for this
|
||||
board.
|
||||
|
||||
Installation Procedures
|
||||
-----------------------
|
||||
|
||||
RocketPort/RocketModem PCI cards require no driver configuration, they are
|
||||
automatically detected and configured.
|
||||
|
||||
The RocketPort driver can be installed as a module (recommended) or built
|
||||
into the kernel. This is selected, as for other drivers, through the `make config`
|
||||
command from the root of the Linux source tree during the kernel build process.
|
||||
|
||||
The RocketPort/RocketModem serial ports installed by this driver are assigned
|
||||
device major number 46, and will be named /dev/ttyRx, where x is the port number
|
||||
starting at zero (ex. /dev/ttyR0, /devttyR1, ...). If you have multiple cards
|
||||
installed in the system, the mapping of port names to serial ports is displayed
|
||||
in the system log at /var/log/messages.
|
||||
|
||||
If installed as a module, the module must be loaded. This can be done
|
||||
manually by entering "modprobe rocket". To have the module loaded automatically
|
||||
upon system boot, edit a `/etc/modprobe.d/*.conf` file and add the line
|
||||
"alias char-major-46 rocket".
|
||||
|
||||
In order to use the ports, their device names (nodes) must be created with mknod.
|
||||
This is only required once, the system will retain the names once created. To
|
||||
create the RocketPort/RocketModem device names, use the command
|
||||
"mknod /dev/ttyRx c 46 x" where x is the port number starting at zero.
|
||||
|
||||
For example::
|
||||
|
||||
> mknod /dev/ttyR0 c 46 0
|
||||
> mknod /dev/ttyR1 c 46 1
|
||||
> mknod /dev/ttyR2 c 46 2
|
||||
|
||||
The Linux script MAKEDEV will create the first 16 ttyRx device names (nodes)
|
||||
for you::
|
||||
|
||||
>/dev/MAKEDEV ttyR
|
||||
|
||||
ISA Rocketport Boards
|
||||
---------------------
|
||||
|
||||
You must assign and configure the I/O addresses used by the ISA Rocketport
|
||||
card before installing and using it. This is done by setting a set of DIP
|
||||
switches on the Rocketport board.
|
||||
|
||||
|
||||
Setting the I/O address
|
||||
-----------------------
|
||||
|
||||
Before installing RocketPort(R) or RocketPort RA boards, you must find
|
||||
a range of I/O addresses for it to use. The first RocketPort card
|
||||
requires a 68-byte contiguous block of I/O addresses, starting at one
|
||||
of the following: 0x100h, 0x140h, 0x180h, 0x200h, 0x240h, 0x280h,
|
||||
0x300h, 0x340h, 0x380h. This I/O address must be reflected in the DIP
|
||||
switches of *all* of the Rocketport cards.
|
||||
|
||||
The second, third, and fourth RocketPort cards require a 64-byte
|
||||
contiguous block of I/O addresses, starting at one of the following
|
||||
I/O addresses: 0x100h, 0x140h, 0x180h, 0x1C0h, 0x200h, 0x240h, 0x280h,
|
||||
0x2C0h, 0x300h, 0x340h, 0x380h, 0x3C0h. The I/O address used by the
|
||||
second, third, and fourth Rocketport cards (if present) are set via
|
||||
software control. The DIP switch settings for the I/O address must be
|
||||
set to the value of the first Rocketport cards.
|
||||
|
||||
In order to distinguish each of the card from the others, each card
|
||||
must have a unique board ID set on the dip switches. The first
|
||||
Rocketport board must be set with the DIP switches corresponding to
|
||||
the first board, the second board must be set with the DIP switches
|
||||
corresponding to the second board, etc. IMPORTANT: The board ID is
|
||||
the only place where the DIP switch settings should differ between the
|
||||
various Rocketport boards in a system.
|
||||
|
||||
The I/O address range used by any of the RocketPort cards must not
|
||||
conflict with any other cards in the system, including other
|
||||
RocketPort cards. Below, you will find a list of commonly used I/O
|
||||
address ranges which may be in use by other devices in your system.
|
||||
On a Linux system, "cat /proc/ioports" will also be helpful in
|
||||
identifying what I/O addresses are being used by devices on your
|
||||
system.
|
||||
|
||||
Remember, the FIRST RocketPort uses 68 I/O addresses. So, if you set it
|
||||
for 0x100, it will occupy 0x100 to 0x143. This would mean that you
|
||||
CAN NOT set the second, third or fourth board for address 0x140 since
|
||||
the first 4 bytes of that range are used by the first board. You would
|
||||
need to set the second, third, or fourth board to one of the next available
|
||||
blocks such as 0x180.
|
||||
|
||||
RocketPort and RocketPort RA SW1 Settings::
|
||||
|
||||
+-------------------------------+
|
||||
| 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|
||||
+-------+-------+---------------+
|
||||
| Unused| Card | I/O Port Block|
|
||||
+-------------------------------+
|
||||
|
||||
DIP Switches DIP Switches
|
||||
7 8 6 5
|
||||
=================== ===================
|
||||
On On UNUSED, MUST BE ON. On On First Card <==== Default
|
||||
On Off Second Card
|
||||
Off On Third Card
|
||||
Off Off Fourth Card
|
||||
|
||||
DIP Switches I/O Address Range
|
||||
4 3 2 1 Used by the First Card
|
||||
=====================================
|
||||
On Off On Off 100-143
|
||||
On Off Off On 140-183
|
||||
On Off Off Off 180-1C3 <==== Default
|
||||
Off On On Off 200-243
|
||||
Off On Off On 240-283
|
||||
Off On Off Off 280-2C3
|
||||
Off Off On Off 300-343
|
||||
Off Off Off On 340-383
|
||||
Off Off Off Off 380-3C3
|
||||
|
||||
Reporting Bugs
|
||||
--------------
|
||||
|
||||
For technical support, please provide the following
|
||||
information: Driver version, kernel release, distribution of
|
||||
kernel, and type of board you are using. Error messages and log
|
||||
printouts port configuration details are especially helpful.
|
||||
|
||||
USA:
|
||||
:Phone: (612) 494-4100
|
||||
:FAX: (612) 494-4199
|
||||
:email: support@comtrol.com
|
||||
|
||||
Comtrol Europe:
|
||||
:Phone: +44 (0) 1 869 323-220
|
||||
:FAX: +44 (0) 1 869 323-211
|
||||
:email: support@comtrol.co.uk
|
||||
|
||||
Web: http://www.comtrol.com
|
||||
FTP: ftp.comtrol.com
|
|
@ -73,12 +73,10 @@ CMAGIC 0x0111 user ``include/linux/
|
|||
MKISS_DRIVER_MAGIC 0x04bf mkiss_channel ``drivers/net/mkiss.h``
|
||||
HDLC_MAGIC 0x239e n_hdlc ``drivers/char/n_hdlc.c``
|
||||
APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c``
|
||||
CYCLADES_MAGIC 0x4359 cyclades_port ``include/linux/cyclades.h``
|
||||
DB_MAGIC 0x4442 fc_info ``drivers/net/iph5526_novram.c``
|
||||
DL_MAGIC 0x444d fc_info ``drivers/net/iph5526_novram.c``
|
||||
FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h``
|
||||
FF_MAGIC 0x4646 fc_info ``drivers/net/iph5526_novram.c``
|
||||
ISICOM_MAGIC 0x4d54 isi_port ``include/linux/isicom.h``
|
||||
PTY_MAGIC 0x5001 ``drivers/char/pty.c``
|
||||
PPP_MAGIC 0x5002 ppp ``include/linux/if_pppvar.h``
|
||||
SSTATE_MAGIC 0x5302 serial_state ``include/linux/serial.h``
|
||||
|
@ -90,14 +88,12 @@ TTY_MAGIC 0x5401 tty_struct ``include/linux/
|
|||
MGSL_MAGIC 0x5401 mgsl_info ``drivers/char/synclink.c``
|
||||
TTY_DRIVER_MAGIC 0x5402 tty_driver ``include/linux/tty_driver.h``
|
||||
MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c``
|
||||
TTY_LDISC_MAGIC 0x5403 tty_ldisc ``include/linux/tty_ldisc.h``
|
||||
USB_SERIAL_MAGIC 0x6702 usb_serial ``drivers/usb/serial/usb-serial.h``
|
||||
FULL_DUPLEX_MAGIC 0x6969 ``drivers/net/ethernet/dec/tulip/de2104x.c``
|
||||
USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth ``drivers/usb/class/bluetty.c``
|
||||
RFCOMM_TTY_MAGIC 0x6d02 ``net/bluetooth/rfcomm/tty.c``
|
||||
USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port ``drivers/usb/serial/usb-serial.h``
|
||||
CG_MAGIC 0x00090255 ufs_cylinder_group ``include/linux/ufs_fs.h``
|
||||
RPORT_MAGIC 0x00525001 r_port ``drivers/char/rocket_int.h``
|
||||
LSEMAGIC 0x05091998 lse ``drivers/fc4/fc.c``
|
||||
RIEBL_MAGIC 0x09051990 ``drivers/net/atarilance.c``
|
||||
NBD_REQUEST_MAGIC 0x12560953 nbd_request ``include/linux/nbd.h``
|
||||
|
|
|
@ -79,12 +79,10 @@ CMAGIC 0x0111 user ``include/linux/
|
|||
MKISS_DRIVER_MAGIC 0x04bf mkiss_channel ``drivers/net/mkiss.h``
|
||||
HDLC_MAGIC 0x239e n_hdlc ``drivers/char/n_hdlc.c``
|
||||
APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c``
|
||||
CYCLADES_MAGIC 0x4359 cyclades_port ``include/linux/cyclades.h``
|
||||
DB_MAGIC 0x4442 fc_info ``drivers/net/iph5526_novram.c``
|
||||
DL_MAGIC 0x444d fc_info ``drivers/net/iph5526_novram.c``
|
||||
FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h``
|
||||
FF_MAGIC 0x4646 fc_info ``drivers/net/iph5526_novram.c``
|
||||
ISICOM_MAGIC 0x4d54 isi_port ``include/linux/isicom.h``
|
||||
PTY_MAGIC 0x5001 ``drivers/char/pty.c``
|
||||
PPP_MAGIC 0x5002 ppp ``include/linux/if_pppvar.h``
|
||||
SSTATE_MAGIC 0x5302 serial_state ``include/linux/serial.h``
|
||||
|
@ -96,14 +94,12 @@ TTY_MAGIC 0x5401 tty_struct ``include/linux/
|
|||
MGSL_MAGIC 0x5401 mgsl_info ``drivers/char/synclink.c``
|
||||
TTY_DRIVER_MAGIC 0x5402 tty_driver ``include/linux/tty_driver.h``
|
||||
MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c``
|
||||
TTY_LDISC_MAGIC 0x5403 tty_ldisc ``include/linux/tty_ldisc.h``
|
||||
USB_SERIAL_MAGIC 0x6702 usb_serial ``drivers/usb/serial/usb-serial.h``
|
||||
FULL_DUPLEX_MAGIC 0x6969 ``drivers/net/ethernet/dec/tulip/de2104x.c``
|
||||
USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth ``drivers/usb/class/bluetty.c``
|
||||
RFCOMM_TTY_MAGIC 0x6d02 ``net/bluetooth/rfcomm/tty.c``
|
||||
USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port ``drivers/usb/serial/usb-serial.h``
|
||||
CG_MAGIC 0x00090255 ufs_cylinder_group ``include/linux/ufs_fs.h``
|
||||
RPORT_MAGIC 0x00525001 r_port ``drivers/char/rocket_int.h``
|
||||
LSEMAGIC 0x05091998 lse ``drivers/fc4/fc.c``
|
||||
GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str ``drivers/scsi/gdth_ioctl.h``
|
||||
RIEBL_MAGIC 0x09051990 ``drivers/net/atarilance.c``
|
||||
|
|
|
@ -62,12 +62,10 @@ CMAGIC 0x0111 user ``include/linux/
|
|||
MKISS_DRIVER_MAGIC 0x04bf mkiss_channel ``drivers/net/mkiss.h``
|
||||
HDLC_MAGIC 0x239e n_hdlc ``drivers/char/n_hdlc.c``
|
||||
APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c``
|
||||
CYCLADES_MAGIC 0x4359 cyclades_port ``include/linux/cyclades.h``
|
||||
DB_MAGIC 0x4442 fc_info ``drivers/net/iph5526_novram.c``
|
||||
DL_MAGIC 0x444d fc_info ``drivers/net/iph5526_novram.c``
|
||||
FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h``
|
||||
FF_MAGIC 0x4646 fc_info ``drivers/net/iph5526_novram.c``
|
||||
ISICOM_MAGIC 0x4d54 isi_port ``include/linux/isicom.h``
|
||||
PTY_MAGIC 0x5001 ``drivers/char/pty.c``
|
||||
PPP_MAGIC 0x5002 ppp ``include/linux/if_pppvar.h``
|
||||
SSTATE_MAGIC 0x5302 serial_state ``include/linux/serial.h``
|
||||
|
@ -79,14 +77,12 @@ TTY_MAGIC 0x5401 tty_struct ``include/linux/
|
|||
MGSL_MAGIC 0x5401 mgsl_info ``drivers/char/synclink.c``
|
||||
TTY_DRIVER_MAGIC 0x5402 tty_driver ``include/linux/tty_driver.h``
|
||||
MGSLPC_MAGIC 0x5402 mgslpc_info ``drivers/char/pcmcia/synclink_cs.c``
|
||||
TTY_LDISC_MAGIC 0x5403 tty_ldisc ``include/linux/tty_ldisc.h``
|
||||
USB_SERIAL_MAGIC 0x6702 usb_serial ``drivers/usb/serial/usb-serial.h``
|
||||
FULL_DUPLEX_MAGIC 0x6969 ``drivers/net/ethernet/dec/tulip/de2104x.c``
|
||||
USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth ``drivers/usb/class/bluetty.c``
|
||||
RFCOMM_TTY_MAGIC 0x6d02 ``net/bluetooth/rfcomm/tty.c``
|
||||
USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port ``drivers/usb/serial/usb-serial.h``
|
||||
CG_MAGIC 0x00090255 ufs_cylinder_group ``include/linux/ufs_fs.h``
|
||||
RPORT_MAGIC 0x00525001 r_port ``drivers/char/rocket_int.h``
|
||||
LSEMAGIC 0x05091998 lse ``drivers/fc4/fc.c``
|
||||
GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str ``drivers/scsi/gdth_ioctl.h``
|
||||
RIEBL_MAGIC 0x09051990 ``drivers/net/atarilance.c``
|
||||
|
|
|
@ -209,7 +209,6 @@ Code Seq# Include File Comments
|
|||
linux/fs.h,
|
||||
'X' all fs/ocfs2/ocfs_fs.h conflict!
|
||||
'X' 01 linux/pktcdvd.h conflict!
|
||||
'Y' all linux/cyclades.h
|
||||
'Z' 14-15 drivers/message/fusion/mptctl.h
|
||||
'[' 00-3F linux/usb/tmc.h USB Test and Measurement Devices
|
||||
<mailto:gregkh@linuxfoundation.org>
|
||||
|
|
22
MAINTAINERS
22
MAINTAINERS
|
@ -4876,16 +4876,8 @@ S: Maintained
|
|||
W: http://www.armlinux.org.uk/
|
||||
F: drivers/video/fbdev/cyber2000fb.*
|
||||
|
||||
CYCLADES ASYNC MUX DRIVER
|
||||
S: Orphan
|
||||
W: http://www.cyclades.com/
|
||||
F: drivers/tty/cyclades.c
|
||||
F: include/linux/cyclades.h
|
||||
F: include/uapi/linux/cyclades.h
|
||||
|
||||
CYCLADES PC300 DRIVER
|
||||
S: Orphan
|
||||
W: http://www.cyclades.com/
|
||||
F: drivers/net/wan/pc300*
|
||||
|
||||
CYPRESS_FIRMWARE MEDIA DRIVER
|
||||
|
@ -12089,8 +12081,7 @@ F: drivers/media/pci/meye/
|
|||
F: include/uapi/linux/meye.h
|
||||
|
||||
MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD
|
||||
M: Jiri Slaby <jirislaby@kernel.org>
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
F: Documentation/driver-api/serial/moxa-smartio.rst
|
||||
F: drivers/tty/mxser.*
|
||||
|
||||
|
@ -12234,11 +12225,6 @@ F: drivers/mux/
|
|||
F: include/dt-bindings/mux/
|
||||
F: include/linux/mux/
|
||||
|
||||
MULTITECH MULTIPORT CARD (ISICOM)
|
||||
S: Orphan
|
||||
F: drivers/tty/isicom.c
|
||||
F: include/linux/isicom.h
|
||||
|
||||
MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
|
||||
M: Bin Liu <b-liu@ti.com>
|
||||
L: linux-usb@vger.kernel.org
|
||||
|
@ -15409,12 +15395,6 @@ L: netdev@vger.kernel.org
|
|||
S: Supported
|
||||
F: drivers/net/ethernet/rocker/
|
||||
|
||||
ROCKETPORT DRIVER
|
||||
S: Maintained
|
||||
W: http://www.comtrol.com
|
||||
F: Documentation/driver-api/serial/rocket.rst
|
||||
F: drivers/tty/rocket*
|
||||
|
||||
ROCKETPORT EXPRESS/INFINITY DRIVER
|
||||
M: Kevin Cernekee <cernekee@gmail.com>
|
||||
L: linux-serial@vger.kernel.org
|
||||
|
|
|
@ -595,7 +595,6 @@ CONFIG_GAMEPORT_FM801=m
|
|||
# CONFIG_LEGACY_PTYS is not set
|
||||
CONFIG_SERIAL_NONSTANDARD=y
|
||||
CONFIG_ROCKETPORT=m
|
||||
CONFIG_CYCLADES=m
|
||||
CONFIG_SYNCLINK_GT=m
|
||||
CONFIG_NOZOMI=m
|
||||
CONFIG_N_HDLC=m
|
||||
|
|
|
@ -31,48 +31,23 @@
|
|||
#define SERIAL_MAX_NUM_LINES 1
|
||||
#define SERIAL_TIMER_VALUE (HZ / 10)
|
||||
|
||||
static void rs_poll(struct timer_list *);
|
||||
|
||||
static struct tty_driver *serial_driver;
|
||||
static struct tty_port serial_port;
|
||||
static struct timer_list serial_timer;
|
||||
|
||||
static DEFINE_TIMER(serial_timer, rs_poll);
|
||||
static DEFINE_SPINLOCK(timer_lock);
|
||||
|
||||
static char *serial_version = "0.1";
|
||||
static char *serial_name = "ISS serial driver";
|
||||
|
||||
/*
|
||||
* This routine is called whenever a serial port is opened. It
|
||||
* enables interrupts for a serial port, linking in its async structure into
|
||||
* the IRQ chain. It also performs the serial-specific
|
||||
* initialization for the tty structure.
|
||||
*/
|
||||
|
||||
static void rs_poll(struct timer_list *);
|
||||
|
||||
static int rs_open(struct tty_struct *tty, struct file * filp)
|
||||
{
|
||||
tty->port = &serial_port;
|
||||
spin_lock_bh(&timer_lock);
|
||||
if (tty->count == 1) {
|
||||
timer_setup(&serial_timer, rs_poll, 0);
|
||||
if (tty->count == 1)
|
||||
mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE);
|
||||
}
|
||||
spin_unlock_bh(&timer_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------
|
||||
* iss_serial_close()
|
||||
*
|
||||
* This routine is called when the serial port gets closed. First, we
|
||||
* wait for the last remaining data to be sent. Then, we unlink its
|
||||
* async structure from the interrupt chain if necessary, and we free
|
||||
* that IRQ if nothing is left in the chain.
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
static void rs_close(struct tty_struct *tty, struct file * filp)
|
||||
{
|
||||
spin_lock_bh(&timer_lock);
|
||||
|
@ -149,7 +124,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
|
|||
|
||||
static int rs_proc_show(struct seq_file *m, void *v)
|
||||
{
|
||||
seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version);
|
||||
seq_printf(m, "serinfo:1.0 driver:0.1\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -166,14 +141,12 @@ static const struct tty_operations serial_ops = {
|
|||
.proc_show = rs_proc_show,
|
||||
};
|
||||
|
||||
int __init rs_init(void)
|
||||
static int __init rs_init(void)
|
||||
{
|
||||
tty_port_init(&serial_port);
|
||||
|
||||
serial_driver = alloc_tty_driver(SERIAL_MAX_NUM_LINES);
|
||||
|
||||
pr_info("%s %s\n", serial_name, serial_version);
|
||||
|
||||
/* Initialize the tty_driver structure */
|
||||
|
||||
serial_driver->driver_name = "iss_serial";
|
||||
|
@ -198,11 +171,7 @@ int __init rs_init(void)
|
|||
|
||||
static __exit void rs_exit(void)
|
||||
{
|
||||
int error;
|
||||
|
||||
if ((error = tty_unregister_driver(serial_driver)))
|
||||
pr_err("ISS_SERIAL: failed to unregister serial driver (%d)\n",
|
||||
error);
|
||||
tty_unregister_driver(serial_driver);
|
||||
put_tty_driver(serial_driver);
|
||||
tty_port_destroy(&serial_port);
|
||||
}
|
||||
|
|
|
@ -104,7 +104,6 @@ static int spk_ttyio_receive_buf2(struct tty_struct *tty,
|
|||
|
||||
static struct tty_ldisc_ops spk_ttyio_ldisc_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "speakup_ldisc",
|
||||
.open = spk_ttyio_ldisc_open,
|
||||
.close = spk_ttyio_ldisc_close,
|
||||
|
|
|
@ -821,7 +821,6 @@ static __poll_t hci_uart_tty_poll(struct tty_struct *tty,
|
|||
|
||||
static struct tty_ldisc_ops hci_uart_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "n_hci",
|
||||
.open = hci_uart_tty_open,
|
||||
.close = hci_uart_tty_close,
|
||||
|
|
|
@ -845,7 +845,6 @@ static void st_tty_flush_buffer(struct tty_struct *tty)
|
|||
}
|
||||
|
||||
static struct tty_ldisc_ops st_ldisc_ops = {
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "n_st",
|
||||
.open = st_tty_open,
|
||||
.close = st_tty_close,
|
||||
|
|
|
@ -382,7 +382,6 @@ static void ldisc_close(struct tty_struct *tty)
|
|||
/* The line discipline structure. */
|
||||
static struct tty_ldisc_ops caif_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "n_caif",
|
||||
.open = ldisc_open,
|
||||
.close = ldisc_close,
|
||||
|
@ -390,18 +389,6 @@ static struct tty_ldisc_ops caif_ldisc = {
|
|||
.write_wakeup = ldisc_tx_wakeup
|
||||
};
|
||||
|
||||
static int register_ldisc(void)
|
||||
{
|
||||
int result;
|
||||
|
||||
result = tty_register_ldisc(N_CAIF, &caif_ldisc);
|
||||
if (result < 0) {
|
||||
pr_err("cannot register CAIF ldisc=%d err=%d\n", N_CAIF,
|
||||
result);
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
static const struct net_device_ops netdev_ops = {
|
||||
.ndo_open = caif_net_open,
|
||||
.ndo_stop = caif_net_close,
|
||||
|
@ -444,7 +431,10 @@ static int __init caif_ser_init(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
ret = register_ldisc();
|
||||
ret = tty_register_ldisc(N_CAIF, &caif_ldisc);
|
||||
if (ret < 0)
|
||||
pr_err("cannot register CAIF ldisc=%d err=%d\n", N_CAIF, ret);
|
||||
|
||||
debugfsdir = debugfs_create_dir("caif_serial", NULL);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -697,7 +697,6 @@ static int slcan_ioctl(struct tty_struct *tty, struct file *file,
|
|||
|
||||
static struct tty_ldisc_ops slc_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "slcan",
|
||||
.open = slcan_open,
|
||||
.close = slcan_close,
|
||||
|
|
|
@ -744,7 +744,6 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
|
|||
|
||||
static struct tty_ldisc_ops sp_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "6pack",
|
||||
.open = sixpack_open,
|
||||
.close = sixpack_close,
|
||||
|
|
|
@ -933,7 +933,6 @@ out:
|
|||
|
||||
static struct tty_ldisc_ops ax_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "mkiss",
|
||||
.open = mkiss_open,
|
||||
.close = mkiss_close,
|
||||
|
|
|
@ -372,7 +372,6 @@ ppp_asynctty_wakeup(struct tty_struct *tty)
|
|||
|
||||
static struct tty_ldisc_ops ppp_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "ppp",
|
||||
.open = ppp_asynctty_open,
|
||||
.close = ppp_asynctty_close,
|
||||
|
|
|
@ -365,7 +365,6 @@ ppp_sync_wakeup(struct tty_struct *tty)
|
|||
|
||||
static struct tty_ldisc_ops ppp_sync_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "pppsync",
|
||||
.open = ppp_sync_open,
|
||||
.close = ppp_sync_close,
|
||||
|
|
|
@ -1263,7 +1263,6 @@ static int sl_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
|||
|
||||
static struct tty_ldisc_ops sl_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "slip",
|
||||
.open = slip_open,
|
||||
.close = slip_close,
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
#include <linux/pps_kernel.h>
|
||||
#include <linux/bug.h>
|
||||
|
||||
#define PPS_TTY_MAGIC 0x0001
|
||||
|
||||
static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status)
|
||||
{
|
||||
struct pps_device *pps;
|
||||
|
@ -114,7 +112,6 @@ static int __init pps_tty_init(void)
|
|||
|
||||
/* Init PPS_TTY data */
|
||||
pps_ldisc_ops.owner = THIS_MODULE;
|
||||
pps_ldisc_ops.magic = PPS_TTY_MAGIC;
|
||||
pps_ldisc_ops.name = "pps_tty";
|
||||
pps_ldisc_ops.dcd_change = pps_tty_dcd_change;
|
||||
pps_ldisc_ops.open = pps_tty_open;
|
||||
|
|
|
@ -85,7 +85,6 @@ struct raw3215_info {
|
|||
int written; /* number of bytes in write requests */
|
||||
struct raw3215_req *queued_read; /* pointer to queued read requests */
|
||||
struct raw3215_req *queued_write;/* pointer to queued write requests */
|
||||
struct tasklet_struct tlet; /* tasklet to invoke tty_wakeup */
|
||||
wait_queue_head_t empty_wait; /* wait queue for flushing */
|
||||
struct timer_list timer; /* timer for delayed output */
|
||||
int line_pos; /* position on the line (for tabs) */
|
||||
|
@ -329,21 +328,6 @@ static inline void raw3215_try_io(struct raw3215_info *raw)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Call tty_wakeup from tasklet context
|
||||
*/
|
||||
static void raw3215_wakeup(unsigned long data)
|
||||
{
|
||||
struct raw3215_info *raw = (struct raw3215_info *) data;
|
||||
struct tty_struct *tty;
|
||||
|
||||
tty = tty_port_tty_get(&raw->port);
|
||||
if (tty) {
|
||||
tty_wakeup(tty);
|
||||
tty_kref_put(tty);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to start the next IO and wake up processes waiting on the tty.
|
||||
*/
|
||||
|
@ -352,7 +336,7 @@ static void raw3215_next_io(struct raw3215_info *raw, struct tty_struct *tty)
|
|||
raw3215_mk_write_req(raw);
|
||||
raw3215_try_io(raw);
|
||||
if (tty && RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE)
|
||||
tasklet_schedule(&raw->tlet);
|
||||
tty_wakeup(tty);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -644,7 +628,6 @@ static struct raw3215_info *raw3215_alloc_info(void)
|
|||
|
||||
timer_setup(&info->timer, raw3215_timeout, 0);
|
||||
init_waitqueue_head(&info->empty_wait);
|
||||
tasklet_init(&info->tlet, raw3215_wakeup, (unsigned long)info);
|
||||
tty_port_init(&info->port);
|
||||
|
||||
return info;
|
||||
|
@ -928,15 +911,13 @@ static int tty3215_open(struct tty_struct *tty, struct file * filp)
|
|||
*/
|
||||
static void tty3215_close(struct tty_struct *tty, struct file * filp)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
if (raw == NULL || tty->count > 1)
|
||||
return;
|
||||
tty->closing = 1;
|
||||
/* Shutdown the terminal */
|
||||
raw3215_shutdown(raw);
|
||||
tasklet_kill(&raw->tlet);
|
||||
tty->closing = 0;
|
||||
tty_port_tty_set(&raw->port, NULL);
|
||||
}
|
||||
|
@ -946,9 +927,7 @@ static void tty3215_close(struct tty_struct *tty, struct file * filp)
|
|||
*/
|
||||
static int tty3215_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
/* Subtract TAB_STOP_SIZE to allow for a tab, 8 <<< 64K */
|
||||
if ((RAW3215_BUFFER_SIZE - raw->count - TAB_STOP_SIZE) >= 0)
|
||||
|
@ -963,12 +942,9 @@ static int tty3215_write_room(struct tty_struct *tty)
|
|||
static int tty3215_write(struct tty_struct * tty,
|
||||
const unsigned char *buf, int count)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
int i, written;
|
||||
|
||||
if (!tty)
|
||||
return 0;
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
written = count;
|
||||
while (count > 0) {
|
||||
for (i = 0; i < count; i++)
|
||||
|
@ -991,12 +967,10 @@ static int tty3215_write(struct tty_struct * tty,
|
|||
*/
|
||||
static int tty3215_put_char(struct tty_struct *tty, unsigned char ch)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
if (!tty)
|
||||
return 0;
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
raw3215_putchar(raw, ch);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1009,17 +983,15 @@ static void tty3215_flush_chars(struct tty_struct *tty)
|
|||
*/
|
||||
static int tty3215_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
return raw->count;
|
||||
}
|
||||
|
||||
static void tty3215_flush_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
raw3215_flush_buffer(raw);
|
||||
tty_wakeup(tty);
|
||||
}
|
||||
|
@ -1029,9 +1001,8 @@ static void tty3215_flush_buffer(struct tty_struct *tty)
|
|||
*/
|
||||
static void tty3215_throttle(struct tty_struct * tty)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
raw->flags |= RAW3215_THROTTLED;
|
||||
}
|
||||
|
||||
|
@ -1040,10 +1011,9 @@ static void tty3215_throttle(struct tty_struct * tty)
|
|||
*/
|
||||
static void tty3215_unthrottle(struct tty_struct * tty)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
unsigned long flags;
|
||||
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
if (raw->flags & RAW3215_THROTTLED) {
|
||||
spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
|
||||
raw->flags &= ~RAW3215_THROTTLED;
|
||||
|
@ -1057,9 +1027,8 @@ static void tty3215_unthrottle(struct tty_struct * tty)
|
|||
*/
|
||||
static void tty3215_stop(struct tty_struct *tty)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
raw->flags |= RAW3215_STOPPED;
|
||||
}
|
||||
|
||||
|
@ -1068,10 +1037,9 @@ static void tty3215_stop(struct tty_struct *tty)
|
|||
*/
|
||||
static void tty3215_start(struct tty_struct *tty)
|
||||
{
|
||||
struct raw3215_info *raw;
|
||||
struct raw3215_info *raw = tty->driver_data;
|
||||
unsigned long flags;
|
||||
|
||||
raw = (struct raw3215_info *) tty->driver_data;
|
||||
if (raw->flags & RAW3215_STOPPED) {
|
||||
spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
|
||||
raw->flags &= ~RAW3215_STOPPED;
|
||||
|
|
|
@ -188,7 +188,7 @@ static int gdm_tty_write_room(struct tty_struct *tty)
|
|||
struct gdm *gdm = tty->driver_data;
|
||||
|
||||
if (!GDM_TTY_READY(gdm))
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
||||
return WRITE_SIZE;
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ config SERIAL_NONSTANDARD
|
|||
help
|
||||
Say Y here if you have any non-standard serial boards -- boards
|
||||
which aren't supported using the standard "dumb" serial driver.
|
||||
This includes intelligent serial boards such as Cyclades,
|
||||
This includes intelligent serial boards such as
|
||||
Digiboards, etc. These are usually used for systems that need many
|
||||
serial ports because they serve many terminals or dial-in
|
||||
connections.
|
||||
|
@ -192,50 +192,6 @@ config SERIAL_NONSTANDARD
|
|||
|
||||
Most people can say N here.
|
||||
|
||||
config ROCKETPORT
|
||||
tristate "Comtrol RocketPort support"
|
||||
depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
|
||||
help
|
||||
This driver supports Comtrol RocketPort and RocketModem PCI boards.
|
||||
These boards provide 2, 4, 8, 16, or 32 high-speed serial ports or
|
||||
modems. For information about the RocketPort/RocketModem boards
|
||||
and this driver read <file:Documentation/driver-api/serial/rocket.rst>.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called rocket.
|
||||
|
||||
If you want to compile this driver into the kernel, say Y here. If
|
||||
you don't have a Comtrol RocketPort/RocketModem card installed, say N.
|
||||
|
||||
config CYCLADES
|
||||
tristate "Cyclades async mux support"
|
||||
depends on SERIAL_NONSTANDARD && (PCI || ISA)
|
||||
select FW_LOADER
|
||||
help
|
||||
This driver supports Cyclades Z and Y multiserial boards.
|
||||
You would need something like this to connect more than two modems to
|
||||
your Linux box, for instance in order to become a dial-in server.
|
||||
|
||||
For information about the Cyclades-Z card, read
|
||||
<file:Documentation/driver-api/serial/cyclades_z.rst>.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called cyclades.
|
||||
|
||||
If you haven't heard about it, it's safe to say N.
|
||||
|
||||
config CYZ_INTR
|
||||
bool "Cyclades-Z interrupt mode operation"
|
||||
depends on CYCLADES && PCI
|
||||
help
|
||||
The Cyclades-Z family of multiport cards allows 2 (two) driver op
|
||||
modes: polling and interrupt. In polling mode, the driver will check
|
||||
the status of the Cyclades-Z ports every certain amount of time
|
||||
(which is called polling cycle and is configurable). In interrupt
|
||||
mode, it will use an interrupt line (IRQ) in order to check the
|
||||
status of the Cyclades-Z ports. The default op mode is polling. If
|
||||
unsure, say N.
|
||||
|
||||
config MOXA_INTELLIO
|
||||
tristate "Moxa Intellio support"
|
||||
depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
|
||||
|
@ -267,16 +223,6 @@ config SYNCLINK_GT
|
|||
synchronous and asynchronous serial adapters
|
||||
manufactured by Microgate Systems, Ltd. (www.microgate.com)
|
||||
|
||||
config ISI
|
||||
tristate "Multi-Tech multiport card support"
|
||||
depends on SERIAL_NONSTANDARD && PCI
|
||||
select FW_LOADER
|
||||
help
|
||||
This is a driver for the Multi-Tech cards which provide several
|
||||
serial ports. The driver is experimental and can currently only be
|
||||
built as a module. The module will be called isicom.
|
||||
If you want to do that, choose M here.
|
||||
|
||||
config N_HDLC
|
||||
tristate "HDLC line discipline support"
|
||||
depends on SERIAL_NONSTANDARD
|
||||
|
|
|
@ -18,13 +18,10 @@ obj-$(CONFIG_SERIAL_DEV_BUS) += serdev/
|
|||
|
||||
# tty drivers
|
||||
obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
|
||||
obj-$(CONFIG_CYCLADES) += cyclades.o
|
||||
obj-$(CONFIG_ISI) += isicom.o
|
||||
obj-$(CONFIG_MOXA_INTELLIO) += moxa.o
|
||||
obj-$(CONFIG_MOXA_SMARTIO) += mxser.o
|
||||
obj-$(CONFIG_NOZOMI) += nozomi.o
|
||||
obj-$(CONFIG_NULL_TTY) += ttynull.o
|
||||
obj-$(CONFIG_ROCKETPORT) += rocket.o
|
||||
obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o
|
||||
obj-$(CONFIG_PPC_EPAPR_HV_BYTECHAN) += ehv_bytechan.o
|
||||
obj-$(CONFIG_GOLDFISH_TTY) += goldfish.o
|
||||
|
|
|
@ -1622,21 +1622,17 @@ fail_put_tty_driver:
|
|||
|
||||
static int __exit amiga_serial_remove(struct platform_device *pdev)
|
||||
{
|
||||
int error;
|
||||
struct serial_state *state = platform_get_drvdata(pdev);
|
||||
|
||||
/* printk("Unloading %s: version %s\n", serial_name, serial_version); */
|
||||
error = tty_unregister_driver(serial_driver);
|
||||
if (error)
|
||||
printk("SERIAL: failed to unregister serial driver (%d)\n",
|
||||
error);
|
||||
tty_unregister_driver(serial_driver);
|
||||
put_tty_driver(serial_driver);
|
||||
tty_port_destroy(&state->tport);
|
||||
|
||||
free_irq(IRQ_AMIGA_TBE, state);
|
||||
free_irq(IRQ_AMIGA_RBF, state);
|
||||
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver amiga_serial_driver = {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -290,35 +290,11 @@ static LIST_HEAD(hvcs_structs);
|
|||
static DEFINE_SPINLOCK(hvcs_structs_lock);
|
||||
static DEFINE_MUTEX(hvcs_init_mutex);
|
||||
|
||||
static void hvcs_unthrottle(struct tty_struct *tty);
|
||||
static void hvcs_throttle(struct tty_struct *tty);
|
||||
static irqreturn_t hvcs_handle_interrupt(int irq, void *dev_instance);
|
||||
|
||||
static int hvcs_write(struct tty_struct *tty,
|
||||
const unsigned char *buf, int count);
|
||||
static int hvcs_write_room(struct tty_struct *tty);
|
||||
static int hvcs_chars_in_buffer(struct tty_struct *tty);
|
||||
|
||||
static int hvcs_has_pi(struct hvcs_struct *hvcsd);
|
||||
static void hvcs_set_pi(struct hvcs_partner_info *pi,
|
||||
struct hvcs_struct *hvcsd);
|
||||
static int hvcs_get_pi(struct hvcs_struct *hvcsd);
|
||||
static int hvcs_rescan_devices_list(void);
|
||||
|
||||
static int hvcs_partner_connect(struct hvcs_struct *hvcsd);
|
||||
static void hvcs_partner_free(struct hvcs_struct *hvcsd);
|
||||
|
||||
static int hvcs_enable_device(struct hvcs_struct *hvcsd,
|
||||
uint32_t unit_address, unsigned int irq, struct vio_dev *dev);
|
||||
|
||||
static int hvcs_open(struct tty_struct *tty, struct file *filp);
|
||||
static void hvcs_close(struct tty_struct *tty, struct file *filp);
|
||||
static void hvcs_hangup(struct tty_struct * tty);
|
||||
|
||||
static int hvcs_probe(struct vio_dev *dev,
|
||||
const struct vio_device_id *id);
|
||||
static int __init hvcs_module_init(void);
|
||||
static void __exit hvcs_module_exit(void);
|
||||
static int hvcs_initialize(void);
|
||||
|
||||
#define HVCS_SCHED_READ 0x00000001
|
||||
|
|
|
@ -235,10 +235,10 @@ static int ipw_write_room(struct tty_struct *linux_tty)
|
|||
|
||||
/* FIXME: Exactly how is the tty object locked here .. */
|
||||
if (!tty)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
||||
if (!tty->port.count)
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
|
||||
room = IPWIRELESS_TX_QUEUE_SIZE - tty->tx_bytes_queued;
|
||||
if (room < 0)
|
||||
|
@ -596,13 +596,8 @@ int ipwireless_tty_init(void)
|
|||
|
||||
void ipwireless_tty_release(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = tty_unregister_driver(ipw_tty_driver);
|
||||
tty_unregister_driver(ipw_tty_driver);
|
||||
put_tty_driver(ipw_tty_driver);
|
||||
if (ret != 0)
|
||||
printk(KERN_ERR IPWIRELESS_PCCARD_NAME
|
||||
": tty_unregister_driver failed with code %d\n", ret);
|
||||
}
|
||||
|
||||
int ipwireless_tty_is_modem(struct ipw_tty *tty)
|
||||
|
|
1699
drivers/tty/isicom.c
1699
drivers/tty/isicom.c
File diff suppressed because it is too large
Load Diff
|
@ -1118,9 +1118,7 @@ static void __exit moxa_exit(void)
|
|||
|
||||
del_timer_sync(&moxaTimer);
|
||||
|
||||
if (tty_unregister_driver(moxaDriver))
|
||||
printk(KERN_ERR "Couldn't unregister MOXA Intellio family "
|
||||
"serial driver\n");
|
||||
tty_unregister_driver(moxaDriver);
|
||||
put_tty_driver(moxaDriver);
|
||||
}
|
||||
|
||||
|
|
|
@ -2416,27 +2416,24 @@ static void gsmld_receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
|||
char *fp, int count)
|
||||
{
|
||||
struct gsm_mux *gsm = tty->disc_data;
|
||||
const unsigned char *dp;
|
||||
char *f;
|
||||
int i;
|
||||
char flags = TTY_NORMAL;
|
||||
|
||||
if (debug & 4)
|
||||
print_hex_dump_bytes("gsmld_receive: ", DUMP_PREFIX_OFFSET,
|
||||
cp, count);
|
||||
|
||||
for (i = count, dp = cp, f = fp; i; i--, dp++) {
|
||||
if (f)
|
||||
flags = *f++;
|
||||
for (; count; count--, cp++) {
|
||||
if (fp)
|
||||
flags = *fp++;
|
||||
switch (flags) {
|
||||
case TTY_NORMAL:
|
||||
gsm->receive(gsm, *dp);
|
||||
gsm->receive(gsm, *cp);
|
||||
break;
|
||||
case TTY_OVERRUN:
|
||||
case TTY_BREAK:
|
||||
case TTY_PARITY:
|
||||
case TTY_FRAME:
|
||||
gsm_error(gsm, *dp, flags);
|
||||
gsm_error(gsm, *cp, flags);
|
||||
break;
|
||||
default:
|
||||
WARN_ONCE(1, "%s: unknown flag %d\n",
|
||||
|
@ -2849,7 +2846,6 @@ static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc)
|
|||
/* Line discipline for real tty */
|
||||
static struct tty_ldisc_ops tty_ldisc_packet = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "n_gsm",
|
||||
.open = gsmld_open,
|
||||
.close = gsmld_close,
|
||||
|
@ -3052,7 +3048,7 @@ static int gsmtty_write_room(struct tty_struct *tty)
|
|||
{
|
||||
struct gsm_dlci *dlci = tty->driver_data;
|
||||
if (dlci->state == DLCI_CLOSED)
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
return TX_SIZE - kfifo_len(&dlci->fifo);
|
||||
}
|
||||
|
||||
|
@ -3060,7 +3056,7 @@ static int gsmtty_chars_in_buffer(struct tty_struct *tty)
|
|||
{
|
||||
struct gsm_dlci *dlci = tty->driver_data;
|
||||
if (dlci->state == DLCI_CLOSED)
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
return kfifo_len(&dlci->fifo);
|
||||
}
|
||||
|
||||
|
|
|
@ -787,7 +787,6 @@ static struct n_hdlc_buf *n_hdlc_buf_get(struct n_hdlc_buf_list *buf_list)
|
|||
|
||||
static struct tty_ldisc_ops n_hdlc_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "hdlc",
|
||||
.open = n_hdlc_tty_open,
|
||||
.close = n_hdlc_tty_close,
|
||||
|
|
|
@ -40,7 +40,6 @@ static void n_null_receivebuf(struct tty_struct *tty,
|
|||
|
||||
static struct tty_ldisc_ops null_ldisc = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "n_null",
|
||||
.open = n_null_open,
|
||||
.close = n_null_close,
|
||||
|
|
|
@ -146,7 +146,6 @@ static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
|||
|
||||
static struct tty_ldisc_ops tty_ldisc_N_R3964 = {
|
||||
.owner = THIS_MODULE,
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "R3964",
|
||||
.open = r3964_open,
|
||||
.close = r3964_close,
|
||||
|
|
|
@ -2488,7 +2488,7 @@ static int n_tty_ioctl(struct tty_struct *tty, struct file *file,
|
|||
}
|
||||
|
||||
static struct tty_ldisc_ops n_tty_ops = {
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.owner = THIS_MODULE,
|
||||
.name = "n_tty",
|
||||
.open = n_tty_open,
|
||||
.close = n_tty_close,
|
||||
|
|
|
@ -47,9 +47,6 @@
|
|||
|
||||
#include <linux/delay.h>
|
||||
|
||||
|
||||
#define VERSION_STRING DRIVER_DESC " 2.1d"
|
||||
|
||||
/* Default debug printout level */
|
||||
#define NOZOMI_DEBUG_LEVEL 0x00
|
||||
static int debug = NOZOMI_DEBUG_LEVEL;
|
||||
|
@ -89,7 +86,6 @@ do { \
|
|||
/* Defines */
|
||||
#define NOZOMI_NAME "nozomi"
|
||||
#define NOZOMI_NAME_TTY "nozomi_tty"
|
||||
#define DRIVER_DESC "Nozomi driver"
|
||||
|
||||
#define NTTY_TTY_MAXMINORS 256
|
||||
#define NTTY_FIFO_BUFFER_SIZE 8192
|
||||
|
@ -359,12 +355,6 @@ struct nozomi {
|
|||
u32 open_ttys;
|
||||
};
|
||||
|
||||
/* This is a data packet that is read or written to/from card */
|
||||
struct buffer {
|
||||
u32 size; /* size is the length of the data buffer */
|
||||
u8 *data;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Global variables */
|
||||
static const struct pci_device_id nozomi_pci_tbl[] = {
|
||||
{PCI_DEVICE(0x1931, 0x000c)}, /* Nozomi HSDPA */
|
||||
|
@ -787,7 +777,6 @@ static int receive_data(enum port_type index, struct nozomi *dc)
|
|||
int i, ret;
|
||||
|
||||
size = __le32_to_cpu(readl(addr));
|
||||
/* DBG1( "%d bytes port: %d", size, index); */
|
||||
|
||||
if (tty && tty_throttled(tty)) {
|
||||
DBG1("No room in tty, don't read data, don't ack interrupt, "
|
||||
|
@ -1318,8 +1307,6 @@ static int nozomi_card_init(struct pci_dev *pdev,
|
|||
int ndev_idx;
|
||||
int i;
|
||||
|
||||
dev_dbg(&pdev->dev, "Init, new card found\n");
|
||||
|
||||
for (ndev_idx = 0; ndev_idx < ARRAY_SIZE(ndevs); ndev_idx++)
|
||||
if (!ndevs[ndev_idx])
|
||||
break;
|
||||
|
@ -1453,8 +1440,6 @@ static void tty_exit(struct nozomi *dc)
|
|||
{
|
||||
unsigned int i;
|
||||
|
||||
DBG1(" ");
|
||||
|
||||
for (i = 0; i < MAX_PORT; ++i)
|
||||
tty_port_tty_hangup(&dc->port[i].port, false);
|
||||
|
||||
|
@ -1619,8 +1604,6 @@ static int ntty_write(struct tty_struct *tty, const unsigned char *buffer,
|
|||
struct port *port = tty->driver_data;
|
||||
unsigned long flags;
|
||||
|
||||
/* DBG1( "WRITEx: %d, index = %d", count, index); */
|
||||
|
||||
if (!dc || !port)
|
||||
return -ENODEV;
|
||||
|
||||
|
@ -1746,8 +1729,6 @@ static int ntty_ioctl(struct tty_struct *tty,
|
|||
struct port *port = tty->driver_data;
|
||||
int rval = -ENOIOCTLCMD;
|
||||
|
||||
DBG1("******** IOCTL, cmd: %d", cmd);
|
||||
|
||||
switch (cmd) {
|
||||
case TIOCMIWAIT: {
|
||||
struct async_icount cprev = port->tty_icount;
|
||||
|
@ -1773,7 +1754,6 @@ static void ntty_unthrottle(struct tty_struct *tty)
|
|||
struct nozomi *dc = get_dc_by_tty(tty);
|
||||
unsigned long flags;
|
||||
|
||||
DBG1("UNTHROTTLE");
|
||||
spin_lock_irqsave(&dc->spin_mutex, flags);
|
||||
enable_transmit_dl(tty->index % MAX_PORT, dc);
|
||||
set_rts(tty, 1);
|
||||
|
@ -1790,7 +1770,6 @@ static void ntty_throttle(struct tty_struct *tty)
|
|||
struct nozomi *dc = get_dc_by_tty(tty);
|
||||
unsigned long flags;
|
||||
|
||||
DBG1("THROTTLE");
|
||||
spin_lock_irqsave(&dc->spin_mutex, flags);
|
||||
set_rts(tty, 0);
|
||||
spin_unlock_irqrestore(&dc->spin_mutex, flags);
|
||||
|
@ -1847,8 +1826,6 @@ static __init int nozomi_init(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
printk(KERN_INFO "Initializing %s\n", VERSION_STRING);
|
||||
|
||||
ntty_driver = alloc_tty_driver(NTTY_TTY_MAXMINORS);
|
||||
if (!ntty_driver)
|
||||
return -ENOMEM;
|
||||
|
@ -1888,7 +1865,6 @@ free_tty:
|
|||
|
||||
static __exit void nozomi_exit(void)
|
||||
{
|
||||
printk(KERN_INFO "Unloading %s\n", DRIVER_DESC);
|
||||
pci_unregister_driver(&nozomi_driver);
|
||||
tty_unregister_driver(ntty_driver);
|
||||
put_tty_driver(ntty_driver);
|
||||
|
@ -1898,4 +1874,4 @@ module_init(nozomi_init);
|
|||
module_exit(nozomi_exit);
|
||||
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
MODULE_DESCRIPTION("Nozomi driver");
|
||||
|
|
3127
drivers/tty/rocket.c
3127
drivers/tty/rocket.c
File diff suppressed because it is too large
Load Diff
|
@ -1,111 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* rocket.h --- the exported interface of the rocket driver to its configuration program.
|
||||
*
|
||||
* Written by Theodore Ts'o, Copyright 1997.
|
||||
* Copyright 1997 Comtrol Corporation.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Model Information Struct */
|
||||
typedef struct {
|
||||
unsigned long model;
|
||||
char modelString[80];
|
||||
unsigned long numPorts;
|
||||
int loadrm2;
|
||||
int startingPortNumber;
|
||||
} rocketModel_t;
|
||||
|
||||
struct rocket_config {
|
||||
int line;
|
||||
int flags;
|
||||
int closing_wait;
|
||||
int close_delay;
|
||||
int port;
|
||||
int reserved[32];
|
||||
};
|
||||
|
||||
struct rocket_ports {
|
||||
int tty_major;
|
||||
int callout_major;
|
||||
rocketModel_t rocketModel[8];
|
||||
};
|
||||
|
||||
struct rocket_version {
|
||||
char rocket_version[32];
|
||||
char rocket_date[32];
|
||||
char reserved[64];
|
||||
};
|
||||
|
||||
/*
|
||||
* Rocketport flags
|
||||
*/
|
||||
/*#define ROCKET_CALLOUT_NOHUP 0x00000001 */
|
||||
#define ROCKET_FORCE_CD 0x00000002
|
||||
#define ROCKET_HUP_NOTIFY 0x00000004
|
||||
#define ROCKET_SPLIT_TERMIOS 0x00000008
|
||||
#define ROCKET_SPD_MASK 0x00000070
|
||||
#define ROCKET_SPD_HI 0x00000010 /* Use 57600 instead of 38400 bps */
|
||||
#define ROCKET_SPD_VHI 0x00000020 /* Use 115200 instead of 38400 bps */
|
||||
#define ROCKET_SPD_SHI 0x00000030 /* Use 230400 instead of 38400 bps */
|
||||
#define ROCKET_SPD_WARP 0x00000040 /* Use 460800 instead of 38400 bps */
|
||||
#define ROCKET_SAK 0x00000080
|
||||
#define ROCKET_SESSION_LOCKOUT 0x00000100
|
||||
#define ROCKET_PGRP_LOCKOUT 0x00000200
|
||||
#define ROCKET_RTS_TOGGLE 0x00000400
|
||||
#define ROCKET_MODE_MASK 0x00003000
|
||||
#define ROCKET_MODE_RS232 0x00000000
|
||||
#define ROCKET_MODE_RS485 0x00001000
|
||||
#define ROCKET_MODE_RS422 0x00002000
|
||||
#define ROCKET_FLAGS 0x00003FFF
|
||||
|
||||
#define ROCKET_USR_MASK 0x0071 /* Legal flags that non-privileged
|
||||
* users can set or reset */
|
||||
|
||||
/*
|
||||
* For closing_wait and closing_wait2
|
||||
*/
|
||||
#define ROCKET_CLOSING_WAIT_NONE ASYNC_CLOSING_WAIT_NONE
|
||||
#define ROCKET_CLOSING_WAIT_INF ASYNC_CLOSING_WAIT_INF
|
||||
|
||||
/*
|
||||
* Rocketport ioctls -- "RP"
|
||||
*/
|
||||
#define RCKP_GET_CONFIG 0x00525002
|
||||
#define RCKP_SET_CONFIG 0x00525003
|
||||
#define RCKP_GET_PORTS 0x00525004
|
||||
#define RCKP_RESET_RM2 0x00525005
|
||||
#define RCKP_GET_VERSION 0x00525006
|
||||
|
||||
/* Rocketport Models */
|
||||
#define MODEL_RP32INTF 0x0001 /* RP 32 port w/external I/F */
|
||||
#define MODEL_RP8INTF 0x0002 /* RP 8 port w/external I/F */
|
||||
#define MODEL_RP16INTF 0x0003 /* RP 16 port w/external I/F */
|
||||
#define MODEL_RP8OCTA 0x0005 /* RP 8 port w/octa cable */
|
||||
#define MODEL_RP4QUAD 0x0004 /* RP 4 port w/quad cable */
|
||||
#define MODEL_RP8J 0x0006 /* RP 8 port w/RJ11 connectors */
|
||||
#define MODEL_RP4J 0x0007 /* RP 4 port w/RJ45 connectors */
|
||||
#define MODEL_RP8SNI 0x0008 /* RP 8 port w/ DB78 SNI connector */
|
||||
#define MODEL_RP16SNI 0x0009 /* RP 16 port w/ DB78 SNI connector */
|
||||
#define MODEL_RPP4 0x000A /* RP Plus 4 port */
|
||||
#define MODEL_RPP8 0x000B /* RP Plus 8 port */
|
||||
#define MODEL_RP2_232 0x000E /* RP Plus 2 port RS232 */
|
||||
#define MODEL_RP2_422 0x000F /* RP Plus 2 port RS232 */
|
||||
|
||||
/* Rocketmodem II Models */
|
||||
#define MODEL_RP6M 0x000C /* RM 6 port */
|
||||
#define MODEL_RP4M 0x000D /* RM 4 port */
|
||||
|
||||
/* Universal PCI boards */
|
||||
#define MODEL_UPCI_RP32INTF 0x0801 /* RP UPCI 32 port w/external I/F */
|
||||
#define MODEL_UPCI_RP8INTF 0x0802 /* RP UPCI 8 port w/external I/F */
|
||||
#define MODEL_UPCI_RP16INTF 0x0803 /* RP UPCI 16 port w/external I/F */
|
||||
#define MODEL_UPCI_RP8OCTA 0x0805 /* RP UPCI 8 port w/octa cable */
|
||||
#define MODEL_UPCI_RM3_8PORT 0x080C /* RP UPCI Rocketmodem III 8 port */
|
||||
#define MODEL_UPCI_RM3_4PORT 0x080C /* RP UPCI Rocketmodem III 4 port */
|
||||
|
||||
/* Compact PCI 16 port */
|
||||
#define MODEL_CPCI_RP16INTF 0x0903 /* RP Compact PCI 16 port w/external I/F */
|
||||
|
||||
/* All ISA boards */
|
||||
#define MODEL_ISA 0x1000
|
File diff suppressed because it is too large
Load Diff
|
@ -354,7 +354,7 @@ static void setup_gpio(struct pci_dev *pcidev, u8 __iomem *p)
|
|||
|
||||
static void *
|
||||
__xr17v35x_register_gpio(struct pci_dev *pcidev,
|
||||
const struct property_entry *properties)
|
||||
const struct software_node *node)
|
||||
{
|
||||
struct platform_device *pdev;
|
||||
|
||||
|
@ -365,7 +365,7 @@ __xr17v35x_register_gpio(struct pci_dev *pcidev,
|
|||
pdev->dev.parent = &pcidev->dev;
|
||||
ACPI_COMPANION_SET(&pdev->dev, ACPI_COMPANION(&pcidev->dev));
|
||||
|
||||
if (platform_device_add_properties(pdev, properties) < 0 ||
|
||||
if (device_add_software_node(&pdev->dev, node) < 0 ||
|
||||
platform_device_add(pdev) < 0) {
|
||||
platform_device_put(pdev);
|
||||
return NULL;
|
||||
|
@ -380,12 +380,16 @@ static const struct property_entry exar_gpio_properties[] = {
|
|||
{ }
|
||||
};
|
||||
|
||||
static const struct software_node exar_gpio_node = {
|
||||
.properties = exar_gpio_properties,
|
||||
};
|
||||
|
||||
static int xr17v35x_register_gpio(struct pci_dev *pcidev,
|
||||
struct uart_8250_port *port)
|
||||
{
|
||||
if (pcidev->vendor == PCI_VENDOR_ID_EXAR)
|
||||
port->port.private_data =
|
||||
__xr17v35x_register_gpio(pcidev, exar_gpio_properties);
|
||||
__xr17v35x_register_gpio(pcidev, &exar_gpio_node);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -457,6 +461,10 @@ static const struct property_entry iot2040_gpio_properties[] = {
|
|||
{ }
|
||||
};
|
||||
|
||||
static const struct software_node iot2040_gpio_node = {
|
||||
.properties = iot2040_gpio_properties,
|
||||
};
|
||||
|
||||
static int iot2040_register_gpio(struct pci_dev *pcidev,
|
||||
struct uart_8250_port *port)
|
||||
{
|
||||
|
@ -468,7 +476,7 @@ static int iot2040_register_gpio(struct pci_dev *pcidev,
|
|||
writeb(IOT2040_UARTS_GPIO_HI_MODE, p + UART_EXAR_MPIOSEL_15_8);
|
||||
|
||||
port->port.private_data =
|
||||
__xr17v35x_register_gpio(pcidev, iot2040_gpio_properties);
|
||||
__xr17v35x_register_gpio(pcidev, &iot2040_gpio_node);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -547,6 +555,7 @@ static void pci_xr17v35x_exit(struct pci_dev *pcidev)
|
|||
struct uart_8250_port *port = serial8250_get_port(priv->line[0]);
|
||||
struct platform_device *pdev = port->port.private_data;
|
||||
|
||||
device_remove_software_node(&pdev->dev);
|
||||
platform_device_unregister(pdev);
|
||||
port->port.private_data = NULL;
|
||||
}
|
||||
|
|
|
@ -1466,13 +1466,11 @@ EXPORT_SYMBOL_GPL(serial8250_em485_stop_tx);
|
|||
|
||||
static enum hrtimer_restart serial8250_em485_handle_stop_tx(struct hrtimer *t)
|
||||
{
|
||||
struct uart_8250_em485 *em485;
|
||||
struct uart_8250_port *p;
|
||||
struct uart_8250_em485 *em485 = container_of(t, struct uart_8250_em485,
|
||||
stop_tx_timer);
|
||||
struct uart_8250_port *p = em485->port;
|
||||
unsigned long flags;
|
||||
|
||||
em485 = container_of(t, struct uart_8250_em485, stop_tx_timer);
|
||||
p = em485->port;
|
||||
|
||||
serial8250_rpm_get(p);
|
||||
spin_lock_irqsave(&p->port.lock, flags);
|
||||
if (em485->active_timer == &em485->stop_tx_timer) {
|
||||
|
@ -1482,16 +1480,13 @@ static enum hrtimer_restart serial8250_em485_handle_stop_tx(struct hrtimer *t)
|
|||
}
|
||||
spin_unlock_irqrestore(&p->port.lock, flags);
|
||||
serial8250_rpm_put(p);
|
||||
|
||||
return HRTIMER_NORESTART;
|
||||
}
|
||||
|
||||
static void start_hrtimer_ms(struct hrtimer *hrt, unsigned long msec)
|
||||
{
|
||||
long sec = msec / 1000;
|
||||
long nsec = (msec % 1000) * 1000000;
|
||||
ktime_t t = ktime_set(sec, nsec);
|
||||
|
||||
hrtimer_start(hrt, t, HRTIMER_MODE_REL);
|
||||
hrtimer_start(hrt, ms_to_ktime(msec), HRTIMER_MODE_REL);
|
||||
}
|
||||
|
||||
static void __stop_tx_rs485(struct uart_8250_port *p)
|
||||
|
@ -1633,19 +1628,18 @@ static inline void start_tx_rs485(struct uart_port *port)
|
|||
|
||||
static enum hrtimer_restart serial8250_em485_handle_start_tx(struct hrtimer *t)
|
||||
{
|
||||
struct uart_8250_em485 *em485;
|
||||
struct uart_8250_port *p;
|
||||
struct uart_8250_em485 *em485 = container_of(t, struct uart_8250_em485,
|
||||
start_tx_timer);
|
||||
struct uart_8250_port *p = em485->port;
|
||||
unsigned long flags;
|
||||
|
||||
em485 = container_of(t, struct uart_8250_em485, start_tx_timer);
|
||||
p = em485->port;
|
||||
|
||||
spin_lock_irqsave(&p->port.lock, flags);
|
||||
if (em485->active_timer == &em485->start_tx_timer) {
|
||||
__start_tx(&p->port);
|
||||
em485->active_timer = NULL;
|
||||
}
|
||||
spin_unlock_irqrestore(&p->port.lock, flags);
|
||||
|
||||
return HRTIMER_NORESTART;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,7 @@ config SERIAL_8250
|
|||
here are those that are setting up dedicated Ethernet WWW/FTP
|
||||
servers, or users that have one of the various bus mice instead of a
|
||||
serial mouse and don't intend to use their machine's standard serial
|
||||
port for anything. (Note that the Cyclades multi serial port driver
|
||||
does not need this driver built in for it to work.)
|
||||
port for anything.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called 8250.
|
||||
|
@ -226,7 +225,7 @@ config SERIAL_8250_MANY_PORTS
|
|||
serial port hardware which acts similar to standard serial port
|
||||
hardware. If you only use the standard COM 1/2/3/4 ports, you can
|
||||
say N here to save some memory. You can also say Y if you have an
|
||||
"intelligent" multiport card such as Cyclades, Digiboards, etc.
|
||||
"intelligent" multiport card such as Digiboards, etc.
|
||||
|
||||
#
|
||||
# Multi-port serial cards
|
||||
|
|
|
@ -456,11 +456,11 @@ static int simple_config(struct pcmcia_device *link)
|
|||
* its base address, then try to grab any standard serial port
|
||||
* address, and finally try to get any free port.
|
||||
*/
|
||||
if (!pcmcia_loop_config(link, simple_config_check_notpicky, NULL))
|
||||
goto found_port;
|
||||
|
||||
dev_warn(&link->dev, "no usable port range found, giving up\n");
|
||||
return -1;
|
||||
ret = pcmcia_loop_config(link, simple_config_check_notpicky, NULL);
|
||||
if (ret) {
|
||||
dev_warn(&link->dev, "no usable port range found, giving up\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
found_port:
|
||||
if (info->multi && (info->manfid == MANFID_3COM))
|
||||
|
@ -474,7 +474,7 @@ found_port:
|
|||
|
||||
ret = pcmcia_enable_device(link);
|
||||
if (ret != 0)
|
||||
return -1;
|
||||
return ret;
|
||||
return setup_serial(link, info, link->resource[0]->start, link->irq);
|
||||
}
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ config SERIAL_CLPS711X_CONSOLE
|
|||
|
||||
config SERIAL_SAMSUNG
|
||||
tristate "Samsung SoC serial support"
|
||||
depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST
|
||||
depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || ARCH_APPLE || COMPILE_TEST
|
||||
select SERIAL_CORE
|
||||
help
|
||||
Support for the on-chip UARTs on the Samsung S3C24XX series CPUs,
|
||||
|
@ -498,6 +498,7 @@ config SERIAL_IMX_EARLYCON
|
|||
bool "Earlycon on IMX serial port"
|
||||
depends on ARCH_MXC || COMPILE_TEST
|
||||
depends on OF
|
||||
select SERIAL_CORE
|
||||
select SERIAL_EARLYCON
|
||||
select SERIAL_CORE_CONSOLE
|
||||
default y if SERIAL_IMX_CONSOLE
|
||||
|
|
|
@ -394,11 +394,7 @@ static void imx_uart_rts_inactive(struct imx_port *sport, u32 *ucr2)
|
|||
|
||||
static void start_hrtimer_ms(struct hrtimer *hrt, unsigned long msec)
|
||||
{
|
||||
long sec = msec / MSEC_PER_SEC;
|
||||
long nsec = (msec % MSEC_PER_SEC) * 1000000;
|
||||
ktime_t t = ktime_set(sec, nsec);
|
||||
|
||||
hrtimer_start(hrt, t, HRTIMER_MODE_REL);
|
||||
hrtimer_start(hrt, ms_to_ktime(msec), HRTIMER_MODE_REL);
|
||||
}
|
||||
|
||||
/* called with port.lock taken and irqs off */
|
||||
|
|
|
@ -603,18 +603,22 @@ void jsm_input(struct jsm_channel *ch)
|
|||
|
||||
if (I_PARMRK(tp) || I_BRKINT(tp) || I_INPCK(tp)) {
|
||||
for (i = 0; i < s; i++) {
|
||||
u8 chr = ch->ch_rqueue[tail + i];
|
||||
u8 error = ch->ch_equeue[tail + i];
|
||||
char flag = TTY_NORMAL;
|
||||
|
||||
/*
|
||||
* Give the Linux ld the flags in the
|
||||
* format it likes.
|
||||
* Give the Linux ld the flags in the format it
|
||||
* likes.
|
||||
*/
|
||||
if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
|
||||
tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_BREAK);
|
||||
else if (*(ch->ch_equeue +tail +i) & UART_LSR_PE)
|
||||
tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_PARITY);
|
||||
else if (*(ch->ch_equeue +tail +i) & UART_LSR_FE)
|
||||
tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_FRAME);
|
||||
else
|
||||
tty_insert_flip_char(port, *(ch->ch_rqueue +tail +i), TTY_NORMAL);
|
||||
if (error & UART_LSR_BI)
|
||||
flag = TTY_BREAK;
|
||||
else if (error & UART_LSR_PE)
|
||||
flag = TTY_PARITY;
|
||||
else if (error & UART_LSR_FE)
|
||||
flag = TTY_FRAME;
|
||||
|
||||
tty_insert_flip_char(port, chr, flag);
|
||||
}
|
||||
} else {
|
||||
tty_insert_flip_string(port, ch->ch_rqueue + tail, s);
|
||||
|
|
|
@ -373,9 +373,7 @@ int kgdb_unregister_nmi_console(void)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = tty_unregister_driver(kgdb_nmi_tty_driver);
|
||||
if (ret)
|
||||
return ret;
|
||||
tty_unregister_driver(kgdb_nmi_tty_driver);
|
||||
put_tty_driver(kgdb_nmi_tty_driver);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -270,8 +270,8 @@ static int liteuart_probe(struct platform_device *pdev)
|
|||
|
||||
/* get membase */
|
||||
port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
|
||||
if (!port->membase)
|
||||
return -ENXIO;
|
||||
if (IS_ERR(port->membase))
|
||||
return PTR_ERR(port->membase);
|
||||
|
||||
/* values not from device tree */
|
||||
port->dev = &pdev->dev;
|
||||
|
|
|
@ -236,7 +236,6 @@ struct eg20t_port {
|
|||
void *rx_buf_virt;
|
||||
dma_addr_t rx_buf_dma;
|
||||
|
||||
struct dentry *debugfs;
|
||||
#define IRQ_NAME_SIZE 17
|
||||
char irq_name[IRQ_NAME_SIZE];
|
||||
|
||||
|
@ -1735,9 +1734,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
|
|||
int fifosize;
|
||||
int port_type;
|
||||
struct pch_uart_driver_data *board;
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
char name[32]; /* for debugfs file name */
|
||||
#endif
|
||||
char name[32];
|
||||
|
||||
board = &drv_dat[id->driver_data];
|
||||
port_type = board->port_type;
|
||||
|
@ -1813,11 +1810,9 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
|
|||
if (ret < 0)
|
||||
goto init_port_hal_free;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
snprintf(name, sizeof(name), "uart%d_regs", board->line_no);
|
||||
priv->debugfs = debugfs_create_file(name, S_IFREG | S_IRUGO,
|
||||
NULL, priv, &port_regs_ops);
|
||||
#endif
|
||||
snprintf(name, sizeof(name), "uart%d_regs", priv->port.line);
|
||||
debugfs_create_file(name, S_IFREG | S_IRUGO, NULL, priv,
|
||||
&port_regs_ops);
|
||||
|
||||
return priv;
|
||||
|
||||
|
@ -1835,10 +1830,10 @@ init_port_alloc_err:
|
|||
|
||||
static void pch_uart_exit_port(struct eg20t_port *priv)
|
||||
{
|
||||
char name[32];
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
debugfs_remove(priv->debugfs);
|
||||
#endif
|
||||
snprintf(name, sizeof(name), "uart%d_regs", priv->port.line);
|
||||
debugfs_remove(debugfs_lookup(name, NULL));
|
||||
uart_remove_one_port(&pch_uart_driver, &priv->port);
|
||||
free_page((unsigned long)priv->rxbuf.buf);
|
||||
}
|
||||
|
|
|
@ -56,9 +56,16 @@
|
|||
/* flag to ignore all characters coming in */
|
||||
#define RXSTAT_DUMMY_READ (0x10000000)
|
||||
|
||||
enum s3c24xx_port_type {
|
||||
TYPE_S3C24XX,
|
||||
TYPE_S3C6400,
|
||||
TYPE_APPLE_S5L,
|
||||
};
|
||||
|
||||
struct s3c24xx_uart_info {
|
||||
char *name;
|
||||
unsigned int type;
|
||||
enum s3c24xx_port_type type;
|
||||
unsigned int port_type;
|
||||
unsigned int fifosize;
|
||||
unsigned long rx_fifomask;
|
||||
unsigned long rx_fifoshift;
|
||||
|
@ -70,6 +77,7 @@ struct s3c24xx_uart_info {
|
|||
unsigned long num_clks;
|
||||
unsigned long clksel_mask;
|
||||
unsigned long clksel_shift;
|
||||
unsigned long ucon_mask;
|
||||
|
||||
/* uart port features */
|
||||
|
||||
|
@ -144,6 +152,8 @@ struct s3c24xx_uart_port {
|
|||
#endif
|
||||
};
|
||||
|
||||
static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport);
|
||||
|
||||
/* conversion functions */
|
||||
|
||||
#define s3c24xx_dev_to_port(__dev) dev_get_drvdata(__dev)
|
||||
|
@ -228,16 +238,6 @@ static int s3c24xx_serial_txempty_nofifo(struct uart_port *port)
|
|||
return rd_regl(port, S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE;
|
||||
}
|
||||
|
||||
/*
|
||||
* s3c64xx and later SoC's include the interrupt mask and status registers in
|
||||
* the controller itself, unlike the s3c24xx SoC's which have these registers
|
||||
* in the interrupt controller. Check if the port type is s3c64xx or higher.
|
||||
*/
|
||||
static int s3c24xx_serial_has_interrupt_mask(struct uart_port *port)
|
||||
{
|
||||
return to_ourport(port)->info->type == PORT_S3C6400;
|
||||
}
|
||||
|
||||
static void s3c24xx_serial_rx_enable(struct uart_port *port)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = to_ourport(port);
|
||||
|
@ -289,10 +289,17 @@ static void s3c24xx_serial_stop_tx(struct uart_port *port)
|
|||
if (!ourport->tx_enabled)
|
||||
return;
|
||||
|
||||
if (s3c24xx_serial_has_interrupt_mask(port))
|
||||
switch (ourport->info->type) {
|
||||
case TYPE_S3C6400:
|
||||
s3c24xx_set_bit(port, S3C64XX_UINTM_TXD, S3C64XX_UINTM);
|
||||
else
|
||||
break;
|
||||
case TYPE_APPLE_S5L:
|
||||
s3c24xx_clear_bit(port, APPLE_S5L_UCON_TXTHRESH_ENA, S3C2410_UCON);
|
||||
break;
|
||||
default:
|
||||
disable_irq_nosync(ourport->tx_irq);
|
||||
break;
|
||||
}
|
||||
|
||||
if (dma && dma->tx_chan && ourport->tx_in_progress == S3C24XX_TX_DMA) {
|
||||
dmaengine_pause(dma->tx_chan);
|
||||
|
@ -353,10 +360,17 @@ static void enable_tx_dma(struct s3c24xx_uart_port *ourport)
|
|||
u32 ucon;
|
||||
|
||||
/* Mask Tx interrupt */
|
||||
if (s3c24xx_serial_has_interrupt_mask(port))
|
||||
switch (ourport->info->type) {
|
||||
case TYPE_S3C6400:
|
||||
s3c24xx_set_bit(port, S3C64XX_UINTM_TXD, S3C64XX_UINTM);
|
||||
else
|
||||
break;
|
||||
case TYPE_APPLE_S5L:
|
||||
WARN_ON(1); // No DMA
|
||||
break;
|
||||
default:
|
||||
disable_irq_nosync(ourport->tx_irq);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Enable tx dma mode */
|
||||
ucon = rd_regl(port, S3C2410_UCON);
|
||||
|
@ -386,13 +400,28 @@ static void enable_tx_pio(struct s3c24xx_uart_port *ourport)
|
|||
wr_regl(port, S3C2410_UCON, ucon);
|
||||
|
||||
/* Unmask Tx interrupt */
|
||||
if (s3c24xx_serial_has_interrupt_mask(port))
|
||||
switch (ourport->info->type) {
|
||||
case TYPE_S3C6400:
|
||||
s3c24xx_clear_bit(port, S3C64XX_UINTM_TXD,
|
||||
S3C64XX_UINTM);
|
||||
else
|
||||
break;
|
||||
case TYPE_APPLE_S5L:
|
||||
ucon |= APPLE_S5L_UCON_TXTHRESH_ENA_MSK;
|
||||
wr_regl(port, S3C2410_UCON, ucon);
|
||||
break;
|
||||
default:
|
||||
enable_irq(ourport->tx_irq);
|
||||
break;
|
||||
}
|
||||
|
||||
ourport->tx_mode = S3C24XX_TX_PIO;
|
||||
|
||||
/*
|
||||
* The Apple version only has edge triggered TX IRQs, so we need
|
||||
* to kick off the process by sending some characters here.
|
||||
*/
|
||||
if (ourport->info->type == TYPE_APPLE_S5L)
|
||||
s3c24xx_serial_tx_chars(ourport);
|
||||
}
|
||||
|
||||
static void s3c24xx_serial_start_tx_pio(struct s3c24xx_uart_port *ourport)
|
||||
|
@ -513,11 +542,19 @@ static void s3c24xx_serial_stop_rx(struct uart_port *port)
|
|||
|
||||
if (ourport->rx_enabled) {
|
||||
dev_dbg(port->dev, "stopping rx\n");
|
||||
if (s3c24xx_serial_has_interrupt_mask(port))
|
||||
switch (ourport->info->type) {
|
||||
case TYPE_S3C6400:
|
||||
s3c24xx_set_bit(port, S3C64XX_UINTM_RXD,
|
||||
S3C64XX_UINTM);
|
||||
else
|
||||
break;
|
||||
case TYPE_APPLE_S5L:
|
||||
s3c24xx_clear_bit(port, APPLE_S5L_UCON_RXTHRESH_ENA, S3C2410_UCON);
|
||||
s3c24xx_clear_bit(port, APPLE_S5L_UCON_RXTO_ENA, S3C2410_UCON);
|
||||
break;
|
||||
default:
|
||||
disable_irq_nosync(ourport->rx_irq);
|
||||
break;
|
||||
}
|
||||
ourport->rx_enabled = 0;
|
||||
}
|
||||
if (dma && dma->rx_chan) {
|
||||
|
@ -651,14 +688,18 @@ static void enable_rx_pio(struct s3c24xx_uart_port *ourport)
|
|||
|
||||
/* set Rx mode to DMA mode */
|
||||
ucon = rd_regl(port, S3C2410_UCON);
|
||||
ucon &= ~(S3C64XX_UCON_TIMEOUT_MASK |
|
||||
S3C64XX_UCON_EMPTYINT_EN |
|
||||
S3C64XX_UCON_DMASUS_EN |
|
||||
S3C64XX_UCON_TIMEOUT_EN |
|
||||
S3C64XX_UCON_RXMODE_MASK);
|
||||
ucon |= 0xf << S3C64XX_UCON_TIMEOUT_SHIFT |
|
||||
S3C64XX_UCON_TIMEOUT_EN |
|
||||
S3C64XX_UCON_RXMODE_CPU;
|
||||
ucon &= ~S3C64XX_UCON_RXMODE_MASK;
|
||||
ucon |= S3C64XX_UCON_RXMODE_CPU;
|
||||
|
||||
/* Apple types use these bits for IRQ masks */
|
||||
if (ourport->info->type != TYPE_APPLE_S5L) {
|
||||
ucon &= ~(S3C64XX_UCON_TIMEOUT_MASK |
|
||||
S3C64XX_UCON_EMPTYINT_EN |
|
||||
S3C64XX_UCON_DMASUS_EN |
|
||||
S3C64XX_UCON_TIMEOUT_EN);
|
||||
ucon |= 0xf << S3C64XX_UCON_TIMEOUT_SHIFT |
|
||||
S3C64XX_UCON_TIMEOUT_EN;
|
||||
}
|
||||
wr_regl(port, S3C2410_UCON, ucon);
|
||||
|
||||
ourport->rx_mode = S3C24XX_RX_PIO;
|
||||
|
@ -814,7 +855,7 @@ static irqreturn_t s3c24xx_serial_rx_chars_pio(void *dev_id)
|
|||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static irqreturn_t s3c24xx_serial_rx_chars(int irq, void *dev_id)
|
||||
static irqreturn_t s3c24xx_serial_rx_irq(int irq, void *dev_id)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = dev_id;
|
||||
|
||||
|
@ -823,16 +864,12 @@ static irqreturn_t s3c24xx_serial_rx_chars(int irq, void *dev_id)
|
|||
return s3c24xx_serial_rx_chars_pio(dev_id);
|
||||
}
|
||||
|
||||
static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
|
||||
static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = id;
|
||||
struct uart_port *port = &ourport->port;
|
||||
struct circ_buf *xmit = &port->state->xmit;
|
||||
unsigned long flags;
|
||||
int count, dma_count = 0;
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
|
||||
count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
|
||||
|
||||
if (ourport->dma && ourport->dma->tx_chan &&
|
||||
|
@ -849,7 +886,7 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
|
|||
wr_reg(port, S3C2410_UTXH, port->x_char);
|
||||
port->icount.tx++;
|
||||
port->x_char = 0;
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
/* if there isn't anything more to transmit, or the uart is now
|
||||
|
@ -858,7 +895,7 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
|
|||
|
||||
if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
|
||||
s3c24xx_serial_stop_tx(port);
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
/* try and drain the buffer... */
|
||||
|
@ -880,7 +917,7 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
|
|||
|
||||
if (!count && dma_count) {
|
||||
s3c24xx_serial_start_tx_dma(ourport, dma_count);
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) {
|
||||
|
@ -891,8 +928,18 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
|
|||
|
||||
if (uart_circ_empty(xmit))
|
||||
s3c24xx_serial_stop_tx(port);
|
||||
}
|
||||
|
||||
static irqreturn_t s3c24xx_serial_tx_irq(int irq, void *id)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = id;
|
||||
struct uart_port *port = &ourport->port;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
|
||||
s3c24xx_serial_tx_chars(ourport);
|
||||
|
||||
out:
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
@ -906,16 +953,37 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
|
|||
irqreturn_t ret = IRQ_HANDLED;
|
||||
|
||||
if (pend & S3C64XX_UINTM_RXD_MSK) {
|
||||
ret = s3c24xx_serial_rx_chars(irq, id);
|
||||
ret = s3c24xx_serial_rx_irq(irq, id);
|
||||
wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_RXD_MSK);
|
||||
}
|
||||
if (pend & S3C64XX_UINTM_TXD_MSK) {
|
||||
ret = s3c24xx_serial_tx_chars(irq, id);
|
||||
ret = s3c24xx_serial_tx_irq(irq, id);
|
||||
wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_TXD_MSK);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* interrupt handler for Apple SoC's.*/
|
||||
static irqreturn_t apple_serial_handle_irq(int irq, void *id)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = id;
|
||||
struct uart_port *port = &ourport->port;
|
||||
unsigned int pend = rd_regl(port, S3C2410_UTRSTAT);
|
||||
irqreturn_t ret = IRQ_NONE;
|
||||
|
||||
if (pend & (APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO)) {
|
||||
wr_regl(port, S3C2410_UTRSTAT,
|
||||
APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO);
|
||||
ret = s3c24xx_serial_rx_irq(irq, id);
|
||||
}
|
||||
if (pend & APPLE_S5L_UTRSTAT_TXTHRESH) {
|
||||
wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_TXTHRESH);
|
||||
ret = s3c24xx_serial_tx_irq(irq, id);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port)
|
||||
{
|
||||
struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
|
||||
|
@ -1098,27 +1166,62 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
|
|||
struct s3c24xx_uart_port *ourport = to_ourport(port);
|
||||
|
||||
if (ourport->tx_claimed) {
|
||||
if (!s3c24xx_serial_has_interrupt_mask(port))
|
||||
free_irq(ourport->tx_irq, ourport);
|
||||
free_irq(ourport->tx_irq, ourport);
|
||||
ourport->tx_enabled = 0;
|
||||
ourport->tx_claimed = 0;
|
||||
ourport->tx_mode = 0;
|
||||
}
|
||||
|
||||
if (ourport->rx_claimed) {
|
||||
if (!s3c24xx_serial_has_interrupt_mask(port))
|
||||
free_irq(ourport->rx_irq, ourport);
|
||||
free_irq(ourport->rx_irq, ourport);
|
||||
ourport->rx_claimed = 0;
|
||||
ourport->rx_enabled = 0;
|
||||
}
|
||||
|
||||
/* Clear pending interrupts and mask all interrupts */
|
||||
if (s3c24xx_serial_has_interrupt_mask(port)) {
|
||||
free_irq(port->irq, ourport);
|
||||
if (ourport->dma)
|
||||
s3c24xx_serial_release_dma(ourport);
|
||||
|
||||
wr_regl(port, S3C64XX_UINTP, 0xf);
|
||||
wr_regl(port, S3C64XX_UINTM, 0xf);
|
||||
}
|
||||
ourport->tx_in_progress = 0;
|
||||
}
|
||||
|
||||
static void s3c64xx_serial_shutdown(struct uart_port *port)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = to_ourport(port);
|
||||
|
||||
ourport->tx_enabled = 0;
|
||||
ourport->tx_mode = 0;
|
||||
ourport->rx_enabled = 0;
|
||||
|
||||
free_irq(port->irq, ourport);
|
||||
|
||||
wr_regl(port, S3C64XX_UINTP, 0xf);
|
||||
wr_regl(port, S3C64XX_UINTM, 0xf);
|
||||
|
||||
if (ourport->dma)
|
||||
s3c24xx_serial_release_dma(ourport);
|
||||
|
||||
ourport->tx_in_progress = 0;
|
||||
}
|
||||
|
||||
static void apple_s5l_serial_shutdown(struct uart_port *port)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = to_ourport(port);
|
||||
|
||||
unsigned int ucon;
|
||||
|
||||
ucon = rd_regl(port, S3C2410_UCON);
|
||||
ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK |
|
||||
APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
|
||||
APPLE_S5L_UCON_RXTO_ENA_MSK);
|
||||
wr_regl(port, S3C2410_UCON, ucon);
|
||||
|
||||
wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_ALL_FLAGS);
|
||||
|
||||
free_irq(port->irq, ourport);
|
||||
|
||||
ourport->tx_enabled = 0;
|
||||
ourport->tx_mode = 0;
|
||||
ourport->rx_enabled = 0;
|
||||
|
||||
if (ourport->dma)
|
||||
s3c24xx_serial_release_dma(ourport);
|
||||
|
@ -1133,7 +1236,7 @@ static int s3c24xx_serial_startup(struct uart_port *port)
|
|||
|
||||
ourport->rx_enabled = 1;
|
||||
|
||||
ret = request_irq(ourport->rx_irq, s3c24xx_serial_rx_chars, 0,
|
||||
ret = request_irq(ourport->rx_irq, s3c24xx_serial_rx_irq, 0,
|
||||
s3c24xx_serial_portname(port), ourport);
|
||||
|
||||
if (ret != 0) {
|
||||
|
@ -1147,7 +1250,7 @@ static int s3c24xx_serial_startup(struct uart_port *port)
|
|||
|
||||
ourport->tx_enabled = 1;
|
||||
|
||||
ret = request_irq(ourport->tx_irq, s3c24xx_serial_tx_chars, 0,
|
||||
ret = request_irq(ourport->tx_irq, s3c24xx_serial_tx_irq, 0,
|
||||
s3c24xx_serial_portname(port), ourport);
|
||||
|
||||
if (ret) {
|
||||
|
@ -1193,9 +1296,7 @@ static int s3c64xx_serial_startup(struct uart_port *port)
|
|||
|
||||
/* For compatibility with s3c24xx Soc's */
|
||||
ourport->rx_enabled = 1;
|
||||
ourport->rx_claimed = 1;
|
||||
ourport->tx_enabled = 0;
|
||||
ourport->tx_claimed = 1;
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
|
||||
|
@ -1215,6 +1316,45 @@ static int s3c64xx_serial_startup(struct uart_port *port)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int apple_s5l_serial_startup(struct uart_port *port)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = to_ourport(port);
|
||||
unsigned long flags;
|
||||
unsigned int ufcon;
|
||||
int ret;
|
||||
|
||||
wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_ALL_FLAGS);
|
||||
|
||||
ret = request_irq(port->irq, apple_serial_handle_irq, 0,
|
||||
s3c24xx_serial_portname(port), ourport);
|
||||
if (ret) {
|
||||
dev_err(port->dev, "cannot get irq %d\n", port->irq);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* For compatibility with s3c24xx Soc's */
|
||||
ourport->rx_enabled = 1;
|
||||
ourport->tx_enabled = 0;
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
|
||||
ufcon = rd_regl(port, S3C2410_UFCON);
|
||||
ufcon |= S3C2410_UFCON_RESETRX | S5PV210_UFCON_RXTRIG8;
|
||||
if (!uart_console(port))
|
||||
ufcon |= S3C2410_UFCON_RESETTX;
|
||||
wr_regl(port, S3C2410_UFCON, ufcon);
|
||||
|
||||
enable_rx_pio(ourport);
|
||||
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
|
||||
/* Enable Rx Interrupt */
|
||||
s3c24xx_set_bit(port, APPLE_S5L_UCON_RXTHRESH_ENA, S3C2410_UCON);
|
||||
s3c24xx_set_bit(port, APPLE_S5L_UCON_RXTO_ENA, S3C2410_UCON);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* power power management control */
|
||||
|
||||
static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
|
||||
|
@ -1535,41 +1675,26 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
|
|||
|
||||
static const char *s3c24xx_serial_type(struct uart_port *port)
|
||||
{
|
||||
switch (port->type) {
|
||||
case PORT_S3C2410:
|
||||
return "S3C2410";
|
||||
case PORT_S3C2440:
|
||||
return "S3C2440";
|
||||
case PORT_S3C2412:
|
||||
return "S3C2412";
|
||||
case PORT_S3C6400:
|
||||
struct s3c24xx_uart_port *ourport = to_ourport(port);
|
||||
|
||||
switch (ourport->info->type) {
|
||||
case TYPE_S3C24XX:
|
||||
return "S3C24XX";
|
||||
case TYPE_S3C6400:
|
||||
return "S3C6400/10";
|
||||
case TYPE_APPLE_S5L:
|
||||
return "APPLE S5L";
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#define MAP_SIZE (0x100)
|
||||
|
||||
static void s3c24xx_serial_release_port(struct uart_port *port)
|
||||
{
|
||||
release_mem_region(port->mapbase, MAP_SIZE);
|
||||
}
|
||||
|
||||
static int s3c24xx_serial_request_port(struct uart_port *port)
|
||||
{
|
||||
const char *name = s3c24xx_serial_portname(port);
|
||||
|
||||
return request_mem_region(port->mapbase, MAP_SIZE, name) ? 0 : -EBUSY;
|
||||
}
|
||||
|
||||
static void s3c24xx_serial_config_port(struct uart_port *port, int flags)
|
||||
{
|
||||
struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
|
||||
|
||||
if (flags & UART_CONFIG_TYPE &&
|
||||
s3c24xx_serial_request_port(port) == 0)
|
||||
port->type = info->type;
|
||||
if (flags & UART_CONFIG_TYPE)
|
||||
port->type = info->port_type;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1580,7 +1705,7 @@ s3c24xx_serial_verify_port(struct uart_port *port, struct serial_struct *ser)
|
|||
{
|
||||
struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
|
||||
|
||||
if (ser->type != PORT_UNKNOWN && ser->type != info->type)
|
||||
if (ser->type != PORT_UNKNOWN && ser->type != info->port_type)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
|
@ -1608,7 +1733,7 @@ static void s3c24xx_serial_put_poll_char(struct uart_port *port,
|
|||
unsigned char c);
|
||||
#endif
|
||||
|
||||
static struct uart_ops s3c24xx_serial_ops = {
|
||||
static const struct uart_ops s3c24xx_serial_ops = {
|
||||
.pm = s3c24xx_serial_pm,
|
||||
.tx_empty = s3c24xx_serial_tx_empty,
|
||||
.get_mctrl = s3c24xx_serial_get_mctrl,
|
||||
|
@ -1621,8 +1746,48 @@ static struct uart_ops s3c24xx_serial_ops = {
|
|||
.shutdown = s3c24xx_serial_shutdown,
|
||||
.set_termios = s3c24xx_serial_set_termios,
|
||||
.type = s3c24xx_serial_type,
|
||||
.release_port = s3c24xx_serial_release_port,
|
||||
.request_port = s3c24xx_serial_request_port,
|
||||
.config_port = s3c24xx_serial_config_port,
|
||||
.verify_port = s3c24xx_serial_verify_port,
|
||||
#if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE) && defined(CONFIG_CONSOLE_POLL)
|
||||
.poll_get_char = s3c24xx_serial_get_poll_char,
|
||||
.poll_put_char = s3c24xx_serial_put_poll_char,
|
||||
#endif
|
||||
};
|
||||
|
||||
static const struct uart_ops s3c64xx_serial_ops = {
|
||||
.pm = s3c24xx_serial_pm,
|
||||
.tx_empty = s3c24xx_serial_tx_empty,
|
||||
.get_mctrl = s3c24xx_serial_get_mctrl,
|
||||
.set_mctrl = s3c24xx_serial_set_mctrl,
|
||||
.stop_tx = s3c24xx_serial_stop_tx,
|
||||
.start_tx = s3c24xx_serial_start_tx,
|
||||
.stop_rx = s3c24xx_serial_stop_rx,
|
||||
.break_ctl = s3c24xx_serial_break_ctl,
|
||||
.startup = s3c64xx_serial_startup,
|
||||
.shutdown = s3c64xx_serial_shutdown,
|
||||
.set_termios = s3c24xx_serial_set_termios,
|
||||
.type = s3c24xx_serial_type,
|
||||
.config_port = s3c24xx_serial_config_port,
|
||||
.verify_port = s3c24xx_serial_verify_port,
|
||||
#if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE) && defined(CONFIG_CONSOLE_POLL)
|
||||
.poll_get_char = s3c24xx_serial_get_poll_char,
|
||||
.poll_put_char = s3c24xx_serial_put_poll_char,
|
||||
#endif
|
||||
};
|
||||
|
||||
static const struct uart_ops apple_s5l_serial_ops = {
|
||||
.pm = s3c24xx_serial_pm,
|
||||
.tx_empty = s3c24xx_serial_tx_empty,
|
||||
.get_mctrl = s3c24xx_serial_get_mctrl,
|
||||
.set_mctrl = s3c24xx_serial_set_mctrl,
|
||||
.stop_tx = s3c24xx_serial_stop_tx,
|
||||
.start_tx = s3c24xx_serial_start_tx,
|
||||
.stop_rx = s3c24xx_serial_stop_rx,
|
||||
.break_ctl = s3c24xx_serial_break_ctl,
|
||||
.startup = apple_s5l_serial_startup,
|
||||
.shutdown = apple_s5l_serial_shutdown,
|
||||
.set_termios = s3c24xx_serial_set_termios,
|
||||
.type = s3c24xx_serial_type,
|
||||
.config_port = s3c24xx_serial_config_port,
|
||||
.verify_port = s3c24xx_serial_verify_port,
|
||||
#if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE) && defined(CONFIG_CONSOLE_POLL)
|
||||
|
@ -1706,14 +1871,9 @@ static void s3c24xx_serial_resetport(struct uart_port *port,
|
|||
{
|
||||
struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
|
||||
unsigned long ucon = rd_regl(port, S3C2410_UCON);
|
||||
unsigned int ucon_mask;
|
||||
|
||||
ucon_mask = info->clksel_mask;
|
||||
if (info->type == PORT_S3C2440)
|
||||
ucon_mask |= S3C2440_UCON0_DIVMASK;
|
||||
|
||||
ucon &= ucon_mask;
|
||||
wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
|
||||
ucon &= (info->clksel_mask | info->ucon_mask);
|
||||
wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
|
||||
|
||||
/* reset both fifos */
|
||||
wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
|
||||
|
@ -1868,10 +2028,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
|
|||
/* setup info for port */
|
||||
port->dev = &platdev->dev;
|
||||
|
||||
/* Startup sequence is different for s3c64xx and higher SoC's */
|
||||
if (s3c24xx_serial_has_interrupt_mask(port))
|
||||
s3c24xx_serial_ops.startup = s3c64xx_serial_startup;
|
||||
|
||||
port->uartclk = 1;
|
||||
|
||||
if (cfg->uart_flags & UPF_CONS_FLOW) {
|
||||
|
@ -1889,8 +2045,8 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
|
|||
|
||||
dev_dbg(port->dev, "resource %pR)\n", res);
|
||||
|
||||
port->membase = devm_ioremap(port->dev, res->start, resource_size(res));
|
||||
if (!port->membase) {
|
||||
port->membase = devm_ioremap_resource(port->dev, res);
|
||||
if (IS_ERR(port->membase)) {
|
||||
dev_err(port->dev, "failed to remap controller address\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
@ -1905,11 +2061,16 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
|
|||
ourport->tx_irq = ret + 1;
|
||||
}
|
||||
|
||||
if (!s3c24xx_serial_has_interrupt_mask(port)) {
|
||||
switch (ourport->info->type) {
|
||||
case TYPE_S3C24XX:
|
||||
ret = platform_get_irq(platdev, 1);
|
||||
if (ret > 0)
|
||||
ourport->tx_irq = ret;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* DMA is currently supported only on DT platforms, if DMA properties
|
||||
* are specified.
|
||||
|
@ -1945,10 +2106,26 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
|
|||
pr_warn("uart: failed to enable baudclk\n");
|
||||
|
||||
/* Keep all interrupts masked and cleared */
|
||||
if (s3c24xx_serial_has_interrupt_mask(port)) {
|
||||
switch (ourport->info->type) {
|
||||
case TYPE_S3C6400:
|
||||
wr_regl(port, S3C64XX_UINTM, 0xf);
|
||||
wr_regl(port, S3C64XX_UINTP, 0xf);
|
||||
wr_regl(port, S3C64XX_UINTSP, 0xf);
|
||||
break;
|
||||
case TYPE_APPLE_S5L: {
|
||||
unsigned int ucon;
|
||||
|
||||
ucon = rd_regl(port, S3C2410_UCON);
|
||||
ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK |
|
||||
APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
|
||||
APPLE_S5L_UCON_RXTO_ENA_MSK);
|
||||
wr_regl(port, S3C2410_UCON, ucon);
|
||||
|
||||
wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_ALL_FLAGS);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
dev_dbg(port->dev, "port: map=%pa, mem=%p, irq=%d (%d,%d), clock=%u\n",
|
||||
|
@ -2019,6 +2196,18 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
|
|||
dev_get_platdata(&pdev->dev) :
|
||||
ourport->drv_data->def_cfg;
|
||||
|
||||
switch (ourport->info->type) {
|
||||
case TYPE_S3C24XX:
|
||||
ourport->port.ops = &s3c24xx_serial_ops;
|
||||
break;
|
||||
case TYPE_S3C6400:
|
||||
ourport->port.ops = &s3c64xx_serial_ops;
|
||||
break;
|
||||
case TYPE_APPLE_S5L:
|
||||
ourport->port.ops = &apple_s5l_serial_ops;
|
||||
break;
|
||||
}
|
||||
|
||||
if (np) {
|
||||
of_property_read_u32(np,
|
||||
"samsung,uart-fifosize", &ourport->port.fifosize);
|
||||
|
@ -2142,7 +2331,8 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)
|
|||
|
||||
if (port) {
|
||||
/* restore IRQ mask */
|
||||
if (s3c24xx_serial_has_interrupt_mask(port)) {
|
||||
switch (ourport->info->type) {
|
||||
case TYPE_S3C6400: {
|
||||
unsigned int uintm = 0xf;
|
||||
|
||||
if (ourport->tx_enabled)
|
||||
|
@ -2156,6 +2346,47 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)
|
|||
if (!IS_ERR(ourport->baudclk))
|
||||
clk_disable_unprepare(ourport->baudclk);
|
||||
clk_disable_unprepare(ourport->clk);
|
||||
break;
|
||||
}
|
||||
case TYPE_APPLE_S5L: {
|
||||
unsigned int ucon;
|
||||
int ret;
|
||||
|
||||
ret = clk_prepare_enable(ourport->clk);
|
||||
if (ret) {
|
||||
dev_err(dev, "clk_enable clk failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
if (!IS_ERR(ourport->baudclk)) {
|
||||
ret = clk_prepare_enable(ourport->baudclk);
|
||||
if (ret) {
|
||||
dev_err(dev, "clk_enable baudclk failed: %d\n", ret);
|
||||
clk_disable_unprepare(ourport->clk);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ucon = rd_regl(port, S3C2410_UCON);
|
||||
|
||||
ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK |
|
||||
APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
|
||||
APPLE_S5L_UCON_RXTO_ENA_MSK);
|
||||
|
||||
if (ourport->tx_enabled)
|
||||
ucon |= APPLE_S5L_UCON_TXTHRESH_ENA_MSK;
|
||||
if (ourport->rx_enabled)
|
||||
ucon |= APPLE_S5L_UCON_RXTHRESH_ENA_MSK |
|
||||
APPLE_S5L_UCON_RXTO_ENA_MSK;
|
||||
|
||||
wr_regl(port, S3C2410_UCON, ucon);
|
||||
|
||||
if (!IS_ERR(ourport->baudclk))
|
||||
clk_disable_unprepare(ourport->baudclk);
|
||||
clk_disable_unprepare(ourport->clk);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2380,7 +2611,8 @@ static struct console s3c24xx_serial_console = {
|
|||
static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
|
||||
.info = &(struct s3c24xx_uart_info) {
|
||||
.name = "Samsung S3C2410 UART",
|
||||
.type = PORT_S3C2410,
|
||||
.type = TYPE_S3C24XX,
|
||||
.port_type = PORT_S3C2410,
|
||||
.fifosize = 16,
|
||||
.rx_fifomask = S3C2410_UFSTAT_RXMASK,
|
||||
.rx_fifoshift = S3C2410_UFSTAT_RXSHIFT,
|
||||
|
@ -2407,7 +2639,8 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
|
|||
static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
|
||||
.info = &(struct s3c24xx_uart_info) {
|
||||
.name = "Samsung S3C2412 UART",
|
||||
.type = PORT_S3C2412,
|
||||
.type = TYPE_S3C24XX,
|
||||
.port_type = PORT_S3C2412,
|
||||
.fifosize = 64,
|
||||
.has_divslot = 1,
|
||||
.rx_fifomask = S3C2440_UFSTAT_RXMASK,
|
||||
|
@ -2436,7 +2669,8 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
|
|||
static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
|
||||
.info = &(struct s3c24xx_uart_info) {
|
||||
.name = "Samsung S3C2440 UART",
|
||||
.type = PORT_S3C2440,
|
||||
.type = TYPE_S3C24XX,
|
||||
.port_type = PORT_S3C2440,
|
||||
.fifosize = 64,
|
||||
.has_divslot = 1,
|
||||
.rx_fifomask = S3C2440_UFSTAT_RXMASK,
|
||||
|
@ -2449,6 +2683,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
|
|||
.num_clks = 4,
|
||||
.clksel_mask = S3C2412_UCON_CLKMASK,
|
||||
.clksel_shift = S3C2412_UCON_CLKSHIFT,
|
||||
.ucon_mask = S3C2440_UCON0_DIVMASK,
|
||||
},
|
||||
.def_cfg = &(struct s3c2410_uartcfg) {
|
||||
.ucon = S3C2410_UCON_DEFAULT,
|
||||
|
@ -2464,7 +2699,8 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
|
|||
static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
|
||||
.info = &(struct s3c24xx_uart_info) {
|
||||
.name = "Samsung S3C6400 UART",
|
||||
.type = PORT_S3C6400,
|
||||
.type = TYPE_S3C6400,
|
||||
.port_type = PORT_S3C6400,
|
||||
.fifosize = 64,
|
||||
.has_divslot = 1,
|
||||
.rx_fifomask = S3C2440_UFSTAT_RXMASK,
|
||||
|
@ -2492,7 +2728,8 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
|
|||
static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
|
||||
.info = &(struct s3c24xx_uart_info) {
|
||||
.name = "Samsung S5PV210 UART",
|
||||
.type = PORT_S3C6400,
|
||||
.type = TYPE_S3C6400,
|
||||
.port_type = PORT_S3C6400,
|
||||
.has_divslot = 1,
|
||||
.rx_fifomask = S5PV210_UFSTAT_RXMASK,
|
||||
.rx_fifoshift = S5PV210_UFSTAT_RXSHIFT,
|
||||
|
@ -2520,7 +2757,8 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
|
|||
#define EXYNOS_COMMON_SERIAL_DRV_DATA \
|
||||
.info = &(struct s3c24xx_uart_info) { \
|
||||
.name = "Samsung Exynos UART", \
|
||||
.type = PORT_S3C6400, \
|
||||
.type = TYPE_S3C6400, \
|
||||
.port_type = PORT_S3C6400, \
|
||||
.has_divslot = 1, \
|
||||
.rx_fifomask = S5PV210_UFSTAT_RXMASK, \
|
||||
.rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \
|
||||
|
@ -2556,6 +2794,34 @@ static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = {
|
|||
#define EXYNOS5433_SERIAL_DRV_DATA (kernel_ulong_t)NULL
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_APPLE
|
||||
static struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
|
||||
.info = &(struct s3c24xx_uart_info) {
|
||||
.name = "Apple S5L UART",
|
||||
.type = TYPE_APPLE_S5L,
|
||||
.port_type = PORT_8250,
|
||||
.fifosize = 16,
|
||||
.rx_fifomask = S3C2410_UFSTAT_RXMASK,
|
||||
.rx_fifoshift = S3C2410_UFSTAT_RXSHIFT,
|
||||
.rx_fifofull = S3C2410_UFSTAT_RXFULL,
|
||||
.tx_fifofull = S3C2410_UFSTAT_TXFULL,
|
||||
.tx_fifomask = S3C2410_UFSTAT_TXMASK,
|
||||
.tx_fifoshift = S3C2410_UFSTAT_TXSHIFT,
|
||||
.def_clk_sel = S3C2410_UCON_CLKSEL0,
|
||||
.num_clks = 1,
|
||||
.clksel_mask = 0,
|
||||
.clksel_shift = 0,
|
||||
},
|
||||
.def_cfg = &(struct s3c2410_uartcfg) {
|
||||
.ucon = APPLE_S5L_UCON_DEFAULT,
|
||||
.ufcon = S3C2410_UFCON_DEFAULT,
|
||||
},
|
||||
};
|
||||
#define S5L_SERIAL_DRV_DATA ((kernel_ulong_t)&s5l_serial_drv_data)
|
||||
#else
|
||||
#define S5L_SERIAL_DRV_DATA ((kernel_ulong_t)NULL)
|
||||
#endif
|
||||
|
||||
static const struct platform_device_id s3c24xx_serial_driver_ids[] = {
|
||||
{
|
||||
.name = "s3c2410-uart",
|
||||
|
@ -2578,6 +2844,9 @@ static const struct platform_device_id s3c24xx_serial_driver_ids[] = {
|
|||
}, {
|
||||
.name = "exynos5433-uart",
|
||||
.driver_data = EXYNOS5433_SERIAL_DRV_DATA,
|
||||
}, {
|
||||
.name = "s5l-uart",
|
||||
.driver_data = S5L_SERIAL_DRV_DATA,
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
@ -2599,6 +2868,8 @@ static const struct of_device_id s3c24xx_uart_dt_match[] = {
|
|||
.data = (void *)EXYNOS4210_SERIAL_DRV_DATA },
|
||||
{ .compatible = "samsung,exynos5433-uart",
|
||||
.data = (void *)EXYNOS5433_SERIAL_DRV_DATA },
|
||||
{ .compatible = "apple,s5l-uart",
|
||||
.data = (void *)S5L_SERIAL_DRV_DATA },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match);
|
||||
|
@ -2730,6 +3001,23 @@ OF_EARLYCON_DECLARE(s5pv210, "samsung,s5pv210-uart",
|
|||
s5pv210_early_console_setup);
|
||||
OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart",
|
||||
s5pv210_early_console_setup);
|
||||
|
||||
/* Apple S5L */
|
||||
static int __init apple_s5l_early_console_setup(struct earlycon_device *device,
|
||||
const char *opt)
|
||||
{
|
||||
/* Close enough to S3C2410 for earlycon... */
|
||||
device->port.private_data = &s3c2410_early_console_data;
|
||||
|
||||
#ifdef CONFIG_ARM64
|
||||
/* ... but we need to override the existing fixmap entry as nGnRnE */
|
||||
__set_fixmap(FIX_EARLYCON_MEM_BASE, device->port.mapbase,
|
||||
__pgprot(PROT_DEVICE_nGnRnE));
|
||||
#endif
|
||||
return samsung_early_console_setup(device, opt);
|
||||
}
|
||||
|
||||
OF_EARLYCON_DECLARE(s5l, "apple,s5l-uart", apple_s5l_early_console_setup);
|
||||
#endif
|
||||
|
||||
MODULE_ALIAS("platform:samsung-uart");
|
||||
|
|
|
@ -137,37 +137,14 @@ MODULE_PARM_DESC(maxframe, "Maximum frame size used by device (4096 to 65535)");
|
|||
*/
|
||||
static struct tty_driver *serial_driver;
|
||||
|
||||
static int open(struct tty_struct *tty, struct file * filp);
|
||||
static void close(struct tty_struct *tty, struct file * filp);
|
||||
static void hangup(struct tty_struct *tty);
|
||||
static void set_termios(struct tty_struct *tty, struct ktermios *old_termios);
|
||||
|
||||
static int write(struct tty_struct *tty, const unsigned char *buf, int count);
|
||||
static int put_char(struct tty_struct *tty, unsigned char ch);
|
||||
static void send_xchar(struct tty_struct *tty, char ch);
|
||||
static void wait_until_sent(struct tty_struct *tty, int timeout);
|
||||
static int write_room(struct tty_struct *tty);
|
||||
static void flush_chars(struct tty_struct *tty);
|
||||
static void flush_buffer(struct tty_struct *tty);
|
||||
static void tx_hold(struct tty_struct *tty);
|
||||
static void tx_release(struct tty_struct *tty);
|
||||
|
||||
static int ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
|
||||
static int chars_in_buffer(struct tty_struct *tty);
|
||||
static void throttle(struct tty_struct * tty);
|
||||
static void unthrottle(struct tty_struct * tty);
|
||||
static int set_break(struct tty_struct *tty, int break_state);
|
||||
|
||||
/*
|
||||
* generic HDLC support and callbacks
|
||||
* generic HDLC support
|
||||
*/
|
||||
#if SYNCLINK_GENERIC_HDLC
|
||||
#define dev_to_port(D) (dev_to_hdlc(D)->priv)
|
||||
static void hdlcdev_tx_done(struct slgt_info *info);
|
||||
static void hdlcdev_rx(struct slgt_info *info, char *buf, int size);
|
||||
static int hdlcdev_init(struct slgt_info *info);
|
||||
static void hdlcdev_exit(struct slgt_info *info);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -186,9 +163,6 @@ struct cond_wait {
|
|||
wait_queue_entry_t wait;
|
||||
unsigned int data;
|
||||
};
|
||||
static void init_cond_wait(struct cond_wait *w, unsigned int data);
|
||||
static void add_cond_wait(struct cond_wait **head, struct cond_wait *w);
|
||||
static void remove_cond_wait(struct cond_wait **head, struct cond_wait *w);
|
||||
static void flush_cond_wait(struct cond_wait **head);
|
||||
|
||||
/*
|
||||
|
@ -443,12 +417,8 @@ static void shutdown(struct slgt_info *info);
|
|||
static void program_hw(struct slgt_info *info);
|
||||
static void change_params(struct slgt_info *info);
|
||||
|
||||
static int register_test(struct slgt_info *info);
|
||||
static int irq_test(struct slgt_info *info);
|
||||
static int loopback_test(struct slgt_info *info);
|
||||
static int adapter_test(struct slgt_info *info);
|
||||
|
||||
static void reset_adapter(struct slgt_info *info);
|
||||
static void reset_port(struct slgt_info *info);
|
||||
static void async_mode(struct slgt_info *info);
|
||||
static void sync_mode(struct slgt_info *info);
|
||||
|
@ -457,14 +427,12 @@ static void rx_stop(struct slgt_info *info);
|
|||
static void rx_start(struct slgt_info *info);
|
||||
static void reset_rbufs(struct slgt_info *info);
|
||||
static void free_rbufs(struct slgt_info *info, unsigned int first, unsigned int last);
|
||||
static void rdma_reset(struct slgt_info *info);
|
||||
static bool rx_get_frame(struct slgt_info *info);
|
||||
static bool rx_get_buf(struct slgt_info *info);
|
||||
|
||||
static void tx_start(struct slgt_info *info);
|
||||
static void tx_stop(struct slgt_info *info);
|
||||
static void tx_set_idle(struct slgt_info *info);
|
||||
static unsigned int free_tbuf_count(struct slgt_info *info);
|
||||
static unsigned int tbuf_bytes(struct slgt_info *info);
|
||||
static void reset_tbufs(struct slgt_info *info);
|
||||
static void tdma_reset(struct slgt_info *info);
|
||||
|
@ -472,26 +440,10 @@ static bool tx_load(struct slgt_info *info, const char *buf, unsigned int count)
|
|||
|
||||
static void get_signals(struct slgt_info *info);
|
||||
static void set_signals(struct slgt_info *info);
|
||||
static void enable_loopback(struct slgt_info *info);
|
||||
static void set_rate(struct slgt_info *info, u32 data_rate);
|
||||
|
||||
static int bh_action(struct slgt_info *info);
|
||||
static void bh_handler(struct work_struct *work);
|
||||
static void bh_transmit(struct slgt_info *info);
|
||||
static void isr_serial(struct slgt_info *info);
|
||||
static void isr_rdma(struct slgt_info *info);
|
||||
static void isr_txeom(struct slgt_info *info, unsigned short status);
|
||||
static void isr_tdma(struct slgt_info *info);
|
||||
|
||||
static int alloc_dma_bufs(struct slgt_info *info);
|
||||
static void free_dma_bufs(struct slgt_info *info);
|
||||
static int alloc_desc(struct slgt_info *info);
|
||||
static void free_desc(struct slgt_info *info);
|
||||
static int alloc_bufs(struct slgt_info *info, struct slgt_desc *bufs, int count);
|
||||
static void free_bufs(struct slgt_info *info, struct slgt_desc *bufs, int count);
|
||||
|
||||
static int alloc_tmp_rbuf(struct slgt_info *info);
|
||||
static void free_tmp_rbuf(struct slgt_info *info);
|
||||
|
||||
static void tx_timeout(struct timer_list *t);
|
||||
static void rx_timeout(struct timer_list *t);
|
||||
|
@ -509,10 +461,6 @@ static int tx_abort(struct slgt_info *info);
|
|||
static int rx_enable(struct slgt_info *info, int enable);
|
||||
static int modem_input_wait(struct slgt_info *info,int arg);
|
||||
static int wait_mgsl_event(struct slgt_info *info, int __user *mask_ptr);
|
||||
static int tiocmget(struct tty_struct *tty);
|
||||
static int tiocmset(struct tty_struct *tty,
|
||||
unsigned int set, unsigned int clear);
|
||||
static int set_break(struct tty_struct *tty, int break_state);
|
||||
static int get_interface(struct slgt_info *info, int __user *if_mode);
|
||||
static int set_interface(struct slgt_info *info, int if_mode);
|
||||
static int set_gpio(struct slgt_info *info, struct gpio_desc __user *gpio);
|
||||
|
@ -526,9 +474,6 @@ static int set_xctrl(struct slgt_info *info, int if_mode);
|
|||
/*
|
||||
* driver functions
|
||||
*/
|
||||
static void add_device(struct slgt_info *info);
|
||||
static void device_init(int adapter_num, struct pci_dev *pdev);
|
||||
static int claim_resources(struct slgt_info *info);
|
||||
static void release_resources(struct slgt_info *info);
|
||||
|
||||
/*
|
||||
|
@ -3705,7 +3650,6 @@ static const struct tty_operations ops = {
|
|||
|
||||
static void slgt_cleanup(void)
|
||||
{
|
||||
int rc;
|
||||
struct slgt_info *info;
|
||||
struct slgt_info *tmp;
|
||||
|
||||
|
@ -3714,9 +3658,7 @@ static void slgt_cleanup(void)
|
|||
if (serial_driver) {
|
||||
for (info=slgt_device_list ; info != NULL ; info=info->next_device)
|
||||
tty_unregister_device(serial_driver, info->line);
|
||||
rc = tty_unregister_driver(serial_driver);
|
||||
if (rc)
|
||||
DBGERR(("tty_unregister_driver error=%d\n", rc));
|
||||
tty_unregister_driver(serial_driver);
|
||||
put_tty_driver(serial_driver);
|
||||
}
|
||||
|
||||
|
|
|
@ -1195,8 +1195,6 @@ int tty_send_xchar(struct tty_struct *tty, char ch)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static char ptychar[] = "pqrstuvwxyzabcde";
|
||||
|
||||
/**
|
||||
* pty_line_name - generate name for a pty
|
||||
* @driver: the tty driver in use
|
||||
|
@ -1210,6 +1208,7 @@ static char ptychar[] = "pqrstuvwxyzabcde";
|
|||
*/
|
||||
static void pty_line_name(struct tty_driver *driver, int index, char *p)
|
||||
{
|
||||
static const char ptychar[] = "pqrstuvwxyzabcde";
|
||||
int i = index + driver->name_base;
|
||||
/* ->name is initialized to "ttyp", but "tty" is expected */
|
||||
sprintf(p, "%s%c%x",
|
||||
|
@ -3524,21 +3523,14 @@ EXPORT_SYMBOL(tty_register_driver);
|
|||
/*
|
||||
* Called by a tty driver to unregister itself.
|
||||
*/
|
||||
int tty_unregister_driver(struct tty_driver *driver)
|
||||
void tty_unregister_driver(struct tty_driver *driver)
|
||||
{
|
||||
#if 0
|
||||
/* FIXME */
|
||||
if (driver->refcount)
|
||||
return -EBUSY;
|
||||
#endif
|
||||
unregister_chrdev_region(MKDEV(driver->major, driver->minor_start),
|
||||
driver->num);
|
||||
mutex_lock(&tty_mutex);
|
||||
list_del(&driver->tty_drivers);
|
||||
mutex_unlock(&tty_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(tty_unregister_driver);
|
||||
|
||||
dev_t tty_devnum(struct tty_struct *tty)
|
||||
|
|
|
@ -57,8 +57,7 @@ int tty_chars_in_buffer(struct tty_struct *tty)
|
|||
{
|
||||
if (tty->ops->chars_in_buffer)
|
||||
return tty->ops->chars_in_buffer(tty);
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(tty_chars_in_buffer);
|
||||
|
||||
|
|
|
@ -14,16 +14,9 @@
|
|||
#include <asm/vio.h>
|
||||
#include <asm/ldc.h>
|
||||
|
||||
#define DRV_MODULE_NAME "vcc"
|
||||
#define DRV_MODULE_VERSION "1.1"
|
||||
#define DRV_MODULE_RELDATE "July 1, 2017"
|
||||
|
||||
static char version[] =
|
||||
DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")";
|
||||
|
||||
MODULE_DESCRIPTION("Sun LDOM virtual console concentrator driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(DRV_MODULE_VERSION);
|
||||
MODULE_VERSION("1.1");
|
||||
|
||||
struct vcc_port {
|
||||
struct vio_driver_state vio;
|
||||
|
@ -59,16 +52,14 @@ struct vcc_port {
|
|||
#define VCC_CTL_BREAK -1
|
||||
#define VCC_CTL_HUP -2
|
||||
|
||||
static const char vcc_driver_name[] = "vcc";
|
||||
static const char vcc_device_node[] = "vcc";
|
||||
static struct tty_driver *vcc_tty_driver;
|
||||
|
||||
static struct vcc_port *vcc_table[VCC_MAX_PORTS];
|
||||
static DEFINE_SPINLOCK(vcc_table_lock);
|
||||
|
||||
int vcc_dbg;
|
||||
int vcc_dbg_ldc;
|
||||
int vcc_dbg_vio;
|
||||
static unsigned int vcc_dbg;
|
||||
static unsigned int vcc_dbg_ldc;
|
||||
static unsigned int vcc_dbg_vio;
|
||||
|
||||
module_param(vcc_dbg, uint, 0664);
|
||||
module_param(vcc_dbg_ldc, uint, 0664);
|
||||
|
@ -735,11 +726,6 @@ static int vcc_open(struct tty_struct *tty, struct file *vcc_file)
|
|||
{
|
||||
struct vcc_port *port;
|
||||
|
||||
if (unlikely(!tty)) {
|
||||
pr_err("VCC: open: Invalid TTY handle\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
if (tty->count > 1)
|
||||
return -EBUSY;
|
||||
|
||||
|
@ -773,11 +759,6 @@ static int vcc_open(struct tty_struct *tty, struct file *vcc_file)
|
|||
|
||||
static void vcc_close(struct tty_struct *tty, struct file *vcc_file)
|
||||
{
|
||||
if (unlikely(!tty)) {
|
||||
pr_err("VCC: close: Invalid TTY handle\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (unlikely(tty->count > 1))
|
||||
return;
|
||||
|
||||
|
@ -805,11 +786,6 @@ static void vcc_hangup(struct tty_struct *tty)
|
|||
{
|
||||
struct vcc_port *port;
|
||||
|
||||
if (unlikely(!tty)) {
|
||||
pr_err("VCC: hangup: Invalid TTY handle\n");
|
||||
return;
|
||||
}
|
||||
|
||||
port = vcc_get_ne(tty->index);
|
||||
if (unlikely(!port)) {
|
||||
pr_err("VCC: hangup: Failed to find VCC port\n");
|
||||
|
@ -839,11 +815,6 @@ static int vcc_write(struct tty_struct *tty, const unsigned char *buf,
|
|||
int tosend = 0;
|
||||
int rv = -EINVAL;
|
||||
|
||||
if (unlikely(!tty)) {
|
||||
pr_err("VCC: write: Invalid TTY handle\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
port = vcc_get_ne(tty->index);
|
||||
if (unlikely(!port)) {
|
||||
pr_err("VCC: write: Failed to find VCC port");
|
||||
|
@ -904,15 +875,10 @@ static int vcc_write_room(struct tty_struct *tty)
|
|||
struct vcc_port *port;
|
||||
u64 num;
|
||||
|
||||
if (unlikely(!tty)) {
|
||||
pr_err("VCC: write_room: Invalid TTY handle\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
port = vcc_get_ne(tty->index);
|
||||
if (unlikely(!port)) {
|
||||
pr_err("VCC: write_room: Failed to find VCC port\n");
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
}
|
||||
|
||||
num = VCC_BUFF_LEN - port->chars_in_buffer;
|
||||
|
@ -927,15 +893,10 @@ static int vcc_chars_in_buffer(struct tty_struct *tty)
|
|||
struct vcc_port *port;
|
||||
u64 num;
|
||||
|
||||
if (unlikely(!tty)) {
|
||||
pr_err("VCC: chars_in_buffer: Invalid TTY handle\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
port = vcc_get_ne(tty->index);
|
||||
if (unlikely(!port)) {
|
||||
pr_err("VCC: chars_in_buffer: Failed to find VCC port\n");
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
}
|
||||
|
||||
num = port->chars_in_buffer;
|
||||
|
@ -950,11 +911,6 @@ static int vcc_break_ctl(struct tty_struct *tty, int state)
|
|||
struct vcc_port *port;
|
||||
unsigned long flags;
|
||||
|
||||
if (unlikely(!tty)) {
|
||||
pr_err("VCC: break_ctl: Invalid TTY handle\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
port = vcc_get_ne(tty->index);
|
||||
if (unlikely(!port)) {
|
||||
pr_err("VCC: break_ctl: Failed to find VCC port\n");
|
||||
|
@ -985,11 +941,6 @@ static int vcc_install(struct tty_driver *driver, struct tty_struct *tty)
|
|||
struct tty_port *port_tty;
|
||||
int ret;
|
||||
|
||||
if (unlikely(!tty)) {
|
||||
pr_err("VCC: install: Invalid TTY handle\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
if (tty->index >= VCC_MAX_PORTS)
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -1024,11 +975,6 @@ static void vcc_cleanup(struct tty_struct *tty)
|
|||
{
|
||||
struct vcc_port *port;
|
||||
|
||||
if (unlikely(!tty)) {
|
||||
pr_err("VCC: cleanup: Invalid TTY handle\n");
|
||||
return;
|
||||
}
|
||||
|
||||
port = vcc_get(tty->index, true);
|
||||
if (port) {
|
||||
port->tty = NULL;
|
||||
|
@ -1066,16 +1012,14 @@ static int vcc_tty_init(void)
|
|||
{
|
||||
int rv;
|
||||
|
||||
pr_info("VCC: %s\n", version);
|
||||
|
||||
vcc_tty_driver = tty_alloc_driver(VCC_MAX_PORTS, VCC_TTY_FLAGS);
|
||||
if (IS_ERR(vcc_tty_driver)) {
|
||||
pr_err("VCC: TTY driver alloc failed\n");
|
||||
return PTR_ERR(vcc_tty_driver);
|
||||
}
|
||||
|
||||
vcc_tty_driver->driver_name = vcc_driver_name;
|
||||
vcc_tty_driver->name = vcc_device_node;
|
||||
vcc_tty_driver->driver_name = "vcc";
|
||||
vcc_tty_driver->name = "vcc";
|
||||
|
||||
vcc_tty_driver->minor_start = VCC_MINOR_START;
|
||||
vcc_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
|
||||
|
|
|
@ -1042,7 +1042,7 @@ static int mos7720_write_room(struct tty_struct *tty)
|
|||
|
||||
mos7720_port = usb_get_serial_port_data(port);
|
||||
if (mos7720_port == NULL)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
||||
/* FIXME: Locking */
|
||||
for (i = 0; i < NUM_URBS; ++i) {
|
||||
|
|
|
@ -96,7 +96,7 @@ static bool vga_is_gfx;
|
|||
static bool vga_512_chars;
|
||||
static int vga_video_font_height;
|
||||
static int vga_scan_lines __read_mostly;
|
||||
static unsigned int vga_rolled_over;
|
||||
static unsigned int vga_rolled_over; /* last vc_origin offset before wrap */
|
||||
|
||||
static bool vgacon_text_mode_force;
|
||||
static bool vga_hardscroll_enabled;
|
||||
|
|
|
@ -1,364 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/* $Revision: 3.0 $$Date: 1998/11/02 14:20:59 $
|
||||
* linux/include/linux/cyclades.h
|
||||
*
|
||||
* This file was initially written by
|
||||
* Randolph Bentson <bentson@grieg.seaslug.org> and is maintained by
|
||||
* Ivan Passos <ivan@cyclades.com>.
|
||||
*
|
||||
* This file contains the general definitions for the cyclades.c driver
|
||||
*$Log: cyclades.h,v $
|
||||
*Revision 3.1 2002/01/29 11:36:16 henrique
|
||||
*added throttle field on struct cyclades_port to indicate whether the
|
||||
*port is throttled or not
|
||||
*
|
||||
*Revision 3.1 2000/04/19 18:52:52 ivan
|
||||
*converted address fields to unsigned long and added fields for physical
|
||||
*addresses on cyclades_card structure;
|
||||
*
|
||||
*Revision 3.0 1998/11/02 14:20:59 ivan
|
||||
*added nports field on cyclades_card structure;
|
||||
*
|
||||
*Revision 2.5 1998/08/03 16:57:01 ivan
|
||||
*added cyclades_idle_stats structure;
|
||||
*
|
||||
*Revision 2.4 1998/06/01 12:09:53 ivan
|
||||
*removed closing_wait2 from cyclades_port structure;
|
||||
*
|
||||
*Revision 2.3 1998/03/16 18:01:12 ivan
|
||||
*changes in the cyclades_port structure to get it closer to the
|
||||
*standard serial port structure;
|
||||
*added constants for new ioctls;
|
||||
*
|
||||
*Revision 2.2 1998/02/17 16:50:00 ivan
|
||||
*changes in the cyclades_port structure (addition of shutdown_wait and
|
||||
*chip_rev variables);
|
||||
*added constants for new ioctls and for CD1400 rev. numbers.
|
||||
*
|
||||
*Revision 2.1 1997/10/24 16:03:00 ivan
|
||||
*added rflow (which allows enabling the CD1400 special flow control
|
||||
*feature) and rtsdtr_inv (which allows DTR/RTS pin inversion) to
|
||||
*cyclades_port structure;
|
||||
*added Alpha support
|
||||
*
|
||||
*Revision 2.0 1997/06/30 10:30:00 ivan
|
||||
*added some new doorbell command constants related to IOCTLW and
|
||||
*UART error signaling
|
||||
*
|
||||
*Revision 1.8 1997/06/03 15:30:00 ivan
|
||||
*added constant ZFIRM_HLT
|
||||
*added constant CyPCI_Ze_win ( = 2 * Cy_PCI_Zwin)
|
||||
*
|
||||
*Revision 1.7 1997/03/26 10:30:00 daniel
|
||||
*new entries at the end of cyclades_port struct to reallocate
|
||||
*variables illegally allocated within card memory.
|
||||
*
|
||||
*Revision 1.6 1996/09/09 18:35:30 bentson
|
||||
*fold in changes for Cyclom-Z -- including structures for
|
||||
*communicating with board as well modest changes to original
|
||||
*structures to support new features.
|
||||
*
|
||||
*Revision 1.5 1995/11/13 21:13:31 bentson
|
||||
*changes suggested by Michael Chastain <mec@duracef.shout.net>
|
||||
*to support use of this file in non-kernel applications
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef _LINUX_CYCLADES_H
|
||||
#define _LINUX_CYCLADES_H
|
||||
|
||||
#include <uapi/linux/cyclades.h>
|
||||
|
||||
|
||||
/* Per card data structure */
|
||||
struct cyclades_card {
|
||||
void __iomem *base_addr;
|
||||
union {
|
||||
void __iomem *p9050;
|
||||
struct RUNTIME_9060 __iomem *p9060;
|
||||
} ctl_addr;
|
||||
struct BOARD_CTRL __iomem *board_ctrl; /* cyz specific */
|
||||
int irq;
|
||||
unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
|
||||
unsigned int first_line; /* minor number of first channel on card */
|
||||
unsigned int nports; /* Number of ports in the card */
|
||||
int bus_index; /* address shift - 0 for ISA, 1 for PCI */
|
||||
int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */
|
||||
u32 hw_ver;
|
||||
spinlock_t card_lock;
|
||||
struct cyclades_port *ports;
|
||||
};
|
||||
|
||||
/***************************************
|
||||
* Memory access functions/macros *
|
||||
* (required to support Alpha systems) *
|
||||
***************************************/
|
||||
|
||||
#define cy_writeb(port,val) do { writeb((val), (port)); mb(); } while (0)
|
||||
#define cy_writew(port,val) do { writew((val), (port)); mb(); } while (0)
|
||||
#define cy_writel(port,val) do { writel((val), (port)); mb(); } while (0)
|
||||
|
||||
/*
|
||||
* Statistics counters
|
||||
*/
|
||||
struct cyclades_icount {
|
||||
__u32 cts, dsr, rng, dcd, tx, rx;
|
||||
__u32 frame, parity, overrun, brk;
|
||||
__u32 buf_overrun;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is our internal structure for each serial port's state.
|
||||
*
|
||||
* Many fields are paralleled by the structure used by the serial_struct
|
||||
* structure.
|
||||
*
|
||||
* For definitions of the flags field, see tty.h
|
||||
*/
|
||||
|
||||
struct cyclades_port {
|
||||
int magic;
|
||||
struct tty_port port;
|
||||
struct cyclades_card *card;
|
||||
union {
|
||||
struct {
|
||||
void __iomem *base_addr;
|
||||
} cyy;
|
||||
struct {
|
||||
struct CH_CTRL __iomem *ch_ctrl;
|
||||
struct BUF_CTRL __iomem *buf_ctrl;
|
||||
} cyz;
|
||||
} u;
|
||||
int line;
|
||||
int flags; /* defined in tty.h */
|
||||
int type; /* UART type */
|
||||
int read_status_mask;
|
||||
int ignore_status_mask;
|
||||
int timeout;
|
||||
int xmit_fifo_size;
|
||||
int cor1,cor2,cor3,cor4,cor5;
|
||||
int tbpr,tco,rbpr,rco;
|
||||
int baud;
|
||||
int rflow;
|
||||
int rtsdtr_inv;
|
||||
int chip_rev;
|
||||
int custom_divisor;
|
||||
u8 x_char; /* to be pushed out ASAP */
|
||||
int breakon;
|
||||
int breakoff;
|
||||
int xmit_head;
|
||||
int xmit_tail;
|
||||
int xmit_cnt;
|
||||
int default_threshold;
|
||||
int default_timeout;
|
||||
unsigned long rflush_count;
|
||||
struct cyclades_monitor mon;
|
||||
struct cyclades_idle_stats idle_stats;
|
||||
struct cyclades_icount icount;
|
||||
struct completion shutdown_wait;
|
||||
int throttle;
|
||||
#ifdef CONFIG_CYZ_INTR
|
||||
struct timer_list rx_full_timer;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define CLOSING_WAIT_DELAY 30*HZ
|
||||
#define CY_CLOSING_WAIT_NONE ASYNC_CLOSING_WAIT_NONE
|
||||
#define CY_CLOSING_WAIT_INF ASYNC_CLOSING_WAIT_INF
|
||||
|
||||
|
||||
#define CyMAX_CHIPS_PER_CARD 8
|
||||
#define CyMAX_CHAR_FIFO 12
|
||||
#define CyPORTS_PER_CHIP 4
|
||||
#define CD1400_MAX_SPEED 115200
|
||||
|
||||
#define CyISA_Ywin 0x2000
|
||||
|
||||
#define CyPCI_Ywin 0x4000
|
||||
#define CyPCI_Yctl 0x80
|
||||
#define CyPCI_Zctl CTRL_WINDOW_SIZE
|
||||
#define CyPCI_Zwin 0x80000
|
||||
#define CyPCI_Ze_win (2 * CyPCI_Zwin)
|
||||
|
||||
#define PCI_DEVICE_ID_MASK 0x06
|
||||
|
||||
/**** CD1400 registers ****/
|
||||
|
||||
#define CD1400_REV_G 0x46
|
||||
#define CD1400_REV_J 0x48
|
||||
|
||||
#define CyRegSize 0x0400
|
||||
#define Cy_HwReset 0x1400
|
||||
#define Cy_ClrIntr 0x1800
|
||||
#define Cy_EpldRev 0x1e00
|
||||
|
||||
/* Global Registers */
|
||||
|
||||
#define CyGFRCR (0x40*2)
|
||||
#define CyRevE (44)
|
||||
#define CyCAR (0x68*2)
|
||||
#define CyCHAN_0 (0x00)
|
||||
#define CyCHAN_1 (0x01)
|
||||
#define CyCHAN_2 (0x02)
|
||||
#define CyCHAN_3 (0x03)
|
||||
#define CyGCR (0x4B*2)
|
||||
#define CyCH0_SERIAL (0x00)
|
||||
#define CyCH0_PARALLEL (0x80)
|
||||
#define CySVRR (0x67*2)
|
||||
#define CySRModem (0x04)
|
||||
#define CySRTransmit (0x02)
|
||||
#define CySRReceive (0x01)
|
||||
#define CyRICR (0x44*2)
|
||||
#define CyTICR (0x45*2)
|
||||
#define CyMICR (0x46*2)
|
||||
#define CyICR0 (0x00)
|
||||
#define CyICR1 (0x01)
|
||||
#define CyICR2 (0x02)
|
||||
#define CyICR3 (0x03)
|
||||
#define CyRIR (0x6B*2)
|
||||
#define CyTIR (0x6A*2)
|
||||
#define CyMIR (0x69*2)
|
||||
#define CyIRDirEq (0x80)
|
||||
#define CyIRBusy (0x40)
|
||||
#define CyIRUnfair (0x20)
|
||||
#define CyIRContext (0x1C)
|
||||
#define CyIRChannel (0x03)
|
||||
#define CyPPR (0x7E*2)
|
||||
#define CyCLOCK_20_1MS (0x27)
|
||||
#define CyCLOCK_25_1MS (0x31)
|
||||
#define CyCLOCK_25_5MS (0xf4)
|
||||
#define CyCLOCK_60_1MS (0x75)
|
||||
#define CyCLOCK_60_2MS (0xea)
|
||||
|
||||
/* Virtual Registers */
|
||||
|
||||
#define CyRIVR (0x43*2)
|
||||
#define CyTIVR (0x42*2)
|
||||
#define CyMIVR (0x41*2)
|
||||
#define CyIVRMask (0x07)
|
||||
#define CyIVRRxEx (0x07)
|
||||
#define CyIVRRxOK (0x03)
|
||||
#define CyIVRTxOK (0x02)
|
||||
#define CyIVRMdmOK (0x01)
|
||||
#define CyTDR (0x63*2)
|
||||
#define CyRDSR (0x62*2)
|
||||
#define CyTIMEOUT (0x80)
|
||||
#define CySPECHAR (0x70)
|
||||
#define CyBREAK (0x08)
|
||||
#define CyPARITY (0x04)
|
||||
#define CyFRAME (0x02)
|
||||
#define CyOVERRUN (0x01)
|
||||
#define CyMISR (0x4C*2)
|
||||
/* see CyMCOR_ and CyMSVR_ for bits*/
|
||||
#define CyEOSRR (0x60*2)
|
||||
|
||||
/* Channel Registers */
|
||||
|
||||
#define CyLIVR (0x18*2)
|
||||
#define CyMscsr (0x01)
|
||||
#define CyTdsr (0x02)
|
||||
#define CyRgdsr (0x03)
|
||||
#define CyRedsr (0x07)
|
||||
#define CyCCR (0x05*2)
|
||||
/* Format 1 */
|
||||
#define CyCHAN_RESET (0x80)
|
||||
#define CyCHIP_RESET (0x81)
|
||||
#define CyFlushTransFIFO (0x82)
|
||||
/* Format 2 */
|
||||
#define CyCOR_CHANGE (0x40)
|
||||
#define CyCOR1ch (0x02)
|
||||
#define CyCOR2ch (0x04)
|
||||
#define CyCOR3ch (0x08)
|
||||
/* Format 3 */
|
||||
#define CySEND_SPEC_1 (0x21)
|
||||
#define CySEND_SPEC_2 (0x22)
|
||||
#define CySEND_SPEC_3 (0x23)
|
||||
#define CySEND_SPEC_4 (0x24)
|
||||
/* Format 4 */
|
||||
#define CyCHAN_CTL (0x10)
|
||||
#define CyDIS_RCVR (0x01)
|
||||
#define CyENB_RCVR (0x02)
|
||||
#define CyDIS_XMTR (0x04)
|
||||
#define CyENB_XMTR (0x08)
|
||||
#define CySRER (0x06*2)
|
||||
#define CyMdmCh (0x80)
|
||||
#define CyRxData (0x10)
|
||||
#define CyTxRdy (0x04)
|
||||
#define CyTxMpty (0x02)
|
||||
#define CyNNDT (0x01)
|
||||
#define CyCOR1 (0x08*2)
|
||||
#define CyPARITY_NONE (0x00)
|
||||
#define CyPARITY_0 (0x20)
|
||||
#define CyPARITY_1 (0xA0)
|
||||
#define CyPARITY_E (0x40)
|
||||
#define CyPARITY_O (0xC0)
|
||||
#define Cy_1_STOP (0x00)
|
||||
#define Cy_1_5_STOP (0x04)
|
||||
#define Cy_2_STOP (0x08)
|
||||
#define Cy_5_BITS (0x00)
|
||||
#define Cy_6_BITS (0x01)
|
||||
#define Cy_7_BITS (0x02)
|
||||
#define Cy_8_BITS (0x03)
|
||||
#define CyCOR2 (0x09*2)
|
||||
#define CyIXM (0x80)
|
||||
#define CyTxIBE (0x40)
|
||||
#define CyETC (0x20)
|
||||
#define CyAUTO_TXFL (0x60)
|
||||
#define CyLLM (0x10)
|
||||
#define CyRLM (0x08)
|
||||
#define CyRtsAO (0x04)
|
||||
#define CyCtsAE (0x02)
|
||||
#define CyDsrAE (0x01)
|
||||
#define CyCOR3 (0x0A*2)
|
||||
#define CySPL_CH_DRANGE (0x80) /* special character detect range */
|
||||
#define CySPL_CH_DET1 (0x40) /* enable special character detection
|
||||
on SCHR4-SCHR3 */
|
||||
#define CyFL_CTRL_TRNSP (0x20) /* Flow Control Transparency */
|
||||
#define CySPL_CH_DET2 (0x10) /* Enable special character detection
|
||||
on SCHR2-SCHR1 */
|
||||
#define CyREC_FIFO (0x0F) /* Receive FIFO threshold */
|
||||
#define CyCOR4 (0x1E*2)
|
||||
#define CyCOR5 (0x1F*2)
|
||||
#define CyCCSR (0x0B*2)
|
||||
#define CyRxEN (0x80)
|
||||
#define CyRxFloff (0x40)
|
||||
#define CyRxFlon (0x20)
|
||||
#define CyTxEN (0x08)
|
||||
#define CyTxFloff (0x04)
|
||||
#define CyTxFlon (0x02)
|
||||
#define CyRDCR (0x0E*2)
|
||||
#define CySCHR1 (0x1A*2)
|
||||
#define CySCHR2 (0x1B*2)
|
||||
#define CySCHR3 (0x1C*2)
|
||||
#define CySCHR4 (0x1D*2)
|
||||
#define CySCRL (0x22*2)
|
||||
#define CySCRH (0x23*2)
|
||||
#define CyLNC (0x24*2)
|
||||
#define CyMCOR1 (0x15*2)
|
||||
#define CyMCOR2 (0x16*2)
|
||||
#define CyRTPR (0x21*2)
|
||||
#define CyMSVR1 (0x6C*2)
|
||||
#define CyMSVR2 (0x6D*2)
|
||||
#define CyANY_DELTA (0xF0)
|
||||
#define CyDSR (0x80)
|
||||
#define CyCTS (0x40)
|
||||
#define CyRI (0x20)
|
||||
#define CyDCD (0x10)
|
||||
#define CyDTR (0x02)
|
||||
#define CyRTS (0x01)
|
||||
#define CyPVSR (0x6F*2)
|
||||
#define CyRBPR (0x78*2)
|
||||
#define CyRCOR (0x7C*2)
|
||||
#define CyTBPR (0x72*2)
|
||||
#define CyTCOR (0x76*2)
|
||||
|
||||
/* Custom Registers */
|
||||
|
||||
#define CyPLX_VER (0x3400)
|
||||
#define PLX_9050 0x0b
|
||||
#define PLX_9060 0x0c
|
||||
#define PLX_9080 0x0d
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
#endif /* _LINUX_CYCLADES_H */
|
|
@ -1,85 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _LINUX_ISICOM_H
|
||||
#define _LINUX_ISICOM_H
|
||||
|
||||
#define YES 1
|
||||
#define NO 0
|
||||
|
||||
/*
|
||||
* ISICOM Driver definitions ...
|
||||
*
|
||||
*/
|
||||
|
||||
#define ISICOM_NAME "ISICom"
|
||||
|
||||
/*
|
||||
* PCI definitions
|
||||
*/
|
||||
|
||||
#define DEVID_COUNT 9
|
||||
#define VENDOR_ID 0x10b5
|
||||
|
||||
/*
|
||||
* These are now officially allocated numbers
|
||||
*/
|
||||
|
||||
#define ISICOM_NMAJOR 112 /* normal */
|
||||
#define ISICOM_CMAJOR 113 /* callout */
|
||||
#define ISICOM_MAGIC (('M' << 8) | 'T')
|
||||
|
||||
#define WAKEUP_CHARS 256 /* hard coded for now */
|
||||
#define TX_SIZE 254
|
||||
|
||||
#define BOARD_COUNT 4
|
||||
#define PORT_COUNT (BOARD_COUNT*16)
|
||||
|
||||
/* character sizes */
|
||||
|
||||
#define ISICOM_CS5 0x0000
|
||||
#define ISICOM_CS6 0x0001
|
||||
#define ISICOM_CS7 0x0002
|
||||
#define ISICOM_CS8 0x0003
|
||||
|
||||
/* stop bits */
|
||||
|
||||
#define ISICOM_1SB 0x0000
|
||||
#define ISICOM_2SB 0x0004
|
||||
|
||||
/* parity */
|
||||
|
||||
#define ISICOM_NOPAR 0x0000
|
||||
#define ISICOM_ODPAR 0x0008
|
||||
#define ISICOM_EVPAR 0x0018
|
||||
|
||||
/* flow control */
|
||||
|
||||
#define ISICOM_CTSRTS 0x03
|
||||
#define ISICOM_INITIATE_XONXOFF 0x04
|
||||
#define ISICOM_RESPOND_XONXOFF 0x08
|
||||
|
||||
#define BOARD(line) (((line) >> 4) & 0x3)
|
||||
|
||||
/* isi kill queue bitmap */
|
||||
|
||||
#define ISICOM_KILLTX 0x01
|
||||
#define ISICOM_KILLRX 0x02
|
||||
|
||||
/* isi_board status bitmap */
|
||||
|
||||
#define FIRMWARE_LOADED 0x0001
|
||||
#define BOARD_ACTIVE 0x0002
|
||||
#define BOARD_INIT 0x0004
|
||||
|
||||
/* isi_port status bitmap */
|
||||
|
||||
#define ISI_CTS 0x1000
|
||||
#define ISI_DSR 0x2000
|
||||
#define ISI_RI 0x4000
|
||||
#define ISI_DCD 0x8000
|
||||
#define ISI_DTR 0x0100
|
||||
#define ISI_RTS 0x0200
|
||||
|
||||
|
||||
#define ISI_TXOK 0x0001
|
||||
|
||||
#endif /* ISICOM_H */
|
|
@ -1688,37 +1688,8 @@
|
|||
#define PCI_VENDOR_ID_MICROSEMI 0x11f8
|
||||
|
||||
#define PCI_VENDOR_ID_RP 0x11fe
|
||||
#define PCI_DEVICE_ID_RP32INTF 0x0001
|
||||
#define PCI_DEVICE_ID_RP8INTF 0x0002
|
||||
#define PCI_DEVICE_ID_RP16INTF 0x0003
|
||||
#define PCI_DEVICE_ID_RP4QUAD 0x0004
|
||||
#define PCI_DEVICE_ID_RP8OCTA 0x0005
|
||||
#define PCI_DEVICE_ID_RP8J 0x0006
|
||||
#define PCI_DEVICE_ID_RP4J 0x0007
|
||||
#define PCI_DEVICE_ID_RP8SNI 0x0008
|
||||
#define PCI_DEVICE_ID_RP16SNI 0x0009
|
||||
#define PCI_DEVICE_ID_RPP4 0x000A
|
||||
#define PCI_DEVICE_ID_RPP8 0x000B
|
||||
#define PCI_DEVICE_ID_RP4M 0x000D
|
||||
#define PCI_DEVICE_ID_RP2_232 0x000E
|
||||
#define PCI_DEVICE_ID_RP2_422 0x000F
|
||||
#define PCI_DEVICE_ID_URP32INTF 0x0801
|
||||
#define PCI_DEVICE_ID_URP8INTF 0x0802
|
||||
#define PCI_DEVICE_ID_URP16INTF 0x0803
|
||||
#define PCI_DEVICE_ID_URP8OCTA 0x0805
|
||||
#define PCI_DEVICE_ID_UPCI_RM3_8PORT 0x080C
|
||||
#define PCI_DEVICE_ID_UPCI_RM3_4PORT 0x080D
|
||||
#define PCI_DEVICE_ID_CRP16INTF 0x0903
|
||||
|
||||
#define PCI_VENDOR_ID_CYCLADES 0x120e
|
||||
#define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100
|
||||
#define PCI_DEVICE_ID_CYCLOM_Y_Hi 0x0101
|
||||
#define PCI_DEVICE_ID_CYCLOM_4Y_Lo 0x0102
|
||||
#define PCI_DEVICE_ID_CYCLOM_4Y_Hi 0x0103
|
||||
#define PCI_DEVICE_ID_CYCLOM_8Y_Lo 0x0104
|
||||
#define PCI_DEVICE_ID_CYCLOM_8Y_Hi 0x0105
|
||||
#define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200
|
||||
#define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201
|
||||
#define PCI_DEVICE_ID_PC300_RX_2 0x0300
|
||||
#define PCI_DEVICE_ID_PC300_RX_1 0x0301
|
||||
#define PCI_DEVICE_ID_PC300_TE_2 0x0310
|
||||
|
@ -2065,8 +2036,6 @@
|
|||
#define PCI_DEVICE_ID_EXAR_XR17V358 0x0358
|
||||
|
||||
#define PCI_VENDOR_ID_MICROGATE 0x13c0
|
||||
#define PCI_DEVICE_ID_MICROGATE_USC 0x0010
|
||||
#define PCI_DEVICE_ID_MICROGATE_SCA 0x0030
|
||||
|
||||
#define PCI_VENDOR_ID_3WARE 0x13C1
|
||||
#define PCI_DEVICE_ID_3WARE_1000 0x1000
|
||||
|
|
|
@ -246,6 +246,22 @@
|
|||
S5PV210_UFCON_TXTRIG4 | \
|
||||
S5PV210_UFCON_RXTRIG4)
|
||||
|
||||
#define APPLE_S5L_UCON_RXTO_ENA 9
|
||||
#define APPLE_S5L_UCON_RXTHRESH_ENA 12
|
||||
#define APPLE_S5L_UCON_TXTHRESH_ENA 13
|
||||
#define APPLE_S5L_UCON_RXTO_ENA_MSK (1 << APPLE_S5L_UCON_RXTO_ENA)
|
||||
#define APPLE_S5L_UCON_RXTHRESH_ENA_MSK (1 << APPLE_S5L_UCON_RXTHRESH_ENA)
|
||||
#define APPLE_S5L_UCON_TXTHRESH_ENA_MSK (1 << APPLE_S5L_UCON_TXTHRESH_ENA)
|
||||
|
||||
#define APPLE_S5L_UCON_DEFAULT (S3C2410_UCON_TXIRQMODE | \
|
||||
S3C2410_UCON_RXIRQMODE | \
|
||||
S3C2410_UCON_RXFIFO_TOI)
|
||||
|
||||
#define APPLE_S5L_UTRSTAT_RXTHRESH (1<<4)
|
||||
#define APPLE_S5L_UTRSTAT_TXTHRESH (1<<5)
|
||||
#define APPLE_S5L_UTRSTAT_RXTO (1<<9)
|
||||
#define APPLE_S5L_UTRSTAT_ALL_FLAGS (0x3f0)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/serial_core.h>
|
||||
|
|
|
@ -482,7 +482,7 @@ extern void stop_tty(struct tty_struct *tty);
|
|||
extern void __start_tty(struct tty_struct *tty);
|
||||
extern void start_tty(struct tty_struct *tty);
|
||||
extern int tty_register_driver(struct tty_driver *driver);
|
||||
extern int tty_unregister_driver(struct tty_driver *driver);
|
||||
extern void tty_unregister_driver(struct tty_driver *driver);
|
||||
extern struct device *tty_register_device(struct tty_driver *driver,
|
||||
unsigned index, struct device *dev);
|
||||
extern struct device *tty_register_device_attr(struct tty_driver *driver,
|
||||
|
|
|
@ -173,7 +173,6 @@ extern int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass,
|
|||
|
||||
|
||||
struct tty_ldisc_ops {
|
||||
int magic;
|
||||
char *name;
|
||||
int num;
|
||||
int flags;
|
||||
|
@ -218,8 +217,6 @@ struct tty_ldisc {
|
|||
struct tty_struct *tty;
|
||||
};
|
||||
|
||||
#define TTY_LDISC_MAGIC 0x5403
|
||||
|
||||
#define LDISC_FLAG_DEFINED 0x00000001
|
||||
|
||||
#define MODULE_ALIAS_LDISC(ldisc) \
|
||||
|
|
|
@ -430,8 +430,6 @@ struct nci_uart_ops {
|
|||
int (*open)(struct nci_uart *nci_uart);
|
||||
void (*close)(struct nci_uart *nci_uart);
|
||||
int (*recv)(struct nci_uart *nci_uart, struct sk_buff *skb);
|
||||
int (*recv_buf)(struct nci_uart *nci_uart, const u8 *data, char *flags,
|
||||
int count);
|
||||
int (*send)(struct nci_uart *nci_uart, struct sk_buff *skb);
|
||||
void (*tx_start)(struct nci_uart *nci_uart);
|
||||
void (*tx_done)(struct nci_uart *nci_uart);
|
||||
|
|
|
@ -1,494 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/* $Revision: 3.0 $$Date: 1998/11/02 14:20:59 $
|
||||
* linux/include/linux/cyclades.h
|
||||
*
|
||||
* This file was initially written by
|
||||
* Randolph Bentson <bentson@grieg.seaslug.org> and is maintained by
|
||||
* Ivan Passos <ivan@cyclades.com>.
|
||||
*
|
||||
* This file contains the general definitions for the cyclades.c driver
|
||||
*$Log: cyclades.h,v $
|
||||
*Revision 3.1 2002/01/29 11:36:16 henrique
|
||||
*added throttle field on struct cyclades_port to indicate whether the
|
||||
*port is throttled or not
|
||||
*
|
||||
*Revision 3.1 2000/04/19 18:52:52 ivan
|
||||
*converted address fields to unsigned long and added fields for physical
|
||||
*addresses on cyclades_card structure;
|
||||
*
|
||||
*Revision 3.0 1998/11/02 14:20:59 ivan
|
||||
*added nports field on cyclades_card structure;
|
||||
*
|
||||
*Revision 2.5 1998/08/03 16:57:01 ivan
|
||||
*added cyclades_idle_stats structure;
|
||||
*
|
||||
*Revision 2.4 1998/06/01 12:09:53 ivan
|
||||
*removed closing_wait2 from cyclades_port structure;
|
||||
*
|
||||
*Revision 2.3 1998/03/16 18:01:12 ivan
|
||||
*changes in the cyclades_port structure to get it closer to the
|
||||
*standard serial port structure;
|
||||
*added constants for new ioctls;
|
||||
*
|
||||
*Revision 2.2 1998/02/17 16:50:00 ivan
|
||||
*changes in the cyclades_port structure (addition of shutdown_wait and
|
||||
*chip_rev variables);
|
||||
*added constants for new ioctls and for CD1400 rev. numbers.
|
||||
*
|
||||
*Revision 2.1 1997/10/24 16:03:00 ivan
|
||||
*added rflow (which allows enabling the CD1400 special flow control
|
||||
*feature) and rtsdtr_inv (which allows DTR/RTS pin inversion) to
|
||||
*cyclades_port structure;
|
||||
*added Alpha support
|
||||
*
|
||||
*Revision 2.0 1997/06/30 10:30:00 ivan
|
||||
*added some new doorbell command constants related to IOCTLW and
|
||||
*UART error signaling
|
||||
*
|
||||
*Revision 1.8 1997/06/03 15:30:00 ivan
|
||||
*added constant ZFIRM_HLT
|
||||
*added constant CyPCI_Ze_win ( = 2 * Cy_PCI_Zwin)
|
||||
*
|
||||
*Revision 1.7 1997/03/26 10:30:00 daniel
|
||||
*new entries at the end of cyclades_port struct to reallocate
|
||||
*variables illegally allocated within card memory.
|
||||
*
|
||||
*Revision 1.6 1996/09/09 18:35:30 bentson
|
||||
*fold in changes for Cyclom-Z -- including structures for
|
||||
*communicating with board as well modest changes to original
|
||||
*structures to support new features.
|
||||
*
|
||||
*Revision 1.5 1995/11/13 21:13:31 bentson
|
||||
*changes suggested by Michael Chastain <mec@duracef.shout.net>
|
||||
*to support use of this file in non-kernel applications
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _UAPI_LINUX_CYCLADES_H
|
||||
#define _UAPI_LINUX_CYCLADES_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct cyclades_monitor {
|
||||
unsigned long int_count;
|
||||
unsigned long char_count;
|
||||
unsigned long char_max;
|
||||
unsigned long char_last;
|
||||
};
|
||||
|
||||
/*
|
||||
* These stats all reflect activity since the device was last initialized.
|
||||
* (i.e., since the port was opened with no other processes already having it
|
||||
* open)
|
||||
*/
|
||||
struct cyclades_idle_stats {
|
||||
__kernel_old_time_t in_use; /* Time device has been in use (secs) */
|
||||
__kernel_old_time_t recv_idle; /* Time since last char received (secs) */
|
||||
__kernel_old_time_t xmit_idle; /* Time since last char transmitted (secs) */
|
||||
unsigned long recv_bytes; /* Bytes received */
|
||||
unsigned long xmit_bytes; /* Bytes transmitted */
|
||||
unsigned long overruns; /* Input overruns */
|
||||
unsigned long frame_errs; /* Input framing errors */
|
||||
unsigned long parity_errs; /* Input parity errors */
|
||||
};
|
||||
|
||||
#define CYCLADES_MAGIC 0x4359
|
||||
|
||||
#define CYGETMON 0x435901
|
||||
#define CYGETTHRESH 0x435902
|
||||
#define CYSETTHRESH 0x435903
|
||||
#define CYGETDEFTHRESH 0x435904
|
||||
#define CYSETDEFTHRESH 0x435905
|
||||
#define CYGETTIMEOUT 0x435906
|
||||
#define CYSETTIMEOUT 0x435907
|
||||
#define CYGETDEFTIMEOUT 0x435908
|
||||
#define CYSETDEFTIMEOUT 0x435909
|
||||
#define CYSETRFLOW 0x43590a
|
||||
#define CYGETRFLOW 0x43590b
|
||||
#define CYSETRTSDTR_INV 0x43590c
|
||||
#define CYGETRTSDTR_INV 0x43590d
|
||||
#define CYZSETPOLLCYCLE 0x43590e
|
||||
#define CYZGETPOLLCYCLE 0x43590f
|
||||
#define CYGETCD1400VER 0x435910
|
||||
#define CYSETWAIT 0x435912
|
||||
#define CYGETWAIT 0x435913
|
||||
|
||||
/*************** CYCLOM-Z ADDITIONS ***************/
|
||||
|
||||
#define CZIOC ('M' << 8)
|
||||
#define CZ_NBOARDS (CZIOC|0xfa)
|
||||
#define CZ_BOOT_START (CZIOC|0xfb)
|
||||
#define CZ_BOOT_DATA (CZIOC|0xfc)
|
||||
#define CZ_BOOT_END (CZIOC|0xfd)
|
||||
#define CZ_TEST (CZIOC|0xfe)
|
||||
|
||||
#define CZ_DEF_POLL (HZ/25)
|
||||
|
||||
#define MAX_BOARD 4 /* Max number of boards */
|
||||
#define MAX_DEV 256 /* Max number of ports total */
|
||||
#define CYZ_MAX_SPEED 921600
|
||||
|
||||
#define CYZ_FIFO_SIZE 16
|
||||
|
||||
#define CYZ_BOOT_NWORDS 0x100
|
||||
struct CYZ_BOOT_CTRL {
|
||||
unsigned short nboard;
|
||||
int status[MAX_BOARD];
|
||||
int nchannel[MAX_BOARD];
|
||||
int fw_rev[MAX_BOARD];
|
||||
unsigned long offset;
|
||||
unsigned long data[CYZ_BOOT_NWORDS];
|
||||
};
|
||||
|
||||
|
||||
#ifndef DP_WINDOW_SIZE
|
||||
/*
|
||||
* Memory Window Sizes
|
||||
*/
|
||||
|
||||
#define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */
|
||||
#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and
|
||||
8Zo V.2 */
|
||||
#define CTRL_WINDOW_SIZE (0x00000080) /* runtime regs 128 bytes */
|
||||
|
||||
/*
|
||||
* CUSTOM_REG - Cyclom-Z/PCI Custom Registers Set. The driver
|
||||
* normally will access only interested on the fpga_id, fpga_version,
|
||||
* start_cpu and stop_cpu.
|
||||
*/
|
||||
|
||||
struct CUSTOM_REG {
|
||||
__u32 fpga_id; /* FPGA Identification Register */
|
||||
__u32 fpga_version; /* FPGA Version Number Register */
|
||||
__u32 cpu_start; /* CPU start Register (write) */
|
||||
__u32 cpu_stop; /* CPU stop Register (write) */
|
||||
__u32 misc_reg; /* Miscellaneous Register */
|
||||
__u32 idt_mode; /* IDT mode Register */
|
||||
__u32 uart_irq_status; /* UART IRQ status Register */
|
||||
__u32 clear_timer0_irq; /* Clear timer interrupt Register */
|
||||
__u32 clear_timer1_irq; /* Clear timer interrupt Register */
|
||||
__u32 clear_timer2_irq; /* Clear timer interrupt Register */
|
||||
__u32 test_register; /* Test Register */
|
||||
__u32 test_count; /* Test Count Register */
|
||||
__u32 timer_select; /* Timer select register */
|
||||
__u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
|
||||
__u32 ram_wait_state; /* RAM wait-state Register */
|
||||
__u32 uart_wait_state; /* UART wait-state Register */
|
||||
__u32 timer_wait_state; /* timer wait-state Register */
|
||||
__u32 ack_wait_state; /* ACK wait State Register */
|
||||
};
|
||||
|
||||
/*
|
||||
* RUNTIME_9060 - PLX PCI9060ES local configuration and shared runtime
|
||||
* registers. This structure can be used to access the 9060 registers
|
||||
* (memory mapped).
|
||||
*/
|
||||
|
||||
struct RUNTIME_9060 {
|
||||
__u32 loc_addr_range; /* 00h - Local Address Range */
|
||||
__u32 loc_addr_base; /* 04h - Local Address Base */
|
||||
__u32 loc_arbitr; /* 08h - Local Arbitration */
|
||||
__u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */
|
||||
__u32 loc_rom_range; /* 10h - Local ROM Range */
|
||||
__u32 loc_rom_base; /* 14h - Local ROM Base */
|
||||
__u32 loc_bus_descr; /* 18h - Local Bus descriptor */
|
||||
__u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */
|
||||
__u32 loc_base_mst; /* 20h - Local Base for Master PCI */
|
||||
__u32 loc_range_io; /* 24h - Local Range for Master IO */
|
||||
__u32 pci_base_mst; /* 28h - PCI Base for Master PCI */
|
||||
__u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */
|
||||
__u32 filler1; /* 30h */
|
||||
__u32 filler2; /* 34h */
|
||||
__u32 filler3; /* 38h */
|
||||
__u32 filler4; /* 3Ch */
|
||||
__u32 mail_box_0; /* 40h - Mail Box 0 */
|
||||
__u32 mail_box_1; /* 44h - Mail Box 1 */
|
||||
__u32 mail_box_2; /* 48h - Mail Box 2 */
|
||||
__u32 mail_box_3; /* 4Ch - Mail Box 3 */
|
||||
__u32 filler5; /* 50h */
|
||||
__u32 filler6; /* 54h */
|
||||
__u32 filler7; /* 58h */
|
||||
__u32 filler8; /* 5Ch */
|
||||
__u32 pci_doorbell; /* 60h - PCI to Local Doorbell */
|
||||
__u32 loc_doorbell; /* 64h - Local to PCI Doorbell */
|
||||
__u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */
|
||||
__u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
|
||||
};
|
||||
|
||||
/* Values for the Local Base Address re-map register */
|
||||
|
||||
#define WIN_RAM 0x00000001L /* set the sliding window to RAM */
|
||||
#define WIN_CREG 0x14000001L /* set the window to custom Registers */
|
||||
|
||||
/* Values timer select registers */
|
||||
|
||||
#define TIMER_BY_1M 0x00 /* clock divided by 1M */
|
||||
#define TIMER_BY_256K 0x01 /* clock divided by 256k */
|
||||
#define TIMER_BY_128K 0x02 /* clock divided by 128k */
|
||||
#define TIMER_BY_32K 0x03 /* clock divided by 32k */
|
||||
|
||||
/****************** ****************** *******************/
|
||||
#endif
|
||||
|
||||
#ifndef ZFIRM_ID
|
||||
/* #include "zfwint.h" */
|
||||
/****************** ****************** *******************/
|
||||
/*
|
||||
* This file contains the definitions for interfacing with the
|
||||
* Cyclom-Z ZFIRM Firmware.
|
||||
*/
|
||||
|
||||
/* General Constant definitions */
|
||||
|
||||
#define MAX_CHAN 64 /* max number of channels per board */
|
||||
|
||||
/* firmware id structure (set after boot) */
|
||||
|
||||
#define ID_ADDRESS 0x00000180L /* signature/pointer address */
|
||||
#define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */
|
||||
#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */
|
||||
#define ZFIRM_RST 0x56040674L /* RST signal (due to FW reset) */
|
||||
|
||||
#define ZF_TINACT_DEF 1000 /* default inactivity timeout
|
||||
(1000 ms) */
|
||||
#define ZF_TINACT ZF_TINACT_DEF
|
||||
|
||||
struct FIRM_ID {
|
||||
__u32 signature; /* ZFIRM/U signature */
|
||||
__u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */
|
||||
};
|
||||
|
||||
/* Op. System id */
|
||||
|
||||
#define C_OS_LINUX 0x00000030 /* generic Linux system */
|
||||
|
||||
/* channel op_mode */
|
||||
|
||||
#define C_CH_DISABLE 0x00000000 /* channel is disabled */
|
||||
#define C_CH_TXENABLE 0x00000001 /* channel Tx enabled */
|
||||
#define C_CH_RXENABLE 0x00000002 /* channel Rx enabled */
|
||||
#define C_CH_ENABLE 0x00000003 /* channel Tx/Rx enabled */
|
||||
#define C_CH_LOOPBACK 0x00000004 /* Loopback mode */
|
||||
|
||||
/* comm_parity - parity */
|
||||
|
||||
#define C_PR_NONE 0x00000000 /* None */
|
||||
#define C_PR_ODD 0x00000001 /* Odd */
|
||||
#define C_PR_EVEN 0x00000002 /* Even */
|
||||
#define C_PR_MARK 0x00000004 /* Mark */
|
||||
#define C_PR_SPACE 0x00000008 /* Space */
|
||||
#define C_PR_PARITY 0x000000ff
|
||||
|
||||
#define C_PR_DISCARD 0x00000100 /* discard char with frame/par error */
|
||||
#define C_PR_IGNORE 0x00000200 /* ignore frame/par error */
|
||||
|
||||
/* comm_data_l - data length and stop bits */
|
||||
|
||||
#define C_DL_CS5 0x00000001
|
||||
#define C_DL_CS6 0x00000002
|
||||
#define C_DL_CS7 0x00000004
|
||||
#define C_DL_CS8 0x00000008
|
||||
#define C_DL_CS 0x0000000f
|
||||
#define C_DL_1STOP 0x00000010
|
||||
#define C_DL_15STOP 0x00000020
|
||||
#define C_DL_2STOP 0x00000040
|
||||
#define C_DL_STOP 0x000000f0
|
||||
|
||||
/* interrupt enabling/status */
|
||||
|
||||
#define C_IN_DISABLE 0x00000000 /* zero, disable interrupts */
|
||||
#define C_IN_TXBEMPTY 0x00000001 /* tx buffer empty */
|
||||
#define C_IN_TXLOWWM 0x00000002 /* tx buffer below LWM */
|
||||
#define C_IN_RXHIWM 0x00000010 /* rx buffer above HWM */
|
||||
#define C_IN_RXNNDT 0x00000020 /* rx no new data timeout */
|
||||
#define C_IN_MDCD 0x00000100 /* modem DCD change */
|
||||
#define C_IN_MDSR 0x00000200 /* modem DSR change */
|
||||
#define C_IN_MRI 0x00000400 /* modem RI change */
|
||||
#define C_IN_MCTS 0x00000800 /* modem CTS change */
|
||||
#define C_IN_RXBRK 0x00001000 /* Break received */
|
||||
#define C_IN_PR_ERROR 0x00002000 /* parity error */
|
||||
#define C_IN_FR_ERROR 0x00004000 /* frame error */
|
||||
#define C_IN_OVR_ERROR 0x00008000 /* overrun error */
|
||||
#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */
|
||||
#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */
|
||||
#define C_IN_MRTS 0x00040000 /* modem RTS drop */
|
||||
#define C_IN_ICHAR 0x00080000
|
||||
|
||||
/* flow control */
|
||||
|
||||
#define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */
|
||||
#define C_FL_IXX 0x00000002 /* output Xon/Xoff flow control */
|
||||
#define C_FL_OIXANY 0x00000004 /* output Xon/Xoff (any xon) */
|
||||
#define C_FL_SWFLOW 0x0000000f
|
||||
|
||||
/* flow status */
|
||||
|
||||
#define C_FS_TXIDLE 0x00000000 /* no Tx data in the buffer or UART */
|
||||
#define C_FS_SENDING 0x00000001 /* UART is sending data */
|
||||
#define C_FS_SWFLOW 0x00000002 /* Tx is stopped by received Xoff */
|
||||
|
||||
/* rs_control/rs_status RS-232 signals */
|
||||
|
||||
#define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in
|
||||
IOCTLM command */
|
||||
#define C_RS_RTS 0x00000001 /* RTS */
|
||||
#define C_RS_DTR 0x00000004 /* DTR */
|
||||
#define C_RS_DCD 0x00000100 /* CD */
|
||||
#define C_RS_DSR 0x00000200 /* DSR */
|
||||
#define C_RS_RI 0x00000400 /* RI */
|
||||
#define C_RS_CTS 0x00000800 /* CTS */
|
||||
|
||||
/* commands Host <-> Board */
|
||||
|
||||
#define C_CM_RESET 0x01 /* reset/flush buffers */
|
||||
#define C_CM_IOCTL 0x02 /* re-read CH_CTRL */
|
||||
#define C_CM_IOCTLW 0x03 /* re-read CH_CTRL, intr when done */
|
||||
#define C_CM_IOCTLM 0x04 /* RS-232 outputs change */
|
||||
#define C_CM_SENDXOFF 0x10 /* send Xoff */
|
||||
#define C_CM_SENDXON 0x11 /* send Xon */
|
||||
#define C_CM_CLFLOW 0x12 /* Clear flow control (resume) */
|
||||
#define C_CM_SENDBRK 0x41 /* send break */
|
||||
#define C_CM_INTBACK 0x42 /* Interrupt back */
|
||||
#define C_CM_SET_BREAK 0x43 /* Tx break on */
|
||||
#define C_CM_CLR_BREAK 0x44 /* Tx break off */
|
||||
#define C_CM_CMD_DONE 0x45 /* Previous command done */
|
||||
#define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */
|
||||
#define C_CM_TINACT 0x51 /* set inactivity detection */
|
||||
#define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */
|
||||
#define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */
|
||||
#define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */
|
||||
#define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */
|
||||
#define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */
|
||||
#define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */
|
||||
#define C_CM_Q_ENABLE 0x58 /* enables queue access from the
|
||||
driver */
|
||||
#define C_CM_Q_DISABLE 0x59 /* disables queue access from the
|
||||
driver */
|
||||
|
||||
#define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */
|
||||
#define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */
|
||||
#define C_CM_RXHIWM 0x62 /* Rx buffer high water mark */
|
||||
#define C_CM_RXNNDT 0x63 /* rx no new data timeout */
|
||||
#define C_CM_TXFEMPTY 0x64
|
||||
#define C_CM_ICHAR 0x65
|
||||
#define C_CM_MDCD 0x70 /* modem DCD change */
|
||||
#define C_CM_MDSR 0x71 /* modem DSR change */
|
||||
#define C_CM_MRI 0x72 /* modem RI change */
|
||||
#define C_CM_MCTS 0x73 /* modem CTS change */
|
||||
#define C_CM_MRTS 0x74 /* modem RTS drop */
|
||||
#define C_CM_RXBRK 0x84 /* Break received */
|
||||
#define C_CM_PR_ERROR 0x85 /* Parity error */
|
||||
#define C_CM_FR_ERROR 0x86 /* Frame error */
|
||||
#define C_CM_OVR_ERROR 0x87 /* Overrun error */
|
||||
#define C_CM_RXOFL 0x88 /* RX buffer overflow */
|
||||
#define C_CM_CMDERROR 0x90 /* command error */
|
||||
#define C_CM_FATAL 0x91 /* fatal error */
|
||||
#define C_CM_HW_RESET 0x92 /* reset board */
|
||||
|
||||
/*
|
||||
* CH_CTRL - This per port structure contains all parameters
|
||||
* that control an specific port. It can be seen as the
|
||||
* configuration registers of a "super-serial-controller".
|
||||
*/
|
||||
|
||||
struct CH_CTRL {
|
||||
__u32 op_mode; /* operation mode */
|
||||
__u32 intr_enable; /* interrupt masking */
|
||||
__u32 sw_flow; /* SW flow control */
|
||||
__u32 flow_status; /* output flow status */
|
||||
__u32 comm_baud; /* baud rate - numerically specified */
|
||||
__u32 comm_parity; /* parity */
|
||||
__u32 comm_data_l; /* data length/stop */
|
||||
__u32 comm_flags; /* other flags */
|
||||
__u32 hw_flow; /* HW flow control */
|
||||
__u32 rs_control; /* RS-232 outputs */
|
||||
__u32 rs_status; /* RS-232 inputs */
|
||||
__u32 flow_xon; /* xon char */
|
||||
__u32 flow_xoff; /* xoff char */
|
||||
__u32 hw_overflow; /* hw overflow counter */
|
||||
__u32 sw_overflow; /* sw overflow counter */
|
||||
__u32 comm_error; /* frame/parity error counter */
|
||||
__u32 ichar;
|
||||
__u32 filler[7];
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* BUF_CTRL - This per channel structure contains
|
||||
* all Tx and Rx buffer control for a given channel.
|
||||
*/
|
||||
|
||||
struct BUF_CTRL {
|
||||
__u32 flag_dma; /* buffers are in Host memory */
|
||||
__u32 tx_bufaddr; /* address of the tx buffer */
|
||||
__u32 tx_bufsize; /* tx buffer size */
|
||||
__u32 tx_threshold; /* tx low water mark */
|
||||
__u32 tx_get; /* tail index tx buf */
|
||||
__u32 tx_put; /* head index tx buf */
|
||||
__u32 rx_bufaddr; /* address of the rx buffer */
|
||||
__u32 rx_bufsize; /* rx buffer size */
|
||||
__u32 rx_threshold; /* rx high water mark */
|
||||
__u32 rx_get; /* tail index rx buf */
|
||||
__u32 rx_put; /* head index rx buf */
|
||||
__u32 filler[5]; /* filler to align structures */
|
||||
};
|
||||
|
||||
/*
|
||||
* BOARD_CTRL - This per board structure contains all global
|
||||
* control fields related to the board.
|
||||
*/
|
||||
|
||||
struct BOARD_CTRL {
|
||||
|
||||
/* static info provided by the on-board CPU */
|
||||
__u32 n_channel; /* number of channels */
|
||||
__u32 fw_version; /* firmware version */
|
||||
|
||||
/* static info provided by the driver */
|
||||
__u32 op_system; /* op_system id */
|
||||
__u32 dr_version; /* driver version */
|
||||
|
||||
/* board control area */
|
||||
__u32 inactivity; /* inactivity control */
|
||||
|
||||
/* host to FW commands */
|
||||
__u32 hcmd_channel; /* channel number */
|
||||
__u32 hcmd_param; /* pointer to parameters */
|
||||
|
||||
/* FW to Host commands */
|
||||
__u32 fwcmd_channel; /* channel number */
|
||||
__u32 fwcmd_param; /* pointer to parameters */
|
||||
__u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */
|
||||
|
||||
/* filler so the structures are aligned */
|
||||
__u32 filler[6];
|
||||
};
|
||||
|
||||
/* Host Interrupt Queue */
|
||||
|
||||
#define QUEUE_SIZE (10*MAX_CHAN)
|
||||
|
||||
struct INT_QUEUE {
|
||||
unsigned char intr_code[QUEUE_SIZE];
|
||||
unsigned long channel[QUEUE_SIZE];
|
||||
unsigned long param[QUEUE_SIZE];
|
||||
unsigned long put;
|
||||
unsigned long get;
|
||||
};
|
||||
|
||||
/*
|
||||
* ZFW_CTRL - This is the data structure that includes all other
|
||||
* data structures used by the Firmware.
|
||||
*/
|
||||
|
||||
struct ZFW_CTRL {
|
||||
struct BOARD_CTRL board_ctrl;
|
||||
struct CH_CTRL ch_ctrl[MAX_CHAN];
|
||||
struct BUF_CTRL buf_ctrl[MAX_CHAN];
|
||||
};
|
||||
|
||||
/****************** ****************** *******************/
|
||||
#endif
|
||||
|
||||
#endif /* _UAPI_LINUX_CYCLADES_H */
|
|
@ -34,8 +34,6 @@
|
|||
#define GOLDSTAR_CDROM_MAJOR 16
|
||||
#define OPTICS_CDROM_MAJOR 17
|
||||
#define SANYO_CDROM_MAJOR 18
|
||||
#define CYCLADES_MAJOR 19
|
||||
#define CYCLADESAUX_MAJOR 20
|
||||
#define MITSUMI_X_CDROM_MAJOR 20
|
||||
#define MFM_ACORN_MAJOR 21 /* ARM Linux /dev/mfm */
|
||||
#define SCSI_GENERIC_MAJOR 21
|
||||
|
|
|
@ -52,11 +52,11 @@ struct serial_struct {
|
|||
#define PORT_16450 2
|
||||
#define PORT_16550 3
|
||||
#define PORT_16550A 4
|
||||
#define PORT_CIRRUS 5 /* usurped by cyclades.c */
|
||||
#define PORT_CIRRUS 5
|
||||
#define PORT_16650 6
|
||||
#define PORT_16650V2 7
|
||||
#define PORT_16750 8
|
||||
#define PORT_STARTECH 9 /* usurped by cyclades.c */
|
||||
#define PORT_STARTECH 9
|
||||
#define PORT_16C950 10 /* Oxford Semiconductor */
|
||||
#define PORT_16654 11
|
||||
#define PORT_16850 12
|
||||
|
|
|
@ -229,6 +229,72 @@ static void nci_uart_tty_wakeup(struct tty_struct *tty)
|
|||
nci_uart_tx_wakeup(nu);
|
||||
}
|
||||
|
||||
/* -- Default recv_buf handler --
|
||||
*
|
||||
* This handler supposes that NCI frames are sent over UART link without any
|
||||
* framing. It reads NCI header, retrieve the packet size and once all packet
|
||||
* bytes are received it passes it to nci_uart driver for processing.
|
||||
*/
|
||||
static int nci_uart_default_recv_buf(struct nci_uart *nu, const u8 *data,
|
||||
int count)
|
||||
{
|
||||
int chunk_len;
|
||||
|
||||
if (!nu->ndev) {
|
||||
nfc_err(nu->tty->dev,
|
||||
"receive data from tty but no NCI dev is attached yet, drop buffer\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Decode all incoming data in packets
|
||||
* and enqueue then for processing.
|
||||
*/
|
||||
while (count > 0) {
|
||||
/* If this is the first data of a packet, allocate a buffer */
|
||||
if (!nu->rx_skb) {
|
||||
nu->rx_packet_len = -1;
|
||||
nu->rx_skb = nci_skb_alloc(nu->ndev,
|
||||
NCI_MAX_PACKET_SIZE,
|
||||
GFP_ATOMIC);
|
||||
if (!nu->rx_skb)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Eat byte after byte till full packet header is received */
|
||||
if (nu->rx_skb->len < NCI_CTRL_HDR_SIZE) {
|
||||
skb_put_u8(nu->rx_skb, *data++);
|
||||
--count;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Header was received but packet len was not read */
|
||||
if (nu->rx_packet_len < 0)
|
||||
nu->rx_packet_len = NCI_CTRL_HDR_SIZE +
|
||||
nci_plen(nu->rx_skb->data);
|
||||
|
||||
/* Compute how many bytes are missing and how many bytes can
|
||||
* be consumed.
|
||||
*/
|
||||
chunk_len = nu->rx_packet_len - nu->rx_skb->len;
|
||||
if (count < chunk_len)
|
||||
chunk_len = count;
|
||||
skb_put_data(nu->rx_skb, data, chunk_len);
|
||||
data += chunk_len;
|
||||
count -= chunk_len;
|
||||
|
||||
/* Chcek if packet is fully received */
|
||||
if (nu->rx_packet_len == nu->rx_skb->len) {
|
||||
/* Pass RX packet to driver */
|
||||
if (nu->ops.recv(nu, nu->rx_skb) != 0)
|
||||
nfc_err(nu->tty->dev, "corrupted RX packet\n");
|
||||
/* Next packet will be a new one */
|
||||
nu->rx_skb = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* nci_uart_tty_receive()
|
||||
*
|
||||
* Called by tty low level driver when receive data is
|
||||
|
@ -250,7 +316,7 @@ static void nci_uart_tty_receive(struct tty_struct *tty, const u8 *data,
|
|||
return;
|
||||
|
||||
spin_lock(&nu->rx_lock);
|
||||
nu->ops.recv_buf(nu, (void *)data, flags, count);
|
||||
nci_uart_default_recv_buf(nu, data, count);
|
||||
spin_unlock(&nu->rx_lock);
|
||||
|
||||
tty_unthrottle(tty);
|
||||
|
@ -321,78 +387,6 @@ static int nci_uart_send(struct nci_uart *nu, struct sk_buff *skb)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* -- Default recv_buf handler --
|
||||
*
|
||||
* This handler supposes that NCI frames are sent over UART link without any
|
||||
* framing. It reads NCI header, retrieve the packet size and once all packet
|
||||
* bytes are received it passes it to nci_uart driver for processing.
|
||||
*/
|
||||
static int nci_uart_default_recv_buf(struct nci_uart *nu, const u8 *data,
|
||||
char *flags, int count)
|
||||
{
|
||||
int chunk_len;
|
||||
|
||||
if (!nu->ndev) {
|
||||
nfc_err(nu->tty->dev,
|
||||
"receive data from tty but no NCI dev is attached yet, drop buffer\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Decode all incoming data in packets
|
||||
* and enqueue then for processing.
|
||||
*/
|
||||
while (count > 0) {
|
||||
/* If this is the first data of a packet, allocate a buffer */
|
||||
if (!nu->rx_skb) {
|
||||
nu->rx_packet_len = -1;
|
||||
nu->rx_skb = nci_skb_alloc(nu->ndev,
|
||||
NCI_MAX_PACKET_SIZE,
|
||||
GFP_ATOMIC);
|
||||
if (!nu->rx_skb)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Eat byte after byte till full packet header is received */
|
||||
if (nu->rx_skb->len < NCI_CTRL_HDR_SIZE) {
|
||||
skb_put_u8(nu->rx_skb, *data++);
|
||||
--count;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Header was received but packet len was not read */
|
||||
if (nu->rx_packet_len < 0)
|
||||
nu->rx_packet_len = NCI_CTRL_HDR_SIZE +
|
||||
nci_plen(nu->rx_skb->data);
|
||||
|
||||
/* Compute how many bytes are missing and how many bytes can
|
||||
* be consumed.
|
||||
*/
|
||||
chunk_len = nu->rx_packet_len - nu->rx_skb->len;
|
||||
if (count < chunk_len)
|
||||
chunk_len = count;
|
||||
skb_put_data(nu->rx_skb, data, chunk_len);
|
||||
data += chunk_len;
|
||||
count -= chunk_len;
|
||||
|
||||
/* Chcek if packet is fully received */
|
||||
if (nu->rx_packet_len == nu->rx_skb->len) {
|
||||
/* Pass RX packet to driver */
|
||||
if (nu->ops.recv(nu, nu->rx_skb) != 0)
|
||||
nfc_err(nu->tty->dev, "corrupted RX packet\n");
|
||||
/* Next packet will be a new one */
|
||||
nu->rx_skb = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -- Default recv handler -- */
|
||||
static int nci_uart_default_recv(struct nci_uart *nu, struct sk_buff *skb)
|
||||
{
|
||||
return nci_recv_frame(nu->ndev, skb);
|
||||
}
|
||||
|
||||
int nci_uart_register(struct nci_uart *nu)
|
||||
{
|
||||
if (!nu || !nu->ops.open ||
|
||||
|
@ -402,12 +396,6 @@ int nci_uart_register(struct nci_uart *nu)
|
|||
/* Set the send callback */
|
||||
nu->ops.send = nci_uart_send;
|
||||
|
||||
/* Install default handlers if not overridden */
|
||||
if (!nu->ops.recv_buf)
|
||||
nu->ops.recv_buf = nci_uart_default_recv_buf;
|
||||
if (!nu->ops.recv)
|
||||
nu->ops.recv = nci_uart_default_recv;
|
||||
|
||||
/* Add this driver in the driver list */
|
||||
if (nci_uart_drivers[nu->driver]) {
|
||||
pr_err("driver %d is already registered\n", nu->driver);
|
||||
|
@ -453,7 +441,6 @@ void nci_uart_set_config(struct nci_uart *nu, int baudrate, int flow_ctrl)
|
|||
EXPORT_SYMBOL_GPL(nci_uart_set_config);
|
||||
|
||||
static struct tty_ldisc_ops nci_uart_ldisc = {
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.owner = THIS_MODULE,
|
||||
.name = "n_nci",
|
||||
.open = nci_uart_tty_open,
|
||||
|
@ -469,7 +456,6 @@ static struct tty_ldisc_ops nci_uart_ldisc = {
|
|||
|
||||
static int __init nci_uart_init(void)
|
||||
{
|
||||
memset(nci_uart_drivers, 0, sizeof(nci_uart_drivers));
|
||||
return tty_register_ldisc(N_NCI, &nci_uart_ldisc);
|
||||
}
|
||||
|
||||
|
|
|
@ -285,7 +285,6 @@ static void v253_wakeup(struct tty_struct *tty)
|
|||
}
|
||||
|
||||
struct tty_ldisc_ops v253_ops = {
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "cx20442",
|
||||
.owner = THIS_MODULE,
|
||||
.open = v253_open,
|
||||
|
|
|
@ -395,7 +395,6 @@ static void cx81801_wakeup(struct tty_struct *tty)
|
|||
}
|
||||
|
||||
static struct tty_ldisc_ops cx81801_ops = {
|
||||
.magic = TTY_LDISC_MAGIC,
|
||||
.name = "cx81801",
|
||||
.owner = THIS_MODULE,
|
||||
.open = cx81801_open,
|
||||
|
|
Loading…
Reference in New Issue