Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170719
b: refs/heads/master
c: 7cecdca
h: refs/heads/master
i:
  170717: e370b24
  170715: 0e5a48c
  170711: 85ac283
  170703: 0e340f4
  170687: d898294
v: v3
  • Loading branch information
Dhananjay Phadke authored and David S. Miller committed Oct 18, 2009
1 parent fa158db commit d9f5550
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 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: 6abb4b83eac25d91f6de834e97b2ea38e979575b
refs/heads/master: 7cecdca133ea9791adce21819b9e9eed79045f23
49 changes: 25 additions & 24 deletions trunk/drivers/net/netxen/netxen_nic_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ netxen_pcie_sem_lock(struct netxen_adapter *adapter, int sem, u32 id_reg)
if (done == 1)
break;
if (++timeout >= NETXEN_PCIE_SEM_TIMEOUT)
return -1;
return -EIO;
msleep(1);
}

Expand Down Expand Up @@ -1083,7 +1083,7 @@ netxen_nic_pci_set_crbwindow_128M(struct netxen_adapter *adapter,
}

/*
* Return -1 if off is not valid,
* Returns < 0 if off is not valid,
* 1 if window access is needed. 'off' is set to offset from
* CRB space in 128M pci map
* 0 if no window access is needed. 'off' is set to 2M addr
Expand All @@ -1096,7 +1096,7 @@ netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter, ulong *off)


if (*off >= NETXEN_CRB_MAX)
return -1;
return -EINVAL;

if (*off >= NETXEN_PCI_CAMQM && (*off < NETXEN_PCI_CAMQM_2M_END)) {
*off = (*off - NETXEN_PCI_CAMQM) + NETXEN_PCI_CAMQM_2M_BASE +
Expand All @@ -1105,7 +1105,7 @@ netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter, ulong *off)
}

if (*off < NETXEN_PCI_CRBSPACE)
return -1;
return -EINVAL;

*off -= NETXEN_PCI_CRBSPACE;

Expand Down Expand Up @@ -1220,25 +1220,26 @@ netxen_nic_hw_write_wx_2M(struct netxen_adapter *adapter, ulong off, u32 data)

rv = netxen_nic_pci_get_crb_addr_2M(adapter, &off);

if (rv == -1) {
printk(KERN_ERR "%s: invalid offset: 0x%016lx\n",
__func__, off);
dump_stack();
return -1;
if (rv == 0) {
writel(data, (void __iomem *)off);
return 0;
}

if (rv == 1) {
if (rv > 0) {
/* indirect access */
write_lock_irqsave(&adapter->ahw.crb_lock, flags);
crb_win_lock(adapter);
netxen_nic_pci_set_crbwindow_2M(adapter, &off);
writel(data, (void __iomem *)off);
crb_win_unlock(adapter);
write_unlock_irqrestore(&adapter->ahw.crb_lock, flags);
} else
writel(data, (void __iomem *)off);

return 0;
}

return 0;
dev_err(&adapter->pdev->dev,
"%s: invalid offset: 0x%016lx\n", __func__, off);
dump_stack();
return -EIO;
}

static u32
Expand All @@ -1250,24 +1251,24 @@ netxen_nic_hw_read_wx_2M(struct netxen_adapter *adapter, ulong off)

rv = netxen_nic_pci_get_crb_addr_2M(adapter, &off);

if (rv == -1) {
printk(KERN_ERR "%s: invalid offset: 0x%016lx\n",
__func__, off);
dump_stack();
return -1;
}
if (rv == 0)
return readl((void __iomem *)off);

if (rv == 1) {
if (rv > 0) {
/* indirect access */
write_lock_irqsave(&adapter->ahw.crb_lock, flags);
crb_win_lock(adapter);
netxen_nic_pci_set_crbwindow_2M(adapter, &off);
data = readl((void __iomem *)off);
crb_win_unlock(adapter);
write_unlock_irqrestore(&adapter->ahw.crb_lock, flags);
} else
data = readl((void __iomem *)off);
return data;
}

return data;
dev_err(&adapter->pdev->dev,
"%s: invalid offset: 0x%016lx\n", __func__, off);
dump_stack();
return -1;
}

/* window 1 registers only */
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/netxen/netxen_nic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,12 @@ void netxen_request_firmware(struct netxen_adapter *adapter)
goto request_fw;
}

if (NX_IS_REVISION_P3P(adapter->ahw.revision_id)) {
/* No file firmware for the time being */
fw_type = NX_FLASH_ROMIMAGE;
goto done;
}

fw_type = netxen_p3_has_mn(adapter) ?
NX_P3_MN_ROMIMAGE : NX_P3_CT_ROMIMAGE;

Expand Down

0 comments on commit d9f5550

Please sign in to comment.