linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilkka Tuohela <hile@nixu.com>
To: linux-hotplug@vger.kernel.org
Subject: Serial uart detection script for udev
Date: Thu, 11 May 2006 09:40:42 +0000	[thread overview]
Message-ID: <1147340442.12646.64.camel@stheno.ner.dy.fi> (raw)

[-- 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 --]

             reply	other threads:[~2006-05-11  9:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-11  9:40 Ilkka Tuohela [this message]
2006-05-11 10:00 ` Serial uart detection script for udev Kay Sievers
2006-05-11 12:11 ` Ilkka Tuohela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1147340442.12646.64.camel@stheno.ner.dy.fi \
    --to=hile@nixu.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).