DPDK  17.05.2
Data Structures | Macros | Typedefs | Functions
rte_bus.h File Reference
#include <stdio.h>
#include <sys/queue.h>
#include <rte_log.h>
#include <rte_dev.h>

Go to the source code of this file.

Data Structures

struct  rte_bus

Macros

#define RTE_REGISTER_BUS(nm, bus)

Typedefs

typedef int(* rte_bus_scan_t )(void)
typedef int(* rte_bus_probe_t )(void)

Functions

 TAILQ_HEAD (rte_bus_list, rte_bus)
void rte_bus_register (struct rte_bus *bus)
void rte_bus_unregister (struct rte_bus *bus)
int rte_bus_scan (void)
int rte_bus_probe (void)
void rte_bus_dump (FILE *f)

Detailed Description

DPDK device bus interface

This file exposes API and interfaces for bus abstraction over the devices and drivers in EAL.

Definition in file rte_bus.h.

Macro Definition Documentation

#define RTE_REGISTER_BUS (   nm,
  bus 
)
Value:
static void __attribute__((constructor(101), used)) businitfn_ ##nm(void) \
{\
(bus).name = RTE_STR(nm);\
rte_bus_register(&bus); \
}

Helper for Bus registration. The constructor has higher priority than PMD constructors.

Definition at line 147 of file rte_bus.h.

Typedef Documentation

typedef int(* rte_bus_scan_t)(void)

Bus specific scan for devices attached on the bus. For each bus object, the scan would be reponsible for finding devices and adding them to its private device list.

A bus should mandatorily implement this method.

Returns
0 for successful scan <0 for unsuccessful scan with error value

Definition at line 70 of file rte_bus.h.

typedef int(* rte_bus_probe_t)(void)

Implementation specific probe function which is responsible for linking devices on that bus with applicable drivers.

This is called while iterating over each registered bus.

Returns
0 for successful probe !0 for any error while probing

Definition at line 82 of file rte_bus.h.

Function Documentation

TAILQ_HEAD ( rte_bus_list  ,
rte_bus   
)
void rte_bus_register ( struct rte_bus bus)

Register a Bus handler.

Parameters
busA pointer to a rte_bus structure describing the bus to be registered.
void rte_bus_unregister ( struct rte_bus bus)

Unregister a Bus handler.

Parameters
busA pointer to a rte_bus structure describing the bus to be unregistered.
int rte_bus_scan ( void  )

Scan all the buses.

Returns
0 in case of success in scanning all buses !0 in case of failure to scan
int rte_bus_probe ( void  )

For each device on the buses, perform a driver 'match' and call the driver-specific probe for device initialization.

Returns
0 for successful match/probe !0 otherwise
void rte_bus_dump ( FILE *  f)

Dump information of all the buses registered with EAL.

Parameters
fA valid and open output stream handle
Returns
0 in case of success !0 in case there is error in opening the output stream