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
708d7b68
Commit
708d7b68
authored
Dec 29, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
8ac9b734
45b9faf3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
214 deletions
+65
-214
drivers/pcmcia/i82365.c
drivers/pcmcia/i82365.c
+11
-15
drivers/pnp/isapnp/Makefile
drivers/pnp/isapnp/Makefile
+2
-2
drivers/pnp/isapnp/compat.c
drivers/pnp/isapnp/compat.c
+12
-13
drivers/pnp/isapnp/core.c
drivers/pnp/isapnp/core.c
+26
-28
drivers/pnp/isapnp/proc.c
drivers/pnp/isapnp/proc.c
+1
-0
include/linux/isapnp.h
include/linux/isapnp.h
+2
-136
include/linux/pci.h
include/linux/pci.h
+3
-16
include/linux/pnp.h
include/linux/pnp.h
+8
-4
No files found.
drivers/pcmcia/i82365.c
View file @
708d7b68
...
@@ -814,7 +814,7 @@ static void __init add_pcic(int ns, int type)
...
@@ -814,7 +814,7 @@ static void __init add_pcic(int ns, int type)
#ifdef CONFIG_ISA
#ifdef CONFIG_ISA
#ifdef
__ISAPNP__
#ifdef
CONFIG_PNP
static
struct
isapnp_device_id
id_table
[]
__initdata
=
{
static
struct
isapnp_device_id
id_table
[]
__initdata
=
{
{
ISAPNP_ANY_ID
,
ISAPNP_ANY_ID
,
ISAPNP_VENDOR
(
'P'
,
'N'
,
'P'
),
{
ISAPNP_ANY_ID
,
ISAPNP_ANY_ID
,
ISAPNP_VENDOR
(
'P'
,
'N'
,
'P'
),
ISAPNP_FUNCTION
(
0x0e00
),
(
unsigned
long
)
"Intel 82365-Compatible"
},
ISAPNP_FUNCTION
(
0x0e00
),
(
unsigned
long
)
"Intel 82365-Compatible"
},
...
@@ -826,32 +826,28 @@ static struct isapnp_device_id id_table[] __initdata = {
...
@@ -826,32 +826,28 @@ static struct isapnp_device_id id_table[] __initdata = {
};
};
MODULE_DEVICE_TABLE
(
isapnp
,
id_table
);
MODULE_DEVICE_TABLE
(
isapnp
,
id_table
);
static
struct
p
ci
_dev
*
i82365_pnpdev
;
static
struct
p
np
_dev
*
i82365_pnpdev
;
#endif
#endif
static
void
__init
isa_probe
(
void
)
static
void
__init
isa_probe
(
void
)
{
{
int
i
,
j
,
sock
,
k
,
ns
,
id
;
int
i
,
j
,
sock
,
k
,
ns
,
id
;
ioaddr_t
port
;
ioaddr_t
port
;
#ifdef
__ISAPNP__
#ifdef
CONFIG_PNP
struct
isapnp_device_id
*
devid
;
struct
isapnp_device_id
*
devid
;
struct
p
ci
_dev
*
dev
;
struct
p
np
_dev
*
dev
;
for
(
devid
=
id_table
;
devid
->
vendor
;
devid
++
)
{
for
(
devid
=
id_table
;
devid
->
vendor
;
devid
++
)
{
if
((
dev
=
isa
pnp_find_dev
(
NULL
,
devid
->
vendor
,
devid
->
function
,
NULL
)))
{
if
((
dev
=
pnp_find_dev
(
NULL
,
devid
->
vendor
,
devid
->
function
,
NULL
)))
{
printk
(
"
ISA
PNP "
);
printk
(
"PNP "
);
if
(
dev
->
prepare
&&
dev
->
prepare
(
dev
)
<
0
)
{
if
(
pnp_activate_dev
(
dev
,
NULL
)
<
0
)
{
printk
(
"prepare failed
\n
"
);
break
;
}
if
(
dev
->
activate
&&
dev
->
activate
(
dev
)
<
0
)
{
printk
(
"activate failed
\n
"
);
printk
(
"activate failed
\n
"
);
break
;
break
;
}
}
if
((
i365_base
=
pci_resource_start
(
dev
,
0
)))
{
i365_base
=
pnp_port_start
(
dev
,
0
);
if
(
i365_base
)
{
printk
(
"no resources ?
\n
"
);
printk
(
"no resources ?
\n
"
);
break
;
break
;
}
}
...
@@ -1644,8 +1640,8 @@ static void __exit exit_i82365(void)
...
@@ -1644,8 +1640,8 @@ static void __exit exit_i82365(void)
release_region
(
socket
[
i
].
ioaddr
,
2
);
release_region
(
socket
[
i
].
ioaddr
,
2
);
}
}
#if defined(CONFIG_ISA) && defined(__ISAPNP__)
#if defined(CONFIG_ISA) && defined(__ISAPNP__)
if
(
i82365_pnpdev
&&
i82365_pnpdev
->
deactivate
)
if
(
i82365_pnpdev
)
i82365_pnpdev
->
deactivate
(
i82365_pnpdev
);
pnp_disable_dev
(
i82365_pnpdev
);
#endif
#endif
}
/* exit_i82365 */
}
/* exit_i82365 */
...
...
drivers/pnp/isapnp/Makefile
View file @
708d7b68
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
# Makefile for the kernel ISAPNP driver.
# Makefile for the kernel ISAPNP driver.
#
#
export-objs
:=
core.o
export-objs
:=
core.o
compat.o
isapnp-proc-$(CONFIG_PROC_FS)
=
proc.o
isapnp-proc-$(CONFIG_PROC_FS)
=
proc.o
obj-y
:=
core.o
$
(
isapnp-proc-y
)
obj-y
:=
core.o
compat.o
$
(
isapnp-proc-y
)
drivers/pnp/isapnp/compat.c
View file @
708d7b68
...
@@ -26,21 +26,20 @@ static void pnp_convert_id(char *buf, unsigned short vendor, unsigned short devi
...
@@ -26,21 +26,20 @@ static void pnp_convert_id(char *buf, unsigned short vendor, unsigned short devi
}
}
struct
pnp_card
*
pnp_find_card
(
unsigned
short
vendor
,
struct
pnp_card
*
pnp_find_card
(
unsigned
short
vendor
,
unsigned
short
device
,
unsigned
short
device
,
struct
pnp_card
*
from
)
struct
pnp_card
*
from
)
{
{
char
id
[
7
];
char
id
[
7
];
char
any
[
7
];
char
any
[
7
];
struct
list_head
*
list
;
struct
list_head
*
list
;
pnp_convert_id
(
id
,
vendor
,
device
);
pnp_convert_id
(
id
,
vendor
,
device
);
pnp_convert_id
(
any
,
ISAPNP_ANY_ID
,
ISAPNP_ANY_ID
);
pnp_convert_id
(
any
,
ISAPNP_ANY_ID
,
ISAPNP_ANY_ID
);
list
=
isapnp_cards
.
next
;
if
(
from
)
list
=
from
->
node
.
next
;
while
(
list
!=
&
isapnp_cards
)
{
list
=
from
?
from
->
global_list
.
next
:
pnp_cards
.
next
;
struct
pnp_card
*
card
=
to_pnp_card
(
list
);
if
(
compare_pnp_id
(
&
card
->
ids
,
id
)
||
(
memcmp
(
id
,
any
,
7
)
==
0
))
while
(
list
!=
&
pnp_cards
)
{
struct
pnp_card
*
card
=
global_to_pnp_card
(
list
);
if
(
compare_pnp_id
(
card
->
id
,
id
)
||
(
memcmp
(
id
,
any
,
7
)
==
0
))
return
card
;
return
card
;
list
=
list
->
next
;
list
=
list
->
next
;
}
}
...
@@ -48,9 +47,9 @@ struct pnp_card *pnp_find_card(unsigned short vendor,
...
@@ -48,9 +47,9 @@ struct pnp_card *pnp_find_card(unsigned short vendor,
}
}
struct
pnp_dev
*
pnp_find_dev
(
struct
pnp_card
*
card
,
struct
pnp_dev
*
pnp_find_dev
(
struct
pnp_card
*
card
,
unsigned
short
vendor
,
unsigned
short
vendor
,
unsigned
short
function
,
unsigned
short
function
,
struct
pnp_dev
*
from
)
struct
pnp_dev
*
from
)
{
{
char
id
[
7
];
char
id
[
7
];
char
any
[
7
];
char
any
[
7
];
...
@@ -65,7 +64,7 @@ struct pnp_dev *pnp_find_dev(struct pnp_card *card,
...
@@ -65,7 +64,7 @@ struct pnp_dev *pnp_find_dev(struct pnp_card *card,
while
(
list
!=
&
pnp_global
)
{
while
(
list
!=
&
pnp_global
)
{
struct
pnp_dev
*
dev
=
global_to_pnp_dev
(
list
);
struct
pnp_dev
*
dev
=
global_to_pnp_dev
(
list
);
if
(
compare_pnp_id
(
&
dev
->
ids
,
id
)
||
(
memcmp
(
id
,
any
,
7
)
==
0
))
if
(
compare_pnp_id
(
dev
->
id
,
id
)
||
(
memcmp
(
id
,
any
,
7
)
==
0
))
return
dev
;
return
dev
;
list
=
list
->
next
;
list
=
list
->
next
;
}
}
...
@@ -80,7 +79,7 @@ struct pnp_dev *pnp_find_dev(struct pnp_card *card,
...
@@ -80,7 +79,7 @@ struct pnp_dev *pnp_find_dev(struct pnp_card *card,
}
}
while
(
list
!=
&
card
->
devices
)
{
while
(
list
!=
&
card
->
devices
)
{
struct
pnp_dev
*
dev
=
card_to_pnp_dev
(
list
);
struct
pnp_dev
*
dev
=
card_to_pnp_dev
(
list
);
if
(
compare_pnp_id
(
&
dev
->
ids
,
id
))
if
(
compare_pnp_id
(
dev
->
id
,
id
))
return
dev
;
return
dev
;
list
=
list
->
next
;
list
=
list
->
next
;
}
}
...
...
drivers/pnp/isapnp/core.c
View file @
708d7b68
...
@@ -42,12 +42,8 @@
...
@@ -42,12 +42,8 @@
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/isapnp.h>
#include <linux/isapnp.h>
#include <linux/pnp.h>
#include <asm/io.h>
#include <asm/io.h>
LIST_HEAD
(
isapnp_cards
);
LIST_HEAD
(
isapnp_devices
);
#if 0
#if 0
#define ISAPNP_REGION_OK
#define ISAPNP_REGION_OK
#endif
#endif
...
@@ -106,6 +102,8 @@ static int isapnp_detected;
...
@@ -106,6 +102,8 @@ static int isapnp_detected;
/* some prototypes */
/* some prototypes */
static
int
isapnp_config_prepare
(
struct
pnp_dev
*
dev
);
static
int
isapnp_config_prepare
(
struct
pnp_dev
*
dev
);
extern
struct
pnp_protocol
isapnp_card_protocol
;
extern
struct
pnp_protocol
isapnp_protocol
;
static
inline
void
write_data
(
unsigned
char
x
)
static
inline
void
write_data
(
unsigned
char
x
)
{
{
...
@@ -521,7 +519,7 @@ static void __init isapnp_add_port_resource(struct pnp_dev *dev,
...
@@ -521,7 +519,7 @@ static void __init isapnp_add_port_resource(struct pnp_dev *dev,
port
->
max
=
(
tmp
[
4
]
<<
8
)
|
tmp
[
3
];
port
->
max
=
(
tmp
[
4
]
<<
8
)
|
tmp
[
3
];
port
->
align
=
tmp
[
5
];
port
->
align
=
tmp
[
5
];
port
->
size
=
tmp
[
6
];
port
->
size
=
tmp
[
6
];
port
->
flags
=
tmp
[
0
]
?
ISA
PNP_PORT_FLAG_16BITADDR
:
0
;
port
->
flags
=
tmp
[
0
]
?
PNP_PORT_FLAG_16BITADDR
:
0
;
pnp_add_port_resource
(
dev
,
depnum
,
port
);
pnp_add_port_resource
(
dev
,
depnum
,
port
);
return
;
return
;
}
}
...
@@ -543,7 +541,7 @@ static void __init isapnp_add_fixed_port_resource(struct pnp_dev *dev,
...
@@ -543,7 +541,7 @@ static void __init isapnp_add_fixed_port_resource(struct pnp_dev *dev,
port
->
min
=
port
->
max
=
(
tmp
[
1
]
<<
8
)
|
tmp
[
0
];
port
->
min
=
port
->
max
=
(
tmp
[
1
]
<<
8
)
|
tmp
[
0
];
port
->
size
=
tmp
[
2
];
port
->
size
=
tmp
[
2
];
port
->
align
=
0
;
port
->
align
=
0
;
port
->
flags
=
ISA
PNP_PORT_FLAG_FIXED
;
port
->
flags
=
PNP_PORT_FLAG_FIXED
;
pnp_add_port_resource
(
dev
,
depnum
,
port
);
pnp_add_port_resource
(
dev
,
depnum
,
port
);
return
;
return
;
}
}
...
@@ -686,7 +684,7 @@ static int __init isapnp_create_device(struct pnp_card *card,
...
@@ -686,7 +684,7 @@ static int __init isapnp_create_device(struct pnp_card *card,
case
_STAG_STARTDEP
:
case
_STAG_STARTDEP
:
if
(
size
>
1
)
if
(
size
>
1
)
goto
__skip
;
goto
__skip
;
dependent
=
0x100
|
ISA
PNP_RES_PRIORITY_ACCEPTABLE
;
dependent
=
0x100
|
PNP_RES_PRIORITY_ACCEPTABLE
;
if
(
size
>
0
)
{
if
(
size
>
0
)
{
isapnp_peek
(
tmp
,
size
);
isapnp_peek
(
tmp
,
size
);
dependent
=
0x100
|
tmp
[
0
];
dependent
=
0x100
|
tmp
[
0
];
...
@@ -891,7 +889,7 @@ static int __init isapnp_build_device_list(void)
...
@@ -891,7 +889,7 @@ static int __init isapnp_build_device_list(void)
if
(
isapnp_checksum_value
!=
0x00
)
if
(
isapnp_checksum_value
!=
0x00
)
printk
(
KERN_ERR
"isapnp: checksum for device %i is not valid (0x%x)
\n
"
,
csn
,
isapnp_checksum_value
);
printk
(
KERN_ERR
"isapnp: checksum for device %i is not valid (0x%x)
\n
"
,
csn
,
isapnp_checksum_value
);
card
->
checksum
=
isapnp_checksum_value
;
card
->
checksum
=
isapnp_checksum_value
;
card
->
protocol
=
&
isapnp_protocol
;
card
->
protocol
=
&
isapnp_
card_
protocol
;
pnpc_add_card
(
card
);
pnpc_add_card
(
card
);
}
}
return
0
;
return
0
;
...
@@ -903,7 +901,12 @@ static int __init isapnp_build_device_list(void)
...
@@ -903,7 +901,12 @@ static int __init isapnp_build_device_list(void)
int
isapnp_present
(
void
)
int
isapnp_present
(
void
)
{
{
return
!
list_empty
(
&
isapnp_devices
);
struct
pnp_card
*
card
;
pnp_for_each_card
(
card
)
{
if
(
card
->
protocol
==
&
isapnp_card_protocol
)
return
1
;
}
return
0
;
}
}
int
isapnp_cfg_begin
(
int
csn
,
int
logdev
)
int
isapnp_cfg_begin
(
int
csn
,
int
logdev
)
...
@@ -970,24 +973,11 @@ static int isapnp_config_prepare(struct pnp_dev *dev)
...
@@ -970,24 +973,11 @@ static int isapnp_config_prepare(struct pnp_dev *dev)
return
0
;
return
0
;
}
}
void
isapnp_resource_change
(
struct
resource
*
resource
,
unsigned
long
start
,
unsigned
long
size
)
{
if
(
resource
==
NULL
)
return
;
resource
->
flags
&=
~
IORESOURCE_AUTO
;
resource
->
start
=
start
;
resource
->
end
=
start
+
size
-
1
;
}
/*
/*
* Inititialization.
* Inititialization.
*/
*/
EXPORT_SYMBOL
(
isapnp_cards
);
EXPORT_SYMBOL
(
isapnp_devices
);
EXPORT_SYMBOL
(
isapnp_present
);
EXPORT_SYMBOL
(
isapnp_present
);
EXPORT_SYMBOL
(
isapnp_cfg_begin
);
EXPORT_SYMBOL
(
isapnp_cfg_begin
);
EXPORT_SYMBOL
(
isapnp_cfg_end
);
EXPORT_SYMBOL
(
isapnp_cfg_end
);
...
@@ -999,7 +989,6 @@ EXPORT_SYMBOL(isapnp_write_word);
...
@@ -999,7 +989,6 @@ EXPORT_SYMBOL(isapnp_write_word);
EXPORT_SYMBOL
(
isapnp_write_dword
);
EXPORT_SYMBOL
(
isapnp_write_dword
);
EXPORT_SYMBOL
(
isapnp_wake
);
EXPORT_SYMBOL
(
isapnp_wake
);
EXPORT_SYMBOL
(
isapnp_device
);
EXPORT_SYMBOL
(
isapnp_device
);
EXPORT_SYMBOL
(
isapnp_resource_change
);
static
int
isapnp_get_resources
(
struct
pnp_dev
*
dev
)
static
int
isapnp_get_resources
(
struct
pnp_dev
*
dev
)
{
{
...
@@ -1053,8 +1042,15 @@ static int isapnp_disable_resources(struct pnp_dev *dev)
...
@@ -1053,8 +1042,15 @@ static int isapnp_disable_resources(struct pnp_dev *dev)
return
0
;
return
0
;
}
}
struct
pnp_protocol
isapnp_card_protocol
=
{
.
name
=
"ISA Plug and Play - card"
,
.
get
=
NULL
,
.
set
=
NULL
,
.
disable
=
NULL
,
};
struct
pnp_protocol
isapnp_protocol
=
{
struct
pnp_protocol
isapnp_protocol
=
{
.
name
=
"ISA Plug and Play"
,
.
name
=
"ISA Plug and Play
- device
"
,
.
get
=
isapnp_get_resources
,
.
get
=
isapnp_get_resources
,
.
set
=
isapnp_set_resources
,
.
set
=
isapnp_set_resources
,
.
disable
=
isapnp_disable_resources
,
.
disable
=
isapnp_disable_resources
,
...
@@ -1064,6 +1060,7 @@ int __init isapnp_init(void)
...
@@ -1064,6 +1060,7 @@ int __init isapnp_init(void)
{
{
int
cards
;
int
cards
;
struct
pnp_card
*
card
;
struct
pnp_card
*
card
;
struct
pnp_dev
*
dev
;
if
(
isapnp_disable
)
{
if
(
isapnp_disable
)
{
isapnp_detected
=
0
;
isapnp_detected
=
0
;
...
@@ -1084,6 +1081,9 @@ int __init isapnp_init(void)
...
@@ -1084,6 +1081,9 @@ int __init isapnp_init(void)
return
-
EBUSY
;
return
-
EBUSY
;
}
}
if
(
pnp_register_protocol
(
&
isapnp_card_protocol
)
<
0
)
return
-
EBUSY
;
if
(
pnp_register_protocol
(
&
isapnp_protocol
)
<
0
)
if
(
pnp_register_protocol
(
&
isapnp_protocol
)
<
0
)
return
-
EBUSY
;
return
-
EBUSY
;
...
@@ -1126,13 +1126,11 @@ int __init isapnp_init(void)
...
@@ -1126,13 +1126,11 @@ int __init isapnp_init(void)
protocol_for_each_card
(
&
isapnp_protocol
,
card
)
{
protocol_for_each_card
(
&
isapnp_protocol
,
card
)
{
cards
++
;
cards
++
;
if
(
isapnp_verbose
)
{
if
(
isapnp_verbose
)
{
struct
list_head
*
devlist
;
printk
(
KERN_INFO
"isapnp: Card '%s'
\n
"
,
card
->
name
[
0
]
?
card
->
name
:
"Unknown"
);
printk
(
KERN_INFO
"isapnp: Card '%s'
\n
"
,
card
->
name
[
0
]
?
card
->
name
:
"Unknown"
);
if
(
isapnp_verbose
<
2
)
if
(
isapnp_verbose
<
2
)
continue
;
continue
;
for
(
devlist
=
card
->
devices
.
next
;
devlist
!=
&
card
->
devices
;
devlist
=
devlist
->
next
)
{
pnp_card_for_each_dev
(
card
,
dev
)
{
struct
pci_dev
*
dev
=
pci_dev_b
(
devlist
);
printk
(
KERN_INFO
"isapnp: Device '%s'
\n
"
,
dev
->
name
[
0
]
?
dev
->
name
:
"Unknown"
);
printk
(
KERN_INFO
"isapnp: Device '%s'
\n
"
,
dev
->
dev
.
name
[
0
]
?
card
->
name
:
"Unknown"
);
}
}
}
}
}
}
...
...
drivers/pnp/isapnp/proc.c
View file @
708d7b68
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <linux/smp_lock.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
extern
struct
pnp_protocol
isapnp_protocol
;
static
struct
proc_dir_entry
*
isapnp_proc_bus_dir
=
NULL
;
static
struct
proc_dir_entry
*
isapnp_proc_bus_dir
=
NULL
;
...
...
include/linux/isapnp.h
View file @
708d7b68
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <linux/config.h>
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/errno.h>
#include <linux/pnp.h>
/*
/*
* Configuration registers (TODO: change by specification)
* Configuration registers (TODO: change by specification)
...
@@ -54,79 +55,7 @@
...
@@ -54,79 +55,7 @@
#ifdef __KERNEL__
#ifdef __KERNEL__
#include <linux/pci.h>
#define DEVICE_COUNT_COMPATIBLE 4
#define ISAPNP_PORT_FLAG_16BITADDR (1<<0)
#define ISAPNP_PORT_FLAG_FIXED (1<<1)
struct
isapnp_port
{
unsigned
short
min
;
/* min base number */
unsigned
short
max
;
/* max base number */
unsigned
char
align
;
/* align boundary */
unsigned
char
size
;
/* size of range */
unsigned
char
flags
;
/* port flags */
unsigned
char
pad
;
/* pad */
struct
isapnp_resources
*
res
;
/* parent */
struct
isapnp_port
*
next
;
/* next port */
};
struct
isapnp_irq
{
unsigned
short
map
;
/* bitmaks for IRQ lines */
unsigned
char
flags
;
/* IRQ flags */
unsigned
char
pad
;
/* pad */
struct
isapnp_resources
*
res
;
/* parent */
struct
isapnp_irq
*
next
;
/* next IRQ */
};
struct
isapnp_dma
{
unsigned
char
map
;
/* bitmask for DMA channels */
unsigned
char
flags
;
/* DMA flags */
struct
isapnp_resources
*
res
;
/* parent */
struct
isapnp_dma
*
next
;
/* next port */
};
struct
isapnp_mem
{
unsigned
int
min
;
/* min base number */
unsigned
int
max
;
/* max base number */
unsigned
int
align
;
/* align boundary */
unsigned
int
size
;
/* size of range */
unsigned
char
flags
;
/* memory flags */
unsigned
char
pad
;
/* pad */
struct
isapnp_resources
*
res
;
/* parent */
struct
isapnp_mem
*
next
;
/* next memory resource */
};
struct
isapnp_mem32
{
/* TODO */
unsigned
char
data
[
17
];
struct
isapnp_resources
*
res
;
/* parent */
struct
isapnp_mem32
*
next
;
/* next 32-bit memory resource */
};
struct
isapnp_fixup
{
unsigned
short
vendor
;
/* matching vendor */
unsigned
short
device
;
/* matching device */
void
(
*
quirk_function
)(
struct
pci_dev
*
dev
);
/* fixup function */
};
#define ISAPNP_RES_PRIORITY_PREFERRED 0
#define ISAPNP_RES_PRIORITY_ACCEPTABLE 1
#define ISAPNP_RES_PRIORITY_FUNCTIONAL 2
#define ISAPNP_RES_PRIORITY_INVALID 65535
struct
isapnp_resources
{
unsigned
short
priority
;
/* priority */
unsigned
short
dependent
;
/* dependent resources */
struct
isapnp_port
*
port
;
/* first port */
struct
isapnp_irq
*
irq
;
/* first IRQ */
struct
isapnp_dma
*
dma
;
/* first DMA */
struct
isapnp_mem
*
mem
;
/* first memory resource */
struct
isapnp_mem32
*
mem32
;
/* first 32-bit memory */
struct
pci_dev
*
dev
;
/* parent */
struct
isapnp_resources
*
alt
;
/* alternative resource (aka dependent resources) */
struct
isapnp_resources
*
next
;
/* next resource */
};
#define ISAPNP_ANY_ID 0xffff
#define ISAPNP_ANY_ID 0xffff
#define ISAPNP_CARD_DEVS 8
#define ISAPNP_CARD_DEVS 8
...
@@ -162,14 +91,6 @@ struct isapnp_device_id {
...
@@ -162,14 +91,6 @@ struct isapnp_device_id {
unsigned
long
driver_data
;
/* data private to the driver */
unsigned
long
driver_data
;
/* data private to the driver */
};
};
struct
isapnp_driver
{
struct
list_head
node
;
char
*
name
;
const
struct
isapnp_device_id
*
id_table
;
/* NULL if wants all devices */
int
(
*
probe
)
(
struct
pci_dev
*
dev
,
const
struct
isapnp_device_id
*
id
);
/* New device inserted */
void
(
*
remove
)
(
struct
pci_dev
*
dev
);
/* Device removed (NULL if not a hot-plug capable driver) */
};
#if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
#if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
#define __ISAPNP__
#define __ISAPNP__
...
@@ -188,7 +109,6 @@ void isapnp_wake(unsigned char csn);
...
@@ -188,7 +109,6 @@ void isapnp_wake(unsigned char csn);
void
isapnp_device
(
unsigned
char
device
);
void
isapnp_device
(
unsigned
char
device
);
void
isapnp_activate
(
unsigned
char
device
);
void
isapnp_activate
(
unsigned
char
device
);
void
isapnp_deactivate
(
unsigned
char
device
);
void
isapnp_deactivate
(
unsigned
char
device
);
void
isapnp_fixup_device
(
struct
pci_dev
*
dev
);
void
*
isapnp_alloc
(
long
size
);
void
*
isapnp_alloc
(
long
size
);
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
...
@@ -199,40 +119,8 @@ static inline isapnp_proc_init(void) { return 0; }
...
@@ -199,40 +119,8 @@ static inline isapnp_proc_init(void) { return 0; }
static
inline
isapnp_proc_done
(
void
)
{
return
0
;
}
static
inline
isapnp_proc_done
(
void
)
{
return
0
;
}
#endif
#endif
/* misc */
void
isapnp_resource_change
(
struct
resource
*
resource
,
unsigned
long
start
,
unsigned
long
size
);
/* init/main.c */
/* init/main.c */
int
isapnp_init
(
void
);
int
isapnp_init
(
void
);
/* manager */
static
inline
struct
pci_bus
*
isapnp_find_card
(
unsigned
short
vendor
,
unsigned
short
device
,
struct
pci_bus
*
from
)
{
return
NULL
;
}
static
inline
struct
pci_dev
*
isapnp_find_dev
(
struct
pci_bus
*
card
,
unsigned
short
vendor
,
unsigned
short
function
,
struct
pci_dev
*
from
)
{
return
NULL
;
}
static
inline
int
isapnp_probe_cards
(
const
struct
isapnp_card_id
*
ids
,
int
(
*
probe
)(
struct
pci_bus
*
card
,
const
struct
isapnp_card_id
*
id
))
{
return
-
ENODEV
;
}
static
inline
int
isapnp_probe_devs
(
const
struct
isapnp_device_id
*
ids
,
int
(
*
probe
)(
struct
pci_dev
*
dev
,
const
struct
isapnp_device_id
*
id
))
{
return
-
ENODEV
;
}
static
inline
int
isapnp_activate_dev
(
struct
pci_dev
*
dev
,
const
char
*
name
)
{
return
-
ENODEV
;
}
static
inline
int
isapnp_register_driver
(
struct
isapnp_driver
*
drv
)
{
return
0
;
}
static
inline
void
isapnp_unregister_driver
(
struct
isapnp_driver
*
drv
)
{
}
extern
struct
list_head
isapnp_cards
;
extern
struct
list_head
isapnp_devices
;
extern
struct
pnp_protocol
isapnp_protocol
;
#define isapnp_for_each_card(card) \
for(card = to_pnp_card(isapnp_cards.next); card != to_pnp_card(&isapnp_cards); card = to_pnp_card(card->node.next))
#define isapnp_for_each_dev(dev) \
for(dev = protocol_to_pnp_dev(isapnp_protocol.devices.next); dev != protocol_to_pnp_dev(&isapnp_protocol.devices); dev = protocol_to_pnp_dev(dev->dev_list.next))
#else
/* !CONFIG_ISAPNP */
#else
/* !CONFIG_ISAPNP */
...
@@ -250,28 +138,6 @@ static inline void isapnp_wake(unsigned char csn) { ; }
...
@@ -250,28 +138,6 @@ static inline void isapnp_wake(unsigned char csn) { ; }
static
inline
void
isapnp_device
(
unsigned
char
device
)
{
;
}
static
inline
void
isapnp_device
(
unsigned
char
device
)
{
;
}
static
inline
void
isapnp_activate
(
unsigned
char
device
)
{
;
}
static
inline
void
isapnp_activate
(
unsigned
char
device
)
{
;
}
static
inline
void
isapnp_deactivate
(
unsigned
char
device
)
{
;
}
static
inline
void
isapnp_deactivate
(
unsigned
char
device
)
{
;
}
/* manager */
static
inline
struct
pci_bus
*
isapnp_find_card
(
unsigned
short
vendor
,
unsigned
short
device
,
struct
pci_bus
*
from
)
{
return
NULL
;
}
static
inline
struct
pci_dev
*
isapnp_find_dev
(
struct
pci_bus
*
card
,
unsigned
short
vendor
,
unsigned
short
function
,
struct
pci_dev
*
from
)
{
return
NULL
;
}
static
inline
int
isapnp_probe_cards
(
const
struct
isapnp_card_id
*
ids
,
int
(
*
probe
)(
struct
pci_bus
*
card
,
const
struct
isapnp_card_id
*
id
))
{
return
-
ENODEV
;
}
static
inline
int
isapnp_probe_devs
(
const
struct
isapnp_device_id
*
ids
,
int
(
*
probe
)(
struct
pci_dev
*
dev
,
const
struct
isapnp_device_id
*
id
))
{
return
-
ENODEV
;
}
static
inline
void
isapnp_resource_change
(
struct
resource
*
resource
,
unsigned
long
start
,
unsigned
long
size
)
{
;
}
static
inline
int
isapnp_activate_dev
(
struct
pci_dev
*
dev
,
const
char
*
name
)
{
return
-
ENODEV
;
}
static
inline
int
isapnp_register_driver
(
struct
isapnp_driver
*
drv
)
{
return
0
;
}
static
inline
void
isapnp_unregister_driver
(
struct
isapnp_driver
*
drv
)
{
}
#endif
/* CONFIG_ISAPNP */
#endif
/* CONFIG_ISAPNP */
...
...
include/linux/pci.h
View file @
708d7b68
...
@@ -362,7 +362,7 @@ enum pci_mmap_state {
...
@@ -362,7 +362,7 @@ enum pci_mmap_state {
#define PCI_ANY_ID (~0)
#define PCI_ANY_ID (~0)
/*
/*
* The pci_dev structure is used to describe
both PCI and ISAPnP
devices.
* The pci_dev structure is used to describe
PCI
devices.
*/
*/
struct
pci_dev
{
struct
pci_dev
{
struct
list_head
global_list
;
/* node in list of all PCI devices */
struct
list_head
global_list
;
/* node in list of all PCI devices */
...
@@ -410,16 +410,9 @@ struct pci_dev {
...
@@ -410,16 +410,9 @@ struct pci_dev {
struct
resource
irq_resource
[
DEVICE_COUNT_IRQ
];
struct
resource
irq_resource
[
DEVICE_COUNT_IRQ
];
char
slot_name
[
8
];
/* slot name */
char
slot_name
[
8
];
/* slot name */
int
active
;
/* ISAPnP: device is active */
int
ro
;
/* ISAPnP: read only */
unsigned
short
regs
;
/* ISAPnP: supported registers */
/* These fields are used by common fixups */
/* These fields are used by common fixups */
unsigned
short
transparent
:
1
;
/* Transparent PCI bridge */
unsigned
int
transparent
:
1
;
/* Transparent PCI bridge */
int
(
*
prepare
)(
struct
pci_dev
*
dev
);
/* ISAPnP hooks */
int
(
*
activate
)(
struct
pci_dev
*
dev
);
int
(
*
deactivate
)(
struct
pci_dev
*
dev
);
};
};
#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
...
@@ -463,13 +456,7 @@ struct pci_bus {
...
@@ -463,13 +456,7 @@ struct pci_bus {
unsigned
char
subordinate
;
/* max number of subordinate buses */
unsigned
char
subordinate
;
/* max number of subordinate buses */
char
name
[
48
];
char
name
[
48
];
unsigned
short
vendor
;
unsigned
short
device
;
unsigned
int
serial
;
/* serial number */
unsigned
char
pnpver
;
/* Plug & Play version */
unsigned
char
productver
;
/* product version */
unsigned
char
checksum
;
/* if zero - checksum passed */
unsigned
char
pad1
;
struct
device
*
dev
;
struct
device
*
dev
;
};
};
...
...
include/linux/pnp.h
View file @
708d7b68
...
@@ -51,11 +51,15 @@ struct pnp_card {
...
@@ -51,11 +51,15 @@ struct pnp_card {
#define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list)
#define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list)
#define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list)
#define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list)
#define to_pnp_card(n)
list_entry
(n, struct pnp_card, dev)
#define to_pnp_card(n)
container_of
(n, struct pnp_card, dev)
#define pnp_for_each_card(card) \
#define pnp_for_each_card(card) \
for(dev = global_to_pnp_card(pnp_cards.next); \
for((card) = global_to_pnp_card(pnp_cards.next); \
dev != global_to_pnp_card(&cards); \
(card) != global_to_pnp_card(&pnp_cards); \
dev = global_to_pnp_card(card>global_list.next))
(card) = global_to_pnp_card((card)->global_list.next))
#define pnp_card_for_each_dev(card,dev) \
for((dev) = card_to_pnp_dev((card)->devices.next); \
(dev) != card_to_pnp_dev(&(card)->devices); \
(dev) = card_to_pnp_dev((dev)->card_list.next))
static
inline
void
*
pnpc_get_drvdata
(
struct
pnp_card
*
pcard
)
static
inline
void
*
pnpc_get_drvdata
(
struct
pnp_card
*
pcard
)
{
{
...
...
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