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
921a5004
Commit
921a5004
authored
Jun 06, 2003
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Fix accidental revert of init_etherdev killing in PPC net drivers.
parent
928880f8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
43 deletions
+45
-43
arch/ppc/8260_io/enet.c
arch/ppc/8260_io/enet.c
+12
-9
arch/ppc/8260_io/fcc_enet.c
arch/ppc/8260_io/fcc_enet.c
+11
-12
arch/ppc/8xx_io/enet.c
arch/ppc/8xx_io/enet.c
+11
-11
arch/ppc/8xx_io/fec.c
arch/ppc/8xx_io/fec.c
+11
-11
No files found.
arch/ppc/8260_io/enet.c
View file @
921a5004
...
@@ -630,19 +630,15 @@ static int __init scc_enet_init(void)
...
@@ -630,19 +630,15 @@ static int __init scc_enet_init(void)
bd
=
(
bd_t
*
)
__res
;
bd
=
(
bd_t
*
)
__res
;
/*
Allocate some private information
.
/*
Create an Ethernet device instance
.
*/
*/
cep
=
(
struct
scc_enet_private
*
)
kmalloc
(
sizeof
(
*
cep
),
GFP_KERNEL
);
dev
=
alloc_etherdev
(
sizeof
(
*
cep
)
);
if
(
cep
==
NULL
)
if
(
!
dev
)
return
-
ENOMEM
;
return
-
ENOMEM
;
__clear_user
(
cep
,
sizeof
(
*
cep
))
;
cep
=
dev
->
priv
;
spin_lock_init
(
&
cep
->
lock
);
spin_lock_init
(
&
cep
->
lock
);
/* Create an Ethernet device instance.
*/
dev
=
init_etherdev
(
0
,
0
);
/* Get pointer to SCC area in parameter RAM.
/* Get pointer to SCC area in parameter RAM.
*/
*/
ep
=
(
scc_enet_t
*
)(
&
immap
->
im_dprambase
[
PROFF_ENET
]);
ep
=
(
scc_enet_t
*
)(
&
immap
->
im_dprambase
[
PROFF_ENET
]);
...
@@ -771,6 +767,7 @@ static int __init scc_enet_init(void)
...
@@ -771,6 +767,7 @@ static int __init scc_enet_init(void)
/* Allocate a page.
/* Allocate a page.
*/
*/
mem_addr
=
__get_free_page
(
GFP_KERNEL
);
mem_addr
=
__get_free_page
(
GFP_KERNEL
);
/* BUG: no check for failure */
/* Initialize the BD for every fragment in the page.
/* Initialize the BD for every fragment in the page.
*/
*/
...
@@ -808,6 +805,7 @@ static int __init scc_enet_init(void)
...
@@ -808,6 +805,7 @@ static int __init scc_enet_init(void)
/* Install our interrupt handler.
/* Install our interrupt handler.
*/
*/
request_irq
(
SIU_INT_ENET
,
scc_enet_interrupt
,
0
,
"enet"
,
dev
);
request_irq
(
SIU_INT_ENET
,
scc_enet_interrupt
,
0
,
"enet"
,
dev
);
/* BUG: no check for failure */
/* Set GSMR_H to enable all normal operating modes.
/* Set GSMR_H to enable all normal operating modes.
* Set GSMR_L to enable Ethernet to MC68160.
* Set GSMR_L to enable Ethernet to MC68160.
...
@@ -837,7 +835,6 @@ static int __init scc_enet_init(void)
...
@@ -837,7 +835,6 @@ static int __init scc_enet_init(void)
io
->
iop_pdatc
|=
PC_EST8260_ENET_NOTFD
;
io
->
iop_pdatc
|=
PC_EST8260_ENET_NOTFD
;
dev
->
base_addr
=
(
unsigned
long
)
ep
;
dev
->
base_addr
=
(
unsigned
long
)
ep
;
dev
->
priv
=
cep
;
/* The CPM Ethernet specific entries in the device structure. */
/* The CPM Ethernet specific entries in the device structure. */
dev
->
open
=
scc_enet_open
;
dev
->
open
=
scc_enet_open
;
...
@@ -852,6 +849,12 @@ static int __init scc_enet_init(void)
...
@@ -852,6 +849,12 @@ static int __init scc_enet_init(void)
*/
*/
sccp
->
scc_gsmrl
|=
(
SCC_GSMRL_ENR
|
SCC_GSMRL_ENT
);
sccp
->
scc_gsmrl
|=
(
SCC_GSMRL_ENR
|
SCC_GSMRL_ENT
);
err
=
register_netdev
(
dev
);
if
(
err
)
{
kfree
(
dev
);
return
err
;
}
printk
(
"%s: SCC ENET Version 0.1, "
,
dev
->
name
);
printk
(
"%s: SCC ENET Version 0.1, "
,
dev
->
name
);
for
(
i
=
0
;
i
<
5
;
i
++
)
for
(
i
=
0
;
i
<
5
;
i
++
)
printk
(
"%02x:"
,
dev
->
dev_addr
[
i
]);
printk
(
"%02x:"
,
dev
->
dev_addr
[
i
]);
...
...
arch/ppc/8260_io/fcc_enet.c
View file @
921a5004
...
@@ -1328,7 +1328,7 @@ static int __init fec_enet_init(void)
...
@@ -1328,7 +1328,7 @@ static int __init fec_enet_init(void)
struct
net_device
*
dev
;
struct
net_device
*
dev
;
struct
fcc_enet_private
*
cep
;
struct
fcc_enet_private
*
cep
;
fcc_info_t
*
fip
;
fcc_info_t
*
fip
;
int
i
,
np
;
int
i
,
np
,
err
;
volatile
immap_t
*
immap
;
volatile
immap_t
*
immap
;
volatile
iop8260_t
*
io
;
volatile
iop8260_t
*
io
;
...
@@ -1339,23 +1339,16 @@ static int __init fec_enet_init(void)
...
@@ -1339,23 +1339,16 @@ static int __init fec_enet_init(void)
fip
=
fcc_ports
;
fip
=
fcc_ports
;
while
(
np
--
>
0
)
{
while
(
np
--
>
0
)
{
/* Create an Ethernet device instance.
/* Allocate some private information.
*/
*/
cep
=
(
struct
fcc_enet_private
*
)
dev
=
alloc_etherdev
(
sizeof
(
*
cep
));
kmalloc
(
sizeof
(
*
cep
),
GFP_KERNEL
);
if
(
!
dev
)
if
(
cep
==
NULL
)
return
-
ENOMEM
;
return
-
ENOMEM
;
__clear_user
(
cep
,
sizeof
(
*
cep
))
;
cep
=
dev
->
priv
;
spin_lock_init
(
&
cep
->
lock
);
spin_lock_init
(
&
cep
->
lock
);
cep
->
fip
=
fip
;
cep
->
fip
=
fip
;
/* Create an Ethernet device instance.
*/
dev
=
init_etherdev
(
0
,
0
);
dev
->
priv
=
cep
;
init_fcc_shutdown
(
fip
,
cep
,
immap
);
init_fcc_shutdown
(
fip
,
cep
,
immap
);
init_fcc_ioports
(
fip
,
io
,
immap
);
init_fcc_ioports
(
fip
,
io
,
immap
);
init_fcc_param
(
fip
,
dev
,
immap
);
init_fcc_param
(
fip
,
dev
,
immap
);
...
@@ -1376,6 +1369,12 @@ static int __init fec_enet_init(void)
...
@@ -1376,6 +1369,12 @@ static int __init fec_enet_init(void)
init_fcc_startup
(
fip
,
dev
);
init_fcc_startup
(
fip
,
dev
);
err
=
register_netdev
(
dev
);
if
(
err
)
{
kfree
(
dev
);
return
err
;
}
printk
(
"%s: FCC ENET Version 0.3, "
,
dev
->
name
);
printk
(
"%s: FCC ENET Version 0.3, "
,
dev
->
name
);
for
(
i
=
0
;
i
<
5
;
i
++
)
for
(
i
=
0
;
i
<
5
;
i
++
)
printk
(
"%02x:"
,
dev
->
dev_addr
[
i
]);
printk
(
"%02x:"
,
dev
->
dev_addr
[
i
]);
...
...
arch/ppc/8xx_io/enet.c
View file @
921a5004
...
@@ -643,7 +643,7 @@ static int __init scc_enet_init(void)
...
@@ -643,7 +643,7 @@ static int __init scc_enet_init(void)
{
{
struct
net_device
*
dev
;
struct
net_device
*
dev
;
struct
scc_enet_private
*
cep
;
struct
scc_enet_private
*
cep
;
int
i
,
j
,
k
;
int
i
,
j
,
k
,
err
;
unsigned
char
*
eap
,
*
ba
;
unsigned
char
*
eap
,
*
ba
;
dma_addr_t
mem_addr
;
dma_addr_t
mem_addr
;
bd_t
*
bd
;
bd_t
*
bd
;
...
@@ -659,19 +659,13 @@ static int __init scc_enet_init(void)
...
@@ -659,19 +659,13 @@ static int __init scc_enet_init(void)
bd
=
(
bd_t
*
)
__res
;
bd
=
(
bd_t
*
)
__res
;
/* Allocate some private information.
dev
=
alloc_etherdev
(
sizeof
(
*
cep
));
*/
if
(
!
dev
)
cep
=
(
struct
scc_enet_private
*
)
kmalloc
(
sizeof
(
*
cep
),
GFP_KERNEL
);
if
(
cep
==
NULL
)
return
-
ENOMEM
;
return
-
ENOMEM
;
__clear_user
(
cep
,
sizeof
(
*
cep
))
;
cep
=
dev
->
priv
;
spin_lock_init
(
&
cep
->
lock
);
spin_lock_init
(
&
cep
->
lock
);
/* Create an Ethernet device instance.
*/
dev
=
init_etherdev
(
0
,
0
);
/* Get pointer to SCC area in parameter RAM.
/* Get pointer to SCC area in parameter RAM.
*/
*/
ep
=
(
scc_enet_t
*
)(
&
cp
->
cp_dparam
[
PROFF_ENET
]);
ep
=
(
scc_enet_t
*
)(
&
cp
->
cp_dparam
[
PROFF_ENET
]);
...
@@ -841,6 +835,7 @@ static int __init scc_enet_init(void)
...
@@ -841,6 +835,7 @@ static int __init scc_enet_init(void)
/* Allocate a page.
/* Allocate a page.
*/
*/
ba
=
(
unsigned
char
*
)
consistent_alloc
(
GFP_KERNEL
,
PAGE_SIZE
,
&
mem_addr
);
ba
=
(
unsigned
char
*
)
consistent_alloc
(
GFP_KERNEL
,
PAGE_SIZE
,
&
mem_addr
);
/* BUG: no check for failure */
/* Initialize the BD for every fragment in the page.
/* Initialize the BD for every fragment in the page.
*/
*/
...
@@ -939,7 +934,6 @@ static int __init scc_enet_init(void)
...
@@ -939,7 +934,6 @@ static int __init scc_enet_init(void)
#endif
#endif
dev
->
base_addr
=
(
unsigned
long
)
ep
;
dev
->
base_addr
=
(
unsigned
long
)
ep
;
dev
->
priv
=
cep
;
#if 0
#if 0
dev->name = "CPM_ENET";
dev->name = "CPM_ENET";
#endif
#endif
...
@@ -953,6 +947,12 @@ static int __init scc_enet_init(void)
...
@@ -953,6 +947,12 @@ static int __init scc_enet_init(void)
dev
->
get_stats
=
scc_enet_get_stats
;
dev
->
get_stats
=
scc_enet_get_stats
;
dev
->
set_multicast_list
=
set_multicast_list
;
dev
->
set_multicast_list
=
set_multicast_list
;
err
=
register_netdev
(
dev
);
if
(
err
)
{
kfree
(
dev
);
return
err
;
}
/* And last, enable the transmit and receive processing.
/* And last, enable the transmit and receive processing.
*/
*/
sccp
->
scc_gsmrl
|=
(
SCC_GSMRL_ENR
|
SCC_GSMRL_ENT
);
sccp
->
scc_gsmrl
|=
(
SCC_GSMRL_ENR
|
SCC_GSMRL_ENT
);
...
...
arch/ppc/8xx_io/fec.c
View file @
921a5004
...
@@ -1570,7 +1570,7 @@ static int __init fec_enet_init(void)
...
@@ -1570,7 +1570,7 @@ static int __init fec_enet_init(void)
{
{
struct
net_device
*
dev
;
struct
net_device
*
dev
;
struct
fec_enet_private
*
fep
;
struct
fec_enet_private
*
fep
;
int
i
,
j
,
k
;
int
i
,
j
,
k
,
err
;
unsigned
char
*
eap
,
*
iap
,
*
ba
;
unsigned
char
*
eap
,
*
iap
,
*
ba
;
unsigned
long
mem_addr
;
unsigned
long
mem_addr
;
volatile
cbd_t
*
bdp
;
volatile
cbd_t
*
bdp
;
...
@@ -1586,17 +1586,11 @@ static int __init fec_enet_init(void)
...
@@ -1586,17 +1586,11 @@ static int __init fec_enet_init(void)
bd
=
(
bd_t
*
)
__res
;
bd
=
(
bd_t
*
)
__res
;
/* Allocate some private information.
dev
=
alloc_etherdev
(
sizeof
(
*
fep
));
*/
if
(
!
dev
)
fep
=
(
struct
fec_enet_private
*
)
kmalloc
(
sizeof
(
*
fep
),
GFP_KERNEL
);
if
(
fep
==
NULL
)
return
-
ENOMEM
;
return
-
ENOMEM
;
__clear_user
(
fep
,
sizeof
(
*
fep
));
fep
=
dev
->
priv
;
/* Create an Ethernet device instance.
*/
dev
=
init_etherdev
(
0
,
0
);
fecp
=
&
(
immap
->
im_cpm
.
cp_fec
);
fecp
=
&
(
immap
->
im_cpm
.
cp_fec
);
...
@@ -1661,6 +1655,7 @@ static int __init fec_enet_init(void)
...
@@ -1661,6 +1655,7 @@ static int __init fec_enet_init(void)
/* Allocate a page.
/* Allocate a page.
*/
*/
ba
=
(
unsigned
char
*
)
consistent_alloc
(
GFP_KERNEL
,
PAGE_SIZE
,
&
mem_addr
);
ba
=
(
unsigned
char
*
)
consistent_alloc
(
GFP_KERNEL
,
PAGE_SIZE
,
&
mem_addr
);
/* BUG: no check for failure */
/* Initialize the BD for every fragment in the page.
/* Initialize the BD for every fragment in the page.
*/
*/
...
@@ -1715,7 +1710,6 @@ static int __init fec_enet_init(void)
...
@@ -1715,7 +1710,6 @@ static int __init fec_enet_init(void)
#endif
#endif
dev
->
base_addr
=
(
unsigned
long
)
fecp
;
dev
->
base_addr
=
(
unsigned
long
)
fecp
;
dev
->
priv
=
fep
;
/* The FEC Ethernet specific entries in the device structure. */
/* The FEC Ethernet specific entries in the device structure. */
dev
->
open
=
fec_enet_open
;
dev
->
open
=
fec_enet_open
;
...
@@ -1752,6 +1746,12 @@ static int __init fec_enet_init(void)
...
@@ -1752,6 +1746,12 @@ static int __init fec_enet_init(void)
fecp
->
fec_mii_speed
=
0
;
/* turn off MDIO */
fecp
->
fec_mii_speed
=
0
;
/* turn off MDIO */
#endif
/* CONFIG_USE_MDIO */
#endif
/* CONFIG_USE_MDIO */
err
=
register_netdev
(
dev
);
if
(
err
)
{
kfree
(
dev
);
return
err
;
}
printk
(
"%s: FEC ENET Version 0.2, FEC irq %d"
printk
(
"%s: FEC ENET Version 0.2, FEC irq %d"
#ifdef PHY_INTERRUPT
#ifdef PHY_INTERRUPT
", MII irq %d"
", MII irq %d"
...
...
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