mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-02 20:59:30 +00:00
net/atm: remove the atmdev_ops {get, set}sockopt methods
All implementations of these two methods are dummies that always return -EINVAL. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
089377b7e8
commit
a06d30ae7a
@ -2027,21 +2027,6 @@ static int eni_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
|
||||
return dev->phy->ioctl(dev,cmd,arg);
|
||||
}
|
||||
|
||||
|
||||
static int eni_getsockopt(struct atm_vcc *vcc,int level,int optname,
|
||||
void __user *optval,int optlen)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
static int eni_setsockopt(struct atm_vcc *vcc,int level,int optname,
|
||||
void __user *optval,unsigned int optlen)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
static int eni_send(struct atm_vcc *vcc,struct sk_buff *skb)
|
||||
{
|
||||
enum enq_res res;
|
||||
@ -2215,8 +2200,6 @@ static const struct atmdev_ops ops = {
|
||||
.open = eni_open,
|
||||
.close = eni_close,
|
||||
.ioctl = eni_ioctl,
|
||||
.getsockopt = eni_getsockopt,
|
||||
.setsockopt = eni_setsockopt,
|
||||
.send = eni_send,
|
||||
.phy_put = eni_phy_put,
|
||||
.phy_get = eni_phy_get,
|
||||
|
@ -1277,8 +1277,6 @@ static const struct atmdev_ops ops = {
|
||||
.send = fs_send,
|
||||
.owner = THIS_MODULE,
|
||||
/* ioctl: fs_ioctl, */
|
||||
/* getsockopt: fs_getsockopt, */
|
||||
/* setsockopt: fs_setsockopt, */
|
||||
/* change_qos: fs_change_qos, */
|
||||
|
||||
/* For now implement these internally here... */
|
||||
|
@ -1710,31 +1710,6 @@ fore200e_getstats(struct fore200e* fore200e)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
fore200e_getsockopt(struct atm_vcc* vcc, int level, int optname, void __user *optval, int optlen)
|
||||
{
|
||||
/* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */
|
||||
|
||||
DPRINTK(2, "getsockopt %d.%d.%d, level = %d, optname = 0x%x, optval = 0x%p, optlen = %d\n",
|
||||
vcc->itf, vcc->vpi, vcc->vci, level, optname, optval, optlen);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
fore200e_setsockopt(struct atm_vcc* vcc, int level, int optname, void __user *optval, unsigned int optlen)
|
||||
{
|
||||
/* struct fore200e* fore200e = FORE200E_DEV(vcc->dev); */
|
||||
|
||||
DPRINTK(2, "setsockopt %d.%d.%d, level = %d, optname = 0x%x, optval = 0x%p, optlen = %d\n",
|
||||
vcc->itf, vcc->vpi, vcc->vci, level, optname, optval, optlen);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
#if 0 /* currently unused */
|
||||
static int
|
||||
fore200e_get_oc3(struct fore200e* fore200e, struct oc3_regs* regs)
|
||||
@ -3026,8 +3001,6 @@ static const struct atmdev_ops fore200e_ops = {
|
||||
.open = fore200e_open,
|
||||
.close = fore200e_close,
|
||||
.ioctl = fore200e_ioctl,
|
||||
.getsockopt = fore200e_getsockopt,
|
||||
.setsockopt = fore200e_setsockopt,
|
||||
.send = fore200e_send,
|
||||
.change_qos = fore200e_change_qos,
|
||||
.proc_read = fore200e_proc_read,
|
||||
|
@ -2527,46 +2527,6 @@ static void hrz_close (struct atm_vcc * atm_vcc) {
|
||||
clear_bit(ATM_VF_ADDR,&atm_vcc->flags);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int hrz_getsockopt (struct atm_vcc * atm_vcc, int level, int optname,
|
||||
void *optval, int optlen) {
|
||||
hrz_dev * dev = HRZ_DEV(atm_vcc->dev);
|
||||
PRINTD (DBG_FLOW|DBG_VCC, "hrz_getsockopt");
|
||||
switch (level) {
|
||||
case SOL_SOCKET:
|
||||
switch (optname) {
|
||||
// case SO_BCTXOPT:
|
||||
// break;
|
||||
// case SO_BCRXOPT:
|
||||
// break;
|
||||
default:
|
||||
return -ENOPROTOOPT;
|
||||
};
|
||||
break;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int hrz_setsockopt (struct atm_vcc * atm_vcc, int level, int optname,
|
||||
void *optval, unsigned int optlen) {
|
||||
hrz_dev * dev = HRZ_DEV(atm_vcc->dev);
|
||||
PRINTD (DBG_FLOW|DBG_VCC, "hrz_setsockopt");
|
||||
switch (level) {
|
||||
case SOL_SOCKET:
|
||||
switch (optname) {
|
||||
// case SO_BCTXOPT:
|
||||
// break;
|
||||
// case SO_BCRXOPT:
|
||||
// break;
|
||||
default:
|
||||
return -ENOPROTOOPT;
|
||||
};
|
||||
break;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static int hrz_ioctl (struct atm_dev * atm_dev, unsigned int cmd, void *arg) {
|
||||
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)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ia_getsockopt(struct atm_vcc *vcc, int level, int optname,
|
||||
void __user *optval, int optlen)
|
||||
{
|
||||
IF_EVENT(printk(">ia_getsockopt\n");)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int ia_setsockopt(struct atm_vcc *vcc, int level, int optname,
|
||||
void __user *optval, unsigned int optlen)
|
||||
{
|
||||
IF_EVENT(printk(">ia_setsockopt\n");)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) {
|
||||
IADEV *iadev;
|
||||
struct dle *wr_ptr;
|
||||
@ -3164,8 +3150,6 @@ static const struct atmdev_ops ops = {
|
||||
.open = ia_open,
|
||||
.close = ia_close,
|
||||
.ioctl = ia_ioctl,
|
||||
.getsockopt = ia_getsockopt,
|
||||
.setsockopt = ia_setsockopt,
|
||||
.send = ia_send,
|
||||
.phy_put = ia_phy_put,
|
||||
.phy_get = ia_phy_get,
|
||||
|
@ -2537,8 +2537,6 @@ static const struct atmdev_ops ops = {
|
||||
.dev_close = lanai_dev_close,
|
||||
.open = lanai_open,
|
||||
.close = lanai_close,
|
||||
.getsockopt = NULL,
|
||||
.setsockopt = NULL,
|
||||
.send = lanai_send,
|
||||
.phy_put = NULL,
|
||||
.phy_get = NULL,
|
||||
|
@ -1179,8 +1179,6 @@ static const struct atmdev_ops fpga_ops = {
|
||||
.open = popen,
|
||||
.close = pclose,
|
||||
.ioctl = NULL,
|
||||
.getsockopt = NULL,
|
||||
.setsockopt = NULL,
|
||||
.send = psend,
|
||||
.send_oam = NULL,
|
||||
.phy_put = NULL,
|
||||
|
@ -1515,20 +1515,6 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int zatm_getsockopt(struct atm_vcc *vcc,int level,int optname,
|
||||
void __user *optval,int optlen)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
static int zatm_setsockopt(struct atm_vcc *vcc,int level,int optname,
|
||||
void __user *optval,unsigned int optlen)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int zatm_send(struct atm_vcc *vcc,struct sk_buff *skb)
|
||||
{
|
||||
int error;
|
||||
@ -1582,8 +1568,6 @@ static const struct atmdev_ops ops = {
|
||||
.open = zatm_open,
|
||||
.close = zatm_close,
|
||||
.ioctl = zatm_ioctl,
|
||||
.getsockopt = zatm_getsockopt,
|
||||
.setsockopt = zatm_setsockopt,
|
||||
.send = zatm_send,
|
||||
.phy_put = zatm_phy_put,
|
||||
.phy_get = zatm_phy_get,
|
||||
|
@ -176,11 +176,6 @@ struct atm_dev {
|
||||
#define ATM_OF_IMMED 1 /* Attempt immediate delivery */
|
||||
#define ATM_OF_INRATE 2 /* Attempt in-rate delivery */
|
||||
|
||||
|
||||
/*
|
||||
* ioctl, getsockopt, and setsockopt are optional and can be set to NULL.
|
||||
*/
|
||||
|
||||
struct atmdev_ops { /* only send is required */
|
||||
void (*dev_close)(struct atm_dev *dev);
|
||||
int (*open)(struct atm_vcc *vcc);
|
||||
@ -190,10 +185,6 @@ struct atmdev_ops { /* only send is required */
|
||||
int (*compat_ioctl)(struct atm_dev *dev,unsigned int cmd,
|
||||
void __user *arg);
|
||||
#endif
|
||||
int (*getsockopt)(struct atm_vcc *vcc,int level,int optname,
|
||||
void __user *optval,int optlen);
|
||||
int (*setsockopt)(struct atm_vcc *vcc,int level,int optname,
|
||||
void __user *optval,unsigned int optlen);
|
||||
int (*send)(struct atm_vcc *vcc,struct sk_buff *skb);
|
||||
int (*send_oam)(struct atm_vcc *vcc,void *cell,int flags);
|
||||
void (*phy_put)(struct atm_dev *dev,unsigned char value,
|
||||
|
@ -782,13 +782,8 @@ int vcc_setsockopt(struct socket *sock, int level, int optname,
|
||||
vcc->atm_options &= ~ATM_ATMOPT_CLP;
|
||||
return 0;
|
||||
default:
|
||||
if (level == SOL_SOCKET)
|
||||
return -EINVAL;
|
||||
break;
|
||||
}
|
||||
if (!vcc->dev || !vcc->dev->ops->setsockopt)
|
||||
return -EINVAL;
|
||||
return vcc->dev->ops->setsockopt(vcc, level, optname, optval, optlen);
|
||||
}
|
||||
}
|
||||
|
||||
int vcc_getsockopt(struct socket *sock, int level, int optname,
|
||||
@ -826,13 +821,8 @@ int vcc_getsockopt(struct socket *sock, int level, int optname,
|
||||
return copy_to_user(optval, &pvc, sizeof(pvc)) ? -EFAULT : 0;
|
||||
}
|
||||
default:
|
||||
if (level == SOL_SOCKET)
|
||||
return -EINVAL;
|
||||
break;
|
||||
}
|
||||
if (!vcc->dev || !vcc->dev->ops->getsockopt)
|
||||
return -EINVAL;
|
||||
return vcc->dev->ops->getsockopt(vcc, level, optname, optval, len);
|
||||
}
|
||||
}
|
||||
|
||||
int register_atmdevice_notifier(struct notifier_block *nb)
|
||||
|
Loading…
Reference in New Issue
Block a user