PERFORCE change 133172 for review
Sepherosa Ziehau
sephe at FreeBSD.org
Sat Jan 12 23:54:42 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=133172
Change 133172 by sephe at sephe_zealot:sam_wifi on 2008/01/13 07:54:10
- Correct bbp_read
- Set TX/RX antenna after BBP is initialized
- Set {TX,CIPHER}_BUSY flag after TX desc is fully setup
- Process encryption intr when RX intr comes
Obtained-from: DragonFly
Affected files ...
.. //depot/projects/wifi/sys/dev/ral/rt2560.c#28 edit
Differences ...
==== //depot/projects/wifi/sys/dev/ral/rt2560.c#28 (text) ====
@@ -1370,8 +1370,10 @@
if (r & RT2560_DECRYPTION_DONE)
rt2560_decryption_intr(sc);
- if (r & RT2560_RX_DONE)
+ if (r & RT2560_RX_DONE) {
rt2560_rx_intr(sc);
+ rt2560_encryption_intr(sc);
+ }
/* re-enable interrupts */
RAL_WRITE(sc, RT2560_CSR8, RT2560_INTR_MASK);
@@ -1515,8 +1517,8 @@
desc->flags = htole32(flags);
desc->flags |= htole32(len << 16);
- desc->flags |= encrypt ? htole32(RT2560_TX_CIPHER_BUSY) :
- htole32(RT2560_TX_BUSY | RT2560_TX_VALID);
+ if (!encrypt)
+ desc->flags |= htole32(RT2560_TX_VALID);
desc->physaddr = htole32(physaddr);
desc->wme = htole16(
@@ -1548,6 +1550,9 @@
if (rate != 2 && (ic->ic_flags & IEEE80211_F_SHPREAMBLE))
desc->plcp_signal |= 0x08;
}
+
+ desc->flags |= encrypt ? htole32(RT2560_TX_CIPHER_BUSY)
+ : htole32(RT2560_TX_BUSY);
}
static int
@@ -2195,6 +2200,16 @@
uint32_t val;
int ntries;
+ for (ntries = 0; ntries < 100; ntries++) {
+ if (!(RAL_READ(sc, RT2560_BBPCSR) & RT2560_BBP_BUSY))
+ break;
+ DELAY(1);
+ }
+ if (ntries == 100) {
+ device_printf(sc->sc_dev, "could not read from BBP\n");
+ return 0;
+ }
+
val = RT2560_BBP_BUSY | reg << 8;
RAL_WRITE(sc, RT2560_BBPCSR, val);
@@ -2752,8 +2767,6 @@
/* set basic rate set (will be updated later) */
RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x153);
- rt2560_set_txantenna(sc, sc->tx_ant);
- rt2560_set_rxantenna(sc, sc->rx_ant);
rt2560_update_slot(ifp);
rt2560_update_plcp(sc);
rt2560_update_led(sc, 0, 0);
@@ -2767,6 +2780,9 @@
return;
}
+ rt2560_set_txantenna(sc, sc->tx_ant);
+ rt2560_set_rxantenna(sc, sc->rx_ant);
+
/* set default BSS channel */
rt2560_set_chan(sc, ic->ic_curchan);
More information about the p4-projects
mailing list