#include <dev/usb/usbdi.h>
#include "usbdevs.h"
-#define USB_DEBUG_VAR rsu_debug
-#include <dev/usb/usb_debug.h>
-
#include <dev/usb/wlan/if_rsureg.h>
#ifdef USB_DEBUG
#define RSU_DEBUG_FWDBG 0x00000200
#define RSU_DEBUG_AMPDU 0x00000400
#define RSU_DEBUG_KEY 0x00000800
+#define RSU_DEBUG_USB 0x00001000
static const STRUCT_USB_HOST_ID rsu_devs[] = {
#define RSU_HT_NOT_SUPPORTED 0
req, data, 0, NULL, 250 /* ms */);
if (err == 0 || err == USB_ERR_NOT_CONFIGURED)
break;
- DPRINTFN(1, "Control request failed, %s (retrying)\n",
- usbd_errstr(err));
+ RSU_DPRINTF(sc, RSU_DEBUG_USB,
+ "Control request failed, %s (retries left: %d)\n",
+ usbd_errstr(err), ntries);
rsu_ms_delay(sc, 10);
}
}
}
#ifdef USB_DEBUG
- if (rsu_debug >= 5) {
+ if (rsu_debug & RSU_DEBUG_RESET) {
/* Dump ROM content. */
printf("\n");
for (i = 0; i < sizeof(sc->rom); i++)
rsu_read_1(sc, R92S_GPIO_IO_SEL) & ~R92S_GPIO_WPS);
reg = rsu_read_1(sc, R92S_GPIO_CTRL);
if (reg != 0xff && (reg & R92S_GPIO_WPS))
- DPRINTF(("WPS PBC is pushed\n"));
+ RSU_DPRINTF(sc, RSU_DEBUG_CALIB, "WPS PBC is pushed\n");
#endif
/* Read current signal level. */
if (rsu_fw_iocmd(sc, 0xf4000001) == 0) {
tmp = le32toh(rsp->associd);
if (tmp >= vap->iv_max_aid) {
- DPRINTF("Assoc ID overflow\n");
+ RSU_DPRINTF(sc, RSU_DEBUG_ANY, "Assoc ID overflow\n");
tmp = 1;
}
RSU_DPRINTF(sc, RSU_DEBUG_STATE | RSU_DEBUG_FWCMD,
m = m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR);
if (__predict_false(m == NULL)) {
- device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n",
- __func__);
+ device_printf(sc->sc_dev,
+ "%s: could not allocate RX mbuf, totlen %d\n",
+ __func__, totlen);
goto fail;
}
usbd_xfer_status(xfer, &len, NULL, NULL, NULL);
if (__predict_false(len < sizeof(*stat))) {
- DPRINTF("xfer too short %d\n", len);
+ RSU_DPRINTF(sc, RSU_DEBUG_RX, "xfer too short %d\n", len);
counter_u64_add(ic->ic_ierrors, 1);
return (NULL);
}
error = EINVAL;
goto fail;
}
- DPRINTF("FW V%d %02x-%02x %02x:%02x\n", le16toh(hdr->version),
- hdr->month, hdr->day, hdr->hour, hdr->minute);
+ RSU_DPRINTF(sc, RSU_DEBUG_FW, "FW V%d %02x-%02x %02x:%02x\n",
+ le16toh(hdr->version), hdr->month, hdr->day, hdr->hour,
+ hdr->minute);
/* Make sure that driver and firmware are in sync. */
if (hdr->privsz != htole32(sizeof(*dmem))) {