Skip to contentSkip to conversation

bnx2x: Implementation for netdev->ndo_fcoe_get_wwn

PATCH Applied Vlad Zolotarov 2 participants 2 messages Jul 21, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 bnx2x: Implementation for netdev->ndo_fcoe_get_wwn

---
 drivers/net/bnx2x/bnx2x_cmn.c  |   23 +++++++++++++++
 drivers/net/bnx2x/bnx2x_cmn.h  |   11 +++++++
 drivers/net/bnx2x/bnx2x_main.c |   60 ++++++++++++++++++++++++++++++++++++++--
 drivers/net/cnic_if.h          |    5 +++
 4 files changed, 96 insertions(+), 3 deletions(-)
drivers/net/bnx2x/bnx2x_cmn.c +23 -0
index 8b079dc..3aadc30 100644
@@ -3327,6 +3327,29 @@ int bnx2x_get_link_cfg_idx(struct bnx2x *bp)
 	return LINK_CONFIG_IDX(sel_phy_idx);
 }
 
+#if defined(NETDEV_FCOE_WWNN) && defined(BCM_CNIC)
+int bnx2x_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
+{
+	struct bnx2x *bp = netdev_priv(dev);
+	struct cnic_eth_dev *cp = &bp->cnic_eth_dev;
+
+	switch (type) {
+	case NETDEV_FCOE_WWNN:
+		*wwn = HILO_U64(cp->fcoe_wwn_node_name_hi,
+				cp->fcoe_wwn_node_name_lo);
+		break;
+	case NETDEV_FCOE_WWPN:
+		*wwn = HILO_U64(cp->fcoe_wwn_port_name_hi,
+				cp->fcoe_wwn_port_name_lo);
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	return 0;
+}
+#endif
+
 /* called with rtnl_lock */
 int bnx2x_change_mtu(struct net_device *dev, int new_mtu)
 {
drivers/net/bnx2x/bnx2x_cmn.h +11 -0
index 83d7d1b..223bfee 100644
@@ -522,6 +522,17 @@ void bnx2x_free_mem_bp(struct bnx2x *bp);
  */
 int bnx2x_change_mtu(struct net_device *dev, int new_mtu);
 
+#if defined(BCM_CNIC) && (defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE))
+/**
+ * bnx2x_fcoe_get_wwn - return the requested WWN value for this port
+ *
+ * @dev:	net_device
+ * @wwn:	output buffer
+ * @type:	WWN type: NETDEV_FCOE_WWNN (node) or NETDEV_FCOE_WWPN (port)
+ *
+ */
+int bnx2x_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type);
+#endif
 u32 bnx2x_fix_features(struct net_device *dev, u32 features);
 int bnx2x_set_features(struct net_device *dev, u32 features);
 
drivers/net/bnx2x/bnx2x_main.c +57 -3

84 lines not on this page · raw message

drivers/net/cnic_if.h +5 -0
index 642b9d5..8a1ffbe 100644
@@ -181,6 +181,11 @@ struct cnic_eth_dev {
 	u32		max_fcoe_conn;
 	u32		max_rdma_conn;
 	u32		fcoe_init_cid;
+	u32		fcoe_wwn_port_name_hi;
+	u32		fcoe_wwn_port_name_lo;
+	u32		fcoe_wwn_node_name_hi;
+	u32		fcoe_wwn_node_name_lo;
+
 	u16		iscsi_l2_client_id;
 	u16		iscsi_l2_cid;
 	u8		iscsi_mac[ETH_ALEN];
Signature · 1 line
1.7.4.1