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
7506a701
Commit
7506a701
authored
Apr 24, 2004
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[libata] add ata_tf_{to,from}_fis helpers
parent
8ee3cab9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
0 deletions
+75
-0
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+73
-0
include/linux/libata.h
include/linux/libata.h
+2
-0
No files found.
drivers/scsi/libata-core.c
View file @
7506a701
...
...
@@ -439,6 +439,77 @@ u8 ata_check_status_mmio(struct ata_port *ap)
return
readb
((
void
*
)
ap
->
ioaddr
.
status_addr
);
}
/**
* ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
* @tf: Taskfile to convert
* @fis: Buffer into which data will output
*
* Converts a standard ATA taskfile to a Serial ATA
* FIS structure (Register - Host to Device).
*
* LOCKING:
* Inherited from caller.
*/
void
ata_tf_to_fis
(
struct
ata_taskfile
*
tf
,
u8
*
fis
,
u8
pmp
)
{
fis
[
0
]
=
0x27
;
/* Register - Host to Device FIS */
fis
[
1
]
=
(
pmp
&
0xf
)
|
(
1
<<
7
);
/* Port multiplier number,
bit 7 indicates Command FIS */
fis
[
2
]
=
tf
->
command
;
fis
[
3
]
=
tf
->
feature
;
fis
[
4
]
=
tf
->
lbal
;
fis
[
5
]
=
tf
->
lbam
;
fis
[
6
]
=
tf
->
lbah
;
fis
[
7
]
=
tf
->
device
;
fis
[
8
]
=
tf
->
hob_lbal
;
fis
[
9
]
=
tf
->
hob_lbam
;
fis
[
10
]
=
tf
->
hob_lbah
;
fis
[
11
]
=
tf
->
hob_feature
;
fis
[
12
]
=
tf
->
nsect
;
fis
[
13
]
=
tf
->
hob_nsect
;
fis
[
14
]
=
0
;
fis
[
15
]
=
tf
->
ctl
;
fis
[
16
]
=
0
;
fis
[
17
]
=
0
;
fis
[
18
]
=
0
;
fis
[
19
]
=
0
;
}
/**
* ata_tf_from_fis - Convert SATA FIS to ATA taskfile
* @fis: Buffer from which data will be input
* @tf: Taskfile to output
*
* Converts a standard ATA taskfile to a Serial ATA
* FIS structure (Register - Host to Device).
*
* LOCKING:
* Inherited from caller.
*/
void
ata_tf_from_fis
(
u8
*
fis
,
struct
ata_taskfile
*
tf
)
{
tf
->
command
=
fis
[
2
];
/* status */
tf
->
feature
=
fis
[
3
];
/* error */
tf
->
lbal
=
fis
[
4
];
tf
->
lbam
=
fis
[
5
];
tf
->
lbah
=
fis
[
6
];
tf
->
device
=
fis
[
7
];
tf
->
hob_lbal
=
fis
[
8
];
tf
->
hob_lbam
=
fis
[
9
];
tf
->
hob_lbah
=
fis
[
10
];
tf
->
nsect
=
fis
[
12
];
tf
->
hob_nsect
=
fis
[
13
];
}
/**
* ata_prot_to_cmd - determine which read/write opcodes to use
* @protocol: ATA_PROT_xxx taskfile protocol
...
...
@@ -3512,6 +3583,8 @@ EXPORT_SYMBOL_GPL(ata_tf_load_pio);
EXPORT_SYMBOL_GPL
(
ata_tf_load_mmio
);
EXPORT_SYMBOL_GPL
(
ata_tf_read_pio
);
EXPORT_SYMBOL_GPL
(
ata_tf_read_mmio
);
EXPORT_SYMBOL_GPL
(
ata_tf_to_fis
);
EXPORT_SYMBOL_GPL
(
ata_tf_from_fis
);
EXPORT_SYMBOL_GPL
(
ata_check_status_pio
);
EXPORT_SYMBOL_GPL
(
ata_check_status_mmio
);
EXPORT_SYMBOL_GPL
(
ata_exec_command_pio
);
...
...
include/linux/libata.h
View file @
7506a701
...
...
@@ -392,6 +392,8 @@ extern void ata_tf_load_pio(struct ata_port *ap, struct ata_taskfile *tf);
extern
void
ata_tf_load_mmio
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
);
extern
void
ata_tf_read_pio
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
);
extern
void
ata_tf_read_mmio
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
);
extern
void
ata_tf_to_fis
(
struct
ata_taskfile
*
tf
,
u8
*
fis
,
u8
pmp
);
extern
void
ata_tf_from_fis
(
u8
*
fis
,
struct
ata_taskfile
*
tf
);
extern
u8
ata_check_status_pio
(
struct
ata_port
*
ap
);
extern
u8
ata_check_status_mmio
(
struct
ata_port
*
ap
);
extern
void
ata_exec_command_pio
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
);
...
...
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