From: Dave Jones <davej@codemonkey.org.uk>
To: J?rn Engel <joern@wohnheim.fh-wedel.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Top stack (l)users
Date: Wed, 5 Mar 2003 23:09:44 -0100 [thread overview]
Message-ID: <20030306000944.GA24986@suse.de> (raw)
In-Reply-To: <20030305202157.GA392@wohnheim.fh-wedel.de>
On Wed, Mar 05, 2003 at 09:21:57PM +0100, J?rn Engel wrote:
> And the winner is drivers/scsi/qlogicfc.c.
Ugh, I tackled that ~6 months back for 2.4 but never got
anyone to test my changes (I don't have hardware).
Someone want to try out the following diff with a card ?
(Still applies to 2.5 with offsets..)
Dave
diff -urpN --exclude-from=/home/davej/.exclude linux-2.4.19/drivers/scsi/qlogicfc.c linux-2.4.19-dj/drivers/scsi/qlogicfc.c
--- linux-2.4.19/drivers/scsi/qlogicfc.c 2002-09-16 15:26:49.000000000 +0100
+++ linux-2.4.19-dj/drivers/scsi/qlogicfc.c 2002-09-18 15:01:51.000000000 +0100
@@ -650,6 +650,7 @@ struct isp2x00_hostdata {
u_char queued;
u_char host_id;
struct timer_list explore_timer;
+ struct id_name_map tempmap[QLOGICFC_MAX_ID + 1];
};
@@ -845,13 +846,12 @@ static int isp2x00_make_portdb(struct Sc
short param[8];
int i, j;
- struct id_name_map temp[QLOGICFC_MAX_ID + 1];
struct isp2x00_hostdata *hostdata;
isp2x00_disable_irqs(host);
- memset(temp, 0, sizeof(temp));
hostdata = (struct isp2x00_hostdata *) host->hostdata;
+ memset(hostdata->tempmap, 0, sizeof(hostdata->tempmap));
#if ISP2x00_FABRIC
for (i = 0x81; i < QLOGICFC_MAX_ID; i++) {
@@ -877,15 +877,15 @@ static int isp2x00_make_portdb(struct Sc
if (param[0] == MBOX_COMMAND_COMPLETE) {
hostdata->port_id = ((u_int) param[3]) << 16;
hostdata->port_id |= param[2];
- temp[0].loop_id = param[1];
- temp[0].wwn = hostdata->wwn;
+ hostdata->tempmap[0].loop_id = param[1];
+ hostdata->tempmap[0].wwn = hostdata->wwn;
}
else {
printk("qlogicfc%d : error getting scsi id.\n", hostdata->host_id);
}
for (i = 0; i <=QLOGICFC_MAX_ID; i++)
- temp[i].loop_id = temp[0].loop_id;
+ hostdata->tempmap[i].loop_id = hostdata->tempmap[0].loop_id;
for (i = 0, j = 1; i <= QLOGICFC_MAX_LOOP_ID; i++) {
param[0] = MBOX_GET_PORT_NAME;
@@ -894,15 +894,15 @@ static int isp2x00_make_portdb(struct Sc
isp2x00_mbox_command(host, param);
if (param[0] == MBOX_COMMAND_COMPLETE) {
- temp[j].loop_id = i;
- temp[j].wwn = ((u64) (param[2] & 0xff)) << 56;
- temp[j].wwn |= ((u64) ((param[2] >> 8) & 0xff)) << 48;
- temp[j].wwn |= ((u64) (param[3] & 0xff)) << 40;
- temp[j].wwn |= ((u64) ((param[3] >> 8) & 0xff)) << 32;
- temp[j].wwn |= ((u64) (param[6] & 0xff)) << 24;
- temp[j].wwn |= ((u64) ((param[6] >> 8) & 0xff)) << 16;
- temp[j].wwn |= ((u64) (param[7] & 0xff)) << 8;
- temp[j].wwn |= ((u64) ((param[7] >> 8) & 0xff));
+ hostdata->tempmap[j].loop_id = i;
+ hostdata->tempmap[j].wwn = ((u64) (param[2] & 0xff)) << 56;
+ hostdata->tempmap[j].wwn |= ((u64) ((param[2] >> 8) & 0xff)) << 48;
+ hostdata->tempmap[j].wwn |= ((u64) (param[3] & 0xff)) << 40;
+ hostdata->tempmap[j].wwn |= ((u64) ((param[3] >> 8) & 0xff)) << 32;
+ hostdata->tempmap[j].wwn |= ((u64) (param[6] & 0xff)) << 24;
+ hostdata->tempmap[j].wwn |= ((u64) ((param[6] >> 8) & 0xff)) << 16;
+ hostdata->tempmap[j].wwn |= ((u64) (param[7] & 0xff)) << 8;
+ hostdata->tempmap[j].wwn |= ((u64) ((param[7] >> 8) & 0xff));
j++;
@@ -911,33 +911,33 @@ static int isp2x00_make_portdb(struct Sc
#if ISP2x00_FABRIC
- isp2x00_init_fabric(host, temp, j);
+ isp2x00_init_fabric(host, hostdata->tempmap, j);
#endif
for (i = 0; i <= QLOGICFC_MAX_ID; i++) {
- if (temp[i].wwn != hostdata->port_db[i].wwn) {
+ if (hostdata->tempmap[i].wwn != hostdata->port_db[i].wwn) {
for (j = 0; j <= QLOGICFC_MAX_ID; j++) {
- if (temp[j].wwn == hostdata->port_db[i].wwn) {
- hostdata->port_db[i].loop_id = temp[j].loop_id;
+ if (hostdata->tempmap[j].wwn == hostdata->port_db[i].wwn) {
+ hostdata->port_db[i].loop_id = hostdata->tempmap[j].loop_id;
break;
}
}
if (j == QLOGICFC_MAX_ID + 1)
- hostdata->port_db[i].loop_id = temp[0].loop_id;
+ hostdata->port_db[i].loop_id = hostdata->tempmap[0].loop_id;
for (j = 0; j <= QLOGICFC_MAX_ID; j++) {
- if (hostdata->port_db[j].wwn == temp[i].wwn || !hostdata->port_db[j].wwn) {
+ if (hostdata->port_db[j].wwn == hostdata->tempmap[i].wwn || !hostdata->port_db[j].wwn) {
break;
}
}
if (j == QLOGICFC_MAX_ID + 1)
printk("qlogicfc%d : Too many scsi devices, no more room in port map.\n", hostdata->host_id);
if (!hostdata->port_db[j].wwn) {
- hostdata->port_db[j].loop_id = temp[i].loop_id;
- hostdata->port_db[j].wwn = temp[i].wwn;
+ hostdata->port_db[j].loop_id = hostdata->tempmap[i].loop_id;
+ hostdata->port_db[j].wwn = hostdata->tempmap[i].wwn;
}
} else
- hostdata->port_db[i].loop_id = temp[i].loop_id;
+ hostdata->port_db[i].loop_id = hostdata->tempmap[i].loop_id;
}
next prev parent reply other threads:[~2003-03-05 23:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-05 20:21 Top stack (l)users Jörn Engel
2003-03-06 0:09 ` Dave Jones [this message]
2003-03-06 0:46 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030306000944.GA24986@suse.de \
--to=davej@codemonkey.org.uk \
--cc=joern@wohnheim.fh-wedel.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.