1320688Serj/******************************************************************************
2320688Serj
3320688Serj  Copyright (c) 2001-2017, Intel Corporation
4320688Serj  All rights reserved.
5320688Serj
6320688Serj  Redistribution and use in source and binary forms, with or without
7320688Serj  modification, are permitted provided that the following conditions are met:
8320688Serj
9320688Serj   1. Redistributions of source code must retain the above copyright notice,
10320688Serj      this list of conditions and the following disclaimer.
11320688Serj
12320688Serj   2. Redistributions in binary form must reproduce the above copyright
13320688Serj      notice, this list of conditions and the following disclaimer in the
14320688Serj      documentation and/or other materials provided with the distribution.
15320688Serj
16320688Serj   3. Neither the name of the Intel Corporation nor the names of its
17320688Serj      contributors may be used to endorse or promote products derived from
18320688Serj      this software without specific prior written permission.
19320688Serj
20320688Serj  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21320688Serj  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22320688Serj  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23320688Serj  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24320688Serj  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25320688Serj  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26320688Serj  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27320688Serj  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28320688Serj  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29320688Serj  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30320688Serj  POSSIBILITY OF SUCH DAMAGE.
31320688Serj
32320688Serj******************************************************************************/
33320688Serj/*$FreeBSD: stable/11/sys/dev/ixgbe/ixgbe_bypass.h 320897 2017-07-11 21:25:07Z erj $*/
34320688Serj
35320688Serj#ifndef _IXGBE_BYPASS_H_
36320688Serj#define _IXGBE_BYPASS_H_
37320688Serj
38320688Serj
39320688Serj/*
40320688Serj * The bypass driver needs to set FW to a epoc of the number of
41320688Serj * seconds we are into this year.  This macro's help support that.
42320688Serj */
43320688Serj#define SEC_PER_DAY     (60 * 60 * 24)
44320688Serj#define SEC_PER_YEAR    (SEC_PER_DAY * 365)
45320688Serj#define SEC_PER_LYEAR   (SEC_PER_DAY * 366)
46320688Serj#define LEAP_YR(y)      ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))
47320688Serj#define SEC_THIS_YEAR(y)        (LEAP_YR(y) ? SEC_PER_LYEAR : SEC_PER_YEAR)
48320688Serj
49320688Serjvoid ixgbe_bypass_init(struct adapter *);
50320688Serj
51320688Serj#endif /* _IXGBE_BYPASS_H_ */
52