From nobody Thu Jan 12 10:36:54 2023 X-Original-To: freebsd-drivers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nt1FS6Sjgz2pF7s for ; Thu, 12 Jan 2023 10:37:00 +0000 (UTC) (envelope-from Lee.MATTHEWS.external@stormshield.eu) Received: from mail.stormshield.eu (mail.stormshield.eu [91.212.116.25]) by mx1.freebsd.org (Postfix) with ESMTP id 4Nt1FR4SfDz49jl for ; Thu, 12 Jan 2023 10:36:59 +0000 (UTC) (envelope-from Lee.MATTHEWS.external@stormshield.eu) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=stormshield.eu header.s=signer header.b=OBsndrvp; spf=pass (mx1.freebsd.org: domain of Lee.MATTHEWS.external@stormshield.eu designates 91.212.116.25 as permitted sender) smtp.mailfrom=Lee.MATTHEWS.external@stormshield.eu; dmarc=pass (policy=quarantine) header.from=stormshield.eu DKIM-Signature: v=1; a=rsa-sha256; d=stormshield.eu; s=signer; c=simple/simple; t=1673519814; h=from:subject:to:date:message-id; bh=vE22docYlgj6zavEqXmam5umvaKcsm7+BmexLxJa6Xw=; b=OBsndrvpygA4GGeWdvZH2iTYE/x7RzB/qIpQlKskP80G/VXaRRpCHfRpjwhUIdr5WR/qoSO/efg JjXR9BY46xInNmpLEOXMIhxzPj2UXsSh4RWUYBcBBe49RI8Mx34Ua3BNb97v2r5TPZfOfFlqAmVSY uBktNpZKUhKp2XFJtTn3dYTFP7PtXgdOs85stALqXGTTb6N5fP002owCqDNxPt1i3Q40bWmcPmbxS JfJMwe4zQtt3novLz44lrDafYnTwGUuDEwwNnkT4UHQmMHLZGIj03UkEzbIeLsx8bC6eOi8e1tJoH MSi6IzkpV+oSDgrgaHJ+pjaHdcFewaP2kbpg== Received: from ICTDCCEXCH001.one.local (10.180.4.1) by ICTDCCEXCH001.one.local (10.180.4.1) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.21; Thu, 12 Jan 2023 11:36:54 +0100 Received: from ICTDCCEXCH001.one.local ([::1]) by ICTDCCEXCH001.one.local ([::1]) with mapi id 15.02.1118.021; Thu, 12 Jan 2023 11:36:54 +0100 From: Lee MATTHEWS To: "freebsd-drivers@freebsd.org" Subject: kernel-space ioctl equivalent Thread-Topic: kernel-space ioctl equivalent Thread-Index: AQHZJnGkgAekbJ+mSEaJqh4xNuw6ZA== Date: Thu, 12 Jan 2023 10:36:54 +0000 Message-ID: <32c375a93a8642dab66066ffd71b4747@stormshield.eu> Accept-Language: en-GB, fr-FR, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.2.62.10] Content-Type: multipart/alternative; boundary="_000_32c375a93a8642dab66066ffd71b4747stormshieldeu_" List-Id: Writing device drivers for FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-drivers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-drivers@freebsd.org MIME-Version: 1.0 X-Spamd-Result: default: False [-3.88 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.977]; DMARC_POLICY_ALLOW(-0.50)[stormshield.eu,quarantine]; R_SPF_ALLOW(-0.20)[+ip4:91.212.116.25]; R_DKIM_ALLOW(-0.20)[stormshield.eu:s=signer]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_EQ_ADDR_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-drivers@freebsd.org]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; ASN(0.00)[asn:49068, ipnet:91.212.116.0/24, country:FR]; HAS_XOIP(0.00)[]; DKIM_TRACE(0.00)[stormshield.eu:+]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4Nt1FR4SfDz49jl X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N --_000_32c375a93a8642dab66066ffd71b4747stormshieldeu_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'd like to obtain a list of all pci devices from the pci driver from anoth= er driver that I'm working on. I note that in the userland tool 'pciconf', this is obtained via the ioctl = "ioctl(fd, PCIOCGETCONF, &pc)". I'd like to know if there is a way of obtaining the same information but di= rectly in kernel space, rather than user space. Is there an equivalent of ioctl that I can use in my driver to get the outp= ut from the request PCIOCGETCONF from the pci driver? Thanks in advance. Best wishes, Lee Matthews --_000_32c375a93a8642dab66066ffd71b4747stormshieldeu_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi,


I'd like to obtain a list of all pci devices from the pci driver from an= other driver that I'm working on.


I note that in the userland tool 'pciconf', this is obtained via the ioc= tl "ioctl(fd, PCIOCGETCONF, &pc)".


I'd like to know if there is a way of obtaining the same information but= directly in kernel space, rather than user space.


Is there an equivalent of ioctl that I can use in my driver to get the= output from the request PCIOCGETCONF from the pci driver?

Thanks in advance.


Best wishes,

Lee Matthews

--_000_32c375a93a8642dab66066ffd71b4747stormshieldeu_--