public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dead code and missing statics in lpfc
@ 2004-05-31 10:04 Christoph Hellwig
  2004-06-06  8:47 ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2004-05-31 10:04 UTC (permalink / raw)
  To: James.Smart; +Cc: linux-scsi


 - remove dead EXPORT_SYMBOLS
 - mark everything static that can be (thanks to Tridge's findstatic.pl)
 - kill all dead functions
(- small lpfc_evt_iocb_free fixes that sneaked into the context)


diff -uNr lpfcdriver-2.6-8.0.2/lpfc_crtn.h lpfcdriver-2.6-8.0.2.hch/lpfc_crtn.h
--- lpfcdriver-2.6-8.0.2/lpfc_crtn.h	2004-05-27 11:07:54.000000000 +0200
+++ lpfcdriver-2.6-8.0.2.hch/lpfc_crtn.h	2004-05-28 13:53:53.126165400 +0200
@@ -101,10 +101,6 @@
 
 int lpfc_check_sparm(lpfcHBA_t *, LPFC_NODELIST_t *, SERV_PARM *, uint32_t);
 int lpfc_geportname(NAME_TYPE *, NAME_TYPE *);
-uint32_t lpfc_add_bind(lpfcHBA_t * phba, uint8_t bind_type,
-		       void *bind_id, uint32_t scsi_id);
-uint32_t lpfc_del_bind(lpfcHBA_t * phba, uint8_t bind_type,
-		       void *bind_id, uint32_t scsi_id);
 
 int lpfc_initial_flogi(lpfcHBA_t *);
 int lpfc_issue_els_plogi(lpfcHBA_t *, LPFC_NODELIST_t *, uint8_t);
@@ -112,8 +108,6 @@
 int lpfc_issue_els_adisc(lpfcHBA_t *, LPFC_NODELIST_t *, uint8_t);
 int lpfc_issue_els_logo(lpfcHBA_t *, LPFC_NODELIST_t *, uint8_t);
 int lpfc_issue_els_scr(lpfcHBA_t *, uint32_t, uint8_t);
-LPFC_IOCBQ_t *lpfc_prep_els_iocb(lpfcHBA_t *, uint8_t expectRsp,
-				uint16_t, uint8_t, LPFC_NODELIST_t *, uint32_t);
 int lpfc_els_free_iocb(lpfcHBA_t *, LPFC_IOCBQ_t *);
 void lpfc_cmpl_els_flogi(lpfcHBA_t *, LPFC_IOCBQ_t *, LPFC_IOCBQ_t *);
 void lpfc_cmpl_els_plogi(lpfcHBA_t *, LPFC_IOCBQ_t *, LPFC_IOCBQ_t *);
@@ -138,7 +132,6 @@
 
 void lpfc_ct_unsol_event(lpfcHBA_t *, LPFC_SLI_RING_t *, LPFC_IOCBQ_t *);
 int lpfc_ns_cmd(lpfcHBA_t *, LPFC_NODELIST_t *, int);
-int lpfc_issue_ct_rsp(lpfcHBA_t *, uint32_t, DMABUF_t *, DMABUFEXT_t *);
 int lpfc_fdmi_cmd(lpfcHBA_t *, LPFC_NODELIST_t *, int);
 void lpfc_fdmi_tmo(unsigned long);
 
@@ -150,8 +143,6 @@
 void lpfc_hba_init(lpfcHBA_t *);
 int lpfc_post_buffer(lpfcHBA_t *, LPFC_SLI_RING_t *, int, int);
 void lpfc_cleanup(lpfcHBA_t *, uint32_t);
-int lpfc_online(lpfcHBA_t *);
-int lpfc_offline(lpfcHBA_t *);
 int lpfc_scsi_free(lpfcHBA_t *);
 int lpfc_parse_binding_entry(lpfcHBA_t *, uint8_t *, uint8_t *,
 			     int, int, int, unsigned int *, int, int *);
@@ -162,7 +153,6 @@
 int lpfc_hba_put_event(lpfcHBA_t *, uint32_t, uint32_t, uint32_t, uint32_t,
 		      uint32_t);
 void lpfc_get_hba_model_desc(lpfcHBA_t *, uint8_t *, uint8_t *);
-void lpfc_get_hba_sym_node_name(lpfcHBA_t *, uint8_t *);
 
 
 int lpfc_sli_queue_setup(lpfcHBA_t *);
@@ -200,7 +190,6 @@
 int lpfc_sli_issue_mbox(lpfcHBA_t *, LPFC_MBOXQ_t *, uint32_t);
 int lpfc_sli_issue_iocb(lpfcHBA_t *, LPFC_SLI_RING_t *, LPFC_IOCBQ_t *,
 			uint32_t);
-int lpfc_sli_brdreset(lpfcHBA_t *);
 void lpfc_sli_pcimem_bcopy(uint32_t *, uint32_t *, uint32_t);
 int lpfc_sli_ringpostbuf_put(lpfcHBA_t *, LPFC_SLI_RING_t *, DMABUF_t *);
 DMABUF_t *lpfc_sli_ringpostbuf_get(lpfcHBA_t *, LPFC_SLI_RING_t *, dma_addr_t);
@@ -220,17 +209,12 @@
 
 int lpfc_sli_issue_iocb_wait(lpfcHBA_t *, LPFC_SLI_RING_t *,
 			    LPFC_IOCBQ_t *, uint32_t, LPFC_IOCBQ_t *, uint32_t);
-int lpfc_sli_issue_mbox_wait(lpfcHBA_t *, LPFC_MBOXQ_t *, uint32_t);
-int lpfc_sleep(lpfcHBA_t *, void *, long tmo);
-void lpfc_wakeup(lpfcHBA_t *, void *);
 
 LPFC_SCSI_BUF_t *lpfc_get_scsi_buf(lpfcHBA_t *);
 void lpfc_free_scsi_buf(LPFC_SCSI_BUF_t *);
 void lpfc_map_fcp_cmnd_to_bpl(lpfcHBA_t *, LPFC_SCSI_BUF_t *);
 void lpfc_free_scsi_cmd(LPFC_SCSI_BUF_t *);
 uint32_t lpfc_os_timeout_transform(lpfcHBA_t *, uint32_t);
-int lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t *, lpfcHBA_t *, uint32_t);
-int lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t *, lpfcHBA_t *, uint32_t);
 
 lpfcHBA_t *lpfc_get_phba_by_inst(int);
 
@@ -257,7 +241,6 @@
 
 void *lpfc_mbuf_alloc(lpfcHBA_t *, int, dma_addr_t *);
 void lpfc_mbuf_free(lpfcHBA_t *, void *, dma_addr_t);
-int lpfc_valid_lun(LPFCSCSITARGET_t *, uint64_t);
 
 void lpfc_sleep_ms(lpfcHBA_t *, int);
 
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_ct.c lpfcdriver-2.6-8.0.2.hch/lpfc_ct.c
--- lpfcdriver-2.6-8.0.2/lpfc_ct.c	2004-05-27 11:07:54.000000000 +0200
+++ lpfcdriver-2.6-8.0.2.hch/lpfc_ct.c	2004-05-28 13:49:39.625703328 +0200
@@ -74,6 +74,7 @@
 						 LPFC_IOCBQ_t *),
 		uint32_t);
 static int lpfc_free_ct_rsp(lpfcHBA_t *, DMABUF_t *);
+static void lpfc_get_hba_sym_node_name(lpfcHBA_t *, uint8_t *);
 
 
 /*
@@ -680,65 +681,6 @@
 	return (0);
 }
 
-int
-lpfc_issue_ct_rsp(lpfcHBA_t * phba,
-		  uint32_t tag, DMABUF_t * bmp, DMABUFEXT_t * inp)
-{
-	LPFC_SLI_t *psli;
-	IOCB_t *icmd;
-	LPFC_IOCBQ_t *ctiocb;
-	LPFC_SLI_RING_t *pring;
-	uint32_t num_entry;
-	int rc = 0;
-
-	psli = &phba->sli;
-	pring = &psli->ring[LPFC_ELS_RING];	/* ELS ring */
-	num_entry = (uint32_t) inp->flag;
-	inp->flag = 0;
-
-	/* Allocate buffer for  command iocb */
-	if ((ctiocb = mempool_alloc(phba->iocb_mem_pool, GFP_ATOMIC)) == 0) {
-		return (ENOMEM);
-	}
-	memset(ctiocb, 0, sizeof (LPFC_IOCBQ_t));
-	icmd = &ctiocb->iocb;
-
-	icmd->un.xseq64.bdl.ulpIoTag32 = 0;
-	icmd->un.xseq64.bdl.addrHigh = putPaddrHigh(bmp->phys);
-	icmd->un.xseq64.bdl.addrLow = putPaddrLow(bmp->phys);
-	icmd->un.xseq64.bdl.bdeFlags = BUFF_TYPE_BDL;
-	icmd->un.xseq64.bdl.bdeSize = (num_entry * sizeof (ULP_BDE64));
-
-	icmd->un.xseq64.w5.hcsw.Fctl = (LS | LA);
-	icmd->un.xseq64.w5.hcsw.Dfctl = 0;
-	icmd->un.xseq64.w5.hcsw.Rctl = FC_SOL_CTL;
-	icmd->un.xseq64.w5.hcsw.Type = FC_COMMON_TRANSPORT_ULP;
-
-	dma_sync_single(&phba->pcidev->dev, bmp->phys, 
-			LPFC_BPL_SIZE, DMA_TO_DEVICE);
-
-	icmd->ulpIoTag = lpfc_sli_next_iotag(phba, pring);
-
-	/* Fill in rest of iocb */
-	icmd->ulpCommand = CMD_XMIT_SEQUENCE64_CX;
-	icmd->ulpBdeCount = 1;
-	icmd->ulpLe = 1;
-	icmd->ulpClass = CLASS3;
-	icmd->ulpContext = (ushort) tag;
-	/* Xmit CT response on exchange <xid> */
-	lpfc_printf_log(phba->brd_no, &lpfc_msgBlk0118,
-			lpfc_mes0118, lpfc_msgBlk0118.msgPreambleStr,
-			icmd->ulpContext, icmd->ulpIoTag, phba->hba_state);
-
-	ctiocb->iocb_cmpl = 0;
-	ctiocb->iocb_flag |= LPFC_IO_LIBDFC;
-
-	rc = lpfc_sli_issue_iocb_wait(phba, pring, ctiocb, SLI_IOCB_USE_TXQ, 0,
-				     phba->fc_ratov * 2 + LPFC_DRVR_TIMEOUT);
-	mempool_free( ctiocb, phba->iocb_mem_pool);
-	return (rc);
-}				/* lpfc_issue_ct_rsp */
-
 static int
 lpfc_gen_req(lpfcHBA_t * phba,
 	     DMABUF_t * bmp,
@@ -2019,7 +1961,7 @@
 	}
 }
 
-void
+static void
 lpfc_get_hba_sym_node_name(lpfcHBA_t * phba, uint8_t * symbp)
 {
 	uint8_t buf[16];
Binary files lpfcdriver-2.6-8.0.2/lpfc_ct.o and lpfcdriver-2.6-8.0.2.hch/lpfc_ct.o differ
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_els.c lpfcdriver-2.6-8.0.2.hch/lpfc_els.c
--- lpfcdriver-2.6-8.0.2/lpfc_els.c	2004-05-27 11:07:54.000000000 +0200
+++ lpfcdriver-2.6-8.0.2.hch/lpfc_els.c	2004-05-28 13:47:04.079349968 +0200
@@ -57,6 +57,8 @@
 static int lpfc_issue_els_flogi(lpfcHBA_t *, LPFC_NODELIST_t *, uint8_t);
 static void lpfc_more_plogi(lpfcHBA_t *);
 static void lpfc_more_adisc(lpfcHBA_t *);
+static LPFC_IOCBQ_t *lpfc_prep_els_iocb(lpfcHBA_t *, uint8_t, uint16_t,
+		uint8_t, LPFC_NODELIST_t *, uint32_t);
 
 static int lpfc_max_els_tries = 3;
 
@@ -1379,7 +1381,7 @@
 	return (0);
 }
 
-LPFC_IOCBQ_t *
+static LPFC_IOCBQ_t *
 lpfc_prep_els_iocb(lpfcHBA_t * phba,
 		   uint8_t expectRsp,
 		   uint16_t cmdSize,
Binary files lpfcdriver-2.6-8.0.2/lpfc_els.o and lpfcdriver-2.6-8.0.2.hch/lpfc_els.o differ
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_fcp.c lpfcdriver-2.6-8.0.2.hch/lpfc_fcp.c
--- lpfcdriver-2.6-8.0.2/lpfc_fcp.c	2004-05-27 11:07:54.000000000 +0200
+++ lpfcdriver-2.6-8.0.2.hch/lpfc_fcp.c	2004-05-28 13:54:16.054679736 +0200
@@ -107,6 +107,7 @@
 static uint32_t lpfc_get_cfgparam(int, int);
 
 static int lpfc_do_dpc(void *);
+static int lpfc_valid_lun(LPFCSCSITARGET_t *, uint64_t);
 
 /* Binding Definitions: Max string size  */
 #define FC_MAX_DID_STRING       6
@@ -967,7 +968,8 @@
 	writel((ha_copy & ~(HA_LATT | HA_ERATT)), phba->HAregaddr);
 	return (ha_copy);
 }				/* lpfc_intr_prep */
-int
+
+static int
 lpfc_valid_lun(LPFCSCSITARGET_t * targetp, uint64_t lun)
 {
 	uint32_t rptLunLen;
@@ -2086,33 +2088,6 @@
 }
 
 
-int
-lpfc_sleep(lpfcHBA_t * phba, void *wait_q_head, long tmo)
-{
-	wait_queue_t wq_entry;
-	int rc = 1;
-	long left;
-
-	init_waitqueue_entry(&wq_entry, current);
-	/* start to sleep before we wait, to avoid races */
-	set_current_state(TASK_INTERRUPTIBLE);
-	add_wait_queue((wait_queue_head_t *) wait_q_head, &wq_entry);
-	if (tmo > 0) {
-		left = schedule_timeout(tmo * HZ);
-	} else {
-		schedule();
-		left = 0;
-	}
-	remove_wait_queue((wait_queue_head_t *) wait_q_head, &wq_entry);
-
-	if (signal_pending(current))
-		return (EINTR);
-	if (rc > 0)
-		return (0);
-	else
-		return (ETIMEDOUT);
-}
-
 /*
  * This is only called to handle FC discovery events. Since this a rare
  * occurance, we allocate an LPFC_DISC_EVT_t structure here instead of
@@ -2149,19 +2124,18 @@
 }
 
 
-static int
+static void
 lpfc_evt_iocb_free(lpfcHBA_t * phba, LPFC_IOCBQ_t * saveq)
 {
 	LPFC_IOCBQ_t     * rspiocbp;
 	LPFC_IOCBQ_t     * tmpiocbp;
 
 	/* Free up iocb buffer chain for cmd just processed */
-	list_for_each_entry_safe(rspiocbp, tmpiocbp, 
-		&saveq->list, list) {
+	list_for_each_entry_safe(rspiocbp, tmpiocbp, &saveq->list, list) {
 		list_del(&rspiocbp->list);
-		mempool_free( rspiocbp, phba->iocb_mem_pool);
+		mempool_free(rspiocbp, phba->iocb_mem_pool);
 	}
-	mempool_free( saveq, phba->iocb_mem_pool);
+	mempool_free(saveq, phba->iocb_mem_pool);
 }
 
 int
@@ -2264,55 +2238,3 @@
 module_init(lpfc_init);
 module_exit(lpfc_exit);
 MODULE_LICENSE("GPL");
-/*
- * Note: PPC64 architecture has function descriptors,
- * so insmod on 2.4 does not automatically export all symbols.
- */
-EXPORT_SYMBOL(lpfc_add_bind);
-EXPORT_SYMBOL(lpfc_block_requests);
-EXPORT_SYMBOL(lpfc_build_scsi_cmd);
-EXPORT_SYMBOL(lpfc_decode_firmware_rev);
-EXPORT_SYMBOL(lpfc_del_bind);
-EXPORT_SYMBOL(lpfc_drvr_name);
-EXPORT_SYMBOL(lpfc_els_free_iocb);
-EXPORT_SYMBOL(lpfc_find_lun);
-EXPORT_SYMBOL(lpfc_findnode_did);
-EXPORT_SYMBOL(lpfc_findnode_scsiid);
-EXPORT_SYMBOL(lpfc_findnode_wwnn);
-EXPORT_SYMBOL(lpfc_findnode_wwpn);
-EXPORT_SYMBOL(lpfc_free_scsi_buf);
-EXPORT_SYMBOL(lpfc_geportname);
-EXPORT_SYMBOL(lpfc_get_hba_model_desc);
-EXPORT_SYMBOL(lpfc_get_hba_sym_node_name);
-EXPORT_SYMBOL(lpfc_get_scsi_buf);
-EXPORT_SYMBOL(lpfc_init_link);
-EXPORT_SYMBOL(lpfc_issue_ct_rsp);
-EXPORT_SYMBOL(lpfc_issue_els_adisc);
-EXPORT_SYMBOL(lpfc_issue_els_logo);
-EXPORT_SYMBOL(lpfc_issue_els_plogi);
-EXPORT_SYMBOL(lpfc_mbuf_alloc);
-EXPORT_SYMBOL(lpfc_mbuf_free);
-EXPORT_SYMBOL(lpfc_nlp_bind);
-EXPORT_SYMBOL(lpfc_page_alloc);
-EXPORT_SYMBOL(lpfc_page_free);
-EXPORT_SYMBOL(lpfc_offline);
-EXPORT_SYMBOL(lpfc_online);
-EXPORT_SYMBOL(lpfc_prep_els_iocb);
-EXPORT_SYMBOL(lpfc_release_version);
-EXPORT_SYMBOL(lpfc_scsi_lun_reset);
-EXPORT_SYMBOL(lpfc_scsi_tgt_reset);
-EXPORT_SYMBOL(lpfc_sleep);
-EXPORT_SYMBOL(lpfc_sleep_ms);
-EXPORT_SYMBOL(lpfc_sli_brdreset);
-EXPORT_SYMBOL(lpfc_sli_issue_iocb_wait);
-EXPORT_SYMBOL(lpfc_sli_issue_mbox);
-EXPORT_SYMBOL(lpfc_sli_issue_mbox_wait);
-EXPORT_SYMBOL(lpfc_sli_next_iotag);
-EXPORT_SYMBOL(lpfc_sli_pcimem_bcopy);
-EXPORT_SYMBOL(lpfc_unblock_requests);
-EXPORT_SYMBOL(lpfc_get_phba_by_inst);
-EXPORT_SYMBOL(lpfc_num_hba);
-EXPORT_SYMBOL(lpfc_loadtime);
-EXPORT_SYMBOL(lpfc_hba_list);
-
-
Binary files lpfcdriver-2.6-8.0.2/lpfc_fcp.o and lpfcdriver-2.6-8.0.2.hch/lpfc_fcp.o differ
Binary files lpfcdriver-2.6-8.0.2/lpfc_hbadisc.o and lpfcdriver-2.6-8.0.2.hch/lpfc_hbadisc.o differ
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_init.c lpfcdriver-2.6-8.0.2.hch/lpfc_init.c
--- lpfcdriver-2.6-8.0.2/lpfc_init.c	2004-05-27 11:07:55.000000000 +0200
+++ lpfcdriver-2.6-8.0.2.hch/lpfc_init.c	2004-05-28 13:45:44.284480632 +0200
@@ -47,6 +47,8 @@
 static void lpfc_establish_link_tmo(unsigned long ptr);
 static int lpfc_check_for_vpd = 1;
 static int lpfc_rdrev_wd30 = 0;
+static int lpfc_online(lpfcHBA_t *);
+static int lpfc_offline(lpfcHBA_t *);
 
 
 /************************************************************************/
@@ -1153,7 +1155,7 @@
 	spin_unlock_irqrestore(&(phba->drvrlock), iflag);
 }
 
-int
+static int
 lpfc_online(lpfcHBA_t * phba)
 {
 	uint32_t timeout;
@@ -1199,7 +1201,7 @@
 	return (0);
 }
 
-int
+static int
 lpfc_offline(lpfcHBA_t * phba)
 {
 	LPFC_SLI_RING_t *pring;
Binary files lpfcdriver-2.6-8.0.2/lpfc_init.o and lpfcdriver-2.6-8.0.2.hch/lpfc_init.o differ
Binary files lpfcdriver-2.6-8.0.2/lpfc_logmsg.o and lpfcdriver-2.6-8.0.2.hch/lpfc_logmsg.o differ
Binary files lpfcdriver-2.6-8.0.2/lpfc_mbox.o and lpfcdriver-2.6-8.0.2.hch/lpfc_mbox.o differ
Binary files lpfcdriver-2.6-8.0.2/lpfc_mem.o and lpfcdriver-2.6-8.0.2.hch/lpfc_mem.o differ
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_nportdisc.c lpfcdriver-2.6-8.0.2.hch/lpfc_nportdisc.c
--- lpfcdriver-2.6-8.0.2/lpfc_nportdisc.c	2004-05-27 11:07:55.000000000 +0200
+++ lpfcdriver-2.6-8.0.2.hch/lpfc_nportdisc.c	2004-05-28 13:51:25.075672496 +0200
@@ -3021,264 +3021,6 @@
 	return (0);
 }
 
-uint32_t
-lpfc_add_bind(lpfcHBA_t * phba, uint8_t bind_type,	/* NN/PN/DID */
-	      void *bind_id,	/* pointer to the bind id value */
-	      uint32_t scsi_id)
-{
-	LPFC_NODELIST_t *ndlp;
-	LPFC_BINDLIST_t *blp;
-	LPFCSCSITARGET_t *targetp;
-	LPFCSCSILUN_t *lunp;
-	struct list_head *pos;
-	struct list_head *curr, *next;
-
-	/* Check if the SCSI ID is currently mapped */
-	ndlp = lpfc_findnode_scsiid(phba, scsi_id);
-	if (ndlp && (ndlp != &phba->fc_fcpnodev)) {
-		return ENOENT;
-	}
-	/* Check if the SCSI ID is currently in the bind list. */
-	list_for_each(pos, &phba->fc_nlpbind_list) {
-		blp = list_entry(pos, LPFC_BINDLIST_t, nlp_listp);
-	
-		if (blp->nlp_sid == scsi_id) {
-			return ENOENT;
-		}
-		switch (bind_type) {
-		case FCP_SEED_WWPN:
-			if ((blp->nlp_bind_type & FCP_SEED_WWPN) &&
-			    (lpfc_geportname(bind_id, &blp->nlp_portname) ==
-			     2)) {
-				return EBUSY;
-			}
-			break;
-		case FCP_SEED_WWNN:
-			if ((blp->nlp_bind_type & FCP_SEED_WWNN) &&
-			    (lpfc_geportname(bind_id, &blp->nlp_nodename) ==
-			     2)) {
-				return EBUSY;
-			}
-			break;
-		case FCP_SEED_DID:
-			if ((blp->nlp_bind_type & FCP_SEED_DID) &&
-			    (*((uint32_t *) bind_id) == blp->nlp_DID)) {
-				return EBUSY;
-			}
-			break;
-		}
-	}
-	if (phba->fcp_mapping != bind_type) {
-		return EINVAL;
-	}
-	switch (bind_type) {
-	case FCP_SEED_WWNN:
-		{
-			/* Check if the node name present in the mapped list */
-			ndlp =
-			    lpfc_findnode_wwnn(phba, NLP_SEARCH_MAPPED,
-					       bind_id);
-			if (ndlp) {
-				return EBUSY;
-			}
-			ndlp =
-			    lpfc_findnode_wwnn(phba, NLP_SEARCH_UNMAPPED,
-					       bind_id);
-			break;
-		}
-	case FCP_SEED_WWPN:
-		{
-			/* Check if the port name present in the mapped list */
-			ndlp =
-			    lpfc_findnode_wwpn(phba, NLP_SEARCH_MAPPED,
-					       bind_id);
-			if (ndlp)
-				return EBUSY;
-			ndlp =
-			    lpfc_findnode_wwpn(phba, NLP_SEARCH_UNMAPPED,
-					       bind_id);
-			break;
-		}
-	case FCP_SEED_DID:
-		{
-			/* Check if the DID present in the mapped list */
-			ndlp =
-			    lpfc_findnode_did(phba, NLP_SEARCH_MAPPED,
-					      *((uint32_t *) bind_id));
-			if (ndlp)
-				return EBUSY;
-			ndlp =
-			    lpfc_findnode_did(phba, NLP_SEARCH_UNMAPPED,
-					      *((uint32_t *) bind_id));
-			break;
-		}
-	}
-
-	/* Add to the bind list */
-	if ((blp = (LPFC_BINDLIST_t *) mempool_alloc(phba->bind_mem_pool, GFP_ATOMIC)) == 0) {
-		return EIO;
-	}
-	memset(blp, 0, sizeof (LPFC_BINDLIST_t));
-	blp->nlp_bind_type = bind_type;
-	blp->nlp_sid = (scsi_id & 0xff);
-
-	switch (bind_type) {
-	case FCP_SEED_WWNN:
-		memcpy(&blp->nlp_nodename, (uint8_t *) bind_id,
-		       sizeof (NAME_TYPE));
-		break;
-
-	case FCP_SEED_WWPN:
-		memcpy(&blp->nlp_portname, (uint8_t *) bind_id,
-		       sizeof (NAME_TYPE));
-		break;
-
-	case FCP_SEED_DID:
-		blp->nlp_DID = *((uint32_t *) bind_id);
-		break;
-
-	}
-
-	lpfc_nlp_bind(phba, blp);
-	/* 
-	   If the newly added node is in the unmapped list, assign a
-	   SCSI ID to the node.
-	 */
-
-	if (ndlp) {
-		if ((blp = lpfc_assign_scsid(phba, ndlp, 0))) {
-			lpfc_nlp_mapped(phba, ndlp, blp);
-			ndlp->nlp_failMask = 0;
-			targetp = ndlp->nlp_Target;
-			if (targetp) {
-				list_for_each_safe(curr, next,
-						   &targetp->lunlist) {
-					lunp = list_entry(curr, LPFCSCSILUN_t,
-							  list);
-					lunp->failMask = 0;
-				}
-				if (targetp->tmofunc.function) {
-					del_timer_sync(&targetp->tmofunc);
-					targetp->tmofunc.function = 0;
-					list_del((struct list_head *)
-						&targetp->tmofunc_data);
-				}
-			} else {
-				/* new target to driver, allocate space to
-				   target <sid> lun 0 */
-				if (blp->nlp_Target == 0) {
-					lpfc_find_lun(phba, blp->nlp_sid, 0, 1);
-					blp->nlp_Target =
-					    phba->device_queue_hash[blp->
-								    nlp_sid];
-				}
-			}
-			lpfc_set_failmask(phba, ndlp, LPFC_DEV_RPTLUN,
-					  LPFC_SET_BITMASK);
-			ndlp->nlp_state = NLP_STE_MAPPED_NODE;
-			lpfc_disc_issue_rptlun(phba, ndlp);
-		}
-	}
-	return (0);
-}
-
-uint32_t
-lpfc_del_bind(lpfcHBA_t * phba, uint8_t bind_type,	/* NN/PN/DID */
-	      void *bind_id,	/* pointer to the bind id value */
-	      uint32_t scsi_id)
-{
-	LPFC_BINDLIST_t *blp = 0;
-	uint32_t found = 0;
-	LPFC_NODELIST_t *ndlp = 0;
-	struct list_head *pos;
-
-	/* Search the mapped list for the bind_id */
-	if (!bind_id) {
-		ndlp = lpfc_findnode_scsiid(phba, scsi_id);
-		if ((ndlp == &phba->fc_fcpnodev) ||
-		    (ndlp && (!(ndlp->nlp_flag & NLP_MAPPED_LIST))))
-			ndlp = 0;
-	} else {
-
-		if (bind_type != phba->fcp_mapping)
-			return EINVAL;
-
-		switch (bind_type) {
-		case FCP_SEED_WWNN:
-			ndlp =
-			    lpfc_findnode_wwnn(phba, NLP_SEARCH_MAPPED,
-					       bind_id);
-			break;
-
-		case FCP_SEED_WWPN:
-			ndlp =
-			    lpfc_findnode_wwpn(phba, NLP_SEARCH_MAPPED,
-					       bind_id);
-			break;
-
-		case FCP_SEED_DID:
-			ndlp =
-			    lpfc_findnode_did(phba, NLP_SEARCH_MAPPED,
-					      *((uint32_t *) bind_id));
-			break;
-		}
-	}
-
-	/* If there is a mapped target for this bing unmap it */
-	if (ndlp) {
-		return EBUSY;
-	}
-
-	/* check binding list */
-	list_for_each(pos, &phba->fc_nlpbind_list) {
-		blp = list_entry(pos, LPFC_BINDLIST_t, nlp_listp);
-
-		if (!bind_id) {
-			/* Search binding based on SCSI ID */
-			if (blp->nlp_sid == scsi_id) {
-				found = 1;
-				break;
-			} else {
-				continue;
-			}
-		}
-
-		switch (bind_type) {
-		case FCP_SEED_WWPN:
-			if ((blp->nlp_bind_type & FCP_SEED_WWPN) &&
-			    (lpfc_geportname(bind_id, &blp->nlp_portname) ==
-			     2)) {
-				found = 1;
-			}
-			break;
-		case FCP_SEED_WWNN:
-			if ((blp->nlp_bind_type & FCP_SEED_WWNN) &&
-			    (lpfc_geportname(bind_id, &blp->nlp_nodename) ==
-			     2)) {
-				found = 1;
-			}
-			break;
-		case FCP_SEED_DID:
-			if ((blp->nlp_bind_type & FCP_SEED_DID) &&
-			    (*((uint32_t *) bind_id) == blp->nlp_DID)) {
-				found = 1;
-			}
-			break;
-		}
-		if (found)
-			break;
-	}
-
-	if (found) {
-		/* take it off the bind list */
-		phba->fc_bind_cnt--;
-		list_del(&blp->nlp_listp);
-		return 0;
-	}
-
-	return ENOENT;
-}
-
 static LPFC_BINDLIST_t *
 lpfc_assign_scsid(lpfcHBA_t * phba, LPFC_NODELIST_t * ndlp,
 		  int prev_flag)
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_scsiport.c lpfcdriver-2.6-8.0.2.hch/lpfc_scsiport.c
--- lpfcdriver-2.6-8.0.2/lpfc_scsiport.c	2004-05-27 11:07:55.000000000 +0200
+++ lpfcdriver-2.6-8.0.2.hch/lpfc_scsiport.c	2004-05-28 14:45:03.229438760 +0200
@@ -537,7 +411,7 @@
 
 }
 
-int
+static int
 lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t * lpfc_cmd, 
 		    lpfcHBA_t *phba, uint32_t flag)
 {
@@ -640,7 +514,7 @@
 
 }
 
-int
+static int
 lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t * lpfc_cmd,
 		    lpfcHBA_t * phba, uint32_t flag)
 {
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_sli.c lpfcdriver-2.6-8.0.2.hch/lpfc_sli.c
--- lpfcdriver-2.6-8.0.2/lpfc_sli.c	2004-05-27 11:07:55.000000000 +0200
+++ lpfcdriver-2.6-8.0.2.hch/lpfc_sli.c	2004-05-28 13:56:00.790757432 +0200
@@ -61,9 +61,9 @@
 static DMABUF_t *lpfc_sli_ringpostbuf_search(lpfcHBA_t *, LPFC_SLI_RING_t *,
 	dma_addr_t, int);
 static void lpfc_sli_wake_iocb_wait(lpfcHBA_t *, LPFC_IOCBQ_t *, LPFC_IOCBQ_t *);
-static void lpfc_sli_wake_mbox_wait(lpfcHBA_t *, LPFC_MBOXQ_t *);
 static int lpfc_sli_abort_iocb_ring(lpfcHBA_t *, LPFC_SLI_RING_t *, uint32_t);
 static int lpfc_sli_resume_iocb(lpfcHBA_t *, LPFC_SLI_RING_t *);
+static int lpfc_sli_brdreset(lpfcHBA_t *);
 
 /*
  * Define macro to log: Mailbox command x%x cannot issue Data
@@ -2226,7 +2226,7 @@
 	return (portCmdGet);
 }
 
-int
+static int
 lpfc_sli_brdreset(lpfcHBA_t * phba)
 {
 	MAILBOX_t *swpmb;
@@ -3521,61 +3521,3 @@
 
 	return retval;
 }
-
-void
-lpfc_sli_wake_mbox_wait(lpfcHBA_t * phba, LPFC_MBOXQ_t * pmboxq)
-{
-	wait_queue_head_t *pdone_q;
-
-	/* 
-	 * If pdone_q is empty, the driver thread gave up waiting and
-	 * continued running.
-	 */
-	pdone_q = (wait_queue_head_t *) pmboxq->context1;
-	if (pdone_q)
-		wake_up_interruptible(pdone_q);
-	return;
-}
-
-int
-lpfc_sli_issue_mbox_wait(lpfcHBA_t * phba, LPFC_MBOXQ_t * pmboxq,
-			 uint32_t timeout)
-{
-	DECLARE_WAIT_QUEUE_HEAD(done_q);
-	DECLARE_WAITQUEUE(wq_entry, current);
-	uint32_t timeleft = 0;
-	int retval;
-
-	/* The caller must leave context1 empty. */
-	if (pmboxq->context1 != 0) {
-		return (MBX_NOT_FINISHED);
-	}
-
-	/* setup wake call as IOCB callback */
-	pmboxq->mbox_cmpl = lpfc_sli_wake_mbox_wait;
-	/* setup context field to pass wait_queue pointer to wake function  */
-	pmboxq->context1 = &done_q;
-
-	/* start to sleep before we wait, to avoid races */
-	set_current_state(TASK_INTERRUPTIBLE);
-	add_wait_queue(&done_q, &wq_entry);
-
-	/* now issue the command */
-	retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT);
-	if (retval == MBX_BUSY || retval == MBX_SUCCESS) {
-		timeleft = schedule_timeout(timeout * HZ);
-		pmboxq->context1 = 0;
-		/* if schedule_timeout returns 0, we timed out and were not
-		   woken up */
-		if (timeleft == 0) {
-			retval = MBX_TIMEOUT;
-		} else {
-			retval = MBX_SUCCESS;
-		}
-	}
-
-
-	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&done_q, &wq_entry);
-	return retval;
-}
Binary files lpfcdriver-2.6-8.0.2/lpfc_sli.o and lpfcdriver-2.6-8.0.2.hch/lpfc_sli.o differ
Binary files lpfcdriver-2.6-8.0.2/lpfc_sysfs.o and lpfcdriver-2.6-8.0.2.hch/lpfc_sysfs.o differ

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dead code and missing statics in lpfc
  2004-05-31 10:04 [PATCH] dead code and missing statics in lpfc Christoph Hellwig
@ 2004-06-06  8:47 ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2004-06-06  8:47 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: James.Smart, linux-scsi

On Mon, May 31, 2004 at 12:04:54PM +0200, Christoph Hellwig wrote:
> 
>  - remove dead EXPORT_SYMBOLS
>  - mark everything static that can be (thanks to Tridge's findstatic.pl)
>  - kill all dead functions
> (- small lpfc_evt_iocb_free fixes that sneaked into the context)

resend of the patch after you nicely broke it with random changes in today
code drop.

p.s. it seems emulex let some windows drone make the tarball, it's completely
 fscked up with broken dos line endings
p.s. v2  the fs attribute and sysfs support in the tarball is completely
bullshit.  take a look at what qlogic does and fix it up.


diff -urp lpfcdriver-2.6-8.0.3/lpfc_crtn.h lpfcdriver-2.6-8.0.3.hch/lpfc_crtn.h
--- lpfcdriver-2.6-8.0.3/lpfc_crtn.h	2004-06-06 18:48:59.000000000 +0200
+++ lpfcdriver-2.6-8.0.3.hch/lpfc_crtn.h	2004-06-06 10:36:33.024158344 +0200
@@ -74,11 +74,6 @@ int lpfc_no_rpi(struct lpfc_hba *, struc
 int lpfc_freenode(struct lpfc_hba *, struct lpfc_nodelist *);
 int lpfc_nlp_remove(struct lpfc_hba *, struct lpfc_nodelist *);
 struct lpfc_nodelist *lpfc_findnode_did(struct lpfc_hba *, uint32_t, uint32_t);
-struct lpfc_nodelist *lpfc_findnode_scsiid(struct lpfc_hba *, uint32_t);
-struct lpfc_nodelist *lpfc_findnode_wwpn(struct lpfc_hba *, uint32_t,
-				    struct lpfc_name *);
-struct lpfc_nodelist *lpfc_findnode_wwnn(struct lpfc_hba *, uint32_t,
-				    struct lpfc_name *);
 void lpfc_disc_list_loopmap(struct lpfc_hba *);
 void lpfc_disc_start(struct lpfc_hba *);
 void lpfc_disc_flush_list(struct lpfc_hba *);
@@ -118,9 +113,6 @@ int lpfc_issue_els_prli(struct lpfc_hba 
 int lpfc_issue_els_adisc(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t);
 int lpfc_issue_els_logo(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t);
 int lpfc_issue_els_scr(struct lpfc_hba *, uint32_t, uint8_t);
-struct lpfc_iocbq *lpfc_prep_els_iocb(struct lpfc_hba *, uint8_t expectRsp,
-				      uint16_t, uint8_t, struct lpfc_nodelist *,
-				      uint32_t);
 int lpfc_els_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *);
 void lpfc_cmpl_els_flogi(struct lpfc_hba *, struct lpfc_iocbq *,
 			 struct lpfc_iocbq *);
@@ -166,8 +158,6 @@ void lpfc_handle_latt(struct lpfc_hba *)
 void lpfc_hba_init(struct lpfc_hba *);
 int lpfc_post_buffer(struct lpfc_hba *, struct lpfc_sli_ring *, int, int);
 void lpfc_cleanup(struct lpfc_hba *, uint32_t);
-int lpfc_online(struct lpfc_hba *);
-int lpfc_offline(struct lpfc_hba *);
 int lpfc_scsi_free(struct lpfc_hba *);
 int lpfc_parse_binding_entry(struct lpfc_hba *, uint8_t *, uint8_t *,
 			     int, int, int, unsigned int *, int, int *);
@@ -215,7 +205,6 @@ int lpfc_sli_intr(struct lpfc_hba *);
 int lpfc_sli_issue_mbox(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t);
 int lpfc_sli_issue_iocb(struct lpfc_hba *, struct lpfc_sli_ring *,
 			struct lpfc_iocbq *, uint32_t);
-int lpfc_sli_brdreset(struct lpfc_hba *);
 void lpfc_sli_pcimem_bcopy(uint32_t *, uint32_t *, uint32_t);
 int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *,
 			     DMABUF_t *);
@@ -240,22 +229,14 @@ void lpfc_start_timer(struct lpfc_hba *,
 void lpfc_stop_timer(struct clk_data *);
 
 
-int lpfc_sli_issue_iocb_wait(struct lpfc_hba *, struct lpfc_sli_ring *,
-			     struct lpfc_iocbq *, uint32_t, struct lpfc_iocbq *,
-			     uint32_t);
 LPFC_SCSI_BUF_t *lpfc_get_scsi_buf(struct lpfc_hba *);
 void lpfc_free_scsi_buf(LPFC_SCSI_BUF_t *);
 void lpfc_map_fcp_cmnd_to_bpl(struct lpfc_hba *, LPFC_SCSI_BUF_t *);
 void lpfc_free_scsi_cmd(LPFC_SCSI_BUF_t *);
 uint32_t lpfc_os_timeout_transform(struct lpfc_hba *, uint32_t);
-int lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t *, struct lpfc_hba *, uint32_t);
-int lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t *, struct lpfc_hba *, uint32_t);
 
 struct lpfc_hba *lpfc_get_phba_by_inst(int);
 
-struct lpfc_bindlist *lpfc_assign_scsid(struct lpfc_hba *,
-					struct lpfc_nodelist *, int);
-
 void lpfc_sched_init_hba(struct lpfc_hba *, uint16_t);
 void lpfc_sched_target_init(LPFCSCSITARGET_t *, uint16_t);
 void lpfc_sched_lun_init(LPFCSCSILUN_t *, uint16_t);
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_ct.o
diff -urp lpfcdriver-2.6-8.0.3/lpfc_els.c lpfcdriver-2.6-8.0.3.hch/lpfc_els.c
--- lpfcdriver-2.6-8.0.3/lpfc_els.c	2004-06-06 18:48:59.000000000 +0200
+++ lpfcdriver-2.6-8.0.3.hch/lpfc_els.c	2004-06-06 10:29:04.543337792 +0200
@@ -70,6 +70,9 @@ static int lpfc_issue_els_flogi(struct l
 				uint8_t);
 static void lpfc_more_plogi(struct lpfc_hba *);
 static void lpfc_more_adisc(struct lpfc_hba *);
+static struct lpfc_iocbq *lpfc_prep_els_iocb(struct lpfc_hba * phba,
+		uint8_t expectRsp, uint16_t cmdSize, uint8_t retry,
+		struct lpfc_nodelist * ndlp, uint32_t elscmd);
 
 static int lpfc_max_els_tries = 3;
 
@@ -1408,7 +1411,7 @@ lpfc_els_retry(struct lpfc_hba * phba, s
 	return (0);
 }
 
-struct lpfc_iocbq *
+static struct lpfc_iocbq *
 lpfc_prep_els_iocb(struct lpfc_hba * phba,
 		   uint8_t expectRsp,
 		   uint16_t cmdSize,
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_els.o
diff -urp lpfcdriver-2.6-8.0.3/lpfc_fcp.c lpfcdriver-2.6-8.0.3.hch/lpfc_fcp.c
--- lpfcdriver-2.6-8.0.3/lpfc_fcp.c	2004-06-06 18:48:59.000000000 +0200
+++ lpfcdriver-2.6-8.0.3.hch/lpfc_fcp.c	2004-06-06 10:24:00.194605832 +0200
@@ -2266,51 +2266,3 @@ lpfc_do_dpc(void *p)
 module_init(lpfc_init);
 module_exit(lpfc_exit);
 MODULE_LICENSE("GPL");
-/*
- * Note: PPC64 architecture has function descriptors,
- * so insmod on 2.4 does not automatically export all symbols.
- */
-
-EXPORT_SYMBOL(lpfc_assign_scsid);
-EXPORT_SYMBOL(lpfc_block_requests);
-EXPORT_SYMBOL(lpfc_build_scsi_cmd);
-EXPORT_SYMBOL(lpfc_decode_firmware_rev);
-EXPORT_SYMBOL(lpfc_disc_issue_rptlun);
-EXPORT_SYMBOL(lpfc_drvr_name);
-EXPORT_SYMBOL(lpfc_els_free_iocb);
-EXPORT_SYMBOL(lpfc_find_lun);
-EXPORT_SYMBOL(lpfc_findnode_did);
-EXPORT_SYMBOL(lpfc_findnode_scsiid);
-EXPORT_SYMBOL(lpfc_findnode_wwnn);
-EXPORT_SYMBOL(lpfc_findnode_wwpn);
-EXPORT_SYMBOL(lpfc_free_scsi_buf);
-EXPORT_SYMBOL(lpfc_geportname);
-EXPORT_SYMBOL(lpfc_get_hba_model_desc);
-EXPORT_SYMBOL(lpfc_get_phba_by_inst);
-EXPORT_SYMBOL(lpfc_get_scsi_buf);
-EXPORT_SYMBOL(lpfc_hba_list);
-EXPORT_SYMBOL(lpfc_init_link);
-EXPORT_SYMBOL(lpfc_issue_els_adisc);
-EXPORT_SYMBOL(lpfc_issue_els_logo);
-EXPORT_SYMBOL(lpfc_issue_els_plogi);
-EXPORT_SYMBOL(lpfc_loadtime);
-EXPORT_SYMBOL(lpfc_mbuf_alloc);
-EXPORT_SYMBOL(lpfc_mbuf_free);
-EXPORT_SYMBOL(lpfc_nlp_bind);
-EXPORT_SYMBOL(lpfc_nlp_mapped);
-EXPORT_SYMBOL(lpfc_num_hba);
-EXPORT_SYMBOL(lpfc_offline);
-EXPORT_SYMBOL(lpfc_online);
-EXPORT_SYMBOL(lpfc_page_free);
-EXPORT_SYMBOL(lpfc_prep_els_iocb);
-EXPORT_SYMBOL(lpfc_release_version);
-EXPORT_SYMBOL(lpfc_scsi_lun_reset);
-EXPORT_SYMBOL(lpfc_scsi_tgt_reset);
-EXPORT_SYMBOL(lpfc_set_failmask);
-EXPORT_SYMBOL(lpfc_sleep_ms);
-EXPORT_SYMBOL(lpfc_sli_brdreset);
-EXPORT_SYMBOL(lpfc_sli_issue_iocb_wait);
-EXPORT_SYMBOL(lpfc_sli_issue_mbox);
-EXPORT_SYMBOL(lpfc_sli_next_iotag);
-EXPORT_SYMBOL(lpfc_sli_pcimem_bcopy);
-EXPORT_SYMBOL(lpfc_unblock_requests);
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_fcp.o
diff -urp lpfcdriver-2.6-8.0.3/lpfc_hbadisc.c lpfcdriver-2.6-8.0.3.hch/lpfc_hbadisc.c
--- lpfcdriver-2.6-8.0.3/lpfc_hbadisc.c	2004-06-06 18:49:00.000000000 +0200
+++ lpfcdriver-2.6-8.0.3.hch/lpfc_hbadisc.c	2004-06-06 10:37:04.846320640 +0200
@@ -1677,7 +1677,7 @@ out:
 }
 
 /* Search for a nodelist entry on a specific list */
-struct lpfc_nodelist *
+static struct lpfc_nodelist *
 lpfc_findnode_scsiid(struct lpfc_hba * phba, uint32_t scsid)
 {
 	struct lpfc_nodelist *ndlp;
@@ -1704,184 +1704,6 @@ lpfc_findnode_scsiid(struct lpfc_hba * p
 
 /* Search for a nodelist entry on a specific list */
 struct lpfc_nodelist *
-lpfc_findnode_wwnn(struct lpfc_hba * phba, uint32_t order,
-		   struct lpfc_name * wwnn)
-{
-	struct lpfc_nodelist *ndlp, *next_ndlp;
-	uint32_t data1;
-	struct lpfc_bindlist *blp;
-
-	blp = 0;
-	if (order & NLP_SEARCH_UNMAPPED) {
-		list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nlpunmap_list,
-					 nlp_listp) {
-			if (lpfc_geportname(&ndlp->nlp_nodename, wwnn) == 2) {
-
-				data1 = (((uint32_t) ndlp->nlp_state << 24) |
-					 ((uint32_t) ndlp->nlp_xri << 16) |
-					 ((uint32_t) ndlp->nlp_type << 8) |
-					 ((uint32_t) ndlp->nlp_rpi & 0xff));
-				/* FIND node DID unmapped */
-				lpfc_printf_log(phba->brd_no, &lpfc_msgBlk0910,
-						lpfc_mes0910,
-						lpfc_msgBlk0910.msgPreambleStr,
-						(ulong) ndlp, ndlp->nlp_DID,
-						ndlp->nlp_flag, data1);
-				if (order & NLP_SEARCH_DEQUE) {
-					ndlp->nlp_flag &=
-					    ~(NLP_UNMAPPED_LIST |
-					      NLP_TGT_NO_SCSIID);
-					phba->fc_unmap_cnt--;
-					list_del(&ndlp->nlp_listp);
-					phba->nport_event_cnt++;
-				}
-				return (ndlp);
-			}
-		}
-	}
-
-	if (order & NLP_SEARCH_MAPPED) {
-		list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nlpmap_list,
-					 nlp_listp) {
-			if (lpfc_geportname(&ndlp->nlp_nodename, wwnn) == 2) {
-
-				data1 = (((uint32_t) ndlp->nlp_state << 24) |
-					 ((uint32_t) ndlp->nlp_xri << 16) |
-					 ((uint32_t) ndlp->nlp_type << 8) |
-					 ((uint32_t) ndlp->nlp_rpi & 0xff));
-				/* FIND node did mapped */
-				lpfc_printf_log(phba->brd_no, &lpfc_msgBlk0902,
-						lpfc_mes0902,
-						lpfc_msgBlk0902.msgPreambleStr,
-						(ulong) ndlp, ndlp->nlp_DID,
-						ndlp->nlp_flag, data1);
-				if (order & NLP_SEARCH_DEQUE) {
-					ndlp->nlp_flag &= ~NLP_MAPPED_LIST;
-					phba->fc_map_cnt--;
-					list_del(&ndlp->nlp_listp);
-					phba->nport_event_cnt++;
-
-					/* Must call before binding is
-					   removed */
-					lpfc_set_failmask(phba, ndlp,
-							  LPFC_DEV_DISAPPEARED,
-							  LPFC_SET_BITMASK);
-
-					blp = ndlp->nlp_listp_bind;
-					ndlp->nlp_listp_bind = 0;
-					if (blp) {
-						blp->nlp_Target =
-						    ndlp->nlp_Target;
-					}
-					/* Keep Target and sid since
-					 * LPFC_DEV_DISAPPEARED is a
-					 * non-fatal error
-					 */
-					ndlp->nlp_flag &= ~NLP_SEED_MASK;
-				}
-				if (blp) {
-					lpfc_nlp_bind(phba, blp);
-				}
-				return (ndlp);
-			}
-		}
-	}
-
-	/* no match found */
-	return ((struct lpfc_nodelist *) 0);
-}
-
-/* Search for a nodelist entry on a specific list */
-struct lpfc_nodelist *
-lpfc_findnode_wwpn(struct lpfc_hba * phba, uint32_t order,
-		   struct lpfc_name * wwpn)
-{
-	struct lpfc_nodelist *ndlp, *next_ndlp;
-	uint32_t data1;
-	struct lpfc_bindlist *blp;
-
-	blp = 0;
-	if (order & NLP_SEARCH_UNMAPPED) {
-		list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nlpunmap_list,
-					nlp_listp) {
-			if (lpfc_geportname(&ndlp->nlp_portname, wwpn) == 2) {
-
-				data1 = (((uint32_t) ndlp->nlp_state << 24) |
-					 ((uint32_t) ndlp->nlp_xri << 16) |
-					 ((uint32_t) ndlp->nlp_type << 8) |
-					 ((uint32_t) ndlp->nlp_rpi & 0xff));
-				/* FIND node DID unmapped */
-				lpfc_printf_log(phba->brd_no, &lpfc_msgBlk0911,
-						lpfc_mes0911,
-						lpfc_msgBlk0911.msgPreambleStr,
-						(ulong) ndlp, ndlp->nlp_DID,
-						ndlp->nlp_flag, data1);
-				if (order & NLP_SEARCH_DEQUE) {
-					ndlp->nlp_flag &=
-					    ~(NLP_UNMAPPED_LIST |
-					      NLP_TGT_NO_SCSIID);
-					phba->fc_unmap_cnt--;
-					list_del(&ndlp->nlp_listp);
-					phba->nport_event_cnt++;
-				}
-				return (ndlp);
-			}
-		}
-	}
-
-	if (order & NLP_SEARCH_MAPPED) {
-		list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nlpmap_list,
-					nlp_listp) {
-			if (lpfc_geportname(&ndlp->nlp_portname, wwpn) == 2) {
-
-				data1 = (((uint32_t) ndlp->nlp_state << 24) |
-					 ((uint32_t) ndlp->nlp_xri << 16) |
-					 ((uint32_t) ndlp->nlp_type << 8) |
-					 ((uint32_t) ndlp->nlp_rpi & 0xff));
-				/* FIND node DID mapped */
-				lpfc_printf_log(phba->brd_no, &lpfc_msgBlk0901,
-						lpfc_mes0901,
-						lpfc_msgBlk0901.msgPreambleStr,
-						(ulong) ndlp, ndlp->nlp_DID,
-						ndlp->nlp_flag, data1);
-				if (order & NLP_SEARCH_DEQUE) {
-					ndlp->nlp_flag &= ~NLP_MAPPED_LIST;
-					phba->fc_map_cnt--;
-					list_del(&ndlp->nlp_listp);
-					phba->nport_event_cnt++;
-
-					/* Must call before binding is
-					   removed */
-					lpfc_set_failmask(phba, ndlp,
-							  LPFC_DEV_DISAPPEARED,
-							  LPFC_SET_BITMASK);
-
-					blp = ndlp->nlp_listp_bind;
-					ndlp->nlp_listp_bind = 0;
-					if (blp) {
-						blp->nlp_Target =
-						    ndlp->nlp_Target;
-					}
-					/* Keep Target and sid since
-					 * LPFC_DEV_DISAPPEARED is a
-					 * non-fatal error
-					 */
-					ndlp->nlp_flag &= ~NLP_SEED_MASK;
-				}
-				if (blp) {
-					lpfc_nlp_bind(phba, blp);
-				}
-				return (ndlp);
-			}
-		}
-	}
-
-	/* no match found */
-	return ((struct lpfc_nodelist *) 0);
-}
-
-/* Search for a nodelist entry on a specific list */
-struct lpfc_nodelist *
 lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, uint32_t did)
 {
 	struct lpfc_nodelist *ndlp, *next_ndlp;
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_hbadisc.o
diff -urp lpfcdriver-2.6-8.0.3/lpfc_init.c lpfcdriver-2.6-8.0.3.hch/lpfc_init.c
--- lpfcdriver-2.6-8.0.3/lpfc_init.c	2004-06-06 18:49:00.000000000 +0200
+++ lpfcdriver-2.6-8.0.3.hch/lpfc_init.c	2004-06-06 10:33:32.597587352 +0200
@@ -47,6 +47,8 @@ static int lpfc_post_rcv_buf(struct lpfc
 static void lpfc_establish_link_tmo(unsigned long ptr);
 static int lpfc_check_for_vpd = 1;
 static int lpfc_rdrev_wd30 = 0;
+static int lpfc_online(struct lpfc_hba * phba);
+static int lpfc_offline(struct lpfc_hba * phba);
 
 
 /************************************************************************/
@@ -1152,7 +1154,7 @@ lpfc_establish_link_tmo(unsigned long pt
 	spin_unlock_irqrestore(&(phba->drvrlock), iflag);
 }
 
-int
+static int
 lpfc_online(struct lpfc_hba * phba)
 {
 	uint32_t timeout;
@@ -1198,7 +1200,7 @@ lpfc_online(struct lpfc_hba * phba)
 	return (0);
 }
 
-int
+static int
 lpfc_offline(struct lpfc_hba * phba)
 {
 	struct lpfc_sli_ring *pring;
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_init.o
diff -urp lpfcdriver-2.6-8.0.3/lpfc_logmsg.c lpfcdriver-2.6-8.0.3.hch/lpfc_logmsg.c
--- lpfcdriver-2.6-8.0.3/lpfc_logmsg.c	2004-06-06 18:49:00.000000000 +0200
+++ lpfcdriver-2.6-8.0.3.hch/lpfc_logmsg.c	2004-06-06 10:40:54.240447432 +0200
@@ -3483,48 +3483,6 @@ msgLogDef lpfc_msgBlk0900 = {
 };
 
 /*
-msgName: lpfc_mes0901
-message:  FIND node DID mapped
-descript: The driver is searching for a node table entry, on the 
-          mapped node list, based on DID.
-data:     (1) nlp (2) nlp_DID (3) nlp_flag (4) data1
-severity: Information
-log:      LOG_NODE verbose
-action:   No action needed, informational
-*/
-char lpfc_mes0901[] = "%sFIND node DID mapped Data: x%x x%x x%x x%x";
-msgLogDef lpfc_msgBlk0901 = {
-	LPFC_LOG_MSG_ND_0901,
-	lpfc_mes0901,
-	lpfc_msgPreambleNDi,
-	LPFC_MSG_OPUT_GLOB_CTRL,
-	LPFC_LOG_MSG_TYPE_INFO,
-	LOG_NODE,
-	ERRID_LOG_UNEXPECT_EVENT
-};
-
-/*
-msgName: lpfc_mes0902
-message:  FIND node DID mapped
-descript: The driver is searching for a node table entry, on the 
-          mapped node list, based on DID.
-data:     (1) nlp (2) nlp_DID (3) nlp_flag (4) data1
-severity: Information
-log:      LOG_NODE verbose
-action:   No action needed, informational
-*/
-char lpfc_mes0902[] = "%sFIND node DID mapped Data: x%x x%x x%x x%x";
-msgLogDef lpfc_msgBlk0902 = {
-	LPFC_LOG_MSG_ND_0902,
-	lpfc_mes0902,
-	lpfc_msgPreambleNDi,
-	LPFC_MSG_OPUT_GLOB_CTRL,
-	LPFC_LOG_MSG_TYPE_INFO,
-	LOG_NODE,
-	ERRID_LOG_UNEXPECT_EVENT
-};
-
-/*
 msgName: lpfc_mes0903
 message:  Add scsiid <sid> to BIND list 
 descript: The driver is putting the node table entry on the binding list.
@@ -3646,48 +3604,6 @@ msgLogDef lpfc_msgBlk0908 = {
 };
 
 /*
-msgName: lpfc_mes0910
-message:  FIND node DID unmapped
-descript: The driver is searching for a node table entry, on the 
-          unmapped node list, based on DID.
-data:     (1) nlp (2) nlp_DID (3) nlp_flag (4) data1
-severity: Information
-log:      LOG_NODE verbose
-action:   No action needed, informational
-*/
-char lpfc_mes0910[] = "%sFIND node DID unmapped Data: x%x x%x x%x x%x";
-msgLogDef lpfc_msgBlk0910 = {
-	LPFC_LOG_MSG_ND_0910,
-	lpfc_mes0910,
-	lpfc_msgPreambleNDi,
-	LPFC_MSG_OPUT_GLOB_CTRL,
-	LPFC_LOG_MSG_TYPE_INFO,
-	LOG_NODE,
-	ERRID_LOG_UNEXPECT_EVENT
-};
-
-/*
-msgName: lpfc_mes0911
-message:  FIND node DID unmapped
-descript: The driver is searching for a node table entry, on the 
-          unmapped node list, based on DID.
-data:     (1) nlp (2) nlp_DID (3) nlp_flag (4) data1
-severity: Information
-log:      LOG_NODE verbose
-action:   No action needed, informational
-*/
-char lpfc_mes0911[] = "%sFIND node DID unmapped Data: x%x x%x x%x x%x";
-msgLogDef lpfc_msgBlk0911 = {
-	LPFC_LOG_MSG_ND_0911,
-	lpfc_mes0911,
-	lpfc_msgPreambleNDi,
-	LPFC_MSG_OPUT_GLOB_CTRL,
-	LPFC_LOG_MSG_TYPE_INFO,
-	LOG_NODE,
-	ERRID_LOG_UNEXPECT_EVENT
-};
-
-/*
 msgName: lpfc_mes0929
 message:  FIND node DID unmapped
 descript: The driver is searching for a node table entry, on the 
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_logmsg.o
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_mbox.o
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_mem.o
diff -urp lpfcdriver-2.6-8.0.3/lpfc_nportdisc.c lpfcdriver-2.6-8.0.3.hch/lpfc_nportdisc.c
--- lpfcdriver-2.6-8.0.3/lpfc_nportdisc.c	2004-06-06 18:49:00.000000000 +0200
+++ lpfcdriver-2.6-8.0.3.hch/lpfc_nportdisc.c	2004-06-06 10:31:59.117798440 +0200
@@ -44,6 +44,8 @@
 extern uint8_t lpfcAlpaArray[];
 
 int lpfc_geportname(struct lpfc_name *, struct lpfc_name *);
+static struct lpfc_bindlist *lpfc_assign_scsid(struct lpfc_hba * phba,
+		struct lpfc_nodelist * ndlp, int prev_flag);
 
 
 static int
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_nportdisc.o
diff -urp lpfcdriver-2.6-8.0.3/lpfc_scsiport.c lpfcdriver-2.6-8.0.3.hch/lpfc_scsiport.c
--- lpfcdriver-2.6-8.0.3/lpfc_scsiport.c	2004-06-06 18:49:00.000000000 +0200
+++ lpfcdriver-2.6-8.0.3.hch/lpfc_scsiport.c	2004-06-06 10:35:27.202164808 +0200
@@ -518,7 +518,7 @@ lpfc_scsi_cmd_abort(struct lpfc_hba * ph
 
 }
 
-int
+static int
 lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t * lpfc_cmd, 
 		    struct lpfc_hba *phba, uint32_t flag)
 {
@@ -623,7 +623,7 @@ lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t * lp
 
 }
 
-int
+static int
 lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t * lpfc_cmd,
 		    struct lpfc_hba * phba, uint32_t flag)
 {
Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_scsiport.o
diff -urp lpfcdriver-2.6-8.0.3/lpfc_sli.c lpfcdriver-2.6-8.0.3.hch/lpfc_sli.c
--- lpfcdriver-2.6-8.0.3/lpfc_sli.c	2004-06-06 18:49:00.000000000 +0200
+++ lpfcdriver-2.6-8.0.3.hch/lpfc_sli.c	2004-06-06 10:34:53.527284168 +0200
@@ -66,11 +66,10 @@ static struct lpfc_iocbq *lpfc_search_tx
 static DMABUF_t *lpfc_sli_ringpostbuf_search(struct lpfc_hba *,
 					     struct lpfc_sli_ring *, dma_addr_t,
 					     int);
-static void lpfc_sli_wake_iocb_wait(struct lpfc_hba *, struct lpfc_iocbq *,
-				    struct lpfc_iocbq *);
 static int lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *,
 				    uint32_t);
 static int lpfc_sli_resume_iocb(struct lpfc_hba *, struct lpfc_sli_ring *);
+static int lpfc_sli_brdreset(struct lpfc_hba * phba);
 
 /*
  * Define macro to log: Mailbox command x%x cannot issue Data
@@ -2243,7 +2242,7 @@ lpfc_sli_resume_iocb(struct lpfc_hba * p
 	return (portCmdGet);
 }
 
-int
+static int
 lpfc_sli_brdreset(struct lpfc_hba * phba)
 {
 	MAILBOX_t *swpmb;
@@ -3357,103 +3356,6 @@ lpfc_sli_abort_iocb_tgt(struct lpfc_hba 
 }
 
 void
-lpfc_sli_wake_iocb_wait(struct lpfc_hba * phba,
-			struct lpfc_iocbq * queue1, struct lpfc_iocbq * queue2)
-{
-	wait_queue_head_t *pdone_q;
-
-	queue1->iocb_flag |= LPFC_IO_WAIT;
-	if (queue1->context2 && queue2)
-		memcpy(queue1->context2, queue2, sizeof (struct lpfc_iocbq));
-
-	/* 
-	 * If pdone_q is empty, the waiter gave up and returned and this
-	 * call has nothing to do.
-	 */
-	pdone_q = queue1->context_un.hipri_wait_queue;
-	if (pdone_q) {
-		wake_up(pdone_q);
-	}
-
-	return;
-}
-
-int
-lpfc_sli_issue_iocb_wait(struct lpfc_hba * phba,
-			 struct lpfc_sli_ring * pring,
-			 struct lpfc_iocbq * piocb,
-			 uint32_t flag,
-			 struct lpfc_iocbq * prspiocbq, uint32_t timeout)
-{
-	DECLARE_WAIT_QUEUE_HEAD(done_q);
-	DECLARE_WAITQUEUE(wq_entry, current);
-	uint32_t timeleft = 0;
-	int retval;
-
-	/* The caller must leave context1 empty for the driver. */
-	if (piocb->context_un.hipri_wait_queue != 0) {
-		return (IOCB_ERROR);
-	}
-	/* If the caller has provided a response iocbq buffer, then context2 
-	 * is NULL or its an error.
-	 */
-	if (prspiocbq) {
-		if (piocb->context2) {
-			return (IOCB_ERROR);
-		}
-		piocb->context2 = prspiocbq;
-	}
-
-	/* setup wake call as IOCB callback */
-	piocb->iocb_cmpl = lpfc_sli_wake_iocb_wait;
-	/* setup context field to pass wait_queue pointer to wake function  */
-	piocb->context_un.hipri_wait_queue = &done_q;
-
-	/* start to sleep before we wait, to avoid races */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	add_wait_queue(&done_q, &wq_entry);
-
-	/* now issue the command */
-	retval = lpfc_sli_issue_iocb(phba, pring, piocb, flag);
-	if ((retval == IOCB_SUCCESS) ||
-	    ((!(flag & SLI_IOCB_RET_IOCB)) && retval == IOCB_BUSY)) {
-
-		/* Give up thread time and wait for the iocb to complete or for
-		 * the alloted time to expire.
-		 */
-		timeleft = schedule_timeout(timeout * HZ);
-
-		piocb->context_un.hipri_wait_queue = 0;	
-		piocb->iocb_cmpl                   = 0;
-		if (piocb->context2 == prspiocbq)
-			piocb->context2 = 0;
-
-		/* Catch the error cases.  A timeleft of zero is an error since
-		 * the iocb should have completed.  The iocb_flag not have value
-		 * LPFC_IO_WAIT is also an error since the wakeup callback sets
-		 * this flag when it runs.  Handle each.
-		 *
-
-		 */
-		if ((timeleft == 0) || !(piocb->iocb_flag & LPFC_IO_WAIT)) {
-			if (timeleft == 0) {
-				printk(KERN_WARNING "lpfc driver detected iocb "
-				       "Timeout!\n");
-				retval = IOCB_TIMEDOUT;
-			} else {
-				printk(KERN_WARNING "lpfc driver detected iocb "
-				       "flag = 0x%X\n", piocb->iocb_flag);
-				retval = IOCB_TIMEDOUT;
-			}
-		}
-	}
-
-	remove_wait_queue(&done_q, &wq_entry);
-	set_current_state(TASK_RUNNING);
-	return retval;
-}
-
-void
 lpfc_sli_wake_iocb_high_priority(struct lpfc_hba * phba,
 				 struct lpfc_iocbq * queue1,
 				 struct lpfc_iocbq * queue2)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] dead code and missing statics in lpfc
@ 2004-06-08 14:45 Smart, James
  2004-06-09  8:55 ` 'Christoph Hellwig'
  0 siblings, 1 reply; 10+ messages in thread
From: Smart, James @ 2004-06-08 14:45 UTC (permalink / raw)
  To: 'Christoph Hellwig'; +Cc: linux-scsi

Christoph,

We had not completed the effort relative to the comments. Sorry you thought
your patch was ignored. They (including the prior one) was not.

I believe that this week we will have completely dealt with the statics and
symbols. One caveat though.. we have a lot of diagnostic and test tools that
like to do low level error injection, testing, and data sampling. Our
automated test suites are built heavily on this infrastructure. The way we
are approaching these tools is as a separate kernel module. Therefore, the
tools use quite a few of the "dead" symbols/functions. One of our jobs is to
ensure that, where we sliced the interface between the driver and the tool
module, that we did so appropriately, dead code in the driver should
actually be in the tool module, and that we are exporting the minimum number
of symbols. I am pushing to have this completed for the next drop as well,
so we can put these comments to rest.

-- james

PS: The drop on SF was updated with the DOS CR's removed.
PSv2: Added to the work list. I believe the work is complete and should be
in next drop.


> -----Original Message-----
> From: Christoph Hellwig [mailto:hch@infradead.org]
> Sent: Sunday, June 06, 2004 4:47 AM
> To: Christoph Hellwig
> Cc: Smart, James; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH] dead code and missing statics in lpfc
> 
> 
> On Mon, May 31, 2004 at 12:04:54PM +0200, Christoph Hellwig wrote:
> > 
> >  - remove dead EXPORT_SYMBOLS
> >  - mark everything static that can be (thanks to Tridge's 
> findstatic.pl)
> >  - kill all dead functions
> > (- small lpfc_evt_iocb_free fixes that sneaked into the context)
> 
> resend of the patch after you nicely broke it with random 
> changes in today
> code drop.
> 
> p.s. it seems emulex let some windows drone make the tarball, 
> it's completely
>  fscked up with broken dos line endings
> p.s. v2  the fs attribute and sysfs support in the tarball is 
> completely
> bullshit.  take a look at what qlogic does and fix it up.
> 
> 
> diff -urp lpfcdriver-2.6-8.0.3/lpfc_crtn.h 
> lpfcdriver-2.6-8.0.3.hch/lpfc_crtn.h
> --- lpfcdriver-2.6-8.0.3/lpfc_crtn.h	2004-06-06 
> 18:48:59.000000000 +0200
> +++ lpfcdriver-2.6-8.0.3.hch/lpfc_crtn.h	2004-06-06 
> 10:36:33.024158344 +0200
> @@ -74,11 +74,6 @@ int lpfc_no_rpi(struct lpfc_hba *, struc
>  int lpfc_freenode(struct lpfc_hba *, struct lpfc_nodelist *);
>  int lpfc_nlp_remove(struct lpfc_hba *, struct lpfc_nodelist *);
>  struct lpfc_nodelist *lpfc_findnode_did(struct lpfc_hba *, 
> uint32_t, uint32_t);
> -struct lpfc_nodelist *lpfc_findnode_scsiid(struct lpfc_hba 
> *, uint32_t);
> -struct lpfc_nodelist *lpfc_findnode_wwpn(struct lpfc_hba *, uint32_t,
> -				    struct lpfc_name *);
> -struct lpfc_nodelist *lpfc_findnode_wwnn(struct lpfc_hba *, uint32_t,
> -				    struct lpfc_name *);
>  void lpfc_disc_list_loopmap(struct lpfc_hba *);
>  void lpfc_disc_start(struct lpfc_hba *);
>  void lpfc_disc_flush_list(struct lpfc_hba *);
> @@ -118,9 +113,6 @@ int lpfc_issue_els_prli(struct lpfc_hba 
>  int lpfc_issue_els_adisc(struct lpfc_hba *, struct 
> lpfc_nodelist *, uint8_t);
>  int lpfc_issue_els_logo(struct lpfc_hba *, struct 
> lpfc_nodelist *, uint8_t);
>  int lpfc_issue_els_scr(struct lpfc_hba *, uint32_t, uint8_t);
> -struct lpfc_iocbq *lpfc_prep_els_iocb(struct lpfc_hba *, 
> uint8_t expectRsp,
> -				      uint16_t, uint8_t, struct 
> lpfc_nodelist *,
> -				      uint32_t);
>  int lpfc_els_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *);
>  void lpfc_cmpl_els_flogi(struct lpfc_hba *, struct lpfc_iocbq *,
>  			 struct lpfc_iocbq *);
> @@ -166,8 +158,6 @@ void lpfc_handle_latt(struct lpfc_hba *)
>  void lpfc_hba_init(struct lpfc_hba *);
>  int lpfc_post_buffer(struct lpfc_hba *, struct lpfc_sli_ring 
> *, int, int);
>  void lpfc_cleanup(struct lpfc_hba *, uint32_t);
> -int lpfc_online(struct lpfc_hba *);
> -int lpfc_offline(struct lpfc_hba *);
>  int lpfc_scsi_free(struct lpfc_hba *);
>  int lpfc_parse_binding_entry(struct lpfc_hba *, uint8_t *, uint8_t *,
>  			     int, int, int, unsigned int *, int, int *);
> @@ -215,7 +205,6 @@ int lpfc_sli_intr(struct lpfc_hba *);
>  int lpfc_sli_issue_mbox(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t);
>  int lpfc_sli_issue_iocb(struct lpfc_hba *, struct lpfc_sli_ring *,
>  			struct lpfc_iocbq *, uint32_t);
> -int lpfc_sli_brdreset(struct lpfc_hba *);
>  void lpfc_sli_pcimem_bcopy(uint32_t *, uint32_t *, uint32_t);
>  int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct 
> lpfc_sli_ring *,
>  			     DMABUF_t *);
> @@ -240,22 +229,14 @@ void lpfc_start_timer(struct lpfc_hba *,
>  void lpfc_stop_timer(struct clk_data *);
>  
>  
> -int lpfc_sli_issue_iocb_wait(struct lpfc_hba *, struct 
> lpfc_sli_ring *,
> -			     struct lpfc_iocbq *, uint32_t, 
> struct lpfc_iocbq *,
> -			     uint32_t);
>  LPFC_SCSI_BUF_t *lpfc_get_scsi_buf(struct lpfc_hba *);
>  void lpfc_free_scsi_buf(LPFC_SCSI_BUF_t *);
>  void lpfc_map_fcp_cmnd_to_bpl(struct lpfc_hba *, LPFC_SCSI_BUF_t *);
>  void lpfc_free_scsi_cmd(LPFC_SCSI_BUF_t *);
>  uint32_t lpfc_os_timeout_transform(struct lpfc_hba *, uint32_t);
> -int lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t *, struct lpfc_hba 
> *, uint32_t);
> -int lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t *, struct lpfc_hba 
> *, uint32_t);
>  
>  struct lpfc_hba *lpfc_get_phba_by_inst(int);
>  
> -struct lpfc_bindlist *lpfc_assign_scsid(struct lpfc_hba *,
> -					struct lpfc_nodelist *, int);
> -
>  void lpfc_sched_init_hba(struct lpfc_hba *, uint16_t);
>  void lpfc_sched_target_init(LPFCSCSITARGET_t *, uint16_t);
>  void lpfc_sched_lun_init(LPFCSCSILUN_t *, uint16_t);
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_ct.o
> diff -urp lpfcdriver-2.6-8.0.3/lpfc_els.c 
> lpfcdriver-2.6-8.0.3.hch/lpfc_els.c
> --- lpfcdriver-2.6-8.0.3/lpfc_els.c	2004-06-06 
> 18:48:59.000000000 +0200
> +++ lpfcdriver-2.6-8.0.3.hch/lpfc_els.c	2004-06-06 
> 10:29:04.543337792 +0200
> @@ -70,6 +70,9 @@ static int lpfc_issue_els_flogi(struct l
>  				uint8_t);
>  static void lpfc_more_plogi(struct lpfc_hba *);
>  static void lpfc_more_adisc(struct lpfc_hba *);
> +static struct lpfc_iocbq *lpfc_prep_els_iocb(struct lpfc_hba * phba,
> +		uint8_t expectRsp, uint16_t cmdSize, uint8_t retry,
> +		struct lpfc_nodelist * ndlp, uint32_t elscmd);
>  
>  static int lpfc_max_els_tries = 3;
>  
> @@ -1408,7 +1411,7 @@ lpfc_els_retry(struct lpfc_hba * phba, s
>  	return (0);
>  }
>  
> -struct lpfc_iocbq *
> +static struct lpfc_iocbq *
>  lpfc_prep_els_iocb(struct lpfc_hba * phba,
>  		   uint8_t expectRsp,
>  		   uint16_t cmdSize,
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_els.o
> diff -urp lpfcdriver-2.6-8.0.3/lpfc_fcp.c 
> lpfcdriver-2.6-8.0.3.hch/lpfc_fcp.c
> --- lpfcdriver-2.6-8.0.3/lpfc_fcp.c	2004-06-06 
> 18:48:59.000000000 +0200
> +++ lpfcdriver-2.6-8.0.3.hch/lpfc_fcp.c	2004-06-06 
> 10:24:00.194605832 +0200
> @@ -2266,51 +2266,3 @@ lpfc_do_dpc(void *p)
>  module_init(lpfc_init);
>  module_exit(lpfc_exit);
>  MODULE_LICENSE("GPL");
> -/*
> - * Note: PPC64 architecture has function descriptors,
> - * so insmod on 2.4 does not automatically export all symbols.
> - */
> -
> -EXPORT_SYMBOL(lpfc_assign_scsid);
> -EXPORT_SYMBOL(lpfc_block_requests);
> -EXPORT_SYMBOL(lpfc_build_scsi_cmd);
> -EXPORT_SYMBOL(lpfc_decode_firmware_rev);
> -EXPORT_SYMBOL(lpfc_disc_issue_rptlun);
> -EXPORT_SYMBOL(lpfc_drvr_name);
> -EXPORT_SYMBOL(lpfc_els_free_iocb);
> -EXPORT_SYMBOL(lpfc_find_lun);
> -EXPORT_SYMBOL(lpfc_findnode_did);
> -EXPORT_SYMBOL(lpfc_findnode_scsiid);
> -EXPORT_SYMBOL(lpfc_findnode_wwnn);
> -EXPORT_SYMBOL(lpfc_findnode_wwpn);
> -EXPORT_SYMBOL(lpfc_free_scsi_buf);
> -EXPORT_SYMBOL(lpfc_geportname);
> -EXPORT_SYMBOL(lpfc_get_hba_model_desc);
> -EXPORT_SYMBOL(lpfc_get_phba_by_inst);
> -EXPORT_SYMBOL(lpfc_get_scsi_buf);
> -EXPORT_SYMBOL(lpfc_hba_list);
> -EXPORT_SYMBOL(lpfc_init_link);
> -EXPORT_SYMBOL(lpfc_issue_els_adisc);
> -EXPORT_SYMBOL(lpfc_issue_els_logo);
> -EXPORT_SYMBOL(lpfc_issue_els_plogi);
> -EXPORT_SYMBOL(lpfc_loadtime);
> -EXPORT_SYMBOL(lpfc_mbuf_alloc);
> -EXPORT_SYMBOL(lpfc_mbuf_free);
> -EXPORT_SYMBOL(lpfc_nlp_bind);
> -EXPORT_SYMBOL(lpfc_nlp_mapped);
> -EXPORT_SYMBOL(lpfc_num_hba);
> -EXPORT_SYMBOL(lpfc_offline);
> -EXPORT_SYMBOL(lpfc_online);
> -EXPORT_SYMBOL(lpfc_page_free);
> -EXPORT_SYMBOL(lpfc_prep_els_iocb);
> -EXPORT_SYMBOL(lpfc_release_version);
> -EXPORT_SYMBOL(lpfc_scsi_lun_reset);
> -EXPORT_SYMBOL(lpfc_scsi_tgt_reset);
> -EXPORT_SYMBOL(lpfc_set_failmask);
> -EXPORT_SYMBOL(lpfc_sleep_ms);
> -EXPORT_SYMBOL(lpfc_sli_brdreset);
> -EXPORT_SYMBOL(lpfc_sli_issue_iocb_wait);
> -EXPORT_SYMBOL(lpfc_sli_issue_mbox);
> -EXPORT_SYMBOL(lpfc_sli_next_iotag);
> -EXPORT_SYMBOL(lpfc_sli_pcimem_bcopy);
> -EXPORT_SYMBOL(lpfc_unblock_requests);
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_fcp.o
> diff -urp lpfcdriver-2.6-8.0.3/lpfc_hbadisc.c 
> lpfcdriver-2.6-8.0.3.hch/lpfc_hbadisc.c
> --- lpfcdriver-2.6-8.0.3/lpfc_hbadisc.c	2004-06-06 
> 18:49:00.000000000 +0200
> +++ lpfcdriver-2.6-8.0.3.hch/lpfc_hbadisc.c	2004-06-06 
> 10:37:04.846320640 +0200
> @@ -1677,7 +1677,7 @@ out:
>  }
>  
>  /* Search for a nodelist entry on a specific list */
> -struct lpfc_nodelist *
> +static struct lpfc_nodelist *
>  lpfc_findnode_scsiid(struct lpfc_hba * phba, uint32_t scsid)
>  {
>  	struct lpfc_nodelist *ndlp;
> @@ -1704,184 +1704,6 @@ lpfc_findnode_scsiid(struct lpfc_hba * p
>  
>  /* Search for a nodelist entry on a specific list */
>  struct lpfc_nodelist *
> -lpfc_findnode_wwnn(struct lpfc_hba * phba, uint32_t order,
> -		   struct lpfc_name * wwnn)
> -{
> -	struct lpfc_nodelist *ndlp, *next_ndlp;
> -	uint32_t data1;
> -	struct lpfc_bindlist *blp;
> -
> -	blp = 0;
> -	if (order & NLP_SEARCH_UNMAPPED) {
> -		list_for_each_entry_safe(ndlp, next_ndlp, 
> &phba->fc_nlpunmap_list,
> -					 nlp_listp) {
> -			if 
> (lpfc_geportname(&ndlp->nlp_nodename, wwnn) == 2) {
> -
> -				data1 = (((uint32_t) 
> ndlp->nlp_state << 24) |
> -					 ((uint32_t) 
> ndlp->nlp_xri << 16) |
> -					 ((uint32_t) 
> ndlp->nlp_type << 8) |
> -					 ((uint32_t) 
> ndlp->nlp_rpi & 0xff));
> -				/* FIND node DID unmapped */
> -				lpfc_printf_log(phba->brd_no, 
> &lpfc_msgBlk0910,
> -						lpfc_mes0910,
> -						
> lpfc_msgBlk0910.msgPreambleStr,
> -						(ulong) ndlp, 
> ndlp->nlp_DID,
> -						ndlp->nlp_flag, data1);
> -				if (order & NLP_SEARCH_DEQUE) {
> -					ndlp->nlp_flag &=
> -					    ~(NLP_UNMAPPED_LIST |
> -					      NLP_TGT_NO_SCSIID);
> -					phba->fc_unmap_cnt--;
> -					list_del(&ndlp->nlp_listp);
> -					phba->nport_event_cnt++;
> -				}
> -				return (ndlp);
> -			}
> -		}
> -	}
> -
> -	if (order & NLP_SEARCH_MAPPED) {
> -		list_for_each_entry_safe(ndlp, next_ndlp, 
> &phba->fc_nlpmap_list,
> -					 nlp_listp) {
> -			if 
> (lpfc_geportname(&ndlp->nlp_nodename, wwnn) == 2) {
> -
> -				data1 = (((uint32_t) 
> ndlp->nlp_state << 24) |
> -					 ((uint32_t) 
> ndlp->nlp_xri << 16) |
> -					 ((uint32_t) 
> ndlp->nlp_type << 8) |
> -					 ((uint32_t) 
> ndlp->nlp_rpi & 0xff));
> -				/* FIND node did mapped */
> -				lpfc_printf_log(phba->brd_no, 
> &lpfc_msgBlk0902,
> -						lpfc_mes0902,
> -						
> lpfc_msgBlk0902.msgPreambleStr,
> -						(ulong) ndlp, 
> ndlp->nlp_DID,
> -						ndlp->nlp_flag, data1);
> -				if (order & NLP_SEARCH_DEQUE) {
> -					ndlp->nlp_flag &= 
> ~NLP_MAPPED_LIST;
> -					phba->fc_map_cnt--;
> -					list_del(&ndlp->nlp_listp);
> -					phba->nport_event_cnt++;
> -
> -					/* Must call before binding is
> -					   removed */
> -					lpfc_set_failmask(phba, ndlp,
> -							  
LPFC_DEV_DISAPPEARED,
> -							  
LPFC_SET_BITMASK);
> -
> -					blp = ndlp->nlp_listp_bind;
> -					ndlp->nlp_listp_bind = 0;
> -					if (blp) {
> -						blp->nlp_Target =
> -						    ndlp->nlp_Target;
> -					}
> -					/* Keep Target and sid since
> -					 * LPFC_DEV_DISAPPEARED is a
> -					 * non-fatal error
> -					 */
> -					ndlp->nlp_flag &= 
> ~NLP_SEED_MASK;
> -				}
> -				if (blp) {
> -					lpfc_nlp_bind(phba, blp);
> -				}
> -				return (ndlp);
> -			}
> -		}
> -	}
> -
> -	/* no match found */
> -	return ((struct lpfc_nodelist *) 0);
> -}
> -
> -/* Search for a nodelist entry on a specific list */
> -struct lpfc_nodelist *
> -lpfc_findnode_wwpn(struct lpfc_hba * phba, uint32_t order,
> -		   struct lpfc_name * wwpn)
> -{
> -	struct lpfc_nodelist *ndlp, *next_ndlp;
> -	uint32_t data1;
> -	struct lpfc_bindlist *blp;
> -
> -	blp = 0;
> -	if (order & NLP_SEARCH_UNMAPPED) {
> -		list_for_each_entry_safe(ndlp, next_ndlp, 
> &phba->fc_nlpunmap_list,
> -					nlp_listp) {
> -			if 
> (lpfc_geportname(&ndlp->nlp_portname, wwpn) == 2) {
> -
> -				data1 = (((uint32_t) 
> ndlp->nlp_state << 24) |
> -					 ((uint32_t) 
> ndlp->nlp_xri << 16) |
> -					 ((uint32_t) 
> ndlp->nlp_type << 8) |
> -					 ((uint32_t) 
> ndlp->nlp_rpi & 0xff));
> -				/* FIND node DID unmapped */
> -				lpfc_printf_log(phba->brd_no, 
> &lpfc_msgBlk0911,
> -						lpfc_mes0911,
> -						
> lpfc_msgBlk0911.msgPreambleStr,
> -						(ulong) ndlp, 
> ndlp->nlp_DID,
> -						ndlp->nlp_flag, data1);
> -				if (order & NLP_SEARCH_DEQUE) {
> -					ndlp->nlp_flag &=
> -					    ~(NLP_UNMAPPED_LIST |
> -					      NLP_TGT_NO_SCSIID);
> -					phba->fc_unmap_cnt--;
> -					list_del(&ndlp->nlp_listp);
> -					phba->nport_event_cnt++;
> -				}
> -				return (ndlp);
> -			}
> -		}
> -	}
> -
> -	if (order & NLP_SEARCH_MAPPED) {
> -		list_for_each_entry_safe(ndlp, next_ndlp, 
> &phba->fc_nlpmap_list,
> -					nlp_listp) {
> -			if 
> (lpfc_geportname(&ndlp->nlp_portname, wwpn) == 2) {
> -
> -				data1 = (((uint32_t) 
> ndlp->nlp_state << 24) |
> -					 ((uint32_t) 
> ndlp->nlp_xri << 16) |
> -					 ((uint32_t) 
> ndlp->nlp_type << 8) |
> -					 ((uint32_t) 
> ndlp->nlp_rpi & 0xff));
> -				/* FIND node DID mapped */
> -				lpfc_printf_log(phba->brd_no, 
> &lpfc_msgBlk0901,
> -						lpfc_mes0901,
> -						
> lpfc_msgBlk0901.msgPreambleStr,
> -						(ulong) ndlp, 
> ndlp->nlp_DID,
> -						ndlp->nlp_flag, data1);
> -				if (order & NLP_SEARCH_DEQUE) {
> -					ndlp->nlp_flag &= 
> ~NLP_MAPPED_LIST;
> -					phba->fc_map_cnt--;
> -					list_del(&ndlp->nlp_listp);
> -					phba->nport_event_cnt++;
> -
> -					/* Must call before binding is
> -					   removed */
> -					lpfc_set_failmask(phba, ndlp,
> -							  
LPFC_DEV_DISAPPEARED,
> -							  
LPFC_SET_BITMASK);
> -
> -					blp = ndlp->nlp_listp_bind;
> -					ndlp->nlp_listp_bind = 0;
> -					if (blp) {
> -						blp->nlp_Target =
> -						    ndlp->nlp_Target;
> -					}
> -					/* Keep Target and sid since
> -					 * LPFC_DEV_DISAPPEARED is a
> -					 * non-fatal error
> -					 */
> -					ndlp->nlp_flag &= 
> ~NLP_SEED_MASK;
> -				}
> -				if (blp) {
> -					lpfc_nlp_bind(phba, blp);
> -				}
> -				return (ndlp);
> -			}
> -		}
> -	}
> -
> -	/* no match found */
> -	return ((struct lpfc_nodelist *) 0);
> -}
> -
> -/* Search for a nodelist entry on a specific list */
> -struct lpfc_nodelist *
>  lpfc_findnode_did(struct lpfc_hba * phba, uint32_t order, 
> uint32_t did)
>  {
>  	struct lpfc_nodelist *ndlp, *next_ndlp;
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_hbadisc.o
> diff -urp lpfcdriver-2.6-8.0.3/lpfc_init.c 
> lpfcdriver-2.6-8.0.3.hch/lpfc_init.c
> --- lpfcdriver-2.6-8.0.3/lpfc_init.c	2004-06-06 
> 18:49:00.000000000 +0200
> +++ lpfcdriver-2.6-8.0.3.hch/lpfc_init.c	2004-06-06 
> 10:33:32.597587352 +0200
> @@ -47,6 +47,8 @@ static int lpfc_post_rcv_buf(struct lpfc
>  static void lpfc_establish_link_tmo(unsigned long ptr);
>  static int lpfc_check_for_vpd = 1;
>  static int lpfc_rdrev_wd30 = 0;
> +static int lpfc_online(struct lpfc_hba * phba);
> +static int lpfc_offline(struct lpfc_hba * phba);
>  
>  
>  
> /*************************************************************
> ***********/
> @@ -1152,7 +1154,7 @@ lpfc_establish_link_tmo(unsigned long pt
>  	spin_unlock_irqrestore(&(phba->drvrlock), iflag);
>  }
>  
> -int
> +static int
>  lpfc_online(struct lpfc_hba * phba)
>  {
>  	uint32_t timeout;
> @@ -1198,7 +1200,7 @@ lpfc_online(struct lpfc_hba * phba)
>  	return (0);
>  }
>  
> -int
> +static int
>  lpfc_offline(struct lpfc_hba * phba)
>  {
>  	struct lpfc_sli_ring *pring;
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_init.o
> diff -urp lpfcdriver-2.6-8.0.3/lpfc_logmsg.c 
> lpfcdriver-2.6-8.0.3.hch/lpfc_logmsg.c
> --- lpfcdriver-2.6-8.0.3/lpfc_logmsg.c	2004-06-06 
> 18:49:00.000000000 +0200
> +++ lpfcdriver-2.6-8.0.3.hch/lpfc_logmsg.c	2004-06-06 
> 10:40:54.240447432 +0200
> @@ -3483,48 +3483,6 @@ msgLogDef lpfc_msgBlk0900 = {
>  };
>  
>  /*
> -msgName: lpfc_mes0901
> -message:  FIND node DID mapped
> -descript: The driver is searching for a node table entry, on the 
> -          mapped node list, based on DID.
> -data:     (1) nlp (2) nlp_DID (3) nlp_flag (4) data1
> -severity: Information
> -log:      LOG_NODE verbose
> -action:   No action needed, informational
> -*/
> -char lpfc_mes0901[] = "%sFIND node DID mapped Data: x%x x%x x%x x%x";
> -msgLogDef lpfc_msgBlk0901 = {
> -	LPFC_LOG_MSG_ND_0901,
> -	lpfc_mes0901,
> -	lpfc_msgPreambleNDi,
> -	LPFC_MSG_OPUT_GLOB_CTRL,
> -	LPFC_LOG_MSG_TYPE_INFO,
> -	LOG_NODE,
> -	ERRID_LOG_UNEXPECT_EVENT
> -};
> -
> -/*
> -msgName: lpfc_mes0902
> -message:  FIND node DID mapped
> -descript: The driver is searching for a node table entry, on the 
> -          mapped node list, based on DID.
> -data:     (1) nlp (2) nlp_DID (3) nlp_flag (4) data1
> -severity: Information
> -log:      LOG_NODE verbose
> -action:   No action needed, informational
> -*/
> -char lpfc_mes0902[] = "%sFIND node DID mapped Data: x%x x%x x%x x%x";
> -msgLogDef lpfc_msgBlk0902 = {
> -	LPFC_LOG_MSG_ND_0902,
> -	lpfc_mes0902,
> -	lpfc_msgPreambleNDi,
> -	LPFC_MSG_OPUT_GLOB_CTRL,
> -	LPFC_LOG_MSG_TYPE_INFO,
> -	LOG_NODE,
> -	ERRID_LOG_UNEXPECT_EVENT
> -};
> -
> -/*
>  msgName: lpfc_mes0903
>  message:  Add scsiid <sid> to BIND list 
>  descript: The driver is putting the node table entry on the 
> binding list.
> @@ -3646,48 +3604,6 @@ msgLogDef lpfc_msgBlk0908 = {
>  };
>  
>  /*
> -msgName: lpfc_mes0910
> -message:  FIND node DID unmapped
> -descript: The driver is searching for a node table entry, on the 
> -          unmapped node list, based on DID.
> -data:     (1) nlp (2) nlp_DID (3) nlp_flag (4) data1
> -severity: Information
> -log:      LOG_NODE verbose
> -action:   No action needed, informational
> -*/
> -char lpfc_mes0910[] = "%sFIND node DID unmapped Data: x%x 
> x%x x%x x%x";
> -msgLogDef lpfc_msgBlk0910 = {
> -	LPFC_LOG_MSG_ND_0910,
> -	lpfc_mes0910,
> -	lpfc_msgPreambleNDi,
> -	LPFC_MSG_OPUT_GLOB_CTRL,
> -	LPFC_LOG_MSG_TYPE_INFO,
> -	LOG_NODE,
> -	ERRID_LOG_UNEXPECT_EVENT
> -};
> -
> -/*
> -msgName: lpfc_mes0911
> -message:  FIND node DID unmapped
> -descript: The driver is searching for a node table entry, on the 
> -          unmapped node list, based on DID.
> -data:     (1) nlp (2) nlp_DID (3) nlp_flag (4) data1
> -severity: Information
> -log:      LOG_NODE verbose
> -action:   No action needed, informational
> -*/
> -char lpfc_mes0911[] = "%sFIND node DID unmapped Data: x%x 
> x%x x%x x%x";
> -msgLogDef lpfc_msgBlk0911 = {
> -	LPFC_LOG_MSG_ND_0911,
> -	lpfc_mes0911,
> -	lpfc_msgPreambleNDi,
> -	LPFC_MSG_OPUT_GLOB_CTRL,
> -	LPFC_LOG_MSG_TYPE_INFO,
> -	LOG_NODE,
> -	ERRID_LOG_UNEXPECT_EVENT
> -};
> -
> -/*
>  msgName: lpfc_mes0929
>  message:  FIND node DID unmapped
>  descript: The driver is searching for a node table entry, on the 
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_logmsg.o
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_mbox.o
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_mem.o
> diff -urp lpfcdriver-2.6-8.0.3/lpfc_nportdisc.c 
> lpfcdriver-2.6-8.0.3.hch/lpfc_nportdisc.c
> --- lpfcdriver-2.6-8.0.3/lpfc_nportdisc.c	2004-06-06 
> 18:49:00.000000000 +0200
> +++ lpfcdriver-2.6-8.0.3.hch/lpfc_nportdisc.c	2004-06-06 
> 10:31:59.117798440 +0200
> @@ -44,6 +44,8 @@
>  extern uint8_t lpfcAlpaArray[];
>  
>  int lpfc_geportname(struct lpfc_name *, struct lpfc_name *);
> +static struct lpfc_bindlist *lpfc_assign_scsid(struct 
> lpfc_hba * phba,
> +		struct lpfc_nodelist * ndlp, int prev_flag);
>  
>  
>  static int
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_nportdisc.o
> diff -urp lpfcdriver-2.6-8.0.3/lpfc_scsiport.c 
> lpfcdriver-2.6-8.0.3.hch/lpfc_scsiport.c
> --- lpfcdriver-2.6-8.0.3/lpfc_scsiport.c	2004-06-06 
> 18:49:00.000000000 +0200
> +++ lpfcdriver-2.6-8.0.3.hch/lpfc_scsiport.c	2004-06-06 
> 10:35:27.202164808 +0200
> @@ -518,7 +518,7 @@ lpfc_scsi_cmd_abort(struct lpfc_hba * ph
>  
>  }
>  
> -int
> +static int
>  lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t * lpfc_cmd, 
>  		    struct lpfc_hba *phba, uint32_t flag)
>  {
> @@ -623,7 +623,7 @@ lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t * lp
>  
>  }
>  
> -int
> +static int
>  lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t * lpfc_cmd,
>  		    struct lpfc_hba * phba, uint32_t flag)
>  {
> Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_scsiport.o
> diff -urp lpfcdriver-2.6-8.0.3/lpfc_sli.c 
> lpfcdriver-2.6-8.0.3.hch/lpfc_sli.c
> --- lpfcdriver-2.6-8.0.3/lpfc_sli.c	2004-06-06 
> 18:49:00.000000000 +0200
> +++ lpfcdriver-2.6-8.0.3.hch/lpfc_sli.c	2004-06-06 
> 10:34:53.527284168 +0200
> @@ -66,11 +66,10 @@ static struct lpfc_iocbq *lpfc_search_tx
>  static DMABUF_t *lpfc_sli_ringpostbuf_search(struct lpfc_hba *,
>  					     struct 
> lpfc_sli_ring *, dma_addr_t,
>  					     int);
> -static void lpfc_sli_wake_iocb_wait(struct lpfc_hba *, 
> struct lpfc_iocbq *,
> -				    struct lpfc_iocbq *);
>  static int lpfc_sli_abort_iocb_ring(struct lpfc_hba *, 
> struct lpfc_sli_ring *,
>  				    uint32_t);
>  static int lpfc_sli_resume_iocb(struct lpfc_hba *, struct 
> lpfc_sli_ring *);
> +static int lpfc_sli_brdreset(struct lpfc_hba * phba);
>  
>  /*
>   * Define macro to log: Mailbox command x%x cannot issue Data
> @@ -2243,7 +2242,7 @@ lpfc_sli_resume_iocb(struct lpfc_hba * p
>  	return (portCmdGet);
>  }
>  
> -int
> +static int
>  lpfc_sli_brdreset(struct lpfc_hba * phba)
>  {
>  	MAILBOX_t *swpmb;
> @@ -3357,103 +3356,6 @@ lpfc_sli_abort_iocb_tgt(struct lpfc_hba 
>  }
>  
>  void
> -lpfc_sli_wake_iocb_wait(struct lpfc_hba * phba,
> -			struct lpfc_iocbq * queue1, struct 
> lpfc_iocbq * queue2)
> -{
> -	wait_queue_head_t *pdone_q;
> -
> -	queue1->iocb_flag |= LPFC_IO_WAIT;
> -	if (queue1->context2 && queue2)
> -		memcpy(queue1->context2, queue2, sizeof (struct 
> lpfc_iocbq));
> -
> -	/* 
> -	 * If pdone_q is empty, the waiter gave up and returned and this
> -	 * call has nothing to do.
> -	 */
> -	pdone_q = queue1->context_un.hipri_wait_queue;
> -	if (pdone_q) {
> -		wake_up(pdone_q);
> -	}
> -
> -	return;
> -}
> -
> -int
> -lpfc_sli_issue_iocb_wait(struct lpfc_hba * phba,
> -			 struct lpfc_sli_ring * pring,
> -			 struct lpfc_iocbq * piocb,
> -			 uint32_t flag,
> -			 struct lpfc_iocbq * prspiocbq, 
> uint32_t timeout)
> -{
> -	DECLARE_WAIT_QUEUE_HEAD(done_q);
> -	DECLARE_WAITQUEUE(wq_entry, current);
> -	uint32_t timeleft = 0;
> -	int retval;
> -
> -	/* The caller must leave context1 empty for the driver. */
> -	if (piocb->context_un.hipri_wait_queue != 0) {
> -		return (IOCB_ERROR);
> -	}
> -	/* If the caller has provided a response iocbq buffer, 
> then context2 
> -	 * is NULL or its an error.
> -	 */
> -	if (prspiocbq) {
> -		if (piocb->context2) {
> -			return (IOCB_ERROR);
> -		}
> -		piocb->context2 = prspiocbq;
> -	}
> -
> -	/* setup wake call as IOCB callback */
> -	piocb->iocb_cmpl = lpfc_sli_wake_iocb_wait;
> -	/* setup context field to pass wait_queue pointer to 
> wake function  */
> -	piocb->context_un.hipri_wait_queue = &done_q;
> -
> -	/* start to sleep before we wait, to avoid races */
> -	set_current_state(TASK_UNINTERRUPTIBLE);
> -	add_wait_queue(&done_q, &wq_entry);
> -
> -	/* now issue the command */
> -	retval = lpfc_sli_issue_iocb(phba, pring, piocb, flag);
> -	if ((retval == IOCB_SUCCESS) ||
> -	    ((!(flag & SLI_IOCB_RET_IOCB)) && retval == IOCB_BUSY)) {
> -
> -		/* Give up thread time and wait for the iocb to 
> complete or for
> -		 * the alloted time to expire.
> -		 */
> -		timeleft = schedule_timeout(timeout * HZ);
> -
> -		piocb->context_un.hipri_wait_queue = 0;	
> -		piocb->iocb_cmpl                   = 0;
> -		if (piocb->context2 == prspiocbq)
> -			piocb->context2 = 0;
> -
> -		/* Catch the error cases.  A timeleft of zero 
> is an error since
> -		 * the iocb should have completed.  The 
> iocb_flag not have value
> -		 * LPFC_IO_WAIT is also an error since the 
> wakeup callback sets
> -		 * this flag when it runs.  Handle each.
> -		 *
> -
> -		 */
> -		if ((timeleft == 0) || !(piocb->iocb_flag & 
> LPFC_IO_WAIT)) {
> -			if (timeleft == 0) {
> -				printk(KERN_WARNING "lpfc 
> driver detected iocb "
> -				       "Timeout!\n");
> -				retval = IOCB_TIMEDOUT;
> -			} else {
> -				printk(KERN_WARNING "lpfc 
> driver detected iocb "
> -				       "flag = 0x%X\n", 
> piocb->iocb_flag);
> -				retval = IOCB_TIMEDOUT;
> -			}
> -		}
> -	}
> -
> -	remove_wait_queue(&done_q, &wq_entry);
> -	set_current_state(TASK_RUNNING);
> -	return retval;
> -}
> -
> -void
>  lpfc_sli_wake_iocb_high_priority(struct lpfc_hba * phba,
>  				 struct lpfc_iocbq * queue1,
>  				 struct lpfc_iocbq * queue2)
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dead code and missing statics in lpfc
  2004-06-08 14:45 Smart, James
@ 2004-06-09  8:55 ` 'Christoph Hellwig'
  0 siblings, 0 replies; 10+ messages in thread
From: 'Christoph Hellwig' @ 2004-06-09  8:55 UTC (permalink / raw)
  To: Smart, James; +Cc: linux-scsi

On Tue, Jun 08, 2004 at 10:45:14AM -0400, Smart, James wrote:
> Christoph,
> 
> We had not completed the effort relative to the comments. Sorry you thought
> your patch was ignored. They (including the prior one) was not.
> 
> I believe that this week we will have completely dealt with the statics and
> symbols. One caveat though.. we have a lot of diagnostic and test tools that
> like to do low level error injection, testing, and data sampling. Our
> automated test suites are built heavily on this infrastructure. The way we
> are approaching these tools is as a separate kernel module. Therefore, the
> tools use quite a few of the "dead" symbols/functions. One of our jobs is to
> ensure that, where we sliced the interface between the driver and the tool
> module, that we did so appropriately, dead code in the driver should
> actually be in the tool module, and that we are exporting the minimum number
> of symbols. I am pushing to have this completed for the next drop as well,
> so we can put these comments to rest.

In either case exported symbols in the driver and dead symbols are completely
uninteresting for a kernel submission, so make sure you get rid of them
before you try to submit the driver.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] dead code and missing statics in lpfc
@ 2004-06-09 11:08 Smart, James
  2004-06-10 11:17 ` 'Christoph Hellwig'
  0 siblings, 1 reply; 10+ messages in thread
From: Smart, James @ 2004-06-09 11:08 UTC (permalink / raw)
  To: 'Christoph Hellwig'; +Cc: linux-scsi

So...

I agree that symbols such as this are not desired, but... If this is the
stance of the linux-scsi group - it says:

- For vendors such as ourselves, the driver that we put through extensive
qualification and testing - real, repeated, extended run time on many
platforms, distributions, and in many different configurations - will NEVER
be the same driver that is ultimately shipped with the kernel. Use of the
kernel-supplied driver will ALWAYS be a calculated risk.

- This implies that - for any production system wanting support - you are
MANDATING that the user replace the kernel-supplied driver with the vendor's
driver. 

- And lastly, although not as important, you are dictating that, for a
kernel-level entity, there is never an opportunity for them to extend their
product set by providing extra add-in or helper modules. This limitation is
reasonable for kernel protection - but it pushes the user, who wants the
features, back to the vendor's replacement driver.

- Ultimately, the byproduct of the above is, you are also focusing the
vendor away from the base kernel. Any effort to extend the driver, it's
feature set, etc - regardless of whether those features/extensions would be
good for the kernel or scsi subsystem overall, will be focused solely on the
mandated replacement driver. The kernel-supplied driver becomes a "put in
the least effort necessary" choice.

I know that I'm a bit strong in the statements above - but it is the reality
we are facing when trying to support Linux. This grinds me, as our desire is
to be 100% behind the kernel-supplied driver and it's community, not to be
doing replacement kits that just circumvent things.


-- James



> -----Original Message-----
> From: 'Christoph Hellwig' [mailto:hch@infradead.org]
> Sent: Wednesday, June 09, 2004 4:56 AM
> To: Smart, James
> Cc: linux-scsi@vger.kernel.org
> Subject: Re: [PATCH] dead code and missing statics in lpfc
> 
> <snip...>
> 
> In either case exported symbols in the driver and dead 
> symbols are completely
> uninteresting for a kernel submission, so make sure you get 
> rid of them
> before you try to submit the driver.
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] dead code and missing statics in lpfc
  2004-06-09 11:08 Smart, James
@ 2004-06-10 11:17 ` 'Christoph Hellwig'
  0 siblings, 0 replies; 10+ messages in thread
From: 'Christoph Hellwig' @ 2004-06-10 11:17 UTC (permalink / raw)
  To: Smart, James; +Cc: linux-scsi

On Wed, Jun 09, 2004 at 07:08:55AM -0400, Smart, James wrote:
> So...
> 
> I agree that symbols such as this are not desired, but... If this is the
> stance of the linux-scsi group - it says:
> 
> - For vendors such as ourselves, the driver that we put through extensive
> qualification and testing - real, repeated, extended run time on many
> platforms, distributions, and in many different configurations - will NEVER
> be the same driver that is ultimately shipped with the kernel. Use of the
> kernel-supplied driver will ALWAYS be a calculated risk.
> 
> - This implies that - for any production system wanting support - you are
> MANDATING that the user replace the kernel-supplied driver with the vendor's
> driver. 

Well, ba strategy for Emulex than and you can be sure any kerneldeveloper
will not recommend Emulex hardware for such a braindead policy then.  Given
the code quality of the Emulex driver it's pretty obvious that youre QA tests
didn't find some of the most obvious bugs.  Anyway, another good example for
my talk on Saturday ;-)

> - And lastly, although not as important, you are dictating that, for a
> kernel-level entity, there is never an opportunity for them to extend their
> product set by providing extra add-in or helper modules. This limitation is
> reasonable for kernel protection - but it pushes the user, who wants the
> features, back to the vendor's replacement driver.

Exactly that's what we're doing.  Opensource your ibjection module and
integrate it with the driver release an everything is fine.

> - Ultimately, the byproduct of the above is, you are also focusing the
> vendor away from the base kernel. Any effort to extend the driver, it's
> feature set, etc - regardless of whether those features/extensions would be
> good for the kernel or scsi subsystem overall, will be focused solely on the
> mandated replacement driver. The kernel-supplied driver becomes a "put in
> the least effort necessary" choice.

Well, bad luck.  With that stance from Emulex we'd better stop any work on
getting it included if you're not interested in it beeing a 1st class citicen.


What you're missing is that the Linux kernel can very well live without a
Emulex driver, but it will hurt Emulex if it's not properly supported by
Linux.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] dead code and missing statics in lpfc
@ 2004-06-10 13:24 Smart, James
  2004-06-10 13:36 ` Arjan van de Ven
  0 siblings, 1 reply; 10+ messages in thread
From: Smart, James @ 2004-06-10 13:24 UTC (permalink / raw)
  To: 'Christoph Hellwig'; +Cc: linux-scsi

You are missing the whole point of this email!

> Well, bad luck.  With that stance from Emulex we'd better 
> stop any work on
> getting it included if you're not interested in it beeing a 
> 1st class citicen.

As the end of the email stated - this is NOT the stance that Emulex wants,
nor is promoting. Believe me - the last thing we want is two variants of the
driver. The efforts that we have taken over the last several months should
give evidence to what our goal is and how much skin we're willing to put in.
Sure, we've had work to do. Until the recently, our goals were not the same.
I also admit, I didn't like the code in place. But then, I wasn't there in
the building, but I am trying to rebuild it, and nothing happens overnight.

> What you're missing is that the Linux kernel can very well 
> live without a
> Emulex driver, but it will hurt Emulex if it's not properly 
> supported by
> Linux.

Crimminy - can't someone voice a counter position without the wrath of God
coming down ?

I am simply making a point that : 
I think it's too much to demand that all external entry points be removed.
We use them extensively for error injection, testing, diagnostics, and
troubleshooting. I don't want to push users to a vendor-specific driver just
to have these capabilities. Nor do we want to have debates on what driver is
qual'd/supported by customers and OEMS - we want 1 and only 1 driver - the
one in the base kernel.  I don't think this an unreasonable demand.  I hope
you can accurately reflect this viewpoint in your talk...


-- James



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] dead code and missing statics in lpfc
  2004-06-10 13:24 Smart, James
@ 2004-06-10 13:36 ` Arjan van de Ven
  0 siblings, 0 replies; 10+ messages in thread
From: Arjan van de Ven @ 2004-06-10 13:36 UTC (permalink / raw)
  To: Smart, James; +Cc: 'Christoph Hellwig', linux-scsi

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]



> I am simply making a point that : 
> I think it's too much to demand that all external entry points be removed.

is it? Christoph has a point in that the users of such points surely can
be added to the kernel too? Maybe we can even make some of those more
generic and have a driver testing/hardening framework in the scsi
midlayer.

However I must say that just some hooks for "invisible" stuff that
significantly crap up a driver are a mistake in my opinion and should be
removed. Quite often such things stand in the way of real cleanups and
restructuring for example.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] dead code and missing statics in lpfc
@ 2004-06-10 14:33 Smart, James
  2004-06-10 14:43 ` Arjan van de Ven
  0 siblings, 1 reply; 10+ messages in thread
From: Smart, James @ 2004-06-10 14:33 UTC (permalink / raw)
  To: 'arjanv@redhat.com'; +Cc: 'Christoph Hellwig', linux-scsi



> -----Original Message-----
> From: Arjan van de Ven [mailto:arjanv@redhat.com]
> Sent: Thursday, June 10, 2004 9:37 AM
> To: Smart, James
> Cc: 'Christoph Hellwig'; linux-scsi@vger.kernel.org
> Subject: RE: [PATCH] dead code and missing statics in lpfc
> 
> 
> 
> 
> > I am simply making a point that : 
> > I think it's too much to demand that all external entry 
> points be removed.
> 
> is it? Christoph has a point in that the users of such points 
> surely can
> be added to the kernel too? Maybe we can even make some of those more
> generic and have a driver testing/hardening framework in the scsi
> midlayer.

I agree with the underlying idea. Make it available, and select the best
parts for a common implementation.  For diagnostics and testing, some of the
framework may be interesting, but the content will be very driver and
hardware-centric. Many would consider including this content, for no
"standard" purpose, is another way to add crud to the driver.  Making
symbols available was a means to avoiding this latter issue.

> 
> However I must say that just some hooks for "invisible" stuff that
> significantly crap up a driver are a mistake in my opinion 
> and should be
> removed. Quite often such things stand in the way of real cleanups and
> restructuring for example.

I respect this opinion. And if this is the consensus, there will be no
problems in following it.


-- James S


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] dead code and missing statics in lpfc
  2004-06-10 14:33 Smart, James
@ 2004-06-10 14:43 ` Arjan van de Ven
  0 siblings, 0 replies; 10+ messages in thread
From: Arjan van de Ven @ 2004-06-10 14:43 UTC (permalink / raw)
  To: Smart, James; +Cc: 'Christoph Hellwig', linux-scsi

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]


> 
>  Many would consider including this content, for no
> "standard" purpose, is another way to add crud to the driver.  Making
> symbols available was a means to avoiding this latter issue.

a separate .c file that conditionally compiles into the driver is in my
opinion far less "crud" than blind hooks. The former allows for a
cleaner implementation I'm sure, AND has the benefit of being able to
see what is being done, so that any restructuring can 1) take it into
account and 2) fix it up on the go.



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-06-10 14:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-31 10:04 [PATCH] dead code and missing statics in lpfc Christoph Hellwig
2004-06-06  8:47 ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2004-06-08 14:45 Smart, James
2004-06-09  8:55 ` 'Christoph Hellwig'
2004-06-09 11:08 Smart, James
2004-06-10 11:17 ` 'Christoph Hellwig'
2004-06-10 13:24 Smart, James
2004-06-10 13:36 ` Arjan van de Ven
2004-06-10 14:33 Smart, James
2004-06-10 14:43 ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox