| Introduction to VxBus |
|
The VxBus device driver infrastructure is fairly new to VxWorks, having been added in release 6.2. Before then drivers were not integrated with VxWorks project configurations, and therefore relied on editing the BSP directly. Now that VxBus is maturing, it's likely to be used by more drivers. Therefore the aim of this article is to introduce what VxBus is, its benefits, as well as the fundamental differences between it and older drivers. BenefitsOne of the key changes and benefits of VxBus is the configuration. Previously everything was handled by config.h and sysLib.c in the BSP directory. The VxBus model allows for driver integration and configuration within a workbench project, where as previously it required modification to the BSP. This means that individual drivers can be added to a project, configured and removed as required, all within the workbench environment. To write or integrate a VxBus driver into a BSP, knowledge of the VxBus infrastructure is important. ClassesIn VxBus there are different classes of drivers, based on the particular function the device and driver are expected to perform. These classes are:
FilesThe driver source supplied with VxWorks for each class are found in a single directory under the target/src/hwif hierarchy. Third party drivers should be placed into target/3rdparty/.
Each driver must have:
Together the cdf, dc and dr files are known as driver configuration files, and are located under target/config/comps. In each BSP, a file called hwconf.c provides configuration data in structures for each VxBus driver used in the system. This defines each hardware device and what driver should be used with it. Each driver instance can use information contained in its own resource structure in hwconf.c. This will typically include a base address for registers and any interrupt details, although any device instance specific configuration that is required can be added. The driver itself accesses this configuration using a devResourceGet call.
Figure1: Example hwconf.c file showing VxBus relationships. Show RoutinesWhen developing a VxBus driver, or using VxBus drivers in a BSP, it can very useful to find out what the status is with particular VxBus drivers. The show routines can tell the developer a lot about what is going on with any VxBus driver.
Differences & ConclusionFundamentally, a VxBus driver is similar to a non VxBus driver. The extra files to support independent configuration of each driver (by anyone building the BSP) has added a layer of complexity. For a simple driver it significantly increases the work required, and may be of little benefit. For a complex driver that may be used with multiple devices and across multiple BSPs, the VxBus configuration should prove more beneficial than the extra driver work. This has hopefully given an insight into VxBus drivers, but for more information it's worth reading the VxWorks Device Driver Developers Guides included with VxWorks. |