Skip to content

Commit

Permalink
netdev: convert pseudo-devices to netdev_tx_t
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Stephen Hemminger authored and davem330 committed Sep 1, 2009
1 parent dc1f8bf commit 6fef4c0
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 31 deletions.
14 changes: 4 additions & 10 deletions drivers/ieee1394/eth1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ static int ether1394_header_cache(const struct neighbour *neigh,
static void ether1394_header_cache_update(struct hh_cache *hh,
const struct net_device *dev,
const unsigned char *haddr);
static int ether1394_tx(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t ether1394_tx(struct sk_buff *skb,
struct net_device *dev);
static void ether1394_iso(struct hpsb_iso *iso);

static struct ethtool_ops ethtool_ops;
Expand Down Expand Up @@ -1555,7 +1556,8 @@ static void ether1394_complete_cb(void *__ptask)
}

/* Transmit a packet (called by kernel) */
static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t ether1394_tx(struct sk_buff *skb,
struct net_device *dev)
{
struct eth1394hdr hdr_buf;
struct eth1394_priv *priv = netdev_priv(dev);
Expand Down Expand Up @@ -1694,14 +1696,6 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
dev->stats.tx_errors++;
spin_unlock_irqrestore(&priv->lock, flags);

/*
* FIXME: According to a patch from 2003-02-26, "returning non-zero
* causes serious problems" here, allegedly. Before that patch,
* -ERRNO was returned which is not appropriate under Linux 2.6.
* Perhaps more needs to be done? Stop the queue in serious
* conditions and restart it elsewhere?
*/
/* return NETDEV_TX_BUSY; */
return NETDEV_TX_OK;
}

Expand Down
7 changes: 4 additions & 3 deletions net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
return rc;
}

static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
Expand Down Expand Up @@ -325,8 +326,8 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK;
}

static int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
struct net_device *dev)
static netdev_tx_t vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
u16 vlan_tci;
Expand Down
3 changes: 2 additions & 1 deletion net/bluetooth/bnep/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ static inline int bnep_net_proto_filter(struct sk_buff *skb, struct bnep_session
}
#endif

static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t bnep_net_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct bnep_session *s = netdev_priv(dev);
struct sock *sk = s->sock->sk;
Expand Down
2 changes: 1 addition & 1 deletion net/bridge/br_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "br_private.h"

/* net device transmit always called with no BH (preempt_disabled) */
int br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct net_bridge *br = netdev_priv(dev);
const unsigned char *dest = skb->data;
Expand Down
3 changes: 2 additions & 1 deletion net/bridge/br_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ static inline int br_is_root_bridge(const struct net_bridge *br)

/* br_device.c */
extern void br_dev_setup(struct net_device *dev);
extern int br_dev_xmit(struct sk_buff *skb, struct net_device *dev);
extern netdev_tx_t br_dev_xmit(struct sk_buff *skb,
struct net_device *dev);

/* br_fdb.c */
extern int br_fdb_init(void);
Expand Down
2 changes: 1 addition & 1 deletion net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -3381,7 +3381,7 @@ static void idle(struct pktgen_dev *pkt_dev)
static void pktgen_xmit(struct pktgen_dev *pkt_dev)
{
struct net_device *odev = pkt_dev->odev;
int (*xmit)(struct sk_buff *, struct net_device *)
netdev_tx_t (*xmit)(struct sk_buff *, struct net_device *)
= odev->netdev_ops->ndo_start_xmit;
struct netdev_queue *txq;
u16 queue_map;
Expand Down
6 changes: 3 additions & 3 deletions net/dsa/dsa_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ struct net_device *dsa_slave_create(struct dsa_switch *ds,
int port, char *name);

/* tag_dsa.c */
int dsa_xmit(struct sk_buff *skb, struct net_device *dev);
netdev_tx_t dsa_xmit(struct sk_buff *skb, struct net_device *dev);

/* tag_edsa.c */
int edsa_xmit(struct sk_buff *skb, struct net_device *dev);
netdev_tx_t edsa_xmit(struct sk_buff *skb, struct net_device *dev);

/* tag_trailer.c */
int trailer_xmit(struct sk_buff *skb, struct net_device *dev);
netdev_tx_t trailer_xmit(struct sk_buff *skb, struct net_device *dev);


#endif
2 changes: 1 addition & 1 deletion net/dsa/tag_dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#define DSA_HLEN 4

int dsa_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t dsa_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct dsa_slave_priv *p = netdev_priv(dev);
u8 *dsa_header;
Expand Down
2 changes: 1 addition & 1 deletion net/dsa/tag_edsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define DSA_HLEN 4
#define EDSA_HLEN 8

int edsa_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t edsa_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct dsa_slave_priv *p = netdev_priv(dev);
u8 *edsa_header;
Expand Down
2 changes: 1 addition & 1 deletion net/dsa/tag_trailer.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/netdevice.h>
#include "dsa_priv.h"

int trailer_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t trailer_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct dsa_slave_priv *p = netdev_priv(dev);
struct sk_buff *nskb;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ static int ipgre_rcv(struct sk_buff *skb)
return(0);
}

static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
struct net_device_stats *stats = &tunnel->dev->stats;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/ipip.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ static int ipip_rcv(struct sk_buff *skb)
* and that skb is filled properly by that function.
*/

static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
struct net_device_stats *stats = &tunnel->dev->stats;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/ipmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ struct net_device *ipmr_new_tunnel(struct net *net, struct vifctl *v)

#ifdef CONFIG_IP_PIMSM

static int reg_vif_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t reg_vif_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct net *net = dev_net(dev);

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/ip6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
}

static int
static netdev_tx_t
ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ip6_tnl *t = netdev_priv(dev);
Expand Down
3 changes: 2 additions & 1 deletion net/ipv6/ip6mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ static struct inet6_protocol pim6_protocol = {

/* Service routines creating virtual interfaces: PIMREG */

static int reg_vif_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t reg_vif_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct net *net = dev_net(dev);

Expand Down
3 changes: 2 additions & 1 deletion net/ipv6/sit.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ static inline __be32 try_6to4(struct in6_addr *v6dst)
* and that skb is filled properly by that function.
*/

static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
struct net_device_stats *stats = &tunnel->dev->stats;
Expand Down
4 changes: 2 additions & 2 deletions net/sched/sch_teql.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static inline int teql_resolve(struct sk_buff *skb,
return __teql_resolve(skb, skb_res, dev);
}

static int teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct teql_master *master = netdev_priv(dev);
struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
Expand Down Expand Up @@ -307,7 +307,7 @@ static int teql_master_xmit(struct sk_buff *skb, struct net_device *dev)

if (!netif_tx_queue_stopped(slave_txq) &&
!netif_tx_queue_frozen(slave_txq) &&
slave_ops->ndo_start_xmit(skb, slave) == 0) {
slave_ops->ndo_start_xmit(skb, slave) == NETDEV_TX_OK) {
txq_trans_update(slave_txq);
__netif_tx_unlock(slave_txq);
master->slaves = NEXT_SLAVE(q);
Expand Down

0 comments on commit 6fef4c0

Please sign in to comment.