git: 00450eeab246 - stable/13 - LinuxKPI: allow bsddriver name to be set for PCI
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 27 Mar 2022 20:14:03 UTC
The branch stable/13 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=00450eeab2465d6dc800680158b2cc67c1a7d9fc
commit 00450eeab2465d6dc800680158b2cc67c1a7d9fc
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-03-24 01:45:36 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
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);