aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_hdr.h
diff options
context:
space:
mode:
authorAnirban Chakraborty <anirban.chakraborty@qlogic.com>2010-06-01 07:28:51 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-02 05:24:03 -0400
commit2e9d722db6617ed10204bfa9cd60552620592a43 (patch)
treeda905f18459e55a8cb534d757f5b14a3e9da73d5 /drivers/net/qlcnic/qlcnic_hdr.h
parentdd8f61d7ff92eb8a4626565ca37b209b3a8a9ce2 (diff)
qlcnic: NIC Partitioning - Add basic infrastructure support
Following changes have been added to enable the adapter to work in NIC partitioning mode where multiple PCI functions of an adapter port can be configured to work as NIC functions. The first function that is enumerated on the PCI bus assumes the role of management function which, besides being able to do all the NIC functionality, can configure other NIC partitions. Other NIC functions can be configured as privileged or non privileged functions. Privileged function can not configure other NIC functions but can do all the NIC functionality including any firmware initialization, chip reset etc. Non privileged functions can do only basic IO. For chip reset etc, it depends on the privilege or management function. 1. Added code to determine PCI function number independent of kernel API. 2. Added Driver - FW version 2.0 support. 3. Changed producer and consumer register offset calculation. 4. Added management and privileged operation modes for npar functions. A module parameter has been added to control it. 5. Added support for configuring the eswitch in the adapter. Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_hdr.h')
-rw-r--r--drivers/net/qlcnic/qlcnic_hdr.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/drivers/net/qlcnic/qlcnic_hdr.h b/drivers/net/qlcnic/qlcnic_hdr.h
index ad9d167723c4..1bcfb121a895 100644
--- a/drivers/net/qlcnic/qlcnic_hdr.h
+++ b/drivers/net/qlcnic/qlcnic_hdr.h
@@ -208,6 +208,39 @@ enum {
208 QLCNIC_HW_PX_MAP_CRB_PGR0 208 QLCNIC_HW_PX_MAP_CRB_PGR0
209}; 209};
210 210
211#define BIT_0 0x1
212#define BIT_1 0x2
213#define BIT_2 0x4
214#define BIT_3 0x8
215#define BIT_4 0x10
216#define BIT_5 0x20
217#define BIT_6 0x40
218#define BIT_7 0x80
219#define BIT_8 0x100
220#define BIT_9 0x200
221#define BIT_10 0x400
222#define BIT_11 0x800
223#define BIT_12 0x1000
224#define BIT_13 0x2000
225#define BIT_14 0x4000
226#define BIT_15 0x8000
227#define BIT_16 0x10000
228#define BIT_17 0x20000
229#define BIT_18 0x40000
230#define BIT_19 0x80000
231#define BIT_20 0x100000
232#define BIT_21 0x200000
233#define BIT_22 0x400000
234#define BIT_23 0x800000
235#define BIT_24 0x1000000
236#define BIT_25 0x2000000
237#define BIT_26 0x4000000
238#define BIT_27 0x8000000
239#define BIT_28 0x10000000
240#define BIT_29 0x20000000
241#define BIT_30 0x40000000
242#define BIT_31 0x80000000
243
211/* This field defines CRB adr [31:20] of the agents */ 244/* This field defines CRB adr [31:20] of the agents */
212 245
213#define QLCNIC_HW_CRB_HUB_AGT_ADR_MN \ 246#define QLCNIC_HW_CRB_HUB_AGT_ADR_MN \
@@ -684,12 +717,20 @@ enum {
684#define QLCNIC_DEV_FAILED 0x6 717#define QLCNIC_DEV_FAILED 0x6
685#define QLCNIC_DEV_QUISCENT 0x7 718#define QLCNIC_DEV_QUISCENT 0x7
686 719
720#define QLC_DEV_CHECK_ACTIVE(VAL, FN) ((VAL) &= (1 << (FN * 4)))
687#define QLC_DEV_SET_REF_CNT(VAL, FN) ((VAL) |= (1 << (FN * 4))) 721#define QLC_DEV_SET_REF_CNT(VAL, FN) ((VAL) |= (1 << (FN * 4)))
688#define QLC_DEV_CLR_REF_CNT(VAL, FN) ((VAL) &= ~(1 << (FN * 4))) 722#define QLC_DEV_CLR_REF_CNT(VAL, FN) ((VAL) &= ~(1 << (FN * 4)))
689#define QLC_DEV_SET_RST_RDY(VAL, FN) ((VAL) |= (1 << (FN * 4))) 723#define QLC_DEV_SET_RST_RDY(VAL, FN) ((VAL) |= (1 << (FN * 4)))
690#define QLC_DEV_SET_QSCNT_RDY(VAL, FN) ((VAL) |= (2 << (FN * 4))) 724#define QLC_DEV_SET_QSCNT_RDY(VAL, FN) ((VAL) |= (2 << (FN * 4)))
691#define QLC_DEV_CLR_RST_QSCNT(VAL, FN) ((VAL) &= ~(3 << (FN * 4))) 725#define QLC_DEV_CLR_RST_QSCNT(VAL, FN) ((VAL) &= ~(3 << (FN * 4)))
692 726
727#define QLC_DEV_GET_DRV(VAL, FN) (0xf & ((VAL) >> (FN * 4)))
728#define QLC_DEV_SET_DRV(VAL, FN) ((VAL) << (FN * 4))
729
730#define QLCNIC_TYPE_NIC 1
731#define QLCNIC_TYPE_FCOE 2
732#define QLCNIC_TYPE_ISCSI 3
733
693#define QLCNIC_RCODE_DRIVER_INFO 0x20000000 734#define QLCNIC_RCODE_DRIVER_INFO 0x20000000
694#define QLCNIC_RCODE_DRIVER_CAN_RELOAD 0x40000000 735#define QLCNIC_RCODE_DRIVER_CAN_RELOAD 0x40000000
695#define QLCNIC_RCODE_FATAL_ERROR 0x80000000 736#define QLCNIC_RCODE_FATAL_ERROR 0x80000000
@@ -721,6 +762,35 @@ struct qlcnic_legacy_intr_set {
721 u32 pci_int_reg; 762 u32 pci_int_reg;
722}; 763};
723 764
765#define QLCNIC_FW_API 0x1b216c
766#define QLCNIC_DRV_OP_MODE 0x1b2170
767#define QLCNIC_MSIX_BASE 0x132110
768#define QLCNIC_MAX_PCI_FUNC 8
769
770/* PCI function operational mode */
771enum {
772 QLCNIC_MGMT_FUNC = 0,
773 QLCNIC_PRIV_FUNC = 1,
774 QLCNIC_NON_PRIV_FUNC = 2
775};
776
777/* FW HAL api version */
778enum {
779 QLCNIC_FW_BASE = 1,
780 QLCNIC_FW_NPAR = 2
781};
782
783#define QLC_DEV_DRV_DEFAULT 0x11111111
784
785#define LSB(x) ((uint8_t)(x))
786#define MSB(x) ((uint8_t)((uint16_t)(x) >> 8))
787
788#define LSW(x) ((uint16_t)((uint32_t)(x)))
789#define MSW(x) ((uint16_t)((uint32_t)(x) >> 16))
790
791#define LSD(x) ((uint32_t)((uint64_t)(x)))
792#define MSD(x) ((uint32_t)((((uint64_t)(x)) >> 16) >> 16))
793
724#define QLCNIC_LEGACY_INTR_CONFIG \ 794#define QLCNIC_LEGACY_INTR_CONFIG \
725{ \ 795{ \
726 { \ 796 { \