diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-04-11 11:34:01 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-04-11 11:34:01 +0000 |
commit | 389f7e08646458d7e3c27f41264733dfff6cbb5b (patch) | |
tree | 228b4260b6e62c89634787027cf567d848332d3d /sys/dev/pci/if_tht.c | |
parent | 8783ee18f36bd14e61a25ee73f1da86845ef96d3 (diff) |
introduce THT_{RXF/TXT}_PKT_NUM macros and use them instead of the
hard coded value of 128 for the pkt allocations.
OK dlg@
Diffstat (limited to 'sys/dev/pci/if_tht.c')
-rw-r--r-- | sys/dev/pci/if_tht.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index 9a84a5c2795..05708f68738 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.113 2008/04/04 11:05:04 dlg Exp $ */ +/* $OpenBSD: if_tht.c,v 1.114 2008/04/11 11:34:00 thib Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -297,6 +297,7 @@ struct tht_rx_free { #define THT_RXF_SGL_LEN ((THT_FIFO_DESC_LEN - \ sizeof(struct tht_rx_free)) / \ sizeof(struct tht_pbd)) +#define THT_RXF_PKT_NUM 128 /* rx descriptor */ struct tht_rx_desc { @@ -378,6 +379,7 @@ struct tht_tx_task { #define THT_TXT_SGL_LEN ((THT_FIFO_DESC_LEN - \ sizeof(struct tht_tx_task)) / \ sizeof(struct tht_pbd)) +#define THT_TXT_PKT_NUM 128 /* tx free fifo */ struct tht_tx_free { @@ -943,9 +945,11 @@ tht_up(struct tht_softc *sc) return; } - if (tht_pkt_alloc(sc, &sc->sc_tx_list, 128, THT_TXT_SGL_LEN) != 0) + if (tht_pkt_alloc(sc, &sc->sc_tx_list, THT_TXT_PKT_NUM, + THT_TXT_SGL_LEN) != 0) return; - if (tht_pkt_alloc(sc, &sc->sc_rx_list, 128, THT_RXF_SGL_LEN) != 0) + if (tht_pkt_alloc(sc, &sc->sc_rx_list, THT_RXF_PKT_NUM, + THT_RXF_SGL_LEN) != 0) goto free_tx_list; if (tht_fifo_alloc(sc, &sc->sc_txt, &tht_txt_desc) != 0) |