Re: newbus questions




On 16.03.2006, at 15:06, Artem 'ZaZooBred' Ignatiev wrote:

On Thu, 16/03/2006 12:35 +0100, Milan Obuch wrote:

....

1. How to create the bus itself, and properly describe its interfaces?
skeletons of bus-driver and frontend-drivers would be a GREAT help.

Being far from everything knowing hacker, I just can help with what I found
when working on something totally unrelated.
First you need to write .m file describing your methods - they are class
description, kind of. There are couple of them - maybe PCI analogy (pci_if.m
and pcib_if.m) could help a little to understand their role. Then you can use
these methods in your device_method_t array describing your device. Actually,
these definitions are something like software bus between parent and child
device. And maybe you could get some clue looking at bktr driver, which could
be somehow related to your are of interest.

Yes, I've got some clearance in how that <something>_if.m files are
written, but bktr driver is too complex for me to understand how the
things are done right now. I'll look at it again, though, maybe I could
understand the logic of how such things are done, when I could clearly
separate generic logic from implementation of particular hardware
driver.

Okay, now I have got the bus device, the child device. My current trouble is
that I want bus driver to provide some methods to child drivers.

So I created saa_bus_if.m file, declared some methods there, made implementation
in bus driver and added them using
DEVICE_METHOD(saa_bus_some_method, saa_some_method_impl),

and added the saa_bus_if.c to child driver SRCS.

Now, when I do SAA_BUS_SOME_METHOD(card, ...) inside bus driver, it works just as
expected. But when I do SAA_BUS_SOME_METHOD(device_get_parent (subdev), ...)
inside subdriver, it happens that KOBJLOOKUP(...) returns pointer to generic
function (which returns ENXIO) rather than pointer to my implementation.

The questions are:
Am I going the Right Way(tm) when exporting functions to child drivers like that?
If yes, what I must do in order to get the real implementation, not the default one?
If no, what is The Right Way(tm)?

Thanks in advance.
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Problem while linking sdbus.lib file, also AddDevice is crahsing when a call to IoAttachDeviceTo
    ... ntStatus = STATUS_SUCCESS; ... // Initialize the driver object with this driver's entry points. ... // can send an ioctl to the bus driver. ...
    (microsoft.public.development.device.drivers)
  • Re: An Architectural Question
    ... a bus dirver does not help for individual instances of the hardware since ... > under the control of the particular driver and a collection of device ... > am wondering if the bus driver approach will be cleaner. ... >> If you mean multiple instances of the same device, ...
    (microsoft.public.development.device.drivers)
  • Re: Elite student 1, Bus-driver 0
    ... Based on what I read it was the bus driver who first got physical. ... However the bus driver decided to break the law. ... the Singapore laws to detain anyone. ...
    (soc.culture.singapore)
  • Re: Bus driver leaves four-year-old at strangers house
    ... house to return and pick him up later. ... Now a Dayton ISD bus driver is suspended for what happened ... That bus driver is in hot water for leaving the child alone while ... Cameron was apparently crying when he told his school bus driver he had ...
    (alt.true-crime)
  • Re: Receiving IOCTLs in a KMDF bus driver
    ... devices for IOCTL handling, so your child drivers were sending the IOCTL to ... the PDO and you were processing it. ... queue handler to the bus driver so that PDO can see IOCTL's. ...
    (microsoft.public.development.device.drivers)