Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193927
b: refs/heads/master
c: b47acac
h: refs/heads/master
i:
  193925: 32b3d45
  193923: d3c02a7
  193919: 98efcaf
v: v3
  • Loading branch information
Dhananjay Phadke authored and David S. Miller committed Apr 3, 2010
1 parent ae87949 commit ccbe55a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 33 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: 897e8c7c450dac2912b677c6e6bf8b04aa5bdf72
refs/heads/master: b47acacd7c888ef550fb786dd02db69d9eb2faee
2 changes: 1 addition & 1 deletion trunk/drivers/net/qlcnic/qlcnic_hdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ enum {
#define QLCNIC_ADDR_OCM1 (0x0000000200400000ULL)
#define QLCNIC_ADDR_OCM1_MAX (0x00000002004fffffULL)
#define QLCNIC_ADDR_QDR_NET (0x0000000300000000ULL)
#define QLCNIC_ADDR_QDR_NET_MAX_P3 (0x0000000303ffffffULL)
#define QLCNIC_ADDR_QDR_NET_MAX (0x0000000307ffffffULL)

/*
* Register offsets for MN
Expand Down
55 changes: 24 additions & 31 deletions trunk/drivers/net/qlcnic/qlcnic_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,6 @@ qlcnic_pci_mem_write_2M(struct qlcnic_adapter *adapter,
{
int i, j, ret;
u32 temp, off8;
u64 stride;
void __iomem *mem_crb;

/* Only 64-bit aligned access */
Expand All @@ -972,7 +971,7 @@ qlcnic_pci_mem_write_2M(struct qlcnic_adapter *adapter,

/* P3 onward, test agent base for MIU and SIU is same */
if (ADDR_IN_RANGE(off, QLCNIC_ADDR_QDR_NET,
QLCNIC_ADDR_QDR_NET_MAX_P3)) {
QLCNIC_ADDR_QDR_NET_MAX)) {
mem_crb = qlcnic_get_ioaddr(adapter,
QLCNIC_CRB_QDR_NET+MIU_TEST_AGT_BASE);
goto correct;
Expand All @@ -990,40 +989,36 @@ qlcnic_pci_mem_write_2M(struct qlcnic_adapter *adapter,
return -EIO;

correct:
stride = QLCNIC_IS_REVISION_P3P(adapter->ahw.revision_id) ? 16 : 8;

off8 = off & ~(stride-1);
off8 = off & ~0xf;

mutex_lock(&adapter->ahw.mem_lock);

writel(off8, (mem_crb + MIU_TEST_AGT_ADDR_LO));
writel(0, (mem_crb + MIU_TEST_AGT_ADDR_HI));

i = 0;
if (stride == 16) {
writel(TA_CTL_ENABLE, (mem_crb + TEST_AGT_CTRL));
writel((TA_CTL_START | TA_CTL_ENABLE),
(mem_crb + TEST_AGT_CTRL));

for (j = 0; j < MAX_CTL_CHECK; j++) {
temp = readl(mem_crb + TEST_AGT_CTRL);
if ((temp & TA_CTL_BUSY) == 0)
break;
}
writel(TA_CTL_ENABLE, (mem_crb + TEST_AGT_CTRL));
writel((TA_CTL_START | TA_CTL_ENABLE),
(mem_crb + TEST_AGT_CTRL));

if (j >= MAX_CTL_CHECK) {
ret = -EIO;
goto done;
}
for (j = 0; j < MAX_CTL_CHECK; j++) {
temp = readl(mem_crb + TEST_AGT_CTRL);
if ((temp & TA_CTL_BUSY) == 0)
break;
}

i = (off & 0xf) ? 0 : 2;
writel(readl(mem_crb + MIU_TEST_AGT_RDDATA(i)),
mem_crb + MIU_TEST_AGT_WRDATA(i));
writel(readl(mem_crb + MIU_TEST_AGT_RDDATA(i+1)),
mem_crb + MIU_TEST_AGT_WRDATA(i+1));
i = (off & 0xf) ? 2 : 0;
if (j >= MAX_CTL_CHECK) {
ret = -EIO;
goto done;
}

i = (off & 0xf) ? 0 : 2;
writel(readl(mem_crb + MIU_TEST_AGT_RDDATA(i)),
mem_crb + MIU_TEST_AGT_WRDATA(i));
writel(readl(mem_crb + MIU_TEST_AGT_RDDATA(i+1)),
mem_crb + MIU_TEST_AGT_WRDATA(i+1));
i = (off & 0xf) ? 2 : 0;

writel(data & 0xffffffff,
mem_crb + MIU_TEST_AGT_WRDATA(i));
writel((data >> 32) & 0xffffffff,
Expand Down Expand Up @@ -1059,7 +1054,7 @@ qlcnic_pci_mem_read_2M(struct qlcnic_adapter *adapter,
{
int j, ret;
u32 temp, off8;
u64 val, stride;
u64 val;
void __iomem *mem_crb;

/* Only 64-bit aligned access */
Expand All @@ -1068,7 +1063,7 @@ qlcnic_pci_mem_read_2M(struct qlcnic_adapter *adapter,

/* P3 onward, test agent base for MIU and SIU is same */
if (ADDR_IN_RANGE(off, QLCNIC_ADDR_QDR_NET,
QLCNIC_ADDR_QDR_NET_MAX_P3)) {
QLCNIC_ADDR_QDR_NET_MAX)) {
mem_crb = qlcnic_get_ioaddr(adapter,
QLCNIC_CRB_QDR_NET+MIU_TEST_AGT_BASE);
goto correct;
Expand All @@ -1088,9 +1083,7 @@ qlcnic_pci_mem_read_2M(struct qlcnic_adapter *adapter,
return -EIO;

correct:
stride = QLCNIC_IS_REVISION_P3P(adapter->ahw.revision_id) ? 16 : 8;

off8 = off & ~(stride-1);
off8 = off & ~0xf;

mutex_lock(&adapter->ahw.mem_lock);

Expand All @@ -1112,7 +1105,7 @@ qlcnic_pci_mem_read_2M(struct qlcnic_adapter *adapter,
ret = -EIO;
} else {
off8 = MIU_TEST_AGT_RDDATA_LO;
if ((stride == 16) && (off & 0xf))
if (off & 0xf)
off8 = MIU_TEST_AGT_RDDATA_UPPER_LO;

temp = readl(mem_crb + off8 + 4);
Expand Down

0 comments on commit ccbe55a

Please sign in to comment.