From amagai@nue.org Mon May 17 21:59:21 1999
Return-Path: <amagai@nue.org>
Received: from may.nue.org (may.nue.org [163.138.156.31])
	by hub.freebsd.org (Postfix) with ESMTP id D76E114D37
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 17 May 1999 21:59:19 -0700 (PDT)
	(envelope-from amagai@nue.org)
Received: by may.nue.org (8.9.3/nue.mxn1); Tue, 18 May 1999 13:59:19 +0900 (JST) <199905180459.NAA14882@may.nue.org> from 
Message-Id: <199905180459.NAA14882@may.nue.org>
Date: Tue, 18 May 1999 13:59:19 +0900 (JST)
From: amagai@nue.org
Reply-To: amagai@nue.org
To: FreeBSD-gnats-submit@freebsd.org
Cc: amagai@nue.org
Subject: tx driver, SIOCGIFADDR ioctl does not work
X-Send-Pr-Version: 3.2

>Number:         11754
>Category:       kern
>Synopsis:       tx driver, SIOCGIFADDR ioctl does not work
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 17 22:00:01 PDT 1999
>Closed-Date:    Wed Jun 9 17:22:24 PDT 1999
>Last-Modified:  Wed Jun  9 17:24:59 PDT 1999
>Originator:     Amagai Yoshiji
>Release:        FreeBSD 3.1-RELEASE
>Organization:
NUE
>Environment:
FreeBSD 3.1-RELEASE (SMP), Gateway GX-450, Pentium XEON * 2 with NIC as follows.
tx0: <SMC 83c170> rev 0x08 int a irq 16 on pci0.17.0
tx0: address 00:e0:29:32:a5:07, type SMC9432TX, 100Mbps
>Description:
SIOCGIFADDR ioctl does not work.
>How-To-Repeat:
>Fix:
/*	$OpenBSD: if_tx.c,v 1.3 1998/10/10 04:30:09 jason Exp $	*/
/*	$Id: if_tx.c,v 1.27 1999/05/10 00:20:46 peter Exp $ */

--- if_tx.c'	Tue May 18 13:46:31 1999
+++ if_tx.c	Tue May 18 13:46:11 1999
@@ -469,6 +469,8 @@
 
 	if( epic_common_attach(sc) ) return;
 
+	bcopy(sc->sc_macaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
+
 	/* Display ethernet address ,... */
 	printf(": address %02x:%02x:%02x:%02x:%02x:%02x,",
 		sc->sc_macaddr[0],sc->sc_macaddr[1],sc->sc_macaddr[2],
================
Amagai Yoshiji
New Unified Environment

>Release-Note:
>Audit-Trail:

From: amagai@nue.org
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: pending/11754: tx driver, SIOCGIFADDR ioctl does not work
Date: Tue, 18 May 1999 14:46:25 +0900 (JST)

 Sorry, my fix is meanless.
 
 How to repeat.
 ================================================================
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
 #include <signal.h>
 #include <setjmp.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <termios.h>
 #include <sys/time.h>
 #include <unistd.h>
 #include <time.h>
 #include <ctype.h>
 #include <errno.h>
 #include <dirent.h>
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <grp.h>
 #include <net/if.h>
 #include <net/bpf.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netinet/if_ether.h>
 
 main ()
 {
   struct ifreq ifr;
   int i, bpf;
   if ((bpf = open("/dev/bpf0", O_RDWR, 0444)) < 0) perror("open bpf");
     
   memset(&ifr, 0, sizeof (ifr));
   strcpy(ifr.ifr_name, "tx0");
   if (ioctl(bpf, BIOCSETIF, &ifr) < 0) perror("setif");
   if (ioctl(bpf, SIOCGIFADDR, &ifr) < 0) perror("GIFA");
 
   fprintf(stderr, "name='%s', len=%d, family=%d\n",
 	  ifr.ifr_name, 
 	  ifr.ifr_addr.sa_len, ifr.ifr_addr.sa_family);
   for (i=0; i < 14; i++)
     fprintf(stderr, "%02x ", ifr.ifr_addr.sa_data[i]&0xff);
   fputc('\n', stderr);
 }
 ================================================================
 

From: amagai@nue.org
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: pending/11754: tx driver, SIOCGIFADDR ioctl does not work
Date: Tue, 18 May 1999 15:44:09 +0900 (JST)

 Fixed!
 "struct arpcom arpcom" must be at first element of sc structure.
 
 /*	$OpenBSD: if_txvar.h,v 1.3 1998/10/10 04:30:09 jason Exp $	*/
 /*      $Id: if_txvar.h,v 1.1.4.1 1999/04/23 05:47:53 semenu Exp $ */
 
 ================================================================
 --- if_txvar.h'	Tue May 18 15:40:12 1999
 +++ if_txvar.h	Tue May 18 15:41:15 1999
 @@ -329,6 +329,7 @@
  	bus_space_tag_t		sc_st;
  	bus_space_handle_t	sc_sh;
  #else /* __FreeBSD__ */
 +	struct arpcom		arpcom;
  #if defined(EPIC_USEIOSPACE)
  	u_int32_t		iobase;
  #else
 @@ -338,7 +339,6 @@
  #if !defined(EPIC_NOIFMEDIA)
  	struct ifmedia 		ifmedia;
  #endif
 -	struct arpcom		arpcom;
  	u_int32_t		unit;
  	struct epic_rx_buffer	rx_buffer[RX_RING_SIZE];
  	struct epic_tx_buffer	tx_buffer[TX_RING_SIZE];
 ================================================================
 
 Amagai Yoshiji
 
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sat May 29 21:24:53 PDT 1999 
Responsible-Changed-Why:  
Misfiled PR. 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Wed Jun 9 17:22:24 PDT 1999 
State-Changed-Why:  
This was fixed by semenu@freebsd.org in revision 1.3 of src/sys/pci/if_txvar.h. 
>Unformatted:
