From nobody@FreeBSD.org  Thu Jul 26 15:18:45 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id A9E0437B403
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 26 Jul 2001 15:18:44 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f6QMIif72179;
	Thu, 26 Jul 2001 15:18:44 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200107262218.f6QMIif72179@freefall.freebsd.org>
Date: Thu, 26 Jul 2001 15:18:44 -0700 (PDT)
From: Jim McGrath <jmcgrath@sitaranetworks.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Bug in cu version of the wx (82543) driver.
X-Send-Pr-Version: www-1.0

>Number:         29249
>Category:       kern
>Synopsis:       Bug in cu version of the wx (82543) driver.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    mjacob
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 26 15:20:08 PDT 2001
>Closed-Date:    Mon Oct 1 17:16:29 PDT 2001
>Last-Modified:  Mon Oct 01 17:16:44 PDT 2001
>Originator:     Jim McGrath
>Release:        The bug is present in -current
>Organization:
Sitara Networks
>Environment:
>Description:
miibus_attach() in sys/dev/mii/mii.c makes an assumption about the location of the arpcom structure in the softc structure.  See the line

	mii->mii_ifp = device_get_softc(device_get_parent(dev));

However, softc, which has struct wxmdvar as its first element, doesn't have struct arpcom as the first element of struct wxmdvar.

This problem is not encountered in the fiber version of the NIC because no use is made of the mii.

struct wxmdvar {
	struct device *		dev;	/* backpointer to device */
	struct arpcom 		arpcom;	/* per-interface network data */
	struct resource *	mem;	/* resource descriptor for registers */

>How-To-Repeat:
Try to get LIVENGOOD_CU working.
>Fix:
I moved the struct arpcom to the first location of struct wxmdvar and this solved my problems.  I did not find any positional dependencies for struct device *dev;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mjacob 
Responsible-Changed-By: mjacob 
Responsible-Changed-When: Mon Oct 1 13:29:52 PDT 2001 
Responsible-Changed-Why:  
my driver 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29249 
State-Changed-From-To: open->closed 
State-Changed-By: mjacob 
State-Changed-When: Mon Oct 1 17:16:29 PDT 2001 
State-Changed-Why:  
fix checked into -current, MFCs in a week. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29249 
>Unformatted:
