Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266127
b: refs/heads/master
c: e3feb26
h: refs/heads/master
i:
  266125: bbb458c
  266123: 2e3644a
  266119: d4f5d2e
  266111: a76b342
v: v3
  • Loading branch information
Rajesh Borundia authored and David S. Miller committed Sep 20, 2011
1 parent a0769a5 commit 62c60e4
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7ffa289445edf73c7797eac1dfa645a9784015a
refs/heads/master: e3feb266c344394ce06bdecdfa05071118249c88
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@

#define _NETXEN_NIC_LINUX_MAJOR 4
#define _NETXEN_NIC_LINUX_MINOR 0
#define _NETXEN_NIC_LINUX_SUBVERSION 76
#define NETXEN_NIC_LINUX_VERSIONID "4.0.76"
#define _NETXEN_NIC_LINUX_SUBVERSION 77
#define NETXEN_NIC_LINUX_VERSIONID "4.0.77"

#define NETXEN_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c))
#define _major(v) (((v) >> 24) & 0xff)
Expand Down
63 changes: 62 additions & 1 deletion trunk/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,63 @@ static void netxen_set_port_mode(struct netxen_adapter *adapter)
}
}

#define PCI_CAP_ID_GEN 0x10

static void netxen_pcie_strap_init(struct netxen_adapter *adapter)
{
u32 pdevfuncsave;
u32 c8c9value = 0;
u32 chicken = 0;
u32 control = 0;
int i, pos;
struct pci_dev *pdev;

pdev = adapter->pdev;

chicken = NXRD32(adapter, NETXEN_PCIE_REG(PCIE_CHICKEN3));
/* clear chicken3.25:24 */
chicken &= 0xFCFFFFFF;
/*
* if gen1 and B0, set F1020 - if gen 2, do nothing
* if gen2 set to F1000
*/
pos = pci_find_capability(pdev, PCI_CAP_ID_GEN);
if (pos == 0xC0) {
pci_read_config_dword(pdev, pos + 0x10, &control);
if ((control & 0x000F0000) != 0x00020000) {
/* set chicken3.24 if gen1 */
chicken |= 0x01000000;
}
dev_info(&adapter->pdev->dev, "Gen2 strapping detected\n");
c8c9value = 0xF1000;
} else {
/* set chicken3.24 if gen1 */
chicken |= 0x01000000;
dev_info(&adapter->pdev->dev, "Gen1 strapping detected\n");
if (adapter->ahw.revision_id == NX_P3_B0)
c8c9value = 0xF1020;
else
c8c9value = 0;
}

NXWR32(adapter, NETXEN_PCIE_REG(PCIE_CHICKEN3), chicken);

if (!c8c9value)
return;

pdevfuncsave = pdev->devfn;
if (pdevfuncsave & 0x07)
return;

for (i = 0; i < 8; i++) {
pci_read_config_dword(pdev, pos + 8, &control);
pci_read_config_dword(pdev, pos + 8, &control);
pci_write_config_dword(pdev, pos + 8, c8c9value);
pdev->devfn++;
}
pdev->devfn = pdevfuncsave;
}

static void netxen_set_msix_bit(struct pci_dev *pdev, int enable)
{
u32 control;
Expand Down Expand Up @@ -867,7 +924,7 @@ netxen_start_firmware(struct netxen_adapter *adapter)
if (err < 0)
goto err_out;
if (err == 0)
goto wait_init;
goto pcie_strap_init;

if (first_boot != 0x55555555) {
NXWR32(adapter, CRB_CMDPEG_STATE, 0);
Expand Down Expand Up @@ -910,6 +967,10 @@ netxen_start_firmware(struct netxen_adapter *adapter)
| (_NETXEN_NIC_LINUX_SUBVERSION);
NXWR32(adapter, CRB_DRIVER_VERSION, val);

pcie_strap_init:
if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
netxen_pcie_strap_init(adapter);

wait_init:
/* Handshake with the card before we register the devices. */
err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
Expand Down

0 comments on commit 62c60e4

Please sign in to comment.