From nobody Sun Mar 27 20:14:03 2022 X-Original-To: dev-commits-src-branches@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 6E8DD1A53464; Sun, 27 Mar 2022 20:14:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KRRqb59RSz4ns3; Sun, 27 Mar 2022 20:14:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648412044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8CLpANTmdcxlVK6xYdJ+G8xFKhMdTRuBM3owQwPTNc0=; b=beljKz9qQTXP5ZO3pnalryFbMj71BcxYVKs5iRhudySoxdHRSckHtvOy2hC6ZUJ/CslOQY uIGJjEg2a7p1KTB3mhjQlxrqHkOW686BTlB1nW3DEORQit00iSp31hGzdzgZ8DTOYz//Uc neHoQE+OlSYgD0S0rGhiPrMzSe1neLVDu8fe7uHpY3mV/lW2GXMfZKg9kJ1JDWbKmZ4OgY 02+lqHOIoZ9M7opmxhud5lu8Itm7ao3p1B4AayEwgl5y3NpoppXNXB7C0knFkgj/ObEGvh UNG135V1zZmDA5YFAvsgc/XtfpgW0u2e6zqP8OHshpC67lF2iSZIw0pP5EP6+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8818A1B767; Sun, 27 Mar 2022 20:14:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22RKE3UG037191; Sun, 27 Mar 2022 20:14:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22RKE3Mx037190; Sun, 27 Mar 2022 20:14:03 GMT (envelope-from git) Date: Sun, 27 Mar 2022 20:14:03 GMT Message-Id: <202203272014.22RKE3Mx037190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 00450eeab246 - stable/13 - LinuxKPI: allow bsddriver name to be set for PCI List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 00450eeab2465d6dc800680158b2cc67c1a7d9fc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648412044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8CLpANTmdcxlVK6xYdJ+G8xFKhMdTRuBM3owQwPTNc0=; b=LYNAXVjxpV0FM39qIjqKL8fGyC3nrtL2yZsJjH0Z24/OCKfRA143nSws+6Ff2p4V1ojM8M e+hzQfgrb1Q7ziWNTkQyhhyXPCpsXONIZgralumf0PPwbcxtAKWApdSd6fLKi7P4Rooun9 lNRdUC8n/p0ycSHEl1Hb28vit76eZaYC2Is8qkbqjcsEhl/TPw8ObAGjL+vUUDEigqFTeW 7rPa2cWbrAK1Ur4ztiOGQP2vfcy9jaAuqyPXChqbL5p8ewxFOMtY6BBSobnY8OrYsSKphf 0Jl0MiUKr2l8TRPMKnTYE1tlWX0xpGrNgBl6x0Wm00/79yuiP8EHXUMwqYOXkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648412044; a=rsa-sha256; cv=none; b=tXRJKnhBdOezSVbDAc299lAezKvuO+JUQUx1wqRxu6toO9UWusX3XcAB9z5y/mievvtU++ 90DgGzTVHK6YSvcLZ/8buHhFtanvmnuqOu23g2SlHkT1xK5YXnL/o2W577lAst09u6qXGf C5iELaF1mqwMZjc5oz60ZkV7iDbGftBqUhRwyHnrUCrP0cVz9WzeL1qUgjO7DGZJzGHnZ9 Nam6s81U21YsgAkrQj4ZGa1G+wFIMzdCHqkFSLj4kKfp4TGBRF/bPZZlzJPCWN8V9yAkeT TpUOhSOhosPF+6eM9CSPJ4w1CIIFs3SHBJh0dhOpufU0t2ChW79k+b8mYFhPBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=00450eeab2465d6dc800680158b2cc67c1a7d9fc commit 00450eeab2465d6dc800680158b2cc67c1a7d9fc Author: Bjoern A. Zeeb AuthorDate: 2022-03-24 01:45:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-03-27 18:08:47 +0000 LinuxKPI: allow bsddriver name to be set for PCI Allow a driver to overwrite the bsddriver name (we use for pci and for wlan parent devices). This allows us to to set .bsddriver.name in struct pci_driver passed to module_pci_driver() and with that set the BSD driver name while retaining the Linux .name one. This is helpful for divers which have different parts depending on chipset and with that would change driver names which is highly confusing especially for configuration. One example is an upcoming rtw88 driver which would be rtw_8822be or rtw_8822ce depending on chipset. Sponsored by: The FreeBSD Foundation Reviewed by: emaste, hselasky Differential Revision: https://reviews.freebsd.org/D34653 (cherry picked from commit 81d058df6d255b7f551564f6d29a03692b51fe5a) --- sys/compat/linuxkpi/common/src/linux_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index bc169425c6a8..0734acac60ac 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -654,7 +654,8 @@ _linux_pci_register_driver(struct pci_driver *pdrv, devclass_t dc) spin_lock(&pci_lock); list_add(&pdrv->node, &pci_drivers); spin_unlock(&pci_lock); - pdrv->bsddriver.name = pdrv->name; + if (pdrv->bsddriver.name == NULL) + pdrv->bsddriver.name = pdrv->name; pdrv->bsddriver.methods = pci_methods; pdrv->bsddriver.size = sizeof(struct pci_dev);