From nobody Thu Mar 24 15:21:08 2022 X-Original-To: dev-commits-src-main@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 6FE9A1A3B2C4; Thu, 24 Mar 2022 15:21:08 +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 4KPTT02lbbz4Xg8; Thu, 24 Mar 2022 15:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648135268; 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=tdGOenKj3UTedqWDoMKsEhu/pqgx9JEVw+fo1L7595c=; b=YOCcyig6Wf+IvWuunwysWyhF3f0XjtUmigNHdCsiQbBeWWJmv+8X0XlaKVnl2+zl1OQwlT 8gKDsu9uA3+GW/o3Wncxv7OAMGecxNQw3LbpVDzBono6xY0OEfepzzn2qIIxSYEAQV068Y MmQiuCtXmh8GUbVOM2+TSJqBJ1inv/aA8u813nl04wCjMGsBvyRP2hkKgT5gGjougC7i/A zNx2KXUP3y5xAiB2ibMuRPE5Ub2ES+YzwdYAWoEyfp8AlRee1IzeRVQpPbvENz5ps5sZ9B o2RzvkHWAfN548pXoPdEa1e41aKcsA1a3M/5MkdZL2rHsk5mb8qucaurpc+b6g== 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 3E2D91A3EA; Thu, 24 Mar 2022 15:21:08 +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 22OFL8lW004940; Thu, 24 Mar 2022 15:21:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22OFL8hK004939; Thu, 24 Mar 2022 15:21:08 GMT (envelope-from git) Date: Thu, 24 Mar 2022 15:21:08 GMT Message-Id: <202203241521.22OFL8hK004939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 81d058df6d25 - main - LinuxKPI: allow bsddriver name to be set for PCI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 81d058df6d255b7f551564f6d29a03692b51fe5a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648135268; 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=tdGOenKj3UTedqWDoMKsEhu/pqgx9JEVw+fo1L7595c=; b=WwXPDhR6ahollY+EPkgwvf6uwXykG8AgqjOwvz+hYHlnBgKtpERjKxL5sy5ghubCUkUfMA /eK3WY6pXVPrdsGQVYCRGrAAtsVu8iNb6STQAwNuvrTaWLdzR76iurzREeeo6s3eRBCePD RNOmlqGaTuIYZkOHSZg12d5/vwJMeTyNeC5E7AwTTVg0ixXkmWhJMMEM7zF1WhDAZ47XnU 5KVhEQUZpmvVQd9htRIKg+TqYpCJO9F3fLKnWRmbgr78/jUPbBS6GkheagNJ798dFCse4Q 0gIQxeSRI/uaziA5M4nqUMbtvuDG5SY+x3DNTrbkpkIpK6Q5LqqE6OiAtXuVDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648135268; a=rsa-sha256; cv=none; b=vCjN5k5G05qp33NRg39UVQ8Z4hQA6VocAmSDW9AgNXYsLJx1JGoFlfMWNdzFj+c0Q3z/wd I0Yx9c4bh3jkQ7hCef8EV8Sk44M53wKnNhew8kU38dwzaVh1XJKQYcoxNWog22kmd6AkWF 0tlt1B9pxPHFT6EXVpxy3eEtynqrtINQT7aI3TxapXbhMuSxAKjzvTMhGhDgOTB9/f8c/5 iAPhbDafmo++Ov25oKW1BjMLt+8zqpPm6kxqYZcBivfYhBwd6xGAhhSgs0Nwl2zqMuRz6m oXzNx3HX03o6fnV18sXMViuZdUEgn5NYouwH52lfovwX4XzOwK+uVrEJi4Pb8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=81d058df6d255b7f551564f6d29a03692b51fe5a commit 81d058df6d255b7f551564f6d29a03692b51fe5a Author: Bjoern A. Zeeb AuthorDate: 2022-03-24 01:45:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-03-24 15:19:15 +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 MFC after: 3 days Reviewed by: emaste, hselasky Differential Revision: https://reviews.freebsd.org/D34653 --- 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 b4f4a2219bb4..f8ae03d2bf28 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);