drivers: remove direct access to interrupt handle
[dpdk.git] / drivers / bus / pci / pci_common_uio.c
index 318f9a1..244c9a8 100644 (file)
@@ -90,8 +90,11 @@ pci_uio_map_resource(struct rte_pci_device *dev)
        struct mapped_pci_res_list *uio_res_list =
                RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list);
 
-       dev->intr_handle.fd = -1;
-       dev->intr_handle.uio_cfg_fd = -1;
+       if (rte_intr_fd_set(dev->intr_handle, -1))
+               return -1;
+
+       if (rte_intr_dev_fd_set(dev->intr_handle, -1))
+               return -1;
 
        /* secondary processes - use already recorded details */
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
@@ -207,6 +210,7 @@ pci_uio_unmap_resource(struct rte_pci_device *dev)
        struct mapped_pci_resource *uio_res;
        struct mapped_pci_res_list *uio_res_list =
                        RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list);
+       int uio_cfg_fd;
 
        if (dev == NULL)
                return;
@@ -229,12 +233,13 @@ pci_uio_unmap_resource(struct rte_pci_device *dev)
        rte_free(uio_res);
 
        /* close fd if in primary process */
-       close(dev->intr_handle.fd);
-       if (dev->intr_handle.uio_cfg_fd >= 0) {
-               close(dev->intr_handle.uio_cfg_fd);
-               dev->intr_handle.uio_cfg_fd = -1;
+       close(rte_intr_fd_get(dev->intr_handle));
+       uio_cfg_fd = rte_intr_dev_fd_get(dev->intr_handle);
+       if (uio_cfg_fd >= 0) {
+               close(uio_cfg_fd);
+               rte_intr_dev_fd_set(dev->intr_handle, -1);
        }
 
-       dev->intr_handle.fd = -1;
-       dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
+       rte_intr_fd_set(dev->intr_handle, -1);
+       rte_intr_type_set(dev->intr_handle, RTE_INTR_HANDLE_UNKNOWN);
 }