summaryrefslogtreecommitdiff
path: root/sys/dev/usb2/wlan/if_ural2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb2/wlan/if_ural2.c')
-rw-r--r--sys/dev/usb2/wlan/if_ural2.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/dev/usb2/wlan/if_ural2.c b/sys/dev/usb2/wlan/if_ural2.c
index 30963cb20b18..9ac3521dab8a 100644
--- a/sys/dev/usb2/wlan/if_ural2.c
+++ b/sys/dev/usb2/wlan/if_ural2.c
@@ -367,7 +367,7 @@ static const struct ural_rf5222 ural_rf5222[] = {
};
static const struct usb2_config ural_config[URAL_N_TRANSFER] = {
- [0] = {
+ [URAL_BULK_DT_WR] = {
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_OUT,
@@ -377,7 +377,7 @@ static const struct usb2_config ural_config[URAL_N_TRANSFER] = {
.mh.timeout = 5000, /* ms */
},
- [1] = {
+ [URAL_BULK_DT_RD] = {
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
@@ -386,7 +386,7 @@ static const struct usb2_config ural_config[URAL_N_TRANSFER] = {
.mh.callback = &ural_bulk_read_callback,
},
- [2] = {
+ [URAL_BULK_CS_WR] = {
.type = UE_CONTROL,
.endpoint = 0x00, /* Control pipe */
.direction = UE_DIR_ANY,
@@ -396,7 +396,7 @@ static const struct usb2_config ural_config[URAL_N_TRANSFER] = {
.mh.interval = 50, /* 50ms */
},
- [3] = {
+ [URAL_BULK_CS_RD] = {
.type = UE_CONTROL,
.endpoint = 0x00, /* Control pipe */
.direction = UE_DIR_ANY,
@@ -881,7 +881,7 @@ ural_end_of_commands(struct ural_softc *sc)
sc->sc_flags &= ~URAL_FLAG_WAIT_COMMAND;
/* start write transfer, if not started */
- usb2_transfer_start(sc->sc_xfer[0]);
+ usb2_transfer_start(sc->sc_xfer[URAL_BULK_DT_WR]);
}
static void
@@ -1077,7 +1077,7 @@ ural_bulk_read_callback(struct usb2_xfer *xfer)
tr_setup:
if (sc->sc_flags & URAL_FLAG_READ_STALL) {
- usb2_transfer_start(sc->sc_xfer[3]);
+ usb2_transfer_start(sc->sc_xfer[URAL_BULK_CS_RD]);
} else {
xfer->frlengths[0] = xfer->max_data_length;
usb2_start_hardware(xfer);
@@ -1115,7 +1115,7 @@ tr_setup:
if (xfer->error != USB_ERR_CANCELLED) {
/* try to clear stall first */
sc->sc_flags |= URAL_FLAG_READ_STALL;
- usb2_transfer_start(sc->sc_xfer[3]);
+ usb2_transfer_start(sc->sc_xfer[URAL_BULK_CS_RD]);
}
return;
@@ -1126,7 +1126,7 @@ static void
ural_bulk_read_clear_stall_callback(struct usb2_xfer *xfer)
{
struct ural_softc *sc = xfer->priv_sc;
- struct usb2_xfer *xfer_other = sc->sc_xfer[1];
+ struct usb2_xfer *xfer_other = sc->sc_xfer[URAL_BULK_DT_RD];
if (usb2_clear_stall_callback(xfer, xfer_other)) {
DPRINTF("stall cleared\n");
@@ -1293,7 +1293,7 @@ ural_setup_desc_and_tx(struct ural_softc *sc, struct mbuf *m,
/* start write transfer, if not started */
_IF_ENQUEUE(&sc->sc_tx_queue, mm);
- usb2_transfer_start(sc->sc_xfer[0]);
+ usb2_transfer_start(sc->sc_xfer[URAL_BULK_DT_WR]);
}
static void
@@ -1313,7 +1313,7 @@ ural_bulk_write_callback(struct usb2_xfer *xfer)
case USB_ST_SETUP:
if (sc->sc_flags & URAL_FLAG_WRITE_STALL) {
- usb2_transfer_start(sc->sc_xfer[2]);
+ usb2_transfer_start(sc->sc_xfer[URAL_BULK_CS_WR]);
break;
}
if (sc->sc_flags & URAL_FLAG_WAIT_COMMAND) {
@@ -1371,7 +1371,7 @@ ural_bulk_write_callback(struct usb2_xfer *xfer)
if (xfer->error != USB_ERR_CANCELLED) {
/* try to clear stall first */
sc->sc_flags |= URAL_FLAG_WRITE_STALL;
- usb2_transfer_start(sc->sc_xfer[2]);
+ usb2_transfer_start(sc->sc_xfer[URAL_BULK_CS_WR]);
}
ifp->if_oerrors++;
break;
@@ -1382,7 +1382,7 @@ static void
ural_bulk_write_clear_stall_callback(struct usb2_xfer *xfer)
{
struct ural_softc *sc = xfer->priv_sc;
- struct usb2_xfer *xfer_other = sc->sc_xfer[0];
+ struct usb2_xfer *xfer_other = sc->sc_xfer[URAL_BULK_DT_WR];
if (usb2_clear_stall_callback(xfer, xfer_other)) {
DPRINTF("stall cleared\n");
@@ -1468,7 +1468,7 @@ ural_start_cb(struct ifnet *ifp)
mtx_lock(&sc->sc_mtx);
/* start write transfer, if not started */
- usb2_transfer_start(sc->sc_xfer[0]);
+ usb2_transfer_start(sc->sc_xfer[URAL_BULK_DT_WR]);
mtx_unlock(&sc->sc_mtx);
}
@@ -2160,8 +2160,8 @@ ural_cfg_init(struct ural_softc *sc,
/*
* start the USB transfers, if not already started:
*/
- usb2_transfer_start(sc->sc_xfer[1]);
- usb2_transfer_start(sc->sc_xfer[0]);
+ usb2_transfer_start(sc->sc_xfer[URAL_BULK_DT_RD]);
+ usb2_transfer_start(sc->sc_xfer[URAL_BULK_DT_WR]);
/*
* start IEEE802.11 layer
@@ -2219,10 +2219,10 @@ ural_cfg_pre_stop(struct ural_softc *sc,
/*
* stop all the transfers, if not already stopped:
*/
- usb2_transfer_stop(sc->sc_xfer[0]);
- usb2_transfer_stop(sc->sc_xfer[1]);
- usb2_transfer_stop(sc->sc_xfer[2]);
- usb2_transfer_stop(sc->sc_xfer[3]);
+ usb2_transfer_stop(sc->sc_xfer[URAL_BULK_DT_WR]);
+ usb2_transfer_stop(sc->sc_xfer[URAL_BULK_DT_RD]);
+ usb2_transfer_stop(sc->sc_xfer[URAL_BULK_CS_WR]);
+ usb2_transfer_stop(sc->sc_xfer[URAL_BULK_CS_RD]);
/* clean up transmission */
ural_tx_clean_queue(sc);