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
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
Hide 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)
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 "
"structure!
\n
"
);
break
;
}
if
(
dev
->
priv
==
NULL
)
{
printk
(
KERN_ERR
"Unable to allocate adapter "
"structure!
\n
"
);
break
;
}
pNet
=
dev
->
priv
;
pNet
->
pAC
=
kmalloc
(
sizeof
(
SK_AC
),
GFP_KERNEL
);
if
(
pNet
->
pAC
==
NULL
){
dev
->
get_stats
=
NULL
;
unregister_netdev
(
dev
);
kfree
(
dev
->
priv
);
free_netdev
(
dev
);
printk
(
KERN_ERR
"Unable to allocate adapter "
"structure!
\n
"
);
break
;
...
...
@@ -699,9 +691,7 @@ static int __init skge_probe (void)
retval
=
SkGeInitPCI
(
pAC
);
if
(
retval
)
{
printk
(
"SKGE: PCI setup failed: %i
\n
"
,
retval
);
dev
->
get_stats
=
NULL
;
unregister_netdev
(
dev
);
kfree
(
dev
);
free_netdev
(
dev
);
continue
;
}
...
...
@@ -730,13 +720,20 @@ static int __init skge_probe (void)
pAC
->
Index
=
boards_found
;
if
(
SkGeBoardInit
(
dev
,
pAC
))
{
FreeResources
(
dev
);
kfree
(
dev
);
free_netdev
(
dev
);
continue
;
}
memcpy
((
caddr_t
)
&
dev
->
dev_addr
,
(
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 */
#ifdef CONFIG_PROC_FS
if
(
!
DeviceFound
)
{
...
...
@@ -767,21 +764,11 @@ static int __init skge_probe (void)
pNet
->
PortNr
=
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
++
;
/* More then one port found */
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 "
"structure!
\n
"
);
break
;
...
...
@@ -814,22 +801,28 @@ static int __init skge_probe (void)
#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
if
(
pSkRootDir
&&
(
pProcFile
=
create_proc_entry
(
dev
->
name
,
S_IRUGO
,
pSkRootDir
)))
{
pProcFile
->
proc_fops
=
&
sk_proc_fops
;
pProcFile
->
data
=
dev
;
}
if
(
pSkRootDir
&&
(
pProcFile
=
create_proc_entry
(
dev
->
name
,
S_IRUGO
,
pSkRootDir
)))
{
pProcFile
->
proc_fops
=
&
sk_proc_fops
;
pProcFile
->
data
=
dev
;
}
#endif
memcpy
((
caddr_t
)
&
dev
->
dev_addr
,
(
caddr_t
)
&
pAC
->
Addr
.
Net
[
1
].
CurrentMacAddress
,
6
);
memcpy
((
caddr_t
)
&
dev
->
dev_addr
,
(
caddr_t
)
&
pAC
->
Addr
.
Net
[
1
].
CurrentMacAddress
,
6
);
printk
(
"%s: %s
\n
"
,
dev
->
name
,
pAC
->
DeviceStr
);
printk
(
" PrefPort:B RlmtMode:Dual Check Link State
\n
"
);
printk
(
"%s: %s
\n
"
,
dev
->
name
,
pAC
->
DeviceStr
);
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