if_uath.c (246565) | if_uath.c (246570) |
---|---|
1/*- 2 * Copyright (c) 2006 Sam Leffler, Errno Consulting 3 * Copyright (c) 2008-2009 Weongyo Jeong <weongyo@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 35 unchanged lines hidden (view full) --- 44 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 45 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 46 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 47 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 48 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 49 */ 50 51#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 Sam Leffler, Errno Consulting 3 * Copyright (c) 2008-2009 Weongyo Jeong <weongyo@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 35 unchanged lines hidden (view full) --- 44 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 45 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 46 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 47 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 48 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 49 */ 50 51#include <sys/cdefs.h> |
52__FBSDID("$FreeBSD: head/sys/dev/usb/wlan/if_uath.c 246565 2013-02-08 21:15:47Z hselasky $"); | 52__FBSDID("$FreeBSD: head/sys/dev/usb/wlan/if_uath.c 246570 2013-02-08 22:51:09Z hselasky $"); |
53 54/*- 55 * Driver for Atheros AR5523 USB parts. 56 * 57 * The driver requires firmware to be loaded into the device. This 58 * is done on device discovery from a user application (uathload) 59 * that is launched by devd when a device with suitable product ID 60 * is recognized. Once firmware has been loaded the device will --- 2370 unchanged lines hidden (view full) --- 2431static void 2432uath_intr_tx_callback(struct usb_xfer *xfer, usb_error_t error) 2433{ 2434 struct uath_softc *sc = usbd_xfer_softc(xfer); 2435 struct uath_cmd *cmd; 2436 2437 UATH_ASSERT_LOCKED(sc); 2438 | 53 54/*- 55 * Driver for Atheros AR5523 USB parts. 56 * 57 * The driver requires firmware to be loaded into the device. This 58 * is done on device discovery from a user application (uathload) 59 * that is launched by devd when a device with suitable product ID 60 * is recognized. Once firmware has been loaded the device will --- 2370 unchanged lines hidden (view full) --- 2431static void 2432uath_intr_tx_callback(struct usb_xfer *xfer, usb_error_t error) 2433{ 2434 struct uath_softc *sc = usbd_xfer_softc(xfer); 2435 struct uath_cmd *cmd; 2436 2437 UATH_ASSERT_LOCKED(sc); 2438 |
2439 switch (USB_GET_STATE(xfer)) { 2440 case USB_ST_TRANSFERRED: 2441 cmd = STAILQ_FIRST(&sc->sc_cmd_active); 2442 if (cmd == NULL) 2443 goto setup; | 2439 cmd = STAILQ_FIRST(&sc->sc_cmd_active); 2440 if (cmd != NULL && USB_GET_STATE(xfer) != USB_ST_SETUP) { |
2444 STAILQ_REMOVE_HEAD(&sc->sc_cmd_active, next); 2445 UATH_STAT_DEC(sc, st_cmd_active); 2446 STAILQ_INSERT_TAIL((cmd->flags & UATH_CMD_FLAG_READ) ? 2447 &sc->sc_cmd_waiting : &sc->sc_cmd_inactive, cmd, next); 2448 if (cmd->flags & UATH_CMD_FLAG_READ) 2449 UATH_STAT_INC(sc, st_cmd_waiting); 2450 else 2451 UATH_STAT_INC(sc, st_cmd_inactive); | 2441 STAILQ_REMOVE_HEAD(&sc->sc_cmd_active, next); 2442 UATH_STAT_DEC(sc, st_cmd_active); 2443 STAILQ_INSERT_TAIL((cmd->flags & UATH_CMD_FLAG_READ) ? 2444 &sc->sc_cmd_waiting : &sc->sc_cmd_inactive, cmd, next); 2445 if (cmd->flags & UATH_CMD_FLAG_READ) 2446 UATH_STAT_INC(sc, st_cmd_waiting); 2447 else 2448 UATH_STAT_INC(sc, st_cmd_inactive); |
2452 /* FALLTHROUGH */ | 2449 } 2450 2451 switch (USB_GET_STATE(xfer)) { 2452 case USB_ST_TRANSFERRED: |
2453 case USB_ST_SETUP: 2454setup: 2455 cmd = STAILQ_FIRST(&sc->sc_cmd_pending); 2456 if (cmd == NULL) { 2457 DPRINTF(sc, UATH_DEBUG_XMIT, "%s: empty pending queue\n", 2458 __func__); 2459 return; 2460 } --- 425 unchanged lines hidden --- | 2453 case USB_ST_SETUP: 2454setup: 2455 cmd = STAILQ_FIRST(&sc->sc_cmd_pending); 2456 if (cmd == NULL) { 2457 DPRINTF(sc, UATH_DEBUG_XMIT, "%s: empty pending queue\n", 2458 __func__); 2459 return; 2460 } --- 425 unchanged lines hidden --- |