Use new docs provided by RFMD to give some meaning to

previously-undocumented registers and magic numbers on the RF3000
baseband.
This commit is contained in:
dyoung 2004-01-10 06:30:35 +00:00
parent bd26cc12f9
commit a94687e30c
2 changed files with 28 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: atw.c,v 1.12 2003/11/16 09:02:42 dyoung Exp $ */
/* $NetBSD: atw.c,v 1.13 2004/01/10 06:30:35 dyoung Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.12 2003/11/16 09:02:42 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.13 2004/01/10 06:30:35 dyoung Exp $");
#include "bpfilter.h"
@ -1510,13 +1510,12 @@ atw_rf3000_init(sc)
if (rc != 0)
goto out;
/* magic derived from binary-only driver */
rc = atw_rf3000_write(sc, RF3000_MAGIC0, RF3000_MAGIC0_VAL);
rc = atw_rf3000_write(sc, RF3000_OPTIONS1, 0x0);
if (rc != 0)
goto out;
rc = atw_rf3000_write(sc, RF3000_MAGIC1, RF3000_MAGIC1_VAL);
rc = atw_rf3000_write(sc, RF3000_OPTIONS2, RF3000_OPTIONS2_LNAGS_DELAY);
if (rc != 0)
goto out;

View File

@ -1,4 +1,4 @@
/* $NetBSD: atwreg.h,v 1.3 2003/12/07 04:22:57 dyoung Exp $ */
/* $NetBSD: atwreg.h,v 1.4 2004/01/10 06:30:36 dyoung Exp $ */
/*
* Copyright (c) 2003 The NetBSD Foundation, Inc. All rights reserved.
@ -893,12 +893,27 @@ struct atw_rxdesc {
#define RF3000_HIGAINCAL_DSSSPAD BIT(6) /* 6dB gain pad for DSSS
* modes (meaning?)
*/
#define RF3000_MAGIC0 0x1C /* magic register derived from
* a binary-only driver
*/
#define RF3000_MAGIC0_VAL 0x00
#define RF3000_MAGIC1 0x1D /* magic register derived from
* a binary-only driver
*/
#define RF3000_MAGIC1_VAL 0x80
#define RF3000_OPTIONS1 0x1C /* Options Register 1 */
/* Saturation threshold is 4 + offset, where -3 <= offset <= 3.
* SAT_THRESH is the absolute value, SAT_THRESH_SIGN is the sign.
*/
#define RF3000_OPTIONS1_SAT_THRESH_SIGN BIT(7)
#define RF3000_OPTIONS1_SAT_THRESH BITS(6,5)
#define RF3000_OPTIONS1_ALTAGC BIT(4) /* 1: retrigger AGC
* algorithm on ADC
* saturation
*/
#define RF3000_OPTIONS1_ALTBUS BIT(3) /* 1: enable alternate
* Tx/Rx data bus
* interface.
*/
#define RF3000_OPTIONS1_RESERVED0_MASK BITS(2,0)/* 0 */
#define RF3000_OPTIONS2 0x1D /* Options Register 2 */
/* 1: delay next AGC 2us instead of 1us after a 1->0 LNAGS-pin transition. */
#define RF3000_OPTIONS2_LNAGS_DELAY BIT(7)
#define RF3000_OPTIONS2_RESERVED0_MASK BITS(6,3) /* 0 */
/* Threshold for AGC re-trigger. 0: high count, 1: low count. */
#define RF3000_OPTIONS2_RTG_THRESH BIT(2)
#define RF3000_OPTIONS2_RESERVED1_MASK BITS(1,0) /* 0 */