Home | History | Annotate | Line # | Download | only in scripts
      1 #!/bin/sh 
      2 #
      3 # Script to output BSD compatible pci ids file
      4 #  - Copyright Dave Airlie 2004 (airlied (at] linux.ie)
      5 #
      6 OUTFILE=drm_pciids.h
      7 
      8 finished=0
      9 
     10 cat > $OUTFILE <<EOF
     11 /*
     12    This file is auto-generated from the drm_pciids.txt in the DRM CVS
     13    Please contact dri-devel@lists.sf.net to add new cards to this list
     14 */
     15 EOF
     16 
     17 while read pcivend pcidev attribs pciname
     18 do
     19 	if [ "x$pcivend" = "x" ]; then
     20 		if [ "$finished" = "0" ]; then
     21 			finished=1
     22 			echo "	{0, 0, 0, NULL}" >> $OUTFILE
     23 			echo >> $OUTFILE
     24 		fi
     25 	else
     26 	
     27 		cardtype=`echo "$pcivend" | cut -s -f2 -d'[' | cut -s -f1 -d']'`
     28 		if [ "x$cardtype" = "x" ];
     29 		then
     30 			echo "	{$pcivend, $pcidev, $attribs, $pciname}, \\" >> $OUTFILE
     31 		else
     32 			echo "#define "$cardtype"_PCI_IDS \\" >> $OUTFILE
     33 			finished=0
     34 		fi
     35 	fi
     36 done
     37 
     38 if [ "$finished" = "0" ]; then
     39 	echo "	{0, 0, 0, NULL}" >> $OUTFILE
     40 fi
     41