Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Jan 2001 23:45:40 +0000
From:      Paul Richards <paul@originative.co.uk>
To:        "Justin T. Gibbs" <gibbs@scsiguy.com>
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   Re: Inheritance in new-bus.
Message-ID:  <3A565CA4.3466BF11@originative.co.uk>
References:  <200101052243.f05Mh2s40409@aslan.scsiguy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"Justin T. Gibbs" wrote:
> 

> 
> Cardbus is no different than your ethernet card example.  Cardbus is
> not a child bus of PCI, but is rather a specialized implementation of

Yes, cardbus is specialized PCI, that's why inheritance would be
correct.  Ethernet is not anything like PCI though so inheritance would
be wrong.

> PCI.  Perhaps my understanding of the devclass is wrong.  I didn't
> think that it had anything to do with the bus hierarchy, but was simply
> a place for a particular class to store data about that class (for instance
> drivers for children of the bus implemented by that class).  As I metioned

No, that's what I wanted to clarify. Devclass is confusingly named since
it suggests it is in some way involved with kobjs but it isn't. In fact,
the kobj implementation has no concept of classes, a kobj is just a way
of encapsulating the methods for an ineterface and since there's no
inheritance at the moment there isn't really any purpose in classes
either. One will follow from the other I guess.

A devclass on the other hand groups together classes (not really in any
OO sense) of devices that are related to the extent that they share the
same driver. It's a somewhat overloaded structure in that if the
devclass happens to be for a bus then it holds a list of drivers for
that bus but this still doesn't have anything to do with kobj.

> in my email, I think the devclass thing won't work.  I'd rathre see
> the method table be an array of "interface structs" with the interfave
> structs having a list of method overides and an optional pointer to
> the parent interface to inherit from.
> 
> >I don't know which particular take on inheritance you've implemented, I
> >wouldn't mind getting a look at the patches :-)
> 
> Several of PCI's methods are now exported in pci_private.h.  Cardbus's
> method table now references several of these methods and occassionally
> one or more of its method overrides also calls into the PCI code to get
> some amount of work done.

Yeah, this is where inheritance would be useful.

Paul.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A565CA4.3466BF11>