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
0b48f262
Commit
0b48f262
authored
Jul 22, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TG3]: Support OBP firmware mac-addresses on sparc64.
parent
2a137fd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
4 deletions
+47
-4
drivers/net/tg3.c
drivers/net/tg3.c
+47
-4
No files found.
drivers/net/tg3.c
View file @
0b48f262
...
...
@@ -32,6 +32,12 @@
#include <asm/byteorder.h>
#include <asm/uaccess.h>
#ifdef CONFIG_SPARC64
#include <asm/idprom.h>
#include <asm/oplib.h>
#include <asm/pbm.h>
#endif
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
#define TG3_VLAN_TAG_USED 1
#else
...
...
@@ -51,8 +57,8 @@
#define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.
6
"
#define DRV_MODULE_RELDATE "Ju
ne 11
, 2003"
#define DRV_MODULE_VERSION "1.
7
"
#define DRV_MODULE_RELDATE "Ju
ly 23
, 2003"
#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
...
...
@@ -6272,11 +6278,44 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
return
err
;
}
#ifdef CONFIG_SPARC64
static
int
__devinit
tg3_get_macaddr_sparc
(
struct
tg3
*
tp
)
{
struct
net_device
*
dev
=
tp
->
dev
;
struct
pci_dev
*
pdev
=
tp
->
pdev
;
struct
pcidev_cookie
*
pcp
=
pdev
->
sysdata
;
if
(
pcp
!=
NULL
)
{
int
node
=
pcp
->
prom_node
;
if
(
prom_getproplen
(
node
,
"local-mac-address"
)
==
6
)
{
prom_getproperty
(
node
,
"local-mac-address"
,
dev
->
dev_addr
,
6
);
return
0
;
}
}
return
-
ENODEV
;
}
static
int
__devinit
tg3_get_default_macaddr_sparc
(
struct
tg3
*
tp
)
{
struct
net_device
*
dev
=
tp
->
dev
;
memcpy
(
dev
->
dev_addr
,
idprom
->
id_ethaddr
,
6
);
return
0
;
}
#endif
static
int
__devinit
tg3_get_device_address
(
struct
tg3
*
tp
)
{
struct
net_device
*
dev
=
tp
->
dev
;
u32
hi
,
lo
,
mac_offset
;
#ifdef CONFIG_SPARC64
if
(
!
tg3_get_macaddr_sparc
(
tp
))
return
0
;
#endif
if
(
PCI_FUNC
(
tp
->
pdev
->
devfn
)
==
0
)
mac_offset
=
0x7c
;
else
...
...
@@ -6317,9 +6356,13 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
dev
->
dev_addr
[
0
]
=
(
hi
>>
8
)
&
0xff
;
}
if
(
!
is_valid_ether_addr
(
&
dev
->
dev_addr
[
0
]))
if
(
!
is_valid_ether_addr
(
&
dev
->
dev_addr
[
0
]))
{
#ifdef CONFIG_SPARC64
if
(
!
tg3_get_default_macaddr_sparc
(
tp
))
return
0
;
#endif
return
-
EINVAL
;
}
return
0
;
}
...
...
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