Commit de458ebd authored by Chas Williams's avatar Chas Williams Committed by Sridhar Samudrala

[ATM]: use sock timestamp

parent 7f754cf4
...@@ -297,7 +297,6 @@ struct atm_vcc { ...@@ -297,7 +297,6 @@ struct atm_vcc {
int (*send)(struct atm_vcc *vcc,struct sk_buff *skb); int (*send)(struct atm_vcc *vcc,struct sk_buff *skb);
void *dev_data; /* per-device data */ void *dev_data; /* per-device data */
void *proto_data; /* per-protocol data */ void *proto_data; /* per-protocol data */
struct timeval timestamp; /* AAL timestamps */
struct sk_buff_head recvq; /* receive queue */ struct sk_buff_head recvq; /* receive queue */
struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ struct k_atm_aal_stats *stats; /* pointer to AAL stats group */
wait_queue_head_t sleep; /* if socket is busy */ wait_queue_head_t sleep; /* if socket is busy */
......
...@@ -121,7 +121,6 @@ int atm_create(struct socket *sock,int protocol,int family) ...@@ -121,7 +121,6 @@ int atm_create(struct socket *sock,int protocol,int family)
vcc->push_oam = NULL; vcc->push_oam = NULL;
vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */ vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */
vcc->atm_options = vcc->aal_options = 0; vcc->atm_options = vcc->aal_options = 0;
vcc->timestamp.tv_sec = vcc->timestamp.tv_usec = 0;
init_waitqueue_head(&vcc->sleep); init_waitqueue_head(&vcc->sleep);
skb_queue_head_init(&vcc->recvq); skb_queue_head_init(&vcc->recvq);
skb_queue_head_init(&vcc->listenq); skb_queue_head_init(&vcc->listenq);
...@@ -379,7 +378,7 @@ int atm_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m, ...@@ -379,7 +378,7 @@ int atm_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
remove_wait_queue(&vcc->sleep,&wait); remove_wait_queue(&vcc->sleep,&wait);
if (error <= 0) return error; if (error <= 0) return error;
vcc->timestamp = skb->stamp; sock_recv_timestamp(m, vcc->sk, skb);
eff_len = skb->len > size ? size : skb->len; eff_len = skb->len > size ? size : skb->len;
if (skb->len > size) /* Not fit ? Report it... */ if (skb->len > size) /* Not fit ? Report it... */
m->msg_flags |= MSG_TRUNC; m->msg_flags |= MSG_TRUNC;
...@@ -611,13 +610,11 @@ int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg) ...@@ -611,13 +610,11 @@ int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg)
kfree(tmp_buf); kfree(tmp_buf);
goto done; goto done;
case SIOCGSTAMP: /* borrowed from IP */ case SIOCGSTAMP: /* borrowed from IP */
if (!vcc->timestamp.tv_sec) { if (!vcc->sk->stamp.tv_sec) {
ret_val = -ENOENT; ret_val = -ENOENT;
goto done; goto done;
} }
vcc->timestamp.tv_sec += vcc->timestamp.tv_usec/1000000; ret_val = copy_to_user((void *) arg, &vcc->sk->stamp,
vcc->timestamp.tv_usec %= 1000000;
ret_val = copy_to_user((void *) arg,&vcc->timestamp,
sizeof(struct timeval)) ? -EFAULT : 0; sizeof(struct timeval)) ? -EFAULT : 0;
goto done; goto done;
case ATM_SETSC: case ATM_SETSC:
......
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