aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_hw.c
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay.phadke@qlogic.com>2010-04-01 15:01:29 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-03 17:19:13 -0400
commit897e8c7c450dac2912b677c6e6bf8b04aa5bdf72 (patch)
tree9bd6fa9ef5c643e08c17847871703f8b0deafead /drivers/net/qlcnic/qlcnic_hw.c
parent0bc92b5b4987ab55f2b75ef42251476b2e049e3d (diff)
qlcnic: handle queue manager access
Check the access by tools for hardware queue engine and handle it separately than other block registers, otherwise incorrect data is returned. Signed-off-by: Dhananjay Phadke <dhananjay.phadke@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_hw.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_hw.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c
index da00e162b6d3..b977874f28ce 100644
--- a/drivers/net/qlcnic/qlcnic_hw.c
+++ b/drivers/net/qlcnic/qlcnic_hw.c
@@ -53,9 +53,6 @@ static inline void writeq(u64 val, void __iomem *addr)
53} 53}
54#endif 54#endif
55 55
56#define ADDR_IN_RANGE(addr, low, high) \
57 (((addr) < (high)) && ((addr) >= (low)))
58
59#define PCI_OFFSET_FIRST_RANGE(adapter, off) \ 56#define PCI_OFFSET_FIRST_RANGE(adapter, off) \
60 ((adapter)->ahw.pci_base0 + (off)) 57 ((adapter)->ahw.pci_base0 + (off))
61 58
@@ -936,6 +933,28 @@ unlock:
936 return ret; 933 return ret;
937} 934}
938 935
936void
937qlcnic_pci_camqm_read_2M(struct qlcnic_adapter *adapter, u64 off, u64 *data)
938{
939 void __iomem *addr = adapter->ahw.pci_base0 +
940 QLCNIC_PCI_CAMQM_2M_BASE + (off - QLCNIC_PCI_CAMQM);
941
942 mutex_lock(&adapter->ahw.mem_lock);
943 *data = readq(addr);
944 mutex_unlock(&adapter->ahw.mem_lock);
945}
946
947void
948qlcnic_pci_camqm_write_2M(struct qlcnic_adapter *adapter, u64 off, u64 data)
949{
950 void __iomem *addr = adapter->ahw.pci_base0 +
951 QLCNIC_PCI_CAMQM_2M_BASE + (off - QLCNIC_PCI_CAMQM);
952
953 mutex_lock(&adapter->ahw.mem_lock);
954 writeq(data, addr);
955 mutex_unlock(&adapter->ahw.mem_lock);
956}
957
939#define MAX_CTL_CHECK 1000 958#define MAX_CTL_CHECK 1000
940 959
941int 960int