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
8660472f
Commit
8660472f
authored
Sep 01, 2003
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr 8390] new function alloc_ei_netdev()
(preferred over alloc_etherdev + 8390-specific ethdev_init)
parent
2967abcf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
drivers/net/8390.c
drivers/net/8390.c
+30
-4
drivers/net/8390.h
drivers/net/8390.h
+1
-0
No files found.
drivers/net/8390.c
View file @
8660472f
...
@@ -997,6 +997,11 @@ static void set_multicast_list(struct net_device *dev)
...
@@ -997,6 +997,11 @@ static void set_multicast_list(struct net_device *dev)
spin_unlock_irqrestore
(
&
ei_local
->
page_lock
,
flags
);
spin_unlock_irqrestore
(
&
ei_local
->
page_lock
,
flags
);
}
}
static
inline
void
ei_device_init
(
struct
ei_device
*
ei_local
)
{
spin_lock_init
(
&
ei_local
->
page_lock
);
}
/**
/**
* ethdev_init - init rest of 8390 device struct
* ethdev_init - init rest of 8390 device struct
* @dev: network device structure to init
* @dev: network device structure to init
...
@@ -1012,14 +1017,11 @@ int ethdev_init(struct net_device *dev)
...
@@ -1012,14 +1017,11 @@ int ethdev_init(struct net_device *dev)
if
(
dev
->
priv
==
NULL
)
if
(
dev
->
priv
==
NULL
)
{
{
struct
ei_device
*
ei_local
;
dev
->
priv
=
kmalloc
(
sizeof
(
struct
ei_device
),
GFP_KERNEL
);
dev
->
priv
=
kmalloc
(
sizeof
(
struct
ei_device
),
GFP_KERNEL
);
if
(
dev
->
priv
==
NULL
)
if
(
dev
->
priv
==
NULL
)
return
-
ENOMEM
;
return
-
ENOMEM
;
memset
(
dev
->
priv
,
0
,
sizeof
(
struct
ei_device
));
memset
(
dev
->
priv
,
0
,
sizeof
(
struct
ei_device
));
ei_local
=
(
struct
ei_device
*
)
dev
->
priv
;
ei_device_init
(
dev
->
priv
);
spin_lock_init
(
&
ei_local
->
page_lock
);
}
}
dev
->
hard_start_xmit
=
&
ei_start_xmit
;
dev
->
hard_start_xmit
=
&
ei_start_xmit
;
...
@@ -1030,6 +1032,29 @@ int ethdev_init(struct net_device *dev)
...
@@ -1030,6 +1032,29 @@ int ethdev_init(struct net_device *dev)
return
0
;
return
0
;
}
}
/* wrapper to make alloc_netdev happy; probably should just cast... */
static
void
__ethdev_init
(
struct
net_device
*
dev
)
{
ethdev_init
(
dev
);
}
/**
* alloc_ei_netdev - alloc_etherdev counterpart for 8390
*
* Allocate 8390-specific net_device.
*/
struct
net_device
*
alloc_ei_netdev
(
void
)
{
struct
net_device
*
dev
;
dev
=
alloc_netdev
(
sizeof
(
struct
ei_device
),
"eth%d"
,
__ethdev_init
);
if
(
dev
)
ei_device_init
(
dev
->
priv
);
return
dev
;
}
...
@@ -1133,6 +1158,7 @@ EXPORT_SYMBOL(ei_interrupt);
...
@@ -1133,6 +1158,7 @@ EXPORT_SYMBOL(ei_interrupt);
EXPORT_SYMBOL
(
ei_tx_timeout
);
EXPORT_SYMBOL
(
ei_tx_timeout
);
EXPORT_SYMBOL
(
ethdev_init
);
EXPORT_SYMBOL
(
ethdev_init
);
EXPORT_SYMBOL
(
NS8390_init
);
EXPORT_SYMBOL
(
NS8390_init
);
EXPORT_SYMBOL
(
alloc_ei_netdev
);
#if defined(MODULE)
#if defined(MODULE)
...
...
drivers/net/8390.h
View file @
8660472f
...
@@ -44,6 +44,7 @@ extern void NS8390_init(struct net_device *dev, int startp);
...
@@ -44,6 +44,7 @@ extern void NS8390_init(struct net_device *dev, int startp);
extern
int
ei_open
(
struct
net_device
*
dev
);
extern
int
ei_open
(
struct
net_device
*
dev
);
extern
int
ei_close
(
struct
net_device
*
dev
);
extern
int
ei_close
(
struct
net_device
*
dev
);
extern
irqreturn_t
ei_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
extern
irqreturn_t
ei_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
extern
struct
net_device
*
alloc_ei_netdev
(
void
);
/* You have one of these per-board */
/* You have one of these per-board */
struct
ei_device
{
struct
ei_device
{
...
...
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