diff options
-rw-r--r-- | drivers/net/via-velocity.c | 20 | ||||
-rw-r--r-- | drivers/net/via-velocity.h | 4 |
2 files changed, 13 insertions, 11 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; | |||
229 | module_param(rx_copybreak, int, 0644); | 229 | module_param(rx_copybreak, int, 0644); |
230 | MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames"); | 230 | MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames"); |
231 | 231 | ||
232 | static void velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr, struct velocity_info_tbl *info); | 232 | static void velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr, |
233 | const struct velocity_info_tbl *info); | ||
233 | static int velocity_get_pci_info(struct velocity_info *, struct pci_dev *pdev); | 234 | static int velocity_get_pci_info(struct velocity_info *, struct pci_dev *pdev); |
234 | static void velocity_print_info(struct velocity_info *vptr); | 235 | static void velocity_print_info(struct velocity_info *vptr); |
235 | static int velocity_open(struct net_device *dev); | 236 | static 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 | ||
297 | static struct velocity_info_tbl chip_info_table[] = { | 298 | static 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 | ||
863 | static void __devinit velocity_init_info(struct pci_dev *pdev, struct velocity_info *vptr, struct velocity_info_tbl *info) | 864 | static 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 | } |
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h index f1b2640ebdc6..496c3d597444 100644 --- a/drivers/net/via-velocity.h +++ b/drivers/net/via-velocity.h | |||
@@ -31,6 +31,8 @@ | |||
31 | #define VELOCITY_FULL_DRV_NAM "VIA Networking Velocity Family Gigabit Ethernet Adapter Driver" | 31 | #define VELOCITY_FULL_DRV_NAM "VIA Networking Velocity Family Gigabit Ethernet Adapter Driver" |
32 | #define VELOCITY_VERSION "1.13" | 32 | #define VELOCITY_VERSION "1.13" |
33 | 33 | ||
34 | #define VELOCITY_IO_SIZE 256 | ||
35 | |||
34 | #define PKT_BUF_SZ 1540 | 36 | #define PKT_BUF_SZ 1540 |
35 | 37 | ||
36 | #define MAX_UNITS 8 | 38 | #define MAX_UNITS 8 |
@@ -1191,7 +1193,6 @@ enum chip_type { | |||
1191 | struct velocity_info_tbl { | 1193 | struct velocity_info_tbl { |
1192 | enum chip_type chip_id; | 1194 | enum chip_type chip_id; |
1193 | char *name; | 1195 | char *name; |
1194 | int io_size; | ||
1195 | int txqueue; | 1196 | int txqueue; |
1196 | u32 flags; | 1197 | u32 flags; |
1197 | }; | 1198 | }; |
@@ -1751,7 +1752,6 @@ struct velocity_info { | |||
1751 | struct mac_regs __iomem * mac_regs; | 1752 | struct mac_regs __iomem * mac_regs; |
1752 | unsigned long memaddr; | 1753 | unsigned long memaddr; |
1753 | unsigned long ioaddr; | 1754 | unsigned long ioaddr; |
1754 | u32 io_size; | ||
1755 | 1755 | ||
1756 | u8 rev_id; | 1756 | u8 rev_id; |
1757 | 1757 | ||