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
ef4604f8
Commit
ef4604f8
authored
Sep 30, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/davem/net-2.5
into home.osdl.org:/home/torvalds/v2.5/linux
parents
efac6a46
dc5d9d1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
52 deletions
+54
-52
drivers/ide/ide-floppy.c
drivers/ide/ide-floppy.c
+54
-52
No files found.
drivers/ide/ide-floppy.c
View file @
ef4604f8
...
...
@@ -156,7 +156,6 @@ typedef struct idefloppy_packet_command_s {
int
request_transfer
;
/* Bytes to transfer */
int
actually_transferred
;
/* Bytes actually transferred */
int
buffer_size
;
/* Size of our data buffer */
char
*
b_data
;
/* Pointer which runs on the buffers */
int
b_count
;
/* Missing/Available data on the current buffer */
struct
request
*
rq
;
/* The corresponding request */
u8
*
buffer
;
/* Data buffer */
...
...
@@ -515,9 +514,6 @@ typedef struct {
u8
reserved
[
4
];
}
idefloppy_mode_parameter_header_t
;
#define IDEFLOPPY_MIN(a,b) ((a)<(b) ? (a):(b))
#define IDEFLOPPY_MAX(a,b) ((a)>(b) ? (a):(b))
/*
* Too bad. The drive wants to send us data which we are not ready to accept.
* Just throw it away.
...
...
@@ -575,59 +571,68 @@ static int idefloppy_do_end_request(ide_drive_t *drive, int uptodate, int nsecs)
static
void
idefloppy_input_buffers
(
ide_drive_t
*
drive
,
idefloppy_pc_t
*
pc
,
unsigned
int
bcount
)
{
struct
request
*
rq
=
pc
->
rq
;
struct
bio
*
bio
=
rq
->
bio
;
int
count
;
struct
bio_vec
*
bvec
;
struct
bio
*
bio
;
unsigned
long
flags
;
char
*
data
;
int
count
,
i
,
done
=
0
;
rq_for_each_bio
(
bio
,
rq
)
{
bio_for_each_segment
(
bvec
,
bio
,
i
)
{
if
(
!
bcount
)
break
;
count
=
min
(
bvec
->
bv_len
,
bcount
);
data
=
bvec_kmap_irq
(
bvec
,
&
flags
);
atapi_input_bytes
(
drive
,
data
,
count
);
bvec_kunmap_irq
(
data
,
&
flags
);
while
(
bcount
)
{
if
(
pc
->
b_count
==
bio
->
bi_size
)
{
rq
->
sector
+=
rq
->
current_nr_sectors
;
rq
->
nr_sectors
-=
rq
->
current_nr_sectors
;
idefloppy_do_end_request
(
drive
,
1
,
0
);
if
((
bio
=
rq
->
bio
)
!=
NULL
)
pc
->
b_count
=
0
;
}
if
(
bio
==
NULL
)
{
printk
(
KERN_ERR
"%s: bio == NULL in "
"idefloppy_input_buffers, bcount == %d
\n
"
,
drive
->
name
,
bcount
);
idefloppy_discard_data
(
drive
,
bcount
);
return
;
}
count
=
IDEFLOPPY_MIN
(
bio
->
bi_size
-
pc
->
b_count
,
bcount
);
atapi_input_bytes
(
drive
,
bio_data
(
bio
)
+
pc
->
b_count
,
count
);
bcount
-=
count
;
pc
->
b_count
+=
count
;
done
+=
count
;
}
}
idefloppy_do_end_request
(
drive
,
1
,
done
>>
9
);
if
(
bcount
)
{
printk
(
KERN_ERR
"%s: leftover data in idefloppy_input_buffers, bcount == %d
\n
"
,
drive
->
name
,
bcount
);
idefloppy_discard_data
(
drive
,
bcount
);
}
}
static
void
idefloppy_output_buffers
(
ide_drive_t
*
drive
,
idefloppy_pc_t
*
pc
,
unsigned
int
bcount
)
{
struct
request
*
rq
=
pc
->
rq
;
struct
bio
*
bio
=
rq
->
bio
;
int
count
;
struct
bio
*
bio
;
struct
bio_vec
*
bvec
;
unsigned
long
flags
;
int
count
,
i
,
done
=
0
;
char
*
data
;
while
(
bcount
)
{
if
(
!
pc
->
b_count
)
{
rq
->
sector
+=
rq
->
current_nr_sectors
;
rq
->
nr_sectors
-=
rq
->
current_nr_sectors
;
idefloppy_do_end_request
(
drive
,
1
,
0
);
if
((
bio
=
rq
->
bio
)
!=
NULL
)
{
pc
->
b_data
=
bio_data
(
bio
);
pc
->
b_count
=
bio
->
bi_size
;
rq_for_each_bio
(
bio
,
rq
)
{
bio_for_each_segment
(
bvec
,
bio
,
i
)
{
if
(
!
bcount
)
break
;
count
=
min
(
bvec
->
bv_len
,
bcount
);
data
=
bvec_kmap_irq
(
bvec
,
&
flags
);
atapi_output_bytes
(
drive
,
data
,
count
);
bvec_kunmap_irq
(
data
,
&
flags
);
bcount
-=
count
;
pc
->
b_count
+=
count
;
done
+=
count
;
}
}
if
(
bio
==
NULL
)
{
printk
(
KERN_ERR
"%s: bio == NULL in "
"idefloppy_output_buffers, bcount == %d
\n
"
,
drive
->
name
,
bcount
);
idefloppy_do_end_request
(
drive
,
1
,
done
>>
9
);
if
(
bcount
)
{
printk
(
KERN_ERR
"%s: leftover data in idefloppy_output_buffers, bcount == %d
\n
"
,
drive
->
name
,
bcount
);
idefloppy_write_zeros
(
drive
,
bcount
);
return
;
}
count
=
IDEFLOPPY_MIN
(
pc
->
b_count
,
bcount
);
atapi_output_bytes
(
drive
,
pc
->
b_data
,
count
);
bcount
-=
count
;
pc
->
b_data
+=
count
;
pc
->
b_count
-=
count
;
}
}
...
...
@@ -732,8 +737,6 @@ static void idefloppy_init_pc (idefloppy_pc_t *pc)
pc
->
request_transfer
=
0
;
pc
->
buffer
=
pc
->
pc_buffer
;
pc
->
buffer_size
=
IDEFLOPPY_PC_BUFFER_SIZE
;
pc
->
b_data
=
NULL
;
// pc->bio = NULL;
pc
->
callback
=
&
idefloppy_pc_callback
;
}
...
...
@@ -1199,7 +1202,6 @@ static void idefloppy_create_rw_cmd (idefloppy_floppy_t *floppy, idefloppy_pc_t
put_unaligned
(
htonl
(
block
),
(
unsigned
int
*
)
&
pc
->
c
[
2
]);
pc
->
callback
=
&
idefloppy_rw_callback
;
pc
->
rq
=
rq
;
pc
->
b_data
=
rq
->
buffer
;
pc
->
b_count
=
cmd
==
READ
?
0
:
rq
->
bio
->
bi_size
;
if
(
rq
->
flags
&
REQ_RW
)
set_bit
(
PC_WRITING
,
&
pc
->
flags
);
...
...
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