PHY Driver as module

M. Warner Losh imp at
Mon Aug 14 18:45:06 UTC 2006

In message: <20060814102931.15992.qmail at>
            Alok Barsode <namaskar_alok at> writes:
: Hi,
: I am a newbie to FreeBSD kernel development.
: I am using FreeBSD 4.10.
: I was trying to build a PHY driver as module
: (/dev/mii/nsgphy.c) but i am unable to do so.
: I modified the Makefile in /sys/modules/mii as follows
: # $FreeBSD: src/sys/modules/mii/Makefile,v
: 2003/10/29 17:06:48 wpaul Exp $
: .PATH:	${.CURDIR}/../../dev/mii
: KMOD	= nsgphy
: SRCS	= mii.c mii_physubr.c miibus_if.h device_if.h
: miibus_if.c
: SRCS	+= bus_if.h pci_if.h nsgphy.c 
: .include <>
: It generated a nsgphy.ko and a mii.ko 
: I am unable to load the nsgphy.ko , it says "No such
: file or directory".
: When i try to insert mii.ko it says file exists.
: Am i missing something?

Yes.  ukphy is needed for most of the mii modules.  You likely are
getting link errors in your dmesg.  ukphy.c and ukphy_subr.c are the
prime candidates to have routines that are missing.  Why there's both
a mii_physubr.c and a ukphy_subr.c is beyond me...

I have some changes in my tree that make it so you can statically link
in only the mii modules you need.  My next step is to provide a way to
load limited numbers of mii modules.  I've been hesitant to go to that
step since it is quite a bit harder to get dependencies right to make
that happen.

Also, the mii identifier codes need to be cleaned up because we're
presenting them in the wrong bit order, but NetBSD changed that a
while ago.  I'm afraid to make the change sine I'm worried about the
number of people I'd break :-)

Good luck!


More information about the freebsd-drivers mailing list