* device model?
@ 2003-06-12 11:56 Matthew Wilcox
[not found] ` <20030612115641.GD30843-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2003-06-12 11:56 UTC (permalink / raw)
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Why doesn't struct acpi_device contain a struct device?
I was rather hoping that with the unified device model in 2.5 that I
could finally model the innards of the zx1 boxes (ie SBA has a bunch of
HBAs, each of which has a PCI root bus). But it looks like acpi_device
isn't part of the unified device model yet. Is there a reason for this,
other than lack of time?
--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: device model?
[not found] ` <20030612115641.GD30843-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
@ 2003-06-12 15:23 ` Patrick Mochel
[not found] ` <Pine.LNX.4.44.0306120818510.11379-100000-L1xM/EEGAB4@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Patrick Mochel @ 2003-06-12 15:23 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
> Why doesn't struct acpi_device contain a struct device?
Because they are not devices, only the firmware representation of them. :)
> I was rather hoping that with the unified device model in 2.5 that I
> could finally model the innards of the zx1 boxes (ie SBA has a bunch of
> HBAs, each of which has a PCI root bus). But it looks like acpi_device
> isn't part of the unified device model yet. Is there a reason for this,
> other than lack of time?
struct acpi_device contains a kobject that is registered in
drivers/acpi/scan.c. The hierarchy is represented in
/sys/firmware/acpi/namespace.
Ideally, when an ACPI namespace object is found, the bus on which the
device belongs will be notified of a found device, so that it may probe,
intiialize, and register the device properly. That will give it
representation in /sys/devices, and ACPI could then provide a symlink
between its object's directory and the device's directory.
But, it hasn't happened yet.
-pat
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: device model?
[not found] ` <Pine.LNX.4.44.0306120818510.11379-100000-L1xM/EEGAB4@public.gmane.org>
@ 2003-06-12 15:30 ` Matthew Wilcox
[not found] ` <20030612153024.GJ30843-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2003-06-12 15:30 UTC (permalink / raw)
To: Patrick Mochel
Cc: Matthew Wilcox, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Thu, Jun 12, 2003 at 08:23:41AM -0700, Patrick Mochel wrote:
> > Why doesn't struct acpi_device contain a struct device?
>
> Because they are not devices, only the firmware representation of them. :)
Umm. OK, smartypants :-P
But I have some devices which _only_ have a firmware representation.
For example, there's a couple of serial ports on this workstation which
can't be found any other way. Then there's the SBA and LBA devices I
mention below. These devices have basically nothing in common except
that they only have an acpi_device to represent them.
> struct acpi_device contains a kobject that is registered in
> drivers/acpi/scan.c. The hierarchy is represented in
> /sys/firmware/acpi/namespace.
>
> Ideally, when an ACPI namespace object is found, the bus on which the
> device belongs will be notified of a found device, so that it may probe,
> intiialize, and register the device properly. That will give it
> representation in /sys/devices, and ACPI could then provide a symlink
> between its object's directory and the device's directory.
>
> But, it hasn't happened yet.
hmm. so you want a serial_object, an lba_object and an sba_object?
then we can tie them together through the namespaces? I feel lost in
a maze of pointers, all subtly different.
--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: device model?
[not found] ` <20030612153024.GJ30843-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
@ 2003-06-12 15:51 ` Patrick Mochel
0 siblings, 0 replies; 4+ messages in thread
From: Patrick Mochel @ 2003-06-12 15:51 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
> But I have some devices which _only_ have a firmware representation.
> For example, there's a couple of serial ports on this workstation which
> can't be found any other way. Then there's the SBA and LBA devices I
> mention below. These devices have basically nothing in common except
> that they only have an acpi_device to represent them.
Hm, we have a name for that - motivation :)
> hmm. so you want a serial_object, an lba_object and an sba_object?
> then we can tie them together through the namespaces? I feel lost in
> a maze of pointers, all subtly different.
Heh. Basically yes, we do want those objects. At least for serial, ACPI is
used only for discovery and resource management, not for actually
communicating with the device. There should also already be a
serial_object of some sort, though there may not be a method for the
system, or firmware driver, to tell the serial core to add the device.
Something like this:
acpi_device * acpidev;
/* Scan ACPI devices */
if (is_serial_device(acpidev)) {
struct serial_device * serdev;
serdev = kmalloc(sizeof(struct serial_device),GFP_KERNEL);
/* Initialize with resource information, etc */
if (!(error = serial_add_device(serdev))) {
sysfs_create_link(&acpidev->kobj,
&serdev->dev.kobj,
"device");
sysfs_create_link(&serdev->dev.kobj,
&acpidev->kobj,
"ACPI");
}
}
should suffice, as well as add symlinks to bridge the representations.
As for the other objects, you want something similar, though the format
of representing the device and notifying the drivers is up to you..
-pat
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-06-12 15:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-12 11:56 device model? Matthew Wilcox
[not found] ` <20030612115641.GD30843-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2003-06-12 15:23 ` Patrick Mochel
[not found] ` <Pine.LNX.4.44.0306120818510.11379-100000-L1xM/EEGAB4@public.gmane.org>
2003-06-12 15:30 ` Matthew Wilcox
[not found] ` <20030612153024.GJ30843-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2003-06-12 15:51 ` Patrick Mochel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox