diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2017-01-08 18:08:15 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2017-01-08 18:08:15 +0000 |
commit | 41004fbb1d30a1805033f7f516ca23730b35b5ad (patch) | |
tree | f6f710b281080c61f34a2499e76a0dd92062ff9e /sys/dev | |
parent | 51530f229306bcc43d6b0bd028a3c3cccf17443b (diff) |
Use a macro for the Tx timeout value.
OK deraadt@ kettenis@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_msk.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_mskvar.h | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_sk.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_skvar.h | 6 |
4 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index b64f550a502..fe339644b71 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_msk.c,v 1.123 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_msk.c,v 1.124 2017/01/08 18:08:14 visa Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1578,7 +1578,7 @@ msk_start(struct ifnet *ifp) SK_IF_WRITE_2(sc_if, 1, SK_TXQA1_Y2_PREF_PUTIDX, idx); /* Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + ifp->if_timer = MSK_TX_TIMEOUT; } } @@ -1716,7 +1716,7 @@ msk_txeof(struct sk_if_softc *sc_if) sc_if->sk_cdata.sk_tx_cnt--; SK_INC(idx, MSK_TX_RING_CNT); } - ifp->if_timer = sc_if->sk_cdata.sk_tx_cnt > 0 ? 5 : 0; + ifp->if_timer = sc_if->sk_cdata.sk_tx_cnt > 0 ? MSK_TX_TIMEOUT : 0; if (sc_if->sk_cdata.sk_tx_cnt < MSK_TX_RING_CNT - 2) ifq_clr_oactive(&ifp->if_snd); diff --git a/sys/dev/pci/if_mskvar.h b/sys/dev/pci/if_mskvar.h index 5291dedb50a..fe31c18794e 100644 --- a/sys/dev/pci/if_mskvar.h +++ b/sys/dev/pci/if_mskvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mskvar.h,v 1.11 2014/07/08 05:35:18 dlg Exp $ */ +/* $OpenBSD: if_mskvar.h,v 1.12 2017/01/08 18:08:14 visa Exp $ */ /* $NetBSD: if_skvar.h,v 1.6 2005/05/30 04:35:22 christos Exp $ */ /*- @@ -26,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -/* $OpenBSD: if_mskvar.h,v 1.11 2014/07/08 05:35:18 dlg Exp $ */ +/* $OpenBSD: if_mskvar.h,v 1.12 2017/01/08 18:08:14 visa Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -228,4 +228,6 @@ struct skc_attach_args { u_int8_t skc_rev; }; +#define MSK_TX_TIMEOUT 5 + #endif /* _DEV_PCI_IF_MSKVAR_H_ */ diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index 31e606ab850..f499c8c5b0c 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.184 2016/04/13 10:34:32 mpi Exp $ */ +/* $OpenBSD: if_sk.c,v 1.185 2017/01/08 18:08:14 visa Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1532,7 +1532,7 @@ sk_start(struct ifnet *ifp) CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); /* Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + ifp->if_timer = SK_TX_TIMEOUT; } } @@ -1691,7 +1691,7 @@ sk_txeof(struct sk_if_softc *sc_if) sc_if->sk_cdata.sk_tx_cnt--; SK_INC(idx, SK_TX_RING_CNT); } - ifp->if_timer = sc_if->sk_cdata.sk_tx_cnt > 0 ? 5 : 0; + ifp->if_timer = sc_if->sk_cdata.sk_tx_cnt > 0 ? SK_TX_TIMEOUT : 0; if (sc_if->sk_cdata.sk_tx_cnt < SK_TX_RING_CNT - 2) ifq_clr_oactive(&ifp->if_snd); diff --git a/sys/dev/pci/if_skvar.h b/sys/dev/pci/if_skvar.h index 987a35c5804..1c6b787835d 100644 --- a/sys/dev/pci/if_skvar.h +++ b/sys/dev/pci/if_skvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_skvar.h,v 1.9 2014/08/20 00:50:45 dlg Exp $ */ +/* $OpenBSD: if_skvar.h,v 1.10 2017/01/08 18:08:14 visa Exp $ */ /* $NetBSD: if_skvar.h,v 1.6 2005/05/30 04:35:22 christos Exp $ */ /*- @@ -26,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -/* $OpenBSD: if_skvar.h,v 1.9 2014/08/20 00:50:45 dlg Exp $ */ +/* $OpenBSD: if_skvar.h,v 1.10 2017/01/08 18:08:14 visa Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -222,4 +222,6 @@ struct skc_attach_args { u_int8_t skc_rev; }; +#define SK_TX_TIMEOUT 5 + #endif /* _DEV_PCI_IF_SKVAR_H_ */ |