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
86bfa5ea
Commit
86bfa5ea
authored
Mar 06, 2002
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update starfire and tulip net drivers to use new PCI API functions
pci_set_mwi and pci_clear_mwi.
parent
018a69a1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
39 deletions
+48
-39
drivers/net/starfire.c
drivers/net/starfire.c
+11
-4
drivers/net/tulip/ChangeLog
drivers/net/tulip/ChangeLog
+7
-0
drivers/net/tulip/tulip_core.c
drivers/net/tulip/tulip_core.c
+30
-35
No files found.
drivers/net/starfire.c
View file @
86bfa5ea
...
...
@@ -96,9 +96,10 @@
LK1.3.5 (jgarzik)
- ethtool NWAY_RST, GLINK, [GS]MSGLVL support
LK1.3.6 (Ion Badulescu)
- Sparc64 support and fixes
- Better stats and error handling
LK1.3.6:
- Sparc64 support and fixes (Ion Badulescu)
- Better stats and error handling (Ion Badulescu)
- Use new pci_set_mwi() PCI API function (jgarzik)
TODO:
- implement tx_timeout() properly
...
...
@@ -107,7 +108,7 @@
#define DRV_NAME "starfire"
#define DRV_VERSION "1.03+LK1.3.6"
#define DRV_RELDATE "March
6
, 2002"
#define DRV_RELDATE "March
7
, 2002"
#include <linux/version.h>
#include <linux/module.h>
...
...
@@ -617,8 +618,10 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
long
ioaddr
;
int
drv_flags
,
io_size
;
int
boguscnt
;
#ifndef HAVE_PCI_SET_MWI
u16
cmd
;
u8
cache
;
#endif
/* when built into the kernel, we only print version if device is found */
#ifndef MODULE
...
...
@@ -665,6 +668,9 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
pci_set_master
(
pdev
);
#ifdef HAVE_PCI_SET_MWI
pci_set_mwi
(
pdev
);
#else
/* enable MWI -- it vastly improves Rx performance on sparc64 */
pci_read_config_word
(
pdev
,
PCI_COMMAND
,
&
cmd
);
cmd
|=
PCI_COMMAND_INVALIDATE
;
...
...
@@ -679,6 +685,7 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
pci_write_config_byte
(
pdev
,
PCI_CACHE_LINE_SIZE
,
SMP_CACHE_BYTES
>>
2
);
}
#endif
#ifdef ZEROCOPY
/* Starfire can do SG and TCP/UDP checksumming */
...
...
drivers/net/tulip/ChangeLog
View file @
86bfa5ea
2002-03-07 Jeff Garzik <jgarzik@mandrakesoft.com>
* tulip_core (tulip_mwi_config): Use new PCI API functions
for enabling and disabled Memory-Write-Invalidate
PCI transaction.
Fix bugs in tulip MWI config also.
2002-01-28 Stefan Rompf <srompf@isg.de>,
Jeff Garzik <jgarzik@mandrakesoft.com>
...
...
drivers/net/tulip/tulip_core.c
View file @
86bfa5ea
...
...
@@ -15,8 +15,8 @@
*/
#define DRV_NAME "tulip"
#define DRV_VERSION "1.1.1
1
"
#define DRV_RELDATE "
Feb 08
, 2002"
#define DRV_VERSION "1.1.1
2
"
#define DRV_RELDATE "
Mar 07
, 2002"
#include <linux/config.h>
#include <linux/module.h>
...
...
@@ -1164,7 +1164,7 @@ static void __devinit tulip_mwi_config (struct pci_dev *pdev,
{
struct
tulip_private
*
tp
=
dev
->
priv
;
u8
cache
;
u16
pci_command
,
new_command
;
u16
pci_command
;
u32
csr0
;
if
(
tulip_debug
>
3
)
...
...
@@ -1172,24 +1172,6 @@ static void __devinit tulip_mwi_config (struct pci_dev *pdev,
tp
->
csr0
=
csr0
=
0
;
/* check for sane cache line size. from acenic.c. */
pci_read_config_byte
(
pdev
,
PCI_CACHE_LINE_SIZE
,
&
cache
);
if
((
cache
<<
2
)
!=
SMP_CACHE_BYTES
)
{
printk
(
KERN_WARNING
"%s: PCI cache line size set incorrectly "
"(%i bytes) by BIOS/FW, correcting to %i
\n
"
,
pdev
->
slot_name
,
(
cache
<<
2
),
SMP_CACHE_BYTES
);
pci_write_config_byte
(
pdev
,
PCI_CACHE_LINE_SIZE
,
SMP_CACHE_BYTES
>>
2
);
udelay
(
5
);
}
/* read cache line size again, hardware may not have accepted
* our cache line size change
*/
pci_read_config_byte
(
pdev
,
PCI_CACHE_LINE_SIZE
,
&
cache
);
if
(
!
cache
)
goto
out
;
/* if we have any cache line size at all, we can do MRM */
csr0
|=
MRM
;
...
...
@@ -1200,15 +1182,19 @@ static void __devinit tulip_mwi_config (struct pci_dev *pdev,
/* set or disable MWI in the standard PCI command bit.
* Check for the case where mwi is desired but not available
*/
pci_read_config_word
(
pdev
,
PCI_COMMAND
,
&
pci_command
);
if
(
csr0
&
MWI
)
new_command
=
pci_command
|
PCI_COMMAND_INVALIDATE
;
else
new_command
=
pci_command
&
~
PCI_COMMAND_INVALIDATE
;
if
(
new_command
!=
pci_command
)
{
pci_write_config_word
(
pdev
,
PCI_COMMAND
,
new_command
);
udelay
(
5
);
if
(
csr0
&
MWI
)
pci_set_mwi
(
pdev
);
else
pci_clear_mwi
(
pdev
);
/* read result from hardware (in case bit refused to enable) */
pci_read_config_word
(
pdev
,
PCI_COMMAND
,
&
pci_command
);
if
((
csr0
&
MWI
)
&&
(
!
(
pci_command
&
PCI_COMMAND_INVALIDATE
)))
csr0
&=
~
MWI
;
/* if cache line size hardwired to zero, no MWI */
pci_read_config_byte
(
pdev
,
PCI_CACHE_LINE_SIZE
,
&
cache
);
if
((
csr0
&
MWI
)
&&
(
cache
==
0
))
{
csr0
&=
~
MWI
;
pci_clear_mwi
(
pdev
);
}
/* assign per-cacheline-size cache alignment and
...
...
@@ -1225,20 +1211,29 @@ static void __devinit tulip_mwi_config (struct pci_dev *pdev,
csr0
|=
MRL
|
(
3
<<
CALShift
)
|
(
32
<<
BurstLenShift
);
break
;
default:
goto
out
;
cache
=
0
;
break
;
}
tp
->
csr0
=
csr0
;
/* if we have a good cache line size, we by now have a good
* csr0, so save it and exit
*/
if
(
cache
)
goto
out
;
/* we don't have a good csr0 or cache line size, disable MWI */
if
(
csr0
&
MWI
)
{
pci_command
&=
~
PCI_COMMAND_INVALIDATE
;
pci_write_config_word
(
pdev
,
PCI_COMMAND
,
pci_command
);
pci_clear_mwi
(
pdev
);
csr0
&=
~
MWI
;
}
tp
->
csr0
=
csr0
|
(
8
<<
BurstLenShift
)
|
(
1
<<
CALShift
);
/* sane defaults for burst length and cache alignment
* originally from de4x5 driver
*/
csr0
|=
(
8
<<
BurstLenShift
)
|
(
1
<<
CALShift
);
out:
tp
->
csr0
=
csr0
;
if
(
tulip_debug
>
2
)
printk
(
KERN_DEBUG
"%s: MWI config cacheline=%d, csr0=%08x
\n
"
,
pdev
->
slot_name
,
cache
,
csr0
);
...
...
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