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
457e1a8a
Commit
457e1a8a
authored
Mar 29, 2007
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SUNGEM]: Consolidate powerpc and sparc MAC probing code.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
dadb830d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
26 deletions
+7
-26
drivers/net/sungem.c
drivers/net/sungem.c
+6
-25
drivers/net/sungem.h
drivers/net/sungem.h
+1
-1
No files found.
drivers/net/sungem.c
View file @
457e1a8a
...
...
@@ -66,9 +66,7 @@
#ifdef CONFIG_SPARC
#include <asm/idprom.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/pbm.h>
#include <asm/prom.h>
#endif
#ifdef CONFIG_PPC_PMAC
...
...
@@ -2906,34 +2904,17 @@ static int __devinit gem_get_device_address(struct gem *gp)
{
#if defined(CONFIG_SPARC) || defined(CONFIG_PPC_PMAC)
struct
net_device
*
dev
=
gp
->
dev
;
#endif
#if defined(CONFIG_SPARC)
struct
pci_dev
*
pdev
=
gp
->
pdev
;
struct
pcidev_cookie
*
pcp
=
pdev
->
sysdata
;
int
use_idprom
=
1
;
if
(
pcp
!=
NULL
)
{
const
unsigned
char
*
addr
;
int
len
;
addr
=
of_get_property
(
pcp
->
prom_node
,
"local-mac-address"
,
&
len
);
if
(
addr
&&
len
==
6
)
{
use_idprom
=
0
;
memcpy
(
dev
->
dev_addr
,
addr
,
6
);
}
}
if
(
use_idprom
)
memcpy
(
dev
->
dev_addr
,
idprom
->
id_ethaddr
,
6
);
#elif defined(CONFIG_PPC_PMAC)
const
unsigned
char
*
addr
;
addr
=
get_property
(
gp
->
of_node
,
"local-mac-address"
,
NULL
);
if
(
addr
==
NULL
)
{
#ifdef CONFIG_SPARC
addr
=
idprom
->
id_ethaddr
;
#else
printk
(
"
\n
"
);
printk
(
KERN_ERR
"%s: can't get mac-address
\n
"
,
dev
->
name
);
return
-
1
;
#endif
}
memcpy
(
dev
->
dev_addr
,
addr
,
6
);
#else
...
...
@@ -3091,7 +3072,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
/* On Apple, we want a reference to the Open Firmware device-tree
* node. We use it for clock control.
*/
#if
def CONFIG_PPC_PMAC
#if
defined(CONFIG_PPC_PMAC) || defined(CONFIG_SPARC)
gp
->
of_node
=
pci_device_to_OF_node
(
pdev
);
#endif
...
...
drivers/net/sungem.h
View file @
457e1a8a
...
...
@@ -1025,7 +1025,7 @@ struct gem {
struct
pci_dev
*
pdev
;
struct
net_device
*
dev
;
#if
def CONFIG_PPC_PMAC
#if
defined(CONFIG_PPC_PMAC) || defined(CONFIG_SPARC)
struct
device_node
*
of_node
;
#endif
};
...
...
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