]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.drivers/lpfc-8.2.8.13-update
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / lpfc-8.2.8.13-update
1 From: Laurie Barry <laurie.barry@emulex.com>
2 Subject: Update lpfc from 8.2.8.12 to 8.2.8.13
3 References: bnc#472608
4
5 lpfc 8.2.8.13 fixes a few bugs found in our qual cycle on SLES 11 RC3:
6
7 * Changed version number to 8.2.8.13
8 * Added sysfs interface to update speed and topology parameter without link
9 bounce (CR 87013)
10 * Fixed loopback test failure (CR 87414)
11
12 Acked-by: Hannes Reinecke <hare@suse.de>
13
14 --
15 diff -urpN a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
16 --- a/drivers/scsi/lpfc/lpfc_attr.c 2009-02-04 11:14:24.143349000 -0500
17 +++ b/drivers/scsi/lpfc/lpfc_attr.c 2009-02-04 11:14:24.291344000 -0500
18 @@ -1,7 +1,7 @@
19 /*******************************************************************
20 * This file is part of the Emulex Linux Device Driver for *
21 * Fibre Channel Host Bus Adapters. *
22 - * Copyright (C) 2004-2008 Emulex. All rights reserved. *
23 + * Copyright (C) 2004-2009 Emulex. All rights reserved. *
24 * EMULEX and SLI are trademarks of Emulex. *
25 * www.emulex.com *
26 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
27 @@ -2449,18 +2449,41 @@ LPFC_VPORT_ATTR_R(scan_down, 1, 0, 1,
28 * non-zero return value from lpfc_issue_lip()
29 * -EINVAL val out of range
30 **/
31 -static int
32 -lpfc_topology_set(struct lpfc_hba *phba, int val)
33 +static ssize_t
34 +lpfc_topology_store(struct device *dev, struct device_attribute *attr,
35 + const char *buf, size_t count)
36 {
37 + struct Scsi_Host *shost = class_to_shost(dev);
38 + struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
39 + struct lpfc_hba *phba = vport->phba;
40 + int val = 0;
41 + int nolip = 0;
42 + const char *val_buf = buf;
43 int err;
44 uint32_t prev_val;
45 +
46 + if (!strncmp(buf, "nolip ", strlen("nolip "))) {
47 + nolip = 1;
48 + val_buf = &buf[strlen("nolip ")];
49 + }
50 +
51 + if (!isdigit(val_buf[0]))
52 + return -EINVAL;
53 + if (sscanf(val_buf, "%i", &val) != 1)
54 + return -EINVAL;
55 +
56 if (val >= 0 && val <= 6) {
57 prev_val = phba->cfg_topology;
58 phba->cfg_topology = val;
59 + if (nolip)
60 + return strlen(buf);
61 +
62 err = lpfc_issue_lip(lpfc_shost_from_vport(phba->pport));
63 - if (err)
64 + if (err) {
65 phba->cfg_topology = prev_val;
66 - return err;
67 + return -EINVAL;
68 + } else
69 + return strlen(buf);
70 }
71 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
72 "%d:0467 lpfc_topology attribute cannot be set to %d, "
73 @@ -2473,7 +2496,6 @@ module_param(lpfc_topology, int, 0);
74 MODULE_PARM_DESC(lpfc_topology, "Select Fibre Channel topology");
75 lpfc_param_show(topology)
76 lpfc_param_init(topology, 0, 0, 6)
77 -lpfc_param_store(topology)
78 static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR,
79 lpfc_topology_show, lpfc_topology_store);
80
81 @@ -2834,12 +2856,29 @@ static struct bin_attribute sysfs_drvr_s
82 * non-zero return value from lpfc_issue_lip()
83 * -EINVAL val out of range
84 **/
85 -static int
86 -lpfc_link_speed_set(struct lpfc_hba *phba, int val)
87 +static ssize_t
88 +lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
89 + const char *buf, size_t count)
90 {
91 + struct Scsi_Host *shost = class_to_shost(dev);
92 + struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
93 + struct lpfc_hba *phba = vport->phba;
94 + int val = 0;
95 + int nolip = 0;
96 + const char *val_buf = buf;
97 int err;
98 uint32_t prev_val;
99
100 + if (!strncmp(buf, "nolip ", strlen("nolip "))) {
101 + nolip = 1;
102 + val_buf = &buf[strlen("nolip ")];
103 + }
104 +
105 + if (!isdigit(val_buf[0]))
106 + return -EINVAL;
107 + if (sscanf(val_buf, "%i", &val) != 1)
108 + return -EINVAL;
109 +
110 if (((val == LINK_SPEED_1G) && !(phba->lmt & LMT_1Gb)) ||
111 ((val == LINK_SPEED_2G) && !(phba->lmt & LMT_2Gb)) ||
112 ((val == LINK_SPEED_4G) && !(phba->lmt & LMT_4Gb)) ||
113 @@ -2847,14 +2886,19 @@ lpfc_link_speed_set(struct lpfc_hba *phb
114 ((val == LINK_SPEED_10G) && !(phba->lmt & LMT_10Gb)))
115 return -EINVAL;
116
117 - if ((val >= 0 && val <= LPFC_MAX_LINK_SPEED)
118 + if ((val >= 0 && val <= 8)
119 && (LPFC_LINK_SPEED_BITMAP & (1 << val))) {
120 prev_val = phba->cfg_link_speed;
121 phba->cfg_link_speed = val;
122 + if (nolip)
123 + return strlen(buf);
124 +
125 err = lpfc_issue_lip(lpfc_shost_from_vport(phba->pport));
126 - if (err)
127 + if (err) {
128 phba->cfg_link_speed = prev_val;
129 - return err;
130 + return -EINVAL;
131 + } else
132 + return strlen(buf);
133 }
134
135 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
136 @@ -2901,7 +2945,6 @@ lpfc_link_speed_init(struct lpfc_hba *ph
137 return -EINVAL;
138 }
139
140 -lpfc_param_store(link_speed)
141 static DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR,
142 lpfc_link_speed_show, lpfc_link_speed_store);
143
144 @@ -3981,6 +4024,10 @@ sysfs_mbox_read(struct kobject *kobj, st
145 (sysfs_mbox->mbox->mb.un.varWords[1] == 1)) {
146 wait_4_menlo_maint = 1;
147 phba->wait_4_mlo_maint_flg = 1;
148 + } else if (sysfs_mbox->mbox->mb.un.varWords[0] ==
149 + SETVAR_MLORST) {
150 + phba->link_flag &= ~LS_LOOPBACK_MODE;
151 + phba->fc_topology = TOPOLOGY_PT_PT;
152 }
153 break;
154 case MBX_RUN_BIU_DIAG64:
155 diff -urpN a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
156 --- a/drivers/scsi/lpfc/lpfc_els.c 2009-02-04 11:14:24.218344000 -0500
157 +++ b/drivers/scsi/lpfc/lpfc_els.c 2009-02-04 11:14:24.311341000 -0500
158 @@ -2514,8 +2514,10 @@ lpfc_els_retry(struct lpfc_hba *phba, st
159 switch ((irsp->un.ulpWord[4] & 0xff)) {
160 case IOERR_LOOP_OPEN_FAILURE:
161 if (cmd == ELS_CMD_FLOGI) {
162 - if (PCI_DEVICE_ID_HORNET ==
163 - phba->pcidev->device) {
164 + if ((PCI_DEVICE_ID_HORNET ==
165 + phba->pcidev->device)
166 + && phba->link_flag ==
167 + LS_LOOPBACK_MODE) {
168 phba->fc_topology = TOPOLOGY_LOOP;
169 phba->pport->fc_myDID = 0;
170 phba->alpa_map[0] = 0;
171 diff -urpN a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
172 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c 2009-02-04 11:14:24.223338000 -0500
173 +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c 2009-02-04 11:14:24.315342000 -0500
174 @@ -2574,6 +2574,10 @@ lpfc_disc_list_loopmap(struct lpfc_vport
175 if (phba->fc_topology != TOPOLOGY_LOOP)
176 return;
177
178 + if ((PCI_DEVICE_ID_HORNET == phba->pcidev->device)
179 + && (phba->link_flag & LS_LOOPBACK_MODE))
180 + return;
181 +
182 /* Check for loop map present or not */
183 if (phba->alpa_map[0]) {
184 for (j = 1; j <= phba->alpa_map[0]; j++) {
185 diff -urpN a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h
186 --- a/drivers/scsi/lpfc/lpfc_version.h 2009-02-04 11:14:24.270343000 -0500
187 +++ b/drivers/scsi/lpfc/lpfc_version.h 2009-02-04 11:14:24.351338000 -0500
188 @@ -18,7 +18,7 @@
189 * included with this package. *
190 *******************************************************************/
191
192 -#define LPFC_DRIVER_VERSION "8.2.8.12"
193 +#define LPFC_DRIVER_VERSION "8.2.8.13"
194
195 #define LPFC_DRIVER_NAME "lpfc"
196 #define LPFC_SP_DRIVER_HANDLER_NAME "lpfc:sp"