PERFORCE change 87287 for review
Sam Leffler
sam at FreeBSD.org
Sat Nov 26 23:09:18 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=87287
Change 87287 by sam at sam_ebb on 2005/11/26 23:08:58
o enable qos frame rx
o when wme is in use take cw params from the tx descriptor
instead of the register config
o disable wme capability for now; need to figure out why
sending qos frames fails
Affected files ...
.. //depot/projects/wifi/sys/dev/ral/if_ral.c#15 edit
.. //depot/projects/wifi/sys/dev/ral/if_ralreg.h#2 edit
Differences ...
==== //depot/projects/wifi/sys/dev/ral/if_ral.c#15 (text+ko) ====
@@ -63,6 +63,7 @@
#include <dev/ral/if_ralreg.h>
#include <dev/ral/if_ralvar.h>
+#define RAL_DEBUG
#ifdef RAL_DEBUG
#define DPRINTF(x) do { if (ral_debug > 0) printf x; } while (0)
#define DPRINTFN(n, x) do { if (ral_debug >= (n)) printf x; } while (0)
@@ -428,7 +429,9 @@
| IEEE80211_C_TXPMGT
| IEEE80211_C_BGSCAN /* capable of bg scanning */
| IEEE80211_C_WPA /* capable of WPA1+WPA2 */
- | IEEE80211_C_WME /* capable of WME */
+#if 0
+ | IEEE80211_C_WME /* capable of WME (not yet) */
+#endif
;
if (sc->rf_rev == RAL_RF_5222) {
@@ -2578,7 +2581,12 @@
eifs = IEEE80211_IS_CHAN_B(ic->ic_curchan) ? 364 : 60;
tmp = RAL_READ(sc, RAL_CSR11);
- tmp = (tmp & ~0x1f00) | slottime << 8;
+ tmp = (tmp & ~RAL_BACKOFF_SLOTTIME) | (slottime << RAL_BACKOFF_SLOTTIME_S);
+ /* XXX belongs elsewhere but this is convenient */
+ if (ic->ic_flags & IEEE80211_F_WME)
+ tmp |= RAL_BACKOFF_CWSELECT;
+ else
+ tmp &= ~RAL_BACKOFF_CWSELECT;
RAL_WRITE(sc, RAL_CSR11, tmp);
tmp = tx_pifs << 16 | tx_sifs;
@@ -2855,11 +2863,15 @@
/* kick Rx */
tmp = RAL_DROP_PHY_ERROR | RAL_DROP_CRC_ERROR;
if (ic->ic_opmode != IEEE80211_M_MONITOR) {
+ /* XXX need CTL frames for ap pwr save */
tmp |= RAL_DROP_CTL | RAL_DROP_VERSION_ERROR;
+ /* XXX needed for repeater operation */
if (ic->ic_opmode != IEEE80211_M_HOSTAP)
tmp |= RAL_DROP_TODS;
if (!(ifp->if_flags & IFF_PROMISC))
tmp |= RAL_DROP_NOT_TO_ME;
+ if (ic->ic_flags & IEEE80211_F_WME)
+ tmp |= RAL_ENABLE_QOS;
}
RAL_WRITE(sc, RAL_RXCSR0, tmp);
==== //depot/projects/wifi/sys/dev/ral/if_ralreg.h#2 (text+ko) ====
@@ -114,19 +114,34 @@
/* possible flags for register RXCSR0 */
-#define RAL_DISABLE_RX (1 << 0)
-#define RAL_DROP_CRC_ERROR (1 << 1)
-#define RAL_DROP_PHY_ERROR (1 << 2)
-#define RAL_DROP_CTL (1 << 3)
-#define RAL_DROP_NOT_TO_ME (1 << 4)
-#define RAL_DROP_TODS (1 << 5)
-#define RAL_DROP_VERSION_ERROR (1 << 6)
+#define RAL_DISABLE_RX (1 << 0) /* disable rx engine */
+#define RAL_DROP_CRC_ERROR (1 << 1) /* drop frames w/ crc errors */
+#define RAL_DROP_PHY_ERROR (1 << 2) /* drop frames w/ phy errors */
+#define RAL_DROP_CTL (1 << 3) /* drop ctrl frames */
+#define RAL_DROP_NOT_TO_ME (1 << 4) /* drop unicast frames !to-me */
+#define RAL_DROP_TODS (1 << 5) /* drop frames with ToDs set */
+#define RAL_DROP_VERSION_ERROR (1 << 6) /* drop frames w/ bad version */
+#define RAL_PASS_CRC (1 << 7) /* include CRC with frame */
+#define RAL_PASS_PLCP (1 << 8) /* include PLCP with frame */
+#define RAL_DROP_MCAST (1 << 9) /* drop multicast frames */
+#define RAL_DROP_BCAST (1 << 10) /* drop broadcast frames */
+#define RAL_ENABLE_QOS (1 << 11) /* accept QOS data frames */
/* possible flags for register CSR1 */
#define RAL_RESET_ASIC (1 << 0)
#define RAL_RESET_BBP (1 << 1)
#define RAL_HOST_READY (1 << 2)
+/* CSR11: back-off control register */
+#define RAL_BACKOFF_CWMIN 0x0000000f /* Cwmin */
+#define RAL_BACKOFF_CWMAX 0x000000f0 /* Cwmax */
+#define RAL_BACKOFF_SLOTTIME 0x00001f00 /* Slot time */
+#define RAL_BACKOFF_SLOTTIME_S 8
+#define RAL_BACKOFF_CWSELECT 0x00002000 /* CW param select (1 => reg, 0 => TxD) */
+/* bits 14-15 are reserved */
+#define RAL_BACKOFF_LGRETRY 0x00ff0000 /* long retry count */
+#define RAL_BACKOFF_SHRETRY 0xff000000 /* short retry count */
+
/* possible flags for register CSR14 */
#define RAL_ENABLE_TSF (1 << 0)
#define RAL_ENABLE_TSF_SYNC(x) (((x) & 0x3) << 1)
More information about the p4-projects
mailing list