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
Kirill Smelkov
linux
Commits
0b13c1f5
Commit
0b13c1f5
authored
Oct 11, 2002
by
Doug Ledford
Committed by
Linus Torvalds
Oct 11, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Updates for the scsi.h removal of device specific data from struct scsi_device
parent
30f7395a
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
90 deletions
+128
-90
drivers/scsi/NCR53C9x.c
drivers/scsi/NCR53C9x.c
+16
-16
drivers/scsi/NCR53C9x.h
drivers/scsi/NCR53C9x.h
+1
-1
drivers/scsi/esp.c
drivers/scsi/esp.c
+97
-70
drivers/scsi/esp.h
drivers/scsi/esp.h
+14
-3
No files found.
drivers/scsi/NCR53C9x.c
View file @
0b13c1f5
...
@@ -869,7 +869,7 @@ static int esp_host_info(struct NCR_ESP *esp, char *ptr, off_t offset, int len)
...
@@ -869,7 +869,7 @@ static int esp_host_info(struct NCR_ESP *esp, char *ptr, off_t offset, int len)
for
(
i
=
0
;
i
<
15
;
i
++
)
{
for
(
i
=
0
;
i
<
15
;
i
++
)
{
if
(
esp
->
targets_present
&
(
1
<<
i
))
{
if
(
esp
->
targets_present
&
(
1
<<
i
))
{
Scsi_Device
*
SDptr
=
esp
->
ehost
->
host_queue
;
Scsi_Device
*
SDptr
=
esp
->
ehost
->
host_queue
;
struct
ESP
_device
*
esp_dev
;
struct
esp
_device
*
esp_dev
;
while
((
SDptr
->
host
!=
esp
->
ehost
)
&&
while
((
SDptr
->
host
!=
esp
->
ehost
)
&&
(
SDptr
->
id
!=
i
)
&&
(
SDptr
->
id
!=
i
)
&&
...
@@ -1014,7 +1014,7 @@ static inline void build_sync_nego_msg(struct NCR_ESP *esp, int period, int offs
...
@@ -1014,7 +1014,7 @@ static inline void build_sync_nego_msg(struct NCR_ESP *esp, int period, int offs
static
void
esp_exec_cmd
(
struct
NCR_ESP
*
esp
)
static
void
esp_exec_cmd
(
struct
NCR_ESP
*
esp
)
{
{
struct
ESP_regs
*
eregs
=
esp
->
eregs
;
struct
ESP_regs
*
eregs
=
esp
->
eregs
;
struct
ESP
_device
*
esp_dev
;
struct
esp
_device
*
esp_dev
;
Scsi_Cmnd
*
SCptr
;
Scsi_Cmnd
*
SCptr
;
Scsi_Device
*
SDptr
;
Scsi_Device
*
SDptr
;
volatile
unchar
*
cmdp
=
esp
->
esp_command
;
volatile
unchar
*
cmdp
=
esp
->
esp_command
;
...
@@ -1043,18 +1043,18 @@ static void esp_exec_cmd(struct NCR_ESP *esp)
...
@@ -1043,18 +1043,18 @@ static void esp_exec_cmd(struct NCR_ESP *esp)
/*
/*
* If esp_dev == NULL then we need to allocate a struct for our data
* If esp_dev == NULL then we need to allocate a struct for our data
*/
*/
if
(
esp_dev
==
NULL
)
{
if
(
!
esp_dev
)
{
esp_dev
=
kmalloc
(
sizeof
(
struct
ESP
_device
),
GFP_ATOMIC
);
esp_dev
=
kmalloc
(
sizeof
(
struct
esp
_device
),
GFP_ATOMIC
);
if
(
esp_dev
==
NULL
)
{
if
(
!
esp_dev
)
{
/* We're SOL. Print a message and bail */
/* We're SOL. Print a message and bail */
printk
(
KERN_WARNING
"esp: no mem for
ESP
_device %d/%d
\n
"
,
printk
(
KERN_WARNING
"esp: no mem for
esp
_device %d/%d
\n
"
,
target
,
lun
);
target
,
lun
);
esp
->
current_SC
=
NULL
;
esp
->
current_SC
=
NULL
;
SCptr
->
result
=
DID_ERROR
<<
16
;
SCptr
->
result
=
DID_ERROR
<<
16
;
SCptr
->
done
(
SCptr
);
SCptr
->
done
(
SCptr
);
return
;
return
;
}
}
memset
(
esp_dev
,
0
,
sizeof
(
struct
ESP
_device
));
memset
(
esp_dev
,
0
,
sizeof
(
struct
esp
_device
));
SDptr
->
hostdata
=
esp_dev
;
SDptr
->
hostdata
=
esp_dev
;
}
}
...
@@ -1720,7 +1720,7 @@ static inline void esp_connect(struct NCR_ESP *esp, struct ESP_regs *eregs,
...
@@ -1720,7 +1720,7 @@ static inline void esp_connect(struct NCR_ESP *esp, struct ESP_regs *eregs,
Scsi_Cmnd
*
sp
)
Scsi_Cmnd
*
sp
)
{
{
Scsi_Device
*
dp
=
sp
->
device
;
Scsi_Device
*
dp
=
sp
->
device
;
struct
ESP
_device
*
esp_dev
=
dp
->
hostdata
;
struct
esp
_device
*
esp_dev
=
dp
->
hostdata
;
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
||
...
@@ -2007,7 +2007,7 @@ static int esp_do_data_finale(struct NCR_ESP *esp,
...
@@ -2007,7 +2007,7 @@ static int esp_do_data_finale(struct NCR_ESP *esp,
struct
ESP_regs
*
eregs
)
struct
ESP_regs
*
eregs
)
{
{
Scsi_Cmnd
*
SCptr
=
esp
->
current_SC
;
Scsi_Cmnd
*
SCptr
=
esp
->
current_SC
;
struct
ESP
_device
*
esp_dev
=
SCptr
->
device
->
hostdata
;
struct
esp
_device
*
esp_dev
=
SCptr
->
device
->
hostdata
;
int
bogus_data
=
0
,
bytes_sent
=
0
,
fifocnt
,
ecount
=
0
;
int
bogus_data
=
0
,
bytes_sent
=
0
,
fifocnt
,
ecount
=
0
;
if
(
esp
->
dma_led_off
)
if
(
esp
->
dma_led_off
)
...
@@ -2228,7 +2228,7 @@ static int esp_do_freebus(struct NCR_ESP *esp, struct ESP_regs *eregs)
...
@@ -2228,7 +2228,7 @@ static int esp_do_freebus(struct NCR_ESP *esp, struct ESP_regs *eregs)
esp
->
msgout_len
=
0
;
esp
->
msgout_len
=
0
;
esp
->
prevmsgout
=
NOP
;
esp
->
prevmsgout
=
NOP
;
if
(
esp
->
prevmsgin
==
COMMAND_COMPLETE
)
{
if
(
esp
->
prevmsgin
==
COMMAND_COMPLETE
)
{
struct
ESP
_device
*
esp_dev
=
SCptr
->
device
->
hostdata
;
struct
esp
_device
*
esp_dev
=
SCptr
->
device
->
hostdata
;
/* Normal end of nexus. */
/* Normal end of nexus. */
if
(
esp
->
disconnected_SC
)
if
(
esp
->
disconnected_SC
)
esp_cmd
(
esp
,
eregs
,
ESP_CMD_ESEL
);
esp_cmd
(
esp
,
eregs
,
ESP_CMD_ESEL
);
...
@@ -2503,7 +2503,7 @@ static int esp_disconnect_amidst_phases(struct NCR_ESP *esp,
...
@@ -2503,7 +2503,7 @@ static int esp_disconnect_amidst_phases(struct NCR_ESP *esp,
struct
ESP_regs
*
eregs
)
struct
ESP_regs
*
eregs
)
{
{
Scsi_Cmnd
*
sp
=
esp
->
current_SC
;
Scsi_Cmnd
*
sp
=
esp
->
current_SC
;
struct
ESP
_device
*
esp_dev
=
sp
->
device
->
hostdata
;
struct
esp
_device
*
esp_dev
=
sp
->
device
->
hostdata
;
/* This means real problems if we see this
/* This means real problems if we see this
* here. Unless we were actually trying
* here. Unless we were actually trying
...
@@ -2602,7 +2602,7 @@ static int esp_do_phase_determine(struct NCR_ESP *esp,
...
@@ -2602,7 +2602,7 @@ static int esp_do_phase_determine(struct NCR_ESP *esp,
static
int
esp_select_complete
(
struct
NCR_ESP
*
esp
,
struct
ESP_regs
*
eregs
)
static
int
esp_select_complete
(
struct
NCR_ESP
*
esp
,
struct
ESP_regs
*
eregs
)
{
{
Scsi_Cmnd
*
SCptr
=
esp
->
current_SC
;
Scsi_Cmnd
*
SCptr
=
esp
->
current_SC
;
struct
ESP
_device
*
esp_dev
=
SCptr
->
device
->
hostdata
;
struct
esp
_device
*
esp_dev
=
SCptr
->
device
->
hostdata
;
int
cmd_bytes_sent
,
fcnt
;
int
cmd_bytes_sent
,
fcnt
;
fcnt
=
(
esp_read
(
eregs
->
esp_fflags
)
&
ESP_FF_FBYTES
);
fcnt
=
(
esp_read
(
eregs
->
esp_fflags
)
&
ESP_FF_FBYTES
);
...
@@ -2931,7 +2931,7 @@ static int check_singlebyte_msg(struct NCR_ESP *esp,
...
@@ -2931,7 +2931,7 @@ static int check_singlebyte_msg(struct NCR_ESP *esp,
case
MESSAGE_REJECT
:
case
MESSAGE_REJECT
:
ESPMISC
((
"msg reject, "
));
ESPMISC
((
"msg reject, "
));
if
(
esp
->
prevmsgout
==
EXTENDED_MESSAGE
)
{
if
(
esp
->
prevmsgout
==
EXTENDED_MESSAGE
)
{
struct
ESP
_device
*
esp_dev
=
esp
->
current_SC
->
device
->
hostdata
;
struct
esp
_device
*
esp_dev
=
esp
->
current_SC
->
device
->
hostdata
;
/* Doesn't look like this target can
/* Doesn't look like this target can
* do synchronous or WIDE transfers.
* do synchronous or WIDE transfers.
...
@@ -2956,7 +2956,7 @@ static int check_singlebyte_msg(struct NCR_ESP *esp,
...
@@ -2956,7 +2956,7 @@ static int check_singlebyte_msg(struct NCR_ESP *esp,
*/
*/
static
int
target_with_ants_in_pants
(
struct
NCR_ESP
*
esp
,
static
int
target_with_ants_in_pants
(
struct
NCR_ESP
*
esp
,
Scsi_Cmnd
*
SCptr
,
Scsi_Cmnd
*
SCptr
,
struct
ESP
_device
*
esp_dev
)
struct
esp
_device
*
esp_dev
)
{
{
if
(
esp_dev
->
sync
||
SCptr
->
device
->
borken
)
{
if
(
esp_dev
->
sync
||
SCptr
->
device
->
borken
)
{
/* sorry, no can do */
/* sorry, no can do */
...
@@ -3011,7 +3011,7 @@ static int check_multibyte_msg(struct NCR_ESP *esp,
...
@@ -3011,7 +3011,7 @@ static int check_multibyte_msg(struct NCR_ESP *esp,
struct
ESP_regs
*
eregs
)
struct
ESP_regs
*
eregs
)
{
{
Scsi_Cmnd
*
SCptr
=
esp
->
current_SC
;
Scsi_Cmnd
*
SCptr
=
esp
->
current_SC
;
struct
ESP
_device
*
esp_dev
=
SCptr
->
device
->
hostdata
;
struct
esp
_device
*
esp_dev
=
SCptr
->
device
->
hostdata
;
unchar
regval
=
0
;
unchar
regval
=
0
;
int
message_out
=
0
;
int
message_out
=
0
;
...
@@ -3345,7 +3345,7 @@ static int esp_do_msgoutdone(struct NCR_ESP *esp,
...
@@ -3345,7 +3345,7 @@ static int esp_do_msgoutdone(struct NCR_ESP *esp,
default:
default:
if
(
!
fcount
(
esp
,
eregs
)
&&
if
(
!
fcount
(
esp
,
eregs
)
&&
!
(((
struct
ESP
_device
*
)
esp
->
current_SC
->
device
->
hostdata
)
->
sync_max_offset
))
!
(((
struct
esp
_device
*
)
esp
->
current_SC
->
device
->
hostdata
)
->
sync_max_offset
))
esp_cmd
(
esp
,
eregs
,
ESP_CMD_FLUSH
);
esp_cmd
(
esp
,
eregs
,
ESP_CMD_FLUSH
);
break
;
break
;
...
...
drivers/scsi/NCR53C9x.h
View file @
0b13c1f5
...
@@ -286,7 +286,7 @@ enum esp_rev {
...
@@ -286,7 +286,7 @@ enum esp_rev {
/* We allocate one of these for each scsi device and attach it to
/* We allocate one of these for each scsi device and attach it to
* SDptr->hostdata for use in the driver
* SDptr->hostdata for use in the driver
*/
*/
struct
ESP
_device
{
struct
esp
_device
{
unsigned
char
sync_min_period
;
unsigned
char
sync_min_period
;
unsigned
char
sync_max_offset
;
unsigned
char
sync_max_offset
;
unsigned
sync
:
1
;
unsigned
sync
:
1
;
...
...
drivers/scsi/esp.c
View file @
0b13c1f5
This diff is collapsed.
Click to expand it.
drivers/scsi/esp.h
View file @
0b13c1f5
...
@@ -64,6 +64,17 @@ enum esp_rev {
...
@@ -64,6 +64,17 @@ enum esp_rev {
espunknown
=
0x07
espunknown
=
0x07
};
};
/* We allocate one of these for each scsi device and attach it to
* SDptr->hostdata for use in the driver
*/
struct
esp_device
{
unsigned
char
sync_min_period
;
unsigned
char
sync_max_offset
;
unsigned
sync
:
1
;
unsigned
wide
:
1
;
unsigned
disconnect
:
1
;
};
/* We get one of these for each ESP probed. */
/* We get one of these for each ESP probed. */
struct
esp
{
struct
esp
{
unsigned
long
eregs
;
/* ESP controller registers */
unsigned
long
eregs
;
/* ESP controller registers */
...
@@ -399,7 +410,7 @@ extern int esp_abort(Scsi_Cmnd *);
...
@@ -399,7 +410,7 @@ extern int esp_abort(Scsi_Cmnd *);
extern
int
esp_reset
(
Scsi_Cmnd
*
,
unsigned
int
);
extern
int
esp_reset
(
Scsi_Cmnd
*
,
unsigned
int
);
extern
int
esp_proc_info
(
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
,
extern
int
esp_proc_info
(
char
*
buffer
,
char
**
start
,
off_t
offset
,
int
length
,
int
hostno
,
int
inout
);
int
hostno
,
int
inout
);
extern
int
esp_revoke
(
Scsi_Device
*
SDptr
);
extern
void
esp_slave_detach
(
Scsi_Device
*
SDptr
);
#ifdef CONFIG_SPARC64
#ifdef CONFIG_SPARC64
#define SCSI_SPARC_ESP { \
#define SCSI_SPARC_ESP { \
...
@@ -407,7 +418,7 @@ extern int esp_revoke(Scsi_Device* SDptr);
...
@@ -407,7 +418,7 @@ extern int esp_revoke(Scsi_Device* SDptr);
proc_info: &esp_proc_info, \
proc_info: &esp_proc_info, \
name: "Sun ESP 100/100a/200", \
name: "Sun ESP 100/100a/200", \
detect: esp_detect, \
detect: esp_detect, \
revoke: esp_revoke,
\
slave_detach: esp_slave_detach,
\
info: esp_info, \
info: esp_info, \
command: esp_command, \
command: esp_command, \
queuecommand: esp_queue, \
queuecommand: esp_queue, \
...
@@ -427,7 +438,7 @@ extern int esp_revoke(Scsi_Device* SDptr);
...
@@ -427,7 +438,7 @@ extern int esp_revoke(Scsi_Device* SDptr);
proc_info: &esp_proc_info, \
proc_info: &esp_proc_info, \
name: "Sun ESP 100/100a/200", \
name: "Sun ESP 100/100a/200", \
detect: esp_detect, \
detect: esp_detect, \
revoke: esp_revoke,
\
slave_detach: esp_slave_detach,
\
info: esp_info, \
info: esp_info, \
command: esp_command, \
command: esp_command, \
queuecommand: esp_queue, \
queuecommand: esp_queue, \
...
...
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