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
d04b51de
Commit
d04b51de
authored
Mar 25, 2003
by
Adam Belay
Browse files
Options
Browse Files
Download
Plain Diff
Merge
http://linux.bkbits.net/linux-2.5
into neo.rr.com:/home/ambx1/src/bk/linus-2.5
parents
b4f6270e
b822f83d
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
200 additions
and
117 deletions
+200
-117
drivers/isdn/hisax/hisax_fcpcipnp.c
drivers/isdn/hisax/hisax_fcpcipnp.c
+2
-2
drivers/pnp/card.c
drivers/pnp/card.c
+46
-26
drivers/pnp/pnpbios/core.c
drivers/pnp/pnpbios/core.c
+102
-35
drivers/pnp/pnpbios/proc.c
drivers/pnp/pnpbios/proc.c
+25
-40
include/linux/pnp.h
include/linux/pnp.h
+4
-3
include/linux/pnpbios.h
include/linux/pnpbios.h
+10
-1
sound/isa/als100.c
sound/isa/als100.c
+5
-4
sound/isa/sb/es968.c
sound/isa/sb/es968.c
+4
-4
sound/oss/sb_card.c
sound/oss/sb_card.c
+1
-1
sound/oss/sb_card.h
sound/oss/sb_card.h
+1
-1
No files found.
drivers/isdn/hisax/hisax_fcpcipnp.c
View file @
d04b51de
...
...
@@ -909,7 +909,7 @@ static struct pci_driver fcpci_driver = {
#ifdef CONFIG_PNP_CARD
static
int
__devinit
fcpnp_probe
(
struct
pnp_card
*
card
,
const
struct
pnp_card_id
*
card_id
)
const
struct
pnp_card_
device_
id
*
card_id
)
{
struct
fritz_adapter
*
adapter
;
struct
pnp_dev
*
pnp_dev
;
...
...
@@ -955,7 +955,7 @@ static void __devexit fcpnp_remove(struct pnp_card *pcard)
delete_adapter
(
adapter
);
}
static
struct
pnp_card_id
fcpnp_ids
[]
__devinitdata
=
{
static
struct
pnp_card_
device_
id
fcpnp_ids
[]
__devinitdata
=
{
{
.
id
=
"AVM0900"
,
.
driver_data
=
(
unsigned
long
)
"Fritz!Card PnP"
,
.
devs
=
{
{
"AVM0900"
}
},
...
...
drivers/pnp/card.c
View file @
d04b51de
...
...
@@ -19,11 +19,12 @@
#include "base.h"
LIST_HEAD
(
pnp_cards
);
LIST_HEAD
(
pnp_card_drivers
);
static
const
struct
pnp_card_id
*
match_card
(
struct
pnp_card_driver
*
drv
,
struct
pnp_card
*
card
)
static
const
struct
pnp_card_
device_
id
*
match_card
(
struct
pnp_card_driver
*
drv
,
struct
pnp_card
*
card
)
{
const
struct
pnp_card_id
*
drv_id
=
drv
->
id_table
;
const
struct
pnp_card_
device_
id
*
drv_id
=
drv
->
id_table
;
while
(
*
drv_id
->
id
){
if
(
compare_pnp_id
(
card
->
id
,
drv_id
->
id
))
return
drv_id
;
...
...
@@ -32,21 +33,41 @@ static const struct pnp_card_id * match_card(struct pnp_card_driver * drv, struc
return
NULL
;
}
static
void
generic_
card_remove
(
struct
pnp_dev
*
dev
)
static
void
card_remove
(
struct
pnp_dev
*
dev
)
{
dev
->
card_link
=
NULL
;
}
static
void
generic_
card_remove_first
(
struct
pnp_dev
*
dev
)
static
void
card_remove_first
(
struct
pnp_dev
*
dev
)
{
struct
pnp_card_driver
*
drv
=
to_pnp_card_driver
(
dev
->
driver
);
if
(
!
dev
->
card
||
!
drv
)
return
;
if
(
drv
->
remove
)
drv
->
remove
(
dev
->
card_link
);
drv
->
link
.
remove
=
&
generic_
card_remove
;
drv
->
link
.
remove
=
&
card_remove
;
kfree
(
dev
->
card_link
);
generic_card_remove
(
dev
);
card_remove
(
dev
);
}
static
int
card_probe
(
struct
pnp_card
*
card
,
struct
pnp_card_driver
*
drv
)
{
const
struct
pnp_card_device_id
*
id
=
match_card
(
drv
,
card
);
if
(
id
)
{
struct
pnp_card_link
*
clink
=
pnp_alloc
(
sizeof
(
struct
pnp_card_link
));
if
(
!
clink
)
return
0
;
clink
->
card
=
card
;
clink
->
driver
=
drv
;
if
(
drv
->
probe
)
{
if
(
drv
->
probe
(
clink
,
id
)
>=
0
)
return
1
;
else
kfree
(
clink
);
}
else
return
1
;
}
return
0
;
}
/**
...
...
@@ -103,7 +124,7 @@ static void pnp_release_card(struct device *dmdev)
int
pnp_add_card
(
struct
pnp_card
*
card
)
{
int
error
;
struct
list_head
*
pos
;
struct
list_head
*
pos
,
*
temp
;
if
(
!
card
||
!
card
->
protocol
)
return
-
EINVAL
;
...
...
@@ -112,6 +133,7 @@ int pnp_add_card(struct pnp_card * card)
card
->
dev
.
bus
=
NULL
;
card
->
dev
.
release
=
&
pnp_release_card
;
error
=
device_register
(
&
card
->
dev
);
if
(
error
==
0
)
{
spin_lock
(
&
pnp_lock
);
list_add_tail
(
&
card
->
global_list
,
&
pnp_cards
);
...
...
@@ -125,6 +147,12 @@ int pnp_add_card(struct pnp_card * card)
struct
pnp_dev
*
dev
=
card_to_pnp_dev
(
pos
);
__pnp_add_device
(
dev
);
}
/* match with card drivers */
list_for_each_safe
(
pos
,
temp
,
&
pnp_card_drivers
){
struct
pnp_card_driver
*
drv
=
list_entry
(
pos
,
struct
pnp_card_driver
,
global_list
);
card_probe
(
card
,
drv
);
}
}
else
pnp_err
(
"sysfs failure, card '%s' will be unavailable"
,
card
->
dev
.
bus_id
);
return
error
;
...
...
@@ -248,9 +276,9 @@ void pnp_release_card_device(struct pnp_dev * dev)
if
(
!
drv
)
return
;
down_write
(
&
dev
->
dev
.
bus
->
subsys
.
rwsem
);
drv
->
link
.
remove
=
&
generic_
card_remove
;
drv
->
link
.
remove
=
&
card_remove
;
device_release_driver
(
&
dev
->
dev
);
drv
->
link
.
remove
=
&
generic_
card_remove_first
;
drv
->
link
.
remove
=
&
card_remove_first
;
up_write
(
&
dev
->
dev
.
bus
->
subsys
.
rwsem
);
}
...
...
@@ -268,25 +296,16 @@ int pnp_register_card_driver(struct pnp_card_driver * drv)
drv
->
link
.
id_table
=
NULL
;
/* this will disable auto matching */
drv
->
link
.
flags
=
drv
->
flags
;
drv
->
link
.
probe
=
NULL
;
drv
->
link
.
remove
=
&
generic_
card_remove_first
;
drv
->
link
.
remove
=
&
card_remove_first
;
spin_lock
(
&
pnp_lock
);
list_add_tail
(
&
drv
->
global_list
,
&
pnp_card_drivers
);
spin_unlock
(
&
pnp_lock
);
pnp_register_driver
(
&
drv
->
link
);
list_for_each_safe
(
pos
,
temp
,
&
pnp_cards
){
struct
pnp_card
*
card
=
list_entry
(
pos
,
struct
pnp_card
,
global_list
);
const
struct
pnp_card_id
*
id
=
match_card
(
drv
,
card
);
if
(
id
)
{
struct
pnp_card_link
*
clink
=
pnp_alloc
(
sizeof
(
struct
pnp_card_link
));
if
(
!
clink
)
continue
;
clink
->
card
=
card
;
clink
->
driver
=
drv
;
if
(
drv
->
probe
)
{
if
(
drv
->
probe
(
clink
,
id
)
>=
0
)
count
++
;
}
else
count
++
;
}
count
+=
card_probe
(
card
,
drv
);
}
return
count
;
}
...
...
@@ -298,9 +317,10 @@ int pnp_register_card_driver(struct pnp_card_driver * drv)
void
pnp_unregister_card_driver
(
struct
pnp_card_driver
*
drv
)
{
spin_lock
(
&
pnp_lock
);
list_del
(
&
drv
->
global_list
);
spin_unlock
(
&
pnp_lock
);
pnp_unregister_driver
(
&
drv
->
link
);
pnp_dbg
(
"the card driver '%s' has been unregistered"
,
drv
->
name
);
}
EXPORT_SYMBOL
(
pnp_add_card
);
...
...
drivers/pnp/pnpbios/core.c
View file @
d04b51de
This diff is collapsed.
Click to expand it.
drivers/pnp/pnpbios/proc.c
View file @
d04b51de
...
...
@@ -31,7 +31,6 @@
static
struct
proc_dir_entry
*
proc_pnp
=
NULL
;
static
struct
proc_dir_entry
*
proc_pnp_boot
=
NULL
;
static
struct
pnp_dev_node_info
node_info
;
static
int
proc_read_pnpconfig
(
char
*
buf
,
char
**
start
,
off_t
pos
,
int
count
,
int
*
eof
,
void
*
data
)
...
...
@@ -136,7 +135,7 @@ static int proc_read_devices(char *buf, char **start, off_t pos,
/* 26 = the number of characters per line sprintf'ed */
if
((
p
-
buf
+
26
)
>
count
)
break
;
if
(
pnp_bios_get_dev_node
(
&
nodenum
,
1
,
node
))
if
(
pnp_bios_get_dev_node
(
&
nodenum
,
PNPMODE_STATIC
,
node
))
break
;
p
+=
sprintf
(
p
,
"%02x
\t
%08x
\t
%02x:%02x:%02x
\t
%04x
\n
"
,
node
->
handle
,
node
->
eisa_id
,
...
...
@@ -193,6 +192,30 @@ static int proc_write_node(struct file *file, const char *buf,
return
count
;
}
int
pnpbios_interface_attach_device
(
struct
pnp_bios_node
*
node
)
{
char
name
[
3
];
struct
proc_dir_entry
*
ent
;
sprintf
(
name
,
"%02x"
,
node
->
handle
);
if
(
!
pnpbios_dont_use_current_config
)
{
ent
=
create_proc_entry
(
name
,
0
,
proc_pnp
);
if
(
ent
)
{
ent
->
read_proc
=
proc_read_node
;
ent
->
write_proc
=
proc_write_node
;
ent
->
data
=
(
void
*
)(
long
)(
node
->
handle
);
}
}
ent
=
create_proc_entry
(
name
,
0
,
proc_pnp_boot
);
if
(
ent
)
{
ent
->
read_proc
=
proc_read_node
;
ent
->
write_proc
=
proc_write_node
;
ent
->
data
=
(
void
*
)(
long
)(
node
->
handle
+
0x100
);
return
0
;
}
return
-
EIO
;
}
/*
* When this is called, pnpbios functions are assumed to
* work and the pnpbios_dont_use_current_config flag
...
...
@@ -200,14 +223,6 @@ static int proc_write_node(struct file *file, const char *buf,
*/
int
__init
pnpbios_proc_init
(
void
)
{
struct
pnp_bios_node
*
node
;
struct
proc_dir_entry
*
ent
;
char
name
[
3
];
u8
nodenum
;
if
(
pnp_bios_dev_node_info
(
&
node_info
))
return
-
EIO
;
proc_pnp
=
proc_mkdir
(
"pnp"
,
proc_bus
);
if
(
!
proc_pnp
)
return
-
EIO
;
...
...
@@ -219,36 +234,6 @@ int __init pnpbios_proc_init( void )
create_proc_read_entry
(
"escd_info"
,
0
,
proc_pnp
,
proc_read_escdinfo
,
NULL
);
create_proc_read_entry
(
"escd"
,
S_IRUSR
,
proc_pnp
,
proc_read_escd
,
NULL
);
create_proc_read_entry
(
"legacy_device_resources"
,
0
,
proc_pnp
,
proc_read_legacyres
,
NULL
);
node
=
pnpbios_kmalloc
(
node_info
.
max_node_size
,
GFP_KERNEL
);
if
(
!
node
)
return
-
ENOMEM
;
for
(
nodenum
=
0
;
nodenum
<
0xff
;
)
{
u8
thisnodenum
=
nodenum
;
if
(
pnp_bios_get_dev_node
(
&
nodenum
,
1
,
node
)
!=
0
)
break
;
sprintf
(
name
,
"%02x"
,
node
->
handle
);
if
(
!
pnpbios_dont_use_current_config
)
{
ent
=
create_proc_entry
(
name
,
0
,
proc_pnp
);
if
(
ent
)
{
ent
->
read_proc
=
proc_read_node
;
ent
->
write_proc
=
proc_write_node
;
ent
->
data
=
(
void
*
)(
long
)(
node
->
handle
);
}
}
ent
=
create_proc_entry
(
name
,
0
,
proc_pnp_boot
);
if
(
ent
)
{
ent
->
read_proc
=
proc_read_node
;
ent
->
write_proc
=
proc_write_node
;
ent
->
data
=
(
void
*
)(
long
)(
node
->
handle
+
0x100
);
}
if
(
nodenum
<=
thisnodenum
)
{
printk
(
KERN_ERR
"%s Node number 0x%x is out of sequence following node 0x%x. Aborting.
\n
"
,
"PnPBIOS: proc_init:"
,
(
unsigned
int
)
nodenum
,
(
unsigned
int
)
thisnodenum
);
break
;
}
}
kfree
(
node
);
return
0
;
}
...
...
include/linux/pnp.h
View file @
d04b51de
...
...
@@ -295,7 +295,7 @@ struct pnp_device_id {
unsigned
long
driver_data
;
/* data private to the driver */
};
struct
pnp_card_id
{
struct
pnp_card_
device_
id
{
char
id
[
PNP_ID_LEN
];
unsigned
long
driver_data
;
/* data private to the driver */
struct
{
...
...
@@ -315,10 +315,11 @@ struct pnp_driver {
#define to_pnp_driver(drv) container_of(drv, struct pnp_driver, driver)
struct
pnp_card_driver
{
struct
list_head
global_list
;
char
*
name
;
const
struct
pnp_card_id
*
id_table
;
const
struct
pnp_card_
device_
id
*
id_table
;
unsigned
int
flags
;
int
(
*
probe
)
(
struct
pnp_card_link
*
card
,
const
struct
pnp_card_id
*
card_id
);
int
(
*
probe
)
(
struct
pnp_card_link
*
card
,
const
struct
pnp_card_
device_
id
*
card_id
);
void
(
*
remove
)
(
struct
pnp_card_link
*
card
);
struct
pnp_driver
link
;
};
...
...
include/linux/pnpbios.h
View file @
d04b51de
...
...
@@ -29,7 +29,7 @@
#include <linux/pci.h>
/*
*
Status codes (warnings and errors)
*
Return codes
*/
#define PNP_SUCCESS 0x00
#define PNP_NOT_SET_STATICALLY 0x7f
...
...
@@ -75,6 +75,7 @@
#define PNPMSG_POWER_OFF 0x41
#define PNPMSG_PNP_OS_ACTIVE 0x42
#define PNPMSG_PNP_OS_INACTIVE 0x43
/*
* Plug and Play BIOS flags
*/
...
...
@@ -88,6 +89,12 @@
#define pnpbios_is_static(x) (((x)->flags & 0x0100) == 0x0000)
#define pnpbios_is_dynamic(x) ((x)->flags & 0x0080)
/*
* Function Parameters
*/
#define PNPMODE_STATIC 1
#define PNPMODE_DYNAMIC 0
/* 0x8000 through 0xffff are OEM defined */
#pragma pack(1)
...
...
@@ -125,8 +132,10 @@ struct pnp_bios_node {
/* 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
);
...
...
sound/isa/als100.c
View file @
d04b51de
...
...
@@ -98,7 +98,7 @@ struct snd_card_als100 {
struct
pnp_dev
*
devopl
;
};
static
struct
pnp_card_id
snd_als100_pnpids
[]
__devinitdata
=
{
static
struct
pnp_card_
device_
id
snd_als100_pnpids
[]
__devinitdata
=
{
/* ALS100 - PRO16PNP */
{
.
id
=
"ALS0001"
,
.
devs
=
{
{
"@@@0001"
},
{
"@X@0001"
},
{
"@H@0001"
},
}
},
/* ALS110 - MF1000 - Digimate 3D Sound */
...
...
@@ -118,7 +118,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_als100_pnpids);
static
int
__devinit
snd_card_als100_isapnp
(
int
dev
,
struct
snd_card_als100
*
acard
,
struct
pnp_card_link
*
card
,
const
struct
pnp_card_id
*
id
)
const
struct
pnp_card_
device_
id
*
id
)
{
struct
pnp_dev
*
pdev
;
struct
pnp_resource_table
*
cfg
=
kmalloc
(
GFP_ATOMIC
,
sizeof
(
struct
pnp_resource_table
));
...
...
@@ -151,6 +151,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca
err
=
pnp_activate_dev
(
pdev
);
if
(
err
<
0
)
{
printk
(
KERN_ERR
PFX
"AUDIO pnp configure failure
\n
"
);
kfree
(
cfg
);
return
err
;
}
port
[
dev
]
=
pnp_port_start
(
pdev
,
0
);
...
...
@@ -209,7 +210,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca
static
int
__init
snd_card_als100_probe
(
int
dev
,
struct
pnp_card_link
*
pcard
,
const
struct
pnp_card_id
*
pid
)
const
struct
pnp_card_
device_
id
*
pid
)
{
int
error
;
sb_t
*
chip
;
...
...
@@ -287,7 +288,7 @@ static int __init snd_card_als100_probe(int dev,
}
static
int
__devinit
snd_als100_pnp_detect
(
struct
pnp_card_link
*
card
,
const
struct
pnp_card_id
*
id
)
const
struct
pnp_card_
device_
id
*
id
)
{
static
int
dev
;
int
res
;
...
...
sound/isa/sb/es968.c
View file @
d04b51de
...
...
@@ -69,7 +69,7 @@ struct snd_card_es968 {
struct
pnp_dev
*
dev
;
};
static
struct
pnp_card_id
snd_es968_pnpids
[]
__devinitdata
=
{
static
struct
pnp_card_
device_
id
snd_es968_pnpids
[]
__devinitdata
=
{
{
.
id
=
"ESS0968"
,
.
devs
=
{
{
"@@@0968"
},
}
},
{
.
id
=
""
,
}
/* end */
};
...
...
@@ -92,7 +92,7 @@ static void snd_card_es968_interrupt(int irq, void *dev_id,
static
int
__devinit
snd_card_es968_isapnp
(
int
dev
,
struct
snd_card_es968
*
acard
,
struct
pnp_card_link
*
card
,
const
struct
pnp_card_id
*
id
)
const
struct
pnp_card_
device_
id
*
id
)
{
struct
pnp_dev
*
pdev
;
struct
pnp_resource_table
*
cfg
=
kmalloc
(
GFP_ATOMIC
,
sizeof
(
struct
pnp_resource_table
));
...
...
@@ -133,7 +133,7 @@ static int __devinit snd_card_es968_isapnp(int dev, struct snd_card_es968 *acard
static
int
__init
snd_card_es968_probe
(
int
dev
,
struct
pnp_card_link
*
pcard
,
const
struct
pnp_card_id
*
pid
)
const
struct
pnp_card_
device_
id
*
pid
)
{
int
error
;
sb_t
*
chip
;
...
...
@@ -188,7 +188,7 @@ static int __init snd_card_es968_probe(int dev,
}
static
int
__devinit
snd_es968_pnp_detect
(
struct
pnp_card_link
*
card
,
const
struct
pnp_card_id
*
id
)
const
struct
pnp_card_
device_
id
*
id
)
{
static
int
dev
;
int
res
;
...
...
sound/oss/sb_card.c
View file @
d04b51de
...
...
@@ -224,7 +224,7 @@ static void sb_dev2cfg(struct pnp_dev *dev, struct sb_card_config *scc)
}
/* Probe callback function for the PnP API */
static
int
sb_pnp_probe
(
struct
pnp_card_link
*
card
,
const
struct
pnp_card_id
*
card_id
)
static
int
sb_pnp_probe
(
struct
pnp_card_link
*
card
,
const
struct
pnp_card_
device_
id
*
card_id
)
{
struct
sb_card_config
*
scc
;
struct
sb_module_options
sbmo
=
{
0
};
/* Default to 0 for PnP */
...
...
sound/oss/sb_card.h
View file @
d04b51de
...
...
@@ -23,7 +23,7 @@ struct sb_card_config {
*/
/* Card PnP ID Table */
static
struct
pnp_card_id
sb_pnp_card_table
[]
=
{
static
struct
pnp_card_
device_
id
sb_pnp_card_table
[]
=
{
/* Sound Blaster 16 */
{.
id
=
"CTL0024"
,
.
driver_data
=
0
,
devs
:
{
{.
id
=
"CTL0031"
},
}
},
/* Sound Blaster 16 */
...
...
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