CY(4)

πŸ’– CY(4) πŸ’–

the Cyclades Cyclom-Y serial driver, explained by your favorite Unix bestie πŸŽ€


✨ NAME ✨

cy β€” Cyclades Cyclom-Y serial driver

yes bestie that's the whole name section, it's giving minimalist πŸ‘‘


🌸 SYNOPSIS 🌸

okay so first things first, how do you even get this thing into your kernel? depends on your hardware, so let's go case by case πŸ¦‹

one ISA card

device cy

and in /boot/device.hints:

hint.cy.0.at="isa"
hint.cy.0.irq="10"
hint.cy.0.maddr="0xd4000"
hint.cy.0.msize="0x2000"

two ISA cards

device cy

and in /boot/device.hints:

hint.cy.0.at="isa"
hint.cy.0.irq="10"
hint.cy.0.maddr="0xd4000"
hint.cy.0.msize="0x2000"
hint.cy.1.at="isa"
hint.cy.1.irq="11"
hint.cy.1.maddr="0xd6000"
hint.cy.1.msize="0x2000"

PCI cards

device cy
options CY_PCI_FASTINTR

and the slayest part: for PCI cards, no lines are required in /boot/device.hints at all. she just works πŸ’…

minor numbering

okay this little diagram is iconic and you WILL need it, so here it is, untouched:

0bMMMMMMMMMMMMMMMMxxxxxxxxOLIMMMMM
                                       callOut
                                        Lock
                                         Initial
               MMMMMMMMMMMMMMMM           MMMMMMinor

read it slow, it's a whole vibe check on how the bits break down 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

The cy driver provides support for Cirrus Logic CD1400-based EIA RS-232C (CCITT V.24) communications interfaces (ports) on Cyclades Cyclom-Y boards. Each CD1400 provides 4 ports. Cyclom-Y boards with various numbers of CD1400's are available. This driver supports up to 8 CD1400's (32 ports) per board. no cap, that's a lot of ports 🫢

Input and output for each line may set independently to the following speeds: 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, or 115200 bps. Other speeds of up to 150000 are supported by the termios interface but not by the sgttyb compatibility interface. The CD1400 is not fast enough to handle speeds above 115200 bps effectively. It can transmit on a single line at slightly more than 115200 bps, but when 4 lines are active in both directions its limit is about 90000 bps on each line. so like, don't ask her to do cardio on four lines at once, she's doing her best 😭

Serial ports controlled by the cy driver can be used for both callin and callout. For each port there is a callin device and a callout device. The minor number of the callout device is 128 higher than that of the corresponding callin port. The callin device is general purpose. Processes opening it normally wait for carrier and for the callout device to become inactive. The callout device is used to steal the port from processes waiting for carrier on the callin device. Processes opening it do not wait for carrier and put any processes waiting for carrier on the callin device into a deeper sleep so that they do not conflict with the callout session. The callout device is abused for handling programs that are supposed to work on general ports and need to open the port without waiting but are too stupid to do so. (we're calling them out fr fr πŸ’€)

The cy driver also supports an initial-state and a lock-state control device for each of the callin and the callout "data" devices. The minor number of the initial-state device is 32 higher than that of the corresponding data device. The minor number of the lock-state device is 64 higher than that of the corresponding data device. The termios settings of a data device are copied from those of the corresponding initial-state device on first opens and are not inherited from previous opens. Use stty(1) in the normal way on the initial-state devices to program initial termios states suitable for your setup. set it once, live your life ✨

The lock termios state acts as flags to disable changing the termios state. E.g., to lock a flag variable such as CRTSCTS, use stty crtscts on the lock-state device. Speeds and special characters may be locked by setting the corresponding value in the lock-state device to any nonzero value.

Correct programs talking to correctly wired external devices work with almost arbitrary initial states and almost no locking, but other setups may benefit from changing some of the default initial state and locking the state. In particular, the initial states for non (POSIX) standard flags should be set to suit the devices attached and may need to be locked to prevent buggy programs from changing them. E.g., CRTSCTS should be locked on for devices that support RTS/CTS handshaking at all times and off for devices that do not support it at all. CLOCAL should be locked on for devices that do not support carrier. HUPCL may be locked off if you do not want to hang up for some reason.

⚠️ In general, very bad things happen if something is locked to the wrong state, and things should not be locked for devices that support more than one setting. The CLOCAL flag on callin ports should be locked off for logins to avoid certain security holes, but this needs to be done by getty if the callin port is used for anything else. bestie please read this part twice, locking the wrong flag is not a slay, it's a cry 😭

πŸŽ€ Kernel Configuration Options πŸŽ€

The CY_PCI_FASTINTR option should be used to avoid suboptimal interrupt handling for PCI Cyclades boards. The PCI BIOS must be configured with the cy interrupt not shared with any other active device for this option to work. This option is not the default because it is currently harmful in certain cases where it does not work. so like, it's a "know what you're doing" girlie πŸ‘‘


πŸ’œ FILES πŸ’œ

  • /dev/ttyc?? β€” for callin ports
  • /dev/ttyic??
  • /dev/ttylc?? β€” corresponding callin initial-state and lock-state devices
  • /dev/cuac?? β€” for callout ports
  • /dev/cuaic??
  • /dev/cualc?? β€” corresponding callout initial-state and lock-state devices
  • /etc/rc.serial β€” examples of setting the initial-state and lock-state devices

The first question mark in these device names is short for the card number (a decimal number between 0 and 65535 inclusive). The second question mark is short for the port number (a letter in the range [0-9a-v]). two little ?s carrying the whole identity of your port, main character energy πŸ’…


🌈 DIAGNOSTICS 🌈

  • cy%d: silo overflow. Problem in the interrupt handler.
  • cy%d: interrupt-level buffer overflow. Problem in the bottom half of the driver.
  • cy%d: tty-level buffer overflow. Problem in the application. Input has arrived faster than the given module could process it and some has been lost.

three moods of overflow and none of them are cute, but now you know which layer to blame πŸ¦‹


⭐ SEE ALSO ⭐

stty(1), termios(4), tty(4), comcontrol(8), pstat(8)


🌸 HISTORY 🌸

The cy driver is derived from the sio driver and the NetBSD cy driver and is currently under development. she's still cooking πŸ“


πŸ’€ BUGS πŸ’€

Serial consoles are not implemented. so if that was your whole plan, it's giving plot twist πŸ™ˆ


and that's the whole page bestie, you ate it, go forth and configure your serial ports responsibly πŸŽ€βœ¨

this page came from the Debian folks and is dated May 24, 2004 β€” yes it's an elder icon, respect her πŸ‘‘. love you, bye πŸ’–

πŸ“¦ where this page comes from