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
e8588f9a
Commit
e8588f9a
authored
Jan 10, 2003
by
Alan Cox
Committed by
Linus Torvalds
Jan 10, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix padding on atp
parent
a8f20e65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
drivers/net/atp.c
drivers/net/atp.c
+15
-5
No files found.
drivers/net/atp.c
View file @
e8588f9a
...
@@ -200,7 +200,7 @@ static void get_node_ID(struct net_device *dev);
...
@@ -200,7 +200,7 @@ static void get_node_ID(struct net_device *dev);
static
unsigned
short
eeprom_op
(
long
ioaddr
,
unsigned
int
cmd
);
static
unsigned
short
eeprom_op
(
long
ioaddr
,
unsigned
int
cmd
);
static
int
net_open
(
struct
net_device
*
dev
);
static
int
net_open
(
struct
net_device
*
dev
);
static
void
hardware_init
(
struct
net_device
*
dev
);
static
void
hardware_init
(
struct
net_device
*
dev
);
static
void
write_packet
(
long
ioaddr
,
int
length
,
unsigned
char
*
packet
,
int
mode
);
static
void
write_packet
(
long
ioaddr
,
int
length
,
unsigned
char
*
packet
,
int
pad
,
int
mode
);
static
void
trigger_send
(
long
ioaddr
,
int
length
);
static
void
trigger_send
(
long
ioaddr
,
int
length
);
static
int
atp_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
static
int
atp_send_packet
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
static
void
atp_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
static
void
atp_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
...
@@ -499,15 +499,23 @@ static void trigger_send(long ioaddr, int length)
...
@@ -499,15 +499,23 @@ static void trigger_send(long ioaddr, int length)
write_reg
(
ioaddr
,
CMR1
,
CMR1_Xmit
);
write_reg
(
ioaddr
,
CMR1
,
CMR1_Xmit
);
}
}
static
void
write_packet
(
long
ioaddr
,
int
length
,
unsigned
char
*
packet
,
int
data_mode
)
static
void
write_packet
(
long
ioaddr
,
int
length
,
unsigned
char
*
packet
,
int
pad_len
,
int
data_mode
)
{
{
length
=
(
length
+
1
)
&
~
1
;
/* Round up to word length. */
if
(
length
&
1
)
{
length
++
;
pad_len
++
;
}
outb
(
EOC
+
MAR
,
ioaddr
+
PAR_DATA
);
outb
(
EOC
+
MAR
,
ioaddr
+
PAR_DATA
);
if
((
data_mode
&
1
)
==
0
)
{
if
((
data_mode
&
1
)
==
0
)
{
/* Write the packet out, starting with the write addr. */
/* Write the packet out, starting with the write addr. */
outb
(
WrAddr
+
MAR
,
ioaddr
+
PAR_DATA
);
outb
(
WrAddr
+
MAR
,
ioaddr
+
PAR_DATA
);
do
{
do
{
write_byte_mode0
(
ioaddr
,
*
packet
++
);
write_byte_mode0
(
ioaddr
,
*
packet
++
);
}
while
(
--
length
>
pad_len
)
;
do
{
write_byte_mode0
(
ioaddr
,
0
);
}
while
(
--
length
>
0
)
;
}
while
(
--
length
>
0
)
;
}
else
{
}
else
{
/* Write the packet out in slow mode. */
/* Write the packet out in slow mode. */
...
@@ -521,8 +529,10 @@ static void write_packet(long ioaddr, int length, unsigned char *packet, int dat
...
@@ -521,8 +529,10 @@ static void write_packet(long ioaddr, int length, unsigned char *packet, int dat
outbyte
>>=
4
;
outbyte
>>=
4
;
outb
(
outbyte
&
0x0f
,
ioaddr
+
PAR_DATA
);
outb
(
outbyte
&
0x0f
,
ioaddr
+
PAR_DATA
);
outb
(
Ctrl_HNibWrite
+
Ctrl_IRQEN
,
ioaddr
+
PAR_CONTROL
);
outb
(
Ctrl_HNibWrite
+
Ctrl_IRQEN
,
ioaddr
+
PAR_CONTROL
);
while
(
--
length
>
0
)
while
(
--
length
>
pad_len
)
write_byte_mode1
(
ioaddr
,
*
packet
++
);
write_byte_mode1
(
ioaddr
,
*
packet
++
);
while
(
--
length
>
0
)
write_byte_mode1
(
ioaddr
,
0
);
}
}
/* Terminate the Tx frame. End of write: ECB. */
/* Terminate the Tx frame. End of write: ECB. */
outb
(
0xff
,
ioaddr
+
PAR_DATA
);
outb
(
0xff
,
ioaddr
+
PAR_DATA
);
...
@@ -564,7 +574,7 @@ static int atp_send_packet(struct sk_buff *skb, struct net_device *dev)
...
@@ -564,7 +574,7 @@ static int atp_send_packet(struct sk_buff *skb, struct net_device *dev)
write_reg_high
(
ioaddr
,
IMR
,
0
);
write_reg_high
(
ioaddr
,
IMR
,
0
);
spin_unlock_irqrestore
(
&
lp
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
lp
->
lock
,
flags
);
write_packet
(
ioaddr
,
length
,
skb
->
data
,
dev
->
if_port
);
write_packet
(
ioaddr
,
length
,
skb
->
data
,
length
-
skb
->
len
,
dev
->
if_port
);
lp
->
pac_cnt_in_tx_buf
++
;
lp
->
pac_cnt_in_tx_buf
++
;
if
(
lp
->
tx_unit_busy
==
0
)
{
if
(
lp
->
tx_unit_busy
==
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