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
88873604
Commit
88873604
authored
Mar 14, 2002
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Plain Diff
Merge mandrakesoft.com:/home/jgarzik/repo/anton-pcnet32-2.5
into mandrakesoft.com:/home/jgarzik/repo/net-drivers-2.5
parents
b8f53f4a
8a015649
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
drivers/net/pcnet32.c
drivers/net/pcnet32.c
+14
-8
No files found.
drivers/net/pcnet32.c
View file @
88873604
...
@@ -323,7 +323,7 @@ struct pcnet32_private {
...
@@ -323,7 +323,7 @@ struct pcnet32_private {
static
void
pcnet32_probe_vlbus
(
void
);
static
void
pcnet32_probe_vlbus
(
void
);
static
int
pcnet32_probe_pci
(
struct
pci_dev
*
,
const
struct
pci_device_id
*
);
static
int
pcnet32_probe_pci
(
struct
pci_dev
*
,
const
struct
pci_device_id
*
);
static
int
pcnet32_probe1
(
unsigned
long
,
unsigned
char
,
int
,
struct
pci_dev
*
);
static
int
pcnet32_probe1
(
unsigned
long
,
unsigned
int
,
int
,
struct
pci_dev
*
);
static
int
pcnet32_open
(
struct
net_device
*
);
static
int
pcnet32_open
(
struct
net_device
*
);
static
int
pcnet32_init_ring
(
struct
net_device
*
);
static
int
pcnet32_init_ring
(
struct
net_device
*
);
static
int
pcnet32_start_xmit
(
struct
sk_buff
*
,
struct
net_device
*
);
static
int
pcnet32_start_xmit
(
struct
sk_buff
*
,
struct
net_device
*
);
...
@@ -507,7 +507,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
...
@@ -507,7 +507,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
* pdev will be NULL when called from pcnet32_probe_vlbus.
* pdev will be NULL when called from pcnet32_probe_vlbus.
*/
*/
static
int
__devinit
static
int
__devinit
pcnet32_probe1
(
unsigned
long
ioaddr
,
unsigned
char
irq_line
,
int
shared
,
pcnet32_probe1
(
unsigned
long
ioaddr
,
unsigned
int
irq_line
,
int
shared
,
struct
pci_dev
*
pdev
)
struct
pci_dev
*
pdev
)
{
{
struct
pcnet32_private
*
lp
;
struct
pcnet32_private
*
lp
;
...
@@ -522,13 +522,13 @@ pcnet32_probe1(unsigned long ioaddr, unsigned char irq_line, int shared,
...
@@ -522,13 +522,13 @@ pcnet32_probe1(unsigned long ioaddr, unsigned char irq_line, int shared,
u8
promaddr
[
6
];
u8
promaddr
[
6
];
/* reset the chip */
/* reset the chip */
pcnet32_dwio_reset
(
ioaddr
);
pcnet32_wio_reset
(
ioaddr
);
pcnet32_wio_reset
(
ioaddr
);
/* NOTE: 16-bit check is first, otherwise some older PCnet chips fail */
/* NOTE: 16-bit check is first, otherwise some older PCnet chips fail */
if
(
pcnet32_wio_read_csr
(
ioaddr
,
0
)
==
4
&&
pcnet32_wio_check
(
ioaddr
))
{
if
(
pcnet32_wio_read_csr
(
ioaddr
,
0
)
==
4
&&
pcnet32_wio_check
(
ioaddr
))
{
a
=
&
pcnet32_wio
;
a
=
&
pcnet32_wio
;
}
else
{
}
else
{
pcnet32_dwio_reset
(
ioaddr
);
if
(
pcnet32_dwio_read_csr
(
ioaddr
,
0
)
==
4
&&
pcnet32_dwio_check
(
ioaddr
))
{
if
(
pcnet32_dwio_read_csr
(
ioaddr
,
0
)
==
4
&&
pcnet32_dwio_check
(
ioaddr
))
{
a
=
&
pcnet32_dwio
;
a
=
&
pcnet32_dwio
;
}
else
}
else
...
@@ -789,7 +789,7 @@ pcnet32_probe1(unsigned long ioaddr, unsigned char irq_line, int shared,
...
@@ -789,7 +789,7 @@ pcnet32_probe1(unsigned long ioaddr, unsigned char irq_line, int shared,
dev
->
set_multicast_list
=
&
pcnet32_set_multicast_list
;
dev
->
set_multicast_list
=
&
pcnet32_set_multicast_list
;
dev
->
do_ioctl
=
&
pcnet32_ioctl
;
dev
->
do_ioctl
=
&
pcnet32_ioctl
;
dev
->
tx_timeout
=
pcnet32_tx_timeout
;
dev
->
tx_timeout
=
pcnet32_tx_timeout
;
dev
->
watchdog_timeo
=
(
HZ
>>
1
);
dev
->
watchdog_timeo
=
(
5
*
HZ
);
lp
->
next
=
pcnet32_dev
;
lp
->
next
=
pcnet32_dev
;
pcnet32_dev
=
dev
;
pcnet32_dev
=
dev
;
...
@@ -946,7 +946,7 @@ pcnet32_purge_tx_ring(struct net_device *dev)
...
@@ -946,7 +946,7 @@ pcnet32_purge_tx_ring(struct net_device *dev)
for
(
i
=
0
;
i
<
TX_RING_SIZE
;
i
++
)
{
for
(
i
=
0
;
i
<
TX_RING_SIZE
;
i
++
)
{
if
(
lp
->
tx_skbuff
[
i
])
{
if
(
lp
->
tx_skbuff
[
i
])
{
pci_unmap_single
(
lp
->
pci_dev
,
lp
->
tx_dma_addr
[
i
],
lp
->
tx_skbuff
[
i
]
->
len
,
PCI_DMA_TODEVICE
);
pci_unmap_single
(
lp
->
pci_dev
,
lp
->
tx_dma_addr
[
i
],
lp
->
tx_skbuff
[
i
]
->
len
,
PCI_DMA_TODEVICE
);
dev_kfree_skb
(
lp
->
tx_skbuff
[
i
]);
dev_kfree_skb
_any
(
lp
->
tx_skbuff
[
i
]);
lp
->
tx_skbuff
[
i
]
=
NULL
;
lp
->
tx_skbuff
[
i
]
=
NULL
;
lp
->
tx_dma_addr
[
i
]
=
0
;
lp
->
tx_dma_addr
[
i
]
=
0
;
}
}
...
@@ -1022,8 +1022,9 @@ static void
...
@@ -1022,8 +1022,9 @@ static void
pcnet32_tx_timeout
(
struct
net_device
*
dev
)
pcnet32_tx_timeout
(
struct
net_device
*
dev
)
{
{
struct
pcnet32_private
*
lp
=
dev
->
priv
;
struct
pcnet32_private
*
lp
=
dev
->
priv
;
unsigned
int
ioaddr
=
dev
->
base_addr
;
unsigned
long
ioaddr
=
dev
->
base_addr
,
flags
;
spin_lock_irqsave
(
&
lp
->
lock
,
flags
);
/* Transmitter timeout, serious problems. */
/* Transmitter timeout, serious problems. */
printk
(
KERN_ERR
"%s: transmit timed out, status %4.4x, resetting.
\n
"
,
printk
(
KERN_ERR
"%s: transmit timed out, status %4.4x, resetting.
\n
"
,
dev
->
name
,
lp
->
a
.
read_csr
(
ioaddr
,
0
));
dev
->
name
,
lp
->
a
.
read_csr
(
ioaddr
,
0
));
...
@@ -1048,6 +1049,8 @@ pcnet32_tx_timeout (struct net_device *dev)
...
@@ -1048,6 +1049,8 @@ pcnet32_tx_timeout (struct net_device *dev)
dev
->
trans_start
=
jiffies
;
dev
->
trans_start
=
jiffies
;
netif_start_queue
(
dev
);
netif_start_queue
(
dev
);
spin_unlock_irqrestore
(
&
lp
->
lock
,
flags
);
}
}
...
@@ -1055,7 +1058,7 @@ static int
...
@@ -1055,7 +1058,7 @@ static int
pcnet32_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
pcnet32_start_xmit
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
pcnet32_private
*
lp
=
dev
->
priv
;
struct
pcnet32_private
*
lp
=
dev
->
priv
;
unsigned
int
ioaddr
=
dev
->
base_addr
;
unsigned
long
ioaddr
=
dev
->
base_addr
;
u16
status
;
u16
status
;
int
entry
;
int
entry
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -1307,6 +1310,7 @@ pcnet32_rx(struct net_device *dev)
...
@@ -1307,6 +1310,7 @@ pcnet32_rx(struct net_device *dev)
if
((
newskb
=
dev_alloc_skb
(
PKT_BUF_SZ
)))
{
if
((
newskb
=
dev_alloc_skb
(
PKT_BUF_SZ
)))
{
skb_reserve
(
newskb
,
2
);
skb_reserve
(
newskb
,
2
);
skb
=
lp
->
rx_skbuff
[
entry
];
skb
=
lp
->
rx_skbuff
[
entry
];
pci_unmap_single
(
lp
->
pci_dev
,
lp
->
rx_dma_addr
[
entry
],
skb
->
len
,
PCI_DMA_FROMDEVICE
);
skb_put
(
skb
,
pkt_len
);
skb_put
(
skb
,
pkt_len
);
lp
->
rx_skbuff
[
entry
]
=
newskb
;
lp
->
rx_skbuff
[
entry
]
=
newskb
;
newskb
->
dev
=
dev
;
newskb
->
dev
=
dev
;
...
@@ -1473,9 +1477,10 @@ static void pcnet32_load_multicast (struct net_device *dev)
...
@@ -1473,9 +1477,10 @@ static void pcnet32_load_multicast (struct net_device *dev)
*/
*/
static
void
pcnet32_set_multicast_list
(
struct
net_device
*
dev
)
static
void
pcnet32_set_multicast_list
(
struct
net_device
*
dev
)
{
{
unsigned
long
ioaddr
=
dev
->
base_addr
;
unsigned
long
ioaddr
=
dev
->
base_addr
,
flags
;
struct
pcnet32_private
*
lp
=
dev
->
priv
;
struct
pcnet32_private
*
lp
=
dev
->
priv
;
spin_lock_irqsave
(
&
lp
->
lock
,
flags
);
if
(
dev
->
flags
&
IFF_PROMISC
)
{
if
(
dev
->
flags
&
IFF_PROMISC
)
{
/* Log any net taps. */
/* Log any net taps. */
printk
(
KERN_INFO
"%s: Promiscuous mode enabled.
\n
"
,
dev
->
name
);
printk
(
KERN_INFO
"%s: Promiscuous mode enabled.
\n
"
,
dev
->
name
);
...
@@ -1488,6 +1493,7 @@ static void pcnet32_set_multicast_list(struct net_device *dev)
...
@@ -1488,6 +1493,7 @@ static void pcnet32_set_multicast_list(struct net_device *dev)
lp
->
a
.
write_csr
(
ioaddr
,
0
,
0x0004
);
/* Temporarily stop the lance. */
lp
->
a
.
write_csr
(
ioaddr
,
0
,
0x0004
);
/* Temporarily stop the lance. */
pcnet32_restart
(
dev
,
0x0042
);
/* Resume normal operation */
pcnet32_restart
(
dev
,
0x0042
);
/* Resume normal operation */
spin_unlock_irqrestore
(
&
lp
->
lock
,
flags
);
}
}
static
int
mdio_read
(
struct
net_device
*
dev
,
int
phy_id
,
int
reg_num
)
static
int
mdio_read
(
struct
net_device
*
dev
,
int
phy_id
,
int
reg_num
)
...
...
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