2 * Intel MIC Platform Software Stack (MPSS)
4 * Copyright(c) 2014 Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
17 #ifndef _SCIF_PEER_BUS_H_
18 #define _SCIF_PEER_BUS_H_
20 #include <linux/device.h>
21 #include <linux/mic_common.h>
24 * Peer devices show up as PCIe devices for the mgmt node but not the cards.
25 * The mgmt node discovers all the cards on the PCIe bus and informs the other
26 * cards about their peers. Upon notification of a peer a node adds a peer
27 * device to the peer bus to maintain symmetry in the way devices are
28 * discovered across all nodes in the SCIF network.
31 * scif_peer_dev - representation of a peer SCIF device
32 * @dev: underlying device
33 * @dnode - The destination node which this device will communicate with.
35 struct scif_peer_dev
{
41 * scif_peer_driver - operations for a scif_peer I/O driver
42 * @driver: underlying device driver (populate name and owner).
43 * @id_table: the ids serviced by this driver.
44 * @probe: the function to call when a device is found. Returns 0 or -errno.
45 * @remove: the function to call when a device is removed.
47 struct scif_peer_driver
{
48 struct device_driver driver
;
49 const struct scif_peer_dev_id
*id_table
;
51 int (*probe
)(struct scif_peer_dev
*dev
);
52 void (*remove
)(struct scif_peer_dev
*dev
);
57 int scif_peer_register_driver(struct scif_peer_driver
*driver
);
58 void scif_peer_unregister_driver(struct scif_peer_driver
*driver
);
60 struct scif_peer_dev
*scif_peer_register_device(struct scif_dev
*sdev
);
61 void scif_peer_unregister_device(struct scif_peer_dev
*sdev
);
63 int scif_peer_bus_init(void);
64 void scif_peer_bus_exit(void);
65 #endif /* _SCIF_PEER_BUS_H */