]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/misc/mic/scif/scif_peer_bus.h
Merge branch 'for-4.3/logitech' into for-next
[karo-tx-linux.git] / drivers / misc / mic / scif / scif_peer_bus.h
1 /*
2  * Intel MIC Platform Software Stack (MPSS)
3  *
4  * Copyright(c) 2014 Intel Corporation.
5  *
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.
9  *
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.
14  *
15  * Intel SCIF driver.
16  */
17 #ifndef _SCIF_PEER_BUS_H_
18 #define _SCIF_PEER_BUS_H_
19
20 #include <linux/device.h>
21 #include <linux/mic_common.h>
22
23 /*
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.
29  */
30 /**
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.
34  */
35 struct scif_peer_dev {
36         struct device dev;
37         u8 dnode;
38 };
39
40 /**
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.
46  */
47 struct scif_peer_driver {
48         struct device_driver driver;
49         const struct scif_peer_dev_id *id_table;
50
51         int (*probe)(struct scif_peer_dev *dev);
52         void (*remove)(struct scif_peer_dev *dev);
53 };
54
55 struct scif_dev;
56
57 int scif_peer_register_driver(struct scif_peer_driver *driver);
58 void scif_peer_unregister_driver(struct scif_peer_driver *driver);
59
60 struct scif_peer_dev *scif_peer_register_device(struct scif_dev *sdev);
61 void scif_peer_unregister_device(struct scif_peer_dev *sdev);
62
63 int scif_peer_bus_init(void);
64 void scif_peer_bus_exit(void);
65 #endif /* _SCIF_PEER_BUS_H */