Model VIP1017
Version 3.0.0 April 20, 1999
Copyright 1997
É: Interface Consultants
:È
3375 Westpark
Drive #143, Houston, TX 77005-4262
713/529-3706
Table of Contents
1. Introduction
2. Installation of the software
3. AIX 4.1.5 Installation
4. AIX 4.1.5 De-Installation
5. AIX 4.2.0 Installation
6. AIX 4.2.0 De-Installation
7. Device Configuration
8. vpioctl.h header file
9. viptest - test plot and programming example
10. vipdma - file dma output program
11. Miscellaneous Notes
12. Revision History
The Interface Consultants’ Model VIP1017
Versatile-Interface-PCI for AIX 4.1.5 and 4.2 is a complete hardware
and software solution to interface high speed Versatec and Centronics (a.k.a.
IBM parallel) devices to IBM RS/6000 workstations with PCI busses running
the AIX operating system.
The solution consists of a PCI bus
interface card that allows selection of Versatec TTL, Versatec Differential,
or Centronics hardware interfaces, and AIX device drivers for AIX version
4.1.5 and AIX 4.2.
A device driver interface definition
file, vpioctl.h, is provided that allows an application programmer to write
applications that interface to the output device.
A test program ‘viptest’ is provided
(with C source code) that produces both print and plot mode data.
A file output program ‘vipdma’ is also
provided that allows files to be output using high speed DMA to a printer,
or a plotter in print or plot mode. This program is a good starting point
for an application programmer that needs to write an program to output
to a printer or plotter.
Note: no other plotting or printing
application software is provided with this product. It is assumed that
the purchaser of this package has the expertise to write a plot application,
or already has one that supports this driver.
The device driver supports the operation
of multiple PCI boards, up to 8 boards, on a single machine. The driver
will identify the boards as devices vip0, vip2, ..., vip7.
Disclaimer: Marks copyright Interface
Consultants, or Xerox.
2. Installation
of the software
Overview:
Shutdown and power off the machine.
Install the PCI adapter card.
Boot the machine.
Login as root.
Install the device driver with ‘smit’.
Test the configuration.
The VIP1017 device driver software
can be easily installed through the ‘smit’ (System Management Interface
Tool) feature of AIX. The install floppies included have been designed
to install the VIP1017 device driver software automatically. The floppies
contain what is known as an ‘installp’ image.
There are two ways to invoke ‘smit’.
If you are running an X-Windows terminal, typing ‘smit’ will invoke a graphical
GUI based version of ‘smit’. If you type ‘smitty’, it will invoke a charcter
(or text) based interface. If you are running telnet, or a character based
terminal, you will get the text based version with either the ‘smit’ or
‘smitty’ command.
This manual shows the screens from
the text based version of ‘smit’. The GUI version has the same menu items,
but selection is with the mouse, and data entry is slightly different.
See the AIX documentation and/or the ‘info’ database for more information
on ‘smit’ operation.
IMPORTANT: Before starting ‘smit’,
make sure you know what version of AIX the machine is running. Use the
‘oslevel’ command to determine which version you are running:
# oslevel
4.1.5.0
# oslevel
4.2.0.0
you are logged into the directory in
which the VIP file resides.
The easiest way to access ‘smit’ is
through an AIX terminal prompt. e.g.
# smit [enter]
This pulls up the menu that follows.
Using the cursor keys or mouse, highlight
the Software Installation and Maintenance selection and hit enter
or select with mouse.
Here is a synopsis on what each of
these four options does:
List All Adapters:
This option lists all of the boards
(along with their assigned names) that have been detected and configured
at power-on. The status of the boards should be Available. If
any changes are made to the setup after power-on, the status of the boards
may change to Defined, or they may be undefined and not show up
on the listing at all.
NOTE: Boards must be Available
for
user to access them. User cannot access boards while they are Defined
or
undefined.
Change/Show Adapter:
This option allows you to select a board and view/change the following attributes:
This option allows you to select a
board and prompts you to input whether it is defined or not. Selecting
no
will remove the board as a device even if it is not physically removed
from the machine. Selecting yes
will put the board in Defined status.
Note: If you wish to reinstall
a board removed with this option, see the section on Installation of
the Software.
Configure Adapter:
This configures the board to the specifications
you have made and changes its status to Available. Use this option
to make Available any device that is in Defined status.
You should make any necessary changes
you wish to perform at this time. After each VIP board is configured to
your standards, you can exit SMIT and test the plotter(s).
1. Insert the disk labeled AIX 4.1.5
in the floppy drive.
2. Login as ‘root’ and start ‘smit’
or ‘smitty’
3. Using the cursor keys or mouse,
highlight the Software
Installation and Maintenance
selection and hit enter or select with mouse. (Note: bold
italics indicates the highlighted
selection)
Move cursor to desired item and
press Enter.
Software Installation and Maintenance
Software License Management
Devices
System Storage Management (Physical & Logical Storage)
Security & Users
Communications Applications and Services
Print Spooling
Problem Determination
Performance & Resource Scheduling
System Environments
Processes & Subsystems
Applications
Using SMIT (information only)
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
4. Using the cursor keys or mouse,
highlight the Install
and Update Software
selection and hit enter or select with mouse.
Software Installation and Maintenance
Move cursor to desired item and
press Enter.
Install and Update Software
Maintain Installed Software
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
Move cursor to desired item and
press Enter.
Install Bundles of Software (Easy Install)
Install/Update Selectable Software (Custom Install)
Copy Software to Hard Disk for Future Installation
List All Software on Installation Media
List All Problems Fixed by Software on Installation Media
List User Instructions for Update Media
Clean Up After an Interrupted
Installation
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
6. Using the cursor keys or mouse, highlight the Install Software Products at Latest Level
selection and hit enter or select with
mouse.
Install/Update Selectable Software
(Custom Install)
Move cursor to desired item and
press Enter.
Install Software Products at Latest Level
Install Bundles of Software
Install Fileset Updates by Fix
Install Additional Printer/Plotter Software
Install Additional Device Software
Install/Update From All Available
Software
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
7.
Using the cursor keys or mouse, highlight the
Install New Software Products at Latest Level selection
and hit enter or select with mouse.
Install Software Products at
Latest Level
Move cursor to desired item and
press Enter.
Install New Software Products at Latest Level
Update Currently Installed Software
to Latest Level
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
8. Hit F4 to get the pop down list.
Using the cursor keys or mouse, highlight the
/dev/fd0 (Diskette Drive)selection
and hit enter or select with mouse.
Install Software Products at
Latest Level
Type or select a value for the entry field.
Press Enter AFTER making all
desired changes.
[Entry Fields]
INPUT device / directory for
software [] +
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x INPUT device / directory for software x
x x
x Move cursor to desired item and press Enter. x
x x
x /dev/fd0 (Diskette Drive) x
x /dev/cd0 (SCSI Multimedia CD-ROM Drive) x
x x
x F1=Help F2=Refresh F3=Cancel x
F1x Esc+8=Image Esc+0=Exit Enter=Do x
Esx /=Find n=Find Next x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
9.
Hit enter or select with mouse to continue the install process.
Install Software Products at
Latest Level
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
* INPUT device / directory for software /dev/fd0
* SOFTWARE to install [all_licensed] +
PREVIEW only? (install operation will NOT occur) no +
COMMIT software updates? yes +
SAVE replaced files? no +
ALTERNATE save directory []
AUTOMATICALLY install requisite software? yes +
EXTEND file systems if space needed? yes +
OVERWRITE same or newer versions? no +
VERIFY install and check file sizes? no +
Include corresponding LANGUAGE filesets? yes +
DETAILED output? no +
F1=Help F2=Refresh F3=Cancel F4=List
Esc+5=Reset Esc+6=Command Esc+7=Edit Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
10. Hit enter or select with mouse
to perform the install process.
Install Software Products at
Latest Level
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
* INPUT device / directory for software /dev/fd0
* SOFTWARE to install [all_licensed] +
PREVIEW only? (install operation will NOT occur) no +
COMMIT software updates? yes +
SAVE replaced files? no +
ALTERNATE save directory []
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk+
x ARE YOU SURE? x+
x x+
x Continuing may delete information you may want x+
x to keep. This is your last chance to stop x+
x before continuing. x+
x Press Enter to continue. x
x Press Cancel to return to the application. x
x x
F1x F1=Help F2=Refresh F3=Cancel x
Esx Esc+8=Image Esc+0=Exit Enter=Do x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
11. The software will install. Wait
for the Command field to change from RUNNING to OK (good completion) or
FAILED (an error has occurred). Hit the down arrow key or select with mouse
to see if the ‘vip’ devices are ‘available’.
COMMAND STATUS
Command: OK stdout: yes stderr:
no
Before command completion, additional
instructions may appear below.
[TOP]
installp -qacgNX -d VPE -f File
2>&1
File:
vdd.vip 2.6.0.0.all
vdd.vipsrc 2.6.0.0.all
+-----------------------------------------------------------------------------+
Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
[MORE...49]
F1=Help F2=Refresh F3=Cancel Esc+6=Command
Esc+8=Image Esc+9=Shell Esc+0=Exit /=Find
n=Find Next
12. Installation is complete. Hit F3
or select with mouse return to the previous screen, or <control-C> to
exit..
COMMAND STATUS
Command: OK stdout: yes stderr:
no
Before command completion, additional
instructions may appear below.
[MORE...33]
+-----------------------------------------------------------------------------+
Installing Software...
+-----------------------------------------------------------------------------+
installp: APPLYING software for:
vdd.vipsrc 2.6.0.0
vdd.vip 2.6.0.0
vip.config running cfgmgr
vip0 Available 04-01 N/A
vip1 Available 04-03 N/A
Finished processing all filesets. (Total time: 23 secs).
[MORE...16]
F1=Help F2=Refresh F3=Cancel Esc+6=Command
Esc+8=Image Esc+9=Shell Esc+0=Exit /=Find
n=Find Next
# ls -l
total 128
-rwxr-xr-x 1 root system 19082 Feb 03 10:40 vipdma
-rw-r----- 1 root system 17707 Feb 03 10:48 vipdma.c
-rwxr-xr-x 1 root system 6581 Feb 03 10:40 viptest
-rw-r----- 1 root system 4104 Feb 03 10:48 viptest.c
-rw-r----- 1 root system 5319 Feb 03 10:48 vpioctl.h
# pwd
/usr/lpp/vdd/vipsrc
To remove the device driver software:
1. Login as ‘root’ and start ‘smit’
or ‘smitty’
2. Using the cursor keys or mouse,
highlight the Software
Installation and Maintenance
selection and hit enter or select with mouse. (Note: bold
italics indicates the highlighted
selection)
System Management
Move cursor to desired item and
press Enter.
Software Installation and Maintenance
Software License Management
Devices
System Storage Management (Physical & Logical Storage)
Security & Users
Communications Applications and Services
Print Spooling
Problem Determination
Performance & Resource Scheduling
System Environments
Processes & Subsystems
Applications
Using SMIT (information only)
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
3. Using the cursor keys or mouse,
highlight the Maintain
Installed Software
selection and hit enter or select with mouse.
Software Installation and Maintenance
Move cursor to desired item and
press Enter.
Install and Update Software
Maintain Installed Software
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
4.
Using the cursor keys or mouse, highlight the Remove
Software Products
selection and hit enter or select with mouse.
Maintain Installed Software
Move cursor to desired item and
press Enter.
List Installed Software
Commit Applied Software Updates (Remove Saved Files)
Reject Applied Software Updates (Use Previous Version)
Remove Software Products
Clean Up After an Interrupted Installation
Check Software File Sizes After Installation
Verify Software Requisites and
Installations
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
5. Hit F4 or select with mouse to pop
up the list of installed software.
Remove Software Products
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
* SOFTWARE name [] +
PREVIEW only? (remove operation will NOT occur) yes +
REMOVE dependent software? no +
DETAILED output? no +
F1=Help F2=Refresh F3=Cancel F4=List
Esc+5=Reset Esc+6=Command Esc+7=Edit Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
6. Hit ‘/’ to
enter the search mode, and hit vdd <Enter>’ to search for the driver.
Remove Software Products
Tylqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
Prx SOFTWARE name x
x x
x Move cursor to desired item and press Esc+7. x
* x ONE OR MORE items can be selected. x+
x Press Enter AFTER making all selections. x+
x x+
x [TOP] x+
x X11.Dt.ToolTalk x
x X11.Dt.helpmin x
x X11.Dt.helprun x
x X11.Dt.lib x
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Find x
x x
x Enter Search Pattern. x
x x
x [vdd] x
x x
Fx F1=Help F2=Refresh F3=Cancel x
Ex Esc+8=Image Esc+0=Exit Enter=Do x
Emqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
7. Hit F7 to select vdd.vip and hit the down arrow key and hit F7 to selectvdd.vipsrc.
Note: if F7 does not work, hit <Esc> the ‘7’.
Hit <Enter> to use the selected
entries.
Remove Software Products
Tylqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
Prx SOFTWARE name x
x x
x Move cursor to desired item and press Esc+7. x
* x ONE OR MORE items can be selected. x+
x Press Enter AFTER making all selections. x+
x x+
x [MORE...181] x+
x devices.tty.rte x
x ipfx.adt x
x ipfx.msg.en_US.adt x
x ipfx.msg.en_US.rte x
x ipfx.rte x
x > vdd.vip x
x > vdd.vipsrc x
x xlC.C x
x [MORE...7] x
x x
x F1=Help F2=Refresh F3=Cancel x
F1x Esc+7=Select Esc+8=Image Esc+0=Exit x
Esx Enter=Do /=Find n=Find Next x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
8.
Hit F4 to enter the list mode, and hit the down arrow to highlight the
‘no’ entry, and hit <enter> to select.
Remove Software Products
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
* SOFTWARE name [vdd.vip vdd.vipsrc] +
PREVIEW only? (remove operation will NOT occur) yes +
REMOVE dependent software? no +
DETAILED output? no +
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x PREVIEW only? (remove operation will NOT occur) x
x x
x Move cursor to desired item and press Enter. x
x x
x yes x
x no x
x x
x F1=Help F2=Refresh F3=Cancel x
F1x Esc+8=Image Esc+0=Exit Enter=Do x
Esx /=Find n=Find Next x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
9. Hit <enter>’ to select the removal
options.
Remove Software Products
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
* SOFTWARE name [vdd.vip vdd.vipsrc] +
PREVIEW only? (remove operation will NOT occur) no +
REMOVE dependent software? no +
DETAILED output? no +
F1=Help F2=Refresh F3=Cancel F4=List
Esc+5=Reset Esc+6=Command Esc+7=Edit Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
10.
Hit <enter>’ to remove the device driver software.
Remove Software Products
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
* SOFTWARE name [vdd.vip vdd.vipsrc] +
PREVIEW only? (remove operation will NOT occur) no +
REMOVE dependent software? no +
DETAILED output? no +
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x ARE YOU SURE? x
x x
x Continuing may delete information you may want x
x to keep. This is your last chance to stop x
x before continuing. x
x Press Enter to continue. x
x Press Cancel to return to the application. x
x x
F1x F1=Help F2=Refresh F3=Cancel x
Esx Esc+8=Image Esc+0=Exit Enter=Do x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
11.When the Status changes from running
to OK, the de-installation is complete. Use the arrow keys to scroll through
the status display. Hit F3 to return to the previous screen, or <Control-C>
to exit ‘smit’.
COMMAND STATUS
Command: OK stdout: yes stderr:
no
Before command completion, additional
instructions may appear below.
[TOP]
+-----------------------------------------------------------------------------+
Pre-deinstall Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...
SUCCESSES
---------
Filesets listed in this section passed pre-deinstall verification
and will be removed.
[MORE...54]
F1=Help F2=Refresh F3=Cancel Esc+6=Command
Esc+8=Image Esc+9=Shell Esc+0=Exit /=Find
n=Find Next
1. Insert the disk labeled AIX 4.1.5
in the floppy drive.
2. Login as ‘root’ and start ‘smit’
or ‘smitty’
3. Using the cursor keys or mouse,
highlight the Software
Installation and Maintenance
selection and hit enter or select with mouse. (Note: bold
italics indicates the highlighted
selection)
System Management
Move cursor to desired item and
press Enter.
Software Installation and Maintenance
Software License Management
Devices
System Storage Management (Physical & Logical Storage)
Security & Users
Communications Applications and Services
Print Spooling
Problem Determination
Performance & Resource Scheduling
System Environments
Processes & Subsystems
Applications
Using SMIT (information only)
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
4. Using the cursor keys or mouse,
highlight the Install
and Update Software
selection and hit enter or select with mouse.
Software Installation and Maintenance
Move cursor to desired item and
press Enter.
Install and Update Software
List Software and Related Information
Software Maintenance and Utilities
System Backup Manager
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
5.
Using the cursor keys or mouse, highlight
Update Installed Software to Latest Level (Update All) selection
and hit enter or select with mouse.
Install and Update Software
Move cursor to desired item and
press Enter.
Install and Update from LATEST Available Software
Update Installed Software to Latest Level (Update All)
Install and Update Software by Package Name (includes devices and printers)
Install Software Bundle (Easy Install)
Update Software by Fix (APAR)
Install and Update from ALL Available
Software
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
8. Hit F4 to get the pop down list.
Using the cursor keys or mouse, highlight the
/dev/fd0 (Diskette Drive)selection
and hit enter or select with mouse.
Install and Update from LATEST
Available Software
Type or select a value for the entry field.
Press Enter AFTER making all
desired changes.
[Entry Fields]
* INPUT device / directory for
software [] +
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x INPUT device / directory for software x
x x
x Move cursor to desired item and press Enter. x
x x
x /dev/cd0 (SCSI Multimedia CD-ROM Drive) x
x /dev/fd0 (Diskette Drive) x
x x
x F1=Help F2=Refresh F3=Cancel x
F1x Esc+8=Image Esc+0=Exit Enter=Do x
Esx /=Find n=Find Next x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
9.
Hit enter or select with mouse to continue the install process.
Install and Update from LATEST
Available Software
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
* INPUT device / directory for software /dev/fd0
* SOFTWARE to install [_all_latest] +
PREVIEW only? (install operation will NOT occur) no +
COMMIT software updates? yes +
SAVE replaced files? no +
AUTOMATICALLY install requisite software? yes +
EXTEND file systems if space needed? yes +
OVERWRITE same or newer versions? no +
VERIFY install and check file sizes? no +
Include corresponding LANGUAGE filesets? yes +
DETAILED output? no +
F1=Help F2=Refresh F3=Cancel F4=List
Esc+5=Reset Esc+6=Command Esc+7=Edit Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
10. Hit enter or select with mouse
to perform the install process.
Install and Update from LATEST
Available Software
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
* INPUT device / directory for software /dev/fd0
* SOFTWARE to install [_all_latest] +
PREVIEW only? (install operation will NOT occur) no +
COMMIT software updates? yes +
SAVE replaced files? no +
AUTOMATICALLY install requisite software? yes +
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk+
x ARE YOU SURE? x+
x x+
x Continuing may delete information you may want x+
x to keep. This is your last chance to stop x+
x before continuing. x
x Press Enter to continue. x
x Press Cancel to return to the application. x
x x
F1x F1=Help F2=Refresh F3=Cancel x
Esx Esc+8=Image Esc+0=Exit Enter=Do x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
11. The software will install. Wait
for the Command field to change from RUNNING to OK (good completion) or
FAILED (an error has occurred). Hit the down arrow key or select with mouse
to see if the ‘vip’ devices are ‘available’.
COMMAND STATUS
Command: OK stdout: yes stderr:
no
Before command completion, additional
instructions may appear below.
[TOP]
installp -acgNqQwXd /dev/fd0
-f File 2>&1
File:
vdd.vip 2.6.0.0
vdd.vipsrc 2.6.0.0
+-----------------------------------------------------------------------------+
Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...
[MORE...45]
F1=Help F2=Refresh F3=Cancel Esc+6=Command
Esc+8=Image Esc+9=Shell Esc+0=Exit /=Find
n=Find Next
ROOT:fldrs01:/home/vip26# lsdev -CH |grep vip
vip0 Available 04-01 N/A
vip1 Available 04-03 N/A
ROOT:fldrs01:/home/vip26#
System Management
Move cursor to desired item and
press Enter.
Software Installation and Maintenance
Software License Management
Devices
System Storage Management (Physical & Logical Storage)
Security & Users
Communications Applications and Services
Print Spooling
Problem Determination
Performance & Resource Scheduling
System Environments
Processes & Subsystems
Applications
Using SMIT (information only)
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
Devices
Move cursor to desired item and
press Enter.
[TOP]
Install/Configure Devices Added After IPL
Printer/Plotter
TTY
Asynchronous Adapters
PTY
Console
Fixed Disk
Disk Array
CD ROM Drive
Read/Write Optical Drive
Diskette Drive
Tape Drive
Communication
Graphic Displays
Graphic Input Devices
[MORE...8]
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
Printer/Plotter
Move cursor to desired item and
press Enter.
Printer/Plotter Devices
Print Spooling
Interface Consultants PCI Adapter
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
Interface Consultants PCI Adapter
Move cursor to desired item and
press Enter.
List All Adapters
Change/Show Adapter
Remove Adapter
Configure Adapter
F1=Help F2=Refresh F3=Cancel Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
COMMAND STATUS
Command: OK stdout: yes stderr:
no
Before command completion, additional
instructions may appear below.
name status location description
vip0 Available 04-01 N/A
vip1 Available 04-03 N/A
F1=Help F2=Refresh F3=Cancel Esc+6=Command
Esc+8=Image Esc+9=Shell Esc+0=Exit /=Find
n=Find Next
Interface Consultants PCI Adapter
Move cursor to desired item and
press Enter.
List All Adapters
Change/Show Adapter
Remove Adapter
Configure Adapter
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Adapter x
x x
x Move cursor to desired item and press Enter. x
x x
x vip0 Available 04-01 N/A x
x vip1 Available 04-03 N/A x
x x
x F1=Help F2=Refresh F3=Cancel x
x Esc+8=Image Esc+0=Exit Enter=Do x
F1x /=Find n=Find Next x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
Change/Show Adapter
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
Adapter to change vip0
Handshake Speed [0] +#
Device timeout (seconds) [30] +#
DMA xfer [1] +#
Apply to ODM Only no +
F1=Help F2=Refresh F3=Cancel F4=List
Esc+5=Reset Esc+6=Command Esc+7=Edit Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
COMMAND STATUS
Command: OK stdout: yes stderr:
no
Before command completion, additional
instructions may appear below.
vip0 changed
F1=Help F2=Refresh F3=Cancel Esc+6=Command
Esc+8=Image Esc+9=Shell Esc+0=Exit /=Find
n=Find Next
Interface Consultants PCI Adapter
Move cursor to desired item and
press Enter.
List All Adapters
Change/Show Adapter
* Remove Adapter
Configure Adapter
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Adapter x
x x
x Move cursor to desired item and press Enter. x
x x
x vip0 Available 04-01 N/A x
x vip1 Available 04-03 N/A x
x x
x F1=Help F2=Refresh F3=Cancel x
x Esc+8=Image Esc+0=Exit Enter=Do x
F1x /=Find n=Find Next x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
Remove Adapter
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
PCI Adapter vip0
Keep defined yes +
F1=Help F2=Refresh F3=Cancel F4=List
Esc+5=Reset Esc+6=Command Esc+7=Edit Esc+8=Image
Esc+9=Shell Esc+0=Exit Enter=Do
Remove Adapter
Type or select values in entry fields.
Press Enter AFTER making all
desired changes.
[Entry Fields]
PCI Adapter vip0
Keep defined yes +
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x ARE YOU SURE? x
x x
x Continuing may delete information you may want x
x to keep. This is your last chance to stop x
x before continuing. x
x Press Enter to continue. x
x Press Cancel to return to the application. x
x x
F1x F1=Help F2=Refresh F3=Cancel x
Esx Esc+8=Image Esc+0=Exit Enter=Do x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
COMMAND STATUS
Command: OK stdout: yes stderr:
no
Before command completion, additional
instructions may appear below.
vip0 Defined
F1=Help F2=Refresh F3=Cancel Esc+6=Command
Esc+8=Image Esc+9=Shell Esc+0=Exit /=Find
n=Find Next
Interface Consultants PCI Adapter
Move cursor to desired item and
press Enter.
List All Adapters
Change/Show Adapter
Remove Adapter
Configure Adapter
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Adapter x
x x
x Move cursor to desired item and press Enter. x
x x
x vip0 Defined 04-01 N/A x
x vip1 Available 04-03 N/A x
x x
x F1=Help F2=Refresh F3=Cancel x
x Esc+8=Image Esc+0=Exit Enter=Do x
F1x /=Find n=Find Next x
Esmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
COMMAND STATUS
Command: OK stdout: yes stderr:
no
Before command completion, additional
instructions may appear below.
vip0 Available
F1=Help F2=Refresh F3=Cancel Esc+6=Command
Esc+8=Image Esc+9=Shell Esc+0=Exit /=Find
n=Find Next
vpioctl.h header
file
This file is installed in the directory /usr/include
Contents:
#ifndef _VPIOCTL_H_
#define _VPIOCTL_H_
#define VIOCTL ('V'<<8)
#define VPLT_FF VIOCTL + 1 /* form feed pulsed command */
#define VPLT_EOT VIOCTL + 2 /* eot pulsed command */
#define VPLT_CLEAR VIOCTL + 3 /* clear pulsed command */
#define VPLT_RLT VIOCTL + 4 /*
remote line terminate pulsed command */
#define VPLT_PRINT VIOCTL + 5 /* print mode */
#define VPLT_PLOT VIOCTL + 6
/* plot mode */
#define VPLT_LSTAT VIOCTL + 7 /* return last status */
#define VPLT_CSTAT VIOCTL + 8 /* return current status */
#define VPLT_REST VIOCTL + 9
/* reset */
struct VIPStatusStruct
{
uchar PresentMode;
uchar LatchedFunctionRegister;
uchar InterfaceStatusRegister;
uchar DeviceStatusRegister;
};
/* ioctl comaptible with the SunOS vp driver */
#define VPRINT 0100 /* set to print mode 0x040 */
#define VPLOT 0200 /* set to plot mode 0x080 */
#define VPRINTPLOT 0400 /* set to spp mode 0x100 */
#define VPC_TERMCOM 0040 /* pulse remote line terminate 0x20 */
#define VPC_FFCOM 0020 /* pulse ff 0x10*/
#define VPC_EOTCOM 0010 /* pulse eot 0x08 */
#define VPC_CLRCOM 0004 /* pulse clear 0x04 */
#define VPC_RESET 0002 /* pulse
reset to plotter 0x02*/
#define VPSC_BUSY 0400000
#define VPSC_ONLN 0002000
#define VPSC_VRDY 0001000
#define VPSC_MODE 0000700
#define VPSC_SPP 0000400
#define VPSC_PLOT 0000200
#define VPSC_PRINT 0000100
#define VPSC_CMDS 0000076
#define VPSC_OPEN 0000001
struct lp_regs {
unsigned short cisreg ; /* interface status reg */
unsigned short cdsreg ; /* device status reg */
};
#define VGETSTATE _IOR('v', 0, int)
#define VSETSTATE _IOW('v', 1, int)
#define LPGETREGS _IOR('v',10,struct lp_regs)
#define LPSETTIMVAL _IOW('v',11,int)
#define LPGETTIMVAL _IOR('v',12,int)
/* VIP register bits */
#define VIP_10115_PCI_ID 0xd5111501
#define VIP_10117_PCI_ID 0xd5111701
/* Register Addresses */
#define INTERRUPT_MASK LATCHED_FUNCTION
#define MODE_REGISTER DEVICE_TIMING
#define INTERFACE_CONTROL PULSED_FUNCTION
#define LATCHED_FUNCTION 0x00
#define DEVICE_TIMING 0x04
#define DEVICE_CONTROL 0x08 /* ECP */
#define PULSED_FUNCTION 0x0c
#define INTERFACE_STATUS 0x10
#define DEVICE_STATUS 0x14
#define REVERSE_DATA 0x18 /* ECP */
#define AUTO_LTR_COUNT_LOW 0x20
#define AUTO_LTR_COUNT_HI 0x30
#define PIO_BYTE_OUT 0x40
#define COMMAND_OUT 0x48
#define PIO_OUT_32 0x50
/* Latched functions: register read/write */
#define L_FLTM 0x01 /* enable centronics fault irq */
#define L_NSLM 0x02 /* enable not-selected/off-line irq */
#define L_NPPM 0x04 /* enable out-of-paper irq */
#define L_NFLM 0x10 /* enable not full irq */
#define L_NHFM 0x20 /* enable not half full irq */
#define L_EMTM 0x40 /* enable fifo empty irq */
#define L_DIRM 0x80 /* enable
device and interface ready irq */
/* Device timing: register read/write */
#define T_SPD0 0x01 /* Handshake timing selection 0 */
#define T_SPD1 0x02 /* Handshake timing selection 1 */
#define T_SWIZ 0x04 /* Byte Swizzle */
#define T_IBSY 0x10 /* Ignore Busy */
#define T_UBSY 0x20 /* Use Busy, not ACK */
#define T_REVD 0x40 /* Reverse Data */
#define T_4EDG 0x80 /* 4 edge
handshake */
/* Device Control (ECP): register read/write */
#define E_AINT 0x01 /* Assert nINIT*/
#define E_DSEL 0x02 /* De-assert SEL IN*/
#define E_AAFD 0x04 /* Assert nAutoFd */
#define E_ASTB 0x08 /* Assert Strobe */
#define E_STBD 0x20 /* Disable Auto Strobe */
#define E_RDYD 0x40 /* Disable READY*/
#define E_FRDY 0x80 /* Forece
READY */
/* Pulsed functions: register read/write */
#define P_REST 0x01 /* reset versatec device */
#define P_RINT 0x20 /* reset irq latch */
#define P_SWAK 0x40 /* software ack */
#define P_MCLR 0x80 /* master
clear for board */
/* Interface status: register read */
#define I_8BIT 0x01 /* 8 bit data path */
#define I_PRNT 0x02 /* print mode */
#define I_NFLL 0x04 /* fifo not full */
#define I_NHFL 0x08 /* fifo not half full */
#define I_EMPT 0x10 /* fifo empty */
#define I_INTF 0x20 /* interrupting */
#define I_DRDY 0x40 /* device ready */
#define I_DIRY 0x80 /* device
and interface ready, fifo empty */
/* Device status: register read */
#define D_CFLT 0x01 /* 1 = centronic fault asserted */
#define D_ONLN 0x02 /* 1 = device selected (online) */
#define D_PMTY 0x04 /* 1 = paper empty */
#define D_CBSY 0x08 /* 1 = centronics busy asserted */
#define D_VRDY 0x10 /* 1 = Versatec ready asserted */
#define D_CENT 0x20 /* 0 = centronics selected */
#define D_VDIF 0x40 /* 0 = Versatec differential selected */
#define D_VTTL 0x80 /* 0 = Versatec
TTL selected */
/* Command Out functions: register write */
#define C_VCLR 0x41 /* Versatec clear */
#define C_VTFF 0x42 /* Versatec form feed */
#define C_VEOT 0x44 /* Versatec EOT */
#define C_VLTR 0x48 /* Versatec line terminate */
#define C_VPRN 0x20 /* Versatec print/plot mode */
#define C_VPLT 0x21 /* Versatec print/plot mode */
#define C_VSPP 0x22 /* Versatec spp mode OR'd into C_VPRN or C_VPLT */
#define C_DSTR_OFF 0x00 /* Data streaming off */
#define C_DSTR_ON 0x01 /* Data streaming on */
#define C_ALTR_OFF 0x00 /* Auto LTR off */
#define C_ALTR_ON 0x10 /* Auto
LTR on */
#endif /* #ifndef _VPIOCTL_H_
*/
Purpose:
Assigns register values to constants.
Description:
This header file contains all the #defined
constants which were used in the device driver routine to substitute for
register values. This file is #included in any program that needs to access
the device. It defines the IOCTL interface to the driver and the meaning
of the return status.
9. viptest
- test plot and programming example
The viptest program is provided with C source code as an example
of how to write a user program that interfaces to the vip device driver.
Typing './viptest' with no parameters prints the following synopsis:
# ./viptest
VIP driver test program - Version 2.6 June 6, 1997
Copyright Interface Consultants
1997
Usage: viptest -f<device name>
-f<device name> (e.g. /dev/vip0)
output test print and plot to
device
The following is the screen output from a call to the Viptest program:
# ./viptest -f /dev/vip1
VIP driver test program - Version 2.6 June 6, 1997
Copyright Interface Consultants 1997
device name = /dev/vip1
block = 0 cnt=1000
block = 1 cnt=2000
block = 2 cnt=3000
block = 3 cnt=4000
. . .
block = 57 cnt=58000
block = 58 cnt=59000
block = 59 cnt=60000
#
The plotter output for viptest is the
word 'hello' output in print mode, followed by black and white stripes
of plot mode data (4 nibs on, 4 nibs off). Thermal plotters will plot in
yellow and white.
To advance the plot out of the plotter,
do a manual form feed, or output a form feed command using vipdma as follows:
# ./vipdma -w/dev/vip0 -cVTFF
This source file and executable file
are installed in the directory /usr/lpp/vdd/vipsrc
/* VIP driver test program - Version 2.6 June 6, 1997*/
/* Copyright Interface Consultants Houston, Texas 1997*/
/* 713/529-3706 */
/* this test program outputs 'hello' in print mode, and then
does dma plot mode of blocks filled with 0xf0. There are
100 blocks sent. The first block is 1000 bytes, and each
block is increased in size by 1000 bytes until it rolls
over the 16 bit max. */
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <unistd.h> /*Needed
for access subroutine constants*/
#include "vpioctl.h"
int file_ptr;
/*************************************************************************/
uint test_print (int file_ptr,char
*string) {
uint rc;
int length;
rc = ioctl(file_ptr, VPLT_PRINT, NULL);
if (rc != 0) {
printf("Error on test_print ioctl VPLT_PRINT, rc=%d\n",rc,length);
exit(-1);
}
length = strlen(string);
rc = write(file_ptr,string,length);
if (rc != length) {
printf("Error on test_print write, rc=%d length=%d\n",rc,length);
exit(-1);
}
return(0);
}
/*************************************************************************/
int test_plot (int file_ptr,char
*string,uint byte_count) {
uint rc;
rc = ioctl(file_ptr, VPLT_PLOT, NULL);
if (rc != 0) {
printf("Error on test_plot VPLT_PLOT, rc=%d\n",rc);
exit(-1);
}
rc = write(file_ptr,string,byte_count);
if (rc != byte_count) {
printf("Error on test_plot write, rc=%d byte_count=%d\n",rc,byte_count);
exit(-1);
}
return(0);
}
/*************************************************************************/
void dma_file (char *devname) {
uint i;
char *plot_data;
uint pd_count;
uint blk_count;
int rc;
file_ptr = open(devname,O_WRONLY);
if (file_ptr == -1) {
printf("Error opening device %s, errno=%d\n",devname,errno);
exit(-1);
}
rc = test_print(file_ptr,"hello \r\n");
if (rc != 0) {
return;
}
pd_count = 0xf000;
blk_count = 1000;
plot_data = (char *)malloc(pd_count);
if (plot_data == NULL) {
printf("cannot allocate test buffer of %u bytes\n",pd_count);
return;
}
for (i=0;i<pd_count;i++) {
plot_data[i] = 0xf0;
}
for (i=0; i< 60;i++) {
printf("block = %u cnt=%u\n",i,blk_count);
rc = test_plot(file_ptr,plot_data,blk_count);
blk_count += 1000; /* note: this will roll over after 65 or so */
}
}
/*************************************************************************/
void useage (void) {
printf("\nUsage: viptest -f<device name>\n");
printf(" -f<device name> (e.g. /dev/vip0) \n");
printf(" output test print and plot to device\n");
}
/*************************************************************************/
int main(int argc, char ** argv)
{
int c;
/*************************************************************/
/* print opening banner */
/*************************************************************/
printf("VIP driver test program - Version 2.6 June 6, 1997\n");
printf(" Copyright Interface
Consultants 1997\n");
if (argc == 1) {
useage();
exit (-1);
}
/*****************************************************************/
/* get command line arguments */
/*****************************************************************/
while (1) {
c = getopt(argc,argv,"f:");
if (c != EOF) {
c = tolower(c);
switch(c) {
case 'f':
printf("device name = %s\n",optarg);
dma_file(optarg);
break;
default:
printf("Unknown parameter 0x%x %c\n",c,c);
useage();
break;
}
}
else {
break;
}
}
return 0;
}
/*************************************************************************/
10.
vipdma - file dma output program
The 'vipdma' program allows files to
be output to a plotter or printer in print or plot mode using high speed
DMA. vipdma is double buffered, and executes command line functions in
a left to right order as entered. vipdma is full featured, in that it can
perform any plotter function that a user program can issue.
Typing './vipdma' with no parameters
prints the following synopsis:
# ./vipdma
VIP driver DMA output program - Version 2.6 June 6, 1997
Copyright Interface Consultants
1997
Usage: vipdma -w<> [-d<>] [-m<>] [-f<>] [-c<>] [-v] [-t<>]
-w<output device> (required- e.g. /dev/vip0)
-d<dma_sizein Kb> (optional - default=16 max=128)
-m<mode> mode for transfer, PRINT(default) or PLOT
-f<filename> data file to dma to port
-c<command> Remote command to plotter, can be:
VRST - Versatec Remote Reset
VCLR - Versatec Remote Clear
VTFF - Versatec Remote Form Feed
VEOT - Versatec End or Terminate
VRLT - Versatec Remote Line Terminate
CSTAT - Get current status
LSTAT - Get latched status
VPRINT - Versatec Print Mode
VPLOT - Versatec Plot Mode
VPRINTPLOT - Versatec SPP Mode
VPC_TERMCOM - Versatec Remote Line Terminate
VPC_FFCOM - Versatec Remote Form Feed
VPC_EOTCOM - Versatec End or Terminate
VPC_CLRCOM - Versatec Remote Clear
VPC_RESET - Versatec Remote Reset
VGETSTATE - Get Versatec VPSC Status
LPGETREGS - Get Versatec registers
LPGETTIMVAL - Get Versatec timeout value
-t<timeout> LPSETTIMVAL - Set Versatec timeout
-v verbose mode
Note: args are executed left to right as found, multiple files in
different modes can be sent in a single command.
e.g. vipdma -w/dev/vip0 -d32 -mPRINT -ffile1.prn -mPLOT -ffile2.plt
sends file1.prn in print mode, and then file2.plt in plot mode
#
Full Versatec 'greensheet' output can
be implemented with VIPdma if preamble and rewind commands are put into
files that are output in print mode, and plot data padded to the correct
bytes per scan in color separate files is output in plot mode.
This source file and executable file
are installed in the directory /usr/lpp/vdd/vipsrc
/* VIP driver DMA output program - Version 2.6 June 6, 1997 */
/* Copyright Interface Consultants Houston, Texas 1997*/
/* 713/529-3706 */
/* this program outputs files
in print or plot DMA mode */
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <unistd.h> /*Needed for access subroutine constants*/
#include <sys/ioctl.h>
#include "vpioctl.h"
#define TRUE 1
#define FALSE 0
struct VIPStatusStruct VIPStatus;
int verbose;
char *plot_data;
ulong pd_cnt;
uint timeout;
int file_ptr = -1;
/*************************************************************************/
void dma_one_block(char *string,ulong
byte_count) {
ulong rc;
if (file_ptr == -1) {
printf("Error device not open - use -w<> at start of command\n");
exit(-1);
}
rc = write(file_ptr,string,byte_count);
if (rc != byte_count) {
printf("Error on test_print write, rc=%d length=%d\n",rc,byte_count);
exit(-1);
}
}
/*************************************************************************/
void dma_file (char *file_name)
{
int file_handle;
uint rc;
char *buff1;
char *buff2;
char *buff;
ulong buff_cnt;
ulong rd_cnt;
if (file_ptr == -1) {
printf("Error device not open - use -w<> at start of command\n");
exit(-1);
}
/* open the file */
file_handle = open(file_name,O_RDONLY);
if (file_handle == -1) {
printf("Error - unable to open file: %s\n",file_name);
exit(-1);
}
/* allocate the data buffers */
buff1 = (char *)malloc(pd_cnt);
if (buff1 == (char *)NULL) {
printf("Error - unable to allocate 1st buffer: %ld bytes\n",pd_cnt);
exit(-1);
}
if (verbose == TRUE) printf("Allocated buff1 of %ld bytes\n",pd_cnt);
buff2 = (char *)malloc(pd_cnt);
if (buff2 == (char *)NULL) {
printf("Error - unable to allocate 2nd buffer: %ld bytes\n",pd_cnt);
exit(-1);
}
if (verbose == TRUE) printf("Allocated
buff2 of %ld bytes\n",pd_cnt);
/* set the first buffer pointer*/
plot_data = buff1;
/* output the file */
while (1) {
/* read a buffer full */
buff_cnt = 0;
while (1) {
rd_cnt = pd_cnt - buff_cnt; /* how many left to read */
if (rd_cnt > 65534L) { /* limit each read to max */
rd_cnt = 65534L;
}
buff = (char *) ((char *)plot_data
+ buff_cnt);
rc = read(file_handle,buff,(uint)rd_cnt);
/* can only read 64K */
buff_cnt += rc;
if (buff_cnt >= pd_cnt) {
/*printf("Buffer Full\n");*/
break;
}
if (rc == 0) {
/*printf("End of File rc==0\n");*/
break;
}
}
/* output the buffer if there is anything in it */
if (buff_cnt != 0) {
/*printf("Outputting one buffer cnt=%lu\n",buff_cnt);*/
dma_one_block(plot_data,buff_cnt);
}
else {
/*printf("Not Outputting one buffer cnt=%lu\n",buff_cnt);*/
break;
}
/* toggle the buffer pointers */
if (plot_data == buff1) {
plot_data = buff2;
}
else {
plot_data = buff1;
}
}
if (buff1 != (char *)NULL) {
free(buff1);
if (verbose == TRUE) printf("Freed buff1\n");
}
if (buff2 != (char *)NULL) {
free(buff2);
if (verbose == TRUE) printf("Freed buff2\n");
}
}
/*************************************************************************/
void issue_cmd (char *cmd_str)
{
int rc;
int Command;
struct lp_regs regs;
if (verbose == TRUE) printf("issue_cmd
cmd_str = %s\n",cmd_str);
if (file_ptr == -1) {
printf("Error device not open - use -w<> at start of command\n");
exit(-1);
}
if (!strcmp(cmd_str,"VRST")) {
if (verbose == TRUE) printf("cmd = VRST\n");
rc = ioctl(file_ptr, VPLT_REST, NULL);
if (rc != 0) {
printf("Error on ioctl VRST, rc=%d\n",rc);
exit(-1);
}
return;
}
if (!strcmp(cmd_str,"VCLR")) {
if (verbose == TRUE) printf("cmd = VCLR\n");
rc = ioctl(file_ptr, VPLT_CLEAR, NULL);
if (rc != 0) {
printf("Error on ioctl VCLR, rc=%d\n",rc);
exit(-1);
}
return;
}
if (!strcmp(cmd_str,"VTFF")) {
if (verbose == TRUE) printf("cmd = VTFF\n");
rc = ioctl(file_ptr, VPLT_FF, NULL);
if (rc != 0) {
printf("Error on ioctl VTFF, rc=%d\n",rc);
exit(-1);
}
return;
}
if (!strcmp(cmd_str,"VEOT")) {
if (verbose == TRUE) printf("cmd = VEOT\n");
rc = ioctl(file_ptr, VPLT_EOT, NULL);
if (rc != 0) {
printf("Error on ioctl VEOT, rc=%d\n",rc);
exit(-1);
}
return;
}
if (!strcmp(cmd_str,"VRLT")) {
if (verbose == TRUE) printf("cmd = VRLT\n");
rc = ioctl(file_ptr, VPLT_RLT, NULL);
if (rc != 0) {
printf("Error on ioctl VRLT, rc=%d\n",rc);
exit(-1);
}
return;
}
if (!strcmp(cmd_str,"CSTAT")) {
if (verbose == TRUE) printf("cmd = CSTAT\n");
rc = ioctl(file_ptr, VPLT_CSTAT, &VIPStatus);
if (rc != 0) {
printf("Error on ioctl VPLT_CSTAT, rc=%d\n",rc);
exit(-1);
}
printf("CSTAT - status PresentMode = 0x%x\n",VIPStatus.PresentMode);
printf("CSTAT - status LatchedFunctionRegister = 0x%x\n",VIPStatus.LatchedFunctionRegister);
printf("CSTAT - status InterfaceStatusRegister = 0x%x\n",VIPStatus.InterfaceStatusRegister);
printf("CSTAT - status DeviceStatusRegister
= 0x%x\n",VIPStatus.DeviceStatusRegister);
return;
}
if (!strcmp(cmd_str,"LSTAT")) {
if (verbose == TRUE) printf("cmd = LSTAT\n");
rc = ioctl(file_ptr, VPLT_LSTAT, &VIPStatus);
if (rc != 0) {
printf("Error on ioctl VPLT_LSTAT, rc=%d\n",rc);
exit(-1);
}
printf("LSTAT - status PresentMode = 0x%x\n",VIPStatus.PresentMode);
printf("LSTAT - status LatchedFunctionRegister = 0x%x\n",VIPStatus.LatchedFunctionRegister);
printf("LSTAT - status InterfaceStatusRegister = 0x%x\n",VIPStatus.InterfaceStatusRegister);
printf("LSTAT - status DeviceStatusRegister
= 0x%x\n",VIPStatus.DeviceStatusRegister);
return;
}
/* VPRINT*/
if (!strcmp(cmd_str,"VPRINT")) {
if (verbose == TRUE) printf("cmd = VPRINT\n");
Command = VPRINT;
rc = ioctl(file_ptr, VSETSTATE, &Command);
if (rc != 0) {
printf("Error on ioctl VPRINT, rc=%d\n",rc);
exit(-1);
}
return;
}
/* VPLOT */
if (!strcmp(cmd_str,"VPLOT")) {
if (verbose == TRUE) printf("cmd = VPLOT\n");
Command = VPLOT;
rc = ioctl(file_ptr, VSETSTATE, &Command);
if (rc != 0) {
printf("Error on ioctl VPLOT, rc=%d\n",rc);
exit(-1);
}
return;
}
/* VPRINTPLOT */
if (!strcmp(cmd_str,"VPRINTPLOT")) {
if (verbose == TRUE) printf("cmd = VPRINTPLOT\n");
Command = VPRINTPLOT;
rc = ioctl(file_ptr, VSETSTATE, &Command);
if (rc != 0) {
printf("Error on ioctl VPRINTPLOT, rc=%d\n",rc);
exit(-1);
}
return;
}
/* VPC_TERMCOM */
if (!strcmp(cmd_str,"VPC_TERMCOM")) {
if (verbose == TRUE) printf("cmd = VPC_TERMCOM\n");
Command = VPC_TERMCOM;
rc = ioctl(file_ptr, VSETSTATE, &Command);
if (rc != 0) {
printf("Error on ioctl VPC_TERMCOM, rc=%d\n",rc);
exit(-1);
}
return;
}
/* VPC_FFCOM */
if (!strcmp(cmd_str,"VPC_FFCOM")) {
if (verbose == TRUE) printf("cmd = VPC_FFCOM\n");
Command = VPC_FFCOM;
rc = ioctl(file_ptr, VSETSTATE, &Command);
if (rc != 0) {
printf("Error on ioctl VPC_FFCOM, rc=%d\n",rc);
exit(-1);
}
return;
}
/* VPC_EOTCOM */
if (!strcmp(cmd_str,"VPC_EOTCOM")) {
if (verbose == TRUE) printf("cmd = VPC_EOTCOM\n");
Command = VPC_EOTCOM;
rc = ioctl(file_ptr, VSETSTATE, &Command);
if (rc != 0) {
printf("Error on ioctl VPC_EOTCOM, rc=%d\n",rc);
exit(-1);
}
return;
}
/* VPC_CLRCOM */
if (!strcmp(cmd_str,"VPC_CLRCOM")) {
if (verbose == TRUE) printf("cmd = VPC_CLRCOM\n");
Command = VPC_CLRCOM;
rc = ioctl(file_ptr, VSETSTATE, &Command);
if (rc != 0) {
printf("Error on ioctl VPC_CLRCOM, rc=%d\n",rc);
exit(-1);
}
return;
}
/* VPC_RESET */
if (!strcmp(cmd_str,"VPC_RESET")) {
if (verbose == TRUE) printf("cmd = VPC_RESET\n");
Command = VPC_RESET;
rc = ioctl(file_ptr, VSETSTATE, &Command);
if (rc != 0) {
printf("Error on ioctl VPC_RESET, rc=%d\n",rc);
exit(-1);
}
return;
}
if (!strcmp(cmd_str,"VGETSTATE")) {
if (verbose == TRUE) printf("cmd = VGETSTATE\n");
rc = ioctl(file_ptr, VGETSTATE, &Command);
if (rc != 0) {
printf("Error on ioctl VGETSTATE, rc=%d\n",rc);
exit(-1);
}
printf("VGETSTATE - status = 0x%x octal=%o\n",Command,Command);
if ((Command & VPSC_BUSY) == VPSC_BUSY) {
printf("VGETSTATE - VPSC_BUSY\n");
}
if ((Command & VPSC_ONLN) == VPSC_ONLN) {
printf("VGETSTATE - VPSC_ONLN\n");
}
if ((Command & VPSC_VRDY) == VPSC_VRDY) {
printf("VGETSTATE - VPSC_VRDY\n");
}
if ((Command & VPSC_SPP) == VPSC_SPP) {
printf("VGETSTATE - VPSC_SPP\n");
}
if ((Command & VPSC_PLOT) == VPSC_PLOT) {
printf("VGETSTATE - VPSC_PLOT\n");
}
if ((Command & VPSC_PRINT) == VPSC_PRINT) {
printf("VGETSTATE - VPSC_PRINT\n");
}
if ((Command & VPSC_OPEN) == VPSC_OPEN) {
printf("VGETSTATE - VPSC_OPEN\n");
}
return;
}
/* LPGETREGS */
if (!strcmp(cmd_str,"LPGETREGS")) {
if (verbose == TRUE) printf("cmd = LPGETREGS\n");
rc = ioctl(file_ptr, LPGETREGS, ®s);
if (rc != 0) {
printf("Error on ioctl LPGETREGS, rc=%d\n",rc);
exit(-1);
}
printf("LPGETREGS - cisreg = 0x%x\n",regs.cisreg);
printf("LPGETREGS - cdsreg = 0x%x\n",regs.cdsreg);
return;
}
/* LPSETTIMVAL */
if (!strcmp(cmd_str,"LPSETTIMVAL")) {
if (verbose == TRUE) printf("cmd = LPSETTIMVAL\n");
Command = timeout;
rc = ioctl(file_ptr, LPSETTIMVAL, &Command);
if (rc != 0) {
printf("Error on ioctl LPSETTIMVAL, rc=%d\n",rc);
exit(-1);
}
printf("LPSETTIMVAL - timeout = %d \n",Command);
return;
}
/* LPGETTIMVAL */
if (!strcmp(cmd_str,"LPGETTIMVAL")) {
if (verbose == TRUE) printf("cmd = LPGETTIMVAL\n");
rc = ioctl(file_ptr, LPGETTIMVAL, &Command);
if (rc != 0) {
printf("Error on ioctl LPGETTIMVAL, rc=%d\n",rc);
exit(-1);
}
printf("LPGETTIMVAL - timeout = %d \n",Command);
return;
}
printf("Error - invalid command: %s\n",cmd_str);
exit(-1);
}
/*************************************************************************/
void useage (void) {
printf("\nUsage: vipdma -w<> [-d<>] [-m<>] [-f<>] [-c<>] [-v] [-t<>]\n");
printf(" -w<output device> (required- e.g. /dev/vip0)\n");
printf(" -d<dma_sizein Kb> (optional - default=16 max=128)\n");
printf(" -m<mode> mode for transfer, PRINT(default) or PLOT\n");
printf(" -f<filename> data file to dma to port\n");
printf(" -c<command> Remote command to plotter, can be:\n");
printf(" VRST - Versatec Remote Reset\n");
printf(" VCLR - Versatec Remote Clear\n");
printf(" VTFF - Versatec Remote Form Feed\n");
printf(" VEOT - Versatec End or Terminate\n");
printf(" VRLT - Versatec Remote Line Terminate\n");
printf(" CSTAT - Get current status\n");
printf(" LSTAT - Get latched status\n");
printf(" \n");
printf(" VPRINT - Versatec Print Mode\n");
printf(" VPLOT - Versatec Plot Mode\n");
printf(" VPRINTPLOT - Versatec SPP Mode\n");
printf(" VPC_TERMCOM - Versatec Remote Line Terminate\n");
printf(" VPC_FFCOM - Versatec Remote Form Feed\n");
printf(" VPC_EOTCOM - Versatec End or Terminate\n");
printf(" VPC_CLRCOM - Versatec Remote Clear\n");
printf(" VPC_RESET - Versatec Remote Reset\n");
printf(" VGETSTATE - Get Versatec VPSC Status\n");
printf(" LPGETREGS - Get Versatec registers\n");
printf(" LPGETTIMVAL - Get Versatec timeout value\n");
printf(" -t<timeout> LPSETTIMVAL
- Set Versatec timeout\n");
printf(" -v verbose mode\n");
printf("Note: args are executed left to right as found, multiple files in \n");
printf(" different modes can be sent in a single command.\n");
printf(" e.g. vipdma -w/dev/vip0 -d32 -mPRINT -ffile1.prn -mPLOT -ffile2.plt\n");
printf(" sends file1.prn in print
mode, and then file2.plt in plot mode\n");
}
/*************************************************************************/
int main(int argc, char ** argv)
{
char *mode_str = NULL;
char *file_str = NULL;
char *cmd_str = NULL;
char *dma_str = NULL;
char *timeout_str = NULL;
uint dma_size;
int c;
/*************************************************************/
/* print opening banner */
/*************************************************************/
printf("VIP driver DMA output program - Version 2.6 June 6, 1997\n");
printf(" Copyright Interface
Consultants 1997\n");
if (argc == 1) {
useage();
exit (-1);
}
verbose = FALSE;
pd_cnt = 16 * 1024; /* 16kb default
*/
/*****************************************************************/
/* get command line arguments */
/*****************************************************************/
while (1) {
c = getopt(argc,argv,"w:c:d:f:m:p:t:v");
if (c != EOF) {
c = tolower(c);
switch(c) {
case 'w':
file_str = optarg;
if (verbose == TRUE) printf("device= %s\n",optarg);
file_ptr = open(optarg,O_WRONLY);
if (file_ptr == -1) {
printf("Error opening device %s, errno=%d\n",optarg,errno);
exit(-1);
}
break;
case 'c':
cmd_str = optarg;
if (verbose == TRUE) printf("cmd_str = %s\n",cmd_str);
issue_cmd(cmd_str);
break;
case 'd':
dma_str = optarg;
if (verbose == TRUE) printf("dma_str = %s\n",dma_str);
dma_size = (uint)strtol(dma_str,(char**) NULL,0);
if (verbose == TRUE) printf("dma_size = %d\n",dma_size);
if (dma_size > 128) {
printf("Warning - DMA size of %d exceeds max using DMA size = 128\n",dma_size);
dma_size = 128;
}
pd_cnt = (ulong)dma_size * 1024L;
break;
case 'f':
file_str = optarg;
if (verbose == TRUE) printf("file_str = %s\n",file_str);
dma_file(file_str);
break;
case 'm':
mode_str = optarg;
if (verbose == TRUE) printf("mode_str = %s\n",mode_str);
if (!strcmp(mode_str,"PLOT")) {
ioctl(file_ptr, VPLT_PLOT, NULL);
if (verbose == TRUE) printf("mode = PLOT\n");
}
else if (!strcmp(mode_str,"PRINT")) {
ioctl(file_ptr, VPLT_PRINT, NULL);
if (verbose == TRUE) printf("mode = PRINT\n");
}
else {
printf("Error mode not PRINT or PLOT: %s \n",mode_str);
printf("Exiting after DMA complete\n");
exit(-1);
}
break;
case 'v':
verbose = TRUE;
if (verbose == TRUE) printf("verbose = TRUE\n");
break;
case 't':
timeout_str = optarg;
if (verbose == TRUE) printf("timeout_str = %s\n",timeout_str);
timeout = (uint)strtol(timeout_str,(char**) NULL,0);
if (verbose == TRUE) printf("timeout = %d\n",timeout);
issue_cmd("LPSETTIMVAL");
break;
default:
if (verbose == TRUE) printf("Unknown parameter 0x%x %c \n",c,c);
break;
}
}
else {
if (verbose == TRUE) printf("End of arg list\n");
break;
}
}
return (0);
}
/*************************************************************************/
06/07/97
2.6.0 - full commercial release version
- AIX 4.1.5 and AIX 4.2.0