Bug 29249

Summary: Bug in cu version of the wx (82543) driver.
Product: Base System Reporter: Jim McGrath <jmcgrath>
Component: kernAssignee: Matt Jacob <mjacob>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Jim McGrath 2001-07-26 23:20:08 UTC
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 */

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;
How-To-Repeat: Try to get LIVENGOOD_CU working.
Comment 1 Matt Jacob freebsd_committer freebsd_triage 2001-10-01 21:29:52 UTC
Responsible Changed
From-To: freebsd-bugs->mjacob

my driver
Comment 2 Matt Jacob freebsd_committer freebsd_triage 2001-10-02 01:16:29 UTC
State Changed
From-To: open->closed

fix checked into -current, MFCs in a week.