ixgbe_bypass.h revision 320688
1139731Simp/******************************************************************************
2131899Smarcel
3131899Smarcel  Copyright (c) 2001-2017, Intel Corporation
4131899Smarcel  All rights reserved.
5131899Smarcel
6131899Smarcel  Redistribution and use in source and binary forms, with or without
7131899Smarcel  modification, are permitted provided that the following conditions are met:
8131899Smarcel
9131899Smarcel   1. Redistributions of source code must retain the above copyright notice,
10131899Smarcel      this list of conditions and the following disclaimer.
11131899Smarcel
12131899Smarcel   2. Redistributions in binary form must reproduce the above copyright
13131899Smarcel      notice, this list of conditions and the following disclaimer in the
14131899Smarcel      documentation and/or other materials provided with the distribution.
15131899Smarcel
16131899Smarcel   3. Neither the name of the Intel Corporation nor the names of its
17131899Smarcel      contributors may be used to endorse or promote products derived from
18131899Smarcel      this software without specific prior written permission.
19131899Smarcel
20131899Smarcel  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21131899Smarcel  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22131899Smarcel  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23131899Smarcel  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24131899Smarcel  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25131899Smarcel  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26131899Smarcel  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27131899Smarcel  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28131899Smarcel  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29131899Smarcel  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30131899Smarcel  POSSIBILITY OF SUCH DAMAGE.
31131899Smarcel
32131899Smarcel******************************************************************************/
33131899Smarcel/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_bypass.h 320688 2017-07-05 17:27:03Z erj $*/
34131899Smarcel
35131899Smarcel#ifndef _IXGBE_BYPASS_H_
36131899Smarcel#define _IXGBE_BYPASS_H_
37131899Smarcel
38131899Smarcel
39138212Speter/*
40131899Smarcel * The bypass driver needs to set FW to a epoc of the number of
41131899Smarcel * seconds we are into this year.  This macro's help support that.
42131899Smarcel */
43138212Speter#define SEC_PER_DAY     (60 * 60 * 24)
44138212Speter#define SEC_PER_YEAR    (SEC_PER_DAY * 365)
45131899Smarcel#define SEC_PER_LYEAR   (SEC_PER_DAY * 366)
46131899Smarcel#define LEAP_YR(y)      ((y % 400 == 0) || ((y % 4 == 0) && (y % 100 != 0)))
47131899Smarcel#define SEC_THIS_YEAR(y)        (LEAP_YR(y) ? SEC_PER_LYEAR : SEC_PER_YEAR)
48131899Smarcel
49131899Smarcelvoid ixgbe_bypass_init(struct adapter *);
50131899Smarcel
51284325Sjhb#endif /* _IXGBE_BYPASS_H_ */
52284325Sjhb