Deleted Added
full compact
e1000_osdep.h (176667) e1000_osdep.h (177867)
1/**************************************************************************
1/******************************************************************************
2
2
3Copyright (c) 2001-2008, Intel Corporation
4All rights reserved.
3 Copyright (c) 2001-2008, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15
16 3. Neither the name of the Intel Corporation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
5
31
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
32******************************************************************************/
33/*$FreeBSD: head/sys/dev/em/e1000_osdep.h 177867 2008-04-02 22:00:36Z jfv $*/
8
34
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11
35
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15
16 3. Neither the name of the Intel Corporation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
19
20THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30POSSIBILITY OF SUCH DAMAGE.
31
32***************************************************************************/
33/* $FreeBSD: head/sys/dev/em/e1000_osdep.h 176667 2008-02-29 21:50:11Z jfv $ */
34
35
36#ifndef _FREEBSD_OS_H_
37#define _FREEBSD_OS_H_
38
39#include <sys/types.h>
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/mbuf.h>
43#include <sys/protosw.h>

--- 22 unchanged lines hidden (view full) ---

66#define MSGOUT(S, A, B) printf(S "\n", A, B)
67#define DEBUGFUNC(F) DEBUGOUT(F);
68 #define DEBUGOUT(S)
69 #define DEBUGOUT1(S,A)
70 #define DEBUGOUT2(S,A,B)
71 #define DEBUGOUT3(S,A,B,C)
72 #define DEBUGOUT7(S,A,B,C,D,E,F,G)
73
36#ifndef _FREEBSD_OS_H_
37#define _FREEBSD_OS_H_
38
39#include <sys/types.h>
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/mbuf.h>
43#include <sys/protosw.h>

--- 22 unchanged lines hidden (view full) ---

66#define MSGOUT(S, A, B) printf(S "\n", A, B)
67#define DEBUGFUNC(F) DEBUGOUT(F);
68 #define DEBUGOUT(S)
69 #define DEBUGOUT1(S,A)
70 #define DEBUGOUT2(S,A,B)
71 #define DEBUGOUT3(S,A,B,C)
72 #define DEBUGOUT7(S,A,B,C,D,E,F,G)
73
74#define STATIC static
75#define FALSE 0
76#define TRUE 1
77#define CMD_MEM_WRT_INVALIDATE 0x0010 /* BIT_4 */
78#define PCI_COMMAND_REGISTER PCIR_COMMAND
74#define STATIC static
75#define FALSE 0
76#define false FALSE /* shared code stupidity */
77#define TRUE 1
78#define true TRUE
79#define CMD_MEM_WRT_INVALIDATE 0x0010 /* BIT_4 */
80#define PCI_COMMAND_REGISTER PCIR_COMMAND
79
80/*
81** These typedefs are necessary due to the new
82** shared code, they are native to Linux.
83*/
84typedef uint64_t u64;
85typedef uint32_t u32;
86typedef uint16_t u16;

--- 10 unchanged lines hidden (view full) ---

97 bus_space_handle_t mem_bus_space_handle;
98 bus_space_tag_t io_bus_space_tag;
99 bus_space_handle_t io_bus_space_handle;
100 bus_space_tag_t flash_bus_space_tag;
101 bus_space_handle_t flash_bus_space_handle;
102 struct device *dev;
103};
104
81
82/*
83** These typedefs are necessary due to the new
84** shared code, they are native to Linux.
85*/
86typedef uint64_t u64;
87typedef uint32_t u32;
88typedef uint16_t u16;

--- 10 unchanged lines hidden (view full) ---

99 bus_space_handle_t mem_bus_space_handle;
100 bus_space_tag_t io_bus_space_tag;
101 bus_space_handle_t io_bus_space_handle;
102 bus_space_tag_t flash_bus_space_tag;
103 bus_space_handle_t flash_bus_space_handle;
104 struct device *dev;
105};
106
105#ifdef NO_82542_SUPPORT
106#define E1000_REGISTER(hw, reg) reg
107#else
108#define E1000_REGISTER(hw, reg) (((hw)->mac.type >= e1000_82543) \
109 ? reg : e1000_translate_register_82542(reg))
107#define E1000_REGISTER(hw, reg) (((hw)->mac.type >= e1000_82543) \
108 ? reg : e1000_translate_register_82542(reg))
110#endif
111
112#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, E1000_STATUS)
113
114/* Read from an absolute offset in the adapter's memory space */
115#define E1000_READ_OFFSET(hw, offset) \
116 bus_space_read_4(((struct e1000_osdep *)(hw)->back)->mem_bus_space_tag, \
117 ((struct e1000_osdep *)(hw)->back)->mem_bus_space_handle, offset)
118

--- 71 unchanged lines hidden ---
109
110#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, E1000_STATUS)
111
112/* Read from an absolute offset in the adapter's memory space */
113#define E1000_READ_OFFSET(hw, offset) \
114 bus_space_read_4(((struct e1000_osdep *)(hw)->back)->mem_bus_space_tag, \
115 ((struct e1000_osdep *)(hw)->back)->mem_bus_space_handle, offset)
116

--- 71 unchanged lines hidden ---