Skip to content

Commit

Permalink
netdev: convert bulk of drivers to netdev_tx_t
Browse files Browse the repository at this point in the history
In a couple of cases collapse some extra code like:
   int retval = NETDEV_TX_OK;
   ...
   return retval;
into
   return NETDEV_TX_OK;

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Sep 1, 2009
1 parent d0cf9c0 commit 6135732
Show file tree
Hide file tree
Showing 102 changed files with 253 additions and 173 deletions.
3 changes: 2 additions & 1 deletion drivers/ieee802154/fakehard.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ static int ieee802154_fake_close(struct net_device *dev)
return 0;
}

static int ieee802154_fake_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t ieee802154_fake_xmit(struct sk_buff *skb,
struct net_device *dev)
{
skb->iif = dev->ifindex;
skb->dev = dev;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,8 @@ static void cp_tx (struct cp_private *cp)
netif_wake_queue(cp->dev);
}

static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
struct net_device *dev)
{
struct cp_private *cp = netdev_priv(dev);
unsigned entry;
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/8139too.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ static void mdio_write (struct net_device *dev, int phy_id, int location,
static void rtl8139_start_thread(struct rtl8139_private *tp);
static void rtl8139_tx_timeout (struct net_device *dev);
static void rtl8139_init_ring (struct net_device *dev);
static int rtl8139_start_xmit (struct sk_buff *skb,
struct net_device *dev);
static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
struct net_device *dev);
#ifdef CONFIG_NET_POLL_CONTROLLER
static void rtl8139_poll_controller(struct net_device *dev);
#endif
Expand Down Expand Up @@ -1687,7 +1687,8 @@ static void rtl8139_tx_timeout (struct net_device *dev)
}
}

static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
struct net_device *dev)
{
struct rtl8139_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->mmio_addr;
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/82596.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static char init_setup[] =
0x7f /* *multi IA */ };

static int i596_open(struct net_device *dev);
static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t i596_start_xmit(struct sk_buff *skb, struct net_device *dev);
static irqreturn_t i596_interrupt(int irq, void *dev_id);
static int i596_close(struct net_device *dev);
static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd);
Expand Down Expand Up @@ -1054,8 +1054,7 @@ static void i596_tx_timeout (struct net_device *dev)
netif_wake_queue (dev);
}


static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct i596_private *lp = dev->ml_priv;
struct tx_cmd *tx_cmd;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/8390.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int ei_close(struct net_device *dev)
}
EXPORT_SYMBOL(ei_close);

int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
return __ei_start_xmit(skb, dev);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/8390.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern int ei_open(struct net_device *dev);
extern int ei_close(struct net_device *dev);
extern irqreturn_t ei_interrupt(int irq, void *dev_id);
extern void ei_tx_timeout(struct net_device *dev);
extern int ei_start_xmit(struct sk_buff *skb, struct net_device *dev);
extern netdev_tx_t ei_start_xmit(struct sk_buff *skb, struct net_device *dev);
extern void ei_set_multicast_list(struct net_device *dev);
extern struct net_device_stats *ei_get_stats(struct net_device *dev);

Expand All @@ -58,7 +58,7 @@ extern int eip_open(struct net_device *dev);
extern int eip_close(struct net_device *dev);
extern irqreturn_t eip_interrupt(int irq, void *dev_id);
extern void eip_tx_timeout(struct net_device *dev);
extern int eip_start_xmit(struct sk_buff *skb, struct net_device *dev);
extern netdev_tx_t eip_start_xmit(struct sk_buff *skb, struct net_device *dev);
extern void eip_set_multicast_list(struct net_device *dev);
extern struct net_device_stats *eip_get_stats(struct net_device *dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/8390p.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int eip_close(struct net_device *dev)
}
EXPORT_SYMBOL(eip_close);

int eip_start_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t eip_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
return __ei_start_xmit(skb, dev);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/a2065.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@ static void lance_tx_timeout(struct net_device *dev)
netif_wake_queue(dev);
}

static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t lance_start_xmit (struct sk_buff *skb,
struct net_device *dev)
{
struct lance_private *lp = netdev_priv(dev);
volatile struct lance_regs *ll = lp->ll;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/acenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2464,7 +2464,8 @@ ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr,
}


static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t ace_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct ace_private *ap = netdev_priv(dev);
struct ace_regs __iomem *regs = ap->regs;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/acenic.h
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,8 @@ static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs);
static irqreturn_t ace_interrupt(int irq, void *dev_id);
static int ace_load_firmware(struct net_device *dev);
static int ace_open(struct net_device *dev);
static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t ace_start_xmit(struct sk_buff *skb,
struct net_device *dev);
static int ace_close(struct net_device *dev);
static void ace_tasklet(unsigned long dev);
static void ace_dump_trace(struct ace_private *ap);
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/amd8111e.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,8 @@ static int amd8111e_tx_queue_avail(struct amd8111e_priv* lp )
This function will queue the transmit packets to the descriptors and will trigger the send operation. It also initializes the transmit descriptors with buffer physical address, byte count, ownership to hardware etc.
*/

static int amd8111e_start_xmit(struct sk_buff *skb, struct net_device * dev)
static netdev_tx_t amd8111e_start_xmit(struct sk_buff *skb,
struct net_device * dev)
{
struct amd8111e_priv *lp = netdev_priv(dev);
int tx_index;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/arcnet/arcnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ static int arcnet_rebuild_header(struct sk_buff *skb)


/* Called by the kernel in order to transmit a packet. */
int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t arcnet_send_packet(struct sk_buff *skb,
struct net_device *dev)
{
struct arcnet_local *lp = netdev_priv(dev);
struct archdr *pkt;
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/ariadne.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ struct lancedata {

static int ariadne_open(struct net_device *dev);
static void ariadne_init_ring(struct net_device *dev);
static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t ariadne_start_xmit(struct sk_buff *skb,
struct net_device *dev);
static void ariadne_tx_timeout(struct net_device *dev);
static int ariadne_rx(struct net_device *dev);
static void ariadne_reset(struct net_device *dev);
Expand Down Expand Up @@ -589,7 +590,8 @@ static void ariadne_tx_timeout(struct net_device *dev)
}


static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t ariadne_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct ariadne_private *priv = netdev_priv(dev);
volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr;
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/at1700.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ struct net_local {
static int at1700_probe1(struct net_device *dev, int ioaddr);
static int read_eeprom(long ioaddr, int location);
static int net_open(struct net_device *dev);
static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t net_send_packet(struct sk_buff *skb,
struct net_device *dev);
static irqreturn_t net_interrupt(int irq, void *dev_id);
static void net_rx(struct net_device *dev);
static int net_close(struct net_device *dev);
Expand Down Expand Up @@ -595,7 +596,8 @@ static void net_tx_timeout (struct net_device *dev)
}


static int net_send_packet (struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t net_send_packet (struct sk_buff *skb,
struct net_device *dev)
{
struct net_local *lp = netdev_priv(dev);
int ioaddr = dev->base_addr;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/atl1c/atl1c_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,8 @@ static void atl1c_tx_queue(struct atl1c_adapter *adapter, struct sk_buff *skb,
AT_WRITE_REG(&adapter->hw, REG_MB_PRIO_PROD_IDX, prod_data);
}

static int atl1c_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb,
struct net_device *netdev)
{
struct atl1c_adapter *adapter = netdev_priv(netdev);
unsigned long flags;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/atl1e/atl1e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,8 @@ static void atl1e_tx_queue(struct atl1e_adapter *adapter, u16 count,
AT_WRITE_REG(&adapter->hw, REG_MB_TPD_PROD_IDX, tx_ring->next_to_use);
}

static int atl1e_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
static netdev_tx_t atl1e_xmit_frame(struct sk_buff *skb,
struct net_device *netdev)
{
struct atl1e_adapter *adapter = netdev_priv(netdev);
unsigned long flags;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/atlx/atl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2349,7 +2349,8 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count,
atomic_set(&tpd_ring->next_to_use, next_to_use);
}

static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
struct net_device *netdev)
{
struct atl1_adapter *adapter = netdev_priv(netdev);
struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/atlx/atl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,8 @@ static inline int TxdFreeBytes(struct atl2_adapter *adapter)
(int) (txd_read_ptr - adapter->txd_write_ptr - 1);
}

static int atl2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
static netdev_tx_t atl2_xmit_frame(struct sk_buff *skb,
struct net_device *netdev)
{
struct atl2_adapter *adapter = netdev_priv(netdev);
struct tx_pkt_header *txph;
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/atp.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ static int net_open(struct net_device *dev);
static void hardware_init(struct net_device *dev);
static void write_packet(long ioaddr, int length, unsigned char *packet, int pad, int mode);
static void trigger_send(long ioaddr, int length);
static int atp_send_packet(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t atp_send_packet(struct sk_buff *skb,
struct net_device *dev);
static irqreturn_t atp_interrupt(int irq, void *dev_id);
static void net_rx(struct net_device *dev);
static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode);
Expand Down Expand Up @@ -552,7 +553,8 @@ static void tx_timeout(struct net_device *dev)
dev->stats.tx_errors++;
}

static int atp_send_packet(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t atp_send_packet(struct sk_buff *skb,
struct net_device *dev)
{
struct net_local *lp = netdev_priv(dev);
long ioaddr = dev->base_addr;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/au1000_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ static int au1000_close(struct net_device *dev)
/*
* Au1000 transmit routine.
*/
static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev)
{
struct au1000_private *aup = netdev_priv(dev);
struct net_device_stats *ps = &dev->stats;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ static void b44_tx_timeout(struct net_device *dev)
netif_wake_queue(dev);
}

static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct b44 *bp = netdev_priv(dev);
int rc = NETDEV_TX_OK;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ static int make_tx_wrbs(struct be_adapter *adapter,
return copied;
}

static int be_xmit(struct sk_buff *skb, struct net_device *netdev)
static netdev_tx_t be_xmit(struct sk_buff *skb,
struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
struct be_tx_obj *tx_obj = &adapter->tx_obj;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6283,7 +6283,7 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp)
* bnx2_tx_int() runs without netif_tx_lock unless it needs to call
* netif_wake_queue().
*/
static int
static netdev_tx_t
bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct bnx2 *bp = netdev_priv(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10936,7 +10936,7 @@ static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb,
* bnx2x_tx_int() runs without netif_tx_lock unless it needs to call
* netif_wake_queue()
*/
static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct bnx2x *bp = netdev_priv(dev);
struct bnx2x_fastpath *fp, *fp_stat;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/can/sja1000/sja1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ static void chipset_init(struct net_device *dev)
* xx xx xx xx ff ll 00 11 22 33 44 55 66 77
* [ can-id ] [flags] [len] [can data (up to 8 bytes]
*/
static int sja1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t sja1000_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct sja1000_priv *priv = netdev_priv(dev);
struct net_device_stats *stats = &dev->stats;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/cassini.c
Original file line number Diff line number Diff line change
Expand Up @@ -2918,7 +2918,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
return 0;
}

static int cas_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t cas_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct cas *cp = netdev_priv(dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/chelsio/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ static inline int eth_hdr_len(const void *data)
/*
* Adds the CPL header to the sk_buff and passes it to t1_sge_tx.
*/
int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct adapter *adapter = dev->ml_priv;
struct sge *sge = adapter->sge;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/chelsio/sge.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void t1_sge_destroy(struct sge *);
irqreturn_t t1_interrupt(int irq, void *cookie);
int t1_poll(struct napi_struct *, int);

int t1_start_xmit(struct sk_buff *skb, struct net_device *dev);
netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev);
void t1_set_vlan_accel(struct adapter *adapter, int on_off);
void t1_sge_start(struct sge *);
void t1_sge_stop(struct sge *);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/cs89x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ struct net_local {

static int cs89x0_probe1(struct net_device *dev, int ioaddr, int modular);
static int net_open(struct net_device *dev);
static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev);
static irqreturn_t net_interrupt(int irq, void *dev_id);
static void set_multicast_list(struct net_device *dev);
static void net_timeout(struct net_device *dev);
Expand Down Expand Up @@ -1518,7 +1518,7 @@ static void net_timeout(struct net_device *dev)
netif_wake_queue(dev);
}

static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t net_send_packet(struct sk_buff *skb,struct net_device *dev)
{
struct net_local *lp = netdev_priv(dev);
unsigned long flags;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/cxgb3/adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void t3_stop_sge_timers(struct adapter *adap);
void t3_free_sge_resources(struct adapter *adap);
void t3_sge_err_intr_handler(struct adapter *adapter);
irq_handler_t t3_intr_handler(struct adapter *adap, int polling);
int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev);
netdev_tx_t t3_eth_xmit(struct sk_buff *skb, struct net_device *dev);
int t3_mgmt_tx(struct adapter *adap, struct sk_buff *skb);
void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p);
int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/cxgb3/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ static inline void t3_stop_tx_queue(struct netdev_queue *txq,
*
* Add a packet to an SGE Tx queue. Runs with softirqs disabled.
*/
int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
{
int qidx;
unsigned int ndesc, pidx, credits, gen, compl;
Expand Down
10 changes: 4 additions & 6 deletions drivers/net/defxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ static int dfx_rcv_init(DFX_board_t *bp, int get_buffers);
static void dfx_rcv_queue_process(DFX_board_t *bp);
static void dfx_rcv_flush(DFX_board_t *bp);

static int dfx_xmt_queue_pkt(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t dfx_xmt_queue_pkt(struct sk_buff *skb,
struct net_device *dev);
static int dfx_xmt_done(DFX_board_t *bp);
static void dfx_xmt_flush(DFX_board_t *bp);

Expand Down Expand Up @@ -3188,11 +3189,8 @@ static void dfx_rcv_queue_process(
* None
*/

static int dfx_xmt_queue_pkt(
struct sk_buff *skb,
struct net_device *dev
)

static netdev_tx_t dfx_xmt_queue_pkt(struct sk_buff *skb,
struct net_device *dev)
{
DFX_board_t *bp = netdev_priv(dev);
u8 prod; /* local transmit producer index */
Expand Down
Loading

0 comments on commit 6135732

Please sign in to comment.