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
05417c09
Commit
05417c09
authored
Mar 22, 2003
by
Chas Williams
Committed by
David S. Miller
Mar 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ATM]: cleanup nicstat, suni and idt77105.
parent
f643f785
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
76 deletions
+26
-76
drivers/atm/idt77105.c
drivers/atm/idt77105.c
+22
-42
drivers/atm/nicstar.c
drivers/atm/nicstar.c
+4
-16
drivers/atm/suni.c
drivers/atm/suni.c
+0
-18
No files found.
drivers/atm/idt77105.c
View file @
05417c09
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include <linux/init.h>
#include <linux/init.h>
#include <linux/capability.h>
#include <linux/capability.h>
#include <linux/atm_idt77105.h>
#include <linux/atm_idt77105.h>
#include <linux/spinlock.h>
#include <asm/system.h>
#include <asm/system.h>
#include <asm/param.h>
#include <asm/param.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
...
@@ -38,6 +39,7 @@ struct idt77105_priv {
...
@@ -38,6 +39,7 @@ struct idt77105_priv {
unsigned
char
old_mcr
;
/* storage of MCR reg while signal lost */
unsigned
char
old_mcr
;
/* storage of MCR reg while signal lost */
};
};
static
spinlock_t
idt77105_priv_lock
=
SPIN_LOCK_UNLOCKED
;
#define PRIV(dev) ((struct idt77105_priv *) dev->phy_data)
#define PRIV(dev) ((struct idt77105_priv *) dev->phy_data)
...
@@ -144,12 +146,11 @@ static int fetch_stats(struct atm_dev *dev,struct idt77105_stats *arg,int zero)
...
@@ -144,12 +146,11 @@ static int fetch_stats(struct atm_dev *dev,struct idt77105_stats *arg,int zero)
unsigned
long
flags
;
unsigned
long
flags
;
struct
idt77105_stats
stats
;
struct
idt77105_stats
stats
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
idt77105_priv_lock
,
flags
);
cli
();
memcpy
(
&
stats
,
&
PRIV
(
dev
)
->
stats
,
sizeof
(
struct
idt77105_stats
));
memcpy
(
&
stats
,
&
PRIV
(
dev
)
->
stats
,
sizeof
(
struct
idt77105_stats
));
if
(
zero
)
if
(
zero
)
memset
(
&
PRIV
(
dev
)
->
stats
,
0
,
sizeof
(
struct
idt77105_stats
));
memset
(
&
PRIV
(
dev
)
->
stats
,
0
,
sizeof
(
struct
idt77105_stats
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
idt77105_priv_lock
,
flags
);
if
(
arg
==
NULL
)
if
(
arg
==
NULL
)
return
0
;
return
0
;
return
copy_to_user
(
arg
,
&
PRIV
(
dev
)
->
stats
,
return
copy_to_user
(
arg
,
&
PRIV
(
dev
)
->
stats
,
...
@@ -267,11 +268,10 @@ static int idt77105_start(struct atm_dev *dev)
...
@@ -267,11 +268,10 @@ static int idt77105_start(struct atm_dev *dev)
if
(
!
(
PRIV
(
dev
)
=
kmalloc
(
sizeof
(
struct
idt77105_priv
),
GFP_KERNEL
)))
if
(
!
(
PRIV
(
dev
)
=
kmalloc
(
sizeof
(
struct
idt77105_priv
),
GFP_KERNEL
)))
return
-
ENOMEM
;
return
-
ENOMEM
;
PRIV
(
dev
)
->
dev
=
dev
;
PRIV
(
dev
)
->
dev
=
dev
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
idt77105_priv_lock
,
flags
);
cli
();
PRIV
(
dev
)
->
next
=
idt77105_all
;
PRIV
(
dev
)
->
next
=
idt77105_all
;
idt77105_all
=
PRIV
(
dev
);
idt77105_all
=
PRIV
(
dev
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
idt77105_priv_lock
,
flags
);
memset
(
&
PRIV
(
dev
)
->
stats
,
0
,
sizeof
(
struct
idt77105_stats
));
memset
(
&
PRIV
(
dev
)
->
stats
,
0
,
sizeof
(
struct
idt77105_stats
));
/* initialise dev->signal from Good Signal Bit */
/* initialise dev->signal from Good Signal Bit */
...
@@ -305,11 +305,9 @@ static int idt77105_start(struct atm_dev *dev)
...
@@ -305,11 +305,9 @@ static int idt77105_start(struct atm_dev *dev)
idt77105_stats_timer_func
(
0
);
/* clear 77105 counters */
idt77105_stats_timer_func
(
0
);
/* clear 77105 counters */
(
void
)
fetch_stats
(
dev
,
NULL
,
1
);
/* clear kernel counters */
(
void
)
fetch_stats
(
dev
,
NULL
,
1
);
/* clear kernel counters */
cli
();
spin_lock_irqsave
(
&
idt77105_priv_lock
,
flags
);
if
(
!
start_timer
)
restore_flags
(
flags
);
if
(
start_timer
)
{
else
{
start_timer
=
0
;
start_timer
=
0
;
restore_flags
(
flags
);
init_timer
(
&
stats_timer
);
init_timer
(
&
stats_timer
);
stats_timer
.
expires
=
jiffies
+
IDT77105_STATS_TIMER_PERIOD
;
stats_timer
.
expires
=
jiffies
+
IDT77105_STATS_TIMER_PERIOD
;
...
@@ -321,32 +319,11 @@ static int idt77105_start(struct atm_dev *dev)
...
@@ -321,32 +319,11 @@ static int idt77105_start(struct atm_dev *dev)
restart_timer
.
function
=
idt77105_restart_timer_func
;
restart_timer
.
function
=
idt77105_restart_timer_func
;
add_timer
(
&
restart_timer
);
add_timer
(
&
restart_timer
);
}
}
spin_unlock_irqrestore
(
&
idt77105_priv_lock
,
flags
);
return
0
;
return
0
;
}
}
static
const
struct
atmphy_ops
idt77105_ops
=
{
idt77105_start
,
idt77105_ioctl
,
idt77105_int
};
int
__init
idt77105_init
(
struct
atm_dev
*
dev
)
{
MOD_INC_USE_COUNT
;
dev
->
phy
=
&
idt77105_ops
;
return
0
;
}
/*
* TODO: this function should be called through phy_ops
* but that will not be possible for some time as there is
* currently a freeze on modifying that structure
* -- Greg Banks, 13 Sep 1999
*/
int
idt77105_stop
(
struct
atm_dev
*
dev
)
int
idt77105_stop
(
struct
atm_dev
*
dev
)
{
{
struct
idt77105_priv
*
walk
,
*
prev
;
struct
idt77105_priv
*
walk
,
*
prev
;
...
@@ -372,30 +349,33 @@ int idt77105_stop(struct atm_dev *dev)
...
@@ -372,30 +349,33 @@ int idt77105_stop(struct atm_dev *dev)
}
}
}
}
MOD_DEC_USE_COUNT
;
return
0
;
return
0
;
}
}
static
const
struct
atmphy_ops
idt77105_ops
=
{
.
start
=
idt77105_start
,
.
ioctl
=
idt77105_ioctl
,
.
interrupt
=
idt77105_int
,
.
stop
=
idt77105_stop
,
};
EXPORT_SYMBOL
(
idt77105_init
);
EXPORT_SYMBOL
(
idt77105_stop
);
MODULE_LICENSE
(
"GPL"
);
#ifdef MODULE
int
i
nit_module
(
void
)
int
i
dt77105_init
(
struct
atm_dev
*
dev
)
{
{
dev
->
phy
=
&
idt77105_ops
;
return
0
;
return
0
;
}
}
EXPORT_SYMBOL
(
idt77105_init
);
void
cleanup_module
(
void
)
static
void
__exit
idt77105_exit
(
void
)
{
{
/* turn off timers */
/* turn off timers */
del_timer
(
&
stats_timer
);
del_timer
(
&
stats_timer
);
del_timer
(
&
restart_timer
);
del_timer
(
&
restart_timer
);
}
}
#endif
module_exit
(
idt77105_exit
);
MODULE_LICENSE
(
"GPL"
);
drivers/atm/nicstar.c
View file @
05417c09
...
@@ -354,11 +354,8 @@ static void __exit nicstar_module_exit(void)
...
@@ -354,11 +354,8 @@ static void __exit nicstar_module_exit(void)
card
=
cards
[
i
];
card
=
cards
[
i
];
#ifdef CONFIG_ATM_NICSTAR_USE_IDT77105
if
(
card
->
atmdev
->
phy
&&
card
->
atmdev
->
phy
->
stop
)
if
(
card
->
max_pcr
==
ATM_25_PCR
)
{
card
->
atmdev
->
phy
->
stop
(
card
->
atmdev
);
idt77105_stop
(
card
->
atmdev
);
}
#endif
/* CONFIG_ATM_NICSTAR_USE_IDT77105 */
/* Stop everything */
/* Stop everything */
writel
(
0x00000000
,
card
->
membase
+
CFG
);
writel
(
0x00000000
,
card
->
membase
+
CFG
);
...
@@ -905,22 +902,13 @@ static int __init ns_init_card(int i, struct pci_dev *pcidev)
...
@@ -905,22 +902,13 @@ static int __init ns_init_card(int i, struct pci_dev *pcidev)
card
->
atmdev
->
phy
=
NULL
;
card
->
atmdev
->
phy
=
NULL
;
#ifdef CONFIG_ATM_NICSTAR_USE_SUNI
#ifdef CONFIG_ATM_NICSTAR_USE_SUNI
if
(
card
->
max_pcr
==
ATM_OC3_PCR
)
{
if
(
card
->
max_pcr
==
ATM_OC3_PCR
)
suni_init
(
card
->
atmdev
);
suni_init
(
card
->
atmdev
);
MOD_INC_USE_COUNT
;
/* Can't remove the nicstar driver or the suni driver would oops */
}
#endif
/* CONFIG_ATM_NICSTAR_USE_SUNI */
#endif
/* CONFIG_ATM_NICSTAR_USE_SUNI */
#ifdef CONFIG_ATM_NICSTAR_USE_IDT77105
#ifdef CONFIG_ATM_NICSTAR_USE_IDT77105
if
(
card
->
max_pcr
==
ATM_25_PCR
)
{
if
(
card
->
max_pcr
==
ATM_25_PCR
)
idt77105_init
(
card
->
atmdev
);
idt77105_init
(
card
->
atmdev
);
/* Note that for the IDT77105 PHY we don't need the awful
* module count hack that the SUNI needs because we can
* stop the '105 when the nicstar module is cleaned up.
*/
}
#endif
/* CONFIG_ATM_NICSTAR_USE_IDT77105 */
#endif
/* CONFIG_ATM_NICSTAR_USE_IDT77105 */
if
(
card
->
atmdev
->
phy
&&
card
->
atmdev
->
phy
->
start
)
if
(
card
->
atmdev
->
phy
&&
card
->
atmdev
->
phy
->
start
)
...
...
drivers/atm/suni.c
View file @
05417c09
...
@@ -307,24 +307,6 @@ int suni_init(struct atm_dev *dev)
...
@@ -307,24 +307,6 @@ int suni_init(struct atm_dev *dev)
return
0
;
return
0
;
}
}
EXPORT_SYMBOL
(
suni_init
);
EXPORT_SYMBOL
(
suni_init
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
#ifdef MODULE
int
init_module
(
void
)
{
return
0
;
}
void
cleanup_module
(
void
)
{
/* Nay */
}
#endif
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