Home | History | Annotate | Download | only in BRCMbnx
      1 #!/sbin/sh
      2 #
      3 # CDDL HEADER START
      4 #
      5 # The contents of this file are subject to the terms of the
      6 # Common Development and Distribution License (the "License").
      7 # You may not use this file except in compliance with the License.
      8 #
      9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10 # or http://www.opensolaris.org/os/licensing.
     11 # See the License for the specific language governing permissions
     12 # and limitations under the License.
     13 #
     14 # When distributing Covered Code, include this CDDL HEADER in each
     15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16 # If applicable, add the following below this CDDL HEADER, with the
     17 # fields enclosed by brackets "[]" replaced with your own identifying
     18 # information: Portions Copyright [yyyy] [name of copyright owner]
     19 #
     20 # CDDL HEADER END
     21 #
     22 #
     23 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     24 # Use is subject to license terms.
     25 #
     26 # ident	"%Z%%M%	%I%	%E% SMI"
     27 #
     28 
     29 PATH="/usr/bin:/usr/sbin:${PATH}"
     30 export PATH
     31 
     32 #
     33 # Driver name 
     34 #
     35 DRV=bnx
     36 
     37 #
     38 # Driver support device list
     39 #
     40 DRVALIAS="\"pci14e4,164a\" \
     41 	\"pci14e4,16aa\" \
     42 	\"pci14e4,164c\" \
     43 	\"pci14e4,16ac\" \
     44 	\"pci14e4,1639\" \
     45         \"pci14e4,163a\""
     46 
     47 #
     48 # Select the correct add_drv options to execute.
     49 #
     50 if [ "${BASEDIR}" = "" ]
     51 then
     52 	BASEDIR=/
     53 fi
     54 if [ "${BASEDIR}" = "/" ]; then
     55         #
     56         # Irrespective of whether hardware exists
     57         # or not don't attempt to attach driver
     58         # to the hardware. This is to avoid problems
     59         # with installing a 32 bit driver on a 64 bit
     60         # running system.
     61 	#
     62 	# Note: don't use '-b' under this situation.
     63 	#	See add_drv(1M) for more info.
     64         #
     65         ADD_DRV="add_drv -n"
     66 else
     67         #
     68         # On a client,
     69         # modify the system files and touch/reconfigure
     70         # for reconfigure reboot
     71         #
     72         ADD_DRV="add_drv -b ${BASEDIR}"
     73 fi
     74 
     75 #
     76 # Make sure the driver has *not* been previously installed
     77 # before attempting to add the driver.
     78 #
     79 grep -w "${DRV}" ${BASEDIR}/etc/name_to_major > /dev/null 2>&1
     80 if [ $? -eq 1 ]; then
     81 	${ADD_DRV} -m '* 0644 root sys' -i "${DRVALIAS}" ${DRV}
     82 	if [ $? -ne 0 ]; then
     83 		echo "\nFailed add_drv!\n" >&2
     84 		exit 1
     85 	fi
     86 else
     87 	echo "${DRV} is already installed!"
     88 fi
     89 
     90 exit 0
     91