diff options
author | Ariel Elior <ariele@broadcom.com> | 2013-01-01 05:22:32 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-02 01:45:06 -0800 |
commit | b56e9670ffa4de1a3cf0ca2f89ff5e2e0c31a1f7 (patch) | |
tree | d2b8a133c9f7d8726bea5e16dade32e4b7e56d03 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | |
parent | 290ca2bb456d4214f00ba0b83fcb9793963fe007 (diff) | |
download | op-kernel-dev-b56e9670ffa4de1a3cf0ca2f89ff5e2e0c31a1f7.zip op-kernel-dev-b56e9670ffa4de1a3cf0ca2f89ff5e2e0c31a1f7.tar.gz |
bnx2x: Prepare device and initialize VF database
At nic load of the PF, if VFs may be present, prepare the device
for the VFs. Initialize the VF database in preparation of VF arrival.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h index 97275aa..0e521b0 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h @@ -179,6 +179,25 @@ struct bnx2x_virtf { #define for_each_vf(bp, var) \ for ((var) = 0; (var) < BNX2X_NR_VIRTFN(bp); (var)++) +#define HW_VF_HANDLE(bp, abs_vfid) \ + (u16)(BP_ABS_FUNC((bp)) | (1<<3) | ((u16)(abs_vfid) << 4)) + +#define FW_PF_MAX_HANDLE 8 + +#define FW_VF_HANDLE(abs_vfid) \ + (abs_vfid + FW_PF_MAX_HANDLE) + +/* VF mail box (aka vf-pf channel) */ + +/* a container for the bi-directional vf<-->pf messages. + * The actual response will be placed according to the offset parameter + * provided in the request + */ + +#define MBX_MSG_ALIGN 8 +#define MBX_MSG_ALIGNED_SIZE (roundup(sizeof(struct bnx2x_vf_mbx_msg), \ + MBX_MSG_ALIGN)) + struct bnx2x_vf_mbx_msg { union vfpf_tlvs req; union pfvf_tlvs resp; @@ -200,6 +219,29 @@ struct bnx2x_vf_mbx { */ }; +struct bnx2x_vf_sp { + union { + struct eth_classify_rules_ramrod_data e2; + } mac_rdata; + + union { + struct eth_classify_rules_ramrod_data e2; + } vlan_rdata; + + union { + struct eth_filter_rules_ramrod_data e2; + } rx_mode_rdata; + + union { + struct eth_multicast_rules_ramrod_data e2; + } mcast_rdata; + + union { + struct client_init_ramrod_data init_data; + struct client_update_ramrod_data update_data; + } q_data; +}; + struct hw_dma { void *addr; dma_addr_t mapping; @@ -239,11 +281,25 @@ struct bnx2x_vfdb { u32 flrd_vfs[FLRD_VFS_DWORDS]; }; +static inline u8 vf_igu_sb(struct bnx2x_virtf *vf, u16 sb_idx) +{ + return vf->igu_base_id + sb_idx; +} + /* global iov routines */ int bnx2x_iov_init_ilt(struct bnx2x *bp, u16 line); int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, int num_vfs_param); void bnx2x_iov_remove_one(struct bnx2x *bp); +void bnx2x_iov_free_mem(struct bnx2x *bp); +int bnx2x_iov_alloc_mem(struct bnx2x *bp); +int bnx2x_iov_nic_init(struct bnx2x *bp); +void bnx2x_iov_init_dq(struct bnx2x *bp); +void bnx2x_iov_init_dmae(struct bnx2x *bp); +void bnx2x_vf_enable_mbx(struct bnx2x *bp, u8 abs_vfid); int bnx2x_vf_idx_by_abs_fid(struct bnx2x *bp, u16 abs_vfid); +/* VF FLR helpers */ +int bnx2x_vf_flr_clnup_epilog(struct bnx2x *bp, u8 abs_vfid); +void bnx2x_vf_enable_access(struct bnx2x *bp, u8 abs_vfid); void bnx2x_add_tlv(struct bnx2x *bp, void *tlvs_list, u16 offset, u16 type, u16 length); void bnx2x_vfpf_prep(struct bnx2x *bp, struct vfpf_first_tlv *first_tlv, |