aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSreenivasa Honnur <Sreenivasa.Honnur@neterion.com>2009-07-01 17:12:23 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-05 22:16:24 -0400
commit7975d1eed732c9d50b41f5847453e324f544bd30 (patch)
tree06a95f3c16a50c90e62170630ab3f4ab333ab14c
parente04af024b2e74249990587e76ec98220028c01c3 (diff)
vxge: Removed ioremap of unused bar addresses and their references
- Removed ioremap of bar1 address Driver needs only bar0 address for register access - Removed references to bar1 and bar2 addresses Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com> Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/vxge/vxge-config.c10
-rw-r--r--drivers/net/vxge/vxge-config.h10
-rw-r--r--drivers/net/vxge/vxge-main.c34
-rw-r--r--drivers/net/vxge/vxge-main.h1
4 files changed, 10 insertions, 45 deletions
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c
index 58d2551c78ed..9e94c4b0fb18 100644
--- a/drivers/net/vxge/vxge-config.c
+++ b/drivers/net/vxge/vxge-config.c
@@ -313,14 +313,6 @@ __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev)
313 hldev->kdfc = (u8 __iomem *)(hldev->bar0 + 313 hldev->kdfc = (u8 __iomem *)(hldev->bar0 +
314 VXGE_HW_TOC_GET_KDFC_INITIAL_OFFSET(val64)); 314 VXGE_HW_TOC_GET_KDFC_INITIAL_OFFSET(val64));
315 break; 315 break;
316 case 2:
317 hldev->kdfc = (u8 __iomem *)(hldev->bar1 +
318 VXGE_HW_TOC_GET_KDFC_INITIAL_OFFSET(val64));
319 break;
320 case 4:
321 hldev->kdfc = (u8 __iomem *)(hldev->bar2 +
322 VXGE_HW_TOC_GET_KDFC_INITIAL_OFFSET(val64));
323 break;
324 default: 316 default:
325 break; 317 break;
326 } 318 }
@@ -831,8 +823,6 @@ vxge_hw_device_initialize(
831 sizeof(struct vxge_hw_device_config)); 823 sizeof(struct vxge_hw_device_config));
832 824
833 hldev->bar0 = attr->bar0; 825 hldev->bar0 = attr->bar0;
834 hldev->bar1 = attr->bar1;
835 hldev->bar2 = attr->bar2;
836 hldev->pdev = attr->pdev; 826 hldev->pdev = attr->pdev;
837 827
838 hldev->uld_callbacks.link_up = attr->uld_callbacks.link_up; 828 hldev->uld_callbacks.link_up = attr->uld_callbacks.link_up;
diff --git a/drivers/net/vxge/vxge-config.h b/drivers/net/vxge/vxge-config.h
index afbdf6f4d224..224acea771ed 100644
--- a/drivers/net/vxge/vxge-config.h
+++ b/drivers/net/vxge/vxge-config.h
@@ -682,8 +682,6 @@ struct __vxge_hw_vpath_handle{
682 * @major_revision: PCI Device major revision 682 * @major_revision: PCI Device major revision
683 * @minor_revision: PCI Device minor revision 683 * @minor_revision: PCI Device minor revision
684 * @bar0: BAR0 virtual address. 684 * @bar0: BAR0 virtual address.
685 * @bar1: BAR1 virtual address.
686 * @bar2: BAR2 virtual address.
687 * @pdev: Physical device handle 685 * @pdev: Physical device handle
688 * @config: Confguration passed by the LL driver at initialization 686 * @config: Confguration passed by the LL driver at initialization
689 * @link_state: Link state 687 * @link_state: Link state
@@ -698,8 +696,6 @@ struct __vxge_hw_device {
698 u8 major_revision; 696 u8 major_revision;
699 u8 minor_revision; 697 u8 minor_revision;
700 void __iomem *bar0; 698 void __iomem *bar0;
701 void __iomem *bar1;
702 void __iomem *bar2;
703 struct pci_dev *pdev; 699 struct pci_dev *pdev;
704 struct net_device *ndev; 700 struct net_device *ndev;
705 struct vxge_hw_device_config config; 701 struct vxge_hw_device_config config;
@@ -788,17 +784,13 @@ struct vxge_hw_device_hw_info {
788/** 784/**
789 * struct vxge_hw_device_attr - Device memory spaces. 785 * struct vxge_hw_device_attr - Device memory spaces.
790 * @bar0: BAR0 virtual address. 786 * @bar0: BAR0 virtual address.
791 * @bar1: BAR1 virtual address.
792 * @bar2: BAR2 virtual address.
793 * @pdev: PCI device object. 787 * @pdev: PCI device object.
794 * 788 *
795 * Device memory spaces. Includes configuration, BAR0, BAR1, etc. per device 789 * Device memory spaces. Includes configuration, BAR0 etc. per device
796 * mapped memories. Also, includes a pointer to OS-specific PCI device object. 790 * mapped memories. Also, includes a pointer to OS-specific PCI device object.
797 */ 791 */
798struct vxge_hw_device_attr { 792struct vxge_hw_device_attr {
799 void __iomem *bar0; 793 void __iomem *bar0;
800 void __iomem *bar1;
801 void __iomem *bar2;
802 struct pci_dev *pdev; 794 struct pci_dev *pdev;
803 struct vxge_hw_uld_cbs uld_callbacks; 795 struct vxge_hw_uld_cbs uld_callbacks;
804}; 796};
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
diff --git a/drivers/net/vxge/vxge-main.h b/drivers/net/vxge/vxge-main.h
index 9704b2bd4320..3386970b7efc 100644
--- a/drivers/net/vxge/vxge-main.h
+++ b/drivers/net/vxge/vxge-main.h
@@ -363,7 +363,6 @@ struct vxgedev {
363 363
364 struct __vxge_hw_vpath_handle *vp_handles[VXGE_HW_MAX_VIRTUAL_PATHS]; 364 struct __vxge_hw_vpath_handle *vp_handles[VXGE_HW_MAX_VIRTUAL_PATHS];
365 void __iomem *bar0; 365 void __iomem *bar0;
366 void __iomem *bar1;
367 struct vxge_sw_stats stats; 366 struct vxge_sw_stats stats;
368 int mtu; 367 int mtu;
369 /* Below variables are used for vpath selection to transmit a packet */ 368 /* Below variables are used for vpath selection to transmit a packet */