Commit 68ad0509 authored by Chas Williams's avatar Chas Williams Committed by Stephen Hemminger

[ATM]: atmdev api cleanup -- remove sg_send() and feedback() (mitch@sfgoth.com).

parent 635d0b51
...@@ -1556,33 +1556,6 @@ static int amb_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) { ...@@ -1556,33 +1556,6 @@ static int amb_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) {
return 0; return 0;
} }
/********** Scatter Gather Send Capability **********/
static int amb_sg_send (struct atm_vcc * atm_vcc,
unsigned long start,
unsigned long size) {
PRINTD (DBG_FLOW|DBG_VCC, "amb_sg_send: never");
return 0;
if (atm_vcc->qos.aal == ATM_AAL5) {
PRINTD (DBG_FLOW|DBG_VCC, "amb_sg_send: yes");
return 1;
} else {
PRINTD (DBG_FLOW|DBG_VCC, "amb_sg_send: no");
return 0;
}
PRINTD (DBG_FLOW|DBG_VCC, "amb_sg_send: always");
return 1;
}
/********** Send OAM **********/
// static int amb_send_oam (struct atm_vcc * atm_vcc, void * cell, int flags);
/********** Feedback to Driver **********/
// void amb_feedback (struct atm_vcc * atm_vcc, struct sk_buff * skb,
// unsigned long start, unsigned long dest, int len);
/********** Change QoS on a VC **********/ /********** Change QoS on a VC **********/
// int amb_change_qos (struct atm_vcc * atm_vcc, struct atm_qos * qos, int flags); // int amb_change_qos (struct atm_vcc * atm_vcc, struct atm_qos * qos, int flags);
...@@ -1693,7 +1666,6 @@ static const struct atmdev_ops amb_ops = { ...@@ -1693,7 +1666,6 @@ static const struct atmdev_ops amb_ops = {
.open = amb_open, .open = amb_open,
.close = amb_close, .close = amb_close,
.send = amb_send, .send = amb_send,
.sg_send = amb_sg_send,
.proc_read = amb_proc_read, .proc_read = amb_proc_read,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -2122,15 +2122,6 @@ backlogged++; ...@@ -2122,15 +2122,6 @@ backlogged++;
return 0; return 0;
} }
static int eni_sg_send(struct atm_vcc *vcc,unsigned long start,
unsigned long size)
{
return vcc->qos.aal == ATM_AAL5 && !((start | size) & 3);
/* don't tolerate misalignment */
}
static void eni_phy_put(struct atm_dev *dev,unsigned char value, static void eni_phy_put(struct atm_dev *dev,unsigned char value,
unsigned long addr) unsigned long addr)
{ {
...@@ -2269,7 +2260,6 @@ static const struct atmdev_ops ops = { ...@@ -2269,7 +2260,6 @@ static const struct atmdev_ops ops = {
.getsockopt = eni_getsockopt, .getsockopt = eni_getsockopt,
.setsockopt = eni_setsockopt, .setsockopt = eni_setsockopt,
.send = eni_send, .send = eni_send,
.sg_send = eni_sg_send,
.phy_put = eni_phy_put, .phy_put = eni_phy_put,
.phy_get = eni_phy_get, .phy_get = eni_phy_get,
.change_qos = eni_change_qos, .change_qos = eni_change_qos,
......
...@@ -1268,14 +1268,6 @@ static unsigned char fs_phy_get(struct atm_dev *dev,unsigned long addr) ...@@ -1268,14 +1268,6 @@ static unsigned char fs_phy_get(struct atm_dev *dev,unsigned long addr)
} }
static void fs_feedback(struct atm_vcc *vcc,struct sk_buff *skb,
unsigned long start,unsigned long dest,int len)
{
func_enter ();
func_exit ();
}
static int fs_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flags) static int fs_change_qos(struct atm_vcc *vcc,struct atm_qos *qos,int flags)
{ {
func_enter (); func_enter ();
...@@ -1293,11 +1285,9 @@ static const struct atmdev_ops ops = { ...@@ -1293,11 +1285,9 @@ static const struct atmdev_ops ops = {
#if 0 #if 0
.owner = THIS_MODULE, .owner = THIS_MODULE,
#endif #endif
/* fs_sg_send */
/* ioctl: fs_ioctl, */ /* ioctl: fs_ioctl, */
/* getsockopt: fs_getsockopt, */ /* getsockopt: fs_getsockopt, */
/* setsockopt: fs_setsockopt, */ /* setsockopt: fs_setsockopt, */
/* feedback: fs_feedback, */
/* change_qos: fs_change_qos, */ /* change_qos: fs_change_qos, */
/* For now implement these internally here... */ /* For now implement these internally here... */
......
...@@ -138,7 +138,6 @@ static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $"; ...@@ -138,7 +138,6 @@ static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
static int he_open(struct atm_vcc *vcc, short vpi, int vci); static int he_open(struct atm_vcc *vcc, short vpi, int vci);
static void he_close(struct atm_vcc *vcc); static void he_close(struct atm_vcc *vcc);
static int he_send(struct atm_vcc *vcc, struct sk_buff *skb); static int he_send(struct atm_vcc *vcc, struct sk_buff *skb);
static int he_sg_send(struct atm_vcc *vcc, unsigned long start, unsigned long size);
static int he_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg); static int he_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg);
static irqreturn_t he_irq_handler(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t he_irq_handler(int irq, void *dev_id, struct pt_regs *regs);
static void he_tasklet(unsigned long data); static void he_tasklet(unsigned long data);
...@@ -166,7 +165,6 @@ static struct atmdev_ops he_ops = ...@@ -166,7 +165,6 @@ static struct atmdev_ops he_ops =
.close = he_close, .close = he_close,
.ioctl = he_ioctl, .ioctl = he_ioctl,
.send = he_send, .send = he_send,
.sg_send = he_sg_send,
.phy_put = he_phy_put, .phy_put = he_phy_put,
.phy_get = he_phy_get, .phy_get = he_phy_get,
.proc_read = he_proc_read, .proc_read = he_proc_read,
...@@ -2726,16 +2724,6 @@ he_close(struct atm_vcc *vcc) ...@@ -2726,16 +2724,6 @@ he_close(struct atm_vcc *vcc)
clear_bit(ATM_VF_ADDR, &vcc->flags); clear_bit(ATM_VF_ADDR, &vcc->flags);
} }
static int
he_sg_send(struct atm_vcc *vcc, unsigned long start, unsigned long size)
{
#ifdef USE_SCATTERGATHER
return 1;
#else
return 0;
#endif
}
static int static int
he_send(struct atm_vcc *vcc, struct sk_buff *skb) he_send(struct atm_vcc *vcc, struct sk_buff *skb)
{ {
......
...@@ -2663,18 +2663,6 @@ static int hrz_setsockopt (struct atm_vcc * atm_vcc, int level, int optname, ...@@ -2663,18 +2663,6 @@ static int hrz_setsockopt (struct atm_vcc * atm_vcc, int level, int optname,
} }
#endif #endif
static int hrz_sg_send (struct atm_vcc * atm_vcc,
unsigned long start,
unsigned long size) {
if (atm_vcc->qos.aal == ATM_AAL5) {
PRINTD (DBG_FLOW|DBG_VCC, "hrz_sg_send: yes");
return 1;
} else {
PRINTD (DBG_FLOW|DBG_VCC, "hrz_sg_send: no");
return 0;
}
}
#if 0 #if 0
static int hrz_ioctl (struct atm_dev * atm_dev, unsigned int cmd, void *arg) { static int hrz_ioctl (struct atm_dev * atm_dev, unsigned int cmd, void *arg) {
hrz_dev * dev = HRZ_DEV(atm_dev); hrz_dev * dev = HRZ_DEV(atm_dev);
...@@ -2748,7 +2736,6 @@ static const struct atmdev_ops hrz_ops = { ...@@ -2748,7 +2736,6 @@ static const struct atmdev_ops hrz_ops = {
.open = hrz_open, .open = hrz_open,
.close = hrz_close, .close = hrz_close,
.send = hrz_send, .send = hrz_send,
.sg_send = hrz_sg_send,
.proc_read = hrz_proc_read, .proc_read = hrz_proc_read,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -1954,7 +1954,7 @@ idt77252_phy_get(struct atm_dev *dev, unsigned long addr) ...@@ -1954,7 +1954,7 @@ idt77252_phy_get(struct atm_dev *dev, unsigned long addr)
return read_utility(dev->dev_data, 0x100 + (addr & 0x1ff)); return read_utility(dev->dev_data, 0x100 + (addr & 0x1ff));
} }
static int static inline int
idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam) idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
{ {
struct atm_dev *dev = vcc->dev; struct atm_dev *dev = vcc->dev;
......
...@@ -3112,14 +3112,6 @@ static int ia_send(struct atm_vcc *vcc, struct sk_buff *skb) ...@@ -3112,14 +3112,6 @@ static int ia_send(struct atm_vcc *vcc, struct sk_buff *skb)
} }
static int ia_sg_send(struct atm_vcc *vcc, unsigned long start,
unsigned long size)
{
IF_EVENT(printk(">ia_sg_send\n");)
return 0;
}
static int ia_proc_read(struct atm_dev *dev,loff_t *pos,char *page) static int ia_proc_read(struct atm_dev *dev,loff_t *pos,char *page)
{ {
int left = *pos, n; int left = *pos, n;
...@@ -3179,7 +3171,6 @@ static const struct atmdev_ops ops = { ...@@ -3179,7 +3171,6 @@ static const struct atmdev_ops ops = {
.getsockopt = ia_getsockopt, .getsockopt = ia_getsockopt,
.setsockopt = ia_setsockopt, .setsockopt = ia_setsockopt,
.send = ia_send, .send = ia_send,
.sg_send = ia_sg_send,
.phy_put = ia_phy_put, .phy_put = ia_phy_put,
.phy_get = ia_phy_get, .phy_get = ia_phy_get,
.change_qos = ia_change_qos, .change_qos = ia_change_qos,
......
...@@ -2788,11 +2788,8 @@ static const struct atmdev_ops ops = { ...@@ -2788,11 +2788,8 @@ static const struct atmdev_ops ops = {
.getsockopt = NULL, .getsockopt = NULL,
.setsockopt = NULL, .setsockopt = NULL,
.send = lanai_send, .send = lanai_send,
.sg_send = NULL, /* no scatter-gather on card */
.send_oam = NULL, /* OAM support not in linux yet */
.phy_put = NULL, .phy_put = NULL,
.phy_get = NULL, .phy_get = NULL,
.feedback = NULL,
.change_qos = lanai_change_qos, .change_qos = lanai_change_qos,
.proc_read = lanai_proc_read .proc_read = lanai_proc_read
}; };
......
...@@ -307,37 +307,6 @@ static void unuse_pool(struct atm_dev *dev,int pool) ...@@ -307,37 +307,6 @@ static void unuse_pool(struct atm_dev *dev,int pool)
drain_free(dev,pool); drain_free(dev,pool);
} }
static void zatm_feedback(struct atm_vcc *vcc,struct sk_buff *skb,
unsigned long start,unsigned long dest,int len)
{
struct zatm_pool_info *pool;
unsigned long offset,flags;
struct zatm_dev *zatm_dev = ZATM_DEV(vcc->dev);
DPRINTK("start 0x%08lx dest 0x%08lx len %d\n",start,dest,len);
if (len < PAGE_SIZE) return;
pool = &zatm_dev->pool_info[ZATM_VCC(vcc)->pool];
offset = (dest-start) & (PAGE_SIZE-1);
spin_lock_irqsave(&zatm_dev->lock, flags);
if (!offset || pool->offset == offset) {
pool->next_cnt = 0;
spin_unlock_irqrestore(&zatm_dev->lock, flags);
return;
}
if (offset != pool->next_off) {
pool->next_off = offset;
pool->next_cnt = 0;
spin_unlock_irqrestore(&zatm_dev->lock, flags);
return;
}
if (++pool->next_cnt >= pool->next_thres) {
pool->offset = pool->next_off;
pool->next_cnt = 0;
}
spin_unlock_irqrestore(&zatm_dev->lock, flags);
}
/*----------------------------------- RX ------------------------------------*/ /*----------------------------------- RX ------------------------------------*/
...@@ -1548,17 +1517,6 @@ static int zatm_setsockopt(struct atm_vcc *vcc,int level,int optname, ...@@ -1548,17 +1517,6 @@ static int zatm_setsockopt(struct atm_vcc *vcc,int level,int optname,
return -EINVAL; return -EINVAL;
} }
#if 0
static int zatm_sg_send(struct atm_vcc *vcc,unsigned long start,
unsigned long size)
{
return vcc->aal == ATM_AAL5;
/* @@@ should check size and maybe alignment*/
}
#endif
static int zatm_send(struct atm_vcc *vcc,struct sk_buff *skb) static int zatm_send(struct atm_vcc *vcc,struct sk_buff *skb)
{ {
int error; int error;
...@@ -1615,10 +1573,8 @@ static const struct atmdev_ops ops = { ...@@ -1615,10 +1573,8 @@ static const struct atmdev_ops ops = {
.getsockopt = zatm_getsockopt, .getsockopt = zatm_getsockopt,
.setsockopt = zatm_setsockopt, .setsockopt = zatm_setsockopt,
.send = zatm_send, .send = zatm_send,
/*zatm_sg_send*/
.phy_put = zatm_phy_put, .phy_put = zatm_phy_put,
.phy_get = zatm_phy_get, .phy_get = zatm_phy_get,
.feedback = zatm_feedback,
.change_qos = zatm_change_qos, .change_qos = zatm_change_qos,
}; };
......
...@@ -335,15 +335,16 @@ struct atm_dev { ...@@ -335,15 +335,16 @@ struct atm_dev {
struct list_head dev_list; /* linkage */ struct list_head dev_list; /* linkage */
}; };
/* OF: send_Oam Flags */
/* #define ATM_OF_IMMED 1 /* Attempt immediate delivery */
* ioctl, getsockopt, setsockopt, and sg_send are optional and can be set to #define ATM_OF_INRATE 2 /* Attempt in-rate delivery */
* NULL. */
/* OF: send_Oam Flags */
#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 */ struct atmdev_ops { /* only send is required */
void (*dev_close)(struct atm_dev *dev); void (*dev_close)(struct atm_dev *dev);
...@@ -355,24 +356,15 @@ struct atmdev_ops { /* only send is required */ ...@@ -355,24 +356,15 @@ struct atmdev_ops { /* only send is required */
int (*setsockopt)(struct atm_vcc *vcc,int level,int optname, int (*setsockopt)(struct atm_vcc *vcc,int level,int optname,
void *optval,int optlen); void *optval,int optlen);
int (*send)(struct atm_vcc *vcc,struct sk_buff *skb); int (*send)(struct atm_vcc *vcc,struct sk_buff *skb);
int (*sg_send)(struct atm_vcc *vcc,unsigned long start,
unsigned long size);
#if 0 /* keep the current hack for now */
int (*send_iovec)(struct atm_vcc *vcc,struct iovec *iov,int size,
void (*discard)(struct atm_vcc *vcc,void *user),void *user);
#endif
int (*send_oam)(struct atm_vcc *vcc,void *cell,int flags); int (*send_oam)(struct atm_vcc *vcc,void *cell,int flags);
void (*phy_put)(struct atm_dev *dev,unsigned char value, void (*phy_put)(struct atm_dev *dev,unsigned char value,
unsigned long addr); unsigned long addr);
unsigned char (*phy_get)(struct atm_dev *dev,unsigned long addr); unsigned char (*phy_get)(struct atm_dev *dev,unsigned long addr);
void (*feedback)(struct atm_vcc *vcc,struct sk_buff *skb,
unsigned long start,unsigned long dest,int len);
int (*change_qos)(struct atm_vcc *vcc,struct atm_qos *qos,int flags); int (*change_qos)(struct atm_vcc *vcc,struct atm_qos *qos,int flags);
int (*proc_read)(struct atm_dev *dev,loff_t *pos,char *page); int (*proc_read)(struct atm_dev *dev,loff_t *pos,char *page);
struct module *owner; struct module *owner;
}; };
struct atmphy_ops { struct atmphy_ops {
int (*start)(struct atm_dev *dev); int (*start)(struct atm_dev *dev);
int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void *arg); int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void *arg);
......
...@@ -545,9 +545,6 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, ...@@ -545,9 +545,6 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
if (error) if (error)
return error; return error;
sock_recv_timestamp(msg, sk, skb); sock_recv_timestamp(msg, sk, skb);
if (vcc->dev->ops->feedback)
vcc->dev->ops->feedback(vcc, skb, (unsigned long) skb->data,
(unsigned long) msg->msg_iov->iov_base, copied);
DPRINTK("RcvM %d -= %d\n", atomic_read(&vcc->sk->rmem_alloc), skb->truesize); DPRINTK("RcvM %d -= %d\n", atomic_read(&vcc->sk->rmem_alloc), skb->truesize);
atm_return(vcc, skb->truesize); atm_return(vcc, skb->truesize);
skb_free_datagram(sk, skb); skb_free_datagram(sk, skb);
......
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