rio.h 19 KB

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