Subject: port-macppc/20608: Built-in mc0 ethernet does not work (gives timeout errors) on Apple Network Server
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jfm@caslon.dk>
List: netbsd-bugs
Date: 03/06/2003 23:57:59
>Number:         20608
>Category:       port-macppc
>Synopsis:       Built-in mc0 ethernet does not work (gives timeout errors) on Apple Network Server
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 06 23:59:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     John Fox Maule
>Release:        1-6 macppc
>Organization:
>Environment:
NetBSD hubble.caslon.dk 1.6 NetBSD 1.6 (HUBBLE) #12: Mon Mar  3 23:28:04 CET 2003     gljohmau@hubble.caslon.dk:/usr/src/sys/arch/macppc/compile/HUBBLE macppc
>Description:
Apple Network Server 500 and 700
Built-in mc0 ethernet does not work (gives timeout errors)
http://www.netbsd.org/Ports/macppc/models.html#ANS

>How-To-Repeat:
Boot netbsd on Apple Network Server
ifconfig mc0 inet 192.168.1.1 netmask 255.255.255.0 up
Try network connectivity ping etc.

>Fix:
Check if its an ANS AAPL,ShinerESB and set sc->sc_plscc = 1; ANS uses AAUI
Diffs to v1.5
Tested on my ANS 700 works. 

*** /root/backup/usr/src/sys/arch/macppc/dev/if_mc.c	Mon Mar  3 13:51:33 2003
--- /usr/src/sys/arch/macppc/dev/if_mc.c	Mon Mar  3 23:25:42 2003
***************
*** 58,63 ****
--- 58,65 ----
  
  #define MC_BUFSIZE 0x800
  
+ #define PORTSEL_AAUI PORTSEL_AUI + ENPLSIO
+ 
  hide int	mc_match __P((struct device *, struct cfdata *, void *));
  hide void	mc_attach __P((struct device *, struct device *, void *));
  hide void	mc_init __P((struct mc_softc *sc));
***************
*** 113,118 ****
--- 115,121 ----
  	struct mc_softc *sc = (struct mc_softc *)self;
  	u_int8_t myaddr[ETHER_ADDR_LEN];
  	u_int *reg;
+         int ofroot;
  
  	sc->sc_node = ca->ca_node;
  
***************
*** 179,187 ****
  	sc->sc_biucc = XMTSP_64;
  	sc->sc_fifocc = XMTFW_16 | RCVFW_64 | XMTFWU | RCVFWU |
  	    XMTBRST | RCVBRST;
! 	/*sc->sc_plscc = PORTSEL_10BT;*/
! 	sc->sc_plscc = PORTSEL_GPSI | ENPLSIO;
! 
  	/* mcsetup returns 1 if something fails */
  	if (mcsetup(sc, myaddr)) {
  		printf("mcsetup returns non zero\n");
--- 182,201 ----
  	sc->sc_biucc = XMTSP_64;
  	sc->sc_fifocc = XMTFW_16 | RCVFW_64 | XMTFWU | RCVFWU |
  	    XMTBRST | RCVBRST;
!         
!         if ((ofroot = OF_finddevice("/")) != -1) {
!                 char compat[32];
! 
!                 memset(compat, 0, sizeof compat);
!                 OF_getprop(ofroot, "compatible", compat, sizeof compat);
!                 if (strcmp(compat, "AAPL,ShinerESB") == 0)
!                 /* Detected Apple Network Server */
!                 sc->sc_plscc = PORTSEL_AAUI;
!         }
!         else {
!                 sc->sc_plscc = PORTSEL_GPSI | ENPLSIO;
!         }
!                 
  	/* mcsetup returns 1 if something fails */
  	if (mcsetup(sc, myaddr)) {
  		printf("mcsetup returns non zero\n");

>Release-Note:
>Audit-Trail:
>Unformatted: