Subversion Repositories HelenOS

Rev

Rev 4723 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4723 Rev 4756
Line 19... Line 19...
19
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
 *
22
 *
23
 * Changes:
23
 * Changes:
24
 *  2009 Lukas Mejdrech ported to HelenOS
24
 *  2009 ported to HelenOS, Lukas Mejdrech
25
 */
25
 */
26
 
26
 
27
/*
27
/*
28
ne2000.h
28
ne2000.h
29
 
29
 
Line 33... Line 33...
33
/** @addtogroup ne2k
33
/** @addtogroup ne2k
34
 *  @{
34
 *  @{
35
 */
35
 */
36
 
36
 
37
/** @file
37
/** @file
38
 *  \todo
38
 *  NE1000 and NE2000 network interface definitions.
39
 */
39
 */
40
 
40
 
41
#ifndef __NET_NETIF_NE2000_H__
41
#ifndef __NET_NETIF_NE2000_H__
42
#define __NET_NETIF_NE2000_H__
42
#define __NET_NETIF_NE2000_H__
43
 
43
 
44
#include <libarch/ddi.h>
44
#include <libarch/ddi.h>
45
 
45
 
46
#include "dp8390_port.h"
46
#include "dp8390_port.h"
47
 
47
 
-
 
48
/** DP8390 register offset.
-
 
49
 */
48
#define NE_DP8390   0x00
50
#define NE_DP8390   0x00
-
 
51
 
-
 
52
/** Data register.
-
 
53
 */
49
#define NE_DATA     0x10
54
#define NE_DATA     0x10
-
 
55
 
-
 
56
/** Reset register.
-
 
57
 */
50
#define NE_RESET    0x1F
58
#define NE_RESET    0x1F
51
 
59
 
-
 
60
/** NE1000 data start.
-
 
61
 */
52
#define NE1000_START    0x2000
62
#define NE1000_START    0x2000
-
 
63
 
-
 
64
/** NE1000 data size.
-
 
65
 */
53
#define NE1000_SIZE 0x2000
66
#define NE1000_SIZE 0x2000
-
 
67
 
-
 
68
/** NE2000 data start.
-
 
69
 */
54
#define NE2000_START    0x4000
70
#define NE2000_START    0x4000
-
 
71
 
-
 
72
/** NE2000 data size.
-
 
73
 */
55
#define NE2000_SIZE 0x4000
74
#define NE2000_SIZE 0x4000
56
 
75
 
-
 
76
/** Reads 1 byte register.
-
 
77
 *  @param[in] dep The network interface structure.
-
 
78
 *  @param[in] reg The register offset.
-
 
79
 *  @returns The read value.
-
 
80
 */
57
#define inb_ne(dep, reg)    (inb(dep->de_base_port+reg))
81
#define inb_ne(dep, reg)    (inb(dep->de_base_port+reg))
-
 
82
 
-
 
83
/** Writes 1 byte register.
-
 
84
 *  @param[in] dep The network interface structure.
-
 
85
 *  @param[in] reg The register offset.
-
 
86
 *  @param[in] data The value to be written.
-
 
87
 */
58
#define outb_ne(dep, reg, data) (outb(dep->de_base_port+reg, data))
88
#define outb_ne(dep, reg, data) (outb(dep->de_base_port+reg, data))
-
 
89
 
-
 
90
/** Reads 1 word (2 bytes) register.
-
 
91
 *  @param[in] dep The network interface structure.
-
 
92
 *  @param[in] reg The register offset.
-
 
93
 *  @returns The read value.
-
 
94
 */
59
#define inw_ne(dep, reg)    (inw(dep->de_base_port+reg))
95
#define inw_ne(dep, reg)    (inw(dep->de_base_port+reg))
-
 
96
 
-
 
97
/** Writes 1 word (2 bytes) register.
-
 
98
 *  @param[in] dep The network interface structure.
-
 
99
 *  @param[in] reg The register offset.
-
 
100
 *  @param[in] data The value to be written.
-
 
101
 */
60
#define outw_ne(dep, reg, data) (outw(dep->de_base_port+reg, data))
102
#define outw_ne(dep, reg, data) (outw(dep->de_base_port+reg, data))
61
 
103
 
62
#endif /* __NET_NETIF_NE2000_H__ */
104
#endif /* __NET_NETIF_NE2000_H__ */
63
 
105
 
64
/*
106
/*