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
005da93c
Commit
005da93c
authored
Apr 21, 2004
by
Denis Vlasenko
Committed by
Linus Torvalds
Apr 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fealnx #10: replace local delay functions with udelay
parent
0e2e4f04
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
43 deletions
+6
-43
drivers/net/fealnx.c
drivers/net/fealnx.c
+6
-43
No files found.
drivers/net/fealnx.c
View file @
005da93c
...
@@ -84,6 +84,7 @@ static int full_duplex[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 };
...
@@ -84,6 +84,7 @@ static int full_duplex[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 };
#include <linux/mii.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/ethtool.h>
#include <linux/crc32.h>
#include <linux/crc32.h>
#include <linux/delay.h>
#include <asm/processor.h>
/* Processor type for cache alignment. */
#include <asm/processor.h>
/* Processor type for cache alignment. */
#include <asm/bitops.h>
#include <asm/bitops.h>
...
@@ -715,6 +716,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
...
@@ -715,6 +716,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
return
err
;
return
err
;
}
}
static
void
__devexit
fealnx_remove_one
(
struct
pci_dev
*
pdev
)
static
void
__devexit
fealnx_remove_one
(
struct
pci_dev
*
pdev
)
{
{
struct
net_device
*
dev
=
pci_get_drvdata
(
pdev
);
struct
net_device
*
dev
=
pci_get_drvdata
(
pdev
);
...
@@ -737,43 +739,6 @@ static void __devexit fealnx_remove_one(struct pci_dev *pdev)
...
@@ -737,43 +739,6 @@ static void __devexit fealnx_remove_one(struct pci_dev *pdev)
printk
(
KERN_ERR
"fealnx: remove for unknown device
\n
"
);
printk
(
KERN_ERR
"fealnx: remove for unknown device
\n
"
);
}
}
unsigned
int
m80x_read_tick
(
void
)
/* function: Reads the Timer tick count register which decrements by 2 from */
/* 65536 to 0 every 1/36.414 of a second. Each 2 decrements of the */
/* count represents 838 nsec's. */
/* input : none. */
/* output : none. */
{
unsigned
char
tmp
;
int
value
;
writeb
((
char
)
0x06
,
0x43
);
// Command 8254 to latch T0's count
// now read the count.
tmp
=
(
unsigned
char
)
readb
(
0x40
);
value
=
((
int
)
tmp
)
<<
8
;
tmp
=
(
unsigned
char
)
readb
(
0x40
);
value
|=
(((
int
)
tmp
)
&
0xff
);
return
(
value
);
}
void
m80x_delay
(
unsigned
int
interval
)
/* function: to wait for a specified time. */
/* input : interval ... the specified time. */
/* output : none. */
{
unsigned
int
interval1
,
interval2
,
i
=
0
;
interval1
=
m80x_read_tick
();
// get initial value
do
{
interval2
=
m80x_read_tick
();
if
(
interval1
<
interval2
)
interval1
=
interval2
;
++
i
;
}
while
(((
interval1
-
interval2
)
<
(
ushort
)
interval
)
&&
(
i
<
65535
));
}
static
ulong
m80x_send_cmd_to_phy
(
long
miiport
,
int
opcode
,
int
phyad
,
int
regad
)
static
ulong
m80x_send_cmd_to_phy
(
long
miiport
,
int
opcode
,
int
phyad
,
int
regad
)
{
{
...
@@ -813,7 +778,7 @@ static ulong m80x_send_cmd_to_phy(long miiport, int opcode, int phyad, int regad
...
@@ -813,7 +778,7 @@ static ulong m80x_send_cmd_to_phy(long miiport, int opcode, int phyad, int regad
/* high MDC */
/* high MDC */
miir
|=
MASK_MIIR_MII_MDC
;
miir
|=
MASK_MIIR_MII_MDC
;
writel
(
miir
,
miiport
);
writel
(
miir
,
miiport
);
m80x_
delay
(
30
);
u
delay
(
30
);
/* next */
/* next */
mask
>>=
1
;
mask
>>=
1
;
...
@@ -848,7 +813,7 @@ static int mdio_read(struct net_device *dev, int phyad, int regad)
...
@@ -848,7 +813,7 @@ static int mdio_read(struct net_device *dev, int phyad, int regad)
/* high MDC, and wait */
/* high MDC, and wait */
miir
|=
MASK_MIIR_MII_MDC
;
miir
|=
MASK_MIIR_MII_MDC
;
writel
(
miir
,
miiport
);
writel
(
miir
,
miiport
);
m80x_delay
((
int
)
30
);
udelay
(
30
);
/* next */
/* next */
mask
>>=
1
;
mask
>>=
1
;
...
@@ -1025,8 +990,7 @@ static void getlinkstatus(struct net_device *dev)
...
@@ -1025,8 +990,7 @@ static void getlinkstatus(struct net_device *dev)
np
->
linkok
=
1
;
np
->
linkok
=
1
;
return
;
return
;
}
}
// delay
udelay
(
100
);
m80x_delay
(
100
);
}
}
}
else
{
}
else
{
for
(
i
=
0
;
i
<
DelayTime
;
++
i
)
{
for
(
i
=
0
;
i
<
DelayTime
;
++
i
)
{
...
@@ -1034,8 +998,7 @@ static void getlinkstatus(struct net_device *dev)
...
@@ -1034,8 +998,7 @@ static void getlinkstatus(struct net_device *dev)
np
->
linkok
=
1
;
np
->
linkok
=
1
;
return
;
return
;
}
}
// delay
udelay
(
100
);
m80x_delay
(
100
);
}
}
}
}
}
}
...
...
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