I have a Red Hat Enterprise 6.2 machine with two on-board serial ports and a PCIe card with 8 additional serial ports (16C950 UARTs, 16C550 compliant). I've added the kernel option 8250.nr_uarts=10 so that all devices show up under /dev.

The two on-board devices show up as ttyS0 and ttyS1, as expected, but the serial ports on the PCIe card aren't being ordered by their I/O port as I would expect them to. Otherwise the devices work fine, it's just that it's not very elegant that the tty order doesn't match the order on the breakout cable for the board. Any ideas on how to change the order?

Edit: Thanks to info provided by Gilles, I have it mostly working now using a udev that writes an ordered NAME by matching on the KERNEL name. The output from udevadm info shows that is the only parameter that can be used to uniquely identify the individual devices (ttyS[2-9] all report the same information, except for the KERNEL parameter).

1 Answer
1

You should be able to change the device names with a udev rule. Run udevadm info -a -n /dev/ttyS2 to obtain characteristics of your device. Find attributes that uniquely identify the multiport card, and one attribute that identifies the port. Then write udev rules for each port. The rules might look like this:

Using udevadm, interestingly, it appears that there are no unique attributes on the devices on the multiport serial card. I created a udev rule that matches using KERNEL for the kernel name for the device and then provides a NAME with the corrected ordered name for the device. I'm not sure if that is optimal, but it appears to be working well right now.
–
LinvilleJun 18 '13 at 20:42