All implementations of these two methods are dummies that always return -EINVAL.
Unified · Split
| @@ -2027,21 +2027,6 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg) · 2026 unmodified lines | ||
| 2027 | 2027 | return dev->phy->ioctl(dev,cmd,arg); |
| 2028 | 2028 | } |
| 2029 | 2029 | |
| 2030 | − | |
| 2031 | −static int eni_getsockopt(struct atm_vcc *vcc,int level,int optname, | |
| 2032 | − void __user *optval,int optlen) | |
| 2033 | −{ | |
| 2034 | − return -EINVAL; | |
| 2035 | −} | |
| 2036 | − | |
| 2037 | − | |
| 2038 | −static int eni_setsockopt(struct atm_vcc *vcc,int level,int optname, | |
| 2039 | − void __user *optval,unsigned int optlen) | |
| 2040 | −{ | |
| 2041 | − return -EINVAL; | |
| 2042 | −} | |
| 2043 | − | |
| 2044 | − | |
| 2045 | 2030 | static int eni_send(struct atm_vcc *vcc,struct sk_buff *skb) |
| 2046 | 2031 | { |
| 2047 | 2032 | enum enq_res res; |
| @@ -2215,8 +2200,6 @@ static const struct atmdev_ops ops = { · 167 unmodified lines | ||
| 2215 | 2200 | .open = eni_open, |
| 2216 | 2201 | .close = eni_close, |
| 2217 | 2202 | .ioctl = eni_ioctl, |
| 2218 | − .getsockopt = eni_getsockopt, | |
| 2219 | − .setsockopt = eni_setsockopt, | |
| 2220 | 2203 | .send = eni_send, |
| 2221 | 2204 | .phy_put = eni_phy_put, |
| 2222 | 2205 | .phy_get = eni_phy_get, |
| @@ -1277,8 +1277,6 @@ static const struct atmdev_ops ops = { · 1276 unmodified lines | ||
| 1277 | 1277 | .send = fs_send, |
| 1278 | 1278 | .owner = THIS_MODULE, |
| 1279 | 1279 | /* ioctl: fs_ioctl, */ |
| 1280 | − /* getsockopt: fs_getsockopt, */ | |
| 1281 | − /* setsockopt: fs_setsockopt, */ | |
| 1282 | 1280 | /* change_qos: fs_change_qos, */ |
| 1283 | 1281 | |
| 1284 | 1282 | /* For now implement these internally here... */ |
| @@ -1710,31 +1710,6 @@ fore200e_getstats(struct fore200e* fore200e) · 1709 unmodified lines | ||
| 1710 | 1710 | return 0; |
| 1711 | 1711 | } |
| 1712 | 1712 | |
| 1713 | − | |
| 1714 | −static int | |
| 1715 | −fore200e_getsockopt(struct atm_vcc* vcc, int level, int optname, void __user *optval, int optlen) | |
| 1716 | −{ | |
| 1717 | − /* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */ | |
| 1718 | − | |
| 1719 | − DPRINTK(2, "getsockopt %d.%d.%d, level = %d, optname = 0x%x, optval = 0x%p, optlen = %d\n", | |
| 1720 | − vcc->itf, vcc->vpi, vcc->vci, level, optname, optval, optlen); | |
| 1721 | − | |
| 1722 | − return -EINVAL; | |
| 1723 | −} | |
| 1724 | − | |
| 1725 | − | |
| 1726 | −static int | |
| 1727 | −fore200e_setsockopt(struct atm_vcc* vcc, int level, int optname, void __user *optval, unsigned int optlen) | |
| 1728 | −{ | |
| 1729 | − /* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */ | |
| 1730 | − | |
| 1731 | − DPRINTK(2, "setsockopt %d.%d.%d, level = %d, optname = 0x%x, optval = 0x%p, optlen = %d\n", | |
| 1732 | − vcc->itf, vcc->vpi, vcc->vci, level, optname, optval, optlen); | |
| 1733 | − | |
| 1734 | − return -EINVAL; | |
| 1735 | −} | |
| 1736 | − | |
| 1737 | − | |
| 1738 | 1713 | #if 0 /* currently unused */ |
| 1739 | 1714 | static int |
| 1740 | 1715 | fore200e_get_oc3(struct fore200e* fore200e, struct oc3_regs* regs) |
| @@ -3026,8 +3001,6 @@ static const struct atmdev_ops fore200e_ops = { · 1285 unmodified lines | ||
| 3026 | 3001 | .open = fore200e_open, |
| 3027 | 3002 | .close = fore200e_close, |
| 3028 | 3003 | .ioctl = fore200e_ioctl, |
| 3029 | − .getsockopt = fore200e_getsockopt, | |
| 3030 | − .setsockopt = fore200e_setsockopt, | |
| 3031 | 3004 | .send = fore200e_send, |
| 3032 | 3005 | .change_qos = fore200e_change_qos, |
| 3033 | 3006 | .proc_read = fore200e_proc_read, |
| @@ -2527,46 +2527,6 @@ static void hrz_close (struct atm_vcc * atm_vcc) { · 2526 unmodified lines | ||
| 2527 | 2527 | clear_bit(ATM_VF_ADDR,&atm_vcc->flags); |
| 2528 | 2528 | } |
| 2529 | 2529 | |
| 2530 | −#if 0 | |
| 2531 | −static int hrz_getsockopt (struct atm_vcc * atm_vcc, int level, int optname, | |
| 2532 | − void *optval, int optlen) { | |
| 2533 | − hrz_dev * dev = HRZ_DEV(atm_vcc->dev); | |
| 2534 | − PRINTD (DBG_FLOW|DBG_VCC, "hrz_getsockopt"); | |
| 2535 | − switch (level) { | |
| 2536 | − case SOL_SOCKET: | |
| 2537 | − switch (optname) { | |
| 2538 | −// case SO_BCTXOPT: | |
| 2539 | −// break; | |
| 2540 | −// case SO_BCRXOPT: | |
| 2541 | −// break; | |
| 2542 | − default: | |
| 2543 | − return -ENOPROTOOPT; | |
| 2544 | − }; | |
| 2545 | − break; | |
| 2546 | − } | |
| 2547 | − return -EINVAL; | |
| 2548 | −} | |
| 2549 | − | |
| 2550 | −static int hrz_setsockopt (struct atm_vcc * atm_vcc, int level, int optname, | |
| 2551 | − void *optval, unsigned int optlen) { | |
| 2552 | − hrz_dev * dev = HRZ_DEV(atm_vcc->dev); | |
| 2553 | − PRINTD (DBG_FLOW|DBG_VCC, "hrz_setsockopt"); | |
| 2554 | − switch (level) { | |
| 2555 | − case SOL_SOCKET: | |
| 2556 | − switch (optname) { | |
| 2557 | −// case SO_BCTXOPT: | |
| 2558 | −// break; | |
| 2559 | −// case SO_BCRXOPT: | |
| 2560 | −// break; | |
| 2561 | − default: | |
| 2562 | − return -ENOPROTOOPT; | |
| 2563 | − }; | |
| 2564 | − break; | |
| 2565 | − } | |
| 2566 | − return -EINVAL; | |
| 2567 | −} | |
| 2568 | −#endif | |
| 2569 | − | |
| 2570 | 2530 | #if 0 |
| 2571 | 2531 | static int hrz_ioctl (struct atm_dev * atm_dev, unsigned int cmd, void *arg) { |
| 2572 | 2532 | hrz_dev * dev = HRZ_DEV(atm_dev); |
| @@ -2880,20 +2880,6 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg) · 2879 unmodified lines | ||
| 2880 | 2880 | return 0; |
| 2881 | 2881 | } |
| 2882 | 2882 | |
| 2883 | −static int ia_getsockopt(struct atm_vcc *vcc, int level, int optname, | |
| 2884 | − void __user *optval, int optlen) | |
| 2885 | −{ | |
| 2886 | − IF_EVENT(printk(">ia_getsockopt\n");) | |
| 2887 | − return -EINVAL; | |
| 2888 | −} | |
| 2889 | − | |
| 2890 | −static int ia_setsockopt(struct atm_vcc *vcc, int level, int optname, | |
| 2891 | − void __user *optval, unsigned int optlen) | |
| 2892 | −{ | |
| 2893 | − IF_EVENT(printk(">ia_setsockopt\n");) | |
| 2894 | − return -EINVAL; | |
| 2895 | −} | |
| 2896 | − | |
| 2897 | 2883 | static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) { |
| 2898 | 2884 | IADEV *iadev; |
| 2899 | 2885 | struct dle *wr_ptr; |
| @@ -3164,8 +3150,6 @@ static const struct atmdev_ops ops = { · 264 unmodified lines | ||
| 3164 | 3150 | .open = ia_open, |
| 3165 | 3151 | .close = ia_close, |
| 3166 | 3152 | .ioctl = ia_ioctl, |
| 3167 | − .getsockopt = ia_getsockopt, | |
| 3168 | − .setsockopt = ia_setsockopt, | |
| 3169 | 3153 | .send = ia_send, |
| 3170 | 3154 | .phy_put = ia_phy_put, |
| 3171 | 3155 | .phy_get = ia_phy_get, |
| @@ -2537,8 +2537,6 @@ static const struct atmdev_ops ops = { · 2536 unmodified lines | ||
| 2537 | 2537 | .dev_close = lanai_dev_close, |
| 2538 | 2538 | .open = lanai_open, |
| 2539 | 2539 | .close = lanai_close, |
| 2540 | − .getsockopt = NULL, | |
| 2541 | − .setsockopt = NULL, | |
| 2542 | 2540 | .send = lanai_send, |
| 2543 | 2541 | .phy_put = NULL, |
| 2544 | 2542 | .phy_get = NULL, |
| @@ -1179,8 +1179,6 @@ static const struct atmdev_ops fpga_ops = { · 1178 unmodified lines | ||
| 1179 | 1179 | .open = popen, |
| 1180 | 1180 | .close = pclose, |
| 1181 | 1181 | .ioctl = NULL, |
| 1182 | − .getsockopt = NULL, | |
| 1183 | − .setsockopt = NULL, | |
| 1184 | 1182 | .send = psend, |
| 1185 | 1183 | .send_oam = NULL, |
| 1186 | 1184 | .phy_put = NULL, |
| @@ -1515,20 +1515,6 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg) · 1514 unmodified lines | ||
| 1515 | 1515 | } |
| 1516 | 1516 | } |
| 1517 | 1517 | |
| 1518 | − | |
| 1519 | −static int zatm_getsockopt(struct atm_vcc *vcc,int level,int optname, | |
| 1520 | − void __user *optval,int optlen) | |
| 1521 | −{ | |
| 1522 | − return -EINVAL; | |
| 1523 | −} | |
| 1524 | − | |
| 1525 | − | |
| 1526 | −static int zatm_setsockopt(struct atm_vcc *vcc,int level,int optname, | |
| 1527 | − void __user *optval,unsigned int optlen) | |
| 1528 | −{ | |
| 1529 | − return -EINVAL; | |
| 1530 | −} | |
| 1531 | − | |
| 1532 | 1518 | static int zatm_send(struct atm_vcc *vcc,struct sk_buff *skb) |
| 1533 | 1519 | { |
| 1534 | 1520 | int error; |
| @@ -1582,8 +1568,6 @@ static const struct atmdev_ops ops = { · 47 unmodified lines | ||
| 1582 | 1568 | .open = zatm_open, |
| 1583 | 1569 | .close = zatm_close, |
| 1584 | 1570 | .ioctl = zatm_ioctl, |
| 1585 | − .getsockopt = zatm_getsockopt, | |
| 1586 | − .setsockopt = zatm_setsockopt, | |
| 1587 | 1571 | .send = zatm_send, |
| 1588 | 1572 | .phy_put = zatm_phy_put, |
| 1589 | 1573 | .phy_get = zatm_phy_get, |
| @@ -176,11 +176,6 @@ struct atm_dev { · 175 unmodified lines | ||
| 176 | 176 | #define ATM_OF_IMMED 1 /* Attempt immediate delivery */ |
| 177 | 177 | #define ATM_OF_INRATE 2 /* Attempt in-rate delivery */ |
| 178 | 178 | |
| 179 | − | |
| 180 | −/* | |
| 181 | − * ioctl, getsockopt, and setsockopt are optional and can be set to NULL. | |
| 182 | − */ | |
| 183 | − | |
| 184 | 179 | struct atmdev_ops { /* only send is required */ |
| 185 | 180 | void (*dev_close)(struct atm_dev *dev); |
| 186 | 181 | int (*open)(struct atm_vcc *vcc); |
| @@ -190,10 +185,6 @@ struct atmdev_ops { /* only send is required */ · 3 unmodified lines | ||
| 190 | 185 | int (*compat_ioctl)(struct atm_dev *dev,unsigned int cmd, |
| 191 | 186 | void __user *arg); |
| 192 | 187 | #endif |
| 193 | − int (*getsockopt)(struct atm_vcc *vcc,int level,int optname, | |
| 194 | − void __user *optval,int optlen); | |
| 195 | − int (*setsockopt)(struct atm_vcc *vcc,int level,int optname, | |
| 196 | − void __user *optval,unsigned int optlen); | |
| 197 | 188 | int (*send)(struct atm_vcc *vcc,struct sk_buff *skb); |
| 198 | 189 | int (*send_oam)(struct atm_vcc *vcc,void *cell,int flags); |
| 199 | 190 | void (*phy_put)(struct atm_dev *dev,unsigned char value, |
| @@ -782,13 +782,8 @@ int vcc_setsockopt(struct socket *sock, int level, int optname, · 781 unmodified lines | ||
| 782 | 782 | vcc->atm_options &= ~ATM_ATMOPT_CLP; |
| 783 | 783 | return 0; |
| 784 | 784 | default: |
| 785 | − if (level == SOL_SOCKET) | |
| 786 | − return -EINVAL; | |
| 787 | − break; | |
| 788 | − } | |
| 789 | − if (!vcc->dev || !vcc->dev->ops->setsockopt) | |
| 790 | 785 | return -EINVAL; |
| 791 | − return vcc->dev->ops->setsockopt(vcc, level, optname, optval, optlen); | |
| 786 | + } | |
| 792 | 787 | } |
| 793 | 788 | |
| 794 | 789 | int vcc_getsockopt(struct socket *sock, int level, int optname, |
| @@ -826,13 +821,8 @@ int vcc_getsockopt(struct socket *sock, int level, int optname, · 31 unmodified lines | ||
| 826 | 821 | return copy_to_user(optval, &pvc, sizeof(pvc)) ? -EFAULT : 0; |
| 827 | 822 | } |
| 828 | 823 | default: |
| 829 | − if (level == SOL_SOCKET) | |
| 830 | − return -EINVAL; | |
| 831 | − break; | |
| 832 | − } | |
| 833 | − if (!vcc->dev || !vcc->dev->ops->getsockopt) | |
| 834 | 824 | return -EINVAL; |
| 835 | − return vcc->dev->ops->getsockopt(vcc, level, optname, optval, len); | |
| 825 | + } | |
| 836 | 826 | } |
| 837 | 827 | |
| 838 | 828 | int register_atmdevice_notifier(struct notifier_block *nb) |