Configuration of STREAMS drivers and modules into WindNet STREAMS is dynamic and can be done any time after WindNet STREAMS has been initialized. WindNet STREAMS provides the routine strmDriverAdd( )for installing drivers, and the routine strmModuleAdd( ) for installing modules. Once installed, STREAMS applications can access the STREAMS drivers and modules.
The routine strmDriverAdd( ) configures a single STREAMS driver. You can configure multiple drivers with additional calls to strmDriverAdd( ). The parameters that must be specified are as follows:
After the routine strmDriverAdd( ) is executed, the device name specified in that call is added to the list of VxWorks devices in the system and to the list of drivers managed by WindNet STREAMS.
For example, the following code shows how to configure into WindNet STREAMS a STREAMS printer driver that has a clone device capable of selecting a printer that is not busy and that provides support for several printers with parallel interfaces:
#include "strmLib.h" /* Install the printer clone device */ strmDriverAdd ("/dev/printer", pPrinterStreamTab, TRUE, NULL,
SVR4_STYLE_OPEN, SQLVL_QUEUE); /* Install the device for the printer with minor device 1 */ strmDriverAdd ("/dev/printer1", pPrinterStreamTab, FALSE, NULL,
SVR4_STYLE_OPEN, SQLVL_QUEUE); /* Install the device for the printer with minor device 2 ... etc */ strmDriverAdd ("/dev/printer2", pPrinterStreamTab, FALSE, NULL,
SVR4_STYLE_OPEN, SQLVL_QUEUE);
To list the devices created in the VxWorks system, use the VxWorks command devs as follows:
-> devs drv name 3 /dev/printer 3 /dev/printer1 3 /dev/printer2
For more information on strmDriverAdd( ), see its manual entry.
The routine strmModuleAdd( ) configures a single STREAMS module. Multiple modules can be configured with additional calls to strmModuleAdd( ). The parameters that must be specified are as follows:
For example, the following code shows how to configure into WindNet STREAMS a STREAMS module that converts upper case letters to lower case:
#include "strmLib.h" /* Install the upper to lower case conversion module */ strmModuleAdd ("upToLow", pUptoLowStreamTab, NULL, SVR4_STYLE_OPEN, SQLVL_QUEUE);
After the driver and modules have been configured into WindNet STREAMS, you can list them with strmDriverModShow( ), described in §5.3.8 strmDriverModShow( ).
For more information on strmModuleAdd( ), see its manual entry.