netdev: convert pseudo drivers to netdev_tx_t
These are all drivers that don't touch real hardware. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6518bbb803
commit
424efe9caf
13 changed files with 27 additions and 29 deletions
|
@ -1188,7 +1188,7 @@ static int fwnet_stop(struct net_device *net)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fwnet_tx(struct sk_buff *skb, struct net_device *net)
|
static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net)
|
||||||
{
|
{
|
||||||
struct fwnet_header hdr_buf;
|
struct fwnet_header hdr_buf;
|
||||||
struct fwnet_device *dev = netdev_priv(net);
|
struct fwnet_device *dev = netdev_priv(net);
|
||||||
|
|
|
@ -4450,7 +4450,7 @@ static void bond_set_xmit_hash_policy(struct bonding *bond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
const struct bonding *bond = netdev_priv(dev);
|
const struct bonding *bond = netdev_priv(dev);
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ static void vcan_rx(struct sk_buff *skb, struct net_device *dev)
|
||||||
netif_rx(skb);
|
netif_rx(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vcan_tx(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t vcan_tx(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct net_device_stats *stats = &dev->stats;
|
struct net_device_stats *stats = &dev->stats;
|
||||||
int loop;
|
int loop;
|
||||||
|
|
|
@ -39,8 +39,6 @@
|
||||||
|
|
||||||
static int numdummies = 1;
|
static int numdummies = 1;
|
||||||
|
|
||||||
static int dummy_xmit(struct sk_buff *skb, struct net_device *dev);
|
|
||||||
|
|
||||||
static int dummy_set_address(struct net_device *dev, void *p)
|
static int dummy_set_address(struct net_device *dev, void *p)
|
||||||
{
|
{
|
||||||
struct sockaddr *sa = p;
|
struct sockaddr *sa = p;
|
||||||
|
@ -57,6 +55,16 @@ static void set_multicast_list(struct net_device *dev)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
|
{
|
||||||
|
dev->stats.tx_packets++;
|
||||||
|
dev->stats.tx_bytes += skb->len;
|
||||||
|
|
||||||
|
dev_kfree_skb(skb);
|
||||||
|
return NETDEV_TX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct net_device_ops dummy_netdev_ops = {
|
static const struct net_device_ops dummy_netdev_ops = {
|
||||||
.ndo_start_xmit = dummy_xmit,
|
.ndo_start_xmit = dummy_xmit,
|
||||||
.ndo_validate_addr = eth_validate_addr,
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
@ -78,16 +86,6 @@ static void dummy_setup(struct net_device *dev)
|
||||||
dev->flags &= ~IFF_MULTICAST;
|
dev->flags &= ~IFF_MULTICAST;
|
||||||
random_ether_addr(dev->dev_addr);
|
random_ether_addr(dev->dev_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dummy_xmit(struct sk_buff *skb, struct net_device *dev)
|
|
||||||
{
|
|
||||||
dev->stats.tx_packets++;
|
|
||||||
dev->stats.tx_bytes += skb->len;
|
|
||||||
|
|
||||||
dev_kfree_skb(skb);
|
|
||||||
return NETDEV_TX_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dummy_validate(struct nlattr *tb[], struct nlattr *data[])
|
static int dummy_validate(struct nlattr *tb[], struct nlattr *data[])
|
||||||
{
|
{
|
||||||
if (tb[IFLA_ADDRESS]) {
|
if (tb[IFLA_ADDRESS]) {
|
||||||
|
|
|
@ -127,7 +127,7 @@
|
||||||
static int eql_open(struct net_device *dev);
|
static int eql_open(struct net_device *dev);
|
||||||
static int eql_close(struct net_device *dev);
|
static int eql_close(struct net_device *dev);
|
||||||
static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
|
static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
|
||||||
static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev);
|
static netdev_tx_t eql_slave_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||||
|
|
||||||
#define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE)
|
#define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE)
|
||||||
#define eql_is_master(dev) ((dev->flags & IFF_MASTER) == IFF_MASTER)
|
#define eql_is_master(dev) ((dev->flags & IFF_MASTER) == IFF_MASTER)
|
||||||
|
@ -325,7 +325,7 @@ static slave_t *__eql_schedule_slaves(slave_queue_t *queue)
|
||||||
return best_slave;
|
return best_slave;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
equalizer_t *eql = netdev_priv(dev);
|
equalizer_t *eql = netdev_priv(dev);
|
||||||
slave_t *slave;
|
slave_t *slave;
|
||||||
|
|
|
@ -59,7 +59,7 @@ struct ifb_private {
|
||||||
static int numifbs = 2;
|
static int numifbs = 2;
|
||||||
|
|
||||||
static void ri_tasklet(unsigned long dev);
|
static void ri_tasklet(unsigned long dev);
|
||||||
static int ifb_xmit(struct sk_buff *skb, struct net_device *dev);
|
static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||||
static int ifb_open(struct net_device *dev);
|
static int ifb_open(struct net_device *dev);
|
||||||
static int ifb_close(struct net_device *dev);
|
static int ifb_close(struct net_device *dev);
|
||||||
|
|
||||||
|
@ -160,11 +160,10 @@ static void ifb_setup(struct net_device *dev)
|
||||||
random_ether_addr(dev->dev_addr);
|
random_ether_addr(dev->dev_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ifb_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct ifb_private *dp = netdev_priv(dev);
|
struct ifb_private *dp = netdev_priv(dev);
|
||||||
struct net_device_stats *stats = &dev->stats;
|
struct net_device_stats *stats = &dev->stats;
|
||||||
int ret = NETDEV_TX_OK;
|
|
||||||
u32 from = G_TC_FROM(skb->tc_verd);
|
u32 from = G_TC_FROM(skb->tc_verd);
|
||||||
|
|
||||||
stats->rx_packets++;
|
stats->rx_packets++;
|
||||||
|
@ -173,7 +172,7 @@ static int ifb_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
if (!(from & (AT_INGRESS|AT_EGRESS)) || !skb->iif) {
|
if (!(from & (AT_INGRESS|AT_EGRESS)) || !skb->iif) {
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
stats->rx_dropped++;
|
stats->rx_dropped++;
|
||||||
return ret;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skb_queue_len(&dp->rq) >= dev->tx_queue_len) {
|
if (skb_queue_len(&dp->rq) >= dev->tx_queue_len) {
|
||||||
|
@ -187,7 +186,7 @@ static int ifb_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
tasklet_schedule(&dp->ifb_tasklet);
|
tasklet_schedule(&dp->ifb_tasklet);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ifb_close(struct net_device *dev)
|
static int ifb_close(struct net_device *dev)
|
||||||
|
|
|
@ -184,7 +184,8 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int macvlan_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
|
||||||
|
struct net_device *dev)
|
||||||
{
|
{
|
||||||
const struct macvlan_dev *vlan = netdev_priv(dev);
|
const struct macvlan_dev *vlan = netdev_priv(dev);
|
||||||
unsigned int len = skb->len;
|
unsigned int len = skb->len;
|
||||||
|
|
|
@ -951,7 +951,7 @@ static int __init ppp_init(void)
|
||||||
/*
|
/*
|
||||||
* Network interface unit routines.
|
* Network interface unit routines.
|
||||||
*/
|
*/
|
||||||
static int
|
static netdev_tx_t
|
||||||
ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct ppp *ppp = netdev_priv(dev);
|
struct ppp *ppp = netdev_priv(dev);
|
||||||
|
|
|
@ -474,7 +474,7 @@ static void sl_tx_timeout(struct net_device *dev)
|
||||||
|
|
||||||
|
|
||||||
/* Encapsulate an IP datagram and kick it into a TTY queue. */
|
/* Encapsulate an IP datagram and kick it into a TTY queue. */
|
||||||
static int
|
static netdev_tx_t
|
||||||
sl_xmit(struct sk_buff *skb, struct net_device *dev)
|
sl_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct slip *sl = netdev_priv(dev);
|
struct slip *sl = netdev_priv(dev);
|
||||||
|
|
|
@ -358,7 +358,7 @@ static int tun_net_close(struct net_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Net device start xmit */
|
/* Net device start xmit */
|
||||||
static int tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct tun_struct *tun = netdev_priv(dev);
|
struct tun_struct *tun = netdev_priv(dev);
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ static struct ethtool_ops veth_ethtool_ops = {
|
||||||
* xmit
|
* xmit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int veth_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct net_device *rcv = NULL;
|
struct net_device *rcv = NULL;
|
||||||
struct veth_priv *priv, *rcv_priv;
|
struct veth_priv *priv, *rcv_priv;
|
||||||
|
|
|
@ -519,7 +519,7 @@ static void xmit_tasklet(unsigned long data)
|
||||||
netif_tx_unlock_bh(vi->dev);
|
netif_tx_unlock_bh(vi->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int start_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct virtnet_info *vi = netdev_priv(dev);
|
struct virtnet_info *vi = netdev_priv(dev);
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ static int gprs_close(struct net_device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gprs_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t gprs_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct gprs_dev *gp = netdev_priv(dev);
|
struct gprs_dev *gp = netdev_priv(dev);
|
||||||
struct sock *sk = gp->sk;
|
struct sock *sk = gp->sk;
|
||||||
|
|
Loading…
Reference in a new issue