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
d5eb4faf
Commit
d5eb4faf
authored
May 06, 2003
by
Chas Williams
Committed by
David S. Miller
May 06, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ATM]: assorted atm patches
parent
b4ad7122
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
73 additions
and
78 deletions
+73
-78
drivers/atm/he.c
drivers/atm/he.c
+38
-45
drivers/atm/he.h
drivers/atm/he.h
+10
-2
drivers/atm/idt77252.c
drivers/atm/idt77252.c
+1
-1
drivers/atm/lanai.c
drivers/atm/lanai.c
+0
-1
drivers/atm/nicstar.c
drivers/atm/nicstar.c
+6
-1
drivers/atm/nicstar.h
drivers/atm/nicstar.h
+1
-0
include/linux/atmdev.h
include/linux/atmdev.h
+3
-12
net/atm/br2684.c
net/atm/br2684.c
+1
-0
net/atm/clip.c
net/atm/clip.c
+1
-0
net/atm/common.c
net/atm/common.c
+7
-13
net/atm/lec.c
net/atm/lec.c
+1
-0
net/atm/mpc.c
net/atm/mpc.c
+2
-1
net/atm/raw.c
net/atm/raw.c
+1
-1
net/atm/signaling.c
net/atm/signaling.c
+1
-1
No files found.
drivers/atm/he.c
View file @
d5eb4faf
This diff is collapsed.
Click to expand it.
drivers/atm/he.h
View file @
d5eb4faf
...
...
@@ -355,10 +355,18 @@ struct he_dev {
struct
he_dev
*
next
;
};
struct
he_iovec
{
u32
iov_base
;
u32
iov_len
;
};
#define HE_MAXIOV 20
struct
he_vcc
{
struct
iovec
iov_head
[
32
];
struct
iovec
*
iov_tail
;
struct
he_iovec
iov_head
[
HE_MAXIOV
];
struct
he_
iovec
*
iov_tail
;
int
pdu_len
;
int
rc_index
;
...
...
drivers/atm/idt77252.c
View file @
d5eb4faf
...
...
@@ -2023,7 +2023,7 @@ idt77252_send_oam(struct atm_vcc *vcc, void *cell, int flags)
atomic_inc
(
&
vcc
->
stats
->
tx_err
);
return
-
ENOMEM
;
}
atomic_add
(
skb
->
truesize
+
ATM_PDU_OVHD
,
&
vcc
->
sk
->
wmem_alloc
);
atomic_add
(
skb
->
truesize
,
&
vcc
->
sk
->
wmem_alloc
);
ATM_SKB
(
skb
)
->
iovcnt
=
0
;
memcpy
(
skb_put
(
skb
,
52
),
cell
,
52
);
...
...
drivers/atm/lanai.c
View file @
d5eb4faf
...
...
@@ -2846,7 +2846,6 @@ static const struct atmdev_ops ops = {
.
phy_get
=
NULL
,
.
feedback
=
NULL
,
.
change_qos
=
lanai_change_qos
,
.
free_rx_skb
=
NULL
,
.
proc_read
=
lanai_proc_read
};
...
...
drivers/atm/nicstar.c
View file @
d5eb4faf
...
...
@@ -882,9 +882,14 @@ static int __init ns_init_card(int i, struct pci_dev *pcidev)
return
error
;
}
if
(
ns_parse_mac
(
mac
[
i
],
card
->
atmdev
->
esi
))
if
(
ns_parse_mac
(
mac
[
i
],
card
->
atmdev
->
esi
))
{
nicstar_read_eprom
(
card
->
membase
,
NICSTAR_EPROM_MAC_ADDR_OFFSET
,
card
->
atmdev
->
esi
,
6
);
if
(
memcmp
(
card
->
atmdev
->
esi
,
"
\x00\x00\x00\x00\x00\x00
"
,
6
)
==
0
)
{
nicstar_read_eprom
(
card
->
membase
,
NICSTAR_EPROM_MAC_ADDR_OFFSET_ALT
,
card
->
atmdev
->
esi
,
6
);
}
}
printk
(
"nicstar%d: MAC address %02X:%02X:%02X:%02X:%02X:%02X
\n
"
,
i
,
card
->
atmdev
->
esi
[
0
],
card
->
atmdev
->
esi
[
1
],
card
->
atmdev
->
esi
[
2
],
...
...
drivers/atm/nicstar.h
View file @
d5eb4faf
...
...
@@ -96,6 +96,7 @@
/* ESI stuff ******************************************************************/
#define NICSTAR_EPROM_MAC_ADDR_OFFSET 0x6C
#define NICSTAR_EPROM_MAC_ADDR_OFFSET_ALT 0xF6
/* #defines *******************************************************************/
...
...
include/linux/atmdev.h
View file @
d5eb4faf
...
...
@@ -30,9 +30,6 @@
#define ATM_DS3_PCR (8000*12)
/* DS3: 12 cells in a 125 usec time slot */
#define ATM_PDU_OVHD 0
/* number of bytes to charge against buffer
quota per PDU */
#define atm_sk(__sk) ((struct atm_vcc *)(__sk)->protinfo)
#define ATM_SD(s) (atm_sk((s)->sk))
...
...
@@ -289,10 +286,6 @@ struct atm_vcc {
struct
atm_sap
sap
;
/* SAP */
void
(
*
push
)(
struct
atm_vcc
*
vcc
,
struct
sk_buff
*
skb
);
void
(
*
pop
)(
struct
atm_vcc
*
vcc
,
struct
sk_buff
*
skb
);
/* optional */
struct
sk_buff
*
(
*
alloc_tx
)(
struct
atm_vcc
*
vcc
,
unsigned
int
size
);
/* TX allocation routine - can be */
/* modified by protocol or by driver.*/
/* NOTE: this interface will change */
int
(
*
push_oam
)(
struct
atm_vcc
*
vcc
,
void
*
cell
);
int
(
*
send
)(
struct
atm_vcc
*
vcc
,
struct
sk_buff
*
skb
);
void
*
dev_data
;
/* per-device data */
...
...
@@ -378,8 +371,6 @@ struct atmdev_ops { /* only send is required */
void
(
*
feedback
)(
struct
atm_vcc
*
vcc
,
struct
sk_buff
*
skb
,
unsigned
long
start
,
unsigned
long
dest
,
int
len
);
int
(
*
change_qos
)(
struct
atm_vcc
*
vcc
,
struct
atm_qos
*
qos
,
int
flags
);
void
(
*
free_rx_skb
)(
struct
atm_vcc
*
vcc
,
struct
sk_buff
*
skb
);
/* @@@ temporary hack */
int
(
*
proc_read
)(
struct
atm_dev
*
dev
,
loff_t
*
pos
,
char
*
page
);
struct
module
*
owner
;
};
...
...
@@ -421,19 +412,19 @@ static __inline__ int atm_guess_pdu2truesize(int pdu_size)
static
__inline__
void
atm_force_charge
(
struct
atm_vcc
*
vcc
,
int
truesize
)
{
atomic_add
(
truesize
+
ATM_PDU_OVHD
,
&
vcc
->
sk
->
rmem_alloc
);
atomic_add
(
truesize
,
&
vcc
->
sk
->
rmem_alloc
);
}
static
__inline__
void
atm_return
(
struct
atm_vcc
*
vcc
,
int
truesize
)
{
atomic_sub
(
truesize
+
ATM_PDU_OVHD
,
&
vcc
->
sk
->
rmem_alloc
);
atomic_sub
(
truesize
,
&
vcc
->
sk
->
rmem_alloc
);
}
static
__inline__
int
atm_may_send
(
struct
atm_vcc
*
vcc
,
unsigned
int
size
)
{
return
size
+
atomic_read
(
&
vcc
->
sk
->
wmem_alloc
)
+
ATM_PDU_OVHD
<
vcc
->
sk
->
sndbuf
;
return
(
size
+
atomic_read
(
&
vcc
->
sk
->
wmem_alloc
))
<
vcc
->
sk
->
sndbuf
;
}
...
...
net/atm/br2684.c
View file @
d5eb4faf
...
...
@@ -481,6 +481,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
}
brdev
->
stats
.
rx_packets
++
;
brdev
->
stats
.
rx_bytes
+=
skb
->
len
;
memset
(
ATM_SKB
(
skb
),
0
,
sizeof
(
struct
atm_skb_data
));
netif_rx
(
skb
);
}
...
...
net/atm/clip.c
View file @
d5eb4faf
...
...
@@ -223,6 +223,7 @@ void clip_push(struct atm_vcc *vcc,struct sk_buff *skb)
clip_vcc
->
last_use
=
jiffies
;
PRIV
(
skb
->
dev
)
->
stats
.
rx_packets
++
;
PRIV
(
skb
->
dev
)
->
stats
.
rx_bytes
+=
skb
->
len
;
memset
(
ATM_SKB
(
skb
),
0
,
sizeof
(
struct
atm_skb_data
));
netif_rx
(
skb
);
}
...
...
net/atm/common.c
View file @
d5eb4faf
...
...
@@ -98,7 +98,7 @@ static struct sk_buff *alloc_tx(struct atm_vcc *vcc,unsigned int size)
}
while
(
!
(
skb
=
alloc_skb
(
size
,
GFP_KERNEL
)))
schedule
();
DPRINTK
(
"AlTx %d += %d
\n
"
,
atomic_read
(
&
vcc
->
sk
->
wmem_alloc
),
skb
->
truesize
);
atomic_add
(
skb
->
truesize
+
ATM_PDU_OVHD
,
&
vcc
->
sk
->
wmem_alloc
);
atomic_add
(
skb
->
truesize
,
&
vcc
->
sk
->
wmem_alloc
);
return
skb
;
}
...
...
@@ -114,7 +114,6 @@ int atm_create(struct socket *sock,int protocol,int family)
vcc
=
atm_sk
(
sk
);
memset
(
&
vcc
->
flags
,
0
,
sizeof
(
vcc
->
flags
));
vcc
->
dev
=
NULL
;
vcc
->
alloc_tx
=
alloc_tx
;
vcc
->
callback
=
NULL
;
memset
(
&
vcc
->
local
,
0
,
sizeof
(
struct
sockaddr_atmsvc
));
memset
(
&
vcc
->
remote
,
0
,
sizeof
(
struct
sockaddr_atmsvc
));
...
...
@@ -144,9 +143,7 @@ void atm_release_vcc_sk(struct sock *sk,int free_sk)
if
(
vcc
->
push
)
vcc
->
push
(
vcc
,
NULL
);
/* atmarpd has no push */
while
((
skb
=
skb_dequeue
(
&
vcc
->
sk
->
receive_queue
)))
{
atm_return
(
vcc
,
skb
->
truesize
);
if
(
vcc
->
dev
->
ops
->
free_rx_skb
)
vcc
->
dev
->
ops
->
free_rx_skb
(
vcc
,
skb
);
else
kfree_skb
(
skb
);
kfree_skb
(
skb
);
}
spin_lock
(
&
atm_dev_lock
);
fops_put
(
vcc
->
dev
->
ops
);
...
...
@@ -412,13 +409,11 @@ int atm_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
el
-=
(
iov
->
iov_len
>
el
)
?
el
:
iov
->
iov_len
;
iov
++
;
}
if
(
!
vcc
->
dev
->
ops
->
free_rx_skb
)
kfree_skb
(
skb
);
else
vcc
->
dev
->
ops
->
free_rx_skb
(
vcc
,
skb
);
kfree_skb
(
skb
);
return
error
?
error
:
eff_len
;
}
error
=
copy_to_user
(
buff
,
skb
->
data
,
eff_len
)
?
-
EFAULT
:
0
;
if
(
!
vcc
->
dev
->
ops
->
free_rx_skb
)
kfree_skb
(
skb
);
else
vcc
->
dev
->
ops
->
free_rx_skb
(
vcc
,
skb
);
kfree_skb
(
skb
);
return
error
?
error
:
eff_len
;
}
...
...
@@ -450,7 +445,7 @@ int atm_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
add_wait_queue
(
&
vcc
->
sleep
,
&
wait
);
set_current_state
(
TASK_INTERRUPTIBLE
);
error
=
0
;
while
(
!
(
skb
=
vcc
->
alloc_tx
(
vcc
,
eff
)))
{
while
(
!
(
skb
=
alloc_tx
(
vcc
,
eff
)))
{
if
(
m
->
msg_flags
&
MSG_DONTWAIT
)
{
error
=
-
EAGAIN
;
break
;
...
...
@@ -502,8 +497,7 @@ unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait)
mask
|=
POLLHUP
;
if
(
sock
->
state
!=
SS_CONNECTING
)
{
if
(
vcc
->
qos
.
txtp
.
traffic_class
!=
ATM_NONE
&&
vcc
->
qos
.
txtp
.
max_sdu
+
atomic_read
(
&
vcc
->
sk
->
wmem_alloc
)
+
ATM_PDU_OVHD
<=
vcc
->
sk
->
sndbuf
)
vcc
->
qos
.
txtp
.
max_sdu
+
atomic_read
(
&
vcc
->
sk
->
wmem_alloc
)
<=
vcc
->
sk
->
sndbuf
)
mask
|=
POLLOUT
|
POLLWRNORM
;
}
else
if
(
vcc
->
reply
!=
WAITING
)
{
...
...
@@ -570,7 +564,7 @@ int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg)
goto
done
;
}
ret_val
=
put_user
(
vcc
->
sk
->
sndbuf
-
atomic_read
(
&
vcc
->
sk
->
wmem_alloc
)
-
ATM_PDU_OVHD
,
atomic_read
(
&
vcc
->
sk
->
wmem_alloc
),
(
int
*
)
arg
)
?
-
EFAULT
:
0
;
goto
done
;
case
SIOCINQ
:
...
...
net/atm/lec.c
View file @
d5eb4faf
...
...
@@ -715,6 +715,7 @@ lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
skb
->
protocol
=
eth_type_trans
(
skb
,
dev
);
priv
->
stats
.
rx_packets
++
;
priv
->
stats
.
rx_bytes
+=
skb
->
len
;
memset
(
ATM_SKB
(
skb
),
0
,
sizeof
(
struct
atm_skb_data
));
netif_rx
(
skb
);
}
}
...
...
net/atm/mpc.c
View file @
d5eb4faf
...
...
@@ -732,6 +732,7 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
eg
->
packets_rcvd
++
;
mpc
->
eg_ops
->
put
(
eg
);
memset
(
ATM_SKB
(
skb
),
0
,
sizeof
(
struct
atm_skb_data
));
netif_rx
(
new_skb
);
return
;
...
...
@@ -863,7 +864,7 @@ static int msg_from_mpoad(struct atm_vcc *vcc, struct sk_buff *skb)
struct
mpoa_client
*
mpc
=
find_mpc_by_vcc
(
vcc
);
struct
k_message
*
mesg
=
(
struct
k_message
*
)
skb
->
data
;
atomic_sub
(
skb
->
truesize
+
ATM_PDU_OVHD
,
&
vcc
->
sk
->
wmem_alloc
);
atomic_sub
(
skb
->
truesize
,
&
vcc
->
sk
->
wmem_alloc
);
if
(
mpc
==
NULL
)
{
printk
(
"mpoa: msg_from_mpoad: no mpc found
\n
"
);
...
...
net/atm/raw.c
View file @
d5eb4faf
...
...
@@ -37,7 +37,7 @@ void atm_push_raw(struct atm_vcc *vcc,struct sk_buff *skb)
static
void
atm_pop_raw
(
struct
atm_vcc
*
vcc
,
struct
sk_buff
*
skb
)
{
DPRINTK
(
"APopR (%d) %d -= %d
\n
"
,
vcc
->
vci
,
vcc
->
sk
->
wmem_alloc
,
skb
->
truesize
);
atomic_sub
(
skb
->
truesize
+
ATM_PDU_OVHD
,
&
vcc
->
sk
->
wmem_alloc
);
atomic_sub
(
skb
->
truesize
,
&
vcc
->
sk
->
wmem_alloc
);
dev_kfree_skb_any
(
skb
);
wake_up
(
&
vcc
->
sleep
);
}
...
...
net/atm/signaling.c
View file @
d5eb4faf
...
...
@@ -98,7 +98,7 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
struct
atm_vcc
*
session_vcc
;
msg
=
(
struct
atmsvc_msg
*
)
skb
->
data
;
atomic_sub
(
skb
->
truesize
+
ATM_PDU_OVHD
,
&
vcc
->
sk
->
wmem_alloc
);
atomic_sub
(
skb
->
truesize
,
&
vcc
->
sk
->
wmem_alloc
);
DPRINTK
(
"sigd_send %d (0x%lx)
\n
"
,(
int
)
msg
->
type
,
(
unsigned
long
)
msg
->
vcc
);
vcc
=
*
(
struct
atm_vcc
**
)
&
msg
->
vcc
;
...
...
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