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
3952c9c5
Commit
3952c9c5
authored
Oct 12, 2004
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] get rid of obsolete APIs in nsp32
Signed-off-by:
James Bottomley
<
James.Bottomley@SteelEye.com
>
parent
ca47f1c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
53 deletions
+54
-53
drivers/scsi/nsp32.c
drivers/scsi/nsp32.c
+52
-51
drivers/scsi/nsp32.h
drivers/scsi/nsp32.h
+2
-2
No files found.
drivers/scsi/nsp32.c
View file @
3952c9c5
...
...
@@ -43,10 +43,11 @@
#include <asm/system.h>
#include <asm/io.h>
#include "scsi.h"
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_ioctl.h>
#include <scsi/scsi.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
# include <linux/blk.h>
...
...
@@ -209,37 +210,38 @@ static int nsp32_detect (struct pci_dev *pdev);
#else
static
int
nsp32_detect
(
Scsi_Host_Template
*
);
#endif
static
int
nsp32_queuecommand
(
Scsi_Cmnd
*
,
void
(
*
done
)(
Scsi_Cmnd
*
));
static
int
nsp32_queuecommand
(
struct
scsi_cmnd
*
,
void
(
*
done
)(
struct
scsi_cmnd
*
));
static
const
char
*
nsp32_info
(
struct
Scsi_Host
*
);
static
int
nsp32_release
(
struct
Scsi_Host
*
);
/* SCSI error handler */
static
int
nsp32_eh_abort
(
Scsi_C
mnd
*
);
static
int
nsp32_eh_bus_reset
(
Scsi_C
mnd
*
);
static
int
nsp32_eh_host_reset
(
Scsi_C
mnd
*
);
static
int
nsp32_eh_abort
(
struct
scsi_c
mnd
*
);
static
int
nsp32_eh_bus_reset
(
struct
scsi_c
mnd
*
);
static
int
nsp32_eh_host_reset
(
struct
scsi_c
mnd
*
);
/* generate SCSI message */
static
void
nsp32_build_identify
(
Scsi_C
mnd
*
);
static
void
nsp32_build_nop
(
Scsi_C
mnd
*
);
static
void
nsp32_build_reject
(
Scsi_C
mnd
*
);
static
void
nsp32_build_sdtr
(
Scsi_C
mnd
*
,
unsigned
char
,
unsigned
char
);
static
void
nsp32_build_identify
(
struct
scsi_c
mnd
*
);
static
void
nsp32_build_nop
(
struct
scsi_c
mnd
*
);
static
void
nsp32_build_reject
(
struct
scsi_c
mnd
*
);
static
void
nsp32_build_sdtr
(
struct
scsi_c
mnd
*
,
unsigned
char
,
unsigned
char
);
/* SCSI message handler */
static
int
nsp32_busfree_occur
(
Scsi_C
mnd
*
,
unsigned
short
);
static
void
nsp32_msgout_occur
(
Scsi_C
mnd
*
);
static
void
nsp32_msgin_occur
(
Scsi_C
mnd
*
,
unsigned
long
,
unsigned
short
);
static
int
nsp32_setup_sg_table
(
Scsi_C
mnd
*
);
static
int
nsp32_selection_autopara
(
Scsi_C
mnd
*
);
static
int
nsp32_selection_autoscsi
(
Scsi_C
mnd
*
);
static
void
nsp32_scsi_done
(
Scsi_C
mnd
*
);
static
int
nsp32_arbitration
(
Scsi_C
mnd
*
,
unsigned
int
);
static
int
nsp32_reselection
(
Scsi_C
mnd
*
,
unsigned
char
);
static
void
nsp32_adjust_busfree
(
Scsi_C
mnd
*
,
unsigned
int
);
static
void
nsp32_restart_autoscsi
(
Scsi_C
mnd
*
,
unsigned
short
);
static
int
nsp32_busfree_occur
(
struct
scsi_c
mnd
*
,
unsigned
short
);
static
void
nsp32_msgout_occur
(
struct
scsi_c
mnd
*
);
static
void
nsp32_msgin_occur
(
struct
scsi_c
mnd
*
,
unsigned
long
,
unsigned
short
);
static
int
nsp32_setup_sg_table
(
struct
scsi_c
mnd
*
);
static
int
nsp32_selection_autopara
(
struct
scsi_c
mnd
*
);
static
int
nsp32_selection_autoscsi
(
struct
scsi_c
mnd
*
);
static
void
nsp32_scsi_done
(
struct
scsi_c
mnd
*
);
static
int
nsp32_arbitration
(
struct
scsi_c
mnd
*
,
unsigned
int
);
static
int
nsp32_reselection
(
struct
scsi_c
mnd
*
,
unsigned
char
);
static
void
nsp32_adjust_busfree
(
struct
scsi_c
mnd
*
,
unsigned
int
);
static
void
nsp32_restart_autoscsi
(
struct
scsi_c
mnd
*
,
unsigned
short
);
/* SCSI SDTR */
static
void
nsp32_analyze_sdtr
(
Scsi_C
mnd
*
);
static
void
nsp32_analyze_sdtr
(
struct
scsi_c
mnd
*
);
static
int
nsp32_search_period_entry
(
nsp32_hw_data
*
,
nsp32_target
*
,
unsigned
char
);
static
void
nsp32_set_async
(
nsp32_hw_data
*
,
nsp32_target
*
);
static
void
nsp32_set_max_sync
(
nsp32_hw_data
*
,
nsp32_target
*
,
unsigned
char
*
,
unsigned
char
*
);
...
...
@@ -279,7 +281,7 @@ static void nsp32_dmessage(const char *, int, int, char *, ...);
/*
* max_sectors is currently limited up to 128.
*/
static
Scsi_Host_T
emplate
nsp32_template
=
{
static
struct
scsi_host_t
emplate
nsp32_template
=
{
.
proc_name
=
"nsp32"
,
.
name
=
"Workbit NinjaSCSI-32Bi/UDE"
,
.
proc_info
=
nsp32_proc_info
,
...
...
@@ -388,7 +390,7 @@ static void nsp32_dmessage(const char *func, int line, int mask, char *fmt, ...)
/*
* IDENTIFY Message
*/
static
void
nsp32_build_identify
(
Scsi_C
mnd
*
SCpnt
)
static
void
nsp32_build_identify
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
int
pos
=
data
->
msgout_len
;
...
...
@@ -407,7 +409,7 @@ static void nsp32_build_identify(Scsi_Cmnd *SCpnt)
/*
* SDTR Message Routine
*/
static
void
nsp32_build_sdtr
(
Scsi_C
mnd
*
SCpnt
,
static
void
nsp32_build_sdtr
(
struct
scsi_c
mnd
*
SCpnt
,
unsigned
char
period
,
unsigned
char
offset
)
{
...
...
@@ -426,7 +428,7 @@ static void nsp32_build_sdtr(Scsi_Cmnd *SCpnt,
/*
* No Operation Message
*/
static
void
nsp32_build_nop
(
Scsi_C
mnd
*
SCpnt
)
static
void
nsp32_build_nop
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
int
pos
=
data
->
msgout_len
;
...
...
@@ -444,7 +446,7 @@ static void nsp32_build_nop(Scsi_Cmnd *SCpnt)
/*
* Reject Message
*/
static
void
nsp32_build_reject
(
Scsi_C
mnd
*
SCpnt
)
static
void
nsp32_build_reject
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
int
pos
=
data
->
msgout_len
;
...
...
@@ -457,7 +459,7 @@ static void nsp32_build_reject(Scsi_Cmnd *SCpnt)
* timer
*/
#if 0
static void nsp32_start_timer(
Scsi_C
mnd *SCpnt, int time)
static void nsp32_start_timer(
struct scsi_c
mnd *SCpnt, int time)
{
unsigned int base = SCpnt->host->io_port;
...
...
@@ -475,7 +477,7 @@ static void nsp32_start_timer(Scsi_Cmnd *SCpnt, int time)
/*
* set SCSI command and other parameter to asic, and start selection phase
*/
static
int
nsp32_selection_autopara
(
Scsi_C
mnd
*
SCpnt
)
static
int
nsp32_selection_autopara
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
unsigned
int
base
=
SCpnt
->
device
->
host
->
io_port
;
...
...
@@ -606,7 +608,7 @@ static int nsp32_selection_autopara(Scsi_Cmnd *SCpnt)
/*
* Selection with AUTO SCSI (without AUTO PARAMETER)
*/
static
int
nsp32_selection_autoscsi
(
Scsi_C
mnd
*
SCpnt
)
static
int
nsp32_selection_autoscsi
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
unsigned
int
base
=
SCpnt
->
device
->
host
->
io_port
;
...
...
@@ -781,7 +783,7 @@ static int nsp32_selection_autoscsi(Scsi_Cmnd *SCpnt)
* arbitration delay time is defined minimal 2.4us in SCSI
* specification, thus udelay works as coarse grained wait timer.
*/
static
int
nsp32_arbitration
(
Scsi_C
mnd
*
SCpnt
,
unsigned
int
base
)
static
int
nsp32_arbitration
(
struct
scsi_c
mnd
*
SCpnt
,
unsigned
int
base
)
{
unsigned
char
arbit
;
int
status
=
TRUE
;
...
...
@@ -830,7 +832,7 @@ static int nsp32_arbitration(Scsi_Cmnd *SCpnt, unsigned int base)
* reselection target id&lun must be already set.
* SCSI-2 says IDENTIFY implies RESTORE_POINTER operation.
*/
static
int
nsp32_reselection
(
Scsi_C
mnd
*
SCpnt
,
unsigned
char
newlun
)
static
int
nsp32_reselection
(
struct
scsi_c
mnd
*
SCpnt
,
unsigned
char
newlun
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
unsigned
int
host_id
=
SCpnt
->
device
->
host
->
this_id
;
...
...
@@ -884,7 +886,7 @@ static int nsp32_reselection(Scsi_Cmnd *SCpnt, unsigned char newlun)
*
* Note: NinjaSCSI-32Bi/UDE bus master can not transfer over 64KB at a time.
*/
static
int
nsp32_setup_sg_table
(
Scsi_C
mnd
*
SCpnt
)
static
int
nsp32_setup_sg_table
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
struct
scatterlist
*
sgl
;
...
...
@@ -904,7 +906,7 @@ static int nsp32_setup_sg_table(Scsi_Cmnd *SCpnt)
if
(
SCpnt
->
use_sg
)
{
sgl
=
(
struct
scatterlist
*
)
SCpnt
->
request_buffer
;
num
=
pci_map_sg
(
data
->
Pci
,
sgl
,
SCpnt
->
use_sg
,
scsi_to_pci_dma_dir
(
SCpnt
->
sc_data_direction
)
);
SCpnt
->
sc_data_direction
);
for
(
i
=
0
;
i
<
num
;
i
++
)
{
/*
* Build nsp32_sglist, substitute sg dma addresses.
...
...
@@ -932,7 +934,7 @@ static int nsp32_setup_sg_table(Scsi_Cmnd *SCpnt)
}
else
{
SCpnt
->
SCp
.
have_data_in
=
pci_map_single
(
data
->
Pci
,
SCpnt
->
request_buffer
,
SCpnt
->
request_bufflen
,
scsi_to_pci_dma_dir
(
SCpnt
->
sc_data_direction
)
);
SCpnt
->
sc_data_direction
);
sgt
[
0
].
addr
=
cpu_to_le32
(
SCpnt
->
SCp
.
have_data_in
);
sgt
[
0
].
len
=
cpu_to_le32
(
SCpnt
->
request_bufflen
|
SGTEND
);
/* set end mark */
...
...
@@ -950,7 +952,7 @@ static int nsp32_setup_sg_table(Scsi_Cmnd *SCpnt)
return
TRUE
;
}
static
int
nsp32_queuecommand
(
Scsi_Cmnd
*
SCpnt
,
void
(
*
done
)(
Scsi_C
mnd
*
))
static
int
nsp32_queuecommand
(
struct
scsi_cmnd
*
SCpnt
,
void
(
*
done
)(
struct
scsi_c
mnd
*
))
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
nsp32_target
*
target
;
...
...
@@ -1205,7 +1207,7 @@ static irqreturn_t do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs)
{
nsp32_hw_data
*
data
=
dev_id
;
unsigned
int
base
=
data
->
BaseAddress
;
Scsi_C
mnd
*
SCpnt
=
data
->
CurrentSC
;
struct
scsi_c
mnd
*
SCpnt
=
data
->
CurrentSC
;
unsigned
short
auto_stat
,
irq_stat
,
trans_stat
;
unsigned
char
busmon
,
busphase
;
unsigned
long
flags
;
...
...
@@ -1622,7 +1624,7 @@ static int nsp32_proc_info(
* Reset parameters and call scsi_done for data->cur_lunt.
* Be careful setting SCpnt->result = DID_* before calling this function.
*/
static
void
nsp32_scsi_done
(
Scsi_C
mnd
*
SCpnt
)
static
void
nsp32_scsi_done
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
unsigned
int
base
=
SCpnt
->
device
->
host
->
io_port
;
...
...
@@ -1637,13 +1639,12 @@ static void nsp32_scsi_done(Scsi_Cmnd *SCpnt)
if
(
SCpnt
->
use_sg
)
{
pci_unmap_sg
(
data
->
Pci
,
(
struct
scatterlist
*
)
SCpnt
->
buffer
,
SCpnt
->
use_sg
,
scsi_to_pci_dma_dir
(
SCpnt
->
sc_data_direction
));
SCpnt
->
use_sg
,
SCpnt
->
sc_data_direction
);
}
else
{
pci_unmap_single
(
data
->
Pci
,
(
u32
)
SCpnt
->
SCp
.
have_data_in
,
SCpnt
->
request_bufflen
,
scsi_to_pci_dma_dir
(
SCpnt
->
sc_data_direction
)
);
SCpnt
->
sc_data_direction
);
}
skip:
...
...
@@ -1678,7 +1679,7 @@ static void nsp32_scsi_done(Scsi_Cmnd *SCpnt)
* MsgIn 04: Diconnect.
* In other case, unexpected BUSFREE is detected.
*/
static
int
nsp32_busfree_occur
(
Scsi_C
mnd
*
SCpnt
,
unsigned
short
execph
)
static
int
nsp32_busfree_occur
(
struct
scsi_c
mnd
*
SCpnt
,
unsigned
short
execph
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
unsigned
int
base
=
SCpnt
->
device
->
host
->
io_port
;
...
...
@@ -1836,7 +1837,7 @@ static int nsp32_busfree_occur(Scsi_Cmnd *SCpnt, unsigned short execph)
* Note: This driver adjust the SG table using SCSI ACK
* counter instead of BMCNT counter!
*/
static
void
nsp32_adjust_busfree
(
Scsi_C
mnd
*
SCpnt
,
unsigned
int
s_sacklen
)
static
void
nsp32_adjust_busfree
(
struct
scsi_c
mnd
*
SCpnt
,
unsigned
int
s_sacklen
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
int
old_entry
=
data
->
cur_entry
;
...
...
@@ -1909,7 +1910,7 @@ static void nsp32_adjust_busfree(Scsi_Cmnd *SCpnt, unsigned int s_sacklen)
* message out phase. It, however, has more than 3 messages,
* HBA creates the interrupt and we have to process by hand.
*/
static
void
nsp32_msgout_occur
(
Scsi_C
mnd
*
SCpnt
)
static
void
nsp32_msgout_occur
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
unsigned
int
base
=
SCpnt
->
device
->
host
->
io_port
;
...
...
@@ -1985,7 +1986,7 @@ static void nsp32_msgout_occur(Scsi_Cmnd *SCpnt)
* Note: Restarting AutoSCSI needs set:
* SYNC_REG, ACK_WIDTH, SGT_ADR, TRANSFER_CONTROL
*/
static
void
nsp32_restart_autoscsi
(
Scsi_C
mnd
*
SCpnt
,
unsigned
short
command
)
static
void
nsp32_restart_autoscsi
(
struct
scsi_c
mnd
*
SCpnt
,
unsigned
short
command
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
unsigned
int
base
=
data
->
BaseAddress
;
...
...
@@ -2051,7 +2052,7 @@ static void nsp32_restart_autoscsi(Scsi_Cmnd *SCpnt, unsigned short command)
/*
* cannot run automatically message in occur
*/
static
void
nsp32_msgin_occur
(
Scsi_C
mnd
*
SCpnt
,
static
void
nsp32_msgin_occur
(
struct
scsi_c
mnd
*
SCpnt
,
unsigned
long
irq_status
,
unsigned
short
execph
)
{
...
...
@@ -2348,7 +2349,7 @@ static void nsp32_msgin_occur(Scsi_Cmnd *SCpnt,
/*
*
*/
static
void
nsp32_analyze_sdtr
(
Scsi_C
mnd
*
SCpnt
)
static
void
nsp32_analyze_sdtr
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
nsp32_target
*
target
=
data
->
cur_target
;
...
...
@@ -2956,7 +2957,7 @@ static const char *nsp32_info(struct Scsi_Host *shpnt)
/****************************************************************************
* error handler
*/
static
int
nsp32_eh_abort
(
Scsi_C
mnd
*
SCpnt
)
static
int
nsp32_eh_abort
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
unsigned
int
base
=
SCpnt
->
device
->
host
->
io_port
;
...
...
@@ -2984,7 +2985,7 @@ static int nsp32_eh_abort(Scsi_Cmnd *SCpnt)
return
SUCCESS
;
}
static
int
nsp32_eh_bus_reset
(
Scsi_C
mnd
*
SCpnt
)
static
int
nsp32_eh_bus_reset
(
struct
scsi_c
mnd
*
SCpnt
)
{
nsp32_hw_data
*
data
=
(
nsp32_hw_data
*
)
SCpnt
->
device
->
host
->
hostdata
;
unsigned
int
base
=
SCpnt
->
device
->
host
->
io_port
;
...
...
@@ -3041,7 +3042,7 @@ static void nsp32_do_bus_reset(nsp32_hw_data *data)
data
->
CurrentSC
=
NULL
;
}
static
int
nsp32_eh_host_reset
(
Scsi_C
mnd
*
SCpnt
)
static
int
nsp32_eh_host_reset
(
struct
scsi_c
mnd
*
SCpnt
)
{
struct
Scsi_Host
*
host
=
SCpnt
->
device
->
host
;
unsigned
int
base
=
SCpnt
->
device
->
host
->
io_port
;
...
...
drivers/scsi/nsp32.h
View file @
3952c9c5
...
...
@@ -499,7 +499,7 @@ typedef struct _nsp32_autoparam {
#define MSGIN03 BIT(1)
/* Auto Msg In 03 Flag */
typedef
struct
_nsp32_lunt
{
Scsi_Cmnd
*
SCpnt
;
/* Current Handling Scsi_C
mnd */
struct
scsi_cmnd
*
SCpnt
;
/* Current Handling struct scsi_c
mnd */
unsigned
long
save_datp
;
/* Save Data Pointer - saved position from initial address */
int
msgin03
;
/* auto msg in 03 flag */
unsigned
int
sg_num
;
/* Total number of SG entries */
...
...
@@ -567,7 +567,7 @@ typedef struct _nsp32_hw_data {
#define NSP32_MMIO_OFFSET 0x0800
unsigned
long
MmioLength
;
Scsi_C
mnd
*
CurrentSC
;
struct
scsi_c
mnd
*
CurrentSC
;
struct
pci_dev
*
Pci
;
const
struct
pci_device_id
*
pci_devid
;
...
...
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