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
9ba3c9af
Commit
9ba3c9af
authored
Oct 16, 2003
by
David S. Miller
Committed by
Stephen Hemminger
Oct 16, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Convert myri_sbus away from init_etherdev.
parent
bc20be4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
+24
-19
drivers/net/myri_sbus.c
drivers/net/myri_sbus.c
+24
-19
No files found.
drivers/net/myri_sbus.c
View file @
9ba3c9af
...
...
@@ -888,15 +888,16 @@ static void dump_eeprom(struct myri_eth *mp)
}
#endif
static
int
__init
myri_ether_init
(
struct
net_device
*
dev
,
struct
sbus_dev
*
sdev
,
int
num
)
static
int
__init
myri_ether_init
(
struct
sbus_dev
*
sdev
,
int
num
)
{
static
unsigned
version_printed
;
struct
net_device
*
dev
;
struct
myri_eth
*
mp
;
unsigned
char
prop_buf
[
32
];
int
i
;
DET
((
"myri_ether_init(%p,%
p,%d):
\n
"
,
dev
,
sdev
,
num
));
dev
=
init_etherdev
(
0
,
sizeof
(
struct
myri_eth
));
DET
((
"myri_ether_init(%p,%
d):
\n
"
,
sdev
,
num
));
dev
=
alloc_etherdev
(
sizeof
(
struct
myri_eth
));
if
(
!
dev
)
return
-
ENOMEM
;
...
...
@@ -904,8 +905,6 @@ static int __init myri_ether_init(struct net_device *dev, struct sbus_dev *sdev,
if
(
version_printed
++
==
0
)
printk
(
version
);
printk
(
"%s: MyriCOM MyriNET Ethernet "
,
dev
->
name
);
mp
=
(
struct
myri_eth
*
)
dev
->
priv
;
spin_lock_init
(
&
mp
->
irq_lock
);
mp
->
myri_sdev
=
sdev
;
...
...
@@ -974,10 +973,7 @@ static int __init myri_ether_init(struct net_device *dev, struct sbus_dev *sdev,
#endif
for
(
i
=
0
;
i
<
6
;
i
++
)
printk
(
"%2.2x%c"
,
dev
->
dev_addr
[
i
]
=
mp
->
eeprom
.
id
[
i
],
i
==
5
?
' '
:
':'
);
printk
(
"
\n
"
);
dev
->
dev_addr
[
i
]
=
mp
->
eeprom
.
id
[
i
];
determine_reg_space_size
(
mp
);
...
...
@@ -1072,9 +1068,6 @@ static int __init myri_ether_init(struct net_device *dev, struct sbus_dev *sdev,
goto
err
;
}
DET
((
"ether_setup()
\n
"
));
ether_setup
(
dev
);
dev
->
mtu
=
MYRINET_MTU
;
dev
->
change_mtu
=
myri_change_mtu
;
dev
->
hard_header
=
myri_header
;
...
...
@@ -1087,15 +1080,30 @@ static int __init myri_ether_init(struct net_device *dev, struct sbus_dev *sdev,
DET
((
"Loading LANAI firmware
\n
"
));
myri_load_lanai
(
mp
);
if
(
register_netdev
(
dev
))
{
printk
(
"MyriCOM: Cannot register device.
\n
"
);
goto
err_free_irq
;
}
#ifdef MODULE
dev
->
ifindex
=
dev_new_index
();
mp
->
next_module
=
root_myri_dev
;
root_myri_dev
=
mp
;
#endif
printk
(
"%s: MyriCOM MyriNET Ethernet "
,
dev
->
name
);
for
(
i
=
0
;
i
<
6
;
i
++
)
printk
(
"%2.2x%c"
,
dev
->
dev_addr
[
i
],
i
==
5
?
' '
:
':'
);
printk
(
"
\n
"
);
return
0
;
err:
unregister_netdev
(
dev
);
err_free_irq:
free_irq
(
dev
->
irq
,
dev
);
err:
/* This will also free the co-allocated 'dev->priv' */
kfree
(
dev
);
free_netdev
(
dev
);
return
-
ENODEV
;
}
...
...
@@ -1112,7 +1120,6 @@ static int __init myri_sbus_match(struct sbus_dev *sdev)
static
int
__init
myri_sbus_probe
(
void
)
{
struct
net_device
*
dev
=
NULL
;
struct
sbus_bus
*
bus
;
struct
sbus_dev
*
sdev
=
0
;
static
int
called
;
...
...
@@ -1128,12 +1135,10 @@ static int __init myri_sbus_probe(void)
for_each_sbus
(
bus
)
{
for_each_sbusdev
(
sdev
,
bus
)
{
if
(
cards
)
dev
=
NULL
;
if
(
myri_sbus_match
(
sdev
))
{
cards
++
;
DET
((
"Found myricom myrinet as %s
\n
"
,
sdev
->
prom_name
));
if
((
v
=
myri_ether_init
(
dev
,
sdev
,
(
cards
-
1
))))
if
((
v
=
myri_ether_init
(
sdev
,
(
cards
-
1
))))
return
v
;
}
}
...
...
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