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
fa0900a4
Commit
fa0900a4
authored
Oct 30, 2002
by
Matt Domsch
Browse files
Options
Browse Files
Download
Plain Diff
Merge dell.com:/home/mdomsch/bk/linux-2.5
into dell.com:/home/mdomsch/bk/linux-2.5-edd-tolinus
parents
d8c084f9
c6fe3db5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
139 additions
and
125 deletions
+139
-125
arch/i386/boot/setup.S
arch/i386/boot/setup.S
+28
-6
arch/i386/kernel/edd.c
arch/i386/kernel/edd.c
+105
-118
arch/i386/kernel/setup.c
arch/i386/kernel/setup.c
+2
-1
include/asm-i386/edd.h
include/asm-i386/edd.h
+4
-0
No files found.
arch/i386/boot/setup.S
View file @
fa0900a4
...
...
@@ -46,8 +46,9 @@
*
by
Robert
Schwebel
,
December
2001
<
robert
@
schwebel
.
de
>
*
*
BIOS
Enhanced
Disk
Drive
support
*
by
Matt
Domsch
<
Matt_Domsch
@
dell
.
com
>
September
2002
*
*
by
Matt
Domsch
<
Matt_Domsch
@
dell
.
com
>
October
2002
*
conformant
to
T13
Committee
www
.
t13
.
org
*
projects
1572
D
,
1484
D
,
1386
D
,
1226
DT
*/
#include <linux/config.h>
...
...
@@ -549,6 +550,27 @@ done_apm_bios:
#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
#
Do
the
BIOS
Enhanced
Disk
Drive
calls
#
This
consists
of
two
calls
:
#
int
13
h
ah
=
41
h
"Check Extensions Present"
#
int
13
h
ah
=
48
h
"Get Device Parameters"
#
#
A
buffer
of
size
EDDMAXNR
*(
EDDEXTSIZE
+
EDDPARMSIZE
)
is
reserved
for
our
use
#
in
the
empty_zero_page
at
EDDBUF
.
The
first
four
bytes
of
which
are
#
used
to
store
the
device
number
,
interface
support
map
and
version
#
results
from
fn41
.
The
following
74
bytes
are
used
to
store
#
the
results
from
fn48
.
Starting
from
device
80
h
,
fn41
,
then
fn48
#
are
called
and
their
results
stored
in
EDDBUF
+
n
*(
EDDEXTSIZE
+
EDDPARMIZE
)
.
#
Then
the
pointer
is
incremented
to
store
the
data
for
the
next
call
.
#
This
repeats
until
either
a
device
doesn
't exist, or until EDDMAXNR
#
devices
have
been
stored
.
#
The
one
tricky
part
is
that
ds
:
si
always
points
four
bytes
into
#
the
structure
,
and
the
fn41
results
are
stored
at
offsets
#
from
there
.
This
removes
the
need
to
increment
the
pointer
for
#
every
store
,
and
leaves
it
ready
for
the
fn48
call
.
#
A
second
one
-
byte
buffer
,
EDDNR
,
in
the
empty_zero_page
stores
#
the
number
of
BIOS
devices
which
exist
,
up
to
EDDMAXNR
.
#
In
setup
.
c
,
copy_edd
()
stores
both
empty_zero_page
buffers
away
#
for
later
use
,
as
they
would
get
overwritten
otherwise
.
#
This
code
is
sensitive
to
the
size
of
the
structs
in
edd
.
h
edd_start
:
#
%
ds
points
to
the
bootsector
...
...
@@ -559,12 +581,12 @@ edd_start:
movb
$
0x80
,
%
dl
#
BIOS
device
0x80
edd_check_ext
:
movb
$
0x41
,
%
ah
#
Function
41
movw
$
0x55aa
,
%
bx
#
magic
movb
$
CHECKEXTENSIONSPRESENT
,
%
ah
#
Function
41
movw
$
EDDMAGIC1
,
%
bx
#
magic
int
$
0x13
#
make
the
call
jc
edd_done
#
no
more
BIOS
devices
cmpw
$
0xAA55
,
%
bx
#
is
magic
right
?
cmpw
$
EDDMAGIC2
,
%
bx
#
is
magic
right
?
jne
edd_next
#
nope
,
next
...
movb
%
dl
,
%
ds
:
-
4
(%
si
)
#
store
device
number
...
...
@@ -574,7 +596,7 @@ edd_check_ext:
edd_get_device_params
:
movw
$EDDPARMSIZE
,
%
ds
:
(%
si
)
#
put
size
movb
$
0x48
,
%
ah
#
Function
48
movb
$
GETDEVICEPARAMETERS
,
%
ah
#
Function
48
int
$
0x13
#
make
the
call
#
Don
't check for fail return
#
it
doesn
't matter.
...
...
arch/i386/kernel/edd.c
View file @
fa0900a4
...
...
@@ -26,14 +26,10 @@
/*
* Known issues:
* - module unload leaves a directory around. Seems related to
* creating symlinks in that directory. Seen on kernel 2.5.41.
* - refcounting of struct device objects could be improved.
*
* TODO:
* - Add IDE and USB disk device support
* - when driverfs model of discs and partitions changes,
* update symlink accordingly.
* - Get symlink creator helper functions exported from
* drivers/base instead of duplicating them here.
* - move edd.[ch] to better locations if/when one is decided
...
...
@@ -61,10 +57,12 @@ MODULE_AUTHOR("Matt Domsch <Matt_Domsch@Dell.com>");
MODULE_DESCRIPTION
(
"driverfs interface to BIOS EDD information"
);
MODULE_LICENSE
(
"GPL"
);
#define EDD_VERSION "0.0
6 2002-Oct-09
"
#define EDD_VERSION "0.0
7 2002-Oct-24
"
#define EDD_DEVICE_NAME_SIZE 16
#define REPORT_URL "http://domsch.com/linux/edd30/results.html"
#define left (count - (p - buf) - 1)
/*
* bios_dir may go away completely,
* and it definitely won't be at the root
...
...
@@ -78,7 +76,6 @@ static struct driver_dir_entry bios_dir = {
struct
edd_device
{
char
name
[
EDD_DEVICE_NAME_SIZE
];
struct
edd_info
*
info
;
struct
list_head
node
;
struct
driver_dir_entry
dir
;
};
...
...
@@ -86,6 +83,7 @@ struct edd_attribute {
struct
attribute
attr
;
ssize_t
(
*
show
)
(
struct
edd_device
*
edev
,
char
*
buf
,
size_t
count
,
loff_t
off
);
int
(
*
test
)
(
struct
edd_device
*
edev
);
};
/* forward declarations */
...
...
@@ -95,10 +93,11 @@ static struct scsi_device *edd_find_matching_scsi_device(struct edd_device *edev
static
struct
edd_device
*
edd_devices
[
EDDMAXNR
];
#define EDD_DEVICE_ATTR(_name,_mode,_show) \
#define EDD_DEVICE_ATTR(_name,_mode,_show
,_test
) \
struct edd_attribute edd_attr_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.show = _show, \
.test = _test, \
};
static
inline
struct
edd_info
*
...
...
@@ -133,35 +132,36 @@ static struct driverfs_ops edd_attr_ops = {
};
static
int
edd_dump_raw_data
(
char
*
b
,
void
*
data
,
int
length
)
edd_dump_raw_data
(
char
*
b
,
int
count
,
void
*
data
,
int
length
)
{
char
*
orig_b
=
b
;
char
buffer1
[
80
],
buffer2
[
80
],
*
b1
,
*
b2
,
c
;
char
hexbuf
[
80
],
ascbuf
[
20
],
*
h
,
*
a
,
c
;
unsigned
char
*
p
=
data
;
unsigned
long
column
=
0
;
int
length_printed
=
0
;
int
length_printed
=
0
,
d
;
const
char
maxcolumn
=
16
;
while
(
length_printed
<
length
)
{
b1
=
buffer1
;
b2
=
buffer2
;
while
(
length_printed
<
length
&&
count
>
0
)
{
h
=
hexbuf
;
a
=
ascbuf
;
for
(
column
=
0
;
column
<
maxcolumn
&&
length_printed
<
length
;
column
++
)
{
b1
+=
sprintf
(
b1
,
"%02x "
,
(
unsigned
char
)
*
p
);
if
(
*
p
<
32
||
*
p
>
126
)
h
+=
sprintf
(
h
,
"%02x "
,
(
unsigned
char
)
*
p
);
if
(
!
isprint
(
*
p
)
)
c
=
'.'
;
else
c
=
*
p
;
b2
+=
sprintf
(
b2
,
"%c"
,
c
);
a
+=
sprintf
(
a
,
"%c"
,
c
);
p
++
;
length_printed
++
;
}
/* pad out the line */
for
(;
column
<
maxcolumn
;
column
++
)
{
b1
+=
sprintf
(
b1
,
" "
);
b2
+=
sprintf
(
b2
,
" "
);
h
+=
sprintf
(
h
,
" "
);
a
+=
sprintf
(
a
,
" "
);
}
b
+=
sprintf
(
b
,
"%s
\t
%s
\n
"
,
buffer1
,
buffer2
);
d
=
snprintf
(
b
,
count
,
"%s
\t
%s
\n
"
,
hexbuf
,
ascbuf
);
b
+=
d
;
count
-=
d
;
}
return
(
b
-
orig_b
);
}
...
...
@@ -179,19 +179,19 @@ edd_show_host_bus(struct edd_device *edev, char *buf, size_t count, loff_t off)
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
isprint
(
info
->
params
.
host_bus_type
[
i
]))
{
p
+=
s
printf
(
p
,
"%c"
,
info
->
params
.
host_bus_type
[
i
]);
p
+=
s
nprintf
(
p
,
left
,
"%c"
,
info
->
params
.
host_bus_type
[
i
]);
}
else
{
p
+=
s
printf
(
p
,
" "
);
p
+=
s
nprintf
(
p
,
left
,
" "
);
}
}
if
(
!
strncmp
(
info
->
params
.
host_bus_type
,
"ISA"
,
3
))
{
p
+=
s
printf
(
p
,
"
\t
base_address: %x
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
base_address: %x
\n
"
,
info
->
params
.
interface_path
.
isa
.
base_address
);
}
else
if
(
!
strncmp
(
info
->
params
.
host_bus_type
,
"PCIX"
,
4
)
||
!
strncmp
(
info
->
params
.
host_bus_type
,
"PCI"
,
3
))
{
p
+=
s
printf
(
p
,
"
\t
%02x:%02x.%
01x
channel: %u
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
%02x:%02x.%
d
channel: %u
\n
"
,
info
->
params
.
interface_path
.
pci
.
bus
,
info
->
params
.
interface_path
.
pci
.
slot
,
info
->
params
.
interface_path
.
pci
.
function
,
...
...
@@ -199,12 +199,12 @@ edd_show_host_bus(struct edd_device *edev, char *buf, size_t count, loff_t off)
}
else
if
(
!
strncmp
(
info
->
params
.
host_bus_type
,
"IBND"
,
4
)
||
!
strncmp
(
info
->
params
.
host_bus_type
,
"XPRS"
,
4
)
||
!
strncmp
(
info
->
params
.
host_bus_type
,
"HTPT"
,
4
))
{
p
+=
s
printf
(
p
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
TBD: %llx
\n
"
,
info
->
params
.
interface_path
.
ibnd
.
reserved
);
}
else
{
p
+=
s
printf
(
p
,
"
\t
unknown: %llx
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
unknown: %llx
\n
"
,
info
->
params
.
interface_path
.
unknown
.
reserved
);
}
return
(
p
-
buf
);
...
...
@@ -223,43 +223,43 @@ edd_show_interface(struct edd_device *edev, char *buf, size_t count, loff_t off)
for
(
i
=
0
;
i
<
8
;
i
++
)
{
if
(
isprint
(
info
->
params
.
interface_type
[
i
]))
{
p
+=
s
printf
(
p
,
"%c"
,
info
->
params
.
interface_type
[
i
]);
p
+=
s
nprintf
(
p
,
left
,
"%c"
,
info
->
params
.
interface_type
[
i
]);
}
else
{
p
+=
s
printf
(
p
,
" "
);
p
+=
s
nprintf
(
p
,
left
,
" "
);
}
}
if
(
!
strncmp
(
info
->
params
.
interface_type
,
"ATAPI"
,
5
))
{
p
+=
s
printf
(
p
,
"
\t
device: %u lun: %u
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
device: %u lun: %u
\n
"
,
info
->
params
.
device_path
.
atapi
.
device
,
info
->
params
.
device_path
.
atapi
.
lun
);
}
else
if
(
!
strncmp
(
info
->
params
.
interface_type
,
"ATA"
,
3
))
{
p
+=
s
printf
(
p
,
"
\t
device: %u
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
device: %u
\n
"
,
info
->
params
.
device_path
.
ata
.
device
);
}
else
if
(
!
strncmp
(
info
->
params
.
interface_type
,
"SCSI"
,
4
))
{
p
+=
s
printf
(
p
,
"
\t
id: %u lun: %llu
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
id: %u lun: %llu
\n
"
,
info
->
params
.
device_path
.
scsi
.
id
,
info
->
params
.
device_path
.
scsi
.
lun
);
}
else
if
(
!
strncmp
(
info
->
params
.
interface_type
,
"USB"
,
3
))
{
p
+=
s
printf
(
p
,
"
\t
serial_number: %llx
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
serial_number: %llx
\n
"
,
info
->
params
.
device_path
.
usb
.
serial_number
);
}
else
if
(
!
strncmp
(
info
->
params
.
interface_type
,
"1394"
,
4
))
{
p
+=
s
printf
(
p
,
"
\t
eui: %llx
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
eui: %llx
\n
"
,
info
->
params
.
device_path
.
i1394
.
eui
);
}
else
if
(
!
strncmp
(
info
->
params
.
interface_type
,
"FIBRE"
,
5
))
{
p
+=
s
printf
(
p
,
"
\t
wwid: %llx lun: %llx
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
wwid: %llx lun: %llx
\n
"
,
info
->
params
.
device_path
.
fibre
.
wwid
,
info
->
params
.
device_path
.
fibre
.
lun
);
}
else
if
(
!
strncmp
(
info
->
params
.
interface_type
,
"I2O"
,
3
))
{
p
+=
s
printf
(
p
,
"
\t
identity_tag: %llx
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
identity_tag: %llx
\n
"
,
info
->
params
.
device_path
.
i2o
.
identity_tag
);
}
else
if
(
!
strncmp
(
info
->
params
.
interface_type
,
"RAID"
,
4
))
{
p
+=
s
printf
(
p
,
"
\t
identity_tag: %x
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
identity_tag: %x
\n
"
,
info
->
params
.
device_path
.
raid
.
array_number
);
}
else
if
(
!
strncmp
(
info
->
params
.
interface_type
,
"SATA"
,
4
))
{
p
+=
s
printf
(
p
,
"
\t
device: %u
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
device: %u
\n
"
,
info
->
params
.
device_path
.
sata
.
device
);
}
else
{
p
+=
s
printf
(
p
,
"
\t
unknown: %llx %llx
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"
\t
unknown: %llx %llx
\n
"
,
info
->
params
.
device_path
.
unknown
.
reserved1
,
info
->
params
.
device_path
.
unknown
.
reserved2
);
}
...
...
@@ -289,15 +289,15 @@ edd_show_raw_data(struct edd_device *edev, char *buf, size_t count, loff_t off)
if
(
!
(
info
->
params
.
key
==
0xBEDD
||
info
->
params
.
key
==
0xDDBE
))
len
=
info
->
params
.
length
;
p
+=
s
printf
(
p
,
"int13 fn48 returned data:
\n\n
"
);
p
+=
edd_dump_raw_data
(
p
,
((
char
*
)
edd
)
+
4
,
len
);
p
+=
s
nprintf
(
p
,
left
,
"int13 fn48 returned data:
\n\n
"
);
p
+=
edd_dump_raw_data
(
p
,
left
,
((
char
*
)
edd
)
+
4
,
len
);
/* Spec violation. Adaptec AIC7899 returns 0xDDBE
here, when it should be 0xBEDD.
*/
p
+=
s
printf
(
p
,
"
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"
\n
"
);
if
(
info
->
params
.
key
==
0xDDBE
)
{
p
+=
s
printf
(
p
,
p
+=
s
nprintf
(
p
,
left
,
"Warning: Spec violation. Key should be 0xBEDD, is 0xDDBE
\n
"
);
email
++
;
}
...
...
@@ -314,13 +314,13 @@ edd_show_raw_data(struct edd_device *edev, char *buf, size_t count, loff_t off)
}
if
(
checksum
)
{
p
+=
s
printf
(
p
,
p
+=
s
nprintf
(
p
,
left
,
"Warning: Spec violation. Device Path checksum invalid.
\n
"
);
email
++
;
}
if
(
!
nonzero_path
)
{
p
+=
s
printf
(
p
,
"Error: Spec violation. Empty device path.
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"Error: Spec violation. Empty device path.
\n
"
);
email
++
;
goto
out
;
}
...
...
@@ -337,7 +337,7 @@ edd_show_raw_data(struct edd_device *edev, char *buf, size_t count, loff_t off)
}
if
(
warn_padding
)
{
p
+=
s
printf
(
p
,
p
+=
s
nprintf
(
p
,
left
,
"Warning: Spec violation. Padding should be 0x20.
\n
"
);
email
++
;
}
...
...
@@ -350,8 +350,8 @@ edd_show_raw_data(struct edd_device *edev, char *buf, size_t count, loff_t off)
info
->
params
.
interface_path
.
pci
.
function
));
if
(
!
pci_dev
)
{
p
+=
s
printf
(
p
,
"Error: BIOS says this is a PCI device, but the OS doesn't know
\n
"
);
p
+=
s
printf
(
p
,
" about a PCI device at %02x:%02x.%01x
\n
"
,
p
+=
s
nprintf
(
p
,
left
,
"Error: BIOS says this is a PCI device, but the OS doesn't know
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
" about a PCI device at %02x:%02x.%d
\n
"
,
info
->
params
.
interface_path
.
pci
.
bus
,
info
->
params
.
interface_path
.
pci
.
slot
,
info
->
params
.
interface_path
.
pci
.
function
);
...
...
@@ -362,21 +362,21 @@ edd_show_raw_data(struct edd_device *edev, char *buf, size_t count, loff_t off)
}
}
if
(
found_pci
)
{
if
(
found_pci
&&
!
edd_dev_is_type
(
edev
,
"SCSI"
)
)
{
sd
=
edd_find_matching_scsi_device
(
edev
);
if
(
!
sd
)
{
p
+=
s
printf
(
p
,
"Error: BIOS says this is a SCSI device, but
\n
"
);
p
+=
s
printf
(
p
,
" the OS doesn't know about this SCSI device.
\n
"
);
p
+=
s
printf
(
p
,
" Do you have it's driver module loaded?
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"Error: BIOS says this is a SCSI device, but
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
" the OS doesn't know about this SCSI device.
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
" Do you have it's driver module loaded?
\n
"
);
email
++
;
}
}
out:
if
(
email
)
{
p
+=
s
printf
(
p
,
"
\n
Please check %s
\n
"
,
REPORT_URL
);
p
+=
s
printf
(
p
,
"to see if this has been reported. If not,
\n
"
);
p
+=
s
printf
(
p
,
"please send the information requested there.
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"
\n
Please check %s
\n
"
,
REPORT_URL
);
p
+=
s
nprintf
(
p
,
left
,
"to see if this has been reported. If not,
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"please send the information requested there.
\n
"
);
}
return
(
p
-
buf
);
...
...
@@ -391,7 +391,7 @@ edd_show_version(struct edd_device *edev, char *buf, size_t count, loff_t off)
return
0
;
}
p
+=
s
printf
(
p
,
"0x%02x
\n
"
,
info
->
version
);
p
+=
s
nprintf
(
p
,
left
,
"0x%02x
\n
"
,
info
->
version
);
return
(
p
-
buf
);
}
...
...
@@ -406,16 +406,16 @@ edd_show_extensions(struct edd_device *edev, char *buf, size_t count,
}
if
(
info
->
interface_support
&
EDD_EXT_FIXED_DISK_ACCESS
)
{
p
+=
s
printf
(
p
,
"Fixed disk access
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"Fixed disk access
\n
"
);
}
if
(
info
->
interface_support
&
EDD_EXT_DEVICE_LOCKING_AND_EJECTING
)
{
p
+=
s
printf
(
p
,
"Device locking and ejecting
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"Device locking and ejecting
\n
"
);
}
if
(
info
->
interface_support
&
EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT
)
{
p
+=
s
printf
(
p
,
"Enhanced Disk Drive support
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"Enhanced Disk Drive support
\n
"
);
}
if
(
info
->
interface_support
&
EDD_EXT_64BIT_EXTENSIONS
)
{
p
+=
s
printf
(
p
,
"64-bit extensions
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"64-bit extensions
\n
"
);
}
return
(
p
-
buf
);
}
...
...
@@ -431,21 +431,21 @@ edd_show_info_flags(struct edd_device *edev, char *buf, size_t count,
}
if
(
info
->
params
.
info_flags
&
EDD_INFO_DMA_BOUNDRY_ERROR_TRANSPARENT
)
p
+=
s
printf
(
p
,
"DMA boundry error transparent
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"DMA boundry error transparent
\n
"
);
if
(
info
->
params
.
info_flags
&
EDD_INFO_GEOMETRY_VALID
)
p
+=
s
printf
(
p
,
"geometry valid
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"geometry valid
\n
"
);
if
(
info
->
params
.
info_flags
&
EDD_INFO_REMOVABLE
)
p
+=
s
printf
(
p
,
"removable
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"removable
\n
"
);
if
(
info
->
params
.
info_flags
&
EDD_INFO_WRITE_VERIFY
)
p
+=
s
printf
(
p
,
"write verify
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"write verify
\n
"
);
if
(
info
->
params
.
info_flags
&
EDD_INFO_MEDIA_CHANGE_NOTIFICATION
)
p
+=
s
printf
(
p
,
"media change notification
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"media change notification
\n
"
);
if
(
info
->
params
.
info_flags
&
EDD_INFO_LOCKABLE
)
p
+=
s
printf
(
p
,
"lockable
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"lockable
\n
"
);
if
(
info
->
params
.
info_flags
&
EDD_INFO_NO_MEDIA_PRESENT
)
p
+=
s
printf
(
p
,
"no media present
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"no media present
\n
"
);
if
(
info
->
params
.
info_flags
&
EDD_INFO_USE_INT13_FN50
)
p
+=
s
printf
(
p
,
"use int13 fn50
\n
"
);
p
+=
s
nprintf
(
p
,
left
,
"use int13 fn50
\n
"
);
return
(
p
-
buf
);
}
...
...
@@ -459,7 +459,7 @@ edd_show_default_cylinders(struct edd_device *edev, char *buf, size_t count,
return
0
;
}
p
+=
s
printf
(
p
,
"0x%x
\n
"
,
info
->
params
.
num_default_cylinders
);
p
+=
s
nprintf
(
p
,
left
,
"0x%x
\n
"
,
info
->
params
.
num_default_cylinders
);
return
(
p
-
buf
);
}
...
...
@@ -473,7 +473,7 @@ edd_show_default_heads(struct edd_device *edev, char *buf, size_t count,
return
0
;
}
p
+=
s
printf
(
p
,
"0x%x
\n
"
,
info
->
params
.
num_default_heads
);
p
+=
s
nprintf
(
p
,
left
,
"0x%x
\n
"
,
info
->
params
.
num_default_heads
);
return
(
p
-
buf
);
}
...
...
@@ -487,7 +487,7 @@ edd_show_default_sectors_per_track(struct edd_device *edev, char *buf,
return
0
;
}
p
+=
s
printf
(
p
,
"0x%x
\n
"
,
info
->
params
.
sectors_per_track
);
p
+=
s
nprintf
(
p
,
left
,
"0x%x
\n
"
,
info
->
params
.
sectors_per_track
);
return
(
p
-
buf
);
}
...
...
@@ -500,21 +500,10 @@ edd_show_sectors(struct edd_device *edev, char *buf, size_t count, loff_t off)
return
0
;
}
p
+=
s
printf
(
p
,
"0x%llx
\n
"
,
info
->
params
.
number_of_sectors
);
p
+=
s
nprintf
(
p
,
left
,
"0x%llx
\n
"
,
info
->
params
.
number_of_sectors
);
return
(
p
-
buf
);
}
static
EDD_DEVICE_ATTR
(
raw_data
,
0444
,
edd_show_raw_data
);
static
EDD_DEVICE_ATTR
(
version
,
0444
,
edd_show_version
);
static
EDD_DEVICE_ATTR
(
extensions
,
0444
,
edd_show_extensions
);
static
EDD_DEVICE_ATTR
(
info_flags
,
0444
,
edd_show_info_flags
);
static
EDD_DEVICE_ATTR
(
default_cylinders
,
0444
,
edd_show_default_cylinders
);
static
EDD_DEVICE_ATTR
(
default_heads
,
0444
,
edd_show_default_heads
);
static
EDD_DEVICE_ATTR
(
default_sectors_per_track
,
0444
,
edd_show_default_sectors_per_track
);
static
EDD_DEVICE_ATTR
(
sectors
,
0444
,
edd_show_sectors
);
static
EDD_DEVICE_ATTR
(
interface
,
0444
,
edd_show_interface
);
static
EDD_DEVICE_ATTR
(
host_bus
,
0444
,
edd_show_host_bus
);
/*
* Some device instances may not have all the above attributes,
...
...
@@ -524,16 +513,7 @@ static EDD_DEVICE_ATTR(host_bus, 0444, edd_show_host_bus);
* if the default_{cylinders,heads,sectors_per_track} values
* are zero, the BIOS doesn't provide sane values, don't bother
* creating files for them either.
*
* struct attr_test pairs an attribute and a test,
* (the default NULL test being true - the attribute exists)
* and individual existence tests may be written for each
* attribute.
*/
struct
attr_test
{
struct
edd_attribute
*
attr
;
int
(
*
test
)
(
struct
edd_device
*
edev
);
};
static
int
edd_has_default_cylinders
(
struct
edd_device
*
edev
)
...
...
@@ -590,23 +570,34 @@ edd_has_edd30(struct edd_device *edev)
return
0
;
}
static
struct
attr_test
def_attrs
[]
=
{
{.
attr
=
&
edd_attr_raw_data
},
{.
attr
=
&
edd_attr_version
},
{.
attr
=
&
edd_attr_extensions
},
{.
attr
=
&
edd_attr_info_flags
},
{.
attr
=
&
edd_attr_sectors
},
{.
attr
=
&
edd_attr_default_cylinders
,
.
test
=
&
edd_has_default_cylinders
},
{.
attr
=
&
edd_attr_default_heads
,
.
test
=
&
edd_has_default_heads
},
{.
attr
=
&
edd_attr_default_sectors_per_track
,
.
test
=
&
edd_has_default_sectors_per_track
},
{.
attr
=
&
edd_attr_interface
,
.
test
=
&
edd_has_edd30
},
{.
attr
=
&
edd_attr_host_bus
,
.
test
=
&
edd_has_edd30
},
{.
attr
=
NULL
,.
test
=
NULL
},
static
EDD_DEVICE_ATTR
(
raw_data
,
0444
,
edd_show_raw_data
,
NULL
);
static
EDD_DEVICE_ATTR
(
version
,
0444
,
edd_show_version
,
NULL
);
static
EDD_DEVICE_ATTR
(
extensions
,
0444
,
edd_show_extensions
,
NULL
);
static
EDD_DEVICE_ATTR
(
info_flags
,
0444
,
edd_show_info_flags
,
NULL
);
static
EDD_DEVICE_ATTR
(
sectors
,
0444
,
edd_show_sectors
,
NULL
);
static
EDD_DEVICE_ATTR
(
default_cylinders
,
0444
,
edd_show_default_cylinders
,
edd_has_default_cylinders
);
static
EDD_DEVICE_ATTR
(
default_heads
,
0444
,
edd_show_default_heads
,
edd_has_default_heads
);
static
EDD_DEVICE_ATTR
(
default_sectors_per_track
,
0444
,
edd_show_default_sectors_per_track
,
edd_has_default_sectors_per_track
);
static
EDD_DEVICE_ATTR
(
interface
,
0444
,
edd_show_interface
,
edd_has_edd30
);
static
EDD_DEVICE_ATTR
(
host_bus
,
0444
,
edd_show_host_bus
,
edd_has_edd30
);
static
struct
edd_attribute
*
def_attrs
[]
=
{
&
edd_attr_raw_data
,
&
edd_attr_version
,
&
edd_attr_extensions
,
&
edd_attr_info_flags
,
&
edd_attr_sectors
,
&
edd_attr_default_cylinders
,
&
edd_attr_default_heads
,
&
edd_attr_default_sectors_per_track
,
&
edd_attr_interface
,
&
edd_attr_host_bus
,
NULL
,
};
/* edd_get_devpath_length(), edd_fill_devpath(), and edd_device_link()
...
...
@@ -857,23 +848,19 @@ edd_create_file(struct edd_device *edev, struct edd_attribute *attr)
static
inline
void
edd_device_unregister
(
struct
edd_device
*
edev
)
{
driverfs_remove_file
(
&
edev
->
dir
,
"pci_dev"
);
driverfs_remove_file
(
&
edev
->
dir
,
"disc"
);
driverfs_remove_dir
(
&
edev
->
dir
);
list_del_init
(
&
edev
->
node
);
}
static
int
edd_populate_dir
(
struct
edd_device
*
edev
)
{
struct
attr_test
*
s
;
struct
edd_attribute
*
attr
;
int
i
;
int
error
=
0
;
for
(
i
=
0
;
def_attrs
[
i
].
attr
;
i
++
)
{
s
=
&
def_attrs
[
i
];
if
(
!
s
->
test
||
(
s
->
test
&&
!
s
->
test
(
edev
)))
{
if
((
error
=
edd_create_file
(
edev
,
s
->
attr
)))
{
for
(
i
=
0
;
(
attr
=
def_attrs
[
i
]);
i
++
)
{
if
(
!
attr
->
test
||
(
attr
->
test
&&
!
attr
->
test
(
edev
)))
{
if
((
error
=
edd_create_file
(
edev
,
attr
)))
{
break
;
}
}
...
...
@@ -928,7 +915,7 @@ static int __init
edd_init
(
void
)
{
unsigned
int
i
;
int
rc
;
int
rc
=
0
;
struct
edd_device
*
edev
;
printk
(
KERN_INFO
"BIOS EDD facility v%s, %d devices found
\n
"
,
...
...
arch/i386/kernel/setup.c
View file @
fa0900a4
...
...
@@ -471,7 +471,8 @@ static int __init copy_e820_map(struct e820entry * biosmap, int nr_map)
unsigned
char
eddnr
;
struct
edd_info
edd
[
EDDNR
];
/**
* copy_edd() - Copy the BIOS EDD information into a safe place.
* copy_edd() - Copy the BIOS EDD information
* from empty_zero_page into a safe place.
*
*/
static
inline
void
copy_edd
(
void
)
...
...
include/asm-i386/edd.h
View file @
fa0900a4
...
...
@@ -36,6 +36,10 @@
#define EDDMAXNR 6
/* number of edd_info structs starting at EDDBUF */
#define EDDEXTSIZE 4
/* change these if you muck with the structures */
#define EDDPARMSIZE 74
#define CHECKEXTENSIONSPRESENT 0x41
#define GETDEVICEPARAMETERS 0x48
#define EDDMAGIC1 0x55AA
#define EDDMAGIC2 0xAA55
#ifndef __ASSEMBLY__
...
...
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