Changeset 3d5e190 in mainline for uspace/srv/hw/netif/dp8390/ne2000.c


Ignore:
Timestamp:
2011-01-06T23:50:48Z (14 years ago)
Author:
martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7c34b28f, 854151c, ae1f70e
Parents:
ba21938 (diff), 7922dea (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:

simplify the NE2000 driver code even futher to be really sure that it is working properly (still not 100 % sure about that)

File:
1 edited

Legend:

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

    rba21938 r3d5e190  
    8181static int test_16(dpeth_t *dep, int pos, uint8_t *pat);
    8282
    83 /** Stops the NE2000 network interface.
    84  *  @param[in,out] dep The network interface structure.
    85  */
    86 static void ne_stop(dpeth_t *dep);
    87 
    88 /** Initializes the NE2000 network interface.
    89  *  @param[in,out] dep The network interface structure.
    90  */
    91 void ne_init(struct dpeth *dep);
    92 
    9383int ne_probe(dpeth_t *dep)
    9484{
     
    136126               
    137127                if (dep->de_16bit) {
    138                         loc1= NE2000_START;
    139                         loc2= NE2000_START + NE2000_SIZE - 4;
    140                         f= test_16;
     128                        loc1 = NE2000_START;
     129                        loc2 = NE2000_START + NE2000_SIZE - 4;
     130                        f = test_16;
    141131                } else {
    142                         loc1= NE1000_START;
    143                         loc2= NE1000_START + NE1000_SIZE - 4;
    144                         f= test_8;
     132                        loc1 = NE1000_START;
     133                        loc2 = NE1000_START + NE1000_SIZE - 4;
     134                        f = test_8;
    145135                }
    146136               
     
    149139                    f(dep, loc2, pat0) && f(dep, loc2, pat1) &&
    150140                    f(dep, loc2, pat2) && f(dep, loc2, pat3)) {
    151                         dep->de_initf = ne_init;
    152                         dep->de_stopf = ne_stop;
    153141                        return 1;
    154142                }
     
    158146}
    159147
     148/** Initializes the NE2000 network interface.
     149 *
     150 *  @param[in,out] dep The network interface structure.
     151 *
     152 */
    160153void ne_init(dpeth_t *dep)
    161154{
     
    206199        dep->de_stoppage = dep->de_offset_page + dep->de_ramsize / DP_PAGESIZE;
    207200       
    208         printf("%s: Novell NE%d000 ethernet card at I/O address "
     201        printf("Novell NE%d000 ethernet card at I/O address "
    209202            "%#lx, memory size %#lx, irq %d\n",
    210             dep->de_name, dep->de_16bit ? 2 : 1,
    211             dep->de_base_port, dep->de_ramsize, dep->de_irq);
     203            dep->de_16bit ? 2 : 1, dep->de_base_port, dep->de_ramsize,
     204            dep->de_irq);
    212205}
    213206
     
    235228       
    236229        if (i == N) {
    237                 printf("%s: NE1000 remote DMA test failed\n", dep->de_name);
     230                printf("NE1000 remote DMA test failed\n");
    238231                return 0;
    239232        }
     
    274267       
    275268        if (i == N) {
    276                 printf("%s: NE2000 remote DMA test failed\n", dep->de_name);
     269                printf("NE2000 remote DMA test failed\n");
    277270                return 0;
    278271        }
     
    290283}
    291284
    292 static void ne_stop(dpeth_t *dep)
     285/** Stop the NE2000 network interface.
     286 *
     287 *  @param[in,out] dep The network interface structure.
     288 *
     289 */
     290void ne_stop(dpeth_t *dep)
    293291{
    294292        /* Reset the ethernet card */
Note: See TracChangeset for help on using the changeset viewer.