aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-02-15 02:12:00 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-15 02:12:00 -0500
commit5e30589521518bff36fd2638b3c3d69679c50436 (patch)
tree6ac985658a06b0787e4354d0d16d380ea9b16a5a /drivers/net/netxen
parentac178ef0ae9eb44fd527d87aa9b6394e05f56e1f (diff)
parentd2f8d7ee1a9b4650b4e43325b321801264f7c37a (diff)
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts: drivers/net/wireless/iwlwifi/iwl-agn.c drivers/net/wireless/iwlwifi/iwl3945-base.c
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c66
1 files changed, 1 insertions, 65 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 5597c754f127..4fe20ecdbc6b 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -201,9 +201,9 @@ static int nx_set_dma_mask(struct netxen_adapter *adapter, uint8_t revision_id)
201 adapter->pci_using_dac = 1; 201 adapter->pci_using_dac = 1;
202 return 0; 202 return 0;
203 } 203 }
204set_32_bit_mask:
204#endif /* CONFIG_IA64 */ 205#endif /* CONFIG_IA64 */
205 206
206set_32_bit_mask:
207 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 207 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
208 if (!err) 208 if (!err)
209 err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 209 err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
@@ -372,67 +372,6 @@ static void netxen_set_port_mode(struct netxen_adapter *adapter)
372 } 372 }
373} 373}
374 374
375#define PCI_CAP_ID_GEN 0x10
376
377static void netxen_pcie_strap_init(struct netxen_adapter *adapter)
378{
379 u32 pdevfuncsave;
380 u32 c8c9value = 0;
381 u32 chicken = 0;
382 u32 control = 0;
383 int i, pos;
384 struct pci_dev *pdev;
385
386 pdev = adapter->pdev;
387
388 adapter->hw_read_wx(adapter,
389 NETXEN_PCIE_REG(PCIE_CHICKEN3), &chicken, 4);
390 /* clear chicken3.25:24 */
391 chicken &= 0xFCFFFFFF;
392 /*
393 * if gen1 and B0, set F1020 - if gen 2, do nothing
394 * if gen2 set to F1000
395 */
396 pos = pci_find_capability(pdev, PCI_CAP_ID_GEN);
397 if (pos == 0xC0) {
398 pci_read_config_dword(pdev, pos + 0x10, &control);
399 if ((control & 0x000F0000) != 0x00020000) {
400 /* set chicken3.24 if gen1 */
401 chicken |= 0x01000000;
402 }
403 printk(KERN_INFO "%s Gen2 strapping detected\n",
404 netxen_nic_driver_name);
405 c8c9value = 0xF1000;
406 } else {
407 /* set chicken3.24 if gen1 */
408 chicken |= 0x01000000;
409 printk(KERN_INFO "%s Gen1 strapping detected\n",
410 netxen_nic_driver_name);
411 if (adapter->ahw.revision_id == NX_P3_B0)
412 c8c9value = 0xF1020;
413 else
414 c8c9value = 0;
415
416 }
417 adapter->hw_write_wx(adapter,
418 NETXEN_PCIE_REG(PCIE_CHICKEN3), &chicken, 4);
419
420 if (!c8c9value)
421 return;
422
423 pdevfuncsave = pdev->devfn;
424 if (pdevfuncsave & 0x07)
425 return;
426
427 for (i = 0; i < 8; i++) {
428 pci_read_config_dword(pdev, pos + 8, &control);
429 pci_read_config_dword(pdev, pos + 8, &control);
430 pci_write_config_dword(pdev, pos + 8, c8c9value);
431 pdev->devfn++;
432 }
433 pdev->devfn = pdevfuncsave;
434}
435
436static void netxen_set_msix_bit(struct pci_dev *pdev, int enable) 375static void netxen_set_msix_bit(struct pci_dev *pdev, int enable)
437{ 376{
438 u32 control; 377 u32 control;
@@ -812,9 +751,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
812 } 751 }
813 netxen_load_firmware(adapter); 752 netxen_load_firmware(adapter);
814 753
815 if (NX_IS_REVISION_P3(revision_id))
816 netxen_pcie_strap_init(adapter);
817
818 if (NX_IS_REVISION_P2(revision_id)) { 754 if (NX_IS_REVISION_P2(revision_id)) {
819 755
820 /* Initialize multicast addr pool owners */ 756 /* Initialize multicast addr pool owners */