FreeBSD use kdev for kernel device name
Signed-off-by: Robert Noland <rnoland@2hip.net>main
parent
391c92ae17
commit
2221e16703
|
@ -717,10 +717,10 @@ static inline int drm_core_has_AGP(struct drm_device *dev)
|
|||
extern int drm_debug_flag;
|
||||
|
||||
/* Device setup support (drm_drv.c) */
|
||||
int drm_probe(device_t nbdev, drm_pci_id_list_t *idlist);
|
||||
int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist);
|
||||
int drm_probe(device_t kdev, drm_pci_id_list_t *idlist);
|
||||
int drm_attach(device_t kdev, drm_pci_id_list_t *idlist);
|
||||
void drm_close(void *data);
|
||||
int drm_detach(device_t nbdev);
|
||||
int drm_detach(device_t kdev);
|
||||
d_ioctl_t drm_ioctl;
|
||||
d_open_t drm_open;
|
||||
d_read_t drm_read;
|
||||
|
|
|
@ -155,53 +155,53 @@ static int drm_msi_is_blacklisted(int vendor, int device)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int drm_probe(device_t dev, drm_pci_id_list_t *idlist)
|
||||
int drm_probe(device_t kdev, drm_pci_id_list_t *idlist)
|
||||
{
|
||||
drm_pci_id_list_t *id_entry;
|
||||
int vendor, device;
|
||||
#if __FreeBSD_version < 700010
|
||||
device_t realdev;
|
||||
|
||||
if (!strcmp(device_get_name(dev), "drmsub"))
|
||||
realdev = device_get_parent(dev);
|
||||
if (!strcmp(device_get_name(kdev), "drmsub"))
|
||||
realdev = device_get_parent(kdev);
|
||||
else
|
||||
realdev = dev;
|
||||
realdev = kdev;
|
||||
vendor = pci_get_vendor(realdev);
|
||||
device = pci_get_device(realdev);
|
||||
#else
|
||||
vendor = pci_get_vendor(dev);
|
||||
device = pci_get_device(dev);
|
||||
vendor = pci_get_vendor(kdev);
|
||||
device = pci_get_device(kdev);
|
||||
#endif
|
||||
|
||||
if (pci_get_class(dev) != PCIC_DISPLAY
|
||||
|| pci_get_subclass(dev) != PCIS_DISPLAY_VGA)
|
||||
if (pci_get_class(kdev) != PCIC_DISPLAY
|
||||
|| pci_get_subclass(kdev) != PCIS_DISPLAY_VGA)
|
||||
return ENXIO;
|
||||
|
||||
id_entry = drm_find_description(vendor, device, idlist);
|
||||
if (id_entry != NULL) {
|
||||
device_set_desc(dev, id_entry->name);
|
||||
device_set_desc(kdev, id_entry->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ENXIO;
|
||||
}
|
||||
|
||||
int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist)
|
||||
int drm_attach(device_t kdev, drm_pci_id_list_t *idlist)
|
||||
{
|
||||
struct drm_device *dev;
|
||||
drm_pci_id_list_t *id_entry;
|
||||
int unit, msicount;
|
||||
|
||||
unit = device_get_unit(nbdev);
|
||||
dev = device_get_softc(nbdev);
|
||||
unit = device_get_unit(kdev);
|
||||
dev = device_get_softc(kdev);
|
||||
|
||||
#if __FreeBSD_version < 700010
|
||||
if (!strcmp(device_get_name(nbdev), "drmsub"))
|
||||
dev->device = device_get_parent(nbdev);
|
||||
if (!strcmp(device_get_name(kdev), "drmsub"))
|
||||
dev->device = device_get_parent(kdev);
|
||||
else
|
||||
dev->device = nbdev;
|
||||
dev->device = kdev;
|
||||
#else
|
||||
dev->device = nbdev;
|
||||
dev->device = kdev;
|
||||
#endif
|
||||
dev->devnode = make_dev(&drm_cdevsw,
|
||||
unit,
|
||||
|
@ -256,11 +256,11 @@ int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist)
|
|||
return drm_load(dev);
|
||||
}
|
||||
|
||||
int drm_detach(device_t nbdev)
|
||||
int drm_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev;
|
||||
|
||||
dev = device_get_softc(nbdev);
|
||||
dev = device_get_softc(kdev);
|
||||
|
||||
drm_unload(dev);
|
||||
|
||||
|
|
|
@ -40,9 +40,9 @@ static drm_pci_id_list_t i915_pciidlist[] = {
|
|||
i915_PCI_IDS
|
||||
};
|
||||
|
||||
static int i915_suspend(device_t nbdev)
|
||||
static int i915_suspend(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
if (!dev || !dev_priv) {
|
||||
|
@ -54,16 +54,16 @@ static int i915_suspend(device_t nbdev)
|
|||
|
||||
i915_save_state(dev);
|
||||
|
||||
return (bus_generic_suspend(nbdev));
|
||||
return (bus_generic_suspend(kdev));
|
||||
}
|
||||
|
||||
static int i915_resume(device_t nbdev)
|
||||
static int i915_resume(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
i915_restore_state(dev);
|
||||
|
||||
return (bus_generic_resume(nbdev));
|
||||
return (bus_generic_resume(kdev));
|
||||
}
|
||||
|
||||
static void i915_configure(struct drm_device *dev)
|
||||
|
@ -97,31 +97,31 @@ static void i915_configure(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
i915_probe(device_t dev)
|
||||
i915_probe(device_t kdev)
|
||||
{
|
||||
return drm_probe(dev, i915_pciidlist);
|
||||
return drm_probe(kdev, i915_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
i915_attach(device_t nbdev)
|
||||
i915_attach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
i915_configure(dev);
|
||||
|
||||
return drm_attach(nbdev, i915_pciidlist);
|
||||
return drm_attach(kdev, i915_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
i915_detach(device_t nbdev)
|
||||
i915_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
ret = drm_detach(kdev);
|
||||
|
||||
free(dev->driver, DRM_MEM_DRIVER);
|
||||
|
||||
|
|
|
@ -74,22 +74,22 @@ static void mach64_configure(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
mach64_probe(device_t dev)
|
||||
mach64_probe(device_t kdev)
|
||||
{
|
||||
return drm_probe(dev, mach64_pciidlist);
|
||||
return drm_probe(kdev, mach64_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
mach64_attach(device_t nbdev)
|
||||
mach64_attach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
mach64_configure(dev);
|
||||
|
||||
return drm_attach(nbdev, mach64_pciidlist);
|
||||
return drm_attach(kdev, mach64_pciidlist);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -99,12 +99,12 @@ mach64_driver_load(struct drm_device * dev, unsigned long flags)
|
|||
}
|
||||
|
||||
static int
|
||||
mach64_detach(device_t nbdev)
|
||||
mach64_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
ret = drm_detach(kdev);
|
||||
|
||||
free(dev->driver, DRM_MEM_DRIVER);
|
||||
|
||||
|
|
|
@ -117,31 +117,31 @@ static void mga_configure(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
mga_probe(device_t dev)
|
||||
mga_probe(device_t kdev)
|
||||
{
|
||||
return drm_probe(dev, mga_pciidlist);
|
||||
return drm_probe(kdev, mga_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
mga_attach(device_t nbdev)
|
||||
mga_attach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
mga_configure(dev);
|
||||
|
||||
return drm_attach(nbdev, mga_pciidlist);
|
||||
return drm_attach(kdev, mga_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
mga_detach(device_t nbdev)
|
||||
mga_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
ret = drm_detach(kdev);
|
||||
|
||||
free(dev->driver, DRM_MEM_DRIVER);
|
||||
|
||||
|
|
|
@ -73,22 +73,22 @@ static void r128_configure(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
r128_probe(device_t dev)
|
||||
r128_probe(device_t kdev)
|
||||
{
|
||||
return drm_probe(dev, r128_pciidlist);
|
||||
return drm_probe(kdev, r128_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
r128_attach(device_t nbdev)
|
||||
r128_attach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
r128_configure(dev);
|
||||
|
||||
return drm_attach(nbdev, r128_pciidlist);
|
||||
return drm_attach(kdev, r128_pciidlist);
|
||||
}
|
||||
|
||||
int r128_driver_load(struct drm_device * dev, unsigned long flags)
|
||||
|
@ -97,12 +97,12 @@ int r128_driver_load(struct drm_device * dev, unsigned long flags)
|
|||
}
|
||||
|
||||
static int
|
||||
r128_detach(device_t nbdev)
|
||||
r128_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
ret = drm_detach(kdev);
|
||||
|
||||
free(dev->driver, DRM_MEM_DRIVER);
|
||||
|
||||
|
|
|
@ -77,31 +77,31 @@ static void radeon_configure(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
radeon_probe(device_t dev)
|
||||
radeon_probe(device_t kdev)
|
||||
{
|
||||
return drm_probe(dev, radeon_pciidlist);
|
||||
return drm_probe(kdev, radeon_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
radeon_attach(device_t nbdev)
|
||||
radeon_attach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
radeon_configure(dev);
|
||||
|
||||
return drm_attach(nbdev, radeon_pciidlist);
|
||||
return drm_attach(kdev, radeon_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
radeon_detach(device_t nbdev)
|
||||
radeon_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
ret = drm_detach(kdev);
|
||||
|
||||
free(dev->driver, DRM_MEM_DRIVER);
|
||||
|
||||
|
|
|
@ -63,31 +63,31 @@ static void savage_configure(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
savage_probe(device_t dev)
|
||||
savage_probe(device_t kdev)
|
||||
{
|
||||
return drm_probe(dev, savage_pciidlist);
|
||||
return drm_probe(kdev, savage_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
savage_attach(device_t nbdev)
|
||||
savage_attach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
savage_configure(dev);
|
||||
|
||||
return drm_attach(nbdev, savage_pciidlist);
|
||||
return drm_attach(kdev, savage_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
savage_detach(device_t nbdev)
|
||||
savage_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
ret = drm_detach(kdev);
|
||||
|
||||
free(dev->driver, DRM_MEM_DRIVER);
|
||||
|
||||
|
|
|
@ -57,31 +57,31 @@ static void sis_configure(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
sis_probe(device_t dev)
|
||||
sis_probe(device_t kdev)
|
||||
{
|
||||
return drm_probe(dev, sis_pciidlist);
|
||||
return drm_probe(kdev, sis_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
sis_attach(device_t nbdev)
|
||||
sis_attach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
sis_configure(dev);
|
||||
|
||||
return drm_attach(nbdev, sis_pciidlist);
|
||||
return drm_attach(kdev, sis_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
sis_detach(device_t nbdev)
|
||||
sis_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
ret = drm_detach(kdev);
|
||||
|
||||
free(dev->driver, DRM_MEM_DRIVER);
|
||||
|
||||
|
|
|
@ -59,31 +59,31 @@ static void tdfx_configure(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
tdfx_probe(device_t dev)
|
||||
tdfx_probe(device_t kdev)
|
||||
{
|
||||
return drm_probe(dev, tdfx_pciidlist);
|
||||
return drm_probe(kdev, tdfx_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
tdfx_attach(device_t nbdev)
|
||||
tdfx_attach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
tdfx_configure(dev);
|
||||
|
||||
return drm_attach(nbdev, tdfx_pciidlist);
|
||||
return drm_attach(kdev, tdfx_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
tdfx_detach(device_t nbdev)
|
||||
tdfx_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
ret = drm_detach(kdev);
|
||||
|
||||
free(dev->driver, DRM_MEM_DRIVER);
|
||||
|
||||
|
|
|
@ -70,31 +70,31 @@ static void via_configure(struct drm_device *dev)
|
|||
}
|
||||
|
||||
static int
|
||||
via_probe(device_t dev)
|
||||
via_probe(device_t kdev)
|
||||
{
|
||||
return drm_probe(dev, via_pciidlist);
|
||||
return drm_probe(kdev, via_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
via_attach(device_t nbdev)
|
||||
via_attach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
|
||||
dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
via_configure(dev);
|
||||
|
||||
return drm_attach(nbdev, via_pciidlist);
|
||||
return drm_attach(kdev, via_pciidlist);
|
||||
}
|
||||
|
||||
static int
|
||||
via_detach(device_t nbdev)
|
||||
via_detach(device_t kdev)
|
||||
{
|
||||
struct drm_device *dev = device_get_softc(nbdev);
|
||||
struct drm_device *dev = device_get_softc(kdev);
|
||||
int ret;
|
||||
|
||||
ret = drm_detach(nbdev);
|
||||
ret = drm_detach(kdev);
|
||||
|
||||
free(dev->driver, DRM_MEM_DRIVER);
|
||||
|
||||
|
|
Loading…
Reference in New Issue