| @@ -673,28 +673,6 @@ __poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait) · 672 unmodified lines |
| 673 | return mask; | 673 | return mask; |
| 674 | } | 674 | } |
| 675 | | 675 | |
| 676 | static int atm_change_qos(struct atm_vcc *vcc, struct atm_qos *qos) | | |
| 677 | { | | |
| 678 | int error; | | |
| 679 | | | |
| 680 | /* | | |
| 681 | * Don't let the QoS change the already connected AAL type nor the | | |
| 682 | * traffic class. | | |
| 683 | */ | | |
| 684 | if (qos->aal != vcc->qos.aal || | | |
| 685 | qos->rxtp.traffic_class != vcc->qos.rxtp.traffic_class || | | |
| 686 | qos->txtp.traffic_class != vcc->qos.txtp.traffic_class) | | |
| 687 | return -EINVAL; | | |
| 688 | error = adjust_tp(&qos->txtp, qos->aal); | | |
| 689 | if (!error) | | |
| 690 | error = adjust_tp(&qos->rxtp, qos->aal); | | |
| 691 | if (error) | | |
| 692 | return error; | | |
| 693 | if (!vcc->dev->ops->change_qos) | | |
| 694 | return -EOPNOTSUPP; | | |
| 695 | return vcc->dev->ops->change_qos(vcc, qos, ATM_MF_SET); | | |
| 696 | } | | |
| 697 | | | |
| 698 | static int check_tp(const struct atm_trafprm *tp) | 676 | static int check_tp(const struct atm_trafprm *tp) |
| 699 | { | 677 | { |
| 700 | /* @@@ Should be merged with adjust_tp */ | 678 | /* @@@ Should be merged with adjust_tp */ |
| @@ -753,8 +731,9 @@ int vcc_setsockopt(struct socket *sock, int level, int optname, · 52 unmodified lines |
| 753 | error = check_qos(&qos); | 731 | error = check_qos(&qos); |
| 754 | if (error) | 732 | if (error) |
| 755 | return error; | 733 | return error; |
| | 734 | /* QoS cannot be renegotiated on an already connected VCC. */ |
| 756 | if (sock->state == SS_CONNECTED) | 735 | if (sock->state == SS_CONNECTED) |
| 757 | return atm_change_qos(vcc, &qos); | 736 | return -EOPNOTSUPP; |
| 758 | if (sock->state != SS_UNCONNECTED) | 737 | if (sock->state != SS_UNCONNECTED) |
| 759 | return -EBADFD; | 738 | return -EBADFD; |
| 760 | vcc->qos = qos; | 739 | vcc->qos = qos; |