From owner-svn-src-head@freebsd.org Sat Apr 2 09:49:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A4CB00F5E for ; Sat, 2 Apr 2016 09:49:55 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A70319B9 for ; Sat, 2 Apr 2016 09:49:55 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-lf0-x22c.google.com with SMTP id p188so76680852lfd.0 for ; Sat, 02 Apr 2016 02:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=VBjv9zQwXKgIZnXCaSKRoqssRGdbCyArYHPm56EYnDk=; b=kmwedgXwS2LoiJF5khIpzhOtMXq+A40qzek4sxsPv0txmppgBeYpKO1UyUiV6yxN4+ ddffQzUBE/LARPwe5FJGRAMOj/iKwCB91aEMl4zT0o/3qFyYg1UaQ+6KzpZETnOhT6l5 Bh2XYQw7BVEIZk8tpJ5gQ1smayS7Z3VtGzdYTbbO/PsWR59iNSS43oPR5RsHgJxK66sh MuEhradd0iQfDCKpsXleTmrzBIkAKX9osxqtI9PW3XzNYgtxVw/r8mXF9HuU/GM8xmvW aUzd67Oqfs6WMG9efK6j/YqCwBM9dIAHqUwiPa4DraDveHJvp4dqJV5V5+Vv4afnRhHJ zSrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=VBjv9zQwXKgIZnXCaSKRoqssRGdbCyArYHPm56EYnDk=; b=JgbuLHmGEQOwXlKkzKiilEAwEfyDwXCPyf5oypQ9Rt4xp1MRRoFsg8Gs0Cnrl1AcL6 1XAbIBKyypw+PrhPW6N+ajQyXbyeNnqLTcB7L0lJmvKoZcE4LKL/zdrOn+q7E5SfLGfU YXPXpr4uDz1crUvAzmIaI9CPoqezTJe3h+OVvY0jSIngcj+utc2+96tvtttFI6L+T6jj +S65NF1Rp2OGqpZtEcMivS2CvyzOr5FqlPCgf1YEATdj83me+njBhHQ+7m9s1kTtPnjn PAJnWO+DEMj9oFc3u1RIqfDDTs6j160Yt9+caXBJzbQgAMwEGNPO3G7Pj31DXIPg0Q5n XU6w== X-Gm-Message-State: AD7BkJLUEJKAl+cM7zma1MUB17jRTdmhlSTTT1FdC1Fa2Jb9bW4r4hcPJWMb7RD5S4LNp/trstt3JeJSLpQLMf5E MIME-Version: 1.0 X-Received: by 10.194.184.38 with SMTP id er6mr1427982wjc.93.1459590593200; Sat, 02 Apr 2016 02:49:53 -0700 (PDT) Received: by 10.194.243.98 with HTTP; Sat, 2 Apr 2016 02:49:53 -0700 (PDT) In-Reply-To: <201604020159.u321xr2V087305@repo.freebsd.org> References: <201604020159.u321xr2V087305@repo.freebsd.org> Date: Sat, 2 Apr 2016 11:49:53 +0200 Message-ID: Subject: Re: svn commit: r297501 - head/usr.sbin/pciconf From: Oliver Pinter To: John Baldwin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 09:49:55 -0000 Hi! On Saturday, April 2, 2016, John Baldwin wrote: > Author: jhb > Date: Sat Apr 2 01:59:53 2016 > New Revision: 297501 > URL: https://svnweb.freebsd.org/changeset/base/297501 > > Log: > Output information about PCI-e devices with slots. > > In particular this includes additional information on HotPlug capable > slots. > > Modified: > head/usr.sbin/pciconf/cap.c > > Modified: head/usr.sbin/pciconf/cap.c > > ============================================================================== > --- head/usr.sbin/pciconf/cap.c Sat Apr 2 01:55:43 2016 (r297500) > +++ head/usr.sbin/pciconf/cap.c Sat Apr 2 01:59:53 2016 (r297501) > @@ -410,6 +410,28 @@ aspm_string(uint8_t aspm) > } > } > > +static int > +slot_power(uint32_t cap) > +{ > + int mwatts; > + > + mwatts = (cap & PCIEM_SLOT_CAP_SPLV) >> 7; > + switch (cap & PCIEM_SLOT_CAP_SPLS) { > + case 0x0: > + mwatts *= 1000; > + break; > + case 0x1: > + mwatts *= 100; > + break; > + case 0x2: > + mwatts *= 10; > + break; > + default: > + break; > + } > + return (mwatts); > +} > + > static void > cap_express(int fd, struct pci_conf *p, uint8_t ptr) > { > @@ -452,8 +474,6 @@ cap_express(int fd, struct pci_conf *p, > printf("type %d", (flags & PCIEM_FLAGS_TYPE) >> 4); > break; > } > - if (flags & PCIEM_FLAGS_SLOT) > - printf(" slot"); > if (flags & PCIEM_FLAGS_IRQ) > printf(" MSI %d", (flags & PCIEM_FLAGS_IRQ) >> 9); > cap = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); > @@ -493,6 +513,26 @@ cap_express(int fd, struct pci_conf *p, > printf(" ASPM %s(%s)", aspm_string(ctl & > PCIEM_LINK_CTL_ASPMC), > aspm_string((cap & PCIEM_LINK_CAP_ASPM) >> 10)); > } > + if (!(flags & PCIEM_FLAGS_SLOT)) > + return; > + cap = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_CAP, 4); > + sta = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_STA, 2); > + ctl = read_config(fd, &p->pc_sel, ptr + PCIER_SLOT_CTL, 2); > + printf("\n "); > + printf(" slot %d", (cap & PCIEM_SLOT_CAP_PSN) >> 19); > + printf(" power limit %d mW", slot_power(cap)); > + if (cap & PCIEM_SLOT_CAP_HPC) > + printf(" HotPlug(%s)", sta & PCIEM_SLOT_STA_PDS ? > "present" : > + "empty"); > + if (cap & PCIEM_SLOT_CAP_HPS) > + printf(" surprise"); What is this surprise string or state? Or is this a forgotten debug string? > + if (cap & PCIEM_SLOT_CAP_APB) > + printf(" Attn Button"); > + if (cap & PCIEM_SLOT_CAP_PCP) > + printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "on" : "off"); > + if (cap & PCIEM_SLOT_CAP_MRLSP) > + printf(" MRL(%s)", sta & PCIEM_SLOT_STA_MRLSS ? "open" : > + "closed"); > } > > static void > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org > " >