From: Nathan F. <nf...@au...> - 2009-12-01 20:56:55
|
Applied. -Nathan Nathan Fontenot wrote: > For certain SAS devices we need to grab the sas address from sysfs > sas_device information instead of using the LUN to calculate the > sas address for the adapter. > > Signed-off-by: Nathan Fontenot <nf...@au...> > --- > > Index: powerpc-utils/scripts/ofpathname > =================================================================== > --- powerpc-utils.orig/scripts/ofpathname 2009-11-11 11:01:21.000000000 -0600 > +++ powerpc-utils/scripts/ofpathname 2009-11-12 10:38:40.000000000 -0600 > @@ -510,15 +510,27 @@ > OF_PATH=$OF_PATH/disk\@$vdiskno > fi > elif [[ -d /proc/device-tree$OF_PATH/sas ]]; then > - local B T L > - B=`echo $BUS | tr "[a-z]" "[A-Z]"` > - B=`echo "ibase=16;obase=A; $B" | bc` > - T=`echo $ID | tr "[a-z]" "[A-Z]"` > - T=`echo "ibase=16;obase=A; $T" | bc` > - L=`echo $LUN | tr "[a-z]" "[A-Z]"` > - L=`echo "ibase=16;obase=A; $L" | bc` > + local vendor_id sas_id > + > + vendor_id=`od -tx /proc/device-tree/$OF_PATH/vendor-id` > + vendor_id=`echo $vendor_id | cut -d " " -f 2` > + if [[ $vendor_id = "00001000" ]]; then > + local dev_id > + goto_dir $device_path "sas_end_device*" > + dev_id=${PWD##*-} > + sas_id=`cat /sys/class/sas_device/end_device-$dev_id/sas_address` > + else > + local B T L > + B=`echo $BUS | tr "[a-z]" "[A-Z]"` > + B=`echo "ibase=16;obase=A; $B" | bc` > + T=`echo $ID | tr "[a-z]" "[A-Z]"` > + T=`echo "ibase=16;obase=A; $T" | bc` > + L=`echo $LUN | tr "[a-z]" "[A-Z]"` > + L=`echo "ibase=16;obase=A; $L" | bc` > + > + sas_id=$(( ($B << 16) | ($T << 8) | $L )) > + fi > > - local sas_id=$(( ($B << 16) | ($T << 8) | $L )) > OF_PATH=$(printf "%s/sas/disk@%x" $OF_PATH $sas_id) > if [[ $LUN != "0" ]]; then > OF_PATH=$(printf "%s,%x" $OF_PATH $LUN) > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |