--- /dev/null
+Subject: Emulex 8.2.8.10 driver patches for SLE11
+From: Jamie Wellnitz <jamie.wellnitz@emulex.com>
+References: bnc#460775
+
+Changes from 8.2.8.9 to 8.2.8.10:
+
+* Changed version number to 8.2.8.10
+* Fix crash during driver load when authentication is enabled (CR 86652 86677)
+
+
+Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
+Signed-off-by: Hannes Reinecke <hare@suse.de>
+--
+diff -urpN a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
+--- a/drivers/scsi/lpfc/lpfc_attr.c 2008-12-16 16:01:42.260089000 -0500
++++ b/drivers/scsi/lpfc/lpfc_attr.c 2008-12-16 16:01:42.586088000 -0500
+@@ -4303,7 +4303,7 @@ lpfc_get_host_port_state(struct Scsi_Hos
+ fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
+ else {
+ if ((vport->cfg_enable_auth) &&
+- (lpfc_security_service_state == SECURITY_OFFLINE)) {
++ (vport->security_service_state == SECURITY_OFFLINE)) {
+ fc_host_port_state(shost) = FC_PORTSTATE_ERROR;
+ spin_unlock_irq(shost->host_lock);
+ return;
+diff -urpN a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
+--- a/drivers/scsi/lpfc/lpfc_crtn.h 2008-12-16 16:01:42.285088000 -0500
++++ b/drivers/scsi/lpfc/lpfc_crtn.h 2008-12-16 16:01:42.606088000 -0500
+@@ -295,7 +295,7 @@ int lpfc_get_instance(void);
+ void lpfc_host_attrib_init(struct Scsi_Host *);
+
+ int lpfc_selective_reset(struct lpfc_hba *);
+-int lpfc_security_wait(struct lpfc_hba *);
++int lpfc_security_wait(struct lpfc_vport *);
+ int lpfc_get_security_enabled(struct Scsi_Host *);
+ void lpfc_security_service_online(struct Scsi_Host *);
+ void lpfc_security_service_offline(struct Scsi_Host *);
+@@ -318,7 +318,6 @@ extern void lpfc_debugfs_slow_ring_trc(s
+ uint32_t, uint32_t);
+ extern struct lpfc_hbq_init *lpfc_hbq_defs[];
+
+-extern uint8_t lpfc_security_service_state;
+ extern spinlock_t fc_security_user_lock;
+ extern struct list_head fc_security_user_list;
+ extern int fc_service_state;
+diff -urpN a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
+--- a/drivers/scsi/lpfc/lpfc_els.c 2008-12-16 16:01:42.345090000 -0500
++++ b/drivers/scsi/lpfc/lpfc_els.c 2008-12-16 16:01:42.652088000 -0500
+@@ -945,7 +945,7 @@ lpfc_initial_flogi(struct lpfc_vport *vp
+ struct lpfc_nodelist *ndlp;
+
+ if ((vport->cfg_enable_auth) &&
+- (lpfc_security_service_state == SECURITY_OFFLINE))
++ (vport->security_service_state == SECURITY_OFFLINE))
+ return 1;
+
+ vport->port_state = LPFC_FLOGI;
+@@ -1000,7 +1000,7 @@ lpfc_initial_fdisc(struct lpfc_vport *vp
+ struct lpfc_nodelist *ndlp;
+
+ if (vport->cfg_enable_auth) {
+- if (lpfc_security_wait(phba)) {
++ if (lpfc_security_wait(vport)) {
+ lpfc_printf_vlog(vport, KERN_ERR, LOG_SECURITY,
+ "1049 Authentication is enabled but "
+ "authentication service is not "
+diff -urpN a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
+--- a/drivers/scsi/lpfc/lpfc.h 2008-12-16 16:01:42.366088000 -0500
++++ b/drivers/scsi/lpfc/lpfc.h 2008-12-16 16:01:42.656088000 -0500
+@@ -478,6 +478,7 @@ struct lpfc_vport {
+ struct list_head sc_users;
+ struct work_struct sc_online_work;
+ struct work_struct sc_offline_work;
++ uint8_t security_service_state;
+
+ /* Vport Config Parameters */
+ uint32_t cfg_scan_down;
+diff -urpN a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
+--- a/drivers/scsi/lpfc/lpfc_hbadisc.c 2008-12-16 16:01:42.378088000 -0500
++++ b/drivers/scsi/lpfc/lpfc_hbadisc.c 2008-12-16 16:01:42.668088000 -0500
+@@ -1010,7 +1010,7 @@ lpfc_mbx_cmpl_local_config_link(struct l
+ * LPFC_FLOGI while waiting for FLOGI cmpl
+ */
+ if ((vport->cfg_enable_auth) &&
+- (lpfc_security_service_state == SECURITY_OFFLINE))
++ (vport->security_service_state == SECURITY_OFFLINE))
+ lpfc_issue_clear_la(phba, vport);
+ else if (vport->port_state != LPFC_FLOGI)
+ lpfc_initial_flogi(vport);
+diff -urpN a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
+--- a/drivers/scsi/lpfc/lpfc_init.c 2008-12-16 16:01:42.403088000 -0500
++++ b/drivers/scsi/lpfc/lpfc_init.c 2008-12-16 16:01:42.693090000 -0500
+@@ -549,14 +549,9 @@ lpfc_config_port_post(struct lpfc_hba *p
+ mempool_free(pmb, phba->mbox_mem_pool);
+ }
+
+- if (vport->cfg_enable_auth) {
+- if (lpfc_security_service_state == SECURITY_OFFLINE) {
+- lpfc_printf_log(vport->phba, KERN_ERR, LOG_SECURITY,
+- "1000 Authentication is enabled but "
+- "authentication service is not running\n");
++ if (vport->cfg_enable_auth &&
++ vport->security_service_state == SECURITY_OFFLINE)
+ vport->auth.auth_mode = FC_AUTHMODE_UNKNOWN;
+- }
+- }
+
+ /* Allocate new MBOX buffer, will be freed in mbox compl */
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+@@ -2124,6 +2119,7 @@ lpfc_create_port(struct lpfc_hba *phba,
+ INIT_WORK(&vport->sc_offline_work, lpfc_fc_sc_security_offline);
+ INIT_LIST_HEAD(&vport->sc_users);
+ INIT_LIST_HEAD(&vport->sc_response_wait_queue);
++ vport->security_service_state = SECURITY_OFFLINE;
+
+ spin_lock_irq(&phba->hbalock);
+ list_add_tail(&vport->listentry, &phba->port_list);
+@@ -2904,19 +2900,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev,
+
+ shost = lpfc_shost_from_vport(vport);
+
+- if ((lpfc_get_security_enabled)(shost)) {
+- unsigned long flags;
+- spin_lock_irqsave(&fc_security_user_lock, flags);
+- list_add_tail(&vport->sc_users, &fc_security_user_list);
+- spin_unlock_irqrestore(&fc_security_user_lock, flags);
+- if (fc_service_state == FC_SC_SERVICESTATE_ONLINE) {
+- lpfc_fc_queue_security_work(vport,
+- &vport->sc_online_work);
+- }
+- /* Triggers fcauthd to register if it is running */
+- fc_host_post_event(shost, fc_get_event_number(),
+- FCH_EVT_PORT_ONLINE, shost->host_no);
+- }
+ phba->pport = vport;
+ lpfc_debugfs_initialize(vport);
+
+@@ -2990,6 +2973,15 @@ lpfc_pci_probe_one(struct pci_dev *pdev,
+ }
+ }
+
++ if ((lpfc_get_security_enabled)(shost)) {
++ unsigned long flags;
++ spin_lock_irqsave(&fc_security_user_lock, flags);
++ list_add_tail(&vport->sc_users, &fc_security_user_list);
++ spin_unlock_irqrestore(&fc_security_user_lock, flags);
++ /* Triggers fcauthd to register if it is running */
++ fc_host_post_event(shost, fc_get_event_number(),
++ FCH_EVT_PORT_ONLINE, shost->host_no);
++ }
+ /*
+ * hba setup may have changed the hba_queue_depth so we need to adjust
+ * the value of can_queue.
+diff -urpN a/drivers/scsi/lpfc/lpfc_security.c b/drivers/scsi/lpfc/lpfc_security.c
+--- a/drivers/scsi/lpfc/lpfc_security.c 2008-12-16 16:01:42.464088000 -0500
++++ b/drivers/scsi/lpfc/lpfc_security.c 2008-12-16 16:01:42.808089000 -0500
+@@ -36,14 +36,12 @@
+ #include "lpfc_auth_access.h"
+ #include "lpfc_vport.h"
+
+-uint8_t lpfc_security_service_state = SECURITY_OFFLINE;
+-
+ void
+ lpfc_security_service_online(struct Scsi_Host *shost)
+ {
+ struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata;
+
+- lpfc_security_service_state = SECURITY_ONLINE;
++ vport->security_service_state = SECURITY_ONLINE;
+ if (vport->cfg_enable_auth &&
+ vport->auth.auth_mode == FC_AUTHMODE_UNKNOWN)
+ lpfc_selective_reset(vport->phba);
+@@ -52,7 +50,9 @@ lpfc_security_service_online(struct Scsi
+ void
+ lpfc_security_service_offline(struct Scsi_Host *shost)
+ {
+- lpfc_security_service_state = SECURITY_OFFLINE;
++ struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata;
++
++ vport->security_service_state = SECURITY_OFFLINE;
+ }
+
+ void
+@@ -185,21 +185,21 @@ lpfc_get_security_enabled(struct Scsi_Ho
+ }
+
+ int
+-lpfc_security_wait(struct lpfc_hba *phba)
++lpfc_security_wait(struct lpfc_vport *vport)
+ {
+ int i = 0;
+- if (lpfc_security_service_state == SECURITY_ONLINE)
++ if (vport->security_service_state == SECURITY_ONLINE)
+ return 0;
+- lpfc_printf_log(phba, KERN_WARNING, LOG_SECURITY,
++ lpfc_printf_vlog(vport, KERN_ERR, LOG_SECURITY,
+ "1058 Waiting for authentication service...\n");
+- while (lpfc_security_service_state == SECURITY_OFFLINE) {
++ while (vport->security_service_state == SECURITY_OFFLINE) {
+ i++;
+ if (i > SECURITY_WAIT_TMO * 2)
+ return -ETIMEDOUT;
+ /* Delay for half of a second */
+ msleep(500);
+ }
+- lpfc_printf_log(phba, KERN_WARNING, LOG_SECURITY,
++ lpfc_printf_vlog(vport, KERN_ERR, LOG_SECURITY,
+ "1059 Authentication service online.\n");
+ return 0;
+ }
+@@ -310,7 +310,7 @@ lpfc_get_auth_config(struct lpfc_nodelis
+ auth_req.remote_wwpn = AUTH_FABRIC_WWN;
+ else
+ auth_req.remote_wwpn = wwn_to_u64(rwwn->u.wwn);
+- if (lpfc_security_service_state == SECURITY_OFFLINE) {
++ if (vport->security_service_state == SECURITY_OFFLINE) {
+ lpfc_printf_vlog(vport, KERN_ERR, LOG_SECURITY,
+ "1053 Start Authentication: "
+ "Security service offline.\n");
+diff -urpN a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h
+--- a/drivers/scsi/lpfc/lpfc_version.h 2008-12-16 16:01:42.512089000 -0500
++++ b/drivers/scsi/lpfc/lpfc_version.h 2008-12-16 16:01:42.835094000 -0500
+@@ -18,7 +18,7 @@
+ * included with this package. *
+ *******************************************************************/
+
+-#define LPFC_DRIVER_VERSION "8.2.8.9"
++#define LPFC_DRIVER_VERSION "8.2.8.10"
+
+ #define LPFC_DRIVER_NAME "lpfc"
+ #define LPFC_SP_DRIVER_HANDLER_NAME "lpfc:sp"