diff options
-rw-r--r-- | drivers/net/3c59x.c | 81 |
1 files changed, 34 insertions, 47 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 51ac35966b2d..70f63891b19c 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -900,7 +900,6 @@ static void acpi_set_WOL(struct net_device *dev); | |||
900 | static struct ethtool_ops vortex_ethtool_ops; | 900 | static struct ethtool_ops vortex_ethtool_ops; |
901 | static void set_8021q_mode(struct net_device *dev, int enable); | 901 | static void set_8021q_mode(struct net_device *dev, int enable); |
902 | 902 | ||
903 | |||
904 | /* This driver uses 'options' to pass the media type, full-duplex flag, etc. */ | 903 | /* This driver uses 'options' to pass the media type, full-duplex flag, etc. */ |
905 | /* Option count limit only -- unlimited interfaces are supported. */ | 904 | /* Option count limit only -- unlimited interfaces are supported. */ |
906 | #define MAX_UNITS 8 | 905 | #define MAX_UNITS 8 |
@@ -915,8 +914,6 @@ static int global_full_duplex = -1; | |||
915 | static int global_enable_wol = -1; | 914 | static int global_enable_wol = -1; |
916 | static int global_use_mmio = -1; | 915 | static int global_use_mmio = -1; |
917 | 916 | ||
918 | /* #define dev_alloc_skb dev_alloc_skb_debug */ | ||
919 | |||
920 | /* Variables to work-around the Compaq PCI BIOS32 problem. */ | 917 | /* Variables to work-around the Compaq PCI BIOS32 problem. */ |
921 | static int compaq_ioaddr, compaq_irq, compaq_device_id = 0x5900; | 918 | static int compaq_ioaddr, compaq_irq, compaq_device_id = 0x5900; |
922 | static struct net_device *compaq_net_device; | 919 | static struct net_device *compaq_net_device; |
@@ -972,7 +969,7 @@ static void poll_vortex(struct net_device *dev) | |||
972 | 969 | ||
973 | #ifdef CONFIG_PM | 970 | #ifdef CONFIG_PM |
974 | 971 | ||
975 | static int vortex_suspend (struct pci_dev *pdev, pm_message_t state) | 972 | static int vortex_suspend(struct pci_dev *pdev, pm_message_t state) |
976 | { | 973 | { |
977 | struct net_device *dev = pci_get_drvdata(pdev); | 974 | struct net_device *dev = pci_get_drvdata(pdev); |
978 | 975 | ||
@@ -990,7 +987,7 @@ static int vortex_suspend (struct pci_dev *pdev, pm_message_t state) | |||
990 | return 0; | 987 | return 0; |
991 | } | 988 | } |
992 | 989 | ||
993 | static int vortex_resume (struct pci_dev *pdev) | 990 | static int vortex_resume(struct pci_dev *pdev) |
994 | { | 991 | { |
995 | struct net_device *dev = pci_get_drvdata(pdev); | 992 | struct net_device *dev = pci_get_drvdata(pdev); |
996 | struct vortex_private *vp = netdev_priv(dev); | 993 | struct vortex_private *vp = netdev_priv(dev); |
@@ -1023,8 +1020,8 @@ static struct eisa_device_id vortex_eisa_ids[] = { | |||
1023 | { "" } | 1020 | { "" } |
1024 | }; | 1021 | }; |
1025 | 1022 | ||
1026 | static int vortex_eisa_probe (struct device *device); | 1023 | static int vortex_eisa_probe(struct device *device); |
1027 | static int vortex_eisa_remove (struct device *device); | 1024 | static int vortex_eisa_remove(struct device *device); |
1028 | 1025 | ||
1029 | static struct eisa_driver vortex_eisa_driver = { | 1026 | static struct eisa_driver vortex_eisa_driver = { |
1030 | .id_table = vortex_eisa_ids, | 1027 | .id_table = vortex_eisa_ids, |
@@ -1035,12 +1032,12 @@ static struct eisa_driver vortex_eisa_driver = { | |||
1035 | } | 1032 | } |
1036 | }; | 1033 | }; |
1037 | 1034 | ||
1038 | static int vortex_eisa_probe (struct device *device) | 1035 | static int vortex_eisa_probe(struct device *device) |
1039 | { | 1036 | { |
1040 | void __iomem *ioaddr; | 1037 | void __iomem *ioaddr; |
1041 | struct eisa_device *edev; | 1038 | struct eisa_device *edev; |
1042 | 1039 | ||
1043 | edev = to_eisa_device (device); | 1040 | edev = to_eisa_device(device); |
1044 | 1041 | ||
1045 | if (!request_region(edev->base_addr, VORTEX_TOTAL_SIZE, DRV_NAME)) | 1042 | if (!request_region(edev->base_addr, VORTEX_TOTAL_SIZE, DRV_NAME)) |
1046 | return -EBUSY; | 1043 | return -EBUSY; |
@@ -1049,7 +1046,7 @@ static int vortex_eisa_probe (struct device *device) | |||
1049 | 1046 | ||
1050 | if (vortex_probe1(device, ioaddr, ioread16(ioaddr + 0xC88) >> 12, | 1047 | if (vortex_probe1(device, ioaddr, ioread16(ioaddr + 0xC88) >> 12, |
1051 | edev->id.driver_data, vortex_cards_found)) { | 1048 | edev->id.driver_data, vortex_cards_found)) { |
1052 | release_region (edev->base_addr, VORTEX_TOTAL_SIZE); | 1049 | release_region(edev->base_addr, VORTEX_TOTAL_SIZE); |
1053 | return -ENODEV; | 1050 | return -ENODEV; |
1054 | } | 1051 | } |
1055 | 1052 | ||
@@ -1058,15 +1055,15 @@ static int vortex_eisa_probe (struct device *device) | |||
1058 | return 0; | 1055 | return 0; |
1059 | } | 1056 | } |
1060 | 1057 | ||
1061 | static int vortex_eisa_remove (struct device *device) | 1058 | static int vortex_eisa_remove(struct device *device) |
1062 | { | 1059 | { |
1063 | struct eisa_device *edev; | 1060 | struct eisa_device *edev; |
1064 | struct net_device *dev; | 1061 | struct net_device *dev; |
1065 | struct vortex_private *vp; | 1062 | struct vortex_private *vp; |
1066 | void __iomem *ioaddr; | 1063 | void __iomem *ioaddr; |
1067 | 1064 | ||
1068 | edev = to_eisa_device (device); | 1065 | edev = to_eisa_device(device); |
1069 | dev = eisa_get_drvdata (edev); | 1066 | dev = eisa_get_drvdata(edev); |
1070 | 1067 | ||
1071 | if (!dev) { | 1068 | if (!dev) { |
1072 | printk("vortex_eisa_remove called for Compaq device!\n"); | 1069 | printk("vortex_eisa_remove called for Compaq device!\n"); |
@@ -1076,17 +1073,17 @@ static int vortex_eisa_remove (struct device *device) | |||
1076 | vp = netdev_priv(dev); | 1073 | vp = netdev_priv(dev); |
1077 | ioaddr = vp->ioaddr; | 1074 | ioaddr = vp->ioaddr; |
1078 | 1075 | ||
1079 | unregister_netdev (dev); | 1076 | unregister_netdev(dev); |
1080 | iowrite16 (TotalReset|0x14, ioaddr + EL3_CMD); | 1077 | iowrite16(TotalReset|0x14, ioaddr + EL3_CMD); |
1081 | release_region (dev->base_addr, VORTEX_TOTAL_SIZE); | 1078 | release_region(dev->base_addr, VORTEX_TOTAL_SIZE); |
1082 | 1079 | ||
1083 | free_netdev (dev); | 1080 | free_netdev(dev); |
1084 | return 0; | 1081 | return 0; |
1085 | } | 1082 | } |
1086 | #endif | 1083 | #endif |
1087 | 1084 | ||
1088 | /* returns count found (>= 0), or negative on error */ | 1085 | /* returns count found (>= 0), or negative on error */ |
1089 | static int __init vortex_eisa_init (void) | 1086 | static int __init vortex_eisa_init(void) |
1090 | { | 1087 | { |
1091 | int eisa_found = 0; | 1088 | int eisa_found = 0; |
1092 | int orig_cards_found = vortex_cards_found; | 1089 | int orig_cards_found = vortex_cards_found; |
@@ -1117,7 +1114,7 @@ static int __init vortex_eisa_init (void) | |||
1117 | } | 1114 | } |
1118 | 1115 | ||
1119 | /* returns count (>= 0), or negative on error */ | 1116 | /* returns count (>= 0), or negative on error */ |
1120 | static int __devinit vortex_init_one (struct pci_dev *pdev, | 1117 | static int __devinit vortex_init_one(struct pci_dev *pdev, |
1121 | const struct pci_device_id *ent) | 1118 | const struct pci_device_id *ent) |
1122 | { | 1119 | { |
1123 | int rc, unit, pci_bar; | 1120 | int rc, unit, pci_bar; |
@@ -1125,7 +1122,7 @@ static int __devinit vortex_init_one (struct pci_dev *pdev, | |||
1125 | void __iomem *ioaddr; | 1122 | void __iomem *ioaddr; |
1126 | 1123 | ||
1127 | /* wake up and enable device */ | 1124 | /* wake up and enable device */ |
1128 | rc = pci_enable_device (pdev); | 1125 | rc = pci_enable_device(pdev); |
1129 | if (rc < 0) | 1126 | if (rc < 0) |
1130 | goto out; | 1127 | goto out; |
1131 | 1128 | ||
@@ -1147,7 +1144,7 @@ static int __devinit vortex_init_one (struct pci_dev *pdev, | |||
1147 | rc = vortex_probe1(&pdev->dev, ioaddr, pdev->irq, | 1144 | rc = vortex_probe1(&pdev->dev, ioaddr, pdev->irq, |
1148 | ent->driver_data, unit); | 1145 | ent->driver_data, unit); |
1149 | if (rc < 0) { | 1146 | if (rc < 0) { |
1150 | pci_disable_device (pdev); | 1147 | pci_disable_device(pdev); |
1151 | goto out; | 1148 | goto out; |
1152 | } | 1149 | } |
1153 | 1150 | ||
@@ -1262,7 +1259,7 @@ static int __devinit vortex_probe1(struct device *gendev, | |||
1262 | 1259 | ||
1263 | /* enable bus-mastering if necessary */ | 1260 | /* enable bus-mastering if necessary */ |
1264 | if (vci->flags & PCI_USES_MASTER) | 1261 | if (vci->flags & PCI_USES_MASTER) |
1265 | pci_set_master (pdev); | 1262 | pci_set_master(pdev); |
1266 | 1263 | ||
1267 | if (vci->drv_flags & IS_VORTEX) { | 1264 | if (vci->drv_flags & IS_VORTEX) { |
1268 | u8 pci_latency; | 1265 | u8 pci_latency; |
@@ -1306,7 +1303,7 @@ static int __devinit vortex_probe1(struct device *gendev, | |||
1306 | if (pdev) | 1303 | if (pdev) |
1307 | pci_set_drvdata(pdev, dev); | 1304 | pci_set_drvdata(pdev, dev); |
1308 | if (edev) | 1305 | if (edev) |
1309 | eisa_set_drvdata (edev, dev); | 1306 | eisa_set_drvdata(edev, dev); |
1310 | 1307 | ||
1311 | vp->media_override = 7; | 1308 | vp->media_override = 7; |
1312 | if (option >= 0) { | 1309 | if (option >= 0) { |
@@ -1808,7 +1805,6 @@ vortex_up(struct net_device *dev) | |||
1808 | set_8021q_mode(dev, 1); | 1805 | set_8021q_mode(dev, 1); |
1809 | iowrite16(StatsEnable, ioaddr + EL3_CMD); /* Turn on statistics. */ | 1806 | iowrite16(StatsEnable, ioaddr + EL3_CMD); /* Turn on statistics. */ |
1810 | 1807 | ||
1811 | // issue_and_wait(dev, SetTxStart|0x07ff); | ||
1812 | iowrite16(RxEnable, ioaddr + EL3_CMD); /* Enable the receiver. */ | 1808 | iowrite16(RxEnable, ioaddr + EL3_CMD); /* Enable the receiver. */ |
1813 | iowrite16(TxEnable, ioaddr + EL3_CMD); /* Enable transmitter. */ | 1809 | iowrite16(TxEnable, ioaddr + EL3_CMD); /* Enable transmitter. */ |
1814 | /* Allow status bits to be seen. */ | 1810 | /* Allow status bits to be seen. */ |
@@ -1944,7 +1940,7 @@ vortex_timer(unsigned long data) | |||
1944 | if (vp->medialock) | 1940 | if (vp->medialock) |
1945 | goto leave_media_alone; | 1941 | goto leave_media_alone; |
1946 | 1942 | ||
1947 | if ( ! ok) { | 1943 | if (!ok) { |
1948 | unsigned int config; | 1944 | unsigned int config; |
1949 | 1945 | ||
1950 | do { | 1946 | do { |
@@ -2179,7 +2175,7 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2179 | if (vp->bus_master) { | 2175 | if (vp->bus_master) { |
2180 | /* Set the bus-master controller to transfer the packet. */ | 2176 | /* Set the bus-master controller to transfer the packet. */ |
2181 | int len = (skb->len + 3) & ~3; | 2177 | int len = (skb->len + 3) & ~3; |
2182 | iowrite32( vp->tx_skb_dma = pci_map_single(VORTEX_PCI(vp), skb->data, len, PCI_DMA_TODEVICE), | 2178 | iowrite32(vp->tx_skb_dma = pci_map_single(VORTEX_PCI(vp), skb->data, len, PCI_DMA_TODEVICE), |
2183 | ioaddr + Wn7_MasterAddr); | 2179 | ioaddr + Wn7_MasterAddr); |
2184 | iowrite16(len, ioaddr + Wn7_MasterLen); | 2180 | iowrite16(len, ioaddr + Wn7_MasterLen); |
2185 | vp->tx_skb = skb; | 2181 | vp->tx_skb = skb; |
@@ -3058,7 +3054,7 @@ static struct ethtool_ops vortex_ethtool_ops = { | |||
3058 | .set_settings = vortex_set_settings, | 3054 | .set_settings = vortex_set_settings, |
3059 | .get_link = ethtool_op_get_link, | 3055 | .get_link = ethtool_op_get_link, |
3060 | .nway_reset = vortex_nway_reset, | 3056 | .nway_reset = vortex_nway_reset, |
3061 | .get_perm_addr = ethtool_op_get_perm_addr, | 3057 | .get_perm_addr = ethtool_op_get_perm_addr, |
3062 | }; | 3058 | }; |
3063 | 3059 | ||
3064 | #ifdef CONFIG_PCI | 3060 | #ifdef CONFIG_PCI |
@@ -3259,7 +3255,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val | |||
3259 | } | 3255 | } |
3260 | return; | 3256 | return; |
3261 | } | 3257 | } |
3262 | 3258 | ||
3263 | /* ACPI: Advanced Configuration and Power Interface. */ | 3259 | /* ACPI: Advanced Configuration and Power Interface. */ |
3264 | /* Set Wake-On-LAN mode and put the board into D3 (power-down) state. */ | 3260 | /* Set Wake-On-LAN mode and put the board into D3 (power-down) state. */ |
3265 | static void acpi_set_WOL(struct net_device *dev) | 3261 | static void acpi_set_WOL(struct net_device *dev) |
@@ -3283,7 +3279,7 @@ static void acpi_set_WOL(struct net_device *dev) | |||
3283 | } | 3279 | } |
3284 | 3280 | ||
3285 | 3281 | ||
3286 | static void __devexit vortex_remove_one (struct pci_dev *pdev) | 3282 | static void __devexit vortex_remove_one(struct pci_dev *pdev) |
3287 | { | 3283 | { |
3288 | struct net_device *dev = pci_get_drvdata(pdev); | 3284 | struct net_device *dev = pci_get_drvdata(pdev); |
3289 | struct vortex_private *vp; | 3285 | struct vortex_private *vp; |
@@ -3339,7 +3335,7 @@ static int vortex_have_pci; | |||
3339 | static int vortex_have_eisa; | 3335 | static int vortex_have_eisa; |
3340 | 3336 | ||
3341 | 3337 | ||
3342 | static int __init vortex_init (void) | 3338 | static int __init vortex_init(void) |
3343 | { | 3339 | { |
3344 | int pci_rc, eisa_rc; | 3340 | int pci_rc, eisa_rc; |
3345 | 3341 | ||
@@ -3355,14 +3351,14 @@ static int __init vortex_init (void) | |||
3355 | } | 3351 | } |
3356 | 3352 | ||
3357 | 3353 | ||
3358 | static void __exit vortex_eisa_cleanup (void) | 3354 | static void __exit vortex_eisa_cleanup(void) |
3359 | { | 3355 | { |
3360 | struct vortex_private *vp; | 3356 | struct vortex_private *vp; |
3361 | void __iomem *ioaddr; | 3357 | void __iomem *ioaddr; |
3362 | 3358 | ||
3363 | #ifdef CONFIG_EISA | 3359 | #ifdef CONFIG_EISA |
3364 | /* Take care of the EISA devices */ | 3360 | /* Take care of the EISA devices */ |
3365 | eisa_driver_unregister (&vortex_eisa_driver); | 3361 | eisa_driver_unregister(&vortex_eisa_driver); |
3366 | #endif | 3362 | #endif |
3367 | 3363 | ||
3368 | if (compaq_net_device) { | 3364 | if (compaq_net_device) { |
@@ -3370,33 +3366,24 @@ static void __exit vortex_eisa_cleanup (void) | |||
3370 | ioaddr = ioport_map(compaq_net_device->base_addr, | 3366 | ioaddr = ioport_map(compaq_net_device->base_addr, |
3371 | VORTEX_TOTAL_SIZE); | 3367 | VORTEX_TOTAL_SIZE); |
3372 | 3368 | ||
3373 | unregister_netdev (compaq_net_device); | 3369 | unregister_netdev(compaq_net_device); |
3374 | iowrite16 (TotalReset, ioaddr + EL3_CMD); | 3370 | iowrite16(TotalReset, ioaddr + EL3_CMD); |
3375 | release_region(compaq_net_device->base_addr, | 3371 | release_region(compaq_net_device->base_addr, |
3376 | VORTEX_TOTAL_SIZE); | 3372 | VORTEX_TOTAL_SIZE); |
3377 | 3373 | ||
3378 | free_netdev (compaq_net_device); | 3374 | free_netdev(compaq_net_device); |
3379 | } | 3375 | } |
3380 | } | 3376 | } |
3381 | 3377 | ||
3382 | 3378 | ||
3383 | static void __exit vortex_cleanup (void) | 3379 | static void __exit vortex_cleanup(void) |
3384 | { | 3380 | { |
3385 | if (vortex_have_pci) | 3381 | if (vortex_have_pci) |
3386 | pci_unregister_driver (&vortex_driver); | 3382 | pci_unregister_driver(&vortex_driver); |
3387 | if (vortex_have_eisa) | 3383 | if (vortex_have_eisa) |
3388 | vortex_eisa_cleanup (); | 3384 | vortex_eisa_cleanup(); |
3389 | } | 3385 | } |
3390 | 3386 | ||
3391 | 3387 | ||
3392 | module_init(vortex_init); | 3388 | module_init(vortex_init); |
3393 | module_exit(vortex_cleanup); | 3389 | module_exit(vortex_cleanup); |
3394 | |||
3395 | |||
3396 | /* | ||
3397 | * Local variables: | ||
3398 | * c-indent-level: 4 | ||
3399 | * c-basic-offset: 4 | ||
3400 | * tab-width: 4 | ||
3401 | * End: | ||
3402 | */ | ||