PERFORCE change 113190 for review
Matt Jacob
mjacob at FreeBSD.org
Sat Jan 20 03:55:30 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=113190
Change 113190 by mjacob at mjexp on 2007/01/20 03:55:24
Ah, fixed a stupidville bug: when we're looking for a new
handle to allocate for an arriving device, don't pick one
that's already in use (pending valid) as the firmware will
be quite content to let you remap that handle to the new
device. Then you trip over a bunch of other code which
ends up nuking one device and putting the new device in
*two* different positions in the virtual map. Gawd.
Affected files ...
.. //depot/projects/mjexp/sys/dev/isp/isp.c#9 edit
Differences ...
==== //depot/projects/mjexp/sys/dev/isp/isp.c#9 (text+ko) ====
@@ -3956,6 +3956,7 @@
static uint16_t
isp_nxt_handle(ispsoftc_t *isp, uint16_t handle)
{
+ int i;
if (handle == NIL_HANDLE) {
if (FCPARAM(isp)->isp_topo == TOPO_F_PORT) {
handle = 0;
@@ -3982,9 +3983,16 @@
}
if (handle == FCPARAM(isp)->isp_loopid) {
return (isp_nxt_handle(isp, handle));
- } else {
- return (handle);
+ }
+ for (i = 0; i < MAX_FC_TARG; i++) {
+ if (FCPARAM(isp)->portdb[i].state == FC_PORTDB_STATE_NIL) {
+ continue;
+ }
+ if (FCPARAM(isp)->portdb[i].handle == handle) {
+ return (isp_nxt_handle(isp, handle));
+ }
}
+ return (handle);
}
/*
More information about the p4-projects
mailing list