dect
/
linux-2.6
Archived
13
0
Fork 0

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:
Stephen Hemminger 2009-08-31 19:50:51 +00:00 committed by David S. Miller
parent 6518bbb803
commit 424efe9caf
13 changed files with 27 additions and 29 deletions

View File

@ -1188,7 +1188,7 @@ static int fwnet_stop(struct net_device *net)
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_device *dev = netdev_priv(net);

View File

@ -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);

View File

@ -83,7 +83,7 @@ static void vcan_rx(struct sk_buff *skb, struct net_device *dev)
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;
int loop;

View File

@ -39,8 +39,6 @@
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)
{
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 = {
.ndo_start_xmit = dummy_xmit,
.ndo_validate_addr = eth_validate_addr,
@ -78,16 +86,6 @@ static void dummy_setup(struct net_device *dev)
dev->flags &= ~IFF_MULTICAST;
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[])
{
if (tb[IFLA_ADDRESS]) {

View File

@ -127,7 +127,7 @@
static int eql_open(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_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_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;
}
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);
slave_t *slave;

View File

@ -59,7 +59,7 @@ struct ifb_private {
static int numifbs = 2;
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_close(struct net_device *dev);
@ -160,11 +160,10 @@ static void ifb_setup(struct net_device *dev)
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 net_device_stats *stats = &dev->stats;
int ret = NETDEV_TX_OK;
u32 from = G_TC_FROM(skb->tc_verd);
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) {
dev_kfree_skb(skb);
stats->rx_dropped++;
return ret;
return NETDEV_TX_OK;
}
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);
}
return ret;
return NETDEV_TX_OK;
}
static int ifb_close(struct net_device *dev)

View File

@ -184,7 +184,8 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
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);
unsigned int len = skb->len;

View File

@ -951,7 +951,7 @@ out:
/*
* Network interface unit routines.
*/
static int
static netdev_tx_t
ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ppp *ppp = netdev_priv(dev);

View File

@ -474,7 +474,7 @@ out:
/* 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)
{
struct slip *sl = netdev_priv(dev);

View File

@ -358,7 +358,7 @@ static int tun_net_close(struct net_device *dev)
}
/* 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);

View File

@ -148,7 +148,7 @@ static struct ethtool_ops veth_ethtool_ops = {
* 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 veth_priv *priv, *rcv_priv;

View File

@ -519,7 +519,7 @@ static void xmit_tasklet(unsigned long data)
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);

View File

@ -183,7 +183,7 @@ static int gprs_close(struct net_device *dev)
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 sock *sk = gp->sk;