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
nexedi
linux
Commits
af013b4d
Commit
af013b4d
authored
Jul 17, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge nuts.ninka.net:/home/davem/src/BK/sparcwork-2.5
into nuts.ninka.net:/home/davem/src/BK/sparc-2.5
parents
71380949
773f63e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
40 deletions
+33
-40
arch/sparc64/kernel/pci.c
arch/sparc64/kernel/pci.c
+32
-39
drivers/sbus/sbus.c
drivers/sbus/sbus.c
+1
-1
No files found.
arch/sparc64/kernel/pci.c
View file @
af013b4d
...
...
@@ -221,7 +221,7 @@ static struct {
#define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \
sizeof(pci_controller_table[0]))
static
void
pci_controller_init
(
char
*
model_name
,
int
namelen
,
int
node
)
static
int
pci_controller_init
(
char
*
model_name
,
int
namelen
,
int
node
)
{
int
i
;
...
...
@@ -230,12 +230,14 @@ static void pci_controller_init(char *model_name, int namelen, int node)
pci_controller_table
[
i
].
model_name
,
namelen
))
{
pci_controller_table
[
i
].
init
(
node
,
model_name
);
return
;
return
1
;
}
}
printk
(
"PCI: Warning unknown controller, model name [%s]
\n
"
,
model_name
);
printk
(
"PCI: Ignoring controller...
\n
"
);
return
0
;
}
static
int
pci_is_controller
(
char
*
model_name
,
int
namelen
,
int
node
)
...
...
@@ -252,37 +254,47 @@ static int pci_is_controller(char *model_name, int namelen, int node)
return
0
;
}
/* Is there some PCI controller in the system? */
int
pcic_present
(
void
)
static
int
pci_controller_scan
(
int
(
*
handler
)(
char
*
,
int
,
int
)
)
{
char
namebuf
[
16
];
char
namebuf
[
64
];
int
node
;
int
count
=
0
;
node
=
prom_getchild
(
prom_root_node
);
while
((
node
=
prom_searchsiblings
(
node
,
"pci"
))
!=
0
)
{
int
len
,
ret
;
int
len
;
len
=
prom_getproperty
(
node
,
"model"
,
namebuf
,
sizeof
(
namebuf
));
if
((
len
=
prom_getproperty
(
node
,
"model"
,
namebuf
,
sizeof
(
namebuf
)))
>
0
||
(
len
=
prom_getproperty
(
node
,
"compatible"
,
namebuf
,
sizeof
(
namebuf
)))
>
0
)
{
int
item_len
=
0
;
ret
=
0
;
if
(
len
>
0
)
{
ret
=
pci_is_controller
(
namebuf
,
len
,
node
);
}
else
{
len
=
prom_getproperty
(
node
,
"compatible"
,
namebuf
,
sizeof
(
namebuf
));
if
(
len
>
0
)
ret
=
pci_is_controller
(
namebuf
,
len
,
node
);
/* Our value may be a multi-valued string in the
* case of some compatible properties. For sanity,
* only try the first one. */
while
(
namebuf
[
item_len
]
&&
len
)
{
len
--
;
item_len
++
;
}
if
(
handler
(
namebuf
,
item_len
,
node
))
count
++
;
}
if
(
ret
)
return
ret
;
node
=
prom_getsibling
(
node
);
if
(
!
node
)
break
;
}
return
0
;
return
count
;
}
/* Is there some PCI controller in the system? */
int
pcic_present
(
void
)
{
return
pci_controller_scan
(
pci_is_controller
);
}
/* Find each controller in the system, attach and initialize
...
...
@@ -292,28 +304,9 @@ int pcic_present(void)
*/
static
void
pci_controller_probe
(
void
)
{
char
namebuf
[
16
];
int
node
;
printk
(
"PCI: Probing for controllers.
\n
"
);
node
=
prom_getchild
(
prom_root_node
);
while
((
node
=
prom_searchsiblings
(
node
,
"pci"
))
!=
0
)
{
int
len
;
len
=
prom_getproperty
(
node
,
"model"
,
namebuf
,
sizeof
(
namebuf
));
if
(
len
>
0
)
pci_controller_init
(
namebuf
,
len
,
node
);
else
{
len
=
prom_getproperty
(
node
,
"compatible"
,
namebuf
,
sizeof
(
namebuf
));
if
(
len
>
0
)
pci_controller_init
(
namebuf
,
len
,
node
);
}
node
=
prom_getsibling
(
node
);
if
(
!
node
)
break
;
}
pci_controller_scan
(
pci_controller_init
);
}
static
void
pci_scan_each_controller_bus
(
void
)
...
...
drivers/sbus/sbus.c
View file @
af013b4d
...
...
@@ -334,7 +334,7 @@ static int __init sbus_init(void)
nd
=
prom_searchsiblings
(
topnd
,
"sbus"
);
if
(
nd
==
0
)
{
#ifdef CONFIG_PCI
if
(
pci_find_device
(
PCI_ANY_ID
,
PCI_ANY_ID
,
NULL
)
==
NULL
)
{
if
(
!
pcic_present
()
)
{
prom_printf
(
"Neither SBUS nor PCI found.
\n
"
);
prom_halt
();
}
else
{
...
...
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