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
02343cfd
Commit
02343cfd
authored
Feb 04, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Feb 04, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] paride cleanup and fixes (24/25)
pd_identify() converted to pd_special_command().
parent
247f8c00
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
drivers/block/paride/pd.c
drivers/block/paride/pd.c
+13
-12
No files found.
drivers/block/paride/pd.c
View file @
02343cfd
...
@@ -591,6 +591,8 @@ static enum action do_pd_write_done(void)
...
@@ -591,6 +591,8 @@ static enum action do_pd_write_done(void)
return
Ok
;
return
Ok
;
}
}
/* special io requests */
/* According to the ATA standard, the default CHS geometry should be
/* According to the ATA standard, the default CHS geometry should be
available following a reset. Some Western Digital drives come up
available following a reset. Some Western Digital drives come up
in a mode where only LBA addresses are accepted until the device
in a mode where only LBA addresses are accepted until the device
...
@@ -660,7 +662,7 @@ static void pd_standby_off(struct pd_unit *disk)
...
@@ -660,7 +662,7 @@ static void pd_standby_off(struct pd_unit *disk)
pd_wait_for
(
disk
,
0
,
DBMSG
(
"after STANDBY"
));
pd_wait_for
(
disk
,
0
,
DBMSG
(
"after STANDBY"
));
}
}
static
int
pd_identify
(
struct
pd_unit
*
disk
)
static
enum
action
pd_identify
(
struct
pd_unit
*
disk
)
{
{
int
j
;
int
j
;
char
id
[
PD_ID_LEN
+
1
];
char
id
[
PD_ID_LEN
+
1
];
...
@@ -671,8 +673,6 @@ static int pd_identify(struct pd_unit *disk)
...
@@ -671,8 +673,6 @@ static int pd_identify(struct pd_unit *disk)
settings on the SLAVE drive.
settings on the SLAVE drive.
*/
*/
pi_connect
(
disk
->
pi
);
if
(
disk
->
drive
==
0
)
if
(
disk
->
drive
==
0
)
pd_reset
(
disk
);
pd_reset
(
disk
);
...
@@ -680,10 +680,8 @@ static int pd_identify(struct pd_unit *disk)
...
@@ -680,10 +680,8 @@ static int pd_identify(struct pd_unit *disk)
pd_wait_for
(
disk
,
0
,
DBMSG
(
"before IDENT"
));
pd_wait_for
(
disk
,
0
,
DBMSG
(
"before IDENT"
));
pd_send_command
(
disk
,
1
,
0
,
0
,
0
,
0
,
IDE_IDENTIFY
);
pd_send_command
(
disk
,
1
,
0
,
0
,
0
,
0
,
IDE_IDENTIFY
);
if
(
pd_wait_for
(
disk
,
STAT_DRQ
,
DBMSG
(
"IDENT DRQ"
))
&
STAT_ERR
)
{
if
(
pd_wait_for
(
disk
,
STAT_DRQ
,
DBMSG
(
"IDENT DRQ"
))
&
STAT_ERR
)
pi_disconnect
(
disk
->
pi
);
return
Fail
;
return
0
;
}
pi_read_block
(
disk
->
pi
,
pd_scratch
,
512
);
pi_read_block
(
disk
->
pi
,
pd_scratch
,
512
);
disk
->
can_lba
=
pd_scratch
[
99
]
&
2
;
disk
->
can_lba
=
pd_scratch
[
99
]
&
2
;
disk
->
sectors
=
le16_to_cpu
(
*
(
u16
*
)
(
pd_scratch
+
12
));
disk
->
sectors
=
le16_to_cpu
(
*
(
u16
*
)
(
pd_scratch
+
12
));
...
@@ -716,10 +714,11 @@ static int pd_identify(struct pd_unit *disk)
...
@@ -716,10 +714,11 @@ static int pd_identify(struct pd_unit *disk)
if
(
!
disk
->
standby
)
if
(
!
disk
->
standby
)
pd_standby_off
(
disk
);
pd_standby_off
(
disk
);
pi_disconnect
(
disk
->
pi
);
return
Ok
;
return
1
;
}
}
/* end of io request engine */
static
void
do_pd_request
(
request_queue_t
*
q
)
static
void
do_pd_request
(
request_queue_t
*
q
)
{
{
if
(
pd_req
)
if
(
pd_req
)
...
@@ -824,7 +823,7 @@ static int pd_check_media(struct gendisk *p)
...
@@ -824,7 +823,7 @@ static int pd_check_media(struct gendisk *p)
static
int
pd_revalidate
(
struct
gendisk
*
p
)
static
int
pd_revalidate
(
struct
gendisk
*
p
)
{
{
struct
pd_unit
*
disk
=
p
->
private_data
;
struct
pd_unit
*
disk
=
p
->
private_data
;
if
(
pd_
identify
(
disk
)
)
if
(
pd_
special_command
(
disk
,
pd_identify
)
==
0
)
set_capacity
(
p
,
disk
->
capacity
);
set_capacity
(
p
,
disk
->
capacity
);
else
else
set_capacity
(
p
,
0
);
set_capacity
(
p
,
0
);
...
@@ -840,6 +839,8 @@ static struct block_device_operations pd_fops = {
...
@@ -840,6 +839,8 @@ static struct block_device_operations pd_fops = {
.
revalidate_disk
=
pd_revalidate
.
revalidate_disk
=
pd_revalidate
};
};
/* probing */
static
void
pd_probe_drive
(
struct
pd_unit
*
disk
)
static
void
pd_probe_drive
(
struct
pd_unit
*
disk
)
{
{
struct
gendisk
*
p
=
alloc_disk
(
1
<<
PD_BITS
);
struct
gendisk
*
p
=
alloc_disk
(
1
<<
PD_BITS
);
...
@@ -855,9 +856,9 @@ static void pd_probe_drive(struct pd_unit *disk)
...
@@ -855,9 +856,9 @@ static void pd_probe_drive(struct pd_unit *disk)
if
(
disk
->
drive
==
-
1
)
{
if
(
disk
->
drive
==
-
1
)
{
for
(
disk
->
drive
=
0
;
disk
->
drive
<=
1
;
disk
->
drive
++
)
for
(
disk
->
drive
=
0
;
disk
->
drive
<=
1
;
disk
->
drive
++
)
if
(
pd_
identify
(
disk
)
)
if
(
pd_
special_command
(
disk
,
pd_identify
)
==
0
)
return
;
return
;
}
else
if
(
pd_
identify
(
disk
)
)
}
else
if
(
pd_
special_command
(
disk
,
pd_identify
)
==
0
)
return
;
return
;
disk
->
gd
=
NULL
;
disk
->
gd
=
NULL
;
put_disk
(
p
);
put_disk
(
p
);
...
...
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