summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/dev/usb
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-20 15:53:03 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-21 10:29:39 +0200
commit18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d (patch)
treea3020ac5b1f366f2f0920941b589808e435dbcee /freebsd/sys/dev/usb
parentUpdate to FreeBSD head 2017-12-01 (diff)
downloadrtems-libbsd-18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d.tar.bz2
Update to FreeBSD head 2018-02-01
Git mirror commit d079ae0442af8fa3cfd6d7ede190d04e64a2c0d4. Update #3472.
Diffstat (limited to 'freebsd/sys/dev/usb')
-rw-r--r--freebsd/sys/dev/usb/controller/dwc_otg_fdt.c3
-rw-r--r--freebsd/sys/dev/usb/controller/ehci.c4
-rw-r--r--freebsd/sys/dev/usb/controller/ohci.c2
-rw-r--r--freebsd/sys/dev/usb/net/if_cdce.c3
-rw-r--r--freebsd/sys/dev/usb/net/if_mos.c2
-rw-r--r--freebsd/sys/dev/usb/quirk/usb_quirk.c1
-rw-r--r--freebsd/sys/dev/usb/serial/u3g.c52
-rw-r--r--freebsd/sys/dev/usb/serial/umodem.c12
-rw-r--r--freebsd/sys/dev/usb/storage/umass.c3
-rw-r--r--freebsd/sys/dev/usb/usb_dev.c14
-rw-r--r--freebsd/sys/dev/usb/usb_device.c134
-rw-r--r--freebsd/sys/dev/usb/wlan/if_rum.c7
-rw-r--r--freebsd/sys/dev/usb/wlan/if_run.c7
-rw-r--r--freebsd/sys/dev/usb/wlan/if_uath.c2
14 files changed, 214 insertions, 32 deletions
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
index 1cf96f4c..a7110887 100644
--- a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -175,7 +175,6 @@ int
dwc_otg_detach(device_t dev)
{
struct dwc_otg_fdt_softc *sc = device_get_softc(dev);
- int err;
/* during module unload there are lots of children leftover */
device_delete_children(dev);
@@ -186,7 +185,7 @@ dwc_otg_detach(device_t dev)
*/
dwc_otg_uninit(&sc->sc_otg);
- err = bus_teardown_intr(dev, sc->sc_otg.sc_irq_res,
+ bus_teardown_intr(dev, sc->sc_otg.sc_irq_res,
sc->sc_otg.sc_intr_hdl);
sc->sc_otg.sc_intr_hdl = NULL;
}
diff --git a/freebsd/sys/dev/usb/controller/ehci.c b/freebsd/sys/dev/usb/controller/ehci.c
index 557698f6..6e7c05f4 100644
--- a/freebsd/sys/dev/usb/controller/ehci.c
+++ b/freebsd/sys/dev/usb/controller/ehci.c
@@ -1204,9 +1204,7 @@ ehci_non_isoc_done_sub(struct usb_xfer *xfer)
static void
ehci_non_isoc_done(struct usb_xfer *xfer)
{
- ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
ehci_qh_t *qh;
- uint32_t status;
usb_error_t err = 0;
DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
@@ -1226,8 +1224,6 @@ ehci_non_isoc_done(struct usb_xfer *xfer)
usb_pc_cpu_invalidate(qh->page_cache);
- status = hc32toh(sc, qh->qh_qtd.qtd_status);
-
/* reset scanner */
xfer->td_transfer_cache = xfer->td_transfer_first;
diff --git a/freebsd/sys/dev/usb/controller/ohci.c b/freebsd/sys/dev/usb/controller/ohci.c
index df1981cc..48db76f0 100644
--- a/freebsd/sys/dev/usb/controller/ohci.c
+++ b/freebsd/sys/dev/usb/controller/ohci.c
@@ -2387,7 +2387,6 @@ ohci_xfer_setup(struct usb_setup_params *parm)
{
struct usb_page_search page_info;
struct usb_page_cache *pc;
- ohci_softc_t *sc;
struct usb_xfer *xfer;
void *last_obj;
uint32_t ntd;
@@ -2395,7 +2394,6 @@ ohci_xfer_setup(struct usb_setup_params *parm)
uint32_t nqh;
uint32_t n;
- sc = OHCI_BUS2SC(parm->udev->bus);
xfer = parm->curr_xfer;
parm->hc_max_packet_size = 0x500;
diff --git a/freebsd/sys/dev/usb/net/if_cdce.c b/freebsd/sys/dev/usb/net/if_cdce.c
index ececc5b3..9a15da69 100644
--- a/freebsd/sys/dev/usb/net/if_cdce.c
+++ b/freebsd/sys/dev/usb/net/if_cdce.c
@@ -288,6 +288,9 @@ static const STRUCT_USB_HOST_ID cdce_host_devs[] = {
{USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR),
USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x76),
USB_DRIVER_INFO(0)},
+ {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR),
+ USB_IFACE_SUBCLASS(0x03), USB_IFACE_PROTOCOL(0x16),
+ USB_DRIVER_INFO(0)},
};
static const STRUCT_USB_DUAL_ID cdce_dual_devs[] = {
diff --git a/freebsd/sys/dev/usb/net/if_mos.c b/freebsd/sys/dev/usb/net/if_mos.c
index a25e9df6..ad7bfcce 100644
--- a/freebsd/sys/dev/usb/net/if_mos.c
+++ b/freebsd/sys/dev/usb/net/if_mos.c
@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-kernel-space.h>
/*-
- * SPDX-License-Identifier: 0BSD AND BSD-4-Clause
+ * SPDX-License-Identifier: (BSD-1-Clause AND BSD-4-Clause)
*
* Copyright (c) 2011 Rick van der Zwet <info@rickvanderzwet.nl>
*
diff --git a/freebsd/sys/dev/usb/quirk/usb_quirk.c b/freebsd/sys/dev/usb/quirk/usb_quirk.c
index 8c9e91cb..3ae4a557 100644
--- a/freebsd/sys/dev/usb/quirk/usb_quirk.c
+++ b/freebsd/sys/dev/usb/quirk/usb_quirk.c
@@ -246,6 +246,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = {
USB_QUIRK(IOMEGA, ZIP100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI,
UQ_MSC_NO_TEST_UNIT_READY), /* XXX ZIP drives can also use ATAPI */
+ USB_QUIRK(JMICRON, JMS567, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN),
USB_QUIRK(JMICRON, JM20337, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI,
UQ_MSC_NO_SYNC_CACHE),
diff --git a/freebsd/sys/dev/usb/serial/u3g.c b/freebsd/sys/dev/usb/serial/u3g.c
index 0f3933e6..6f1cfdb1 100644
--- a/freebsd/sys/dev/usb/serial/u3g.c
+++ b/freebsd/sys/dev/usb/serial/u3g.c
@@ -202,6 +202,7 @@ static driver_t u3g_driver = {
static const STRUCT_USB_HOST_ID u3g_devs[] = {
#define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) }
+ U3G_DEV(ABIT, AK_020, 0),
U3G_DEV(ACERP, H10, 0),
U3G_DEV(AIRPLUS, MCD650, 0),
U3G_DEV(AIRPRIME, PC5220, 0),
@@ -310,7 +311,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = {
U3G_DEV(HUAWEI, E173, 0),
U3G_DEV(HUAWEI, E173_INIT, U3GINIT_HUAWEISCSI),
U3G_DEV(HUAWEI, E3131, 0),
- U3G_DEV(HUAWEI, E3131_INIT, U3GINIT_HUAWEISCSI),
+ U3G_DEV(HUAWEI, E3131_INIT, U3GINIT_HUAWEISCSI2),
U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI),
U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI),
U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI),
@@ -331,6 +332,8 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = {
U3G_DEV(HUAWEI, K4505, U3GINIT_HUAWEI),
U3G_DEV(HUAWEI, K4505_INIT, U3GINIT_HUAWEISCSI),
U3G_DEV(HUAWEI, ETS2055, U3GINIT_HUAWEI),
+ U3G_DEV(HUAWEI, E3272_INIT, U3GINIT_HUAWEISCSI2),
+ U3G_DEV(HUAWEI, E3272, 0),
U3G_DEV(KYOCERA2, CDMA_MSM_K, 0),
U3G_DEV(KYOCERA2, KPC680, 0),
U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI),
@@ -493,6 +496,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = {
U3G_DEV(QUANTA, GLX, 0),
U3G_DEV(QUANTA, Q101, 0),
U3G_DEV(QUANTA, Q111, 0),
+ U3G_DEV(QUECTEL, EC25, 0),
U3G_DEV(SIERRA, AC402, 0),
U3G_DEV(SIERRA, AC595U, 0),
U3G_DEV(SIERRA, AC313U, 0),
@@ -632,6 +636,45 @@ u3g_huawei_init(struct usb_device *udev)
return (0);
}
+static int
+u3g_huawei_is_cdce(uint16_t idVendor, uint8_t bInterfaceSubClass,
+ uint8_t bInterfaceProtocol)
+{
+ /*
+ * This function returns non-zero if the interface being
+ * probed is of type CDC ethernet, which the U3G driver should
+ * not attach to. See sys/dev/usb/net/if_cdce.c for matching
+ * entries.
+ */
+ if (idVendor != USB_VENDOR_HUAWEI)
+ goto done;
+
+ switch (bInterfaceSubClass) {
+ case 0x02:
+ switch (bInterfaceProtocol) {
+ case 0x16:
+ case 0x46:
+ case 0x76:
+ return (1);
+ default:
+ break;
+ }
+ break;
+ case 0x03:
+ switch (bInterfaceProtocol) {
+ case 0x16:
+ return (1);
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+done:
+ return (0);
+}
+
static void
u3g_sael_m460_init(struct usb_device *udev)
{
@@ -845,6 +888,10 @@ u3g_probe(device_t self)
if (uaa->info.bInterfaceClass != UICLASS_VENDOR) {
return (ENXIO);
}
+ if (u3g_huawei_is_cdce(uaa->info.idVendor, uaa->info.bInterfaceSubClass,
+ uaa->info.bInterfaceProtocol)) {
+ return (ENXIO);
+ }
return (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa));
}
@@ -888,6 +935,9 @@ u3g_attach(device_t dev)
id = usbd_get_interface_descriptor(iface);
if (id == NULL || id->bInterfaceClass != UICLASS_VENDOR)
continue;
+ if (u3g_huawei_is_cdce(uaa->info.idVendor,
+ id->bInterfaceSubClass, id->bInterfaceProtocol))
+ continue;
usbd_set_parent_iface(uaa->device, i, uaa->info.bIfaceIndex);
iface_valid |= (1<<i);
}
diff --git a/freebsd/sys/dev/usb/serial/umodem.c b/freebsd/sys/dev/usb/serial/umodem.c
index c64600c8..ac1e35c8 100644
--- a/freebsd/sys/dev/usb/serial/umodem.c
+++ b/freebsd/sys/dev/usb/serial/umodem.c
@@ -133,6 +133,18 @@ static const STRUCT_USB_DUAL_ID umodem_dual_devs[] = {
static const STRUCT_USB_HOST_ID umodem_host_devs[] = {
/* Huawei Modem class match */
+ {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR),
+ USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x01)},
+ {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR),
+ USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x02)},
+ {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR),
+ USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x10)},
+ {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR),
+ USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x12)},
+ {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR),
+ USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x61)},
+ {USB_VENDOR(USB_VENDOR_HUAWEI), USB_IFACE_CLASS(UICLASS_VENDOR),
+ USB_IFACE_SUBCLASS(0x02), USB_IFACE_PROTOCOL(0x62)},
{USB_VENDOR(USB_VENDOR_HUAWEI),USB_IFACE_CLASS(UICLASS_CDC),
USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL),
USB_IFACE_PROTOCOL(0xFF)},
diff --git a/freebsd/sys/dev/usb/storage/umass.c b/freebsd/sys/dev/usb/storage/umass.c
index 6b488cf7..c74a8403 100644
--- a/freebsd/sys/dev/usb/storage/umass.c
+++ b/freebsd/sys/dev/usb/storage/umass.c
@@ -1097,7 +1097,6 @@ static void
umass_init_shuttle(struct umass_softc *sc)
{
struct usb_device_request req;
- usb_error_t err;
uint8_t status[2] = {0, 0};
/*
@@ -1110,7 +1109,7 @@ umass_init_shuttle(struct umass_softc *sc)
req.wIndex[0] = sc->sc_iface_no;
req.wIndex[1] = 0;
USETW(req.wLength, sizeof(status));
- err = usbd_do_request(sc->sc_udev, NULL, &req, &status);
+ usbd_do_request(sc->sc_udev, NULL, &req, &status);
DPRINTF(sc, UDMASS_GEN, "Shuttle init returned 0x%02x%02x\n",
status[0], status[1]);
diff --git a/freebsd/sys/dev/usb/usb_dev.c b/freebsd/sys/dev/usb/usb_dev.c
index 2b244d80..94f306d4 100644
--- a/freebsd/sys/dev/usb/usb_dev.c
+++ b/freebsd/sys/dev/usb/usb_dev.c
@@ -882,7 +882,7 @@ usb_open(struct cdev *dev, int fflags, int devtype, struct thread *td)
struct usb_fs_privdata* pd = (struct usb_fs_privdata*)dev->si_drv1;
struct usb_cdev_refdata refs;
struct usb_cdev_privdata *cpd;
- int err, ep;
+ int err;
DPRINTFN(2, "%s fflags=0x%08x\n", devtoname(dev), fflags);
@@ -894,7 +894,6 @@ usb_open(struct cdev *dev, int fflags, int devtype, struct thread *td)
}
cpd = malloc(sizeof(*cpd), M_USBDEV, M_WAITOK | M_ZERO);
- ep = cpd->ep_addr = pd->ep_addr;
usb_loc_fill(pd, cpd);
err = usb_ref_device(cpd, &refs, 1);
@@ -1422,8 +1421,6 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag)
struct usb_cdev_privdata* cpd;
struct usb_fifo *f;
struct usb_mbuf *m;
- int fflags;
- int resid;
int io_len;
int err;
uint8_t tr_data = 0;
@@ -1436,8 +1433,6 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag)
if (err)
return (ENXIO);
- fflags = cpd->fflags;
-
f = refs.rxfifo;
if (f == NULL) {
/* should not happen */
@@ -1445,8 +1440,6 @@ usb_read(struct cdev *dev, struct uio *uio, int ioflag)
return (EPERM);
}
- resid = uio->uio_resid;
-
mtx_lock(f->priv_mtx);
/* check for permanent read error */
@@ -1546,8 +1539,6 @@ usb_write(struct cdev *dev, struct uio *uio, int ioflag)
struct usb_fifo *f;
struct usb_mbuf *m;
uint8_t *pdata;
- int fflags;
- int resid;
int io_len;
int err;
uint8_t tr_data = 0;
@@ -1562,15 +1553,12 @@ usb_write(struct cdev *dev, struct uio *uio, int ioflag)
if (err)
return (ENXIO);
- fflags = cpd->fflags;
-
f = refs.txfifo;
if (f == NULL) {
/* should not happen */
usb_unref_device(cpd, &refs);
return (EPERM);
}
- resid = uio->uio_resid;
mtx_lock(f->priv_mtx);
diff --git a/freebsd/sys/dev/usb/usb_device.c b/freebsd/sys/dev/usb/usb_device.c
index 861f6029..5f1cf409 100644
--- a/freebsd/sys/dev/usb/usb_device.c
+++ b/freebsd/sys/dev/usb/usb_device.c
@@ -89,6 +89,7 @@
/* function prototypes */
+static int sysctl_hw_usb_template(SYSCTL_HANDLER_ARGS);
static void usb_init_endpoint(struct usb_device *, uint8_t,
struct usb_endpoint_descriptor *,
struct usb_endpoint_ss_comp_descriptor *,
@@ -123,8 +124,137 @@ int usb_template;
#endif
#ifndef __rtems__
-SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RWTUN,
- &usb_template, 0, "Selected USB device side template");
+SYSCTL_PROC(_hw_usb, OID_AUTO, template,
+ CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
+ NULL, 0, sysctl_hw_usb_template,
+ "I", "Selected USB device side template");
+
+/*------------------------------------------------------------------------*
+ * usb_trigger_reprobe_on_off
+ *
+ * This function sets the pull up resistors for all ports currently
+ * operating in device mode either on (when on_not_off is 1), or off
+ * (when it's 0).
+ *------------------------------------------------------------------------*/
+static void
+usb_trigger_reprobe_on_off(int on_not_off)
+{
+ struct usb_port_status ps;
+ struct usb_bus *bus;
+ struct usb_device *udev;
+ usb_error_t err;
+ int do_unlock, max;
+
+ max = devclass_get_maxunit(usb_devclass_ptr);
+ while (max >= 0) {
+ mtx_lock(&usb_ref_lock);
+ bus = devclass_get_softc(usb_devclass_ptr, max);
+ max--;
+
+ if (bus == NULL || bus->devices == NULL ||
+ bus->devices[USB_ROOT_HUB_ADDR] == NULL) {
+ mtx_unlock(&usb_ref_lock);
+ continue;
+ }
+
+ udev = bus->devices[USB_ROOT_HUB_ADDR];
+
+ if (udev->refcount == USB_DEV_REF_MAX) {
+ mtx_unlock(&usb_ref_lock);
+ continue;
+ }
+
+ udev->refcount++;
+ mtx_unlock(&usb_ref_lock);
+
+ do_unlock = usbd_enum_lock(udev);
+ if (do_unlock > 1) {
+ do_unlock = 0;
+ goto next;
+ }
+
+ err = usbd_req_get_port_status(udev, NULL, &ps, 1);
+ if (err != 0) {
+ DPRINTF("usbd_req_get_port_status() "
+ "failed: %s\n", usbd_errstr(err));
+ goto next;
+ }
+
+ if ((UGETW(ps.wPortStatus) & UPS_PORT_MODE_DEVICE) == 0)
+ goto next;
+
+ if (on_not_off) {
+ err = usbd_req_set_port_feature(udev, NULL, 1,
+ UHF_PORT_POWER);
+ if (err != 0) {
+ DPRINTF("usbd_req_set_port_feature() "
+ "failed: %s\n", usbd_errstr(err));
+ }
+ } else {
+ err = usbd_req_clear_port_feature(udev, NULL, 1,
+ UHF_PORT_POWER);
+ if (err != 0) {
+ DPRINTF("usbd_req_clear_port_feature() "
+ "failed: %s\n", usbd_errstr(err));
+ }
+ }
+
+next:
+ mtx_lock(&usb_ref_lock);
+ if (do_unlock)
+ usbd_enum_unlock(udev);
+ if (--(udev->refcount) == 0)
+ cv_broadcast(&udev->ref_cv);
+ mtx_unlock(&usb_ref_lock);
+ }
+}
+
+/*------------------------------------------------------------------------*
+ * usb_trigger_reprobe_all
+ *
+ * This function toggles the pull up resistors for all ports currently
+ * operating in device mode, causing the host machine to reenumerate them.
+ *------------------------------------------------------------------------*/
+static void
+usb_trigger_reprobe_all(void)
+{
+
+ /*
+ * Set the pull up resistors off for all ports in device mode.
+ */
+ usb_trigger_reprobe_on_off(0);
+
+ /*
+ * According to the DWC OTG spec this must be at least 3ms.
+ */
+ usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_POWER_DOWN_TIME));
+
+ /*
+ * Set the pull up resistors back on.
+ */
+ usb_trigger_reprobe_on_off(1);
+}
+
+static int
+sysctl_hw_usb_template(SYSCTL_HANDLER_ARGS)
+{
+ int error, val;
+
+ val = usb_template;
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error != 0 || req->newptr == NULL || usb_template == val)
+ return (error);
+
+ usb_template = val;
+
+ if (usb_template < 0) {
+ usb_trigger_reprobe_on_off(0);
+ } else {
+ usb_trigger_reprobe_all();
+ }
+
+ return (0);
+}
#endif /* __rtems__ */
/* English is default language */
diff --git a/freebsd/sys/dev/usb/wlan/if_rum.c b/freebsd/sys/dev/usb/wlan/if_rum.c
index 9996576e..dbb12335 100644
--- a/freebsd/sys/dev/usb/wlan/if_rum.c
+++ b/freebsd/sys/dev/usb/wlan/if_rum.c
@@ -2303,11 +2303,14 @@ rum_update_slot(struct ieee80211com *ic)
static int
rum_wme_update(struct ieee80211com *ic)
{
- const struct wmeParams *chanp =
- ic->ic_wme.wme_chanParams.cap_wmeParams;
+ struct chanAccParams chp;
+ const struct wmeParams *chanp;
struct rum_softc *sc = ic->ic_softc;
int error = 0;
+ ieee80211_wme_ic_getparams(ic, &chp);
+ chanp = chp.cap_wmeParams;
+
RUM_LOCK(sc);
error = rum_write(sc, RT2573_AIFSN_CSR,
chanp[WME_AC_VO].wmep_aifsn << 12 |
diff --git a/freebsd/sys/dev/usb/wlan/if_run.c b/freebsd/sys/dev/usb/wlan/if_run.c
index d9bda8c8..71f53dd3 100644
--- a/freebsd/sys/dev/usb/wlan/if_run.c
+++ b/freebsd/sys/dev/usb/wlan/if_run.c
@@ -2219,11 +2219,14 @@ run_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
static int
run_wme_update(struct ieee80211com *ic)
{
+ struct chanAccParams chp;
struct run_softc *sc = ic->ic_softc;
- const struct wmeParams *ac =
- ic->ic_wme.wme_chanParams.cap_wmeParams;
+ const struct wmeParams *ac;
int aci, error = 0;
+ ieee80211_wme_ic_getparams(ic, &chp);
+ ac = chp.cap_wmeParams;
+
/* update MAC TX configuration registers */
RUN_LOCK(sc);
for (aci = 0; aci < WME_NUM_AC; aci++) {
diff --git a/freebsd/sys/dev/usb/wlan/if_uath.c b/freebsd/sys/dev/usb/wlan/if_uath.c
index e1aa5ec0..e001d9ed 100644
--- a/freebsd/sys/dev/usb/wlan/if_uath.c
+++ b/freebsd/sys/dev/usb/wlan/if_uath.c
@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-kernel-space.h>
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND 0BSD
+ * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-1-Clause)
*
* Copyright (c) 2006 Sam Leffler, Errno Consulting
* Copyright (c) 2008-2009 Weongyo Jeong <weongyo@freebsd.org>