| <link rel="stylesheet" href="../style.css" /> |
| |
| [TOC] |
| # fuchsia.hardware.network |
| |
| <div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div> |
| |
| |
| ## **PROTOCOLS** |
| |
| ## Device {#Device} |
| *Defined in [fuchsia.hardware.network/device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=95)* |
| <p>A Network Device.</p> |
| |
| |
| ### Clone {#Device.Clone} |
| |
| <p>Establishes a new connection to this device.</p> |
| <ul> |
| <li>request <code>device</code> the server end for the new connection.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Device.Clone_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>device</code></td> |
| <td> |
| <code>server_end<<a class='link' href='#Device'>Device</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### GetInfo {#Device.GetInfo} |
| |
| <p>Obtain information about device</p> |
| <ul> |
| <li>response <code>info</code> device information.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Device.GetInfo_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Device.GetInfo_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>info</code></td> |
| <td> |
| <code><a class='link' href='#DeviceInfo'>DeviceInfo</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetPort {#Device.GetPort} |
| |
| <p>Connects to a port the given <code>id</code>.</p> |
| <ul> |
| <li>request <code>id</code> port to connect to.</li> |
| <li>request <code>port</code> server end of port channel.</li> |
| </ul> |
| <p><code>port</code> is closed with a <code>ZX_ERR_NOT_FOUND</code> epitaph if no port with <code>id</code> |
| exists.</p> |
| |
| |
| |
| #### Request {#Device.GetPort_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>id</code></td> |
| <td> |
| <code><a class='link' href='#PortId'>PortId</a></code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>port</code></td> |
| <td> |
| <code>server_end<<a class='link' href='#Port'>Port</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### GetPortWatcher {#Device.GetPortWatcher} |
| |
| <p>Connects a <a class='link' href='#PortWatcher'>PortWatcher</a> to this device.</p> |
| <ul> |
| <li>request <code>watcher</code> server end of watcher channel.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Device.GetPortWatcher_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>watcher</code></td> |
| <td> |
| <code>server_end<<a class='link' href='#PortWatcher'>PortWatcher</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### OpenSession {#Device.OpenSession} |
| |
| <p>Opens a new session with the network device.</p> |
| <ul> |
| <li>request <code>session_name</code> is used as a debugging label attached to this |
| session.</li> |
| <li>request <code>session_info</code> contains the necessary information to setup the |
| session's data exchange.</li> |
| </ul> |
| <ul> |
| <li>response <code>session</code> a handle to control the session.</li> |
| <li>response <code>fifos</code> data-plane FIFOs attached to the session.</li> |
| </ul> |
| <ul> |
| <li>error <code>ZX_ERR_NOT_SUPPORTED</code> if <code>session_info</code> contains not supported |
| frame types or descriptors set up.</li> |
| <li>error <code>ZX_ERR_INVALID_ARGS</code> if <code>session_info</code> is missing fields or |
| contains invalid information.</li> |
| <li>error <code>ZX_ERR_INTERNAL</code> if the data VMO is rejected by the underlying |
| device.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Device.OpenSession_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>session_name</code></td> |
| <td> |
| <code>string[64]</code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>session_info</code></td> |
| <td> |
| <code><a class='link' href='#SessionInfo'>SessionInfo</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| #### Response {#Device.OpenSession_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#Device_OpenSession_Result'>Device_OpenSession_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ## DeviceInstance {#DeviceInstance} |
| *Defined in [fuchsia.hardware.network/instance.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/instance.fidl;l=15)* |
| <p>An instance of a network device exposed on devfs.</p> |
| |
| |
| ### GetDevice {#DeviceInstance.GetDevice} |
| |
| <p>Connects to the <a class='link' href='#Device'>Device</a> implementation.</p> |
| <ul> |
| <li>request <code>device</code> device handle.</li> |
| </ul> |
| |
| |
| |
| #### Request {#DeviceInstance.GetDevice_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>device</code></td> |
| <td> |
| <code>server_end<<a class='link' href='#Device'>Device</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## Diagnostics {#Diagnostics} |
| *Defined in [fuchsia.hardware.network/diagnostics.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/diagnostics.fidl;l=10)* |
| <p>Provides two way communications between device and upper layers to exchange |
| device health information.</p> |
| <div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: HEAD</span></div> |
| |
| |
| ### LogDebugInfoToSyslog {#Diagnostics.LogDebugInfoToSyslog} |
| |
| <p>Requests that the device produces debugging information in the system |
| logs.</p> |
| <p>The call returns once device debug information has been produced.</p> |
| |
| |
| |
| #### Request {#Diagnostics.LogDebugInfoToSyslog_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Diagnostics.LogDebugInfoToSyslog_Response} |
| |
| <EMPTY> |
| |
| ## MacAddressing {#MacAddressing} |
| *Defined in [fuchsia.hardware.network/mac.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/mac.fidl;l=21)* |
| |
| |
| ### AddMulticastAddress {#MacAddressing.AddMulticastAddress} |
| |
| <p>Adds multicast address to the list of multicast groups.</p> |
| <p>The list of multicast addresses kept is untouched by calls to <code>SetMode</code>. |
| If the device's mode is not <code>MULTICAST_FILTER</code>, the list of multicast |
| addresses is ignored.</p> |
| <ul> |
| <li>request <code>address</code> multicast address to add to the list.</li> |
| </ul> |
| <ul> |
| <li>response <code>status</code> <code>ZX_ERR_INVALID_ARGS</code> if <code>address</code> is not a |
| multicast address.</li> |
| </ul> |
| |
| |
| |
| #### Request {#MacAddressing.AddMulticastAddress_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>address</code></td> |
| <td> |
| <code><a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#MacAddress'>MacAddress</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| #### Response {#MacAddressing.AddMulticastAddress_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>status</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetUnicastAddress {#MacAddressing.GetUnicastAddress} |
| |
| <p>Gets the Device's current unicast MAC address.</p> |
| <p>Implementers of this API do not need to return a uniquely identifiable |
| MAC; the unicast address returned is the one that is <em>currently</em> in use |
| to filter unicast frames, or that identifies the device on a link it's |
| <em>currently</em> on. Users of this API must not rely on the stability or |
| uniqueness of the returned value to identify or disambiguate device |
| instances.</p> |
| <ul> |
| <li>response <code>address</code> device's unicast MAC address.</li> |
| </ul> |
| |
| |
| |
| #### Request {#MacAddressing.GetUnicastAddress_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#MacAddressing.GetUnicastAddress_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>address</code></td> |
| <td> |
| <code><a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#MacAddress'>MacAddress</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### RemoveMulticastAddress {#MacAddressing.RemoveMulticastAddress} |
| |
| <p>Removes multicast address from the list of multicast groups.</p> |
| <ul> |
| <li>request <code>address</code> multicast address to remove from the list.</li> |
| </ul> |
| <ul> |
| <li>response <code>status</code> <code>ZX_ERR_INVALID_ARGS</code> if <code>address</code> is not a |
| multicast address.</li> |
| </ul> |
| |
| |
| |
| #### Request {#MacAddressing.RemoveMulticastAddress_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>address</code></td> |
| <td> |
| <code><a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#MacAddress'>MacAddress</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| #### Response {#MacAddressing.RemoveMulticastAddress_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>status</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### SetMode {#MacAddressing.SetMode} |
| |
| <p>Sets requested operating mode of this device to <code>mode</code>.</p> |
| <p>The requested mode is attached to the current client connection to the |
| device. Because multiple clients can be attached to the same device at |
| once, the mode with the least restrictions is the one actively put into |
| effect into the underlying device implementation.</p> |
| <p>If the device does not support the requested mode, but supports a mode |
| that is more open than the requested one, <code>SetMode</code> succeeds regardless. |
| Otherwise, if the device only supports <em>more restrictive</em> modes than the |
| one requested, <code>SetMode</code> returns <code>ZX_ERR_NOT_SUPPORTED</code>.</p> |
| <p>Clients must be aware that the resource being accessed is shared, and |
| that the device may be effectively operating at a more open level than |
| the one that was requested (although never at one more restrictive).</p> |
| <ul> |
| <li>request <code>mode</code> request mode to attach to.</li> |
| </ul> |
| <ul> |
| <li>response <code>status</code> <code>ZX_ERR_NOT_SUPPORTED</code> it the device only supports |
| mode more restrictive than the one requested.</li> |
| </ul> |
| |
| |
| |
| #### Request {#MacAddressing.SetMode_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>mode</code></td> |
| <td> |
| <code><a class='link' href='#MacFilterMode'>MacFilterMode</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| #### Response {#MacAddressing.SetMode_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>status</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ## Port {#Port} |
| *Defined in [fuchsia.hardware.network/port.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=115)* |
| <p>A logical port belonging to a <a class='link' href='#Device'>Device</a>.</p> |
| |
| |
| ### Clone {#Port.Clone} |
| |
| <p>Establishes a new connection to this port.</p> |
| <ul> |
| <li>request <code>port</code> the server end for the new connection.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Port.Clone_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>port</code></td> |
| <td> |
| <code>server_end<<a class='link' href='#Port'>Port</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### GetCounters {#Port.GetCounters} |
| |
| <p>Retrieves a snapshot of traffic counters on this port.</p> |
| <div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 10</span></div> |
| |
| |
| |
| #### Request {#Port.GetCounters_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Port.GetCounters_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>payload</code></td> |
| <td> |
| <code><a class='link' href='#PortGetCountersResponse'>PortGetCountersResponse</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetDevice {#Port.GetDevice} |
| |
| <p>Connects to the <a class='link' href='#Device'>Device</a> this port belongs to.</p> |
| <ul> |
| <li>request <code>device</code> grants access to the parent device.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Port.GetDevice_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>device</code></td> |
| <td> |
| <code>server_end<<a class='link' href='#Device'>Device</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### GetDiagnostics {#Port.GetDiagnostics} |
| |
| <p>Grants access to <a class='link' href='#Diagnostics'>Diagnostics</a> for this port.</p> |
| <ul> |
| <li>request <code>diagnostics</code> grants access to diagnostics information.</li> |
| </ul> |
| <div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: HEAD</span></div> |
| |
| |
| |
| #### Request {#Port.GetDiagnostics_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>diagnostics</code></td> |
| <td> |
| <code>server_end<<a class='link' href='#Diagnostics'>Diagnostics</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### GetInfo {#Port.GetInfo} |
| |
| <p>Obtain information about port.</p> |
| <ul> |
| <li>response <code>info</code> port information.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Port.GetInfo_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Port.GetInfo_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>info</code></td> |
| <td> |
| <code><a class='link' href='#PortInfo'>PortInfo</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetMac {#Port.GetMac} |
| |
| <p>Connects to a <a class='link' href='#MacAddressing'>MacAddressing</a> associated with the port.</p> |
| <ul> |
| <li>request <code>mac</code> mac handle. Closed with <code>ZX_ERR_NOT_SUPPORTED</code> if this |
| port does not support mac addressing.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Port.GetMac_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>mac</code></td> |
| <td> |
| <code>server_end<<a class='link' href='#MacAddressing'>MacAddressing</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### GetStatus {#Port.GetStatus} |
| |
| <p>Obtain the operating port status.</p> |
| <ul> |
| <li>response <code>status</code> snapshot of port's current status.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Port.GetStatus_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Port.GetStatus_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>status</code></td> |
| <td> |
| <code><a class='link' href='#PortStatus'>PortStatus</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetStatusWatcher {#Port.GetStatusWatcher} |
| |
| <p>Connects to a <a class='link' href='#StatusWatcher'>StatusWatcher</a> to observe port status changes.</p> |
| <ul> |
| <li>request <code>watcher</code> handle to the status watcher.</li> |
| <li>request <code>buffer</code> the number of status changes that the client requests |
| to be stored by <code>StatusWatcher</code>. Values are capped at |
| <a class='link' href='#MAX_STATUS_BUFFER'>MAX_STATUS_BUFFER</a>. A value of 0 or 1 causes the <code>StatusWatcher</code> to |
| not keep any buffers on status changed. Clients that need to observe all |
| changes to status (as opposed to only the current state) are encouraged |
| to set a buffer value larger than 1, so that all edges can be observed. |
| If <code>StatusWatcher</code>'s internal queue is filled and new status changes |
| occur, the oldest samples will be dropped to make room for new ones.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Port.GetStatusWatcher_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>watcher</code></td> |
| <td> |
| <code>server_end<<a class='link' href='#StatusWatcher'>StatusWatcher</a>></code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>buffer</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## PortWatcher {#PortWatcher} |
| *Defined in [fuchsia.hardware.network/device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=149)* |
| <p>Provides iteration over and updates for ports attached to a device.</p> |
| |
| |
| ### Watch {#PortWatcher.Watch} |
| |
| <p>Get the next port event.</p> |
| <p>The first N calls return <a class='link' href='#DevicePortEvent.existing'>DevicePortEvent.existing</a> where N is the |
| number of ports present on the device at the time of the watcher's |
| creation. The next call returns <a class='link' href='#DevicePortEvent.idle'>DevicePortEvent.idle</a> to indicate the |
| end of existing ports. Subsequent calls block until a port is added |
| (<a class='link' href='#DevicePortEvent.added'>DevicePortEvent.added</a>) or removed (<a class='link' href='#DevicePortEvent.removed'>DevicePortEvent.removed</a>).</p> |
| <p>The server closes the <code>PortWatcher</code> channel with <code>ZX_ERR_CANCELED</code> if |
| the number of unread events reaches a server-selected limit that is at |
| least two times <a class='link' href='#MAX_PORTS'>MAX_PORTS</a>. Clients are encouraged to maintain a |
| hanging call to <code>Watch</code> at all times to avoid triggering this condition.</p> |
| <ul> |
| <li>response <code>event</code> next port event.</li> |
| </ul> |
| |
| |
| |
| #### Request {#PortWatcher.Watch_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#PortWatcher.Watch_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>event</code></td> |
| <td> |
| <code><a class='link' href='#DevicePortEvent'>DevicePortEvent</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ## Session {#Session} |
| *Defined in [fuchsia.hardware.network/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/session.fidl;l=34)* |
| <p>Represents a session with a Network device.</p> |
| <p>A session has a data plane and a control plane. The <code>Session</code> protocol |
| represents the control plane of the session and the FIFOs and VMOs exchanged |
| during the <a class='link' href='#Device.OpenSession'>Device.OpenSession</a> call are the data plane. Lifetime of the |
| session is controlled by a <code>Session</code> protocol handle.</p> |
| <p>Sessions must attach to ports of interest to start receiving and sending |
| data. Sessions are always created with no ports attached.</p> |
| <p>If a port is destroyed from the underlying device, it is automatically |
| detached from the session.</p> |
| <p>Inbound traffic is dispatched to all open sessions. Devices typically |
| operate with a single primary session, see <a class='link' href='#SessionFlags.PRIMARY'>SessionFlags.PRIMARY</a>. Each |
| additional open session to the same device causes data copy overhead on the |
| device's data path.</p> |
| <p>The session is closed with an error epitaph if an invalid buffer descriptor |
| is sent over either the tx or rx FIFOs. Invalid descriptors include: |
| - Descriptor index larger than <a class='link' href='#SessionInfo.descriptor_count'>SessionInfo.descriptor_count</a>. |
| - Descriptor chains larger than <a class='link' href='#MAX_DESCRIPTOR_CHAIN'>MAX_DESCRIPTOR_CHAIN</a>. |
| - rx buffers smaller than <a class='link' href='#Info.min_rx_buffer_length'>Info.min_rx_buffer_length</a>. |
| - tx buffers smaller than <a class='link' href='#Info.min_tx_buffer_length'>Info.min_tx_buffer_length</a>. |
| - tx buffers not respecting <a class='link' href='#Info.min_tx_buffer_head'>Info.min_tx_buffer_head</a> or |
| <a class='link' href='#Info.min_tx_buffer_tail'>Info.min_tx_buffer_tail</a>.</p> |
| |
| |
| ### Attach {#Session.Attach} |
| |
| <p>Attaches the session to <code>port</code>.</p> |
| <p>Once attached, the session starts to receive the subscribed frames over |
| the data FIFOs and it may send frames destined to the specified <code>port</code>.</p> |
| <ul> |
| <li>request <code>port</code> port to subscribe to.</li> |
| <li>request <code>rx_frames</code> Frame types of interest on the port.</li> |
| </ul> |
| <ul> |
| <li>error <code>ZX_ERR_NOT_FOUND</code> if <code>port</code> is not valid.</li> |
| <li>error <code>ZX_ERR_INVALID_ARGS</code> if <code>rx_frames</code> is not a subset of the |
| port's supported frames.</li> |
| <li>error <code>ZX_ERR_ALREADY_BOUND</code> if <code>port</code> is already attached.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Session.Attach_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>port</code></td> |
| <td> |
| <code><a class='link' href='#PortId'>PortId</a></code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>rx_frames</code></td> |
| <td> |
| <code>vector<<a class='link' href='#FrameType'>FrameType</a>>[4]</code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| #### Response {#Session.Attach_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#Session_Attach_Result'>Session_Attach_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### Close {#Session.Close} |
| |
| <p>Cleanly closes a session.</p> |
| <p>This will cause the session to send a <code>ZX_ERR_CANCELLED</code> epitaph and |
| proceed to close the Session channel. Clients may only assume that they |
| own all the buffers that are currently owned by the session (sent over |
| either the rx or tx FIFOs) once the epitaph is received. Closing the rx |
| or tx FIFO is equivalent to calling <code>Close</code>.</p> |
| |
| |
| |
| #### Request {#Session.Close_Request} |
| |
| <EMPTY> |
| |
| |
| ### Detach {#Session.Detach} |
| |
| <p>Detaches the session from <code>port</code>.</p> |
| <p>Once detached, the session stops receiving frames from <code>port</code>. Frames |
| sent to a detached port may be returned with an error. It is not |
| necessary to call <code>Detach</code> on ports that are removed from the device, |
| doing so causes <code>ZX_ERR_NOT_FOUND</code> to be returned.</p> |
| <ul> |
| <li>request <code>port</code> port to subscribe to.</li> |
| </ul> |
| <ul> |
| <li>error <code>ZX_ERR_NOT_FOUND</code> if the session is not currently attached to |
| the port.</li> |
| </ul> |
| |
| |
| |
| #### Request {#Session.Detach_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>port</code></td> |
| <td> |
| <code><a class='link' href='#PortId'>PortId</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| #### Response {#Session.Detach_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#Session_Detach_Result'>Session_Detach_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ## StatusWatcher {#StatusWatcher} |
| *Defined in [fuchsia.hardware.network/port.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=72)* |
| <p>Provides a way to receive updates on port status changes.</p> |
| |
| |
| ### WatchStatus {#StatusWatcher.WatchStatus} |
| |
| <p><code>WatchStatus</code> blocks until the port's status has changed.</p> |
| <p>The first call to <code>WatchStatus</code> returns immediately with the current |
| port status, subsequent calls complete when the port status differs from |
| the last one that was returned through this <code>StatusWatcher</code>.</p> |
| <p>If <code>StatusWatcher</code> was created with a buffer value larger than 1, |
| <code>WatchStatus</code> may return a queued status change, depending on how many |
| status changed happened since the last call to <code>WatchStatus</code>.</p> |
| <ul> |
| <li>response <code>device_status</code> the most recent port status.</li> |
| </ul> |
| |
| |
| |
| #### Request {#StatusWatcher.WatchStatus_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#StatusWatcher.WatchStatus_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>port_status</code></td> |
| <td> |
| <code><a class='link' href='#PortStatus'>PortStatus</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## **STRUCTS** |
| |
| ### Device_OpenSession_Response [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Device_OpenSession_Response data-text="Device_OpenSession_Response"} |
| *Defined in [fuchsia.hardware.network/device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=119)* |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="Device_OpenSession_Response.session"> |
| <td><code>session</code></td> |
| <td> |
| <code><a class='link' href='#Session'>Session</a></code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| <tr id="Device_OpenSession_Response.fifos"> |
| <td><code>fifos</code></td> |
| <td> |
| <code><a class='link' href='#Fifos'>Fifos</a></code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### Empty {#Empty data-text="Empty"} |
| *Defined in [fuchsia.hardware.network/device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=170)* |
| |
| <EMPTY> |
| |
| ### Fifos [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Fifos data-text="Fifos"} |
| *Defined in [fuchsia.hardware.network/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/session.fidl;l=107)* |
| <p>Data-plane FIFOs.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="Fifos.rx"> |
| <td><code>rx</code></td> |
| <td> |
| <code>handle<fifo></code> |
| </td> |
| <td><p>Handle for the rx FIFO.</p> |
| <p>Clients must write 16-bit descriptor indexes to this FIFO to be able to |
| receive frames.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="Fifos.tx"> |
| <td><code>tx</code></td> |
| <td> |
| <code>handle<fifo></code> |
| </td> |
| <td><p>Handle for the tx FIFO.</p> |
| <p>Clients write 16-bit descriptor indexes to this FIFO to enqueue outgoing |
| frames.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### FrameTypeSupport {#FrameTypeSupport data-text="FrameTypeSupport"} |
| *Defined in [fuchsia.hardware.network/frames.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=51)* |
| <p>Specifies a frame type and features and supported flags associated with that |
| type.</p> |
| <p>This is used by clients to read the supported frames on the tx path for a |
| given Network Device.</p> |
| <p>Some Network Devices may parse outgoing frames to perform frame |
| transformation or specific hardware support. Each frame type has an |
| associated <a class='link' href='#FrameTypeSupport.features'>FrameTypeSupport.features</a> bits enumeration that lists |
| FrameType-specific features that may or may not be supported. Devices that |
| do not perform parsing are encouraged to just use the <a class='link' href='#FRAME_FEATURES_RAW'>FRAME_FEATURES_RAW</a> |
| bit in <code>features</code>, which informs the client that all frame features are |
| allowed.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="FrameTypeSupport.type"> |
| <td><code>type</code></td> |
| <td> |
| <code><a class='link' href='#FrameType'>FrameType</a></code> |
| </td> |
| <td><p>The frame type this support entry refers to.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="FrameTypeSupport.features"> |
| <td><code>features</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>The frame type-specific features supported.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="FrameTypeSupport.supported_flags"> |
| <td><code>supported_flags</code></td> |
| <td> |
| <code><a class='link' href='#TxFlags'>TxFlags</a></code> |
| </td> |
| <td><p>The flags supported for the given frame type.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### PortId {#PortId data-text="PortId"} |
| *Defined in [fuchsia.hardware.network/port.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=18)* |
| <p>A device port identifier.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="PortId.base"> |
| <td><code>base</code></td> |
| <td> |
| <code><a class='link' href='#BasePortId'>BasePortId</a></code> |
| </td> |
| <td><p>The base identifier for the port.</p> |
| <p>Generally identifies a port instance in hardware.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="PortId.salt"> |
| <td><code>salt</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>An implementation-defined identifier that is guaranteed to change on |
| every instantiation of the identified port.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### Session_Attach_Response {#Session_Attach_Response data-text="Session_Attach_Response"} |
| *Defined in [fuchsia.hardware.network/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/session.fidl;l=49)* |
| |
| <EMPTY> |
| |
| ### Session_Detach_Response {#Session_Detach_Response data-text="Session_Detach_Response"} |
| *Defined in [fuchsia.hardware.network/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/session.fidl;l=62)* |
| |
| <EMPTY> |
| |
| |
| ## **ENUMS** |
| |
| ### DeviceClass [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DeviceClass data-text="DeviceClass"} |
| Type: <code>uint16</code> |
| |
| *Defined in [fuchsia.hardware.network/port.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=37)* |
| <p>Network device class.</p> |
| <p><em>Note</em>: Device implementers are encouraged to propose additions to this |
| enumeration to avoid using ill-fitting variants if there's not a good match |
| available.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="DeviceClass.VIRTUAL"> |
| <td><h3 id="DeviceClass.VIRTUAL" class="add-link hide-from-toc">VIRTUAL</h3></td> |
| <td><code>0</code></td> |
| <td></td> |
| </tr> |
| <tr id="DeviceClass.ETHERNET"> |
| <td><h3 id="DeviceClass.ETHERNET" class="add-link hide-from-toc">ETHERNET</h3></td> |
| <td><code>1</code></td> |
| <td></td> |
| </tr> |
| <tr id="DeviceClass.WLAN"> |
| <td><h3 id="DeviceClass.WLAN" class="add-link hide-from-toc">WLAN</h3></td> |
| <td><code>2</code></td> |
| <td></td> |
| </tr> |
| <tr id="DeviceClass.PPP"> |
| <td><h3 id="DeviceClass.PPP" class="add-link hide-from-toc">PPP</h3></td> |
| <td><code>3</code></td> |
| <td></td> |
| </tr> |
| <tr id="DeviceClass.BRIDGE"> |
| <td><h3 id="DeviceClass.BRIDGE" class="add-link hide-from-toc">BRIDGE</h3></td> |
| <td><code>4</code></td> |
| <td></td> |
| </tr> |
| <tr id="DeviceClass.WLAN_AP"> |
| <td><h3 id="DeviceClass.WLAN_AP" class="add-link hide-from-toc">WLAN_AP</h3></td> |
| <td><code>5</code></td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### FrameType [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#FrameType data-text="FrameType"} |
| Type: <code>uint8</code> |
| |
| *Defined in [fuchsia.hardware.network/frames.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=7)* |
| <p>Types of frames.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="FrameType.ETHERNET"> |
| <td><h3 id="FrameType.ETHERNET" class="add-link hide-from-toc">ETHERNET</h3></td> |
| <td><code>1</code></td> |
| <td></td> |
| </tr> |
| <tr id="FrameType.IPV4"> |
| <td><h3 id="FrameType.IPV4" class="add-link hide-from-toc">IPV4</h3></td> |
| <td><code>2</code></td> |
| <td></td> |
| </tr> |
| <tr id="FrameType.IPV6"> |
| <td><h3 id="FrameType.IPV6" class="add-link hide-from-toc">IPV6</h3></td> |
| <td><code>3</code></td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### InfoType [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#InfoType data-text="InfoType"} |
| Type: <code>uint32</code> |
| |
| *Defined in [fuchsia.hardware.network/frames.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=64)* |
| <p>The type of metadata information appended to a frame.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="InfoType.NO_INFO"> |
| <td><h3 id="InfoType.NO_INFO" class="add-link hide-from-toc">NO_INFO</h3></td> |
| <td><code>0</code></td> |
| <td><p>No extra information is available.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### MacFilterMode [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#MacFilterMode data-text="MacFilterMode"} |
| Type: <code>uint32</code> |
| |
| *Defined in [fuchsia.hardware.network/mac.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/mac.fidl;l=10)* |
| <p>The address filtering mode supported by MAC devices.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="MacFilterMode.MULTICAST_FILTER"> |
| <td><h3 id="MacFilterMode.MULTICAST_FILTER" class="add-link hide-from-toc">MULTICAST_FILTER</h3></td> |
| <td><code>0</code></td> |
| <td><p>Device accepts only unicast frames addressed to its own unicast address, |
| or multicast frames that are part of the multicast address filter list.</p> |
| </td> |
| </tr> |
| <tr id="MacFilterMode.MULTICAST_PROMISCUOUS"> |
| <td><h3 id="MacFilterMode.MULTICAST_PROMISCUOUS" class="add-link hide-from-toc">MULTICAST_PROMISCUOUS</h3></td> |
| <td><code>1</code></td> |
| <td><p>Device accepts unicast frames addressed to its own unicast address, or |
| any multicast frames.</p> |
| </td> |
| </tr> |
| <tr id="MacFilterMode.PROMISCUOUS"> |
| <td><h3 id="MacFilterMode.PROMISCUOUS" class="add-link hide-from-toc">PROMISCUOUS</h3></td> |
| <td><code>2</code></td> |
| <td><p>Device accepts all frames.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### RxAcceleration [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#RxAcceleration data-text="RxAcceleration"} |
| Type: <code>uint8</code> |
| |
| *Defined in [fuchsia.hardware.network/frames.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=73)* |
| <p>Available rx acceleration features.</p> |
| <p>Features are mapped to the <code>RX_ACCEL_*</code> bits in descriptors by the available |
| values reported in <a class='link' href='#Info.rx_accel'>Info.rx_accel</a>.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="RxAcceleration.VALIDATED_ETHERNET_FCS"> |
| <td><h3 id="RxAcceleration.VALIDATED_ETHERNET_FCS" class="add-link hide-from-toc">VALIDATED_ETHERNET_FCS</h3></td> |
| <td><code>0</code></td> |
| <td><p>Inbound rx frame validated the Ethernet Frame Check Sequence.</p> |
| </td> |
| </tr> |
| <tr id="RxAcceleration.VALIDATED_IPV4_CHECKSUM"> |
| <td><h3 id="RxAcceleration.VALIDATED_IPV4_CHECKSUM" class="add-link hide-from-toc">VALIDATED_IPV4_CHECKSUM</h3></td> |
| <td><code>1</code></td> |
| <td><p>Inbound rx frame validated the IPv4 checksum.</p> |
| </td> |
| </tr> |
| <tr id="RxAcceleration.VALIDATED_TCP_CHECKSUM"> |
| <td><h3 id="RxAcceleration.VALIDATED_TCP_CHECKSUM" class="add-link hide-from-toc">VALIDATED_TCP_CHECKSUM</h3></td> |
| <td><code>2</code></td> |
| <td><p>Inbound rx frame validated the TCP checksum.</p> |
| </td> |
| </tr> |
| <tr id="RxAcceleration.VALIDATED_UDP_CHECKSUM"> |
| <td><h3 id="RxAcceleration.VALIDATED_UDP_CHECKSUM" class="add-link hide-from-toc">VALIDATED_UDP_CHECKSUM</h3></td> |
| <td><code>3</code></td> |
| <td><p>Inbound rx frame validated the UDP checksum.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### TxAcceleration [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#TxAcceleration data-text="TxAcceleration"} |
| Type: <code>uint8</code> |
| |
| *Defined in [fuchsia.hardware.network/frames.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=88)* |
| <p>Available tx acceleration features.</p> |
| <p>Features are mapped to the <code>TX_ACCEL_*</code> bits in descriptors by the available |
| values reported in <a class='link' href='#Info.tx_accel'>Info.tx_accel</a>.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="TxAcceleration.COMPUTE_ETHERNET_FCS"> |
| <td><h3 id="TxAcceleration.COMPUTE_ETHERNET_FCS" class="add-link hide-from-toc">COMPUTE_ETHERNET_FCS</h3></td> |
| <td><code>0</code></td> |
| <td><p>Request that device calculate the Ethernet Frame Check Sequence and |
| write it in place.</p> |
| </td> |
| </tr> |
| <tr id="TxAcceleration.COMPUTE_IPV4_CHECKSUM"> |
| <td><h3 id="TxAcceleration.COMPUTE_IPV4_CHECKSUM" class="add-link hide-from-toc">COMPUTE_IPV4_CHECKSUM</h3></td> |
| <td><code>1</code></td> |
| <td><p>Request that the device calculate the IPv4 checksum and write it in |
| place.</p> |
| </td> |
| </tr> |
| <tr id="TxAcceleration.COMPUTE_TCP_CHECKSUM"> |
| <td><h3 id="TxAcceleration.COMPUTE_TCP_CHECKSUM" class="add-link hide-from-toc">COMPUTE_TCP_CHECKSUM</h3></td> |
| <td><code>2</code></td> |
| <td><p>Request that the device calculate the TCP checksum and write it in |
| place.</p> |
| </td> |
| </tr> |
| <tr id="TxAcceleration.COMPUTE_UDP_CHECKSUM"> |
| <td><h3 id="TxAcceleration.COMPUTE_UDP_CHECKSUM" class="add-link hide-from-toc">COMPUTE_UDP_CHECKSUM</h3></td> |
| <td><code>3</code></td> |
| <td><p>Request that the device calculate the UDP checksum and write it in |
| place.</p> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## **TABLES** |
| |
| ### DeviceInfo {#DeviceInfo data-text="DeviceInfo"} |
| |
| |
| *Defined in [fuchsia.hardware.network/device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=28)* |
| <p>Network device information.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="DeviceInfo.min_descriptor_length"> |
| <td><h3 id="DeviceInfo.min_descriptor_length" class="add-link hide-from-toc">1</h3></td> |
| <td><code>min_descriptor_length</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>Minimum descriptor length, in 64-bit words. Required.</p> |
| <p>The minimum length that each buffer descriptor must have for correct |
| operation with this device. Devices that support extra frame metadata |
| inform larger minimum descriptor lengths that reflect the minimum space |
| needed to be able to store frame metadata.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.descriptor_version"> |
| <td><h3 id="DeviceInfo.descriptor_version" class="add-link hide-from-toc">2</h3></td> |
| <td><code>descriptor_version</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>Accepted descriptor version. Required.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.rx_depth"> |
| <td><h3 id="DeviceInfo.rx_depth" class="add-link hide-from-toc">3</h3></td> |
| <td><code>rx_depth</code></td> |
| <td> |
| <code>uint16</code> |
| </td> |
| <td><p>Maximum number of items in rx FIFO (per session). Required.</p> |
| <p><code>rx_depth</code> is calculated based on the size of the actual backing |
| hardware rx queue.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.tx_depth"> |
| <td><h3 id="DeviceInfo.tx_depth" class="add-link hide-from-toc">4</h3></td> |
| <td><code>tx_depth</code></td> |
| <td> |
| <code>uint16</code> |
| </td> |
| <td><p>Maximum number of items in tx FIFO (per session). Required.</p> |
| <p><code>tx_depth</code> is calculated based on the size of the actual backing |
| hardware tx queue.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.buffer_alignment"> |
| <td><h3 id="DeviceInfo.buffer_alignment" class="add-link hide-from-toc">5</h3></td> |
| <td><code>buffer_alignment</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>Alignment requirement for buffers in the data VMO.</p> |
| <p>All buffers in the data VMO <em>must</em> be aligned to <code>buffer_alignment</code> |
| relative to the start of the VMO. <code>buffer_alignment == 0</code> is never |
| reported. Required.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.max_buffer_length"> |
| <td><h3 id="DeviceInfo.max_buffer_length" class="add-link hide-from-toc">6</h3></td> |
| <td><code>max_buffer_length</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>Maximum supported length of buffers in the data VMO, in bytes.</p> |
| <p>Absent if no maximum buffer length is defined. Must be nonzero.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.min_rx_buffer_length"> |
| <td><h3 id="DeviceInfo.min_rx_buffer_length" class="add-link hide-from-toc">7</h3></td> |
| <td><code>min_rx_buffer_length</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>The minimum rx buffer length required for device. Required.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.min_tx_buffer_length"> |
| <td><h3 id="DeviceInfo.min_tx_buffer_length" class="add-link hide-from-toc">8</h3></td> |
| <td><code>min_tx_buffer_length</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>The minimum tx buffer length required for the device. Required.</p> |
| <p>This value accounts only for tx payload length, <code>min_tx_buffer_head</code> and |
| <code>min_tx_buffer_tail</code> are not part of this value.</p> |
| <p>Clients must zero pad outgoing frames to meet the required minimum |
| length.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.min_tx_buffer_head"> |
| <td><h3 id="DeviceInfo.min_tx_buffer_head" class="add-link hide-from-toc">9</h3></td> |
| <td><code>min_tx_buffer_head</code></td> |
| <td> |
| <code>uint16</code> |
| </td> |
| <td><p>The number of bytes the device requests be free as <code>head</code> space in a tx |
| buffer. Required.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.min_tx_buffer_tail"> |
| <td><h3 id="DeviceInfo.min_tx_buffer_tail" class="add-link hide-from-toc">10</h3></td> |
| <td><code>min_tx_buffer_tail</code></td> |
| <td> |
| <code>uint16</code> |
| </td> |
| <td><p>The amount of bytes the device requests be free as <code>tail</code> space in a tx |
| buffer. Required.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.max_buffer_parts"> |
| <td><h3 id="DeviceInfo.max_buffer_parts" class="add-link hide-from-toc">11</h3></td> |
| <td><code>max_buffer_parts</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>Maximum descriptor chain length accepted by the device. Required.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.rx_accel"> |
| <td><h3 id="DeviceInfo.rx_accel" class="add-link hide-from-toc">12</h3></td> |
| <td><code>rx_accel</code></td> |
| <td> |
| <code>vector<<a class='link' href='#RxAcceleration'>RxAcceleration</a>>[16]</code> |
| </td> |
| <td><p>Available rx acceleration flags for this device.</p> |
| <p><code>rx_accel</code> maps the <code>RX_ACCEL_*</code> flags in the frame descriptors with |
| semantic acceleration features described by <a class='link' href='#RxAcceleration'>RxAcceleration</a>. Position |
| <code>n</code> of <code>rx_accel</code> conveys the meaning of the <code>RX_ACCEL_n</code> flag.</p> |
| <p>Interpreted as empty if not provided.</p> |
| </td> |
| </tr> |
| <tr id="DeviceInfo.tx_accel"> |
| <td><h3 id="DeviceInfo.tx_accel" class="add-link hide-from-toc">13</h3></td> |
| <td><code>tx_accel</code></td> |
| <td> |
| <code>vector<<a class='link' href='#TxAcceleration'>TxAcceleration</a>>[16]</code> |
| </td> |
| <td><p>Available tx acceleration flags for this device.</p> |
| <p><code>tx_accel</code> maps the <code>TX_ACCEL_*</code> flags in the frame descriptors with |
| semantic acceleration features described by <a class='link' href='#TxAcceleration'>TxAcceleration</a>. Position |
| <code>n</code> of <code>tx_accel</code> conveys the meaning of the <code>TX_ACCEL_n</code> flag.</p> |
| <p>Interpreted as empty if not provided.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### PortGetCountersResponse {#PortGetCountersResponse data-text="PortGetCountersResponse"} |
| |
| |
| *Defined in [fuchsia.hardware.network/port.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=164)* |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="PortGetCountersResponse.rx_frames"> |
| <td><h3 id="PortGetCountersResponse.rx_frames" class="add-link hide-from-toc">1</h3></td> |
| <td><code>rx_frames</code></td> |
| <td> |
| <code>uint64</code> |
| </td> |
| <td><p>The total number of ingress frames on this port.</p> |
| </td> |
| </tr> |
| <tr id="PortGetCountersResponse.rx_bytes"> |
| <td><h3 id="PortGetCountersResponse.rx_bytes" class="add-link hide-from-toc">2</h3></td> |
| <td><code>rx_bytes</code></td> |
| <td> |
| <code>uint64</code> |
| </td> |
| <td><p>The total number of ingress bytes on this port.</p> |
| </td> |
| </tr> |
| <tr id="PortGetCountersResponse.tx_frames"> |
| <td><h3 id="PortGetCountersResponse.tx_frames" class="add-link hide-from-toc">3</h3></td> |
| <td><code>tx_frames</code></td> |
| <td> |
| <code>uint64</code> |
| </td> |
| <td><p>The total number of egress frames on this port.</p> |
| </td> |
| </tr> |
| <tr id="PortGetCountersResponse.tx_bytes"> |
| <td><h3 id="PortGetCountersResponse.tx_bytes" class="add-link hide-from-toc">4</h3></td> |
| <td><code>tx_bytes</code></td> |
| <td> |
| <code>uint64</code> |
| </td> |
| <td><p>The total number of egress bytes on this port.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### PortInfo {#PortInfo data-text="PortInfo"} |
| |
| |
| *Defined in [fuchsia.hardware.network/port.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=90)* |
| <p>Logical port information.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="PortInfo.id"> |
| <td><h3 id="PortInfo.id" class="add-link hide-from-toc">1</h3></td> |
| <td><code>id</code></td> |
| <td> |
| <code><a class='link' href='#PortId'>PortId</a></code> |
| </td> |
| <td><p>Port's identifier. Required.</p> |
| </td> |
| </tr> |
| <tr id="PortInfo.class"> |
| <td><h3 id="PortInfo.class" class="add-link hide-from-toc">2</h3></td> |
| <td><code>class</code></td> |
| <td> |
| <code><a class='link' href='#PortClass'>PortClass</a></code> |
| </td> |
| <td><p>Port's class. Required.</p> |
| </td> |
| </tr> |
| <tr id="PortInfo.rx_types"> |
| <td><h3 id="PortInfo.rx_types" class="add-link hide-from-toc">3</h3></td> |
| <td><code>rx_types</code></td> |
| <td> |
| <code>vector<<a class='link' href='#FrameType'>FrameType</a>>[4]</code> |
| </td> |
| <td><p>Supported rx frame types on this port. Required.</p> |
| <p>Clients may open sessions subscribing to a subset of <code>rx_types</code> frame |
| types on this port.</p> |
| </td> |
| </tr> |
| <tr id="PortInfo.tx_types"> |
| <td><h3 id="PortInfo.tx_types" class="add-link hide-from-toc">4</h3></td> |
| <td><code>tx_types</code></td> |
| <td> |
| <code>vector<<a class='link' href='#FrameTypeSupport'>FrameTypeSupport</a>>[4]</code> |
| </td> |
| <td><p>Supported tx frame types on this port. Required.</p> |
| <p>Frames destined to this port whose frame type is not in <code>tx_types</code> are |
| returned with an error.</p> |
| <p>Some network devices may need to perform partial frame parsing and |
| serialization and, for that reason, <code>tx_types</code> is a vector of |
| <a class='link' href='#FrameTypeSupport'>FrameTypeSupport</a> which includes specific features per frame type. |
| For example, a device that supports Ethernet frames but needs to convert |
| the Ethernet header may only support standard Ethernet II frames, and |
| not any "raw" Ethernet frame.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### PortStatus {#PortStatus data-text="PortStatus"} |
| |
| |
| *Defined in [fuchsia.hardware.network/port.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=61)* |
| <p>Dynamic port information.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="PortStatus.flags"> |
| <td><h3 id="PortStatus.flags" class="add-link hide-from-toc">1</h3></td> |
| <td><code>flags</code></td> |
| <td> |
| <code><a class='link' href='#StatusFlags'>StatusFlags</a></code> |
| </td> |
| <td><p>Port status flags.</p> |
| </td> |
| </tr> |
| <tr id="PortStatus.mtu"> |
| <td><h3 id="PortStatus.mtu" class="add-link hide-from-toc">2</h3></td> |
| <td><code>mtu</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>Maximum transmit unit for this port, in bytes.</p> |
| <p>The reported MTU is the size of an entire frame, including any header |
| and trailer bytes for whatever protocols this port supports.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### SessionInfo [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#SessionInfo data-text="SessionInfo"} |
| |
| |
| *Defined in [fuchsia.hardware.network/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/session.fidl;l=121)* |
| <p>Session configuration.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="SessionInfo.descriptors"> |
| <td><h3 id="SessionInfo.descriptors" class="add-link hide-from-toc">1</h3></td> |
| <td><code>descriptors</code></td> |
| <td> |
| <code>handle<vmo></code> |
| </td> |
| <td><p>VMO containing the descriptors. Required.</p> |
| <p>16-bit indices transmitted over the FIFOs index a descriptor in this VMO |
| (byte offset = descriptor_length * 8 * index).</p> |
| </td> |
| </tr> |
| <tr id="SessionInfo.data"> |
| <td><h3 id="SessionInfo.data" class="add-link hide-from-toc">2</h3></td> |
| <td><code>data</code></td> |
| <td> |
| <code>handle<vmo></code> |
| </td> |
| <td><p>VMO containing frame data. Required.</p> |
| <p>Descriptors contain byte-offsets that are used to index arbitrary |
| regions in <code>data</code>.</p> |
| </td> |
| </tr> |
| <tr id="SessionInfo.descriptor_version"> |
| <td><h3 id="SessionInfo.descriptor_version" class="add-link hide-from-toc">3</h3></td> |
| <td><code>descriptor_version</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>Requested descriptor version. Required.</p> |
| <p>If the network device does not support the requested descriptor version, |
| <a class='link' href='#Device.OpenSession'>Device.OpenSession</a> fails with <code>ZX_ERR_NOT_SUPPORTED</code>.</p> |
| </td> |
| </tr> |
| <tr id="SessionInfo.descriptor_length"> |
| <td><h3 id="SessionInfo.descriptor_length" class="add-link hide-from-toc">4</h3></td> |
| <td><code>descriptor_length</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>Descriptor length, in 64-bit words. Required.</p> |
| <p>The length of each descriptor in the <code>descriptors</code> VMO. This is used as |
| a multiplier to find byte offsets in <code>descriptors</code> given a descriptor |
| index passed through the rx or tx FIFOs.</p> |
| </td> |
| </tr> |
| <tr id="SessionInfo.descriptor_count"> |
| <td><h3 id="SessionInfo.descriptor_count" class="add-link hide-from-toc">5</h3></td> |
| <td><code>descriptor_count</code></td> |
| <td> |
| <code>uint16</code> |
| </td> |
| <td><p>Total number of descriptors that can be used by this session. Required.</p> |
| <p>Descriptor indices transferred through either the rx or tx FIFO must be |
| in the range [0, <code>descriptor_count</code>).</p> |
| </td> |
| </tr> |
| <tr id="SessionInfo.options"> |
| <td><h3 id="SessionInfo.options" class="add-link hide-from-toc">6</h3></td> |
| <td><code>options</code></td> |
| <td> |
| <code><a class='link' href='#SessionFlags'>SessionFlags</a></code> |
| </td> |
| <td><p>Extra options. Interpreted as empty bitmask if absent.</p> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## **UNIONS** |
| |
| ### DevicePortEvent [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DevicePortEvent data-text="DevicePortEvent"} |
| *Defined in [fuchsia.hardware.network/device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=175)* |
| <p>Port creation and destruction events.</p> |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="DevicePortEvent.existing"> |
| <td><h3 id="DevicePortEvent.existing" class="add-link hide-from-toc">1</h3></td> |
| <td><code>existing</code></td> |
| <td> |
| <code><a class='link' href='#PortId'>PortId</a></code> |
| </td> |
| <td><p>Port existed when watcher was created.</p> |
| </td> |
| </tr> |
| <tr id="DevicePortEvent.added"> |
| <td><h3 id="DevicePortEvent.added" class="add-link hide-from-toc">2</h3></td> |
| <td><code>added</code></td> |
| <td> |
| <code><a class='link' href='#PortId'>PortId</a></code> |
| </td> |
| <td><p>New port was added to device.</p> |
| </td> |
| </tr> |
| <tr id="DevicePortEvent.removed"> |
| <td><h3 id="DevicePortEvent.removed" class="add-link hide-from-toc">3</h3></td> |
| <td><code>removed</code></td> |
| <td> |
| <code><a class='link' href='#PortId'>PortId</a></code> |
| </td> |
| <td><p>Port was removed from the device.</p> |
| </td> |
| </tr> |
| <tr id="DevicePortEvent.idle"> |
| <td><h3 id="DevicePortEvent.idle" class="add-link hide-from-toc">4</h3></td> |
| <td><code>idle</code></td> |
| <td> |
| <code><a class='link' href='#Empty'>Empty</a></code> |
| </td> |
| <td><p>Exhausted list of existing ports.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### Device_OpenSession_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Device_OpenSession_Result data-text="Device_OpenSession_Result"} |
| *Defined in [fuchsia.hardware.network/device.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=119)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="Device_OpenSession_Result.response"> |
| <td><h3 id="Device_OpenSession_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#Device_OpenSession_Response'>Device_OpenSession_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="Device_OpenSession_Result.err"> |
| <td><h3 id="Device_OpenSession_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### Session_Attach_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Session_Attach_Result data-text="Session_Attach_Result"} |
| *Defined in [fuchsia.hardware.network/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/session.fidl;l=49)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="Session_Attach_Result.response"> |
| <td><h3 id="Session_Attach_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#Session_Attach_Response'>Session_Attach_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="Session_Attach_Result.err"> |
| <td><h3 id="Session_Attach_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### Session_Detach_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Session_Detach_Result data-text="Session_Detach_Result"} |
| *Defined in [fuchsia.hardware.network/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/session.fidl;l=62)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="Session_Detach_Result.response"> |
| <td><h3 id="Session_Detach_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#Session_Detach_Response'>Session_Detach_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="Session_Detach_Result.err"> |
| <td><h3 id="Session_Detach_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| |
| ## **BITS** |
| |
| ### EthernetFeatures [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#EthernetFeatures} |
| Type: <code>uint32</code> |
| |
| *Defined in [fuchsia.hardware.network/frames.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=20)* |
| <p>Ethernet frame sub-types and features.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="EthernetFeatures.RAW"> |
| <td><h3 id="EthernetFeatures.RAW" class="add-link hide-from-toc">RAW</h3></td> |
| <td>1</td> |
| <td><p>Device supports any type of ethernet frame.</p> |
| <p>Same as specifying all other flags. Used by devices that do not inspect |
| or parse outbound traffic.</p> |
| </td> |
| </tr> |
| <tr id="EthernetFeatures.ETHERNET_II"> |
| <td><h3 id="EthernetFeatures.ETHERNET_II" class="add-link hide-from-toc">ETHERNET_II</h3></td> |
| <td>2</td> |
| <td><p>Device supports EthernetII frames.</p> |
| </td> |
| </tr> |
| <tr id="EthernetFeatures.E_802_1_Q"> |
| <td><h3 id="EthernetFeatures.E_802_1_Q" class="add-link hide-from-toc">E_802_1_Q</h3></td> |
| <td>4</td> |
| <td><p>Device supports 802.1q VLAN additions.</p> |
| </td> |
| </tr> |
| <tr id="EthernetFeatures.E_802_1_Q_IN_Q"> |
| <td><h3 id="EthernetFeatures.E_802_1_Q_IN_Q" class="add-link hide-from-toc">E_802_1_Q_IN_Q</h3></td> |
| <td>8</td> |
| <td><p>Device supports 802.1 q-in-q Multiple VLAN tagging additions.</p> |
| <p>Only meaningful if <code>E_802_1_Q</code> is also present.</p> |
| </td> |
| </tr> |
| <tr id="EthernetFeatures.E_802_3_LLC_SNAP"> |
| <td><h3 id="EthernetFeatures.E_802_3_LLC_SNAP" class="add-link hide-from-toc">E_802_3_LLC_SNAP</h3></td> |
| <td>16</td> |
| <td><p>Device supports 802.3 LLC + SNAP Ethernet frame format.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### RxFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#RxFlags} |
| Type: <code>uint32</code> |
| |
| *Defined in [fuchsia.hardware.network/frames.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=107)* |
| <p>Flags set by a Device when handing a buffer to a client on the rx path.</p> |
| <p>Set by devices on the <code>inbound_flags</code> field of an rx descriptor.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="RxFlags.RX_ACCEL_0"> |
| <td><h3 id="RxFlags.RX_ACCEL_0" class="add-link hide-from-toc">RX_ACCEL_0</h3></td> |
| <td>1</td> |
| <td><p>Acceleration flag 0.</p> |
| <p>Acceleration flags are mapped to the acceleration features reported by |
| the <a class='link' href='#Device'>Device</a> in <a class='link' href='#Info.rx_accel'>Info.rx_accel</a>. The n-th feature in <code>rx_accel</code> maps |
| to the <code>RX_ACCEL_n</code> <code>RxFlag</code>.</p> |
| </td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_1"> |
| <td><h3 id="RxFlags.RX_ACCEL_1" class="add-link hide-from-toc">RX_ACCEL_1</h3></td> |
| <td>2</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_2"> |
| <td><h3 id="RxFlags.RX_ACCEL_2" class="add-link hide-from-toc">RX_ACCEL_2</h3></td> |
| <td>4</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_3"> |
| <td><h3 id="RxFlags.RX_ACCEL_3" class="add-link hide-from-toc">RX_ACCEL_3</h3></td> |
| <td>8</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_4"> |
| <td><h3 id="RxFlags.RX_ACCEL_4" class="add-link hide-from-toc">RX_ACCEL_4</h3></td> |
| <td>16</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_5"> |
| <td><h3 id="RxFlags.RX_ACCEL_5" class="add-link hide-from-toc">RX_ACCEL_5</h3></td> |
| <td>32</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_6"> |
| <td><h3 id="RxFlags.RX_ACCEL_6" class="add-link hide-from-toc">RX_ACCEL_6</h3></td> |
| <td>64</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_7"> |
| <td><h3 id="RxFlags.RX_ACCEL_7" class="add-link hide-from-toc">RX_ACCEL_7</h3></td> |
| <td>128</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_8"> |
| <td><h3 id="RxFlags.RX_ACCEL_8" class="add-link hide-from-toc">RX_ACCEL_8</h3></td> |
| <td>256</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_9"> |
| <td><h3 id="RxFlags.RX_ACCEL_9" class="add-link hide-from-toc">RX_ACCEL_9</h3></td> |
| <td>512</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_10"> |
| <td><h3 id="RxFlags.RX_ACCEL_10" class="add-link hide-from-toc">RX_ACCEL_10</h3></td> |
| <td>1024</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_11"> |
| <td><h3 id="RxFlags.RX_ACCEL_11" class="add-link hide-from-toc">RX_ACCEL_11</h3></td> |
| <td>2048</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_12"> |
| <td><h3 id="RxFlags.RX_ACCEL_12" class="add-link hide-from-toc">RX_ACCEL_12</h3></td> |
| <td>4096</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_13"> |
| <td><h3 id="RxFlags.RX_ACCEL_13" class="add-link hide-from-toc">RX_ACCEL_13</h3></td> |
| <td>8192</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_14"> |
| <td><h3 id="RxFlags.RX_ACCEL_14" class="add-link hide-from-toc">RX_ACCEL_14</h3></td> |
| <td>16384</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_ACCEL_15"> |
| <td><h3 id="RxFlags.RX_ACCEL_15" class="add-link hide-from-toc">RX_ACCEL_15</h3></td> |
| <td>32768</td> |
| <td></td> |
| </tr> |
| <tr id="RxFlags.RX_OVERRUN"> |
| <td><h3 id="RxFlags.RX_OVERRUN" class="add-link hide-from-toc">RX_OVERRUN</h3></td> |
| <td>536870912</td> |
| <td><p>Device experienced a hardware rx overrun.</p> |
| <p>Rx overruns are typically set by hardware controllers when a frame event |
| was detected but the frame data couldn't be captured. Devices should |
| clear the controller flag once this is set on an inbound frame, so |
| future overruns can be detected and reported.</p> |
| </td> |
| </tr> |
| <tr id="RxFlags.RX_VALIDATION_ERROR"> |
| <td><h3 id="RxFlags.RX_VALIDATION_ERROR" class="add-link hide-from-toc">RX_VALIDATION_ERROR</h3></td> |
| <td>1073741824</td> |
| <td><p>This bit is set if frame validation is performed (such as by hardware |
| acceleration features) and fails.</p> |
| <p>It's important to note that some devices may simply discard frames for |
| which validation fails and never notify the client. Rx frames that |
| failed validation are only transmitted to the client if the |
| <code>SessionFlags::REPORT_INVALID_RX</code> option is selected when creating a |
| session.</p> |
| </td> |
| </tr> |
| <tr id="RxFlags.RX_ECHOED_TX"> |
| <td><h3 id="RxFlags.RX_ECHOED_TX" class="add-link hide-from-toc">RX_ECHOED_TX</h3></td> |
| <td>2147483648</td> |
| <td><p>This is an echoed tx frame, created by a tx request.</p> |
| <p>Can only be set in sessions that have the <code>LISTEN_TX</code> flag.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### SessionFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#SessionFlags} |
| Type: <code>uint16</code> |
| |
| *Defined in [fuchsia.hardware.network/session.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/session.fidl;l=74)* |
| <p>Additional session options.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="SessionFlags.PRIMARY"> |
| <td><h3 id="SessionFlags.PRIMARY" class="add-link hide-from-toc">PRIMARY</h3></td> |
| <td>1</td> |
| <td><p>Attach as primary session.</p> |
| <p>Sessions marked with the <code>PRIMARY</code> bit get the following different |
| treatment:</p> |
| <ul> |
| <li>If no PRIMARY sessions are attached, the device will <em>not</em> serve rx |
| frames to non-PRIMARY sessions.</li> |
| <li>If there's only one PRIMARY session active, it may get a zero-copy |
| data path from the the backing hardware, if the underlying |
| implementation supports it.</li> |
| </ul> |
| </td> |
| </tr> |
| <tr id="SessionFlags.LISTEN_TX"> |
| <td><h3 id="SessionFlags.LISTEN_TX" class="add-link hide-from-toc">LISTEN_TX</h3></td> |
| <td>2</td> |
| <td><p>Listen for outgoing frames.</p> |
| <p><code>LISTEN_TX</code> sessions receive any outgoing frames (from all sessions) on |
| its rx path. Can be used for snooping traffic. Sessions marked with |
| <code>LISTEN_TX</code> may also send frames, but they should keep in mind that |
| they'll ALWAYS receive those frames back on their rx path (no origin |
| session filtering is performed).</p> |
| </td> |
| </tr> |
| <tr id="SessionFlags.REPORT_INVALID_RX"> |
| <td><h3 id="SessionFlags.REPORT_INVALID_RX" class="add-link hide-from-toc">REPORT_INVALID_RX</h3></td> |
| <td>4</td> |
| <td><p>Receive invalid rx frames.</p> |
| <p>Sessions marked with <code>REPORT_INVALID_RX</code> are interested in receiving |
| frames that were rejected by internal device checks or payload |
| validation performed by hardware. Due to the nature of some hardware |
| platforms, sessions marked with <code>REPORT_INVALID_RX</code> may still not |
| receive frames that fail validation if the hardware implementation |
| simply drops the frame and doesn't expose it to the software stack. |
| Sessions NOT marked with <code>REPORT_INVALID_RX</code>, in contrast, will NEVER |
| receive an rx frame with the <code>RX_VALIDATION_ERROR</code> flag set.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### StatusFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#StatusFlags} |
| Type: <code>uint32</code> |
| |
| *Defined in [fuchsia.hardware.network/port.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=54)* |
| <p>Port status bits, reported in <a class='link' href='#PortStatus.flags'>PortStatus.flags</a>.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="StatusFlags.ONLINE"> |
| <td><h3 id="StatusFlags.ONLINE" class="add-link hide-from-toc">ONLINE</h3></td> |
| <td>1</td> |
| <td><p>Port is online, i.e., data path is open and any ongoing sessions may |
| send and receive frames.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### TxFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#TxFlags} |
| Type: <code>uint32</code> |
| |
| *Defined in [fuchsia.hardware.network/frames.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=157)* |
| <p>Flags set by a Client when handing a buffer to a client on the tx path.</p> |
| <p>Set by Clients on the <code>inbound_flags</code> field of a tx descriptor.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="TxFlags.TX_ACCEL_0"> |
| <td><h3 id="TxFlags.TX_ACCEL_0" class="add-link hide-from-toc">TX_ACCEL_0</h3></td> |
| <td>1</td> |
| <td><p>Acceleration flag 0.</p> |
| <p>Acceleration flags are mapped to the acceleration features reported by |
| the <a class='link' href='#Device'>Device</a> in <a class='link' href='#Info.tx_accel'>Info.tx_accel</a>. The n-th feature in <code>tx_accel</code> maps |
| to the <code>TX_ACCEL_n</code> <code>TxFlag</code>.</p> |
| </td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_1"> |
| <td><h3 id="TxFlags.TX_ACCEL_1" class="add-link hide-from-toc">TX_ACCEL_1</h3></td> |
| <td>2</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_2"> |
| <td><h3 id="TxFlags.TX_ACCEL_2" class="add-link hide-from-toc">TX_ACCEL_2</h3></td> |
| <td>4</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_3"> |
| <td><h3 id="TxFlags.TX_ACCEL_3" class="add-link hide-from-toc">TX_ACCEL_3</h3></td> |
| <td>8</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_4"> |
| <td><h3 id="TxFlags.TX_ACCEL_4" class="add-link hide-from-toc">TX_ACCEL_4</h3></td> |
| <td>16</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_5"> |
| <td><h3 id="TxFlags.TX_ACCEL_5" class="add-link hide-from-toc">TX_ACCEL_5</h3></td> |
| <td>32</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_6"> |
| <td><h3 id="TxFlags.TX_ACCEL_6" class="add-link hide-from-toc">TX_ACCEL_6</h3></td> |
| <td>64</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_7"> |
| <td><h3 id="TxFlags.TX_ACCEL_7" class="add-link hide-from-toc">TX_ACCEL_7</h3></td> |
| <td>128</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_8"> |
| <td><h3 id="TxFlags.TX_ACCEL_8" class="add-link hide-from-toc">TX_ACCEL_8</h3></td> |
| <td>256</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_9"> |
| <td><h3 id="TxFlags.TX_ACCEL_9" class="add-link hide-from-toc">TX_ACCEL_9</h3></td> |
| <td>512</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_10"> |
| <td><h3 id="TxFlags.TX_ACCEL_10" class="add-link hide-from-toc">TX_ACCEL_10</h3></td> |
| <td>1024</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_11"> |
| <td><h3 id="TxFlags.TX_ACCEL_11" class="add-link hide-from-toc">TX_ACCEL_11</h3></td> |
| <td>2048</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_12"> |
| <td><h3 id="TxFlags.TX_ACCEL_12" class="add-link hide-from-toc">TX_ACCEL_12</h3></td> |
| <td>4096</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_13"> |
| <td><h3 id="TxFlags.TX_ACCEL_13" class="add-link hide-from-toc">TX_ACCEL_13</h3></td> |
| <td>8192</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_14"> |
| <td><h3 id="TxFlags.TX_ACCEL_14" class="add-link hide-from-toc">TX_ACCEL_14</h3></td> |
| <td>16384</td> |
| <td></td> |
| </tr> |
| <tr id="TxFlags.TX_ACCEL_15"> |
| <td><h3 id="TxFlags.TX_ACCEL_15" class="add-link hide-from-toc">TX_ACCEL_15</h3></td> |
| <td>32768</td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### TxReturnFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#TxReturnFlags} |
| Type: <code>uint32</code> |
| |
| *Defined in [fuchsia.hardware.network/frames.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=184)* |
| <p>Flags set by a Device when returning a tx buffer back to a client.</p> |
| <p>Set by Devices on the <code>return_flags</code> field of a tx descriptor.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="TxReturnFlags.TX_RET_NOT_SUPPORTED"> |
| <td><h3 id="TxReturnFlags.TX_RET_NOT_SUPPORTED" class="add-link hide-from-toc">TX_RET_NOT_SUPPORTED</h3></td> |
| <td>1</td> |
| <td><p>Requested operation in <code>inbound_flags</code> is not supported; the frame was |
| not sent.</p> |
| <p>Always set in conjunction with <code>TX_RET_ERROR</code>.</p> |
| </td> |
| </tr> |
| <tr id="TxReturnFlags.TX_RET_OUT_OF_RESOURCES"> |
| <td><h3 id="TxReturnFlags.TX_RET_OUT_OF_RESOURCES" class="add-link hide-from-toc">TX_RET_OUT_OF_RESOURCES</h3></td> |
| <td>2</td> |
| <td><p>Could not allocate resources to send frame.</p> |
| <p>Always set in conjunction with <code>TX_RET_ERROR</code>.</p> |
| </td> |
| </tr> |
| <tr id="TxReturnFlags.TX_RET_NOT_AVAILABLE"> |
| <td><h3 id="TxReturnFlags.TX_RET_NOT_AVAILABLE" class="add-link hide-from-toc">TX_RET_NOT_AVAILABLE</h3></td> |
| <td>4</td> |
| <td><p>Device is not available (offline or disconnected); the frame was not |
| sent.</p> |
| <p>Always set in conjunction with <code>TX_RET_ERROR</code>.</p> |
| </td> |
| </tr> |
| <tr id="TxReturnFlags.TX_RET_ERROR"> |
| <td><h3 id="TxReturnFlags.TX_RET_ERROR" class="add-link hide-from-toc">TX_RET_ERROR</h3></td> |
| <td>2147483648</td> |
| <td></td> |
| </tr> |
| </table> |
| |
| |
| ## **CONSTANTS** |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr> |
| <tr id="FRAME_FEATURES_RAW"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=17">FRAME_FEATURES_RAW</a></td> |
| <td> |
| <code>1</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td><p>Blanket definition for raw frames.</p> |
| <p>Devices that do not perform any sort of parsing of outbound traffic should |
| define <code>FRAME_FEATURES_RAW</code> in the <a class='link' href='#FrameTypeSupport'>FrameTypeSupport</a> entry.</p> |
| </td> |
| </tr> |
| <tr id="MAX_ACCEL_FLAGS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=25">MAX_ACCEL_FLAGS</a></td> |
| <td> |
| <code>16</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td><p>Maximum number of acceleration flags.</p> |
| <p>Each descriptor has 16 bits of space for acceleration flags (<a class='link' href='#RxFlags'>RxFlags</a> and |
| <a class='link' href='#TxFlags'>TxFlags</a>) thus the maximum number of reported accelerations is 16. Each |
| descriptor reports which accelerations were applied (<code>RxFlags</code>) or are |
| requested (<code>TxFlags</code>) by mapping indexes in the vector of supported |
| accelerations (<a class='link' href='#Info.rx_accel'>Info.rx_accel</a> and (<a class='link' href='#Info.tx_accel'>Info.tx_accel</a>) to bits in the |
| respective acceleration flags bitfield.</p> |
| </td> |
| </tr> |
| <tr id="MAX_DESCRIPTOR_CHAIN"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/frames.fidl;l=61">MAX_DESCRIPTOR_CHAIN</a></td> |
| <td> |
| <code>4</code> |
| </td> |
| <td><code>uint8</code></td> |
| <td><p>Maximum number of chained descriptors that describe a single frame.</p> |
| </td> |
| </tr> |
| <tr id="MAX_FRAME_TYPES"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=12">MAX_FRAME_TYPES</a></td> |
| <td> |
| <code>4</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td><p>Maximum numbers of supported frame types for rx or tx.</p> |
| </td> |
| </tr> |
| <tr id="MAX_PORTS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=11">MAX_PORTS</a></td> |
| <td> |
| <code>32</code> |
| </td> |
| <td><code>uint8</code></td> |
| <td><p>The maximum number of ports attached to a device at a given time.</p> |
| </td> |
| </tr> |
| <tr id="MAX_SESSION_NAME"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/device.fidl;l=15">MAX_SESSION_NAME</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td><p>Maximum length of session label.</p> |
| </td> |
| </tr> |
| <tr id="MAX_STATUS_BUFFER"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=8">MAX_STATUS_BUFFER</a></td> |
| <td> |
| <code>50</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td><p>The maximum number of status samples that can be buffered by a |
| <a class='link' href='#StatusWatcher'>StatusWatcher</a>.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ## **ALIASES** |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="BasePortId"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=15">BasePortId</a></td> |
| <td> |
| <code>uint8</code></td> |
| <td><p>The base identifier of a port within a device. Always less than |
| <a class='link' href='#MAX_PORTS'>MAX_PORTS</a>.</p> |
| </td> |
| </tr> |
| <tr id="PortClass"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.network/port.fidl;l=51">PortClass</a></td> |
| <td> |
| <code>fuchsia.hardware.network/DeviceClass</code></td> |
| <td><p>Network port class.</p> |
| </td> |
| </tr> |
| </table> |