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
aadf0cf9
Commit
aadf0cf9
authored
Jun 25, 2003
by
Ralf Bächle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr] au1000_eth update
parent
3f8e1a1d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
49 deletions
+42
-49
drivers/net/Kconfig
drivers/net/Kconfig
+4
-4
drivers/net/Makefile
drivers/net/Makefile
+1
-1
drivers/net/au1000_eth.c
drivers/net/au1000_eth.c
+34
-36
drivers/net/au1000_eth.h
drivers/net/au1000_eth.h
+3
-8
No files found.
drivers/net/Kconfig
View file @
aadf0cf9
...
...
@@ -492,12 +492,12 @@ config MIPS_GT96100ETH
help
Say Y here to support the Ethernet subsystem on your GT96100 card.
config MIPS_AU1
0
00_ENET
config MIPS_AU1
X
00_ENET
bool "MIPS AU1000 Ethernet support"
depends on NET_ETHERNET &&
MIPS_AU10
00
depends on NET_ETHERNET &&
SOC_AU1X
00
help
If you have an Alchemy Semi AU1
000 ethernet controller
on an SGI MIPS system,
say Y. Otherwise, say N.
If you have an Alchemy Semi AU1
X00 based system
say Y. Otherwise, say N.
config NET_SB1250_MAC
tristate "SB1250 Ethernet support"
...
...
drivers/net/Makefile
View file @
aadf0cf9
...
...
@@ -157,7 +157,7 @@ obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o
obj-$(CONFIG_EQUALIZER)
+=
eql.o
obj-$(CONFIG_MIPS_JAZZ_SONIC)
+=
jazzsonic.o
obj-$(CONFIG_MIPS_GT96100ETH)
+=
gt96100eth.o
obj-$(CONFIG_MIPS_AU1
0
00_ENET)
+=
au1000_eth.o
obj-$(CONFIG_MIPS_AU1
X
00_ENET)
+=
au1000_eth.o
obj-$(CONFIG_SGI_IOC3_ETH)
+=
ioc3-eth.o
obj-$(CONFIG_BAGETLANCE)
+=
bagetlance.o
obj-$(CONFIG_DECLANCE)
+=
declance.o
...
...
drivers/net/au1000_eth.c
View file @
aadf0cf9
/*
*
* Alchemy Semi Au1000 ethernet driver
*
* Copyright 2001 MontaVista Software Inc.
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
*
* ########################################################################
*
* This program is free software; you can distribute it and/or modify it
* under the terms of the GNU General Public License (Version 2) as
* published by the Free Software Foundation.
...
...
@@ -20,16 +17,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* ########################################################################
*
*
*/
#ifndef __mips__
#error This driver only works with MIPS architectures!
#endif
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
...
...
@@ -125,7 +114,7 @@ static struct {
},
au1100_iflist
[
NUM_INTERFACES
]
=
{
{
AU1000_ETH0_BASE
,
AU1000_ETH0_IRQ
},
{
NULL
,
NULL
}
{
0
,
0
}
};
static
char
version
[]
__devinitdata
=
...
...
@@ -152,13 +141,6 @@ static unsigned char au1000_mac_addr[6] __devinitdata = {
* code.
*/
static
char
*
phy_link
[]
=
{
"unknown"
,
"10Base2"
,
"10BaseT"
,
"AUI"
,
"100BaseT"
,
"100BaseTX"
,
"100BaseFX"
};
int
bcm_5201_init
(
struct
net_device
*
dev
,
int
phy_addr
)
{
s16
data
;
...
...
@@ -184,6 +166,11 @@ int bcm_5201_init(struct net_device *dev, int phy_addr)
data
&=
~
MII_FDX_LED
;
mdio_write
(
dev
,
phy_addr
,
MII_INT
,
data
);
/* Enable TX LED instead of FDX */
data
=
mdio_read
(
dev
,
phy_addr
,
MII_INT
);
data
&=
~
MII_FDX_LED
;
mdio_write
(
dev
,
phy_addr
,
MII_INT
,
data
);
if
(
au1000_debug
>
4
)
dump_mii
(
dev
,
phy_addr
);
return
0
;
}
...
...
@@ -640,7 +627,7 @@ static int __init au1000_init_module(void)
int
prid
;
int
base_addr
,
irq
;
prid
=
read_
32bit_cp0_register
(
CP0_PRID
);
prid
=
read_
c0_prid
(
);
for
(
i
=
0
;
i
<
NUM_INTERFACES
;
i
++
)
{
if
(
(
prid
&
0xffff0000
)
==
0x00030000
)
{
base_addr
=
au1000_iflist
[
i
].
port
;
...
...
@@ -675,10 +662,11 @@ au1000_probe1(struct net_device *dev, long ioaddr, int irq, int port_num)
char
*
pmac
,
*
argptr
;
char
ethaddr
[
6
];
if
(
!
request_region
(
ioaddr
,
MAC_IOSIZE
,
"Au1000 ENET"
))
if
(
!
request_region
(
PHYSADDR
(
ioaddr
)
,
MAC_IOSIZE
,
"Au1000 ENET"
))
return
-
ENODEV
;
if
(
version_printed
++
==
0
)
printk
(
version
);
if
(
version_printed
++
==
0
)
printk
(
version
);
if
(
!
dev
)
dev
=
init_etherdev
(
NULL
,
sizeof
(
struct
au1000_private
));
...
...
@@ -816,7 +804,7 @@ au1000_probe1(struct net_device *dev, long ioaddr, int irq, int port_num)
return
0
;
free_region:
release_region
(
ioaddr
,
MAC_IOSIZE
);
release_region
(
PHYSADDR
(
ioaddr
)
,
MAC_IOSIZE
);
unregister_netdev
(
dev
);
if
(
aup
->
vaddr
)
dma_free
((
void
*
)
aup
->
vaddr
,
...
...
@@ -1047,8 +1035,9 @@ static void au1000_tx_ack(struct net_device *dev)
ptxd
=
aup
->
tx_dma_ring
[
aup
->
tx_tail
];
while
(
ptxd
->
buff_stat
&
TX_T_DONE
)
{
update_tx_stats
(
dev
,
ptxd
->
status
,
ptxd
->
len
&
0x3ff
);
update_tx_stats
(
dev
,
ptxd
->
status
,
aup
->
tx_len
[
aup
->
tx_tail
]
&
0x3ff
);
ptxd
->
buff_stat
&=
~
TX_T_DONE
;
aup
->
tx_len
[
aup
->
tx_tail
]
=
0
;
ptxd
->
len
=
0
;
au_sync
();
...
...
@@ -1088,7 +1077,8 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
return
1
;
}
else
if
(
buff_stat
&
TX_T_DONE
)
{
update_tx_stats
(
dev
,
ptxd
->
status
,
ptxd
->
len
&
0x3ff
);
update_tx_stats
(
dev
,
ptxd
->
status
,
aup
->
tx_len
[
aup
->
tx_head
]
&
0x3ff
);
aup
->
tx_len
[
aup
->
tx_head
]
=
0
;
ptxd
->
len
=
0
;
}
...
...
@@ -1103,11 +1093,13 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
for
(
i
=
skb
->
len
;
i
<
MAC_MIN_PKT_SIZE
;
i
++
)
{
((
char
*
)
pDB
->
vaddr
)[
i
]
=
0
;
}
aup
->
tx_len
[
aup
->
tx_head
]
=
MAC_MIN_PKT_SIZE
;
ptxd
->
len
=
MAC_MIN_PKT_SIZE
;
}
else
else
{
aup
->
tx_len
[
aup
->
tx_head
]
=
skb
->
len
;
ptxd
->
len
=
skb
->
len
;
}
ptxd
->
buff_stat
=
pDB
->
dma_addr
|
TX_DMA_ENABLE
;
au_sync
();
dev_kfree_skb
(
skb
);
...
...
@@ -1244,6 +1236,8 @@ static void au1000_tx_timeout(struct net_device *dev)
printk
(
KERN_ERR
"%s: au1000_tx_timeout: dev=%p
\n
"
,
dev
->
name
,
dev
);
reset_mac
(
dev
);
au1000_init
(
dev
);
dev
->
trans_start
=
jiffies
;
netif_wake_queue
(
dev
);
}
static
void
set_rx_mode
(
struct
net_device
*
dev
)
...
...
@@ -1269,7 +1263,8 @@ static void set_rx_mode(struct net_device *dev)
mc_filter
[
1
]
=
mc_filter
[
0
]
=
0
;
for
(
i
=
0
,
mclist
=
dev
->
mc_list
;
mclist
&&
i
<
dev
->
mc_count
;
i
++
,
mclist
=
mclist
->
next
)
{
set_bit
(
ether_crc
(
ETH_ALEN
,
mclist
->
dmi_addr
)
>>
26
,
mc_filter
);
set_bit
(
ether_crc_le
(
ETH_ALEN
,
mclist
->
dmi_addr
)
>>
26
,
mc_filter
);
}
aup
->
mac
->
multi_hash_high
=
mc_filter
[
1
];
aup
->
mac
->
multi_hash_low
=
mc_filter
[
0
];
...
...
@@ -1287,6 +1282,7 @@ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
switch
(
cmd
)
{
case
SIOCGMIIPHY
:
/* Get the address of the PHY in use. */
data
[
0
]
=
PHY_ADDRESS
;
return
0
;
case
SIOCGMIIREG
:
/* Read the specified MII register. */
//data[3] = mdio_read(ioaddr, data[0], data[1]);
...
...
@@ -1295,8 +1291,10 @@ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
case
SIOCSMIIREG
:
/* Write the specified MII register */
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
//mdio_write(ioaddr, data[0], data[1], data[2]);
return
0
;
default:
return
-
EOPNOTSUPP
;
}
...
...
drivers/net/au1000_eth.h
View file @
aadf0cf9
/*
*
* Alchemy Semi Au1000 ethernet driver include file
*
* Author: Pete Popov <ppopov@mvista.com>
*
* Copyright 2001 MontaVista Software Inc.
*
* ########################################################################
*
* This program is free software; you can distribute it and/or modify it
* under the terms of the GNU General Public License (Version 2) as
* published by the Free Software Foundation.
...
...
@@ -20,11 +17,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* ########################################################################
*
*
*/
#include <linux/config.h>
#define NUM_INTERFACES 2
...
...
@@ -203,6 +197,7 @@ struct au1000_private {
db_dest_t
db
[
NUM_RX_BUFFS
+
NUM_TX_BUFFS
];
volatile
rx_dma_t
*
rx_dma_ring
[
NUM_RX_DMA
];
volatile
tx_dma_t
*
tx_dma_ring
[
NUM_TX_DMA
];
int
tx_len
[
NUM_TX_DMA
];
db_dest_t
*
rx_db_inuse
[
NUM_RX_DMA
];
db_dest_t
*
tx_db_inuse
[
NUM_TX_DMA
];
u32
rx_head
;
...
...
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