---
name: "rio_setup_device"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/rio_setup_device"
---

# rio\_setup\_device(9)

Allocates and sets up a RIO device

## NAME

rio\_setup\_device - Allocates and sets up a RIO device

## SYNOPSIS

**struct rio\_dev \* rio\_setup\_device(struct rio\_net \*** *net***, struct rio\_mport \*** *port***, u16** *destid***, u8** *hopcount***, int** *do\_enum***);**

## ARGUMENTS

*net*

RIO network

*port*

Master port to send transactions

*destid*

Current destination ID

*hopcount*

Current hopcount

*do\_enum*

Enumeration/Discovery mode flag

## DESCRIPTION

Allocates a RIO device and configures fields based on configuration space contents. If device has a destination ID register, a destination ID is either assigned in enumeration mode or read from configuration space in discovery mode. If the device has switch capabilities, then a switch is allocated and configured appropriately. Returns a pointer to a RIO device on success or NULL on failure.

## AUTHOR

**Matt Porter** \<mporter@kernel.crashing.org\>, \<mporter@mvista.com\>

Author.

## COPYRIGHT
