Skip to content

Commit bde1504

Browse files
committed
virtio-msg: editorial changes from Peter
* add missing ')' * clarify that bus properties are advertised from the bus to the transport layer and change "driver" to bus or transport layer to more clearly show whom is targeted by the requirements * Avoid passive voice and clearly specify which element must conform * s/All encoding of values and fields/All values and fields/ * Use u8 and le16 types for virtio_msg_message * s/must be zero of Bus messages/must be zero for Bus messages/ * use ':' at end of item in list, not ';' * Add missing verb and s/posted/available in Runtime Notifications Signed-off-by: Bill Mills <bill.mills@linaro.org>
1 parent dba3557 commit bde1504

1 file changed

Lines changed: 20 additions & 19 deletions

File tree

transport-msg.tex

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ \subsubsection{Purpose}
2626

2727
\item \textbf{Reduce per-bus complexity:}
2828
Buses can implement a fully message-based workflow (including optional
29-
enumeration via \busref{GET_DEVICES} and hotplug via \busref{EVENT_DEVICE}
29+
enumeration via \busref{GET_DEVICES} and hotplug via \busref{EVENT_DEVICE})
3030
or they can discover and manage devices through
3131
alternative means such as platform firmware data. In either case, they
3232
forward transport messages to and from each device.
@@ -110,7 +110,8 @@ \subsection{Basic Concepts}
110110
\subsubsection{Transport Revisions and Maximum Message Size}
111111
\label{sec:Virtio Transport Options / Virtio Over Messages / Basic Concepts / Revisions}
112112

113-
Each \textbf{virtio-msg bus instance} advertises:
113+
Each \textbf{virtio-msg bus instance} advertises the following to the transport
114+
layer:
114115
\begin{itemize}
115116
\item A \textbf{transport revision} indicating the protocol version it
116117
supports. This revision is separate from the overall Virtio
@@ -122,19 +123,19 @@ \subsubsection{Transport Revisions and Maximum Message Size}
122123
\end{itemize}
123124

124125
These parameters \emph{MAY} vary between bus instances within the same system.
125-
The driver obtains a bus's revision, maximum message size and list of features
126-
through an \emph{implementation-defined} mechanism, which could be:
126+
The bus implementation obtains a bus's revision, maximum message size and list
127+
of features through an \emph{implementation-defined} mechanism, which could be:
127128
\begin{itemize}
128129
\item A device tree or firmware method providing bus configuration,
129130
\item A message exchange during bus setup,
130131
\item A per bus instance list of properties,
131132
\item A static definition built into the driver for a known environment.
132133
\end{itemize}
133134

134-
After learning these parameters, the driver \emph{MUST} respect them for all
135-
messages involving that bus instance. For example, it \emph{MUST NOT} send a
136-
message exceeding the \textbf{maximum message size}, and it \emph{MUST} avoid
137-
using advanced features or messages unavailable in the bus's advertised
135+
After learning these parameters, the transport layer \emph{MUST} respect them
136+
for all messages involving that bus instance. For example, it \emph{MUST NOT}
137+
send a message exceeding the \textbf{maximum message size}, and it \emph{MUST}
138+
avoid using advanced features or messages unavailable in the bus's advertised
138139
\textbf{transport revision}.
139140

140141
\paragraph{virtio-msg revisions}
@@ -188,8 +189,8 @@ \subsubsection{Configuration Generation Count}
188189
or the response to \msgref{GET_CONFIG} which also both provide the device's
189190
current configuration count. The device may change any amount of data for one
190191
generation count increment. If the change cannot fit in one \msgref{EVENT_CONFIG}
191-
message, it \emph{SHOULD} be signaled to the driver via a \msgref{EVENT_CONFIG}
192-
message with a zero data length and the new generation count.
192+
message, the device \emph{SHOULD} send an \msgref{EVENT_CONFIG} message
193+
with a zero data length and the new generation count to the driver.
193194
The device \emph{MUST NOT} provide the same generation count in
194195
multiple \msgref{EVENT_CONFIG} messages that contain non-zero length config
195196
data. The driver includes its view of the current generation count in
@@ -295,7 +296,7 @@ \subsubsection{Bus vs. Transport Messages}
295296
\subsubsection{Endianness}
296297
\label{sec:Virtio Transport Options / Virtio Over Messages / Basic Concepts / Endianness}
297298

298-
All encoding of values and fields defined in the virtio-msg messages \emph{MUST}
299+
All values and fields defined in the virtio-msg messages \emph{MUST}
299300
be encoded in little-endian.
300301

301302
\subsubsection{Common Message Format}
@@ -308,12 +309,12 @@ \subsubsection{Common Message Format}
308309
The header layout is:
309310
\begin{lstlisting}
310311
struct virtio_msg_header {
311-
uint8_t type; /* request/response + bus/transport */
312-
uint8_t msg_id; /* message id */
313-
uint16_t dev_num; /* device number (0 for bus messages) */
314-
uint16_t token; /* correlation identifier (0 for events) */
315-
uint16_t msg_size; /* total size: header (8) + payload */
316-
uint8_t payload[];
312+
u8 type; /* request/response + bus/transport */
313+
u8 msg_id; /* message id */
314+
le16 dev_num; /* device number (0 for bus messages) */
315+
le16 token; /* correlation identifier (0 for events) */
316+
le16 msg_size; /* total size: header (8) + payload */
317+
u8 payload[];
317318
};
318319
\end{lstlisting}
319320

@@ -1340,10 +1341,10 @@ \subsubsection{Optional Requirements}
13401341
\begin{itemize}
13411342
\item A device or the driver side bus \emph{MUST} send \msgref{EVENT_CONFIG}
13421343
to inform the driver of configuration of device status changes.
1343-
\item A device or the driver side bus \emph{MUST} \msgref{EVENT_USED}
1344+
\item A device or the driver side bus \emph{MUST} send \msgref{EVENT_USED}
13441345
to inform the driver of (likely) buffer completions.
13451346
\item A driver \emph{MUST} send \msgref{EVENT_AVAIL} to notify the device that
1346-
new buffers are posted.
1347+
new buffers are available.
13471348
\end{itemize}
13481349

13491350
\subsubsection{Compliance for Different Environments}

0 commit comments

Comments
 (0)