History log of /freebsd-current/sys/dev/usb/serial/umodem.c
Revision Date Author Comments
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# eebd9d53 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: Simplify BSD-2-Clause AND BSD-2-Clause

After removing the -FreeBSD and -NetBSD, we're left with a nuber of
BSD-2-Clause AND BSD-2-Clause, so tidy that up.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# b61a5730 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 73c3e8b1 17-Jan-2023 Steffen Dirkwinkel <s.dirkwinkel@beckhoff.com>

umodem: add quirk to ignore CDC_CM descriptor

Some devices have CDC_CM descriptors that would point us to
the wrong interfaces. Add a quirk to ignore those (prefering the
CDC_UNION descriptor effectively)

Reviewed by: manu
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37942


# 40e43b05 30-Aug-2022 Hans Petter Selasky <hselasky@FreeBSD.org>

umodem(4): Clear stall at every open.

Some controllers like the XHCI(4) loose track of the data toggle value when
USB receive transfers are cancelled at close. This in turn can lead to to
data loss after the next open.

To avoid data loss, make sure both the receive and transmit data toggles
get reset, before trying to read or write any data.

Differential Revision: https://reviews.freebsd.org/D36391
Submitted by: Dave Baukus <daveb@spectralogic.com>
MFC after: 1 week
Sponsored by: NVIDIA Networking


# bc9372d7 06-May-2022 John Baldwin <jhb@FreeBSD.org>

usb: Remove unused devclass arguments to DRIVER_MODULE.


# 28d54982 31-Aug-2021 Kornel Duleba <mindal@semihalf.com>

umodem: Add Huawei E3372h-320 device id

After switching the dongle to the Huawei alternate mode(modem mode)
with usb_modeswitch the serial interfaces had all of their ids set to
0xFF.
After modifying umodem to work with that it attached successfully and
I've managed to configure device with standard AT commands to get
internet connection.


# ec97e9ca 20-Aug-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Fully revert f83f5d58394db57576bbed6dc7531997cabeb102 for the sys/dev/usb/serial
folder, only keeping the zero length packet API introduced in sys/dev/usb
after more reports of USB serial devices not supporting ZLPs.

Reported by: mav@
MFC after: 1 week
Sponsored by: NVIDIA Networking


# f83f5d58 05-Jul-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Send a zero-length-packet first when opening a BULK endpoint for USB serial
port devices. If it gets eaten it is fine. Many USB device side implementations
don't properly support the clear endpoint halt command and if they do, data is lost
because the transmit FIFO is typically reset when this command is received.

Tested by: jmg
MFC after: 1 week
Sponsored by: NVIDIA Networking


# 8463bd8a 21-Sep-2020 Hans Petter Selasky <hselasky@FreeBSD.org>

Add support for Winbond USB CDC modem device found in Tenma power supply.

PR: 249384
MFC after: 1 week
Submitted by: darius@dons.net.au
Sponsored by: Mellanox Technologies // NVIDIA Networking


# 9dd3156e 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

usb: clean up empty lines in .c and .h files


# f8d2b1f3 15-Feb-2020 Pawel Biernacki <kaktus@FreeBSD.org>

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked). Use it in
preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Reviewed by: hselasky, kib
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D23632


# f86e6000 04-Dec-2019 Warner Losh <imp@FreeBSD.org>

Regularize my copyright notice

o Remove All Rights Reserved from my notices
o imp@FreeBSD.org everywhere
o regularize punctiation, eliminate date ranges
o Make sure that it's clear that I don't claim All Rights reserved by listing
All Rights Reserved on same line as other copyright holders (but not
me). Other such holders are also listed last where it's clear.


# 7762e8a1 25-Apr-2018 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make it possible (controlled via sysctl, enabled by default) to mark
device-side (and only device-side) "virtual USB serial adapters" - the
ones you can get with an OTG-capable board - as consoles. It boils down
to adding the device name to kern.console sysctl, although doing that
requires jumping through some hoops. It doesn't change the actual
operation of those virtual devices. The point is to make it possible
for init(8) to recognize them as console devices and to launch getty(8)
for them, when configured as "onifconsole" in ttys(5). The point of
that, in turn, is to add such entries to the default ttys(5), so that
init(8) will launch gettys for device-side "virtual serial adapters",
but not for actual USB serial dongles.

Reviewed by: hselasky@
No objections: imp@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# cdadbbb0 18-Jan-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Improve support for USB based 3G/4G/5G dongles from Huawei.

PR: 192345
Sponsored by: Mellanox Technologies


# 718cf2cc 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# fe67c846 26-Jul-2016 Ian Lepore <ian@FreeBSD.org>

Annotate the usb-serial drivers which always return 0 for line status,
so that it'll be easier to find and fix them in the future.


# f809f280 10-Dec-2015 Warner Losh <imp@FreeBSD.org>

Create a USB_PNP_INFO and use it to export the existing PNP
tables. Some drivers needed some slight re-arrangement of declarations
to accommodate this. Change the USB pnp tables slightly to allow
better compatibility with the system by moving linux driver info from
start of each entry to the end. All other PNP tables in the system
have the per-device flags and such at the end of the elements rather
that at the beginning.

Differential Review: https://reviews.freebsd.org/D3458


# 27aae196 09-Jan-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Add support for USB device side mode to the USB modem driver.

MFC after: 1 week
Submitted by: br@


# ece4b0bd 05-Jan-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Make a bunch of USB debug SYSCTLs tunable, so that their value(s) can
be set before the USB device(s) are probed.


# 3d9b56b0 15-Dec-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Resolve USB driver identification conflict.

Reported by: Anish Mistry <amistry@am-productions.biz>
MFC after: 1 week


# 0fcefb43 17-Mar-2014 Ed Maste <emaste@FreeBSD.org>

Update NetBSD Foundation copyrights to 2-clause BSD

The NetBSD Foundation states "Third parties are encouraged to change the
license on any files which have a 4-clause license contributed to the
NetBSD Foundation to a 2-clause license."

This change removes clauses 3 and 4 from copyright / license blocks that
list The NetBSD Foundation as the only copyright holder.

Sponsored by: The FreeBSD Foundation


# c48efaec 31-Oct-2013 Adrian Chadd <adrian@FreeBSD.org>

Allow the Arduino Leonardo to work by supporting CDC=0 devices.

CDC=0 simply means "no command codes", CDC=1 means "AT command codes."
There's no driver change required! It's purely to tell the application
layer whether to speak AT commands or not. Things are all still serial.

PR: usb/183505
Reviewed by: hps
MFC after: 1 week


# c01fc06e 15-Aug-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Revert r239178 and implement two new functions, namely
"device_free_softc()" and "device_claim_softc()",
to allow USB serial drivers refcounting the softc.
These functions are used to grab the softc from
auto-free and to free the softc back to the correct
malloc type, respectivly.

Discussed with: jhb
MFC after: 2 weeks


# 5805d178 10-Aug-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Take advantage of new UCOM and bus functionality so that
the device_detach() function doesn't block on UCOM device
drivers until the TTY handle is closed by the userspace
application. This is implemented by a postpone of the
softc free where the UCOM structures reside until the
TTY references are gone.

Discussed with: kib, ed
MFC after: 2 weeks


# 4815449e 17-Apr-2012 Thomas Quinot <thomas@FreeBSD.org>

Fix typo in comment


# 6d917491 02-Apr-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix compiler warnings, mostly signed issues,
when USB modules are compiled with WARNS=9.

MFC after: 1 weeks


# 271ae033 12-Nov-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Style change.
- Make it easier to port the USB code to other platforms by only using
one set of memory functions for clearing and copying memory. None of
the memory copies are overlapping. This means using bcopy() is not
required.
- Fix a compile warning when USB_HAVE_BUSDMA=0
- Add missing semicolon in avr32dci.
- Update some comments.

MFC after: 1 week


# 6472ac3d 07-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


# 13ceb654 06-Nov-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Add support for new USB modem protocol.

PR: usb/159919
MFC after: 1 week


# 9cfbe3e7 24-Jun-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

- Export more USB device ID's.

MFC after: 3 days


# f1a16106 23-Jun-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

- Move all USB device ID arrays into so-called sections,
sorted according to the mode which they support:
host, device or dual mode
- Add generic tool to extract these data:
tools/bus_autoconf

Discussed with: imp
Suggested by: Robert Millan <rmh@debian.org>
PR: misc/157903
MFC after: 14 days


# a1538640 03-Feb-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix for detection of MTK 3329 GPS USB devices.

Submitted by: Mykhaylo Yehorov
PR: usb/153929
Approved by: thompsa (mentor)


# 58ccf5b4 11-Jan-2011 John Baldwin <jhb@FreeBSD.org>

Remove unneeded includes of <sys/linker_set.h>. Other headers that use
it internally contain nested includes.

Reviewed by: bde


# 6416c259 05-Nov-2010 Nick Hibma <n_hibma@FreeBSD.org>

Implement ucom_set_pnpinfo_usb() providing ttyname and port number
information through devd. My E220 now produces the notification (1 line):

+u3g0 at bus=1 hubaddr=1 port=0 devaddr=2 interface=0 \
vendor=0x12d1 product=0x1003 devclass=0x00 devsubclass=0x00 \
sernum="" release=0x0000 intclass=0xff intsubclass=0xff \
ttyname=U0 ttyports=2 on uhub0

Note: serial/ufoma and net/uhso still provide port number and tty name
(uhso only) information through sysctls, which should now be removed.

Reviewed by: hpselasky


# 015bb88f 03-Nov-2010 Nick Hibma <n_hibma@FreeBSD.org>

- Simplify the way unit/subunit allocation is done in ucom.
- hw.usb.ucom.cons_unit is now split into
hw.usb.ucom.cons_unit/...cons_subunit.

Note: The tunable/sysctl hw.usb.ucom.cons_unit needs to be reviewed if

a) a console was defined a USB serial devices, and a USB device with
more than 1 subunit is present, and this device is attached before the
device functioning as a console

or

b) a console was defined on a USB device with more than 1 subunit

Reviewed by: hps
MFC after: 2 weeks


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# ad658060 29-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r207077

Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
the illusion of a tunable setting but was always turned on regardless.


# b850ecc1 22-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
the illusion of a tunable setting but was always turned on regardless.

MFC after: 1 week


# 5aab223c 06-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r203903

Make umodem more tolerant for devices which modem descriptors are misplaced.

Reported by: Erick Wales
Submitted by: Hans Petter Selasky


# 3e889e24 14-Feb-2010 Andrew Thompson <thompsa@FreeBSD.org>

Make umodem more tolerant for devices which modem descriptors are misplaced.

Reported by: Erick Wales
Submitted by: Hans Petter Selasky


# a1028b88 30-Dec-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFC r200395

Add a quirk for the Curitel UM175 where setting multiplexing for call
management over the data endpoint causes communication to die.

Take this one step further and model it on the existing NetBSD quirk and import
other device IDs from them.

Obtained from: NetBSD


# 4b5437a1 10-Dec-2009 Andrew Thompson <thompsa@FreeBSD.org>

Add a quirk for the Curitel UM175 where setting multiplexing for call
management over the data endpoint causes communication to die.

Take this one step further and model it on the existing NetBSD quirk and import
other device IDs from them.

Obtained from: NetBSD


# c1b5138f 09-Dec-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFC r199816

Remove overuse of exclamation marks in kernel printfs, there mere fact a
message has been printed is enough to get someones attention. Also remove the
line number for DPRINTF/DPRINTFN, it already prints the funtion name and a
unique message.


# 767cb2e2 25-Nov-2009 Andrew Thompson <thompsa@FreeBSD.org>

Remove overuse of exclamation marks in kernel printfs, there mere fact a
message has been printed is enough to get someones attention. Also remove the
line number for DPRINTF/DPRINTFN, it already prints the funtion name and a
unique message.


# e792954d 29-Oct-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFC r197570

Add experimental support for usb serial console and polled mode during DDB.


# 655dc9d0 28-Sep-2009 Andrew Thompson <thompsa@FreeBSD.org>

Add experimental support for usb serial console and polled mode during DDB.

Submitted by: Hans Petter Selasky


# ed6d949a 22-Jun-2009 Andrew Thompson <thompsa@FreeBSD.org>

- Make struct usb_xfer opaque so that drivers can not access the internals
- Reduce the number of headers needed for a usb driver, the common case is just usb.h and usbdi.h


# 3c8d24f4 15-Jun-2009 Andrew Thompson <thompsa@FreeBSD.org>

Fix usb2_find_descriptor function name.


# a593f6b8 14-Jun-2009 Andrew Thompson <thompsa@FreeBSD.org>

s/usb2_/usb_|usbd_/ on all function names for the USB stack.


# e0a69b51 29-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

s/usb2_/usb_/ on all typedefs for the USB stack.


# 760bc48e 28-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

s/usb2_/usb_/ on all C structs for the USB stack.


# 9360ae40 20-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

Rename the usb sysctl tree from hw.usb2.* back to hw.usb.*.

Submitted by: Hans Petter Selasky


# f29a0724 20-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

- rename usb2_mode to usb_mode [1]
- change variable types to use the enum

Submitted by: Hans Petter Selasky [1]


# 4eae601e 05-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb@159909

- make usb2_power_mask_t 16-bit
- remove "usb2_config_sub" structure from "usb2_config". To compensate for this
"usb2_config" has a new field called "usb_mode" which select for which mode
the current xfer entry is active. Options are: a) Device mode only b) Host
mode only (default-by-zero) c) Both modes. This change was scripted using
the following sed script: "s/\.mh\././g".
- the standard packet size table in "usb_transfer.c" is now a function, hence
the code for the function uses less memory than the table itself.

Submitted by: Hans Petter Selasky


# ab42e8b2 20-Mar-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb @159430

- Move tunable defines into usb_core.h and dependancy towards usb_defs.h
- Leave hardcoded defines in "usb_defs.h".
- Allow overriding all tunable defines.
- Add more customisable typedefs.
- Correct maximum device number.

Submitted by: Hans Petter Selasky


# 296ade60 20-Mar-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb @159375,159376,159377

Further remove dependancy towards Giant.

Submitted by: Hans Petter Selasky


# c3beab6a 05-Mar-2009 Andrew Thompson <thompsa@FreeBSD.org>

Add support for the UNION interface descriptor, used by Nokia phones.

PR: usb/117185


# 9aef556d 01-Mar-2009 Andrew Thompson <thompsa@FreeBSD.org>

Rename the ushub device class back to uhub as it was in the old usb stack,
moused(8) looks for "uhub/ums" to decide if needs to load the module.

Reported by: Garrett Cooper


# deefe583 01-Mar-2009 Andrew Thompson <thompsa@FreeBSD.org>

Move the serial drivers from Giant to using their own mutexs.

Tested with: u3g, ubser, uplcom


# 5d38a4d4 24-Feb-2009 Ed Schouten <ed@FreeBSD.org>

Also use proper capitalisation of FreeBSD in other source files.

Approved by: thompsa


# 02ac6454 23-Feb-2009 Andrew Thompson <thompsa@FreeBSD.org>

Move the new USB stack into its new home.