summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/if_urtw.c152
-rw-r--r--sys/dev/usb/if_urtwreg.h112
2 files changed, 132 insertions, 132 deletions
diff --git a/sys/dev/usb/if_urtw.c b/sys/dev/usb/if_urtw.c
index 7c093c35307..ce65963dda9 100644
--- a/sys/dev/usb/if_urtw.c
+++ b/sys/dev/usb/if_urtw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urtw.c,v 1.12 2009/06/04 19:45:36 martynas Exp $ */
+/* $OpenBSD: if_urtw.c,v 1.13 2009/06/04 19:53:17 martynas Exp $ */
/*-
* Copyright (c) 2008 Weongyo Jeong <weongyo@FreeBSD.org>
@@ -182,31 +182,31 @@ static uint8_t urtw_8225_agc[] = {
};
static uint32_t urtw_8225_channel[] = {
- 0x0000, /* dummy channel 0 */
- 0x085c, /* 1 */
- 0x08dc, /* 2 */
- 0x095c, /* 3 */
- 0x09dc, /* 4 */
- 0x0a5c, /* 5 */
- 0x0adc, /* 6 */
- 0x0b5c, /* 7 */
- 0x0bdc, /* 8 */
- 0x0c5c, /* 9 */
- 0x0cdc, /* 10 */
- 0x0d5c, /* 11 */
- 0x0ddc, /* 12 */
- 0x0e5c, /* 13 */
- 0x0f72, /* 14 */
+ 0x0000, /* dummy channel 0 */
+ 0x085c, /* 1 */
+ 0x08dc, /* 2 */
+ 0x095c, /* 3 */
+ 0x09dc, /* 4 */
+ 0x0a5c, /* 5 */
+ 0x0adc, /* 6 */
+ 0x0b5c, /* 7 */
+ 0x0bdc, /* 8 */
+ 0x0c5c, /* 9 */
+ 0x0cdc, /* 10 */
+ 0x0d5c, /* 11 */
+ 0x0ddc, /* 12 */
+ 0x0e5c, /* 13 */
+ 0x0f72, /* 14 */
};
static uint8_t urtw_8225_gain[] = {
- 0x23, 0x88, 0x7c, 0xa5, /* -82dbm */
- 0x23, 0x88, 0x7c, 0xb5, /* -82dbm */
- 0x23, 0x88, 0x7c, 0xc5, /* -82dbm */
- 0x33, 0x80, 0x79, 0xc5, /* -78dbm */
- 0x43, 0x78, 0x76, 0xc5, /* -74dbm */
- 0x53, 0x60, 0x73, 0xc5, /* -70dbm */
- 0x63, 0x58, 0x70, 0xc5, /* -66dbm */
+ 0x23, 0x88, 0x7c, 0xa5, /* -82dbm */
+ 0x23, 0x88, 0x7c, 0xb5, /* -82dbm */
+ 0x23, 0x88, 0x7c, 0xc5, /* -82dbm */
+ 0x33, 0x80, 0x79, 0xc5, /* -78dbm */
+ 0x43, 0x78, 0x76, 0xc5, /* -74dbm */
+ 0x53, 0x60, 0x73, 0xc5, /* -70dbm */
+ 0x63, 0x58, 0x70, 0xc5, /* -66dbm */
};
static struct urtw_pair urtw_8225_rf_part1[] = {
@@ -285,13 +285,13 @@ static uint8_t urtw_8225_txpwr_ofdm[]={
};
static uint8_t urtw_8225v2_gain_bg[]={
- 0x23, 0x15, 0xa5, /* -82-1dbm */
- 0x23, 0x15, 0xb5, /* -82-2dbm */
- 0x23, 0x15, 0xc5, /* -82-3dbm */
- 0x33, 0x15, 0xc5, /* -78dbm */
- 0x43, 0x15, 0xc5, /* -74dbm */
- 0x53, 0x15, 0xc5, /* -70dbm */
- 0x63, 0x15, 0xc5, /* -66dbm */
+ 0x23, 0x15, 0xa5, /* -82-1dbm */
+ 0x23, 0x15, 0xb5, /* -82-2dbm */
+ 0x23, 0x15, 0xc5, /* -82-3dbm */
+ 0x33, 0x15, 0xc5, /* -78dbm */
+ 0x43, 0x15, 0xc5, /* -74dbm */
+ 0x53, 0x15, 0xc5, /* -70dbm */
+ 0x63, 0x15, 0xc5, /* -66dbm */
};
static struct urtw_pair urtw_8225v2_rf_part1[] = {
@@ -478,8 +478,8 @@ urtw_match(struct device *parent, void *match, void *aux)
if (uaa->iface != NULL)
return UMATCH_NONE;
- return (usb_lookup(urtw_devs, uaa->vendor, uaa->product) != NULL) ?
- UMATCH_VENDOR_PRODUCT : UMATCH_NONE;
+ return ((usb_lookup(urtw_devs, uaa->vendor, uaa->product) != NULL) ?
+ UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
}
void
@@ -508,14 +508,14 @@ urtw_attach(struct device *parent, struct device *self, void *aux)
error = urtw_get_txpwr(sc);
if (error != 0)
goto fail;
- error = urtw_led_init(sc); /* XXX incompleted */
+ error = urtw_led_init(sc); /* XXX incompleted */
if (error != 0)
goto fail;
sc->sc_rts_retry = URTW_DEFAULT_RTS_RETRY;
sc->sc_tx_retry = URTW_DEFAULT_TX_RETRY;
sc->sc_currate = 3;
- /* XXX for what? */
+ /* XXX for what? */
sc->sc_preamble_mode = 2;
usb_init_task(&sc->sc_task, urtw_task, sc);
@@ -670,7 +670,7 @@ urtw_open_pipes(struct urtw_softc *sc)
* pipe numbers
*/
- /* tx pipe - low priority packets */
+ /* tx pipe - low priority packets */
error = usbd_open_pipe(sc->sc_iface, 0x2, USBD_EXCLUSIVE_USE,
&sc->sc_txpipe_low);
if (error != 0) {
@@ -678,7 +678,7 @@ urtw_open_pipes(struct urtw_softc *sc)
sc->sc_dev.dv_xname, usbd_errstr(error));
goto fail;
}
- /* tx pipe - normal priority packets */
+ /* tx pipe - normal priority packets */
error = usbd_open_pipe(sc->sc_iface, 0x3, USBD_EXCLUSIVE_USE,
&sc->sc_txpipe_normal);
if (error != 0) {
@@ -686,7 +686,7 @@ urtw_open_pipes(struct urtw_softc *sc)
sc->sc_dev.dv_xname, usbd_errstr(error));
goto fail;
}
- /* rx pipe */
+ /* rx pipe */
error = usbd_open_pipe(sc->sc_iface, 0x81, USBD_EXCLUSIVE_USE,
&sc->sc_rxpipe);
if (error != 0) {
@@ -896,7 +896,7 @@ fail:
return (error);
}
-/* XXX why we should allocalte memory buffer instead of using memory stack? */
+/* XXX why we should allocalte memory buffer instead of using memory stack? */
usbd_status
urtw_8225_write_s16(struct urtw_softc *sc, uint8_t addr, int index,
uint16_t *data)
@@ -1120,7 +1120,7 @@ urtw_get_rfchip(struct urtw_softc *sc)
break;
default:
panic("unsupported RF chip %d\n", data & 0xff);
- /* never reach */
+ /* never reach */
}
fail:
@@ -1205,7 +1205,7 @@ urtw_eprom_read32(struct urtw_softc *sc, uint32_t addr, uint32_t *data)
int16_t addrstr[8], data16, readcmd[] = { 1, 1, 0 };
usbd_status error;
- /* NB: make sure the buffer is initialized */
+ /* NB: make sure the buffer is initialized */
*data = 0;
/* enable EPROM programming */
@@ -1327,11 +1327,11 @@ urtw_eprom_ck(struct urtw_softc *sc)
uint8_t data;
usbd_status error;
- /* masking */
+ /* masking */
urtw_read8_m(sc, URTW_EPROM_CMD, &data);
urtw_write8_m(sc, URTW_EPROM_CMD, data | URTW_EPROM_CK);
DELAY(URTW_EPROM_DELAY);
- /* unmasking */
+ /* unmasking */
urtw_read8_m(sc, URTW_EPROM_CMD, &data);
urtw_write8_m(sc, URTW_EPROM_CMD, data & ~URTW_EPROM_CK);
DELAY(URTW_EPROM_DELAY);
@@ -1614,11 +1614,11 @@ urtw_led_on(struct urtw_softc *sc, int type)
default:
panic("unsupported LED PIN type 0x%x",
sc->sc_gpio_ledpin);
- /* never reach */
+ /* never reach */
}
} else {
panic("unsupported LED type 0x%x", type);
- /* never reach */
+ /* never reach */
}
sc->sc_gpio_ledon = 1;
@@ -1640,11 +1640,11 @@ urtw_led_off(struct urtw_softc *sc, int type)
default:
panic("unsupported LED PIN type 0x%x",
sc->sc_gpio_ledpin);
- /* never reach */
+ /* never reach */
}
} else {
panic("unsupported LED type 0x%x", type);
- /* never reach */
+ /* never reach */
}
sc->sc_gpio_ledon = 0;
@@ -1674,7 +1674,7 @@ urtw_led_mode0(struct urtw_softc *sc, int mode)
break;
default:
panic("unsupported LED mode 0x%x", mode);
- /* never reach */
+ /* never reach */
}
switch (sc->sc_gpio_ledstate) {
@@ -1700,7 +1700,7 @@ urtw_led_mode0(struct urtw_softc *sc, int mode)
break;
default:
panic("unknown LED status 0x%x", sc->sc_gpio_ledstate);
- /* never reach */
+ /* never reach */
}
return (0);
}
@@ -1769,7 +1769,7 @@ urtw_led_ctl(struct urtw_softc *sc, int mode)
break;
default:
panic("unsupported LED mode %d\n", sc->sc_strategy);
- /* never reach */
+ /* never reach */
}
return (error);
@@ -1819,7 +1819,7 @@ urtw_led_blink(struct urtw_softc *sc)
break;
default:
panic("unknown LED status 0x%x", sc->sc_gpio_ledstate);
- /* never reach */
+ /* never reach */
}
return (0);
}
@@ -1843,7 +1843,7 @@ urtw_update_msr(struct urtw_softc *sc)
default:
panic("unsupported operation mode 0x%x\n",
ic->ic_opmode);
- /* never reach */
+ /* never reach */
}
} else
data |= URTW_MSR_LINK_NONE;
@@ -1860,7 +1860,7 @@ urtw_rate2rtl(int rate)
for (i = 0; i < nitems(urtw_ratetable); i++) {
if (rate == urtw_ratetable[i].reg)
- return urtw_ratetable[i].val;
+ return (urtw_ratetable[i].val);
}
return (3);
@@ -1873,7 +1873,7 @@ urtw_rtl2rate(int rate)
for (i = 0; i < nitems(urtw_ratetable); i++) {
if (rate == urtw_ratetable[i].val)
- return urtw_ratetable[i].reg;
+ return (urtw_ratetable[i].reg);
}
return (0);
@@ -2043,7 +2043,7 @@ urtw_init(struct ifnet *ifp)
urtw_write8_m(sc, 0x85, 0);
urtw_write8_m(sc, URTW_GPIO, 0);
- /* for led */
+ /* for led */
urtw_write8_m(sc, 0x85, 4);
error = urtw_led_ctl(sc, URTW_LED_CTL_POWER_ON);
if (error != 0)
@@ -2053,7 +2053,7 @@ urtw_init(struct ifnet *ifp)
if (error)
goto fail;
- /* applying MAC address again. */
+ /* applying MAC address again. */
IEEE80211_ADDR_COPY(ic->ic_myaddr, LLADDR(ifp->if_sadl));
urtw_write32_m(sc, URTW_MAC0, ((uint32_t *)ic->ic_myaddr)[0]);
urtw_write16_m(sc, URTW_MAC4, ((uint32_t *)ic->ic_myaddr)[1] & 0xffff);
@@ -2089,7 +2089,7 @@ urtw_init(struct ifnet *ifp)
if (error != 0)
goto fail;
- /* reset softc variables */
+ /* reset softc variables */
sc->sc_txidx = sc->sc_tx_low_queued = sc->sc_tx_normal_queued = 0;
sc->sc_txtimer = 0;
@@ -2462,7 +2462,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_node *ni, struct mbuf *m0,
data->buf[1] = (m0->m_pkthdr.len & 0x0f00) >> 8;
data->buf[1] |= (1 << 7);
- /* XXX sc_preamble_mode is always 2. */
+ /* XXX sc_preamble_mode is always 2. */
if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) &&
(ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) &&
(sc->sc_preamble_mode == 1) && (sc->sc_currate != 0))
@@ -2472,7 +2472,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_node *ni, struct mbuf *m0,
panic("TODO tx.");
if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG)
data->buf[2] |= (1 << 1);
- /* RTS rate - 10 means we use a basic rate. */
+ /* RTS rate - 10 means we use a basic rate. */
data->buf[2] |= (urtw_rate2rtl(2) << 3);
/*
* XXX currently TX rate control depends on the rate value of
@@ -2486,9 +2486,9 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_node *ni, struct mbuf *m0,
else if (ic->ic_fixed_rate != -1)
data->buf[3] = urtw_rate2rtl(ic->ic_fixed_rate);
}
- data->buf[8] = 3; /* CW minimum */
- data->buf[8] |= (7 << 4); /* CW maximum */
- data->buf[9] |= 11; /* retry limitation */
+ data->buf[8] = 3; /* CW minimum */
+ data->buf[8] |= (7 << 4); /* CW maximum */
+ data->buf[9] |= 11; /* retry limitation */
m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)&data->buf[12]);
data->ni = ni;
@@ -2614,7 +2614,7 @@ urtw_8225_set_txpwrlvl(struct urtw_softc *sc, int chan)
usbd_status error;
cck_pwrlvl_max = 11;
- ofdm_pwrlvl_max = 25; /* 12 -> 25 */
+ ofdm_pwrlvl_max = 25; /* 12 -> 25 */
ofdm_pwrlvl_min = 10;
/* CCK power setting */
@@ -2711,7 +2711,7 @@ urtw_8225_rf_init(struct urtw_softc *sc)
usbd_delay_ms(sc->sc_udev, 200);
urtw_8225_write(sc, 0x0, 0x127);
- for (i = 0; i < 95; i++) {
+ for (i = 0; i < nitems(urtw_8225_rxgain); i++) {
urtw_8225_write(sc, 0x1, (uint8_t)(i + 1));
urtw_8225_write(sc, 0x2, urtw_8225_rxgain[i]);
}
@@ -2719,7 +2719,7 @@ urtw_8225_rf_init(struct urtw_softc *sc)
urtw_8225_write(sc, 0x0, 0x27);
urtw_8225_write(sc, 0x0, 0x22f);
- for (i = 0; i < 128; i++) {
+ for (i = 0; i < nitems(urtw_8225_agc); i++) {
urtw_8187_write_phy_ofdm(sc, 0xb, urtw_8225_agc[i]);
urtw_8187_write_phy_ofdm(sc, 0xa, (uint8_t)i + 0x80);
}
@@ -2803,7 +2803,7 @@ urtw_8225_rf_set_sens(struct urtw_softc *sc, int sens)
usbd_status error;
if (sens < 0 || sens > 6)
- return -1;
+ return (-1);
if (sens > 4)
urtw_8225_write(sc, 0x0c, 0x850);
@@ -2845,8 +2845,8 @@ urtw_isbmode(uint16_t rate)
rate = urtw_rtl2rate(rate);
- return ((rate <= 22 && rate != 12 && rate != 18) ||
- rate == 44) ? (1) : (0);
+ return (((rate <= 22 && rate != 12 && rate != 18) ||
+ rate == 44) ? (1) : (0));
}
void
@@ -2879,7 +2879,7 @@ urtw_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
goto skip;
}
- /* 4 dword and 4 byte CRC */
+ /* 4 dword and 4 byte CRC */
len = actlen - (4 * 4);
desc = data->buf + len;
flen = ((desc[1] & 0x0f) << 8) + (desc[0] & 0xff);
@@ -2890,7 +2890,7 @@ urtw_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
rate = (desc[2] & 0xf0) >> 4;
quality = desc[4] & 0xff;
- /* XXX correct? */
+ /* XXX correct? */
rssi = (desc[6] & 0xfe) >> 1;
if (!urtw_isbmode(rate)) {
rssi = (rssi > 90) ? 90 : ((rssi < 25) ? 25 : rssi);
@@ -2931,7 +2931,7 @@ urtw_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
struct mbuf mb;
struct urtw_rx_radiotap_header *tap = &sc->sc_rxtap;
- /* XXX Are variables correct? */
+ /* XXX Are variables correct? */
tap->wr_chan_freq = htole16(ic->ic_bss->ni_chan->ic_freq);
tap->wr_chan_flags = htole16(ic->ic_bss->ni_chan->ic_flags);
tap->wr_dbm_antsignal = (int8_t)rssi;
@@ -2950,7 +2950,7 @@ urtw_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
sc->sc_currate = (rate > 0) ? rate : sc->sc_currate;
ni = ieee80211_find_rxnode(ic, wh);
- /* XXX correct? */
+ /* XXX correct? */
nf = (quality > 64) ? 0 : ((64 - quality) * 100) / 64;
/* send the frame to the 802.11 layer */
@@ -2976,7 +2976,7 @@ urtw_8225v2_setgain(struct urtw_softc *sc, int16_t gain)
uint8_t *gainp;
usbd_status error;
- /* XXX for A? */
+ /* XXX for A? */
gainp = urtw_8225v2_gain_bg;
urtw_8187_write_phy_ofdm(sc, 0x0d, gainp[gain * 3]);
usbd_delay_ms(sc->sc_udev, 1);
@@ -3081,7 +3081,7 @@ urtw_8225v2_rf_init(struct urtw_softc *sc)
urtw_8225_write(sc, 0x0, 0x1b7);
- for (i = 0; i < 95; i++) {
+ for (i = 0; i < nitems(urtw_8225v2_rxgain); i++) {
urtw_8225_write(sc, 0x1, (uint8_t)(i + 1));
urtw_8225_write(sc, 0x2, urtw_8225v2_rxgain[i]);
}
@@ -3115,7 +3115,7 @@ urtw_8225v2_rf_init(struct urtw_softc *sc)
usbd_delay_ms(sc->sc_udev, 100);
urtw_8225_write(sc, 0x0, 0x2bf);
- for (i = 0; i < 128; i++) {
+ for (i = 0; i < nitems(urtw_8225_agc); i++) {
urtw_8187_write_phy_ofdm(sc, 0xb, urtw_8225_agc[i]);
urtw_8187_write_phy_ofdm(sc, 0xa, (uint8_t)i + 0x80);
}
@@ -3264,12 +3264,12 @@ urtw_task(void *arg)
case IEEE80211_S_RUN:
ni = ic->ic_bss;
- /* setting bssid. */
+ /* setting bssid. */
urtw_write32_m(sc, URTW_BSSID, ((uint32_t *)ni->ni_bssid)[0]);
urtw_write16_m(sc, URTW_BSSID + 4,
((uint16_t *)ni->ni_bssid)[2]);
urtw_update_msr(sc);
- /* XXX maybe the below would be incorrect. */
+ /* XXX maybe the below would be incorrect. */
urtw_write16_m(sc, URTW_ATIM_WND, 2);
urtw_write16_m(sc, URTW_ATIM_TR_ITV, 100);
urtw_write16_m(sc, URTW_BEACON_INTERVAL, 0x64);
diff --git a/sys/dev/usb/if_urtwreg.h b/sys/dev/usb/if_urtwreg.h
index d7ed772be5d..fb93656d98a 100644
--- a/sys/dev/usb/if_urtwreg.h
+++ b/sys/dev/usb/if_urtwreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urtwreg.h,v 1.4 2009/06/04 19:37:26 martynas Exp $ */
+/* $OpenBSD: if_urtwreg.h,v 1.5 2009/06/04 19:53:17 martynas Exp $ */
/*-
* Copyright (c) 2008 Weongyo Jeong <weongyo@FreeBSD.org>
@@ -19,26 +19,26 @@
#define URTW_CONFIG_NO 1
#define URTW_IFACE_INDEX 0
-/* for 8187 */
-#define URTW_MAC0 0x0000 /* 1 byte */
-#define URTW_MAC1 0x0001 /* 1 byte */
-#define URTW_MAC2 0x0002 /* 1 byte */
-#define URTW_MAC3 0x0003 /* 1 byte */
-#define URTW_MAC4 0x0004 /* 1 byte */
-#define URTW_MAC5 0x0005 /* 1 byte */
-#define URTW_BRSR 0x002c /* 2 byte */
+/* for 8187 */
+#define URTW_MAC0 0x0000 /* 1 byte */
+#define URTW_MAC1 0x0001 /* 1 byte */
+#define URTW_MAC2 0x0002 /* 1 byte */
+#define URTW_MAC3 0x0003 /* 1 byte */
+#define URTW_MAC4 0x0004 /* 1 byte */
+#define URTW_MAC5 0x0005 /* 1 byte */
+#define URTW_BRSR 0x002c /* 2 byte */
#define URTW_BRSR_MBR_8185 (0x0fff)
-#define URTW_BSSID 0x002e /* 6 byte */
-#define URTW_RESP_RATE 0x0034 /* 1 byte */
+#define URTW_BSSID 0x002e /* 6 byte */
+#define URTW_RESP_RATE 0x0034 /* 1 byte */
#define URTW_RESP_MAX_RATE_SHIFT (4)
#define URTW_RESP_MIN_RATE_SHIFT (0)
-#define URTW_EIFS 0x0035 /* 1 byte */
-#define URTW_INTR_MASK 0x003c /* 2 byte */
-#define URTW_CMD 0x0037 /* 1 byte */
+#define URTW_EIFS 0x0035 /* 1 byte */
+#define URTW_INTR_MASK 0x003c /* 2 byte */
+#define URTW_CMD 0x0037 /* 1 byte */
#define URTW_CMD_TX_ENABLE (0x4)
#define URTW_CMD_RX_ENABLE (0x8)
#define URTW_CMD_RST (0x10)
-#define URTW_TX_CONF 0x0040 /* 4 byte */
+#define URTW_TX_CONF 0x0040 /* 4 byte */
#define URTW_TX_LOOPBACK_SHIFT (17)
#define URTW_TX_LOOPBACK_NONE (0 << URTW_TX_LOOPBACK_SHIFT)
#define URTW_TX_LOOPBACK_MAC (1 << URTW_TX_LOOPBACK_SHIFT)
@@ -58,7 +58,7 @@
#define URTW_TX_DISCW (1 << 20)
#define URTW_TX_SWPLCPLEN (1 << 24)
#define URTW_TX_NOICV (0x80000)
-#define URTW_RX 0x0044 /* 4 byte */
+#define URTW_RX 0x0044 /* 4 byte */
#define URTW_RX_9356SEL (1 << 6)
#define URTW_RX_FILTER_MASK \
(URTW_RX_FILTER_ALLMAC | URTW_RX_FILTER_NICMAC | URTW_RX_FILTER_MCAST | \
@@ -91,8 +91,8 @@
#define URTW_MAX_RX_DMA_1024 (6)
#define URTW_MAX_RX_DMA_SHIFT (10)
#define URTW_RCR_ONLYERLPKT (1 << 31)
-#define URTW_INT_TIMEOUT 0x0048 /* 4 byte */
-#define URTW_EPROM_CMD 0x0050 /* 1 byte */
+#define URTW_INT_TIMEOUT 0x0048 /* 4 byte */
+#define URTW_EPROM_CMD 0x0050 /* 1 byte */
#define URTW_EPROM_CMD_NORMAL (0x0)
#define URTW_EPROM_CMD_NORMAL_MODE \
(URTW_EPROM_CMD_NORMAL << URTW_EPROM_CMD_SHIFT)
@@ -108,55 +108,55 @@
#define URTW_EPROM_CK (0x4)
#define URTW_EPROM_CS (0x8)
#define URTW_CONFIG2 0x0053
-#define URTW_ANAPARAM 0x0054 /* 4 byte */
+#define URTW_ANAPARAM 0x0054 /* 4 byte */
#define URTW_8225_ANAPARAM_ON (0xa0000a59)
-#define URTW_MSR 0x0058 /* 1 byte */
+#define URTW_MSR 0x0058 /* 1 byte */
#define URTW_MSR_LINK_MASK ((1 << 2) | (1 << 3))
#define URTW_MSR_LINK_SHIFT (2)
#define URTW_MSR_LINK_NONE (0 << URTW_MSR_LINK_SHIFT)
#define URTW_MSR_LINK_ADHOC (1 << URTW_MSR_LINK_SHIFT)
#define URTW_MSR_LINK_STA (2 << URTW_MSR_LINK_SHIFT)
#define URTW_MSR_LINK_HOSTAP (3 << URTW_MSR_LINK_SHIFT)
-#define URTW_CONFIG3 0x0059 /* 1 byte */
+#define URTW_CONFIG3 0x0059 /* 1 byte */
#define URTW_CONFIG3_ANAPARAM_WRITE (0x40)
#define URTW_CONFIG3_ANAPARAM_W_SHIFT (6)
-#define URTW_PSR 0x005e /* 1 byte */
-#define URTW_ANAPARAM2 0x0060 /* 4 byte */
+#define URTW_PSR 0x005e /* 1 byte */
+#define URTW_ANAPARAM2 0x0060 /* 4 byte */
#define URTW_8225_ANAPARAM2_ON (0x860c7312)
-#define URTW_BEACON_INTERVAL 0x0070 /* 2 byte */
-#define URTW_ATIM_WND 0x0072 /* 2 byte */
-#define URTW_BEACON_INTERVAL_TIME 0x0074 /* 2 byte */
-#define URTW_ATIM_TR_ITV 0x0076 /* 2 byte */
-#define URTW_RF_PINS_OUTPUT 0x0080 /* 2 byte */
+#define URTW_BEACON_INTERVAL 0x0070 /* 2 byte */
+#define URTW_ATIM_WND 0x0072 /* 2 byte */
+#define URTW_BEACON_INTERVAL_TIME 0x0074 /* 2 byte */
+#define URTW_ATIM_TR_ITV 0x0076 /* 2 byte */
+#define URTW_RF_PINS_OUTPUT 0x0080 /* 2 byte */
#define URTW_BB_HOST_BANG_CLK (1 << 1)
#define URTW_BB_HOST_BANG_EN (1 << 2)
#define URTW_BB_HOST_BANG_RW (1 << 3)
-#define URTW_RF_PINS_ENABLE 0x0082 /* 2 byte */
-#define URTW_RF_PINS_SELECT 0x0084 /* 2 byte */
-#define URTW_RF_PINS_INPUT 0x0086 /* 2 byte */
-#define URTW_RF_PARA 0x0088 /* 4 byte */
-#define URTW_RF_TIMING 0x008c /* 4 byte */
-#define URTW_GP_ENABLE 0x0090 /* 1 byte */
-#define URTW_GPIO 0x0091 /* 1 byte */
-#define URTW_TX_AGC_CTL 0x009c /* 1 byte */
+#define URTW_RF_PINS_ENABLE 0x0082 /* 2 byte */
+#define URTW_RF_PINS_SELECT 0x0084 /* 2 byte */
+#define URTW_RF_PINS_INPUT 0x0086 /* 2 byte */
+#define URTW_RF_PARA 0x0088 /* 4 byte */
+#define URTW_RF_TIMING 0x008c /* 4 byte */
+#define URTW_GP_ENABLE 0x0090 /* 1 byte */
+#define URTW_GPIO 0x0091 /* 1 byte */
+#define URTW_TX_AGC_CTL 0x009c /* 1 byte */
#define URTW_TX_AGC_CTL_PERPACKET_GAIN (0x1)
#define URTW_TX_AGC_CTL_PERPACKET_ANTSEL (0x2)
#define URTW_TX_AGC_CTL_FEEDBACK_ANT (0x4)
-#define URTW_TX_GAIN_CCK 0x009d /* 1 byte */
-#define URTW_TX_GAIN_OFDM 0x009e /* 1 byte */
-#define URTW_TX_ANTENNA 0x009f /* 1 byte */
-#define URTW_WPA_CONFIG 0x00b0 /* 1 byte */
-#define URTW_SIFS 0x00b4 /* 1 byte */
-#define URTW_DIFS 0x00b5 /* 1 byte */
-#define URTW_SLOT 0x00b6 /* 1 byte */
-#define URTW_CW_CONF 0x00bc /* 1 byte */
+#define URTW_TX_GAIN_CCK 0x009d /* 1 byte */
+#define URTW_TX_GAIN_OFDM 0x009e /* 1 byte */
+#define URTW_TX_ANTENNA 0x009f /* 1 byte */
+#define URTW_WPA_CONFIG 0x00b0 /* 1 byte */
+#define URTW_SIFS 0x00b4 /* 1 byte */
+#define URTW_DIFS 0x00b5 /* 1 byte */
+#define URTW_SLOT 0x00b6 /* 1 byte */
+#define URTW_CW_CONF 0x00bc /* 1 byte */
#define URTW_CW_CONF_PERPACKET_RETRY (0x2)
#define URTW_CW_CONF_PERPACKET_CW (0x1)
-#define URTW_CW_VAL 0x00bd /* 1 byte */
-#define URTW_RATE_FALLBACK 0x00be /* 1 byte */
-#define URTW_TALLY_SEL 0x00fc /* 1 byte */
+#define URTW_CW_VAL 0x00bd /* 1 byte */
+#define URTW_RATE_FALLBACK 0x00be /* 1 byte */
+#define URTW_TALLY_SEL 0x00fc /* 1 byte */
-/* for EEPROM */
+/* for EEPROM */
#define URTW_EPROM_TXPW_BASE 0x05
#define URTW_EPROM_RFCHIPID 0x06
#define URTW_EPROM_RFCHIPID_RTL8225U (5)
@@ -172,7 +172,7 @@
#define URTW_EPROM_CID_SERCOMM_PS (0x02)
#define URTW_EPROM_CID_HW_LED (0x03)
-/* LED */
+/* LED */
#define URTW_CID_DEFAULT 0
#define URTW_CID_8187_ALPHA0 1
#define URTW_CID_8187_SERCOMM_PS 2
@@ -198,7 +198,7 @@
#define URTW_LED_NO_LINK_BLINK 7
#define URTW_LED_BLINK_CM3 8
-/* for extra area */
+/* for extra area */
#define URTW_EPROM_DISABLE 0
#define URTW_EPROM_ENABLE 1
#define URTW_EPROM_DELAY 10
@@ -226,7 +226,7 @@ struct urtw_rx_data {
struct mbuf *m;
};
-/* XXX not correct.. */
+/* XXX not correct.. */
#define URTW_MIN_RXBUFSZ \
(sizeof(struct ieee80211_frame_min))
@@ -281,7 +281,7 @@ struct urtw_softc {
uint8_t sc_crcmon;
uint8_t sc_bssid[IEEE80211_ADDR_LEN];
- /* for RF */
+ /* for RF */
usbd_status (*sc_rf_init)(struct urtw_softc *);
usbd_status (*sc_rf_set_chan)(struct urtw_softc *,
int);
@@ -289,7 +289,7 @@ struct urtw_softc {
int);
uint32_t sc_max_sens;
uint32_t sc_sens;
- /* for LED */
+ /* for LED */
struct timeout sc_led_ch;
struct usb_task sc_ledtask;
uint8_t sc_psr;
@@ -301,13 +301,13 @@ struct urtw_softc {
uint8_t sc_gpio_ledpin;
uint8_t sc_gpio_blinktime;
uint8_t sc_gpio_blinkstate;
- /* RX/TX */
+ /* RX/TX */
usbd_pipe_handle sc_rxpipe;
usbd_pipe_handle sc_txpipe_low;
usbd_pipe_handle sc_txpipe_normal;
#define URTW_PRIORITY_LOW 0
#define URTW_PRIORITY_NORMAL 1
-#define URTW_DATA_TIMEOUT 10000 /* 10 sec */
+#define URTW_DATA_TIMEOUT 10000 /* 10 sec */
struct urtw_rx_data sc_rxdata[URTW_RX_DATA_LIST_COUNT];
struct urtw_tx_data sc_txdata[URTW_TX_DATA_LIST_COUNT];
uint32_t sc_tx_low_queued;
@@ -319,7 +319,7 @@ struct urtw_softc {
struct timeout scan_to;
int sc_txtimer;
int sc_currate;
- /* TX power */
+ /* TX power */
uint8_t sc_txpwr_cck[URTW_MAX_CHANNELS];
uint8_t sc_txpwr_cck_base;
uint8_t sc_txpwr_ofdm[URTW_MAX_CHANNELS];