Single RS232 port Telit and CMUX mode (GSM 27.010 / n_gsm)

Tim Small tim at seoss.co.uk
Tue Jul 4 08:21:34 UTC 2017


On 03/07/17 17:39, Dan Williams wrote:
> There should be some way to link the different ports created with the
> gsmtty ldisc to their "physical" serial port.  For each of the gsmtty
> devices in sysfs (eg, /sys/class/tty/gsmtty0 or so) can you:
> 
> ls -al /sys/class/tty/gsmtty0

Hi Dan,

Thanks for your response.

The devices seem to start from 1 (and end at 63, but the module which
I'm using only supports 1 to 4 I believe?):

~# ls -al /sys/class/tty/gsmtty1
lrwxrwxrwx 1 root root 0 Jul  3 18:08 /sys/class/tty/gsmtty1 ->
../../devices/virtual/tty/gsmtty1

~# udevadm info /sys/class/tty/gsmtty1
P: /devices/virtual/tty/gsmtty1
N: gsmtty1
E: DEVNAME=/dev/gsmtty1
E: DEVPATH=/devices/virtual/tty/gsmtty1
E: ID_MM_CANDIDATE=1
E: ID_MM_TELIT_PORT_TYPE_MODEM=1
E: ID_MM_TTY_BAUDRATE=115200
E: MAJOR=245
E: MINOR=1
E: SUBSYSTEM=tty

~# udevadm info /sys/devices/virtual/tty/gsmtty1
P: /devices/virtual/tty/gsmtty1
N: gsmtty1
E: DEVNAME=/dev/gsmtty1
E: DEVPATH=/devices/virtual/tty/gsmtty1
E: ID_MM_CANDIDATE=1
E: ID_MM_TELIT_PORT_TYPE_MODEM=1
E: ID_MM_TTY_BAUDRATE=115200
E: MAJOR=245
E: MINOR=1
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=1323561699
E: net.ifnames=0

The ID_MM vars are from a custom udev rule which I added, e.g.

DEVPATH=="/devices/virtual/tty/gsmtty1",
ENV{ID_MM_TTY_BAUDRATE}="115200", ENV{ID_MM_CANDIDATE}="1",
ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1"


> and we can go from there.  We might also be able to use udev to figure
> it out, though that's often not as useful for virtual devices.  But the
> kernel gsmtty code does have specific calls to link the MUX ports to
> the parent.
> 
> Basically, we just want each of the MUX ports to show as serial ports
> of the same base modem.  Then you would get PPP and control muxed over
> the same port and MM would be aware of it :)

I had a bit of a poke around before sending the original email, but I
couldn't see an obvious way of linking the muxed and physical ports via
udev or sysfs.  Arguably there should be I suppose, and I can have a go
at hacking something up in the n_gsm kernel module perhaps?  What do you
think?

Tim.


More information about the ModemManager-devel mailing list