1PK(4) Kernel Interfaces Manual PK(4)
2
3
4
6 pk - packet driver
7
9 The packet driver implements a full-duplex end-to-end flow control
10 strategy for machine-to-machine communication. Packet driver protocol
11 is established by calling pkon(2) with a character device file descrip‐
12 tor and a desired packet size in bytes. The packet size must be a
13 power of 2, 32≤size≤4096. The file descriptor must represent an 8-bit
14 data path. This is normally obtained by setting the device in raw
15 mode (see ioctl(2)).
16
17 The actual packet size, which may be smaller than the desired packet
18 size, is arrived at by negotiation with the packet driver at the remote
19 end of the data link.
20
21 The packet driver maintains two data areas for incoming and outgoing
22 packets. The output area is needed to implement retransmission on
23 errors, and arriving packets are queued in the input area. Data arriv‐
24 ing for a file not open for reading is discarded. Initially the size
25 of both areas is set to two packets.
26
27 It is not necessary that reads and writes be multiples of the packet
28 size although there is less system overhead if they are. Read opera‐
29 tions return the maximum amount of data available from the input area
30 up to the number of bytes specified in the system call. The buffer
31 sizes in write operations are not normally transmitted across the link.
32 However, writes of zero length are treated specially and are reflected
33 at the remote end as a zero-length read. This facilitates marking the
34 serial byte stream, usually for delimiting files.
35
36 When one side of a packet driver link is shut down by close(2)or pkoff
37 (see pkon(2)), read(2) on the other side will return 0, and write on
38 the other side will raise a SIGPIPE signal.
39
41 pkon(2), pkopen(3)
42
43
44
45 local PK(4)