aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxge/vxge-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/vxge/vxge-main.c')
-rw-r--r--drivers/net/vxge/vxge-main.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index fd0ebf78bead..8a3c7b327cf6 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -4152,18 +4152,6 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4152 attr.bar0, 4152 attr.bar0,
4153 (unsigned long long)pci_resource_start(pdev, 0)); 4153 (unsigned long long)pci_resource_start(pdev, 0));
4154 4154
4155 attr.bar1 = pci_ioremap_bar(pdev, 2);
4156 if (!attr.bar1) {
4157 vxge_debug_init(VXGE_ERR,
4158 "%s : cannot remap io memory bar2", __func__);
4159 ret = -ENODEV;
4160 goto _exit3;
4161 }
4162 vxge_debug_ll_config(VXGE_TRACE,
4163 "pci ioremap bar1: %p:0x%llx",
4164 attr.bar1,
4165 (unsigned long long)pci_resource_start(pdev, 2));
4166
4167 status = vxge_hw_device_hw_info_get(attr.bar0, 4155 status = vxge_hw_device_hw_info_get(attr.bar0,
4168 &ll_config.device_hw_info); 4156 &ll_config.device_hw_info);
4169 if (status != VXGE_HW_OK) { 4157 if (status != VXGE_HW_OK) {
@@ -4171,7 +4159,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4171 "%s: Reading of hardware info failed." 4159 "%s: Reading of hardware info failed."
4172 "Please try upgrading the firmware.", VXGE_DRIVER_NAME); 4160 "Please try upgrading the firmware.", VXGE_DRIVER_NAME);
4173 ret = -EINVAL; 4161 ret = -EINVAL;
4174 goto _exit4; 4162 goto _exit3;
4175 } 4163 }
4176 4164
4177 if (ll_config.device_hw_info.fw_version.major != 4165 if (ll_config.device_hw_info.fw_version.major !=
@@ -4181,7 +4169,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4181 ll_config.device_hw_info.fw_version.major, 4169 ll_config.device_hw_info.fw_version.major,
4182 VXGE_DRIVER_VERSION_MAJOR); 4170 VXGE_DRIVER_VERSION_MAJOR);
4183 ret = -EINVAL; 4171 ret = -EINVAL;
4184 goto _exit4; 4172 goto _exit3;
4185 } 4173 }
4186 4174
4187 vpath_mask = ll_config.device_hw_info.vpath_mask; 4175 vpath_mask = ll_config.device_hw_info.vpath_mask;
@@ -4189,7 +4177,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4189 vxge_debug_ll_config(VXGE_TRACE, 4177 vxge_debug_ll_config(VXGE_TRACE,
4190 "%s: No vpaths available in device", VXGE_DRIVER_NAME); 4178 "%s: No vpaths available in device", VXGE_DRIVER_NAME);
4191 ret = -EINVAL; 4179 ret = -EINVAL;
4192 goto _exit4; 4180 goto _exit3;
4193 } 4181 }
4194 4182
4195 vxge_debug_ll_config(VXGE_TRACE, 4183 vxge_debug_ll_config(VXGE_TRACE,
@@ -4222,7 +4210,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4222 vxge_debug_ll_config(VXGE_ERR, 4210 vxge_debug_ll_config(VXGE_ERR,
4223 "%s: No more vpaths to configure", VXGE_DRIVER_NAME); 4211 "%s: No more vpaths to configure", VXGE_DRIVER_NAME);
4224 ret = 0; 4212 ret = 0;
4225 goto _exit4; 4213 goto _exit3;
4226 } 4214 }
4227 4215
4228 /* Setting driver callbacks */ 4216 /* Setting driver callbacks */
@@ -4235,7 +4223,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4235 vxge_debug_init(VXGE_ERR, 4223 vxge_debug_init(VXGE_ERR,
4236 "Failed to initialize device (%d)", status); 4224 "Failed to initialize device (%d)", status);
4237 ret = -EINVAL; 4225 ret = -EINVAL;
4238 goto _exit4; 4226 goto _exit3;
4239 } 4227 }
4240 4228
4241 vxge_hw_device_debug_set(hldev, VXGE_ERR, VXGE_COMPONENT_LL); 4229 vxge_hw_device_debug_set(hldev, VXGE_ERR, VXGE_COMPONENT_LL);
@@ -4260,7 +4248,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4260 if (vxge_device_register(hldev, &ll_config, high_dma, no_of_vpath, 4248 if (vxge_device_register(hldev, &ll_config, high_dma, no_of_vpath,
4261 &vdev)) { 4249 &vdev)) {
4262 ret = -EINVAL; 4250 ret = -EINVAL;
4263 goto _exit5; 4251 goto _exit4;
4264 } 4252 }
4265 4253
4266 vxge_hw_device_debug_set(hldev, VXGE_TRACE, VXGE_COMPONENT_LL); 4254 vxge_hw_device_debug_set(hldev, VXGE_TRACE, VXGE_COMPONENT_LL);
@@ -4271,7 +4259,6 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4271 hldev->ndev = vdev->ndev; 4259 hldev->ndev = vdev->ndev;
4272 vdev->mtu = VXGE_HW_DEFAULT_MTU; 4260 vdev->mtu = VXGE_HW_DEFAULT_MTU;
4273 vdev->bar0 = attr.bar0; 4261 vdev->bar0 = attr.bar0;
4274 vdev->bar1 = attr.bar1;
4275 vdev->max_vpath_supported = max_vpath_supported; 4262 vdev->max_vpath_supported = max_vpath_supported;
4276 vdev->no_of_vpath = no_of_vpath; 4263 vdev->no_of_vpath = no_of_vpath;
4277 4264
@@ -4353,7 +4340,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4353 "%s: mac_addr_list : memory allocation failed", 4340 "%s: mac_addr_list : memory allocation failed",
4354 vdev->ndev->name); 4341 vdev->ndev->name);
4355 ret = -EPERM; 4342 ret = -EPERM;
4356 goto _exit6; 4343 goto _exit5;
4357 } 4344 }
4358 macaddr = (u8 *)&entry->macaddr; 4345 macaddr = (u8 *)&entry->macaddr;
4359 memcpy(macaddr, vdev->ndev->dev_addr, ETH_ALEN); 4346 memcpy(macaddr, vdev->ndev->dev_addr, ETH_ALEN);
@@ -4370,16 +4357,14 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4370 4357
4371 return 0; 4358 return 0;
4372 4359
4373_exit6: 4360_exit5:
4374 for (i = 0; i < vdev->no_of_vpath; i++) 4361 for (i = 0; i < vdev->no_of_vpath; i++)
4375 vxge_free_mac_add_list(&vdev->vpaths[i]); 4362 vxge_free_mac_add_list(&vdev->vpaths[i]);
4376 4363
4377 vxge_device_unregister(hldev); 4364 vxge_device_unregister(hldev);
4378_exit5: 4365_exit4:
4379 pci_disable_sriov(pdev); 4366 pci_disable_sriov(pdev);
4380 vxge_hw_device_terminate(hldev); 4367 vxge_hw_device_terminate(hldev);
4381_exit4:
4382 iounmap(attr.bar1);
4383_exit3: 4368_exit3:
4384 iounmap(attr.bar0); 4369 iounmap(attr.bar0);
4385_exit2: 4370_exit2:
@@ -4438,7 +4423,6 @@ vxge_remove(struct pci_dev *pdev)
4438 kfree(vdev->vpaths); 4423 kfree(vdev->vpaths);
4439 4424
4440 iounmap(vdev->bar0); 4425 iounmap(vdev->bar0);
4441 iounmap(vdev->bar1);
4442 4426
4443 pci_disable_sriov(pdev); 4427 pci_disable_sriov(pdev);
4444 4428