aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/via-velocity.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/via-velocity.c')
-rw-r--r--drivers/net/via-velocity.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 019dcf2457b4..7e3b2a318146 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -229,7 +229,8 @@ static int rx_copybreak = 200;
229module_param(rx_copybreak, int, 0644); 229module_param(rx_copybreak, int, 0644);
230MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames"); 230MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
231 231
232static void velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr, struct velocity_info_tbl *info); 232static void velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr,
233 const struct velocity_info_tbl *info);
233static int velocity_get_pci_info(struct velocity_info *, struct pci_dev *pdev); 234static int velocity_get_pci_info(struct velocity_info *, struct pci_dev *pdev);
234static void velocity_print_info(struct velocity_info *vptr); 235static void velocity_print_info(struct velocity_info *vptr);
235static int velocity_open(struct net_device *dev); 236static int velocity_open(struct net_device *dev);
@@ -294,9 +295,9 @@ static void velocity_unregister_notifier(void)
294 * Internal board variants. At the moment we have only one 295 * Internal board variants. At the moment we have only one
295 */ 296 */
296 297
297static struct velocity_info_tbl chip_info_table[] = { 298static const struct velocity_info_tbl chip_info_table[] __devinitdata = {
298 {CHIP_TYPE_VT6110, "VIA Networking Velocity Family Gigabit Ethernet Adapter", 256, 1, 0x00FFFFFFUL}, 299 {CHIP_TYPE_VT6110, "VIA Networking Velocity Family Gigabit Ethernet Adapter", 1, 0x00FFFFFFUL},
299 {0, NULL} 300 { }
300}; 301};
301 302
302/* 303/*
@@ -685,7 +686,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
685 static int first = 1; 686 static int first = 1;
686 struct net_device *dev; 687 struct net_device *dev;
687 int i; 688 int i;
688 struct velocity_info_tbl *info = &chip_info_table[ent->driver_data]; 689 const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data];
689 struct velocity_info *vptr; 690 struct velocity_info *vptr;
690 struct mac_regs __iomem * regs; 691 struct mac_regs __iomem * regs;
691 int ret = -ENOMEM; 692 int ret = -ENOMEM;
@@ -742,7 +743,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
742 goto err_disable; 743 goto err_disable;
743 } 744 }
744 745
745 regs = ioremap(vptr->memaddr, vptr->io_size); 746 regs = ioremap(vptr->memaddr, VELOCITY_IO_SIZE);
746 if (regs == NULL) { 747 if (regs == NULL) {
747 ret = -EIO; 748 ret = -EIO;
748 goto err_release_res; 749 goto err_release_res;
@@ -860,13 +861,14 @@ static void __devinit velocity_print_info(struct velocity_info *vptr)
860 * discovered. 861 * discovered.
861 */ 862 */
862 863
863static void __devinit velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr, struct velocity_info_tbl *info) 864static void __devinit velocity_init_info(struct pci_dev *pdev,
865 struct velocity_info *vptr,
866 const struct velocity_info_tbl *info)
864{ 867{
865 memset(vptr, 0, sizeof(struct velocity_info)); 868 memset(vptr, 0, sizeof(struct velocity_info));
866 869
867 vptr->pdev = pdev; 870 vptr->pdev = pdev;
868 vptr->chip_id = info->chip_id; 871 vptr->chip_id = info->chip_id;
869 vptr->io_size = info->io_size;
870 vptr->num_txq = info->txqueue; 872 vptr->num_txq = info->txqueue;
871 vptr->multicast_limit = MCAM_SIZE; 873 vptr->multicast_limit = MCAM_SIZE;
872 spin_lock_init(&vptr->lock); 874 spin_lock_init(&vptr->lock);
@@ -904,7 +906,7 @@ static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pc
904 return -EINVAL; 906 return -EINVAL;
905 } 907 }
906 908
907 if (pci_resource_len(pdev, 1) < 256) { 909 if (pci_resource_len(pdev, 1) < VELOCITY_IO_SIZE) {
908 dev_printk(KERN_ERR, &pdev->dev, "region #1 is too small.\n"); 910 dev_printk(KERN_ERR, &pdev->dev, "region #1 is too small.\n");
909 return -EINVAL; 911 return -EINVAL;
910 } 912 }