rio.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * RapidIO interconnect services
  4. * (RapidIO Interconnect Specification, http://www.rapidio.org)
  5. *
  6. * Copyright 2005 MontaVista Software, Inc.
  7. * Matt Porter <mporter@kernel.crashing.org>
  8. */
  9. #ifndef LINUX_RIO_H
  10. #define LINUX_RIO_H
  11. #include <linux/types.h>
  12. #include <linux/ioport.h>
  13. #include <linux/list.h>
  14. #include <linux/errno.h>
  15. #include <linux/device.h>
  16. #include <linux/rio_regs.h>
  17. #include <linux/mod_devicetable.h>
  18. #ifdef CONFIG_RAPIDIO_DMA_ENGINE
  19. #include <linux/dmaengine.h>
  20. #endif
  21. #define RIO_NO_HOPCOUNT -1
  22. #define RIO_INVALID_DESTID 0xffff
  23. #define RIO_MAX_MPORTS 8
  24. #define RIO_MAX_MPORT_RESOURCES 16
  25. #define RIO_MAX_DEV_RESOURCES 16
  26. #define RIO_MAX_MPORT_NAME 40
  27. #define RIO_GLOBAL_TABLE 0xff /* Indicates access of a switch's
  28. global routing table if it
  29. has multiple (or per port)
  30. tables */
  31. #define RIO_INVALID_ROUTE 0xff /* Indicates that a route table
  32. entry is invalid (no route
  33. exists for the device ID) */
  34. #define RIO_MAX_ROUTE_ENTRIES(size) (size ? (1 << 16) : (1 << 8))
  35. #define RIO_ANY_DESTID(size) (size ? 0xffff : 0xff)
  36. #define RIO_MAX_MBOX 4
  37. #define RIO_MAX_MSG_SIZE 0x1000
  38. /*
  39. * Error values that may be returned by RIO functions.
  40. */
  41. #define RIO_SUCCESSFUL 0x00
  42. #define RIO_BAD_SIZE 0x81
  43. /*
  44. * For RIO devices, the region numbers are assigned this way:
  45. *
  46. * 0 RapidIO outbound doorbells
  47. * 1-15 RapidIO memory regions
  48. *
  49. * For RIO master ports, the region number are assigned this way:
  50. *
  51. * 0 RapidIO inbound doorbells
  52. * 1 RapidIO inbound mailboxes
  53. * 2 RapidIO outbound mailboxes
  54. */
  55. #define RIO_DOORBELL_RESOURCE 0
  56. #define RIO_INB_MBOX_RESOURCE 1
  57. #define RIO_OUTB_MBOX_RESOURCE 2
  58. #define RIO_PW_MSG_SIZE 64
  59. /*
  60. * A component tag value (stored in the component tag CSR) is used as device's
  61. * unique identifier assigned during enumeration. Besides being used for
  62. * identifying switches (which do not have device ID register), it also is used
  63. * by error management notification and therefore has to be assigned
  64. * to endpoints as well.
  65. */
  66. #define RIO_CTAG_RESRVD 0xfffe0000 /* Reserved */
  67. #define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */
  68. extern struct bus_type rio_bus_type;
  69. extern struct class rio_mport_class;
  70. struct rio_mport;
  71. struct rio_dev;
  72. union rio_pw_msg;
  73. /**
  74. * struct rio_switch - RIO switch info
  75. * @node: Node in global list of switches
  76. * @route_table: Copy of switch routing table
  77. * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
  78. * @ops: pointer to switch-specific operations
  79. * @lock: lock to serialize operations updates
  80. * @nextdev: Array of per-port pointers to the next attached device
  81. */
  82. struct rio_switch {
  83. struct list_head node;
  84. u8 *route_table;
  85. u32 port_ok;
  86. struct rio_switch_ops *ops;
  87. spinlock_t lock;
  88. struct rio_dev *nextdev[];
  89. };
  90. /**
  91. * struct rio_switch_ops - Per-switch operations
  92. * @owner: The module owner of this structure
  93. * @add_entry: Callback for switch-specific route add function
  94. * @get_entry: Callback for switch-specific route get function
  95. * @clr_table: Callback for switch-specific clear route table function
  96. * @set_domain: Callback for switch-specific domain setting function
  97. * @get_domain: Callback for switch-specific domain get function
  98. * @em_init: Callback for switch-specific error management init function
  99. * @em_handle: Callback for switch-specific error management handler function
  100. *
  101. * Defines the operations that are necessary to initialize/control
  102. * a particular RIO switch device.
  103. */
  104. struct rio_switch_ops {
  105. struct module *owner;
  106. int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,
  107. u16 table, u16 route_destid, u8 route_port);
  108. int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,
  109. u16 table, u16 route_destid, u8 *route_port);
  110. int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,
  111. u16 table);
  112. int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
  113. u8 sw_domain);
  114. int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
  115. u8 *sw_domain);
  116. int (*em_init) (struct rio_dev *dev);
  117. int (*em_handle) (struct rio_dev *dev, u8 swport);
  118. };
  119. enum rio_device_state {
  120. RIO_DEVICE_INITIALIZING,
  121. RIO_DEVICE_RUNNING,
  122. RIO_DEVICE_GONE,
  123. RIO_DEVICE_SHUTDOWN,
  124. };
  125. /**
  126. * struct rio_dev - RIO device info
  127. * @global_list: Node in list of all RIO devices
  128. * @net_list: Node in list of RIO devices in a network
  129. * @net: Network this device is a part of
  130. * @do_enum: Enumeration flag
  131. * @did: Device ID
  132. * @vid: Vendor ID
  133. * @device_rev: Device revision
  134. * @asm_did: Assembly device ID
  135. * @asm_vid: Assembly vendor ID
  136. * @asm_rev: Assembly revision
  137. * @efptr: Extended feature pointer
  138. * @pef: Processing element features
  139. * @swpinfo: Switch port info
  140. * @src_ops: Source operation capabilities
  141. * @dst_ops: Destination operation capabilities
  142. * @comp_tag: RIO component tag
  143. * @phys_efptr: RIO device extended features pointer
  144. * @phys_rmap: LP-Serial Register Map Type (1 or 2)
  145. * @em_efptr: RIO Error Management features pointer
  146. * @dma_mask: Mask of bits of RIO address this device implements
  147. * @driver: Driver claiming this device
  148. * @dev: Device model device
  149. * @riores: RIO resources this device owns
  150. * @pwcback: port-write callback function for this device
  151. * @destid: Network destination ID (or associated destid for switch)
  152. * @hopcount: Hopcount to this device
  153. * @prev: Previous RIO device connected to the current one
  154. * @state: device state
  155. * @rswitch: struct rio_switch (if valid for this device)
  156. */
  157. struct rio_dev {
  158. struct list_head global_list; /* node in list of all RIO devices */
  159. struct list_head net_list; /* node in per net list */
  160. struct rio_net *net; /* RIO net this device resides in */
  161. bool do_enum;
  162. u16 did;
  163. u16 vid;
  164. u32 device_rev;
  165. u16 asm_did;
  166. u16 asm_vid;
  167. u16 asm_rev;
  168. u16 efptr;
  169. u32 pef;
  170. u32 swpinfo;
  171. u32 src_ops;
  172. u32 dst_ops;
  173. u32 comp_tag;
  174. u32 phys_efptr;
  175. u32 phys_rmap;
  176. u32 em_efptr;
  177. u64 dma_mask;
  178. struct rio_driver *driver; /* RIO driver claiming this device */
  179. struct device dev; /* LDM device structure */
  180. struct resource riores[RIO_MAX_DEV_RESOURCES];
  181. int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
  182. u16 destid;
  183. u8 hopcount;
  184. struct rio_dev *prev;
  185. atomic_t state;
  186. struct rio_switch rswitch[]; /* RIO switch info */
  187. };
  188. #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
  189. #define rio_dev_f(n) list_entry(n, struct rio_dev, net_list)
  190. #define to_rio_dev(n) container_of(n, struct rio_dev, dev)
  191. #define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0])
  192. #define to_rio_mport(n) container_of(n, struct rio_mport, dev)
  193. #define to_rio_net(n) container_of(n, struct rio_net, dev)
  194. /**
  195. * struct rio_msg - RIO message event
  196. * @res: Mailbox resource
  197. * @mcback: Message event callback
  198. */
  199. struct rio_msg {
  200. struct resource *res;
  201. void (*mcback) (struct rio_mport * mport, void *dev_id, int mbox, int slot);
  202. };
  203. /**
  204. * struct rio_dbell - RIO doorbell event
  205. * @node: Node in list of doorbell events
  206. * @res: Doorbell resource
  207. * @dinb: Doorbell event callback
  208. * @dev_id: Device specific pointer to pass on event
  209. */
  210. struct rio_dbell {
  211. struct list_head node;
  212. struct resource *res;
  213. void (*dinb) (struct rio_mport *mport, void *dev_id, u16 src, u16 dst, u16 info);
  214. void *dev_id;
  215. };
  216. /**
  217. * struct rio_mport - RIO master port info
  218. * @dbells: List of doorbell events
  219. * @pwrites: List of portwrite events
  220. * @node: Node in global list of master ports
  221. * @nnode: Node in network list of master ports
  222. * @net: RIO net this mport is attached to
  223. * @lock: lock to synchronize lists manipulations
  224. * @iores: I/O mem resource that this master port interface owns
  225. * @riores: RIO resources that this master port interfaces owns
  226. * @inb_msg: RIO inbound message event descriptors
  227. * @outb_msg: RIO outbound message event descriptors
  228. * @host_deviceid: Host device ID associated with this master port
  229. * @ops: configuration space functions
  230. * @id: Port ID, unique among all ports
  231. * @index: Port index, unique among all port interfaces of the same type
  232. * @sys_size: RapidIO common transport system size
  233. * @phys_efptr: RIO port extended features pointer
  234. * @phys_rmap: LP-Serial EFB Register Mapping type (1 or 2).
  235. * @name: Port name string
  236. * @dev: device structure associated with an mport
  237. * @priv: Master port private data
  238. * @dma: DMA device associated with mport
  239. * @nscan: RapidIO network enumeration/discovery operations
  240. * @state: mport device state
  241. * @pwe_refcnt: port-write enable ref counter to track enable/disable requests
  242. */
  243. struct rio_mport {
  244. struct list_head dbells; /* list of doorbell events */
  245. struct list_head pwrites; /* list of portwrite events */
  246. struct list_head node; /* node in global list of ports */
  247. struct list_head nnode; /* node in net list of ports */
  248. struct rio_net *net; /* RIO net this mport is attached to */
  249. struct mutex lock;
  250. struct resource iores;
  251. struct resource riores[RIO_MAX_MPORT_RESOURCES];
  252. struct rio_msg inb_msg[RIO_MAX_MBOX];
  253. struct rio_msg outb_msg[RIO_MAX_MBOX];
  254. int host_deviceid; /* Host device ID */
  255. struct rio_ops *ops; /* low-level architecture-dependent routines */
  256. unsigned char id; /* port ID, unique among all ports */
  257. unsigned char index; /* port index, unique among all port
  258. interfaces of the same type */
  259. unsigned int sys_size; /* RapidIO common transport system size.
  260. * 0 - Small size. 256 devices.
  261. * 1 - Large size, 65536 devices.
  262. */
  263. u32 phys_efptr;
  264. u32 phys_rmap;
  265. unsigned char name[RIO_MAX_MPORT_NAME];
  266. struct device dev;
  267. void *priv; /* Master port private data */
  268. #ifdef CONFIG_RAPIDIO_DMA_ENGINE
  269. struct dma_device dma;
  270. #endif
  271. struct rio_scan *nscan;
  272. atomic_t state;
  273. unsigned int pwe_refcnt;
  274. };
  275. static inline int rio_mport_is_running(struct rio_mport *mport)
  276. {
  277. return atomic_read(&mport->state) == RIO_DEVICE_RUNNING;
  278. }
  279. /*
  280. * Enumeration/discovery control flags
  281. */
  282. #define RIO_SCAN_ENUM_NO_WAIT 0x00000001 /* Do not wait for enum completed */
  283. /**
  284. * struct rio_net - RIO network info
  285. * @node: Node in global list of RIO networks
  286. * @devices: List of devices in this network
  287. * @switches: List of switches in this network
  288. * @mports: List of master ports accessing this network
  289. * @hport: Default port for accessing this network
  290. * @id: RIO network ID
  291. * @dev: Device object
  292. * @enum_data: private data specific to a network enumerator
  293. * @release: enumerator-specific release callback
  294. */
  295. struct rio_net {
  296. struct list_head node; /* node in list of networks */
  297. struct list_head devices; /* list of devices in this net */
  298. struct list_head switches; /* list of switches in this net */
  299. struct list_head mports; /* list of ports accessing net */
  300. struct rio_mport *hport; /* primary port for accessing net */
  301. unsigned char id; /* RIO network ID */
  302. struct device dev;
  303. void *enum_data; /* private data for enumerator of the network */
  304. void (*release)(struct rio_net *net);
  305. };
  306. enum rio_link_speed {
  307. RIO_LINK_DOWN = 0, /* SRIO Link not initialized */
  308. RIO_LINK_125 = 1, /* 1.25 GBaud */
  309. RIO_LINK_250 = 2, /* 2.5 GBaud */
  310. RIO_LINK_312 = 3, /* 3.125 GBaud */
  311. RIO_LINK_500 = 4, /* 5.0 GBaud */
  312. RIO_LINK_625 = 5 /* 6.25 GBaud */
  313. };
  314. enum rio_link_width {
  315. RIO_LINK_1X = 0,
  316. RIO_LINK_1XR = 1,
  317. RIO_LINK_2X = 3,
  318. RIO_LINK_4X = 2,
  319. RIO_LINK_8X = 4,
  320. RIO_LINK_16X = 5
  321. };
  322. enum rio_mport_flags {
  323. RIO_MPORT_DMA = (1 << 0), /* supports DMA data transfers */
  324. RIO_MPORT_DMA_SG = (1 << 1), /* DMA supports HW SG mode */
  325. RIO_MPORT_IBSG = (1 << 2), /* inbound mapping supports SG */
  326. };
  327. /**
  328. * struct rio_mport_attr - RIO mport device attributes
  329. * @flags: mport device capability flags
  330. * @link_speed: SRIO link speed value (as defined by RapidIO specification)
  331. * @link_width: SRIO link width value (as defined by RapidIO specification)
  332. * @dma_max_sge: number of SG list entries that can be handled by DMA channel(s)
  333. * @dma_max_size: max number of bytes in single DMA transfer (SG entry)
  334. * @dma_align: alignment shift for DMA operations (as for other DMA operations)
  335. */
  336. struct rio_mport_attr {
  337. int flags;
  338. int link_speed;
  339. int link_width;
  340. /* DMA capability info: valid only if RIO_MPORT_DMA flag is set */
  341. int dma_max_sge;
  342. int dma_max_size;
  343. int dma_align;
  344. };
  345. /* Low-level architecture-dependent routines */
  346. /**
  347. * struct rio_ops - Low-level RIO configuration space operations
  348. * @lcread: Callback to perform local (master port) read of config space.
  349. * @lcwrite: Callback to perform local (master port) write of config space.
  350. * @cread: Callback to perform network read of config space.
  351. * @cwrite: Callback to perform network write of config space.
  352. * @dsend: Callback to send a doorbell message.
  353. * @pwenable: Callback to enable/disable port-write message handling.
  354. * @open_outb_mbox: Callback to initialize outbound mailbox.
  355. * @close_outb_mbox: Callback to shut down outbound mailbox.
  356. * @open_inb_mbox: Callback to initialize inbound mailbox.
  357. * @close_inb_mbox: Callback to shut down inbound mailbox.
  358. * @add_outb_message: Callback to add a message to an outbound mailbox queue.
  359. * @add_inb_buffer: Callback to add a buffer to an inbound mailbox queue.
  360. * @get_inb_message: Callback to get a message from an inbound mailbox queue.
  361. * @map_inb: Callback to map RapidIO address region into local memory space.
  362. * @unmap_inb: Callback to unmap RapidIO address region mapped with map_inb().
  363. * @query_mport: Callback to query mport device attributes.
  364. * @map_outb: Callback to map outbound address region into local memory space.
  365. * @unmap_outb: Callback to unmap outbound RapidIO address region.
  366. */
  367. struct rio_ops {
  368. int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
  369. u32 *data);
  370. int (*lcwrite) (struct rio_mport *mport, int index, u32 offset, int len,
  371. u32 data);
  372. int (*cread) (struct rio_mport *mport, int index, u16 destid,
  373. u8 hopcount, u32 offset, int len, u32 *data);
  374. int (*cwrite) (struct rio_mport *mport, int index, u16 destid,
  375. u8 hopcount, u32 offset, int len, u32 data);
  376. int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data);
  377. int (*pwenable) (struct rio_mport *mport, int enable);
  378. int (*open_outb_mbox)(struct rio_mport *mport, void *dev_id,
  379. int mbox, int entries);
  380. void (*close_outb_mbox)(struct rio_mport *mport, int mbox);
  381. int (*open_inb_mbox)(struct rio_mport *mport, void *dev_id,
  382. int mbox, int entries);
  383. void (*close_inb_mbox)(struct rio_mport *mport, int mbox);
  384. int (*add_outb_message)(struct rio_mport *mport, struct rio_dev *rdev,
  385. int mbox, void *buffer, size_t len);
  386. int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf);
  387. void *(*get_inb_message)(struct rio_mport *mport, int mbox);
  388. int (*map_inb)(struct rio_mport *mport, dma_addr_t lstart,
  389. u64 rstart, u64 size, u32 flags);
  390. void (*unmap_inb)(struct rio_mport *mport, dma_addr_t lstart);
  391. int (*query_mport)(struct rio_mport *mport,
  392. struct rio_mport_attr *attr);
  393. int (*map_outb)(struct rio_mport *mport, u16 destid, u64 rstart,
  394. u32 size, u32 flags, dma_addr_t *laddr);
  395. void (*unmap_outb)(struct rio_mport *mport, u16 destid, u64 rstart);
  396. };
  397. #define RIO_RESOURCE_MEM 0x00000100
  398. #define RIO_RESOURCE_DOORBELL 0x00000200
  399. #define RIO_RESOURCE_MAILBOX 0x00000400
  400. #define RIO_RESOURCE_CACHEABLE 0x00010000
  401. #define RIO_RESOURCE_PCI 0x00020000
  402. #define RIO_RESOURCE_BUSY 0x80000000
  403. /**
  404. * struct rio_driver - RIO driver info
  405. * @node: Node in list of drivers
  406. * @name: RIO driver name
  407. * @id_table: RIO device ids to be associated with this driver
  408. * @probe: RIO device inserted
  409. * @remove: RIO device removed
  410. * @shutdown: shutdown notification callback
  411. * @suspend: RIO device suspended
  412. * @resume: RIO device awakened
  413. * @enable_wake: RIO device enable wake event
  414. * @driver: LDM driver struct
  415. *
  416. * Provides info on a RIO device driver for insertion/removal and
  417. * power management purposes.
  418. */
  419. struct rio_driver {
  420. struct list_head node;
  421. char *name;
  422. const struct rio_device_id *id_table;
  423. int (*probe) (struct rio_dev * dev, const struct rio_device_id * id);
  424. void (*remove) (struct rio_dev * dev);
  425. void (*shutdown)(struct rio_dev *dev);
  426. int (*suspend) (struct rio_dev * dev, u32 state);
  427. int (*resume) (struct rio_dev * dev);
  428. int (*enable_wake) (struct rio_dev * dev, u32 state, int enable);
  429. struct device_driver driver;
  430. };
  431. #define to_rio_driver(drv) container_of(drv,struct rio_driver, driver)
  432. union rio_pw_msg {
  433. struct {
  434. u32 comptag; /* Component Tag CSR */
  435. u32 errdetect; /* Port N Error Detect CSR */
  436. u32 is_port; /* Implementation specific + PortID */
  437. u32 ltlerrdet; /* LTL Error Detect CSR */
  438. u32 padding[12];
  439. } em;
  440. u32 raw[RIO_PW_MSG_SIZE/sizeof(u32)];
  441. };
  442. #ifdef CONFIG_RAPIDIO_DMA_ENGINE
  443. /*
  444. * enum rio_write_type - RIO write transaction types used in DMA transfers
  445. *
  446. * Note: RapidIO specification defines write (NWRITE) and
  447. * write-with-response (NWRITE_R) data transfer operations.
  448. * Existing DMA controllers that service RapidIO may use one of these operations
  449. * for entire data transfer or their combination with only the last data packet
  450. * requires response.
  451. */
  452. enum rio_write_type {
  453. RDW_DEFAULT, /* default method used by DMA driver */
  454. RDW_ALL_NWRITE, /* all packets use NWRITE */
  455. RDW_ALL_NWRITE_R, /* all packets use NWRITE_R */
  456. RDW_LAST_NWRITE_R, /* last packet uses NWRITE_R, others - NWRITE */
  457. };
  458. struct rio_dma_ext {
  459. u16 destid;
  460. u64 rio_addr; /* low 64-bits of 66-bit RapidIO address */
  461. u8 rio_addr_u; /* upper 2-bits of 66-bit RapidIO address */
  462. enum rio_write_type wr_type; /* preferred RIO write operation type */
  463. };
  464. struct rio_dma_data {
  465. /* Local data (as scatterlist) */
  466. struct scatterlist *sg; /* I/O scatter list */
  467. unsigned int sg_len; /* size of scatter list */
  468. /* Remote device address (flat buffer) */
  469. u64 rio_addr; /* low 64-bits of 66-bit RapidIO address */
  470. u8 rio_addr_u; /* upper 2-bits of 66-bit RapidIO address */
  471. enum rio_write_type wr_type; /* preferred RIO write operation type */
  472. };
  473. static inline struct rio_mport *dma_to_mport(struct dma_device *ddev)
  474. {
  475. return container_of(ddev, struct rio_mport, dma);
  476. }
  477. #endif /* CONFIG_RAPIDIO_DMA_ENGINE */
  478. /**
  479. * struct rio_scan - RIO enumeration and discovery operations
  480. * @owner: The module owner of this structure
  481. * @enumerate: Callback to perform RapidIO fabric enumeration.
  482. * @discover: Callback to perform RapidIO fabric discovery.
  483. */
  484. struct rio_scan {
  485. struct module *owner;
  486. int (*enumerate)(struct rio_mport *mport, u32 flags);
  487. int (*discover)(struct rio_mport *mport, u32 flags);
  488. };
  489. /**
  490. * struct rio_scan_node - list node to register RapidIO enumeration and
  491. * discovery methods with RapidIO core.
  492. * @mport_id: ID of an mport (net) serviced by this enumerator
  493. * @node: node in global list of registered enumerators
  494. * @ops: RIO enumeration and discovery operations
  495. */
  496. struct rio_scan_node {
  497. int mport_id;
  498. struct list_head node;
  499. struct rio_scan *ops;
  500. };
  501. /* Architecture and hardware-specific functions */
  502. extern int rio_mport_initialize(struct rio_mport *);
  503. extern int rio_register_mport(struct rio_mport *);
  504. extern int rio_unregister_mport(struct rio_mport *);
  505. extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int);
  506. extern void rio_close_inb_mbox(struct rio_mport *, int);
  507. extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int);
  508. extern void rio_close_outb_mbox(struct rio_mport *, int);
  509. extern int rio_query_mport(struct rio_mport *port,
  510. struct rio_mport_attr *mport_attr);
  511. #endif /* LINUX_RIO_H */