Changeset 93fb170c in mainline for uspace/srv/hw/netif/dp8390/ne2000.h


Ignore:
Timestamp:
2011-01-08T18:51:31Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
15be932
Parents:
8f748215 (diff), a523af4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from main branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/netif/dp8390/ne2000.h

    r8f748215 r93fb170c  
    11/*
    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:
     2 * Copyright (c) 2009 Lukas Mejdrech
     3 * Copyright (c) 2011 Martin Decky
     4 * All rights reserved.
    35 *
    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
     6 * Redistribution and use in source and binary forms, with or without
     7 * modification, are permitted provided that the following conditions
     8 * are met:
    89 *
     10 * - Redistributions of source code must retain the above copyright
     11 *   notice, this list of conditions and the following disclaimer.
     12 * - 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 * - The name of the author may not be used to endorse or promote products
     16 *   derived from this software without specific prior written permission.
    917 *
    10  * Disclaimer
    11  *
    12  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
     18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    1319 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    1420 * 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,
     21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    1622 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    1723 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     
    2026 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    2127 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    22  *
    23  * Changes:
    24  *  2009 ported to HelenOS, Lukas Mejdrech
    2528 */
    2629
    2730/*
    28 ne2000.h
    29 
    30 Created:        March 15, 1994 by Philip Homburg <philip@f-mnx.phicoh.com>
    31 */
     31 * This code is based upon the NE2000 driver for MINIX,
     32 * distributed according to a BSD-style license.
     33 *
     34 * Copyright (c) 1987, 1997, 2006 Vrije Universiteit
     35 * Copyright (c) 1992, 1994 Philip Homburg
     36 * Copyright (c) 1996 G. Falzoni
     37 *
     38 */
    3239
    3340/** @addtogroup ne2k
     
    4350
    4451#include <libarch/ddi.h>
    45 
    4652#include "dp8390_port.h"
    4753
    4854/** DP8390 register offset.
    4955 */
    50 #define NE_DP8390       0x00
     56#define NE_DP8390  0x00
    5157
    5258/** Data register.
    5359 */
    54 #define NE_DATA         0x10
     60#define NE_DATA  0x10
    5561
    5662/** Reset register.
    5763 */
    58 #define NE_RESET        0x1F
     64#define NE_RESET  0x1f
    5965
    6066/** NE1000 data start.
    6167 */
    62 #define NE1000_START    0x2000
     68#define NE1000_START  0x2000
    6369
    6470/** NE1000 data size.
    6571 */
    66 #define NE1000_SIZE     0x2000
     72#define NE1000_SIZE  0x2000
    6773
    6874/** NE2000 data start.
    6975 */
    70 #define NE2000_START    0x4000
     76#define NE2000_START  0x4000
    7177
    7278/** NE2000 data size.
    7379 */
    74 #define NE2000_SIZE     0x4000
     80#define NE2000_SIZE  0x4000
    7581
    7682/** Reads 1 byte register.
     
    7985 *  @returns The read value.
    8086 */
    81 #define inb_ne(dep, reg)        (inb(dep->de_base_port+reg))
     87#define inb_ne(dep, reg)  (inb(dep->de_base_port + reg))
    8288
    8389/** Writes 1 byte register.
     
    8692 *  @param[in] data The value to be written.
    8793 */
    88 #define outb_ne(dep, reg, data) (outb(dep->de_base_port+reg, data))
     94#define outb_ne(dep, reg, data)  (outb(dep->de_base_port + reg, data))
    8995
    9096/** Reads 1 word (2 bytes) register.
     
    9399 *  @returns The read value.
    94100 */
    95 #define inw_ne(dep, reg)        (inw(dep->de_base_port+reg))
     101#define inw_ne(dep, reg)  (inw(dep->de_base_port + reg))
    96102
    97103/** Writes 1 word (2 bytes) register.
     
    100106 *  @param[in] data The value to be written.
    101107 */
    102 #define outw_ne(dep, reg, data) (outw(dep->de_base_port+reg, data))
     108#define outw_ne(dep, reg, data)  (outw(dep->de_base_port + reg, data))
    103109
    104 #endif /* __NET_NETIF_NE2000_H__ */
     110struct dpeth;
    105111
    106 /*
    107  * $PchId: ne2000.h,v 1.4 2004/08/03 12:03:20 philip Exp $
    108  */
     112extern int ne_probe(struct dpeth *);
     113extern void ne_init(struct dpeth *);
     114extern void ne_stop(struct dpeth *);
     115
     116#endif
    109117
    110118/** @}
Note: See TracChangeset for help on using the changeset viewer.