From owner-freebsd-questions@FreeBSD.ORG Mon Oct 1 17:30:39 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A59C1065670 for ; Mon, 1 Oct 2012 17:30:39 +0000 (UTC) (envelope-from sam.gh1986@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2A0E08FC15 for ; Mon, 1 Oct 2012 17:30:38 +0000 (UTC) Received: by vcbfw7 with SMTP id fw7so7703567vcb.13 for ; Mon, 01 Oct 2012 10:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=1T+yRACbKp9ci6i9DdYGH7aL8zFKAFMSbqNn2IVDWKg=; b=wAf+DP/DQLrnHxaTXSX293E5hKYJFKKQV4hIheFpMRzCZQMuWVrI7jL87gGKKvI3FO LemkJ8UzpUnetqVXpk/w15RWPZo6noke4+jlV8VkwpP05FVTIeOBEh0D4RuCsogu72xt QDzHEVWttz+MSrekU40kG1GVxK/mCnA0wZBI+BwnV95nxk4zwzQBPfX4qMR2eHUhjtab /THACXyFnq8sZhvbd+gzDE6CetqqXOv3BCQWlPyJXOES/Zbz2wG2Nie7VfbevWv/d2tY bPSFsiEO61s4b+cT75op6YadOjPhv6UuznqG5acAYFgsFO3+tQFt6xsCWAituiqXZz9/ wZcQ== MIME-Version: 1.0 Received: by 10.58.94.109 with SMTP id db13mr9028087veb.39.1349112637951; Mon, 01 Oct 2012 10:30:37 -0700 (PDT) Received: by 10.58.239.167 with HTTP; Mon, 1 Oct 2012 10:30:37 -0700 (PDT) In-Reply-To: <20121001114809.GA44965@kontrol.kode5.net> References: <20121001114809.GA44965@kontrol.kode5.net> Date: Mon, 1 Oct 2012 21:00:37 +0330 Message-ID: From: s m To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: find slot number and number of ports for each card X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Oct 2012 17:30:39 -0000 thanks every body for your answers. now i know my path. thanks again On Mon, Oct 1, 2012 at 3:18 PM, Jamie Paul Griffin wrote: > [ Devin Teske wrote on Sat 29.Sep'12 at 12:32:04 -0700 ] > > > > > On Sep 29, 2012, at 7:37 AM, saeedeh motlagh wrote: > > > > > hello all > > > > > > i want to have statistics about my hardware specially the type of car= d > > > that are installed on my system, > > > > Card characteristics are provided by "pciconf -l". > > ("pciconf -lv" for verbose listing). > > > > Two important notes about "pciconf -l"=85 > > > > 1. It lists more than just "cards" > > 2. The "type" can't always be determined by FreeBSD > > > > When looking at the output of "pciconf -l", each line represents a > > component (this can be an integrated component on the mother- > > board, such as USB port, not necessarily a PCI add-in card). > > > > If the line begins with "none@" then a driver has not attached to > > this device (and FreeBSD therefore doesn't know what "type" it is). > > In this case, you'll want to look at the "chip=3D" portion of the line. > > The "chip=3D" portion of the line gives you two very important pieces > > of information when it comes to identifying your hardware: > > > > a. The 4-digit hexadecimal identifier for the Model of the device > > b. The 4-digit hexadecimal identifier for the Vendor of the device > > > > (in that order from left-to-right) > > > > Let's look at a sample line: > > > > vgapci0@pci0:2:9:0: class=3D0x030000 card=3D0x00081002 chip=3D0x47521= 002 > rev=3D0x27 hdr=3D0x00 > > > > NOTE: That's my graphics card on an ASUSTek P4B533 motherboard > > > > In the above line, see "chip=3D0x47521002". > > In this case, "4752" is the Model identifier > > and "1002" is the Vendor identifier. > > > > If you're a human and you want to know what these numbers are, > > you hop on over to pcidatabase.com and punch in the numbers to > > find out that this is a [particularly ancient] ATI Rage XL graphics car= d. > > > > If you're not a human (i.e., a script), you'll instead reference a loca= l > > copy of the "pci.ids" (/usr/local/share/pciids/pci.ids for example): > > > > $ grep '1002 4752' /usr/local/share/pciids/pci.ids > > 1002 4752 Proliant Rage XL > > > > > > > > > the number of ports that each card has > > > > That one is near impossible. > > > > Since every add-in card is going function differently, you really need > > a device-specific enumeration method to (for example) count things > > like PHYs provided by a single NIC. > > > > Imagine if you will, the case of the card for which there is no driver > > loaded in the kernel (where "pciconf -l" shows a "none@" prefix). > > There really is no way to enumerate the number of "ports" a card > > offers in that circumstance. > > > > However! > > > > You can build logic into your code (if you are scripting something) > > that takes the description from the pci.ids file (or just the raw hex > IDs) > > and extrapolates based on prior-knowledge how many ports a > > particular device has. > > > > > > > > > and the slot number which cards are installed. > > > > That's provided by pciconf. > > > > Also, it's worth mentioning the excellent "dmidecode" tool from the > > ports tree. This too can enumerate the slots themselves (and tell you > > whether they are PCI, PCI-X, PCIe, etc. including voltage. Search > > for "System Slot Information" in the dmidecode output for this info. > > -- > > Devin > > This is interesting. I'm glad this question was raised, because i've > noticed i've got two "none@" lines listed when using pciconf -lv. I've > been trying to figure out what these are over the last week but to no > avail. They must be there for some purpose and I wondered if i'm missing > some important driver because of this. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >