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
b33c7025
Commit
b33c7025
authored
Jan 10, 2004
by
Richard Procter
Committed by
Jeff Garzik
Jan 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr 3c527] whitespace changes (sync up with maintainer)
parent
e958d4a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
80 deletions
+81
-80
drivers/net/3c527.c
drivers/net/3c527.c
+81
-80
No files found.
drivers/net/3c527.c
View file @
b33c7025
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#define DRV_NAME "3c527"
#define DRV_NAME "3c527"
#define DRV_VERSION "0.7-SMP"
#define DRV_VERSION "0.7-SMP"
#define DRV_RELDATE "2003/
10/06
"
#define DRV_RELDATE "2003/
09/17
"
static
const
char
*
version
=
static
const
char
*
version
=
DRV_NAME
".c:v"
DRV_VERSION
" "
DRV_RELDATE
" Richard Procter <rnp@paradise.net.nz>
\n
"
;
DRV_NAME
".c:v"
DRV_VERSION
" "
DRV_RELDATE
" Richard Procter <rnp@paradise.net.nz>
\n
"
;
...
@@ -146,14 +146,12 @@ static unsigned int mc32_debug = NET_DEBUG;
...
@@ -146,14 +146,12 @@ static unsigned int mc32_debug = NET_DEBUG;
static
const
int
WORKAROUND_82586
=
1
;
static
const
int
WORKAROUND_82586
=
1
;
/* Pointers to buffers and their on-card records */
/* Pointers to buffers and their on-card records */
struct
mc32_ring_desc
struct
mc32_ring_desc
{
{
volatile
struct
skb_header
*
p
;
volatile
struct
skb_header
*
p
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
};
};
/* Information that needs to be kept for each board. */
/* Information that needs to be kept for each board. */
struct
mc32_local
struct
mc32_local
{
{
...
@@ -181,6 +179,7 @@ struct mc32_local
...
@@ -181,6 +179,7 @@ struct mc32_local
atomic_t
tx_count
;
/* buffers left */
atomic_t
tx_count
;
/* buffers left */
volatile
u16
tx_ring_head
;
/* index to tx en-queue end */
volatile
u16
tx_ring_head
;
/* index to tx en-queue end */
u16
tx_ring_tail
;
/* index to tx de-queue end */
u16
tx_ring_tail
;
/* index to tx de-queue end */
u16
rx_ring_tail
;
/* index to rx de-queue end */
u16
rx_ring_tail
;
/* index to rx de-queue end */
struct
semaphore
cmd_mutex
;
/* Serialises issuing of execute commands */
struct
semaphore
cmd_mutex
;
/* Serialises issuing of execute commands */
...
@@ -583,8 +582,10 @@ static int mc32_command_nowait(struct net_device *dev, u16 cmd, void *data, int
...
@@ -583,8 +582,10 @@ static int mc32_command_nowait(struct net_device *dev, u16 cmd, void *data, int
outb
(
1
<<
6
,
ioaddr
+
HOST_CMD
);
outb
(
1
<<
6
,
ioaddr
+
HOST_CMD
);
ret
=
0
;
ret
=
0
;
/* Interrupt handler will signal mutex on completion */
/* Interrupt handler will signal mutex on completion */
}
}
return
ret
;
return
ret
;
}
}
...
@@ -606,7 +607,6 @@ static int mc32_command_nowait(struct net_device *dev, u16 cmd, void *data, int
...
@@ -606,7 +607,6 @@ static int mc32_command_nowait(struct net_device *dev, u16 cmd, void *data, int
* reply. All well and good. The complication arises because you use
* reply. All well and good. The complication arises because you use
* commands for filter list changes which come in at bh level from things
* commands for filter list changes which come in at bh level from things
* like IPV6 group stuff.
* like IPV6 group stuff.
*
*/
*/
static
int
mc32_command
(
struct
net_device
*
dev
,
u16
cmd
,
void
*
data
,
int
len
)
static
int
mc32_command
(
struct
net_device
*
dev
,
u16
cmd
,
void
*
data
,
int
len
)
...
@@ -618,7 +618,7 @@ static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len)
...
@@ -618,7 +618,7 @@ static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len)
down
(
&
lp
->
cmd_mutex
);
down
(
&
lp
->
cmd_mutex
);
/*
/*
*
My t
urn
*
My T
urn
*/
*/
lp
->
cmd_nonblocking
=
0
;
lp
->
cmd_nonblocking
=
0
;
...
@@ -636,6 +636,7 @@ static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len)
...
@@ -636,6 +636,7 @@ static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len)
ret
=
-
1
;
ret
=
-
1
;
up
(
&
lp
->
cmd_mutex
);
up
(
&
lp
->
cmd_mutex
);
/*
/*
* A multicast set got blocked - try it now
* A multicast set got blocked - try it now
*/
*/
...
@@ -701,9 +702,7 @@ static void mc32_halt_transceiver(struct net_device *dev)
...
@@ -701,9 +702,7 @@ static void mc32_halt_transceiver(struct net_device *dev)
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
mc32_ready_poll
(
dev
);
mc32_ready_poll
(
dev
);
lp
->
rx_box
->
mbox
=
0
;
lp
->
rx_box
->
mbox
=
0
;
outb
(
HOST_CMD_SUSPND_RX
,
ioaddr
+
HOST_CMD
);
outb
(
HOST_CMD_SUSPND_RX
,
ioaddr
+
HOST_CMD
);
wait_for_completion
(
&
lp
->
xceiver_cmd
);
wait_for_completion
(
&
lp
->
xceiver_cmd
);
...
@@ -786,7 +785,6 @@ static int mc32_load_rx_ring(struct net_device *dev)
...
@@ -786,7 +785,6 @@ static int mc32_load_rx_ring(struct net_device *dev)
static
void
mc32_flush_rx_ring
(
struct
net_device
*
dev
)
static
void
mc32_flush_rx_ring
(
struct
net_device
*
dev
)
{
{
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
int
i
;
int
i
;
for
(
i
=
0
;
i
<
RX_RING_LEN
;
i
++
)
for
(
i
=
0
;
i
<
RX_RING_LEN
;
i
++
)
...
@@ -834,7 +832,7 @@ static void mc32_load_tx_ring(struct net_device *dev)
...
@@ -834,7 +832,7 @@ static void mc32_load_tx_ring(struct net_device *dev)
tx_base
=
p
->
next
;
tx_base
=
p
->
next
;
}
}
/* -1 so that tx_ring_head cannot "lap" tx_ring_tail
,
*/
/* -1 so that tx_ring_head cannot "lap" tx_ring_tail */
/* see mc32_tx_ring */
/* see mc32_tx_ring */
atomic_set
(
&
lp
->
tx_count
,
TX_RING_LEN
-
1
);
atomic_set
(
&
lp
->
tx_count
,
TX_RING_LEN
-
1
);
...
@@ -855,7 +853,6 @@ static void mc32_load_tx_ring(struct net_device *dev)
...
@@ -855,7 +853,6 @@ static void mc32_load_tx_ring(struct net_device *dev)
static
void
mc32_flush_tx_ring
(
struct
net_device
*
dev
)
static
void
mc32_flush_tx_ring
(
struct
net_device
*
dev
)
{
{
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
int
i
;
int
i
;
for
(
i
=
0
;
i
<
TX_RING_LEN
;
i
++
)
for
(
i
=
0
;
i
<
TX_RING_LEN
;
i
++
)
...
@@ -911,6 +908,7 @@ static int mc32_open(struct net_device *dev)
...
@@ -911,6 +908,7 @@ static int mc32_open(struct net_device *dev)
up
(
&
lp
->
cmd_mutex
);
up
(
&
lp
->
cmd_mutex
);
/*
/*
* Send the indications on command
* Send the indications on command
*/
*/
...
@@ -1008,12 +1006,11 @@ static void mc32_timeout(struct net_device *dev)
...
@@ -1008,12 +1006,11 @@ static void mc32_timeout(struct net_device *dev)
* crucial that we update lp->tx_ring_head only after we've
* crucial that we update lp->tx_ring_head only after we've
* established a valid packet in the tx ring (and is why we mark
* established a valid packet in the tx ring (and is why we mark
* tx_ring_head volatile).
* tx_ring_head volatile).
*
/
*
**/
static
int
mc32_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
static
int
mc32_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
{
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
u16
head
=
lp
->
tx_ring_head
;
u16
head
=
lp
->
tx_ring_head
;
volatile
struct
skb_header
*
p
,
*
np
;
volatile
struct
skb_header
*
p
,
*
np
;
...
@@ -1025,6 +1022,7 @@ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev)
...
@@ -1025,6 +1022,7 @@ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev)
}
}
skb
=
skb_padto
(
skb
,
ETH_ZLEN
);
skb
=
skb_padto
(
skb
,
ETH_ZLEN
);
if
(
skb
==
NULL
)
{
if
(
skb
==
NULL
)
{
netif_wake_queue
(
dev
);
netif_wake_queue
(
dev
);
return
0
;
return
0
;
...
@@ -1041,7 +1039,7 @@ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev)
...
@@ -1041,7 +1039,7 @@ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev)
np
=
lp
->
tx_ring
[
head
].
p
;
np
=
lp
->
tx_ring
[
head
].
p
;
/* We will need this to flush the buffer out */
/* We will need this to flush the buffer out */
lp
->
tx_ring
[
head
].
skb
=
skb
;
lp
->
tx_ring
[
lp
->
tx_ring_head
].
skb
=
skb
;
np
->
length
=
unlikely
(
skb
->
len
<
ETH_ZLEN
)
?
ETH_ZLEN
:
skb
->
len
;
np
->
length
=
unlikely
(
skb
->
len
<
ETH_ZLEN
)
?
ETH_ZLEN
:
skb
->
len
;
...
@@ -1142,6 +1140,7 @@ static void mc32_rx_ring(struct net_device *dev)
...
@@ -1142,6 +1140,7 @@ static void mc32_rx_ring(struct net_device *dev)
int
x
=
0
;
int
x
=
0
;
rx_old_tail
=
rx_ring_tail
=
lp
->
rx_ring_tail
;
rx_old_tail
=
rx_ring_tail
=
lp
->
rx_ring_tail
;
do
do
{
{
p
=
lp
->
rx_ring
[
rx_ring_tail
].
p
;
p
=
lp
->
rx_ring
[
rx_ring_tail
].
p
;
...
@@ -1389,7 +1388,9 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
...
@@ -1389,7 +1388,9 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
if
(
lp
->
mc_reload_wait
)
if
(
lp
->
mc_reload_wait
)
mc32_reset_multicast_list
(
dev
);
mc32_reset_multicast_list
(
dev
);
}
}
else
complete
(
&
lp
->
execution_cmd
);
else
{
complete
(
&
lp
->
execution_cmd
);
}
}
}
if
(
status
&
2
)
if
(
status
&
2
)
{
{
...
@@ -1442,8 +1443,8 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
...
@@ -1442,8 +1443,8 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
static
int
mc32_close
(
struct
net_device
*
dev
)
static
int
mc32_close
(
struct
net_device
*
dev
)
{
{
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
int
ioaddr
=
dev
->
base_addr
;
int
ioaddr
=
dev
->
base_addr
;
u8
regs
;
u8
regs
;
u16
one
=
1
;
u16
one
=
1
;
...
@@ -1461,6 +1462,7 @@ static int mc32_close(struct net_device *dev)
...
@@ -1461,6 +1462,7 @@ static int mc32_close(struct net_device *dev)
mc32_halt_transceiver
(
dev
);
mc32_halt_transceiver
(
dev
);
/* Ensure we issue no more commands beyond this point */
/* Ensure we issue no more commands beyond this point */
down
(
&
lp
->
cmd_mutex
);
down
(
&
lp
->
cmd_mutex
);
/* Ok the card is now stopping */
/* Ok the card is now stopping */
...
@@ -1489,10 +1491,9 @@ static int mc32_close(struct net_device *dev)
...
@@ -1489,10 +1491,9 @@ static int mc32_close(struct net_device *dev)
static
struct
net_device_stats
*
mc32_get_stats
(
struct
net_device
*
dev
)
static
struct
net_device_stats
*
mc32_get_stats
(
struct
net_device
*
dev
)
{
{
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
;
struct
mc32_local
*
lp
=
(
struct
mc32_local
*
)
dev
->
priv
;
mc32_update_stats
(
dev
);
mc32_update_stats
(
dev
);
return
&
lp
->
net_stats
;
return
&
lp
->
net_stats
;
}
}
...
...
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