Provides the means to send data to the X.25 adapter.
int x25swrite (devno, uiop, chan, ext) dev_t devno; struct uio *uiop; int chan; struct x25_write_ext *ext;
|devno||Specifies major and minor device numbers.|
|uiop||Points to a uio structure.|
|chan||Identifies the channel number assigned by the x25smpx routine.|
|ext||Points to the struct x25_write_ext structure. This structure is found in the /usr/include/sys/x25user.h file.|
Note: Call-establishment or termination packets cannot be sent using this entry point.
The x25swrite entry point provides the means to send an X.25 data packet to the adapter.
For the x25swrite entry point, the uiop parameter is a pointer to a uio structure. This structure is described in the /usr/include/sys/uio.h file. The uio structure specifies the location and length of the caller's data.
This routine checks the uiop->segflag field to determine whether the data is in user space or kernel space. If the data is in kernel space, the uiop->uio_ iov ->uio_base field points to an mbuf structure chain containing the data for transmission. If the data is in user space, then the uiop->uio_iov field points to an array of iovec structures.
The data is in the form described by the mbuf structure. For a kernel-mode process, the mbuf structure containing the data should be pinned before making this call.
For session types of SESSION_SVC_OUT, SESSION_SVC_IN, or SESSION_PVC, the possible values for the packet_type field are the following:
If the value of the packet_type field is PKT_DATA and the data buffer is larger than the packet size, the data is transmitted as an X.25 packet sequence.
If a previous incoming data packet has been received with the D bit set, the incoming packet must be acknowledged with a PKT_D_BIT_ACK packet type before any further packets can be accepted by the device handler for this session.
For the x25swrite entry point, the ext parameter points to the x25_write_ext parameter block. The x25_write_ext structure contains a write_extension (we) structure and a session_id field.
The we.flag field consists of the bitwise OR of one or more of the following values:
|CIO_NOFREE_MBUF||Setting this bit causes the X.25 device handler to retain the mbuf structure after transmission is complete. If a kernel-mode process sets this bit, it must also do the following:|
|CIO_ACK_TX_DONE||Setting this bit causes the X.25 device handler to acknowledge completion by building a CIO_TX_DONE status block for the caller when the write is complete.|
The we.status field is meaningful only if the return value is EIO.
The x25swrite entry point can be called from the process environment only.
|EINVAL||Indicates that an invalid parameter was used or a write was made on a listen session.|
|EIO|| Indicates an error has occurred. The ext->status
field contains one of the following common exception codes:
The x25swrite entry point functions with an X.25 Interface Co-Processor/2 that has been correctly configured for use on a qualified network. Consult adapter specifications for more information on configuring the adapter and network qualifications.
The x25sread entry point.
Common X.25 Device Handler Structures in AIX Version 4 Kernel Extensions and Device Support Programming Concepts.
Sessions with the X.25 Device Handler in AIX Kernel Extensions and Device Support Programming Concepts.