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
a043bc4c
Commit
a043bc4c
authored
Jun 03, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Move arch/cris drivers away from init_etherdev().
parent
132508c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
75 deletions
+31
-75
arch/cris/drivers/ethernet.c
arch/cris/drivers/ethernet.c
+18
-39
arch/cris/drivers/lpslave/e100lpslavenet.c
arch/cris/drivers/lpslave/e100lpslavenet.c
+13
-36
No files found.
arch/cris/drivers/ethernet.c
View file @
a043bc4c
...
...
@@ -292,37 +292,19 @@ static void e100_set_network_leds(int active);
*/
static
int
__init
etrax_ethernet_init
(
struct
net_device
*
dev
)
etrax_ethernet_init
(
void
)
{
int
i
;
struct
net_device
*
dev
;
int
i
,
err
;
int
anOffset
=
0
;
printk
(
"ETRAX 100LX 10/100MBit ethernet v2.0 (c) 2000-2001 Axis Communications AB
\n
"
);
dev
->
base_addr
=
(
unsigned
int
)
R_NETWORK_SA_0
;
/* just to have something to show */
printk
(
"%s initialized
\n
"
,
dev
->
name
);
/* make Linux aware of the new hardware */
if
(
!
dev
)
{
printk
(
KERN_WARNING
"%s: dev == NULL. Should this happen?
\n
"
,
cardname
);
dev
=
init_etherdev
(
dev
,
sizeof
(
struct
net_local
));
dev
=
alloc_etherdev
(
sizeof
(
struct
net_local
));
if
(
!
dev
)
panic
(
"init_etherdev failed
\n
"
);
}
/* setup generic handlers and stuff in the dev struct */
ether_setup
(
dev
);
/* make room for the local structure containing stats etc */
dev
->
priv
=
kmalloc
(
sizeof
(
struct
net_local
),
GFP_KERNEL
);
if
(
dev
->
priv
==
NULL
)
return
-
ENOMEM
;
memset
(
dev
->
priv
,
0
,
sizeof
(
struct
net_local
));
dev
->
base_addr
=
(
unsigned
int
)
R_NETWORK_SA_0
;
/* just to have something to show */
/* now setup our etrax specific stuff */
...
...
@@ -340,10 +322,6 @@ etrax_ethernet_init(struct net_device *dev)
dev
->
do_ioctl
=
e100_ioctl
;
dev
->
tx_timeout
=
e100_tx_timeout
;
/* set the default MAC address */
e100_set_mac_address
(
dev
,
&
default_mac
);
/* Initialise the list of Etrax DMA-descriptors */
/* Initialise receive descriptors */
...
...
@@ -371,6 +349,16 @@ etrax_ethernet_init(struct net_device *dev)
myLastRxDesc
=
&
RxDescList
[
NBR_OF_RX_DESC
-
1
];
myPrevRxDesc
=
&
RxDescList
[
NBR_OF_RX_DESC
-
1
];
err
=
register_netdev
(
dev
);
if
(
err
)
{
kfree
(
dev
);
return
err
;
}
/* set the default MAC address */
e100_set_mac_address
(
dev
,
&
default_mac
);
/* Initialize speed indicator stuff. */
current_speed
=
10
;
...
...
@@ -1349,19 +1337,10 @@ e100_set_network_leds(int active)
}
}
static
struct
net_device
dev_etrax_ethernet
;
/* only got one */
static
int
etrax_init_module
(
void
)
{
struct
net_device
*
d
=
&
dev_etrax_ethernet
;
d
->
init
=
etrax_ethernet_init
;
if
(
register_netdev
(
d
)
==
0
)
return
0
;
else
return
-
ENODEV
;
return
etrax_ethernet_init
();
}
module_init
(
etrax_init_module
);
arch/cris/drivers/lpslave/e100lpslavenet.c
View file @
a043bc4c
...
...
@@ -162,37 +162,19 @@ extern unsigned char e100lpslaveprog;
* (detachable devices only).
*/
static
int
__init
etrax_ethernet_lpslave_init
(
struct
net_device
*
dev
)
etrax_ethernet_lpslave_init
(
void
)
{
int
i
;
struct
net_device
*
dev
;
int
i
,
err
;
int
anOffset
=
0
;
printk
(
"Etrax/100 lpslave ethernet driver v0.3, (c) 1999 Axis Communications AB
\n
"
);
dev
->
base_addr
=
2
;
printk
(
"%s initialized
\n
"
,
dev
->
name
);
/* make Linux aware of the new hardware */
if
(
!
dev
)
{
printk
(
KERN_WARNING
"%s: dev == NULL. Should this happen?
\n
"
,
cardname
);
dev
=
init_etherdev
(
dev
,
sizeof
(
struct
net_local
));
dev
=
alloc_etherdev
(
sizeof
(
struct
net_lock
));
if
(
!
dev
)
panic
(
"init_etherdev failed
\n
"
);
}
/* setup generic handlers and stuff in the dev struct */
ether_setup
(
dev
);
/* make room for the local structure containing stats etc */
dev
->
priv
=
kmalloc
(
sizeof
(
struct
net_local
),
GFP_KERNEL
);
if
(
dev
->
priv
==
NULL
)
return
-
ENOMEM
;
memset
(
dev
->
priv
,
0
,
sizeof
(
struct
net_local
));
dev
->
base_addr
=
2
;
/* now setup our etrax specific stuff */
...
...
@@ -242,7 +224,11 @@ etrax_ethernet_lpslave_init(struct net_device *dev)
TxDescList
[
0
].
buf
=
virt_to_phys
(
&
host_command
);
TxDescList
[
0
].
next
=
virt_to_phys
(
&
TxDescList
[
1
]);
return
0
;
err
=
register_netdev
(
dev
);
if
(
err
)
kfree
(
dev
);
return
err
;
}
/* set MAC address of the interface. called from the core after a
...
...
@@ -1017,19 +1003,10 @@ dump_parport_status(void)
}
#endif
/* ETHDEBUG */
static
struct
net_device
dev_etrax_slave_ethernet
;
static
int
etrax_init_module
(
void
)
{
struct
net_device
*
d
=
&
dev_etrax_slave_ethernet
;
d
->
init
=
etrax_ethernet_lpslave_init
;
if
(
register_netdev
(
d
)
==
0
)
return
0
;
else
return
-
ENODEV
;
return
etrax_ethernet_lpslave_init
();
}
module_init
(
etrax_init_module
);
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