From f9cdab9b956447e334dd3e9226019db10c6a35cb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 19:55:14 +0000 Subject: [PATCH 1/2] Support the MultiTech MT9234MU: find it on Linux, page ATI11 - libdmodemctl: a command's response in pages (ATI11 on the Agere modems, the MultiTech MT9234 among them) stops at "Press any key". The session now sends a space at that prompt, for 8 pages at most, and keeps the prompt out of the response. So the Call Stats page gets the full report instead of a timeout. Text typed in the terminal is left to the user. A test covers it. - Linux: usbmodem.c finds an MT9234MU or MT9234ZBA-USB in sysfs. The line settings show its ttyUSB with a "Use" button, or say that it needs mts_mt9234mu.fw (or the ti_usb_3410_5052 driver). Its port opens with RTS/CTS (the modem's &K3). - docs/design.md: hardware modems on each system, the firmware file and the country setting (AT%T19). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01B82eRTNWiwCE3duMg28226 --- README.md | 4 +- core/src/session.c | 40 +++++++++- core/test/dmodemctl_test.c | 27 +++++++ docs/design.md | 41 +++++++++++ linux/CMakeLists.txt | 1 + linux/src/app.h | 17 +++++ linux/src/config.c | 35 ++++++++- linux/src/modem.c | 4 + linux/src/usbmodem.c | 147 +++++++++++++++++++++++++++++++++++++ 9 files changed, 312 insertions(+), 4 deletions(-) create mode 100644 linux/src/usbmodem.c diff --git a/README.md b/README.md index c2afe2c..e594561 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ libdmodemctl. Thus they operate in the same way. LGPL-2.0-or-later: `core/licenses/syncterm-fonts-LGPL-2.0.txt`) - **Settings**: each modem setting as a native control, from AT!M - **Call Stats**: the rate, modulation, error control and line figures of the last call (AT#UD, ATI11) -- **Line settings**: a SIP account, a USB modem, or a modem that already runs +- **Line settings**: a SIP account, a USB modem, or a modem that already runs (dmodemd, or a hardware modem such as the MultiTech MT9234MU) - **Windows 95 and later**: plain Win32, built with Open Watcom. On Windows 9x, the app connects to a modem through TCP or a COM port | | Windows | macOS | Linux | @@ -59,7 +59,7 @@ D-Modem 1.0. ## Documentation -- [Design](docs/design.md): how the apps are built, what they share, and the Windows 9x notes +- [Design](docs/design.md): how the apps are built, what they share, hardware modems (the MultiTech MT9234MU), and the Windows 9x notes - [libdmodemctl](core/include/dmodemctl.h): the API of the library - [Documentation style](docs/STYLE.md): the rules for ASD-STE100 Simplified Technical English diff --git a/core/src/session.c b/core/src/session.c index fc0b4ce..ebb5a1b 100644 --- a/core/src/session.c +++ b/core/src/session.c @@ -43,6 +43,8 @@ /* a line longer than this keeps only its end (a configurator's screens come with no line ends, and its OK after the last one) */ #define LINE_MAX 4096 +/* the most pages of one response that the session pages on */ +#define PAGES_MAX 8 /* voice: how far ahead of the line our samples go (60 ms), how many of the far end's are kept (1 s), how many of ours may wait (a third of @@ -120,6 +122,10 @@ struct dmc_session { struct command *queue, *active; int64_t active_until; int echo_seen; + /* the pages of its response that the session paged on (a key sent + to "Press any key") */ + int pages; + int prompt; /* the rest of the prompt's line: dropped */ dmc_buf response; int next_tag; /* the events, and the one dmc_next_event() last gave */ @@ -378,6 +384,8 @@ static void pump(dmc_session *s) s->active = c; s->active_until = s->now + c->timeout_ms; s->echo_seen = 0; + s->pages = 0; + s->prompt = 0; buf_clear(&s->response); buf_adds(&s->out, c->cmd); buf_addc(&s->out, '\r'); @@ -770,6 +778,17 @@ static void line_in(dmc_session *s, const char *l) static void voice_byte(dmc_session *s, unsigned char c); +/* whether l is a pager's prompt: a modem that shows a long response in + pages (ATI11 on the Agere modems, the MultiTech MT9234 among them) + stops after each page at "Press any key to continue; ESC to quit" */ +static int pager_prompt(const char *l) +{ + for (; *l; l++) + if (starts_ci(l, "any key")) + return 1; + return 0; +} + void dmc_feed(dmc_session *s, const char *data, int n) { if (s->state == DMC_CLOSED) @@ -783,16 +802,35 @@ void dmc_feed(dmc_session *s, const char *data, int n) int quiet = s->active && (s->active->flags & DMC_QUIET); if (!quiet) buf_addc(&s->term, c); + if (c == '\n' && s->prompt) { + s->prompt = 0; + continue; + } if (c == '\n') { line_in(s, buf_str(&s->line)); buf_clear(&s->line); continue; } - if (c == '\r') + if (c == '\r') { + s->prompt = 0; + continue; + } + if (s->prompt) continue; if (s->line.n >= LINE_MAX) buf_drop(&s->line, s->line.n - LINE_MAX / 2); buf_addc(&s->line, c); + /* a command's response in pages: the next page asked for + (a space), the prompt kept out of the response */ + if (s->active && (s->state == DMC_IDLE || + s->state == DMC_ONLINE_COMMAND) && + s->pages < PAGES_MAX && pager_prompt(buf_str(&s->line))) { + buf_addc(&s->out, ' '); + buf_clear(&s->line); + s->prompt = 1; + s->pages++; + s->active_until = s->now + s->active->timeout_ms; + } } } diff --git a/core/test/dmodemctl_test.c b/core/test/dmodemctl_test.c index 1ad905b..71cc34b 100644 --- a/core/test/dmodemctl_test.c +++ b/core/test/dmodemctl_test.c @@ -140,6 +140,32 @@ static void test_command(void) dmc_session_free(s); } +/* a response in pages (ATI11 on an Agere modem, a MultiTech MT9234): + a space for each "Press any key", the prompt kept out of the response */ +static void test_pages(void) +{ + dmc_session *s = dmc_session_new(); + dmc_event ev; + dmc_open(s, 0); + int tag = dmc_command(s, "ATI11", DMC_QUIET, 0); + CHECK_STR(out(s), "ATI11\r"); + feed(s, "ATI11\r\r\nLast Connection V.92\r\n" + "Press any key to continue; ESC to quit"); + CHECK_STR(out(s), " "); + CHECK(!next_of(s, DMC_EV_RESPONSE, &ev)); + feed(s, "\r\nNear Echo Level NA\r\n\r\nOK\r\n"); + CHECK_STR(out(s), ""); + CHECK(next_of(s, DMC_EV_RESPONSE, &ev)); + CHECK(ev.tag == tag && ev.ok); + CHECK_STR(ev.text, "Last Connection V.92\n\nNear Echo Level NA"); + /* text typed in the terminal is the user's own: no key sent */ + dmc_type(s, "ATI11\r", 6); + out(s); + feed(s, "ATI11\r\r\nPress any key to continue"); + CHECK_STR(out(s), ""); + dmc_session_free(s); +} + /* a call: dial, connect, online data, hang up through the escape */ static void test_call(void) { @@ -1185,6 +1211,7 @@ int main(int argc, char **argv) const char *dir = argc > 1 ? argv[1] : "."; CHECK(dmc_version() == DMC_VERSION); test_command(); + test_pages(); test_call(); test_unsolicited(); test_typed(); diff --git a/docs/design.md b/docs/design.md index f67b1ba..4f7954a 100644 --- a/docs/design.md +++ b/docs/design.md @@ -109,6 +109,47 @@ the pty in the group of the user (`-g`). Thus dmodemd does not need root. Each app can also use a modem that already runs: a device path on Linux and macOS, or a TCP address or a COM port on Windows. +## Hardware modems: the MultiTech MT9234MU + +The "device" line can also open a hardware modem. The apps send AT commands +to it and read its result codes, as they do with dmodemd. The Settings page +needs `AT!M`, thus it operates only with dmodemd. + +The MultiTech MultiMobile MT9234MU (USB 06E0:F114) and the MT9234ZBA-USB +(06E0:F115, 06E0:0319) are V.92 data and fax modems. They have a TI TUSB3410 +USB UART. The TUSB3410 has no firmware of its own. The host downloads the +firmware into the chip each time you connect the modem. + +| | Linux | macOS | Windows | +| --- | --- | --- | --- | +| Driver | `ti_usb_3410_5052` (in the kernel) | we do not know a driver for the MT9234MU. The CDC-ACM models (MT9234MU-CDC) use the driver of the system | the driver of MultiTech | +| Firmware | `mts_mt9234mu.fw` in `/lib/firmware` | not applicable | the driver of MultiTech has it | +| The port | `/dev/ttyUSB0` | `/dev/cu.usbmodem*` (CDC-ACM models) | a COM port | + +Linux does not include `mts_mt9234mu.fw` after June 2026. MultiTech gave no +license that lets other persons distribute it, thus linux-firmware removed +it. Get the file from the Linux driver of MultiTech, or from a +linux-firmware package from before that date. Put it in `/lib/firmware`, +then disconnect the modem and connect it again. + +On Linux, the app finds the modem in sysfs (`linux/src/usbmodem.c`). The +line settings show where the modem is, with a "Use" button. If the modem +has no firmware, they show what to do. When the app opens the port of the +modem, it sets RTS/CTS flow control (`CRTSCTS`). The modem uses `&K3` from +the factory. + +Set the country of the line with `AT%T19,0,` and `AT&F&W` in the +"Commands when the modem opens" field one time, or in the Terminal page. +`AT%T19,0,34` is the default (North America and Europe). + +`ATI11` on these modems (and on other Agere modems) shows its report on two +pages. After each page, the modem waits for a key ("Press any key"). The +library sends a space when a command of the app gets this prompt, thus the +Call Stats page gets the full report. It does this for 8 pages at most. In +the Terminal page, you push the key. + +We did not test this yet with a real MT9234MU. + ## Remote logins The Remote page logs in to a server, next to the modem, in a separate diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index bc796db..4093297 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -5,6 +5,7 @@ add_executable(dmodem-gui src/window.c src/modem.c src/config.c + src/usbmodem.c src/settings.c src/stats.c src/voice.c diff --git a/linux/src/app.h b/linux/src/app.h index b02cde9..7dd1886 100644 --- a/linux/src/app.h +++ b/linux/src/app.h @@ -102,6 +102,23 @@ gboolean config_sip_ready(const Config *c); /* the line settings dialog */ void prefs_show(App *a); +/* usbmodem.c: a MultiTech MT9234MU (or MT9234ZBA-USB) on USB, from + sysfs */ +typedef struct UsbModem { + char *name; /* "MultiTech MT9234MU" */ + char *tty; /* "/dev/ttyUSB0", or NULL if it has none */ + gboolean no_firmware; /* in the boot ROM: no firmware loaded */ +} UsbModem; +/* the first one plugged in, or NULL */ +UsbModem *usbmodem_find(void); +/* what it is and where, or what it needs, for the user */ +char *usbmodem_describe(const UsbModem *m); +/* whether Linux has its firmware file (mts_mt9234mu.fw) */ +gboolean usbmodem_firmware_present(void); +/* whether tty path is such a modem's */ +gboolean usbmodem_is(const char *path); +void usbmodem_free(UsbModem *m); + /* modem.c */ void modem_start(App *a); void modem_stop(App *a); diff --git a/linux/src/config.c b/linux/src/config.c index e92c1bc..0638cac 100644 --- a/linux/src/config.c +++ b/linux/src/config.c @@ -305,6 +305,37 @@ static AdwPreferencesGroup *group(AdwPreferencesPage *page, const char *title, return ADW_PREFERENCES_GROUP(g); } +static void use_found(GtkButton *b, gpointer data) +{ + Prefs *p = data; + gtk_editable_set_text(GTK_EDITABLE(p->device), + g_object_get_data(G_OBJECT(b), "tty")); +} + +/* a MultiTech MT9234MU plugged in: a row that says where it is (with a + button that puts it in Device), or what it needs */ +static void device_found(Prefs *p) +{ + UsbModem *m = usbmodem_find(); + if (!m) + return; + char *d = usbmodem_describe(m); + GtkWidget *r = adw_action_row_new(); + adw_preferences_row_set_title(ADW_PREFERENCES_ROW(r), "Found"); + adw_action_row_set_subtitle(ADW_ACTION_ROW(r), d); + if (m->tty) { + GtkWidget *b = gtk_button_new_with_label("Use"); + gtk_widget_set_valign(b, GTK_ALIGN_CENTER); + g_object_set_data_full(G_OBJECT(b), "tty", g_strdup(m->tty), + g_free); + g_signal_connect(b, "clicked", G_CALLBACK(use_found), p); + adw_action_row_add_suffix(ADW_ACTION_ROW(r), b); + } + adw_preferences_group_add(p->device_g, r); + g_free(d); + usbmodem_free(m); +} + static char *text_of(AdwEntryRow *r) { return g_strstrip(g_strdup(gtk_editable_get_text(GTK_EDITABLE(r)))); @@ -388,8 +419,10 @@ void prefs_show(App *a) p->alsa = entry(p->alsa_g, "ALSA device", c->alsa); p->device_g = group(page, "A modem that already runs", "dmodemd started as a service, or any modem's " - "serial port."); + "serial port (a MultiTech MT9234MU is " + "/dev/ttyUSB0)."); p->device = entry(p->device_g, "Device", c->device); + device_found(p); AdwPreferencesGroup *adv = group(page, "Advanced", NULL); p->init = entry(adv, "Commands when the modem opens", c->init); diff --git a/linux/src/modem.c b/linux/src/modem.c index 266ad77..d05117f 100644 --- a/linux/src/modem.c +++ b/linux/src/modem.c @@ -157,6 +157,10 @@ static gboolean open_dte(App *a, const char *path) cfsetispeed(&t, B115200); cfsetospeed(&t, B115200); t.c_cflag |= CLOCAL | CREAD; + /* (a MultiTech MT9234MU: RTS/CTS, its &K3, so that the + modem's buffer does not overflow in a fast call) */ + if (usbmodem_is(path)) + t.c_cflag |= CRTSCTS; tcsetattr(fd, TCSANOW, &t); } a->fd = fd; diff --git a/linux/src/usbmodem.c b/linux/src/usbmodem.c new file mode 100644 index 0000000..0be1d6f --- /dev/null +++ b/linux/src/usbmodem.c @@ -0,0 +1,147 @@ +/* + * SPDX-License-Identifier: AGPL-3.0-only + * Copyright (C) 2026 D-Modem Authors + * + * usbmodem.c - hardware modems on USB that the "device" line can open: + * the MultiTech MT9234MU and MT9234ZBA-USB, found in sysfs + * + * These modems have a TI TUSB3410 USB UART. Linux's ti_usb_3410_5052 + * driver downloads its firmware (mts_mt9234mu.fw) into the chip; then + * the modem is a ttyUSB. Without the firmware file the modem stays in + * the chip's boot ROM (one configuration) and has no tty. + */ +#include +#include +#include + +#include "app.h" + +/* MultiTech's vendor ID and the products with a TUSB3410 */ +static const struct { + const char *product, *name; +} models[] = { + { "f114", "MultiTech MT9234MU" }, + { "f115", "MultiTech MT9234ZBA-USB" }, + { "0319", "MultiTech MT9234ZBA-USB" }, +}; + +/* the firmware file's places that Linux looks in */ +static const char *const firmware[] = { + "/lib/firmware/updates/mts_mt9234mu.fw", + "/lib/firmware/mts_mt9234mu.fw", + "/usr/lib/firmware/updates/mts_mt9234mu.fw", + "/usr/lib/firmware/mts_mt9234mu.fw", + NULL +}; + +/* the trimmed text of sysfs file dir/name, or NULL */ +static char *attr(const char *dir, const char *name) +{ + char *path = g_build_filename(dir, name, NULL); + char *t = NULL; + if (g_file_get_contents(path, &t, NULL, NULL)) + g_strstrip(t); + g_free(path); + return t; +} + +/* the first ttyUSB under USB device dir's interfaces, as /dev/ttyUSBn, + or NULL */ +static char *tty_of(const char *dir) +{ + char *found = NULL; + GDir *d = g_dir_open(dir, 0, NULL); + if (!d) + return NULL; + const char *e; + while (!found && (e = g_dir_read_name(d))) { + /* (its interfaces: "1-2:2.0") */ + if (!strchr(e, ':')) + continue; + char *itf = g_build_filename(dir, e, NULL); + GDir *i = g_dir_open(itf, 0, NULL); + const char *t; + while (i && !found && (t = g_dir_read_name(i))) + if (g_str_has_prefix(t, "ttyUSB")) + found = g_strconcat("/dev/", t, NULL); + if (i) + g_dir_close(i); + g_free(itf); + } + g_dir_close(d); + return found; +} + +gboolean usbmodem_firmware_present(void) +{ + for (int i = 0; firmware[i]; i++) + if (g_file_test(firmware[i], G_FILE_TEST_EXISTS)) + return TRUE; + return FALSE; +} + +UsbModem *usbmodem_find(void) +{ + const char *root = "/sys/bus/usb/devices"; + GDir *d = g_dir_open(root, 0, NULL); + if (!d) + return NULL; + UsbModem *m = NULL; + const char *e; + while (!m && (e = g_dir_read_name(d))) { + char *dir = g_build_filename(root, e, NULL); + char *vid = attr(dir, "idVendor"); + char *pid = vid ? attr(dir, "idProduct") : NULL; + for (size_t k = 0; pid && !m && + k < sizeof(models) / sizeof(models[0]); k++) { + if (g_ascii_strcasecmp(vid, "06e0") || + g_ascii_strcasecmp(pid, models[k].product)) + continue; + m = g_new0(UsbModem, 1); + m->name = g_strdup(models[k].name); + m->tty = tty_of(dir); + char *nc = attr(dir, "bNumConfigurations"); + /* (one configuration: the boot ROM's) */ + m->no_firmware = !m->tty && nc && !strcmp(nc, "1"); + g_free(nc); + } + g_free(vid); + g_free(pid); + g_free(dir); + } + g_dir_close(d); + return m; +} + +char *usbmodem_describe(const UsbModem *m) +{ + if (m->tty) + return g_strdup_printf("%s at %s", m->name, m->tty); + if (m->no_firmware && !usbmodem_firmware_present()) + return g_strdup_printf("%s, with no firmware: put " + "mts_mt9234mu.fw in /lib/firmware, " + "then connect the modem again", m->name); + if (m->no_firmware) + return g_strdup_printf("%s, with no firmware: load the " + "ti_usb_3410_5052 driver, then connect " + "the modem again", m->name); + return g_strdup_printf("%s, with no serial port: load the " + "ti_usb_3410_5052 driver", m->name); +} + +gboolean usbmodem_is(const char *path) +{ + UsbModem *m = usbmodem_find(); + gboolean is = m && m->tty && path && !strcmp(m->tty, path); + usbmodem_free(m); + return is; +} + +void usbmodem_free(UsbModem *m) +{ + if (!m) + return; + g_free(m->name); + g_free(m->tty); + g_free(m); +} From 6324b7fff4a81e2f266a403a620169bf36436b41 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 21:15:43 +0000 Subject: [PATCH 2/2] Ship MultiTech's mts_mt9234mu.fw for Linux linux/firmware has MultiTech's firmware for the MT9234MU, with a README that gives its source (linux-firmware before June 2026), that its licence is unknown, and that the AGPL and commercial licences do not apply to it. cmake --install puts it in share/dmodem-gui/firmware; with -DDMODEM_GUI_INSTALL_FIRMWARE=ON also in /lib/firmware (and as mts_mt9234zba.fw). When a modem has no firmware, Settings now names the shipped copy and where to copy it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01B82eRTNWiwCE3duMg28226 --- docs/design.md | 9 ++++++--- linux/CMakeLists.txt | 15 +++++++++++++++ linux/firmware/README.md | 32 ++++++++++++++++++++++++++++++++ linux/firmware/mts_mt9234mu.fw | Bin 0 -> 13769 bytes linux/src/app.h | 2 ++ linux/src/usbmodem.c | 32 ++++++++++++++++++++++++++++---- 6 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 linux/firmware/README.md create mode 100644 linux/firmware/mts_mt9234mu.fw diff --git a/docs/design.md b/docs/design.md index 4f7954a..c47b4b0 100644 --- a/docs/design.md +++ b/docs/design.md @@ -128,13 +128,16 @@ firmware into the chip each time you connect the modem. Linux does not include `mts_mt9234mu.fw` after June 2026. MultiTech gave no license that lets other persons distribute it, thus linux-firmware removed -it. Get the file from the Linux driver of MultiTech, or from a -linux-firmware package from before that date. Put it in `/lib/firmware`, +it. This repository includes the file, with a notice +(`linux/firmware/README.md`). The AGPL-3.0 license does not apply to it. +`cmake --install` puts it in `share/dmodem-gui/firmware`, and +`-DDMODEM_GUI_INSTALL_FIRMWARE=ON` also puts it in `/lib/firmware`. Else, +copy it to `/lib/firmware` (for the MT9234ZBA-USB, as `mts_mt9234zba.fw`), then disconnect the modem and connect it again. On Linux, the app finds the modem in sysfs (`linux/src/usbmodem.c`). The line settings show where the modem is, with a "Use" button. If the modem -has no firmware, they show what to do. When the app opens the port of the +has no firmware, they show the command that copies the file. When the app opens the port of the modem, it sets RTS/CTS flow control (`CRTSCTS`). The modem uses `&K3` from the factory. diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 4093297..ef1554e 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -13,6 +13,11 @@ add_executable(dmodem-gui src/termview.c src/audio.c) target_link_libraries(dmodem-gui PRIVATE dmodemctl dmodemssh PkgConfig::GTK) +# where the MT9234MU's firmware is installed, and where it is in the source +include(GNUInstallDirs) +target_compile_definitions(dmodem-gui PRIVATE + DMODEM_FIRMWARE_DIR="${CMAKE_INSTALL_FULL_DATADIR}/dmodem-gui/firmware" + DMODEM_FIRMWARE_SRC="${CMAKE_CURRENT_SOURCE_DIR}/firmware") # the sound of voice calls: PulseAudio's client (PipeWire serves it # too); without it the app has no sound pkg_check_modules(PULSE IMPORTED_TARGET libpulse-mainloop-glib) @@ -39,6 +44,16 @@ install(FILES data/io.github.d_modem.DModem.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(FILES data/io.github.d_modem.DModem.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) +# MultiTech's firmware for the MT9234MU (licence unknown: linux/firmware/README.md) +install(FILES firmware/mts_mt9234mu.fw firmware/README.md + DESTINATION ${CMAKE_INSTALL_DATADIR}/dmodem-gui/firmware) +option(DMODEM_GUI_INSTALL_FIRMWARE + "Also install mts_mt9234mu.fw (and mts_mt9234zba.fw) in /lib/firmware" OFF) +if(DMODEM_GUI_INSTALL_FIRMWARE) + install(FILES firmware/mts_mt9234mu.fw DESTINATION /lib/firmware) + install(FILES firmware/mts_mt9234mu.fw DESTINATION /lib/firmware + RENAME mts_mt9234zba.fw) +endif() install(FILES ${PROJECT_SOURCE_DIR}/assets/dmodem.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps RENAME io.github.d_modem.DModem.svg) diff --git a/linux/firmware/README.md b/linux/firmware/README.md new file mode 100644 index 0000000..47e22db --- /dev/null +++ b/linux/firmware/README.md @@ -0,0 +1,32 @@ +# The firmware of the MultiTech modems + +| File | For | Size (octets) | SHA-1 | License | Source | +|---|---|---|---|---|---| +| mts_mt9234mu.fw | MultiTech MT9234MU and MT9234ZBA-USB (TI TUSB3410) | 13769 | `5537e93217c509129d5a870b9fe089cd58647070` | unknown | linux-firmware, before June 2026 (`WHENCE`: "Multi-Tech USB fax modems", "Licence: Unknown") | + +The TUSB3410 of these modems has no firmware of its own. The +`ti_usb_3410_5052` driver of Linux downloads this file into the chip each +time you connect the modem. The driver looks for the file in +`/lib/firmware`. The MT9234ZBA-USB uses the name `mts_mt9234zba.fw` for the +same code. + +To install it: + + sudo cp linux/firmware/mts_mt9234mu.fw /lib/firmware/ + sudo cp linux/firmware/mts_mt9234mu.fw /lib/firmware/mts_mt9234zba.fw + +Then disconnect the modem and connect it again. `cmake --install` puts the +file in `share/dmodem-gui/firmware`. With `-DDMODEM_GUI_INSTALL_FIRMWARE=ON`, +it also puts the file in `/lib/firmware`. + +Multi-Tech Systems, Inc. gave this file to the Linux kernel in 2010. The +file is TI's TUSB3410 UART firmware, compiled again by MultiTech with some +changes. The file has no copyright text and no license text. MultiTech did +not publish a license for it. In June 2026, linux-firmware removed it with +the other files that have an unknown license. + +We include the file so that the modem operates without a search for it. The +AGPL-3.0 license of D-Modem and the commercial license do not apply to this +file. Multi-Tech Systems, Inc. and Texas Instruments keep their rights in it. +If you are the holder of these rights and you do not agree, tell us and we +will remove the file. diff --git a/linux/firmware/mts_mt9234mu.fw b/linux/firmware/mts_mt9234mu.fw new file mode 100644 index 0000000000000000000000000000000000000000..09c1361f243396a9d99b2d9dac600d3325b096e2 GIT binary patch literal 13769 zcmb7r3wRUPmGGU1WEpp7BvZj;@9E0!gR4cT2co9|Ed$HmQV8Xi&M`~OW-+Dt$rgOThhAYogtJ@?K? zmJCU{7|-Lp?m6e4d+xpGj?Yvf8cm@m#S{1+z2Nucp1jZ%PDk@OckD`Q%dhy#fxt@J z^Wr-a(|}6ee`7>!(w;Vsh$ijHlzO^%#2x$7@s<-VcVvi1Z`%w$)gy&L&@mTW-f~^p z44~_rbjwX~Jo+~`l}D}xd>upeRL5{V z-4U;6Izp}kEmt<%DFBB(oOILI5d~~a$0q7opf&*2D=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gb3!O?2ddv?@&xxL`XEX|QHe`qc=q&W>|J1!|ji=J+iRtuG2sxSzSC9uE6 z^@abOXILFNzLMhCFzTq-z!UC)zz!m-w4^2oo|MAD)vWq+KgoX1A3CY zu5FOJEGEoHabr)qXO1f&SPho{y~Ppwa)ieMhn9SJ*4A>Dx&l&MzOe>cON-nwfiHV9S>x{^W<>Y;k*9%E0IBAU6OmyN59 zP0j>Ae}fY>B4wZL(S$p87(RX2Vb6z>unRs$hLd|w@jfXFJ_`84FHQf#2xZL{X^K1q z-zURY%J}UH{(2dI!%SGnSjd@wYaSS)`P%{B|}G9;>`cFHii9`J_cM( zv_I9>>TGLm{Mq?7DDHdp^1jybOb^>*z}?SJiV#| zSDM-0Ukv+I{3(4sS1Jw}M9y!OV9g|UXWbAvhlr#>!u;}AG0S1hOhUonWxb3R5PE6c z3&nAwAW`kqfz}t>Tbq7<{(v}fPxjudK0A99Nx6O-_btDj?W>V)!Ji29D|>8(MWH>g zfWYAkQ8a%9J6o5FB|4hB>SyBQ>}aw$UL0~X+8l5sYgo)z!l&IfeM87szRfRKFI@yj zI;j9i^4oBDgs}Stz>O)Nfv1AtorVvC8P356CLWJZ9H)9diw3Ms4wXJ)z7cXMYGq}p z#Rq?tLy^DA(Vi06VDh z+V6OuJO9r4w*;{5`~k4{1Pqe}+Axu9W|7;&!H^xM?0NkvUlHwM zJ88bM5RcyT*t(CLR3j4DID4H9v;C}}y~GZ%BkWQ3ZTA1OpTnQ~;GaLU|CfD_{Xgu# zvY)X3$(~}*vFF+26DbA>Xeo`Bj<*z@{{ZkobOita literal 0 HcmV?d00001 diff --git a/linux/src/app.h b/linux/src/app.h index 7dd1886..daec000 100644 --- a/linux/src/app.h +++ b/linux/src/app.h @@ -115,6 +115,8 @@ UsbModem *usbmodem_find(void); char *usbmodem_describe(const UsbModem *m); /* whether Linux has its firmware file (mts_mt9234mu.fw) */ gboolean usbmodem_firmware_present(void); +/* the copy of mts_mt9234mu.fw that comes with the app, or NULL */ +char *usbmodem_shipped_firmware(void); /* whether tty path is such a modem's */ gboolean usbmodem_is(const char *path); void usbmodem_free(UsbModem *m); diff --git a/linux/src/usbmodem.c b/linux/src/usbmodem.c index 0be1d6f..1a70f98 100644 --- a/linux/src/usbmodem.c +++ b/linux/src/usbmodem.c @@ -31,6 +31,8 @@ static const char *const firmware[] = { "/lib/firmware/mts_mt9234mu.fw", "/usr/lib/firmware/updates/mts_mt9234mu.fw", "/usr/lib/firmware/mts_mt9234mu.fw", + "/lib/firmware/mts_mt9234zba.fw", + "/usr/lib/firmware/mts_mt9234zba.fw", NULL }; @@ -113,14 +115,36 @@ UsbModem *usbmodem_find(void) return m; } +char *usbmodem_shipped_firmware(void) +{ + static const char *const dirs[] = { + DMODEM_FIRMWARE_DIR, DMODEM_FIRMWARE_SRC, NULL + }; + for (int i = 0; dirs[i]; i++) { + char *p = g_build_filename(dirs[i], "mts_mt9234mu.fw", NULL); + if (g_file_test(p, G_FILE_TEST_EXISTS)) + return p; + g_free(p); + } + return NULL; +} + char *usbmodem_describe(const UsbModem *m) { if (m->tty) return g_strdup_printf("%s at %s", m->name, m->tty); - if (m->no_firmware && !usbmodem_firmware_present()) - return g_strdup_printf("%s, with no firmware: put " - "mts_mt9234mu.fw in /lib/firmware, " - "then connect the modem again", m->name); + if (m->no_firmware && !usbmodem_firmware_present()) { + char *fw = usbmodem_shipped_firmware(); + /* (the MT9234ZBA-USB's driver asks for its own name) */ + const char *to = strstr(m->name, "ZBA") ? + "/lib/firmware/mts_mt9234zba.fw" : "/lib/firmware/"; + char *d = g_strdup_printf("%s, with no firmware: copy %s to " + "%s (sudo cp), then connect the " + "modem again", m->name, + fw ? fw : "mts_mt9234mu.fw", to); + g_free(fw); + return d; + } if (m->no_firmware) return g_strdup_printf("%s, with no firmware: load the " "ti_usb_3410_5052 driver, then connect "