Shudong,
thanks for that overview. Indeed, it is good starting point.
Regards,
Cyril
On 1/23/06, Shudong Zhou <szhou at billybob.sfbay.sun.com> wrote:
> > Shudong,
> >
> > Do you think it is possible to get us some info on the
> > entry points from bus_ops vector and their arguments ?
> >
> > Regards,
> > Cyril
> >
>
> Cyril,
>
> Sorry for not responding sooner. Let me start by describing
> the entry points at a high level. The details of the arguments
> are probably best learned by looking at nexus driver examples
> in the source base. I hope this is a reasonable starting point
> before getting into more details.
>
> The basic idea of bus_ops is to insulate the bus-specificness
> from adapter drivers, making it possible for a single driver to
> work for an sbus adaptor and a pci adaptor (assuming both use
> the same chip).
>
> The bus_ops definition is found in usr/include/sys/devops.h.
> A functional nexus driver must cover three areas:
> register mapping
> bus_map(), bus_map_fault()
> dma mapping
> bus_dma_*()
> interrupt routing
> bus_intr_op()
> The interrupt ops used to be handled by bus_*_intrspec(). This
> has been replaced in Solaris 10 Update 1 by bus_intr_op() to
> handle MSI-X. While there is a large number of entry points,
> most of them are only implemented once for each bus architecture.
> For example, you implement bus_*_dma() once for the top-level pci
> driver. The intermediate pci_pci bridge drivers simply inherit
> the ops from the parent nexus.
>
> In addition to be above entry points, we also have
> bus_*_event*()
> These entry points allow drivers to post events up and down
> the driver tree. They are used for hotplug drivers only (usb,
> 1394).
> bus_config/bus_unconfig
> These are for hotplug drivers which needs special handling
> when creating child devices. For example, a USB device may
> map to more than one node in the device tree. These nodes
> must be created/removed together when the device is hot
> inserted/removed.
> bus_fm_*
> These are for fault management.
> bus_power
> For power management
>
> Finally, there is bus_ctl(). This is a *required* entry point which
> implements misc. sub-operations. DDI_CTLOPS_INITCHILD is responsible
> for assigning a child's "bus address". DDI_CTLOPS_REPORTDEV simply
> prints a syslog message.
>
> Shudong
>
>