bk://gkernel.bkbits.net/netdev-2.6 jgarzik@pobox.com|ChangeSet|20041026211646|42164 jgarzik # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/10/26 18:33:26-07:00 akpm@bix.(none) # Merge bk://gkernel.bkbits.net/netdev-2.6 # into bix.(none):/usr/src/bk-netdev # # net/irda/irlan/irlan_client.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_mgt.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_hotplug.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_dev.h # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_dev.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/isl_38xx.h # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/isl_38xx.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/netwave_cs.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wan/lmc/lmc_main.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tulip/xircom_cb.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tulip/tulip_core.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tulip/de4x5.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tulip/de2104x.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tokenring/olympic.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tokenring/lanstreamer.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/ixgb/ixgb_main.c # 2004/10/26 18:33:22-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/via-rhine.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tg3.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/smc91x.h # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -43 # Auto merged # # drivers/net/slip.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/sk_mca.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/sis900.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/pcnet32.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/ns83820.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/mac8390.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/ibmlana.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/hamradio/hdlcdrv.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/forcedeth.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/e1000/e1000_main.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/e1000/e1000.h # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/e100.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/depca.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/defxx.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/b44.h # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/b44.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/acenic.c # 2004/10/26 18:33:21-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/Kconfig # 2004/10/26 18:33:20-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/8139too.c # 2004/10/26 18:33:20-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/8139cp.c # 2004/10/26 18:33:20-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/3c59x.c # 2004/10/26 18:33:20-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/media/dvb/dvb-core/dvb_net.c # 2004/10/26 18:33:20-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/10/26 18:32:04-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-netdev # # net/irda/irlan/irlan_client.c # 2004/10/26 18:32:01-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tulip/xircom_cb.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tulip/tulip_core.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tulip/de4x5.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tulip/de2104x.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tokenring/olympic.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/smc91x.h # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +43 -0 # Auto merged # # drivers/net/slip.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/sis900.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/pcnet32.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/ns83820.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/mac8390.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/ixgb/ixgb_main.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/hamradio/hdlcdrv.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/e1000/e1000_main.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/e1000/e1000.h # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/Kconfig # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/3c59x.c # 2004/10/26 18:32:00-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/10/26 17:15:25-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/8139too # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/8139too.c # 2004/10/26 17:15:20-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/26 17:14:34-04:00 akpm@osdl.org # [PATCH] ray_cs export cleanup # # From: Arjan van de Ven # # The ray_cs driver author seemed to have assumed that he needs to exports # functions he registers with the core kernel via function pointers, that of # course isn't the case so the cleanup below removes this; these functions # aren't used anywhere else nor meant to be (they're even static). # # Signed-off-by: Andrew Morton # Signed-off-by: Jeff Garzik # # drivers/net/wireless/ray_cs.c # 2004/10/24 05:01:51-04:00 akpm@osdl.org +0 -4 # ray_cs export cleanup # # ChangeSet # 2004/10/26 17:10:11-04:00 akpm@osdl.org # [PATCH] rtl8139too.c: Fix missing pci_disable_dev # # From: Thomas Gleixner # # Simple fix to make pci_enable/disable symetric and avoid the warning on # module unload. # # Signed-off-by: Thomas Gleixner # Signed-off-by: Andrew Morton # Signed-off-by: Jeff Garzik # # drivers/net/8139too.c # 2004/10/24 06:32:54-04:00 akpm@osdl.org +1 -1 # rtl8139too.c: Fix missing pci_disable_dev # # ChangeSet # 2004/10/26 17:00:44-04:00 jgarzik@pobox.com # Hand-merge upstream pci_{save,restore}_state() stuff. # # drivers/net/8139too.c # 2004/10/26 17:00:39-04:00 jgarzik@pobox.com +0 -1 # Hand-merge upstream pci_{save,restore}_state() stuff. # # ChangeSet # 2004/10/26 13:04:59-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/tg3 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/tulip/tulip_core.c # 2004/10/26 13:04:56-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/slip.c # 2004/10/26 13:04:56-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/sis900.c # 2004/10/26 13:04:56-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ns83820.c # 2004/10/26 13:04:56-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/e1000/e1000_main.c # 2004/10/26 13:04:56-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/e1000/e1000.h # 2004/10/26 13:04:56-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/8139too.c # 2004/10/26 13:04:56-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/3c59x.c # 2004/10/26 13:04:56-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/25 22:11:52-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/r8169 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/Kconfig # 2004/10/25 22:11:49-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/25 22:10:39-04:00 akpm@osdl.org # [PATCH] r8169 module_param build fix # # Signed-off-by: Andrew Morton # Signed-off-by: Jeff Garzik # # drivers/net/r8169.c # 2004/10/24 05:47:51-04:00 akpm@osdl.org +1 -1 # r8169-module_param-fix # # ChangeSet # 2004/10/25 19:08:02-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-netdev # # drivers/net/8139too.c # 2004/10/25 19:07:58-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/10/25 21:22:35-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/linux-2.6 # into pobox.com:/garz/repo/netdev-2.6/r8169 # # drivers/net/Kconfig # 2004/10/25 21:22:31-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/25 21:11:47-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/tg3 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/tg3.c # 2004/10/25 21:11:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/25 21:10:46-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/misc # into pobox.com:/garz/repo/netdev-2.6/ALL # # net/irda/irlan/irlan_client.c # 2004/10/25 21:10:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tulip/xircom_cb.c # 2004/10/25 21:10:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tulip/de4x5.c # 2004/10/25 21:10:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tulip/de2104x.c # 2004/10/25 21:10:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tokenring/olympic.c # 2004/10/25 21:10:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ixgb/ixgb_main.c # 2004/10/25 21:10:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/hamradio/hdlcdrv.c # 2004/10/25 21:10:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/smc91x.h # 2004/10/25 21:10:43-04:00 jgarzik@pobox.com +43 -0 # Auto merged # # drivers/net/pcnet32.c # 2004/10/25 21:10:43-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ns83820.c # 2004/10/25 21:10:43-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/mac8390.c # 2004/10/25 21:10:43-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/e1000/e1000_main.c # 2004/10/25 21:10:43-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/Kconfig # 2004/10/25 21:10:43-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/25 17:29:04-04:00 jgarzik@pobox.com # Merge # # drivers/net/tg3.c # 2004/10/25 17:29:03-04:00 jgarzik@pobox.com +0 -0 # SCCS merged # # ChangeSet # 2004/10/25 13:36:48-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-netdev # # drivers/net/wireless/netwave_cs.c # 2004/10/25 13:36:42-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wan/lmc/lmc_main.c # 2004/10/25 13:36:42-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/sk_mca.c # 2004/10/25 13:36:42-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/ibmlana.c # 2004/10/25 13:36:42-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/e100.c # 2004/10/25 13:36:42-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/defxx.c # 2004/10/25 13:36:42-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/acenic.c # 2004/10/25 13:36:42-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/media/dvb/dvb-core/dvb_net.c # 2004/10/25 13:36:42-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_mgt.c # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_hotplug.c # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_dev.h # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_dev.c # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/isl_38xx.h # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/isl_38xx.c # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/netwave_cs.c # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wan/lmc/lmc_main.c # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/via-rhine.c # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tokenring/lanstreamer.c # 2004/10/25 12:23:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/sk_mca.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/sis900.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ibmlana.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/forcedeth.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/e100.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/depca.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/defxx.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/b44.h # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/b44.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/acenic.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/8139cp.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/media/dvb/dvb-core/dvb_net.c # 2004/10/25 12:23:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/25 03:49:28-04:00 jgarzik@pobox.com # Merge # # drivers/net/tg3.c # 2004/10/25 03:49:24-04:00 jgarzik@pobox.com +0 -0 # SCCS merged # # ChangeSet # 2004/10/24 23:01:07-07:00 akpm@bix.(none) # wer # # drivers/net/tg3.c # 2004/10/24 23:01:00-07:00 akpm@bix.(none) +2 -0 # dsf # # drivers/net/wireless/prism54/islpci_mgt.c # 2004/10/24 22:59:37-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_hotplug.c # 2004/10/24 22:59:37-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_dev.h # 2004/10/24 22:59:37-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_dev.c # 2004/10/24 22:59:37-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/isl_38xx.h # 2004/10/24 22:59:37-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/wireless/prism54/isl_38xx.c # 2004/10/24 22:59:37-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/via-rhine.c # 2004/10/24 22:59:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/tokenring/lanstreamer.c # 2004/10/24 22:59:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/sis900.c # 2004/10/24 22:59:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/forcedeth.c # 2004/10/24 22:59:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/depca.c # 2004/10/24 22:59:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/b44.h # 2004/10/24 22:59:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/b44.c # 2004/10/24 22:59:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/net/8139cp.c # 2004/10/24 22:59:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/10/21 22:16:28-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/viro-eth1 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/wireless/netwave_cs.c # 2004/10/21 22:16:26-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/arlan.h # 2004/10/21 22:16:25-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tokenring/olympic.c # 2004/10/21 22:16:25-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tokenring/lanstreamer.c # 2004/10/21 22:16:25-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/starfire.c # 2004/10/21 22:16:25-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/21 22:15:24-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/via-rhine # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/via-rhine.c # 2004/10/21 22:15:21-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/21 22:13:27-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/ibmtr # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/slip.c # 2004/10/21 22:13:24-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/21 18:41:34-04:00 viro@www.linux.org.uk # [PATCH] mace iomem annotations - trivial part # # Signed-off-by: Al Viro # # drivers/net/mace.c # 2004/10/21 10:48:48-04:00 viro@www.linux.org.uk +32 -34 # (17/18) mace iomem annotations - trivial part # # ChangeSet # 2004/10/21 18:40:03-04:00 viro@www.linux.org.uk # [PATCH] airo iomem annotations # # Signed-off-by: Al Viro # # drivers/net/wireless/airo.c # 2004/10/21 10:48:47-04:00 viro@www.linux.org.uk +21 -21 # (14/18) airo iomem annotations # # ChangeSet # 2004/10/21 18:39:52-04:00 viro@www.linux.org.uk # [PATCH] wavelan_cs iomem annotations # # Signed-off-by: Al Viro # # drivers/net/wireless/wavelan_cs.p.h # 2004/10/21 10:48:47-04:00 viro@www.linux.org.uk +1 -0 # (13/18) wavelan_cs iomem annotations # # drivers/net/wireless/wavelan_cs.c # 2004/10/21 10:48:47-04:00 viro@www.linux.org.uk +14 -11 # (13/18) wavelan_cs iomem annotations # # ChangeSet # 2004/10/21 18:36:57-04:00 viro@www.linux.org.uk # [PATCH] lne390 iomem annotations and fixes # # annotated, killed isa_... uses by making ioremap() unconditional, fixed # the use of isa_... on already remapped address. # # Signed-off-by: Al Viro # # drivers/net/lne390.c # 2004/10/21 10:48:46-04:00 viro@www.linux.org.uk +27 -37 # (11/18) lne390 iomem annotations and fixes # # ChangeSet # 2004/10/21 18:36:08-04:00 viro@www.linux.org.uk # [PATCH] fealnx iomem annotations, switch to io{read,write} # # Signed-off-by: Al Viro # # drivers/net/fealnx.c # 2004/10/21 10:48:46-04:00 viro@www.linux.org.uk +129 -146 # (10/18) fealnx iomem annotations, switch to io{read,write} # # ChangeSet # 2004/10/21 18:33:39-04:00 viro@www.linux.org.uk # [PATCH] wireless iomem annotations and fixes, switch to io{read,write} # # hermes.c switched to ioread/iowrite from homegrown analogs, its users # updated. Fixed direct dereferencing of ioremapped memory in orinoco_plx. # # Signed-off-by: Al Viro # # drivers/net/wireless/orinoco_tmd.c # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +27 -24 # (9/18) wireless iomem annotations and fixes, switch to io{read,write} # # drivers/net/wireless/orinoco_plx.c # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +41 -41 # (9/18) wireless iomem annotations and fixes, switch to io{read,write} # # drivers/net/wireless/orinoco_pci.c # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +3 -4 # (9/18) wireless iomem annotations and fixes, switch to io{read,write} # # drivers/net/wireless/orinoco_cs.c # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +8 -2 # (9/18) wireless iomem annotations and fixes, switch to io{read,write} # # drivers/net/wireless/hermes.h # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +10 -52 # (9/18) wireless iomem annotations and fixes, switch to io{read,write} # # drivers/net/wireless/hermes.c # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +20 -23 # (9/18) wireless iomem annotations and fixes, switch to io{read,write} # # drivers/net/wireless/airport.c # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +2 -3 # (9/18) wireless iomem annotations and fixes, switch to io{read,write} # # ChangeSet # 2004/10/21 18:30:29-04:00 viro@www.linux.org.uk # [PATCH] ibmtr annotations - the rest # # the rest of annotations and cleanup: ->sram_virt abuse removed, we have # separate ->sram_phys now (not remapped) and keep ->sram_virt an iomem # pointer. # # Signed-off-by: Al Viro # # include/linux/ibmtr.h # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +2 -1 # (7/18) ibmtr annotations - the rest # # drivers/net/tokenring/ibmtr.c # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +45 -59 # (7/18) ibmtr annotations - the rest # # drivers/net/pcmcia/ibmtr_cs.c # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +3 -2 # (7/18) ibmtr annotations - the rest # # ChangeSet # 2004/10/21 18:28:58-04:00 viro@www.linux.org.uk # [PATCH] skfp iomem annotations, switch to io{read,write} # # Signed-off-by: Al Viro # # drivers/net/skfp/skfddi.c # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +16 -9 # (8/18) skfp iomem annotations, switch to io{read,write} # # drivers/net/skfp/h/types.h # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +6 -15 # (8/18) skfp iomem annotations, switch to io{read,write} # # drivers/net/skfp/h/targetos.h # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +1 -1 # (8/18) skfp iomem annotations, switch to io{read,write} # # drivers/net/skfp/h/targethw.h # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +1 -5 # (8/18) skfp iomem annotations, switch to io{read,write} # # drivers/net/skfp/h/fplustm.h # 2004/10/21 10:48:45-04:00 viro@www.linux.org.uk +1 -5 # (8/18) skfp iomem annotations, switch to io{read,write} # # ChangeSet # 2004/10/21 18:26:47-04:00 viro@www.linux.org.uk # [PATCH] olympic_open() cleanup and fixes # # Signed-off-by: Al Viro # # drivers/net/tokenring/olympic.c # 2004/10/21 10:48:44-04:00 viro@www.linux.org.uk +46 -48 # (6/18) olympic_open() cleanup and fixes # # ChangeSet # 2004/10/21 18:26:35-04:00 viro@www.linux.org.uk # [PATCH] sundance iomem annotations, switch to io{read,write} # # Signed-off-by: Al Viro # # drivers/net/sundance.c # 2004/10/21 10:56:28-04:00 viro@www.linux.org.uk +121 -138 # (3/18) sundance iomem annotations, switch to io{read,write} # # ChangeSet # 2004/10/21 18:25:51-04:00 viro@www.linux.org.uk # [PATCH] via-rhine iomem annotations, switch to io{read,write} # # Signed-off-by: Al Viro # # drivers/net/via-rhine.c # 2004/10/21 11:02:43-04:00 viro@www.linux.org.uk +127 -140 # (2/18) via-rhine iomem annotations, switch to io{read,write} # # ChangeSet # 2004/10/21 18:17:45-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/linux-2.6 # into pobox.com:/garz/repo/netdev-2.6/via-rhine # # drivers/net/via-rhine.c # 2004/10/21 18:17:40-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/21 18:14:03-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/linux-2.6 # into pobox.com:/garz/repo/netdev-2.6/viro-eth1 # # drivers/net/wireless/netwave_cs.c # 2004/10/21 18:14:00-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/arlan.h # 2004/10/21 18:13:59-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tokenring/lanstreamer.c # 2004/10/21 18:13:59-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/starfire.c # 2004/10/21 18:13:59-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/20 19:41:31-04:00 jgarzik@pobox.com # Hand-merge pci_save_state() stuff that came in from upstream. # # drivers/net/8139too.c # 2004/10/20 19:41:26-04:00 jgarzik@pobox.com +0 -1 # Hand-merge pci_save_state() stuff that came in from upstream. # # net/irda/irlan/irlan_client.c # 2004/10/20 19:30:53-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # include/linux/pci_ids.h # 2004/10/20 19:30:53-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_mgt.c # 2004/10/20 19:30:53-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_hotplug.c # 2004/10/20 19:30:53-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_dev.h # 2004/10/20 19:30:53-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/netwave_cs.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/arlan.h # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wan/lmc/lmc_main.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/via-rhine.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tulip/xircom_cb.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tulip/winbond-840.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tulip/de4x5.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tokenring/olympic.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tokenring/lanstreamer.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tokenring/3c359.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tg3.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/starfire.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/slip.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/sk_mca.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/sis900.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/pcnet32.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/pcmcia/xirc2ps_cs.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/mac8390.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ixgb/ixgb_main.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ibmlana.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/hamradio/hdlcdrv.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/eepro100.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/e1000/e1000_main.c # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/e1000/e1000.h # 2004/10/20 19:30:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/e100.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/depca.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/defxx.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/b44.h # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/b44.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/atp.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/acenic.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/Kconfig # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/8139cp.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/3c59x.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/3c507.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/media/dvb/dvb-core/dvb_net.c # 2004/10/20 19:30:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/20 01:29:35-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/viro-old-eth # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/pcmcia/smc91c92_cs.c # 2004/10/20 01:29:32-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/20 01:28:30-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/viro-eth1 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/wireless/netwave_cs.c # 2004/10/20 01:28:28-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/20 01:26:20-04:00 viro@www.linux.org.uk # [PATCH] net/pcmcia iomem annotations # # Signed-off-by: Al Viro # # include/pcmcia/mem_op.h # 2004/10/15 14:46:49-04:00 viro@www.linux.org.uk +38 -51 # (31/32) net/pcmcia iomem annotations # # drivers/net/pcmcia/xirc2ps_cs.c # 2004/10/15 14:46:34-04:00 viro@www.linux.org.uk +1 -1 # (31/32) net/pcmcia iomem annotations # # drivers/net/pcmcia/smc91c92_cs.c # 2004/10/15 14:46:30-04:00 viro@www.linux.org.uk +1 -1 # (31/32) net/pcmcia iomem annotations # # drivers/net/pcmcia/pcnet_cs.c # 2004/10/15 14:46:20-04:00 viro@www.linux.org.uk +21 -18 # (31/32) net/pcmcia iomem annotations # # drivers/net/pcmcia/fmvj18x_cs.c # 2004/10/15 14:46:26-04:00 viro@www.linux.org.uk +2 -2 # (31/32) net/pcmcia iomem annotations # # ChangeSet # 2004/10/20 01:23:43-04:00 viro@www.linux.org.uk # [PATCH] netwave iomem annotations # # Signed-off-by: Al Viro # # drivers/net/wireless/netwave_cs.c # 2004/10/15 14:40:21-04:00 viro@www.linux.org.uk +23 -19 # (30/32) netwave iomem annotations # # ChangeSet # 2004/10/20 01:23:33-04:00 viro@www.linux.org.uk # [PATCH] arlan iomem annotations and cleanups # # iomem annotations + couple of bad implementations of offsetof() replaced with # the real thing. # # Signed-off-by: Al Viro # # drivers/net/wireless/arlan.h # 2004/10/15 14:35:50-04:00 viro@www.linux.org.uk +3 -5 # (28/32) arlan iomem annotations and cleanups # # drivers/net/wireless/arlan-proc.c # 2004/10/15 14:32:05-04:00 viro@www.linux.org.uk +5 -5 # (28/32) arlan iomem annotations and cleanups # # drivers/net/wireless/arlan-main.c # 2004/10/15 14:31:08-04:00 viro@www.linux.org.uk +21 -21 # (28/32) arlan iomem annotations and cleanups # # ChangeSet # 2004/10/20 01:23:23-04:00 viro@www.linux.org.uk # [PATCH] netdev_priv() in netwave_cs # # Signed-off-by: Al Viro # # drivers/net/wireless/netwave_cs.c # 2004/10/15 14:43:33-04:00 viro@www.linux.org.uk +18 -17 # (29/32) netdev_priv() in netwave_cs # # ChangeSet # 2004/10/20 01:23:12-04:00 viro@www.linux.org.uk # [PATCH] netdev_priv() in arlan # # Signed-off-by: Al Viro # # drivers/net/wireless/arlan.h # 2004/10/15 14:36:05-04:00 viro@www.linux.org.uk +10 -10 # (27/32) netdev_priv() in arlan # # drivers/net/wireless/arlan-proc.c # 2004/10/15 14:33:52-04:00 viro@www.linux.org.uk +10 -5 # (27/32) netdev_priv() in arlan # # drivers/net/wireless/arlan-main.c # 2004/10/15 14:26:22-04:00 viro@www.linux.org.uk +24 -24 # (27/32) netdev_priv() in arlan # # ChangeSet # 2004/10/20 01:18:24-04:00 viro@www.linux.org.uk # [PATCH] (25/32) lanstreamer iomem annotations # # Signed-off-by: Al Viro # # drivers/net/tokenring/lanstreamer.h # 2004/10/15 14:20:31-04:00 viro@www.linux.org.uk +1 -1 # (25/32) lanstreamer iomem annotations # # drivers/net/tokenring/lanstreamer.c # 2004/10/15 14:20:29-04:00 viro@www.linux.org.uk +12 -12 # (25/32) lanstreamer iomem annotations # # ChangeSet # 2004/10/20 01:17:06-04:00 viro@www.linux.org.uk # [PATCH] beginning of ibmtr iomem annotations # # the easy parts of ibmtr annotations, there will be another patch dealing with # the rest of it. # # Signed-off-by: Al Viro # # include/linux/ibmtr.h # 2004/10/15 12:44:51-04:00 viro@www.linux.org.uk +7 -7 # (24/32) beginning of ibmtr iomem annotations # # drivers/net/tokenring/ibmtr.c # 2004/10/15 12:44:51-04:00 viro@www.linux.org.uk +52 -50 # (24/32) beginning of ibmtr iomem annotations # # drivers/net/pcmcia/ibmtr_cs.c # 2004/10/15 12:44:51-04:00 viro@www.linux.org.uk +1 -1 # (24/32) beginning of ibmtr iomem annotations # # ChangeSet # 2004/10/20 00:55:18-04:00 viro@www.linux.org.uk # [PATCH] e2100 iomem annotations and fixes # # added mission ioremap(); driver was using readw() et.al. on non-remapped # addresses. # # Signed-off-by: Al Viro # # drivers/net/e2100.c # 2004/10/15 12:44:51-04:00 viro@www.linux.org.uk +13 -5 # (23/32) e2100 iomem annotations and fixes # # ChangeSet # 2004/10/20 00:54:19-04:00 viro@www.linux.org.uk # [PATCH] 3c359 iomem annotations # # Signed-off-by: Al Viro # # drivers/net/tokenring/3c359.h # 2004/10/15 12:44:50-04:00 viro@www.linux.org.uk +1 -1 # (22/32) 3c359 iomem annotations # # drivers/net/tokenring/3c359.c # 2004/10/15 12:44:50-04:00 viro@www.linux.org.uk +18 -18 # (22/32) 3c359 iomem annotations # # ChangeSet # 2004/10/20 00:54:08-04:00 viro@www.linux.org.uk # [PATCH] depca iomem annotations # # Signed-off-by: Al Viro # # drivers/net/depca.c # 2004/10/15 12:44:35-04:00 viro@www.linux.org.uk +12 -12 # (20/32) depca iomem annotations # # ChangeSet # 2004/10/20 00:51:44-04:00 viro@www.linux.org.uk # [PATCH] killed isa_... in 3c507 # # switched to ioremap() + normal read../write.. # # Signed-off-by: Al Viro # # drivers/net/3c507.c # 2004/10/15 12:44:28-04:00 viro@www.linux.org.uk +80 -68 # (19/32) killed isa_... in 3c507 # # ChangeSet # 2004/10/20 00:51:07-04:00 viro@www.linux.org.uk # [PATCH] starfire iomem annotations # # Signed-off-by: Al Viro # # drivers/net/starfire.c # 2004/10/15 12:44:23-04:00 viro@www.linux.org.uk +40 -39 # (18/32) starfire iomem annotations # # ChangeSet # 2004/10/20 00:47:46-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/misc # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/Kconfig # 2004/10/20 00:47:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/20 00:45:46-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/e100 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/e100.c # 2004/10/20 00:45:44-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:21:25-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/r8169 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/Kconfig # 2004/10/19 19:21:23-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:15:33-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/smc91x # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/smc91x.h # 2004/10/19 19:15:30-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:14:23-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/sis900 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/sis900.c # 2004/10/19 19:14:21-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:13:21-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/prism54 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/wireless/prism54/islpci_dev.h # 2004/10/19 19:13:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/islpci_dev.c # 2004/10/19 19:13:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/isl_38xx.h # 2004/10/19 19:13:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/wireless/prism54/isl_38xx.c # 2004/10/19 19:13:18-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:11:53-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/iomap # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/eepro100.c # 2004/10/19 19:11:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/Kconfig # 2004/10/19 19:11:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:10:54-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/forcedeth # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/forcedeth.c # 2004/10/19 19:10:51-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:09:56-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/e1000-2 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/e1000/e1000_main.c # 2004/10/19 19:09:53-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:08:56-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/e100 # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/e100.c # 2004/10/19 19:08:53-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:07:54-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/defxx # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/defxx.c # 2004/10/19 19:07:52-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:01:43-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/set-config # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/media/dvb/dvb-core/dvb_net.c # 2004/10/19 19:01:39-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 19:00:36-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/misc # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/tulip/de2104x.c # 2004/10/19 19:00:33-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ns83820.c # 2004/10/19 19:00:33-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ixgb/ixgb_main.c # 2004/10/19 19:00:33-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 18:59:32-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/mc-filter # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/tulip/winbond-840.c # 2004/10/19 18:59:29-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tulip/tulip_core.c # 2004/10/19 18:59:29-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 18:58:34-04:00 jgarzik@pobox.com # Merge pobox.com:/garz/repo/netdev-2.6/janitor # into pobox.com:/garz/repo/netdev-2.6/ALL # # drivers/net/tulip/tulip_core.c # 2004/10/19 18:58:31-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ns83820.c # 2004/10/19 18:58:31-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/3c59x.c # 2004/10/19 18:58:31-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 14:20:37-04:00 jgarzik@pobox.com # Merge pobox.com:/spare/repo/netdev-2.6/8139cp # into pobox.com:/spare/repo/netdev-2.6/ALL # # include/linux/pci_ids.h # 2004/10/19 14:20:34-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/8139cp.c # 2004/10/19 14:20:33-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/10/19 11:27:26-04:00 romieu@fr.zoreil.com # [PATCH] r8169: netconsole support # # netconsole support. # # Signed-off-by: John W. Linville # # drivers/net/r8169.c # 2004/10/18 17:56:27-04:00 romieu@fr.zoreil.com +21 -0 # r8169: netconsole support # # ChangeSet # 2004/10/19 11:27:11-04:00 romieu@fr.zoreil.com # [PATCH] r8169: unneeded synchronize_irq() # # synchronize_irq() is not needed as it is already issued by free_irq(). # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/10/18 17:37:58-04:00 romieu@fr.zoreil.com +0 -1 # r8169: unneeded synchronize_irq() # # ChangeSet # 2004/10/19 11:26:56-04:00 romieu@fr.zoreil.com # [PATCH] r8169: always clean Tx desc # # rtl8169_unmap_tx_skb() can not assume that a Tx ring descriptor belongs # to the host as it can be issued during rtl8169_tx_clear() as a part of # a recovery process (during Tx timeout for instance). # # Simple fix: always clean the relevant descriptor entry. # # Acked-by: Francois Romieu # Signed-off-by: Jon Mason # # drivers/net/r8169.c # 2004/10/18 17:31:21-04:00 romieu@fr.zoreil.com +1 -0 # r8169: always clean Tx desc # # ChangeSet # 2004/10/16 17:22:32-04:00 viro@www.linux.org.uk # [PATCH] ne3210 iomem annotations # # Signed-off-by: Al Viro # # drivers/net/ne3210.c # 2004/10/15 12:44:22-04:00 viro@www.linux.org.uk +17 -17 # (17/32) ne3210 iomem annotations # # ChangeSet # 2004/10/16 16:50:54-04:00 viro@www.linux.org.uk # [PATCH] ac3200 iomem annotations and fixes # # annotated, killed isa_... uses by making ioremap() unconditional, fixed # the use of isa_... on already remapped address. # # Signed-off-by: Al Viro # # drivers/net/ac3200.c # 2004/10/15 12:44:22-04:00 viro@www.linux.org.uk +27 -37 # (15/32) ac3200 iomem annotations and fixes # # drivers/net/8390.h # 2004/10/15 12:44:21-04:00 viro@www.linux.org.uk +1 -0 # (15/32) ac3200 iomem annotations and fixes # # ChangeSet # 2004/10/15 19:52:15-04:00 shemminger@osdl.org # [PATCH] tg3: make driver only data static # # Several data structures should have been marked static because # the are local to this driver. # # Signed-off-by: Stephen Hemminger # # drivers/net/tg3.c # 2004/10/15 15:57:56-04:00 shemminger@osdl.org +6 -6 # tg3: make driver only data static # # ChangeSet # 2004/10/15 19:52:02-04:00 shemminger@osdl.org # [PATCH] tg3: use netdev_priv # # use netdev_priv # # Signed-off-by: Stephen Hemminger # # drivers/net/tg3.c # 2004/10/15 15:19:26-04:00 shemminger@osdl.org +2 -2 # tg3: use netdev_priv # # ChangeSet # 2004/10/15 19:51:49-04:00 shemminger@osdl.org # [PATCH] tg3: use module_param # # get rid of deprecated use of MODULE_PARM # # Signed-off-by: Stephen Hemminger # # drivers/net/tg3.c # 2004/10/15 15:19:54-04:00 shemminger@osdl.org +3 -3 # tg3: use module_param # # ChangeSet # 2004/10/15 19:49:50-04:00 shemminger@osdl.org # [PATCH] via-rhine: free_ring should be static # # free_ring is a local function # # Signed-off-by: Stephen Hemminger # # drivers/net/via-rhine.c # 2004/10/15 15:45:02-04:00 shemminger@osdl.org +1 -1 # via-rhine: free_ring should be static # # ChangeSet # 2004/10/15 19:49:38-04:00 shemminger@osdl.org # [PATCH] via-rhine: use module_param # # Signed-off-by: Stephen Hemminger # # drivers/net/via-rhine.c # 2004/10/15 15:27:28-04:00 shemminger@osdl.org +4 -3 # via-rhine: use module_param # # ChangeSet # 2004/10/15 19:25:35-04:00 shemminger@osdl.org # [PATCH] 8139too: use netdev_priv # # Use netdev_priv where appropriate, and get rid of "can't happen anymore" assert's. # # Signed-off-by: Stephen Hemminger # # drivers/net/8139too.c # 2004/10/15 18:25:02-04:00 shemminger@osdl.org +38 -45 # 8139too: use netdev_priv # # ChangeSet # 2004/10/15 19:22:45-04:00 shemminger@osdl.org # [PATCH] r8169: use netdev_priv # # Use netdev_priv in a couple of places in realtek 8169 # # Signed-off-by: Stephen Hemminger # # drivers/net/r8169.c # 2004/10/15 18:00:43-04:00 shemminger@osdl.org +2 -2 # r8169: use netdev_priv # # ChangeSet # 2004/10/15 19:22:14-04:00 shemminger@osdl.org # [PATCH] r8169: use module_param # # Use module_param instead of deprecated MDOULE_PARM # # Signed-off-by: Stephen Hemminger # # drivers/net/r8169.c # 2004/10/15 17:56:05-04:00 shemminger@osdl.org +5 -3 # r8169: use module_param # # ChangeSet # 2004/10/15 14:56:05-04:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] iomem annotations in r8169 # # Signed-off-by: Al Viro # # drivers/net/r8169.c # 2004/10/13 13:49:51-04:00 viro@parcelfarce.linux.theplanet.co.uk +42 -42 # annotations in r8169 # # ChangeSet # 2004/10/15 13:18:39-04:00 Philipp.Gortan@tttech.com # [netdrvr 8139cp] add PCI ID # # include/linux/pci_ids.h # 2004/10/15 13:18:32-04:00 Philipp.Gortan@tttech.com +3 -0 # [netdrvr 8139cp] add PCI ID # # drivers/net/8139cp.c # 2004/10/15 13:18:32-04:00 Philipp.Gortan@tttech.com +2 -0 # [netdrvr 8139cp] add PCI ID # # ChangeSet # 2004/10/04 16:46:51-04:00 romieu@fr.zoreil.com # [PATCH] r8169: cleanup # # Cleanup # - timeout message is redundant with net/sched/sch_generic::dev_watchdog; # - anti-bloat in rtl8169_get_rx_csum; # - format fix. # # Signed-off-by: Francois Romieu # Signed-off-by: Jon Mason # # drivers/net/r8169.c # 2004/10/04 15:27:47-04:00 romieu@fr.zoreil.com +3 -5 # r8169: cleanup # # ChangeSet # 2004/10/04 16:46:37-04:00 romieu@fr.zoreil.com # [PATCH] r8169: rtl8169_close() races # # - close the race with rtl8169_interrupt() which appears when rtl8169_close() # uses synchronize_irq()/free_irq(); # - netif_poll_disable() allows rtl8169_close() to wait for any pending # rtl8169_poll() to complete so it can safely clear the rings. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/10/04 15:26:01-04:00 romieu@fr.zoreil.com +6 -0 # r8169: rtl8169_close() races # # ChangeSet # 2004/10/04 16:46:24-04:00 romieu@fr.zoreil.com # [PATCH] r8169: automatic pci dac step down # # Automatic adjustement of highmem dma feature. # # The first interruption encountered on systems where the 8169 does not # perform PCI DAC correctly seems to always be a PCI error one. # When DAC is enabled, the driver tries to issue a complete down/up # sequence as an addition to the usual halt of the device. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/10/04 15:25:07-04:00 romieu@fr.zoreil.com +70 -7 # r8169: automatic pci dac step down # # ChangeSet # 2004/10/04 16:46:10-04:00 romieu@fr.zoreil.com # [PATCH] r8169: wrong advertisement of VLAN features # # Removal of an advertisement for VLAN features which is redundant with # rtl8169_init_one(). # # Signed-off-by: Jon Mason # # drivers/net/r8169.c # 2004/10/04 15:17:44-04:00 romieu@fr.zoreil.com +0 -2 # r8169: wrong advertisement of VLAN features # # ChangeSet # 2004/10/04 16:45:56-04:00 romieu@fr.zoreil.com # [PATCH] r8169: Tx timeout rework # # Tx timeout rework: # - the ring descriptors of the chipset and the ring index of the driver # are synced during a reset of the device; # - rtl8169_interrupt: rtl8169_hw_reset() replaces the previous stop code. # An implicit reset of the device is added but it makes no noticeable # difference with the former behavior (i.e.: stop the chipset). # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/10/04 15:15:41-04:00 romieu@fr.zoreil.com +65 -24 # r8169: Tx timeout rework # # ChangeSet # 2004/10/01 00:16:39-04:00 felipewd@terra.com.br # [PATCH] 8139cp net driver: add MODULE_VERSION # # drivers/net/8139cp.c # 2004/09/23 00:02:58-04:00 felipewd@terra.com.br +1 -0 # 8139cp net driver: add MODULE_VERSION # # ChangeSet # 2004/09/30 23:24:55-04:00 klassert@mathematik.tu-chemnitz.de # [PATCH] 8139cp - add netpoll support # # Patch adds netpoll support to the 8139cp driver. # The patch needs some tests because I have no NIC of this type for testing. # # Applies against linux-2.6.9-rc2-mm3 # # Signed-off-by: Steffen Klassert # # drivers/net/8139cp.c # 2004/09/27 07:55:04-04:00 klassert@mathematik.tu-chemnitz.de +19 -0 # 8139cp - add netpoll support # # ChangeSet # 2004/09/20 18:37:18-04:00 jgarzik@pobox.com # Hand-merge upstream r8169 DAC changes. # # drivers/net/r8169.c # 2004/09/20 18:37:11-04:00 jgarzik@pobox.com +0 -14 # Hand-merge upstream r8169 DAC changes. # # drivers/net/Kconfig # 2004/09/20 18:35:32-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/09/20 15:08:23-04:00 rl@hellgate.ch # [PATCH] mc_filter on big-endian arch # # On Sat, 19 Jun 2004 17:37:37 -0400, Jeff Garzik wrote: # > you would be kind enough to resend the non-via-rhine patches WRT mc_filter? # # Sure. Patch is for 2.6 (not rediffed, yell if it doesn't apply # anymore). Btw, did you pick up the mc_filter patch for 2.4 via-rhine? # # This untested patch fixes hardware mc filters for tulip_core, winbond, # and atp. Hopefully :-). # # Please review and test. # # Signed-off-by: Roger Luethi # # drivers/net/tulip/winbond-840.c # 2004/06/06 12:04:19-04:00 rl@hellgate.ch +1 -1 # mc_filter on big-endian arch # # drivers/net/tulip/tulip_core.c # 2004/06/06 12:04:36-04:00 rl@hellgate.ch +1 -1 # mc_filter on big-endian arch # # drivers/net/atp.c # 2004/06/06 12:04:55-04:00 rl@hellgate.ch +1 -1 # mc_filter on big-endian arch # # ChangeSet # 2004/09/20 14:48:28-04:00 shemminger@osdl.org # [PATCH] 8139cp - module_param # # Not sure if I sent this already... # Convert 8139cp to use new module_param() not old MODULE_PARM # # Signed-off-by: Stephen Hemminger # # drivers/net/8139cp.c # 2004/07/23 16:54:25-04:00 shemminger@osdl.org +3 -2 # 8139cp - module_param # # ChangeSet # 2004/09/20 14:06:35-04:00 romieu@fr.zoreil.com # [PATCH] r8169: default on disabling PCIDAC # # Default to disabling PCI DAC as this option appears unsafe on amd64 # (original suggestion by Hans-Frieder Vogt ). # # The driver will typically report PCI System error when something goes # wrong. The relevant interrupt is not masked any more and the driver # can thus be disabled. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/09/19 18:16:02-04:00 romieu@fr.zoreil.com +15 -2 # r8169: default on disabling PCIDAC # # ChangeSet # 2004/09/17 12:17:15-04:00 jgarzik@pobox.com # [netdrvr eepro100] fix pci_iomap() args and info msg that follows # # drivers/net/eepro100.c # 2004/09/17 12:17:09-04:00 jgarzik@pobox.com +6 -6 # [netdrvr eepro100] fix pci_iomap() args and info msg that follows # # ChangeSet # 2004/09/16 20:34:40-04:00 romieu@fr.zoreil.com # [PATCH] r8169: Mac identifier extracted from Realtek's driver v2.2 # # Mac identifier extracted from Realtek's driver v2.2. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/09/08 17:31:09-04:00 romieu@fr.zoreil.com +3 -1 # r8169: Mac identifier extracted from Realtek's driver v2.2 # # ChangeSet # 2004/09/16 20:34:28-04:00 romieu@fr.zoreil.com # [PATCH] r8169: TSO support. # # TSO support. Suggestion of Jeff Garzik. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/09/08 16:53:47-04:00 romieu@fr.zoreil.com +14 -3 # r8169: TSO support. # # ChangeSet # 2004/09/16 20:34:16-04:00 romieu@fr.zoreil.com # [PATCH] r8169: hint for Tx flow control # # return 1 in start_xmit() when the required descriptors are not available # and wait for more room. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/09/08 16:04:04-04:00 romieu@fr.zoreil.com +7 -5 # r8169: hint for Tx flow control # # ChangeSet # 2004/09/16 20:34:04-04:00 romieu@fr.zoreil.com # [PATCH] r8169: miscalculation of available Tx descriptors # # The count of available entries in the Tx descriptors ring is badly wrong. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/09/08 16:02:35-04:00 romieu@fr.zoreil.com +9 -5 # r8169: miscalculation of available Tx descriptors # # ChangeSet # 2004/09/16 20:27:36-04:00 jgarzik@pobox.com # Merge pobox.com:/spare/repo/linux-2.6 # into pobox.com:/spare/repo/netdev-2.6/r8169 # # drivers/net/Kconfig # 2004/09/16 20:27:32-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/09/16 20:13:40-04:00 davem@davemloft.net # [PATCH] eepro100.c iomap conversion # # drivers/net/eepro100.c # 2004/09/16 19:48:12-04:00 davem@davemloft.net +129 -162 # RFC eepro100.c conversion # # drivers/net/Kconfig # 2004/09/16 19:46:57-04:00 davem@davemloft.net +0 -10 # RFC eepro100.c conversion # # ChangeSet # 2004/08/31 03:20:31-04:00 romieu@fr.zoreil.com # [PATCH] 8139cp: SG support fixes # # - suspicious length in pci_unmap_single; # - wait for the last frag before freeing the relevant skb; # - no need to crash when facing some unexpected csum combination. # # drivers/net/8139cp.c # 2004/08/30 15:21:23-04:00 romieu@fr.zoreil.com +13 -12 # 8139cp: SG support fixes # # ChangeSet # 2004/08/31 03:18:42-04:00 jgarzik@pobox.com # Hand-merge upstream r8169 change. # # drivers/net/r8169.c # 2004/08/31 03:18:36-04:00 jgarzik@pobox.com +1 -2 # Hand-merge upstream r8169 change. # # ChangeSet # 2004/08/31 03:16:23-04:00 jgarzik@pobox.com # Merge pobox.com:/spare/repo/net-drivers-2.6 # into pobox.com:/spare/repo/netdev-2.6/8139cp # # drivers/net/8139cp.c # 2004/08/31 03:16:19-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/08/29 17:19:44-04:00 jgarzik@pobox.com # [netdrvr 8139cp] TSO support # # drivers/net/8139cp.c # 2004/08/29 17:19:37-04:00 jgarzik@pobox.com +33 -17 # [netdrvr 8139cp] TSO support # # ChangeSet # 2004/08/28 19:20:27-04:00 romieu@fr.zoreil.com # [PATCH] r8169: vlan support # # 802.1Q support. # Mostly stolen from the 8139cp.c driver. The relevant registers and # descriptors bits are identical for both chipsets. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:31:33-04:00 romieu@fr.zoreil.com +94 -2 # r8169: vlan support # # drivers/net/Kconfig # 2004/08/23 17:31:33-04:00 romieu@fr.zoreil.com +9 -0 # r8169: vlan support # # ChangeSet # 2004/08/28 19:20:17-04:00 romieu@fr.zoreil.com # [PATCH] r8169: Rx checksum support # # Rx IP checksumming support. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:30:08-04:00 romieu@fr.zoreil.com +58 -1 # r8169: Rx checksum support # # ChangeSet # 2004/08/28 19:20:06-04:00 romieu@fr.zoreil.com # [PATCH] r8169: advertise DMA to high memory # # Advertise the ability to DMA to high memory. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:30:06-04:00 romieu@fr.zoreil.com +3 -4 # r8169: advertise DMA to high memory # # ChangeSet # 2004/08/28 19:19:56-04:00 romieu@fr.zoreil.com # [PATCH] r8169: Tx checksum offload # # SG and IP checksumming support on output. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:30:04-04:00 romieu@fr.zoreil.com +153 -58 # r8169: Tx checksum offload # # ChangeSet # 2004/08/28 19:19:45-04:00 romieu@fr.zoreil.com # [PATCH] r8169: comment a gcc 2.95.x bug # # gcc 2.95.3 bug has been experienced on gcc 2.95.4. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:30:03-04:00 romieu@fr.zoreil.com +1 -1 # r8169: comment a gcc 2.95.x bug # # ChangeSet # 2004/08/28 19:19:34-04:00 romieu@fr.zoreil.com # [PATCH] r8169: sync the names of a few bits with the 8139cp driver # # Sync the names of the descriptor with these which are used in the 8139cp # driver. Though not exactly identical the descriptors are forward compatible. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:30:01-04:00 romieu@fr.zoreil.com +20 -20 # r8169: sync the names of a few bits with the 8139cp driver # # ChangeSet # 2004/08/28 19:19:23-04:00 romieu@fr.zoreil.com # [PATCH] r8169: bump version number # # Help reviewers realize that the in-kernel driver has evolved lately. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:30:00-04:00 romieu@fr.zoreil.com +10 -1 # r8169: bump version number # # ChangeSet # 2004/08/28 19:19:13-04:00 romieu@fr.zoreil.com # [PATCH] r8169: enable MWI # # - enable Memory Write and Invalidate (disabled after reset); # - fix wrong goto. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:30:00-04:00 romieu@fr.zoreil.com +11 -6 # r8169: enable MWI # # ChangeSet # 2004/08/28 19:19:03-04:00 romieu@fr.zoreil.com # [PATCH] r8169: code cleanup # # Cleanup/code removal: # - MAX_ETH_FRAME_SIZE is not used; # - removal of assertion for impossible condition (if it happens, it will _not_ # take long to notice anyway) # - introduce rtl8169_release_board() to factor out some code; # - rtl8169_init_board: # - some variables are not really needed nor do they help read the code; # - more explicit name for label; # - tp->{Rx/Tx}DescArray: no need to zeroize coherent DMA mapping. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:29:59-04:00 romieu@fr.zoreil.com +26 -38 # r8169: code cleanup # # ChangeSet # 2004/08/28 19:18:52-04:00 romieu@fr.zoreil.com # [PATCH] r8169: per device receive buffer size # # Turn the Rx receive buffer size into a per device variable. # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:29:59-04:00 romieu@fr.zoreil.com +28 -23 # r8169: per device receive buffer size # # ChangeSet # 2004/08/28 19:18:40-04:00 romieu@fr.zoreil.com # [PATCH] r8169: add ethtool_ops.{get_regs_len/get_regs} # # - ethtool_ops.{get_regs_len/get_regs} for r8169; # - fix a dubious check: datasheet v1.21 claims on p.44 that io/memory space # is exactly 256 bytes wide; # - use SET_ETHTOOL_OPS(). # # Signed-off-by: Francois Romieu # # drivers/net/r8169.c # 2004/08/23 17:29:58-04:00 romieu@fr.zoreil.com +23 -3 # r8169: add ethtool_ops.{get_regs_len/get_regs} # # ChangeSet # 2004/08/28 19:06:15-04:00 rene.herman@keyaccess.nl # [PATCH] 8139too Interframe Gap Time # # drivers/net/8139too.c # 2004/04/30 10:29:08-04:00 rene.herman@keyaccess.nl +9 -5 # 8139too Interframe Gap Time # diff -Nru a/drivers/net/3c507.c b/drivers/net/3c507.c --- a/drivers/net/3c507.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/3c507.c 2004-10-26 18:34:29 -07:00 @@ -127,6 +127,7 @@ ushort tx_reap; ushort tx_pkts_in_ring; spinlock_t lock; + void __iomem *base; }; /* @@ -348,6 +349,7 @@ return dev; out1: free_irq(dev->irq, dev); + iounmap(((struct net_local *)netdev_priv(dev))->base); release_region(dev->base_addr, EL16_IO_EXTENT); out: free_netdev(dev); @@ -395,7 +397,7 @@ irqval = request_irq(irq, &el16_interrupt, 0, DRV_NAME, dev); if (irqval) { - printk ("unable to get IRQ %d (irqval=%d).\n", irq, irqval); + printk(KERN_ERR "3c507: unable to get IRQ %d (irqval=%d).\n", irq, irqval); retval = -EAGAIN; goto out; } @@ -445,6 +447,12 @@ lp = netdev_priv(dev); memset(lp, 0, sizeof(*lp)); spin_lock_init(&lp->lock); + lp->base = ioremap(dev->mem_start, RX_BUF_END); + if (!lp->base) { + printk(KERN_ERR "3c507: unable to remap memory\n"); + retval = -EAGAIN; + goto out1; + } dev->open = el16_open; dev->stop = el16_close; @@ -455,6 +463,8 @@ dev->ethtool_ops = &netdev_ethtool_ops; dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ return 0; +out1: + free_irq(dev->irq, dev); out: release_region(ioaddr, EL16_IO_EXTENT); return retval; @@ -474,11 +484,11 @@ { struct net_local *lp = netdev_priv(dev); int ioaddr = dev->base_addr; - unsigned long shmem = dev->mem_start; + void __iomem *shmem = lp->base; if (net_debug > 1) printk ("%s: transmit timed out, %s? ", dev->name, - isa_readw (shmem + iSCB_STATUS) & 0x8000 ? "IRQ conflict" : + readw(shmem + iSCB_STATUS) & 0x8000 ? "IRQ conflict" : "network cable problem"); /* Try to restart the adaptor. */ if (lp->last_restart == lp->stats.tx_packets) { @@ -491,7 +501,7 @@ /* Issue the channel attention signal and hope it "gets better". */ if (net_debug > 1) printk ("Kicking board.\n"); - isa_writew (0xf000 | CUC_START | RX_START, shmem + iSCB_CMD); + writew(0xf000 | CUC_START | RX_START, shmem + iSCB_CMD); outb (0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */ lp->last_restart = lp->stats.tx_packets; } @@ -539,7 +549,7 @@ struct net_local *lp; int ioaddr, status, boguscount = 0; ushort ack_cmd = 0; - unsigned long shmem; + void __iomem *shmem; if (dev == NULL) { printk ("net_interrupt(): irq %d for unknown device.\n", irq); @@ -548,11 +558,11 @@ ioaddr = dev->base_addr; lp = netdev_priv(dev); - shmem = dev->mem_start; + shmem = lp->base; spin_lock(&lp->lock); - status = isa_readw(shmem+iSCB_STATUS); + status = readw(shmem+iSCB_STATUS); if (net_debug > 4) { printk("%s: 3c507 interrupt, status %4.4x.\n", dev->name, status); @@ -563,7 +573,7 @@ /* Reap the Tx packet buffers. */ while (lp->tx_pkts_in_ring) { - unsigned short tx_status = isa_readw(shmem+lp->tx_reap); + unsigned short tx_status = readw(shmem+lp->tx_reap); if (!(tx_status & 0x8000)) { if (net_debug > 5) printk("Tx command incomplete (%#x).\n", lp->tx_reap); @@ -619,11 +629,11 @@ printk("%s: Rx unit stopped, status %04x, restarting.\n", dev->name, status); init_rx_bufs(dev); - isa_writew(RX_BUF_START,shmem+iSCB_RFA); + writew(RX_BUF_START,shmem+iSCB_RFA); ack_cmd |= RX_START; } - isa_writew(ack_cmd,shmem+iSCB_CMD); + writew(ack_cmd,shmem+iSCB_CMD); outb(0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */ /* Clear the latched interrupt. */ @@ -637,13 +647,14 @@ static int el16_close(struct net_device *dev) { + struct net_local *lp = netdev_priv(dev); int ioaddr = dev->base_addr; - unsigned long shmem = dev->mem_start; + void __iomem *shmem = lp->base; netif_stop_queue(dev); /* Flush the Tx and disable Rx. */ - isa_writew(RX_SUSPEND | CUC_SUSPEND,shmem+iSCB_CMD); + writew(RX_SUSPEND | CUC_SUSPEND,shmem+iSCB_CMD); outb(0, ioaddr + SIGNAL_CA); /* Disable the 82586's input to the interrupt line. */ @@ -671,7 +682,7 @@ static void init_rx_bufs(struct net_device *dev) { struct net_local *lp = netdev_priv(dev); - unsigned long write_ptr; + void __iomem *write_ptr; unsigned short SCB_base = SCB_BASE; int cur_rxbuf = lp->rx_head = RX_BUF_START; @@ -679,26 +690,26 @@ /* Initialize each Rx frame + data buffer. */ do { /* While there is room for one more. */ - write_ptr = dev->mem_start + cur_rxbuf; + write_ptr = lp->base + cur_rxbuf; - isa_writew(0x0000,write_ptr); /* Status */ - isa_writew(0x0000,write_ptr+=2); /* Command */ - isa_writew(cur_rxbuf + RX_BUF_SIZE,write_ptr+=2); /* Link */ - isa_writew(cur_rxbuf + 22,write_ptr+=2); /* Buffer offset */ - isa_writew(0x0000,write_ptr+=2); /* Pad for dest addr. */ - isa_writew(0x0000,write_ptr+=2); - isa_writew(0x0000,write_ptr+=2); - isa_writew(0x0000,write_ptr+=2); /* Pad for source addr. */ - isa_writew(0x0000,write_ptr+=2); - isa_writew(0x0000,write_ptr+=2); - isa_writew(0x0000,write_ptr+=2); /* Pad for protocol. */ - - isa_writew(0x0000,write_ptr+=2); /* Buffer: Actual count */ - isa_writew(-1,write_ptr+=2); /* Buffer: Next (none). */ - isa_writew(cur_rxbuf + 0x20 + SCB_base,write_ptr+=2);/* Buffer: Address low */ - isa_writew(0x0000,write_ptr+=2); + writew(0x0000,write_ptr); /* Status */ + writew(0x0000,write_ptr+=2); /* Command */ + writew(cur_rxbuf + RX_BUF_SIZE,write_ptr+=2); /* Link */ + writew(cur_rxbuf + 22,write_ptr+=2); /* Buffer offset */ + writew(0x0000,write_ptr+=2); /* Pad for dest addr. */ + writew(0x0000,write_ptr+=2); + writew(0x0000,write_ptr+=2); + writew(0x0000,write_ptr+=2); /* Pad for source addr. */ + writew(0x0000,write_ptr+=2); + writew(0x0000,write_ptr+=2); + writew(0x0000,write_ptr+=2); /* Pad for protocol. */ + + writew(0x0000,write_ptr+=2); /* Buffer: Actual count */ + writew(-1,write_ptr+=2); /* Buffer: Next (none). */ + writew(cur_rxbuf + 0x20 + SCB_base,write_ptr+=2);/* Buffer: Address low */ + writew(0x0000,write_ptr+=2); /* Finally, the number of bytes in the buffer. */ - isa_writew(0x8000 + RX_BUF_SIZE-0x20,write_ptr+=2); + writew(0x8000 + RX_BUF_SIZE-0x20,write_ptr+=2); lp->rx_tail = cur_rxbuf; cur_rxbuf += RX_BUF_SIZE; @@ -706,16 +717,16 @@ /* Terminate the list by setting the EOL bit, and wrap the pointer to make the list a ring. */ - write_ptr = dev->mem_start + lp->rx_tail + 2; - isa_writew(0xC000,write_ptr); /* Command, mark as last. */ - isa_writew(lp->rx_head,write_ptr+2); /* Link */ + write_ptr = lp->base + lp->rx_tail + 2; + writew(0xC000,write_ptr); /* Command, mark as last. */ + writew(lp->rx_head,write_ptr+2); /* Link */ } static void init_82586_mem(struct net_device *dev) { struct net_local *lp = netdev_priv(dev); short ioaddr = dev->base_addr; - unsigned long shmem = dev->mem_start; + void __iomem *shmem = lp->base; /* Enable loopback to protect the wire while starting up, and hold the 586 in reset during the memory initialization. */ @@ -726,13 +737,13 @@ init_words[7] = SCB_BASE; /* Write the words at 0xfff6 (address-aliased to 0xfffff6). */ - isa_memcpy_toio(dev->mem_end-10, init_words, 10); + memcpy_toio(lp->base + RX_BUF_END - 10, init_words, 10); /* Write the words at 0x0000. */ - isa_memcpy_toio(dev->mem_start, init_words + 5, sizeof(init_words) - 10); + memcpy_toio(lp->base, init_words + 5, sizeof(init_words) - 10); /* Fill in the station address. */ - isa_memcpy_toio(dev->mem_start+SA_OFFSET, dev->dev_addr, + memcpy_toio(lp->base+SA_OFFSET, dev->dev_addr, sizeof(dev->dev_addr)); /* The Tx-block list is written as needed. We just set up the values. */ @@ -750,11 +761,11 @@ { int boguscnt = 50; - while (isa_readw(shmem+iSCB_STATUS) == 0) + while (readw(shmem+iSCB_STATUS) == 0) if (--boguscnt == 0) { printk("%s: i82586 initialization timed out with status %04x," "cmd %04x.\n", dev->name, - isa_readw(shmem+iSCB_STATUS), isa_readw(shmem+iSCB_CMD)); + readw(shmem+iSCB_STATUS), readw(shmem+iSCB_CMD)); break; } /* Issue channel-attn -- the 82586 won't start. */ @@ -765,7 +776,7 @@ outb(0x84, ioaddr + MISC_CTRL); if (net_debug > 4) printk("%s: Initialized 82586, status %04x.\n", dev->name, - isa_readw(shmem+iSCB_STATUS)); + readw(shmem+iSCB_STATUS)); return; } @@ -774,33 +785,33 @@ struct net_local *lp = netdev_priv(dev); short ioaddr = dev->base_addr; ushort tx_block = lp->tx_head; - unsigned long write_ptr = dev->mem_start + tx_block; + void __iomem *write_ptr = lp->base + tx_block; static char padding[ETH_ZLEN]; /* Set the write pointer to the Tx block, and put out the header. */ - isa_writew(0x0000,write_ptr); /* Tx status */ - isa_writew(CMD_INTR|CmdTx,write_ptr+=2); /* Tx command */ - isa_writew(tx_block+16,write_ptr+=2); /* Next command is a NoOp. */ - isa_writew(tx_block+8,write_ptr+=2); /* Data Buffer offset. */ + writew(0x0000,write_ptr); /* Tx status */ + writew(CMD_INTR|CmdTx,write_ptr+=2); /* Tx command */ + writew(tx_block+16,write_ptr+=2); /* Next command is a NoOp. */ + writew(tx_block+8,write_ptr+=2); /* Data Buffer offset. */ /* Output the data buffer descriptor. */ - isa_writew((pad + length) | 0x8000,write_ptr+=2); /* Byte count parameter. */ - isa_writew(-1,write_ptr+=2); /* No next data buffer. */ - isa_writew(tx_block+22+SCB_BASE,write_ptr+=2); /* Buffer follows the NoOp command. */ - isa_writew(0x0000,write_ptr+=2); /* Buffer address high bits (always zero). */ + writew((pad + length) | 0x8000,write_ptr+=2); /* Byte count parameter. */ + writew(-1,write_ptr+=2); /* No next data buffer. */ + writew(tx_block+22+SCB_BASE,write_ptr+=2); /* Buffer follows the NoOp command. */ + writew(0x0000,write_ptr+=2); /* Buffer address high bits (always zero). */ /* Output the Loop-back NoOp command. */ - isa_writew(0x0000,write_ptr+=2); /* Tx status */ - isa_writew(CmdNOp,write_ptr+=2); /* Tx command */ - isa_writew(tx_block+16,write_ptr+=2); /* Next is myself. */ + writew(0x0000,write_ptr+=2); /* Tx status */ + writew(CmdNOp,write_ptr+=2); /* Tx command */ + writew(tx_block+16,write_ptr+=2); /* Next is myself. */ /* Output the packet at the write pointer. */ - isa_memcpy_toio(write_ptr+2, buf, length); + memcpy_toio(write_ptr+2, buf, length); if (pad) - isa_memcpy_toio(write_ptr+length+2, padding, pad); + memcpy_toio(write_ptr+length+2, padding, pad); /* Set the old command link pointing to this send packet. */ - isa_writew(tx_block,dev->mem_start + lp->tx_cmd_link); + writew(tx_block,lp->base + lp->tx_cmd_link); lp->tx_cmd_link = tx_block + 20; /* Set the next free tx region. */ @@ -821,19 +832,19 @@ static void el16_rx(struct net_device *dev) { struct net_local *lp = netdev_priv(dev); - unsigned long shmem = dev->mem_start; + void __iomem *shmem = lp->base; ushort rx_head = lp->rx_head; ushort rx_tail = lp->rx_tail; ushort boguscount = 10; short frame_status; - while ((frame_status = isa_readw(shmem+rx_head)) < 0) { /* Command complete */ - unsigned long read_frame = dev->mem_start + rx_head; - ushort rfd_cmd = isa_readw(read_frame+2); - ushort next_rx_frame = isa_readw(read_frame+4); - ushort data_buffer_addr = isa_readw(read_frame+6); - unsigned long data_frame = dev->mem_start + data_buffer_addr; - ushort pkt_len = isa_readw(data_frame); + while ((frame_status = readw(shmem+rx_head)) < 0) { /* Command complete */ + void __iomem *read_frame = lp->base + rx_head; + ushort rfd_cmd = readw(read_frame+2); + ushort next_rx_frame = readw(read_frame+4); + ushort data_buffer_addr = readw(read_frame+6); + void __iomem *data_frame = lp->base + data_buffer_addr; + ushort pkt_len = readw(data_frame); if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22 || (pkt_len & 0xC000) != 0xC000) { @@ -865,7 +876,7 @@ skb->dev = dev; /* 'skb->data' points to the start of sk_buff data area. */ - isa_memcpy_fromio(skb_put(skb,pkt_len), data_frame + 10, pkt_len); + memcpy_fromio(skb_put(skb,pkt_len), data_frame + 10, pkt_len); skb->protocol=eth_type_trans(skb,dev); netif_rx(skb); @@ -875,10 +886,10 @@ } /* Clear the status word and set End-of-List on the rx frame. */ - isa_writew(0,read_frame); - isa_writew(0xC000,read_frame+2); + writew(0,read_frame); + writew(0xC000,read_frame+2); /* Clear the end-of-list on the prev. RFD. */ - isa_writew(0x0000,dev->mem_start + rx_tail + 2); + writew(0x0000,lp->base + rx_tail + 2); rx_tail = rx_head; rx_head = next_rx_frame; @@ -935,6 +946,7 @@ struct net_device *dev = dev_3c507; unregister_netdev(dev); free_irq(dev->irq, dev); + iounmap(((struct net_local *)netdev_priv(dev))->base); release_region(dev->base_addr, EL16_IO_EXTENT); free_netdev(dev); } diff -Nru a/drivers/net/8139cp.c b/drivers/net/8139cp.c --- a/drivers/net/8139cp.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/8139cp.c 2004-10-26 18:34:29 -07:00 @@ -54,6 +54,7 @@ #include #include +#include #include #include #include @@ -91,16 +92,17 @@ MODULE_AUTHOR("Jeff Garzik "); MODULE_DESCRIPTION("RealTek RTL-8139C+ series 10/100 PCI Ethernet driver"); +MODULE_VERSION(DRV_VERSION); MODULE_LICENSE("GPL"); static int debug = -1; -MODULE_PARM (debug, "i"); +module_param(debug, int, 0); MODULE_PARM_DESC (debug, "8139cp: bitmapped message enable number"); /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). The RTL chips use a 64 element hash table based on the Ethernet CRC. */ static int multicast_filter_limit = 32; -MODULE_PARM (multicast_filter_limit, "i"); +module_param(multicast_filter_limit, int, 0); MODULE_PARM_DESC (multicast_filter_limit, "8139cp: maximum number of filtered multicast addresses"); #define PFX DRV_NAME ": " @@ -186,6 +188,9 @@ RingEnd = (1 << 30), /* End of descriptor ring */ FirstFrag = (1 << 29), /* First segment of a packet */ LastFrag = (1 << 28), /* Final segment of a packet */ + LargeSend = (1 << 27), /* TCP Large Send Offload (TSO) */ + MSSShift = 16, /* MSS value position */ + MSSMask = 0xfff, /* MSS value: 11 bits */ TxError = (1 << 23), /* Tx error summary */ RxError = (1 << 20), /* Rx error summary */ IPCS = (1 << 18), /* Calculate IP checksum */ @@ -312,7 +317,7 @@ struct ring_info { struct sk_buff *skb; dma_addr_t mapping; - unsigned frag; + u32 len; }; struct cp_dma_stats { @@ -394,10 +399,15 @@ static void __cp_set_rx_mode (struct net_device *dev); static void cp_tx (struct cp_private *cp); static void cp_clean_rings (struct cp_private *cp); +#ifdef CONFIG_NET_POLL_CONTROLLER +static void cp_poll_controller(struct net_device *dev); +#endif static struct pci_device_id cp_pci_tbl[] = { { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, + { PCI_VENDOR_ID_TTTECH, PCI_DEVICE_ID_TTTECH_MC312, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, { }, }; MODULE_DEVICE_TABLE(pci, cp_pci_tbl); @@ -686,6 +696,19 @@ return IRQ_HANDLED; } +#ifdef CONFIG_NET_POLL_CONTROLLER +/* + * Polling receive - used by netconsole and other diagnostic tools + * to allow network i/o with interrupts disabled. + */ +static void cp_poll_controller(struct net_device *dev) +{ + disable_irq(dev->irq); + cp_interrupt(dev->irq, dev, NULL); + enable_irq(dev->irq); +} +#endif + static void cp_tx (struct cp_private *cp) { unsigned tx_head = cp->tx_head; @@ -705,7 +728,7 @@ BUG(); pci_unmap_single(cp->pdev, cp->tx_skb[tx_tail].mapping, - skb->len, PCI_DMA_TODEVICE); + cp->tx_skb[tx_tail].len, PCI_DMA_TODEVICE); if (status & LastFrag) { if (status & (TxError | TxFIFOUnder)) { @@ -747,10 +770,11 @@ { struct cp_private *cp = netdev_priv(dev); unsigned entry; - u32 eor; + u32 eor, flags; #if CP_VLAN_TAG_USED u32 vlan_tag = 0; #endif + int mss = 0; spin_lock_irq(&cp->lock); @@ -770,6 +794,9 @@ entry = cp->tx_head; eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0; + if (dev->features & NETIF_F_TSO) + mss = skb_shinfo(skb)->tso_size; + if (skb_shinfo(skb)->nr_frags == 0) { struct cp_desc *txd = &cp->tx_ring[entry]; u32 len; @@ -781,26 +808,26 @@ txd->addr = cpu_to_le64(mapping); wmb(); - if (skb->ip_summed == CHECKSUM_HW) { + flags = eor | len | DescOwn | FirstFrag | LastFrag; + + if (mss) + flags |= LargeSend | ((mss & MSSMask) << MSSShift); + else if (skb->ip_summed == CHECKSUM_HW) { const struct iphdr *ip = skb->nh.iph; if (ip->protocol == IPPROTO_TCP) - txd->opts1 = cpu_to_le32(eor | len | DescOwn | - FirstFrag | LastFrag | - IPCS | TCPCS); + flags |= IPCS | TCPCS; else if (ip->protocol == IPPROTO_UDP) - txd->opts1 = cpu_to_le32(eor | len | DescOwn | - FirstFrag | LastFrag | - IPCS | UDPCS); + flags |= IPCS | UDPCS; else - BUG(); - } else - txd->opts1 = cpu_to_le32(eor | len | DescOwn | - FirstFrag | LastFrag); + WARN_ON(1); /* we need a WARN() */ + } + + txd->opts1 = cpu_to_le32(flags); wmb(); cp->tx_skb[entry].skb = skb; cp->tx_skb[entry].mapping = mapping; - cp->tx_skb[entry].frag = 0; + cp->tx_skb[entry].len = len; entry = NEXT_TX(entry); } else { struct cp_desc *txd; @@ -818,7 +845,7 @@ first_len, PCI_DMA_TODEVICE); cp->tx_skb[entry].skb = skb; cp->tx_skb[entry].mapping = first_mapping; - cp->tx_skb[entry].frag = 1; + cp->tx_skb[entry].len = first_len; entry = NEXT_TX(entry); for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { @@ -834,16 +861,19 @@ len, PCI_DMA_TODEVICE); eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0; - if (skb->ip_summed == CHECKSUM_HW) { - ctrl = eor | len | DescOwn | IPCS; + ctrl = eor | len | DescOwn; + + if (mss) + ctrl |= LargeSend | + ((mss & MSSMask) << MSSShift); + else if (skb->ip_summed == CHECKSUM_HW) { if (ip->protocol == IPPROTO_TCP) - ctrl |= TCPCS; + ctrl |= IPCS | TCPCS; else if (ip->protocol == IPPROTO_UDP) - ctrl |= UDPCS; + ctrl |= IPCS | UDPCS; else BUG(); - } else - ctrl = eor | len | DescOwn; + } if (frag == skb_shinfo(skb)->nr_frags - 1) ctrl |= LastFrag; @@ -858,7 +888,7 @@ cp->tx_skb[entry].skb = skb; cp->tx_skb[entry].mapping = mapping; - cp->tx_skb[entry].frag = frag + 2; + cp->tx_skb[entry].len = len; entry = NEXT_TX(entry); } @@ -1072,7 +1102,6 @@ cp->rx_skb[i].mapping = pci_map_single(cp->pdev, skb->tail, cp->rx_buf_sz, PCI_DMA_FROMDEVICE); cp->rx_skb[i].skb = skb; - cp->rx_skb[i].frag = 0; cp->rx_ring[i].opts2 = 0; cp->rx_ring[i].addr = cpu_to_le64(cp->rx_skb[i].mapping); @@ -1124,9 +1153,6 @@ { unsigned i; - memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE); - memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE); - for (i = 0; i < CP_RX_RING_SIZE; i++) { if (cp->rx_skb[i].skb) { pci_unmap_single(cp->pdev, cp->rx_skb[i].mapping, @@ -1138,13 +1164,18 @@ for (i = 0; i < CP_TX_RING_SIZE; i++) { if (cp->tx_skb[i].skb) { struct sk_buff *skb = cp->tx_skb[i].skb; + pci_unmap_single(cp->pdev, cp->tx_skb[i].mapping, - skb->len, PCI_DMA_TODEVICE); - dev_kfree_skb(skb); + cp->tx_skb[i].len, PCI_DMA_TODEVICE); + if (le32_to_cpu(cp->tx_ring[i].opts1) & LastFrag) + dev_kfree_skb(skb); cp->net_stats.tx_dropped++; } } + memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE); + memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE); + memset(&cp->rx_skb, 0, sizeof(struct ring_info) * CP_RX_RING_SIZE); memset(&cp->tx_skb, 0, sizeof(struct ring_info) * CP_TX_RING_SIZE); } @@ -1536,6 +1567,8 @@ .set_tx_csum = ethtool_op_set_tx_csum, /* local! */ .get_sg = ethtool_op_get_sg, .set_sg = ethtool_op_set_sg, + .get_tso = ethtool_op_get_tso, + .set_tso = ethtool_op_set_tso, .get_regs = cp_get_regs, .get_wol = cp_get_wol, .set_wol = cp_set_wol, @@ -1747,6 +1780,9 @@ dev->get_stats = cp_get_stats; dev->do_ioctl = cp_ioctl; dev->poll = cp_rx_poll; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = cp_poll_controller; +#endif dev->weight = 16; /* arbitrary? from NAPI_HOWTO.txt. */ #ifdef BROKEN dev->change_mtu = cp_change_mtu; @@ -1765,6 +1801,10 @@ if (pci_using_dac) dev->features |= NETIF_F_HIGHDMA; + +#if 0 /* disabled by default until verified */ + dev->features |= NETIF_F_TSO; +#endif dev->irq = pdev->irq; diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c --- a/drivers/net/8139too.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/8139too.c 2004-10-26 18:34:29 -07:00 @@ -390,8 +390,14 @@ /* Bits in TxConfig. */ enum tx_config_bits { - TxIFG1 = (1 << 25), /* Interframe Gap Time */ - TxIFG0 = (1 << 24), /* Enabling these bits violates IEEE 802.3 */ + + /* Interframe Gap Time. Only TxIFG96 doesn't violate IEEE 802.3 */ + TxIFGShift = 24, + TxIFG84 = (0 << TxIFGShift), /* 8.4us / 840ns (10 / 100Mbps) */ + TxIFG88 = (1 << TxIFGShift), /* 8.8us / 880ns (10 / 100Mbps) */ + TxIFG92 = (2 << TxIFGShift), /* 9.2us / 920ns (10 / 100Mbps) */ + TxIFG96 = (3 << TxIFGShift), /* 9.6us / 960ns (10 / 100Mbps) */ + TxLoopBack = (1 << 18) | (1 << 17), /* enable loopback test mode */ TxCRC = (1 << 16), /* DISABLE appending CRC to end of Tx packets */ TxClearAbt = (1 << 0), /* Clear abort (WO) */ @@ -723,17 +729,14 @@ #endif static const unsigned int rtl8139_tx_config = - (TX_DMA_BURST << TxDMAShift) | (TX_RETRY << TxRetryShift); + TxIFG96 | (TX_DMA_BURST << TxDMAShift) | (TX_RETRY << TxRetryShift); static void __rtl8139_cleanup_dev (struct net_device *dev) { - struct rtl8139_private *tp; + struct rtl8139_private *tp = netdev_priv(dev); struct pci_dev *pdev; assert (dev != NULL); - assert (dev->priv != NULL); - - tp = dev->priv; assert (tp->pci_dev != NULL); pdev = tp->pci_dev; @@ -746,7 +749,7 @@ pci_release_regions (pdev); free_netdev(dev); - + pci_disable_device(pdev); pci_set_drvdata (pdev, NULL); } @@ -785,7 +788,7 @@ *dev_out = NULL; - /* dev and dev->priv zeroed in alloc_etherdev */ + /* dev and priv zeroed in alloc_etherdev */ dev = alloc_etherdev (sizeof (*tp)); if (dev == NULL) { printk (KERN_ERR PFX "%s: Unable to alloc new net device\n", pci_name(pdev)); @@ -794,7 +797,7 @@ SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - tp = dev->priv; + tp = netdev_priv(dev); tp->pci_dev = pdev; /* enable device (incl. PCI PM wakeup and hotplug setup) */ @@ -976,8 +979,8 @@ return i; assert (dev != NULL); - tp = dev->priv; - assert (tp != NULL); + tp = netdev_priv(dev); + ioaddr = tp->mmio_addr; assert (ioaddr != NULL); @@ -1010,8 +1013,8 @@ dev->irq = pdev->irq; - /* dev->priv/tp zeroed and aligned in alloc_etherdev */ - tp = dev->priv; + /* tp zeroed and aligned in alloc_etherdev */ + tp = netdev_priv(dev); /* note: tp->chipset set in rtl8139_init_board */ tp->drv_flags = board_info[ent->driver_data].hw_flags; @@ -1116,11 +1119,8 @@ static void __devexit rtl8139_remove_one (struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata (pdev); - struct rtl8139_private *np; assert (dev != NULL); - np = dev->priv; - assert (np != NULL); unregister_netdev (dev); @@ -1234,7 +1234,7 @@ static int mdio_read (struct net_device *dev, int phy_id, int location) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); int retval = 0; #ifdef CONFIG_8139TOO_8129 void *mdio_addr = tp->mmio_addr + Config4; @@ -1276,7 +1276,7 @@ static void mdio_write (struct net_device *dev, int phy_id, int location, int value) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); #ifdef CONFIG_8139TOO_8129 void *mdio_addr = tp->mmio_addr + Config4; int mii_cmd = (0x5002 << 16) | (phy_id << 23) | (location << 18) | value; @@ -1319,7 +1319,7 @@ static int rtl8139_open (struct net_device *dev) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); int retval; void *ioaddr = tp->mmio_addr; @@ -1367,7 +1367,7 @@ static void rtl_check_media (struct net_device *dev, unsigned int init_media) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); if (tp->phys[0] >= 0) { mii_check_media(&tp->mii, netif_msg_link(tp), init_media); @@ -1377,7 +1377,7 @@ /* Start the hardware at open or resume. */ static void rtl8139_hw_start (struct net_device *dev) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); void *ioaddr = tp->mmio_addr; u32 i; u8 tmp; @@ -1399,8 +1399,6 @@ tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys; RTL_W32 (RxConfig, tp->rx_config); - - /* Check this value: the documentation for IFG contradicts ifself. */ RTL_W32 (TxConfig, rtl8139_tx_config); tp->cur_rx = 0; @@ -1446,7 +1444,7 @@ /* Initialize the Rx and Tx rings, along with various 'dev' bits. */ static void rtl8139_init_ring (struct net_device *dev) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); int i; tp->cur_rx = 0; @@ -1613,7 +1611,7 @@ static int rtl8139_thread (void *data) { struct net_device *dev = data; - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); unsigned long timeout; daemonize("%s", dev->name); @@ -1645,7 +1643,7 @@ static void rtl8139_start_thread(struct net_device *dev) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); tp->thr_pid = -1; tp->twistie = 0; @@ -1673,7 +1671,7 @@ static void rtl8139_tx_timeout (struct net_device *dev) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); void *ioaddr = tp->mmio_addr; int i; u8 tmp8; @@ -1718,7 +1716,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); void *ioaddr = tp->mmio_addr; unsigned int entry; unsigned int len = skb->len; @@ -1766,7 +1764,6 @@ unsigned long dirty_tx, tx_left; assert (dev != NULL); - assert (tp != NULL); assert (ioaddr != NULL); dirty_tx = tp->dirty_tx; @@ -2125,7 +2122,7 @@ static int rtl8139_poll(struct net_device *dev, int *budget) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); void *ioaddr = tp->mmio_addr; int orig_budget = min(*budget, dev->quota); int done = 1; @@ -2163,7 +2160,7 @@ struct pt_regs *regs) { struct net_device *dev = (struct net_device *) dev_instance; - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); void *ioaddr = tp->mmio_addr; u16 status, ackstat; int link_changed = 0; /* avoid bogus "uninit" warning */ @@ -2239,7 +2236,7 @@ static int rtl8139_close (struct net_device *dev) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); void *ioaddr = tp->mmio_addr; int ret = 0; unsigned long flags; @@ -2302,7 +2299,7 @@ other threads or interrupts aren't messing with the 8139. */ static void rtl8139_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); void *ioaddr = np->mmio_addr; spin_lock_irq(&np->lock); @@ -2336,7 +2333,7 @@ aren't messing with the 8139. */ static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); void *ioaddr = np->mmio_addr; u32 support; u8 cfg3, cfg5; @@ -2376,7 +2373,7 @@ static void rtl8139_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); strcpy(info->driver, DRV_NAME); strcpy(info->version, DRV_VERSION); strcpy(info->bus_info, pci_name(np->pci_dev)); @@ -2385,7 +2382,7 @@ static int rtl8139_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); spin_lock_irq(&np->lock); mii_ethtool_gset(&np->mii, cmd); spin_unlock_irq(&np->lock); @@ -2394,7 +2391,7 @@ static int rtl8139_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); int rc; spin_lock_irq(&np->lock); rc = mii_ethtool_sset(&np->mii, cmd); @@ -2404,25 +2401,25 @@ static int rtl8139_nway_reset(struct net_device *dev) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); return mii_nway_restart(&np->mii); } static u32 rtl8139_get_link(struct net_device *dev) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); return mii_link_ok(&np->mii); } static u32 rtl8139_get_msglevel(struct net_device *dev) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); return np->msg_enable; } static void rtl8139_set_msglevel(struct net_device *dev, u32 datum) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); np->msg_enable = datum; } @@ -2433,13 +2430,13 @@ #else static int rtl8139_get_regs_len(struct net_device *dev) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); return np->regs_len; } static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); regs->version = RTL_REGS_VER; @@ -2456,7 +2453,7 @@ static void rtl8139_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); data[0] = np->xstats.early_rx; data[1] = np->xstats.tx_buf_mapped; @@ -2488,7 +2485,7 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - struct rtl8139_private *np = dev->priv; + struct rtl8139_private *np = netdev_priv(dev); int rc; if (!netif_running(dev)) @@ -2504,7 +2501,7 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); void *ioaddr = tp->mmio_addr; unsigned long flags; @@ -2523,7 +2520,7 @@ static void __set_rx_mode (struct net_device *dev) { - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); void *ioaddr = tp->mmio_addr; u32 mc_filter[2]; /* Multicast hash filter */ int i, rx_mode; @@ -2572,7 +2569,7 @@ static void rtl8139_set_rx_mode (struct net_device *dev) { unsigned long flags; - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); spin_lock_irqsave (&tp->lock, flags); __set_rx_mode(dev); @@ -2584,7 +2581,7 @@ static int rtl8139_suspend (struct pci_dev *pdev, u32 state) { struct net_device *dev = pci_get_drvdata (pdev); - struct rtl8139_private *tp = dev->priv; + struct rtl8139_private *tp = netdev_priv(dev); void *ioaddr = tp->mmio_addr; unsigned long flags; diff -Nru a/drivers/net/8390.h b/drivers/net/8390.h --- a/drivers/net/8390.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/8390.h 2004-10-26 18:34:29 -07:00 @@ -52,6 +52,7 @@ void (*block_input)(struct net_device *, int, struct sk_buff *, int); unsigned long rmem_start; unsigned long rmem_end; + void __iomem *mem; unsigned char mcfilter[8]; unsigned open:1; unsigned word16:1; /* We have the 16-bit (vs 8-bit) version of the card. */ diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/Kconfig 2004-10-26 18:34:29 -07:00 @@ -1398,16 +1398,6 @@ will be called eepro100. -config EEPRO100_PIO - bool "Use PIO instead of MMIO" if !X86_VISWS - depends on EEPRO100 - default y if X86_VISWS - help - This instructs the driver to use programmed I/O ports (PIO) instead - of PCI shared memory (MMIO). This can possibly solve some problems - in case your mainboard has memory consistency issues. If unsure, - say N. - config E100 tristate "Intel(R) PRO/100+ support" depends on NET_PCI && PCI @@ -1978,6 +1968,15 @@ information. If in doubt, say N. + +config R8169_VLAN + bool "VLAN support" + depends on R8169 && VLAN_8021Q + ---help--- + Say Y here for the r8169 driver to support the functions required + by the kernel 802.1Q code. + + If in doubt, say Y. config SK98LIN tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support" diff -Nru a/drivers/net/ac3200.c b/drivers/net/ac3200.c --- a/drivers/net/ac3200.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/ac3200.c 2004-10-26 18:34:29 -07:00 @@ -128,8 +128,7 @@ /* Someday free_irq may be in ac_close_card() */ free_irq(dev->irq, dev); release_region(dev->base_addr, AC_IO_EXTENT); - if (ei_status.reg0) - iounmap((void *)dev->mem_start); + iounmap(ei_status.mem); } #ifndef MODULE @@ -237,32 +236,22 @@ /* * BEWARE!! Some dain-bramaged EISA SCUs will allow you to put * the card mem within the region covered by `normal' RAM !!! + * + * ioremap() will fail in that case. */ - if (dev->mem_start > 1024*1024) { /* phys addr > 1MB */ - if (dev->mem_start < virt_to_phys(high_memory)) { - printk(KERN_CRIT "ac3200.c: Card RAM overlaps with normal memory!!!\n"); - printk(KERN_CRIT "ac3200.c: Use EISA SCU to set card memory below 1MB,\n"); - printk(KERN_CRIT "ac3200.c: or to an address above 0x%lx.\n", virt_to_phys(high_memory)); - printk(KERN_CRIT "ac3200.c: Driver NOT installed.\n"); - retval = -EINVAL; - goto out1; - } - dev->mem_start = (unsigned long)ioremap(dev->mem_start, AC_STOP_PG*0x100); - if (dev->mem_start == 0) { - printk(KERN_ERR "ac3200.c: Unable to remap card memory above 1MB !!\n"); - printk(KERN_ERR "ac3200.c: Try using EISA SCU to set memory below 1MB.\n"); - printk(KERN_ERR "ac3200.c: Driver NOT installed.\n"); - retval = -EINVAL; - goto out1; - } - ei_status.reg0 = 1; /* Use as remap flag */ - printk("ac3200.c: remapped %dkB card memory to virtual address %#lx\n", - AC_STOP_PG/4, dev->mem_start); - } - - ei_status.rmem_start = dev->mem_start + TX_PAGES*256; - dev->mem_end = ei_status.rmem_end = dev->mem_start - + (AC_STOP_PG - AC_START_PG)*256; + ei_status.mem = ioremap(dev->mem_start, AC_STOP_PG*0x100); + if (!ei_status.mem) { + printk(KERN_ERR "ac3200.c: Unable to remap card memory above 1MB !!\n"); + printk(KERN_ERR "ac3200.c: Try using EISA SCU to set memory below 1MB.\n"); + printk(KERN_ERR "ac3200.c: Driver NOT installed.\n"); + retval = -EINVAL; + goto out1; + } + printk("ac3200.c: remapped %dkB card memory to virtual address %p\n", + AC_STOP_PG/4, ei_status.mem); + + dev->mem_start = (unsigned long)ei_status.mem; + dev->mem_end = dev->mem_start + (AC_STOP_PG - AC_START_PG)*256; ei_status.name = "AC3200"; ei_status.tx_start_page = AC_START_PG; @@ -324,8 +313,8 @@ static void ac_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) { - unsigned long hdr_start = dev->mem_start + ((ring_page - AC_START_PG)<<8); - isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); + void __iomem *hdr_start = ei_status.mem + ((ring_page - AC_START_PG)<<8); + memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); } /* Block input and output are easy on shared memory ethercards, the only @@ -334,26 +323,27 @@ static void ac_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) { - unsigned long xfer_start = dev->mem_start + ring_offset - (AC_START_PG<<8); + void __iomem *start = ei_status.mem + ring_offset - AC_START_PG*256; - if (xfer_start + count > ei_status.rmem_end) { + if (ring_offset + count > AC_STOP_PG*256) { /* We must wrap the input move. */ - int semi_count = ei_status.rmem_end - xfer_start; - isa_memcpy_fromio(skb->data, xfer_start, semi_count); + int semi_count = AC_STOP_PG*256 - ring_offset; + memcpy_fromio(skb->data, start, semi_count); count -= semi_count; - isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); + memcpy_fromio(skb->data + semi_count, + ei_status.mem + TX_PAGES*256, count); } else { /* Packet is in one chunk -- we can copy + cksum. */ - isa_eth_io_copy_and_sum(skb, xfer_start, count, 0); + eth_io_copy_and_sum(skb, start, count, 0); } } static void ac_block_output(struct net_device *dev, int count, const unsigned char *buf, int start_page) { - unsigned long shmem = dev->mem_start + ((start_page - AC_START_PG)<<8); + void __iomem *shmem = ei_status.mem + ((start_page - AC_START_PG)<<8); - isa_memcpy_toio(shmem, buf, count); + memcpy_toio(shmem, buf, count); } static int ac_close_card(struct net_device *dev) diff -Nru a/drivers/net/atp.c b/drivers/net/atp.c --- a/drivers/net/atp.c 2004-10-26 18:34:30 -07:00 +++ b/drivers/net/atp.c 2004-10-26 18:34:30 -07:00 @@ -909,7 +909,7 @@ i++, mclist = mclist->next) { int filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; - mc_filter[filterbit >> 5] |= cpu_to_le32(1 << (filterbit & 31)); + mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); } new_mode = CMR2h_Normal; } diff -Nru a/drivers/net/depca.c b/drivers/net/depca.c --- a/drivers/net/depca.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/depca.c 2004-10-26 18:34:29 -07:00 @@ -463,11 +463,11 @@ } depca_bus; /* type of bus */ struct depca_init init_block; /* Shadow Initialization block */ /* CPU address space fields */ - struct depca_rx_desc *rx_ring; /* Pointer to start of RX descriptor ring */ - struct depca_tx_desc *tx_ring; /* Pointer to start of TX descriptor ring */ - void *rx_buff[NUM_RX_DESC]; /* CPU virt address of sh'd memory buffs */ - void *tx_buff[NUM_TX_DESC]; /* CPU virt address of sh'd memory buffs */ - void *sh_mem; /* CPU mapped virt address of device RAM */ + struct depca_rx_desc __iomem *rx_ring; /* Pointer to start of RX descriptor ring */ + struct depca_tx_desc __iomem *tx_ring; /* Pointer to start of TX descriptor ring */ + void __iomem *rx_buff[NUM_RX_DESC]; /* CPU virt address of sh'd memory buffs */ + void __iomem *tx_buff[NUM_TX_DESC]; /* CPU virt address of sh'd memory buffs */ + void __iomem *sh_mem; /* CPU mapped virt address of device RAM */ u_long mem_start; /* Bus address of device RAM (before remap) */ u_long mem_len; /* device memory size */ /* Device address space fields */ @@ -693,11 +693,11 @@ /* Tx & Rx descriptors (aligned to a quadword boundary) */ offset = (offset + DEPCA_ALIGN) & ~DEPCA_ALIGN; - lp->rx_ring = (struct depca_rx_desc *) (lp->sh_mem + offset); + lp->rx_ring = (struct depca_rx_desc __iomem *) (lp->sh_mem + offset); lp->rx_ring_offset = offset; offset += (sizeof(struct depca_rx_desc) * NUM_RX_DESC); - lp->tx_ring = (struct depca_tx_desc *) (lp->sh_mem + offset); + lp->tx_ring = (struct depca_tx_desc __iomem *) (lp->sh_mem + offset); lp->tx_ring_offset = offset; offset += (sizeof(struct depca_tx_desc) * NUM_TX_DESC); @@ -1649,7 +1649,7 @@ static int __init DepcaSignature(char *name, u_long base_addr) { u_int i, j, k; - void *ptr; + void __iomem *ptr; char tmpstr[16]; u_long prom_addr = base_addr + 0xc000; u_long mem_addr = base_addr + 0x8000; /* 32KB */ @@ -1876,17 +1876,17 @@ printk("Descriptor addresses (CPU):\nRX: "); for (i = 0; i < lp->rxRingMask; i++) { if (i < 3) { - printk("0x%8.8lx ", (long) &lp->rx_ring[i].base); + printk("%p ", &lp->rx_ring[i].base); } } - printk("...0x%8.8lx\n", (long) &lp->rx_ring[i].base); + printk("...%p\n", &lp->rx_ring[i].base); printk("TX: "); for (i = 0; i < lp->txRingMask; i++) { if (i < 3) { - printk("0x%8.8lx ", (long) &lp->tx_ring[i].base); + printk("%p ", &lp->tx_ring[i].base); } } - printk("...0x%8.8lx\n", (long) &lp->tx_ring[i].base); + printk("...%p\n", &lp->tx_ring[i].base); printk("\nDescriptor buffers (Device):\nRX: "); for (i = 0; i < lp->rxRingMask; i++) { if (i < 3) { diff -Nru a/drivers/net/e2100.c b/drivers/net/e2100.c --- a/drivers/net/e2100.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/e2100.c 2004-10-26 18:34:29 -07:00 @@ -72,7 +72,7 @@ #define E21_SAPROM 0x10 /* Offset to station address data. */ #define E21_IO_EXTENT 0x20 -static inline void mem_on(short port, volatile char *mem_base, +static inline void mem_on(short port, volatile char __iomem *mem_base, unsigned char start_page ) { /* This is a little weird: set the shared memory window by doing a @@ -143,6 +143,7 @@ static void cleanup_card(struct net_device *dev) { /* NB: e21_close() handles free_irq */ + iounmap(ei_status.mem); release_region(dev->base_addr, E21_IO_EXTENT); } @@ -257,6 +258,13 @@ if (dev->mem_start == 0) dev->mem_start = 0xd0000; + ei_status.mem = ioremap(dev->mem_start, 2*1024); + if (!ei_status.mem) { + printk("unable to remap memory\n"); + retval = -EAGAIN; + goto out; + } + #ifdef notdef /* These values are unused. The E2100 has a 2K window into the packet buffer. The window can be set to start on any page boundary. */ @@ -329,7 +337,7 @@ { short ioaddr = dev->base_addr; - char *shared_mem = (char *)dev->mem_start; + char __iomem *shared_mem = ei_status.mem; mem_on(ioaddr, shared_mem, ring_page); @@ -352,12 +360,12 @@ e21_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) { short ioaddr = dev->base_addr; - char *shared_mem = (char *)dev->mem_start; + char __iomem *shared_mem = ei_status.mem; mem_on(ioaddr, shared_mem, (ring_offset>>8)); /* Packet is always in one chunk -- we can copy + cksum. */ - eth_io_copy_and_sum(skb, dev->mem_start + (ring_offset & 0xff), count, 0); + eth_io_copy_and_sum(skb, ei_status.mem + (ring_offset & 0xff), count, 0); mem_off(ioaddr); } @@ -367,7 +375,7 @@ int start_page) { short ioaddr = dev->base_addr; - volatile char *shared_mem = (char *)dev->mem_start; + volatile char __iomem *shared_mem = ei_status.mem; /* Set the shared memory window start by doing a read, with the low address bits specifying the starting page. */ diff -Nru a/drivers/net/eepro100.c b/drivers/net/eepro100.c --- a/drivers/net/eepro100.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/eepro100.c 2004-10-26 18:34:29 -07:00 @@ -114,11 +114,7 @@ #include #include -/* enable PIO instead of MMIO, if CONFIG_EEPRO100_PIO is selected */ -#ifdef CONFIG_EEPRO100_PIO -#define USE_IO 1 -#endif - +static int use_io; static int debug = -1; #define DEBUG_DEFAULT (NETIF_MSG_DRV | \ NETIF_MSG_HW | \ @@ -130,6 +126,7 @@ MODULE_AUTHOR("Maintainer: Andrey V. Savochkin "); MODULE_DESCRIPTION("Intel i82557/i82558/i82559 PCI EtherExpressPro driver"); MODULE_LICENSE("GPL"); +MODULE_PARM(use_io, "i"); MODULE_PARM(debug, "i"); MODULE_PARM(options, "1-" __MODULE_STRING(8) "i"); MODULE_PARM(full_duplex, "1-" __MODULE_STRING(8) "i"); @@ -289,39 +286,13 @@ */ -static int speedo_found1(struct pci_dev *pdev, long ioaddr, int fnd_cnt, int acpi_idle_state); +static int speedo_found1(struct pci_dev *pdev, void __iomem *ioaddr, int fnd_cnt, int acpi_idle_state); enum pci_flags_bit { PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3, }; -static inline unsigned int io_inw(unsigned long port) -{ - return inw(port); -} -static inline void io_outw(unsigned int val, unsigned long port) -{ - outw(val, port); -} - -#ifndef USE_IO -/* Currently alpha headers define in/out macros. - Undefine them. 2000/03/30 SAW */ -#undef inb -#undef inw -#undef inl -#undef outb -#undef outw -#undef outl -#define inb readb -#define inw readw -#define inl readl -#define outb writeb -#define outw writew -#define outl writel -#endif - /* Offsets to the various registers. All accesses need not be longword aligned. */ enum speedo_offsets { @@ -453,6 +424,7 @@ Unfortunately, all the positions have been shifted since there. A new re-alignment is required. 2000/03/06 SAW */ struct speedo_private { + void __iomem *regs; struct TxFD *tx_ring; /* Commands (usually CmdTxPacket). */ struct RxFD *rx_ringp[RX_RING_SIZE]; /* Rx descriptor, used as ring. */ /* The addresses of a Tx/Rx-in-place packets/buffers. */ @@ -520,7 +492,7 @@ static int eepro100_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); -static int do_eeprom_cmd(long ioaddr, int cmd, int cmd_len); +static int do_eeprom_cmd(void __iomem *ioaddr, int cmd, int cmd_len); static int mdio_read(struct net_device *dev, int phy_id, int location); static void mdio_write(struct net_device *dev, int phy_id, int location, int value); static int speedo_open(struct net_device *dev); @@ -551,15 +523,16 @@ /* How to wait for the command unit to accept a command. Typically this takes 0 ticks. */ -static inline unsigned char wait_for_cmd_done(struct net_device *dev) +static inline unsigned char wait_for_cmd_done(struct net_device *dev, + struct speedo_private *sp) { int wait = 1000; - long cmd_ioaddr = dev->base_addr + SCBCmd; + void __iomem *cmd_ioaddr = sp->regs + SCBCmd; unsigned char r; do { udelay(1); - r = inb(cmd_ioaddr); + r = ioread8(cmd_ioaddr); } while(r && --wait >= 0); if (wait < 0) @@ -570,10 +543,11 @@ static int __devinit eepro100_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) { - unsigned long ioaddr; - int irq; + void __iomem *ioaddr; + int irq, pci_bar; int acpi_idle_state = 0, pm; static int cards_found /* = 0 */; + unsigned long pci_base; #ifndef MODULE /* when built-in, we only print version if device is found */ @@ -607,24 +581,17 @@ } irq = pdev->irq; -#ifdef USE_IO - ioaddr = pci_resource_start(pdev, 1); + pci_bar = use_io ? 1 : 0; + pci_base = pci_resource_start(pdev, pci_bar); if (DEBUG & NETIF_MSG_PROBE) - printk("Found Intel i82557 PCI Speedo at I/O %#lx, IRQ %d.\n", - ioaddr, irq); -#else - ioaddr = (unsigned long)ioremap(pci_resource_start(pdev, 0), - pci_resource_len(pdev, 0)); + printk("Found Intel i82557 PCI Speedo at %#lx, IRQ %d.\n", + pci_base, irq); + + ioaddr = pci_iomap(pdev, pci_bar, 0); if (!ioaddr) { - printk (KERN_ERR "eepro100: cannot remap MMIO region %lx @ %lx\n", - pci_resource_len(pdev, 0), pci_resource_start(pdev, 0)); + printk (KERN_ERR "eepro100: cannot remap IO\n"); goto err_out_free_mmio_region; } - if (DEBUG & NETIF_MSG_PROBE) - printk("Found Intel i82557 PCI Speedo, MMIO at %#lx, IRQ %d.\n", - pci_resource_start(pdev, 0), irq); -#endif - if (speedo_found1(pdev, ioaddr, cards_found, acpi_idle_state) == 0) cards_found++; @@ -634,9 +601,7 @@ return 0; err_out_iounmap: ; -#ifndef USE_IO - iounmap ((void *)ioaddr); -#endif + pci_iounmap(pdev, ioaddr); err_out_free_mmio_region: release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); err_out_free_pio_region: @@ -663,7 +628,7 @@ #endif static int __devinit speedo_found1(struct pci_dev *pdev, - long ioaddr, int card_idx, int acpi_idle_state) + void __iomem *ioaddr, int card_idx, int acpi_idle_state) { struct net_device *dev; struct speedo_private *sp; @@ -706,14 +671,16 @@ The size test is for 6 bit vs. 8 bit address serial EEPROMs. */ { - unsigned long iobase; + void __iomem *iobase; int read_cmd, ee_size; u16 sum; int j; /* Use IO only to avoid postponed writes and satisfy EEPROM timing requirements. */ - iobase = pci_resource_start(pdev, 1); + iobase = pci_iomap(pdev, 1, pci_resource_len(pdev, 1)); + if (!iobase) + goto err_free_unlock; if ((do_eeprom_cmd(iobase, EE_READ_CMD << 24, 27) & 0xffe0000) == 0xffe0000) { ee_size = 0x100; @@ -739,13 +706,15 @@ /* Don't unregister_netdev(dev); as the EEPro may actually be usable, especially if the MAC address is set later. On the other hand, it may be unusable if MDI data is corrupted. */ + + pci_iounmap(pdev, iobase); } /* Reset the chip: stop Tx and Rx processes and clear counters. This takes less than 10usec and will easily finish before the next action. */ - outl(PortReset, ioaddr + SCBPort); - inl(ioaddr + SCBPort); + iowrite32(PortReset, ioaddr + SCBPort); + ioread32(ioaddr + SCBPort); udelay(10); if (eeprom[3] & 0x0100) @@ -758,13 +727,12 @@ for (i = 0; i < 5; i++) printk("%2.2X:", dev->dev_addr[i]); printk("%2.2X, ", dev->dev_addr[i]); -#ifdef USE_IO - printk("I/O at %#3lx, ", ioaddr); -#endif printk("IRQ %d.\n", pdev->irq); - /* we must initialize base_addr early, for mdio_{read,write} */ - dev->base_addr = ioaddr; + sp = netdev_priv(dev); + + /* we must initialize this early, for mdio_{read,write} */ + sp->regs = ioaddr; #if 1 || defined(kernel_bloat) /* OK, this is pure kernel bloat. I don't like it when other drivers @@ -811,7 +779,7 @@ self_test_results = (s32*) ((((long) tx_ring_space) + 15) & ~0xf); self_test_results[0] = 0; self_test_results[1] = -1; - outl(tx_ring_dma | PortSelfTest, ioaddr + SCBPort); + iowrite32(tx_ring_dma | PortSelfTest, ioaddr + SCBPort); do { udelay(10); } while (self_test_results[1] == -1 && --boguscnt >= 0); @@ -835,8 +803,8 @@ } #endif /* kernel_bloat */ - outl(PortReset, ioaddr + SCBPort); - inl(ioaddr + SCBPort); + iowrite32(PortReset, ioaddr + SCBPort); + ioread32(ioaddr + SCBPort); udelay(10); /* Return the chip to its original power state. */ @@ -847,7 +815,6 @@ dev->irq = pdev->irq; - sp = netdev_priv(dev); sp->pdev = pdev; sp->msg_enable = DEBUG; sp->acpi_pwr = acpi_idle_state; @@ -910,27 +877,27 @@ return -1; } -static void do_slow_command(struct net_device *dev, int cmd) +static void do_slow_command(struct net_device *dev, struct speedo_private *sp, int cmd) { - long cmd_ioaddr = dev->base_addr + SCBCmd; + void __iomem *cmd_ioaddr = sp->regs + SCBCmd; int wait = 0; do - if (inb(cmd_ioaddr) == 0) break; + if (ioread8(cmd_ioaddr) == 0) break; while(++wait <= 200); if (wait > 100) printk(KERN_ERR "Command %4.4x never accepted (%d polls)!\n", - inb(cmd_ioaddr), wait); + ioread8(cmd_ioaddr), wait); - outb(cmd, cmd_ioaddr); + iowrite8(cmd, cmd_ioaddr); for (wait = 0; wait <= 100; wait++) - if (inb(cmd_ioaddr) == 0) return; + if (ioread8(cmd_ioaddr) == 0) return; for (; wait <= 20000; wait++) - if (inb(cmd_ioaddr) == 0) return; + if (ioread8(cmd_ioaddr) == 0) return; else udelay(1); printk(KERN_ERR "Command %4.4x was not accepted after %d polls!" " Current status %8.8x.\n", - cmd, wait, inl(dev->base_addr + SCBStatus)); + cmd, wait, ioread32(sp->regs + SCBStatus)); } /* Serial EEPROM section. @@ -952,35 +919,36 @@ interval for serial EEPROM. However, it looks like that there is an additional requirement dictating larger udelay's in the code below. 2000/05/24 SAW */ -static int __devinit do_eeprom_cmd(long ioaddr, int cmd, int cmd_len) +static int __devinit do_eeprom_cmd(void __iomem *ioaddr, int cmd, int cmd_len) { unsigned retval = 0; - long ee_addr = ioaddr + SCBeeprom; + void __iomem *ee_addr = ioaddr + SCBeeprom; - io_outw(EE_ENB, ee_addr); udelay(2); - io_outw(EE_ENB | EE_SHIFT_CLK, ee_addr); udelay(2); + iowrite16(EE_ENB, ee_addr); udelay(2); + iowrite16(EE_ENB | EE_SHIFT_CLK, ee_addr); udelay(2); /* Shift the command bits out. */ do { short dataval = (cmd & (1 << cmd_len)) ? EE_WRITE_1 : EE_WRITE_0; - io_outw(dataval, ee_addr); udelay(2); - io_outw(dataval | EE_SHIFT_CLK, ee_addr); udelay(2); - retval = (retval << 1) | ((io_inw(ee_addr) & EE_DATA_READ) ? 1 : 0); + iowrite16(dataval, ee_addr); udelay(2); + iowrite16(dataval | EE_SHIFT_CLK, ee_addr); udelay(2); + retval = (retval << 1) | ((ioread16(ee_addr) & EE_DATA_READ) ? 1 : 0); } while (--cmd_len >= 0); - io_outw(EE_ENB, ee_addr); udelay(2); + iowrite16(EE_ENB, ee_addr); udelay(2); /* Terminate the EEPROM access. */ - io_outw(EE_ENB & ~EE_CS, ee_addr); + iowrite16(EE_ENB & ~EE_CS, ee_addr); return retval; } static int mdio_read(struct net_device *dev, int phy_id, int location) { - long ioaddr = dev->base_addr; + struct speedo_private *sp = netdev_priv(dev); + void __iomem *ioaddr = sp->regs; int val, boguscnt = 64*10; /* <64 usec. to complete, typ 27 ticks */ - outl(0x08000000 | (location<<16) | (phy_id<<21), ioaddr + SCBCtrlMDI); + iowrite32(0x08000000 | (location<<16) | (phy_id<<21), ioaddr + SCBCtrlMDI); do { - val = inl(ioaddr + SCBCtrlMDI); + val = ioread32(ioaddr + SCBCtrlMDI); if (--boguscnt < 0) { printk(KERN_ERR " mdio_read() timed out with val = %8.8x.\n", val); break; @@ -991,12 +959,13 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int value) { - long ioaddr = dev->base_addr; + struct speedo_private *sp = netdev_priv(dev); + void __iomem *ioaddr = sp->regs; int val, boguscnt = 64*10; /* <64 usec. to complete, typ 27 ticks */ - outl(0x04000000 | (location<<16) | (phy_id<<21) | value, + iowrite32(0x04000000 | (location<<16) | (phy_id<<21) | value, ioaddr + SCBCtrlMDI); do { - val = inl(ioaddr + SCBCtrlMDI); + val = ioread32(ioaddr + SCBCtrlMDI); if (--boguscnt < 0) { printk(KERN_ERR" mdio_write() timed out with val = %8.8x.\n", val); break; @@ -1008,7 +977,7 @@ speedo_open(struct net_device *dev) { struct speedo_private *sp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = sp->regs; int retval; if (netif_msg_ifup(sp)) @@ -1052,7 +1021,7 @@ speedo_init_rx_ring(dev); /* Fire up the hardware. */ - outw(SCBMaskAll, ioaddr + SCBCmd); + iowrite16(SCBMaskAll, ioaddr + SCBCmd); speedo_resume(dev); netdevice_start(dev); @@ -1071,7 +1040,7 @@ if (netif_msg_ifup(sp)) { printk(KERN_DEBUG "%s: Done speedo_open(), status %8.8x.\n", - dev->name, inw(ioaddr + SCBStatus)); + dev->name, ioread16(ioaddr + SCBStatus)); } /* Set the timer. The timer serves a dual purpose: @@ -1095,46 +1064,46 @@ static void speedo_resume(struct net_device *dev) { struct speedo_private *sp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = sp->regs; /* Start with a Tx threshold of 256 (0x..20.... 8 byte units). */ sp->tx_threshold = 0x01208000; /* Set the segment registers to '0'. */ - if (wait_for_cmd_done(dev) != 0) { - outl(PortPartialReset, ioaddr + SCBPort); + if (wait_for_cmd_done(dev, sp) != 0) { + iowrite32(PortPartialReset, ioaddr + SCBPort); udelay(10); } - outl(0, ioaddr + SCBPointer); - inl(ioaddr + SCBPointer); /* Flush to PCI. */ + iowrite32(0, ioaddr + SCBPointer); + ioread32(ioaddr + SCBPointer); /* Flush to PCI. */ udelay(10); /* Bogus, but it avoids the bug. */ /* Note: these next two operations can take a while. */ - do_slow_command(dev, RxAddrLoad); - do_slow_command(dev, CUCmdBase); + do_slow_command(dev, sp, RxAddrLoad); + do_slow_command(dev, sp, CUCmdBase); /* Load the statistics block and rx ring addresses. */ - outl(sp->lstats_dma, ioaddr + SCBPointer); - inl(ioaddr + SCBPointer); /* Flush to PCI */ + iowrite32(sp->lstats_dma, ioaddr + SCBPointer); + ioread32(ioaddr + SCBPointer); /* Flush to PCI */ - outb(CUStatsAddr, ioaddr + SCBCmd); + iowrite8(CUStatsAddr, ioaddr + SCBCmd); sp->lstats->done_marker = 0; - wait_for_cmd_done(dev); + wait_for_cmd_done(dev, sp); if (sp->rx_ringp[sp->cur_rx % RX_RING_SIZE] == NULL) { if (netif_msg_rx_err(sp)) printk(KERN_DEBUG "%s: NULL cur_rx in speedo_resume().\n", dev->name); } else { - outl(sp->rx_ring_dma[sp->cur_rx % RX_RING_SIZE], + iowrite32(sp->rx_ring_dma[sp->cur_rx % RX_RING_SIZE], ioaddr + SCBPointer); - inl(ioaddr + SCBPointer); /* Flush to PCI */ + ioread32(ioaddr + SCBPointer); /* Flush to PCI */ } /* Note: RxStart should complete instantly. */ - do_slow_command(dev, RxStart); - do_slow_command(dev, CUDumpStats); + do_slow_command(dev, sp, RxStart); + do_slow_command(dev, sp, CUDumpStats); /* Fill the first command with our physical address. */ { @@ -1153,11 +1122,11 @@ } /* Start the chip's Tx process and unmask interrupts. */ - outl(TX_RING_ELEM_DMA(sp, sp->dirty_tx % TX_RING_SIZE), + iowrite32(TX_RING_ELEM_DMA(sp, sp->dirty_tx % TX_RING_SIZE), ioaddr + SCBPointer); /* We are not ACK-ing FCP and ER in the interrupt handler yet so they should remain masked --Dragan */ - outw(CUStart | SCBMaskEarlyRx | SCBMaskFlowCtl, ioaddr + SCBCmd); + iowrite16(CUStart | SCBMaskEarlyRx | SCBMaskFlowCtl, ioaddr + SCBCmd); } /* @@ -1176,29 +1145,29 @@ { struct speedo_private *sp = netdev_priv(dev); struct RxFD *rfd; - long ioaddr; + void __iomem *ioaddr; - ioaddr = dev->base_addr; - if (wait_for_cmd_done(dev) != 0) { + ioaddr = sp->regs; + if (wait_for_cmd_done(dev, sp) != 0) { printk("%s: previous command stalled\n", dev->name); return; } /* * Put the hardware into a known state. */ - outb(RxAbort, ioaddr + SCBCmd); + iowrite8(RxAbort, ioaddr + SCBCmd); rfd = sp->rx_ringp[sp->cur_rx % RX_RING_SIZE]; rfd->rx_buf_addr = 0xffffffff; - if (wait_for_cmd_done(dev) != 0) { + if (wait_for_cmd_done(dev, sp) != 0) { printk("%s: RxAbort command stalled\n", dev->name); return; } - outl(sp->rx_ring_dma[sp->cur_rx % RX_RING_SIZE], + iowrite32(sp->rx_ring_dma[sp->cur_rx % RX_RING_SIZE], ioaddr + SCBPointer); - outb(RxStart, ioaddr + SCBCmd); + iowrite8(RxStart, ioaddr + SCBCmd); } @@ -1207,7 +1176,7 @@ { struct net_device *dev = (struct net_device *)data; struct speedo_private *sp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = sp->regs; int phy_num = sp->phy[0] & 0x1f; /* We have MII and lost link beat. */ @@ -1230,7 +1199,7 @@ mii_check_link(&sp->mii_if); if (netif_msg_timer(sp)) { printk(KERN_DEBUG "%s: Media control tick, status %4.4x.\n", - dev->name, inw(ioaddr + SCBStatus)); + dev->name, ioread16(ioaddr + SCBStatus)); } if (sp->rx_mode < 0 || (sp->rx_bug && jiffies - sp->last_rx_time > 2*HZ)) { @@ -1277,7 +1246,7 @@ #if 0 { - long ioaddr = dev->base_addr; + void __iomem *ioaddr = sp->regs; int phy_num = sp->phy[0] & 0x1f; for (i = 0; i < 16; i++) { /* FIXME: what does it mean? --SAW */ @@ -1398,14 +1367,14 @@ static void speedo_tx_timeout(struct net_device *dev) { struct speedo_private *sp = netdev_priv(dev); - long ioaddr = dev->base_addr; - int status = inw(ioaddr + SCBStatus); + void __iomem *ioaddr = sp->regs; + int status = ioread16(ioaddr + SCBStatus); unsigned long flags; if (netif_msg_tx_err(sp)) { printk(KERN_WARNING "%s: Transmit timed out: status %4.4x " " %4.4x at %d/%d command %8.8x.\n", - dev->name, status, inw(ioaddr + SCBCmd), + dev->name, status, ioread16(ioaddr + SCBCmd), sp->dirty_tx, sp->cur_tx, sp->tx_ring[sp->dirty_tx % TX_RING_SIZE].status); @@ -1417,9 +1386,9 @@ /* Only the command unit has stopped. */ printk(KERN_WARNING "%s: Trying to restart the transmitter...\n", dev->name); - outl(TX_RING_ELEM_DMA(sp, dirty_tx % TX_RING_SIZE]), + iowrite32(TX_RING_ELEM_DMA(sp, dirty_tx % TX_RING_SIZE]), ioaddr + SCBPointer); - outw(CUStart, ioaddr + SCBCmd); + iowrite16(CUStart, ioaddr + SCBCmd); reset_mii(dev); } else { #else @@ -1427,12 +1396,12 @@ #endif del_timer_sync(&sp->timer); /* Reset the Tx and Rx units. */ - outl(PortReset, ioaddr + SCBPort); + iowrite32(PortReset, ioaddr + SCBPort); /* We may get spurious interrupts here. But I don't think that they may do much harm. 1999/12/09 SAW */ udelay(10); /* Disable interrupts. */ - outw(SCBMaskAll, ioaddr + SCBCmd); + iowrite16(SCBMaskAll, ioaddr + SCBCmd); synchronize_irq(dev->irq); speedo_tx_buffer_gc(dev); /* Free as much as possible. @@ -1460,7 +1429,7 @@ speedo_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct speedo_private *sp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = sp->regs; int entry; /* Prevent interrupts from changing the Tx ring from underneath us. */ @@ -1499,18 +1468,18 @@ /* workaround for hardware bug on 10 mbit half duplex */ if ((sp->partner == 0) && (sp->chip_id == 1)) { - wait_for_cmd_done(dev); - outb(0 , ioaddr + SCBCmd); + wait_for_cmd_done(dev, sp); + iowrite8(0 , ioaddr + SCBCmd); udelay(1); } /* Trigger the command unit resume. */ - wait_for_cmd_done(dev); + wait_for_cmd_done(dev, sp); clear_suspend(sp->last_cmd); /* We want the time window between clearing suspend flag on the previous command and resuming CU to be as small as possible. Interrupts in between are very undesired. --SAW */ - outb(CUResume, ioaddr + SCBCmd); + iowrite8(CUResume, ioaddr + SCBCmd); sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry]; /* Leave room for set_rx_mode(). If there is no more space than reserved @@ -1592,12 +1561,13 @@ { struct net_device *dev = (struct net_device *)dev_instance; struct speedo_private *sp; - long ioaddr, boguscnt = max_interrupt_work; + void __iomem *ioaddr; + long boguscnt = max_interrupt_work; unsigned short status; unsigned int handled = 0; - ioaddr = dev->base_addr; sp = netdev_priv(dev); + ioaddr = sp->regs; #ifndef final_version /* A lock to prevent simultaneous entry on SMP machines. */ @@ -1610,11 +1580,11 @@ #endif do { - status = inw(ioaddr + SCBStatus); + status = ioread16(ioaddr + SCBStatus); /* Acknowledge all of the current interrupt sources ASAP. */ /* Will change from 0xfc00 to 0xff00 when we start handling FCP and ER interrupts --Dragan */ - outw(status & 0xfc00, ioaddr + SCBStatus); + iowrite16(status & 0xfc00, ioaddr + SCBStatus); if (netif_msg_intr(sp)) printk(KERN_DEBUG "%s: interrupt status=%#4.4x.\n", @@ -1674,14 +1644,14 @@ /* Clear all interrupt sources. */ /* Will change from 0xfc00 to 0xff00 when we start handling FCP and ER interrupts --Dragan */ - outw(0xfc00, ioaddr + SCBStatus); + iowrite16(0xfc00, ioaddr + SCBStatus); break; } } while (1); if (netif_msg_intr(sp)) printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n", - dev->name, inw(ioaddr + SCBStatus)); + dev->name, ioread16(ioaddr + SCBStatus)); clear_bit(0, (void*)&sp->in_interrupt); return IRQ_RETVAL(handled); @@ -1900,8 +1870,8 @@ static int speedo_close(struct net_device *dev) { - long ioaddr = dev->base_addr; struct speedo_private *sp = netdev_priv(dev); + void __iomem *ioaddr = sp->regs; int i; netdevice_stop(dev); @@ -1909,16 +1879,16 @@ if (netif_msg_ifdown(sp)) printk(KERN_DEBUG "%s: Shutting down ethercard, status was %4.4x.\n", - dev->name, inw(ioaddr + SCBStatus)); + dev->name, ioread16(ioaddr + SCBStatus)); /* Shut off the media monitoring timer. */ del_timer_sync(&sp->timer); - outw(SCBMaskAll, ioaddr + SCBCmd); + iowrite16(SCBMaskAll, ioaddr + SCBCmd); /* Shutting down the chip nicely fails to disable flow control. So.. */ - outl(PortPartialReset, ioaddr + SCBPort); - inl(ioaddr + SCBPort); /* flush posted write */ + iowrite32(PortPartialReset, ioaddr + SCBPort); + ioread32(ioaddr + SCBPort); /* flush posted write */ /* * The chip requires a 10 microsecond quiet period. Wait here! */ @@ -1980,7 +1950,7 @@ speedo_get_stats(struct net_device *dev) { struct speedo_private *sp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = sp->regs; /* Update only if the previous dump finished. */ if (sp->lstats->done_marker == le32_to_cpu(0xA007)) { @@ -2001,8 +1971,8 @@ /* Take a spinlock to make wait_for_cmd_done and sending the command atomic. --SAW */ spin_lock_irqsave(&sp->lock, flags); - wait_for_cmd_done(dev); - outb(CUDumpStats, ioaddr + SCBCmd); + wait_for_cmd_done(dev, sp); + iowrite8(CUDumpStats, ioaddr + SCBCmd); spin_unlock_irqrestore(&sp->lock, flags); } } @@ -2123,7 +2093,7 @@ static void set_rx_mode(struct net_device *dev) { struct speedo_private *sp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = sp->regs; struct descriptor *last_cmd; char new_rx_mode; unsigned long flags; @@ -2178,9 +2148,9 @@ config_cmd_data[8] = 0; } /* Trigger the command unit resume. */ - wait_for_cmd_done(dev); + wait_for_cmd_done(dev, sp); clear_suspend(last_cmd); - outb(CUResume, ioaddr + SCBCmd); + iowrite8(CUResume, ioaddr + SCBCmd); if ((int)(sp->cur_tx - sp->dirty_tx) >= TX_QUEUE_LIMIT) { netif_stop_queue(dev); sp->tx_full = 1; @@ -2215,10 +2185,10 @@ *setup_params++ = *eaddrs++; } - wait_for_cmd_done(dev); + wait_for_cmd_done(dev, sp); clear_suspend(last_cmd); /* Immediately trigger the command unit resume. */ - outb(CUResume, ioaddr + SCBCmd); + iowrite8(CUResume, ioaddr + SCBCmd); if ((int)(sp->cur_tx - sp->dirty_tx) >= TX_QUEUE_LIMIT) { netif_stop_queue(dev); @@ -2291,10 +2261,10 @@ pci_dma_sync_single_for_device(sp->pdev, mc_blk->frame_dma, mc_blk->len, PCI_DMA_TODEVICE); - wait_for_cmd_done(dev); + wait_for_cmd_done(dev, sp); clear_suspend(last_cmd); /* Immediately trigger the command unit resume. */ - outb(CUResume, ioaddr + SCBCmd); + iowrite8(CUResume, ioaddr + SCBCmd); if ((int)(sp->cur_tx - sp->dirty_tx) >= TX_QUEUE_LIMIT) { netif_stop_queue(dev); @@ -2315,7 +2285,7 @@ { struct net_device *dev = pci_get_drvdata (pdev); struct speedo_private *sp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = sp->regs; pci_save_state(pdev); @@ -2325,7 +2295,7 @@ del_timer_sync(&sp->timer); netif_device_detach(dev); - outl(PortPartialReset, ioaddr + SCBPort); + iowrite32(PortPartialReset, ioaddr + SCBPort); /* XXX call pci_set_power_state ()? */ return 0; @@ -2335,7 +2305,7 @@ { struct net_device *dev = pci_get_drvdata (pdev); struct speedo_private *sp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = sp->regs; pci_restore_state(pdev); @@ -2349,7 +2319,7 @@ reinitialization; - serialization with other driver calls. 2000/03/08 SAW */ - outw(SCBMaskAll, ioaddr + SCBCmd); + iowrite16(SCBMaskAll, ioaddr + SCBCmd); speedo_resume(dev); netif_device_attach(dev); sp->rx_mode = -1; @@ -2371,10 +2341,7 @@ release_region(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1)); release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); -#ifndef USE_IO - iounmap((char *)dev->base_addr); -#endif - + pci_iounmap(pdev, sp->regs); pci_free_consistent(pdev, TX_RING_SIZE * sizeof(struct TxFD) + sizeof(struct speedo_stats), sp->tx_ring, sp->tx_ring_dma); diff -Nru a/drivers/net/fealnx.c b/drivers/net/fealnx.c --- a/drivers/net/fealnx.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/fealnx.c 2004-10-26 18:34:29 -07:00 @@ -102,21 +102,6 @@ #define USE_IO_OPS #endif -#ifdef USE_IO_OPS -#undef readb -#undef readw -#undef readl -#undef writeb -#undef writew -#undef writel -#define readb inb -#define readw inw -#define readl inl -#define writeb outb -#define writew outw -#define writel outl -#endif - /* Kernel compatibility defines, some common to David Hinds' PCMCIA package. */ /* This is only in the support-all-kernels source code. */ @@ -444,6 +429,7 @@ int mii_cnt; /* MII device addresses. */ unsigned char phys[2]; /* MII device addresses. */ struct mii_if_info mii; + void __iomem *mem; }; @@ -468,23 +454,23 @@ static void reset_rx_descriptors(struct net_device *dev); static void reset_tx_descriptors(struct net_device *dev); -static void stop_nic_rx(long ioaddr, long crvalue) +static void stop_nic_rx(void __iomem *ioaddr, long crvalue) { int delay = 0x1000; - writel(crvalue & ~(CR_W_RXEN), ioaddr + TCRRCR); + iowrite32(crvalue & ~(CR_W_RXEN), ioaddr + TCRRCR); while (--delay) { - if ( (readl(ioaddr + TCRRCR) & CR_R_RXSTOP) == CR_R_RXSTOP) + if ( (ioread32(ioaddr + TCRRCR) & CR_R_RXSTOP) == CR_R_RXSTOP) break; } } -static void stop_nic_rxtx(long ioaddr, long crvalue) +static void stop_nic_rxtx(void __iomem *ioaddr, long crvalue) { int delay = 0x1000; - writel(crvalue & ~(CR_W_RXEN+CR_W_TXEN), ioaddr + TCRRCR); + iowrite32(crvalue & ~(CR_W_RXEN+CR_W_TXEN), ioaddr + TCRRCR); while (--delay) { - if ( (readl(ioaddr + TCRRCR) & (CR_R_RXSTOP+CR_R_TXSTOP)) + if ( (ioread32(ioaddr + TCRRCR) & (CR_R_RXSTOP+CR_R_TXSTOP)) == (CR_R_RXSTOP+CR_R_TXSTOP) ) break; } @@ -498,11 +484,17 @@ int i, option, err, irq; static int card_idx = -1; char boardname[12]; - long ioaddr; + void __iomem *ioaddr; + unsigned long len; unsigned int chip_id = ent->driver_data; struct net_device *dev; void *ring_space; dma_addr_t ring_dma; +#ifdef USE_IO_OPS + int bar = 0; +#else + int bar = 1; +#endif /* when built into the kernel, we only print version if device is found */ #ifndef MODULE @@ -520,14 +512,10 @@ if (i) return i; pci_set_master(pdev); -#ifdef USE_IO_OPS - ioaddr = pci_resource_len(pdev, 0); -#else - ioaddr = pci_resource_len(pdev, 1); -#endif - if (ioaddr < MIN_REGION_SIZE) { + len = pci_resource_len(pdev, bar); + if (len < MIN_REGION_SIZE) { printk(KERN_ERR "%s: region size %ld too small, aborting\n", - boardname, ioaddr); + boardname, len); return -ENODEV; } @@ -536,17 +524,12 @@ irq = pdev->irq; -#ifdef USE_IO_OPS - ioaddr = pci_resource_start(pdev, 0); -#else - ioaddr = (long) ioremap(pci_resource_start(pdev, 1), - pci_resource_len(pdev, 1)); + ioaddr = pci_iomap(pdev, bar, len); if (!ioaddr) { err = -ENOMEM; goto err_out_res; } -#endif - + dev = alloc_etherdev(sizeof(struct netdev_private)); if (!dev) { err = -ENOMEM; @@ -557,16 +540,17 @@ /* read ethernet id */ for (i = 0; i < 6; ++i) - dev->dev_addr[i] = readb(ioaddr + PAR0 + i); + dev->dev_addr[i] = ioread8(ioaddr + PAR0 + i); /* Reset the chip to erase previous misconfiguration. */ - writel(0x00000001, ioaddr + BCR); + iowrite32(0x00000001, ioaddr + BCR); - dev->base_addr = ioaddr; + dev->base_addr = (unsigned long)ioaddr; dev->irq = irq; /* Make certain the descriptor lists are aligned. */ - np = dev->priv; + np = netdev_priv(dev); + np->mem = ioaddr; spin_lock_init(&np->lock); np->pci_dev = pdev; np->flags = skel_netdrv_tbl[chip_id].flags; @@ -635,7 +619,7 @@ np->phys[0] = 32; /* 89/6/23 add, (begin) */ /* get phy type */ - if (readl(ioaddr + PHYIDENTIFIER) == MysonPHYID) + if (ioread32(ioaddr + PHYIDENTIFIER) == MysonPHYID) np->PHYType = MysonPHY; else np->PHYType = OtherPHY; @@ -670,7 +654,7 @@ if (np->flags == HAS_MII_XCVR) mdio_write(dev, np->phys[0], MII_ADVERTISE, ADVERTISE_FULL); else - writel(ADVERTISE_FULL, ioaddr + ANARANLPAR); + iowrite32(ADVERTISE_FULL, ioaddr + ANARANLPAR); np->mii.force_media = 1; } @@ -689,7 +673,7 @@ if (err) goto err_out_free_tx; - printk(KERN_INFO "%s: %s at 0x%lx, ", + printk(KERN_INFO "%s: %s at %p, ", dev->name, skel_netdrv_tbl[chip_id].chip_name, ioaddr); for (i = 0; i < 5; i++) printk("%2.2x:", dev->dev_addr[i]); @@ -704,10 +688,8 @@ err_out_free_dev: free_netdev(dev); err_out_unmap: -#ifndef USE_IO_OPS - iounmap((void *)ioaddr); + pci_iounmap(pdev, ioaddr); err_out_res: -#endif pci_release_regions(pdev); return err; } @@ -718,16 +700,14 @@ struct net_device *dev = pci_get_drvdata(pdev); if (dev) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); pci_free_consistent(pdev, TX_TOTAL_SIZE, np->tx_ring, np->tx_ring_dma); pci_free_consistent(pdev, RX_TOTAL_SIZE, np->rx_ring, np->rx_ring_dma); unregister_netdev(dev); -#ifndef USE_IO_OPS - iounmap((void *)dev->base_addr); -#endif + pci_iounmap(pdev, np->mem); free_netdev(dev); pci_release_regions(pdev); pci_set_drvdata(pdev, NULL); @@ -736,14 +716,14 @@ } -static ulong m80x_send_cmd_to_phy(long miiport, int opcode, int phyad, int regad) +static ulong m80x_send_cmd_to_phy(void __iomem *miiport, int opcode, int phyad, int regad) { ulong miir; int i; unsigned int mask, data; /* enable MII output */ - miir = (ulong) readl(miiport); + miir = (ulong) ioread32(miiport); miir &= 0xfffffff0; miir |= MASK_MIIR_MII_WRITE + MASK_MIIR_MII_MDO; @@ -752,11 +732,11 @@ for (i = 0; i < 32; i++) { /* low MDC; MDO is already high (miir) */ miir &= ~MASK_MIIR_MII_MDC; - writel(miir, miiport); + iowrite32(miir, miiport); /* high MDC */ miir |= MASK_MIIR_MII_MDC; - writel(miir, miiport); + iowrite32(miir, miiport); } /* calculate ST+OP+PHYAD+REGAD+TA */ @@ -770,10 +750,10 @@ if (mask & data) miir |= MASK_MIIR_MII_MDO; - writel(miir, miiport); + iowrite32(miir, miiport); /* high MDC */ miir |= MASK_MIIR_MII_MDC; - writel(miir, miiport); + iowrite32(miir, miiport); udelay(30); /* next */ @@ -787,7 +767,8 @@ static int mdio_read(struct net_device *dev, int phyad, int regad) { - long miiport = dev->base_addr + MANAGEMENT; + struct netdev_private *np = netdev_priv(dev); + void __iomem *miiport = np->mem + MANAGEMENT; ulong miir; unsigned int mask, data; @@ -799,16 +780,16 @@ while (mask) { /* low MDC */ miir &= ~MASK_MIIR_MII_MDC; - writel(miir, miiport); + iowrite32(miir, miiport); /* read MDI */ - miir = readl(miiport); + miir = ioread32(miiport); if (miir & MASK_MIIR_MII_MDI) data |= mask; /* high MDC, and wait */ miir |= MASK_MIIR_MII_MDC; - writel(miir, miiport); + iowrite32(miir, miiport); udelay(30); /* next */ @@ -817,7 +798,7 @@ /* low MDC */ miir &= ~MASK_MIIR_MII_MDC; - writel(miir, miiport); + iowrite32(miir, miiport); return data & 0xffff; } @@ -825,7 +806,8 @@ static void mdio_write(struct net_device *dev, int phyad, int regad, int data) { - long miiport = dev->base_addr + MANAGEMENT; + struct netdev_private *np = netdev_priv(dev); + void __iomem *miiport = np->mem + MANAGEMENT; ulong miir; unsigned int mask; @@ -838,11 +820,11 @@ miir &= ~(MASK_MIIR_MII_MDC + MASK_MIIR_MII_MDO); if (mask & data) miir |= MASK_MIIR_MII_MDO; - writel(miir, miiport); + iowrite32(miir, miiport); /* high MDC */ miir |= MASK_MIIR_MII_MDC; - writel(miir, miiport); + iowrite32(miir, miiport); /* next */ mask >>= 1; @@ -850,29 +832,29 @@ /* low MDC */ miir &= ~MASK_MIIR_MII_MDC; - writel(miir, miiport); + iowrite32(miir, miiport); } static int netdev_open(struct net_device *dev) { - struct netdev_private *np = dev->priv; - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; int i; - writel(0x00000001, ioaddr + BCR); /* Reset */ + iowrite32(0x00000001, ioaddr + BCR); /* Reset */ if (request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev)) return -EAGAIN; for (i = 0; i < 3; i++) - writew(((unsigned short*)dev->dev_addr)[i], + iowrite16(((unsigned short*)dev->dev_addr)[i], ioaddr + PAR0 + i*2); init_ring(dev); - writel(np->rx_ring_dma, ioaddr + RXLBA); - writel(np->tx_ring_dma, ioaddr + TXLBA); + iowrite32(np->rx_ring_dma, ioaddr + RXLBA); + iowrite32(np->tx_ring_dma, ioaddr + TXLBA); /* Initialize other registers. */ /* Configure the PCI bus bursts and FIFO thresholds. @@ -933,12 +915,12 @@ np->crvalue |= CR_W_ENH; /* set enhanced bit */ np->imrvalue |= ETI; } - writel(np->bcrvalue, ioaddr + BCR); + iowrite32(np->bcrvalue, ioaddr + BCR); if (dev->if_port == 0) dev->if_port = np->default_port; - writel(0, ioaddr + RXPDR); + iowrite32(0, ioaddr + RXPDR); // 89/9/1 modify, // np->crvalue = 0x00e40001; /* tx store and forward, tx/rx enable */ np->crvalue |= 0x00e40001; /* tx store and forward, tx/rx enable */ @@ -951,8 +933,8 @@ netif_start_queue(dev); /* Clear and Enable interrupts by setting the interrupt mask. */ - writel(FBE | TUNF | CNTOVF | RBU | TI | RI, ioaddr + ISR); - writel(np->imrvalue, ioaddr + IMR); + iowrite32(FBE | TUNF | CNTOVF | RBU | TI | RI, ioaddr + ISR); + iowrite32(np->imrvalue, ioaddr + IMR); if (debug) printk(KERN_DEBUG "%s: Done netdev_open().\n", dev->name); @@ -980,14 +962,14 @@ /* input : dev... pointer to the adapter block. */ /* output : none. */ { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); unsigned int i, DelayTime = 0x1000; np->linkok = 0; if (np->PHYType == MysonPHY) { for (i = 0; i < DelayTime; ++i) { - if (readl(dev->base_addr + BMCRSR) & LinkIsUp2) { + if (ioread32(np->mem + BMCRSR) & LinkIsUp2) { np->linkok = 1; return; } @@ -1007,14 +989,14 @@ static void getlinktype(struct net_device *dev) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); if (np->PHYType == MysonPHY) { /* 3-in-1 case */ - if (readl(dev->base_addr + TCRRCR) & CR_R_FD) + if (ioread32(np->mem + TCRRCR) & CR_R_FD) np->duplexmode = 2; /* full duplex */ else np->duplexmode = 1; /* half duplex */ - if (readl(dev->base_addr + TCRRCR) & CR_R_PS10) + if (ioread32(np->mem + TCRRCR) & CR_R_PS10) np->line_speed = 1; /* 10M */ else np->line_speed = 2; /* 100M */ @@ -1110,7 +1092,7 @@ /* Take lock before calling this */ static void allocate_rx_buffers(struct net_device *dev) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); /* allocate skb for rx buffers */ while (np->really_rx_count != RX_RING_SIZE) { @@ -1136,16 +1118,16 @@ static void netdev_timer(unsigned long data) { struct net_device *dev = (struct net_device *) data; - struct netdev_private *np = dev->priv; - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; int old_crvalue = np->crvalue; unsigned int old_linkok = np->linkok; unsigned long flags; if (debug) printk(KERN_DEBUG "%s: Media selection timer tick, status %8.8x " - "config %8.8x.\n", dev->name, readl(ioaddr + ISR), - readl(ioaddr + TCRRCR)); + "config %8.8x.\n", dev->name, ioread32(ioaddr + ISR), + ioread32(ioaddr + TCRRCR)); spin_lock_irqsave(&np->lock, flags); @@ -1155,7 +1137,7 @@ getlinktype(dev); if (np->crvalue != old_crvalue) { stop_nic_rxtx(ioaddr, np->crvalue); - writel(np->crvalue, ioaddr + TCRRCR); + iowrite32(np->crvalue, ioaddr + TCRRCR); } } } @@ -1173,22 +1155,23 @@ /* Reset chip and disable rx, tx and interrupts */ static void reset_and_disable_rxtx(struct net_device *dev) { - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; int delay=51; /* Reset the chip's Tx and Rx processes. */ stop_nic_rxtx(ioaddr, 0); /* Disable interrupts by clearing the interrupt mask. */ - writel(0, ioaddr + IMR); + iowrite32(0, ioaddr + IMR); /* Reset the chip to erase previous misconfiguration. */ - writel(0x00000001, ioaddr + BCR); + iowrite32(0x00000001, ioaddr + BCR); /* Ueimor: wait for 50 PCI cycles (and flush posted writes btw). We surely wait too long (address+data phase). Who cares? */ while (--delay) { - readl(ioaddr + BCR); + ioread32(ioaddr + BCR); rmb(); } } @@ -1198,33 +1181,33 @@ /* Restore chip after reset */ static void enable_rxtx(struct net_device *dev) { - struct netdev_private *np = dev->priv; - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; reset_rx_descriptors(dev); - writel(np->tx_ring_dma + ((char*)np->cur_tx - (char*)np->tx_ring), + iowrite32(np->tx_ring_dma + ((char*)np->cur_tx - (char*)np->tx_ring), ioaddr + TXLBA); - writel(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring), + iowrite32(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring), ioaddr + RXLBA); - writel(np->bcrvalue, ioaddr + BCR); + iowrite32(np->bcrvalue, ioaddr + BCR); - writel(0, ioaddr + RXPDR); + iowrite32(0, ioaddr + RXPDR); __set_rx_mode(dev); /* changes np->crvalue, writes it into TCRRCR */ /* Clear and Enable interrupts by setting the interrupt mask. */ - writel(FBE | TUNF | CNTOVF | RBU | TI | RI, ioaddr + ISR); - writel(np->imrvalue, ioaddr + IMR); + iowrite32(FBE | TUNF | CNTOVF | RBU | TI | RI, ioaddr + ISR); + iowrite32(np->imrvalue, ioaddr + IMR); - writel(0, ioaddr + TXPDR); + iowrite32(0, ioaddr + TXPDR); } static void reset_timer(unsigned long data) { struct net_device *dev = (struct net_device *) data; - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); unsigned long flags; printk(KERN_WARNING "%s: resetting tx and rx machinery\n", dev->name); @@ -1247,13 +1230,13 @@ static void tx_timeout(struct net_device *dev) { - struct netdev_private *np = dev->priv; - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; unsigned long flags; int i; printk(KERN_WARNING "%s: Transmit timed out, status %8.8x," - " resetting...\n", dev->name, readl(ioaddr + ISR)); + " resetting...\n", dev->name, ioread32(ioaddr + ISR)); { printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); @@ -1282,7 +1265,7 @@ /* Initialize the Rx and Tx rings, along with various 'dev' bits. */ static void init_ring(struct net_device *dev) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); int i; /* initialize rx variables */ @@ -1346,7 +1329,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); unsigned long flags; spin_lock_irqsave(&np->lock, flags); @@ -1413,7 +1396,7 @@ if (np->free_tx_count < 2) netif_stop_queue(dev); ++np->really_tx_count; - writel(0, dev->base_addr + TXPDR); + iowrite32(0, np->mem + TXPDR); dev->trans_start = jiffies; spin_unlock_irqrestore(&np->lock, flags); @@ -1425,7 +1408,7 @@ /* Chip probably hosed tx ring. Clean up. */ static void reset_tx_descriptors(struct net_device *dev) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); struct fealnx_desc *cur; int i; @@ -1460,7 +1443,7 @@ /* Take lock and stop rx before calling this */ static void reset_rx_descriptors(struct net_device *dev) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); struct fealnx_desc *cur = np->cur_rx; int i; @@ -1472,8 +1455,8 @@ cur = cur->next_desc_logical; } - writel(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring), - dev->base_addr + RXLBA); + iowrite32(np->rx_ring_dma + ((char*)np->cur_rx - (char*)np->rx_ring), + np->mem + RXLBA); } @@ -1482,21 +1465,21 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = (struct net_device *) dev_instance; - struct netdev_private *np = dev->priv; - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; long boguscnt = max_interrupt_work; unsigned int num_tx = 0; int handled = 0; spin_lock(&np->lock); - writel(0, ioaddr + IMR); + iowrite32(0, ioaddr + IMR); do { - u32 intr_status = readl(ioaddr + ISR); + u32 intr_status = ioread32(ioaddr + ISR); /* Acknowledge all of the current interrupt sources ASAP. */ - writel(intr_status, ioaddr + ISR); + iowrite32(intr_status, ioaddr + ISR); if (debug) printk(KERN_DEBUG "%s: Interrupt, status %4.4x.\n", dev->name, @@ -1517,15 +1500,15 @@ // }; if (intr_status & TUNF) - writel(0, ioaddr + TXPDR); + iowrite32(0, ioaddr + TXPDR); if (intr_status & CNTOVF) { /* missed pkts */ - np->stats.rx_missed_errors += readl(ioaddr + TALLY) & 0x7fff; + np->stats.rx_missed_errors += ioread32(ioaddr + TALLY) & 0x7fff; /* crc error */ np->stats.rx_crc_errors += - (readl(ioaddr + TALLY) & 0x7fff0000) >> 16; + (ioread32(ioaddr + TALLY) & 0x7fff0000) >> 16; } if (intr_status & (RI | RBU)) { @@ -1534,7 +1517,7 @@ else { stop_nic_rx(ioaddr, np->crvalue); reset_rx_descriptors(dev); - writel(np->crvalue, ioaddr + TCRRCR); + iowrite32(np->crvalue, ioaddr + TCRRCR); } } @@ -1605,7 +1588,7 @@ if (np->crvalue & CR_W_ENH) { long data; - data = readl(ioaddr + TSR); + data = ioread32(ioaddr + TSR); np->stats.tx_errors += (data & 0xff000000) >> 24; np->stats.tx_aborted_errors += (data & 0xff000000) >> 24; np->stats.tx_window_errors += (data & 0x00ff0000) >> 16; @@ -1635,16 +1618,16 @@ /* read the tally counters */ /* missed pkts */ - np->stats.rx_missed_errors += readl(ioaddr + TALLY) & 0x7fff; + np->stats.rx_missed_errors += ioread32(ioaddr + TALLY) & 0x7fff; /* crc error */ - np->stats.rx_crc_errors += (readl(ioaddr + TALLY) & 0x7fff0000) >> 16; + np->stats.rx_crc_errors += (ioread32(ioaddr + TALLY) & 0x7fff0000) >> 16; if (debug) printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n", - dev->name, readl(ioaddr + ISR)); + dev->name, ioread32(ioaddr + ISR)); - writel(np->imrvalue, ioaddr + IMR); + iowrite32(np->imrvalue, ioaddr + IMR); spin_unlock(&np->lock); @@ -1656,8 +1639,8 @@ for clarity and better register allocation. */ static int netdev_rx(struct net_device *dev) { - struct netdev_private *np = dev->priv; - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; /* If EOP is set on the next entry, it's a new packet. Send it up. */ while (!(np->cur_rx->status & RXOWN) && np->cur_rx->skbuff) { @@ -1725,7 +1708,7 @@ } else { /* rx error, need to reset this chip */ stop_nic_rx(ioaddr, np->crvalue); reset_rx_descriptors(dev); - writel(np->crvalue, ioaddr + TCRRCR); + iowrite32(np->crvalue, ioaddr + TCRRCR); } break; /* exit the while loop */ } @@ -1793,13 +1776,13 @@ static struct net_device_stats *get_stats(struct net_device *dev) { - long ioaddr = dev->base_addr; - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; /* The chip only need report frame silently dropped. */ if (netif_running(dev)) { - np->stats.rx_missed_errors += readl(ioaddr + TALLY) & 0x7fff; - np->stats.rx_crc_errors += (readl(ioaddr + TALLY) & 0x7fff0000) >> 16; + np->stats.rx_missed_errors += ioread32(ioaddr + TALLY) & 0x7fff; + np->stats.rx_crc_errors += (ioread32(ioaddr + TALLY) & 0x7fff0000) >> 16; } return &np->stats; @@ -1809,7 +1792,7 @@ /* for dev->set_multicast_list */ static void set_rx_mode(struct net_device *dev) { - spinlock_t *lp = &((struct netdev_private *)dev->priv)->lock; + spinlock_t *lp = &((struct netdev_private *)netdev_priv(dev))->lock; unsigned long flags; spin_lock_irqsave(lp, flags); __set_rx_mode(dev); @@ -1820,8 +1803,8 @@ /* Take lock before calling */ static void __set_rx_mode(struct net_device *dev) { - struct netdev_private *np = dev->priv; - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; u32 mc_filter[2]; /* Multicast hash filter */ u32 rx_mode; @@ -1851,16 +1834,16 @@ stop_nic_rxtx(ioaddr, np->crvalue); - writel(mc_filter[0], ioaddr + MAR0); - writel(mc_filter[1], ioaddr + MAR1); + iowrite32(mc_filter[0], ioaddr + MAR0); + iowrite32(mc_filter[1], ioaddr + MAR1); np->crvalue &= ~CR_W_RXMODEMASK; np->crvalue |= rx_mode; - writel(np->crvalue, ioaddr + TCRRCR); + iowrite32(np->crvalue, ioaddr + TCRRCR); } static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); strcpy(info->driver, DRV_NAME); strcpy(info->version, DRV_VERSION); @@ -1869,7 +1852,7 @@ static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); int rc; spin_lock_irq(&np->lock); @@ -1881,7 +1864,7 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); int rc; spin_lock_irq(&np->lock); @@ -1893,13 +1876,13 @@ static int netdev_nway_reset(struct net_device *dev) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); return mii_nway_restart(&np->mii); } static u32 netdev_get_link(struct net_device *dev) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); return mii_link_ok(&np->mii); } @@ -1927,7 +1910,7 @@ static int mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); int rc; if (!netif_running(dev)) @@ -1943,14 +1926,14 @@ static int netdev_close(struct net_device *dev) { - long ioaddr = dev->base_addr; - struct netdev_private *np = dev->priv; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mem; int i; netif_stop_queue(dev); /* Disable interrupts by clearing the interrupt mask. */ - writel(0x0000, ioaddr + IMR); + iowrite32(0x0000, ioaddr + IMR); /* Stop the chip's Tx and Rx processes. */ stop_nic_rxtx(ioaddr, 0); diff -Nru a/drivers/net/lne390.c b/drivers/net/lne390.c --- a/drivers/net/lne390.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/lne390.c 2004-10-26 18:34:29 -07:00 @@ -149,8 +149,7 @@ { free_irq(dev->irq, dev); release_region(dev->base_addr, LNE390_IO_EXTENT); - if (ei_status.reg0) - iounmap((void *)dev->mem_start); + iounmap(ei_status.mem); } #ifndef MODULE @@ -257,32 +256,22 @@ /* BEWARE!! Some dain-bramaged EISA SCUs will allow you to put the card mem within the region covered by `normal' RAM !!! + + ioremap() will fail in that case. */ - if (dev->mem_start > 1024*1024) { /* phys addr > 1MB */ - if (dev->mem_start < virt_to_phys(high_memory)) { - printk(KERN_CRIT "lne390.c: Card RAM overlaps with normal memory!!!\n"); - printk(KERN_CRIT "lne390.c: Use EISA SCU to set card memory below 1MB,\n"); - printk(KERN_CRIT "lne390.c: or to an address above 0x%lx.\n", virt_to_phys(high_memory)); - printk(KERN_CRIT "lne390.c: Driver NOT installed.\n"); - ret = -EINVAL; - goto cleanup; - } - dev->mem_start = (unsigned long)ioremap(dev->mem_start, LNE390_STOP_PG*0x100); - if (dev->mem_start == 0) { - printk(KERN_ERR "lne390.c: Unable to remap card memory above 1MB !!\n"); - printk(KERN_ERR "lne390.c: Try using EISA SCU to set memory below 1MB.\n"); - printk(KERN_ERR "lne390.c: Driver NOT installed.\n"); - ret = -EAGAIN; - goto cleanup; - } - ei_status.reg0 = 1; /* Use as remap flag */ - printk("lne390.c: remapped %dkB card memory to virtual address %#lx\n", - LNE390_STOP_PG/4, dev->mem_start); - } - - dev->mem_end = ei_status.rmem_end = dev->mem_start - + (LNE390_STOP_PG - LNE390_START_PG)*256; - ei_status.rmem_start = dev->mem_start + TX_PAGES*256; + ei_status.mem = ioremap(dev->mem_start, LNE390_STOP_PG*0x100); + if (!ei_status.mem) { + printk(KERN_ERR "lne390.c: Unable to remap card memory above 1MB !!\n"); + printk(KERN_ERR "lne390.c: Try using EISA SCU to set memory below 1MB.\n"); + printk(KERN_ERR "lne390.c: Driver NOT installed.\n"); + ret = -EAGAIN; + goto cleanup; + } + printk("lne390.c: remapped %dkB card memory to virtual address %p\n", + LNE390_STOP_PG/4, ei_status.mem); + + dev->mem_start = (unsigned long)ei_status.mem; + dev->mem_end = dev->mem_start + (LNE390_STOP_PG - LNE390_START_PG)*256; /* The 8390 offset is zero for the LNE390 */ dev->base_addr = ioaddr; @@ -352,8 +341,8 @@ static void lne390_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) { - unsigned long hdr_start = dev->mem_start + ((ring_page - LNE390_START_PG)<<8); - isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); + void __iomem *hdr_start = ei_status.mem + ((ring_page - LNE390_START_PG)<<8); + memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); hdr->count = (hdr->count + 3) & ~3; /* Round up allocation. */ } @@ -366,27 +355,28 @@ static void lne390_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) { - unsigned long xfer_start = dev->mem_start + ring_offset - (LNE390_START_PG<<8); + void __iomem *xfer_start = ei_status.mem + ring_offset - (LNE390_START_PG<<8); - if (xfer_start + count > ei_status.rmem_end) { + if (ring_offset + count > (LNE390_STOP_PG<<8)) { /* Packet wraps over end of ring buffer. */ - int semi_count = ei_status.rmem_end - xfer_start; - isa_memcpy_fromio(skb->data, xfer_start, semi_count); + int semi_count = (LNE390_STOP_PG<<8) - ring_offset; + memcpy_fromio(skb->data, xfer_start, semi_count); count -= semi_count; - isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); + memcpy_fromio(skb->data + semi_count, + ei_status.mem + (TX_PAGES<<8), count); } else { /* Packet is in one chunk. */ - isa_memcpy_fromio(skb->data, xfer_start, count); + memcpy_fromio(skb->data, xfer_start, count); } } static void lne390_block_output(struct net_device *dev, int count, const unsigned char *buf, int start_page) { - unsigned long shmem = dev->mem_start + ((start_page - LNE390_START_PG)<<8); + void __iomem *shmem = ei_status.mem + ((start_page - LNE390_START_PG)<<8); count = (count + 3) & ~3; /* Round up to doubleword */ - isa_memcpy_toio(shmem, buf, count); + memcpy_toio(shmem, buf, count); } static int lne390_open(struct net_device *dev) diff -Nru a/drivers/net/mace.c b/drivers/net/mace.c --- a/drivers/net/mace.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/mace.c 2004-10-26 18:34:29 -07:00 @@ -40,10 +40,10 @@ #define TX_DMA_ERR 0x80 struct mace_data { - volatile struct mace *mace; - volatile struct dbdma_regs *tx_dma; + volatile struct mace __iomem *mace; + volatile struct dbdma_regs __iomem *tx_dma; int tx_dma_intr; - volatile struct dbdma_regs *rx_dma; + volatile struct dbdma_regs __iomem *rx_dma; int rx_dma_intr; volatile struct dbdma_cmd *tx_cmds; /* xmit dma command list */ volatile struct dbdma_cmd *rx_cmds; /* recv dma command list */ @@ -88,7 +88,7 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id, struct pt_regs *regs); static void mace_set_timeout(struct net_device *dev); static void mace_tx_timeout(unsigned long data); -static inline void dbdma_reset(volatile struct dbdma_regs *dma); +static inline void dbdma_reset(volatile struct dbdma_regs __iomem *dma); static inline void mace_clean_rings(struct mace_data *mp); static void __mace_set_address(struct net_device *dev, void *addr); @@ -164,7 +164,7 @@ macio_set_drvdata(mdev, dev); dev->base_addr = macio_resource_start(mdev, 0); - mp->mace = (volatile struct mace *)ioremap(dev->base_addr, 0x1000); + mp->mace = ioremap(dev->base_addr, 0x1000); if (mp->mace == NULL) { printk(KERN_ERR "MACE: can't map IO resources !\n"); rc = -ENOMEM; @@ -183,8 +183,7 @@ mp = (struct mace_data *) dev->priv; mp->maccc = ENXMT | ENRCV; - mp->tx_dma = (volatile struct dbdma_regs *) - ioremap(macio_resource_start(mdev, 1), 0x1000); + mp->tx_dma = ioremap(macio_resource_start(mdev, 1), 0x1000); if (mp->tx_dma == NULL) { printk(KERN_ERR "MACE: can't map TX DMA resources !\n"); rc = -ENOMEM; @@ -192,8 +191,7 @@ } mp->tx_dma_intr = macio_irq(mdev, 1); - mp->rx_dma = (volatile struct dbdma_regs *) - ioremap(macio_resource_start(mdev, 2), 0x1000); + mp->rx_dma = ioremap(macio_resource_start(mdev, 2), 0x1000); if (mp->rx_dma == NULL) { printk(KERN_ERR "MACE: can't map RX DMA resources !\n"); rc = -ENOMEM; @@ -275,11 +273,11 @@ err_free_irq: free_irq(macio_irq(mdev, 0), dev); err_unmap_rx_dma: - iounmap((void*)mp->rx_dma); + iounmap(mp->rx_dma); err_unmap_tx_dma: - iounmap((void*)mp->tx_dma); + iounmap(mp->tx_dma); err_unmap_io: - iounmap((void*)mp->mace); + iounmap(mp->mace); err_free: free_netdev(dev); err_release: @@ -305,9 +303,9 @@ free_irq(mp->tx_dma_intr, dev); free_irq(mp->rx_dma_intr, dev); - iounmap((void*)mp->rx_dma); - iounmap((void*)mp->tx_dma); - iounmap((void*)mp->mace); + iounmap(mp->rx_dma); + iounmap(mp->tx_dma); + iounmap(mp->mace); free_netdev(dev); @@ -316,7 +314,7 @@ return 0; } -static void dbdma_reset(volatile struct dbdma_regs *dma) +static void dbdma_reset(volatile struct dbdma_regs __iomem *dma) { int i; @@ -334,7 +332,7 @@ static void mace_reset(struct net_device *dev) { struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct mace *mb = mp->mace; + volatile struct mace __iomem *mb = mp->mace; int i; /* soft-reset the chip */ @@ -389,7 +387,7 @@ static void __mace_set_address(struct net_device *dev, void *addr) { struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct mace *mb = mp->mace; + volatile struct mace __iomem *mb = mp->mace; unsigned char *p = addr; int i; @@ -410,7 +408,7 @@ static int mace_set_address(struct net_device *dev, void *addr) { struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct mace *mb = mp->mace; + volatile struct mace __iomem *mb = mp->mace; unsigned long flags; spin_lock_irqsave(&mp->lock, flags); @@ -445,9 +443,9 @@ static int mace_open(struct net_device *dev) { struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct mace *mb = mp->mace; - volatile struct dbdma_regs *rd = mp->rx_dma; - volatile struct dbdma_regs *td = mp->tx_dma; + volatile struct mace __iomem *mb = mp->mace; + volatile struct dbdma_regs __iomem *rd = mp->rx_dma; + volatile struct dbdma_regs __iomem *td = mp->tx_dma; volatile struct dbdma_cmd *cp; int i; struct sk_buff *skb; @@ -515,9 +513,9 @@ static int mace_close(struct net_device *dev) { struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct mace *mb = mp->mace; - volatile struct dbdma_regs *rd = mp->rx_dma; - volatile struct dbdma_regs *td = mp->tx_dma; + volatile struct mace __iomem *mb = mp->mace; + volatile struct dbdma_regs __iomem *rd = mp->rx_dma; + volatile struct dbdma_regs __iomem *td = mp->tx_dma; /* disable rx and tx */ out_8(&mb->maccc, 0); @@ -548,7 +546,7 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev) { struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct dbdma_regs *td = mp->tx_dma; + volatile struct dbdma_regs __iomem *td = mp->tx_dma; volatile struct dbdma_cmd *cp, *np; unsigned long flags; int fill, next, len; @@ -610,7 +608,7 @@ static void mace_set_multicast(struct net_device *dev) { struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct mace *mb = mp->mace; + volatile struct mace __iomem *mb = mp->mace; int i, j; u32 crc; unsigned long flags; @@ -662,7 +660,7 @@ static void mace_handle_misc_intrs(struct mace_data *mp, int intr) { - volatile struct mace *mb = mp->mace; + volatile struct mace __iomem *mb = mp->mace; static int mace_babbles, mace_jabbers; if (intr & MPCO) @@ -685,8 +683,8 @@ { struct net_device *dev = (struct net_device *) dev_id; struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct mace *mb = mp->mace; - volatile struct dbdma_regs *td = mp->tx_dma; + volatile struct mace __iomem *mb = mp->mace; + volatile struct dbdma_regs __iomem *td = mp->tx_dma; volatile struct dbdma_cmd *cp; int intr, fs, i, stat, x; int xcount, dstat; @@ -831,9 +829,9 @@ { struct net_device *dev = (struct net_device *) data; struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct mace *mb = mp->mace; - volatile struct dbdma_regs *td = mp->tx_dma; - volatile struct dbdma_regs *rd = mp->rx_dma; + volatile struct mace __iomem *mb = mp->mace; + volatile struct dbdma_regs __iomem *td = mp->tx_dma; + volatile struct dbdma_regs __iomem *rd = mp->rx_dma; volatile struct dbdma_cmd *cp; unsigned long flags; int i; @@ -902,7 +900,7 @@ { struct net_device *dev = (struct net_device *) dev_id; struct mace_data *mp = (struct mace_data *) dev->priv; - volatile struct dbdma_regs *rd = mp->rx_dma; + volatile struct dbdma_regs __iomem *rd = mp->rx_dma; volatile struct dbdma_cmd *cp, *np; int i, nb, stat, next; struct sk_buff *skb; diff -Nru a/drivers/net/ne3210.c b/drivers/net/ne3210.c --- a/drivers/net/ne3210.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/ne3210.c 2004-10-26 18:34:29 -07:00 @@ -174,18 +174,17 @@ printk("%dkB memory at physical address %#lx\n", NE3210_STOP_PG/4, phys_mem); - dev->mem_start = (unsigned long)ioremap(phys_mem, NE3210_STOP_PG*0x100); - if (dev->mem_start == 0) { + ei_status.mem = ioremap(phys_mem, NE3210_STOP_PG*0x100); + if (!ei_status.mem) { printk(KERN_ERR "ne3210.c: Unable to remap card memory !!\n"); printk(KERN_ERR "ne3210.c: Driver NOT installed.\n"); retval = -EAGAIN; goto out4; } - printk("ne3210.c: remapped %dkB card memory to virtual address %#lx\n", - NE3210_STOP_PG/4, dev->mem_start); - dev->mem_end = ei_status.rmem_end = dev->mem_start - + (NE3210_STOP_PG - NE3210_START_PG)*256; - ei_status.rmem_start = dev->mem_start + TX_PAGES*256; + printk("ne3210.c: remapped %dkB card memory to virtual address %p\n", + NE3210_STOP_PG/4, ei_status.mem); + dev->mem_start = (unsigned long)ei_status.mem; + dev->mem_end = dev->mem_start + (NE3210_STOP_PG - NE3210_START_PG)*256; /* The 8390 offset is zero for the NE3210 */ dev->base_addr = ioaddr; @@ -219,7 +218,7 @@ return 0; out5: - iounmap((void *)dev->mem_start); + iounmap(ei_status.mem); out4: release_mem_region (phys_mem, NE3210_STOP_PG*0x100); out3: @@ -240,7 +239,7 @@ unsigned long ioaddr = to_eisa_device (device)->base_addr; unregister_netdev (dev); - iounmap((void *)dev->mem_start); + iounmap(ei_status.mem); release_mem_region (ei_status.priv, NE3210_STOP_PG*0x100); free_irq (dev->irq, dev); release_region (ioaddr + NE3210_CFG1, NE3210_CFG_EXTENT); @@ -288,7 +287,7 @@ static void ne3210_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) { - unsigned long hdr_start = dev->mem_start + ((ring_page - NE3210_START_PG)<<8); + void __iomem *hdr_start = ei_status.mem + ((ring_page - NE3210_START_PG)<<8); memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); hdr->count = (hdr->count + 3) & ~3; /* Round up allocation. */ } @@ -302,24 +301,25 @@ static void ne3210_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) { - unsigned long xfer_start = dev->mem_start + ring_offset - (NE3210_START_PG<<8); + void __iomem *start = ei_status.mem + ring_offset - NE3210_START_PG*256; - if (xfer_start + count > ei_status.rmem_end) { + if (ring_offset + count > NE3210_STOP_PG*256) { /* Packet wraps over end of ring buffer. */ - int semi_count = ei_status.rmem_end - xfer_start; - memcpy_fromio(skb->data, xfer_start, semi_count); + int semi_count = NE3210_STOP_PG*256 - ring_offset; + memcpy_fromio(skb->data, start, semi_count); count -= semi_count; - memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); + memcpy_fromio(skb->data + semi_count, + ei_status.mem + TX_PAGES*256, count); } else { /* Packet is in one chunk. */ - memcpy_fromio(skb->data, xfer_start, count); + memcpy_fromio(skb->data, start, count); } } static void ne3210_block_output(struct net_device *dev, int count, const unsigned char *buf, int start_page) { - unsigned long shmem = dev->mem_start + ((start_page - NE3210_START_PG)<<8); + void __iomem *shmem = ei_status.mem + ((start_page - NE3210_START_PG)<<8); count = (count + 3) & ~3; /* Round up to doubleword */ memcpy_toio(shmem, buf, count); diff -Nru a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c --- a/drivers/net/pcmcia/fmvj18x_cs.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/pcmcia/fmvj18x_cs.c 2004-10-26 18:34:29 -07:00 @@ -623,7 +623,7 @@ { win_req_t req; memreq_t mem; - u_char *base; + u_char __iomem *base; int i, j; /* Allocate a small memory window */ @@ -676,7 +676,7 @@ { win_req_t req; memreq_t mem; - u_char *base; + u_char __iomem *base; int i, j; struct net_device *dev = link->priv; ioaddr_t ioaddr; diff -Nru a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c --- a/drivers/net/pcmcia/ibmtr_cs.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/pcmcia/ibmtr_cs.c 2004-10-26 18:34:29 -07:00 @@ -355,7 +355,8 @@ CS_CHECK(MapMemPage, pcmcia_map_mem_page(info->sram_win_handle, &mem)); ti->sram_base = mem.CardOffset >> 12; - ti->sram_virt = (u_long)ioremap(req.Base, req.Size); + ti->sram_virt = ioremap(req.Base, req.Size); + ti->sram_phys = req.Base; CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); @@ -412,7 +413,7 @@ pcmcia_release_irq(link->handle, &link->irq); if (link->win) { struct tok_info *ti = netdev_priv(dev); - iounmap((void *)ti->mmio); + iounmap(ti->mmio); pcmcia_release_window(link->win); pcmcia_release_window(info->sram_win_handle); } @@ -444,7 +445,7 @@ if (link->state & DEV_CONFIG) { /* set flag to bypass normal interrupt code */ struct tok_info *priv = netdev_priv(dev); - priv->sram_virt |= 1; + priv->sram_phys |= 1; netif_device_detach(dev); } break; diff -Nru a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c --- a/drivers/net/pcmcia/pcnet_cs.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/pcmcia/pcnet_cs.c 2004-10-26 18:34:29 -07:00 @@ -227,7 +227,7 @@ dev_link_t link; dev_node_t node; u_int flags; - caddr_t base; + void __iomem *base; struct timer_list watchdog; int stale, fast_poll; u_char phy_id; @@ -352,7 +352,7 @@ struct net_device *dev = link->priv; win_req_t req; memreq_t mem; - u_char *base, *virt; + u_char __iomem *base, *virt; int i, j; /* Allocate a small memory window */ @@ -1491,9 +1491,10 @@ /*====================================================================*/ -static void copyin(u_char *dest, u_char *src, int c) +static void copyin(void *dest, void __iomem *src, int c) { - u_short *d = (u_short *)dest, *s = (u_short *)src; + u_short *d = dest; + u_short __iomem *s = src; int odd; if (c <= 0) @@ -1508,9 +1509,10 @@ *((u_char *)d) = readw(s) & 0xff; } -static void copyout(u_char *dest, const u_char *src, int c) +static void copyout(void __iomem *dest, const void *src, int c) { - u_short *d = (u_short *)dest, *s = (u_short *)src; + u_short __iomem *d = dest; + const u_short *s = src; int odd; if (c <= 0) @@ -1531,10 +1533,11 @@ struct e8390_pkt_hdr *hdr, int ring_page) { - void *xfer_start = (void *)(ei_status.rmem_start + (ring_page << 8) - - (ei_status.rx_start_page << 8)); + void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8) + + (ring_page << 8) + - (ei_status.rx_start_page << 8); - copyin((void *)hdr, xfer_start, sizeof(struct e8390_pkt_hdr)); + copyin(hdr, xfer_start, sizeof(struct e8390_pkt_hdr)); /* Fix for big endian systems */ hdr->count = le16_to_cpu(hdr->count); } @@ -1544,17 +1547,17 @@ static void shmem_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) { - void *xfer_start = (void *)(ei_status.rmem_start + ring_offset - - (ei_status.rx_start_page << 8)); + void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8) + + ring_offset + - (ei_status.rx_start_page << 8); char *buf = skb->data; - if (xfer_start + count > (void *)ei_status.rmem_end) { + if (xfer_start + count > (void __iomem *)ei_status.rmem_end) { /* We must wrap the input move. */ - int semi_count = (void*)ei_status.rmem_end - xfer_start; + int semi_count = (void __iomem *)ei_status.rmem_end - xfer_start; copyin(buf, xfer_start, semi_count); buf += semi_count; - ring_offset = ei_status.rx_start_page << 8; - xfer_start = (void *)ei_status.rmem_start; + xfer_start = ei_status.mem + (TX_PAGES<<8); count -= semi_count; } copyin(buf, xfer_start, count); @@ -1565,7 +1568,7 @@ static void shmem_block_output(struct net_device *dev, int count, const u_char *buf, const int start_page) { - void *shmem = (void *)dev->mem_start + (start_page << 8); + void __iomem *shmem = ei_status.mem + (start_page << 8); shmem -= ei_status.tx_start_page << 8; copyout(shmem, buf, count); } @@ -1617,8 +1620,8 @@ goto failed; } - dev->mem_start = (u_long)info->base + offset; - ei_status.rmem_start = dev->mem_start + (TX_PAGES<<8); + ei_status.mem = info->base + offset; + dev->mem_start = (u_long)ei_status.mem; dev->mem_end = ei_status.rmem_end = (u_long)info->base + req.Size; ei_status.tx_start_page = start_pg; diff -Nru a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c --- a/drivers/net/pcmcia/smc91c92_cs.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/pcmcia/smc91c92_cs.c 2004-10-26 18:34:29 -07:00 @@ -120,7 +120,7 @@ dev_node_t node; struct sk_buff *saved_skb; int packets_waiting; - caddr_t base; + void __iomem *base; u_short cfg; struct timer_list media; int watchdog, tx_err; diff -Nru a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c --- a/drivers/net/pcmcia/xirc2ps_cs.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/pcmcia/xirc2ps_cs.c 2004-10-26 18:34:29 -07:00 @@ -365,7 +365,7 @@ int dingo; /* a CEM56 type card */ int new_mii; /* has full 10baseT/100baseT MII */ int modem; /* is a multi function card (i.e with a modem) */ - caddr_t dingo_ccr; /* only used for CEM56 cards */ + void __iomem *dingo_ccr; /* only used for CEM56 cards */ unsigned last_ptr_value; /* last packets transmitted value */ const char *manf_str; } local_info_t; diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c --- a/drivers/net/r8169.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/r8169.c 2004-10-26 18:34:29 -07:00 @@ -6,6 +6,7 @@ History: Feb 4 2002 - created initially by ShuChen . May 20 2002 - Add link status force-mode and TBI mode support. + 2004 - Massive updates. See kernel SCM system for details. ========================================================================= 1. [DEPRECATED: use ethtool instead] The media can be forced in 5 modes. Command: 'insmod r8169 media = SET_MEDIA' @@ -33,22 +34,34 @@ - Copy mc_filter setup code from 8139cp (includes an optimization, and avoids set_bit use) +VERSION 1.6LK <2004/04/14> + + - Merge of Realtek's version 1.6 + - Conversion to DMA API + - Suspend/resume + - Endianness + - Misc Rx/Tx bugs */ #include +#include #include #include #include #include #include #include +#include #include +#include +#include +#include #include #include #include -#define RTL8169_VERSION "1.2" +#define RTL8169_VERSION "1.6LK" #define MODULENAME "r8169" #define RTL8169_DRIVER_NAME MODULENAME " Gigabit Ethernet driver " RTL8169_VERSION #define PFX MODULENAME ": " @@ -65,17 +78,23 @@ #define dprintk(fmt, args...) do {} while (0) #endif /* RTL8169_DEBUG */ +#define TX_BUFFS_AVAIL(tp) \ + (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1) + #ifdef CONFIG_R8169_NAPI #define rtl8169_rx_skb netif_receive_skb +#define rtl8169_rx_hwaccel_skb vlan_hwaccel_rx #define rtl8169_rx_quota(count, quota) min(count, quota) #else #define rtl8169_rx_skb netif_rx +#define rtl8169_rx_hwaccel_skb vlan_hwaccel_receive_skb #define rtl8169_rx_quota(count, quota) count #endif /* media options */ #define MAX_UNITS 8 static int media[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 }; +static int num_media = 0; /* Maximum events (Rx packets, etc.) to handle at each interrupt. */ static int max_interrupt_work = 20; @@ -87,9 +106,6 @@ /* MAC address length*/ #define MAC_ADDR_LEN 6 -/* max supported gigabit ethernet frame size -- must be at least (dev->mtu+14+4).*/ -#define MAX_ETH_FRAME_SIZE 1536 - #define TX_FIFO_THRESH 256 /* In bytes */ #define RX_FIFO_THRESH 7 /* 7 means NO threshold, Rx buffer level before first PCI xfer. */ @@ -99,6 +115,7 @@ #define RxPacketMaxSize 0x0800 /* Maximum size supported is 16K-1 */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ +#define R8169_REGS_SIZE 256 #define R8169_NAPI_WEIGHT 64 #define NUM_TX_DESC 64 /* Number of Tx descriptor registers */ #define NUM_RX_DESC 256 /* Number of Rx descriptor registers */ @@ -106,7 +123,6 @@ #define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) -#define RTL_MIN_IO_SIZE 0x80 #define RTL8169_TX_TIMEOUT (6*HZ) #define RTL8169_PHY_TIMEOUT (10*HZ) @@ -122,7 +138,8 @@ RTL_GIGA_MAC_VER_B = 0x00, /* RTL_GIGA_MAC_VER_C = 0x03, */ RTL_GIGA_MAC_VER_D = 0x01, - RTL_GIGA_MAC_VER_E = 0x02 + RTL_GIGA_MAC_VER_E = 0x02, + RTL_GIGA_MAC_VER_X = 0x04 /* Greater than RTL_GIGA_MAC_VER_E */ }; enum phy_version { @@ -304,28 +321,57 @@ }; enum _DescStatusBit { - OWNbit = 0x80000000, - EORbit = 0x40000000, - FSbit = 0x20000000, - LSbit = 0x10000000, + DescOwn = (1 << 31), /* Descriptor is owned by NIC */ + RingEnd = (1 << 30), /* End of descriptor ring */ + FirstFrag = (1 << 29), /* First segment of a packet */ + LastFrag = (1 << 28), /* Final segment of a packet */ + + /* Tx private */ + LargeSend = (1 << 27), /* TCP Large Send Offload (TSO) */ + MSSShift = 16, /* MSS value position */ + MSSMask = 0xfff, /* MSS value + LargeSend bit: 12 bits */ + IPCS = (1 << 18), /* Calculate IP checksum */ + UDPCS = (1 << 17), /* Calculate UDP/IP checksum */ + TCPCS = (1 << 16), /* Calculate TCP/IP checksum */ + TxVlanTag = (1 << 17), /* Add VLAN tag */ + + /* Rx private */ + PID1 = (1 << 18), /* Protocol ID bit 1/2 */ + PID0 = (1 << 17), /* Protocol ID bit 2/2 */ + +#define RxProtoUDP (PID1) +#define RxProtoTCP (PID0) +#define RxProtoIP (PID1 | PID0) +#define RxProtoMask RxProtoIP + + IPFail = (1 << 16), /* IP checksum failed */ + UDPFail = (1 << 15), /* UDP/IP checksum failed */ + TCPFail = (1 << 14), /* TCP/IP checksum failed */ + RxVlanTag = (1 << 16), /* VLAN tag available */ }; #define RsvdMask 0x3fffc000 struct TxDesc { - u32 status; - u32 vlan_tag; + u32 opts1; + u32 opts2; u64 addr; }; struct RxDesc { - u32 status; - u32 vlan_tag; + u32 opts1; + u32 opts2; u64 addr; }; +struct ring_info { + struct sk_buff *skb; + u32 len; + u8 __pad[sizeof(void *) - sizeof(u32)]; +}; + struct rtl8169_private { - void *mmio_addr; /* memory map physical address */ + void __iomem *mmio_addr; /* memory map physical address */ struct pci_dev *pci_dev; /* Index of PCI device */ struct net_device_stats stats; /* statistics of net device */ spinlock_t lock; /* spin lock flag */ @@ -341,25 +387,29 @@ dma_addr_t TxPhyAddr; dma_addr_t RxPhyAddr; struct sk_buff *Rx_skbuff[NUM_RX_DESC]; /* Rx data buffers */ - struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Tx data buffers */ + struct ring_info tx_skb[NUM_TX_DESC]; /* Tx data buffers */ + unsigned rx_buf_sz; struct timer_list timer; u16 cp_cmd; u16 intr_mask; int phy_auto_nego_reg; int phy_1000_ctrl_reg; - +#ifdef CONFIG_R8169_VLAN + struct vlan_group *vlgrp; +#endif int (*set_speed)(struct net_device *, u8 autoneg, u16 speed, u8 duplex); void (*get_settings)(struct net_device *, struct ethtool_cmd *); - void (*phy_reset_enable)(void *); - unsigned int (*phy_reset_pending)(void *); - unsigned int (*link_ok)(void *); + void (*phy_reset_enable)(void __iomem *); + unsigned int (*phy_reset_pending)(void __iomem *); + unsigned int (*link_ok)(void __iomem *); + struct work_struct task; }; MODULE_AUTHOR("Realtek"); MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); -MODULE_PARM(media, "1-" __MODULE_STRING(MAX_UNITS) "i"); -MODULE_PARM(rx_copybreak, "i"); -MODULE_PARM(use_dac, "i"); +module_param_array(media, int, &num_media, 0); +module_param(rx_copybreak, int, 0); +module_param(use_dac, int, 0); MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot."); MODULE_LICENSE("GPL"); @@ -373,6 +423,8 @@ static void rtl8169_set_rx_mode(struct net_device *dev); static void rtl8169_tx_timeout(struct net_device *dev); static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); +static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *, + void __iomem *); #ifdef CONFIG_R8169_NAPI static int rtl8169_poll(struct net_device *dev, int *budget); #endif @@ -389,7 +441,7 @@ #define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less #define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less -static void mdio_write(void *ioaddr, int RegAddr, int value) +static void mdio_write(void __iomem *ioaddr, int RegAddr, int value) { int i; @@ -404,7 +456,7 @@ } } -static int mdio_read(void *ioaddr, int RegAddr) +static int mdio_read(void __iomem *ioaddr, int RegAddr) { int i, value = -1; @@ -422,32 +474,32 @@ return value; } -static unsigned int rtl8169_tbi_reset_pending(void *ioaddr) +static unsigned int rtl8169_tbi_reset_pending(void __iomem *ioaddr) { return RTL_R32(TBICSR) & TBIReset; } -static unsigned int rtl8169_xmii_reset_pending(void *ioaddr) +static unsigned int rtl8169_xmii_reset_pending(void __iomem *ioaddr) { return mdio_read(ioaddr, 0) & 0x8000; } -static unsigned int rtl8169_tbi_link_ok(void *ioaddr) +static unsigned int rtl8169_tbi_link_ok(void __iomem *ioaddr) { return RTL_R32(TBICSR) & TBILinkOk; } -static unsigned int rtl8169_xmii_link_ok(void *ioaddr) +static unsigned int rtl8169_xmii_link_ok(void __iomem *ioaddr) { return RTL_R8(PHYstatus) & LinkStatus; } -static void rtl8169_tbi_reset_enable(void *ioaddr) +static void rtl8169_tbi_reset_enable(void __iomem *ioaddr) { RTL_W32(TBICSR, RTL_R32(TBICSR) | TBIReset); } -static void rtl8169_xmii_reset_enable(void *ioaddr) +static void rtl8169_xmii_reset_enable(void __iomem *ioaddr) { unsigned int val; @@ -456,7 +508,7 @@ } static void rtl8169_check_link_status(struct net_device *dev, - struct rtl8169_private *tp, void *ioaddr) + struct rtl8169_private *tp, void __iomem *ioaddr) { unsigned long flags; @@ -511,11 +563,16 @@ strcpy(info->bus_info, pci_name(tp->pci_dev)); } +static int rtl8169_get_regs_len(struct net_device *dev) +{ + return R8169_REGS_SIZE; +} + static int rtl8169_set_speed_tbi(struct net_device *dev, u8 autoneg, u16 speed, u8 duplex) { struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; int ret = 0; u32 reg; @@ -539,7 +596,7 @@ u8 autoneg, u16 speed, u8 duplex) { struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; int auto_nego, giga_ctrl; auto_nego = mdio_read(ioaddr, PHY_AUTO_NEGO_REG); @@ -601,10 +658,109 @@ return ret; } +static u32 rtl8169_get_rx_csum(struct net_device *dev) +{ + struct rtl8169_private *tp = netdev_priv(dev); + + return tp->cp_cmd & RxChkSum; +} + +static int rtl8169_set_rx_csum(struct net_device *dev, u32 data) +{ + struct rtl8169_private *tp = netdev_priv(dev); + void __iomem *ioaddr = tp->mmio_addr; + unsigned long flags; + + spin_lock_irqsave(&tp->lock, flags); + + if (data) + tp->cp_cmd |= RxChkSum; + else + tp->cp_cmd &= ~RxChkSum; + + RTL_W16(CPlusCmd, tp->cp_cmd); + RTL_R16(CPlusCmd); + + spin_unlock_irqrestore(&tp->lock, flags); + + return 0; +} + +#ifdef CONFIG_R8169_VLAN + +static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp, + struct sk_buff *skb) +{ + return (tp->vlgrp && vlan_tx_tag_present(skb)) ? + TxVlanTag | cpu_to_be16(vlan_tx_tag_get(skb)) : 0x00; +} + +static void rtl8169_vlan_rx_register(struct net_device *dev, + struct vlan_group *grp) +{ + struct rtl8169_private *tp = netdev_priv(dev); + void __iomem *ioaddr = tp->mmio_addr; + unsigned long flags; + + spin_lock_irqsave(&tp->lock, flags); + tp->vlgrp = grp; + tp->cp_cmd |= RxVlan; + RTL_W16(CPlusCmd, tp->cp_cmd); + RTL_R16(CPlusCmd); + spin_unlock_irqrestore(&tp->lock, flags); +} + +static void rtl8169_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) +{ + struct rtl8169_private *tp = netdev_priv(dev); + void __iomem *ioaddr = tp->mmio_addr; + unsigned long flags; + + spin_lock_irqsave(&tp->lock, flags); + tp->cp_cmd &= ~RxVlan; + RTL_W16(CPlusCmd, tp->cp_cmd); + RTL_R16(CPlusCmd); + if (tp->vlgrp) + tp->vlgrp->vlan_devices[vid] = NULL; + spin_unlock_irqrestore(&tp->lock, flags); +} + +static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, + struct sk_buff *skb) +{ + u32 opts2 = desc->opts2; + int ret; + + if (tp->vlgrp && (opts2 & RxVlanTag)) { + rtl8169_rx_hwaccel_skb(skb, tp->vlgrp, + be16_to_cpu(opts2 & 0xffff)); + ret = 0; + } else + ret = -1; + desc->opts2 = 0; + return ret; +} + +#else /* !CONFIG_R8169_VLAN */ + +static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp, + struct sk_buff *skb) +{ + return 0; +} + +static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, + struct sk_buff *skb) +{ + return -1; +} + +#endif + static void rtl8169_gset_tbi(struct net_device *dev, struct ethtool_cmd *cmd) { struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; u32 status; cmd->supported = @@ -623,7 +779,7 @@ static void rtl8169_gset_xmii(struct net_device *dev, struct ethtool_cmd *cmd) { struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; u8 status; cmd->supported = SUPPORTED_10baseT_Half | @@ -674,15 +830,38 @@ return 0; } +static void rtl8169_get_regs(struct net_device *dev, struct ethtool_regs *regs, + void *p) +{ + struct rtl8169_private *tp = netdev_priv(dev); + unsigned long flags; + + if (regs->len > R8169_REGS_SIZE) + regs->len = R8169_REGS_SIZE; + + spin_lock_irqsave(&tp->lock, flags); + memcpy_fromio(p, tp->mmio_addr, regs->len); + spin_unlock_irqrestore(&tp->lock, flags); +} static struct ethtool_ops rtl8169_ethtool_ops = { .get_drvinfo = rtl8169_get_drvinfo, + .get_regs_len = rtl8169_get_regs_len, .get_link = ethtool_op_get_link, .get_settings = rtl8169_get_settings, .set_settings = rtl8169_set_settings, + .get_rx_csum = rtl8169_get_rx_csum, + .set_rx_csum = rtl8169_set_rx_csum, + .get_tx_csum = ethtool_op_get_tx_csum, + .set_tx_csum = ethtool_op_set_tx_csum, + .get_sg = ethtool_op_get_sg, + .set_sg = ethtool_op_set_sg, + .get_tso = ethtool_op_get_tso, + .set_tso = ethtool_op_set_tso, + .get_regs = rtl8169_get_regs, }; -static void rtl8169_write_gmii_reg_bit(void *ioaddr, int reg, int bitnum, +static void rtl8169_write_gmii_reg_bit(void __iomem *ioaddr, int reg, int bitnum, int bitval) { int val; @@ -693,12 +872,13 @@ mdio_write(ioaddr, reg, val & 0xffff); } -static void rtl8169_get_mac_version(struct rtl8169_private *tp, void *ioaddr) +static void rtl8169_get_mac_version(struct rtl8169_private *tp, void __iomem *ioaddr) { const struct { u32 mask; int mac_version; } mac_info[] = { + { 0x1 << 28, RTL_GIGA_MAC_VER_X }, { 0x1 << 26, RTL_GIGA_MAC_VER_E }, { 0x1 << 23, RTL_GIGA_MAC_VER_D }, { 0x00000000, RTL_GIGA_MAC_VER_B } /* Catch-all */ @@ -733,7 +913,7 @@ dprintk("mac_version == Unknown\n"); } -static void rtl8169_get_phy_version(struct rtl8169_private *tp, void *ioaddr) +static void rtl8169_get_phy_version(struct rtl8169_private *tp, void __iomem *ioaddr) { const struct { u16 mask; @@ -779,7 +959,7 @@ static void rtl8169_hw_phy_config(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; struct { u16 regs[5]; /* Beware of bit-sign propagation */ } phy_magic[5] = { { @@ -849,7 +1029,7 @@ struct net_device *dev = (struct net_device *)__opaque; struct rtl8169_private *tp = netdev_priv(dev); struct timer_list *timer = &tp->timer; - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; unsigned long timeout = RTL8169_PHY_TIMEOUT; assert(tp->mac_version > RTL_GIGA_MAC_VER_B); @@ -910,41 +1090,65 @@ add_timer(timer); } +#ifdef CONFIG_NET_POLL_CONTROLLER +/* + * Polling 'interrupt' - used by things like netconsole to send skbs + * without having to re-enable interrupts. It's not called while + * the interrupt routine is executing. + */ +static void rtl8169_netpoll(struct net_device *dev) +{ + struct rtl8169_private *tp = netdev_priv(dev); + struct pci_dev *pdev = tp->pci_dev; + + disable_irq(pdev->irq); + rtl8169_interrupt(pdev->irq, dev, NULL); + enable_irq(pdev->irq); +} +#endif + +static void rtl8169_release_board(struct pci_dev *pdev, struct net_device *dev, + void __iomem *ioaddr) +{ + iounmap(ioaddr); + pci_release_regions(pdev); + pci_disable_device(pdev); + free_netdev(dev); +} + static int __devinit rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, - void **ioaddr_out) + void __iomem **ioaddr_out) { - void *ioaddr = NULL; + void __iomem *ioaddr; struct net_device *dev; struct rtl8169_private *tp; - unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; - int rc, i, acpi_idle_state = 0, pm_cap; - + int rc = -ENOMEM, i, acpi_idle_state = 0, pm_cap; - assert(pdev != NULL); assert(ioaddr_out != NULL); - *ioaddr_out = NULL; - *dev_out = NULL; - // dev zeroed in alloc_etherdev dev = alloc_etherdev(sizeof (*tp)); if (dev == NULL) { printk(KERN_ERR PFX "unable to alloc new ethernet\n"); - return -ENOMEM; + goto err_out; } SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - tp = dev->priv; + tp = netdev_priv(dev); // enable device (incl. PCI PM wakeup and hotplug setup) rc = pci_enable_device(pdev); if (rc) { printk(KERN_ERR PFX "%s: enable failure\n", pdev->slot_name); - goto err_out; + goto err_out_free_dev; } + rc = pci_set_mwi(pdev); + if (rc < 0) + goto err_out_disable; + /* save power state before pci_enable_device overwrites it */ pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); if (pm_cap) { @@ -955,41 +1159,37 @@ } else { printk(KERN_ERR PFX "Cannot find PowerManagement capability, aborting.\n"); - goto err_out_free_res; + goto err_out_mwi; } - mmio_start = pci_resource_start(pdev, 1); - mmio_end = pci_resource_end(pdev, 1); - mmio_flags = pci_resource_flags(pdev, 1); - mmio_len = pci_resource_len(pdev, 1); - // make sure PCI base addr 1 is MMIO - if (!(mmio_flags & IORESOURCE_MEM)) { + if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) { printk(KERN_ERR PFX "region #1 not an MMIO resource, aborting\n"); rc = -ENODEV; - goto err_out_disable; + goto err_out_mwi; } // check for weird/broken PCI region reporting - if (mmio_len < RTL_MIN_IO_SIZE) { + if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) { printk(KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); rc = -ENODEV; - goto err_out_disable; + goto err_out_mwi; } rc = pci_request_regions(pdev, MODULENAME); if (rc) { printk(KERN_ERR PFX "%s: could not request regions.\n", pdev->slot_name); - goto err_out_disable; + goto err_out_mwi; } tp->cp_cmd = PCIMulRW | RxChkSum; if ((sizeof(dma_addr_t) > 4) && - !pci_set_dma_mask(pdev, DMA_64BIT_MASK) && use_dac) + !pci_set_dma_mask(pdev, DMA_64BIT_MASK) && use_dac) { tp->cp_cmd |= PCIDAC; - else { + dev->features |= NETIF_F_HIGHDMA; + } else { rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); if (rc < 0) { printk(KERN_ERR PFX "DMA configuration failed.\n"); @@ -997,12 +1197,10 @@ } } - - // enable PCI bus-mastering pci_set_master(pdev); // ioremap MMIO region - ioaddr = ioremap(mmio_start, mmio_len); + ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE); if (ioaddr == NULL) { printk(KERN_ERR PFX "cannot remap MMIO, aborting\n"); rc = -EIO; @@ -1039,27 +1237,36 @@ } tp->chipset = i; + tp->rx_buf_sz = RX_BUF_SIZE; + *ioaddr_out = ioaddr; *dev_out = dev; - return 0; +out: + return rc; err_out_free_res: pci_release_regions(pdev); +err_out_mwi: + pci_clear_mwi(pdev); + err_out_disable: pci_disable_device(pdev); -err_out: +err_out_free_dev: free_netdev(dev); - return rc; +err_out: + *ioaddr_out = NULL; + *dev_out = NULL; + goto out; } static int __devinit rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { struct net_device *dev = NULL; - struct rtl8169_private *tp = NULL; - void *ioaddr = NULL; + struct rtl8169_private *tp; + void __iomem *ioaddr = NULL; static int board_idx = -1; static int printed_version = 0; u8 autoneg, duplex; @@ -1080,10 +1287,8 @@ if (rc) return rc; - tp = dev->priv; + tp = netdev_priv(dev); assert(ioaddr != NULL); - assert(dev != NULL); - assert(tp != NULL); if (RTL_R8(PHYstatus) & TBI_Enable) { tp->set_speed = rtl8169_set_speed_tbi; @@ -1108,18 +1313,30 @@ dev->open = rtl8169_open; dev->hard_start_xmit = rtl8169_start_xmit; dev->get_stats = rtl8169_get_stats; - dev->ethtool_ops = &rtl8169_ethtool_ops; + SET_ETHTOOL_OPS(dev, &rtl8169_ethtool_ops); dev->stop = rtl8169_close; dev->tx_timeout = rtl8169_tx_timeout; dev->set_multicast_list = rtl8169_set_rx_mode; dev->watchdog_timeo = RTL8169_TX_TIMEOUT; dev->irq = pdev->irq; dev->base_addr = (unsigned long) ioaddr; + #ifdef CONFIG_R8169_NAPI dev->poll = rtl8169_poll; dev->weight = R8169_NAPI_WEIGHT; printk(KERN_INFO PFX "NAPI enabled\n"); #endif + +#ifdef CONFIG_R8169_VLAN + dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; + dev->vlan_rx_register = rtl8169_vlan_rx_register; + dev->vlan_rx_kill_vid = rtl8169_vlan_rx_kill_vid; +#endif + +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = rtl8169_netpoll; +#endif + tp->intr_mask = 0xffff; tp->pci_dev = pdev; tp->mmio_addr = ioaddr; @@ -1128,10 +1345,7 @@ rc = register_netdev(dev); if (rc) { - iounmap(ioaddr); - pci_release_regions(pdev); - pci_disable_device(pdev); - free_netdev(dev); + rtl8169_release_board(pdev, dev, ioaddr); return rc; } @@ -1187,11 +1401,7 @@ assert(tp != NULL); unregister_netdev(dev); - iounmap(tp->mmio_addr); - pci_release_regions(pdev); - - pci_disable_device(pdev); - free_netdev(dev); + rtl8169_release_board(pdev, dev, tp->mmio_addr); pci_set_drvdata(pdev, NULL); } @@ -1201,7 +1411,7 @@ { struct net_device *dev = pci_get_drvdata(pdev); struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; unsigned long flags; if (!netif_running(dev)) @@ -1270,6 +1480,8 @@ if (retval < 0) goto err_free_rx; + INIT_WORK(&tp->task, NULL, dev); + rtl8169_hw_start(dev); rtl8169_request_timer(dev); @@ -1289,11 +1501,23 @@ goto out; } +static void rtl8169_hw_reset(void __iomem *ioaddr) +{ + /* Disable interrupts */ + RTL_W16(IntrMask, 0x0000); + + /* Reset the chipset */ + RTL_W8(ChipCmd, CmdReset); + + /* PCI commit */ + RTL_R8(ChipCmd); +} + static void rtl8169_hw_start(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; u32 i; /* Soft reset the chip. */ @@ -1332,8 +1556,6 @@ RTL_W16(CPlusCmd, tp->cp_cmd); } - tp->cur_rx = 0; - RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK)); RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32)); RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK)); @@ -1357,49 +1579,51 @@ static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) { desc->addr = 0x0badbadbadbadbadull; - desc->status &= ~cpu_to_le32(OWNbit | RsvdMask); + desc->opts1 &= ~cpu_to_le32(DescOwn | RsvdMask); } -static void rtl8169_free_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, - struct RxDesc *desc) +static void rtl8169_free_rx_skb(struct rtl8169_private *tp, + struct sk_buff **sk_buff, struct RxDesc *desc) { - pci_unmap_single(pdev, le64_to_cpu(desc->addr), RX_BUF_SIZE, + struct pci_dev *pdev = tp->pci_dev; + + pci_unmap_single(pdev, le64_to_cpu(desc->addr), tp->rx_buf_sz, PCI_DMA_FROMDEVICE); dev_kfree_skb(*sk_buff); *sk_buff = NULL; rtl8169_make_unusable_by_asic(desc); } -static inline void rtl8169_return_to_asic(struct RxDesc *desc) +static inline void rtl8169_return_to_asic(struct RxDesc *desc, int rx_buf_sz) { - desc->status |= cpu_to_le32(OWNbit + RX_BUF_SIZE); + desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz); } -static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping) +static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping, + int rx_buf_sz) { desc->addr = cpu_to_le64(mapping); - desc->status |= cpu_to_le32(OWNbit + RX_BUF_SIZE); + desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz); } -static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct net_device *dev, - struct sk_buff **sk_buff, struct RxDesc *desc) +static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, + struct RxDesc *desc, int rx_buf_sz) { struct sk_buff *skb; dma_addr_t mapping; int ret = 0; - skb = dev_alloc_skb(RX_BUF_SIZE); + skb = dev_alloc_skb(rx_buf_sz); if (!skb) goto err_out; - skb->dev = dev; skb_reserve(skb, 2); *sk_buff = skb; - mapping = pci_map_single(pdev, skb->tail, RX_BUF_SIZE, + mapping = pci_map_single(pdev, skb->tail, rx_buf_sz, PCI_DMA_FROMDEVICE); - rtl8169_give_to_asic(desc, mapping); + rtl8169_give_to_asic(desc, mapping, rx_buf_sz); out: return ret; @@ -1416,7 +1640,7 @@ for (i = 0; i < NUM_RX_DESC; i++) { if (tp->Rx_skbuff[i]) { - rtl8169_free_rx_skb(tp->pci_dev, tp->Rx_skbuff + i, + rtl8169_free_rx_skb(tp, tp->Rx_skbuff + i, tp->RxDescArray + i); } } @@ -1433,8 +1657,8 @@ if (tp->Rx_skbuff[i]) continue; - ret = rtl8169_alloc_rx_skb(tp->pci_dev, dev, tp->Rx_skbuff + i, - tp->RxDescArray + i); + ret = rtl8169_alloc_rx_skb(tp->pci_dev, tp->Rx_skbuff + i, + tp->RxDescArray + i, tp->rx_buf_sz); if (ret < 0) break; } @@ -1443,19 +1667,21 @@ static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc) { - desc->status |= cpu_to_le32(EORbit); + desc->opts1 |= cpu_to_le32(RingEnd); +} + +static void rtl8169_init_ring_indexes(struct rtl8169_private *tp) +{ + tp->dirty_tx = tp->dirty_rx = tp->cur_tx = tp->cur_rx = 0; } static int rtl8169_init_ring(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); - tp->cur_rx = tp->dirty_rx = 0; - tp->cur_tx = tp->dirty_tx = 0; - memset(tp->TxDescArray, 0x0, NUM_TX_DESC * sizeof (struct TxDesc)); - memset(tp->RxDescArray, 0x0, NUM_RX_DESC * sizeof (struct RxDesc)); + rtl8169_init_ring_indexes(tp); - memset(tp->Tx_skbuff, 0x0, NUM_TX_DESC * sizeof(struct sk_buff *)); + memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info)); memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *)); if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC) != NUM_RX_DESC) @@ -1470,123 +1696,293 @@ return -ENOMEM; } -static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, +static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb, struct TxDesc *desc) { - u32 len = sk_buff[0]->len; + unsigned int len = tx_skb->len; - pci_unmap_single(pdev, le64_to_cpu(desc->addr), - len < ETH_ZLEN ? ETH_ZLEN : len, PCI_DMA_TODEVICE); + pci_unmap_single(pdev, le64_to_cpu(desc->addr), len, PCI_DMA_TODEVICE); + desc->opts1 = 0x00; + desc->opts2 = 0x00; desc->addr = 0x00; - *sk_buff = NULL; + tx_skb->len = 0; } -static void -rtl8169_tx_clear(struct rtl8169_private *tp) +static void rtl8169_tx_clear(struct rtl8169_private *tp) { - int i; + unsigned int i; - tp->cur_tx = 0; - for (i = 0; i < NUM_TX_DESC; i++) { - struct sk_buff *skb = tp->Tx_skbuff[i]; + for (i = tp->dirty_tx; i < tp->dirty_tx + NUM_TX_DESC; i++) { + unsigned int entry = i % NUM_TX_DESC; + struct ring_info *tx_skb = tp->tx_skb + entry; + unsigned int len = tx_skb->len; - if (skb) { - rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + i, - tp->TxDescArray + i); - dev_kfree_skb(skb); + if (len) { + struct sk_buff *skb = tx_skb->skb; + + rtl8169_unmap_tx_skb(tp->pci_dev, tx_skb, + tp->TxDescArray + entry); + if (skb) { + dev_kfree_skb(skb); + tx_skb->skb = NULL; + } tp->stats.tx_dropped++; } } + tp->cur_tx = tp->dirty_tx = 0; } -static void -rtl8169_tx_timeout(struct net_device *dev) +static void rtl8169_schedule_work(struct net_device *dev, void (*task)(void *)) { struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; - u8 tmp8; - printk(KERN_INFO "%s: TX Timeout\n", dev->name); - /* disable Tx, if not already */ - tmp8 = RTL_R8(ChipCmd); - if (tmp8 & CmdTxEnb) - RTL_W8(ChipCmd, tmp8 & ~CmdTxEnb); + PREPARE_WORK(&tp->task, task, dev); + schedule_delayed_work(&tp->task, 4); +} - /* Disable interrupts by clearing the interrupt mask. */ - RTL_W16(IntrMask, 0x0000); +static void rtl8169_wait_for_quiescence(struct net_device *dev) +{ + synchronize_irq(dev->irq); - /* Stop a shared interrupt from scavenging while we are. */ - spin_lock_irq(&tp->lock); - rtl8169_tx_clear(tp); - spin_unlock_irq(&tp->lock); + /* Wait for any pending NAPI task to complete */ + netif_poll_disable(dev); +} - /* ...and finally, reset everything */ - rtl8169_hw_start(dev); +static void rtl8169_reinit_task(void *_data) +{ + struct net_device *dev = _data; + int ret; + + if (netif_running(dev)) { + rtl8169_wait_for_quiescence(dev); + rtl8169_close(dev); + } - netif_wake_queue(dev); + ret = rtl8169_open(dev); + if (unlikely(ret < 0)) { + if (net_ratelimit()) { + printk(PFX KERN_ERR "%s: reinit failure (status = %d)." + " Rescheduling.\n", dev->name, ret); + } + rtl8169_schedule_work(dev, rtl8169_reinit_task); + } } -static int -rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev) +static void rtl8169_reset_task(void *_data) { + struct net_device *dev = _data; struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; - unsigned int entry = tp->cur_tx % NUM_TX_DESC; - u32 len = skb->len; - - if (unlikely(skb->len < ETH_ZLEN)) { - skb = skb_padto(skb, ETH_ZLEN); - if (!skb) - goto err_update_stats; - len = ETH_ZLEN; + + if (!netif_running(dev)) + return; + + rtl8169_wait_for_quiescence(dev); + + rtl8169_rx_interrupt(dev, tp, tp->mmio_addr); + rtl8169_tx_clear(tp); + + if (tp->dirty_rx == tp->cur_rx) { + rtl8169_init_ring_indexes(tp); + rtl8169_hw_start(dev); + netif_wake_queue(dev); + } else { + if (net_ratelimit()) { + printk(PFX KERN_EMERG "%s: Rx buffers shortage\n", + dev->name); + } + rtl8169_schedule_work(dev, rtl8169_reset_task); } - - if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) { +} + +static void rtl8169_tx_timeout(struct net_device *dev) +{ + struct rtl8169_private *tp = netdev_priv(dev); + + rtl8169_hw_reset(tp->mmio_addr); + + /* Let's wait a bit while any (async) irq lands on */ + rtl8169_schedule_work(dev, rtl8169_reset_task); +} + +static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, + u32 opts1) +{ + struct skb_shared_info *info = skb_shinfo(skb); + unsigned int cur_frag, entry; + struct TxDesc *txd; + + entry = tp->cur_tx; + for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) { + skb_frag_t *frag = info->frags + cur_frag; dma_addr_t mapping; - u32 status; + u32 status, len; + void *addr; - mapping = pci_map_single(tp->pci_dev, skb->data, len, - PCI_DMA_TODEVICE); + entry = (entry + 1) % NUM_TX_DESC; - tp->Tx_skbuff[entry] = skb; - tp->TxDescArray[entry].addr = cpu_to_le64(mapping); + txd = tp->TxDescArray + entry; + len = frag->size; + addr = ((void *) page_address(frag->page)) + frag->page_offset; + mapping = pci_map_single(tp->pci_dev, addr, len, PCI_DMA_TODEVICE); - /* anti gcc 2.95.3 bugware */ - status = OWNbit | FSbit | LSbit | len | - (EORbit * !((entry + 1) % NUM_TX_DESC)); - tp->TxDescArray[entry].status = cpu_to_le32(status); - - RTL_W8(TxPoll, 0x40); //set polling bit + /* anti gcc 2.95.3 bugware (sic) */ + status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC)); - dev->trans_start = jiffies; + txd->opts1 = cpu_to_le32(status); + txd->addr = cpu_to_le64(mapping); - tp->cur_tx++; - smp_wmb(); - } else - goto err_drop; + tp->tx_skb[entry].len = len; + } + + if (cur_frag) { + tp->tx_skb[entry].skb = skb; + txd->opts1 |= cpu_to_le32(LastFrag); + } + + return cur_frag; +} - if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) { - u32 dirty = tp->dirty_tx; +static inline u32 rtl8169_tso_csum(struct sk_buff *skb, struct net_device *dev) +{ + if (dev->features & NETIF_F_TSO) { + u32 mss = skb_shinfo(skb)->tso_size; + + if (mss) + return LargeSend | ((mss & MSSMask) << MSSShift); + } + if (skb->ip_summed == CHECKSUM_HW) { + const struct iphdr *ip = skb->nh.iph; + + if (ip->protocol == IPPROTO_TCP) + return IPCS | TCPCS; + else if (ip->protocol == IPPROTO_UDP) + return IPCS | UDPCS; + WARN_ON(1); /* we need a WARN() */ + } + return 0; +} + +static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev) +{ + struct rtl8169_private *tp = netdev_priv(dev); + unsigned int frags, entry = tp->cur_tx % NUM_TX_DESC; + struct TxDesc *txd = tp->TxDescArray + entry; + void __iomem *ioaddr = tp->mmio_addr; + dma_addr_t mapping; + u32 status, len; + u32 opts1; + int ret = 0; + if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { + printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", + dev->name); + goto err_stop; + } + + if (unlikely(le32_to_cpu(txd->opts1) & DescOwn)) + goto err_stop; + + opts1 = DescOwn | rtl8169_tso_csum(skb, dev); + + frags = rtl8169_xmit_frags(tp, skb, opts1); + if (frags) { + len = skb_headlen(skb); + opts1 |= FirstFrag; + } else { + len = skb->len; + + if (unlikely(len < ETH_ZLEN)) { + skb = skb_padto(skb, ETH_ZLEN); + if (!skb) + goto err_update_stats; + len = ETH_ZLEN; + } + + opts1 |= FirstFrag | LastFrag; + tp->tx_skb[entry].skb = skb; + } + + mapping = pci_map_single(tp->pci_dev, skb->data, len, PCI_DMA_TODEVICE); + + tp->tx_skb[entry].len = len; + txd->addr = cpu_to_le64(mapping); + txd->opts2 = rtl8169_tx_vlan_tag(tp, skb); + + wmb(); + + /* anti gcc 2.95.3 bugware (sic) */ + status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC)); + txd->opts1 = cpu_to_le32(status); + + dev->trans_start = jiffies; + + tp->cur_tx += frags + 1; + + smp_wmb(); + + RTL_W8(TxPoll, 0x40); //set polling bit + + if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { netif_stop_queue(dev); smp_rmb(); - if (dirty != tp->dirty_tx) + if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) netif_wake_queue(dev); } out: - return 0; + return ret; -err_drop: - dev_kfree_skb(skb); +err_stop: + netif_stop_queue(dev); + ret = 1; err_update_stats: tp->stats.tx_dropped++; goto out; } +static void rtl8169_pcierr_interrupt(struct net_device *dev) +{ + struct rtl8169_private *tp = netdev_priv(dev); + struct pci_dev *pdev = tp->pci_dev; + void __iomem *ioaddr = tp->mmio_addr; + u16 pci_status, pci_cmd; + + pci_read_config_word(pdev, PCI_COMMAND, &pci_cmd); + pci_read_config_word(pdev, PCI_STATUS, &pci_status); + + printk(KERN_ERR PFX "%s: PCI error (cmd = 0x%04x, status = 0x%04x).\n", + dev->name, pci_cmd, pci_status); + + /* + * The recovery sequence below admits a very elaborated explanation: + * - it seems to work; + * - I did not see what else could be done. + * + * Feel free to adjust to your needs. + */ + pci_write_config_word(pdev, PCI_COMMAND, + pci_cmd | PCI_COMMAND_SERR | PCI_COMMAND_PARITY); + + pci_write_config_word(pdev, PCI_STATUS, + pci_status & (PCI_STATUS_DETECTED_PARITY | + PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_REC_MASTER_ABORT | + PCI_STATUS_REC_TARGET_ABORT | PCI_STATUS_SIG_TARGET_ABORT)); + + /* The infamous DAC f*ckup only happens at boot time */ + if ((tp->cp_cmd & PCIDAC) && (tp->dirty_rx == tp->cur_rx == 0)) { + printk(KERN_INFO PFX "%s: disabling PCI DAC.\n", dev->name); + tp->cp_cmd &= ~PCIDAC; + RTL_W16(CPlusCmd, tp->cp_cmd); + dev->features &= ~NETIF_F_HIGHDMA; + rtl8169_schedule_work(dev, rtl8169_reinit_task); + } + + rtl8169_hw_reset(ioaddr); +} + static void rtl8169_tx_interrupt(struct net_device *dev, struct rtl8169_private *tp, - void *ioaddr) + void __iomem *ioaddr) { unsigned int dirty_tx, tx_left; @@ -1600,22 +1996,24 @@ while (tx_left > 0) { unsigned int entry = dirty_tx % NUM_TX_DESC; - struct sk_buff *skb = tp->Tx_skbuff[entry]; + struct ring_info *tx_skb = tp->tx_skb + entry; + u32 len = tx_skb->len; u32 status; rmb(); - status = le32_to_cpu(tp->TxDescArray[entry].status); - if (status & OWNbit) + status = le32_to_cpu(tp->TxDescArray[entry].opts1); + if (status & DescOwn) break; - /* FIXME: is it really accurate for TxErr ? */ - tp->stats.tx_bytes += skb->len >= ETH_ZLEN ? - skb->len : ETH_ZLEN; + tp->stats.tx_bytes += len; tp->stats.tx_packets++; - rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + entry, - tp->TxDescArray + entry); - dev_kfree_skb_irq(skb); - tp->Tx_skbuff[entry] = NULL; + + rtl8169_unmap_tx_skb(tp->pci_dev, tx_skb, tp->TxDescArray + entry); + + if (status & LastFrag) { + dev_kfree_skb_irq(tx_skb->skb); + tx_skb->skb = NULL; + } dirty_tx++; tx_left--; } @@ -1623,14 +2021,28 @@ if (tp->dirty_tx != dirty_tx) { tp->dirty_tx = dirty_tx; smp_wmb(); - if (netif_queue_stopped(dev)) + if (netif_queue_stopped(dev) && + (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { netif_wake_queue(dev); + } } } +static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc) +{ + u32 opts1 = desc->opts1; + u32 status = opts1 & RxProtoMask; + + if (((status == RxProtoTCP) && !(opts1 & TCPFail)) || + ((status == RxProtoUDP) && !(opts1 & UDPFail)) || + ((status == RxProtoIP) && !(opts1 & IPFail))) + skb->ip_summed = CHECKSUM_UNNECESSARY; + else + skb->ip_summed = CHECKSUM_NONE; +} + static inline int rtl8169_try_rx_copy(struct sk_buff **sk_buff, int pkt_size, - struct RxDesc *desc, - struct net_device *dev) + struct RxDesc *desc, int rx_buf_sz) { int ret = -1; @@ -1639,11 +2051,10 @@ skb = dev_alloc_skb(pkt_size + 2); if (skb) { - skb->dev = dev; skb_reserve(skb, 2); eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0); *sk_buff = skb; - rtl8169_return_to_asic(desc); + rtl8169_return_to_asic(desc, rx_buf_sz); ret = 0; } } @@ -1652,7 +2063,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp, - void *ioaddr) + void __iomem *ioaddr) { unsigned int cur_rx, rx_left, count; int delta; @@ -1670,9 +2081,9 @@ u32 status; rmb(); - status = le32_to_cpu(tp->RxDescArray[entry].status); + status = le32_to_cpu(tp->RxDescArray[entry].opts1); - if (status & OWNbit) + if (status & DescOwn) break; if (status & RxRES) { printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); @@ -1688,22 +2099,27 @@ void (*pci_action)(struct pci_dev *, dma_addr_t, size_t, int) = pci_dma_sync_single_for_device; - + rtl8169_rx_csum(skb, desc); + pci_dma_sync_single_for_cpu(tp->pci_dev, - le64_to_cpu(desc->addr), RX_BUF_SIZE, + le64_to_cpu(desc->addr), tp->rx_buf_sz, PCI_DMA_FROMDEVICE); - if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) { + if (rtl8169_try_rx_copy(&skb, pkt_size, desc, + tp->rx_buf_sz)) { pci_action = pci_unmap_single; tp->Rx_skbuff[entry] = NULL; } pci_action(tp->pci_dev, le64_to_cpu(desc->addr), - RX_BUF_SIZE, PCI_DMA_FROMDEVICE); + tp->rx_buf_sz, PCI_DMA_FROMDEVICE); + skb->dev = dev; skb_put(skb, pkt_size); skb->protocol = eth_type_trans(skb, dev); - rtl8169_rx_skb(skb); + + if (rtl8169_rx_vlan_skb(tp, desc, skb) < 0) + rtl8169_rx_skb(skb); dev->last_rx = jiffies; tp->stats.rx_bytes += pkt_size; @@ -1744,10 +2160,13 @@ struct net_device *dev = (struct net_device *) dev_instance; struct rtl8169_private *tp = netdev_priv(dev); int boguscnt = max_interrupt_work; - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; int status = 0; int handled = 0; + if (unlikely(!netif_running(dev))) + goto out; + do { status = RTL_R16(IntrStatus); @@ -1765,11 +2184,7 @@ break; if (unlikely(status & SYSErr)) { - printk(KERN_ERR PFX "%s: PCI error (status: 0x%04x)." - " Device disabled.\n", dev->name, status); - RTL_W8(ChipCmd, 0x00); - RTL_W16(IntrMask, 0x0000); - RTL_R16(IntrMask); + rtl8169_pcierr_interrupt(dev); break; } @@ -1783,7 +2198,7 @@ if (likely(netif_rx_schedule_prep(dev))) __netif_rx_schedule(dev); else { - printk(KERN_INFO "%s: interrupt %x taken in poll\n", + printk(KERN_INFO "%s: interrupt %04x taken in poll\n", dev->name, status); } break; @@ -1806,6 +2221,7 @@ /* Clear all interrupt sources. */ RTL_W16(IntrStatus, 0xffff); } +out: return IRQ_RETVAL(handled); } @@ -1814,7 +2230,7 @@ { unsigned int work_done, work_to_do = min(*budget, dev->quota); struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; work_done = rtl8169_rx_interrupt(dev, tp, ioaddr); rtl8169_tx_interrupt(dev, tp, ioaddr); @@ -1844,10 +2260,12 @@ { struct rtl8169_private *tp = netdev_priv(dev); struct pci_dev *pdev = tp->pci_dev; - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; netif_stop_queue(dev); + flush_scheduled_work(); + rtl8169_delete_timer(dev); spin_lock_irq(&tp->lock); @@ -1864,9 +2282,10 @@ spin_unlock_irq(&tp->lock); - synchronize_irq(dev->irq); free_irq(dev->irq, dev); + netif_poll_disable(dev); + rtl8169_tx_clear(tp); rtl8169_rx_clear(tp); @@ -1885,7 +2304,7 @@ rtl8169_set_rx_mode(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; unsigned long flags; u32 mc_filter[2]; /* Multicast hash filter */ int i, rx_mode; @@ -1937,7 +2356,7 @@ static struct net_device_stats *rtl8169_get_stats(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); - void *ioaddr = tp->mmio_addr; + void __iomem *ioaddr = tp->mmio_addr; unsigned long flags; if (netif_running(dev)) { diff -Nru a/drivers/net/skfp/h/fplustm.h b/drivers/net/skfp/h/fplustm.h --- a/drivers/net/skfp/h/fplustm.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/skfp/h/fplustm.h 2004-10-26 18:34:29 -07:00 @@ -21,11 +21,7 @@ #define _FPLUS_ #ifndef HW_PTR -#ifdef MEM_MAPPED_IO -#define HW_PTR u_long -#else -#define HW_PTR u_short -#endif +#define HW_PTR void __iomem * #endif /* diff -Nru a/drivers/net/skfp/h/targethw.h b/drivers/net/skfp/h/targethw.h --- a/drivers/net/skfp/h/targethw.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/skfp/h/targethw.h 2004-10-26 18:34:29 -07:00 @@ -33,11 +33,7 @@ #endif #ifndef HW_PTR -#ifdef MEM_MAPPED_IO -#define HW_PTR u_long -#else -#define HW_PTR u_short -#endif +#define HW_PTR void __iomem * #endif #ifdef MULT_OEM diff -Nru a/drivers/net/skfp/h/targetos.h b/drivers/net/skfp/h/targetos.h --- a/drivers/net/skfp/h/targetos.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/skfp/h/targetos.h 2004-10-26 18:34:29 -07:00 @@ -53,7 +53,7 @@ // is redefined by linux, but we need our definition #undef ADDR #ifdef MEM_MAPPED_IO -#define ADDR(a) (char far *) smc->hw.iop+(a) +#define ADDR(a) (smc->hw.iop+(a)) #else #define ADDR(a) (((a)>>7) ? (outp(smc->hw.iop+B0_RAP,(a)>>7), (smc->hw.iop+( ((a)&0x7F) | ((a)>>7 ? 0x80:0)) )) : (smc->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0)))) #endif diff -Nru a/drivers/net/skfp/h/types.h b/drivers/net/skfp/h/types.h --- a/drivers/net/skfp/h/types.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/skfp/h/types.h 2004-10-26 18:34:29 -07:00 @@ -29,20 +29,11 @@ #define _far #endif -#ifndef MEM_MAPPED_IO // "normal" IO -#define inp(p) inb(p) -#define inpw(p) inw(p) -#define inpd(p) inl(p) -#define outp(p,c) outb(c,p) -#define outpw(p,s) outw(s,p) -#define outpd(p,l) outl(l,p) -#else // memory mapped io -#define inp(a) readb(a) -#define inpw(a) readw(a) -#define inpd(a) readl(a) -#define outp(a,v) writeb(v, a) -#define outpw(a,v) writew(v, a) -#define outpd(a,v) writel(v, a) -#endif +#define inp(p) ioread8(p) +#define inpw(p) ioread16(p) +#define inpd(p) ioread32(p) +#define outp(p,c) iowrite8(c,p) +#define outpw(p,s) iowrite16(s,p) +#define outpd(p,l) iowrite32(l,p) #endif /* _TYPES_ */ diff -Nru a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c --- a/drivers/net/skfp/skfddi.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/skfp/skfddi.c 2004-10-26 18:34:29 -07:00 @@ -206,6 +206,7 @@ struct net_device *dev; struct s_smc *smc; /* board pointer */ unsigned long port, len; + void __iomem *mem; int err; PRINTK(KERN_INFO "entering skfp_init_one\n"); @@ -263,16 +264,16 @@ } #ifdef MEM_MAPPED_IO - dev->base_addr = (unsigned long) ioremap(port, len); - if (!dev->base_addr) { - printk(KERN_ERR "skfp: Unable to map MEMORY register, " + mem = ioremap(port, len); +#else + mem =ioport_map(port, len); +#endif + if (!mem) { + printk(KERN_ERR "skfp: Unable to map register, " "FDDI adapter will be disabled.\n"); err = -EIO; goto err_out3; } -#else - dev->base_addr = port; -#endif dev->irq = pdev->irq; dev->get_stats = &skfp_ctl_get_stats; @@ -296,9 +297,12 @@ smc->os.MaxFrameSize = MAX_FRAME_SIZE; smc->os.dev = dev; smc->hw.slot = -1; + smc->hw.iop = mem; smc->os.ResetRequested = FALSE; skb_queue_head_init(&smc->os.SendSkbQueue); + dev->base_addr = (unsigned long)mem; + err = skfp_driver_init(dev); if (err) goto err_out4; @@ -328,7 +332,9 @@ smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA); err_out4: #ifdef MEM_MAPPED_IO - iounmap((void *) dev->base_addr); + iounmap(smc->hw.iop); +#else + ioport_unmap(smc->hw.iop); #endif err_out3: free_netdev(dev); @@ -363,7 +369,9 @@ lp->os.LocalRxBuffer = NULL; } #ifdef MEM_MAPPED_IO - iounmap((void *) p->base_addr); + iounmap(lp->hw.iop); +#else + ioport_unmap(lp->hw.iop); #endif pci_release_regions(pdev); free_netdev(p); @@ -406,7 +414,6 @@ // set the io address in private structures bp->base_addr = dev->base_addr; - smc->hw.iop = dev->base_addr; // Get the interrupt level from the PCI Configuration Table smc->hw.irq = dev->irq; diff -Nru a/drivers/net/smc91x.h b/drivers/net/smc91x.h --- a/drivers/net/smc91x.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/smc91x.h 2004-10-26 18:34:29 -07:00 @@ -160,6 +160,49 @@ #define SMC_insw(a, r, p, l) insw((a) + (r), p, l) #define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) +#elif defined(CONFIG_MACH_LPD7A400) || defined(CONFIG_MACH_LPD7A404) + +#include /* IOBARRIER_VIRT */ + +#define SMC_CAN_USE_8BIT 0 +#define SMC_CAN_USE_16BIT 1 +#define SMC_CAN_USE_32BIT 0 +#define SMC_NOWAIT 0 +#define SMC_IOBARRIER ({ barrier (); readl (IOBARRIER_VIRT); }) + +static inline unsigned short SMC_inw (unsigned long a, int r) +{ + unsigned short v; + v = readw (a + r); + SMC_IOBARRIER; + return v; +} + +static inline void SMC_outw (unsigned short v, unsigned long a, int r) +{ + writew (v, a + r); + SMC_IOBARRIER; +} + +static inline void SMC_insw (unsigned long a, int r, unsigned char* p, int l) +{ + while (l-- > 0) { + *((unsigned short*)p)++ = readw (a + r); + SMC_IOBARRIER; + } +} + +static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l) +{ + while (l-- > 0) { + writew (*((unsigned short*)p)++, a + r); + SMC_IOBARRIER; + } +} + +#define RPC_LSA_DEFAULT RPC_LED_TX_RX +#define RPC_LSB_DEFAULT RPC_LED_100_10 + #elif defined(CONFIG_M32R) #define SMC_CAN_USE_8BIT 0 diff -Nru a/drivers/net/starfire.c b/drivers/net/starfire.c --- a/drivers/net/starfire.c 2004-10-26 18:34:30 -07:00 +++ b/drivers/net/starfire.c 2004-10-26 18:34:30 -07:00 @@ -776,6 +776,7 @@ struct mii_if_info mii_if; /* MII lib hooks/info */ int phy_cnt; /* MII device addresses. */ unsigned char phys[PHY_CNT]; /* MII device addresses. */ + void __iomem *base; }; @@ -846,6 +847,7 @@ struct net_device *dev; static int card_idx = -1; long ioaddr; + void __iomem *base; int drv_flags, io_size; int boguscnt; @@ -884,14 +886,12 @@ } /* ioremap is borken in Linux-2.2.x/sparc64 */ -#if !defined(CONFIG_SPARC64) || LINUX_VERSION_CODE > 0x20300 - ioaddr = (long) ioremap(ioaddr, io_size); - if (!ioaddr) { + base = ioremap(ioaddr, io_size); + if (!base) { printk(KERN_ERR DRV_NAME " %d: cannot remap %#x @ %#lx, aborting\n", card_idx, io_size, ioaddr); goto err_out_free_res; } -#endif /* !CONFIG_SPARC64 || Linux 2.3.0+ */ pci_set_master(pdev); @@ -918,27 +918,27 @@ /* Serial EEPROM reads are hidden by the hardware. */ for (i = 0; i < 6; i++) - dev->dev_addr[i] = readb(ioaddr + EEPROMCtrl + 20 - i); + dev->dev_addr[i] = readb(base + EEPROMCtrl + 20 - i); #if ! defined(final_version) /* Dump the EEPROM contents during development. */ if (debug > 4) for (i = 0; i < 0x20; i++) printk("%2.2x%s", - (unsigned int)readb(ioaddr + EEPROMCtrl + i), + (unsigned int)readb(base + EEPROMCtrl + i), i % 16 != 15 ? " " : "\n"); #endif /* Issue soft reset */ - writel(MiiSoftReset, ioaddr + TxMode); + writel(MiiSoftReset, base + TxMode); udelay(1000); - writel(0, ioaddr + TxMode); + writel(0, base + TxMode); /* Reset the chip to erase previous misconfiguration. */ - writel(1, ioaddr + PCIDeviceConfig); + writel(1, base + PCIDeviceConfig); boguscnt = 1000; while (--boguscnt > 0) { udelay(10); - if ((readl(ioaddr + PCIDeviceConfig) & 1) == 0) + if ((readl(base + PCIDeviceConfig) & 1) == 0) break; } if (boguscnt == 0) @@ -946,10 +946,11 @@ /* wait a little longer */ udelay(1000); - dev->base_addr = ioaddr; + dev->base_addr = (unsigned long)base; dev->irq = irq; np = netdev_priv(dev); + np->base = base; spin_lock_init(&np->lock); pci_set_drvdata(pdev, dev); @@ -1021,8 +1022,8 @@ if (register_netdev(dev)) goto err_out_cleardev; - printk(KERN_INFO "%s: %s at %#lx, ", - dev->name, netdrv_tbl[chip_idx].name, ioaddr); + printk(KERN_INFO "%s: %s at %p, ", + dev->name, netdrv_tbl[chip_idx].name, base); for (i = 0; i < 5; i++) printk("%2.2x:", dev->dev_addr[i]); printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq); @@ -1065,7 +1066,7 @@ err_out_cleardev: pci_set_drvdata(pdev, NULL); - iounmap((void *)ioaddr); + iounmap(base); err_out_free_res: pci_release_regions (pdev); err_out_free_netdev: @@ -1077,7 +1078,8 @@ /* Read the MII Management Data I/O (MDIO) interfaces. */ static int mdio_read(struct net_device *dev, int phy_id, int location) { - long mdio_addr = dev->base_addr + MIICtrl + (phy_id<<7) + (location<<2); + struct netdev_private *np = netdev_priv(dev); + void __iomem *mdio_addr = np->base + MIICtrl + (phy_id<<7) + (location<<2); int result, boguscnt=1000; /* ??? Should we add a busy-wait here? */ do @@ -1093,7 +1095,8 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int value) { - long mdio_addr = dev->base_addr + MIICtrl + (phy_id<<7) + (location<<2); + struct netdev_private *np = netdev_priv(dev); + void __iomem *mdio_addr = np->base + MIICtrl + (phy_id<<7) + (location<<2); writel(value, mdio_addr); /* The busy-wait will occur before a read. */ } @@ -1102,7 +1105,7 @@ static int netdev_open(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; int i, retval; size_t tx_done_q_size, rx_done_q_size, tx_ring_size, rx_ring_size; @@ -1191,7 +1194,7 @@ writew(0, ioaddr + PerfFilterTable + 8); for (i = 1; i < 16; i++) { u16 *eaddrs = (u16 *)dev->dev_addr; - long setup_frm = ioaddr + PerfFilterTable + i * 16; + void __iomem *setup_frm = ioaddr + PerfFilterTable + i * 16; writew(cpu_to_be16(eaddrs[2]), setup_frm); setup_frm += 4; writew(cpu_to_be16(eaddrs[1]), setup_frm); setup_frm += 4; writew(cpu_to_be16(eaddrs[0]), setup_frm); setup_frm += 8; @@ -1295,7 +1298,7 @@ static void tx_timeout(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; int old_debug; printk(KERN_WARNING "%s: Transmit timed out, status %#8.8x, " @@ -1343,7 +1346,7 @@ /* Grrr, we cannot offset to correctly align the IP header. */ np->rx_ring[i].rxaddr = cpu_to_dma(np->rx_info[i].mapping | RxDescValid); } - writew(i - 1, dev->base_addr + RxDescQIdx); + writew(i - 1, np->base + RxDescQIdx); np->dirty_rx = (unsigned int)(i - RX_RING_SIZE); /* Clear the remainder of the Rx buffer ring. */ @@ -1464,7 +1467,7 @@ wmb(); /* Update the producer index. */ - writel(entry * (sizeof(starfire_tx_desc) / 8), dev->base_addr + TxProducerIdx); + writel(entry * (sizeof(starfire_tx_desc) / 8), np->base + TxProducerIdx); /* 4 is arbitrary, but should be ok */ if ((np->cur_tx - np->dirty_tx) + 4 > TX_RING_SIZE) @@ -1481,16 +1484,13 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = dev_instance; - struct netdev_private *np; - long ioaddr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; int boguscnt = max_interrupt_work; int consumer; int tx_status; int handled = 0; - ioaddr = dev->base_addr; - np = netdev_priv(dev); - do { u32 intr_status = readl(ioaddr + IntrClear); @@ -1697,7 +1697,7 @@ desc->status = 0; np->rx_done = (np->rx_done + 1) % DONE_Q_SIZE; } - writew(np->rx_done, dev->base_addr + CompletionQConsumerIdx); + writew(np->rx_done, np->base + CompletionQConsumerIdx); out: refill_rx_ring(dev); @@ -1712,7 +1712,8 @@ static int netdev_poll(struct net_device *dev, int *budget) { u32 intr_status; - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; int retcode = 0, quota = dev->quota; do { @@ -1766,14 +1767,14 @@ np->rx_ring[entry].rxaddr |= cpu_to_dma(RxDescEndRing); } if (entry >= 0) - writew(entry, dev->base_addr + RxDescQIdx); + writew(entry, np->base + RxDescQIdx); } static void netdev_media_change(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; u16 reg0, reg1, reg4, reg5; u32 new_tx_mode; u32 new_intr_timer_ctrl; @@ -1852,7 +1853,7 @@ /* Came close to underrunning the Tx FIFO, increase threshold. */ if (intr_status & IntrTxDataLow) { if (np->tx_threshold <= PKT_BUF_SZ / 16) { - writel(++np->tx_threshold, dev->base_addr + TxThreshold); + writel(++np->tx_threshold, np->base + TxThreshold); printk(KERN_NOTICE "%s: PCI bus congestion, increasing Tx FIFO threshold to %d bytes\n", dev->name, np->tx_threshold * 16); } else @@ -1874,8 +1875,8 @@ static struct net_device_stats *get_stats(struct net_device *dev) { - long ioaddr = dev->base_addr; struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; /* This adapter architecture needs no SMP locks. */ np->stats.tx_bytes = readl(ioaddr + 0x57010); @@ -1904,17 +1905,17 @@ */ static void set_rx_mode(struct net_device *dev) { - long ioaddr = dev->base_addr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; u32 rx_mode = MinVLANPrio; struct dev_mc_list *mclist; int i; #ifdef VLAN_SUPPORT - struct netdev_private *np = netdev_priv(dev); rx_mode |= VlanMode; if (np->vlgrp) { int vlan_count = 0; - long filter_addr = ioaddr + HashTable + 8; + void __iomem *filter_addr = ioaddr + HashTable + 8; for (i = 0; i < VLAN_VID_MASK; i++) { if (np->vlgrp->vlan_devices[i]) { if (vlan_count >= 32) @@ -1943,7 +1944,7 @@ rx_mode |= AcceptBroadcast|AcceptAllMulticast|PerfectFilter; } else if (dev->mc_count <= 14) { /* Use the 16 element perfect filter, skip first two entries. */ - long filter_addr = ioaddr + PerfFilterTable + 2 * 16; + void __iomem *filter_addr = ioaddr + PerfFilterTable + 2 * 16; u16 *eaddrs; for (i = 2, mclist = dev->mc_list; mclist && i < dev->mc_count + 2; i++, mclist = mclist->next) { @@ -1961,7 +1962,7 @@ rx_mode |= AcceptBroadcast|PerfectFilter; } else { /* Must use a multicast hash table. */ - long filter_addr; + void __iomem *filter_addr; u16 *eaddrs; u16 mc_filter[32] __attribute__ ((aligned(sizeof(long)))); /* Multicast hash filter */ @@ -2077,8 +2078,8 @@ static int netdev_close(struct net_device *dev) { - long ioaddr = dev->base_addr; struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; int i; netif_stop_queue(dev); @@ -2162,7 +2163,7 @@ pci_set_power_state(pdev, 3); /* go to sleep in D3 mode */ pci_disable_device(pdev); - iounmap((char *)dev->base_addr); + iounmap(np->base); pci_release_regions(pdev); pci_set_drvdata(pdev, NULL); diff -Nru a/drivers/net/sundance.c b/drivers/net/sundance.c --- a/drivers/net/sundance.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/sundance.c 2004-10-26 18:34:29 -07:00 @@ -305,20 +305,6 @@ /* This driver was written to use PCI memory space, however x86-oriented hardware often uses I/O space accesses. */ -#ifdef USE_IO_OPS -#undef readb -#undef readw -#undef readl -#undef writeb -#undef writew -#undef writel -#define readb inb -#define readw inw -#define readl inl -#define writeb outb -#define writew outw -#define writel outl -#endif /* Offsets to the device registers. Unlike software-only systems, device drivers interact with complex hardware. @@ -480,6 +466,7 @@ int mii_preamble_required; unsigned char phys[MII_CNT]; /* MII device addresses, only first one used. */ struct pci_dev *pci_dev; + void __iomem *base; unsigned char pci_rev_id; }; @@ -490,7 +477,7 @@ LinkChange) static int change_mtu(struct net_device *dev, int new_mtu); -static int eeprom_read(long ioaddr, int location); +static int eeprom_read(void __iomem *ioaddr, int location); static int mdio_read(struct net_device *dev, int phy_id, int location); static void mdio_write(struct net_device *dev, int phy_id, int location, int value); static int netdev_open(struct net_device *dev); @@ -522,10 +509,15 @@ int chip_idx = ent->driver_data; int irq; int i; - long ioaddr; + void __iomem *ioaddr; u16 mii_ctl; void *ring_space; dma_addr_t ring_dma; +#ifdef USE_IO_OPS + int bar = 0; +#else + int bar = 1; +#endif /* when built into the kernel, we only print version if device is found */ @@ -550,23 +542,19 @@ if (pci_request_regions(pdev, DRV_NAME)) goto err_out_netdev; -#ifdef USE_IO_OPS - ioaddr = pci_resource_start(pdev, 0); -#else - ioaddr = pci_resource_start(pdev, 1); - ioaddr = (long) ioremap (ioaddr, netdev_io_size); + ioaddr = pci_iomap(pdev, bar, netdev_io_size); if (!ioaddr) goto err_out_res; -#endif for (i = 0; i < 3; i++) ((u16 *)dev->dev_addr)[i] = le16_to_cpu(eeprom_read(ioaddr, i + EEPROM_SA_OFFSET)); - dev->base_addr = ioaddr; + dev->base_addr = (unsigned long)ioaddr; dev->irq = irq; np = netdev_priv(dev); + np->base = ioaddr; np->pci_dev = pdev; np->chip_id = chip_idx; np->msg_enable = (1 << debug) - 1; @@ -611,7 +599,7 @@ if (i) goto err_out_unmap_rx; - printk(KERN_INFO "%s: %s at 0x%lx, ", + printk(KERN_INFO "%s: %s at %p, ", dev->name, pci_id_tbl[chip_idx].name, ioaddr); for (i = 0; i < 5; i++) printk("%2.2x:", dev->dev_addr[i]); @@ -637,7 +625,7 @@ if (phy_idx == 0) { printk(KERN_INFO "%s: No MII transceiver found, aborting. ASIC status %x\n", - dev->name, readl(ioaddr + ASICCtrl)); + dev->name, ioread32(ioaddr + ASICCtrl)); goto err_out_unregister; } @@ -674,7 +662,7 @@ } /* Fibre PHY? */ - if (readl (ioaddr + ASICCtrl) & 0x80) { + if (ioread32 (ioaddr + ASICCtrl) & 0x80) { /* Default 100Mbps Full */ if (np->an_enable) { np->speed = 100; @@ -703,10 +691,10 @@ /* Perhaps move the reset here? */ /* Reset the chip to erase previous misconfiguration. */ if (netif_msg_hw(np)) - printk("ASIC Control is %x.\n", readl(ioaddr + ASICCtrl)); - writew(0x007f, ioaddr + ASICCtrl + 2); + printk("ASIC Control is %x.\n", ioread32(ioaddr + ASICCtrl)); + iowrite16(0x007f, ioaddr + ASICCtrl + 2); if (netif_msg_hw(np)) - printk("ASIC Control is now %x.\n", readl(ioaddr + ASICCtrl)); + printk("ASIC Control is now %x.\n", ioread32(ioaddr + ASICCtrl)); card_idx++; return 0; @@ -719,10 +707,8 @@ pci_free_consistent(pdev, TX_TOTAL_SIZE, np->tx_ring, np->tx_ring_dma); err_out_cleardev: pci_set_drvdata(pdev, NULL); -#ifndef USE_IO_OPS - iounmap((void *)ioaddr); + pci_iounmap(pdev, ioaddr); err_out_res: -#endif pci_release_regions(pdev); err_out_netdev: free_netdev (dev); @@ -739,16 +725,16 @@ return 0; } -#define eeprom_delay(ee_addr) readl(ee_addr) +#define eeprom_delay(ee_addr) ioread32(ee_addr) /* Read the EEPROM and MII Management Data I/O (MDIO) interfaces. */ -static int __devinit eeprom_read(long ioaddr, int location) +static int __devinit eeprom_read(void __iomem *ioaddr, int location) { int boguscnt = 10000; /* Typical 1900 ticks. */ - writew(0x0200 | (location & 0xff), ioaddr + EECtrl); + iowrite16(0x0200 | (location & 0xff), ioaddr + EECtrl); do { eeprom_delay(ioaddr + EECtrl); - if (! (readw(ioaddr + EECtrl) & 0x8000)) { - return readw(ioaddr + EEData); + if (! (ioread16(ioaddr + EECtrl) & 0x8000)) { + return ioread16(ioaddr + EEData); } } while (--boguscnt > 0); return 0; @@ -761,7 +747,7 @@ The maximum data clock rate is 2.5 Mhz. The minimum timing is usually met by back-to-back 33Mhz PCI cycles. */ -#define mdio_delay() readb(mdio_addr) +#define mdio_delay() ioread8(mdio_addr) enum mii_reg_bits { MDIO_ShiftClk=0x0001, MDIO_Data=0x0002, MDIO_EnbOutput=0x0004, @@ -772,15 +758,15 @@ /* Generate the preamble required for initial synchronization and a few older transceivers. */ -static void mdio_sync(long mdio_addr) +static void mdio_sync(void __iomem *mdio_addr) { int bits = 32; /* Establish sync by sending at least 32 logic ones. */ while (--bits >= 0) { - writeb(MDIO_WRITE1, mdio_addr); + iowrite8(MDIO_WRITE1, mdio_addr); mdio_delay(); - writeb(MDIO_WRITE1 | MDIO_ShiftClk, mdio_addr); + iowrite8(MDIO_WRITE1 | MDIO_ShiftClk, mdio_addr); mdio_delay(); } } @@ -788,7 +774,7 @@ static int mdio_read(struct net_device *dev, int phy_id, int location) { struct netdev_private *np = netdev_priv(dev); - long mdio_addr = dev->base_addr + MIICtrl; + void __iomem *mdio_addr = np->base + MIICtrl; int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location; int i, retval = 0; @@ -799,17 +785,17 @@ for (i = 15; i >= 0; i--) { int dataval = (mii_cmd & (1 << i)) ? MDIO_WRITE1 : MDIO_WRITE0; - writeb(dataval, mdio_addr); + iowrite8(dataval, mdio_addr); mdio_delay(); - writeb(dataval | MDIO_ShiftClk, mdio_addr); + iowrite8(dataval | MDIO_ShiftClk, mdio_addr); mdio_delay(); } /* Read the two transition, 16 data, and wire-idle bits. */ for (i = 19; i > 0; i--) { - writeb(MDIO_EnbIn, mdio_addr); + iowrite8(MDIO_EnbIn, mdio_addr); mdio_delay(); - retval = (retval << 1) | ((readb(mdio_addr) & MDIO_Data) ? 1 : 0); - writeb(MDIO_EnbIn | MDIO_ShiftClk, mdio_addr); + retval = (retval << 1) | ((ioread8(mdio_addr) & MDIO_Data) ? 1 : 0); + iowrite8(MDIO_EnbIn | MDIO_ShiftClk, mdio_addr); mdio_delay(); } return (retval>>1) & 0xffff; @@ -818,7 +804,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int value) { struct netdev_private *np = netdev_priv(dev); - long mdio_addr = dev->base_addr + MIICtrl; + void __iomem *mdio_addr = np->base + MIICtrl; int mii_cmd = (0x5002 << 16) | (phy_id << 23) | (location<<18) | value; int i; @@ -829,16 +815,16 @@ for (i = 31; i >= 0; i--) { int dataval = (mii_cmd & (1 << i)) ? MDIO_WRITE1 : MDIO_WRITE0; - writeb(dataval, mdio_addr); + iowrite8(dataval, mdio_addr); mdio_delay(); - writeb(dataval | MDIO_ShiftClk, mdio_addr); + iowrite8(dataval | MDIO_ShiftClk, mdio_addr); mdio_delay(); } /* Clear out extra bits. */ for (i = 2; i > 0; i--) { - writeb(MDIO_EnbIn, mdio_addr); + iowrite8(MDIO_EnbIn, mdio_addr); mdio_delay(); - writeb(MDIO_EnbIn | MDIO_ShiftClk, mdio_addr); + iowrite8(MDIO_EnbIn | MDIO_ShiftClk, mdio_addr); mdio_delay(); } return; @@ -847,7 +833,7 @@ static int netdev_open(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; int i; /* Do we need to reset the chip??? */ @@ -861,18 +847,18 @@ dev->name, dev->irq); init_ring(dev); - writel(np->rx_ring_dma, ioaddr + RxListPtr); + iowrite32(np->rx_ring_dma, ioaddr + RxListPtr); /* The Tx list pointer is written as packets are queued. */ /* Initialize other registers. */ __set_mac_addr(dev); #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) - writew(dev->mtu + 18, ioaddr + MaxFrameSize); + iowrite16(dev->mtu + 18, ioaddr + MaxFrameSize); #else - writew(dev->mtu + 14, ioaddr + MaxFrameSize); + iowrite16(dev->mtu + 14, ioaddr + MaxFrameSize); #endif if (dev->mtu > 2047) - writel(readl(ioaddr + ASICCtrl) | 0x0C, ioaddr + ASICCtrl); + iowrite32(ioread32(ioaddr + ASICCtrl) | 0x0C, ioaddr + ASICCtrl); /* Configure the PCI bus bursts and FIFO thresholds. */ @@ -882,24 +868,24 @@ np->mcastlock = SPIN_LOCK_UNLOCKED; set_rx_mode(dev); - writew(0, ioaddr + IntrEnable); - writew(0, ioaddr + DownCounter); + iowrite16(0, ioaddr + IntrEnable); + iowrite16(0, ioaddr + DownCounter); /* Set the chip to poll every N*320nsec. */ - writeb(100, ioaddr + RxDMAPollPeriod); - writeb(127, ioaddr + TxDMAPollPeriod); + iowrite8(100, ioaddr + RxDMAPollPeriod); + iowrite8(127, ioaddr + TxDMAPollPeriod); /* Fix DFE-580TX packet drop issue */ if (np->pci_rev_id >= 0x14) - writeb(0x01, ioaddr + DebugCtrl1); + iowrite8(0x01, ioaddr + DebugCtrl1); netif_start_queue(dev); - writew (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); if (netif_msg_ifup(np)) printk(KERN_DEBUG "%s: Done netdev_open(), status: Rx %x Tx %x " "MAC Control %x, %4.4x %4.4x.\n", - dev->name, readl(ioaddr + RxStatus), readb(ioaddr + TxStatus), - readl(ioaddr + MACCtrl0), - readw(ioaddr + MACCtrl1), readw(ioaddr + MACCtrl0)); + dev->name, ioread32(ioaddr + RxStatus), ioread8(ioaddr + TxStatus), + ioread32(ioaddr + MACCtrl0), + ioread16(ioaddr + MACCtrl1), ioread16(ioaddr + MACCtrl0)); /* Set the timer to check for link beat. */ init_timer(&np->timer); @@ -909,7 +895,7 @@ add_timer(&np->timer); /* Enable interrupts by setting the interrupt mask. */ - writew(DEFAULT_INTR, ioaddr + IntrEnable); + iowrite16(DEFAULT_INTR, ioaddr + IntrEnable); return 0; } @@ -917,7 +903,7 @@ static void check_duplex(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; int mii_lpa = mdio_read(dev, np->phys[0], MII_LPA); int negotiated = mii_lpa & np->mii_if.advertising; int duplex; @@ -925,7 +911,7 @@ /* Force media */ if (!np->an_enable || mii_lpa == 0xffff) { if (np->mii_if.full_duplex) - writew (readw (ioaddr + MACCtrl0) | EnbFullDuplex, + iowrite16 (ioread16 (ioaddr + MACCtrl0) | EnbFullDuplex, ioaddr + MACCtrl0); return; } @@ -938,7 +924,7 @@ printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d " "negotiated capability %4.4x.\n", dev->name, duplex ? "full" : "half", np->phys[0], negotiated); - writew(readw(ioaddr + MACCtrl0) | duplex ? 0x20 : 0, ioaddr + MACCtrl0); + iowrite16(ioread16(ioaddr + MACCtrl0) | duplex ? 0x20 : 0, ioaddr + MACCtrl0); } } @@ -946,14 +932,14 @@ { struct net_device *dev = (struct net_device *)data; struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; int next_tick = 10*HZ; if (netif_msg_timer(np)) { printk(KERN_DEBUG "%s: Media selection timer tick, intr status %4.4x, " "Tx %x Rx %x.\n", - dev->name, readw(ioaddr + IntrEnable), - readb(ioaddr + TxStatus), readl(ioaddr + RxStatus)); + dev->name, ioread16(ioaddr + IntrEnable), + ioread8(ioaddr + TxStatus), ioread32(ioaddr + RxStatus)); } check_duplex(dev); np->timer.expires = jiffies + next_tick; @@ -963,16 +949,16 @@ static void tx_timeout(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; unsigned long flag; netif_stop_queue(dev); tasklet_disable(&np->tx_tasklet); - writew(0, ioaddr + IntrEnable); + iowrite16(0, ioaddr + IntrEnable); printk(KERN_WARNING "%s: Transmit timed out, TxStatus %2.2x " "TxFrameId %2.2x," - " resetting...\n", dev->name, readb(ioaddr + TxStatus), - readb(ioaddr + TxFrameId)); + " resetting...\n", dev->name, ioread8(ioaddr + TxStatus), + ioread8(ioaddr + TxFrameId)); { int i; @@ -986,7 +972,7 @@ le32_to_cpu(np->tx_ring[i].frag[0].length)); } printk(KERN_DEBUG "TxListPtr=%08x netif_queue_stopped=%d\n", - readl(dev->base_addr + TxListPtr), + ioread32(np->base + TxListPtr), netif_queue_stopped(dev)); printk(KERN_DEBUG "cur_tx=%d(%02x) dirty_tx=%d(%02x)\n", np->cur_tx, np->cur_tx % TX_RING_SIZE, @@ -1007,7 +993,7 @@ if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) { netif_wake_queue(dev); } - writew(DEFAULT_INTR, ioaddr + IntrEnable); + iowrite16(DEFAULT_INTR, ioaddr + IntrEnable); tasklet_enable(&np->tx_tasklet); } @@ -1076,9 +1062,9 @@ /* Indicate the latest descriptor of tx ring */ txdesc->status |= cpu_to_le32(DescIntrOnTx); - if (readl (dev->base_addr + TxListPtr) == 0) - writel (np->tx_ring_dma + head * sizeof(struct netdev_desc), - dev->base_addr + TxListPtr); + if (ioread32 (np->base + TxListPtr) == 0) + iowrite32 (np->tx_ring_dma + head * sizeof(struct netdev_desc), + np->base + TxListPtr); return; } @@ -1128,17 +1114,17 @@ reset_tx (struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; struct sk_buff *skb; int i; int irq = in_interrupt(); /* Reset tx logic, TxListPtr will be cleaned */ - writew (TxDisable, ioaddr + MACCtrl1); - writew (TxReset | DMAReset | FIFOReset | NetworkReset, + iowrite16 (TxDisable, ioaddr + MACCtrl1); + iowrite16 (TxReset | DMAReset | FIFOReset | NetworkReset, ioaddr + ASICCtrl + 2); for (i=50; i > 0; i--) { - if ((readw(ioaddr + ASICCtrl + 2) & ResetBusy) == 0) + if ((ioread16(ioaddr + ASICCtrl + 2) & ResetBusy) == 0) break; mdelay(1); } @@ -1159,7 +1145,7 @@ } np->cur_tx = np->dirty_tx = 0; np->cur_task = 0; - writew (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); return 0; } @@ -1168,19 +1154,17 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = (struct net_device *)dev_instance; - struct netdev_private *np; - long ioaddr; + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; int hw_frame_id; int tx_cnt; int tx_status; int handled = 0; - ioaddr = dev->base_addr; - np = netdev_priv(dev); do { - int intr_status = readw(ioaddr + IntrStatus); - writew(intr_status, ioaddr + IntrStatus); + int intr_status = ioread16(ioaddr + IntrStatus); + iowrite16(intr_status, ioaddr + IntrStatus); if (netif_msg_intr(np)) printk(KERN_DEBUG "%s: Interrupt, status %4.4x.\n", @@ -1192,14 +1176,14 @@ handled = 1; if (intr_status & (IntrRxDMADone)) { - writew(DEFAULT_INTR & ~(IntrRxDone|IntrRxDMADone), + iowrite16(DEFAULT_INTR & ~(IntrRxDone|IntrRxDMADone), ioaddr + IntrEnable); if (np->budget < 0) np->budget = RX_BUDGET; tasklet_schedule(&np->rx_tasklet); } if (intr_status & (IntrTxDone | IntrDrvRqst)) { - tx_status = readw (ioaddr + TxStatus); + tx_status = ioread16 (ioaddr + TxStatus); for (tx_cnt=32; tx_status & 0x80; --tx_cnt) { if (netif_msg_tx_done(np)) printk @@ -1221,18 +1205,18 @@ spin_unlock(&np->lock); } if (tx_status & 0x1e) /* Restart the Tx. */ - writew (TxEnable, + iowrite16 (TxEnable, ioaddr + MACCtrl1); } /* Yup, this is a documentation bug. It cost me *hours*. */ - writew (0, ioaddr + TxStatus); - tx_status = readw (ioaddr + TxStatus); + iowrite16 (0, ioaddr + TxStatus); + tx_status = ioread16 (ioaddr + TxStatus); if (tx_cnt < 0) break; } hw_frame_id = (tx_status >> 8) & 0xff; } else { - hw_frame_id = readb(ioaddr + TxFrameId); + hw_frame_id = ioread8(ioaddr + TxFrameId); } if (np->pci_rev_id >= 0x14) { @@ -1293,8 +1277,8 @@ } while (0); if (netif_msg_intr(np)) printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n", - dev->name, readw(ioaddr + IntrStatus)); - writel(5000, ioaddr + DownCounter); + dev->name, ioread16(ioaddr + IntrStatus)); + iowrite32(5000, ioaddr + DownCounter); return IRQ_RETVAL(handled); } @@ -1304,7 +1288,7 @@ struct netdev_private *np = netdev_priv(dev); int entry = np->cur_rx % RX_RING_SIZE; int boguscnt = np->budget; - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; int received = 0; /* If EOP is set on the next entry, it's a new packet. Send it up. */ @@ -1381,7 +1365,7 @@ np->cur_rx = entry; refill_rx (dev); np->budget -= received; - writew(DEFAULT_INTR, ioaddr + IntrEnable); + iowrite16(DEFAULT_INTR, ioaddr + IntrEnable); return; not_done: @@ -1428,8 +1412,8 @@ } static void netdev_error(struct net_device *dev, int intr_status) { - long ioaddr = dev->base_addr; struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; u16 mii_ctl, mii_advertise, mii_lpa; int speed; @@ -1465,9 +1449,9 @@ } check_duplex (dev); if (np->flowctrl && np->mii_if.full_duplex) { - writew(readw(ioaddr + MulticastFilter1+2) | 0x0200, + iowrite16(ioread16(ioaddr + MulticastFilter1+2) | 0x0200, ioaddr + MulticastFilter1+2); - writew(readw(ioaddr + MACCtrl0) | EnbFlowCtrl, + iowrite16(ioread16(ioaddr + MACCtrl0) | EnbFlowCtrl, ioaddr + MACCtrl0); } } @@ -1484,35 +1468,35 @@ static struct net_device_stats *get_stats(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = np->base; int i; /* We should lock this segment of code for SMP eventually, although the vulnerability window is very small and statistics are non-critical. */ /* The chip only need report frame silently dropped. */ - np->stats.rx_missed_errors += readb(ioaddr + RxMissed); - np->stats.tx_packets += readw(ioaddr + TxFramesOK); - np->stats.rx_packets += readw(ioaddr + RxFramesOK); - np->stats.collisions += readb(ioaddr + StatsLateColl); - np->stats.collisions += readb(ioaddr + StatsMultiColl); - np->stats.collisions += readb(ioaddr + StatsOneColl); - np->stats.tx_carrier_errors += readb(ioaddr + StatsCarrierError); - readb(ioaddr + StatsTxDefer); + np->stats.rx_missed_errors += ioread8(ioaddr + RxMissed); + np->stats.tx_packets += ioread16(ioaddr + TxFramesOK); + np->stats.rx_packets += ioread16(ioaddr + RxFramesOK); + np->stats.collisions += ioread8(ioaddr + StatsLateColl); + np->stats.collisions += ioread8(ioaddr + StatsMultiColl); + np->stats.collisions += ioread8(ioaddr + StatsOneColl); + np->stats.tx_carrier_errors += ioread8(ioaddr + StatsCarrierError); + ioread8(ioaddr + StatsTxDefer); for (i = StatsTxDefer; i <= StatsMcastRx; i++) - readb(ioaddr + i); - np->stats.tx_bytes += readw(ioaddr + TxOctetsLow); - np->stats.tx_bytes += readw(ioaddr + TxOctetsHigh) << 16; - np->stats.rx_bytes += readw(ioaddr + RxOctetsLow); - np->stats.rx_bytes += readw(ioaddr + RxOctetsHigh) << 16; + ioread8(ioaddr + i); + np->stats.tx_bytes += ioread16(ioaddr + TxOctetsLow); + np->stats.tx_bytes += ioread16(ioaddr + TxOctetsHigh) << 16; + np->stats.rx_bytes += ioread16(ioaddr + RxOctetsLow); + np->stats.rx_bytes += ioread16(ioaddr + RxOctetsHigh) << 16; return &np->stats; } static void set_rx_mode(struct net_device *dev) { - long ioaddr = dev->base_addr; struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; u16 mc_filter[4]; /* Multicast hash filter */ u32 rx_mode; int i; @@ -1542,27 +1526,28 @@ } rx_mode = AcceptBroadcast | AcceptMultiHash | AcceptMyPhys; } else { - writeb(AcceptBroadcast | AcceptMyPhys, ioaddr + RxMode); + iowrite8(AcceptBroadcast | AcceptMyPhys, ioaddr + RxMode); return; } if (np->mii_if.full_duplex && np->flowctrl) mc_filter[3] |= 0x0200; for (i = 0; i < 4; i++) - writew(mc_filter[i], ioaddr + MulticastFilter0 + i*2); - writeb(rx_mode, ioaddr + RxMode); + iowrite16(mc_filter[i], ioaddr + MulticastFilter0 + i*2); + iowrite8(rx_mode, ioaddr + RxMode); } static int __set_mac_addr(struct net_device *dev) { + struct netdev_private *np = netdev_priv(dev); u16 addr16; addr16 = (dev->dev_addr[0] | (dev->dev_addr[1] << 8)); - writew(addr16, dev->base_addr + StationAddr); + iowrite16(addr16, np->base + StationAddr); addr16 = (dev->dev_addr[2] | (dev->dev_addr[3] << 8)); - writew(addr16, dev->base_addr + StationAddr+2); + iowrite16(addr16, np->base + StationAddr+2); addr16 = (dev->dev_addr[4] | (dev->dev_addr[5] << 8)); - writew(addr16, dev->base_addr + StationAddr+4); + iowrite16(addr16, np->base + StationAddr+4); return 0; } @@ -1638,9 +1623,9 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; int rc; int i; - long ioaddr = dev->base_addr; if (!netif_running(dev)) return -EINVAL; @@ -1661,14 +1646,14 @@ le32_to_cpu(np->tx_ring[i].frag[0].length)); } printk(KERN_DEBUG "TxListPtr=%08x netif_queue_stopped=%d\n", - readl(dev->base_addr + TxListPtr), + ioread32(np->base + TxListPtr), netif_queue_stopped(dev)); printk(KERN_DEBUG "cur_tx=%d(%02x) dirty_tx=%d(%02x)\n", np->cur_tx, np->cur_tx % TX_RING_SIZE, np->dirty_tx, np->dirty_tx % TX_RING_SIZE); printk(KERN_DEBUG "cur_rx=%d dirty_rx=%d\n", np->cur_rx, np->dirty_rx); printk(KERN_DEBUG "cur_task=%d\n", np->cur_task); - printk(KERN_DEBUG "TxStatus=%04x\n", readw(ioaddr + TxStatus)); + printk(KERN_DEBUG "TxStatus=%04x\n", ioread16(ioaddr + TxStatus)); return 0; } @@ -1678,8 +1663,8 @@ static int netdev_close(struct net_device *dev) { - long ioaddr = dev->base_addr; struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->base; struct sk_buff *skb; int i; @@ -1688,17 +1673,17 @@ if (netif_msg_ifdown(np)) { printk(KERN_DEBUG "%s: Shutting down ethercard, status was Tx %2.2x " "Rx %4.4x Int %2.2x.\n", - dev->name, readb(ioaddr + TxStatus), - readl(ioaddr + RxStatus), readw(ioaddr + IntrStatus)); + dev->name, ioread8(ioaddr + TxStatus), + ioread32(ioaddr + RxStatus), ioread16(ioaddr + IntrStatus)); printk(KERN_DEBUG "%s: Queue pointers were Tx %d / %d, Rx %d / %d.\n", dev->name, np->cur_tx, np->dirty_tx, np->cur_rx, np->dirty_rx); } /* Disable interrupts by clearing the interrupt mask. */ - writew(0x0000, ioaddr + IntrEnable); + iowrite16(0x0000, ioaddr + IntrEnable); /* Stop the chip's Tx and Rx processes. */ - writew(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); + iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); /* Wait and kill tasklet */ tasklet_kill(&np->rx_tasklet); @@ -1765,10 +1750,8 @@ np->rx_ring_dma); pci_free_consistent(pdev, TX_TOTAL_SIZE, np->tx_ring, np->tx_ring_dma); + pci_iounmap(pdev, np->base); pci_release_regions(pdev); -#ifndef USE_IO_OPS - iounmap((char *)(dev->base_addr)); -#endif free_netdev(dev); pci_set_drvdata(pdev, NULL); } diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c --- a/drivers/net/tg3.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/tg3.c 2004-10-26 18:34:29 -07:00 @@ -12,7 +12,7 @@ #include #include - +#include #include #include #include @@ -146,6 +146,8 @@ MODULE_VERSION(DRV_MODULE_VERSION); static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */ +module_param(tg3_debug, int, 0); +MODULE_PARM_DESC(tg3_debug, "Tigon3 bitmapped debugging message enable value"); static struct pci_device_id tg3_pci_tbl[] = { { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5700, @@ -225,8 +227,8 @@ MODULE_DEVICE_TABLE(pci, tg3_pci_tbl); -struct { - char string[ETH_GSTRING_LEN]; +static struct { + const char string[ETH_GSTRING_LEN]; } ethtool_stats_keys[TG3_NUM_STATS] = { { "rx_octets" }, { "rx_fragments" }, @@ -4505,7 +4507,7 @@ 0xac470014, 0xac4a0018, 0x03e00008, 0xac4b001c, 0x00000000, 0x00000000, }; -u32 tg3TsoFwRodata[] = { +static u32 tg3TsoFwRodata[] = { 0x4d61696e, 0x43707542, 0x00000000, 0x4d61696e, 0x43707541, 0x00000000, 0x00000000, 0x00000000, 0x73746b6f, 0x66666c64, 0x496e0000, 0x73746b6f, 0x66662a2a, 0x00000000, 0x53774576, 0x656e7430, 0x00000000, 0x00000000, @@ -4513,7 +4515,7 @@ 0x00000000, }; -u32 tg3TsoFwData[] = { +static u32 tg3TsoFwData[] = { 0x00000000, 0x73746b6f, 0x66666c64, 0x5f76312e, 0x362e3000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -4694,14 +4696,14 @@ 0x00000000, 0x00000000, 0x00000000, }; -u32 tg3Tso5FwRodata[(TG3_TSO5_FW_RODATA_LEN / 4) + 1] = { +static u32 tg3Tso5FwRodata[(TG3_TSO5_FW_RODATA_LEN / 4) + 1] = { 0x4d61696e, 0x43707542, 0x00000000, 0x4d61696e, 0x43707541, 0x00000000, 0x00000000, 0x00000000, 0x73746b6f, 0x66666c64, 0x00000000, 0x00000000, 0x73746b6f, 0x66666c64, 0x00000000, 0x00000000, 0x66617461, 0x6c457272, 0x00000000, 0x00000000, 0x00000000, }; -u32 tg3Tso5FwData[(TG3_TSO5_FW_DATA_LEN / 4) + 1] = { +static u32 tg3Tso5FwData[(TG3_TSO5_FW_DATA_LEN / 4) + 1] = { 0x00000000, 0x73746b6f, 0x66666c64, 0x5f76312e, 0x322e3000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; @@ -6324,7 +6326,7 @@ u32 offset, u32 *val); static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data) { - struct tg3 *tp = dev->priv; + struct tg3 *tp = netdev_priv(dev); int ret; u8 *pd; u32 i, offset, len, val, b_offset, b_count; @@ -6686,7 +6688,7 @@ static void tg3_get_ethtool_stats (struct net_device *dev, struct ethtool_stats *estats, u64 *tmp_stats) { - struct tg3 *tp = dev->priv; + struct tg3 *tp = netdev_priv(dev); memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats)); } diff -Nru a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c --- a/drivers/net/tokenring/3c359.c 2004-10-26 18:34:30 -07:00 +++ b/drivers/net/tokenring/3c359.c 2004-10-26 18:34:30 -07:00 @@ -159,7 +159,7 @@ struct xl_private *xl_priv = (struct xl_private *)dev->priv ; struct xl_tx_desc *txd ; - u8 *xl_mmio = xl_priv->xl_mmio ; + u8 __iomem *xl_mmio = xl_priv->xl_mmio ; int i ; printk("tx_ring_head: %d, tx_ring_tail: %d, free_ent: %d \n",xl_priv->tx_ring_head, @@ -182,7 +182,7 @@ struct xl_private *xl_priv = (struct xl_private *)dev->priv ; struct xl_rx_desc *rxd ; - u8 *xl_mmio = xl_priv->xl_mmio ; + u8 __iomem *xl_mmio = xl_priv->xl_mmio ; int i ; printk("rx_ring_tail: %d \n", xl_priv->rx_ring_tail) ; @@ -215,7 +215,7 @@ static u16 xl_ee_read(struct net_device *dev, int ee_addr) { struct xl_private *xl_priv = (struct xl_private *)dev->priv ; - u8 *xl_mmio = xl_priv->xl_mmio ; + u8 __iomem *xl_mmio = xl_priv->xl_mmio ; /* Wait for EEProm to not be busy */ writel(IO_WORD_READ | EECONTROL, xl_mmio + MMIO_MAC_ACCESS_CMD) ; @@ -247,7 +247,7 @@ static void xl_ee_write(struct net_device *dev, int ee_addr, u16 ee_value) { struct xl_private *xl_priv = (struct xl_private *)dev->priv ; - u8 *xl_mmio = xl_priv->xl_mmio ; + u8 __iomem *xl_mmio = xl_priv->xl_mmio ; /* Wait for EEProm to not be busy */ writel(IO_WORD_READ | EECONTROL, xl_mmio + MMIO_MAC_ACCESS_CMD) ; @@ -386,7 +386,7 @@ static int xl_hw_reset(struct net_device *dev) { struct xl_private *xl_priv = (struct xl_private *)dev->priv ; - u8 *xl_mmio = xl_priv->xl_mmio ; + u8 __iomem *xl_mmio = xl_priv->xl_mmio ; unsigned long t ; u16 i ; u16 result_16 ; @@ -569,7 +569,7 @@ static int xl_open(struct net_device *dev) { struct xl_private *xl_priv=(struct xl_private *)dev->priv; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem *xl_mmio = xl_priv->xl_mmio ; u8 i ; u16 hwaddr[3] ; /* Should be u8[6] but we get word return values */ int open_err ; @@ -727,7 +727,7 @@ static int xl_open_hw(struct net_device *dev) { struct xl_private *xl_priv=(struct xl_private *)dev->priv; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem *xl_mmio = xl_priv->xl_mmio ; u16 vsoff ; char ver_str[33]; int open_err ; @@ -891,7 +891,7 @@ static void xl_rx(struct net_device *dev) { struct xl_private *xl_priv=(struct xl_private *)dev->priv; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; struct sk_buff *skb, *skb2 ; int frame_length = 0, copy_len = 0 ; int temp_ring_loc ; @@ -999,7 +999,7 @@ static void xl_reset(struct net_device *dev) { struct xl_private *xl_priv=(struct xl_private *)dev->priv; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; unsigned long t; writew( GLOBAL_RESET, xl_mmio + MMIO_COMMAND ) ; @@ -1046,7 +1046,7 @@ { struct net_device *dev = (struct net_device *)dev_id; struct xl_private *xl_priv =(struct xl_private *)dev->priv; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; u16 intstatus, macstatus ; if (!dev) { @@ -1234,7 +1234,7 @@ static void xl_dn_comp(struct net_device *dev) { struct xl_private *xl_priv=(struct xl_private *)dev->priv; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; struct xl_tx_desc *txd ; @@ -1270,7 +1270,7 @@ static int xl_close(struct net_device *dev) { struct xl_private *xl_priv = (struct xl_private *) dev->priv ; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; unsigned long t ; netif_stop_queue(dev) ; @@ -1409,7 +1409,7 @@ static void xl_srb_bh(struct net_device *dev) { struct xl_private *xl_priv = (struct xl_private *) dev->priv ; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; u8 srb_cmd, ret_code ; int i ; @@ -1506,7 +1506,7 @@ static void xl_arb_cmd(struct net_device *dev) { struct xl_private *xl_priv = (struct xl_private *) dev->priv; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; u8 arb_cmd ; u16 lan_status, lan_status_diff ; @@ -1634,7 +1634,7 @@ static void xl_asb_cmd(struct net_device *dev) { struct xl_private *xl_priv = (struct xl_private *) dev->priv ; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; if (xl_priv->asb_queued == 1) writel(ACK_INTERRUPT | LATCH_ACK | ASBFACK, xl_mmio + MMIO_COMMAND) ; @@ -1665,7 +1665,7 @@ static void xl_asb_bh(struct net_device *dev) { struct xl_private *xl_priv = (struct xl_private *) dev->priv ; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; u8 ret_code ; writel(MMIO_BYTE_READ | 0xd0000 | xl_priv->asb | 2, xl_mmio + MMIO_MAC_ACCESS_CMD) ; @@ -1693,7 +1693,7 @@ static void xl_srb_cmd(struct net_device *dev, int srb_cmd) { struct xl_private *xl_priv = (struct xl_private *) dev->priv ; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; switch (srb_cmd) { case READ_LOG: @@ -1750,7 +1750,7 @@ static void xl_wait_misr_flags(struct net_device *dev) { struct xl_private *xl_priv = (struct xl_private *) dev->priv ; - u8 * xl_mmio = xl_priv->xl_mmio ; + u8 __iomem * xl_mmio = xl_priv->xl_mmio ; int i ; diff -Nru a/drivers/net/tokenring/3c359.h b/drivers/net/tokenring/3c359.h --- a/drivers/net/tokenring/3c359.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/tokenring/3c359.h 2004-10-26 18:34:29 -07:00 @@ -263,7 +263,7 @@ u16 arb; u16 asb; - u8 *xl_mmio; + u8 __iomem *xl_mmio; char *xl_card_name; struct pci_dev *pdev ; diff -Nru a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c --- a/drivers/net/tokenring/ibmtr.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/tokenring/ibmtr.c 2004-10-26 18:34:29 -07:00 @@ -227,7 +227,7 @@ printk("\n"); } -static void __devinit HWPrtChanID(void * pcid, short stride) +static void __devinit HWPrtChanID(void __iomem *pcid, short stride) { short i, j; for (i = 0, j = 0; i < 24; i++, j += stride) @@ -239,15 +239,16 @@ * going away. */ -static void __devinit find_turbo_adapters(int *iolist) { +static void __devinit find_turbo_adapters(int *iolist) +{ int ram_addr; int index=0; - void *chanid; + void __iomem *chanid; int found_turbo=0; unsigned char *tchanid, ctemp; int i, j; unsigned long jif; - void *ram_mapped ; + void __iomem *ram_mapped ; if (turbo_searched == 1) return; turbo_searched=1; @@ -328,8 +329,8 @@ { struct tok_info *ti = (struct tok_info *) dev->priv; - iounmap((u32 *)ti->mmio); - iounmap((u32 *)ti->sram_virt); + iounmap(ti->mmio); + iounmap(ti->sram_virt); } #endif } @@ -383,9 +384,9 @@ { unsigned char segment, intr=0, irq=0, i, j, cardpresent=NOTOK, temp=0; - void * t_mmio = NULL; + void __iomem * t_mmio = NULL; struct tok_info *ti = dev->priv; - void *cd_chanid; + void __iomem *cd_chanid; unsigned char *tchanid, ctemp; #ifndef PCMCIA unsigned char t_irq=0; @@ -428,7 +429,7 @@ */ #ifdef PCMCIA iounmap(t_mmio); - t_mmio = (void *)ti->mmio; /*BMS to get virtual address */ + t_mmio = ti->mmio; /*BMS to get virtual address */ irq = ti->irq; /*BMS to display the irq! */ #endif cd_chanid = (CHANNEL_ID + t_mmio); /* for efficiency */ @@ -515,7 +516,7 @@ if (intr == 3) irq = 11; ti->global_int_enable = 0; ti->adapter_int_enable = 0; - ti->sram_virt=(__u32)(inb(PIOaddr+ADAPTRESETREL) & 0xfe) << 12; + ti->sram_phys=(__u32)(inb(PIOaddr+ADAPTRESETREL) & 0xfe) << 12; break; case TR_ISAPNP: if (!t_irq) { @@ -533,7 +534,7 @@ kfree(ti); return -ENODEV; } - ti->sram_virt = + ti->sram_phys = ((__u32)readb(ti->mmio+ACA_OFFSET+ACA_RW+RRR_EVEN)<<12); ti->adapter_int_enable = PIOaddr + ADAPTINTREL; break; @@ -542,7 +543,7 @@ if (ibmtr_debug_trace & TRC_INIT) { /* just report int */ DPRINTK("irq=%d", irq); - printk(", sram_virt=0x%x", ti->sram_virt); + printk(", sram_phys=0x%x", ti->sram_phys); if(ibmtr_debug_trace&TRC_INITV){ /* full chat in verbose only */ DPRINTK(", ti->mmio=%p", ti->mmio); printk(", segment=%02X", segment); @@ -681,7 +682,7 @@ ibmtr_mem_base = chk_base; } } - else ti->sram_base = ti->sram_virt >> 12; + else ti->sram_base = ti->sram_phys >> 12; /* The PCMCIA has already got the interrupt line and the io port, so no chance of anybody else getting it - MLP */ @@ -893,7 +894,7 @@ */ dev->flags &= ~IFF_RUNNING; - ti->sram_virt &= ~1; /* to reverse what we do in tok_close */ + ti->sram_phys &= ~1; /* to reverse what we do in tok_close */ /* init the spinlock */ ti->lock = SPIN_LOCK_UNLOCKED; init_timer(&ti->tr_timer); @@ -1068,7 +1069,7 @@ /* unloading the module from memory, and then if a timer pops, ouch */ del_timer_sync(&ti->tr_timer); outb(0, dev->base_addr + ADAPTRESET); - ti->sram_virt |= 1; + ti->sram_phys |= 1; ti->open_status = CLOSED; netif_stop_queue(dev); @@ -1094,30 +1095,33 @@ "IMPL force received","Duplicate modifier", "No monitor detected","Monitor contention failed for RPL"}; -void dir_open_adapter (struct net_device *dev) { +static void __iomem *map_address(struct tok_info *ti, unsigned index, __u8 *page) +{ + if (ti->page_mask) { + *page = (index >> 8) & ti->page_mask; + index &= ~(ti->page_mask << 8); + } + return ti->sram_virt + index; +} +void dir_open_adapter (struct net_device *dev) +{ struct tok_info *ti = (struct tok_info *) dev->priv; unsigned char ret_code; __u16 err; - ti->srb = ntohs(readw(ti->init_srb + SRB_ADDRESS_OFST)); - ti->ssb = ntohs(readw(ti->init_srb + SSB_ADDRESS_OFST)); - ti->arb = ntohs(readw(ti->init_srb + ARB_ADDRESS_OFST)); - ti->asb = ntohs(readw(ti->init_srb + ASB_ADDRESS_OFST)); - if (ti->page_mask) { - ti->srb_page = (ti->srb >> 8) & ti->page_mask; - ti->srb &= ~(ti->page_mask << 8); - ti->ssb_page = (ti->ssb >> 8) & ti->page_mask; - ti->ssb &= ~(ti->page_mask << 8); - ti->arb_page = (ti->arb >> 8) & ti->page_mask; - ti->arb &= ~(ti->page_mask << 8); - ti->asb_page = (ti->asb >> 8) & ti->page_mask; - ti->asb &= ~(ti->page_mask << 8); - } - ti->srb += ti->sram_virt; - ti->ssb += ti->sram_virt; - ti->arb += ti->sram_virt; - ti->asb += ti->sram_virt; + ti->srb = map_address(ti, + ntohs(readw(ti->init_srb + SRB_ADDRESS_OFST)), + &ti->srb_page); + ti->ssb = map_address(ti, + ntohs(readw(ti->init_srb + SSB_ADDRESS_OFST)), + &ti->ssb_page); + ti->arb = map_address(ti, + ntohs(readw(ti->init_srb + ARB_ADDRESS_OFST)), + &ti->arb_page); + ti->asb = map_address(ti, + ntohs(readw(ti->init_srb + ASB_ADDRESS_OFST)), + &ti->asb_page); ti->current_skb = NULL; ret_code = readb(ti->init_srb + RETCODE_OFST); err = ntohs(readw(ti->init_srb + OPEN_ERROR_CODE_OFST)); @@ -1188,7 +1192,7 @@ DPRINTK("Int from tok_driver, dev : %p irq%d regs=%p\n", dev,irq,regs); #endif ti = (struct tok_info *) dev->priv; - if (ti->sram_virt & 1) + if (ti->sram_phys & 1) return IRQ_NONE; /* PCMCIA card extraction flag */ spin_lock(&(ti->lock)); #ifdef ENABLE_PAGING @@ -1220,15 +1224,11 @@ if (status & ADAP_CHK_INT) { int i; - __u32 check_reason; + void __iomem *check_reason; __u8 check_reason_page = 0; - check_reason = - ntohs(readw(ti->mmio+ ACA_OFFSET+ACA_RW + WWCR_EVEN)); - if (ti->page_mask) { - check_reason_page = (check_reason >> 8) & ti->page_mask; - check_reason &= ~(ti->page_mask << 8); - } - check_reason += ti->sram_virt; + check_reason = map_address(ti, + ntohs(readw(ti->mmio+ ACA_OFFSET+ACA_RW + WWCR_EVEN)), + &check_reason_page); SET_PAGE(check_reason_page); DPRINTK("Adapter check interrupt\n"); @@ -1517,23 +1517,20 @@ /* we assign the shared-ram address for ISA devices */ writeb(ti->sram_base, ti->mmio + ACA_OFFSET + ACA_RW + RRR_EVEN); #ifndef PCMCIA - ti->sram_virt = (u32)ioremap(((__u32)ti->sram_base << 12), ti->avail_shared_ram); + ti->sram_virt = ioremap(((__u32)ti->sram_base << 12), ti->avail_shared_ram); #endif - ti->init_srb = ntohs(readw(ti->mmio + ACA_OFFSET + WRBR_EVEN)); - if (ti->page_mask) { - ti->init_srb_page = (ti->init_srb >> 8) & ti->page_mask; - ti->init_srb &= ~(ti->page_mask << 8); - } - ti->init_srb += ti->sram_virt; + ti->init_srb = map_address(ti, + ntohs(readw(ti->mmio + ACA_OFFSET + WRBR_EVEN)), + &ti->init_srb_page); if (ti->page_mask && ti->avail_shared_ram == 127) { - int last_512 = 0xfe00, i; - int last_512_page=0; - last_512_page=(last_512>>8)&ti->page_mask; - last_512 &= ~(ti->page_mask << 8); + void __iomem *last_512; + __u8 last_512_page=0; + int i; + last_512 = map_address(ti, 0xfe00, &last_512_page); /* initialize high section of ram (if necessary) */ SET_PAGE(last_512_page); for (i = 0; i < 512; i++) - writeb(0, ti->sram_virt + last_512 + i); + writeb(0, last_512 + i); } SET_PAGE(ti->init_srb_page); @@ -1542,7 +1539,7 @@ int i; DPRINTK("ti->init_srb_page=0x%x\n", ti->init_srb_page); - DPRINTK("init_srb(%x):", (ti->init_srb) ); + DPRINTK("init_srb(%p):", ti->init_srb ); for (i = 0; i < 20; i++) printk("%02X ", (int) readb(ti->init_srb + i)); printk("\n"); @@ -1579,6 +1576,7 @@ struct trh_hdr *trhdr = (struct trh_hdr *) ti->current_skb->data; unsigned int hdr_len; __u32 dhb=0,dhb_base; + void __iomem *dhbuf = NULL; unsigned char xmit_command; int i,dhb_len=0x4000,src_len,src_offset; struct trllc *llc; @@ -1600,7 +1598,7 @@ dhb_page = (dhb_base >> 8) & ti->page_mask; dhb=dhb_base & ~(ti->page_mask << 8); } - dhb += ti->sram_virt; + dhbuf = ti->sram_virt + dhb; /* Figure out the size of the 802.5 header */ if (!(trhdr->saddr[0] & 0x80)) /* RIF present? */ @@ -1626,12 +1624,12 @@ writew(htons(0x11), ti->asb + FRAME_LENGTH_OFST); writeb(0x0e, ti->asb + HEADER_LENGTH_OFST); SET_PAGE(dhb_page); - writeb(AC, dhb); - writeb(LLC_FRAME, dhb + 1); + writeb(AC, dhbuf); + writeb(LLC_FRAME, dhbuf + 1); for (i = 0; i < TR_ALEN; i++) - writeb((int) 0x0FF, dhb + i + 2); + writeb((int) 0x0FF, dhbuf + i + 2); for (i = 0; i < TR_ALEN; i++) - writeb(0, dhb + i + TR_ALEN + 2); + writeb(0, dhbuf + i + TR_ALEN + 2); writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); return; } @@ -1650,10 +1648,10 @@ dhb=dhb & ~(ti->page_mask << 8); dhb_len=0x4000-dhb; /* remaining size of this page */ } - dhb+=ti->sram_virt; + dhbuf = ti->sram_virt + dhb; SET_PAGE(dhb_page); if (src_len > dhb_len) { - memcpy_toio(dhb,&ti->current_skb->data[src_offset], + memcpy_toio(dhbuf,&ti->current_skb->data[src_offset], dhb_len); src_len -= dhb_len; src_offset += dhb_len; @@ -1661,7 +1659,7 @@ dhb=dhb_base; continue; } - memcpy_toio(dhb, &ti->current_skb->data[src_offset], src_len); + memcpy_toio(dhbuf, &ti->current_skb->data[src_offset], src_len); break; } writeb(RESP_IN_ASB, ti->mmio + ACA_OFFSET + ACA_SET + ISRA_ODD); @@ -1689,9 +1687,9 @@ static void tr_rx(struct net_device *dev) { struct tok_info *ti = (struct tok_info *) dev->priv; - __u32 rbuffer, rbufdata; + __u32 rbuffer; + void __iomem *rbuf, *rbufdata, *llc; __u8 rbuffer_page = 0; - __u32 llc; unsigned char *data; unsigned int rbuffer_len, lan_hdr_len, hdr_len, ip_len, length; unsigned char dlc_hdr_len; @@ -1705,11 +1703,7 @@ SET_PAGE(ti->arb_page); memcpy_fromio(&rarb, ti->arb, sizeof(rarb)); rbuffer = ntohs(rarb.rec_buf_addr) ; - if (ti->page_mask) { - rbuffer_page = (rbuffer >> 8) & ti->page_mask; - rbuffer &= ~(ti->page_mask << 8); - } - rbuffer += ti->sram_virt; + rbuf = map_address(ti, rbuffer, &rbuffer_page); SET_PAGE(ti->asb_page); @@ -1728,7 +1722,7 @@ hdr_len = lan_hdr_len + sizeof(struct trllc) + sizeof(struct iphdr); SET_PAGE(rbuffer_page); - llc = (rbuffer + offsetof(struct rec_buf, data) + lan_hdr_len); + llc = rbuf + offsetof(struct rec_buf, data) + lan_hdr_len; #if TR_VERBOSE DPRINTK("offsetof data: %02X lan_hdr_len: %02X\n", @@ -1759,9 +1753,7 @@ if (!IPv4_p) { - __u32 trhhdr; - - trhhdr = (rbuffer + offsetof(struct rec_buf, data)); + void __iomem *trhhdr = rbuf + offsetof(struct rec_buf, data); DPRINTK("Probably non-IP frame received.\n"); DPRINTK("ssap: %02X dsap: %02X " @@ -1793,8 +1785,8 @@ skb_put(skb, length); skb->dev = dev; data = skb->data; - rbuffer_len = ntohs(readw(rbuffer + offsetof(struct rec_buf, buf_len))); - rbufdata = rbuffer + offsetof(struct rec_buf, data); + rbuffer_len = ntohs(readw(rbuf + offsetof(struct rec_buf, buf_len))); + rbufdata = rbuf + offsetof(struct rec_buf, data); if (IPv4_p) { /* Copy the headers without checksumming */ @@ -1822,20 +1814,16 @@ data,lengthpage_mask) { - rbuffer_page = (rbuffer >> 8) & ti->page_mask; - rbuffer &= ~(ti->page_mask << 8); - } - rbuffer += ti->sram_virt; + rbuf = map_address(ti, rbuffer, &rbuffer_page); SET_PAGE(rbuffer_page); - rbuffer_len = ntohs(readw(rbuffer + BUFFER_LENGTH_OFST)); - rbufdata = rbuffer + offsetof(struct rec_buf, data); + rbuffer_len = ntohs(readw(rbuf + BUFFER_LENGTH_OFST)); + rbufdata = rbuf + offsetof(struct rec_buf, data); } SET_PAGE(ti->asb_page); diff -Nru a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c --- a/drivers/net/tokenring/lanstreamer.c 2004-10-26 18:34:30 -07:00 +++ b/drivers/net/tokenring/lanstreamer.c 2004-10-26 18:34:30 -07:00 @@ -443,7 +443,7 @@ static int streamer_reset(struct net_device *dev) { struct streamer_private *streamer_priv; - __u8 *streamer_mmio; + __u8 __iomem *streamer_mmio; unsigned long t; unsigned int uaa_addr; struct sk_buff *skb = NULL; @@ -591,7 +591,7 @@ static int streamer_open(struct net_device *dev) { struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; unsigned long flags; char open_error[255]; int i, open_finished = 1; @@ -908,7 +908,7 @@ { struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; struct streamer_rx_desc *rx_desc; int rx_ring_last_received, length, frame_length, buffer_cnt = 0; struct sk_buff *skb, *skb2; @@ -1035,7 +1035,7 @@ struct net_device *dev = (struct net_device *) dev_id; struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; __u16 sisr; __u16 misr; u8 max_intr = MAX_INTR; @@ -1158,7 +1158,7 @@ { struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; unsigned long flags ; spin_lock_irqsave(&streamer_priv->streamer_lock, flags); @@ -1209,7 +1209,7 @@ { struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; unsigned long flags; int i; @@ -1275,7 +1275,7 @@ { struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; __u8 options = 0; struct dev_mc_list *dmi; unsigned char dev_mc_address[5]; @@ -1334,7 +1334,7 @@ static void streamer_srb_bh(struct net_device *dev) { struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; __u16 srb_word; writew(streamer_priv->srb, streamer_mmio + LAPA); @@ -1531,7 +1531,7 @@ { struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; __u8 header_len; __u16 frame_len, buffer_len; struct sk_buff *mac_frame; @@ -1747,7 +1747,7 @@ { struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; if (streamer_priv->asb_queued == 1) { @@ -1855,7 +1855,7 @@ { struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - __u8 *streamer_mmio = streamer_priv->streamer_mmio; + __u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; struct streamer_adapter_addr_table sat; struct streamer_parameters_table spt; int size = 0; @@ -1939,7 +1939,7 @@ { int i; struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv; - u8 *streamer_mmio = streamer_priv->streamer_mmio; + u8 __iomem *streamer_mmio = streamer_priv->streamer_mmio; switch(cmd) { case IOCTL_SISR_MASK: diff -Nru a/drivers/net/tokenring/lanstreamer.h b/drivers/net/tokenring/lanstreamer.h --- a/drivers/net/tokenring/lanstreamer.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/tokenring/lanstreamer.h 2004-10-26 18:34:29 -07:00 @@ -293,7 +293,7 @@ struct streamer_private *next; struct pci_dev *pci_dev; - __u8 *streamer_mmio; + __u8 __iomem *streamer_mmio; char *streamer_card_name; spinlock_t streamer_lock; diff -Nru a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c --- a/drivers/net/tokenring/olympic.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/tokenring/olympic.c 2004-10-26 18:34:29 -07:00 @@ -438,8 +438,8 @@ struct olympic_private *olympic_priv=(struct olympic_private *)dev->priv; u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio,*init_srb; unsigned long flags, t; - char open_error[255] ; int i, open_finished = 1 ; + u8 resp, err; DECLARE_WAITQUEUE(wait,current) ; @@ -540,52 +540,48 @@ * timed out. */ - if(readb(init_srb+2)== OLYMPIC_CLEAR_RET_CODE) { + switch (resp = readb(init_srb+2)) { + case OLYMPIC_CLEAR_RET_CODE: printk(KERN_WARNING "%s: Adapter Open time out or error.\n", dev->name) ; - return -EIO ; - } + goto out; + case 0: + open_finished = 1; + break; + case 0x07: + if (!olympic_priv->olympic_ring_speed && open_finished) { /* Autosense , first time around */ + printk(KERN_WARNING "%s: Retrying at different ring speed \n", dev->name); + open_finished = 0 ; + continue; + } + + err = readb(init_srb+7); + + if (!olympic_priv->olympic_ring_speed && ((err & 0x0f) == 0x0d)) { + printk(KERN_WARNING "%s: Tried to autosense ring speed with no monitors present\n",dev->name); + printk(KERN_WARNING "%s: Please try again with a specified ring speed \n",dev->name); + } else { + printk(KERN_WARNING "%s: %s - %s\n", dev->name, + open_maj_error[(err & 0xf0) >> 4], + open_min_error[(err & 0x0f)]); + } + goto out; + + case 0x32: + printk(KERN_WARNING "%s: Invalid LAA: %02x:%02x:%02x:%02x:%02x:%02x\n", + dev->name, + olympic_priv->olympic_laa[0], + olympic_priv->olympic_laa[1], + olympic_priv->olympic_laa[2], + olympic_priv->olympic_laa[3], + olympic_priv->olympic_laa[4], + olympic_priv->olympic_laa[5]) ; + goto out; + + default: + printk(KERN_WARNING "%s: Bad OPEN response: %x\n", dev->name, resp); + goto out; - if(readb(init_srb+2)!=0) { - if (readb(init_srb+2) == 0x07) { - if (!olympic_priv->olympic_ring_speed && open_finished) { /* Autosense , first time around */ - printk(KERN_WARNING "%s: Retrying at different ring speed \n", dev->name); - open_finished = 0 ; - } else { - - strcpy(open_error, open_maj_error[(readb(init_srb+7) & 0xf0) >> 4]) ; - strcat(open_error," - ") ; - strcat(open_error, open_min_error[(readb(init_srb+7) & 0x0f)]) ; - - if (!olympic_priv->olympic_ring_speed && ((readb(init_srb+7) & 0x0f) == 0x0d)) { - printk(KERN_WARNING "%s: Tried to autosense ring speed with no monitors present\n",dev->name); - printk(KERN_WARNING "%s: Please try again with a specified ring speed \n",dev->name); - free_irq(dev->irq, dev); - return -EIO ; - } - - printk(KERN_WARNING "%s: %s\n",dev->name,open_error); - free_irq(dev->irq,dev) ; - return -EIO ; - - } /* if autosense && open_finished */ - } else if (init_srb[2] == 0x32) { - printk(KERN_WARNING "%s: Invalid LAA: %02x:%02x:%02x:%02x:%02x:%02x\n", - dev->name, - olympic_priv->olympic_laa[0], - olympic_priv->olympic_laa[1], - olympic_priv->olympic_laa[2], - olympic_priv->olympic_laa[3], - olympic_priv->olympic_laa[4], - olympic_priv->olympic_laa[5]) ; - free_irq(dev->irq,dev) ; - return -EIO ; - } else { - printk(KERN_WARNING "%s: Bad OPEN response: %x\n", dev->name,init_srb[2]); - free_irq(dev->irq, dev); - return -EIO; - } - } else - open_finished = 1 ; + } } while (!(open_finished)) ; /* Will only loop if ring speed mismatch re-open attempted && autosense is on */ if (readb(init_srb+18) & (1<<3)) @@ -634,8 +630,7 @@ if (i==0) { printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers. Adapter disabled\n",dev->name); - free_irq(dev->irq, dev); - return -EIO; + goto out; } olympic_priv->rx_ring_dma_addr = pci_map_single(olympic_priv->pdev,olympic_priv->olympic_rx_ring, @@ -737,7 +732,10 @@ netif_start_queue(dev); return 0; - + +out: + free_irq(dev->irq, dev); + return -EIO; } /* diff -Nru a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c --- a/drivers/net/tulip/tulip_core.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/tulip/tulip_core.c 2004-10-26 18:34:29 -07:00 @@ -1044,7 +1044,7 @@ else filterbit = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; filterbit &= 0x3f; - mc_filter[filterbit >> 5] |= cpu_to_le32(1 << (filterbit & 31)); + mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); if (tulip_debug > 2) { printk(KERN_INFO "%s: Added filter for %2.2x:%2.2x:%2.2x:" "%2.2x:%2.2x:%2.2x %8.8x bit %d.\n", dev->name, diff -Nru a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c --- a/drivers/net/tulip/winbond-840.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/tulip/winbond-840.c 2004-10-26 18:34:29 -07:00 @@ -1409,7 +1409,7 @@ i++, mclist = mclist->next) { int filterbit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F; filterbit &= 0x3f; - mc_filter[filterbit >> 5] |= cpu_to_le32(1 << (filterbit & 31)); + mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); } rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; } diff -Nru a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c --- a/drivers/net/via-rhine.c 2004-10-26 18:34:30 -07:00 +++ b/drivers/net/via-rhine.c 2004-10-26 18:34:30 -07:00 @@ -177,6 +177,7 @@ #define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/ #include +#include #include #include #include @@ -208,27 +209,15 @@ #ifdef CONFIG_VIA_RHINE_MMIO #define USE_MMIO #else -#undef readb -#undef readw -#undef readl -#undef writeb -#undef writew -#undef writel -#define readb inb -#define readw inw -#define readl inl -#define writeb outb -#define writew outw -#define writel outl #endif MODULE_AUTHOR("Donald Becker "); MODULE_DESCRIPTION("VIA Rhine PCI Fast Ethernet driver"); MODULE_LICENSE("GPL"); -MODULE_PARM(max_interrupt_work, "i"); -MODULE_PARM(debug, "i"); -MODULE_PARM(rx_copybreak, "i"); +module_param(max_interrupt_work, int, 0); +module_param(debug, int, 0); +module_param(rx_copybreak, int, 0); MODULE_PARM_DESC(max_interrupt_work, "VIA Rhine maximum events handled per interrupt"); MODULE_PARM_DESC(debug, "VIA Rhine debug level (0-7)"); MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames"); @@ -363,7 +352,7 @@ */ /* Beware of PCI posted writes */ -#define IOSYNC do { readb(dev->base_addr + StationAddr); } while (0) +#define IOSYNC do { ioread8(ioaddr + StationAddr); } while (0) static struct pci_device_id rhine_pci_tbl[] = { @@ -500,6 +489,7 @@ u8 tx_thresh, rx_thresh; struct mii_if_info mii_if; + void __iomem *base; }; static int mdio_read(struct net_device *dev, int phy_id, int location); @@ -529,14 +519,14 @@ static inline u32 get_intr_status(struct net_device *dev) { - long ioaddr = dev->base_addr; struct rhine_private *rp = netdev_priv(dev); + void __iomem *ioaddr = rp->base; u32 intr_status; - intr_status = readw(ioaddr + IntrStatus); + intr_status = ioread16(ioaddr + IntrStatus); /* On Rhine-II, Bit 3 indicates Tx descriptor write-back race. */ if (rp->quirks & rqStatusWBRace) - intr_status |= readb(ioaddr + IntrStatus2) << 16; + intr_status |= ioread8(ioaddr + IntrStatus2) << 16; return intr_status; } @@ -546,32 +536,32 @@ */ static void rhine_power_init(struct net_device *dev) { - long ioaddr = dev->base_addr; struct rhine_private *rp = netdev_priv(dev); + void __iomem *ioaddr = rp->base; u16 wolstat; if (rp->quirks & rqWOL) { /* Make sure chip is in power state D0 */ - writeb(readb(ioaddr + StickyHW) & 0xFC, ioaddr + StickyHW); + iowrite8(ioread8(ioaddr + StickyHW) & 0xFC, ioaddr + StickyHW); /* Disable "force PME-enable" */ - writeb(0x80, ioaddr + WOLcgClr); + iowrite8(0x80, ioaddr + WOLcgClr); /* Clear power-event config bits (WOL) */ - writeb(0xFF, ioaddr + WOLcrClr); + iowrite8(0xFF, ioaddr + WOLcrClr); /* More recent cards can manage two additional patterns */ if (rp->quirks & rq6patterns) - writeb(0x03, ioaddr + WOLcrClr1); + iowrite8(0x03, ioaddr + WOLcrClr1); /* Save power-event status bits */ - wolstat = readb(ioaddr + PwrcsrSet); + wolstat = ioread8(ioaddr + PwrcsrSet); if (rp->quirks & rq6patterns) - wolstat |= (readb(ioaddr + PwrcsrSet1) & 0x03) << 8; + wolstat |= (ioread8(ioaddr + PwrcsrSet1) & 0x03) << 8; /* Clear power-event status bits */ - writeb(0xFF, ioaddr + PwrcsrClr); + iowrite8(0xFF, ioaddr + PwrcsrClr); if (rp->quirks & rq6patterns) - writeb(0x03, ioaddr + PwrcsrClr1); + iowrite8(0x03, ioaddr + PwrcsrClr1); if (wolstat) { char *reason; @@ -602,27 +592,27 @@ static void rhine_chip_reset(struct net_device *dev) { - long ioaddr = dev->base_addr; struct rhine_private *rp = netdev_priv(dev); + void __iomem *ioaddr = rp->base; - writeb(Cmd1Reset, ioaddr + ChipCmd1); + iowrite8(Cmd1Reset, ioaddr + ChipCmd1); IOSYNC; - if (readb(ioaddr + ChipCmd1) & Cmd1Reset) { + if (ioread8(ioaddr + ChipCmd1) & Cmd1Reset) { printk(KERN_INFO "%s: Reset not complete yet. " "Trying harder.\n", DRV_NAME); /* Force reset */ if (rp->quirks & rqForceReset) - writeb(0x40, ioaddr + MiscCmd); + iowrite8(0x40, ioaddr + MiscCmd); /* Reset can take somewhat longer (rare) */ - RHINE_WAIT_FOR(!(readb(ioaddr + ChipCmd1) & Cmd1Reset)); + RHINE_WAIT_FOR(!(ioread8(ioaddr + ChipCmd1) & Cmd1Reset)); } if (debug > 1) printk(KERN_INFO "%s: Reset %s.\n", dev->name, - (readb(ioaddr + ChipCmd1) & Cmd1Reset) ? + (ioread8(ioaddr + ChipCmd1) & Cmd1Reset) ? "failed" : "succeeded"); } @@ -647,8 +637,8 @@ */ static void __devinit rhine_reload_eeprom(long pioaddr, struct net_device *dev) { - long ioaddr = dev->base_addr; struct rhine_private *rp = netdev_priv(dev); + void __iomem *ioaddr = rp->base; outb(0x20, pioaddr + MACRegEEcsr); RHINE_WAIT_FOR(!(inb(pioaddr + MACRegEEcsr) & 0x20)); @@ -664,7 +654,7 @@ /* Turn off EEPROM-controlled wake-up (magic packet) */ if (rp->quirks & rqWOL) - writeb(readb(ioaddr + ConfigA) & 0xFE, ioaddr + ConfigA); + iowrite8(ioread8(ioaddr + ConfigA) & 0xFE, ioaddr + ConfigA); } @@ -702,9 +692,14 @@ u32 quirks; long pioaddr; long memaddr; - long ioaddr; + void __iomem *ioaddr; int io_size, phy_id; const char *name; +#ifdef USE_MMIO + int bar = 1; +#else + int bar = 0; +#endif /* when built into the kernel, we only print version if device is found */ #ifndef MODULE @@ -783,10 +778,7 @@ if (rc) goto err_out_free_netdev; -#ifdef USE_MMIO - enable_mmio(pioaddr, quirks); - - ioaddr = (long) ioremap(memaddr, io_size); + ioaddr = pci_iomap(pdev, bar, io_size); if (!ioaddr) { rc = -EIO; printk(KERN_ERR "ioremap failed for device %s, region 0x%X " @@ -794,6 +786,9 @@ goto err_out_free_res; } +#ifdef USE_MMIO + enable_mmio(pioaddr, quirks); + /* Check that selected MMIO registers match the PIO ones */ i = 0; while (mmio_verify_registers[i]) { @@ -807,18 +802,17 @@ goto err_out_unmap; } } -#else - ioaddr = pioaddr; #endif /* USE_MMIO */ - dev->base_addr = ioaddr; + dev->base_addr = (unsigned long)ioaddr; + rp->base = ioaddr; /* Get chip registers into a sane state */ rhine_power_init(dev); rhine_hw_init(dev, pioaddr); for (i = 0; i < 6; i++) - dev->dev_addr[i] = readb(ioaddr + StationAddr + i); + dev->dev_addr[i] = ioread8(ioaddr + StationAddr + i); if (!is_valid_ether_addr(dev->dev_addr)) { rc = -EIO; @@ -828,7 +822,7 @@ /* For Rhine-I/II, phy_id is loaded from EEPROM */ if (!phy_id) - phy_id = readb(ioaddr + 0x6C); + phy_id = ioread8(ioaddr + 0x6C); dev->irq = pdev->irq; @@ -901,10 +895,8 @@ return 0; err_out_unmap: -#ifdef USE_MMIO - iounmap((void *)ioaddr); + pci_iounmap(pdev, ioaddr); err_out_free_res: -#endif pci_release_regions(pdev); err_out_free_netdev: free_netdev(dev); @@ -947,7 +939,7 @@ return 0; } -void free_ring(struct net_device* dev) +static void free_ring(struct net_device* dev) { struct rhine_private *rp = netdev_priv(dev); @@ -1071,102 +1063,102 @@ static void rhine_check_media(struct net_device *dev, unsigned int init_media) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; mii_check_media(&rp->mii_if, debug, init_media); if (rp->mii_if.full_duplex) - writeb(readb(ioaddr + ChipCmd1) | Cmd1FDuplex, + iowrite8(ioread8(ioaddr + ChipCmd1) | Cmd1FDuplex, ioaddr + ChipCmd1); else - writeb(readb(ioaddr + ChipCmd1) & ~Cmd1FDuplex, + iowrite8(ioread8(ioaddr + ChipCmd1) & ~Cmd1FDuplex, ioaddr + ChipCmd1); } static void init_registers(struct net_device *dev) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; int i; for (i = 0; i < 6; i++) - writeb(dev->dev_addr[i], ioaddr + StationAddr + i); + iowrite8(dev->dev_addr[i], ioaddr + StationAddr + i); /* Initialize other registers. */ - writew(0x0006, ioaddr + PCIBusConfig); /* Tune configuration??? */ + iowrite16(0x0006, ioaddr + PCIBusConfig); /* Tune configuration??? */ /* Configure initial FIFO thresholds. */ - writeb(0x20, ioaddr + TxConfig); + iowrite8(0x20, ioaddr + TxConfig); rp->tx_thresh = 0x20; rp->rx_thresh = 0x60; /* Written in rhine_set_rx_mode(). */ - writel(rp->rx_ring_dma, ioaddr + RxRingPtr); - writel(rp->tx_ring_dma, ioaddr + TxRingPtr); + iowrite32(rp->rx_ring_dma, ioaddr + RxRingPtr); + iowrite32(rp->tx_ring_dma, ioaddr + TxRingPtr); rhine_set_rx_mode(dev); /* Enable interrupts by setting the interrupt mask. */ - writew(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow | + iowrite16(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow | IntrRxDropped | IntrRxNoBuf | IntrTxAborted | IntrTxDone | IntrTxError | IntrTxUnderrun | IntrPCIErr | IntrStatsMax | IntrLinkChange, ioaddr + IntrEnable); - writew(CmdStart | CmdTxOn | CmdRxOn | (Cmd1NoTxPoll << 8), + iowrite16(CmdStart | CmdTxOn | CmdRxOn | (Cmd1NoTxPoll << 8), ioaddr + ChipCmd); rhine_check_media(dev, 1); } /* Enable MII link status auto-polling (required for IntrLinkChange) */ -static void rhine_enable_linkmon(long ioaddr) +static void rhine_enable_linkmon(void __iomem *ioaddr) { - writeb(0, ioaddr + MIICmd); - writeb(MII_BMSR, ioaddr + MIIRegAddr); - writeb(0x80, ioaddr + MIICmd); + iowrite8(0, ioaddr + MIICmd); + iowrite8(MII_BMSR, ioaddr + MIIRegAddr); + iowrite8(0x80, ioaddr + MIICmd); - RHINE_WAIT_FOR((readb(ioaddr + MIIRegAddr) & 0x20)); + RHINE_WAIT_FOR((ioread8(ioaddr + MIIRegAddr) & 0x20)); - writeb(MII_BMSR | 0x40, ioaddr + MIIRegAddr); + iowrite8(MII_BMSR | 0x40, ioaddr + MIIRegAddr); } /* Disable MII link status auto-polling (required for MDIO access) */ -static void rhine_disable_linkmon(long ioaddr, u32 quirks) +static void rhine_disable_linkmon(void __iomem *ioaddr, u32 quirks) { - writeb(0, ioaddr + MIICmd); + iowrite8(0, ioaddr + MIICmd); if (quirks & rqRhineI) { - writeb(0x01, ioaddr + MIIRegAddr); // MII_BMSR + iowrite8(0x01, ioaddr + MIIRegAddr); // MII_BMSR /* Can be called from ISR. Evil. */ mdelay(1); /* 0x80 must be set immediately before turning it off */ - writeb(0x80, ioaddr + MIICmd); + iowrite8(0x80, ioaddr + MIICmd); - RHINE_WAIT_FOR(readb(ioaddr + MIIRegAddr) & 0x20); + RHINE_WAIT_FOR(ioread8(ioaddr + MIIRegAddr) & 0x20); /* Heh. Now clear 0x80 again. */ - writeb(0, ioaddr + MIICmd); + iowrite8(0, ioaddr + MIICmd); } else - RHINE_WAIT_FOR(readb(ioaddr + MIIRegAddr) & 0x80); + RHINE_WAIT_FOR(ioread8(ioaddr + MIIRegAddr) & 0x80); } /* Read and write over the MII Management Data I/O (MDIO) interface. */ static int mdio_read(struct net_device *dev, int phy_id, int regnum) { - long ioaddr = dev->base_addr; struct rhine_private *rp = netdev_priv(dev); + void __iomem *ioaddr = rp->base; int result; rhine_disable_linkmon(ioaddr, rp->quirks); /* rhine_disable_linkmon already cleared MIICmd */ - writeb(phy_id, ioaddr + MIIPhyAddr); - writeb(regnum, ioaddr + MIIRegAddr); - writeb(0x40, ioaddr + MIICmd); /* Trigger read */ - RHINE_WAIT_FOR(!(readb(ioaddr + MIICmd) & 0x40)); - result = readw(ioaddr + MIIData); + iowrite8(phy_id, ioaddr + MIIPhyAddr); + iowrite8(regnum, ioaddr + MIIRegAddr); + iowrite8(0x40, ioaddr + MIICmd); /* Trigger read */ + RHINE_WAIT_FOR(!(ioread8(ioaddr + MIICmd) & 0x40)); + result = ioread16(ioaddr + MIIData); rhine_enable_linkmon(ioaddr); return result; @@ -1175,16 +1167,16 @@ static void mdio_write(struct net_device *dev, int phy_id, int regnum, int value) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; rhine_disable_linkmon(ioaddr, rp->quirks); /* rhine_disable_linkmon already cleared MIICmd */ - writeb(phy_id, ioaddr + MIIPhyAddr); - writeb(regnum, ioaddr + MIIRegAddr); - writew(value, ioaddr + MIIData); - writeb(0x20, ioaddr + MIICmd); /* Trigger write */ - RHINE_WAIT_FOR(!(readb(ioaddr + MIICmd) & 0x20)); + iowrite8(phy_id, ioaddr + MIIPhyAddr); + iowrite8(regnum, ioaddr + MIIRegAddr); + iowrite16(value, ioaddr + MIIData); + iowrite8(0x20, ioaddr + MIICmd); /* Trigger write */ + RHINE_WAIT_FOR(!(ioread8(ioaddr + MIICmd) & 0x20)); rhine_enable_linkmon(ioaddr); } @@ -1192,7 +1184,7 @@ static int rhine_open(struct net_device *dev) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; int rc; rc = request_irq(rp->pdev->irq, &rhine_interrupt, SA_SHIRQ, dev->name, @@ -1214,7 +1206,7 @@ if (debug > 2) printk(KERN_DEBUG "%s: Done rhine_open(), status %4.4x " "MII status: %4.4x.\n", - dev->name, readw(ioaddr + ChipCmd), + dev->name, ioread16(ioaddr + ChipCmd), mdio_read(dev, rp->mii_if.phy_id, MII_BMSR)); netif_start_queue(dev); @@ -1225,11 +1217,11 @@ static void rhine_tx_timeout(struct net_device *dev) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status " "%4.4x, resetting...\n", - dev->name, readw(ioaddr + IntrStatus), + dev->name, ioread16(ioaddr + IntrStatus), mdio_read(dev, rp->mii_if.phy_id, MII_BMSR)); /* protect against concurrent rx interrupts */ @@ -1258,7 +1250,7 @@ static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; unsigned entry; /* Caution: the write order is important here, set the field @@ -1276,7 +1268,7 @@ rp->tx_skbuff[entry] = skb; if ((rp->quirks & rqRhineI) && - (((long)skb->data & 3) || skb_shinfo(skb)->nr_frags != 0 || skb->ip_summed == CHECKSUM_HW)) { + (((unsigned long)skb->data & 3) || skb_shinfo(skb)->nr_frags != 0 || skb->ip_summed == CHECKSUM_HW)) { /* Must use alignment buffer. */ if (skb->len > PKT_BUF_SZ) { /* packet too long, drop it */ @@ -1311,7 +1303,7 @@ /* Non-x86 Todo: explicitly flush cache lines here. */ /* Wake the potentially-idle transmit channel */ - writeb(readb(ioaddr + ChipCmd1) | Cmd1TxDemand, + iowrite8(ioread8(ioaddr + ChipCmd1) | Cmd1TxDemand, ioaddr + ChipCmd1); IOSYNC; @@ -1334,20 +1326,19 @@ static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = dev_instance; - long ioaddr; + struct rhine_private *rp = netdev_priv(dev); + void __iomem *ioaddr = rp->base; u32 intr_status; int boguscnt = max_interrupt_work; int handled = 0; - ioaddr = dev->base_addr; - while ((intr_status = get_intr_status(dev))) { handled = 1; /* Acknowledge all of the current interrupt sources ASAP. */ if (intr_status & IntrTxDescRace) - writeb(0x08, ioaddr + IntrStatus2); - writew(intr_status & 0xffff, ioaddr + IntrStatus); + iowrite8(0x08, ioaddr + IntrStatus2); + iowrite16(intr_status & 0xffff, ioaddr + IntrStatus); IOSYNC; if (debug > 4) @@ -1361,9 +1352,9 @@ if (intr_status & (IntrTxErrSummary | IntrTxDone)) { if (intr_status & IntrTxErrSummary) { /* Avoid scavenging before Tx engine turned off */ - RHINE_WAIT_FOR(!(readb(ioaddr+ChipCmd) & CmdTxOn)); + RHINE_WAIT_FOR(!(ioread8(ioaddr+ChipCmd) & CmdTxOn)); if (debug > 2 && - readb(ioaddr+ChipCmd) & CmdTxOn) + ioread8(ioaddr+ChipCmd) & CmdTxOn) printk(KERN_WARNING "%s: " "rhine_interrupt() Tx engine" "still on.\n", dev->name); @@ -1387,7 +1378,7 @@ if (debug > 3) printk(KERN_DEBUG "%s: exiting interrupt, status=%8.8x.\n", - dev->name, readw(ioaddr + IntrStatus)); + dev->name, ioread16(ioaddr + IntrStatus)); return IRQ_RETVAL(handled); } @@ -1582,16 +1573,16 @@ * these, for others the counters are set to 1 when written to and * instead cleared when read. So we clear them both ways ... */ -static inline void clear_tally_counters(const long ioaddr) +static inline void clear_tally_counters(void __iomem *ioaddr) { - writel(0, ioaddr + RxMissed); - readw(ioaddr + RxCRCErrs); - readw(ioaddr + RxMissed); + iowrite32(0, ioaddr + RxMissed); + ioread16(ioaddr + RxCRCErrs); + ioread16(ioaddr + RxMissed); } static void rhine_restart_tx(struct net_device *dev) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; int entry = rp->dirty_tx % TX_RING_SIZE; u32 intr_status; @@ -1604,12 +1595,12 @@ if ((intr_status & IntrTxErrSummary) == 0) { /* We know better than the chip where it should continue. */ - writel(rp->tx_ring_dma + entry * sizeof(struct tx_desc), + iowrite32(rp->tx_ring_dma + entry * sizeof(struct tx_desc), ioaddr + TxRingPtr); - writeb(readb(ioaddr + ChipCmd) | CmdTxOn, + iowrite8(ioread8(ioaddr + ChipCmd) | CmdTxOn, ioaddr + ChipCmd); - writeb(readb(ioaddr + ChipCmd1) | Cmd1TxDemand, + iowrite8(ioread8(ioaddr + ChipCmd1) | Cmd1TxDemand, ioaddr + ChipCmd1); IOSYNC; } @@ -1626,15 +1617,15 @@ static void rhine_error(struct net_device *dev, int intr_status) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; spin_lock(&rp->lock); if (intr_status & IntrLinkChange) rhine_check_media(dev, 0); if (intr_status & IntrStatsMax) { - rp->stats.rx_crc_errors += readw(ioaddr + RxCRCErrs); - rp->stats.rx_missed_errors += readw(ioaddr + RxMissed); + rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs); + rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed); clear_tally_counters(ioaddr); } if (intr_status & IntrTxAborted) { @@ -1644,7 +1635,7 @@ } if (intr_status & IntrTxUnderrun) { if (rp->tx_thresh < 0xE0) - writeb(rp->tx_thresh += 0x20, ioaddr + TxConfig); + iowrite8(rp->tx_thresh += 0x20, ioaddr + TxConfig); if (debug > 1) printk(KERN_INFO "%s: Transmitter underrun, Tx " "threshold now %2.2x.\n", @@ -1659,7 +1650,7 @@ (intr_status & (IntrTxAborted | IntrTxUnderrun | IntrTxDescRace)) == 0) { if (rp->tx_thresh < 0xE0) { - writeb(rp->tx_thresh += 0x20, ioaddr + TxConfig); + iowrite8(rp->tx_thresh += 0x20, ioaddr + TxConfig); } if (debug > 1) printk(KERN_INFO "%s: Unspecified error. Tx " @@ -1684,12 +1675,12 @@ static struct net_device_stats *rhine_get_stats(struct net_device *dev) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; unsigned long flags; spin_lock_irqsave(&rp->lock, flags); - rp->stats.rx_crc_errors += readw(ioaddr + RxCRCErrs); - rp->stats.rx_missed_errors += readw(ioaddr + RxMissed); + rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs); + rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed); clear_tally_counters(ioaddr); spin_unlock_irqrestore(&rp->lock, flags); @@ -1699,7 +1690,7 @@ static void rhine_set_rx_mode(struct net_device *dev) { struct rhine_private *rp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; u32 mc_filter[2]; /* Multicast hash filter */ u8 rx_mode; /* Note: 0x02=accept runt, 0x01=accept errs */ @@ -1708,13 +1699,13 @@ printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name); rx_mode = 0x1C; - writel(0xffffffff, ioaddr + MulticastFilter0); - writel(0xffffffff, ioaddr + MulticastFilter1); + iowrite32(0xffffffff, ioaddr + MulticastFilter0); + iowrite32(0xffffffff, ioaddr + MulticastFilter1); } else if ((dev->mc_count > multicast_filter_limit) || (dev->flags & IFF_ALLMULTI)) { /* Too many to match, or accept all multicasts. */ - writel(0xffffffff, ioaddr + MulticastFilter0); - writel(0xffffffff, ioaddr + MulticastFilter1); + iowrite32(0xffffffff, ioaddr + MulticastFilter0); + iowrite32(0xffffffff, ioaddr + MulticastFilter1); rx_mode = 0x0C; } else { struct dev_mc_list *mclist; @@ -1726,11 +1717,11 @@ mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); } - writel(mc_filter[0], ioaddr + MulticastFilter0); - writel(mc_filter[1], ioaddr + MulticastFilter1); + iowrite32(mc_filter[0], ioaddr + MulticastFilter0); + iowrite32(mc_filter[1], ioaddr + MulticastFilter1); rx_mode = 0x0C; } - writeb(rp->rx_thresh | rx_mode, ioaddr + RxConfig); + iowrite8(rp->rx_thresh | rx_mode, ioaddr + RxConfig); } static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) @@ -1854,8 +1845,8 @@ static int rhine_close(struct net_device *dev) { - long ioaddr = dev->base_addr; struct rhine_private *rp = netdev_priv(dev); + void __iomem *ioaddr = rp->base; spin_lock_irq(&rp->lock); @@ -1864,16 +1855,16 @@ if (debug > 1) printk(KERN_DEBUG "%s: Shutting down ethercard, " "status was %4.4x.\n", - dev->name, readw(ioaddr + ChipCmd)); + dev->name, ioread16(ioaddr + ChipCmd)); /* Switch to loopback mode to avoid hardware races. */ - writeb(rp->tx_thresh | 0x02, ioaddr + TxConfig); + iowrite8(rp->tx_thresh | 0x02, ioaddr + TxConfig); /* Disable interrupts by clearing the interrupt mask. */ - writew(0x0000, ioaddr + IntrEnable); + iowrite16(0x0000, ioaddr + IntrEnable); /* Stop the chip's Tx and Rx processes. */ - writew(CmdStop, ioaddr + ChipCmd); + iowrite16(CmdStop, ioaddr + ChipCmd); spin_unlock_irq(&rp->lock); @@ -1889,15 +1880,13 @@ static void __devexit rhine_remove_one(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); + struct rhine_private *rp = netdev_priv(dev); unregister_netdev(dev); + pci_iounmap(pdev, rp->base); pci_release_regions(pdev); -#ifdef USE_MMIO - iounmap((char *)(dev->base_addr)); -#endif - free_netdev(dev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); @@ -1908,33 +1897,32 @@ struct pci_dev *pdev = to_pci_dev(gendev); struct net_device *dev = pci_get_drvdata(pdev); struct rhine_private *rp = netdev_priv(dev); - - long ioaddr = dev->base_addr; + void __iomem *ioaddr = rp->base; rhine_power_init(dev); /* Make sure we use pattern 0, 1 and not 4, 5 */ if (rp->quirks & rq6patterns) - writeb(0x04, ioaddr + 0xA7); + iowrite8(0x04, ioaddr + 0xA7); if (rp->wolopts & WAKE_MAGIC) - writeb(WOLmagic, ioaddr + WOLcrSet); + iowrite8(WOLmagic, ioaddr + WOLcrSet); if (rp->wolopts & (WAKE_BCAST|WAKE_MCAST)) - writeb(WOLbmcast, ioaddr + WOLcgSet); + iowrite8(WOLbmcast, ioaddr + WOLcgSet); if (rp->wolopts & WAKE_PHY) - writeb(WOLlnkon | WOLlnkoff, ioaddr + WOLcrSet); + iowrite8(WOLlnkon | WOLlnkoff, ioaddr + WOLcrSet); if (rp->wolopts & WAKE_UCAST) - writeb(WOLucast, ioaddr + WOLcrSet); + iowrite8(WOLucast, ioaddr + WOLcrSet); /* Enable legacy WOL (for old motherboards) */ - writeb(0x01, ioaddr + PwcfgSet); - writeb(readb(ioaddr + StickyHW) | 0x04, ioaddr + StickyHW); + iowrite8(0x01, ioaddr + PwcfgSet); + iowrite8(ioread8(ioaddr + StickyHW) | 0x04, ioaddr + StickyHW); /* Hit power state D3 (sleep) */ - writeb(readb(ioaddr + StickyHW) | 0x03, ioaddr + StickyHW); + iowrite8(ioread8(ioaddr + StickyHW) | 0x03, ioaddr + StickyHW); /* TODO: Check use of pci_enable_wake() */ diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c --- a/drivers/net/wireless/airo.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/airo.c 2004-10-26 18:34:29 -07:00 @@ -970,7 +970,7 @@ * Host receive descriptor */ typedef struct { - unsigned char *card_ram_off; /* offset into card memory of the + unsigned char __iomem *card_ram_off; /* offset into card memory of the desc */ RxFid rx_desc; /* card receive descriptor */ char *virtual_host_addr; /* virtual address of host receive @@ -982,7 +982,7 @@ * Host transmit descriptor */ typedef struct { - unsigned char *card_ram_off; /* offset into card memory of the + unsigned char __iomem *card_ram_off; /* offset into card memory of the desc */ TxFid tx_desc; /* card transmit descriptor */ char *virtual_host_addr; /* virtual address of host receive @@ -994,7 +994,7 @@ * Host RID descriptor */ typedef struct { - unsigned char *card_ram_off; /* offset into card memory of the + unsigned char __iomem *card_ram_off; /* offset into card memory of the descriptor */ Rid rid_desc; /* card RID descriptor */ char *virtual_host_addr; /* virtual address of host receive @@ -1203,8 +1203,8 @@ unsigned long ridbus; // phys addr of config_desc struct sk_buff_head txq;// tx queue used by mpi350 code struct pci_dev *pci; - unsigned char *pcimem; - unsigned char *pciaux; + unsigned char __iomem *pcimem; + unsigned char __iomem *pciaux; unsigned char *shared; dma_addr_t shared_dma; int power; @@ -2029,8 +2029,8 @@ memcpy(sendbuf, buffer, len); } - memcpy((char *)ai->txfids[0].card_ram_off, - (char *)&ai->txfids[0].tx_desc, sizeof(TxFid)); + memcpy_toio(ai->txfids[0].card_ram_off, + &ai->txfids[0].tx_desc, sizeof(TxFid)); OUT4500(ai, EVACK, 8); @@ -2460,7 +2460,7 @@ } for (i=0; irxfids[i].card_ram_off, + memcpy_toio(ai->rxfids[i].card_ram_off, &ai->rxfids[i].rx_desc, sizeof(RxFid)); } @@ -2476,7 +2476,7 @@ for (i=0; itxfids[i].tx_desc.valid = 1; - memcpy((char *)ai->txfids[i].card_ram_off, + memcpy_toio(ai->txfids[i].card_ram_off, &ai->txfids[i].tx_desc, sizeof(TxFid)); } ai->txfids[i-1].tx_desc.eoc = 1; /* Last descriptor has EOC set */ @@ -2501,8 +2501,8 @@ return rc; } - memcpy((char *)ai->config_desc.card_ram_off, - (char *)&ai->config_desc.rid_desc, sizeof(Rid)); + memcpy_toio(ai->config_desc.card_ram_off, + &ai->config_desc.rid_desc, sizeof(Rid)); return rc; } @@ -2520,7 +2520,7 @@ int rc = -1; int i; unsigned char *busaddroff,*vpackoff; - unsigned char *pciaddroff; + unsigned char __iomem *pciaddroff; mem_start = pci_resource_start(pci, 1); mem_len = pci_resource_len(pci, 1); @@ -3441,7 +3441,7 @@ MICBuffer micbuf; #endif - memcpy ((char *)&rxd, ai->rxfids[0].card_ram_off, sizeof(rxd)); + memcpy_fromio(&rxd, ai->rxfids[0].card_ram_off, sizeof(rxd)); /* Make sure we got something */ if (rxd.rdy && rxd.valid == 0) { len = rxd.len + 12; @@ -3504,7 +3504,7 @@ rxd.valid = 1; rxd.rdy = 0; rxd.len = PKTSIZE; - memcpy (ai->rxfids[0].card_ram_off, (char *)&rxd, sizeof(rxd)); + memcpy_toio(ai->rxfids[0].card_ram_off, &rxd, sizeof(rxd)); } } @@ -3526,7 +3526,7 @@ u16 *buffer; char *ptr = ai->rxfids[0].virtual_host_addr+4; - memcpy ((char *)&rxd, ai->rxfids[0].card_ram_off, sizeof(rxd)); + memcpy_fromio(&rxd, ai->rxfids[0].card_ram_off, sizeof(rxd)); memcpy ((char *)&hdr, ptr, sizeof(hdr)); ptr += sizeof(hdr); /* Bad CRC. Ignore packet */ @@ -3610,7 +3610,7 @@ rxd.valid = 1; rxd.rdy = 0; rxd.len = PKTSIZE; - memcpy (ai->rxfids[0].card_ram_off, (char *)&rxd, sizeof(rxd)); + memcpy_toio(ai->rxfids[0].card_ram_off, &rxd, sizeof(rxd)); } } @@ -3990,8 +3990,8 @@ cmd.cmd = CMD_ACCESS; cmd.parm0 = rid; - memcpy((char *)ai->config_desc.card_ram_off, - (char *)&ai->config_desc.rid_desc, sizeof(Rid)); + memcpy_toio(ai->config_desc.card_ram_off, + &ai->config_desc.rid_desc, sizeof(Rid)); rc = issuecommand(ai, &cmd, &rsp); @@ -4062,8 +4062,8 @@ cmd.cmd = CMD_WRITERID; cmd.parm0 = rid; - memcpy((char *)ai->config_desc.card_ram_off, - (char *)&ai->config_desc.rid_desc, sizeof(Rid)); + memcpy_toio(ai->config_desc.card_ram_off, + &ai->config_desc.rid_desc, sizeof(Rid)); if (len < 4 || len > 2047) { printk(KERN_ERR "%s: len=%d\n",__FUNCTION__,len); @@ -7591,7 +7591,7 @@ /* Write stuff */ if (test_bit(FLAG_MPI,&ai->flags)) - memcpy(ai->pciaux + 0x8000, ai->flash, FLASHSIZE); + memcpy_toio(ai->pciaux + 0x8000, ai->flash, FLASHSIZE); else { OUT4500(ai,AUXPAGE,0x100); OUT4500(ai,AUXOFF,0); diff -Nru a/drivers/net/wireless/airport.c b/drivers/net/wireless/airport.c --- a/drivers/net/wireless/airport.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/airport.c 2004-10-26 18:34:29 -07:00 @@ -45,7 +45,7 @@ struct airport { struct macio_dev *mdev; - void *vaddr; + void __iomem *vaddr; int irq_requested; int ndev_registered; }; @@ -232,8 +232,7 @@ goto failed; } - hermes_struct_init(hw, (ulong)card->vaddr, - HERMES_MEM, HERMES_16BIT_REGSPACING); + hermes_struct_init(hw, card->vaddr, HERMES_16BIT_REGSPACING); /* Power up card */ pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(mdev), 0, 1); diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/arlan-main.c 2004-10-26 18:34:29 -07:00 @@ -129,7 +129,7 @@ static inline int arlan_drop_tx(struct net_device *dev) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); priv->stats.tx_errors++; if (priv->Conf->tx_delay_ms) @@ -152,8 +152,8 @@ int arlan_command(struct net_device *dev, int command_p) { - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; struct arlan_conf_stru *conf = priv->Conf; int udelayed = 0; int i = 0; @@ -368,7 +368,7 @@ if (!registrationBad(dev)) { setInterruptEnable(dev); - memset_io((void *) arlan->commandParameter, 0, 0xf); + memset_io(arlan->commandParameter, 0, 0xf); WRITESHMB(arlan->commandByte, ARLAN_COM_INT | ARLAN_COM_RX_ENABLE); WRITESHMB(arlan->commandParameter[0], conf->rxParameter); arlan_interrupt_lancpu(dev); @@ -398,9 +398,9 @@ priv->last_rx_int_ack_time + us2ticks(conf->rx_tweak2))) { setInterruptEnable(dev); - memset_io((void *) arlan->commandParameter, 0, 0xf); + memset_io(arlan->commandParameter, 0, 0xf); WRITESHMB(arlan->commandByte, ARLAN_COM_TX_ENABLE | ARLAN_COM_INT); - memcpy_toio((void *) arlan->commandParameter, &TXLAST(dev), 14); + memcpy_toio(arlan->commandParameter, &TXLAST(dev), 14); // for ( i=1 ; i < 15 ; i++) printk("%02x:",READSHMB(arlan->commandParameter[i])); priv->tx_last_sent = jiffies; arlan_interrupt_lancpu(dev); @@ -481,7 +481,7 @@ static inline void arlan_command_process(struct net_device *dev) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); int times = 0; while (priv->waiting_command_mask && times < 8) @@ -502,7 +502,7 @@ static inline void arlan_retransmit_now(struct net_device *dev) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); ARLAN_DEBUG_ENTRY("arlan_retransmit_now"); @@ -540,7 +540,7 @@ static void arlan_registration_timer(unsigned long data) { struct net_device *dev = (struct net_device *) data; - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); int bh_mark_needed = 0; int next_tick = 1; long lostTime = ((long)jiffies - (long)priv->registrationLastSeen) @@ -633,7 +633,7 @@ static void arlan_print_registers(struct net_device *dev, int line) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); volatile struct arlan_shmem *arlan = priv->card; u_char hostcpuLock, lancpuLock, controlRegister, cntrlRegImage, @@ -663,8 +663,8 @@ { int i; - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; struct arlan_conf_stru *conf = priv->Conf; int tailStarts = 0x800; @@ -673,9 +673,9 @@ ARLAN_DEBUG_ENTRY("arlan_hw_tx"); if (TXHEAD(dev).offset) - headEnds = (((TXHEAD(dev).offset + TXHEAD(dev).length - (((int) arlan->txBuffer) - ((int) arlan))) / 64) + 1) * 64; + headEnds = (((TXHEAD(dev).offset + TXHEAD(dev).length - offsetof(struct arlan_shmem, txBuffer)) / 64) + 1) * 64; if (TXTAIL(dev).offset) - tailStarts = 0x800 - (((TXTAIL(dev).offset - (((int) arlan->txBuffer) - ((int) arlan))) / 64) + 2) * 64; + tailStarts = 0x800 - (((TXTAIL(dev).offset - offsetof(struct arlan_shmem, txBuffer)) / 64) + 2) * 64; if (!TXHEAD(dev).offset && length < tailStarts) @@ -684,7 +684,7 @@ printk(KERN_ERR "TXHEAD insert, tailStart %d\n", tailStarts); TXHEAD(dev).offset = - (((int) arlan->txBuffer) - ((int) arlan)); + offsetof(struct arlan_shmem, txBuffer); TXHEAD(dev).length = length - ARLAN_FAKE_HDR_LEN; for (i = 0; i < 6; i++) TXHEAD(dev).dest[i] = buf[i]; @@ -692,7 +692,7 @@ TXHEAD(dev).retries = conf->txRetries; /* 0 is use default */ TXHEAD(dev).routing = conf->txRouting; TXHEAD(dev).scrambled = conf->txScrambled; - memcpy_toio(((char *) arlan + TXHEAD(dev).offset), buf + ARLAN_FAKE_HDR_LEN, TXHEAD(dev).length); + memcpy_toio((char __iomem *)arlan + TXHEAD(dev).offset, buf + ARLAN_FAKE_HDR_LEN, TXHEAD(dev).length); } else if (!TXTAIL(dev).offset && length < (0x800 - headEnds)) { @@ -700,7 +700,7 @@ printk(KERN_ERR "TXTAIL insert, headEnd %d\n", headEnds); TXTAIL(dev).offset = - (((int) arlan->txBuffer) - ((int) arlan)) + 0x800 - (length / 64 + 2) * 64; + offsetof(struct arlan_shmem, txBuffer) + 0x800 - (length / 64 + 2) * 64; TXTAIL(dev).length = length - ARLAN_FAKE_HDR_LEN; for (i = 0; i < 6; i++) TXTAIL(dev).dest[i] = buf[i]; @@ -708,7 +708,7 @@ TXTAIL(dev).retries = conf->txRetries; TXTAIL(dev).routing = conf->txRouting; TXTAIL(dev).scrambled = conf->txScrambled; - memcpy_toio(((char *) arlan + TXTAIL(dev).offset), buf + ARLAN_FAKE_HDR_LEN, TXTAIL(dev).length); + memcpy_toio(((char __iomem *)arlan + TXTAIL(dev).offset), buf + ARLAN_FAKE_HDR_LEN, TXTAIL(dev).length); } else { @@ -764,8 +764,8 @@ static int arlan_hw_config(struct net_device *dev) { - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; struct arlan_conf_stru *conf = priv->Conf; ARLAN_DEBUG_ENTRY("arlan_hw_config"); @@ -847,8 +847,8 @@ static int arlan_read_card_configuration(struct net_device *dev) { u_char tlx415; - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; struct arlan_conf_stru *conf = priv->Conf; ARLAN_DEBUG_ENTRY("arlan_read_card_configuration"); @@ -972,7 +972,7 @@ static int __init arlan_check_fingerprint(unsigned long memaddr) { static const char probeText[] = "TELESYSTEM SLW INC. ARLAN \0"; - volatile struct arlan_shmem *arlan = (struct arlan_shmem *) memaddr; + volatile struct arlan_shmem __iomem *arlan = (struct arlan_shmem *) memaddr; unsigned long paddr = virt_to_phys((void *) memaddr); char tempBuf[49]; @@ -1000,7 +1000,7 @@ static int arlan_change_mtu(struct net_device *dev, int new_mtu) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); struct arlan_conf_stru *conf = priv->Conf; ARLAN_DEBUG_ENTRY("arlan_change_mtu"); @@ -1040,7 +1040,7 @@ static int __init arlan_setup_device(struct net_device *dev, int num) { - struct arlan_private *ap = dev->priv; + struct arlan_private *ap = netdev_priv(dev); int err; ARLAN_DEBUG_ENTRY("arlan_setup_device"); @@ -1081,7 +1081,7 @@ static int __init arlan_probe_here(struct net_device *dev, unsigned long memaddr) { - struct arlan_private *ap = dev->priv; + struct arlan_private *ap = netdev_priv(dev); ARLAN_DEBUG_ENTRY("arlan_probe_here"); @@ -1110,8 +1110,8 @@ static int arlan_open(struct net_device *dev) { - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; int ret = 0; ARLAN_DEBUG_ENTRY("arlan_open"); @@ -1208,7 +1208,7 @@ static inline int DoNotReTransmitCrap(struct net_device *dev) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); if (TXLAST(dev).length < priv->Conf->ReTransmitPacketMaxSize) return 1; @@ -1218,7 +1218,7 @@ static inline int DoNotWaitReTransmitCrap(struct net_device *dev) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); if (TXLAST(dev).length < priv->Conf->waitReTransmitPacketMaxSize) return 1; @@ -1227,7 +1227,7 @@ static inline void arlan_queue_retransmit(struct net_device *dev) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); ARLAN_DEBUG_ENTRY("arlan_queue_retransmit"); @@ -1242,7 +1242,7 @@ static inline void RetryOrFail(struct net_device *dev) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); ARLAN_DEBUG_ENTRY("RetryOrFail"); @@ -1263,7 +1263,7 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); ARLAN_DEBUG_ENTRY("arlan_tx_done_interrupt"); @@ -1405,8 +1405,8 @@ char *skbtmp; int i = 0; - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; struct arlan_conf_stru *conf = priv->Conf; @@ -1509,7 +1509,7 @@ skb->dev = dev; skbtmp = skb_put(skb, pkt_len); - memcpy_fromio(skbtmp + ARLAN_FAKE_HDR_LEN, ((char *) arlan) + rxOffset, pkt_len - ARLAN_FAKE_HDR_LEN); + memcpy_fromio(skbtmp + ARLAN_FAKE_HDR_LEN, ((char __iomem *) arlan) + rxOffset, pkt_len - ARLAN_FAKE_HDR_LEN); memcpy_fromio(skbtmp, arlan->ultimateDestAddress, 6); memcpy_fromio(skbtmp + 6, arlan->rxSrc, 6); WRITESHMB(arlan->rxStatus, 0x00); @@ -1557,8 +1557,8 @@ static void arlan_process_interrupt(struct net_device *dev) { - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; u_char rxStatus = READSHMB(arlan->rxStatus); u_char txStatus = READSHMB(arlan->txStatus); u_short rxOffset = READSHMS(arlan->rxOffset); @@ -1660,8 +1660,8 @@ static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; u_char rxStatus = READSHMB(arlan->rxStatus); u_char txStatus = READSHMB(arlan->txStatus); @@ -1683,7 +1683,7 @@ static int arlan_close(struct net_device *dev) { - struct arlan_private *priv = dev->priv; + struct arlan_private *priv = netdev_priv(dev); ARLAN_DEBUG_ENTRY("arlan_close"); @@ -1717,8 +1717,8 @@ static struct net_device_stats *arlan_statistics(struct net_device *dev) { - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; ARLAN_DEBUG_ENTRY("arlan_statistics"); @@ -1747,8 +1747,8 @@ static void arlan_set_multicast(struct net_device *dev) { - struct arlan_private *priv = dev->priv; - volatile struct arlan_shmem *arlan = priv->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; struct arlan_conf_stru *conf = priv->Conf; int board_conf_needed = 0; diff -Nru a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c --- a/drivers/net/wireless/arlan-proc.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/arlan-proc.c 2004-10-26 18:34:29 -07:00 @@ -58,7 +58,8 @@ static const char *arlan_diagnostic_info_string(struct net_device *dev) { - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; u_char diagnosticInfo; READSHM(diagnosticInfo, arlan->diagnosticInfo, u_char); @@ -113,7 +114,8 @@ static const char *arlan_hardware_type_string(struct net_device *dev) { u_char hardwareType; - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; READSHM(hardwareType, arlan->hardwareType, u_char); switch (hardwareType) @@ -189,7 +191,8 @@ u_char diagnosticInfo; u_short diagnosticOffset; u_char hardwareType; - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; // ARLAN_DEBUG_ENTRY("arlan_print_diagnostic_info"); @@ -254,7 +257,8 @@ int i; int memlen = sizeof(struct arlan_shmem) - 0xF; /* avoid control register */ volatile char *arlan_mem = (char *) (dev->mem_start); - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; char pattern; ptr = NULL; @@ -319,7 +323,8 @@ static int arlan_setup_card_by_book(struct net_device *dev) { u_char irqLevel, configuredStatusFlag; - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_private *priv = netdev_priv(dev); + volatile struct arlan_shmem __iomem *arlan = priv->card; // ARLAN_DEBUG_ENTRY("arlan_setup_card"); diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/arlan.h 2004-10-26 18:34:29 -07:00 @@ -332,7 +332,7 @@ /* Information that need to be kept for each board. */ struct arlan_private { struct net_device_stats stats; - struct arlan_shmem * card; + struct arlan_shmem __iomem * card; struct arlan_shmem * conf; struct arlan_conf_stru * Conf; @@ -403,14 +403,12 @@ #define ARLAN_COM_INT 0x80 -#define TXLAST(dev) (((struct arlan_private *)dev->priv)->txRing[((struct arlan_private *)dev->priv)->txLast]) -#define TXHEAD(dev) (((struct arlan_private *)dev->priv)->txRing[0]) -#define TXTAIL(dev) (((struct arlan_private *)dev->priv)->txRing[1]) - -#define TXBuffStart(dev) \ - ((int)(((struct arlan_private *)dev->priv)->card)->txBuffer) - ((int)(((struct arlan_private *)dev->priv)->card) ) -#define TXBuffEnd(dev) \ - ((int)(((struct arlan_private *)dev->priv)->card)->rxBuffer) - ((int)(((struct arlan_private *)dev->priv)->card) +#define TXLAST(dev) (((struct arlan_private *)netdev_priv(dev))->txRing[((struct arlan_private *)netdev_priv(dev))->txLast]) +#define TXHEAD(dev) (((struct arlan_private *)netdev_priv(dev))->txRing[0]) +#define TXTAIL(dev) (((struct arlan_private *)netdev_priv(dev))->txRing[1]) + +#define TXBuffStart(dev) offsetof(struct arlan_shmem, txBuffer) +#define TXBuffEnd(dev) offsetof(struct arlan_shmem, xxBuffer) #define READSHM(to,from,atype) {\ atype tmp;\ @@ -451,16 +449,16 @@ #define registrationBad(dev)\ - ( ( READSHMB(((struct arlan_private *)dev->priv)->card->registrationMode) > 0) && \ - ( READSHMB(((struct arlan_private *)dev->priv)->card->registrationStatus) == 0) ) + ( ( READSHMB(((struct arlan_private *)netdev_priv(dev))->card->registrationMode) > 0) && \ + ( READSHMB(((struct arlan_private *)netdev_priv(dev))->card->registrationStatus) == 0) ) #define readControlRegister(dev)\ - READSHMB(((struct arlan_private *)dev->priv)->card->cntrlRegImage) + READSHMB(((struct arlan_private *)netdev_priv(dev))->card->cntrlRegImage) #define writeControlRegister(dev, v){\ - WRITESHMB(((struct arlan_private *)dev->priv)->card->cntrlRegImage ,((v) &0xF) );\ - WRITESHMB(((struct arlan_private *)dev->priv)->card->controlRegister ,(v) );} + WRITESHMB(((struct arlan_private *)netdev_priv(dev))->card->cntrlRegImage ,((v) &0xF) );\ + WRITESHMB(((struct arlan_private *)netdev_priv(dev))->card->controlRegister ,(v) );} #define arlan_interrupt_lancpu(dev) {\ diff -Nru a/drivers/net/wireless/hermes.c b/drivers/net/wireless/hermes.c --- a/drivers/net/wireless/hermes.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/hermes.c 2004-10-26 18:34:29 -07:00 @@ -67,8 +67,7 @@ * Debugging helpers */ -#define IO_TYPE(hw) ((hw)->io_space ? "IO " : "MEM ") -#define DMSG(stuff...) do {printk(KERN_DEBUG "hermes @ %s0x%x: " , IO_TYPE(hw), hw->iobase); \ +#define DMSG(stuff...) do {printk(KERN_DEBUG "hermes @ %p: " , hw->iobase); \ printk(stuff);} while (0) #undef HERMES_DEBUG @@ -123,11 +122,9 @@ * Function definitions */ -void hermes_struct_init(hermes_t *hw, ulong address, - int io_space, int reg_spacing) +void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing) { hw->iobase = address; - hw->io_space = io_space; hw->reg_spacing = reg_spacing; hw->inten = 0x0; @@ -200,9 +197,9 @@ } if (! (reg & HERMES_EV_CMD)) { - printk(KERN_ERR "hermes @ %s0x%lx: " + printk(KERN_ERR "hermes @ %p: " "Timeout waiting for card to reset (reg=0x%04x)!\n", - IO_TYPE(hw), hw->iobase, reg); + hw->iobase, reg); err = -ETIMEDOUT; goto out; } @@ -235,13 +232,13 @@ err = hermes_issue_cmd(hw, cmd, parm0); if (err) { if (! hermes_present(hw)) { - printk(KERN_WARNING "hermes @ %s0x%lx: " + printk(KERN_WARNING "hermes @ %p: " "Card removed while issuing command.\n", - IO_TYPE(hw), hw->iobase); + hw->iobase); err = -ENODEV; } else - printk(KERN_ERR "hermes @ %s0x%lx: Error %d issuing command.\n", - IO_TYPE(hw), hw->iobase, err); + printk(KERN_ERR "hermes @ %p: Error %d issuing command.\n", + hw->iobase, err); goto out; } @@ -254,17 +251,17 @@ } if (! hermes_present(hw)) { - printk(KERN_WARNING "hermes @ %s0x%lx: " + printk(KERN_WARNING "hermes @ %p: " "Card removed while waiting for command completion.\n", - IO_TYPE(hw), hw->iobase); + hw->iobase); err = -ENODEV; goto out; } if (! (reg & HERMES_EV_CMD)) { - printk(KERN_ERR "hermes @ %s0x%lx: " + printk(KERN_ERR "hermes @ %p: " "Timeout waiting for command completion.\n", - IO_TYPE(hw), hw->iobase); + hw->iobase); err = -ETIMEDOUT; goto out; } @@ -309,16 +306,16 @@ } if (! hermes_present(hw)) { - printk(KERN_WARNING "hermes @ %s0x%lx: " + printk(KERN_WARNING "hermes @ %p: " "Card removed waiting for frame allocation.\n", - IO_TYPE(hw), hw->iobase); + hw->iobase); return -ENODEV; } if (! (reg & HERMES_EV_ALLOC)) { - printk(KERN_ERR "hermes @ %s0x%lx: " + printk(KERN_ERR "hermes @ %p: " "Timeout waiting for frame allocation\n", - IO_TYPE(hw), hw->iobase); + hw->iobase); return -ETIMEDOUT; } @@ -484,14 +481,14 @@ *length = rlength; if (rtype != rid) - printk(KERN_WARNING "hermes @ %s0x%lx: " + printk(KERN_WARNING "hermes @ %p: " "hermes_read_ltv(): rid (0x%04x) does not match type (0x%04x)\n", - IO_TYPE(hw), hw->iobase, rid, rtype); + hw->iobase, rid, rtype); if (HERMES_RECLEN_TO_BYTES(rlength) > bufsize) - printk(KERN_WARNING "hermes @ %s0x%lx: " + printk(KERN_WARNING "hermes @ %p: " "Truncating LTV record from %d to %d bytes. " "(rid=0x%04x, len=0x%04x)\n", - IO_TYPE(hw), hw->iobase, + hw->iobase, HERMES_RECLEN_TO_BYTES(rlength), bufsize, rid, rlength); nwords = min((unsigned)rlength - 1, bufsize / 2); diff -Nru a/drivers/net/wireless/hermes.h b/drivers/net/wireless/hermes.h --- a/drivers/net/wireless/hermes.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/hermes.h 2004-10-26 18:34:29 -07:00 @@ -344,10 +344,7 @@ /* Basic control structure */ typedef struct hermes { - unsigned long iobase; - int io_space; /* 1 if we IO-mapped IO, 0 for memory-mapped IO? */ -#define HERMES_IO 1 -#define HERMES_MEM 0 + void __iomem *iobase; int reg_spacing; #define HERMES_16BIT_REGSPACING 0 #define HERMES_32BIT_REGSPACING 1 @@ -362,21 +359,15 @@ } hermes_t; /* Register access convenience macros */ -#define hermes_read_reg(hw, off) ((hw)->io_space ? \ - inw((hw)->iobase + ( (off) << (hw)->reg_spacing )) : \ - readw((hw)->iobase + ( (off) << (hw)->reg_spacing ))) -#define hermes_write_reg(hw, off, val) do { \ - if ((hw)->io_space) \ - outw_p((val), (hw)->iobase + ((off) << (hw)->reg_spacing)); \ - else \ - writew((val), (hw)->iobase + ((off) << (hw)->reg_spacing)); \ - } while (0) +#define hermes_read_reg(hw, off) \ + (ioread16((hw)->iobase + ( (off) << (hw)->reg_spacing ))) +#define hermes_write_reg(hw, off, val) \ + (iowrite16((val), (hw)->iobase + ((off) << (hw)->reg_spacing))) #define hermes_read_regn(hw, name) hermes_read_reg((hw), HERMES_##name) #define hermes_write_regn(hw, name, val) hermes_write_reg((hw), HERMES_##name, (val)) /* Function prototypes */ -void hermes_struct_init(hermes_t *hw, ulong address, int io_space, - int reg_spacing); +void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing); int hermes_init(hermes_t *hw); int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0, struct hermes_response *resp); @@ -430,41 +421,13 @@ static inline void hermes_read_words(struct hermes *hw, int off, void *buf, unsigned count) { off = off << hw->reg_spacing; - - if (hw->io_space) { - insw(hw->iobase + off, buf, count); - } else { - unsigned i; - u16 *p; - - /* This needs to *not* byteswap (like insw()) but - * readw() does byteswap hence the conversion. I hope - * gcc is smart enough to fold away the two swaps on - * big-endian platforms. */ - for (i = 0, p = buf; i < count; i++) { - *p++ = cpu_to_le16(readw(hw->iobase + off)); - } - } + ioread16_rep(hw->iobase + off, buf, count); } static inline void hermes_write_words(struct hermes *hw, int off, const void *buf, unsigned count) { off = off << hw->reg_spacing; - - if (hw->io_space) { - outsw(hw->iobase + off, buf, count); - } else { - unsigned i; - const u16 *p; - - /* This needs to *not* byteswap (like outsw()) but - * writew() does byteswap hence the conversion. I - * hope gcc is smart enough to fold away the two swaps - * on big-endian platforms. */ - for (i = 0, p = buf; i < count; i++) { - writew(le16_to_cpu(*p++), hw->iobase + off); - } - } + iowrite16_rep(hw->iobase + off, buf, count); } static inline void hermes_clear_words(struct hermes *hw, int off, unsigned count) @@ -473,13 +436,8 @@ off = off << hw->reg_spacing; - if (hw->io_space) { - for (i = 0; i < count; i++) - outw(0, hw->iobase + off); - } else { - for (i = 0; i < count; i++) - writew(0, hw->iobase + off); - } + for (i = 0; i < count; i++) + iowrite16(0, hw->iobase + off); } #define HERMES_READ_RECORD(hw, bap, rid, buf) \ diff -Nru a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c --- a/drivers/net/wireless/netwave_cs.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/netwave_cs.c 2004-10-26 18:34:29 -07:00 @@ -213,7 +213,7 @@ static void netwave_detach(dev_link_t *); /* Destroy instance */ /* Hardware configuration */ -static void netwave_doreset(ioaddr_t iobase, u_char* ramBase); +static void netwave_doreset(ioaddr_t iobase, u_char __iomem *ramBase); static void netwave_reset(struct net_device *dev); /* Misc device stuff */ @@ -321,7 +321,7 @@ dev_link_t link; spinlock_t spinlock; /* Serialize access to the hardware (SMP) */ dev_node_t node; - u_char *ramBase; + u_char __iomem *ramBase; int timeoutCounter; int lastExec; struct timer_list watchdog; /* To avoid blocking state */ @@ -340,12 +340,12 @@ * The Netwave card is little-endian, so won't work for big endian * systems. */ -static inline unsigned short get_uint16(u_char* staddr) +static inline unsigned short get_uint16(u_char __iomem *staddr) { return readw(staddr); /* Return only 16 bits */ } -static inline short get_int16(u_char* staddr) +static inline short get_int16(u_char __iomem * staddr) { return readw(staddr); } @@ -362,7 +362,7 @@ } #ifdef WIRELESS_EXT -static void netwave_snapshot(netwave_private *priv, u_char *ramBase, +static void netwave_snapshot(netwave_private *priv, u_char __iomem *ramBase, ioaddr_t iobase) { u_short resultBuffer; @@ -397,8 +397,8 @@ { unsigned long flags; ioaddr_t iobase = dev->base_addr; - netwave_private *priv = (netwave_private *) dev->priv; - u_char *ramBase = priv->ramBase; + netwave_private *priv = netdev_priv(dev); + u_char __iomem *ramBase = priv->ramBase; struct iw_statistics* wstats; wstats = &priv->iw_stats; @@ -446,7 +446,7 @@ dev = alloc_etherdev(sizeof(netwave_private)); if (!dev) return NULL; - priv = dev->priv; + priv = netdev_priv(dev); link = &priv->link; link->priv = dev; @@ -589,8 +589,8 @@ { unsigned long flags; ioaddr_t iobase = dev->base_addr; - netwave_private *priv = (netwave_private *) dev->priv; - u_char *ramBase = priv->ramBase; + netwave_private *priv = netdev_priv(dev); + u_char __iomem *ramBase = priv->ramBase; /* Disable interrupts & save flags */ spin_lock_irqsave(&priv->spinlock, flags); @@ -647,8 +647,8 @@ { unsigned long flags; ioaddr_t iobase = dev->base_addr; - netwave_private *priv = (netwave_private *) dev->priv; - u_char *ramBase = priv->ramBase; + netwave_private *priv = netdev_priv(dev); + u_char __iomem *ramBase = priv->ramBase; /* Disable interrupts & save flags */ spin_lock_irqsave(&priv->spinlock, flags); @@ -763,8 +763,8 @@ { unsigned long flags; ioaddr_t iobase = dev->base_addr; - netwave_private *priv = (netwave_private *) dev->priv; - u_char *ramBase = priv->ramBase; + netwave_private *priv = netdev_priv(dev); + u_char __iomem *ramBase = priv->ramBase; /* Disable interrupts & save flags */ spin_lock_irqsave(&priv->spinlock, flags); @@ -996,14 +996,14 @@ static void netwave_pcmcia_config(dev_link_t *link) { client_handle_t handle = link->handle; struct net_device *dev = link->priv; - netwave_private *priv = dev->priv; + netwave_private *priv = netdev_priv(dev); tuple_t tuple; cisparse_t parse; int i, j, last_ret, last_fn; u_char buf[64]; win_req_t req; memreq_t mem; - u_char *ramBase = NULL; + u_char __iomem *ramBase = NULL; DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link); @@ -1069,7 +1069,7 @@ /* Store base address of the common window frame */ ramBase = ioremap(req.Base, 0x8000); - ((netwave_private*)dev->priv)->ramBase = ramBase; + priv->ramBase = ramBase; dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; @@ -1118,7 +1118,7 @@ static void netwave_release(dev_link_t *link) { struct net_device *dev = link->priv; - netwave_private *priv = dev->priv; + netwave_private *priv = netdev_priv(dev); DEBUG(0, "netwave_release(0x%p)\n", link); @@ -1149,7 +1149,8 @@ * */ static int netwave_event(event_t event, int priority, - event_callback_args_t *args) { + event_callback_args_t *args) +{ dev_link_t *link = args->client_data; struct net_device *dev = link->priv; @@ -1202,7 +1203,8 @@ * * Proper hardware reset of the card. */ -static void netwave_doreset(ioaddr_t ioBase, u_char* ramBase) { +static void netwave_doreset(ioaddr_t ioBase, u_char __iomem *ramBase) +{ /* Reset card */ wait_WOC(ioBase); outb(0x80, ioBase + NETWAVE_REG_PMR); @@ -1217,8 +1219,8 @@ */ static void netwave_reset(struct net_device *dev) { /* u_char state; */ - netwave_private *priv = (netwave_private*) dev->priv; - u_char *ramBase = priv->ramBase; + netwave_private *priv = netdev_priv(dev); + u_char __iomem *ramBase = priv->ramBase; ioaddr_t iobase = dev->base_addr; DEBUG(0, "netwave_reset: Done with hardware reset\n"); @@ -1298,8 +1300,8 @@ DataOffset; int tmpcount; - netwave_private *priv = (netwave_private *) dev->priv; - u_char* ramBase = priv->ramBase; + netwave_private *priv = netdev_priv(dev); + u_char __iomem * ramBase = priv->ramBase; ioaddr_t iobase = dev->base_addr; /* Disable interrupts & save flags */ @@ -1390,11 +1392,12 @@ * ready to transmit another packet. * 3. A command has completed execution. */ -static irqreturn_t netwave_interrupt(int irq, void* dev_id, struct pt_regs *regs) { +static irqreturn_t netwave_interrupt(int irq, void* dev_id, struct pt_regs *regs) +{ ioaddr_t iobase; - u_char *ramBase; + u_char __iomem *ramBase; struct net_device *dev = (struct net_device *)dev_id; - struct netwave_private *priv = dev->priv; + struct netwave_private *priv = netdev_priv(dev); dev_link_t *link = &priv->link; int i; @@ -1524,7 +1527,7 @@ } /* netwave_watchdog */ static struct net_device_stats *netwave_get_stats(struct net_device *dev) { - netwave_private *priv = (netwave_private*)dev->priv; + netwave_private *priv = netdev_priv(dev); update_stats(dev); @@ -1547,7 +1550,7 @@ static void update_stats(struct net_device *dev) { //unsigned long flags; -/* netwave_private *priv = (netwave_private*) dev->priv; */ +/* netwave_private *priv = netdev_priv(dev); */ //spin_lock_irqsave(&priv->spinlock, flags); @@ -1557,9 +1560,10 @@ //spin_unlock_irqrestore(&priv->spinlock, flags); } -static int netwave_rx(struct net_device *dev) { - netwave_private *priv = (netwave_private*)(dev->priv); - u_char *ramBase = priv->ramBase; +static int netwave_rx(struct net_device *dev) +{ + netwave_private *priv = netdev_priv(dev); + u_char __iomem *ramBase = priv->ramBase; ioaddr_t iobase = dev->base_addr; u_char rxStatus; struct sk_buff *skb = NULL; @@ -1647,7 +1651,7 @@ } static int netwave_open(struct net_device *dev) { - netwave_private *priv = dev->priv; + netwave_private *priv = netdev_priv(dev); dev_link_t *link = &priv->link; DEBUG(1, "netwave_open: starting.\n"); @@ -1664,7 +1668,7 @@ } static int netwave_close(struct net_device *dev) { - netwave_private *priv = (netwave_private *)dev->priv; + netwave_private *priv = netdev_priv(dev); dev_link_t *link = &priv->link; DEBUG(1, "netwave_close: finishing.\n"); @@ -1709,7 +1713,8 @@ static void set_multicast_list(struct net_device *dev) { ioaddr_t iobase = dev->base_addr; - u_char* ramBase = ((netwave_private*) dev->priv)->ramBase; + netwave_private *priv = netdev_priv(dev); + u_char __iomem * ramBase = priv->ramBase; u_char rcvMode = 0; #ifdef PCMCIA_DEBUG diff -Nru a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c --- a/drivers/net/wireless/orinoco_cs.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/orinoco_cs.c 2004-10-26 18:34:29 -07:00 @@ -276,6 +276,7 @@ cisinfo_t info; tuple_t tuple; cisparse_t parse; + void __iomem *mem; CS_CHECK(ValidateCIS, pcmcia_validate_cis(handle, &info)); @@ -435,8 +436,11 @@ /* We initialize the hermes structure before completing PCMCIA * configuration just in case the interrupt handler gets * called. */ - hermes_struct_init(hw, link->io.BasePort1, - HERMES_IO, HERMES_16BIT_REGSPACING); + mem = ioport_map(link->io.BasePort1, link->io.NumPorts1); + if (!mem) + goto cs_failed; + + hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); /* * This actually configures the PCMCIA socket -- setting up @@ -519,6 +523,8 @@ if (link->irq.AssignedIRQ) pcmcia_release_irq(link->handle, &link->irq); link->state &= ~DEV_CONFIG; + if (priv->hw.iobase) + ioport_unmap(priv->hw.iobase); } /* orinoco_cs_release */ /* diff -Nru a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c --- a/drivers/net/wireless/orinoco_pci.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/orinoco_pci.c 2004-10-26 18:34:29 -07:00 @@ -196,7 +196,7 @@ { int err = 0; unsigned long pci_iorange; - u16 *pci_ioaddr = NULL; + u16 __iomem *pci_ioaddr = NULL; unsigned long pci_iolen; struct orinoco_private *priv = NULL; struct net_device *dev = NULL; @@ -230,8 +230,7 @@ "Detected Orinoco/Prism2 PCI device at %s, mem:0x%lX to 0x%lX -> 0x%p, irq:%d\n", pci_name(pdev), dev->mem_start, dev->mem_end, pci_ioaddr, pdev->irq); - hermes_struct_init(&priv->hw, dev->base_addr, - HERMES_MEM, HERMES_32BIT_REGSPACING); + hermes_struct_init(&priv->hw, pci_ioaddr, HERMES_32BIT_REGSPACING); pci_set_drvdata(pdev, dev); err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, @@ -290,7 +289,7 @@ free_irq(dev->irq, dev); if (priv->hw.iobase) - iounmap((unsigned char *) priv->hw.iobase); + iounmap(priv->hw.iobase); pci_set_drvdata(pdev, NULL); free_netdev(dev); diff -Nru a/drivers/net/wireless/orinoco_plx.c b/drivers/net/wireless/orinoco_plx.c --- a/drivers/net/wireless/orinoco_plx.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/orinoco_plx.c 2004-10-26 18:34:29 -07:00 @@ -156,12 +156,14 @@ const struct pci_device_id *ent) { int err = 0; - u16 *attr_mem = NULL; + u16 __iomem *attr_mem = NULL; u32 reg, addr; struct orinoco_private *priv = NULL; unsigned long pccard_ioaddr = 0; unsigned long pccard_iolen = 0; + u16 magic[8]; struct net_device *dev = NULL; + void __iomem *mem; int i; err = pci_enable_device(pdev); @@ -170,41 +172,41 @@ /* Resource 2 is mapped to the PCMCIA space */ attr_mem = ioremap(pci_resource_start(pdev, 2), PAGE_SIZE); - if (! attr_mem) - goto fail; + if (!attr_mem) + goto out; printk(KERN_DEBUG "orinoco_plx: CIS: "); for (i = 0; i < 16; i++) { - printk("%02X:", (int)attr_mem[i]); + printk("%02X:", readw(attr_mem+i)); } printk("\n"); /* Verify whether PC card is present */ /* FIXME: we probably need to be smarted about this */ - if (memcmp(attr_mem, cis_magic, sizeof(cis_magic)) != 0) { + memcpy_fromio(magic, attr_mem, 16); + if (memcmp(magic, cis_magic, 16) != 0) { printk(KERN_ERR "orinoco_plx: The CIS value of Prism2 PC card is invalid.\n"); err = -EIO; - goto fail; + iounmap(attr_mem); + goto out; } /* PCMCIA COR is the first byte following CIS: this write should * enable I/O mode and select level-triggered interrupts */ - attr_mem[COR_OFFSET] = COR_VALUE; + writew(COR_VALUE, attr_mem + COR_OFFSET); mdelay(1); - reg = attr_mem[COR_OFFSET]; + reg = readw(attr_mem + COR_OFFSET); + iounmap(attr_mem); + if (reg != COR_VALUE) { printk(KERN_ERR "orinoco_plx: Error setting COR value (reg=%x)\n", reg); - goto fail; + goto out; } - iounmap(attr_mem); - attr_mem = NULL; /* done with this now, it seems */ - /* bjoern: We need to tell the card to enable interrupts, in case the serial eprom didn't do this already. See the PLX9052 data book, p8-1 and 8-24 for reference. */ addr = pci_resource_start(pdev, 1); - reg = 0; reg = inl(addr+PLX_INTCSR); if (reg & PLX_INTCSR_INTEN) printk(KERN_DEBUG "orinoco_plx: " @@ -216,7 +218,7 @@ if(!(reg & PLX_INTCSR_INTEN)) { printk(KERN_ERR "orinoco_plx: " "Couldn't enable Local Interrupts\n"); - goto fail; + goto out; } } @@ -226,16 +228,21 @@ if (! request_region(pccard_ioaddr, pccard_iolen, DRIVER_NAME)) { printk(KERN_ERR "orinoco_plx: I/O resource 0x%lx @ 0x%lx busy\n", pccard_iolen, pccard_ioaddr); - pccard_ioaddr = 0; err = -EBUSY; - goto fail; + goto out; + } + + mem = pci_iomap(pdev, 3, 0); + if (!mem) { + err = -ENOMEM; + goto out1; } /* Allocate network device */ dev = alloc_orinocodev(0, NULL); - if (! dev) { + if (!dev) { err = -ENOMEM; - goto fail; + goto out2; } priv = netdev_priv(dev); @@ -247,8 +254,7 @@ "at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq, pccard_ioaddr); - hermes_struct_init(&(priv->hw), dev->base_addr, HERMES_IO, - HERMES_16BIT_REGSPACING); + hermes_struct_init(&(priv->hw), mem, HERMES_16BIT_REGSPACING); pci_set_drvdata(pdev, dev); err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, @@ -256,47 +262,41 @@ if (err) { printk(KERN_ERR PFX "Error allocating IRQ %d.\n", pdev->irq); err = -EBUSY; - goto fail; + goto out3; } dev->irq = pdev->irq; err = register_netdev(dev); if (err) - goto fail; + goto out4; return 0; - fail: - printk(KERN_DEBUG PFX "init_one(), FAIL!\n"); - - if (dev) { - if (dev->irq) - free_irq(dev->irq, dev); - - free_netdev(dev); - } - - if (pccard_ioaddr) - release_region(pccard_ioaddr, pccard_iolen); - - if (attr_mem) - iounmap(attr_mem); - +out4: + free_irq(dev->irq, dev); +out3: + free_netdev(dev); +out2: + pci_iounmap(pdev, mem); +out1: + release_region(pccard_ioaddr, pccard_iolen); +out: pci_disable_device(pdev); - + printk(KERN_DEBUG PFX "init_one(), FAIL!\n"); return err; } static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); - - BUG_ON(! dev); + struct orinoco_private *priv = netdev_priv(dev); unregister_netdev(dev); if (dev->irq) free_irq(dev->irq, dev); + + pci_iounmap(pdev, priv->hw.iobase); pci_set_drvdata(pdev, NULL); diff -Nru a/drivers/net/wireless/orinoco_tmd.c b/drivers/net/wireless/orinoco_tmd.c --- a/drivers/net/wireless/orinoco_tmd.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/orinoco_tmd.c 2004-10-26 18:34:29 -07:00 @@ -89,6 +89,7 @@ unsigned long pccard_ioaddr = 0; unsigned long pccard_iolen = 0; struct net_device *dev = NULL; + void __iomem *mem; err = pci_enable_device(pdev); if (err) @@ -100,9 +101,8 @@ if (! request_region(pccard_ioaddr, pccard_iolen, DRIVER_NAME)) { printk(KERN_ERR PFX "I/O resource at 0x%lx len 0x%lx busy\n", pccard_ioaddr, pccard_iolen); - pccard_ioaddr = 0; err = -EBUSY; - goto fail; + goto out; } addr = pci_resource_start(pdev, 1); outb(COR_VALUE, addr); @@ -111,14 +111,20 @@ if (reg != COR_VALUE) { printk(KERN_ERR PFX "Error setting TMD COR values %x should be %x\n", reg, COR_VALUE); err = -EIO; - goto fail; + goto out2; } /* Allocate network device */ dev = alloc_orinocodev(0, NULL); if (! dev) { err = -ENOMEM; - goto fail; + goto out2; + } + + mem = pci_iomap(pdev, 2, 0); + if (!mem) { + err = -ENOMEM; + goto out3; } priv = netdev_priv(dev); @@ -130,8 +136,7 @@ "at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq, pccard_ioaddr); - hermes_struct_init(&(priv->hw), dev->base_addr, - HERMES_IO, HERMES_16BIT_REGSPACING); + hermes_struct_init(&(priv->hw), mem, HERMES_16BIT_REGSPACING); pci_set_drvdata(pdev, dev); err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, @@ -140,30 +145,27 @@ printk(KERN_ERR PFX "Error allocating IRQ %d.\n", pdev->irq); err = -EBUSY; - goto fail; + goto out4; } dev->irq = pdev->irq; err = register_netdev(dev); if (err) - goto fail; + goto out5; return 0; - fail: - printk(KERN_DEBUG PFX "init_one(), FAIL!\n"); - - if (dev) { - if (dev->irq) - free_irq(dev->irq, dev); - - free_netdev(dev); - } - - if (pccard_ioaddr) - release_region(pccard_ioaddr, pccard_iolen); - +out5: + free_irq(dev->irq, dev); +out4: + pci_iounmap(pdev, mem); +out3: + free_netdev(dev); +out2: + release_region(pccard_ioaddr, pccard_iolen); +out: pci_disable_device(pdev); + printk(KERN_DEBUG PFX "init_one(), FAIL!\n"); return err; } @@ -171,14 +173,15 @@ static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); - - BUG_ON(! dev); + struct orinoco_private *priv = netdev_priv(dev); unregister_netdev(dev); if (dev->irq) free_irq(dev->irq, dev); - + + pci_iounmap(pdev, priv->hw.iobase); + pci_set_drvdata(pdev, NULL); free_netdev(dev); diff -Nru a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c --- a/drivers/net/wireless/ray_cs.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/ray_cs.c 2004-10-26 18:34:29 -07:00 @@ -155,10 +155,6 @@ static void start_net(u_long local); /* void start_net(ray_dev_t *local); */ -/* Create symbol table for registering with kernel in init_module */ -EXPORT_SYMBOL(ray_dev_ioctl); -EXPORT_SYMBOL(ray_rx); - /*===========================================================================*/ /* Parameters that can be set with 'insmod' */ /* Bit map of interrupts to choose from */ diff -Nru a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c --- a/drivers/net/wireless/wavelan_cs.c 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/wavelan_cs.c 2004-10-26 18:34:29 -07:00 @@ -136,7 +136,8 @@ u_char * b, /* buffer to fill */ int n) /* size to read */ { - u_char * ptr = ((u_char *)dev->mem_start) + PSA_ADDR + (o << 1); + net_local *lp = netdev_priv(dev); + u_char __iomem *ptr = lp->mem + PSA_ADDR + (o << 1); while(n-- > 0) { @@ -160,12 +161,13 @@ u_char * b, /* Buffer in memory */ int n) /* Length of buffer */ { - u_char * ptr = ((u_char *) dev->mem_start) + PSA_ADDR + (o << 1); + net_local *lp = netdev_priv(dev); + u_char __iomem *ptr = lp->mem + PSA_ADDR + (o << 1); int count = 0; ioaddr_t base = dev->base_addr; /* As there seem to have no flag PSA_BUSY as in the ISA model, we are * oblige to verify this address to know when the PSA is ready... */ - volatile u_char * verify = ((u_char *) dev->mem_start) + PSA_ADDR + + volatile u_char __iomem *verify = lp->mem + PSA_ADDR + (psaoff(0, psa_comp_number) << 1); /* Authorize writting to PSA */ @@ -3948,17 +3950,16 @@ static inline int wv_pcmcia_config(dev_link_t * link) { - client_handle_t handle; + client_handle_t handle = link->handle; tuple_t tuple; cisparse_t parse; - struct net_device * dev; + struct net_device * dev = (struct net_device *) link->priv; int i; u_char buf[64]; win_req_t req; memreq_t mem; + net_local * lp = netdev_priv(dev); - handle = link->handle; - dev = (struct net_device *) link->priv; #ifdef DEBUG_CONFIG_TRACE printk(KERN_DEBUG "->wv_pcmcia_config(0x%p)\n", link); @@ -4045,7 +4046,8 @@ break; } - dev->mem_start = (u_long)ioremap(req.Base, req.Size); + lp->mem = ioremap(req.Base, req.Size); + dev->mem_start = (u_long)lp->mem; dev->mem_end = dev->mem_start + req.Size; mem.CardOffset = 0; mem.Page = 0; @@ -4062,8 +4064,8 @@ netif_start_queue(dev); #ifdef DEBUG_CONFIG_INFO - printk(KERN_DEBUG "wv_pcmcia_config: MEMSTART 0x%x IRQ %d IOPORT 0x%x\n", - (u_int) dev->mem_start, dev->irq, (u_int) dev->base_addr); + printk(KERN_DEBUG "wv_pcmcia_config: MEMSTART %p IRQ %d IOPORT 0x%x\n", + lp->mem, dev->irq, (u_int) dev->base_addr); #endif i = register_netdev(dev); @@ -4104,13 +4106,14 @@ wv_pcmcia_release(dev_link_t *link) { struct net_device * dev = (struct net_device *) link->priv; + net_local * lp = netdev_priv(dev); #ifdef DEBUG_CONFIG_TRACE printk(KERN_DEBUG "%s: -> wv_pcmcia_release(0x%p)\n", dev->name, link); #endif /* Don't bother checking to see if these succeed or not */ - iounmap((u_char *)dev->mem_start); + iounmap(lp->mem); pcmcia_release_window(link->win); pcmcia_release_configuration(link->handle); pcmcia_release_io(link->handle, &link->io); diff -Nru a/drivers/net/wireless/wavelan_cs.p.h b/drivers/net/wireless/wavelan_cs.p.h --- a/drivers/net/wireless/wavelan_cs.p.h 2004-10-26 18:34:29 -07:00 +++ b/drivers/net/wireless/wavelan_cs.p.h 2004-10-26 18:34:29 -07:00 @@ -645,6 +645,7 @@ int cell_search; /* Searching for new cell? */ struct timer_list cell_timer; /* Garbage collection */ #endif /* WAVELAN_ROAMING */ + void __iomem *mem; }; /**************************** PROTOTYPES ****************************/ diff -Nru a/include/linux/ibmtr.h b/include/linux/ibmtr.h --- a/include/linux/ibmtr.h 2004-10-26 18:34:29 -07:00 +++ b/include/linux/ibmtr.h 2004-10-26 18:34:29 -07:00 @@ -169,7 +169,7 @@ struct tok_info { unsigned char irq; - void *mmio; + void __iomem *mmio; unsigned char hw_address[32]; unsigned char adapter_type; unsigned char data_rate; @@ -192,12 +192,13 @@ /* Additions by Peter De Schrijver */ unsigned char page_mask; /* mask to select RAM page to Map*/ unsigned char mapped_ram_size; /* size of RAM page */ - __u32 sram_virt; /* Shared memory base address */ - __u32 init_srb; /* Initial System Request Block address */ - __u32 srb; /* System Request Block address */ - __u32 ssb; /* System Status Block address */ - __u32 arb; /* Adapter Request Block address */ - __u32 asb; /* Adapter Status Block address */ + __u32 sram_phys; /* Shared memory base address */ + void __iomem *sram_virt; /* Shared memory base address */ + void __iomem *init_srb; /* Initial System Request Block address */ + void __iomem *srb; /* System Request Block address */ + void __iomem *ssb; /* System Status Block address */ + void __iomem *arb; /* Adapter Request Block address */ + void __iomem *asb; /* Adapter Status Block address */ __u8 init_srb_page; __u8 srb_page; __u8 ssb_page; diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h --- a/include/linux/pci_ids.h 2004-10-26 18:34:30 -07:00 +++ b/include/linux/pci_ids.h 2004-10-26 18:34:30 -07:00 @@ -119,6 +119,9 @@ /* Vendors and devices. Sort key: vendor first, device next. */ +#define PCI_VENDOR_ID_TTTECH 0x0357 +#define PCI_DEVICE_ID_TTTECH_MC312 0x000A + #define PCI_VENDOR_ID_DYNALINK 0x0675 #define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702 diff -Nru a/include/pcmcia/mem_op.h b/include/pcmcia/mem_op.h --- a/include/pcmcia/mem_op.h 2004-10-26 18:34:30 -07:00 +++ b/include/pcmcia/mem_op.h 2004-10-26 18:34:30 -07:00 @@ -76,67 +76,54 @@ #else /* UNSAFE_MEMCPY */ -static inline void copy_from_pc(void *to, const void *from, size_t n) +static inline void copy_from_pc(void *to, void __iomem *from, size_t n) { - size_t odd = (n & 1); - n -= odd; - while (n) { - u_short *t = to; - - *t = __raw_readw(from); - to = (void *)((long)to + 2); - from = (const void *)((long)from + 2); - n -= 2; - } - if (odd) - *(u_char *)to = readb(from); + __u16 *t = to; + __u16 __iomem *f = from; + size_t odd = (n & 1); + for (n >>= 1; n; n--) + *t++ = __raw_readw(f++); + if (odd) + *(__u8 *)t = readb(f); } -static inline void copy_to_pc(void *to, const void *from, size_t n) +static inline void copy_to_pc(void __iomem *to, const void *from, size_t n) { - size_t odd = (n & 1); - n -= odd; - while (n) { - __raw_writew(*(u_short *)from, to); - to = (void *)((long)to + 2); - from = (const void *)((long)from + 2); - n -= 2; - } - if (odd) - writeb(*(u_char *)from, to); + __u16 __iomem *t = to; + const __u16 *f = from; + size_t odd = (n & 1); + for (n >>= 1; n ; n--) + __raw_writew(*f++, t++); + if (odd) + writeb(*(__u8 *)f, t); } -static inline void copy_pc_to_user(void *to, const void *from, size_t n) +static inline void copy_pc_to_user(void __user *to, void __iomem *from, size_t n) { - size_t odd = (n & 1); - n -= odd; - while (n) { - put_user(__raw_readw(from), (short *)to); - to = (void *)((long)to + 2); - from = (const void *)((long)from + 2); - n -= 2; - } - if (odd) - put_user(readb(from), (char *)to); + __u16 __user *t = to; + __u16 __iomem *f = from; + size_t odd = (n & 1); + for (n >>= 1; n ; n--) + put_user(__raw_readw(f++), t++); + if (odd) + put_user(readb(f), (char __user *)t); } -static inline void copy_user_to_pc(void *to, const void *from, size_t n) +static inline void copy_user_to_pc(void __iomem *to, void __user *from, size_t n) { - short s; - char c; - size_t odd = (n & 1); - n -= odd; - while (n) { - get_user(s, (short *)from); - __raw_writew(s, to); - to = (void *)((long)to + 2); - from = (const void *)((long)from + 2); - n -= 2; - } - if (odd) { - get_user(c, (char *)from); - writeb(c, to); - } + __u16 __user *f = from; + __u16 __iomem *t = to; + short s; + char c; + size_t odd = (n & 1); + for (n >>= 1; n; n--) { + get_user(s, f++); + __raw_writew(s, t++); + } + if (odd) { + get_user(c, (char __user *)f); + writeb(c, t); + } } #endif /* UNSAFE_MEMCPY */