linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Serial uart detection script for udev
@ 2006-05-11  9:40 Ilkka Tuohela
  2006-05-11 10:00 ` Kay Sievers
  2006-05-11 12:11 ` Ilkka Tuohela
  0 siblings, 2 replies; 3+ messages in thread
From: Ilkka Tuohela @ 2006-05-11  9:40 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]


Attached is a small script to find out UART for a serial device from
udev rules. I have installed the script to /lib/udev/serial_uart. It
would be nice to get this script to standard udev distribution as well.

I need this script for globetrotter gprs pcmcia-card, which has two
serial ports: one is a proprietary control port not usable from linux
which can be recognized by 16450 UART, other is the real serial device
to use with 16550A UART.

To explain this further here is my rule file for this card:

ACTION!="add", GOTO="globetrotter_end"

SYSFS{prod_id1}=="Option International", SYSFS{prod_id2}=="GSM/GPRS
GlobeTrotter", IMPORT{program}="serial_uart %p"

### Control channel device, not really used in linux
SYSFS{prod_id1}=="Option International", SYSFS{prod_id2}=="GSM/GPRS
GlobeTrotter", ENV{SERIAL_UART}=="16450", SYMLINK
+="globetrotter/control"

### Normal serial device
SYSFS{prod_id1}=="Option International", SYSFS{prod_id2}=="GSM/GPRS
GlobeTrotter", ENV{SERIAL_UART}=="16550A", SYMLINK
+="globetrotter/serial"

# Now set pincode to the serial device
SYSFS{prod_id1}=="Option International", SYSFS{prod_id2}=="GSM/GPRS
GlobeTrotter", ENV{SERIAL_UART}=="16550A",
RUN="/etc/udev/scripts/globetrotter-pincode.sh %k"

LABEL="globetrotter_end"

I think it would be actually better that UART for a serial port would be
available directly as SYSFS attribute, but this system works as well.

-- 
Ilkka Tuohela / Nixu Oy <Ilkka.Tuohela@nixu.com>
PGP-fingerprint: EAE2 B9CF BFE3 A6A1 09DD  3C12 C721 CF5A EB00 F285
Mobile phone: +358-40-5233174


[-- Attachment #2: serial_uart --]
[-- Type: application/x-shellscript, Size: 742 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-11 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-11  9:40 Serial uart detection script for udev Ilkka Tuohela
2006-05-11 10:00 ` Kay Sievers
2006-05-11 12:11 ` Ilkka Tuohela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).