Subversion Repositories HelenOS

Rev

Rev 4723 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4163 mejdrech 1
/*
2
 * Copyright (c) 1987,1997, 2006, Vrije Universiteit, Amsterdam, The Netherlands All rights reserved. Redistribution and use of the MINIX 3 operating system in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
3
 *
4
 * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
5
 * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
6
 * * Neither the name of the Vrije Universiteit nor the names of the software authors or contributors may be used to endorse or promote products derived from this software without specific prior written permission.
7
 * * Any deviations from these conditions require written permission from the copyright holder in advance
8
 *
9
 *
10
 * Disclaimer
11
 *
12
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
13
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
14
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
15
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ANY AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
16
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
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
21
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
 *
23
 * Changes:
4756 mejdrech 24
 *  2009 ported to HelenOS, Lukas Mejdrech
4163 mejdrech 25
 */
26
 
27
/*
28
ne2000.h
29
 
30
Created:    March 15, 1994 by Philip Homburg <philip@f-mnx.phicoh.com>
31
*/
32
 
33
/** @addtogroup ne2k
34
 *  @{
35
 */
36
 
4723 mejdrech 37
/** @file
4756 mejdrech 38
 *  NE1000 and NE2000 network interface definitions.
4723 mejdrech 39
 */
40
 
4163 mejdrech 41
#ifndef __NET_NETIF_NE2000_H__
42
#define __NET_NETIF_NE2000_H__
43
 
44
#include <libarch/ddi.h>
45
 
46
#include "dp8390_port.h"
47
 
4756 mejdrech 48
/** DP8390 register offset.
49
 */
4163 mejdrech 50
#define NE_DP8390   0x00
4756 mejdrech 51
 
52
/** Data register.
53
 */
4163 mejdrech 54
#define NE_DATA     0x10
4756 mejdrech 55
 
56
/** Reset register.
57
 */
4163 mejdrech 58
#define NE_RESET    0x1F
59
 
4756 mejdrech 60
/** NE1000 data start.
61
 */
4163 mejdrech 62
#define NE1000_START    0x2000
4756 mejdrech 63
 
64
/** NE1000 data size.
65
 */
4163 mejdrech 66
#define NE1000_SIZE 0x2000
4756 mejdrech 67
 
68
/** NE2000 data start.
69
 */
4163 mejdrech 70
#define NE2000_START    0x4000
4756 mejdrech 71
 
72
/** NE2000 data size.
73
 */
4163 mejdrech 74
#define NE2000_SIZE 0x4000
75
 
4756 mejdrech 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
 */
4163 mejdrech 81
#define inb_ne(dep, reg)    (inb(dep->de_base_port+reg))
4756 mejdrech 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
 */
4163 mejdrech 88
#define outb_ne(dep, reg, data) (outb(dep->de_base_port+reg, data))
4756 mejdrech 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
 */
4163 mejdrech 95
#define inw_ne(dep, reg)    (inw(dep->de_base_port+reg))
4756 mejdrech 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
 */
4163 mejdrech 102
#define outw_ne(dep, reg, data) (outw(dep->de_base_port+reg, data))
103
 
104
#endif /* __NET_NETIF_NE2000_H__ */
105
 
106
/*
107
 * $PchId: ne2000.h,v 1.4 2004/08/03 12:03:20 philip Exp $
108
 */
109
 
110
/** @}
111
 */