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
81377879
Commit
81377879
authored
Dec 08, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB storage: remove the raw_bulk.c and raw_bulk.h files as they are no longer needed.
parent
343f4be5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
136 deletions
+0
-136
drivers/usb/storage/raw_bulk.c
drivers/usb/storage/raw_bulk.c
+0
-116
drivers/usb/storage/raw_bulk.h
drivers/usb/storage/raw_bulk.h
+0
-20
No files found.
drivers/usb/storage/raw_bulk.c
deleted
100644 → 0
View file @
343f4be5
/*
* Common routines for a handful of drivers.
* Unrelated to CF/SM - just scatter-gather stuff.
*/
#include "usb.h"
#include "raw_bulk.h"
/*
* The routines below convert scatter-gather to single buffer.
* Some drivers claim this is necessary.
* Nothing is done when use_sg is zero.
*/
/*
* Copy from scatter-gather buffer into a newly allocated single buffer,
* starting at a given index and offset.
* When done, update index and offset.
* Return a pointer to the single buffer.
*/
unsigned
char
*
us_copy_from_sgbuf
(
unsigned
char
*
content
,
int
len
,
int
*
index
,
int
*
offset
,
int
use_sg
)
{
struct
scatterlist
*
sg
;
unsigned
char
*
buffer
;
int
transferred
,
i
;
if
(
!
use_sg
)
return
content
;
sg
=
(
struct
scatterlist
*
)
content
;
buffer
=
kmalloc
(
len
,
GFP_NOIO
);
if
(
buffer
==
NULL
)
return
NULL
;
transferred
=
0
;
i
=
*
index
;
while
(
i
<
use_sg
&&
transferred
<
len
)
{
unsigned
char
*
ptr
;
unsigned
int
length
,
room
;
ptr
=
sg_address
(
sg
[
i
])
+
*
offset
;
room
=
sg
[
i
].
length
-
*
offset
;
length
=
len
-
transferred
;
if
(
length
>
room
)
length
=
room
;
memcpy
(
buffer
+
transferred
,
ptr
,
length
);
transferred
+=
length
;
*
offset
+=
length
;
if
(
length
==
room
)
{
i
++
;
*
offset
=
0
;
}
}
*
index
=
i
;
return
buffer
;
}
unsigned
char
*
us_copy_from_sgbuf_all
(
unsigned
char
*
content
,
int
len
,
int
use_sg
)
{
int
index
,
offset
;
index
=
offset
=
0
;
return
us_copy_from_sgbuf
(
content
,
len
,
&
index
,
&
offset
,
use_sg
);
}
/*
* Copy from a single buffer into a scatter-gather buffer,
* starting at a given index and offset.
* When done, update index and offset.
*/
void
us_copy_to_sgbuf
(
unsigned
char
*
buffer
,
int
buflen
,
void
*
content
,
int
*
index
,
int
*
offset
,
int
use_sg
)
{
struct
scatterlist
*
sg
;
int
i
,
transferred
;
if
(
!
use_sg
)
return
;
transferred
=
0
;
sg
=
content
;
i
=
*
index
;
while
(
i
<
use_sg
&&
transferred
<
buflen
)
{
unsigned
char
*
ptr
;
unsigned
int
length
,
room
;
ptr
=
sg_address
(
sg
[
i
])
+
*
offset
;
room
=
sg
[
i
].
length
-
*
offset
;
length
=
buflen
-
transferred
;
if
(
length
>
room
)
length
=
room
;
memcpy
(
ptr
,
buffer
+
transferred
,
length
);
transferred
+=
length
;
*
offset
+=
length
;
if
(
length
==
room
)
{
i
++
;
*
offset
=
0
;
}
}
*
index
=
i
;
}
void
us_copy_to_sgbuf_all
(
unsigned
char
*
buffer
,
int
buflen
,
void
*
content
,
int
use_sg
)
{
int
index
,
offset
;
index
=
offset
=
0
;
us_copy_to_sgbuf
(
buffer
,
buflen
,
content
,
&
index
,
&
offset
,
use_sg
);
}
drivers/usb/storage/raw_bulk.h
deleted
100644 → 0
View file @
343f4be5
#ifndef _USB_STORAGE_RAW_BULK_H_
#define _USB_STORAGE_RAW_BULK_H_
/* scatter-gather */
extern
unsigned
char
*
us_copy_from_sgbuf
(
unsigned
char
*
content
,
int
buflen
,
int
*
index
,
int
*
offset
,
int
use_sg
);
extern
unsigned
char
*
us_copy_from_sgbuf_all
(
unsigned
char
*
content
,
int
len
,
int
use_sg
);
extern
void
us_copy_to_sgbuf
(
unsigned
char
*
buffer
,
int
buflen
,
void
*
content
,
int
*
index
,
int
*
offset
,
int
use_sg
);
extern
void
us_copy_to_sgbuf_all
(
unsigned
char
*
buffer
,
int
buflen
,
void
*
content
,
int
use_sg
);
#endif
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