diff options
Diffstat (limited to 'usr/src')
35 files changed, 769 insertions, 140 deletions
diff --git a/usr/src/pkgdefs/SUNWcakr.u/prototype_com b/usr/src/pkgdefs/SUNWcakr.u/prototype_com index ebcb8368e8..7573a522ea 100644 --- a/usr/src/pkgdefs/SUNWcakr.u/prototype_com +++ b/usr/src/pkgdefs/SUNWcakr.u/prototype_com @@ -419,7 +419,6 @@ f none platform/sun4u/kernel/crypto/sparcv9/md5 755 root sys f none platform/sun4u/kernel/crypto/sparcv9/rsa 755 root sys f none platform/sun4u/kernel/crypto/sparcv9/sha1 755 root sys d none platform/sun4u/kernel/drv 755 root sys -f none platform/sun4u/kernel/drv/dmfe.conf 644 root sys f none platform/sun4u/kernel/drv/i2bsc.conf 644 root sys f none platform/sun4u/kernel/drv/rmc_comm.conf 644 root sys f none platform/sun4u/kernel/drv/rmcadm.conf 644 root sys @@ -432,7 +431,6 @@ f none platform/sun4u/kernel/drv/sparcv9/bbc_beep 755 root sys f none platform/sun4u/kernel/drv/sparcv9/ctsmc 755 root sys f none platform/sun4u/kernel/drv/sparcv9/db21554 755 root sys f none platform/sun4u/kernel/drv/sparcv9/dma 755 root sys -f none platform/sun4u/kernel/drv/sparcv9/dmfe 755 root sys f none platform/sun4u/kernel/drv/sparcv9/ebus 755 root sys f none platform/sun4u/kernel/drv/sparcv9/epic 755 root sys f none platform/sun4u/kernel/drv/sparcv9/fd 755 root sys diff --git a/usr/src/pkgdefs/SUNWdmfe/Makefile b/usr/src/pkgdefs/SUNWdmfe/Makefile new file mode 100644 index 0000000000..f7155fcc1c --- /dev/null +++ b/usr/src/pkgdefs/SUNWdmfe/Makefile @@ -0,0 +1,37 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +include ../Makefile.com + +DATAFILES += depend + +.KEEP_STATE: + +all: $(FILES) postinstall postremove +install: all pkg + +include ../Makefile.targ diff --git a/usr/src/pkgdefs/SUNWdmfe/pkginfo.tmpl b/usr/src/pkgdefs/SUNWdmfe/pkginfo.tmpl new file mode 100644 index 0000000000..c9447ed230 --- /dev/null +++ b/usr/src/pkgdefs/SUNWdmfe/pkginfo.tmpl @@ -0,0 +1,47 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +PKG=SUNWdmfe +NAME=Davicom 9102 Fast Ethernet Driver +ARCH="ISA" +VERSION="ONVERS,REV=0.0.0" +SUNW_PRODNAME="SunOS" +SUNW_PRODVERS="RELEASE/VERSION" +SUNW_PKGVERS="1.0" +SUNW_PKGTYPE="root" +MAXINST="1000" +CATEGORY=system +VENDOR="Sun Microsystems, Inc." +DESC="Davicom 9102 Fast Ethernet Network Adapter Driver" +CLASSES="none preserve" +HOTLINE="Please contact your local service provider" +EMAIL="" +BASEDIR=/ +SUNW_PKG_ALLZONES="true" +SUNW_PKG_HOLLOW="true" +SUNW_PKG_THISZONE="false" diff --git a/usr/src/pkgdefs/SUNWdmfe/postinstall b/usr/src/pkgdefs/SUNWdmfe/postinstall new file mode 100644 index 0000000000..36444495a2 --- /dev/null +++ b/usr/src/pkgdefs/SUNWdmfe/postinstall @@ -0,0 +1,148 @@ +#!/sbin/sh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# Function: check_add_drv() +# +# This function will check if the module has an entry in etc/name_to_major +# If not simply calls add_drv with the arguments given. If there is +# such an entry in name_to_major file, it adds entries in driver_aliases +# driver_classes and minor_perm if necessary. +# The syntax of this function is the same as add_drv. + +check_add_drv() +{ + if [ "$BASEDIR" = "" ] + then + BASEDIR=/ + fi + alias="" + class="" + ADD_ALIAS=0 + ADD_CLASS=0 + ADD_MINOR=0 + OPTIND=1 + IS_NET_DRIVER=0 + + cmd="add_drv" + + NO_CMD= + while getopts i:b:m:c:N opt + do + case $opt in + N ) NO_CMD=1;; + i ) ADD_ALIAS=1 + alias=$OPTARG + cmd=$cmd" -i '$alias'" + ;; + m ) ADD_MINOR=1 + minor=$OPTARG + cmd=$cmd" -m '$minor'" + ;; + c) ADD_CLASS=1 + class=$OPTARG + cmd=$cmd" -c $class" + ;; + b) BASEDIR=$OPTARG + cmd=$cmd" -b $BASEDIR" + ;; + \?) echo "check_add_drv can not handle this option" + return + ;; + esac + done + shift `/usr/bin/expr $OPTIND - 1` + + drvname=$1 + + cmd=$cmd" "$drvname + + drvname=`echo $drvname | /usr/bin/sed 's;.*/;;g'` + + /usr/bin/grep "^$drvname[ ]" $BASEDIR/etc/name_to_major > /dev/null 2>&1 + + # + # NB: We really would have liked to use update_drv here, but + # since we can't do that (see CR 6281386), we have this code. + # Note that if we've never added this driver before, the add_drv + # below takes care of worrying about conflicting entries in + # /etc/driver_aliases. (It will fail if there is a conflicting + # driver squatting on the alias.) + # + if [ "$NO_CMD" = "" -a $? -ne 0 ] + then + eval $cmd + else + # entry already in name_to_major, add alias, class, minorperm + # if necessary + if [ $ADD_ALIAS = 1 ] + then + for i in $alias + do + /usr/bin/egrep "^$drvname[ ]+$i" $BASEDIR/etc/driver_aliases>/dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "$drvname $i" >> $BASEDIR/etc/driver_aliases + fi + done + fi + + if [ $ADD_CLASS = 1 ] + then + /usr/bin/egrep "^$drvname[ ]+$class( | |$)" $BASEDIR/etc/driver_classes > /dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "$drvname\t$class" >> $BASEDIR/etc/driver_classes + fi + fi + + if [ $ADD_MINOR = 1 ] + then + /usr/bin/grep "^$drvname:" $BASEDIR/etc/minor_perm > /dev/null 2>&1 + if [ $? -ne 0 ] + then + minorentry="$drvname:$minor" + echo $minorentry >> $BASEDIR/etc/minor_perm + fi + fi + + fi + + +} + +# +# Okay, so 128h is not a legal PCI vendor id. But apparently some SPARC +# firmware creates the node with this id. Not sure why, possibly it is +# a firmware bug, possibly it was intended to prevent the driver from +# being used with 3rd party NICs. Whatever the reason, it isn't relevant +# anymore, but we still have to support the old node. +# +check_add_drv \ + -b "$BASEDIR" \ + -i '"pci128h,9102" "pci108e,9102" "pci1282,9102"' \ + dmfe diff --git a/usr/src/pkgdefs/SUNWdmfe/postremove b/usr/src/pkgdefs/SUNWdmfe/postremove new file mode 100644 index 0000000000..0f5982b2ec --- /dev/null +++ b/usr/src/pkgdefs/SUNWdmfe/postremove @@ -0,0 +1,38 @@ +#!/sbin/sh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +BD=${BASEDIR:-/} +if grep -w dmfe $BD/etc/name_to_major > /dev/null 2>&1 +then + rem_drv -b ${BD} dmfe + if [ $? -ne 0 ] + then + exit 1 + fi +fi +exit 0 diff --git a/usr/src/pkgdefs/SUNWdmfe/prototype_com b/usr/src/pkgdefs/SUNWdmfe/prototype_com new file mode 100644 index 0000000000..f8f3ce0ed6 --- /dev/null +++ b/usr/src/pkgdefs/SUNWdmfe/prototype_com @@ -0,0 +1,50 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# This required package information file contains a list of package contents. +# The 'pkgmk' command uses this file to identify the contents of a package +# and their location on the development machine when building the package. +# Can be created via a text editor or through use of the 'pkgproto' command. + +#!search <pathname pathname ...> # where to find pkg objects +#!include <filename> # include another 'prototype' file +#!default <mode> <owner> <group> # default used if not specified on entry +#!<param>=<value> # puts parameter in pkg environment + +# +# +i pkginfo +i copyright +i depend +i postinstall +i postremove + +# Davicom 9102 Fast Ethernet driver +d none kernel 0755 root sys +d none kernel/drv 0755 root sys +f none kernel/drv/dmfe.conf 0644 root sys diff --git a/usr/src/pkgdefs/SUNWdmfe/prototype_i386 b/usr/src/pkgdefs/SUNWdmfe/prototype_i386 new file mode 100644 index 0000000000..630c847257 --- /dev/null +++ b/usr/src/pkgdefs/SUNWdmfe/prototype_i386 @@ -0,0 +1,49 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# This required package information file contains a list of package contents. +# The 'pkgmk' command uses this file to identify the contents of a package +# and their location on the development machine when building the package. +# Can be created via a text editor or through use of the 'pkgproto' command. + +#!search <pathname pathname ...> # where to find pkg objects +#!include <filename> # include another 'prototype' file +#!default <mode> <owner> <group> # default used if not specified on entry +#!<param>=<value> # puts parameter in pkg environment + +# +# Include ISA independent files (prototype_com) +# +!include prototype_com +# +# + +# Davicom 9102 Fast Ethernet driver +f none kernel/drv/dmfe 0755 root sys +d none kernel/drv/amd64 0755 root sys +f none kernel/drv/amd64/dmfe 0755 root sys diff --git a/usr/src/pkgdefs/SUNWdmfe/prototype_sparc b/usr/src/pkgdefs/SUNWdmfe/prototype_sparc new file mode 100644 index 0000000000..21b69acb18 --- /dev/null +++ b/usr/src/pkgdefs/SUNWdmfe/prototype_sparc @@ -0,0 +1,48 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# This required package information file contains a list of package contents. +# The 'pkgmk' command uses this file to identify the contents of a package +# and their location on the development machine when building the package. +# Can be created via a text editor or through use of the 'pkgproto' command. + +#!search <pathname pathname ...> # where to find pkg objects +#!include <filename> # include another 'prototype' file +#!default <mode> <owner> <group> # default used if not specified on entry +#!<param>=<value> # puts parameter in pkg environment + +# +# Include ISA independent files (prototype_com) +# +!include prototype_com +# +# + +# Davicom 9102 Fast Ethernet driver +d none kernel/drv/sparcv9 0755 root sys +f none kernel/drv/sparcv9/dmfe 0755 root sys diff --git a/usr/src/pkgdefs/SUNWhea/prototype_sparc b/usr/src/pkgdefs/SUNWhea/prototype_sparc index c4b1b43779..1cabdb3d84 100644 --- a/usr/src/pkgdefs/SUNWhea/prototype_sparc +++ b/usr/src/pkgdefs/SUNWhea/prototype_sparc @@ -70,8 +70,6 @@ d none usr/include/sys/dktp 755 root bin f none usr/include/sys/dktp/dadkio.h 644 root bin f none usr/include/sys/dktp/fdisk.h 644 root bin f none usr/include/sys/dmaga.h 644 root bin -f none usr/include/sys/dmfe.h 644 root bin -f none usr/include/sys/dmfe_impl.h 644 root bin f none usr/include/sys/eri.h 644 root bin f none usr/include/sys/eri_common.h 644 root bin f none usr/include/sys/eri_mac.h 644 root bin diff --git a/usr/src/pkgdefs/common_files/i.devpolicy b/usr/src/pkgdefs/common_files/i.devpolicy index d0f6485407..cdba4b66ae 100644 --- a/usr/src/pkgdefs/common_files/i.devpolicy +++ b/usr/src/pkgdefs/common_files/i.devpolicy @@ -73,7 +73,7 @@ do done # potential deletions - deletions="elx dld" + deletions="elx dld le" for dev in $deletions do diff --git a/usr/src/pkgdefs/common_files/i.minorperm_i386 b/usr/src/pkgdefs/common_files/i.minorperm_i386 index 2be3fef034..c7bafd374c 100644 --- a/usr/src/pkgdefs/common_files/i.minorperm_i386 +++ b/usr/src/pkgdefs/common_files/i.minorperm_i386 @@ -119,6 +119,9 @@ clone:pcan 0600 root sys 0666 root sys /dev/pcan clone:ral 0600 root sys 0666 root sys /dev/ral clone:rtw 0600 root sys 0666 root sys /dev/rtw clone:wpi 0600 root sys 0666 root sys /dev/wpi +clone:afe 0600 root sys 0666 root sys /dev/afe +clone:dmfe 0600 root sys 0666 root sys /dev/dmfe +clone:mxfe 0600 root sys 0666 root sys /dev/mxfe bge:* 0600 root sys 0666 root sys /dev/bge* rge:* 0600 root sys 0666 root sys /dev/rge* xge:* 0600 root sys 0666 root sys /dev/xge* @@ -135,6 +138,9 @@ pcan:* 0600 root sys 0666 root sys /dev/pcan* ral:* 0600 root sys 0666 root sys /dev/ral* rtw:* 0600 root sys 0666 root sys /dev/rtw* wpi:* 0600 root sys 0666 root sys /dev/wpi* +afe:* 0600 root sys 0666 root sys /dev/afe* +dmfe:* 0600 root sys 0666 root sys /dev/dmfe* +mxfe:* 0600 root sys 0666 root sys /dev/mxfe* EOF } @@ -268,6 +274,9 @@ clone:pcan clone:ral clone:rtw clone:wpi +clone:afe +clone:dmfe +clone:mxfe bge:* rge:* xge:* @@ -284,6 +293,9 @@ pcan:* ral:* rtw:* wpi:* +afe:* +dmfe:* +mxfe:* bmc:bmc dld:* aggr:* diff --git a/usr/src/pkgdefs/common_files/i.minorperm_sparc b/usr/src/pkgdefs/common_files/i.minorperm_sparc index d5f665f930..4a00d39f27 100644 --- a/usr/src/pkgdefs/common_files/i.minorperm_sparc +++ b/usr/src/pkgdefs/common_files/i.minorperm_sparc @@ -93,7 +93,6 @@ clone:ce 0600 root sys 0666 root sys /dev/ce clone:eri 0600 root sys 0666 root sys /dev/eri clone:ge 0600 root sys 0666 root sys /dev/ge clone:hme 0600 root sys 0666 root sys /dev/hme -clone:le 0600 root sys 0666 root sys /dev/le clone:qfe 0600 root sys 0666 root sys /dev/qfe clone:bge 0600 root sys 0666 root sys /dev/bge clone:rge 0600 root sys 0666 root sys /dev/rge @@ -104,7 +103,10 @@ clone:chxge 0600 root sys 0666 root sys /dev/chxge clone:vsw 0600 root sys 0666 root sys /dev/vsw clone:vnet 0600 root sys 0666 root sys /dev/vnet clone:pcwl 0600 root sys 0666 root sys /dev/pcwl -clone:pcan 0600 root sys 0666 root sys /dev/pcan +clone:pcan 0600 root sys 0666 root sys /dev/pcan +clone:afe 0600 root sys 0666 root sys /dev/afe +clone:mxfe 0600 root sys 0666 root sys /dev/mxfe +clone:rtls 0600 root sys 0666 root sys /dev/rtls bge:* 0600 root sys 0666 root sys /dev/bge* rge:* 0600 root sys 0666 root sys /dev/rge* xge:* 0600 root sys 0666 root sys /dev/xge* @@ -119,6 +121,9 @@ clone:dmfe 0600 root sys 0666 root sys /dev/dmfe dmfe:* 0600 root sys 0666 root sys /dev/dmfe* clone:pcelx 0600 root sys 0666 root sys /dev/pcelx pcelx:* 0600 root sys 0666 root sys /dev/pcelx* +afe:* 0600 root sys 0666 root sys /dev/afe* +mxfe:* 0600 root sys 0666 root sys /dev/mxfe* +rtls:* 0600 root sys 0666 root sys /dev/rtls* ipf:* 0600 root sys 0666 root sys /dev/ipf pfil:* 0600 root sys 0666 root sys /dev/pfil scsi_vhci:devctl 0600 root sys 0666 root sys /devices/scsi_vhci:devctl @@ -172,6 +177,7 @@ clone:rts clone:ipsecah clone:ipsecesp clone:keysock +clone:le su:* profile:profile clone:qe @@ -197,7 +203,6 @@ EOF make_add_list() { cat > /tmp/add.$$ << EOF -clone:le clone:llc1 stc:* mcpzsa:* @@ -278,6 +283,9 @@ clone:vsw clone:vnet clone:pcwl clone:pcan +clone:afe +clone:mxfe +clone:rtls bge:* rge:* xge:* @@ -288,6 +296,9 @@ vsw:* vnet:* pcwl:* pcan:* +afe:* +mxfe:* +rtls:* clone:dmfe dmfe:* clone:pcelx diff --git a/usr/src/tools/scripts/bfu.sh b/usr/src/tools/scripts/bfu.sh index cb2bbca528..3738a89d7a 100644 --- a/usr/src/tools/scripts/bfu.sh +++ b/usr/src/tools/scripts/bfu.sh @@ -6436,6 +6436,13 @@ mondo_loop() { fi # + # Remove platform specific dmfe driver ... its common now + if [ $target_isa = sparc ]; then + rm -f $root/platform/sun4u/kernel/drv/sparcv9/dmfe + rm -f $root/platform/sun4u/kernel/drv/dmfe.conf + fi + + # # Diskless clients have already extracted /usr so don't delete this # Non-global zones never extracts /usr so don't delete these # @@ -6709,6 +6716,8 @@ mondo_loop() { rm -f $root/usr/include/sys/dktp/sctarget.h rm -f $root/usr/include/sys/dktp/tgcd.h rm -f $root/usr/include/sys/dktp/tgpassthru.h + rm -f $root/usr/include/sys/dmfe.h + rm -f $root/usr/include/sys/dmfe_impl.h # # Remove Floating Point Emulator for EOF as per PSARC/2003/651 @@ -7277,7 +7286,6 @@ mondo_loop() { clone:eri eri clone:ge ge clone:hme hme - clone:le le clone:qfe qfe clone:bge bge bge:* bge* @@ -7293,6 +7301,12 @@ mondo_loop() { iprb:* iprb* clone:spwr spwr spwr:* spwr* + clone:afe afe + afe:* afe* + clone:mxfe mxfe + mxfe:* mxfe* + clone:rtls rtls + rtls:* rtls* EOF if [ $target_isa = i386 ] && [[ $rootslice = /dev/rdsk/* || \ diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files index 3b40c9279e..be3b4128f4 100644 --- a/usr/src/uts/common/Makefile.files +++ b/usr/src/uts/common/Makefile.files @@ -1342,6 +1342,8 @@ AFE_OBJS += afe.o BGE_OBJS += bge_main2.o bge_chip2.o bge_kstats.o bge_log.o bge_ndd.o \ bge_atomic.o bge_mii.o bge_send.o bge_recv2.o +DMFE_OBJS += dmfe_log.o dmfe_main.o dmfe_mii.o dmfe_ndd.o + IXGB_OBJS += ixgb.o ixgb_atomic.o ixgb_chip.o ixgb_gld.o ixgb_kstats.o \ ixgb_log.o ixgb_ndd.o ixgb_rx.o ixgb_tx.o ixgb_xmii.o diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules index 32c06e1d4e..d1bdc761b4 100644 --- a/usr/src/uts/common/Makefile.rules +++ b/usr/src/uts/common/Makefile.rules @@ -487,6 +487,10 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/dls/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) +$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/dmfe/%.c + $(COMPILE.c) -o $@ $< + $(CTFCONVERT_O) + $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/drm/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) @@ -1330,6 +1334,9 @@ $(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/dld/%.c $(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/dls/%.c @($(LHEAD) $(LINT.c) $< $(LTAIL)) +$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/dmfe/%.c + @($(LHEAD) $(LINT.c) $< $(LTAIL)) + $(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/drm/%.c @($(LHEAD) $(LINT.c) $< $(LTAIL)) diff --git a/usr/src/uts/sun4u/io/dmfe/dmfe.conf b/usr/src/uts/common/io/dmfe/dmfe.conf index 56f847ff94..56f847ff94 100644 --- a/usr/src/uts/sun4u/io/dmfe/dmfe.conf +++ b/usr/src/uts/common/io/dmfe/dmfe.conf diff --git a/usr/src/uts/sun4u/sys/dmfe.h b/usr/src/uts/common/io/dmfe/dmfe.h index 615a3e23e2..c208046848 100644 --- a/usr/src/uts/sun4u/sys/dmfe.h +++ b/usr/src/uts/common/io/dmfe/dmfe.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -290,6 +289,8 @@ struct tx_desc_type { #define WRITE_OP 0x00002000UL #define READ_OP 0x00004000UL #define SER_15_MB1 0x00008000UL +#define READ_EEPROM (READ_OP | SEL_EEPROM) +#define READ_EEPROM_CS (READ_OP | SEL_EEPROM | SEL_CHIP) #define MII_CLOCK 0x00010000UL #define MII_DATA_OUT 0x00020000UL @@ -350,8 +351,12 @@ struct tx_desc_type { /* SROM access definitions */ -#define HIGH_ADDRESS_BIT 0x00000020UL +#define HIGH_ADDRESS_BIT 0x20 /* 6 bits */ +#define HIGH_CMD_BIT 0x4 /* 3 bits */ +#define HIGH_DATA_BIT 0x8000 /* 16 bits */ #define SROM_DELAY 5 /* 5 microseconds */ +#define EEPROM_READ_CMD 6 +#define EEPROM_EN_ADDR 20 /* MII access definitions */ #define MII_REG_ADDR_SHIFT 18 diff --git a/usr/src/uts/sun4u/sys/dmfe_impl.h b/usr/src/uts/common/io/dmfe/dmfe_impl.h index 2699b9dc51..6792f540bd 100644 --- a/usr/src/uts/sun4u/sys/dmfe_impl.h +++ b/usr/src/uts/common/io/dmfe/dmfe_impl.h @@ -56,9 +56,9 @@ extern "C" { #include <sys/sunddi.h> #include <sys/miiregs.h> -#include <sys/dmfe.h> #include <sys/mac.h> #include <sys/mac_ether.h> +#include "dmfe.h" #define DMFE_MAX_PKT_SIZE (VLAN_TAGSZ + ETHERMAX + ETHERFCSL) @@ -114,6 +114,7 @@ typedef struct { uint32_t ndp_max; uint32_t ndp_val; char *ndp_name; + struct dmfe *ndp_dmfe; } nd_param_t; /* @@ -228,7 +229,7 @@ enum ioc_reply { /* * Per-instance soft-state structure */ -typedef struct { +typedef struct dmfe { /* * These fields are set by attach() and unchanged thereafter ... */ @@ -359,6 +360,7 @@ typedef struct { uint32_t imask; /* interrupt mask shadow */ enum mac_state mac_state; /* RESET/STOPPED/STARTED */ enum chip_state chip_state; /* see above */ + boolean_t link_reset; /* ndd needs link reset */ /* * Physical link state data (protected by oplock) @@ -507,7 +509,7 @@ typedef struct { /* * Bit test macros, returning boolean_t values */ -#define BIS(w, b) ((w) & (b)) +#define BIS(w, b) (((w) & (b)) != 0) #define BIC(w, b) !BIS(w, b) #define DMFE_GUARD 0x1919603003090218 @@ -611,6 +613,7 @@ uint32_t dmfe_chip_get32(dmfe_t *dmfep, off_t offset); void dmfe_chip_put32(dmfe_t *dmfep, off_t offset, uint32_t value); /* dmfe_mii.c */ +void dmfe_read_eeprom(dmfe_t *dmfep, uint16_t addr, uint8_t *ptr, int cnt); boolean_t dmfe_init_phy(dmfe_t *dmfep); void dmfe_update_phy(dmfe_t *dmfep); boolean_t dmfe_check_link(dmfe_t *dmfep); diff --git a/usr/src/uts/sun4u/io/dmfe/dmfe_log.c b/usr/src/uts/common/io/dmfe/dmfe_log.c index 3f58805c35..1e14543fad 100644 --- a/usr/src/uts/sun4u/io/dmfe/dmfe_log.c +++ b/usr/src/uts/common/io/dmfe/dmfe_log.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,13 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 1994-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" -#include <sys/dmfe_impl.h> +#include "dmfe_impl.h" /* diff --git a/usr/src/uts/sun4u/io/dmfe/dmfe_main.c b/usr/src/uts/common/io/dmfe/dmfe_main.c index cd3d27b86b..74ef877524 100644 --- a/usr/src/uts/sun4u/io/dmfe/dmfe_main.c +++ b/usr/src/uts/common/io/dmfe/dmfe_main.c @@ -27,7 +27,7 @@ #include <sys/types.h> #include <sys/sunddi.h> -#include <sys/dmfe_impl.h> +#include "dmfe_impl.h" /* * This is the string displayed by modinfo, etc. @@ -115,15 +115,15 @@ static uint32_t dmfe_setup_desc1 = TX_SETUP_PACKET | SETUPBUF_SIZE | /* * Some tunable parameters ... - * Number of RX/TX ring entries (32/32) + * Number of RX/TX ring entries (128/128) * Minimum number of TX ring slots to keep free (1) * Low-water mark at which to try to reclaim TX ring slots (1) * How often to take a TX-done interrupt (twice per ring cycle) * Whether to reclaim TX ring entries on a TX-done interrupt (no) */ -#define DMFE_TX_DESC 32 /* Should be a multiple of 4 <= 256 */ -#define DMFE_RX_DESC 32 /* Should be a multiple of 4 <= 256 */ +#define DMFE_TX_DESC 128 /* Should be a multiple of 4 <= 256 */ +#define DMFE_RX_DESC 128 /* Should be a multiple of 4 <= 256 */ static uint32_t dmfe_rx_desc = DMFE_RX_DESC; static uint32_t dmfe_tx_desc = DMFE_TX_DESC; @@ -546,8 +546,7 @@ dmfe_enable_interrupts(dmfe_t *dmfep) * Put 'the standard set of interrupts' in the interrupt mask register */ dmfep->imask = RX_PKTDONE_INT | TX_PKTDONE_INT | - RX_STOPPED_INT | TX_STOPPED_INT | - RX_UNAVAIL_INT | SYSTEM_ERR_INT; + RX_STOPPED_INT | TX_STOPPED_INT | RX_UNAVAIL_INT | SYSTEM_ERR_INT; dmfe_chip_put32(dmfep, INT_MASK_REG, NORMAL_SUMMARY_INT | ABNORMAL_SUMMARY_INT | dmfep->imask); @@ -718,7 +717,7 @@ dmfe_getp(dmfe_t *dmfep) * discard these here so they don't get sent upstream ...) */ (void) ddi_dma_sync(dmfep->rx_buff.dma_hdl, - index*DMFE_BUF_SIZE, DMFE_BUF_SIZE, + index * DMFE_BUF_SIZE, DMFE_BUF_SIZE, DDI_DMA_SYNC_FORKERNEL); rxb = &dmfep->rx_buff.mem_va[index*DMFE_BUF_SIZE]; @@ -961,7 +960,6 @@ dmfe_reclaim_tx_desc(dmfe_t *dmfep) dma_area_t *descp; uint32_t desc0; uint32_t desc1; - int nfree; int i; ASSERT(mutex_owned(dmfep->txlock)); @@ -972,20 +970,6 @@ dmfe_reclaim_tx_desc(dmfe_t *dmfep) descp = &dmfep->tx_desc; DMA_SYNC(descp, DDI_DMA_SYNC_FORKERNEL); -#if DMFEDEBUG - /* - * check that we own all descriptors from next_free to next_used-1 - */ - nfree = 0; - i = dmfep->tx.next_free; - do { - ASSERT((dmfe_ring_get32(descp, i, DESC0) & TX_OWN) == 0); - nfree += 1; - i = NEXT(i, dmfep->tx.n_desc); - } while (i != dmfep->tx.next_busy); - ASSERT(nfree == dmfep->tx.n_free); -#endif /* DMFEDEBUG */ - /* * Early exit if there are no descriptors to reclaim, either * because they're all reclaimed already, or because the next @@ -1196,9 +1180,7 @@ dmfe_send_msg(dmfe_t *dmfep, mblk_t *mp) desc1 = TX_FIRST_DESC | TX_LAST_DESC | totlen; (void) ddi_dma_sync(dmfep->tx_buff.dma_hdl, - index*DMFE_BUF_SIZE, DMFE_BUF_SIZE, - DDI_DMA_SYNC_FORDEV); - + index * DMFE_BUF_SIZE, DMFE_BUF_SIZE, DDI_DMA_SYNC_FORDEV); } /* @@ -2085,8 +2067,7 @@ dmfe_interrupt(caddr_t arg) * they weren't Abnormal?), but we'll check just * in case ... */ - DMFE_DEBUG(("unexpected interrupt bits: 0x%x", - istat)); + DMFE_DEBUG(("unexpected interrupt bits: 0x%x", istat)); } } @@ -2620,6 +2601,9 @@ dmfe_find_mac_address(dmfe_t *dmfep) * We have to find the "vendor's factory-set address". This is * the value of the property "local-mac-address", as set by OBP * (or a .conf file!) + * + * If the property is not there, then we try to find the factory + * mac address from the devices serial EEPROM. */ bzero(dmfep->curr_addr, sizeof (dmfep->curr_addr)); err = ddi_prop_lookup_byte_array(DDI_DEV_T_ANY, dmfep->devinfo, @@ -2628,6 +2612,10 @@ dmfe_find_mac_address(dmfe_t *dmfep) if (propsize == ETHERADDRL) ethaddr_copy(prop, dmfep->curr_addr); ddi_prop_free(prop); + } else { + /* no property set... check eeprom */ + dmfe_read_eeprom(dmfep, EEPROM_EN_ADDR, dmfep->curr_addr, + ETHERADDRL); } DMFE_DEBUG(("dmfe_setup_mac_address: factory %s", @@ -2696,7 +2684,7 @@ dmfe_alloc_bufs(dmfe_t *dmfep) /* * Allocate memory & handles for TX descriptor ring */ - memsize = dmfep->tx.n_desc*sizeof (struct tx_desc_type); + memsize = dmfep->tx.n_desc * sizeof (struct tx_desc_type); err = dmfe_alloc_dma_mem(dmfep, memsize, SETUPBUF_SIZE, DMFE_SLOP, &dmfe_reg_accattr, DDI_DMA_RDWR | DDI_DMA_CONSISTENT, &dmfep->tx_desc); @@ -2706,8 +2694,8 @@ dmfe_alloc_bufs(dmfe_t *dmfep) /* * Allocate memory & handles for TX buffers */ - memsize = dmfep->tx.n_desc*DMFE_BUF_SIZE, - err = dmfe_alloc_dma_mem(dmfep, memsize, 0, 0, + memsize = dmfep->tx.n_desc * DMFE_BUF_SIZE; + err = dmfe_alloc_dma_mem(dmfep, memsize, 0, 0, &dmfe_data_accattr, DDI_DMA_WRITE | DMFE_DMA_MODE, &dmfep->tx_buff); if (err != DDI_SUCCESS) @@ -2716,7 +2704,7 @@ dmfe_alloc_bufs(dmfe_t *dmfep) /* * Allocate memory & handles for RX descriptor ring */ - memsize = dmfep->rx.n_desc*sizeof (struct rx_desc_type); + memsize = dmfep->rx.n_desc * sizeof (struct rx_desc_type); err = dmfe_alloc_dma_mem(dmfep, memsize, 0, DMFE_SLOP, &dmfe_reg_accattr, DDI_DMA_RDWR | DDI_DMA_CONSISTENT, &dmfep->rx_desc); @@ -2726,10 +2714,9 @@ dmfe_alloc_bufs(dmfe_t *dmfep) /* * Allocate memory & handles for RX buffers */ - memsize = dmfep->rx.n_desc*DMFE_BUF_SIZE, - err = dmfe_alloc_dma_mem(dmfep, memsize, 0, 0, - &dmfe_data_accattr, DDI_DMA_READ | DMFE_DMA_MODE, - &dmfep->rx_buff); + memsize = dmfep->rx.n_desc * DMFE_BUF_SIZE; + err = dmfe_alloc_dma_mem(dmfep, memsize, 0, 0, + &dmfe_data_accattr, DDI_DMA_READ | DMFE_DMA_MODE, &dmfep->rx_buff); if (err != DDI_SUCCESS) return (DDI_FAILURE); @@ -2978,7 +2965,6 @@ dmfe_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd) dmfep->cycid = NULL; (void) snprintf(dmfep->ifname, sizeof (dmfep->ifname), "dmfe%d", instance); - dmfe_find_mac_address(dmfep); /* * Check for custom "opmode-reg-value" property; @@ -3018,6 +3004,11 @@ dmfe_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd) dmfep->progress |= PROGRESS_REGS; /* + * Get our MAC address. + */ + dmfe_find_mac_address(dmfep); + + /* * Allocate the TX and RX descriptors/buffers. */ dmfep->tx.n_desc = dmfe_tx_desc; diff --git a/usr/src/uts/sun4u/io/dmfe/dmfe_mii.c b/usr/src/uts/common/io/dmfe/dmfe_mii.c index 91651bec47..d63dfd291c 100644 --- a/usr/src/uts/sun4u/io/dmfe/dmfe_mii.c +++ b/usr/src/uts/common/io/dmfe/dmfe_mii.c @@ -25,7 +25,7 @@ #pragma ident "%Z%%M% %I% %E% SMI" -#include <sys/dmfe_impl.h> +#include "dmfe_impl.h" /* * The bit-twiddling required by the MII interface makes the functions @@ -82,6 +82,104 @@ enum xcvr_type { }; /* + * ======== Low-level SROM access ======== + */ + +/* + * EEPROM access is here because it shares register functionality with MII. + * NB: <romaddr> is a byte address but must be 16-bit aligned. + * <cnt> is a byte count, and must be a multiple of 2. + */ +void +dmfe_read_eeprom(dmfe_t *dmfep, uint16_t raddr, uint8_t *ptr, int cnt) +{ + uint16_t value; + uint16_t bit; + + /* only a whole number of words for now */ + ASSERT((cnt % 2) == 0); + ASSERT((raddr % 2) == 0); + ASSERT(cnt > 0); + ASSERT(((raddr + cnt) / 2) < (HIGH_ADDRESS_BIT << 1)); + + raddr /= 2; /* make it a word address */ + + /* loop over multiple words... rom access in 16-bit increments */ + while (cnt > 0) { + + /* select the eeprom */ + dmfe_chip_put32(dmfep, ETHER_ROM_REG, READ_EEPROM); + drv_usecwait(1); + dmfe_chip_put32(dmfep, ETHER_ROM_REG, READ_EEPROM_CS); + drv_usecwait(1); + dmfe_chip_put32(dmfep, ETHER_ROM_REG, READ_EEPROM_CS | SEL_CLK); + drv_usecwait(1); + dmfe_chip_put32(dmfep, ETHER_ROM_REG, READ_EEPROM_CS); + drv_usecwait(1); + + /* send 3 bit read command */ + for (bit = HIGH_CMD_BIT; bit != 0; bit >>= 1) { + + value = (bit & EEPROM_READ_CMD) ? DATA_IN : 0; + + /* strobe the bit in */ + dmfe_chip_put32(dmfep, ETHER_ROM_REG, + READ_EEPROM_CS | value); + drv_usecwait(1); + dmfe_chip_put32(dmfep, ETHER_ROM_REG, + READ_EEPROM_CS | SEL_CLK | value); + drv_usecwait(1); + dmfe_chip_put32(dmfep, ETHER_ROM_REG, + READ_EEPROM_CS | value); + drv_usecwait(1); + } + + /* send 6 bit address */ + for (bit = HIGH_ADDRESS_BIT; bit != 0; bit >>= 1) { + value = (bit & raddr) ? DATA_IN : 0; + + /* strobe the bit in */ + dmfe_chip_put32(dmfep, ETHER_ROM_REG, + READ_EEPROM_CS | value); + drv_usecwait(1); + dmfe_chip_put32(dmfep, ETHER_ROM_REG, + READ_EEPROM_CS | SEL_CLK | value); + drv_usecwait(1); + dmfe_chip_put32(dmfep, ETHER_ROM_REG, + READ_EEPROM_CS | value); + drv_usecwait(1); + } + + /* shift out data */ + value = 0; + for (bit = HIGH_DATA_BIT; bit != 0; bit >>= 1) { + + dmfe_chip_put32(dmfep, ETHER_ROM_REG, + READ_EEPROM_CS | SEL_CLK); + drv_usecwait(1); + + if (dmfe_chip_get32(dmfep, ETHER_ROM_REG) & DATA_OUT) + value |= bit; + drv_usecwait(1); + + dmfe_chip_put32(dmfep, ETHER_ROM_REG, READ_EEPROM_CS); + drv_usecwait(1); + } + + /* turn off EEPROM access */ + dmfe_chip_put32(dmfep, ETHER_ROM_REG, READ_EEPROM); + drv_usecwait(1); + + /* this makes it endian neutral */ + *ptr++ = value & 0xff; + *ptr++ = (value >> 8); + + cnt -= 2; + raddr++; + } +} + +/* * ======== Lowest-level bit-twiddling to drive MII interface ======== */ @@ -118,7 +216,7 @@ dmfe_poke_mii(dmfe_t *dmfep, uint32_t mii_data, uint_t nbits) } dmfe_chip_put32(dmfep, ETHER_ROM_REG, - MII_WRITE | dbit); /* Clock Low */ + MII_WRITE | dbit); /* Clock Low */ drv_usecwait(MII_DELAY); } @@ -270,7 +368,7 @@ dmfe_probe_phy(dmfe_t *dmfep) bmsr = dmfe_mii_status(dmfep); DMFE_DEBUG(("dmfe_probe_phy($%p, %d) BMSR 0x%x", - (void *)dmfep, dmfep->phy_addr, bmsr)); + (void *)dmfep, dmfep->phy_addr, bmsr)); /* * At least one bit in BMSR should be set (for the device @@ -342,9 +440,9 @@ dmfe_update_phy(dmfe_t *dmfep) uint16_t anar; DMFE_DEBUG(("dmfe_update_phy: autoneg %d 100fdx %d 100hdx %d " - "10fdx %d 10hdx %d", dmfep->param_autoneg, - dmfep->param_anar_100fdx, dmfep->param_anar_100hdx, - dmfep->param_anar_10fdx, dmfep->param_anar_10hdx)); + "10fdx %d 10hdx %d", dmfep->param_autoneg, + dmfep->param_anar_100fdx, dmfep->param_anar_100hdx, + dmfep->param_anar_10fdx, dmfep->param_anar_10hdx)); ASSERT(mutex_owned(dmfep->milock)); @@ -488,7 +586,7 @@ dmfe_check_bmsr(dmfe_t *dmfep) */ new_bmsr = dmfe_mii_status(dmfep); DMFE_DEBUG(("dmfe_check_bmsr: bmsr 0x%x -> 0x%x", - dmfep->phy_bmsr, new_bmsr)); + dmfep->phy_bmsr, new_bmsr)); /* * Record new value and timestamp if it's changed @@ -659,8 +757,8 @@ dmfe_process_bmsr(dmfe_t *dmfep, clock_t time) DRV_KS_SET(dmfep, KS_MIIREG_DSCSR, dmfep->phy_dscsr); DMFE_DEBUG(("dmfe_process_bmsr: ANAR 0x%x->0x%x ANLPAR 0x%x SCSR 0x%x", - dmfep->phy_anar_w, dmfep->phy_anar_r, - dmfep->phy_anlpar, dmfep->phy_dscsr)); + dmfep->phy_anar_w, dmfep->phy_anar_r, + dmfep->phy_anlpar, dmfep->phy_dscsr)); /* * Capabilities of DM9102A @@ -753,7 +851,7 @@ dmfe_process_bmsr(dmfe_t *dmfep, clock_t time) } DMFE_DEBUG(("dmfe_process_bmsr: BMSR 0x%x state %d -> %d @ %d", - dmfep->phy_bmsr, dmfep->link_state, newstate, time)); + dmfep->phy_bmsr, dmfep->link_state, newstate, time)); return (newstate); } diff --git a/usr/src/uts/sun4u/io/dmfe/dmfe_ndd.c b/usr/src/uts/common/io/dmfe/dmfe_ndd.c index 025ff85069..207c0d294a 100644 --- a/usr/src/uts/sun4u/io/dmfe/dmfe_ndd.c +++ b/usr/src/uts/common/io/dmfe/dmfe_ndd.c @@ -25,7 +25,7 @@ #pragma ident "%Z%%M% %I% %E% SMI" -#include <sys/dmfe_impl.h> +#include "dmfe_impl.h" #define DMFE_DBG DMFE_DBG_NDD /* debug flag for this code */ @@ -119,15 +119,15 @@ dmfe_param_get(queue_t *q, mblk_t *mp, caddr_t cp, cred_t *credp) /* * Validates the request to set a DMFE parameter to a specific value. - * If the request is OK, the parameter is set. Also the <info> field - * is incremented to show that the parameter was touched, even though - * it may have been set to the same value it already had. + * If the request is OK, the parameter is set. Also, update the link reset + * to show that a link reset is required if the parameter changed, or for + * magic parameters, that it was touched even if the value did not change. */ static int dmfe_param_set(queue_t *q, mblk_t *mp, char *value, caddr_t cp, cred_t *credp) { nd_param_t *ndp; - size_t new_value; + long new_value; char *end; _NOTE(ARGUNUSED(q, mp, credp)) @@ -136,14 +136,16 @@ dmfe_param_set(queue_t *q, mblk_t *mp, char *value, caddr_t cp, cred_t *credp) if (ndp->ndp_name[0] == '-') return (EACCES); /* shouldn't happen! */ - new_value = mi_strtol(value, &end, 10); - if (end == value) + if (ddi_strtol(value, &end, 10, &new_value) != 0) return (EINVAL); if (new_value < ndp->ndp_min || new_value > ndp->ndp_max) return (EINVAL); + if ((ndp->ndp_name[0] == '*') || + (ndp->ndp_val != new_value)) { + ndp->ndp_dmfe->link_reset = B_TRUE; + } ndp->ndp_val = new_value; - ndp->ndp_info += 1; return (0); } @@ -173,6 +175,7 @@ dmfe_param_register(dmfe_t *dmfep) */ ndp = &dmfep->nd_params[tmplp->ndp_info]; *ndp = *tmplp; + ndp->ndp_dmfe = dmfep; nm = &ndp->ndp_name[0]; setfn = *nm++ == '-' ? NULL : dmfe_param_set; if (!nd_load(nddpp, nm, dmfe_param_get, setfn, (caddr_t)ndp)) @@ -184,7 +187,7 @@ dmfe_param_register(dmfe_t *dmfep) nd_fail: DMFE_DEBUG(("dmfe_param_register: FAILED at index %d [info %d]", - tmplp-nd_template, tmplp->ndp_info)); + tmplp-nd_template, tmplp->ndp_info)); nd_free(nddpp); return (B_FALSE); } @@ -223,10 +226,10 @@ dmfe_nd_init(dmfe_t *dmfep) */ dip = dmfep->devinfo; speed = ddi_prop_get_int(DDI_DEV_T_ANY, dip, - 0, transfer_speed_propname, -1); + 0, transfer_speed_propname, -1); if (speed != -1) { dmfe_log(dmfep, "%s property is %d", - transfer_speed_propname, speed); + transfer_speed_propname, speed); switch (speed) { case 100: dmfep->param_anar_10hdx = 0; @@ -287,9 +290,9 @@ dmfe_nd_init(dmfe_t *dmfep) * parameter will be set to a default value (100Mb/s, half-duplex). */ speed = ddi_prop_get_int(DDI_DEV_T_ANY, dip, - DDI_PROP_DONTPASS, speed_propname, -1); + DDI_PROP_DONTPASS, speed_propname, -1); duplex = ddi_prop_get_int(DDI_DEV_T_ANY, dip, - DDI_PROP_DONTPASS, duplex_propname, -1); + DDI_PROP_DONTPASS, duplex_propname, -1); if (speed != -1 || duplex != -1) { /* force speed */ @@ -300,8 +303,7 @@ dmfe_nd_init(dmfe_t *dmfep) dmfep->param_anar_100T4 = 0; dmfep->param_autoneg = 0; - dmfe_log(dmfep, "%s property is %d", - speed_propname, speed); + dmfe_log(dmfep, "%s property is %d", speed_propname, speed); switch (speed) { case 10: dmfep->param_anar_100hdx = 0; @@ -315,8 +317,7 @@ dmfe_nd_init(dmfe_t *dmfep) break; } - dmfe_log(dmfep, "%s property is %d", - duplex_propname, duplex); + dmfe_log(dmfep, "%s property is %d", duplex_propname, duplex); switch (duplex) { case 1: dmfep->param_anar_10hdx = 0; @@ -337,8 +338,6 @@ dmfe_nd_init(dmfe_t *dmfep) enum ioc_reply dmfe_nd_ioctl(dmfe_t *dmfep, queue_t *wq, mblk_t *mp, int cmd) { - nd_param_t *ndp; - uint32_t info; int ok; switch (cmd) { @@ -379,21 +378,20 @@ dmfe_nd_ioctl(dmfe_t *dmfep, queue_t *wq, mblk_t *mp, int cmd) * didn't touch the magic 'autonegotiation' parameter, * we can just tell our caller to send the prepared reply. * - * If the 'autonegotiation' parameter *was* touched, we - * flag it so the top-level ioctl code knows to update + * If the 'autonegotiation' parameter *was* touched (or any + * of the other link parameters modified), we flag + * it so the top-level ioctl code knows to update * the PHY and restart the chip before replying ... */ - ndp = &dmfep->nd_params[PARAM_ADV_AUTONEG_CAP]; - info = ndp->ndp_info; ok = nd_getset(wq, dmfep->nd_data_p, mp); - DMFE_DEBUG(("dmfe_nd_ioctl: set %s autoneg %d info %d/%d", - ok ? "OK" : "FAIL", ndp->ndp_val, - info, ndp->ndp_info)); + DMFE_DEBUG(("dmfe_nd_ioctl: set %s link_reset %d", + ok ? "OK" : "FAIL", dmfep->link_reset)); if (!ok) return (IOC_INVAL); - if (ndp->ndp_info == info) + if (!dmfep->link_reset) return (IOC_REPLY); + dmfep->link_reset = B_FALSE; return (IOC_RESTART); } } diff --git a/usr/src/uts/intel/Makefile.intel.shared b/usr/src/uts/intel/Makefile.intel.shared index 9881fa7c16..e6f0a4b1ae 100644 --- a/usr/src/uts/intel/Makefile.intel.shared +++ b/usr/src/uts/intel/Makefile.intel.shared @@ -349,6 +349,7 @@ $(CLOSED_BUILD)CLOSED_DRV_KMODS_32 += sbpro # DRV_KMODS += afe +DRV_KMODS += dmfe DRV_KMODS += e1000g DRV_KMODS += mxfe DRV_KMODS += rge diff --git a/usr/src/uts/sun4u/dmfe/Makefile b/usr/src/uts/intel/dmfe/Makefile index db0b6a2f4f..bd6a744af8 100644 --- a/usr/src/uts/sun4u/dmfe/Makefile +++ b/usr/src/uts/intel/dmfe/Makefile @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# uts/sun4u/dmfe/Makefile +# uts/intel/dmfe/Makefile # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -27,8 +27,6 @@ # # This makefile drives the production of the dmfe driver module. # -# sun4u implementation architecture dependent -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -41,13 +39,13 @@ UTSBASE = ../.. MODULE = dmfe OBJECTS = $(DMFE_OBJS:%=$(OBJS_DIR)/%) LINTS = $(DMFE_OBJS:%.o=$(LINTS_DIR)/%.ln) -ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) -CONF_SRCDIR = $(UTSBASE)/sun4u/io/dmfe +ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) +CONF_SRCDIR = $(UTSBASE)/common/io/dmfe # # Include common rules. # -include $(UTSBASE)/sun4u/Makefile.sun4u +include $(UTSBASE)/intel/Makefile.intel # # Define targets @@ -57,14 +55,6 @@ LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # -# Overrides -# -ALL_BUILDS = $(ALL_BUILDSONLY64) -DEF_BUILDS = $(DEF_BUILDSONLY64) -CLEANLINTFILES += $(LINT32_FILES) - - -# # lint pass one enforcement # CFLAGS += $(CCVERBOSE) @@ -107,4 +97,4 @@ install: $(INSTALL_DEPS) # # Include common targets. # -include $(UTSBASE)/sun4u/Makefile.targ +include $(UTSBASE)/intel/Makefile.targ diff --git a/usr/src/uts/intel/os/minor_perm b/usr/src/uts/intel/os/minor_perm index a4cc93f6a3..1182263005 100644 --- a/usr/src/uts/intel/os/minor_perm +++ b/usr/src/uts/intel/os/minor_perm @@ -136,6 +136,9 @@ clone:pcan 0666 root sys clone:ral 0666 root sys clone:rtw 0666 root sys clone:wpi 0666 root sys +clone:dmfe 0666 root sys +clone:afe 0666 root sys +clone:mxfe 0666 root sys bge:* 0666 root sys rge:* 0666 root sys xge:* 0666 root sys @@ -157,3 +160,6 @@ physmem:* 0600 root sys sdp:sdp 0666 root sys battery:* 0666 root sys ucode:* 0644 root sys +dmfe:* 0666 root sys +afe:* 0666 root sys +mxfe:* 0666 root sys diff --git a/usr/src/uts/sparc/Makefile.sparc.shared b/usr/src/uts/sparc/Makefile.sparc.shared index aa386b1e93..389784317a 100644 --- a/usr/src/uts/sparc/Makefile.sparc.shared +++ b/usr/src/uts/sparc/Makefile.sparc.shared @@ -271,7 +271,7 @@ $(CLOSED_BUILD)CLOSED_DRV_KMODS += ixgb # Machine Specific Driver Modules (/kernel/drv): # DRV_KMODS += audio1575 audio810 audiohd audiocs audiots -DRV_KMODS += bge bpp eri esp fas hme qfe +DRV_KMODS += bge bpp dmfe eri esp fas hme qfe DRV_KMODS += openeepr options sd ses st DRV_KMODS += ssd DRV_KMODS += ecpp diff --git a/usr/src/uts/sparc/dmfe/Makefile b/usr/src/uts/sparc/dmfe/Makefile new file mode 100644 index 0000000000..cd3f62467e --- /dev/null +++ b/usr/src/uts/sparc/dmfe/Makefile @@ -0,0 +1,100 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# uts/sparc/dmfe/Makefile +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# This makefile drives the production of the dmfe driver module. +# + +# +# Path to the base of the uts directory tree (usually /usr/src/uts). +# +UTSBASE = ../.. + +# +# Define the module and object file sets. +# +MODULE = dmfe +OBJECTS = $(DMFE_OBJS:%=$(OBJS_DIR)/%) +LINTS = $(DMFE_OBJS:%.o=$(LINTS_DIR)/%.ln) +ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) +CONF_SRCDIR = $(UTSBASE)/common/io/dmfe + +# +# Include common rules. +# +include $(UTSBASE)/sparc/Makefile.sparc + +# +# Define targets +# +ALL_TARGET = $(BINARY) $(SRC_CONFFILE) +LINT_TARGET = $(MODULE).lint +INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) + +# +# lint pass one enforcement +# +CFLAGS += $(CCVERBOSE) + +# +# extra link arguments +# +LDFLAGS += -dy -N misc/mac -N drv/ip + +# +# For now, disable these lint checks; maintainers should endeavor +# to investigate and remove these for maximum lint coverage. +# Please do not carry these forward to new Makefiles. +# +LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV + +# +# Default build targets. +# +.KEEP_STATE: + +def: $(DEF_DEPS) + +all: $(ALL_DEPS) + +clean: $(CLEAN_DEPS) + +clobber: $(CLOBBER_DEPS) + +lint: $(LINT_DEPS) + +modlintlib: $(MODLINTLIB_DEPS) + +clean.lint: $(CLEAN_LINT_DEPS) + +install: $(INSTALL_DEPS) + +# +# Include common targets. +# +include $(UTSBASE)/sparc/Makefile.targ diff --git a/usr/src/uts/sparc/os/device_policy b/usr/src/uts/sparc/os/device_policy index 8412304aa6..fbd64bea6a 100644 --- a/usr/src/uts/sparc/os/device_policy +++ b/usr/src/uts/sparc/os/device_policy @@ -57,12 +57,10 @@ spdsock read_priv_set=sys_ip_config write_priv_set=sys_ip_config # Raw network interface access permissions # ce read_priv_set=net_rawaccess write_priv_set=net_rawaccess -dmfe read_priv_set=net_rawaccess write_priv_set=net_rawaccess eri read_priv_set=net_rawaccess write_priv_set=net_rawaccess ge read_priv_set=net_rawaccess write_priv_set=net_rawaccess hme read_priv_set=net_rawaccess write_priv_set=net_rawaccess ibd read_priv_set=net_rawaccess write_priv_set=net_rawaccess -le read_priv_set=net_rawaccess write_priv_set=net_rawaccess pcelx read_priv_set=net_rawaccess write_priv_set=net_rawaccess qfe read_priv_set=net_rawaccess write_priv_set=net_rawaccess aggr read_priv_set=net_rawaccess write_priv_set=net_rawaccess diff --git a/usr/src/uts/sparc/os/driver_aliases b/usr/src/uts/sparc/os/driver_aliases index 5f64e885d8..9199aa44ba 100644 --- a/usr/src/uts/sparc/os/driver_aliases +++ b/usr/src/uts/sparc/os/driver_aliases @@ -132,8 +132,6 @@ mpt "pciex1000,56" mpt "pciex1000,58" power "ali1535d+-power" ramdisk SUNW,ramdisk -dmfe "pci108e,9102" -dmfe "pci128h,9102" ctsmc "nct-ds80ch11-smc" sd "scsiclass,00" ssd "scsa,00.bfcp" diff --git a/usr/src/uts/sparc/os/minor_perm b/usr/src/uts/sparc/os/minor_perm index b8b22f0bbd..21b3b4d1ce 100644 --- a/usr/src/uts/sparc/os/minor_perm +++ b/usr/src/uts/sparc/os/minor_perm @@ -20,7 +20,6 @@ ipsecesp:ipsecesp 0666 root sys keysock:keysock 0666 root sys clone:loop 0666 root sys clone:ptmx 0666 root sys -clone:le 0666 root sys clone:llc1 0666 root sys rts:rts 0666 root sys tcp:tcp 0666 root sys @@ -159,6 +158,9 @@ clone:pcwl 0666 root sys clone:pcan 0666 root sys clone:vsw 0666 root sys clone:vnet 0666 root sys +clone:afe 0666 root sys +clone:mxfe 0666 root sys +clone:rtls 0666 root sys bge:* 0666 root sys rge:* 0666 root sys xge:* 0666 root sys @@ -169,6 +171,9 @@ pcwl:* 0666 root sys pcan:* 0666 root sys vsw:* 0666 root sys vnet:* 0666 root sys +afe:* 0666 root sys +mxfe:* 0666 root sys +rtls:* 0666 root sys vnic:* 0666 root sys physmem:* 0600 root sys sdp:sdp 0666 root sys diff --git a/usr/src/uts/sparc/os/name_to_major b/usr/src/uts/sparc/os/name_to_major index 7b2bf99211..82d40a46e8 100644 --- a/usr/src/uts/sparc/os/name_to_major +++ b/usr/src/uts/sparc/os/name_to_major @@ -170,7 +170,6 @@ profile 220 systrace 221 sdt 222 fasttrap 223 -dmfe 224 todds1307 225 pool 226 zcons 227 diff --git a/usr/src/uts/sun4u/Makefile.files b/usr/src/uts/sun4u/Makefile.files index 79d91b9f90..018f76ded7 100644 --- a/usr/src/uts/sun4u/Makefile.files +++ b/usr/src/uts/sun4u/Makefile.files @@ -138,7 +138,6 @@ GPTWO_CPU_OBJS += gptwo_cpu.o ZULUVM_OBJS += zuluvm.o zulu_asm.o zulu_hat.o zulu_hat_asm.o JBUSPPM_OBJS += jbusppm.o -DMFE_OBJS += dmfe_log.o dmfe_main.o dmfe_mii.o dmfe_ndd.o RMC_COMM_OBJS += rmc_comm.o rmc_comm_crctab.o rmc_comm_dp.o rmc_comm_drvintf.o RMCADM_OBJS += rmcadm.o diff --git a/usr/src/uts/sun4u/Makefile.rules b/usr/src/uts/sun4u/Makefile.rules index a77d0a1cd1..da99b37b02 100644 --- a/usr/src/uts/sun4u/Makefile.rules +++ b/usr/src/uts/sun4u/Makefile.rules @@ -91,10 +91,6 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/sun4u/io/px/%.c $(OBJS_DIR)/%.o: $(UTSBASE)/sun4u/io/px/%.s $(COMPILE.s) -o $@ $< -$(OBJS_DIR)/%.o: $(UTSBASE)/sun4u/io/dmfe/%.c - $(COMPILE.c) -o $@ $< - $(CTFCONVERT_O) - $(OBJS_DIR)/%.o: $(UTSBASE)/sun4u/ml/%.s $(COMPILE.s) -o $@ $< @@ -208,9 +204,6 @@ $(LINTS_DIR)/%.ln: $(UTSBASE)/sun4u/io/px/%.c $(LINTS_DIR)/%.ln: $(UTSBASE)/sun4u/io/px/%.s @($(LHEAD) $(LINT.s) $< $(LTAIL)) -$(LINTS_DIR)/%.ln: $(UTSBASE)/sun4u/io/dmfe/%.c - @($(LHEAD) $(LINT.c) $< $(LTAIL)) - $(LINTS_DIR)/%.ln: $(UTSBASE)/sun4u/ml/%.s @($(LHEAD) $(LINT.s) $< $(LTAIL)) diff --git a/usr/src/uts/sun4u/Makefile.sun4u.shared b/usr/src/uts/sun4u/Makefile.sun4u.shared index b6ffd619d2..e11ac0c2b3 100644 --- a/usr/src/uts/sun4u/Makefile.sun4u.shared +++ b/usr/src/uts/sun4u/Makefile.sun4u.shared @@ -398,7 +398,6 @@ DRV_KMODS += pmubus DRV_KMODS += pmugpio DRV_KMODS += pmc DRV_KMODS += trapstat -DRV_KMODS += dmfe DRV_KMODS += rmc_comm DRV_KMODS += rmcadm DRV_KMODS += rmclomv diff --git a/usr/src/uts/sun4u/sys/Makefile b/usr/src/uts/sun4u/sys/Makefile index c65314c3a3..d87c67017d 100644 --- a/usr/src/uts/sun4u/sys/Makefile +++ b/usr/src/uts/sun4u/sys/Makefile @@ -113,12 +113,6 @@ $(CLOSED_BUILD)CLOSED_HDRS= \ memtestio_sr.h \ memtestio_u.h -DMFEHDRS = dmfe.h dmfe_impl.h miiregs.h - -ROOTDMFEDIR = $(ROOT)/usr/include/sys - -ROOTDMFEHDRS = $(DMFEHDRS:%=$(ROOTDMFEDIR)/%) - $(CLOSED_BUILD)CLOSED_I2CHDRS = clients/scmi2c.h I2CHDRS = clients/max1617.h misc/i2c_svc.h clients/i2c_client.h \ @@ -163,9 +157,9 @@ $(CLOSED_BUILD)CHECKHDRS += \ .PARALLEL: $(CHECKHDRS) $(ROOTHDRS) $(ROOTMONHDRS) $(SUN4_ROOTHDRS) -install_h: $(ROOTDIRS) $(USR_PSM_ISYS_I2C_DIRS) $(ROOTDMFEDIR) .WAIT \ +install_h: $(ROOTDIRS) $(USR_PSM_ISYS_I2C_DIRS) .WAIT \ $(ROOTHDRS) $(ROOTI2CHDRS) \ - $(ROOTMONHDRS) $(ROOTDMFEHDRS) \ + $(ROOTMONHDRS) \ $(SUN4_ROOTHDRS) $(ROOTLINK) check: $(CHECKHDRS) @@ -194,12 +188,6 @@ $(USR_PSM_ISYS_DIR)/%: ../../sun4/sys/% $(USR_PSM_ISYS_DIR) $(USR_PSM_MON_DIR)/%: mon/% $(USR_PSM_MON_DIR) $(INS.file) -$(ROOTDMFEDIR)/%: % $(ROOTDMFEDIR) - $(INS.file) - -$(ROOTDMFEDIR): - $(INS.dir.root.bin) - $(ROOTDIRS): $(INS.dir.root.bin) |