Changeset 4f6d73a in rtems


Ignore:
Timestamp:
Mar 3, 1999, 4:22:57 PM (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
163b29a
Parents:
97b8b8f
Message:

Patch from Erik Ivanenko <erik.ivanenko@…> to correct a bug
that shows up if the BSP uses memory near address 0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/i386ex/network/network.c

    r97b8b8f r4f6d73a  
    6767static struct uti596_softc uti596_softc;
    6868
    69 int uti596packetNumber = 0;
    7069
    7170static    int scbStatus;
     
    411410}
    412411
    413 
    414412static void
    415413uti596_start (struct ifnet *ifp)
     
    426424  int boguscnt = 1000;
    427425  rtems_status_code status_code;
     426
     427  printf("uti596_initialize_hardware\n");
    428428 
    429429  /* reset the board  */
     
    431431  outport_word( PORT_ADDR, 0 );
    432432
    433   sc->pScp = (struct i596_scp *)
    434     calloc(1,sizeof(struct i596_scp) + 0xf);
     433  uti596_softc.pScp = (struct i596_scp *) calloc(1,sizeof(struct i596_scp) + 0xf);
    435434#ifdef DBG_INIT
    436435  printf("initialize_hardware:Scp address initially %p\n", sc->pScp);
     
    438437  sc->pScp = (struct i596_scp *)
    439438    ((((int)uti596_softc.pScp) + 0xf) & 0xfffffff0);
    440  
    441439
    442440#ifdef DBG_INIT
    443441  printf("initialize_hardware:change scp address to : %p\n",sc->pScp);
    444442#endif
    445 
    446443 
    447444  /* change the scp address */
     
    461458  outport_word( PORT_ADDR, 0 );
    462459 
    463   outport_word(PORT_ADDR, ((((int)uti596_softc.pScp) &  0xffff) | 2 ));
    464   outport_word(PORT_ADDR, (( (int)uti596_softc.pScp) >> 16 ) & 0xffff );
     460  outport_word(PORT_ADDR, ((((int)sc->pScp) &  0xffff) | 2 ));
     461  outport_word(PORT_ADDR, (( (int)sc->pScp) >> 16 ) & 0xffff );
    465462 
    466463  /* This is linear mode, LOCK function is disabled  */
     
    523520  struct i596_cmd *pCmd;
    524521 
     522
     523  printf("uti596_reset_hardware\n");
    525524  pCmd = sc->pCmdHead;  /* This is a tx command for sure (99.99999%)  */
    526525 
     
    528527  outport_word( PORT_ADDR, 0 );
    529528  outport_word( PORT_ADDR, 0 );
     529
     530  if ( sc->pScp == NULL ) {
     531    printf("Calloc scp\n");
     532    uti596_softc.pScp = (struct i596_scp *) calloc(1,sizeof(struct i596_scp) + 0xf);
     533  }
    530534
    531535#ifdef DBG_RESET
     
    556560  outport_word( PORT_ADDR, 0 );
    557561 
    558   outport_word(PORT_ADDR, ((((int)uti596_softc.pScp) &  0xffff) | 2 ));
    559   outport_word(PORT_ADDR, (( (int)uti596_softc.pScp) >> 16 ) & 0xffff );
     562  /*  outport_word(PORT_ADDR, ((((int)uti596_softc.pScp) &  0xffff) | 2 ));
     563  outport_word(PORT_ADDR, (( (int)uti596_softc.pScp) >> 16 ) & 0xffff ); */
     564 
     565  outport_word(PORT_ADDR, ((((int)sc->pScp) &  0xffff) | 2 ));
     566  outport_word(PORT_ADDR, (( (int)sc->pScp) >> 16 ) & 0xffff );
    560567 
    561568  /* This is linear mode, LOCK function is disabled  */
     
    12081215 #endif
    12091216
    1210 #ifdef DEBUG_POLLED_CMD
     1217#ifdef DBG_POLLED_CMD
    12111218     
    12121219     switch ( pCmd -> command & 0x7 ){ /* check bottom 7 bits */
     
    12461253     pCmd->next = I596_NULL;
    12471254
     1255     UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: wait prev");
     1256
    12481257     uti596_softc.pCmdHead = uti596_softc.pCmdTail = uti596_softc.scb.pCmd = pCmd;
    1249 
    1250      UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: wait prev");
    1251 
    12521258     uti596_softc.scb.command = CUC_START;
    12531259     outport_word (CHAN_ATTN,0);
    12541260
    1255      UTI_WAIT_COMMAND_ACCEPTED(2000000,"Add Polled command: start");
     1261     UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: start");
    12561262     uti596_softc.pCmdHead = uti596_softc.pCmdTail = uti596_softc.scb.pCmd = I596_NULL;
    12571263
    1258 #ifdef DBG_596
     1264#ifdef DBG_POLLED_CMD
    12591265     printf("Scb status & command 0x%x 0x%x\n",
    12601266            uti596_softc.scb.status,
     
    18471853  /* Indicate to ULCS that this is initialized */ 
    18481854  ifp->if_softc = sc; 
     1855  sc -> pScp = NULL;
    18491856 
    18501857  /* Assign the name */
     
    19531960   }
    19541961   else {
    1955      printk("***INFO: ACK'd w/o processing. status = %x\n", scbStatus);
     1962     /*     printk("***INFO: ACK'd w/o processing. status = %x\n", scbStatus); */
    19561963     return;
    19571964   }
     
    25032510    outport_word( CHAN_ATTN, 0 );
    25042511
    2505    
    25062512}
    25072513
     
    27172723  struct uti596_softc  *sc = arg;
    27182724  struct ifnet *ifp = &sc->arpcom.ac_if;
     2725  rtems_status_code status_code;
     2726
    27192727
    27202728  if (sc->txDaemonTid == 0) {
    27212729
    27222730    uti596_initialize_hardware(sc);
    2723 
     2731   
    27242732    /*
    27252733     * Start driver tasks
    27262734     */
    2727 
     2735   
    27282736    sc->txDaemonTid = rtems_bsdnet_newproc ("UTtx", 2*4096, uti596_txDaemon, sc);
    27292737    sc->rxDaemonTid = rtems_bsdnet_newproc ("UTrx", 2*4096, uti596_rxDaemon, sc);
    27302738    sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096,
    27312739                                               uti596_resetDaemon, sc);
     2740   
     2741   
     2742#ifdef DBG_INIT
     2743    printf("After attach, status of board = 0x%x\n", sc->scb.status );
     2744#endif
     2745    outport_word(0x380, 0xf); /* reset the LED's */
     2746
    27322747  }
     2748
    27332749  /*
    27342750   * Enable receiver
    27352751   */
     2752  UTI_WAIT_COMMAND_ACCEPTED(4000, "init:Before RX_START");
    27362753  sc->scb.pRfd = sc -> pBeginRFA;
    27372754  sc->scb.command = RX_START;
Note: See TracChangeset for help on using the changeset viewer.