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
03eb6d11
Commit
03eb6d11
authored
Jul 20, 2003
by
Christoph Hellwig
Committed by
David S. Miller
Jul 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARCNET]: Fix module refcounting.
parent
71a82136
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
71 deletions
+26
-71
drivers/net/arcnet/arc-rimi.c
drivers/net/arcnet/arc-rimi.c
+1
-11
drivers/net/arcnet/arcnet.c
drivers/net/arcnet/arcnet.c
+13
-5
drivers/net/arcnet/com20020-isa.c
drivers/net/arcnet/com20020-isa.c
+1
-9
drivers/net/arcnet/com20020-pci.c
drivers/net/arcnet/com20020-pci.c
+1
-9
drivers/net/arcnet/com20020.c
drivers/net/arcnet/com20020.c
+5
-12
drivers/net/arcnet/com90io.c
drivers/net/arcnet/com90io.c
+1
-10
drivers/net/arcnet/com90xx.c
drivers/net/arcnet/com90xx.c
+1
-12
include/linux/arcdevice.h
include/linux/arcdevice.h
+3
-3
No files found.
drivers/net/arcnet/arc-rimi.c
View file @
03eb6d11
...
...
@@ -47,7 +47,6 @@ static void arcrimi_command(struct net_device *dev, int command);
static
int
arcrimi_status
(
struct
net_device
*
dev
);
static
void
arcrimi_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
int
arcrimi_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
void
arcrimi_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
arcrimi_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
static
void
arcrimi_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
...
...
@@ -179,7 +178,7 @@ static int __init arcrimi_found(struct net_device *dev)
lp
->
hw
.
status
=
arcrimi_status
;
lp
->
hw
.
intmask
=
arcrimi_setmask
;
lp
->
hw
.
reset
=
arcrimi_reset
;
lp
->
hw
.
o
pen_close
=
arcrimi_openclose
;
lp
->
hw
.
o
wner
=
THIS_MODULE
;
lp
->
hw
.
copy_to_card
=
arcrimi_copy_to_card
;
lp
->
hw
.
copy_from_card
=
arcrimi_copy_from_card
;
lp
->
mem_start
=
ioremap
(
dev
->
mem_start
,
dev
->
mem_end
-
dev
->
mem_start
+
1
);
...
...
@@ -254,15 +253,6 @@ static int arcrimi_reset(struct net_device *dev, int really_reset)
return
0
;
}
static
void
arcrimi_openclose
(
struct
net_device
*
dev
,
int
open
)
{
if
(
open
)
MOD_INC_USE_COUNT
;
else
MOD_DEC_USE_COUNT
;
}
static
void
arcrimi_setmask
(
struct
net_device
*
dev
,
int
mask
)
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
...
...
drivers/net/arcnet/arcnet.c
View file @
03eb6d11
...
...
@@ -343,7 +343,10 @@ void arcdev_setup(struct net_device *dev)
static
int
arcnet_open
(
struct
net_device
*
dev
)
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
int
count
,
newmtu
;
int
count
,
newmtu
,
error
;
if
(
!
try_module_get
(
lp
->
hw
.
owner
))
return
-
ENODEV
;
BUGLVL
(
D_PROTO
)
{
int
count
;
...
...
@@ -360,8 +363,9 @@ static int arcnet_open(struct net_device *dev)
/* try to put the card in a defined state - if it fails the first
* time, actually reset it.
*/
error
=
-
ENODEV
;
if
(
ARCRESET
(
0
)
&&
ARCRESET
(
1
))
return
-
ENODEV
;
goto
out_module_put
;
newmtu
=
choose_mtu
();
if
(
newmtu
<
dev
->
mtu
)
...
...
@@ -391,7 +395,7 @@ static int arcnet_open(struct net_device *dev)
lp
->
rfc1201
.
sequence
=
1
;
/* bring up the hardware driver */
ARCOPEN
(
1
);
lp
->
hw
.
open
(
dev
);
if
(
dev
->
dev_addr
[
0
]
==
0
)
BUGMSG
(
D_NORMAL
,
"WARNING! Station address 00 is reserved "
...
...
@@ -415,6 +419,10 @@ static int arcnet_open(struct net_device *dev)
netif_start_queue
(
dev
);
return
0
;
out_module_put:
module_put
(
lp
->
hw
.
owner
);
return
error
;
}
...
...
@@ -432,8 +440,8 @@ static int arcnet_close(struct net_device *dev)
mdelay
(
1
);
/* shut down the card */
ARCOPEN
(
0
);
lp
->
hw
.
close
(
dev
);
module_put
(
lp
->
hw
.
owner
);
return
0
;
}
...
...
drivers/net/arcnet/com20020-isa.c
View file @
03eb6d11
...
...
@@ -131,14 +131,6 @@ MODULE_PARM(clockp, "i");
MODULE_PARM
(
clockm
,
"i"
);
MODULE_LICENSE
(
"GPL"
);
static
void
com20020isa_open_close
(
struct
net_device
*
dev
,
bool
open
)
{
if
(
open
)
MOD_INC_USE_COUNT
;
else
MOD_DEC_USE_COUNT
;
}
int
init_module
(
void
)
{
struct
net_device
*
dev
;
...
...
@@ -160,7 +152,7 @@ int init_module(void)
lp
->
clockp
=
clockp
&
7
;
lp
->
clockm
=
clockm
&
3
;
lp
->
timeout
=
timeout
&
3
;
lp
->
hw
.
open_close_ll
=
com20020isa_open_close
;
lp
->
owner
=
THIS_MODULE
;
dev
->
base_addr
=
io
;
dev
->
irq
=
irq
;
...
...
drivers/net/arcnet/com20020-pci.c
View file @
03eb6d11
...
...
@@ -60,14 +60,6 @@ MODULE_PARM(clockp, "i");
MODULE_PARM
(
clockm
,
"i"
);
MODULE_LICENSE
(
"GPL"
);
static
void
com20020pci_open_close
(
struct
net_device
*
dev
,
bool
open
)
{
if
(
open
)
MOD_INC_USE_COUNT
;
else
MOD_DEC_USE_COUNT
;
}
static
int
__devinit
com20020pci_probe
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
id
)
{
struct
net_device
*
dev
;
...
...
@@ -111,7 +103,7 @@ static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_de
lp
->
clockp
=
clockp
&
7
;
lp
->
clockm
=
clockm
&
3
;
lp
->
timeout
=
timeout
;
lp
->
hw
.
o
pen_close_ll
=
com20020pci_open_close
;
lp
->
hw
.
o
wner
=
THIS_MODULE
;
if
(
check_region
(
ioaddr
,
ARCNET_TOTAL_SIZE
))
{
BUGMSG
(
D_INIT
,
"IO region %xh-%xh already allocated.
\n
"
,
...
...
drivers/net/arcnet/com20020.c
View file @
03eb6d11
...
...
@@ -50,13 +50,12 @@ static void com20020_command(struct net_device *dev, int command);
static
int
com20020_status
(
struct
net_device
*
dev
);
static
void
com20020_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
int
com20020_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
void
com20020_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
com20020_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
static
void
com20020_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
static
void
com20020_set_mc_list
(
struct
net_device
*
dev
);
static
void
com20020_close
(
struct
net_device
*
,
bool
);
static
void
com20020_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
)
...
...
@@ -162,13 +161,14 @@ int __devinit com20020_found(struct net_device *dev, int shared)
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
lp
->
hw
.
owner
=
THIS_MODULE
;
lp
->
hw
.
command
=
com20020_command
;
lp
->
hw
.
status
=
com20020_status
;
lp
->
hw
.
intmask
=
com20020_setmask
;
lp
->
hw
.
reset
=
com20020_reset
;
lp
->
hw
.
open_close
=
com20020_openclose
;
lp
->
hw
.
copy_to_card
=
com20020_copy_to_card
;
lp
->
hw
.
copy_from_card
=
com20020_copy_from_card
;
lp
->
hw
.
close
=
com20020_close
;
dev
->
set_multicast_list
=
com20020_set_mc_list
;
...
...
@@ -298,25 +298,18 @@ static int com20020_status(struct net_device *dev)
return
ASTATUS
();
}
static
void
com20020_openclose
(
struct
net_device
*
dev
,
bool
open
)
static
void
com20020_close
(
struct
net_device
*
dev
,
bool
open
)
{
struct
arcnet_local
*
lp
=
(
struct
arcnet_local
*
)
dev
->
priv
;
int
ioaddr
=
dev
->
base_addr
;
if
(
open
)
{
MOD_INC_USE_COUNT
;
}
else
{
if
(
!
open
)
{
/* disable transmitter */
lp
->
config
&=
~
TXENcfg
;
SETCONF
;
MOD_DEC_USE_COUNT
;
}
lp
->
hw
.
open_close_ll
(
dev
,
open
);
}
/* Set or clear the multicast filter for this adaptor.
* num_addrs == -1 Promiscuous mode, receive all packets
* num_addrs == 0 Normal mode, clear multicast list
...
...
drivers/net/arcnet/com90io.c
View file @
03eb6d11
...
...
@@ -47,7 +47,6 @@ static void com90io_command(struct net_device *dev, int command);
static
int
com90io_status
(
struct
net_device
*
dev
);
static
void
com90io_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
int
com90io_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
void
com90io_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
com90io_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
static
void
com90io_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
...
...
@@ -257,7 +256,7 @@ static int __init com90io_found(struct net_device *dev)
lp
->
hw
.
status
=
com90io_status
;
lp
->
hw
.
intmask
=
com90io_setmask
;
lp
->
hw
.
reset
=
com90io_reset
;
lp
->
hw
.
o
pen_close
=
com90io_openclose
;
lp
->
hw
.
o
wner
=
THIS_MODULE
;
lp
->
hw
.
copy_to_card
=
com90io_copy_to_card
;
lp
->
hw
.
copy_from_card
=
com90io_copy_from_card
;
...
...
@@ -344,14 +343,6 @@ static void com90io_setmask(struct net_device *dev, int mask)
AINTMASK
(
mask
);
}
static
void
com90io_openclose
(
struct
net_device
*
dev
,
int
open
)
{
if
(
open
)
MOD_INC_USE_COUNT
;
else
MOD_DEC_USE_COUNT
;
}
static
void
com90io_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
)
{
...
...
drivers/net/arcnet/com90xx.c
View file @
03eb6d11
...
...
@@ -58,7 +58,6 @@ static void com90xx_command(struct net_device *dev, int command);
static
int
com90xx_status
(
struct
net_device
*
dev
);
static
void
com90xx_setmask
(
struct
net_device
*
dev
,
int
mask
);
static
int
com90xx_reset
(
struct
net_device
*
dev
,
int
really_reset
);
static
void
com90xx_openclose
(
struct
net_device
*
dev
,
bool
open
);
static
void
com90xx_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
static
void
com90xx_copy_from_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
...
...
@@ -450,7 +449,7 @@ static int __init com90xx_found(struct net_device *dev0, int ioaddr, int airq,
lp
->
hw
.
status
=
com90xx_status
;
lp
->
hw
.
intmask
=
com90xx_setmask
;
lp
->
hw
.
reset
=
com90xx_reset
;
lp
->
hw
.
o
pen_close
=
com90xx_openclose
;
lp
->
hw
.
o
wner
=
THIS_MODULE
;
lp
->
hw
.
copy_to_card
=
com90xx_copy_to_card
;
lp
->
hw
.
copy_from_card
=
com90xx_copy_from_card
;
lp
->
mem_start
=
ioremap
(
dev
->
mem_start
,
dev
->
mem_end
-
dev
->
mem_start
+
1
);
...
...
@@ -570,16 +569,6 @@ int com90xx_reset(struct net_device *dev, int really_reset)
return
0
;
}
static
void
com90xx_openclose
(
struct
net_device
*
dev
,
bool
open
)
{
if
(
open
)
MOD_INC_USE_COUNT
;
else
MOD_DEC_USE_COUNT
;
}
static
void
com90xx_copy_to_card
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
)
{
...
...
include/linux/arcdevice.h
View file @
03eb6d11
...
...
@@ -291,12 +291,13 @@ struct arcnet_local {
/* hardware-specific functions */
struct
{
struct
module
*
owner
;
void
(
*
command
)
(
struct
net_device
*
dev
,
int
cmd
);
int
(
*
status
)
(
struct
net_device
*
dev
);
void
(
*
intmask
)
(
struct
net_device
*
dev
,
int
mask
);
bool
(
*
reset
)
(
struct
net_device
*
dev
,
bool
really_reset
);
void
(
*
open
_close
)
(
struct
net_device
*
dev
,
bool
open
);
void
(
*
open_close_ll
)
(
struct
net_device
*
dev
,
bool
open
);
void
(
*
open
)
(
struct
net_device
*
dev
);
void
(
*
close
)
(
struct
net_device
*
dev
);
void
(
*
copy_to_card
)
(
struct
net_device
*
dev
,
int
bufnum
,
int
offset
,
void
*
buf
,
int
count
);
...
...
@@ -312,7 +313,6 @@ struct arcnet_local {
#define ACOMMAND(x) (lp->hw.command(dev, (x)))
#define ASTATUS() (lp->hw.status(dev))
#define AINTMASK(x) (lp->hw.intmask(dev, (x)))
#define ARCOPEN(x) (lp->hw.open_close(dev, (x)))
...
...
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