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
21f6cbbb
Commit
21f6cbbb
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 sk98lin away from init_etherdev.
parent
5fae2ae3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
37 deletions
+30
-37
drivers/net/sk98lin/skge.c
drivers/net/sk98lin/skge.c
+30
-37
No files found.
drivers/net/sk98lin/skge.c
View file @
21f6cbbb
...
@@ -653,24 +653,16 @@ static int __init skge_probe (void)
...
@@ -653,24 +653,16 @@ static int __init skge_probe (void)
continue
;
continue
;
if
((
dev
=
init_etherdev
(
dev
,
sizeof
(
DEV_NET
)))
==
NULL
)
{
if
((
dev
=
alloc_etherdev
(
sizeof
(
DEV_NET
)))
==
NULL
)
{
printk
(
KERN_ERR
"Unable to allocate etherdev "
printk
(
KERN_ERR
"Unable to allocate etherdev "
"structure!
\n
"
);
"structure!
\n
"
);
break
;
break
;
}
}
if
(
dev
->
priv
==
NULL
)
{
printk
(
KERN_ERR
"Unable to allocate adapter "
"structure!
\n
"
);
break
;
}
pNet
=
dev
->
priv
;
pNet
=
dev
->
priv
;
pNet
->
pAC
=
kmalloc
(
sizeof
(
SK_AC
),
GFP_KERNEL
);
pNet
->
pAC
=
kmalloc
(
sizeof
(
SK_AC
),
GFP_KERNEL
);
if
(
pNet
->
pAC
==
NULL
){
if
(
pNet
->
pAC
==
NULL
){
dev
->
get_stats
=
NULL
;
free_netdev
(
dev
);
unregister_netdev
(
dev
);
kfree
(
dev
->
priv
);
printk
(
KERN_ERR
"Unable to allocate adapter "
printk
(
KERN_ERR
"Unable to allocate adapter "
"structure!
\n
"
);
"structure!
\n
"
);
break
;
break
;
...
@@ -699,9 +691,7 @@ static int __init skge_probe (void)
...
@@ -699,9 +691,7 @@ static int __init skge_probe (void)
retval
=
SkGeInitPCI
(
pAC
);
retval
=
SkGeInitPCI
(
pAC
);
if
(
retval
)
{
if
(
retval
)
{
printk
(
"SKGE: PCI setup failed: %i
\n
"
,
retval
);
printk
(
"SKGE: PCI setup failed: %i
\n
"
,
retval
);
dev
->
get_stats
=
NULL
;
free_netdev
(
dev
);
unregister_netdev
(
dev
);
kfree
(
dev
);
continue
;
continue
;
}
}
...
@@ -730,13 +720,20 @@ static int __init skge_probe (void)
...
@@ -730,13 +720,20 @@ static int __init skge_probe (void)
pAC
->
Index
=
boards_found
;
pAC
->
Index
=
boards_found
;
if
(
SkGeBoardInit
(
dev
,
pAC
))
{
if
(
SkGeBoardInit
(
dev
,
pAC
))
{
FreeResources
(
dev
);
FreeResources
(
dev
);
kfree
(
dev
);
free_netdev
(
dev
);
continue
;
continue
;
}
}
memcpy
((
caddr_t
)
&
dev
->
dev_addr
,
memcpy
((
caddr_t
)
&
dev
->
dev_addr
,
(
caddr_t
)
&
pAC
->
Addr
.
Net
[
0
].
CurrentMacAddress
,
6
);
(
caddr_t
)
&
pAC
->
Addr
.
Net
[
0
].
CurrentMacAddress
,
6
);
if
(
register_netdev
(
dev
))
{
printk
(
KERN_ERR
"SKGE: Could not register device.
\n
"
);
FreeResources
(
dev
);
free_netdev
(
dev
);
continue
;
}
/* First adapter... Create proc and print message */
/* First adapter... Create proc and print message */
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
if
(
!
DeviceFound
)
{
if
(
!
DeviceFound
)
{
...
@@ -767,21 +764,11 @@ static int __init skge_probe (void)
...
@@ -767,21 +764,11 @@ static int __init skge_probe (void)
pNet
->
PortNr
=
0
;
pNet
->
PortNr
=
0
;
pNet
->
NetNr
=
0
;
pNet
->
NetNr
=
0
;
#ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM
if
(
pAC
->
ChipsetType
)
{
/* SG and ZEROCOPY - fly baby... */
dev
->
features
|=
NETIF_F_SG
|
NETIF_F_IP_CSUM
;
}
#endif
#endif
boards_found
++
;
boards_found
++
;
/* More then one port found */
/* More then one port found */
if
((
pAC
->
GIni
.
GIMacsFound
==
2
)
&&
(
pAC
->
RlmtNets
==
2
))
{
if
((
pAC
->
GIni
.
GIMacsFound
==
2
)
&&
(
pAC
->
RlmtNets
==
2
))
{
if
((
dev
=
init_etherdev
(
NULL
,
sizeof
(
DEV_NET
)))
==
0
)
{
if
((
dev
=
alloc_etherdev
(
sizeof
(
DEV_NET
)))
==
0
)
{
printk
(
KERN_ERR
"Unable to allocate etherdev "
printk
(
KERN_ERR
"Unable to allocate etherdev "
"structure!
\n
"
);
"structure!
\n
"
);
break
;
break
;
...
@@ -814,6 +801,12 @@ static int __init skge_probe (void)
...
@@ -814,6 +801,12 @@ static int __init skge_probe (void)
#endif
#endif
#endif
#endif
if
(
register_netdev
(
dev
))
{
printk
(
KERN_ERR
"SKGE: Could not register "
"second port.
\n
"
);
free_netdev
(
dev
);
pAC
->
dev
[
1
]
=
pAC
->
dev
[
0
];
}
else
{
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
if
(
pSkRootDir
if
(
pSkRootDir
&&
(
pProcFile
=
create_proc_entry
(
dev
->
name
,
&&
(
pProcFile
=
create_proc_entry
(
dev
->
name
,
...
@@ -829,7 +822,7 @@ static int __init skge_probe (void)
...
@@ -829,7 +822,7 @@ static int __init skge_probe (void)
printk
(
"%s: %s
\n
"
,
dev
->
name
,
pAC
->
DeviceStr
);
printk
(
"%s: %s
\n
"
,
dev
->
name
,
pAC
->
DeviceStr
);
printk
(
" PrefPort:B RlmtMode:Dual Check Link State
\n
"
);
printk
(
" PrefPort:B RlmtMode:Dual Check Link State
\n
"
);
}
}
}
...
...
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