View | Details | Raw Unified | Return to bug 111522 | Differences between
and this patch

Collapse All | Expand All

(-)sys/powerpc/powerpc/nexus.c (+56 lines)
Lines 74-79 Link Here
74
74
75
#include <sys/rman.h>
75
#include <sys/rman.h>
76
76
77
#include "ofw_bus_if.h"
77
#include "pic_if.h"
78
#include "pic_if.h"
78
79
79
/*
80
/*
Lines 124-129 Link Here
124
static int	nexus_release_resource(device_t, device_t, int, int,
125
static int	nexus_release_resource(device_t, device_t, int, int,
125
		    struct resource *);
126
		    struct resource *);
126
127
128
static phandle_t	 nexus_ofw_get_node(device_t, device_t);
129
static const char	*nexus_ofw_get_name(device_t, device_t);
130
static const char	*nexus_ofw_get_type(device_t, device_t);
131
static const char	*nexus_ofw_get_compat(device_t, device_t);
132
127
/*
133
/*
128
 * Local routines
134
 * Local routines
129
 */
135
 */
Lines 151-156 Link Here
151
	DEVMETHOD(bus_deactivate_resource,	nexus_deactivate_resource),
157
	DEVMETHOD(bus_deactivate_resource,	nexus_deactivate_resource),
152
	DEVMETHOD(bus_release_resource,	nexus_release_resource),
158
	DEVMETHOD(bus_release_resource,	nexus_release_resource),
153
159
160
	/* OFW bus interface */
161
	DEVMETHOD(ofw_bus_get_node, nexus_ofw_get_node),
162
	DEVMETHOD(ofw_bus_get_name, nexus_ofw_get_name),
163
	DEVMETHOD(ofw_bus_get_type, nexus_ofw_get_type),
164
	DEVMETHOD(ofw_bus_get_compat, nexus_ofw_get_compat),
165
154
	{ 0, 0 }
166
	{ 0, 0 }
155
};
167
};
156
168
Lines 416-418 Link Here
416
428
417
	return (0);
429
	return (0);
418
}
430
}
431
432
static const char *
433
nexus_ofw_get_name(device_t bus, device_t dev)
434
{
435
	struct nexus_devinfo *dinfo;
436
437
	if ((dinfo = device_get_ivars(dev)) == 0)
438
		return NULL;
439
	
440
	return dinfo->ndi_name;
441
}
442
443
static phandle_t
444
nexus_ofw_get_node(device_t bus, device_t dev)
445
{
446
	struct nexus_devinfo *dinfo;
447
448
	if ((dinfo = device_get_ivars(dev)) == 0)
449
		return 0;
450
	
451
	return dinfo->ndi_node;
452
}
453
454
static const char *
455
nexus_ofw_get_type(device_t bus, device_t dev)
456
{
457
	struct nexus_devinfo *dinfo;
458
459
	if ((dinfo = device_get_ivars(dev)) == 0)
460
		return NULL;
461
	
462
	return dinfo->ndi_device_type;
463
}
464
465
static const char *
466
nexus_ofw_get_compat(device_t bus, device_t dev)
467
{
468
	struct nexus_devinfo *dinfo;
469
470
	if ((dinfo = device_get_ivars(dev)) == 0)
471
		return NULL;
472
	
473
	return dinfo->ndi_compatible;
474
}

Return to bug 111522