Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
00492e8c
Commit
00492e8c
authored
Feb 03, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/davem/sparc-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
ba5ce248
45c20ae5
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
114 additions
and
87 deletions
+114
-87
arch/sparc/kernel/entry.S
arch/sparc/kernel/entry.S
+10
-0
arch/sparc/kernel/sparc_ksyms.c
arch/sparc/kernel/sparc_ksyms.c
+1
-0
drivers/fc4/fc.c
drivers/fc4/fc.c
+12
-14
drivers/scsi/esp.c
drivers/scsi/esp.c
+46
-46
drivers/scsi/fcal.c
drivers/scsi/fcal.c
+4
-3
drivers/scsi/pluto.c
drivers/scsi/pluto.c
+9
-7
drivers/scsi/qlogicpti.c
drivers/scsi/qlogicpti.c
+17
-17
include/asm-sparc/delay.h
include/asm-sparc/delay.h
+1
-0
include/asm-sparc64/delay.h
include/asm-sparc64/delay.h
+14
-0
No files found.
arch/sparc/kernel/entry.S
View file @
00492e8c
...
@@ -1808,6 +1808,15 @@ C_LABEL(fpload):
...
@@ -1808,6 +1808,15 @@ C_LABEL(fpload):
retl
retl
nop
nop
.
globl
C_LABEL
(
ndelay
)
C_LABEL
(
ndelay
):
save
%
sp
,
-
REGWIN_SZ
,
%
sp
mov
%
i0
,
%
o0
call
.
umul
mov
5
,
%
o1
ba
delay_continue
nop
.
globl
C_LABEL
(
udelay
)
.
globl
C_LABEL
(
udelay
)
C_LABEL
(
udelay
):
C_LABEL
(
udelay
):
save
%
sp
,
-
REGWIN_SZ
,
%
sp
save
%
sp
,
-
REGWIN_SZ
,
%
sp
...
@@ -1815,6 +1824,7 @@ C_LABEL(udelay):
...
@@ -1815,6 +1824,7 @@ C_LABEL(udelay):
sethi
%
hi
(
0x10c6
),
%
o1
sethi
%
hi
(
0x10c6
),
%
o1
call
.
umul
call
.
umul
or
%
o1
,
%
lo
(
0x10c6
),
%
o1
or
%
o1
,
%
lo
(
0x10c6
),
%
o1
delay_continue
:
#ifndef CONFIG_SMP
#ifndef CONFIG_SMP
sethi
%
hi
(
C_LABEL
(
loops_per_jiffy
)),
%
o3
sethi
%
hi
(
C_LABEL
(
loops_per_jiffy
)),
%
o3
call
.
umul
call
.
umul
...
...
arch/sparc/kernel/sparc_ksyms.c
View file @
00492e8c
...
@@ -151,6 +151,7 @@ EXPORT_SYMBOL(__cpu_logical_map);
...
@@ -151,6 +151,7 @@ EXPORT_SYMBOL(__cpu_logical_map);
#endif
#endif
EXPORT_SYMBOL
(
udelay
);
EXPORT_SYMBOL
(
udelay
);
EXPORT_SYMBOL
(
ndelay
);
EXPORT_SYMBOL
(
mostek_lock
);
EXPORT_SYMBOL
(
mostek_lock
);
EXPORT_SYMBOL
(
mstk48t02_regs
);
EXPORT_SYMBOL
(
mstk48t02_regs
);
#if CONFIG_SUN_AUXIO
#if CONFIG_SUN_AUXIO
...
...
drivers/fc4/fc.c
View file @
00492e8c
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
#endif
#endif
#define FCP_CMND(SCpnt) ((fcp_cmnd *)&(SCpnt->SCp))
#define FCP_CMND(SCpnt) ((fcp_cmnd *)&(SCpnt->SCp))
#define FC_SCMND(SCpnt) ((fc_channel *)(SCpnt->host->hostdata[0]))
#define FC_SCMND(SCpnt) ((fc_channel *)(SCpnt->
device->
host->hostdata[0]))
#define SC_FCMND(fcmnd) ((Scsi_Cmnd *)((long)fcmnd - (long)&(((Scsi_Cmnd *)0)->SCp)))
#define SC_FCMND(fcmnd) ((Scsi_Cmnd *)((long)fcmnd - (long)&(((Scsi_Cmnd *)0)->SCp)))
static
int
fcp_scsi_queue_it
(
fc_channel
*
,
Scsi_Cmnd
*
,
fcp_cmnd
*
,
int
);
static
int
fcp_scsi_queue_it
(
fc_channel
*
,
Scsi_Cmnd
*
,
fcp_cmnd
*
,
int
);
...
@@ -449,7 +449,7 @@ static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hd
...
@@ -449,7 +449,7 @@ static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hd
}
}
if
(
status_byte
(
rsp_status
)
==
QUEUE_FULL
)
{
if
(
status_byte
(
rsp_status
)
==
QUEUE_FULL
)
{
printk
(
"%s: (%d,%d) Received rsp_status 0x%x
\n
"
,
fc
->
name
,
SCpnt
->
channel
,
SCpnt
->
target
,
rsp_status
);
printk
(
"%s: (%d,%d) Received rsp_status 0x%x
\n
"
,
fc
->
name
,
SCpnt
->
device
->
channel
,
SCpnt
->
device
->
id
,
rsp_status
);
}
}
SCpnt
->
result
=
(
host_status
<<
16
)
|
(
rsp_status
&
0xff
);
SCpnt
->
result
=
(
host_status
<<
16
)
|
(
rsp_status
&
0xff
);
...
@@ -771,10 +771,10 @@ static void fcp_scsi_done (Scsi_Cmnd *SCpnt)
...
@@ -771,10 +771,10 @@ static void fcp_scsi_done (Scsi_Cmnd *SCpnt)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
SCpnt
->
host
->
host_lock
,
flags
);
spin_lock_irqsave
(
SCpnt
->
device
->
host
->
host_lock
,
flags
);
if
(
FCP_CMND
(
SCpnt
)
->
done
)
if
(
FCP_CMND
(
SCpnt
)
->
done
)
FCP_CMND
(
SCpnt
)
->
done
(
SCpnt
);
FCP_CMND
(
SCpnt
)
->
done
(
SCpnt
);
spin_unlock_irqrestore
(
SCpnt
->
host
->
host_lock
,
flags
);
spin_unlock_irqrestore
(
SCpnt
->
device
->
host
->
host_lock
,
flags
);
}
}
static
int
fcp_scsi_queue_it
(
fc_channel
*
fc
,
Scsi_Cmnd
*
SCpnt
,
fcp_cmnd
*
fcmd
,
int
prepare
)
static
int
fcp_scsi_queue_it
(
fc_channel
*
fc
,
Scsi_Cmnd
*
SCpnt
,
fcp_cmnd
*
fcmd
,
int
prepare
)
...
@@ -799,8 +799,8 @@ static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, i
...
@@ -799,8 +799,8 @@ static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, i
fc
->
cmd_slots
[
fcmd
->
token
]
=
fcmd
;
fc
->
cmd_slots
[
fcmd
->
token
]
=
fcmd
;
if
(
SCpnt
->
device
->
tagged_supported
)
{
if
(
SCpnt
->
device
->
tagged_supported
)
{
if
(
jiffies
-
fc
->
ages
[
SCpnt
->
channel
*
fc
->
targets
+
SCpnt
->
target
]
>
(
5
*
60
*
HZ
))
{
if
(
jiffies
-
fc
->
ages
[
SCpnt
->
device
->
channel
*
fc
->
targets
+
SCpnt
->
device
->
id
]
>
(
5
*
60
*
HZ
))
{
fc
->
ages
[
SCpnt
->
channel
*
fc
->
targets
+
SCpnt
->
target
]
=
jiffies
;
fc
->
ages
[
SCpnt
->
device
->
channel
*
fc
->
targets
+
SCpnt
->
device
->
id
]
=
jiffies
;
fcp_cntl
=
FCP_CNTL_QTYPE_ORDERED
;
fcp_cntl
=
FCP_CNTL_QTYPE_ORDERED
;
}
else
}
else
fcp_cntl
=
FCP_CNTL_QTYPE_SIMPLE
;
fcp_cntl
=
FCP_CNTL_QTYPE_SIMPLE
;
...
@@ -916,9 +916,9 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
...
@@ -916,9 +916,9 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
unsigned
long
flags
;
unsigned
long
flags
;
SCpnt
->
result
=
DID_ABORT
;
SCpnt
->
result
=
DID_ABORT
;
spin_lock_irqsave
(
SCpnt
->
host
->
host_lock
,
flags
);
spin_lock_irqsave
(
SCpnt
->
device
->
host
->
host_lock
,
flags
);
fcmd
->
done
(
SCpnt
);
fcmd
->
done
(
SCpnt
);
spin_unlock_irqrestore
(
SCpnt
->
host
->
host_lock
,
flags
);
spin_unlock_irqrestore
(
SCpnt
->
device
->
host
->
host_lock
,
flags
);
printk
(
"FC: soft abort
\n
"
);
printk
(
"FC: soft abort
\n
"
);
return
SUCCESS
;
return
SUCCESS
;
}
else
{
}
else
{
...
@@ -932,7 +932,7 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
...
@@ -932,7 +932,7 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
fc_channel
*
fc
=
FC_SCMND
(
SCpnt
);
fc_channel
*
fc
=
FC_SCMND
(
SCpnt
);
fc
->
rst_pkt
->
eh_state
=
SCSI_STATE_FINISHED
;
fc
->
rst_pkt
->
eh_state
=
SCSI_STATE_FINISHED
;
up
(
fc
->
rst_pkt
->
host
->
eh_action
);
up
(
fc
->
rst_pkt
->
device
->
host
->
eh_action
);
}
}
#define FCP_RESET_TIMEOUT (2*HZ)
#define FCP_RESET_TIMEOUT (2*HZ)
...
@@ -955,9 +955,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
...
@@ -955,9 +955,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
cmd
=
fc
->
scsi_cmd_pool
+
0
;
cmd
=
fc
->
scsi_cmd_pool
+
0
;
FCD
((
"Preparing rst packet
\n
"
))
FCD
((
"Preparing rst packet
\n
"
))
fc
->
encode_addr
(
SCpnt
,
cmd
->
fcp_addr
,
fc
,
fcmd
);
fc
->
encode_addr
(
SCpnt
,
cmd
->
fcp_addr
,
fc
,
fcmd
);
fc
->
rst_pkt
->
channel
=
SCpnt
->
channel
;
fc
->
rst_pkt
->
device
=
SCpnt
->
device
;
fc
->
rst_pkt
->
target
=
SCpnt
->
target
;
fc
->
rst_pkt
->
lun
=
0
;
fc
->
rst_pkt
->
cmd_len
=
0
;
fc
->
rst_pkt
->
cmd_len
=
0
;
fc
->
cmd_slots
[
0
]
=
fcmd
;
fc
->
cmd_slots
[
0
]
=
fcmd
;
...
@@ -989,7 +987,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
...
@@ -989,7 +987,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
* Set up the semaphore so we wait for the command to complete.
* Set up the semaphore so we wait for the command to complete.
*/
*/
fc
->
rst_pkt
->
host
->
eh_action
=
&
sem
;
fc
->
rst_pkt
->
device
->
host
->
eh_action
=
&
sem
;
fc
->
rst_pkt
->
request
->
rq_status
=
RQ_SCSI_BUSY
;
fc
->
rst_pkt
->
request
->
rq_status
=
RQ_SCSI_BUSY
;
fc
->
rst_pkt
->
done
=
fcp_scsi_reset_done
;
fc
->
rst_pkt
->
done
=
fcp_scsi_reset_done
;
...
@@ -997,7 +995,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
...
@@ -997,7 +995,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
down
(
&
sem
);
down
(
&
sem
);
fc
->
rst_pkt
->
host
->
eh_action
=
NULL
;
fc
->
rst_pkt
->
device
->
host
->
eh_action
=
NULL
;
del_timer
(
&
fc
->
rst_pkt
->
eh_timeout
);
del_timer
(
&
fc
->
rst_pkt
->
eh_timeout
);
/*
/*
...
...
drivers/scsi/esp.c
View file @
00492e8c
...
@@ -453,7 +453,7 @@ static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, int target, int lun)
...
@@ -453,7 +453,7 @@ static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, int target, int lun)
Scsi_Cmnd
*
ptr
,
*
prev
;
Scsi_Cmnd
*
ptr
,
*
prev
;
for
(
ptr
=
*
SC
,
prev
=
NULL
;
for
(
ptr
=
*
SC
,
prev
=
NULL
;
ptr
&&
((
ptr
->
target
!=
target
)
||
(
ptr
->
lun
!=
lun
));
ptr
&&
((
ptr
->
device
->
id
!=
target
)
||
(
ptr
->
device
->
lun
!=
lun
));
prev
=
ptr
,
ptr
=
(
Scsi_Cmnd
*
)
ptr
->
host_scribble
)
prev
=
ptr
,
ptr
=
(
Scsi_Cmnd
*
)
ptr
->
host_scribble
)
;
;
if
(
ptr
)
{
if
(
ptr
)
{
...
@@ -1447,7 +1447,7 @@ static void esp_release_dmabufs(struct esp *esp, Scsi_Cmnd *sp)
...
@@ -1447,7 +1447,7 @@ static void esp_release_dmabufs(struct esp *esp, Scsi_Cmnd *sp)
static
void
esp_restore_pointers
(
struct
esp
*
esp
,
Scsi_Cmnd
*
sp
)
static
void
esp_restore_pointers
(
struct
esp
*
esp
,
Scsi_Cmnd
*
sp
)
{
{
struct
esp_pointers
*
ep
=
&
esp
->
data_pointers
[
sp
->
target
];
struct
esp_pointers
*
ep
=
&
esp
->
data_pointers
[
sp
->
device
->
id
];
sp
->
SCp
.
ptr
=
ep
->
saved_ptr
;
sp
->
SCp
.
ptr
=
ep
->
saved_ptr
;
sp
->
SCp
.
buffer
=
ep
->
saved_buffer
;
sp
->
SCp
.
buffer
=
ep
->
saved_buffer
;
...
@@ -1457,7 +1457,7 @@ static void esp_restore_pointers(struct esp *esp, Scsi_Cmnd *sp)
...
@@ -1457,7 +1457,7 @@ static void esp_restore_pointers(struct esp *esp, Scsi_Cmnd *sp)
static
void
esp_save_pointers
(
struct
esp
*
esp
,
Scsi_Cmnd
*
sp
)
static
void
esp_save_pointers
(
struct
esp
*
esp
,
Scsi_Cmnd
*
sp
)
{
{
struct
esp_pointers
*
ep
=
&
esp
->
data_pointers
[
sp
->
target
];
struct
esp_pointers
*
ep
=
&
esp
->
data_pointers
[
sp
->
device
->
id
];
ep
->
saved_ptr
=
sp
->
SCp
.
ptr
;
ep
->
saved_ptr
=
sp
->
SCp
.
ptr
;
ep
->
saved_buffer
=
sp
->
SCp
.
buffer
;
ep
->
saved_buffer
=
sp
->
SCp
.
buffer
;
...
@@ -1559,8 +1559,8 @@ static void esp_exec_cmd(struct esp *esp)
...
@@ -1559,8 +1559,8 @@ static void esp_exec_cmd(struct esp *esp)
SDptr
=
SCptr
->
device
;
SDptr
=
SCptr
->
device
;
esp_dev
=
SDptr
->
hostdata
;
esp_dev
=
SDptr
->
hostdata
;
lun
=
SCptr
->
lun
;
lun
=
SCptr
->
device
->
lun
;
target
=
SCptr
->
target
;
target
=
SCptr
->
device
->
id
;
esp
->
snip
=
0
;
esp
->
snip
=
0
;
esp
->
msgout_len
=
0
;
esp
->
msgout_len
=
0
;
...
@@ -1621,7 +1621,7 @@ static void esp_exec_cmd(struct esp *esp)
...
@@ -1621,7 +1621,7 @@ static void esp_exec_cmd(struct esp *esp)
* disconnect.
* disconnect.
*/
*/
ESPMISC
((
"esp: Selecting device for first time. target=%d "
ESPMISC
((
"esp: Selecting device for first time. target=%d "
"lun=%d
\n
"
,
target
,
SCptr
->
lun
));
"lun=%d
\n
"
,
target
,
SCptr
->
device
->
lun
));
if
(
!
SDptr
->
borken
&&
!
esp_dev
->
disconnect
)
if
(
!
SDptr
->
borken
&&
!
esp_dev
->
disconnect
)
esp_dev
->
disconnect
=
1
;
esp_dev
->
disconnect
=
1
;
...
@@ -1731,7 +1731,7 @@ static void esp_exec_cmd(struct esp *esp)
...
@@ -1731,7 +1731,7 @@ static void esp_exec_cmd(struct esp *esp)
SDptr
->
removable
==
0
)
||
SDptr
->
removable
==
0
)
||
cdrom_hwbug_wkaround
||
SDptr
->
borken
)
{
cdrom_hwbug_wkaround
||
SDptr
->
borken
)
{
ESPMISC
((
KERN_INFO
"esp%d: Disabling DISCONNECT for target %d "
ESPMISC
((
KERN_INFO
"esp%d: Disabling DISCONNECT for target %d "
"lun %d
\n
"
,
esp
->
esp_id
,
SCptr
->
target
,
SCptr
->
lun
));
"lun %d
\n
"
,
esp
->
esp_id
,
SCptr
->
device
->
id
,
SCptr
->
device
->
lun
));
esp_dev
->
disconnect
=
0
;
esp_dev
->
disconnect
=
0
;
*
cmdp
++
=
IDENTIFY
(
0
,
lun
);
*
cmdp
++
=
IDENTIFY
(
0
,
lun
);
}
else
{
}
else
{
...
@@ -1822,10 +1822,10 @@ static int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
...
@@ -1822,10 +1822,10 @@ static int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
SCpnt
->
SCp
.
phase
=
not_issued
;
SCpnt
->
SCp
.
phase
=
not_issued
;
/* We use the scratch area. */
/* We use the scratch area. */
ESPQUEUE
((
"esp_queue: target=%d lun=%d "
,
SCpnt
->
target
,
SCpnt
->
lun
));
ESPQUEUE
((
"esp_queue: target=%d lun=%d "
,
SCpnt
->
device
->
id
,
SCpnt
->
device
->
lun
));
ESPDISC
((
"N<%02x,%02x>"
,
SCpnt
->
target
,
SCpnt
->
lun
));
ESPDISC
((
"N<%02x,%02x>"
,
SCpnt
->
device
->
id
,
SCpnt
->
device
->
lun
));
esp
=
(
struct
esp
*
)
SCpnt
->
host
->
hostdata
;
esp
=
(
struct
esp
*
)
SCpnt
->
device
->
host
->
hostdata
;
esp_get_dmabufs
(
esp
,
SCpnt
);
esp_get_dmabufs
(
esp
,
SCpnt
);
esp_save_pointers
(
esp
,
SCpnt
);
/* FIXME for tag queueing */
esp_save_pointers
(
esp
,
SCpnt
);
/* FIXME for tag queueing */
...
@@ -1852,7 +1852,7 @@ static int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
...
@@ -1852,7 +1852,7 @@ static int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
/* Only queuing supported in this ESP driver. */
/* Only queuing supported in this ESP driver. */
static
int
esp_command
(
Scsi_Cmnd
*
SCpnt
)
static
int
esp_command
(
Scsi_Cmnd
*
SCpnt
)
{
{
struct
esp
*
esp
=
(
struct
esp
*
)
SCpnt
->
host
->
hostdata
;
struct
esp
*
esp
=
(
struct
esp
*
)
SCpnt
->
device
->
host
->
hostdata
;
ESPLOG
((
"esp%d: esp_command() called...
\n
"
,
esp
->
esp_id
));
ESPLOG
((
"esp%d: esp_command() called...
\n
"
,
esp
->
esp_id
));
return
-
1
;
return
-
1
;
...
@@ -1863,7 +1863,7 @@ static void esp_dump_cmd(Scsi_Cmnd *SCptr)
...
@@ -1863,7 +1863,7 @@ static void esp_dump_cmd(Scsi_Cmnd *SCptr)
{
{
ESPLOG
((
"[tgt<%02x> lun<%02x> "
ESPLOG
((
"[tgt<%02x> lun<%02x> "
"pphase<%s> cphase<%s>]"
,
"pphase<%s> cphase<%s>]"
,
SCptr
->
target
,
SCptr
->
lun
,
SCptr
->
device
->
id
,
SCptr
->
device
->
lun
,
phase_string
(
SCptr
->
SCp
.
sent_command
),
phase_string
(
SCptr
->
SCp
.
sent_command
),
phase_string
(
SCptr
->
SCp
.
phase
)));
phase_string
(
SCptr
->
SCp
.
phase
)));
}
}
...
@@ -1917,7 +1917,7 @@ static void esp_dump_state(struct esp *esp)
...
@@ -1917,7 +1917,7 @@ static void esp_dump_state(struct esp *esp)
/* Abort a command. The host_lock is acquired by caller. */
/* Abort a command. The host_lock is acquired by caller. */
static
int
esp_abort
(
Scsi_Cmnd
*
SCptr
)
static
int
esp_abort
(
Scsi_Cmnd
*
SCptr
)
{
{
struct
esp
*
esp
=
(
struct
esp
*
)
SCptr
->
host
->
hostdata
;
struct
esp
*
esp
=
(
struct
esp
*
)
SCptr
->
device
->
host
->
hostdata
;
int
don
;
int
don
;
ESPLOG
((
"esp%d: Aborting command
\n
"
,
esp
->
esp_id
));
ESPLOG
((
"esp%d: Aborting command
\n
"
,
esp
->
esp_id
));
...
@@ -2049,7 +2049,7 @@ static int esp_do_resetbus(struct esp *esp)
...
@@ -2049,7 +2049,7 @@ static int esp_do_resetbus(struct esp *esp)
*/
*/
static
int
esp_reset
(
Scsi_Cmnd
*
SCptr
)
static
int
esp_reset
(
Scsi_Cmnd
*
SCptr
)
{
{
struct
esp
*
esp
=
(
struct
esp
*
)
SCptr
->
host
->
hostdata
;
struct
esp
*
esp
=
(
struct
esp
*
)
SCptr
->
device
->
host
->
hostdata
;
(
void
)
esp_do_resetbus
(
esp
);
(
void
)
esp_do_resetbus
(
esp
);
...
@@ -2474,13 +2474,13 @@ static inline void esp_connect(struct esp *esp, Scsi_Cmnd *sp)
...
@@ -2474,13 +2474,13 @@ static inline void esp_connect(struct esp *esp, Scsi_Cmnd *sp)
if
(
esp
->
prev_soff
!=
esp_dev
->
sync_max_offset
||
if
(
esp
->
prev_soff
!=
esp_dev
->
sync_max_offset
||
esp
->
prev_stp
!=
esp_dev
->
sync_min_period
||
esp
->
prev_stp
!=
esp_dev
->
sync_min_period
||
(
esp
->
erev
>
esp100a
&&
(
esp
->
erev
>
esp100a
&&
esp
->
prev_cfg3
!=
esp
->
config3
[
sp
->
target
]))
{
esp
->
prev_cfg3
!=
esp
->
config3
[
sp
->
device
->
id
]))
{
esp
->
prev_soff
=
esp_dev
->
sync_max_offset
;
esp
->
prev_soff
=
esp_dev
->
sync_max_offset
;
esp
->
prev_stp
=
esp_dev
->
sync_min_period
;
esp
->
prev_stp
=
esp_dev
->
sync_min_period
;
sbus_writeb
(
esp
->
prev_soff
,
esp
->
eregs
+
ESP_SOFF
);
sbus_writeb
(
esp
->
prev_soff
,
esp
->
eregs
+
ESP_SOFF
);
sbus_writeb
(
esp
->
prev_stp
,
esp
->
eregs
+
ESP_STP
);
sbus_writeb
(
esp
->
prev_stp
,
esp
->
eregs
+
ESP_STP
);
if
(
esp
->
erev
>
esp100a
)
{
if
(
esp
->
erev
>
esp100a
)
{
esp
->
prev_cfg3
=
esp
->
config3
[
sp
->
target
];
esp
->
prev_cfg3
=
esp
->
config3
[
sp
->
device
->
id
];
sbus_writeb
(
esp
->
prev_cfg3
,
esp
->
eregs
+
ESP_CFG3
);
sbus_writeb
(
esp
->
prev_cfg3
,
esp
->
eregs
+
ESP_CFG3
);
}
}
}
}
...
@@ -2736,7 +2736,7 @@ static int esp_do_data_finale(struct esp *esp)
...
@@ -2736,7 +2736,7 @@ static int esp_do_data_finale(struct esp *esp)
esp
->
esp_id
,
esp
->
esp_id
,
SCptr
->
use_sg
,
SCptr
->
SCp
.
ptr
,
SCptr
->
SCp
.
this_residual
));
SCptr
->
use_sg
,
SCptr
->
SCp
.
ptr
,
SCptr
->
SCp
.
this_residual
));
ESPLOG
((
"esp%d: Forcing async for target %d
\n
"
,
esp
->
esp_id
,
ESPLOG
((
"esp%d: Forcing async for target %d
\n
"
,
esp
->
esp_id
,
SCptr
->
target
));
SCptr
->
device
->
id
));
SCptr
->
device
->
borken
=
1
;
SCptr
->
device
->
borken
=
1
;
esp_dev
->
sync
=
0
;
esp_dev
->
sync
=
0
;
bytes_sent
=
0
;
bytes_sent
=
0
;
...
@@ -2842,7 +2842,7 @@ static int esp_do_freebus(struct esp *esp)
...
@@ -2842,7 +2842,7 @@ static int esp_do_freebus(struct esp *esp)
if
(
SCptr
->
SCp
.
Status
!=
GOOD
&&
if
(
SCptr
->
SCp
.
Status
!=
GOOD
&&
SCptr
->
SCp
.
Status
!=
CONDITION_GOOD
&&
SCptr
->
SCp
.
Status
!=
CONDITION_GOOD
&&
((
1
<<
SCptr
->
target
)
&
esp
->
targets_present
)
&&
((
1
<<
SCptr
->
device
->
id
)
&
esp
->
targets_present
)
&&
esp_dev
->
sync
&&
esp_dev
->
sync
&&
esp_dev
->
sync_max_offset
)
{
esp_dev
->
sync_max_offset
)
{
/* SCSI standard says that the synchronous capabilities
/* SCSI standard says that the synchronous capabilities
...
@@ -2853,7 +2853,7 @@ static int esp_do_freebus(struct esp *esp)
...
@@ -2853,7 +2853,7 @@ static int esp_do_freebus(struct esp *esp)
* state.
* state.
*/
*/
ESPMISC
((
"esp: Status <%d> for target %d lun %d
\n
"
,
ESPMISC
((
"esp: Status <%d> for target %d lun %d
\n
"
,
SCptr
->
SCp
.
Status
,
SCptr
->
target
,
SCptr
->
lun
));
SCptr
->
SCp
.
Status
,
SCptr
->
device
->
id
,
SCptr
->
device
->
lun
));
/* But don't do this when spinning up a disk at
/* But don't do this when spinning up a disk at
* boot time while we poll for completion as it
* boot time while we poll for completion as it
...
@@ -2864,14 +2864,14 @@ static int esp_do_freebus(struct esp *esp)
...
@@ -2864,14 +2864,14 @@ static int esp_do_freebus(struct esp *esp)
if
(
esp_should_clear_sync
(
SCptr
)
!=
0
)
if
(
esp_should_clear_sync
(
SCptr
)
!=
0
)
esp_dev
->
sync
=
0
;
esp_dev
->
sync
=
0
;
}
}
ESPDISC
((
"F<%02x,%02x>"
,
SCptr
->
target
,
SCptr
->
lun
));
ESPDISC
((
"F<%02x,%02x>"
,
SCptr
->
device
->
id
,
SCptr
->
device
->
lun
));
esp_done
(
esp
,
((
SCptr
->
SCp
.
Status
&
0xff
)
|
esp_done
(
esp
,
((
SCptr
->
SCp
.
Status
&
0xff
)
|
((
SCptr
->
SCp
.
Message
&
0xff
)
<<
8
)
|
((
SCptr
->
SCp
.
Message
&
0xff
)
<<
8
)
|
(
DID_OK
<<
16
)));
(
DID_OK
<<
16
)));
}
else
if
(
esp
->
prevmsgin
==
DISCONNECT
)
{
}
else
if
(
esp
->
prevmsgin
==
DISCONNECT
)
{
/* Normal disconnect. */
/* Normal disconnect. */
esp_cmd
(
esp
,
ESP_CMD_ESEL
);
esp_cmd
(
esp
,
ESP_CMD_ESEL
);
ESPDISC
((
"D<%02x,%02x>"
,
SCptr
->
target
,
SCptr
->
lun
));
ESPDISC
((
"D<%02x,%02x>"
,
SCptr
->
device
->
id
,
SCptr
->
device
->
lun
));
append_SC
(
&
esp
->
disconnected_SC
,
SCptr
);
append_SC
(
&
esp
->
disconnected_SC
,
SCptr
);
esp
->
current_SC
=
NULL
;
esp
->
current_SC
=
NULL
;
if
(
esp
->
issue_SC
)
if
(
esp
->
issue_SC
)
...
@@ -2901,21 +2901,21 @@ static int esp_bad_reconnect(struct esp *esp)
...
@@ -2901,21 +2901,21 @@ static int esp_bad_reconnect(struct esp *esp)
sp
=
esp
->
issue_SC
;
sp
=
esp
->
issue_SC
;
ESPLOG
((
"esp%d: issue_SC["
,
esp
->
esp_id
));
ESPLOG
((
"esp%d: issue_SC["
,
esp
->
esp_id
));
while
(
sp
)
{
while
(
sp
)
{
ESPLOG
((
"<%02x,%02x>"
,
sp
->
target
,
sp
->
lun
));
ESPLOG
((
"<%02x,%02x>"
,
sp
->
device
->
id
,
sp
->
device
->
lun
));
sp
=
(
Scsi_Cmnd
*
)
sp
->
host_scribble
;
sp
=
(
Scsi_Cmnd
*
)
sp
->
host_scribble
;
}
}
ESPLOG
((
"]
\n
"
));
ESPLOG
((
"]
\n
"
));
sp
=
esp
->
current_SC
;
sp
=
esp
->
current_SC
;
ESPLOG
((
"esp%d: current_SC["
,
esp
->
esp_id
));
ESPLOG
((
"esp%d: current_SC["
,
esp
->
esp_id
));
if
(
sp
)
if
(
sp
)
ESPLOG
((
"<%02x,%02x>"
,
sp
->
target
,
sp
->
lun
));
ESPLOG
((
"<%02x,%02x>"
,
sp
->
device
->
id
,
sp
->
device
->
lun
));
else
else
ESPLOG
((
"<NULL>"
));
ESPLOG
((
"<NULL>"
));
ESPLOG
((
"]
\n
"
));
ESPLOG
((
"]
\n
"
));
sp
=
esp
->
disconnected_SC
;
sp
=
esp
->
disconnected_SC
;
ESPLOG
((
"esp%d: disconnected_SC["
,
esp
->
esp_id
));
ESPLOG
((
"esp%d: disconnected_SC["
,
esp
->
esp_id
));
while
(
sp
)
{
while
(
sp
)
{
ESPLOG
((
"<%02x,%02x>"
,
sp
->
target
,
sp
->
lun
));
ESPLOG
((
"<%02x,%02x>"
,
sp
->
device
->
id
,
sp
->
device
->
lun
));
sp
=
(
Scsi_Cmnd
*
)
sp
->
host_scribble
;
sp
=
(
Scsi_Cmnd
*
)
sp
->
host_scribble
;
}
}
ESPLOG
((
"]
\n
"
));
ESPLOG
((
"]
\n
"
));
...
@@ -2959,7 +2959,7 @@ static int esp_do_reconnect(struct esp *esp)
...
@@ -2959,7 +2959,7 @@ static int esp_do_reconnect(struct esp *esp)
esp_cmd
(
esp
,
ESP_CMD_MOK
);
esp_cmd
(
esp
,
ESP_CMD_MOK
);
if
(
esp
->
erev
==
fashme
)
if
(
esp
->
erev
==
fashme
)
sbus_writeb
(((
SCptr
->
target
&
0xf
)
|
sbus_writeb
(((
SCptr
->
device
->
id
&
0xf
)
|
(
ESP_BUSID_RESELID
|
ESP_BUSID_CTR32BIT
)),
(
ESP_BUSID_RESELID
|
ESP_BUSID_CTR32BIT
)),
esp
->
eregs
+
ESP_BUSID
);
esp
->
eregs
+
ESP_BUSID
);
...
@@ -3246,7 +3246,7 @@ static int esp_select_complete(struct esp *esp)
...
@@ -3246,7 +3246,7 @@ static int esp_select_complete(struct esp *esp)
*/
*/
if
(
esp
->
ireg
==
(
ESP_INTR_FDONE
|
ESP_INTR_BSERV
))
{
if
(
esp
->
ireg
==
(
ESP_INTR_FDONE
|
ESP_INTR_BSERV
))
{
/* target speaks... */
/* target speaks... */
esp
->
targets_present
|=
(
1
<<
SCptr
->
target
);
esp
->
targets_present
|=
(
1
<<
SCptr
->
device
->
id
);
/* What if the target ignores the sdtr? */
/* What if the target ignores the sdtr? */
if
(
esp
->
snip
)
if
(
esp
->
snip
)
...
@@ -3275,7 +3275,7 @@ static int esp_select_complete(struct esp *esp)
...
@@ -3275,7 +3275,7 @@ static int esp_select_complete(struct esp *esp)
* XXX for synchronous transfers.
* XXX for synchronous transfers.
*/
*/
ESPLOG
((
"esp%d: STEP_ASEL for tgt %d
\n
"
,
ESPLOG
((
"esp%d: STEP_ASEL for tgt %d
\n
"
,
esp
->
esp_id
,
SCptr
->
target
));
esp
->
esp_id
,
SCptr
->
device
->
id
));
case
ESP_STEP_SID
:
case
ESP_STEP_SID
:
/* Arbitration won, target selected, went
/* Arbitration won, target selected, went
...
@@ -3395,7 +3395,7 @@ static int esp_select_complete(struct esp *esp)
...
@@ -3395,7 +3395,7 @@ static int esp_select_complete(struct esp *esp)
if
(
esp
->
disconnected_SC
)
if
(
esp
->
disconnected_SC
)
esp_cmd
(
esp
,
ESP_CMD_ESEL
);
esp_cmd
(
esp
,
ESP_CMD_ESEL
);
if
(((
1
<<
SCptr
->
target
)
&
esp
->
targets_present
)
&&
if
(((
1
<<
SCptr
->
device
->
id
)
&
esp
->
targets_present
)
&&
esp
->
seqreg
!=
0
&&
esp
->
seqreg
!=
0
&&
(
esp
->
cur_msgout
[
0
]
==
EXTENDED_MESSAGE
)
&&
(
esp
->
cur_msgout
[
0
]
==
EXTENDED_MESSAGE
)
&&
(
SCptr
->
SCp
.
phase
==
in_slct_msg
||
(
SCptr
->
SCp
.
phase
==
in_slct_msg
||
...
@@ -3403,7 +3403,7 @@ static int esp_select_complete(struct esp *esp)
...
@@ -3403,7 +3403,7 @@ static int esp_select_complete(struct esp *esp)
/* shit */
/* shit */
esp
->
snip
=
0
;
esp
->
snip
=
0
;
ESPLOG
((
"esp%d: Failed synchronous negotiation for target %d "
ESPLOG
((
"esp%d: Failed synchronous negotiation for target %d "
"lun %d
\n
"
,
esp
->
esp_id
,
SCptr
->
target
,
SCptr
->
lun
));
"lun %d
\n
"
,
esp
->
esp_id
,
SCptr
->
device
->
id
,
SCptr
->
device
->
lun
));
esp_dev
->
sync_max_offset
=
0
;
esp_dev
->
sync_max_offset
=
0
;
esp_dev
->
sync_min_period
=
0
;
esp_dev
->
sync_min_period
=
0
;
esp_dev
->
sync
=
1
;
/* so we don't negotiate again */
esp_dev
->
sync
=
1
;
/* so we don't negotiate again */
...
@@ -3429,9 +3429,9 @@ static int esp_select_complete(struct esp *esp)
...
@@ -3429,9 +3429,9 @@ static int esp_select_complete(struct esp *esp)
* or whenever when we are scanning the bus for targets.
* or whenever when we are scanning the bus for targets.
* But first make sure that is really what is happening.
* But first make sure that is really what is happening.
*/
*/
if
(((
1
<<
SCptr
->
target
)
&
esp
->
targets_present
))
{
if
(((
1
<<
SCptr
->
device
->
id
)
&
esp
->
targets_present
))
{
ESPLOG
((
"esp%d: Warning, live target %d not responding to "
ESPLOG
((
"esp%d: Warning, live target %d not responding to "
"selection.
\n
"
,
esp
->
esp_id
,
SCptr
->
target
));
"selection.
\n
"
,
esp
->
esp_id
,
SCptr
->
device
->
id
));
/* This _CAN_ happen. The SCSI standard states that
/* This _CAN_ happen. The SCSI standard states that
* the target is to _not_ respond to selection if
* the target is to _not_ respond to selection if
...
@@ -3444,7 +3444,7 @@ static int esp_select_complete(struct esp *esp)
...
@@ -3444,7 +3444,7 @@ static int esp_select_complete(struct esp *esp)
/* Else, there really isn't anyone there. */
/* Else, there really isn't anyone there. */
ESPMISC
((
"esp: selection failure, maybe nobody there?
\n
"
));
ESPMISC
((
"esp: selection failure, maybe nobody there?
\n
"
));
ESPMISC
((
"esp: target %d lun %d
\n
"
,
ESPMISC
((
"esp: target %d lun %d
\n
"
,
SCptr
->
target
,
SCptr
->
lun
));
SCptr
->
device
->
id
,
SCptr
->
device
->
lun
));
esp_done
(
esp
,
(
DID_BAD_TARGET
<<
16
));
esp_done
(
esp
,
(
DID_BAD_TARGET
<<
16
));
}
}
return
do_intr_end
;
return
do_intr_end
;
...
@@ -3517,7 +3517,7 @@ static int check_singlebyte_msg(struct esp *esp)
...
@@ -3517,7 +3517,7 @@ static int check_singlebyte_msg(struct esp *esp)
case
NOP
:
case
NOP
:
ESPLOG
((
"esp%d: target %d sends a nop
\n
"
,
esp
->
esp_id
,
ESPLOG
((
"esp%d: target %d sends a nop
\n
"
,
esp
->
esp_id
,
esp
->
current_SC
->
target
));
esp
->
current_SC
->
device
->
id
));
return
0
;
return
0
;
case
RESTORE_POINTERS
:
case
RESTORE_POINTERS
:
...
@@ -3600,7 +3600,7 @@ static void sync_report(struct esp *esp)
...
@@ -3600,7 +3600,7 @@ static void sync_report(struct esp *esp)
int
integer
=
hz
/
1000000
;
int
integer
=
hz
/
1000000
;
int
fraction
=
(
hz
-
(
integer
*
1000000
))
/
10000
;
int
fraction
=
(
hz
-
(
integer
*
1000000
))
/
10000
;
if
((
esp
->
erev
==
fashme
)
&&
if
((
esp
->
erev
==
fashme
)
&&
(
esp
->
config3
[
esp
->
current_SC
->
target
]
&
ESP_CONFIG3_EWIDE
))
{
(
esp
->
config3
[
esp
->
current_SC
->
device
->
id
]
&
ESP_CONFIG3_EWIDE
))
{
type
=
"FAST-WIDE"
;
type
=
"FAST-WIDE"
;
integer
<<=
1
;
integer
<<=
1
;
fraction
<<=
1
;
fraction
<<=
1
;
...
@@ -3615,7 +3615,7 @@ static void sync_report(struct esp *esp)
...
@@ -3615,7 +3615,7 @@ static void sync_report(struct esp *esp)
* sibling call optimization. -DaveM
* sibling call optimization. -DaveM
*/
*/
ESPLOG
((
KERN_INFO
"esp%d: target %d "
,
ESPLOG
((
KERN_INFO
"esp%d: target %d "
,
esp
->
esp_id
,
esp
->
current_SC
->
target
));
esp
->
esp_id
,
esp
->
current_SC
->
device
->
id
));
ESPLOG
((
"[period %dns offset %d %d.%02dMHz "
,
ESPLOG
((
"[period %dns offset %d %d.%02dMHz "
,
(
int
)
msg3
*
4
,
(
int
)
msg4
,
(
int
)
msg3
*
4
,
(
int
)
msg4
,
integer
,
fraction
));
integer
,
fraction
));
...
@@ -3623,7 +3623,7 @@ static void sync_report(struct esp *esp)
...
@@ -3623,7 +3623,7 @@ static void sync_report(struct esp *esp)
(((
msg3
*
4
)
<
200
)
?
"-II"
:
""
)));
(((
msg3
*
4
)
<
200
)
?
"-II"
:
""
)));
}
else
{
}
else
{
ESPLOG
((
KERN_INFO
"esp%d: target %d asynchronous
\n
"
,
ESPLOG
((
KERN_INFO
"esp%d: target %d asynchronous
\n
"
,
esp
->
esp_id
,
esp
->
current_SC
->
target
));
esp
->
esp_id
,
esp
->
current_SC
->
device
->
id
));
}
}
}
}
...
@@ -3707,11 +3707,11 @@ static int check_multibyte_msg(struct esp *esp)
...
@@ -3707,11 +3707,11 @@ static int check_multibyte_msg(struct esp *esp)
*/
*/
if
(
esp
->
erev
==
fashme
)
if
(
esp
->
erev
==
fashme
)
esp_dev
->
sync_max_offset
&=
~
esp
->
radelay
;
esp_dev
->
sync_max_offset
&=
~
esp
->
radelay
;
esp
->
config3
[
SCptr
->
target
]
|=
bit
;
esp
->
config3
[
SCptr
->
device
->
id
]
|=
bit
;
}
else
{
}
else
{
esp
->
config3
[
SCptr
->
target
]
&=
~
bit
;
esp
->
config3
[
SCptr
->
device
->
id
]
&=
~
bit
;
}
}
esp
->
prev_cfg3
=
esp
->
config3
[
SCptr
->
target
];
esp
->
prev_cfg3
=
esp
->
config3
[
SCptr
->
device
->
id
];
sbus_writeb
(
esp
->
prev_cfg3
,
esp
->
eregs
+
ESP_CFG3
);
sbus_writeb
(
esp
->
prev_cfg3
,
esp
->
eregs
+
ESP_CFG3
);
}
}
esp
->
prev_soff
=
esp_dev
->
sync_max_offset
;
esp
->
prev_soff
=
esp_dev
->
sync_max_offset
;
...
@@ -3721,7 +3721,7 @@ static int check_multibyte_msg(struct esp *esp)
...
@@ -3721,7 +3721,7 @@ static int check_multibyte_msg(struct esp *esp)
ESPSDTR
((
"soff=%2x stp=%2x cfg3=%2x
\n
"
,
ESPSDTR
((
"soff=%2x stp=%2x cfg3=%2x
\n
"
,
esp_dev
->
sync_max_offset
,
esp_dev
->
sync_max_offset
,
esp_dev
->
sync_min_period
,
esp_dev
->
sync_min_period
,
esp
->
config3
[
SCptr
->
target
]));
esp
->
config3
[
SCptr
->
device
->
id
]));
esp
->
snip
=
0
;
esp
->
snip
=
0
;
}
else
if
(
esp_dev
->
sync_max_offset
)
{
}
else
if
(
esp_dev
->
sync_max_offset
)
{
...
@@ -3740,8 +3740,8 @@ static int check_multibyte_msg(struct esp *esp)
...
@@ -3740,8 +3740,8 @@ static int check_multibyte_msg(struct esp *esp)
bit
=
ESP_CONFIG3_FAST
;
bit
=
ESP_CONFIG3_FAST
;
else
else
bit
=
ESP_CONFIG3_FSCSI
;
bit
=
ESP_CONFIG3_FSCSI
;
esp
->
config3
[
SCptr
->
target
]
&=
~
bit
;
esp
->
config3
[
SCptr
->
device
->
id
]
&=
~
bit
;
esp
->
prev_cfg3
=
esp
->
config3
[
SCptr
->
target
];
esp
->
prev_cfg3
=
esp
->
config3
[
SCptr
->
device
->
id
];
sbus_writeb
(
esp
->
prev_cfg3
,
esp
->
eregs
+
ESP_CFG3
);
sbus_writeb
(
esp
->
prev_cfg3
,
esp
->
eregs
+
ESP_CFG3
);
}
}
}
}
...
@@ -3778,7 +3778,7 @@ static int check_multibyte_msg(struct esp *esp)
...
@@ -3778,7 +3778,7 @@ static int check_multibyte_msg(struct esp *esp)
/* Things look good; let's see what we got. */
/* Things look good; let's see what we got. */
if
(
size
==
16
)
{
if
(
size
==
16
)
{
/* Set config 3 register for this target. */
/* Set config 3 register for this target. */
esp
->
config3
[
SCptr
->
target
]
|=
ESP_CONFIG3_EWIDE
;
esp
->
config3
[
SCptr
->
device
->
id
]
|=
ESP_CONFIG3_EWIDE
;
}
else
{
}
else
{
/* Just make sure it was one byte sized. */
/* Just make sure it was one byte sized. */
if
(
size
!=
8
)
{
if
(
size
!=
8
)
{
...
@@ -3788,9 +3788,9 @@ static int check_multibyte_msg(struct esp *esp)
...
@@ -3788,9 +3788,9 @@ static int check_multibyte_msg(struct esp *esp)
goto
finish
;
goto
finish
;
}
}
/* Pure paranoia. */
/* Pure paranoia. */
esp
->
config3
[
SCptr
->
target
]
&=
~
(
ESP_CONFIG3_EWIDE
);
esp
->
config3
[
SCptr
->
device
->
id
]
&=
~
(
ESP_CONFIG3_EWIDE
);
}
}
esp
->
prev_cfg3
=
esp
->
config3
[
SCptr
->
target
];
esp
->
prev_cfg3
=
esp
->
config3
[
SCptr
->
device
->
id
];
sbus_writeb
(
esp
->
prev_cfg3
,
esp
->
eregs
+
ESP_CFG3
);
sbus_writeb
(
esp
->
prev_cfg3
,
esp
->
eregs
+
ESP_CFG3
);
/* Regardless, next try for sync transfers. */
/* Regardless, next try for sync transfers. */
...
@@ -4258,7 +4258,7 @@ static void esp_handle(struct esp *esp)
...
@@ -4258,7 +4258,7 @@ static void esp_handle(struct esp *esp)
* a nexus is alive on the bus.
* a nexus is alive on the bus.
*/
*/
ESPLOG
((
"esp%d: Forcing async and disabling disconnect for "
ESPLOG
((
"esp%d: Forcing async and disabling disconnect for "
"target %d
\n
"
,
esp
->
esp_id
,
SCptr
->
target
));
"target %d
\n
"
,
esp
->
esp_id
,
SCptr
->
device
->
id
));
SCptr
->
device
->
borken
=
1
;
/* foo on you */
SCptr
->
device
->
borken
=
1
;
/* foo on you */
}
}
...
...
drivers/scsi/fcal.c
View file @
00492e8c
...
@@ -292,11 +292,12 @@ static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmn
...
@@ -292,11 +292,12 @@ static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmn
if
(
SCpnt
->
cmnd
[
1
]
&
0xe0
)
return
-
EINVAL
;
if
(
SCpnt
->
cmnd
[
1
]
&
0xe0
)
return
-
EINVAL
;
/* FC-PLDA tells us... */
/* FC-PLDA tells us... */
memset
(
addr
,
0
,
8
);
memset
(
addr
,
0
,
8
);
f
=
(
struct
fcal
*
)
SCpnt
->
host
->
hostdata
;
f
=
(
struct
fcal
*
)
SCpnt
->
device
->
host
->
hostdata
;
if
(
!
f
->
map
[
SCpnt
->
target
])
return
-
EINVAL
;
if
(
!
f
->
map
[
SCpnt
->
device
->
id
])
return
-
EINVAL
;
/* Now, determine DID: It will be Native Identifier, so we zero upper
/* Now, determine DID: It will be Native Identifier, so we zero upper
2 bytes of the 3 byte DID, lowest byte will be AL-PA */
2 bytes of the 3 byte DID, lowest byte will be AL-PA */
fcmd
->
did
=
target2alpa
[
SCpnt
->
target
];
fcmd
->
did
=
target2alpa
[
SCpnt
->
device
->
id
];
FCALD
((
"trying DID %06x
\n
"
,
fcmd
->
did
))
FCALD
((
"trying DID %06x
\n
"
,
fcmd
->
did
))
return
0
;
return
0
;
}
}
...
...
drivers/scsi/pluto.c
View file @
00492e8c
...
@@ -156,12 +156,12 @@ int __init pluto_detect(Scsi_Host_Template *tpnt)
...
@@ -156,12 +156,12 @@ int __init pluto_detect(Scsi_Host_Template *tpnt)
pluto
->
fc
=
fc
;
pluto
->
fc
=
fc
;
SCpnt
->
host
=
host
;
SCpnt
->
cmnd
[
0
]
=
INQUIRY
;
SCpnt
->
cmnd
[
0
]
=
INQUIRY
;
SCpnt
->
cmnd
[
4
]
=
255
;
SCpnt
->
cmnd
[
4
]
=
255
;
/* FC layer requires this, so that SCpnt->device->tagged_supported is initially 0 */
/* FC layer requires this, so that SCpnt->device->tagged_supported is initially 0 */
SCpnt
->
device
=
&
dev
;
SCpnt
->
device
=
&
dev
;
dev
.
host
=
host
;
SCpnt
->
cmd_len
=
COMMAND_SIZE
(
INQUIRY
);
SCpnt
->
cmd_len
=
COMMAND_SIZE
(
INQUIRY
);
...
@@ -325,16 +325,18 @@ const char *pluto_info(struct Scsi_Host *host)
...
@@ -325,16 +325,18 @@ const char *pluto_info(struct Scsi_Host *host)
*/
*/
static
int
pluto_encode_addr
(
Scsi_Cmnd
*
SCpnt
,
u16
*
addr
,
fc_channel
*
fc
,
fcp_cmnd
*
fcmd
)
static
int
pluto_encode_addr
(
Scsi_Cmnd
*
SCpnt
,
u16
*
addr
,
fc_channel
*
fc
,
fcp_cmnd
*
fcmd
)
{
{
PLND
((
"encode addr %d %d %d
\n
"
,
SCpnt
->
channel
,
SCpnt
->
target
,
SCpnt
->
cmnd
[
1
]
&
0xe0
))
PLND
((
"encode addr %d %d %d
\n
"
,
SCpnt
->
device
->
channel
,
SCpnt
->
device
->
id
,
SCpnt
->
cmnd
[
1
]
&
0xe0
))
/* We don't support LUNs - neither does SSA :) */
/* We don't support LUNs - neither does SSA :) */
if
(
SCpnt
->
cmnd
[
1
]
&
0xe0
)
return
-
EINVAL
;
if
(
SCpnt
->
cmnd
[
1
]
&
0xe0
)
if
(
!
SCpnt
->
channel
)
{
return
-
EINVAL
;
if
(
SCpnt
->
target
)
return
-
EINVAL
;
if
(
!
SCpnt
->
device
->
channel
)
{
if
(
SCpnt
->
device
->
id
)
return
-
EINVAL
;
memset
(
addr
,
0
,
4
*
sizeof
(
u16
));
memset
(
addr
,
0
,
4
*
sizeof
(
u16
));
}
else
{
}
else
{
addr
[
0
]
=
1
;
addr
[
0
]
=
1
;
addr
[
1
]
=
SCpnt
->
channel
-
1
;
addr
[
1
]
=
SCpnt
->
device
->
channel
-
1
;
addr
[
2
]
=
SCpnt
->
target
;
addr
[
2
]
=
SCpnt
->
device
->
id
;
addr
[
3
]
=
0
;
addr
[
3
]
=
0
;
}
}
/* We're Point-to-Point, so target it to the default DID */
/* We're Point-to-Point, so target it to the default DID */
...
...
drivers/scsi/qlogicpti.c
View file @
00492e8c
...
@@ -1004,16 +1004,16 @@ static inline void cmd_frob(struct Command_Entry *cmd, Scsi_Cmnd *Cmnd,
...
@@ -1004,16 +1004,16 @@ static inline void cmd_frob(struct Command_Entry *cmd, Scsi_Cmnd *Cmnd,
memset
(
cmd
,
0
,
sizeof
(
struct
Command_Entry
));
memset
(
cmd
,
0
,
sizeof
(
struct
Command_Entry
));
cmd
->
hdr
.
entry_cnt
=
1
;
cmd
->
hdr
.
entry_cnt
=
1
;
cmd
->
hdr
.
entry_type
=
ENTRY_COMMAND
;
cmd
->
hdr
.
entry_type
=
ENTRY_COMMAND
;
cmd
->
target_id
=
Cmnd
->
target
;
cmd
->
target_id
=
Cmnd
->
device
->
id
;
cmd
->
target_lun
=
Cmnd
->
lun
;
cmd
->
target_lun
=
Cmnd
->
device
->
lun
;
cmd
->
cdb_length
=
Cmnd
->
cmd_len
;
cmd
->
cdb_length
=
Cmnd
->
cmd_len
;
cmd
->
control_flags
=
0
;
cmd
->
control_flags
=
0
;
if
(
Cmnd
->
device
->
tagged_supported
)
{
if
(
Cmnd
->
device
->
tagged_supported
)
{
if
(
qpti
->
cmd_count
[
Cmnd
->
target
]
==
0
)
if
(
qpti
->
cmd_count
[
Cmnd
->
device
->
id
]
==
0
)
qpti
->
tag_ages
[
Cmnd
->
target
]
=
jiffies
;
qpti
->
tag_ages
[
Cmnd
->
device
->
id
]
=
jiffies
;
if
((
jiffies
-
qpti
->
tag_ages
[
Cmnd
->
target
])
>
(
5
*
HZ
))
{
if
((
jiffies
-
qpti
->
tag_ages
[
Cmnd
->
device
->
id
])
>
(
5
*
HZ
))
{
cmd
->
control_flags
=
CFLAG_ORDERED_TAG
;
cmd
->
control_flags
=
CFLAG_ORDERED_TAG
;
qpti
->
tag_ages
[
Cmnd
->
target
]
=
jiffies
;
qpti
->
tag_ages
[
Cmnd
->
device
->
id
]
=
jiffies
;
}
else
}
else
cmd
->
control_flags
=
CFLAG_SIMPLE_TAG
;
cmd
->
control_flags
=
CFLAG_SIMPLE_TAG
;
}
}
...
@@ -1097,7 +1097,7 @@ static inline int load_cmd(Scsi_Cmnd *Cmnd, struct Command_Entry *cmd,
...
@@ -1097,7 +1097,7 @@ static inline int load_cmd(Scsi_Cmnd *Cmnd, struct Command_Entry *cmd,
cmd
->
handle
=
in_ptr
;
cmd
->
handle
=
in_ptr
;
qpti
->
cmd_slots
[
in_ptr
]
=
Cmnd
;
qpti
->
cmd_slots
[
in_ptr
]
=
Cmnd
;
qpti
->
cmd_count
[
Cmnd
->
target
]
++
;
qpti
->
cmd_count
[
Cmnd
->
device
->
id
]
++
;
sbus_writew
(
in_ptr
,
qpti
->
qregs
+
MBOX4
);
sbus_writew
(
in_ptr
,
qpti
->
qregs
+
MBOX4
);
qpti
->
req_in_ptr
=
in_ptr
;
qpti
->
req_in_ptr
=
in_ptr
;
...
@@ -1118,8 +1118,8 @@ static inline void update_can_queue(struct Scsi_Host *host, u_int in_ptr, u_int
...
@@ -1118,8 +1118,8 @@ static inline void update_can_queue(struct Scsi_Host *host, u_int in_ptr, u_int
*/
*/
static
void
ourdone
(
Scsi_Cmnd
*
Cmnd
)
static
void
ourdone
(
Scsi_Cmnd
*
Cmnd
)
{
{
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
Cmnd
->
host
->
hostdata
;
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
Cmnd
->
device
->
host
->
hostdata
;
int
tgt
=
Cmnd
->
target
;
int
tgt
=
Cmnd
->
device
->
id
;
void
(
*
done
)
(
Scsi_Cmnd
*
);
void
(
*
done
)
(
Scsi_Cmnd
*
);
/* This grot added by DaveM, blame him for ugliness.
/* This grot added by DaveM, blame him for ugliness.
...
@@ -1170,7 +1170,7 @@ static int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *));
...
@@ -1170,7 +1170,7 @@ static int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *));
static
int
qlogicpti_queuecommand_slow
(
Scsi_Cmnd
*
Cmnd
,
static
int
qlogicpti_queuecommand_slow
(
Scsi_Cmnd
*
Cmnd
,
void
(
*
done
)(
Scsi_Cmnd
*
))
void
(
*
done
)(
Scsi_Cmnd
*
))
{
{
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
Cmnd
->
host
->
hostdata
;
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
Cmnd
->
device
->
host
->
hostdata
;
unsigned
long
flags
;
unsigned
long
flags
;
/*
/*
...
@@ -1229,7 +1229,7 @@ static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
...
@@ -1229,7 +1229,7 @@ static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
* and can rock on..
* and can rock on..
*/
*/
if
(
qpti
==
NULL
)
if
(
qpti
==
NULL
)
Cmnd
->
host
->
hostt
->
queuecommand
=
qlogicpti_queuecommand
;
Cmnd
->
device
->
host
->
hostt
->
queuecommand
=
qlogicpti_queuecommand
;
spin_unlock_irqrestore
(
&
qpti
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
qpti
->
lock
,
flags
);
...
@@ -1246,7 +1246,7 @@ static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
...
@@ -1246,7 +1246,7 @@ static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
*/
*/
static
int
qlogicpti_queuecommand
(
Scsi_Cmnd
*
Cmnd
,
void
(
*
done
)(
Scsi_Cmnd
*
))
static
int
qlogicpti_queuecommand
(
Scsi_Cmnd
*
Cmnd
,
void
(
*
done
)(
Scsi_Cmnd
*
))
{
{
struct
Scsi_Host
*
host
=
Cmnd
->
host
;
struct
Scsi_Host
*
host
=
Cmnd
->
device
->
host
;
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
host
->
hostdata
;
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
host
->
hostdata
;
struct
Command_Entry
*
cmd
;
struct
Command_Entry
*
cmd
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -1431,7 +1431,7 @@ static Scsi_Cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
...
@@ -1431,7 +1431,7 @@ static Scsi_Cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
Cmnd
->
request_bufflen
,
Cmnd
->
request_bufflen
,
scsi_to_sbus_dma_dir
(
Cmnd
->
sc_data_direction
));
scsi_to_sbus_dma_dir
(
Cmnd
->
sc_data_direction
));
}
}
qpti
->
cmd_count
[
Cmnd
->
target
]
--
;
qpti
->
cmd_count
[
Cmnd
->
device
->
id
]
--
;
sbus_writew
(
out_ptr
,
qpti
->
qregs
+
MBOX5
);
sbus_writew
(
out_ptr
,
qpti
->
qregs
+
MBOX5
);
Cmnd
->
host_scribble
=
(
unsigned
char
*
)
done_queue
;
Cmnd
->
host_scribble
=
(
unsigned
char
*
)
done_queue
;
done_queue
=
Cmnd
;
done_queue
=
Cmnd
;
...
@@ -1468,7 +1468,7 @@ static void qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -1468,7 +1468,7 @@ static void qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
static
int
qlogicpti_abort
(
Scsi_Cmnd
*
Cmnd
)
static
int
qlogicpti_abort
(
Scsi_Cmnd
*
Cmnd
)
{
{
u_short
param
[
6
];
u_short
param
[
6
];
struct
Scsi_Host
*
host
=
Cmnd
->
host
;
struct
Scsi_Host
*
host
=
Cmnd
->
device
->
host
;
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
host
->
hostdata
;
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
host
->
hostdata
;
int
return_status
=
SUCCESS
;
int
return_status
=
SUCCESS
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -1476,7 +1476,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
...
@@ -1476,7 +1476,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
int
i
;
int
i
;
printk
(
KERN_WARNING
"qlogicpti : Aborting cmd for tgt[%d] lun[%d]
\n
"
,
printk
(
KERN_WARNING
"qlogicpti : Aborting cmd for tgt[%d] lun[%d]
\n
"
,
(
int
)
Cmnd
->
target
,
(
int
)
Cmnd
->
lun
);
(
int
)
Cmnd
->
device
->
id
,
(
int
)
Cmnd
->
device
->
lun
);
spin_lock_irqsave
(
&
qpti
->
lock
,
flags
);
spin_lock_irqsave
(
&
qpti
->
lock
,
flags
);
...
@@ -1491,7 +1491,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
...
@@ -1491,7 +1491,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
cmd_cookie
=
i
;
cmd_cookie
=
i
;
param
[
0
]
=
MBOX_ABORT
;
param
[
0
]
=
MBOX_ABORT
;
param
[
1
]
=
(((
u_short
)
Cmnd
->
target
)
<<
8
)
|
Cmnd
->
lun
;
param
[
1
]
=
(((
u_short
)
Cmnd
->
device
->
id
)
<<
8
)
|
Cmnd
->
device
->
lun
;
param
[
2
]
=
cmd_cookie
>>
16
;
param
[
2
]
=
cmd_cookie
>>
16
;
param
[
3
]
=
cmd_cookie
&
0xffff
;
param
[
3
]
=
cmd_cookie
&
0xffff
;
if
(
qlogicpti_mbox_command
(
qpti
,
param
,
0
)
||
if
(
qlogicpti_mbox_command
(
qpti
,
param
,
0
)
||
...
@@ -1510,7 +1510,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
...
@@ -1510,7 +1510,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
static
int
qlogicpti_reset
(
Scsi_Cmnd
*
Cmnd
)
static
int
qlogicpti_reset
(
Scsi_Cmnd
*
Cmnd
)
{
{
u_short
param
[
6
];
u_short
param
[
6
];
struct
Scsi_Host
*
host
=
Cmnd
->
host
;
struct
Scsi_Host
*
host
=
Cmnd
->
device
->
host
;
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
host
->
hostdata
;
struct
qlogicpti
*
qpti
=
(
struct
qlogicpti
*
)
host
->
hostdata
;
int
return_status
=
SUCCESS
;
int
return_status
=
SUCCESS
;
unsigned
long
flags
;
unsigned
long
flags
;
...
...
include/asm-sparc/delay.h
View file @
00492e8c
...
@@ -21,5 +21,6 @@ extern __inline__ void __delay(unsigned long loops)
...
@@ -21,5 +21,6 @@ extern __inline__ void __delay(unsigned long loops)
/* This is too messy with inline asm on the Sparc. */
/* This is too messy with inline asm on the Sparc. */
extern
void
udelay
(
unsigned
long
usecs
);
extern
void
udelay
(
unsigned
long
usecs
);
extern
void
ndelay
(
unsigned
long
usecs
);
#endif
/* defined(__SPARC_DELAY_H) */
#endif
/* defined(__SPARC_DELAY_H) */
include/asm-sparc64/delay.h
View file @
00492e8c
...
@@ -45,6 +45,19 @@ static __inline__ void __udelay(unsigned long usecs, unsigned long lps)
...
@@ -45,6 +45,19 @@ static __inline__ void __udelay(unsigned long usecs, unsigned long lps)
__delay
(
usecs
*
HZ
);
__delay
(
usecs
*
HZ
);
}
}
extern
__inline__
void
__ndelay
(
unsigned
long
usecs
,
unsigned
long
lps
)
{
usecs
*=
0x0000000000000005UL
;
/* 2**32 / 10000 */
__asm__
__volatile__
(
" mulx %1, %2, %0
\n
"
" srlx %0, 32, %0
\n
"
:
"=r"
(
usecs
)
:
"r"
(
usecs
),
"r"
(
lps
));
__delay
(
usecs
*
HZ
);
}
#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
#define __udelay_val cpu_data[smp_processor_id()].udelay_val
#define __udelay_val cpu_data[smp_processor_id()].udelay_val
#else
#else
...
@@ -52,6 +65,7 @@ static __inline__ void __udelay(unsigned long usecs, unsigned long lps)
...
@@ -52,6 +65,7 @@ static __inline__ void __udelay(unsigned long usecs, unsigned long lps)
#endif
#endif
#define udelay(usecs) __udelay((usecs),__udelay_val)
#define udelay(usecs) __udelay((usecs),__udelay_val)
#define ndelay(usecs) __ndelay((usecs),__udelay_val)
#endif
/* !__ASSEMBLY__ */
#endif
/* !__ASSEMBLY__ */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment