Changeset 4f6d73a in rtems
- Timestamp:
- 03/03/99 16:22:57 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 163b29a
- Parents:
- 97b8b8f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/i386/i386ex/network/network.c
r97b8b8f r4f6d73a 67 67 static struct uti596_softc uti596_softc; 68 68 69 int uti596packetNumber = 0;70 69 71 70 static int scbStatus; … … 411 410 } 412 411 413 414 412 static void 415 413 uti596_start (struct ifnet *ifp) … … 426 424 int boguscnt = 1000; 427 425 rtems_status_code status_code; 426 427 printf("uti596_initialize_hardware\n"); 428 428 429 429 /* reset the board */ … … 431 431 outport_word( PORT_ADDR, 0 ); 432 432 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); 435 434 #ifdef DBG_INIT 436 435 printf("initialize_hardware:Scp address initially %p\n", sc->pScp); … … 438 437 sc->pScp = (struct i596_scp *) 439 438 ((((int)uti596_softc.pScp) + 0xf) & 0xfffffff0); 440 441 439 442 440 #ifdef DBG_INIT 443 441 printf("initialize_hardware:change scp address to : %p\n",sc->pScp); 444 442 #endif 445 446 443 447 444 /* change the scp address */ … … 461 458 outport_word( PORT_ADDR, 0 ); 462 459 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 ); 465 462 466 463 /* This is linear mode, LOCK function is disabled */ … … 523 520 struct i596_cmd *pCmd; 524 521 522 523 printf("uti596_reset_hardware\n"); 525 524 pCmd = sc->pCmdHead; /* This is a tx command for sure (99.99999%) */ 526 525 … … 528 527 outport_word( PORT_ADDR, 0 ); 529 528 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 } 530 534 531 535 #ifdef DBG_RESET … … 556 560 outport_word( PORT_ADDR, 0 ); 557 561 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 ); 560 567 561 568 /* This is linear mode, LOCK function is disabled */ … … 1208 1215 #endif 1209 1216 1210 #ifdef D EBUG_POLLED_CMD1217 #ifdef DBG_POLLED_CMD 1211 1218 1212 1219 switch ( pCmd -> command & 0x7 ){ /* check bottom 7 bits */ … … 1246 1253 pCmd->next = I596_NULL; 1247 1254 1255 UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: wait prev"); 1256 1248 1257 uti596_softc.pCmdHead = uti596_softc.pCmdTail = uti596_softc.scb.pCmd = pCmd; 1249 1250 UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: wait prev");1251 1252 1258 uti596_softc.scb.command = CUC_START; 1253 1259 outport_word (CHAN_ATTN,0); 1254 1260 1255 UTI_WAIT_COMMAND_ACCEPTED( 2000000,"Add Polled command: start");1261 UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: start"); 1256 1262 uti596_softc.pCmdHead = uti596_softc.pCmdTail = uti596_softc.scb.pCmd = I596_NULL; 1257 1263 1258 #ifdef DBG_ 5961264 #ifdef DBG_POLLED_CMD 1259 1265 printf("Scb status & command 0x%x 0x%x\n", 1260 1266 uti596_softc.scb.status, … … 1847 1853 /* Indicate to ULCS that this is initialized */ 1848 1854 ifp->if_softc = sc; 1855 sc -> pScp = NULL; 1849 1856 1850 1857 /* Assign the name */ … … 1953 1960 } 1954 1961 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); */ 1956 1963 return; 1957 1964 } … … 2503 2510 outport_word( CHAN_ATTN, 0 ); 2504 2511 2505 2506 2512 } 2507 2513 … … 2717 2723 struct uti596_softc *sc = arg; 2718 2724 struct ifnet *ifp = &sc->arpcom.ac_if; 2725 rtems_status_code status_code; 2726 2719 2727 2720 2728 if (sc->txDaemonTid == 0) { 2721 2729 2722 2730 uti596_initialize_hardware(sc); 2723 2731 2724 2732 /* 2725 2733 * Start driver tasks 2726 2734 */ 2727 2735 2728 2736 sc->txDaemonTid = rtems_bsdnet_newproc ("UTtx", 2*4096, uti596_txDaemon, sc); 2729 2737 sc->rxDaemonTid = rtems_bsdnet_newproc ("UTrx", 2*4096, uti596_rxDaemon, sc); 2730 2738 sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096, 2731 2739 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 2732 2747 } 2748 2733 2749 /* 2734 2750 * Enable receiver 2735 2751 */ 2752 UTI_WAIT_COMMAND_ACCEPTED(4000, "init:Before RX_START"); 2736 2753 sc->scb.pRfd = sc -> pBeginRFA; 2737 2754 sc->scb.command = RX_START;
Note: See TracChangeset
for help on using the changeset viewer.