~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/mic_bus.h

Version: ~ [ linux-5.2 ] ~ [ linux-5.1.16 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.57 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.132 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.184 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.184 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.69 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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  * The full GNU General Public License is included in this distribution in
 16  * the file called "COPYING".
 17  *
 18  * Intel MIC Bus driver.
 19  *
 20  * This implementation is very similar to the the virtio bus driver
 21  * implementation @ include/linux/virtio.h.
 22  */
 23 #ifndef _MIC_BUS_H_
 24 #define _MIC_BUS_H_
 25 /*
 26  * Everything a mbus driver needs to work with any particular mbus
 27  * implementation.
 28  */
 29 #include <linux/interrupt.h>
 30 #include <linux/dma-mapping.h>
 31 
 32 struct mbus_device_id {
 33         __u32 device;
 34         __u32 vendor;
 35 };
 36 
 37 #define MBUS_DEV_DMA_HOST 2
 38 #define MBUS_DEV_DMA_MIC 3
 39 #define MBUS_DEV_ANY_ID 0xffffffff
 40 
 41 /**
 42  * mbus_device - representation of a device using mbus
 43  * @mmio_va: virtual address of mmio space
 44  * @hw_ops: the hardware ops supported by this device.
 45  * @id: the device type identification (used to match it with a driver).
 46  * @dev: underlying device.
 47  * be used to communicate with.
 48  * @index: unique position on the mbus bus
 49  */
 50 struct mbus_device {
 51         void __iomem *mmio_va;
 52         struct mbus_hw_ops *hw_ops;
 53         struct mbus_device_id id;
 54         struct device dev;
 55         int index;
 56 };
 57 
 58 /**
 59  * mbus_driver - operations for a mbus I/O driver
 60  * @driver: underlying device driver (populate name and owner).
 61  * @id_table: the ids serviced by this driver.
 62  * @probe: the function to call when a device is found.  Returns 0 or -errno.
 63  * @remove: the function to call when a device is removed.
 64  */
 65 struct mbus_driver {
 66         struct device_driver driver;
 67         const struct mbus_device_id *id_table;
 68         int (*probe)(struct mbus_device *dev);
 69         void (*scan)(struct mbus_device *dev);
 70         void (*remove)(struct mbus_device *dev);
 71 };
 72 
 73 /**
 74  * struct mic_irq - opaque pointer used as cookie
 75  */
 76 struct mic_irq;
 77 
 78 /**
 79  * mbus_hw_ops - Hardware operations for accessing a MIC device on the MIC bus.
 80  */
 81 struct mbus_hw_ops {
 82         struct mic_irq* (*request_threaded_irq)(struct mbus_device *mbdev,
 83                                                 irq_handler_t handler,
 84                                                 irq_handler_t thread_fn,
 85                                                 const char *name, void *data,
 86                                                 int intr_src);
 87         void (*free_irq)(struct mbus_device *mbdev,
 88                          struct mic_irq *cookie, void *data);
 89         void (*ack_interrupt)(struct mbus_device *mbdev, int num);
 90 };
 91 
 92 struct mbus_device *
 93 mbus_register_device(struct device *pdev, int id, const struct dma_map_ops *dma_ops,
 94                      struct mbus_hw_ops *hw_ops, int index,
 95                      void __iomem *mmio_va);
 96 void mbus_unregister_device(struct mbus_device *mbdev);
 97 
 98 int mbus_register_driver(struct mbus_driver *drv);
 99 void mbus_unregister_driver(struct mbus_driver *drv);
100 
101 static inline struct mbus_device *dev_to_mbus(struct device *_dev)
102 {
103         return container_of(_dev, struct mbus_device, dev);
104 }
105 
106 static inline struct mbus_driver *drv_to_mbus(struct device_driver *drv)
107 {
108         return container_of(drv, struct mbus_driver, driver);
109 }
110 
111 #endif /* _MIC_BUS_H */
112 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp