Changeset 8f5e2527 in mainline


Ignore:
Timestamp:
2011-01-06T13:58:09Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
95ff5c4
Parents:
4765152
Message:

remove unnecessary clutter

Location:
uspace/srv/hw/netif/dp8390
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/netif/dp8390/dp8390.c

    r4765152 r8f5e2527  
    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:
    24  *  2009 ported to HelenOS, Lukas Mejdrech
    25  */
    26 
    271/** @addtogroup dp8390
    282 *  @{
     
    4317#include "dp8390_drv.h"
    4418#include "dp8390_port.h"
    45 
    46 /*
    47  * dp8390.c
    48  *
    49  * Created:     before Dec 28, 1992 by Philip Homburg <philip@f-mnx.phicoh.com>
    50  *
    51  * Modified Mar 10 1994 by Philip Homburg
    52  *      Become a generic dp8390 driver.
    53  *
    54  * Modified Dec 20 1996 by G. Falzoni <falzoni@marina.scn.de>
    55  *      Added support for 3c503 boards.
    56  */
    5719
    5820#include "local.h"
     
    8143static void outsw(port_t port, void * buf, size_t size);
    8244
    83 //static u16_t eth_ign_proto;
    84 //static char *progname;
    85 
    86 /* Configuration */
    87 /*typedef struct dp_conf
    88 {
    89         port_t dpc_port;
    90         int dpc_irq;
    91         phys_bytes dpc_mem;
    92         char *dpc_envvar;
    93 } dp_conf_t;
    94 */
    95 //dp_conf_t dp_conf[]=  /* Card addresses */
    96 //{
    97         /* I/O port, IRQ,  Buffer address,  Env. var. */
    98 /*      { 0x280,     3,    0xD0000,        "DPETH0"     },
    99         { 0x300,     5,    0xC8000,        "DPETH1"     },
    100         { 0x380,    10,    0xD8000,        "DPETH2"     },
    101 };
    102 */
    103 /* Test if dp_conf has exactly DE_PORT_NR entries.  If not then you will see
    104  * the error: "array size is negative".
    105  */
    106 //extern int ___dummy[DE_PORT_NR == sizeof(dp_conf)/sizeof(dp_conf[0]) ? 1 : -1];
    107 
    108 /* Card inits configured out? */
    109 #if !ENABLE_WDETH
    110 #define wdeth_probe(dep)        (0)
    111 #endif
    112 #if !ENABLE_NE2000
    113 #define ne_probe(dep)           (0)
    114 #endif
    115 #if !ENABLE_3C503
    116 #define el2_probe(dep)          (0)
    117 #endif
    118 
    11945/* Some clones of the dp8390 and the PC emulator 'Bochs' require the CR_STA
    12046 * on writes to the CR register. Additional CR_STAs do not appear to hurt
     
    12349#define CR_EXTRA        CR_STA
    12450
    125 //#if ENABLE_PCI
    126 //_PROTOTYPE(static void pci_conf, (void)                               );
    127 //#endif
    128 //_PROTOTYPE(static void do_vwrite, (message *mp, int from_int,
    129 //                                                      int vectored)   );
    130 //_PROTOTYPE(static void do_vwrite_s, (message *mp, int from_int)       );
    131 //_PROTOTYPE(static void do_vread, (message *mp, int vectored)          );
    132 //_PROTOTYPE(static void do_vread_s, (message *mp)                      );
    133 //_PROTOTYPE(static void do_init, (message *mp)                         );
    134 //_PROTOTYPE(static void do_int, (dpeth_t *dep)                         );
    135 //_PROTOTYPE(static void do_getstat, (message *mp)                      );
    136 //_PROTOTYPE(static void do_getstat_s, (message *mp)                    );
    137 //_PROTOTYPE(static void do_getname, (message *mp)                      );
    138 //_PROTOTYPE(static void do_stop, (message *mp)                         );
    13951_PROTOTYPE(static void dp_init, (dpeth_t *dep)                          );
    140 //_PROTOTYPE(static void dp_confaddr, (dpeth_t *dep)                    );
    14152_PROTOTYPE(static void dp_reinit, (dpeth_t *dep)                        );
    14253_PROTOTYPE(static void dp_reset, (dpeth_t *dep)                 );
    143 //_PROTOTYPE(static void dp_check_ints, (dpeth_t *dep)                  );
    14454_PROTOTYPE(static void dp_recv, (dpeth_t *dep)                          );
    14555_PROTOTYPE(static void dp_send, (dpeth_t *dep)                          );
    146 //_PROTOTYPE(static void dp8390_stop, (void)                            );
    147 _PROTOTYPE(static void dp_getblock, (dpeth_t *dep, int page,
    148                                 size_t offset, size_t size, void *dst)  );
    14956_PROTOTYPE(static void dp_pio8_getblock, (dpeth_t *dep, int page,
    15057                                size_t offset, size_t size, void *dst)  );
     
    15360_PROTOTYPE(static int dp_pkt2user, (dpeth_t *dep, int page,
    15461                                                        int length) );
    155 //_PROTOTYPE(static int dp_pkt2user_s, (dpeth_t *dep, int page,
    156 //                                                      int length)     );
    157 _PROTOTYPE(static void dp_user2nic, (dpeth_t *dep, iovec_dat_t *iovp,
    158                 vir_bytes offset, int nic_addr, vir_bytes count) );
    159 //_PROTOTYPE(static void dp_user2nic_s, (dpeth_t *dep, iovec_dat_s_t *iovp,
    160 //              vir_bytes offset, int nic_addr, vir_bytes count)        );
    16162_PROTOTYPE(static void dp_pio8_user2nic, (dpeth_t *dep,
    16263                                iovec_dat_t *iovp, vir_bytes offset,
    16364                                int nic_addr, vir_bytes count) );
    164 //_PROTOTYPE(static void dp_pio8_user2nic_s, (dpeth_t *dep,
    165 //                              iovec_dat_s_t *iovp, vir_bytes offset,
    166 //                              int nic_addr, vir_bytes count)          );
    16765_PROTOTYPE(static void dp_pio16_user2nic, (dpeth_t *dep,
    16866                                iovec_dat_t *iovp, vir_bytes offset,
    16967                                int nic_addr, vir_bytes count) );
    170 //_PROTOTYPE(static void dp_pio16_user2nic_s, (dpeth_t *dep,
    171 //                              iovec_dat_s_t *iovp, vir_bytes offset,
    172 //                              int nic_addr, vir_bytes count)          );
    173 _PROTOTYPE(static void dp_nic2user, (dpeth_t *dep, int nic_addr,
    174                 iovec_dat_t *iovp, vir_bytes offset, vir_bytes count)   );
    175 //_PROTOTYPE(static void dp_nic2user_s, (dpeth_t *dep, int nic_addr,
    176 //              iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count) );
    17768_PROTOTYPE(static void dp_pio8_nic2user, (dpeth_t *dep, int nic_addr,
    17869                iovec_dat_t *iovp, vir_bytes offset, vir_bytes count)   );
    179 //_PROTOTYPE(static void dp_pio8_nic2user_s, (dpeth_t *dep, int nic_addr,
    180 //              iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count) );
    18170_PROTOTYPE(static void dp_pio16_nic2user, (dpeth_t *dep, int nic_addr,
    18271                iovec_dat_t *iovp, vir_bytes offset, vir_bytes count)   );
    183 //_PROTOTYPE(static void dp_pio16_nic2user_s, (dpeth_t *dep, int nic_addr,
    184 //              iovec_dat_s_t *iovp, vir_bytes offset, vir_bytes count) );
    18572_PROTOTYPE(static void dp_next_iovec, (iovec_dat_t *iovp)               );
    186 //_PROTOTYPE(static void dp_next_iovec_s, (iovec_dat_s_t *iovp)         );
    18773_PROTOTYPE(static void conf_hw, (dpeth_t *dep)                          );
    188 //_PROTOTYPE(static void update_conf, (dpeth_t *dep, dp_conf_t *dcp)    );
    189 _PROTOTYPE(static void map_hw_buffer, (dpeth_t *dep)                    );
    190 //_PROTOTYPE(static int calc_iovec_size, (iovec_dat_t *iovp)            );
    191 //_PROTOTYPE(static int calc_iovec_size_s, (iovec_dat_s_t *iovp)                );
    19274_PROTOTYPE(static void reply, (dpeth_t *dep, int err, int may_block)    );
    193 //_PROTOTYPE(static void mess_reply, (message *req, message *reply)     );
    19475_PROTOTYPE(static void get_userdata, (int user_proc,
    19576                vir_bytes user_addr, vir_bytes count, void *loc_addr)   );
    196 //_PROTOTYPE(static void get_userdata_s, (int user_proc,
    197 //              cp_grant_id_t grant, vir_bytes offset, vir_bytes count,
    198 //              void *loc_addr) );
    199 //_PROTOTYPE(static void put_userdata, (int user_proc,
    200 //              vir_bytes user_addr, vir_bytes count, void *loc_addr)   );
    201 //_PROTOTYPE(static void put_userdata_s, (int user_proc,
    202 //              cp_grant_id_t grant, size_t count, void *loc_addr)      );
    20377_PROTOTYPE(static void insb, (port_t port, void *buf, size_t size)                              );
    20478_PROTOTYPE(static void insw, (port_t port, void *buf, size_t size)                              );
    205 //_PROTOTYPE(static void do_vir_insb, (port_t port, int proc,
    206 //                                      vir_bytes buf, size_t size)     );
    207 //_PROTOTYPE(static void do_vir_insw, (port_t port, int proc,
    208 //                                      vir_bytes buf, size_t size)     );
    209 //_PROTOTYPE(static void do_vir_outsb, (port_t port, int proc,
    210 //                                      vir_bytes buf, size_t size)     );
    211 //_PROTOTYPE(static void do_vir_outsw, (port_t port, int proc,
    212 //                                      vir_bytes buf, size_t size)     );
    21379
    21480int do_probe(dpeth_t * dep){
     
    494360                                                        i < 5 ? ':' : '\n');
    495361        }
    496 
    497         /* Map buffer */
    498         map_hw_buffer(dep);
    499362
    500363        /* Initialization of the dp8390 following the mandatory procedure
     
    567430        dep->de_sendq_head= 0;
    568431        dep->de_sendq_tail= 0;
    569         if (!dep->de_prog_IO)
    570         {
    571                 dep->de_user2nicf= dp_user2nic;
    572 //              dep->de_user2nicf_s= dp_user2nic_s;
    573                 dep->de_nic2userf= dp_nic2user;
    574 //              dep->de_nic2userf_s= dp_nic2user_s;
    575                 dep->de_getblockf= dp_getblock;
    576         }
    577         else if (dep->de_16bit)
     432        if (dep->de_16bit)
    578433        {
    579434                dep->de_user2nicf= dp_pio16_user2nic;
     
    938793
    939794/*===========================================================================*
    940  *                              dp_getblock                                  *
    941  *===========================================================================*/
    942 static void dp_getblock(dep, page, offset, size, dst)
    943 dpeth_t *dep;
    944 int page;
    945 size_t offset;
    946 size_t size;
    947 void *dst;
    948 {
    949 //      int r;
    950 
    951         offset = page * DP_PAGESIZE + offset;
    952 
    953         memcpy(dst, dep->de_locmem + offset, size);
    954 }
    955 
    956 /*===========================================================================*
    957795 *                              dp_pio8_getblock                             *
    958796 *===========================================================================*/
     
    1051889        }
    1052890        return OK;
    1053 }
    1054 
    1055 /*===========================================================================*
    1056  *                              dp_user2nic                                  *
    1057  *===========================================================================*/
    1058 static void dp_user2nic(dep, iovp, offset, nic_addr, count)
    1059 dpeth_t *dep;
    1060 iovec_dat_t *iovp;
    1061 vir_bytes offset;
    1062 int nic_addr;
    1063 vir_bytes count;
    1064 {
    1065         vir_bytes vir_hw;//, vir_user;
    1066         //int bytes, i, r;
    1067         int i, r;
    1068         vir_bytes bytes;
    1069 
    1070         vir_hw = (vir_bytes)dep->de_locmem + nic_addr;
    1071 
    1072         i= 0;
    1073         while (count > 0)
    1074         {
    1075                 if (i >= IOVEC_NR)
    1076                 {
    1077                         dp_next_iovec(iovp);
    1078                         i= 0;
    1079                         continue;
    1080                 }
    1081                 assert(i < iovp->iod_iovec_s);
    1082                 if (offset >= iovp->iod_iovec[i].iov_size)
    1083                 {
    1084                         offset -= iovp->iod_iovec[i].iov_size;
    1085                         i++;
    1086                         continue;
    1087                 }
    1088                 bytes = iovp->iod_iovec[i].iov_size - offset;
    1089                 if (bytes > count)
    1090                         bytes = count;
    1091 
    1092                 r= sys_vircopy(iovp->iod_proc_nr, D,
    1093                         iovp->iod_iovec[i].iov_addr + offset,
    1094                         SELF, D, vir_hw, bytes);
    1095                 if (r != OK)
    1096                         panic("DP8390", "dp_user2nic: sys_vircopy failed", r);
    1097 
    1098                 count -= bytes;
    1099                 vir_hw += bytes;
    1100                 offset += bytes;
    1101         }
    1102         assert(count == 0);
    1103891}
    1104892
     
    12811069
    12821070/*===========================================================================*
    1283  *                              dp_nic2user                                  *
    1284  *===========================================================================*/
    1285 static void dp_nic2user(dep, nic_addr, iovp, offset, count)
    1286 dpeth_t *dep;
    1287 int nic_addr;
    1288 iovec_dat_t *iovp;
    1289 vir_bytes offset;
    1290 vir_bytes count;
    1291 {
    1292         vir_bytes vir_hw;//, vir_user;
    1293         vir_bytes bytes;
    1294         int i, r;
    1295 
    1296         vir_hw = (vir_bytes)dep->de_locmem + nic_addr;
    1297 
    1298         i= 0;
    1299         while (count > 0)
    1300         {
    1301                 if (i >= IOVEC_NR)
    1302                 {
    1303                         dp_next_iovec(iovp);
    1304                         i= 0;
    1305                         continue;
    1306                 }
    1307                 assert(i < iovp->iod_iovec_s);
    1308                 if (offset >= iovp->iod_iovec[i].iov_size)
    1309                 {
    1310                         offset -= iovp->iod_iovec[i].iov_size;
    1311                         i++;
    1312                         continue;
    1313                 }
    1314                 bytes = iovp->iod_iovec[i].iov_size - offset;
    1315                 if (bytes > count)
    1316                         bytes = count;
    1317 
    1318                 r= sys_vircopy(SELF, D, vir_hw,
    1319                         iovp->iod_proc_nr, D,
    1320                         iovp->iod_iovec[i].iov_addr + offset, bytes);
    1321                 if (r != OK)
    1322                         panic("DP8390", "dp_nic2user: sys_vircopy failed", r);
    1323 
    1324                 count -= bytes;
    1325                 vir_hw += bytes;
    1326                 offset += bytes;
    1327         }
    1328         assert(count == 0);
    1329 }
    1330 
    1331 /*===========================================================================*
    13321071 *                              dp_pio8_nic2user                             *
    13331072 *===========================================================================*/
     
    15141253//      if (dep->de_mode != DEM_ENABLED)
    15151254//              return;
    1516         if (!wdeth_probe(dep) && !ne_probe(dep) && !el2_probe(dep))
    1517         {
     1255        if (!ne_probe(dep)) {
    15181256                printf("%s: No ethernet card found at %#lx\n",
    15191257                    dep->de_name, dep->de_base_port);
     
    15281266        dep->de_flags = DEF_EMPTY;
    15291267//      dep->de_stat = empty_stat;
    1530 }
    1531 
    1532 /*===========================================================================*
    1533  *                              map_hw_buffer                                *
    1534  *===========================================================================*/
    1535 static void map_hw_buffer(dep)
    1536 dpeth_t *dep;
    1537 {
    1538 //      int r;
    1539 //      size_t o, size;
    1540 //      char *buf, *abuf;
    1541 
    1542         if (dep->de_prog_IO)
    1543         {
    1544 #if 0
    1545                 if(debug){
    1546                         printf(
    1547                         "map_hw_buffer: programmed I/O, no need to map buffer\n");
    1548                 }
    1549 #endif
    1550                 dep->de_locmem = (char *)-dep->de_ramsize; /* trap errors */
    1551                 return;
    1552         }else{
    1553                 printf("map_hw_buffer: no buffer!\n");
    1554         }
    1555 
    1556 //      size = dep->de_ramsize + PAGE_SIZE;     /* Add PAGE_SIZE for
    1557 //                                               * alignment
    1558 //                                               */
    1559 //      buf= malloc(size);
    1560 //      if (buf == NULL)
    1561 //              panic(__FILE__, "map_hw_buffer: cannot malloc size", size);
    1562 //      o= PAGE_SIZE - ((vir_bytes)buf % PAGE_SIZE);
    1563 //      abuf= buf + o;
    1564 //      printf("buf at 0x%x, abuf at 0x%x\n", buf, abuf);
    1565 
    1566 //      r= sys_vm_map(SELF, 1 /* map */, (vir_bytes)abuf,
    1567 //                      dep->de_ramsize, (phys_bytes)dep->de_linmem);
    1568 //      if (r != OK)
    1569 //              panic(__FILE__, "map_hw_buffer: sys_vm_map failed", r);
    1570 //      dep->de_locmem = abuf;
    15711268}
    15721269
     
    16651362}
    16661363
    1667 /*
    1668  * $PchId: dp8390.c,v 1.25 2005/02/10 17:32:07 philip Exp $
    1669  */
    1670 
    16711364/** @}
    16721365 */
  • uspace/srv/hw/netif/dp8390/dp8390.h

    r4765152 r8f5e2527  
    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:
    24  *  2009 ported to HelenOS, Lukas Mejdrech
    25  */
    26 
    271/** @addtogroup dp8390
    282 *  @{
     
    4418 */
    4519#define DP8390_IO_SIZE  0x020
    46 
    47 /*
    48 dp8390.h
    49 
    50 Created:        before Dec 28, 1992 by Philip Homburg
    51 */
    5220
    5321/* National Semiconductor DP8390 Network Interface Controller. */
     
    330298         * hardwired in the board, the probe should modify these fields.
    331299         * Futhermore, the probe routine should also fill in de_initf and
    332          * de_stopf fields with the appropriate function pointers and set
    333          * de_prog_IO iff programmed I/O is to be used.
     300         * de_stopf fields with the appropriate function pointers.
    334301         */
    335302        port_t de_base_port;
    336303        phys_bytes de_linmem;
    337         char *de_locmem;
    338304        int de_irq;
    339305        int de_int_pending;
     
    341307        dp_initf_t de_initf;
    342308        dp_stopf_t de_stopf;
    343         int de_prog_IO;
    344309        char de_name[sizeof("dp8390#n")];
    345310
     
    360325        /* should be here - read even for ne2k isa init... */
    361326        char de_pci;                    /* TRUE iff PCI device */
    362 
    363 #if ENABLE_PCI
    364         /* PCI config */
    365 //      char de_pci;                    /* TRUE iff PCI device */
    366 //      u8_t de_pcibus;
    367 //      u8_t de_pcidev;
    368 //      u8_t de_pcifunc;       
    369 #endif
    370327
    371328        /* Do it yourself send queue */
     
    418375#define DEM_ENABLED     0x2
    419376
    420 //#if !__minix_vmd
    421 #define debug           1       /* Standard Minix lacks debug variable */
    422 //#endif
    423 
    424 /*
    425  * $PchId: dp8390.h,v 1.10 2005/02/10 17:26:06 philip Exp $
    426  */
     377#define debug           1
    427378
    428379#endif
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    r4765152 r8f5e2527  
    131131                fibril_rwlock_write_unlock(&netif_globals.lock);
    132132        }
    133         ipc_answer_0(iid, EOK);
    134133}
    135134
  • uspace/srv/hw/netif/dp8390/local.h

    r4765152 r8f5e2527  
    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:
    24  *  2009 ported to HelenOS, Lukas Mejdrech
    25  */
    26 
    271/** @addtogroup dp8390
    282 *  @{
     
    3812#include "dp8390_port.h"
    3913
    40 /*
    41 local.h
    42 */
    43 
    44 /** WDETH switch.
    45  */
    46 #define ENABLE_WDETH 0
    47 
    48 /** NE2000 switch.
    49  */
    50 #define ENABLE_NE2000 1
    51 
    52 /** 3C503 switch.
    53  */
    54 #define ENABLE_3C503 0
    55 
    56 /** PCI support switch.
    57  */
    58 #define ENABLE_PCI 0
    59 
    6014struct dpeth;
    6115
    62 /* 3c503.c */
    63 /* * Probes a 3C503 network interface.
    64  *  @param[in] dep The network interface structure.
    65  *  @returns 1 if the NE2000 network interface is present.
    66  *  @returns 0 otherwise.
    67  */
    68 //_PROTOTYPE(int el2_probe, (struct dpeth*dep)                          );
    69 
    70 /* ne2000.c */
    71 /** Probes a NE2000 or NE1000 network interface.
    72  *  @param[in] dep The network interface structure.
    73  *  @returns 1 if the NE2000 network interface is present.
    74  *  @returns 0 otherwise.
    75  */
    7616int ne_probe(struct dpeth * dep);
    77 //_PROTOTYPE(int ne_probe, (struct dpeth *dep)                          );
    78 //_PROTOTYPE(void ne_init, (struct dpeth *dep)                          );
    79 
    80 /* rtl8029.c */
    81 /* * Probes a RTL8029 network interface.
    82  *  @param[in] dep The network interface structure.
    83  *  @returns 1 if the NE2000 network interface is present.
    84  *  @returns 0 otherwise.
    85  */
    86 //_PROTOTYPE(int rtl_probe, (struct dpeth *dep)                         );
    87 
    88 /* wdeth.c */
    89 /* * Probes a WDETH network interface.
    90  *  @param[in] dep The network interface structure.
    91  *  @returns 1 if the NE2000 network interface is present.
    92  *  @returns 0 otherwise.
    93  */
    94 //_PROTOTYPE(int wdeth_probe, (struct dpeth*dep)                                );
    9517
    9618#endif
  • uspace/srv/hw/netif/dp8390/ne2000.c

    r4765152 r8f5e2527  
    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:
    24  *  2009 ported to HelenOS, Lukas Mejdrech
    25  */
    26 
    271/** @addtogroup ne2k
    282 *  @{
     
    3711
    3812#include "dp8390_port.h"
    39 
    40 /*
    41 ne2000.c
    42 
    43 Driver for the ne2000 ethernet cards. This file contains only the ne2000
    44 specific code, the rest is in dp8390.c
    45 
    46 Created:        March 15, 1994 by Philip Homburg <philip@f-mnx.phicoh.com>
    47 */
    48 
    49 //#include "../drivers.h"
    50 
    51 //#include <net/gen/ether.h>
    52 //#include <net/gen/eth_io.h>
    53 //#if __minix_vmd
    54 //#include "config.h"
    55 //#endif
    5613
    5714#include "local.h"
     
    5916#include "ne2000.h"
    6017
    61 #if ENABLE_NE2000
    62 
    6318/** Number of bytes to transfer.
    6419 */
    6520#define N 100
    66 
    67 //#define MILLIS_TO_TICKS(m)  (((m)*HZ/1000)+1)
    6821
    6922/** Sleeps for the defined millicesonds.
     
    11467 */
    11568static void ne_stop(dpeth_t *dep);
    116 //_PROTOTYPE(static void milli_delay, (unsigned long millis)            );
    11769
    11870/** Initializes the NE2000 network interface.
     
    196148                                dep->de_initf= ne_init;
    197149                        dep->de_stopf= ne_stop;
    198                         dep->de_prog_IO= 1;
    199150                        return 1;
    200151                }
     
    401352        outb_ne(dep, NE_RESET, byte);
    402353}
    403 /*
    404 static void milli_delay(unsigned long millis)
    405 {
    406         tickdelay(MILLIS_TO_TICKS(millis));
    407 }
    408 */
    409 #endif /* ENABLE_NE2000 */
    410 
    411 /*
    412  * $PchId: ne2000.c,v 1.10 2004/08/03 12:03:00 philip Exp $
    413  */
    414354
    415355/** @}
  • uspace/srv/hw/netif/dp8390/ne2000.h

    r4765152 r8f5e2527  
    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:
    24  *  2009 ported to HelenOS, Lukas Mejdrech
    25  */
    26 
    27 /*
    28 ne2000.h
    29 
    30 Created:        March 15, 1994 by Philip Homburg <philip@f-mnx.phicoh.com>
    31 */
    32 
    331/** @addtogroup ne2k
    342 *  @{
     
    10472#endif /* __NET_NETIF_NE2000_H__ */
    10573
    106 /*
    107  * $PchId: ne2000.h,v 1.4 2004/08/03 12:03:20 philip Exp $
    108  */
    109 
    11074/** @}
    11175 */
Note: See TracChangeset for help on using the changeset viewer.