Changeset db9ae70 in rtems
- Timestamp:
- 07/26/00 21:15:27 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 08330bf
- Parents:
- b144609
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/m68k/mvme167/include/bsp.h
rb144609 rdb9ae70 47 47 48 48 struct rtems_bsdnet_ifconfig; 49 extern int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig );49 int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig, int attaching ); 50 50 #define RTEMS_BSP_NETWORK_DRIVER_NAME "uti1" 51 51 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH uti596_attach -
c/src/lib/libbsp/m68k/mvme167/network/network.c
rb144609 rdb9ae70 53 53 #include <bsp.h> 54 54 #include <stdio.h> 55 #include <string.h> 56 #include <stdlib.h> 55 57 56 58 #include <rtems/error.h> … … 124 126 static unsigned long word_swap ( unsigned long ); 125 127 static void * malloc_16byte_aligned ( void **, void ** adjusted_pointer, size_t ); 126 RTEMS_INLINE_ROUTINE void uti596_writePortFunction ( vo id *, unsigned long );128 RTEMS_INLINE_ROUTINE void uti596_writePortFunction ( volatile void *, unsigned long ); 127 129 RTEMS_INLINE_ROUTINE void uti596_portReset( void ); 128 130 static unsigned long uti596_portSelfTest( i596_selftest * ); … … 286 288 */ 287 289 RTEMS_INLINE_ROUTINE void uti596_writePortFunction( 288 vo id * addr,290 volatile void * addr, 289 291 unsigned long cmd 290 292 ) … … 746 748 diagnose.command = CmdDiagnose; 747 749 diagnose.status = 0; 748 uti596_softc.pCurrent_command_status = &diagnose.status;750 uti596_softc.pCurrent_command_status = (unsigned short *)&diagnose.status; 749 751 uti596_addPolledCmd(&diagnose); 750 752 return (uti596_wait ( &uti596_softc, UTI596_WAIT_FOR_STAT_C )); … … 775 777 { 776 778 sc->set_conf.cmd.command = CmdConfigure; 777 memcpy ( sc->set_conf.data, uti596initSetup, 14);779 memcpy ( (void *)sc->set_conf.data, uti596initSetup, 14); 778 780 uti596_addPolledCmd( (i596_cmd *) &sc->set_conf); 779 781 780 782 /* Poll for successful command completion */ 781 sc->pCurrent_command_status = &(sc->set_conf.cmd.status);783 sc->pCurrent_command_status = (unsigned short *)&(sc->set_conf.cmd.status); 782 784 return ( uti596_wait ( sc, UTI596_WAIT_FOR_STAT_C ) ); 783 785 } … … 812 814 813 815 /* Poll for successful command completion */ 814 sc->pCurrent_command_status = &(sc->set_add.cmd.status);816 sc->pCurrent_command_status = (unsigned short *)&(sc->set_add.cmd.status); 815 817 return ( uti596_wait ( sc, UTI596_WAIT_FOR_STAT_C ) ); 816 818 } … … 1434 1436 if (uti596_softc.pLastUnkRFD != I596_NULL ) { 1435 1437 1436 uti596_append( &uti596_softc.pSavedRfdQueue, pRfd); /* Only here! saved Q */1438 uti596_append((i596_rfd **)&uti596_softc.pSavedRfdQueue, pRfd); /* Only here! saved Q */ 1437 1439 uti596_softc.pEndSavedQueue = pRfd; 1438 1440 uti596_softc.savedCount++; … … 1481 1483 * in either case, EL bit has been read, and RNR condition will occur 1482 1484 */ 1483 uti596_append( &uti596_softc.pSavedRfdQueue, pRfd); /* save it for RNR */1485 uti596_append( (i596_rfd **)&uti596_softc.pSavedRfdQueue, pRfd); /* save it for RNR */ 1484 1486 1485 1487 uti596_softc.pEndSavedQueue = pRfd; /* reset end of saved queue */ … … 1650 1652 1651 1653 int uti596_attach( 1652 struct rtems_bsdnet_ifconfig * pConfig 1654 struct rtems_bsdnet_ifconfig * pConfig, 1655 int attaching 1653 1656 ) 1654 1657 { 1655 1658 uti596_softc_ *sc = &uti596_softc; /* device dependent data structure */ 1656 struct ifnet * ifp = &sc->arpcom.ac_if;/* ifnet structure */1657 1658 1659 1660 1661 1662 1659 struct ifnet * ifp = (struct ifnet *)&sc->arpcom.ac_if; /* ifnet structure */ 1660 int unitNumber; 1661 char *unitName; 1662 char *pAddr; 1663 int addr; 1664 1665 #ifdef DBG_ATTACH 1663 1666 printk(("uti596_attach: begins\n")) 1664 1667 #endif 1665 1668 1666 1669 /* The NIC is not started yet */ … … 1668 1671 1669 1672 /* Indicate to ULCS that this is initialized */ 1670 ifp->if_softc = sc;1673 ifp->if_softc = (void *)sc; 1671 1674 sc->pScp = NULL; 1672 1675 1673 1674 1675 1676 /* Parse driver name */ 1677 if ((unitNumber = rtems_bsdnet_parse_driver_name (pConfig, &unitName)) < 0) 1678 return 0; 1676 1679 1677 1680 ifp->if_name = unitName; … … 1693 1696 * structure values is unrecoverable and would be lost here. 1694 1697 */ 1695 if ( addr = nvram->ipaddr) {1696 if ( pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT) )1697 pConfig->ip_address =inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );1698 1699 1700 } 1701 if ( addr = nvram->netmask) {1702 if ( pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT) )1703 pConfig->ip_netmask =inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );1704 1705 1698 if ( (addr = nvram->ipaddr) ) { 1699 if ( (pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT )) ) 1700 pConfig->ip_address = (char *)inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 ); 1701 else 1702 rtems_panic("Can't allocate ip_address buffer!\n"); 1703 } 1704 if ( (addr = nvram->netmask) ) { 1705 if ( (pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT )) ) 1706 pConfig->ip_netmask = (char *)inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 ); 1707 else 1708 rtems_panic("Can't allocate ip_netmask buffer!\n"); 1706 1709 } 1707 1710 … … 1711 1714 */ 1712 1715 if ( nvram->enaddr ) { 1713 memcpy ( sc->arpcom.ac_enaddr, &nvram->enaddr, ETHER_ADDR_LEN);1716 memcpy ((void *)sc->arpcom.ac_enaddr, &nvram->enaddr, ETHER_ADDR_LEN); 1714 1717 } 1715 1718 else if ( pConfig->hardware_address) { 1716 memcpy ( sc->arpcom.ac_enaddr, pConfig->hardware_address, ETHER_ADDR_LEN);1719 memcpy ((void *)sc->arpcom.ac_enaddr, pConfig->hardware_address, ETHER_ADDR_LEN); 1717 1720 } 1718 1721 else { 1719 memcpy ( sc->arpcom.ac_enaddr, (char *)0xFFFC1F2C, ETHER_ADDR_LEN);1722 memcpy ((void *)sc->arpcom.ac_enaddr, (char *)0xFFFC1F2C, ETHER_ADDR_LEN); 1720 1723 } 1721 1724 … … 1801 1804 { 1802 1805 uti596_softc_ *sc = arg; 1803 struct ifnet *ifp = &sc->arpcom.ac_if;1806 struct ifnet *ifp = (struct ifnet *)&sc->arpcom.ac_if; 1804 1807 1805 1808 if (sc->txDaemonTid == 0) { … … 1808 1811 * Initialize the 82596 1809 1812 */ 1810 1813 #ifdef DBG_INIT 1811 1814 printk(("uti596_init: begins\nuti596_init: initializing the 82596...\n")) 1812 1815 #endif 1813 1816 uti596_initialize_hardware(sc); 1814 1817 … … 1816 1819 * Start driver tasks 1817 1820 */ 1818 1821 #ifdef DBG_INIT 1819 1822 printk(("uti596_init: starting driver tasks...\n")) 1820 1821 sc->txDaemonTid = rtems_bsdnet_newproc ("UTtx", 2*4096, uti596_txDaemon, sc);1822 sc->rxDaemonTid = rtems_bsdnet_newproc ("UTrx", 2*4096, uti596_rxDaemon, sc);1823 sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096, uti596_resetDaemon, sc);1824 1825 1823 #endif 1824 sc->txDaemonTid = rtems_bsdnet_newproc ("UTtx", 2*4096, uti596_txDaemon, (void *)sc); 1825 sc->rxDaemonTid = rtems_bsdnet_newproc ("UTrx", 2*4096, uti596_rxDaemon, (void *)sc); 1826 sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096, uti596_resetDaemon, (void *)sc); 1827 1828 #ifdef DBG_INIT 1826 1829 printk(("uti596_init: After attach, status of board = 0x%x\n", sc->scb.status )) 1827 1830 #endif 1828 1831 } 1829 1832 … … 1831 1834 * Enable receiver 1832 1835 */ 1833 1834 1835 1836 #ifdef DBG_INIT 1837 printk(("uti596_init: enabling the reciever...\n" )) 1838 #endif 1836 1839 sc->scb.command = RX_START; 1837 1840 uti596_issueCA ( sc, UTI596_WAIT_FOR_CU_ACCEPT ); … … 1841 1844 */ 1842 1845 ifp->if_flags |= IFF_RUNNING; 1843 1844 1845 1846 #ifdef DBG_INIT 1847 printk(("uti596_init: completed.\n")) 1848 #endif 1846 1849 } 1847 1850 … … 1865 1868 ) 1866 1869 { 1867 struct ifnet *ifp =&sc->arpcom.ac_if;1868 1869 1870 struct ifnet *ifp = (struct ifnet *)&sc->arpcom.ac_if; 1871 1872 ifp->if_flags &= ~IFF_RUNNING; 1870 1873 sc->started = 0; 1871 1874 1872 1873 1875 #ifdef DBG_STOP 1876 printk(("uti596stop: %s: Shutting down ethercard, status was %4.4x.\n", 1874 1877 uti596_softc.arpcom.ac_if.if_name, uti596_softc.scb.status)) 1875 1876 1877 1878 1879 1878 #endif 1879 1880 printk(("Stopping interface\n")) 1881 sc->scb.command = CUC_ABORT | RX_ABORT; 1882 i82596->chan_attn = 0x00000000; 1880 1883 } 1881 1884 … … 1896 1899 { 1897 1900 uti596_softc_ *sc = (uti596_softc_ *)arg; 1898 struct ifnet *ifp = &sc->arpcom.ac_if;1901 struct ifnet *ifp = (struct ifnet *)&sc->arpcom.ac_if; 1899 1902 struct mbuf *m; 1900 1903 rtems_event_set events; … … 1941 1944 { 1942 1945 uti596_softc_ *sc = (uti596_softc_ *)arg; 1943 struct ifnet *ifp = &sc->arpcom.ac_if;1946 struct ifnet *ifp = (struct ifnet *)&sc->arpcom.ac_if; 1944 1947 struct mbuf *m; 1945 1948 … … 1979 1982 * a fragment, so it is NOT a complete packet. 1980 1983 */ 1981 pRfd = uti596_dequeue( &sc->pInboundFrameQueue);1984 pRfd = uti596_dequeue( (i596_rfd **)&sc->pInboundFrameQueue); 1982 1985 while ( pRfd && 1983 1986 pRfd != I596_NULL && … … 2005 2008 m->m_pkthdr.rcvif = ifp; 2006 2009 /* move everything into an mbuf */ 2007 memcpy(m->m_data, pRfd->data, pkt_len);2010 memcpy(m->m_data, (const char *)pRfd->data, pkt_len); 2008 2011 m->m_len = m->m_pkthdr.len = pkt_len - sizeof(struct ether_header) - 4; 2009 2012 … … 2060 2063 _ISR_Enable(level); 2061 2064 2062 pRfd = uti596_dequeue( &sc->pInboundFrameQueue); /* grab next frame */2065 pRfd = uti596_dequeue( (i596_rfd **)&sc->pInboundFrameQueue); /* grab next frame */ 2063 2066 2064 2067 } /* end while */ … … 2228 2231 pIsrRfd = (i596_rfd *) word_swap ((unsigned long)uti596_softc.pBeginRFA->next); 2229 2232 /* the append destroys the link */ 2230 uti596_append( &uti596_softc.pInboundFrameQueue , uti596_softc.pBeginRFA );2233 uti596_append( (i596_rfd **)&uti596_softc.pInboundFrameQueue , uti596_softc.pBeginRFA ); 2231 2234 2232 2235 /* … … 2462 2465 uti596_softc.pEndRFA -> next = I596_NULL; /* added feb 16 */ 2463 2466 } 2464 uti596_append( &uti596_softc.pSavedRfdQueue, uti596_softc.pLastUnkRFD );2467 uti596_append( (i596_rfd **)&uti596_softc.pSavedRfdQueue, uti596_softc.pLastUnkRFD ); 2465 2468 uti596_softc.savedCount++; 2466 2469 uti596_softc.pEndSavedQueue = uti596_softc.pLastUnkRFD; … … 2576 2579 static int uti596_ioctl( 2577 2580 struct ifnet *ifp, 2578 int command, caddr_t data 2581 int command, 2582 caddr_t data 2579 2583 ) 2580 2584 { … … 2603 2607 case IFF_UP: 2604 2608 printk(("IFF_UP\n")) 2605 uti596_init ( sc);2609 uti596_init ( (void *)sc); 2606 2610 break; 2607 2611 … … 2609 2613 printk(("IFF_UP and RUNNING\n")) 2610 2614 uti596_stop (sc); 2611 uti596_init ( sc);2615 uti596_init ( (void *)sc); 2612 2616 break; 2613 2617 -
c/src/lib/libbsp/m68k/mvme167/network/uti596.h
rb144609 rdb9ae70 209 209 unsigned short status; 210 210 unsigned short command; 211 struct i596_cmd *next;211 volatile struct i596_cmd *next; 212 212 } i596_cmd; 213 213 … … 228 228 typedef volatile struct i596_tx { 229 229 i596_cmd cmd; 230 struct i596_tbd *pTbd;230 volatile struct i596_tbd *pTbd; 231 231 unsigned short count; 232 232 unsigned short pad; … … 251 251 unsigned short size; 252 252 unsigned short pad; 253 struct i596_tbd *next;253 volatile struct i596_tbd *next; 254 254 char *data; 255 255 } i596_tbd; … … 262 262 unsigned short count; 263 263 unsigned short offset; 264 struct i596_rbd *next;264 volatile struct i596_rbd *next; 265 265 char *data; 266 266 unsigned short size; … … 274 274 unsigned short stat; 275 275 unsigned short cmd; 276 struct i596_rfd *next;276 volatile struct i596_rfd *next; 277 277 i596_rbd *pRbd; 278 278 unsigned short count; -
make/custom/mvme167.cfg
rb144609 rdb9ae70 22 22 # 23 23 24 CPU_CFLAGS = -m68040 -DRTEMS_BSP=$(RTEMS_BSP) 24 CPU_CFLAGS = -m68040 -DRTEMS_BSP=$(RTEMS_BSP) -D$(RTEMS_BSP) 25 25 26 26 # BSP specific preprocessor flags.
Note: See TracChangeset
for help on using the changeset viewer.