Commit 9334bf2e authored by HardenedBSD Sync Service's avatar HardenedBSD Sync Service
Browse files

Merge remote-tracking branch 'freebsd/stable/12' into hardened/12-stable/master

parents f9797618 8a047df9
......@@ -1629,20 +1629,24 @@ em_if_media_change(if_ctx_t ctx)
sc->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
break;
case IFM_100_TX:
sc->hw.mac.autoneg = false;
sc->hw.phy.autoneg_advertised = 0;
if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX)
sc->hw.mac.autoneg = DO_AUTO_NEG;
if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
sc->hw.phy.autoneg_advertised = ADVERTISE_100_FULL;
sc->hw.mac.forced_speed_duplex = ADVERTISE_100_FULL;
else
} else {
sc->hw.phy.autoneg_advertised = ADVERTISE_100_HALF;
sc->hw.mac.forced_speed_duplex = ADVERTISE_100_HALF;
}
break;
case IFM_10_T:
sc->hw.mac.autoneg = false;
sc->hw.phy.autoneg_advertised = 0;
if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX)
sc->hw.mac.autoneg = DO_AUTO_NEG;
if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
sc->hw.phy.autoneg_advertised = ADVERTISE_10_FULL;
sc->hw.mac.forced_speed_duplex = ADVERTISE_10_FULL;
else
} else {
sc->hw.phy.autoneg_advertised = ADVERTISE_10_HALF;
sc->hw.mac.forced_speed_duplex = ADVERTISE_10_HALF;
}
break;
default:
device_printf(sc->dev, "Unsupported media type\n");
......@@ -1723,6 +1727,9 @@ em_if_multi_set(if_ctx_t ctx)
if_multiaddr_array(ifp, mta, &mcnt, MAX_NUM_MULTICAST_ADDRESSES);
if (mcnt < MAX_NUM_MULTICAST_ADDRESSES)
e1000_update_mc_addr_list(&sc->hw, mta, mcnt);
reg_rctl = E1000_READ_REG(&sc->hw, E1000_RCTL);
if (if_getflags(ifp) & IFF_PROMISC)
......@@ -1736,9 +1743,6 @@ em_if_multi_set(if_ctx_t ctx)
E1000_WRITE_REG(&sc->hw, E1000_RCTL, reg_rctl);
if (mcnt < MAX_NUM_MULTICAST_ADDRESSES)
e1000_update_mc_addr_list(&sc->hw, mta, mcnt);
if (sc->hw.mac.type == e1000_82542 &&
sc->hw.revision_id == E1000_REVISION_2) {
reg_rctl = E1000_READ_REG(&sc->hw, E1000_RCTL);
......
......@@ -3289,6 +3289,12 @@ ixgbe_if_multi_set(if_ctx_t ctx)
mcnt = if_multi_apply(iflib_get_ifp(ctx), ixgbe_mc_filter_apply, sc);
if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) {
update_ptr = (u8 *)mta;
ixgbe_update_mc_addr_list(&sc->hw, update_ptr, mcnt,
ixgbe_mc_array_itr, true);
}
fctrl = IXGBE_READ_REG(&sc->hw, IXGBE_FCTRL);
if (ifp->if_flags & IFF_PROMISC)
......@@ -3301,13 +3307,6 @@ ixgbe_if_multi_set(if_ctx_t ctx)
fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
IXGBE_WRITE_REG(&sc->hw, IXGBE_FCTRL, fctrl);
if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) {
update_ptr = (u8 *)mta;
ixgbe_update_mc_addr_list(&sc->hw, update_ptr, mcnt,
ixgbe_mc_array_itr, true);
}
} /* ixgbe_if_multi_set */
/************************************************************************
......
......@@ -3856,6 +3856,7 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer)
uint32_t mask;
uint8_t index;
uint8_t epno;
uint8_t drop;
pepext = xhci_get_endpoint_ext(xfer->xroot->udev,
xfer->endpoint->edesc);
......@@ -3897,15 +3898,19 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer)
*/
switch (xhci_get_endpoint_state(udev, epno)) {
case XHCI_EPCTX_0_EPSTATE_DISABLED:
break;
drop = 0;
break;
case XHCI_EPCTX_0_EPSTATE_STOPPED:
drop = 1;
break;
case XHCI_EPCTX_0_EPSTATE_HALTED:
err = xhci_cmd_reset_ep(sc, 0, epno, index);
if (err != 0)
drop = (err != 0);
if (drop)
DPRINTF("Could not reset endpoint %u\n", epno);
break;
default:
drop = 1;
err = xhci_cmd_stop_ep(sc, 0, epno, index);
if (err != 0)
DPRINTF("Could not stop endpoint %u\n", epno);
......@@ -3926,11 +3931,25 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer)
*/
mask = (1U << epno);
xhci_configure_mask(udev, mask | 1U, 0);
if (epno != 1 && drop != 0) {
/* drop endpoint context to reset data toggle value, if any. */
xhci_configure_mask(udev, mask, 1);
err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index);
if (err != 0) {
DPRINTF("Could not drop "
"endpoint %u at slot %u.\n", epno, index);
} else {
sc->sc_hw.devs[index].ep_configured &= ~mask;
}
}
xhci_configure_mask(udev, mask, 0);
if (!(sc->sc_hw.devs[index].ep_configured & mask)) {
sc->sc_hw.devs[index].ep_configured |= mask;
err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index);
if (err == 0)
sc->sc_hw.devs[index].ep_configured |= mask;
} else {
err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment