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
e331896d
Commit
e331896d
authored
Sep 25, 2003
by
Paul Gortmaker
Committed by
Jeff Garzik
Sep 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] ne2k-pci full duplex with RealTek
parent
d766e943
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
11 deletions
+38
-11
drivers/net/ne2k-pci.c
drivers/net/ne2k-pci.c
+38
-11
No files found.
drivers/net/ne2k-pci.c
View file @
e331896d
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,8 @@
*/
*/
#define DRV_NAME "ne2k-pci"
#define DRV_NAME "ne2k-pci"
#define DRV_VERSION "1.0
2
"
#define DRV_VERSION "1.0
3
"
#define DRV_RELDATE "
10/19/2000
"
#define DRV_RELDATE "
9/22/2003
"
/* The user-configurable values.
/* The user-configurable values.
...
@@ -380,21 +380,48 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
...
@@ -380,21 +380,48 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
}
}
/*
* Magic incantation sequence for full duplex on the supported cards.
*/
static
inline
int
set_realtek_fdx
(
struct
net_device
*
dev
)
{
long
ioaddr
=
dev
->
base_addr
;
outb
(
0xC0
+
E8390_NODMA
,
ioaddr
+
NE_CMD
);
/* Page 3 */
outb
(
0xC0
,
ioaddr
+
0x01
);
/* Enable writes to CONFIG3 */
outb
(
0x40
,
ioaddr
+
0x06
);
/* Enable full duplex */
outb
(
0x00
,
ioaddr
+
0x01
);
/* Disable writes to CONFIG3 */
outb
(
E8390_PAGE0
+
E8390_NODMA
,
ioaddr
+
NE_CMD
);
/* Page 0 */
return
0
;
}
static
inline
int
set_holtek_fdx
(
struct
net_device
*
dev
)
{
long
ioaddr
=
dev
->
base_addr
;
outb
(
inb
(
ioaddr
+
0x20
)
|
0x80
,
ioaddr
+
0x20
);
return
0
;
}
static
int
ne2k_pci_set_fdx
(
struct
net_device
*
dev
)
{
if
(
ei_status
.
ne2k_flags
&
REALTEK_FDX
)
return
set_realtek_fdx
(
dev
);
else
if
(
ei_status
.
ne2k_flags
&
HOLTEK_FDX
)
return
set_holtek_fdx
(
dev
);
return
-
EOPNOTSUPP
;
}
static
int
ne2k_pci_open
(
struct
net_device
*
dev
)
static
int
ne2k_pci_open
(
struct
net_device
*
dev
)
{
{
int
ret
=
request_irq
(
dev
->
irq
,
ei_interrupt
,
SA_SHIRQ
,
dev
->
name
,
dev
);
int
ret
=
request_irq
(
dev
->
irq
,
ei_interrupt
,
SA_SHIRQ
,
dev
->
name
,
dev
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
/* Set full duplex for the chips that we know about. */
if
(
ei_status
.
ne2k_flags
&
FORCE_FDX
)
if
(
ei_status
.
ne2k_flags
&
FORCE_FDX
)
{
ne2k_pci_set_fdx
(
dev
);
long
ioaddr
=
dev
->
base_addr
;
if
(
ei_status
.
ne2k_flags
&
REALTEK_FDX
)
{
outb
(
0xC0
+
E8390_NODMA
,
ioaddr
+
NE_CMD
);
/* Page 3 */
outb
(
inb
(
ioaddr
+
0x20
)
|
0x80
,
ioaddr
+
0x20
);
}
else
if
(
ei_status
.
ne2k_flags
&
HOLTEK_FDX
)
outb
(
inb
(
ioaddr
+
0x20
)
|
0x80
,
ioaddr
+
0x20
);
}
ei_open
(
dev
);
ei_open
(
dev
);
return
0
;
return
0
;
}
}
...
...
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