Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Aug 2006 12:41:49 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        namaskar_alok@yahoo.co.in
Cc:        freebsd-drivers@freebsd.org
Subject:   Re: PHY Driver as module
Message-ID:  <20060814.124149.-432839450.imp@bsdimp.com>
In-Reply-To: <20060814102931.15992.qmail@web8910.mail.in.yahoo.com>
References:  <20060814102931.15992.qmail@web8910.mail.in.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20060814102931.15992.qmail@web8910.mail.in.yahoo.com>
            Alok Barsode <namaskar_alok@yahoo.co.in> 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 1.11.2.8
: 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 <bsd.kmod.mk>
: 
: 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!

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060814.124149.-432839450.imp>