I like the tlp/atw-style names for software descriptors, txsoft,

better than txctl.  Change from rtw_txctl/rtw_rxctl to
rtw_txsoft/rtw_rxsoft.  Change the descriptor blocks' names to
match: rtw_txctl_blk becomes rtw_txsoft_blk.  Change the member-name
prefixes for both software and hardware descriptors.
This commit is contained in:
dyoung 2004-12-29 01:06:52 +00:00
parent fae5965c52
commit c3b84ef737
3 changed files with 342 additions and 342 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtwreg.h,v 1.5 2004/12/27 08:59:16 mycroft Exp $ */ /* $NetBSD: rtwreg.h,v 1.6 2004/12/29 01:06:52 dyoung Exp $ */
/* /*
* Copyright (c) 2003 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 2003 The NetBSD Foundation, Inc. All rights reserved.
@ -846,15 +846,15 @@
/* Tx descriptor */ /* Tx descriptor */
struct rtw_txdesc { struct rtw_txdesc {
u_int32_t htx_ctl0; u_int32_t td_ctl0;
u_int32_t htx_ctl1; u_int32_t td_ctl1;
u_int32_t htx_buf; u_int32_t td_buf;
u_int32_t htx_len; u_int32_t td_len;
u_int32_t htx_next; u_int32_t td_next;
u_int32_t htx_rsvd[3]; u_int32_t td_rsvd[3];
}; };
#define htx_stat htx_ctl0 #define td_stat td_ctl0
#define RTW_TXCTL0_OWN BIT(31) /* 1: ready to Tx */ #define RTW_TXCTL0_OWN BIT(31) /* 1: ready to Tx */
#define RTW_TXCTL0_RSVD0 BIT(30) /* reserved */ #define RTW_TXCTL0_RSVD0 BIT(30) /* reserved */
@ -908,16 +908,16 @@ struct rtw_txdesc {
/* Rx descriptor */ /* Rx descriptor */
struct rtw_rxdesc { struct rtw_rxdesc {
u_int32_t hrx_ctl; u_int32_t rd_ctl;
u_int32_t hrx_rsvd0; u_int32_t rd_rsvd0;
u_int32_t hrx_buf; u_int32_t rd_buf;
u_int32_t hrx_rsvd1; u_int32_t rd_rsvd1;
}; };
#define hrx_stat hrx_ctl #define rd_stat rd_ctl
#define hrx_rssi hrx_rsvd0 #define rd_rssi rd_rsvd0
#define hrx_tsftl hrx_buf /* valid only when RTW_RXSTAT_LS is set */ #define rd_tsftl rd_buf /* valid only when RTW_RXSTAT_LS is set */
#define hrx_tsfth hrx_rsvd1 /* valid only when RTW_RXSTAT_LS is set */ #define rd_tsfth rd_rsvd1 /* valid only when RTW_RXSTAT_LS is set */
#define RTW_RXCTL_OWN BIT(31) /* 1: owned by NIC */ #define RTW_RXCTL_OWN BIT(31) /* 1: owned by NIC */
#define RTW_RXCTL_EOR BIT(30) /* end of ring */ #define RTW_RXCTL_EOR BIT(30) /* end of ring */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtwvar.h,v 1.14 2004/12/29 00:21:37 dyoung Exp $ */ /* $NetBSD: rtwvar.h,v 1.15 2004/12/29 01:06:52 dyoung Exp $ */
/*- /*-
* Copyright (c) 2004, 2005 David Young. All rights reserved. * Copyright (c) 2004, 2005 David Young. All rights reserved.
* *
@ -123,20 +123,20 @@ struct rtw_srom {
u_int16_t sr_size; u_int16_t sr_size;
}; };
struct rtw_rxctl { struct rtw_rxsoft {
struct mbuf *srx_mbuf; struct mbuf *rs_mbuf;
bus_dmamap_t srx_dmamap; bus_dmamap_t rs_dmamap;
}; };
struct rtw_txctl { struct rtw_txsoft {
SIMPLEQ_ENTRY(rtw_txctl) stx_q; SIMPLEQ_ENTRY(rtw_txsoft) ts_q;
struct mbuf *stx_mbuf; struct mbuf *ts_mbuf;
bus_dmamap_t stx_dmamap; bus_dmamap_t ts_dmamap;
struct ieee80211_node *stx_ni; /* destination node */ struct ieee80211_node *ts_ni; /* destination node */
u_int stx_first; /* 1st hw descriptor */ u_int ts_first; /* 1st hw descriptor */
u_int stx_last; /* last hw descriptor */ u_int ts_last; /* last hw descriptor */
struct ieee80211_duration stx_d0; struct ieee80211_duration ts_d0;
struct ieee80211_duration stx_dn; struct ieee80211_duration ts_dn;
}; };
#define RTW_NTXPRI 4 /* number of Tx priorities */ #define RTW_NTXPRI 4 /* number of Tx priorities */
@ -169,39 +169,39 @@ struct rtw_txctl {
#define RTW_RXQLEN 64 #define RTW_RXQLEN 64
struct rtw_rxdesc_blk { struct rtw_rxdesc_blk {
struct rtw_rxdesc *hrc_desc; struct rtw_rxdesc *rdb_desc;
u_int hrc_next; u_int rdb_next;
u_int hrc_ndesc; u_int rdb_ndesc;
bus_dma_tag_t hrc_dmat; bus_dma_tag_t rdb_dmat;
bus_dmamap_t hrc_dmamap; bus_dmamap_t rdb_dmamap;
}; };
struct rtw_txdesc_blk { struct rtw_txdesc_blk {
u_int htc_ndesc; u_int tdb_ndesc;
u_int htc_next; u_int tdb_next;
u_int htc_nfree; u_int tdb_nfree;
bus_dma_tag_t htc_dmat; bus_dma_tag_t tdb_dmat;
bus_dmamap_t htc_dmamap; bus_dmamap_t tdb_dmamap;
bus_addr_t htc_physbase; bus_addr_t tdb_physbase;
bus_addr_t htc_ofs; bus_addr_t tdb_ofs;
struct rtw_txdesc *htc_desc; struct rtw_txdesc *tdb_desc;
}; };
#define RTW_NEXT_IDX(__htc, __idx) (((__idx) + 1) % (__htc)->htc_ndesc) #define RTW_NEXT_IDX(__htc, __idx) (((__idx) + 1) % (__htc)->tdb_ndesc)
#define RTW_NEXT_DESC(__htc, __idx) \ #define RTW_NEXT_DESC(__htc, __idx) \
((__htc)->htc_physbase + \ ((__htc)->tdb_physbase + \
sizeof(struct rtw_txdesc) * RTW_NEXT_IDX((__htc), (__idx))) sizeof(struct rtw_txdesc) * RTW_NEXT_IDX((__htc), (__idx)))
SIMPLEQ_HEAD(rtw_txq, rtw_txctl); SIMPLEQ_HEAD(rtw_txq, rtw_txsoft);
struct rtw_txctl_blk { struct rtw_txsoft_blk {
/* dirty/free s/w descriptors */ /* dirty/free s/w descriptors */
struct rtw_txq stc_dirtyq; struct rtw_txq tsb_dirtyq;
struct rtw_txq stc_freeq; struct rtw_txq tsb_freeq;
u_int stc_ndesc; u_int tsb_ndesc;
int stc_tx_timer; int tsb_tx_timer;
struct rtw_txctl *stc_desc; struct rtw_txsoft *tsb_desc;
}; };
struct rtw_descs { struct rtw_descs {
@ -394,12 +394,12 @@ struct rtw_softc {
u_int8_t sc_phydelay; u_int8_t sc_phydelay;
/* s/w Tx/Rx descriptors */ /* s/w Tx/Rx descriptors */
struct rtw_txctl_blk sc_txctl_blk[RTW_NTXPRI]; struct rtw_txsoft_blk sc_txsoft_blk[RTW_NTXPRI];
u_int sc_txq; u_int sc_txq;
u_int sc_txnext; u_int sc_txnext;
struct rtw_txdesc_blk sc_txdesc_blk[RTW_NTXPRI]; struct rtw_txdesc_blk sc_txdesc_blk[RTW_NTXPRI];
struct rtw_rxctl sc_rxctl[RTW_RXQLEN]; struct rtw_rxsoft sc_rxsoft[RTW_RXQLEN];
struct rtw_rxdesc_blk sc_rxdesc_blk; struct rtw_rxdesc_blk sc_rxdesc_blk;
struct rtw_descs *sc_descs; struct rtw_descs *sc_descs;