diff options
Diffstat (limited to 'arch/powerpc/include/asm/vio.h')
| -rw-r--r-- | arch/powerpc/include/asm/vio.h | 61 | 
1 files changed, 58 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/vio.h b/arch/powerpc/include/asm/vio.h index 0a290a19594..4f9b7ca0710 100644 --- a/arch/powerpc/include/asm/vio.h +++ b/arch/powerpc/include/asm/vio.h @@ -15,7 +15,6 @@  #define _ASM_POWERPC_VIO_H  #ifdef __KERNEL__ -#include <linux/init.h>  #include <linux/errno.h>  #include <linux/device.h>  #include <linux/dma-mapping.h> @@ -44,8 +43,52 @@   */  #define VIO_CMO_MIN_ENT 1562624 +extern struct bus_type vio_bus_type; +  struct iommu_table; +/* + * Platform Facilities Option (PFO)-specific data + */ + +/* Starting unit address for PFO devices on the VIO BUS */ +#define VIO_BASE_PFO_UA	0x50000000 + +/** + * vio_pfo_op - PFO operation parameters + * + * @flags: h_call subfunctions and modifiers + * @in: Input data block logical real address + * @inlen: If non-negative, the length of the input data block.  If negative, + *	the length of the input data descriptor list in bytes. + * @out: Output data block logical real address + * @outlen: If non-negative, the length of the input data block.  If negative, + *	the length of the input data descriptor list in bytes. + * @csbcpb: Logical real address of the 4k naturally-aligned storage block + *	containing the CSB & optional FC field specific CPB + * @timeout: # of milliseconds to retry h_call, 0 for no timeout. + * @hcall_err: pointer to return the h_call return value, else NULL + */ +struct vio_pfo_op { +	u64 flags; +	s64 in; +	s64 inlen; +	s64 out; +	s64 outlen; +	u64 csbcpb; +	void *done; +	unsigned long handle; +	unsigned int timeout; +	long hcall_err; +}; + +/* End PFO specific data */ + +enum vio_dev_family { +	VDEVICE,	/* The OF node is a child of /vdevice */ +	PFO,		/* The OF node is a child of /ibm,platform-facilities */ +}; +  /**   * vio_dev - This structure is used to describe virtual I/O devices.   * @@ -58,6 +101,7 @@ struct vio_dev {  	const char *name;  	const char *type;  	uint32_t unit_address; +	uint32_t resource_id;  	unsigned int irq;  	struct {  		size_t desired; @@ -65,10 +109,12 @@ struct vio_dev {  		size_t allocated;  		atomic_t allocs_failed;  	} cmo; +	enum vio_dev_family family;  	struct device dev;  };  struct vio_driver { +	const char *name;  	const struct vio_device_id *id_table;  	int (*probe)(struct vio_dev *dev, const struct vio_device_id *id);  	int (*remove)(struct vio_dev *dev); @@ -76,16 +122,25 @@ struct vio_driver {  	 * be loaded in a CMO environment if it uses DMA.  	 */  	unsigned long (*get_desired_dma)(struct vio_dev *dev); +	const struct dev_pm_ops *pm;  	struct device_driver driver;  }; -extern int vio_register_driver(struct vio_driver *drv); +extern int __vio_register_driver(struct vio_driver *drv, struct module *owner, +				 const char *mod_name); +/* + * vio_register_driver must be a macro so that KBUILD_MODNAME can be expanded + */ +#define vio_register_driver(driver)		\ +	__vio_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)  extern void vio_unregister_driver(struct vio_driver *drv);  extern int vio_cmo_entitlement_update(size_t);  extern void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired); -extern void __devinit vio_unregister_device(struct vio_dev *dev); +extern void vio_unregister_device(struct vio_dev *dev); + +extern int vio_h_cop_sync(struct vio_dev *vdev, struct vio_pfo_op *op);  struct device_node;  | 
