diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/e1000/if_igb.c | 2 | ||||
-rw-r--r-- | sys/dev/hwpmc/hwpmc_powerpc.c | 1 | ||||
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 16 | ||||
-rw-r--r-- | sys/dev/usb/input/ukbd.c | 51 | ||||
-rw-r--r-- | sys/dev/virtio/network/if_vtnet.c | 65 |
5 files changed, 68 insertions, 67 deletions
diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index 2134e296..d6e4de5 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -2381,7 +2381,9 @@ igb_allocate_legacy(struct adapter *adapter) { device_t dev = adapter->dev; struct igb_queue *que = adapter->queues; +#ifndef IGB_LEGACY_TX struct tx_ring *txr = adapter->tx_rings; +#endif int error, rid = 0; /* Turn off all interrupts */ diff --git a/sys/dev/hwpmc/hwpmc_powerpc.c b/sys/dev/hwpmc/hwpmc_powerpc.c index ed1f023..8da54c2 100644 --- a/sys/dev/hwpmc/hwpmc_powerpc.c +++ b/sys/dev/hwpmc/hwpmc_powerpc.c @@ -147,6 +147,7 @@ pmc_md_initialize() case MPC7455: case MPC7457: error = pmc_mpc7xxx_initialize(pmc_mdep); + break; case IBM970: case IBM970FX: case IBM970MP: diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index cd3e3cf..5715df3 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -1038,6 +1038,13 @@ cbb_cardbus_power_disable_socket(device_t brdev, device_t child) /* CardBus Resource */ /************************************************************************/ +static void +cbb_activate_window(device_t brdev, int type) +{ + + PCI_ENABLE_IO(device_get_parent(brdev), brdev, type); +} + static int cbb_cardbus_io_open(device_t brdev, int win, uint32_t start, uint32_t end) { @@ -1055,6 +1062,7 @@ cbb_cardbus_io_open(device_t brdev, int win, uint32_t start, uint32_t end) pci_write_config(brdev, basereg, start, 4); pci_write_config(brdev, limitreg, end, 4); + cbb_activate_window(brdev, SYS_RES_IOPORT); return (0); } @@ -1075,6 +1083,7 @@ cbb_cardbus_mem_open(device_t brdev, int win, uint32_t start, uint32_t end) pci_write_config(brdev, basereg, start, 4); pci_write_config(brdev, limitreg, end, 4); + cbb_activate_window(brdev, SYS_RES_MEMORY); return (0); } @@ -1342,7 +1351,12 @@ cbb_pcic_activate_resource(device_t brdev, device_t child, int type, int rid, struct resource *res) { struct cbb_softc *sc = device_get_softc(brdev); - return (exca_activate_resource(&sc->exca[0], child, type, rid, res)); + int error; + + error = exca_activate_resource(&sc->exca[0], child, type, rid, res); + if (error == 0) + cbb_activate_window(brdev, type); + return (error); } static int diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 6bc1468..3f3de51 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -197,7 +197,6 @@ struct ukbd_softc { #define UKBD_FLAG_NUMLOCK 0x00080000 #define UKBD_FLAG_CAPSLOCK 0x00100000 #define UKBD_FLAG_SCROLLLOCK 0x00200000 -#define UKBD_FLAG_VALID_KEYS 0x00400000 int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ int sc_state; /* shift/lock key state */ @@ -474,7 +473,8 @@ ukbd_get_key(struct ukbd_softc *sc, uint8_t wait) || (sc->sc_flags & UKBD_FLAG_POLLING) != 0, ("not polling in kdb or panic\n")); - if (sc->sc_inputs == 0) { + if (sc->sc_inputs == 0 && + (sc->sc_flags & UKBD_FLAG_GONE) == 0) { /* start transfer, if not already started */ usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT]); } @@ -513,41 +513,6 @@ ukbd_interrupt(struct ukbd_softc *sc) n_mod = sc->sc_ndata.modifiers; o_mod = sc->sc_odata.modifiers; - - /* - * Don't output any modifier keys before we see a valid - * non-modifier key press. This prevents so-called "ghost - * keyboards" keeping modifier keys pressed while not actually - * seen as a real keyboard. - */ - if (sc->sc_flags & UKBD_FLAG_VALID_KEYS) - goto kfound; - - for (i = 0; i != UKBD_NKEYCODE; i++) { - key = sc->sc_ndata.keycode[i]; - switch (key) { - case 0xe0: - case 0xe4: - case 0xe1: - case 0xe5: - case 0xe2: - case 0xe6: - case 0xe3: - case 0xe7: - case 0x00: - case KEY_ERROR: - break; - default: - sc->sc_flags |= UKBD_FLAG_VALID_KEYS; - goto kfound; - } - } - DPRINTF("Keeping modifiers buffered\n"); - - /* keep modifiers in buffer */ - sc->sc_ndata.modifiers = n_mod = 0; - -kfound: if (n_mod != o_mod) { for (i = 0; i < UKBD_NMOD; i++) { if ((n_mod & ukbd_mods[i].mask) != @@ -1355,6 +1320,18 @@ ukbd_detach(device_t dev) usb_callout_stop(&sc->sc_callout); + /* kill any stuck keys */ + if (sc->sc_flags & UKBD_FLAG_ATTACHED) { + /* stop receiving events from the USB keyboard */ + usbd_transfer_stop(sc->sc_xfer[UKBD_INTR_DT]); + + /* release all leftover keys, if any */ + memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); + + /* process releasing of all keys */ + ukbd_interrupt(sc); + } + ukbd_disable(&sc->sc_kbd); #ifdef KBD_INSTALL_CDEV diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 66fdd5c..e9a4d7d 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -147,6 +147,7 @@ static int vtnet_txq_mq_start_locked(struct vtnet_txq *, struct mbuf *); static int vtnet_txq_mq_start(struct ifnet *, struct mbuf *); static void vtnet_txq_tq_deferred(void *, int); #endif +static void vtnet_txq_start(struct vtnet_txq *); static void vtnet_txq_tq_intr(void *, int); static void vtnet_txq_eof(struct vtnet_txq *); static void vtnet_tx_vq_intr(void *); @@ -843,7 +844,7 @@ vtnet_alloc_virtqueues(struct vtnet_softc *sc) if (sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) nvqs++; - info = malloc(sizeof(struct vq_alloc_info) * nvqs , M_TEMP, M_NOWAIT); + info = malloc(sizeof(struct vq_alloc_info) * nvqs, M_TEMP, M_NOWAIT); if (info == NULL) return (ENOMEM); @@ -1820,9 +1821,9 @@ vtnet_rx_vq_intr(void *xrxq) return; } -again: VTNET_RXQ_LOCK(rxq); +again: if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { VTNET_RXQ_UNLOCK(rxq); return; @@ -1836,10 +1837,11 @@ again: * This is an occasional condition or race (when !more), * so retry a few times before scheduling the taskqueue. */ - rxq->vtnrx_stats.vrxs_rescheduled++; - VTNET_RXQ_UNLOCK(rxq); if (tries++ < VTNET_INTR_DISABLE_RETRIES) goto again; + + VTNET_RXQ_UNLOCK(rxq); + rxq->vtnrx_stats.vrxs_rescheduled++; taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); } else VTNET_RXQ_UNLOCK(rxq); @@ -2241,6 +2243,12 @@ vtnet_txq_mq_start_locked(struct vtnet_txq *txq, struct mbuf *m) vtnet_txq_eof(txq); while ((m = drbr_peek(ifp, br)) != NULL) { + if (virtqueue_full(vq)) { + drbr_putback(ifp, br, m); + error = ENOBUFS; + break; + } + error = vtnet_txq_encap(txq, &m); if (error) { if (m != NULL) @@ -2309,6 +2317,24 @@ vtnet_txq_tq_deferred(void *xtxq, int pending) #endif /* VTNET_LEGACY_TX */ static void +vtnet_txq_start(struct vtnet_txq *txq) +{ + struct vtnet_softc *sc; + struct ifnet *ifp; + + sc = txq->vtntx_sc; + ifp = sc->vtnet_ifp; + +#ifdef VTNET_LEGACY_TX + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + vtnet_start_locked(txq, ifp); +#else + if (!drbr_empty(ifp, txq->vtntx_br)) + vtnet_txq_mq_start_locked(txq, NULL); +#endif +} + +static void vtnet_txq_tq_intr(void *xtxq, int pending) { struct vtnet_softc *sc; @@ -2328,13 +2354,7 @@ vtnet_txq_tq_intr(void *xtxq, int pending) vtnet_txq_eof(txq); -#ifdef VTNET_LEGACY_TX - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vtnet_start_locked(txq, ifp); -#else - if (!drbr_empty(ifp, txq->vtntx_br)) - vtnet_txq_mq_start_locked(txq, NULL); -#endif + vtnet_txq_start(txq); if (vtnet_txq_enable_intr(txq) != 0) { vtnet_txq_disable_intr(txq); @@ -2395,9 +2415,9 @@ vtnet_tx_vq_intr(void *xtxq) return; } -again: VTNET_TXQ_LOCK(txq); +again: if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { VTNET_TXQ_UNLOCK(txq); return; @@ -2405,13 +2425,7 @@ again: vtnet_txq_eof(txq); -#ifdef VTNET_LEGACY_TX - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vtnet_start_locked(txq, ifp); -#else - if (!drbr_empty(ifp, txq->vtntx_br)) - vtnet_txq_mq_start_locked(txq, NULL); -#endif + vtnet_txq_start(txq); if (vtnet_txq_enable_intr(txq) != 0) { vtnet_txq_disable_intr(txq); @@ -2419,9 +2433,10 @@ again: * This is an occasional race, so retry a few times * before scheduling the taskqueue. */ - VTNET_TXQ_UNLOCK(txq); if (tries++ < VTNET_INTR_DISABLE_RETRIES) goto again; + + VTNET_TXQ_UNLOCK(txq); txq->vtntx_stats.vtxs_rescheduled++; taskqueue_enqueue(txq->vtntx_tq, &txq->vtntx_intrtask); } else @@ -2431,24 +2446,16 @@ again: static void vtnet_tx_start_all(struct vtnet_softc *sc) { - struct ifnet *ifp; struct vtnet_txq *txq; int i; - ifp = sc->vtnet_ifp; VTNET_CORE_LOCK_ASSERT(sc); for (i = 0; i < sc->vtnet_act_vq_pairs; i++) { txq = &sc->vtnet_txqs[i]; VTNET_TXQ_LOCK(txq); -#ifdef VTNET_LEGACY_TX - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vtnet_start_locked(txq, ifp); -#else - if (!drbr_empty(ifp, txq->vtntx_br)) - vtnet_txq_mq_start_locked(txq, NULL); -#endif + vtnet_txq_start(txq); VTNET_TXQ_UNLOCK(txq); } } |