3 * Copyright (C) 2010 - 2013 UNISYS 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 as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14 * NON INFRINGEMENT. See the GNU General Public License for more
19 * Unisys Virtual PCI driver header
26 #include <linux/version.h>
27 #include <linux/uuid.h>
29 #define PCI_DEVICE_ID_VIRTHBA 0xAA00
30 #define PCI_DEVICE_ID_VIRTNIC 0xAB00
32 struct scsi_adap_info
{
33 void *scsihost
; /* scsi host if this device is a scsi hba */
34 struct vhba_wwnn wwnn
; /* the world wide node name of vhba */
35 struct vhba_config_max max
; /* various max specifications used
39 struct net_adap_info
{
40 struct net_device
*netdev
; /* network device if this
42 u8 mac_addr
[MAX_MACADDR_LEN
];
48 enum virtpci_dev_type
{
55 enum virtpci_dev_type devtype
; /* indicates type of the
56 * virtual pci device */
57 struct virtpci_driver
*mydriver
; /* which driver has allocated
59 unsigned short vendor
; /* vendor id for device */
60 unsigned short device
; /* device id for device */
61 u32 bus_no
; /* number of bus on which device exists */
62 u32 device_no
; /* device's number on the bus */
63 struct irq_info intr
; /* interrupt info */
64 struct device generic_dev
; /* generic device */
66 struct scsi_adap_info scsi
;
67 struct net_adap_info net
;
70 struct uisqueue_info queueinfo
; /* holds ptr to channel where cmds &
71 * rsps are queued & retrieved */
72 struct virtpci_dev
*next
; /* points to next virtpci device */
75 struct virtpci_driver
{
76 struct list_head node
;
77 const char *name
; /* the name of the driver in sysfs */
80 const struct pci_device_id
*id_table
; /* must be non-NULL for probe
82 int (*probe
)(struct virtpci_dev
*dev
,
83 const struct pci_device_id
*id
); /* device inserted */
84 void (*remove
)(struct virtpci_dev
*dev
); /* Device removed (NULL if
85 * not a hot-plug capable
87 int (*suspend
)(struct virtpci_dev
*dev
,
88 u32 state
); /* Device suspended */
89 int (*resume
)(struct virtpci_dev
*dev
); /* Device woken up */
90 int (*enable_wake
)(struct virtpci_dev
*dev
,
91 u32 state
, int enable
); /* Enable wake event */
92 struct device_driver core_driver
; /* VIRTPCI core fills this in */
95 #define driver_to_virtpci_driver(in_drv) \
96 container_of(in_drv, struct virtpci_driver, core_driver)
97 #define device_to_virtpci_dev(in_dev) \
98 container_of(in_dev, struct virtpci_dev, generic_dev)
100 int virtpci_register_driver(struct virtpci_driver
*);
101 void virtpci_unregister_driver(struct virtpci_driver
*);
103 #endif /* __VIRTPCI_H__ */