Commit f6932f56 authored by Chas Williams's avatar Chas Williams Committed by David S. Miller

[ATM]: Remove recvmsg and rename atm_async_release_vcc.

parent e0380eac
...@@ -452,7 +452,7 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, ...@@ -452,7 +452,7 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci); int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci);
int atm_pcr_goal(struct atm_trafprm *tp); int atm_pcr_goal(struct atm_trafprm *tp);
void atm_async_release_vcc(struct atm_vcc *vcc,int reply); void vcc_release_async(struct atm_vcc *vcc, int reply);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -140,8 +140,8 @@ static void idle_timer_check(unsigned long dummy) ...@@ -140,8 +140,8 @@ static void idle_timer_check(unsigned long dummy)
DPRINTK("releasing vcc %p->%p of " DPRINTK("releasing vcc %p->%p of "
"entry %p\n",clip_vcc,clip_vcc->vcc, "entry %p\n",clip_vcc,clip_vcc->vcc,
entry); entry);
atm_async_release_vcc(clip_vcc->vcc, vcc_release_async(clip_vcc->vcc,
-ETIMEDOUT); -ETIMEDOUT);
} }
if (entry->vccs || if (entry->vccs ||
time_before(jiffies, entry->expires)) { time_before(jiffies, entry->expires)) {
......
This diff is collapsed.
...@@ -12,19 +12,18 @@ ...@@ -12,19 +12,18 @@
int atm_create(struct socket *sock,int protocol,int family); int atm_create(struct socket *sock,int protocol,int family);
int atm_release(struct socket *sock); int atm_release(struct socket *sock);
int atm_connect(struct socket *sock,int itf,short vpi,int vci); int vcc_connect(struct socket *sock, int itf, short vpi, int vci);
int atm_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m, int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
int total_len, int flags); int size, int flags);
int atm_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m, int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
int total_len); int total_len);
unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait); unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait);
int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
int atm_setsockopt(struct socket *sock,int level,int optname,char *optval, int vcc_setsockopt(struct socket *sock, int level, int optname, char *optval,
int optlen); int optlen);
int atm_getsockopt(struct socket *sock,int level,int optname,char *optval, int vcc_getsockopt(struct socket *sock, int level, int optname, char *optval,
int *optlen); int *optlen);
int atm_connect_vcc(struct atm_vcc *vcc,int itf,short vpi,int vci);
void atm_release_vcc_sk(struct sock *sk,int free_sk); void atm_release_vcc_sk(struct sock *sk,int free_sk);
void atm_shutdown_dev(struct atm_dev *dev); void atm_shutdown_dev(struct atm_dev *dev);
......
...@@ -1079,7 +1079,7 @@ lec_arp_clear_vccs(struct lec_arp_table *entry) ...@@ -1079,7 +1079,7 @@ lec_arp_clear_vccs(struct lec_arp_table *entry)
clear_bit(ATM_VF_READY,&entry->vcc->flags); clear_bit(ATM_VF_READY,&entry->vcc->flags);
entry->vcc->push(entry->vcc, NULL); entry->vcc->push(entry->vcc, NULL);
#endif #endif
atm_async_release_vcc(entry->vcc, -EPIPE); vcc_release_async(entry->vcc, -EPIPE);
entry->vcc = NULL; entry->vcc = NULL;
} }
if (entry->recv_vcc) { if (entry->recv_vcc) {
...@@ -1089,7 +1089,7 @@ lec_arp_clear_vccs(struct lec_arp_table *entry) ...@@ -1089,7 +1089,7 @@ lec_arp_clear_vccs(struct lec_arp_table *entry)
clear_bit(ATM_VF_READY,&entry->recv_vcc->flags); clear_bit(ATM_VF_READY,&entry->recv_vcc->flags);
entry->recv_vcc->push(entry->recv_vcc, NULL); entry->recv_vcc->push(entry->recv_vcc, NULL);
#endif #endif
atm_async_release_vcc(entry->recv_vcc, -EPIPE); vcc_release_async(entry->recv_vcc, -EPIPE);
entry->recv_vcc = NULL; entry->recv_vcc = NULL;
} }
} }
......
...@@ -212,7 +212,7 @@ static void in_cache_remove_entry(in_cache_entry *entry, ...@@ -212,7 +212,7 @@ static void in_cache_remove_entry(in_cache_entry *entry,
client->eg_ops->put(eg_entry); client->eg_ops->put(eg_entry);
return; return;
} }
atm_async_release_vcc(vcc, -EPIPE); vcc_release_async(vcc, -EPIPE);
} }
return; return;
...@@ -447,7 +447,7 @@ static void eg_cache_remove_entry(eg_cache_entry *entry, ...@@ -447,7 +447,7 @@ static void eg_cache_remove_entry(eg_cache_entry *entry,
client->in_ops->put(in_entry); client->in_ops->put(in_entry);
return; return;
} }
atm_async_release_vcc(vcc, -EPIPE); vcc_release_async(vcc, -EPIPE);
} }
return; return;
......
...@@ -31,20 +31,29 @@ static int pvc_shutdown(struct socket *sock,int how) ...@@ -31,20 +31,29 @@ static int pvc_shutdown(struct socket *sock,int how)
static int pvc_bind(struct socket *sock,struct sockaddr *sockaddr, static int pvc_bind(struct socket *sock,struct sockaddr *sockaddr,
int sockaddr_len) int sockaddr_len)
{ {
struct sock *sk = sock->sk;
struct sockaddr_atmpvc *addr; struct sockaddr_atmpvc *addr;
struct atm_vcc *vcc; struct atm_vcc *vcc;
int error;
if (sockaddr_len != sizeof(struct sockaddr_atmpvc)) return -EINVAL; if (sockaddr_len != sizeof(struct sockaddr_atmpvc)) return -EINVAL;
addr = (struct sockaddr_atmpvc *) sockaddr; addr = (struct sockaddr_atmpvc *) sockaddr;
if (addr->sap_family != AF_ATMPVC) return -EAFNOSUPPORT; if (addr->sap_family != AF_ATMPVC) return -EAFNOSUPPORT;
lock_sock(sk);
vcc = ATM_SD(sock); vcc = ATM_SD(sock);
if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD; if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) {
error = -EBADFD;
goto out;
}
if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) { if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) {
if (vcc->vpi != ATM_VPI_UNSPEC) addr->sap_addr.vpi = vcc->vpi; if (vcc->vpi != ATM_VPI_UNSPEC) addr->sap_addr.vpi = vcc->vpi;
if (vcc->vci != ATM_VCI_UNSPEC) addr->sap_addr.vci = vcc->vci; if (vcc->vci != ATM_VCI_UNSPEC) addr->sap_addr.vci = vcc->vci;
} }
return atm_connect(sock,addr->sap_addr.itf,addr->sap_addr.vpi, error = vcc_connect(sock, addr->sap_addr.itf, addr->sap_addr.vpi,
addr->sap_addr.vci); addr->sap_addr.vci);
out:
release_sock(sk);
return error;
} }
...@@ -54,6 +63,31 @@ static int pvc_connect(struct socket *sock,struct sockaddr *sockaddr, ...@@ -54,6 +63,31 @@ static int pvc_connect(struct socket *sock,struct sockaddr *sockaddr,
return pvc_bind(sock,sockaddr,sockaddr_len); return pvc_bind(sock,sockaddr,sockaddr_len);
} }
static int pvc_setsockopt(struct socket *sock, int level, int optname,
char *optval, int optlen)
{
struct sock *sk = sock->sk;
int error;
lock_sock(sk);
error = vcc_setsockopt(sock, level, optname, optval, optlen);
release_sock(sk);
return error;
}
static int pvc_getsockopt(struct socket *sock, int level, int optname,
char *optval, int *optlen)
{
struct sock *sk = sock->sk;
int error;
lock_sock(sk);
error = vcc_getsockopt(sock, level, optname, optval, optlen);
release_sock(sk);
return error;
}
static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr, static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr,
int *sockaddr_len,int peer) int *sockaddr_len,int peer)
...@@ -72,7 +106,7 @@ static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr, ...@@ -72,7 +106,7 @@ static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr,
} }
static struct proto_ops SOCKOPS_WRAPPED(pvc_proto_ops) = { static struct proto_ops pvc_proto_ops = {
.family = PF_ATMPVC, .family = PF_ATMPVC,
.release = atm_release, .release = atm_release,
...@@ -85,19 +119,15 @@ static struct proto_ops SOCKOPS_WRAPPED(pvc_proto_ops) = { ...@@ -85,19 +119,15 @@ static struct proto_ops SOCKOPS_WRAPPED(pvc_proto_ops) = {
.ioctl = vcc_ioctl, .ioctl = vcc_ioctl,
.listen = sock_no_listen, .listen = sock_no_listen,
.shutdown = pvc_shutdown, .shutdown = pvc_shutdown,
.setsockopt = atm_setsockopt, .setsockopt = pvc_setsockopt,
.getsockopt = atm_getsockopt, .getsockopt = pvc_getsockopt,
.sendmsg = atm_sendmsg, .sendmsg = vcc_sendmsg,
.recvmsg = atm_recvmsg, .recvmsg = vcc_recvmsg,
.mmap = sock_no_mmap, .mmap = sock_no_mmap,
.sendpage = sock_no_sendpage, .sendpage = sock_no_sendpage,
}; };
#include <linux/smp_lock.h>
SOCKOPS_WRAP(pvc_proto, PF_ATMPVC);
static int pvc_create(struct socket *sock,int protocol) static int pvc_create(struct socket *sock,int protocol)
{ {
sock->ops = &pvc_proto_ops; sock->ops = &pvc_proto_ops;
......
...@@ -124,14 +124,16 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) ...@@ -124,14 +124,16 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
clear_bit(ATM_VF_REGIS,&vcc->flags); clear_bit(ATM_VF_REGIS,&vcc->flags);
clear_bit(ATM_VF_READY,&vcc->flags); clear_bit(ATM_VF_READY,&vcc->flags);
vcc->reply = msg->reply; vcc->reply = msg->reply;
vcc->sk->sk_err = -msg->reply;
break; break;
case as_indicate: case as_indicate:
vcc = *(struct atm_vcc **) &msg->listen_vcc; vcc = *(struct atm_vcc **) &msg->listen_vcc;
DPRINTK("as_indicate!!!\n"); DPRINTK("as_indicate!!!\n");
lock_sock(vcc->sk);
if (vcc->sk->sk_ack_backlog == if (vcc->sk->sk_ack_backlog ==
vcc->sk->sk_max_ack_backlog) { vcc->sk->sk_max_ack_backlog) {
sigd_enq(0,as_reject,vcc,NULL,NULL); sigd_enq(0,as_reject,vcc,NULL,NULL);
return 0; goto as_indicate_complete;
} }
vcc->sk->sk_ack_backlog++; vcc->sk->sk_ack_backlog++;
skb_queue_tail(&vcc->sk->sk_receive_queue, skb); skb_queue_tail(&vcc->sk->sk_receive_queue, skb);
...@@ -140,11 +142,14 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) ...@@ -140,11 +142,14 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
&vcc->sleep); &vcc->sleep);
vcc->callback(vcc); vcc->callback(vcc);
} }
as_indicate_complete:
release_sock(vcc->sk);
return 0; return 0;
case as_close: case as_close:
set_bit(ATM_VF_RELEASED,&vcc->flags); set_bit(ATM_VF_RELEASED,&vcc->flags);
clear_bit(ATM_VF_READY,&vcc->flags); clear_bit(ATM_VF_READY,&vcc->flags);
vcc->reply = msg->reply; vcc->reply = msg->reply;
vcc->sk->sk_err = -msg->reply;
break; break;
case as_modify: case as_modify:
modify_qos(vcc,msg); modify_qos(vcc,msg);
...@@ -202,6 +207,7 @@ static void purge_vccs(struct atm_vcc *vcc) ...@@ -202,6 +207,7 @@ static void purge_vccs(struct atm_vcc *vcc)
!test_bit(ATM_VF_META,&vcc->flags)) { !test_bit(ATM_VF_META,&vcc->flags)) {
set_bit(ATM_VF_RELEASED,&vcc->flags); set_bit(ATM_VF_RELEASED,&vcc->flags);
vcc->reply = -EUNATCH; vcc->reply = -EUNATCH;
vcc->sk->sk_err = EUNATCH;
wake_up(&vcc->sleep); wake_up(&vcc->sleep);
} }
vcc = vcc->next; vcc = vcc->next;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment