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
14658038
Commit
14658038
authored
Jan 30, 2005
by
Jody McIntyre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Christoph Hellwig: avoid obsolete scsi APIs in sbp2
Signed-off-by:
Jody McIntyre
<
scjody@modernduck.com
>
parent
36c954a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
40 deletions
+45
-40
drivers/ieee1394/sbp2.c
drivers/ieee1394/sbp2.c
+36
-33
drivers/ieee1394/sbp2.h
drivers/ieee1394/sbp2.h
+9
-7
No files found.
drivers/ieee1394/sbp2.c
View file @
14658038
...
...
@@ -64,7 +64,10 @@
#include <asm/system.h>
#include <asm/scatterlist.h>
#include "../scsi/scsi.h"
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include "csr1212.h"
...
...
@@ -224,10 +227,10 @@ static void sbp2scsi_complete_all_commands(struct scsi_id_instance_data *scsi_id
u32
status
);
static
void
sbp2scsi_complete_command
(
struct
scsi_id_instance_data
*
scsi_id
,
u32
scsi_status
,
Scsi_C
mnd
*
SCpnt
,
void
(
*
done
)(
Scsi_C
mnd
*
));
u32
scsi_status
,
struct
scsi_c
mnd
*
SCpnt
,
void
(
*
done
)(
struct
scsi_c
mnd
*
));
static
Scsi_Host_T
emplate
scsi_driver_template
;
static
struct
scsi_host_t
emplate
scsi_driver_template
;
const
u8
sbp2_speedto_max_payload
[]
=
{
0x7
,
0x8
,
0x9
,
0xA
,
0xB
,
0xC
};
...
...
@@ -520,8 +523,8 @@ static struct sbp2_command_info *sbp2util_find_command_for_SCpnt(struct scsi_id_
*/
static
struct
sbp2_command_info
*
sbp2util_allocate_command_orb
(
struct
scsi_id_instance_data
*
scsi_id
,
Scsi_C
mnd
*
Current_SCpnt
,
void
(
*
Current_done
)(
Scsi_C
mnd
*
))
struct
scsi_c
mnd
*
Current_SCpnt
,
void
(
*
Current_done
)(
struct
scsi_c
mnd
*
))
{
struct
list_head
*
lh
;
struct
sbp2_command_info
*
command
=
NULL
;
...
...
@@ -1700,14 +1703,14 @@ static int sbp2_create_command_orb(struct scsi_id_instance_data *scsi_id,
unsigned
int
scsi_use_sg
,
unsigned
int
scsi_request_bufflen
,
void
*
scsi_request_buffer
,
unsigned
char
scsi_dir
)
enum
dma_data_direction
dma_dir
)
{
struct
sbp2scsi_host_info
*
hi
=
scsi_id
->
hi
;
struct
scatterlist
*
sgpnt
=
(
struct
scatterlist
*
)
scsi_request_buffer
;
struct
sbp2_command_orb
*
command_orb
=
&
command
->
command_orb
;
struct
sbp2_unrestricted_page_table
*
scatter_gather_element
=
&
command
->
scatter_gather_element
[
0
];
int
dma_dir
=
scsi_to_pci_dma_dir
(
scsi_dir
);
u32
sg_count
,
sg_len
,
orb_direction
;
dma_addr_t
sg_addr
;
int
i
;
...
...
@@ -1730,22 +1733,22 @@ static int sbp2_create_command_orb(struct scsi_id_instance_data *scsi_id,
* Get the direction of the transfer. If the direction is unknown, then use our
* goofy table as a back-up.
*/
switch
(
scsi
_dir
)
{
case
SCSI_DAT
A_NONE
:
switch
(
dma
_dir
)
{
case
DM
A_NONE
:
orb_direction
=
ORB_DIRECTION_NO_DATA_TRANSFER
;
break
;
case
SCSI_DATA_WRIT
E
:
case
DMA_TO_DEVIC
E
:
orb_direction
=
ORB_DIRECTION_WRITE_TO_MEDIA
;
break
;
case
SCSI_DATA_READ
:
case
DMA_FROM_DEVICE
:
orb_direction
=
ORB_DIRECTION_READ_FROM_MEDIA
;
break
;
case
SCSI_DATA_UNKNOWN
:
case
DMA_BIDIRECTIONAL
:
default:
SBP2_ERR
(
"SCSI data transfer direction not specified. "
"Update the SBP2 direction table in sbp2.h if "
"necessary for your application"
);
print_command
(
scsi_cmd
);
__scsi_print_command
(
scsi_cmd
);
orb_direction
=
sbp2scsi_direction_table
[
*
scsi_cmd
];
break
;
}
...
...
@@ -2031,7 +2034,8 @@ static int sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id,
* This function is called in order to begin a regular SBP-2 command.
*/
static
int
sbp2_send_command
(
struct
scsi_id_instance_data
*
scsi_id
,
Scsi_Cmnd
*
SCpnt
,
void
(
*
done
)(
Scsi_Cmnd
*
))
struct
scsi_cmnd
*
SCpnt
,
void
(
*
done
)(
struct
scsi_cmnd
*
))
{
unchar
*
cmd
=
(
unchar
*
)
SCpnt
->
cmnd
;
unsigned
int
request_bufflen
=
SCpnt
->
request_bufflen
;
...
...
@@ -2040,7 +2044,7 @@ static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
SBP2_DEBUG
(
"sbp2_send_command"
);
#if (CONFIG_IEEE1394_SBP2_DEBUG >= 2) || defined(CONFIG_IEEE1394_SBP2_PACKET_DUMP)
printk
(
"[scsi command]
\n
"
);
print_command
(
cmd
);
scsi_print_command
(
SCpnt
);
#endif
SBP2_DEBUG
(
"SCSI transfer size = %x"
,
request_bufflen
);
SBP2_DEBUG
(
"SCSI s/g elements = %x"
,
(
unsigned
int
)
SCpnt
->
use_sg
);
...
...
@@ -2233,7 +2237,7 @@ static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status, unchar *sense
* response data translations for the SCSI stack
*/
static
void
sbp2_check_sbp2_response
(
struct
scsi_id_instance_data
*
scsi_id
,
Scsi_C
mnd
*
SCpnt
)
struct
scsi_c
mnd
*
SCpnt
)
{
u8
*
scsi_buf
=
SCpnt
->
request_buffer
;
u8
device_type
=
SBP2_DEVICE_TYPE
(
scsi_id
->
sbp2_device_type_and_lun
);
...
...
@@ -2312,7 +2316,7 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int dest
struct
sbp2scsi_host_info
*
hi
;
struct
scsi_id_instance_data
*
scsi_id
=
NULL
,
*
scsi_id_tmp
;
u32
id
;
Scsi_C
mnd
*
SCpnt
=
NULL
;
struct
scsi_c
mnd
*
SCpnt
=
NULL
;
u32
scsi_status
=
SBP2_SCSI_STATUS_GOOD
;
struct
sbp2_command_info
*
command
;
...
...
@@ -2454,7 +2458,8 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int dest
* This routine is the main request entry routine for doing I/O. It is
* called from the scsi stack directly.
*/
static
int
sbp2scsi_queuecommand
(
Scsi_Cmnd
*
SCpnt
,
void
(
*
done
)(
Scsi_Cmnd
*
))
static
int
sbp2scsi_queuecommand
(
struct
scsi_cmnd
*
SCpnt
,
void
(
*
done
)(
struct
scsi_cmnd
*
))
{
struct
scsi_id_instance_data
*
scsi_id
=
(
struct
scsi_id_instance_data
*
)
SCpnt
->
device
->
host
->
hostdata
[
0
];
...
...
@@ -2550,9 +2555,8 @@ static void sbp2scsi_complete_all_commands(struct scsi_id_instance_data *scsi_id
PCI_DMA_BIDIRECTIONAL
);
sbp2util_mark_command_completed
(
scsi_id
,
command
);
if
(
command
->
Current_SCpnt
)
{
void
(
*
done
)(
Scsi_Cmnd
*
)
=
command
->
Current_done
;
command
->
Current_SCpnt
->
result
=
status
<<
16
;
done
(
command
->
Current_SCpnt
);
command
->
Current_done
(
command
->
Current_SCpnt
);
}
}
...
...
@@ -2565,8 +2569,8 @@ static void sbp2scsi_complete_all_commands(struct scsi_id_instance_data *scsi_id
* This can be called in interrupt context.
*/
static
void
sbp2scsi_complete_command
(
struct
scsi_id_instance_data
*
scsi_id
,
u32
scsi_status
,
Scsi_C
mnd
*
SCpnt
,
void
(
*
done
)(
Scsi_C
mnd
*
))
u32
scsi_status
,
struct
scsi_c
mnd
*
SCpnt
,
void
(
*
done
)(
struct
scsi_c
mnd
*
))
{
unsigned
long
flags
;
...
...
@@ -2611,8 +2615,8 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
* Debug stuff
*/
#if CONFIG_IEEE1394_SBP2_DEBUG >= 1
print_command
(
SCpnt
->
cmnd
);
print_sense
(
"bh"
,
SCpnt
);
scsi_print_command
(
SCpnt
);
scsi_
print_sense
(
"bh"
,
SCpnt
);
#endif
break
;
...
...
@@ -2620,7 +2624,7 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
case
SBP2_SCSI_STATUS_SELECTION_TIMEOUT
:
SBP2_ERR
(
"SBP2_SCSI_STATUS_SELECTION_TIMEOUT"
);
SCpnt
->
result
=
DID_NO_CONNECT
<<
16
;
print_command
(
SCpnt
->
cmnd
);
scsi_print_command
(
SCpnt
);
break
;
case
SBP2_SCSI_STATUS_CONDITION_MET
:
...
...
@@ -2628,7 +2632,7 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
case
SBP2_SCSI_STATUS_COMMAND_TERMINATED
:
SBP2_ERR
(
"Bad SCSI status = %x"
,
scsi_status
);
SCpnt
->
result
=
DID_ERROR
<<
16
;
print_command
(
SCpnt
->
cmnd
);
scsi_print_command
(
SCpnt
);
break
;
default:
...
...
@@ -2688,7 +2692,7 @@ static int sbp2scsi_slave_configure (struct scsi_device *sdev)
* Called by scsi stack when something has really gone wrong. Usually
* called when a command has timed-out for some reason.
*/
static
int
sbp2scsi_abort
(
Scsi_C
mnd
*
SCpnt
)
static
int
sbp2scsi_abort
(
struct
scsi_c
mnd
*
SCpnt
)
{
struct
scsi_id_instance_data
*
scsi_id
=
(
struct
scsi_id_instance_data
*
)
SCpnt
->
device
->
host
->
hostdata
[
0
];
...
...
@@ -2696,7 +2700,7 @@ static int sbp2scsi_abort (Scsi_Cmnd *SCpnt)
struct
sbp2_command_info
*
command
;
SBP2_ERR
(
"aborting sbp2 command"
);
print_command
(
SCpnt
->
cmnd
);
scsi_print_command
(
SCpnt
);
if
(
scsi_id
)
{
...
...
@@ -2717,9 +2721,8 @@ static int sbp2scsi_abort (Scsi_Cmnd *SCpnt)
PCI_DMA_BIDIRECTIONAL
);
sbp2util_mark_command_completed
(
scsi_id
,
command
);
if
(
command
->
Current_SCpnt
)
{
void
(
*
done
)(
Scsi_Cmnd
*
)
=
command
->
Current_done
;
command
->
Current_SCpnt
->
result
=
DID_ABORT
<<
16
;
done
(
command
->
Current_SCpnt
);
command
->
Current_done
(
command
->
Current_SCpnt
);
}
}
...
...
@@ -2736,7 +2739,7 @@ static int sbp2scsi_abort (Scsi_Cmnd *SCpnt)
/*
* Called by scsi stack when something has really gone wrong.
*/
static
int
sbp2scsi_reset
(
Scsi_C
mnd
*
SCpnt
)
static
int
sbp2scsi_reset
(
struct
scsi_c
mnd
*
SCpnt
)
{
struct
scsi_id_instance_data
*
scsi_id
=
(
struct
scsi_id_instance_data
*
)
SCpnt
->
device
->
host
->
hostdata
[
0
];
...
...
@@ -2789,7 +2792,7 @@ MODULE_SUPPORTED_DEVICE(SBP2_DEVICE_NAME);
MODULE_LICENSE
(
"GPL"
);
/* SCSI host template */
static
Scsi_Host_T
emplate
scsi_driver_template
=
{
static
struct
scsi_host_t
emplate
scsi_driver_template
=
{
.
module
=
THIS_MODULE
,
.
name
=
"SBP-2 IEEE-1394"
,
.
proc_name
=
SBP2_DEVICE_NAME
,
...
...
drivers/ieee1394/sbp2.h
View file @
14658038
...
...
@@ -324,8 +324,8 @@ struct sbp2_command_info {
struct
list_head
list
;
struct
sbp2_command_orb
command_orb
____cacheline_aligned
;
dma_addr_t
command_orb_dma
____cacheline_aligned
;
Scsi_C
mnd
*
Current_SCpnt
;
void
(
*
Current_done
)(
Scsi_C
mnd
*
);
struct
scsi_c
mnd
*
Current_SCpnt
;
void
(
*
Current_done
)(
struct
scsi_c
mnd
*
);
/* Also need s/g structure for each sbp2 command */
struct
sbp2_unrestricted_page_table
scatter_gather_element
[
SG_ALL
]
____cacheline_aligned
;
...
...
@@ -434,8 +434,8 @@ static void sbp2util_remove_command_orb_pool(struct scsi_id_instance_data *scsi_
static
struct
sbp2_command_info
*
sbp2util_find_command_for_orb
(
struct
scsi_id_instance_data
*
scsi_id
,
dma_addr_t
orb
);
static
struct
sbp2_command_info
*
sbp2util_find_command_for_SCpnt
(
struct
scsi_id_instance_data
*
scsi_id
,
void
*
SCpnt
);
static
struct
sbp2_command_info
*
sbp2util_allocate_command_orb
(
struct
scsi_id_instance_data
*
scsi_id
,
Scsi_C
mnd
*
Current_SCpnt
,
void
(
*
Current_done
)(
Scsi_C
mnd
*
));
struct
scsi_c
mnd
*
Current_SCpnt
,
void
(
*
Current_done
)(
struct
scsi_c
mnd
*
));
static
void
sbp2util_mark_command_completed
(
struct
scsi_id_instance_data
*
scsi_id
,
struct
sbp2_command_info
*
command
);
...
...
@@ -466,14 +466,16 @@ static int sbp2_create_command_orb(struct scsi_id_instance_data *scsi_id,
unsigned
int
scsi_use_sg
,
unsigned
int
scsi_request_bufflen
,
void
*
scsi_request_buffer
,
unsigned
char
scsi
_dir
);
enum
dma_data_direction
dma
_dir
);
static
int
sbp2_link_orb_command
(
struct
scsi_id_instance_data
*
scsi_id
,
struct
sbp2_command_info
*
command
);
static
int
sbp2_send_command
(
struct
scsi_id_instance_data
*
scsi_id
,
Scsi_Cmnd
*
SCpnt
,
void
(
*
done
)(
Scsi_Cmnd
*
));
struct
scsi_cmnd
*
SCpnt
,
void
(
*
done
)(
struct
scsi_cmnd
*
));
static
unsigned
int
sbp2_status_to_sense_data
(
unchar
*
sbp2_status
,
unchar
*
sense_data
);
static
void
sbp2_check_sbp2_command
(
struct
scsi_id_instance_data
*
scsi_id
,
unchar
*
cmd
);
static
void
sbp2_check_sbp2_response
(
struct
scsi_id_instance_data
*
scsi_id
,
Scsi_Cmnd
*
SCpnt
);
static
void
sbp2_check_sbp2_response
(
struct
scsi_id_instance_data
*
scsi_id
,
struct
scsi_cmnd
*
SCpnt
);
static
void
sbp2_parse_unit_directory
(
struct
scsi_id_instance_data
*
scsi_id
,
struct
unit_directory
*
ud
);
static
int
sbp2_set_busy_timeout
(
struct
scsi_id_instance_data
*
scsi_id
);
...
...
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