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
8090fa24
Commit
8090fa24
authored
Sep 21, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge davem@nuts.ninka.net:/disk1/davem/BK/net-2.5
into kernel.bkbits.net:/home/davem/net-2.5
parents
767ac366
aad00662
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
145 additions
and
154 deletions
+145
-154
drivers/pnp/card.c
drivers/pnp/card.c
+7
-1
drivers/pnp/isapnp/compat.c
drivers/pnp/isapnp/compat.c
+0
-1
drivers/pnp/isapnp/core.c
drivers/pnp/isapnp/core.c
+0
-2
drivers/pnp/isapnp/proc.c
drivers/pnp/isapnp/proc.c
+0
-1
drivers/pnp/pnpbios/bioscalls.c
drivers/pnp/pnpbios/bioscalls.c
+3
-86
drivers/pnp/pnpbios/core.c
drivers/pnp/pnpbios/core.c
+72
-8
drivers/pnp/pnpbios/pnpbios.h
drivers/pnp/pnpbios/pnpbios.h
+38
-2
drivers/pnp/pnpbios/proc.c
drivers/pnp/pnpbios/proc.c
+12
-2
drivers/pnp/quirks.c
drivers/pnp/quirks.c
+0
-24
drivers/pnp/resource.c
drivers/pnp/resource.c
+2
-16
fs/proc/base.c
fs/proc/base.c
+10
-4
include/linux/pnpbios.h
include/linux/pnpbios.h
+1
-7
No files found.
drivers/pnp/card.c
View file @
8090fa24
...
...
@@ -62,8 +62,14 @@ static int card_probe(struct pnp_card * card, struct pnp_card_driver * drv)
if
(
drv
->
probe
)
{
if
(
drv
->
probe
(
clink
,
id
)
>=
0
)
return
1
;
else
else
{
struct
pnp_dev
*
dev
;
card_for_each_dev
(
card
,
dev
)
{
if
(
dev
->
card_link
==
clink
)
pnp_release_card_device
(
dev
);
}
kfree
(
clink
);
}
}
else
return
1
;
}
...
...
drivers/pnp/isapnp/compat.c
View file @
8090fa24
...
...
@@ -9,7 +9,6 @@
/* TODO: see if more isapnp functions are needed here */
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/isapnp.h>
#include <linux/string.h>
...
...
drivers/pnp/isapnp/core.c
View file @
8090fa24
...
...
@@ -35,7 +35,6 @@
*/
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
...
...
@@ -65,7 +64,6 @@ MODULE_PARM(isapnp_rdp, "i");
MODULE_PARM_DESC
(
isapnp_rdp
,
"ISA Plug & Play read data port"
);
MODULE_PARM
(
isapnp_reset
,
"i"
);
MODULE_PARM_DESC
(
isapnp_reset
,
"ISA Plug & Play reset all cards"
);
MODULE_PARM
(
isapnp_allow_dma0
,
"i"
);
MODULE_PARM
(
isapnp_verbose
,
"i"
);
MODULE_PARM_DESC
(
isapnp_verbose
,
"ISA Plug & Play verbose mode"
);
MODULE_LICENSE
(
"GPL"
);
...
...
drivers/pnp/isapnp/proc.c
View file @
8090fa24
...
...
@@ -20,7 +20,6 @@
*/
#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/isapnp.h>
#include <linux/proc_fs.h>
...
...
drivers/pnp/pnpbios/bioscalls.c
View file @
8090fa24
...
...
@@ -23,41 +23,7 @@
#include <asm/system.h>
#include <asm/byteorder.h>
/* PnP BIOS signature: "$PnP" */
#define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24))
#pragma pack(1)
union
pnp_bios_expansion_header
{
struct
{
u32
signature
;
/* "$PnP" */
u8
version
;
/* in BCD */
u8
length
;
/* length in bytes, currently 21h */
u16
control
;
/* system capabilities */
u8
checksum
;
/* all bytes must add up to 0 */
u32
eventflag
;
/* phys. address of the event flag */
u16
rmoffset
;
/* real mode entry point */
u16
rmcseg
;
u16
pm16offset
;
/* 16 bit protected mode entry */
u32
pm16cseg
;
u32
deviceID
;
/* EISA encoded system ID or 0 */
u16
rmdseg
;
/* real mode data segment */
u32
pm16dseg
;
/* 16 bit pm data segment base */
}
fields
;
char
chars
[
0x21
];
/* To calculate the checksum */
};
#pragma pack()
static
union
pnp_bios_expansion_header
*
pnp_bios_hdr
=
NULL
;
/*
* Call this only after init time
*/
static
int
pnp_bios_present
(
void
)
{
return
(
pnp_bios_hdr
!=
NULL
);
}
#include "pnpbios.h"
static
struct
{
u16
offset
;
...
...
@@ -557,10 +523,10 @@ static int pnp_bios_write_escd(char *data, u32 nvram_base)
/*
*
Probing and
Initialization
* Initialization
*/
static
void
pnpbios_prepare_bios_calls
(
union
pnp_bios_expansion_header
*
header
)
void
pnpbios_calls_init
(
union
pnp_bios_install_struct
*
header
)
{
int
i
;
spin_lock_init
(
&
pnp_bios_lock
);
...
...
@@ -576,52 +542,3 @@ static void pnpbios_prepare_bios_calls(union pnp_bios_expansion_header *header)
Q_SET_SEL
(
i
,
PNP_DS
,
header
->
fields
.
pm16dseg
,
64
*
1024
);
}
}
int
pnpbios_probe_installation
(
void
)
{
union
pnp_bios_expansion_header
*
check
;
u8
sum
;
int
length
,
i
;
printk
(
KERN_INFO
"PnPBIOS: Scanning system for PnP BIOS support...
\n
"
);
/*
* Search the defined area (0xf0000-0xffff0) for a valid PnP BIOS
* structure and, if one is found, sets up the selectors and
* entry points
*/
for
(
check
=
(
union
pnp_bios_expansion_header
*
)
__va
(
0xf0000
);
check
<
(
union
pnp_bios_expansion_header
*
)
__va
(
0xffff0
);
((
void
*
)
(
check
))
+=
16
)
{
if
(
check
->
fields
.
signature
!=
PNP_SIGNATURE
)
continue
;
printk
(
KERN_INFO
"PnPBIOS: Found PnP BIOS installation structure at 0x%p
\n
"
,
check
);
length
=
check
->
fields
.
length
;
if
(
!
length
)
{
printk
(
KERN_ERR
"PnPBIOS: installation structure is invalid, skipping
\n
"
);
continue
;
}
for
(
sum
=
0
,
i
=
0
;
i
<
length
;
i
++
)
sum
+=
check
->
chars
[
i
];
if
(
sum
)
{
printk
(
KERN_ERR
"PnPBIOS: installation structure is corrupted, skipping
\n
"
);
continue
;
}
if
(
check
->
fields
.
version
<
0x10
)
{
printk
(
KERN_WARNING
"PnPBIOS: PnP BIOS version %d.%d is not supported
\n
"
,
check
->
fields
.
version
>>
4
,
check
->
fields
.
version
&
15
);
continue
;
}
printk
(
KERN_INFO
"PnPBIOS: PnP BIOS version %d.%d, entry 0x%x:0x%x, dseg 0x%x
\n
"
,
check
->
fields
.
version
>>
4
,
check
->
fields
.
version
&
15
,
check
->
fields
.
pm16cseg
,
check
->
fields
.
pm16offset
,
check
->
fields
.
pm16dseg
);
pnp_bios_hdr
=
check
;
pnpbios_prepare_bios_calls
(
check
);
return
1
;
}
printk
(
KERN_INFO
"PnPBIOS: PnP BIOS support was not detected.
\n
"
);
return
0
;
}
drivers/pnp/pnpbios/core.c
View file @
8090fa24
...
...
@@ -74,6 +74,13 @@
*
*/
static
union
pnp_bios_install_struct
*
pnp_bios_install
=
NULL
;
int
pnp_bios_present
(
void
)
{
return
(
pnp_bios_install
!=
NULL
);
}
struct
pnp_dev_node_info
node_info
;
void
*
pnpbios_kmalloc
(
size_t
size
,
int
f
)
...
...
@@ -410,7 +417,56 @@ static int __init pnpbios_setup(char *str)
__setup
(
"pnpbios="
,
pnpbios_setup
);
#endif
subsys_initcall
(
pnpbios_init
);
/* PnP BIOS signature: "$PnP" */
#define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24))
int
__init
pnpbios_probe_system
(
void
)
{
union
pnp_bios_install_struct
*
check
;
u8
sum
;
int
length
,
i
;
printk
(
KERN_INFO
"PnPBIOS: Scanning system for PnP BIOS support...
\n
"
);
/*
* Search the defined area (0xf0000-0xffff0) for a valid PnP BIOS
* structure and, if one is found, sets up the selectors and
* entry points
*/
for
(
check
=
(
union
pnp_bios_install_struct
*
)
__va
(
0xf0000
);
check
<
(
union
pnp_bios_install_struct
*
)
__va
(
0xffff0
);
((
void
*
)
(
check
))
+=
16
)
{
if
(
check
->
fields
.
signature
!=
PNP_SIGNATURE
)
continue
;
printk
(
KERN_INFO
"PnPBIOS: Found PnP BIOS installation structure at 0x%p
\n
"
,
check
);
length
=
check
->
fields
.
length
;
if
(
!
length
)
{
printk
(
KERN_ERR
"PnPBIOS: installation structure is invalid, skipping
\n
"
);
continue
;
}
for
(
sum
=
0
,
i
=
0
;
i
<
length
;
i
++
)
sum
+=
check
->
chars
[
i
];
if
(
sum
)
{
printk
(
KERN_ERR
"PnPBIOS: installation structure is corrupted, skipping
\n
"
);
continue
;
}
if
(
check
->
fields
.
version
<
0x10
)
{
printk
(
KERN_WARNING
"PnPBIOS: PnP BIOS version %d.%d is not supported
\n
"
,
check
->
fields
.
version
>>
4
,
check
->
fields
.
version
&
15
);
continue
;
}
printk
(
KERN_INFO
"PnPBIOS: PnP BIOS version %d.%d, entry 0x%x:0x%x, dseg 0x%x
\n
"
,
check
->
fields
.
version
>>
4
,
check
->
fields
.
version
&
15
,
check
->
fields
.
pm16cseg
,
check
->
fields
.
pm16offset
,
check
->
fields
.
pm16dseg
);
pnp_bios_install
=
check
;
return
1
;
}
printk
(
KERN_INFO
"PnPBIOS: PnP BIOS support was not detected.
\n
"
);
return
0
;
}
int
__init
pnpbios_init
(
void
)
{
...
...
@@ -421,24 +477,30 @@ int __init pnpbios_init(void)
}
/* scan the system for pnpbios support */
if
(
!
pnpbios_probe_
installation
())
if
(
!
pnpbios_probe_
system
())
return
-
ENODEV
;
/* make preparations for bios calls */
pnpbios_calls_init
(
pnp_bios_install
);
/* read the node info */
if
(
pnp_bios_dev_node_info
(
&
node_info
))
{
ret
=
pnp_bios_dev_node_info
(
&
node_info
);
if
(
ret
)
{
printk
(
KERN_ERR
"PnPBIOS: Unable to get node info. Aborting.
\n
"
);
return
-
EIO
;
return
ret
;
}
/* register with the pnp layer */
pnp_register_protocol
(
&
pnpbios_protocol
);
ret
=
pnp_register_protocol
(
&
pnpbios_protocol
);
if
(
ret
)
{
printk
(
KERN_ERR
"PnPBIOS: Unable to register driver. Aborting.
\n
"
);
return
ret
;
}
#ifdef CONFIG_PROC_FS
/* start the proc interface */
ret
=
pnpbios_proc_init
();
if
(
ret
)
return
ret
;
#endif
printk
(
KERN_ERR
"PnPBIOS: Failed to create proc interface.
\n
"
);
/* scan for pnpbios devices */
build_devlist
();
...
...
@@ -446,6 +508,8 @@ int __init pnpbios_init(void)
return
0
;
}
subsys_initcall
(
pnpbios_init
);
static
int
__init
pnpbios_thread_init
(
void
)
{
#ifdef CONFIG_HOTPLUG
...
...
drivers/pnp/pnpbios/pnpbios.h
View file @
8090fa24
/*
* pnpbios.h - contains
definitions for functions used only locally.
* pnpbios.h - contains
local definitions
*/
#pragma pack(1)
union
pnp_bios_install_struct
{
struct
{
u32
signature
;
/* "$PnP" */
u8
version
;
/* in BCD */
u8
length
;
/* length in bytes, currently 21h */
u16
control
;
/* system capabilities */
u8
checksum
;
/* all bytes must add up to 0 */
u32
eventflag
;
/* phys. address of the event flag */
u16
rmoffset
;
/* real mode entry point */
u16
rmcseg
;
u16
pm16offset
;
/* 16 bit protected mode entry */
u32
pm16cseg
;
u32
deviceID
;
/* EISA encoded system ID or 0 */
u16
rmdseg
;
/* real mode data segment */
u32
pm16dseg
;
/* 16 bit pm data segment base */
}
fields
;
char
chars
[
0x21
];
/* To calculate the checksum */
};
#pragma pack()
extern
int
pnp_bios_present
(
void
);
extern
int
pnpbios_dont_use_current_config
;
extern
void
*
pnpbios_kmalloc
(
size_t
size
,
int
f
);
extern
int
pnpbios_parse_data_stream
(
struct
pnp_dev
*
dev
,
struct
pnp_bios_node
*
node
);
extern
int
pnpbios_read_resources_from_node
(
struct
pnp_resource_table
*
res
,
struct
pnp_bios_node
*
node
);
extern
int
pnpbios_write_resources_to_node
(
struct
pnp_resource_table
*
res
,
struct
pnp_bios_node
*
node
);
extern
void
pnpid32_to_pnpid
(
u32
id
,
char
*
str
);
extern
void
pnpbios_print_status
(
const
char
*
module
,
u16
status
);
extern
int
pnpbios_probe_installation
(
void
);
extern
void
pnpbios_calls_init
(
union
pnp_bios_install_struct
*
header
);
#ifdef CONFIG_PROC_FS
extern
int
pnpbios_interface_attach_device
(
struct
pnp_bios_node
*
node
);
extern
int
pnpbios_proc_init
(
void
);
extern
void
pnpbios_proc_exit
(
void
);
#else
static
inline
int
pnpbios_interface_attach_device
(
struct
pnp_bios_node
*
node
)
{
return
0
;
}
static
inline
int
pnpbios_proc_init
(
void
)
{
return
0
;
}
static
inline
void
pnpbios_proc_exit
(
void
)
{
;
}
#endif
/* CONFIG_PROC */
drivers/pnp/pnpbios/proc.c
View file @
8090fa24
...
...
@@ -31,6 +31,8 @@
#include <asm/uaccess.h>
#include "pnpbios.h"
static
struct
proc_dir_entry
*
proc_pnp
=
NULL
;
static
struct
proc_dir_entry
*
proc_pnp_boot
=
NULL
;
...
...
@@ -213,6 +215,9 @@ int pnpbios_interface_attach_device(struct pnp_bios_node * node)
struct
proc_dir_entry
*
ent
;
sprintf
(
name
,
"%02x"
,
node
->
handle
);
if
(
!
proc_pnp
)
return
-
EIO
;
if
(
!
pnpbios_dont_use_current_config
)
{
ent
=
create_proc_entry
(
name
,
0
,
proc_pnp
);
if
(
ent
)
{
...
...
@@ -221,6 +226,9 @@ int pnpbios_interface_attach_device(struct pnp_bios_node * node)
ent
->
data
=
(
void
*
)(
long
)(
node
->
handle
);
}
}
if
(
!
proc_pnp_boot
)
return
-
EIO
;
ent
=
create_proc_entry
(
name
,
0
,
proc_pnp_boot
);
if
(
ent
)
{
ent
->
read_proc
=
proc_read_node
;
...
...
@@ -228,6 +236,7 @@ int pnpbios_interface_attach_device(struct pnp_bios_node * node)
ent
->
data
=
(
void
*
)(
long
)(
node
->
handle
+
0x100
);
return
0
;
}
return
-
EIO
;
}
...
...
@@ -257,8 +266,9 @@ void __exit pnpbios_proc_exit(void)
{
int
i
;
char
name
[
3
];
if
(
!
proc_pnp
)
return
;
if
(
!
proc_pnp
)
return
;
for
(
i
=
0
;
i
<
0xff
;
i
++
)
{
sprintf
(
name
,
"%02x"
,
i
);
...
...
drivers/pnp/quirks.c
View file @
8090fa24
...
...
@@ -111,28 +111,6 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
return
;
}
extern
int
pnp_allow_dma0
;
static
void
quirk_opl3sax_resources
(
struct
pnp_dev
*
dev
)
{
/* This really isn't a device quirk but isapnp core code
* doesn't allow a DMA channel of 0, afflicted card is an
* OPL3Sax where x=4.
*/
struct
pnp_option
*
res
;
int
max
;
res
=
dev
->
dependent
;
max
=
0
;
for
(;
res
;
res
=
res
->
next
)
{
if
(
res
->
dma
->
map
>
max
)
max
=
res
->
dma
->
map
;
}
if
(
max
==
1
&&
pnp_allow_dma0
==
-
1
)
{
printk
(
KERN_INFO
"pnp: opl3sa4 quirk: Allowing dma 0.
\n
"
);
pnp_allow_dma0
=
1
;
}
return
;
}
/*
* PnP Quirks
* Cards or devices that need some tweaking due to incomplete resource info
...
...
@@ -153,7 +131,6 @@ static struct pnp_fixup pnp_fixups[] = {
{
"CTL0043"
,
quirk_sb16audio_resources
},
{
"CTL0044"
,
quirk_sb16audio_resources
},
{
"CTL0045"
,
quirk_sb16audio_resources
},
{
"YMH0021"
,
quirk_opl3sax_resources
},
{
""
}
};
...
...
@@ -170,4 +147,3 @@ void pnp_fixup_device(struct pnp_dev *dev)
i
++
;
}
}
drivers/pnp/resource.c
View file @
8090fa24
...
...
@@ -21,8 +21,6 @@
#include <linux/pnp.h>
#include "base.h"
int
pnp_allow_dma0
=
-
1
;
/* allow dma 0 during auto activation:
* -1=off (:default), 0=off (set by user), 1=on */
int
pnp_skip_pci_scan
;
/* skip PCI resource scanning */
int
pnp_reserve_irq
[
16
]
=
{
[
0
...
15
]
=
-
1
};
/* reserve (don't use) some IRQ */
int
pnp_reserve_dma
[
8
]
=
{
[
0
...
7
]
=
-
1
};
/* reserve (don't use) some DMA */
...
...
@@ -426,7 +424,7 @@ int pnp_check_irq(struct pnp_dev * dev, int idx)
int
pnp_check_dma
(
struct
pnp_dev
*
dev
,
int
idx
)
{
int
tmp
,
mindma
=
1
;
int
tmp
;
struct
pnp_dev
*
tdev
;
unsigned
long
*
dma
=
&
dev
->
res
.
dma_resource
[
idx
].
start
;
...
...
@@ -435,9 +433,7 @@ int pnp_check_dma(struct pnp_dev * dev, int idx)
return
1
;
/* check if the resource is valid */
if
(
pnp_allow_dma0
==
1
)
mindma
=
0
;
if
(
*
dma
<
mindma
||
*
dma
==
4
||
*
dma
>
7
)
if
(
*
dma
<
0
||
*
dma
==
4
||
*
dma
>
7
)
return
0
;
/* check if the resource is reserved */
...
...
@@ -488,16 +484,6 @@ EXPORT_SYMBOL(pnp_register_port_resource);
EXPORT_SYMBOL
(
pnp_register_mem_resource
);
/* format is: allowdma0 */
static
int
__init
pnp_allowdma0
(
char
*
str
)
{
pnp_allow_dma0
=
1
;
return
1
;
}
__setup
(
"allowdma0"
,
pnp_allowdma0
);
/* format is: pnp_reserve_irq=irq1[,irq2] .... */
static
int
__init
pnp_setup_reserve_irq
(
char
*
str
)
...
...
fs/proc/base.c
View file @
8090fa24
...
...
@@ -1196,8 +1196,10 @@ static struct file_operations proc_pid_attr_operations = {
.
write
=
proc_pid_attr_write
,
};
static
struct
file_operations
proc_attr_operations
;
static
struct
inode_operations
proc_attr_inode_operations
;
static
struct
file_operations
proc_tid_attr_operations
;
static
struct
inode_operations
proc_tid_attr_inode_operations
;
static
struct
file_operations
proc_tgid_attr_operations
;
static
struct
inode_operations
proc_tgid_attr_inode_operations
;
#endif
/* SMP-safe */
...
...
@@ -1304,10 +1306,14 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
break
;
#ifdef CONFIG_SECURITY
case
PROC_TID_ATTR
:
inode
->
i_nlink
=
2
;
inode
->
i_op
=
&
proc_tid_attr_inode_operations
;
inode
->
i_fop
=
&
proc_tid_attr_operations
;
break
;
case
PROC_TGID_ATTR
:
inode
->
i_nlink
=
2
;
inode
->
i_op
=
&
proc_attr_inode_operations
;
inode
->
i_fop
=
&
proc_attr_operations
;
inode
->
i_op
=
&
proc_
tgid_
attr_inode_operations
;
inode
->
i_fop
=
&
proc_
tgid_
attr_operations
;
break
;
case
PROC_TID_ATTR_CURRENT
:
case
PROC_TGID_ATTR_CURRENT
:
...
...
include/linux/pnpbios.h
View file @
8090fa24
...
...
@@ -26,7 +26,7 @@
#ifdef __KERNEL__
#include <linux/types.h>
#include <linux/p
ci
.h>
#include <linux/p
np
.h>
/*
* Return codes
...
...
@@ -131,13 +131,7 @@ struct pnp_bios_node {
#ifdef CONFIG_PNPBIOS
/* non-exported */
extern
int
pnpbios_dont_use_current_config
;
extern
struct
pnp_dev_node_info
node_info
;
extern
void
*
pnpbios_kmalloc
(
size_t
size
,
int
f
);
extern
int
pnpbios_init
(
void
);
extern
int
pnpbios_interface_attach_device
(
struct
pnp_bios_node
*
node
);
extern
int
pnpbios_proc_init
(
void
);
extern
void
pnpbios_proc_exit
(
void
);
extern
int
pnp_bios_dev_node_info
(
struct
pnp_dev_node_info
*
data
);
extern
int
pnp_bios_get_dev_node
(
u8
*
nodenum
,
char
config
,
struct
pnp_bios_node
*
data
);
...
...
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