Home | History | Annotate | Download | only in usb
History log of /src/sys/dev/usb/if_umb.c
RevisionDateAuthorComments
 1.27  18-Aug-2025  andvar Fix various typos, mainly in comments:
s/invaid/invalid/
s/instad/instead/
s/wich/with/
s/tranform/transform/
s/tranmist/transmit/
s/tranceiver/transceiver/
s/Tranparent/Transparent/
s/tranlated/translated/
s/tranfer/transfer/
s/tranmissions/transmissions/
s/condtions/conditions/
s/Recient/Recent/
 1.26  05-Jul-2024  rin sys: Drop redundant NULL check before m_freem(9)

m_freem(9) safely has accepted NULL argument at least since 4.2BSD:
https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/sys/uipc_mbuf.c

Compile-tested on amd64/ALL.

Suggested by knakahara@
 1.25  20-Aug-2022  riastradh branches: 1.25.8; 1.25.10;
umb(4): Use usbd_do_request as drivers are intended to do.
 1.24  17-Apr-2022  riastradh umb(4): Use memcpy, not potentially unaligned/aliased casts.
 1.23  17-Apr-2022  riastradh umb(4): Validate descriptor lengths.
 1.22  17-Apr-2022  riastradh umb(4): Use usb_cdc_descriptor_t for bDescriptorSubtype.

Note: This needs more length validation! TBD in a separate commit.
 1.21  21-Sep-2021  christos don't opencode kauth_cred_get()
 1.20  16-Jun-2021  riastradh if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around. And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail. (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint. This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken. However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.
 1.19  24-Mar-2020  maxv branches: 1.19.8;
Fix type confusion. Found by kASan when doing a normal attach+detach over
vHCI.
 1.18  21-Mar-2020  skrll KNF
 1.17  19-Mar-2020  khorben Only set the IPv4 address in umb(4) if both MBIM_IPCONF_HAS_ADDRINFO and
MBIM_IPCONF_HAS_GWINFO are available. Configuring umb(4) without gateway
wont work the system needs a destination address for the interface.
Problem found by jsg@.
OK jsg@ deraadt@

From OpenBSD.
 1.16  19-Mar-2020  khorben turn the success paths of FCC registration into debug prints. The
(unlikely) failure path remains noisy.
discussed with claudio

From OpenBSD.
 1.15  19-Mar-2020  khorben When there is no network around the state timeout fires over and over again.
Change the printf into a log and only under IFF_DEBUG to reduce dmesg spam.
Loudly requested by beck@ OK deraadt@

From OpenBSD.
 1.14  14-Mar-2020  christos revert the 0x% -> %# change for fixed width formats pointed out by uwe.
 1.13  13-Mar-2020  christos PR/55068: sc.dying: Fix printf formats:
- no %s/%p for kernel log
- 0x% -> %#
- always %j for kernel log
 1.12  04-Feb-2020  thorpej Use ifmedia_fini().
 1.11  29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.10  17-Dec-2019  christos branches: 1.10.2;
Protect network ioctls from non-authorized users. (Ilja Van Sprundel)
 1.9  26-Jun-2019  khorben branches: 1.9.2;
Fix typos

Some were found by OpenBSD.
 1.8  27-Jan-2019  pgoyette branches: 1.8.4;
Merge the [pgoyette-compat] branch
 1.7  15-Nov-2018  maxv Remove the 'copy' argument from m_devget(), unused. While here rename
off0->off.
 1.6  20-Sep-2018  khorben Prevent a panic in umb(4) when roaming is disabled

From OpenBSD.
 1.5  20-Sep-2018  khorben Use usb_rem_task_wait() now that it is available

This should avoid panics while detaching devices.
 1.4  01-Aug-2018  khorben branches: 1.4.4;
Fix building umb(4) on NetBSD-current

Patch by Robert Swindells; thank you!
 1.3  01-Aug-2018  khorben Allow kmem_alloc(9) to sleep when attaching

Without this, umb(4) may needlessly fail to attach, like when under memory
pressure.

Thanks skrll@ for the heads-up!
 1.2  01-Aug-2018  khorben Avoid parentheses in return statements (KNF)

NFCI.

Thanks skrll@ for the heads-up!
 1.1  31-Jul-2018  khorben Add a port of the umb(4) driver from OpenBSD

The umb(4) driver provides support for USB MBIM (Mobile Broadband
Interface Model) devices.

MBIM devices establish connections via cellular networks such as GPRS,
UMTS, and LTE. They appear as a regular point-to-point network interface, transporting raw IP frames.

Required configuration parameters like PIN and APN have to be set with
umbctl(8), a new tool specific to this driver. The IP address is configured
automatically; the default route and DNS server information have to be set
separately.

The driver is not fully functional yet, it is therefore still marked as
experimental and disabled by default. Any help welcome to complete it!

Tested on NetBSD/amd64, with a Sierra Wireless EM7345 LTE modem on a Lenovo
ThinkPad T440s. No functional change expected otherwise.
 1.4.4.4  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.4.4.3  30-Sep-2018  pgoyette Ssync with HEAD
 1.4.4.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.4.1  01-Aug-2018  pgoyette file if_umb.c was added on branch pgoyette-compat on 2018-09-06 06:56:04 +0000
 1.8.4.4  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.8.4.3  08-Apr-2020  martin Merge changes from current as of 20200406
 1.8.4.2  10-Jun-2019  christos Sync with HEAD
 1.8.4.1  27-Jan-2019  christos file if_umb.c was added on branch phil-wifi on 2019-06-10 22:07:33 +0000
 1.9.2.1  17-Dec-2019  martin Pull up following revision(s) (requested by christos in ticket #569):

sys/dev/usb/if_umb.c: revision 1.10
sys/net/if.c: revision 1.466
sys/dev/ic/ath.c: revision 1.129

Protect network ioctls from non-authorized users. (Ilja Van Sprundel)
 1.10.2.1  29-Feb-2020  ad Sync with head.
 1.19.8.1  17-Jun-2021  thorpej Sync w/ HEAD.
 1.25.10.1  02-Aug-2025  perseant Sync with HEAD
 1.25.8.2  16-Nov-2023  thorpej if_transmit_lock() and if_enqueue() are equivalent. if_enqueue() is
a better name, so collapse everything down to that and garbage-collect
if_transmit_lock().
 1.25.8.1  16-Nov-2023  thorpej IFQ_CLASSIFY() -> ifq_classify_packet().

RSS XML Feed