pci: support multiple PCI regions per device
[dpdk.git] / lib / librte_pmd_e1000 / igb_ethdev.c
index 71b6ac0..5647dae 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  * 
- *   Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
  *   All rights reserved.
  * 
  *   Redistribution and use in source and binary forms, with or without 
@@ -283,7 +283,7 @@ eth_igb_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
        struct e1000_hw *hw =
                E1000_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
        struct e1000_vfta * shadow_vfta =
-               E1000_DEV_PRIVATE_TO_VFTA(eth_dev->data->dev_private);
+                       E1000_DEV_PRIVATE_TO_VFTA(eth_dev->data->dev_private);
 
        pci_dev = eth_dev->pci_dev;
        eth_dev->dev_ops = &eth_igb_ops;
@@ -299,10 +299,9 @@ eth_igb_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
                return 0;
        }
 
-       hw->hw_addr= (void *)pci_dev->mem_resource.addr;
+       hw->hw_addr= (void *)pci_dev->mem_resource[0].addr;
 
        igb_identify_hardware(eth_dev);
-
        if (e1000_setup_init_funcs(hw, TRUE) != E1000_SUCCESS) {
                error = -EIO;
                goto err_late;
@@ -415,7 +414,7 @@ eth_igbvf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
 
        hw->device_id = pci_dev->id.device_id;
        hw->vendor_id = pci_dev->id.vendor_id;
-       hw->hw_addr = (void *)pci_dev->mem_resource.addr;
+       hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
 
        /* Initialize the shared code */
        diag = e1000_setup_init_funcs(hw, TRUE);
@@ -1550,7 +1549,8 @@ eth_igb_interrupt_action(struct rte_eth_dev *dev)
  *  void
  */
 static void
-eth_igb_interrupt_handler(struct rte_intr_handle *handle, void *param)
+eth_igb_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
+                                                       void *param)
 {
        struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
 
@@ -1829,7 +1829,8 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)
                        mask = 1;
                        for (j = 0; j < 32; j++){
                                if(vfta & mask)
-                                       igbvf_set_vfta(hw, (i<<5)+j, on);
+                                       igbvf_set_vfta(hw,
+                                               (uint16_t)((i<<5)+j), on);
                                mask<<=1;
                        }
                }