diff options
author | John W. Linville <linville@tuxdriver.com> | 2005-11-07 03:58:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:25 -0500 |
commit | 900fd17dd01d2c99dfd1ec0b53a860894a2673ee (patch) | |
tree | fcd447fc10d1a58c11854e29077417c329afebe7 /drivers/net/3c59x.c | |
parent | 35b306743d17cdd31357e5de9ce6c549e5d6756e (diff) |
[PATCH] 3c59x: enable use of memory-mapped PCI I/O
Add capability for 3c59x driver to use memory-mapped PCI I/O resources.
This may improve performance for those devices so equipped. This will be
the default behaviour for IS_CYCLONE and IS_TORNADO devices. Additionally,
it can be enabled/disabled individually for up to MAX_UNITS number of
devices via the use_mmio module option or for all units via the
global_use_mmio option. The use_mmio option overrides the global_use_mmio
option for those devices specified.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net/3c59x.c')
-rw-r--r-- | drivers/net/3c59x.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 413b82c5994c..c1ee8efc9d56 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -908,9 +908,11 @@ static int full_duplex[MAX_UNITS] = {[0 ... MAX_UNITS-1] = -1 }; | |||
908 | static int hw_checksums[MAX_UNITS] = {[0 ... MAX_UNITS-1] = -1 }; | 908 | static int hw_checksums[MAX_UNITS] = {[0 ... MAX_UNITS-1] = -1 }; |
909 | static int flow_ctrl[MAX_UNITS] = {[0 ... MAX_UNITS-1] = -1 }; | 909 | static int flow_ctrl[MAX_UNITS] = {[0 ... MAX_UNITS-1] = -1 }; |
910 | static int enable_wol[MAX_UNITS] = {[0 ... MAX_UNITS-1] = -1 }; | 910 | static int enable_wol[MAX_UNITS] = {[0 ... MAX_UNITS-1] = -1 }; |
911 | static int use_mmio[MAX_UNITS] = {[0 ... MAX_UNITS-1] = -1 }; | ||
911 | static int global_options = -1; | 912 | static int global_options = -1; |
912 | static int global_full_duplex = -1; | 913 | static int global_full_duplex = -1; |
913 | static int global_enable_wol = -1; | 914 | static int global_enable_wol = -1; |
915 | static int global_use_mmio = -1; | ||
914 | 916 | ||
915 | /* #define dev_alloc_skb dev_alloc_skb_debug */ | 917 | /* #define dev_alloc_skb dev_alloc_skb_debug */ |
916 | 918 | ||
@@ -935,6 +937,8 @@ module_param(compaq_ioaddr, int, 0); | |||
935 | module_param(compaq_irq, int, 0); | 937 | module_param(compaq_irq, int, 0); |
936 | module_param(compaq_device_id, int, 0); | 938 | module_param(compaq_device_id, int, 0); |
937 | module_param(watchdog, int, 0); | 939 | module_param(watchdog, int, 0); |
940 | module_param(global_use_mmio, int, 0); | ||
941 | module_param_array(use_mmio, int, NULL, 0); | ||
938 | MODULE_PARM_DESC(debug, "3c59x debug level (0-6)"); | 942 | MODULE_PARM_DESC(debug, "3c59x debug level (0-6)"); |
939 | MODULE_PARM_DESC(options, "3c59x: Bits 0-3: media type, bit 4: bus mastering, bit 9: full duplex"); | 943 | MODULE_PARM_DESC(options, "3c59x: Bits 0-3: media type, bit 4: bus mastering, bit 9: full duplex"); |
940 | MODULE_PARM_DESC(global_options, "3c59x: same as options, but applies to all NICs if options is unset"); | 944 | MODULE_PARM_DESC(global_options, "3c59x: same as options, but applies to all NICs if options is unset"); |
@@ -950,6 +954,8 @@ MODULE_PARM_DESC(compaq_ioaddr, "3c59x PCI I/O base address (Compaq BIOS problem | |||
950 | MODULE_PARM_DESC(compaq_irq, "3c59x PCI IRQ number (Compaq BIOS problem workaround)"); | 954 | MODULE_PARM_DESC(compaq_irq, "3c59x PCI IRQ number (Compaq BIOS problem workaround)"); |
951 | MODULE_PARM_DESC(compaq_device_id, "3c59x PCI device ID (Compaq BIOS problem workaround)"); | 955 | MODULE_PARM_DESC(compaq_device_id, "3c59x PCI device ID (Compaq BIOS problem workaround)"); |
952 | MODULE_PARM_DESC(watchdog, "3c59x transmit timeout in milliseconds"); | 956 | MODULE_PARM_DESC(watchdog, "3c59x transmit timeout in milliseconds"); |
957 | MODULE_PARM_DESC(global_use_mmio, "3c59x: same as use_mmio, but applies to all NICs if options is unset"); | ||
958 | MODULE_PARM_DESC(use_mmio, "3c59x: use memory-mapped PCI I/O resource (0-1)"); | ||
953 | 959 | ||
954 | #ifdef CONFIG_NET_POLL_CONTROLLER | 960 | #ifdef CONFIG_NET_POLL_CONTROLLER |
955 | static void poll_vortex(struct net_device *dev) | 961 | static void poll_vortex(struct net_device *dev) |
@@ -1109,15 +1115,32 @@ static int __init vortex_eisa_init (void) | |||
1109 | static int __devinit vortex_init_one (struct pci_dev *pdev, | 1115 | static int __devinit vortex_init_one (struct pci_dev *pdev, |
1110 | const struct pci_device_id *ent) | 1116 | const struct pci_device_id *ent) |
1111 | { | 1117 | { |
1112 | int rc; | 1118 | int rc, unit, pci_bar; |
1119 | struct vortex_chip_info *vci; | ||
1120 | void __iomem *ioaddr; | ||
1113 | 1121 | ||
1114 | /* wake up and enable device */ | 1122 | /* wake up and enable device */ |
1115 | rc = pci_enable_device (pdev); | 1123 | rc = pci_enable_device (pdev); |
1116 | if (rc < 0) | 1124 | if (rc < 0) |
1117 | goto out; | 1125 | goto out; |
1118 | 1126 | ||
1119 | rc = vortex_probe1 (&pdev->dev, pci_iomap(pdev, 0, 0), | 1127 | unit = vortex_cards_found; |
1120 | pdev->irq, ent->driver_data, vortex_cards_found); | 1128 | |
1129 | if (global_use_mmio < 0 && (unit >= MAX_UNITS || use_mmio[unit] < 0)) { | ||
1130 | /* Determine the default if the user didn't override us */ | ||
1131 | vci = &vortex_info_tbl[ent->driver_data]; | ||
1132 | pci_bar = vci->drv_flags & (IS_CYCLONE | IS_TORNADO) ? 1 : 0; | ||
1133 | } else if (unit < MAX_UNITS && use_mmio[unit] >= 0) | ||
1134 | pci_bar = use_mmio[unit] ? 1 : 0; | ||
1135 | else | ||
1136 | pci_bar = global_use_mmio ? 1 : 0; | ||
1137 | |||
1138 | ioaddr = pci_iomap(pdev, pci_bar, 0); | ||
1139 | if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */ | ||
1140 | ioaddr = pci_iomap(pdev, 0, 0); | ||
1141 | |||
1142 | rc = vortex_probe1(&pdev->dev, ioaddr, pdev->irq, | ||
1143 | ent->driver_data, unit); | ||
1121 | if (rc < 0) { | 1144 | if (rc < 0) { |
1122 | pci_disable_device (pdev); | 1145 | pci_disable_device (pdev); |
1123 | goto out; | 1146 | goto out; |