Next: Linux Device Driver
Up: Operation
Previous: I/O register detail
This section explains how to get a control right and
how to read/write data on P-PCI-LV.
To have the control right means that the interface has
a right to determine the direction of data transfer.
- get the control right.
- set 1 into RUNMOD in Mode register
and then set 0 into PRV in Mode register for getting PRV.
- Read Status register.
- If PRV bit in Status register is set,
another board already has the control right.
Thus, this board sets 1 into PRV bit in Mode register
for becoming non-PRV board.
- Check the direction of data transfer. For input,
the DIR bit in Mode register should be 1 if another board
has the control right. The bit should be 0 if this board
has the control right. For output, the bit should be 0
if another board has the control right.
The bit should be 1 if this board has the control right.
Otherwise, the direction error occurs. You should check
the direction and corrects it.
- Read/Write operation(as PCI bus master)
- Check the specified data size.
- Enables the forced-end interrupt and
the normal-end interrupt.
- On the write operation, data in user's buffer
should be copied into kernel buffer.
- Set the physical address of data buffer into
Transfer address register of P-PCI-LV.
- Set the byte count to be transferred into
Transfer count register of P-PCI-LV.
The value subtracted by 1 should be written.
- Set this board in master mode(start DMA).
- Wait for an interrupt, forced-end,
normal-end or timeout interrupt.
If the timeout occurred, returns with error condition.
Otherwise, go next step.
- Get actual length of data transferred,
from RetLength register in P-PCI-LV.
On the read operation, data should be copied
into user's buffer.
- Return with the actual length.
Next: Linux Device Driver
Up: Operation
Previous: I/O register detail
Yoshiji Yasu
2002年08月06日 18時03分20秒