From owner-p4-projects@FreeBSD.ORG Sat Nov 26 23:09:17 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2226916A422; Sat, 26 Nov 2005 23:09:17 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BFD9B16A41F for ; Sat, 26 Nov 2005 23:09:16 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57FA343D4C for ; Sat, 26 Nov 2005 23:09:16 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jAQN9GLL020395 for ; Sat, 26 Nov 2005 23:09:16 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jAQN9FYJ020392 for perforce@freebsd.org; Sat, 26 Nov 2005 23:09:15 GMT (envelope-from sam@freebsd.org) Date: Sat, 26 Nov 2005 23:09:15 GMT Message-Id: <200511262309.jAQN9FYJ020392@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 87287 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2005 23:09:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=87287 Change 87287 by sam@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 #include +#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)