eal: provide functions to access PCI config
[dpdk.git] / lib / librte_eal / common / include / rte_pci.h
index e96f389..34cafa6 100644 (file)
@@ -416,7 +416,7 @@ int rte_eal_pci_probe_one(const struct rte_pci_addr *addr);
  * Close the single PCI device.
  *
  * Scan the content of the PCI bus, and find the pci device specified by pci
- * address, then call the close() function for registered driver that has a
+ * address, then call the devuninit() function for registered driver that has a
  * matching entry in its id_table for discovered device.
  *
  * @param addr
@@ -425,7 +425,9 @@ int rte_eal_pci_probe_one(const struct rte_pci_addr *addr);
  *   - 0 on success.
  *   - Negative on error.
  */
-int rte_eal_pci_close_one(const struct rte_pci_addr *addr);
+int rte_eal_pci_detach(const struct rte_pci_addr *addr);
+int __attribute__ ((deprecated))
+rte_eal_pci_close_one(const struct rte_pci_addr *addr);
 
 /**
  * Dump the content of the PCI bus.
@@ -453,6 +455,38 @@ void rte_eal_pci_register(struct rte_pci_driver *driver);
  */
 void rte_eal_pci_unregister(struct rte_pci_driver *driver);
 
+/**
+ * Read PCI config space.
+ *
+ * @param device
+ *   A pointer to a rte_pci_device structure describing the device
+ *   to use
+ * @param buf
+ *   A data buffer where the bytes should be read into
+ * @param len
+ *   The length of the data buffer.
+ * @param offset
+ *   The offset into PCI config space
+ */
+int rte_eal_pci_read_config(const struct rte_pci_device *device,
+                           void *buf, size_t len, off_t offset);
+
+/**
+ * Write PCI config space.
+ *
+ * @param device
+ *   A pointer to a rte_pci_device structure describing the device
+ *   to use
+ * @param buf
+ *   A data buffer containing the bytes should be written
+ * @param len
+ *   The length of the data buffer.
+ * @param offset
+ *   The offset into PCI config space
+ */
+int rte_eal_pci_write_config(const struct rte_pci_device *device,
+                            const void *buf, size_t len, off_t offset);
+
 #ifdef __cplusplus
 }
 #endif