diff options
author | Vladislav Zolotarov <vladz@broadcom.com> | 2011-07-21 03:56:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-21 15:33:56 -0400 |
commit | bf61ee146749de86a5ac46b25d28f8da5bb39d03 (patch) | |
tree | 01e73869a9aee32b72c1ac7203f4bd2036a68f91 /drivers/net/bnx2x/bnx2x_main.c | |
parent | 7ad711b49e661a0979ed1a84bed16bc9fa7f872b (diff) |
bnx2x: Implementation for netdev->ndo_fcoe_get_wwn
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_main.c | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 28ef7faf4480..121df1f676e3 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -9104,10 +9104,13 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) | |||
9104 | #ifdef BCM_CNIC | 9104 | #ifdef BCM_CNIC |
9105 | static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp) | 9105 | static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp) |
9106 | { | 9106 | { |
9107 | int port = BP_PORT(bp); | ||
9108 | int func = BP_ABS_FUNC(bp); | ||
9109 | |||
9107 | u32 max_iscsi_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp, | 9110 | u32 max_iscsi_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp, |
9108 | drv_lic_key[BP_PORT(bp)].max_iscsi_conn); | 9111 | drv_lic_key[port].max_iscsi_conn); |
9109 | u32 max_fcoe_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp, | 9112 | u32 max_fcoe_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp, |
9110 | drv_lic_key[BP_PORT(bp)].max_fcoe_conn); | 9113 | drv_lic_key[port].max_fcoe_conn); |
9111 | 9114 | ||
9112 | /* Get the number of maximum allowed iSCSI and FCoE connections */ | 9115 | /* Get the number of maximum allowed iSCSI and FCoE connections */ |
9113 | bp->cnic_eth_dev.max_iscsi_conn = | 9116 | bp->cnic_eth_dev.max_iscsi_conn = |
@@ -9118,11 +9121,59 @@ static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp) | |||
9118 | (max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >> | 9121 | (max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >> |
9119 | BNX2X_MAX_FCOE_INIT_CONN_SHIFT; | 9122 | BNX2X_MAX_FCOE_INIT_CONN_SHIFT; |
9120 | 9123 | ||
9124 | /* Read the WWN: */ | ||
9125 | if (!IS_MF(bp)) { | ||
9126 | /* Port info */ | ||
9127 | bp->cnic_eth_dev.fcoe_wwn_port_name_hi = | ||
9128 | SHMEM_RD(bp, | ||
9129 | dev_info.port_hw_config[port]. | ||
9130 | fcoe_wwn_port_name_upper); | ||
9131 | bp->cnic_eth_dev.fcoe_wwn_port_name_lo = | ||
9132 | SHMEM_RD(bp, | ||
9133 | dev_info.port_hw_config[port]. | ||
9134 | fcoe_wwn_port_name_lower); | ||
9135 | |||
9136 | /* Node info */ | ||
9137 | bp->cnic_eth_dev.fcoe_wwn_node_name_hi = | ||
9138 | SHMEM_RD(bp, | ||
9139 | dev_info.port_hw_config[port]. | ||
9140 | fcoe_wwn_node_name_upper); | ||
9141 | bp->cnic_eth_dev.fcoe_wwn_node_name_lo = | ||
9142 | SHMEM_RD(bp, | ||
9143 | dev_info.port_hw_config[port]. | ||
9144 | fcoe_wwn_node_name_lower); | ||
9145 | } else if (!IS_MF_SD(bp)) { | ||
9146 | u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg); | ||
9147 | |||
9148 | /* | ||
9149 | * Read the WWN info only if the FCoE feature is enabled for | ||
9150 | * this function. | ||
9151 | */ | ||
9152 | if (cfg & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) { | ||
9153 | /* Port info */ | ||
9154 | bp->cnic_eth_dev.fcoe_wwn_port_name_hi = | ||
9155 | MF_CFG_RD(bp, func_ext_config[func]. | ||
9156 | fcoe_wwn_port_name_upper); | ||
9157 | bp->cnic_eth_dev.fcoe_wwn_port_name_lo = | ||
9158 | MF_CFG_RD(bp, func_ext_config[func]. | ||
9159 | fcoe_wwn_port_name_lower); | ||
9160 | |||
9161 | /* Node info */ | ||
9162 | bp->cnic_eth_dev.fcoe_wwn_node_name_hi = | ||
9163 | MF_CFG_RD(bp, func_ext_config[func]. | ||
9164 | fcoe_wwn_node_name_upper); | ||
9165 | bp->cnic_eth_dev.fcoe_wwn_node_name_lo = | ||
9166 | MF_CFG_RD(bp, func_ext_config[func]. | ||
9167 | fcoe_wwn_node_name_lower); | ||
9168 | } | ||
9169 | } | ||
9170 | |||
9121 | BNX2X_DEV_INFO("max_iscsi_conn 0x%x max_fcoe_conn 0x%x\n", | 9171 | BNX2X_DEV_INFO("max_iscsi_conn 0x%x max_fcoe_conn 0x%x\n", |
9122 | bp->cnic_eth_dev.max_iscsi_conn, | 9172 | bp->cnic_eth_dev.max_iscsi_conn, |
9123 | bp->cnic_eth_dev.max_fcoe_conn); | 9173 | bp->cnic_eth_dev.max_fcoe_conn); |
9124 | 9174 | ||
9125 | /* If mamimum allowed number of connections is zero - | 9175 | /* |
9176 | * If maximum allowed number of connections is zero - | ||
9126 | * disable the feature. | 9177 | * disable the feature. |
9127 | */ | 9178 | */ |
9128 | if (!bp->cnic_eth_dev.max_iscsi_conn) | 9179 | if (!bp->cnic_eth_dev.max_iscsi_conn) |
@@ -9993,6 +10044,9 @@ static const struct net_device_ops bnx2x_netdev_ops = { | |||
9993 | #endif | 10044 | #endif |
9994 | .ndo_setup_tc = bnx2x_setup_tc, | 10045 | .ndo_setup_tc = bnx2x_setup_tc, |
9995 | 10046 | ||
10047 | #if defined(NETDEV_FCOE_WWNN) && defined(BCM_CNIC) | ||
10048 | .ndo_fcoe_get_wwn = bnx2x_fcoe_get_wwn, | ||
10049 | #endif | ||
9996 | }; | 10050 | }; |
9997 | 10051 | ||
9998 | static inline int bnx2x_set_coherency_mask(struct bnx2x *bp) | 10052 | static inline int bnx2x_set_coherency_mask(struct bnx2x *bp) |