Skip to contentSkip to conversation

: Add iSCSI support to BNX2 devices.

RFC In review Michael Chan 1 participant 1 message Aug 4, 2007

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

RFC 1/2 : Add iSCSI support to BNX2 devices.

drivers/net/Kconfig +10 -0
index 81ef81c..b23c142 100644
@@ -2237,6 +2237,16 @@ config BNX2
 	  To compile this driver as a module, choose M here: the module
 	  will be called bnx2.  This is recommended.
 
+config CNIC
+	tristate "Broadcom CNIC support"
+	depends on BNX2
+	help
+	  This driver supports offload features of Broadcom NetXtremeII
+	  gigabit Ethernet cards.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called cnic.  This is recommended.
+
 config SPIDER_NET
 	tristate "Spider Gigabit Ethernet driver"
 	depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB)
drivers/net/Makefile +1 -0
index e684212..3b5f057 100644
@@ -59,6 +59,7 @@ obj-$(CONFIG_STNIC) += stnic.o 8390.o
 obj-$(CONFIG_FEALNX) += fealnx.o
 obj-$(CONFIG_TIGON3) += tg3.o
 obj-$(CONFIG_BNX2) += bnx2.o
+obj-$(CONFIG_CNIC) += cnic.o
 spidernet-y += spider_net.o spider_net_ethtool.o
 obj-$(CONFIG_SPIDER_NET) += spidernet.o sungem_phy.o
 obj-$(CONFIG_GELIC_NET) += ps3_gelic.o
drivers/net/bnx2.c +105 -11

250 lines not on this page · raw message

drivers/net/bnx2.h +22 -3
index 102adfe..75929c7 100644
@@ -6465,6 +6465,16 @@ struct flash_spec {
 	u8  *name;
 };
 
+struct cnic_ops {
+	struct module		*cnic_owner;
+	void			(*cnic_stop)(void *);
+	void			(*cnic_start)(void *);
+	int			(*cnic_handler)(void *, struct status_block *);
+};
+
+extern int bnx2_register_cnic(struct net_device *, struct cnic_ops *, void *);
+extern int bnx2_unregister_cnic(struct net_device *);
+
 struct bnx2 {
 	/* Fields used in the tx and intr/napi performance paths are grouped */
 	/* together in the beginning of the structure. */
@@ -6524,6 +6534,10 @@ struct bnx2 {
 	int		tx_ring_size;
 	u32		tx_wake_thresh;
 
+	struct cnic_ops		*cnic_ops;
+	void			*cnic_data;
+	int			cnic_tag;
+
 	/* End of fields used in the performance code paths. */
 
 	char			*name;
@@ -6635,6 +6649,7 @@ struct bnx2 {
 
 	u16			req_line_speed;
 	u8			req_duplex;
+	u8			req_port;
 
 	u8			phy_port;
 	u8			link_up;
@@ -6684,8 +6699,10 @@ struct bnx2 {
 	void			*gunzip_buf;
 };
 
-static u32 bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset);
-static void bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val);
+extern u32 bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset);
+extern void bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val);
+extern u32 bnx2_reg_rd_ind_locked(struct bnx2 *bp, u32 offset);
+extern void bnx2_reg_wr_ind_locked(struct bnx2 *bp, u32 offset, u32 val);
 
 #define REG_RD(bp, offset)					\
 	readl(bp->regview + offset)
@@ -6704,7 +6721,9 @@ static void bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val);
 
 /* Indirect context access.  Unlike the MBQ_WR, these macros will not
  * trigger a chip event. */
-static void bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val);
+extern void bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val);
+extern void bnx2_ctx_wr_locked(struct bnx2 *bp, u32 cid_addr, u32 offset,
+			       u32 val);
 
 #define CTX_WR(bp, cid_addr, offset, val)			\
 	bnx2_ctx_wr(bp, cid_addr, offset, val)
drivers/net/cnic.c new file +1885 -0

1,885 lines not on this page · raw message

drivers/net/cnic.h new file +163 -0

163 lines not on this page · raw message

drivers/net/cnic_cm.h new file +555 -0

555 lines not on this page · raw message

drivers/net/cnic_if.h new file +152 -0

69 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.