Skip to contentSkip to conversation

lpfc: Add LPFC TM API v4 WIP

PATCH New Nicholas A. Bellinger 1 participant 1 message Jul 20, 2010

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

PATCH 1/2 lpfc: Add LPFC TM API v4 WIP

From: Nicholas Bellinger <[email protected]>

This patch contains the lpfc_target_api.c related functions that are required to function existing TM API v2 HBQ I/O operation with LPFC_EXTRA_RING. There are a couple of significant differences with the new v4 API related to explict sliport and tgtport configuration in order to be driven by the fabric independent configfs infrastructure and TM child module code.

Note that backwards compat with v2 plugins is a WIP, as well as is the merge of TM v3 support.

---
 drivers/scsi/lpfc/Makefile               |    4 +-
 drivers/scsi/lpfc/lpfc_target_api.c      | 1375 ++++++++++++++++++++++++++++++
 drivers/scsi/lpfc/lpfc_target_api.h      |  180 ++++
 drivers/scsi/lpfc/lpfc_target_api_base.h |   45 +
 drivers/scsi/lpfc/lpfc_target_mod.h      |  159 ++++
 drivers/scsi/lpfc/lpfc_target_protos.h   |   34 +
 6 files changed, 1796 insertions(+), 1 deletions(-)
 create mode 100755 drivers/scsi/lpfc/lpfc_target_api.c
 create mode 100755 drivers/scsi/lpfc/lpfc_target_api.h
 create mode 100755 drivers/scsi/lpfc/lpfc_target_api_base.h
 create mode 100755 drivers/scsi/lpfc/lpfc_target_mod.h
 create mode 100755 drivers/scsi/lpfc/lpfc_target_protos.h
drivers/scsi/lpfc/Makefile +3 -1
index ad05d6e..752e232 100644
@@ -24,8 +24,10 @@ ifneq ($(GCOV),)
   EXTRA_CFLAGS += -O0
 endif
 
+EXTRA_CFLAGS += -DLPFC_TARGET_MODE
+
 obj-$(CONFIG_SCSI_LPFC) := lpfc.o
 
 lpfc-objs := lpfc_mem.o lpfc_sli.o lpfc_ct.o lpfc_els.o lpfc_hbadisc.o	\
 	lpfc_init.o lpfc_mbox.o lpfc_nportdisc.o lpfc_scsi.o lpfc_attr.o \
-	lpfc_vport.o lpfc_debugfs.o lpfc_bsg.o
+	lpfc_vport.o lpfc_debugfs.o lpfc_bsg.o lpfc_target_api.o
drivers/scsi/lpfc/lpfc_target_api.c new file +1375 -0

1,375 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_target_api.h new file +180 -0

180 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_target_api_base.h new file +45 -0

45 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_target_mod.h new file +159 -0

159 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_target_protos.h new file +34 -0
new file mode 100755
index 0000000..a08fce2
@@ -0,0 +1,34 @@
+/*******************************************************************
+ * This file is part of the Emulex Linux Device Driver for         *
+ * Fibre Channel Host Bus Adapters.                                *
+ * Copyright (C) 2003-2008 Emulex.  All rights reserved.           *
+ * EMULEX and SLI are trademarks of Emulex.                        *
+ * www.emulex.com                                                  *
+ *                                                                 *
+ * This program is free software; you can redistribute it and/or   *
+ * modify it under the terms of version 2 of the GNU General       *
+ * Public License as published by the Free Software Foundation.    *
+ * This program is distributed in the hope that it will be useful. *
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
+ * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
+ * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
+ * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
+ * more details, a copy of which can be found in the file COPYING  *
+ * included with this package.                                     *
+ *******************************************************************/
+#ifndef _H_LPFC_TGT_PROTO
+#define _H_LPFC_TGT_PROTO
+void tm_check_duplicate_wwpn(struct lpfc_vport *, struct lpfc_nodelist *);
+
+int lpfc_target_sliport_init(struct lpfc_hba *phba, struct pci_dev *pci_dev,
+			tm_driver_data_t *fabric_tgt_data);
+struct target_tgtport_s *lpfc_target_new_tgtport(struct lpfc_vport *vport);
+uint32_t lpfc_tm_tgtport_unbind(struct lpfc_vport *vport);
+uint32_t lpfc_target_check_login(struct lpfc_vport *, struct lpfc_nodelist *);
+
+tm_login_handle_t lpfc_tm_tgtport_login(struct lpfc_vport *,
+			struct lpfc_nodelist *);
+void lpfc_tm_tgtport_logout(struct lpfc_vport *, tm_login_handle_t);
+uint32_t lpfc_tm_tgtport_chk_login(struct lpfc_vport *, tm_login_info_t *);
+#endif				/* _H_LPFC_TGT_PROTO */
Signature · 1 line
1.5.6.5