Re: [PATCH 4/4] tty: n_gsm: add ioctl to map serial device to mux'ed tty

From: Alan Cox
Date: Tue Jul 09 2019 - 11:22:38 EST


On Mon, 8 Jul 2019 21:02:52 +0200
Martin HundebÃll <martin@xxxxxxxxxx> wrote:

> Guessing the base tty for a gsm0710 multiplexed serial device is not
> currently possible, which makes it racy to use with multiple modems.
>
> Add a way to map the physical serial tty to its related mux devices
> using a ioctl.

That looks very sensible

> + int base;
>
> /* open the serial port connected to the modem */
> fd = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NDELAY);
> @@ -58,6 +61,11 @@ Major parts of the initialization program :
> c.mtu = 127;
> /* set the new configuration */
> ioctl(fd, GSMIOC_SETCONF, &c);
> + /* get and print base gsmtty device node */
> + ioctl(fd, GSMIOC_GETBASE, &base);

Can we at least use a specific sized type ? uint32_t or whatever is fine.

Alan