Skip to content

Commit

Permalink
wireless: convert drivers to netdev_tx_t
Browse files Browse the repository at this point in the history
Mostly just simple conversions:
  * ray_cs had bogus return of NET_TX_LOCKED but driver
    was not using NETIF_F_LLTX
  * hostap and ipw2x00 had some code that returned value
    from a called function that also had to change to return netdev_tx_t

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 0fc4809 commit d0cf9c0
Show file tree
Hide file tree
Showing 28 changed files with 92 additions and 65 deletions.
12 changes: 6 additions & 6 deletions drivers/net/wimax/i2400m/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,12 @@ int i2400m_net_tx(struct i2400m *i2400m, struct net_device *net_dev,
* that will sleep. See i2400m_net_wake_tx() for details.
*/
static
int i2400m_hard_start_xmit(struct sk_buff *skb,
struct net_device *net_dev)
netdev_tx_t i2400m_hard_start_xmit(struct sk_buff *skb,
struct net_device *net_dev)
{
int result;
struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
struct device *dev = i2400m_dev(i2400m);
int result;

d_fnstart(3, dev, "(skb %p net_dev %p)\n", skb, net_dev);
if (i2400m->state == I2400M_SS_IDLE)
Expand All @@ -353,9 +353,9 @@ int i2400m_hard_start_xmit(struct sk_buff *skb,
net_dev->stats.tx_bytes += skb->len;
}
kfree_skb(skb);
result = NETDEV_TX_OK;
d_fnend(3, dev, "(skb %p net_dev %p) = %d\n", skb, net_dev, result);
return result;

d_fnend(3, dev, "(skb %p net_dev %p)\n", skb, net_dev);
return NETDEV_TX_OK;
}


Expand Down
12 changes: 9 additions & 3 deletions drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,9 @@ static int airo_open(struct net_device *dev) {
return 0;
}

static int mpi_start_xmit(struct sk_buff *skb, struct net_device *dev) {
static netdev_tx_t mpi_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
int npacks, pending;
unsigned long flags;
struct airo_info *ai = dev->ml_priv;
Expand Down Expand Up @@ -2119,7 +2121,9 @@ static void airo_end_xmit(struct net_device *dev) {
dev_kfree_skb(skb);
}

static int airo_start_xmit(struct sk_buff *skb, struct net_device *dev) {
static netdev_tx_t airo_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
s16 len;
int i, j;
struct airo_info *priv = dev->ml_priv;
Expand Down Expand Up @@ -2184,7 +2188,9 @@ static void airo_end_xmit11(struct net_device *dev) {
dev_kfree_skb(skb);
}

static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) {
static netdev_tx_t airo_start_xmit11(struct sk_buff *skb,
struct net_device *dev)
{
s16 len;
int i, j;
struct airo_info *priv = dev->ml_priv;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/arlan-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct arlan_conf_stru arlan_conf[MAX_ARLANS];
static int arlans_found;

static int arlan_open(struct net_device *dev);
static int arlan_tx(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t arlan_tx(struct sk_buff *skb, struct net_device *dev);
static irqreturn_t arlan_interrupt(int irq, void *dev_id);
static int arlan_close(struct net_device *dev);
static struct net_device_stats *
Expand Down Expand Up @@ -1169,7 +1169,7 @@ static void arlan_tx_timeout (struct net_device *dev)
}


static int arlan_tx(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t arlan_tx(struct sk_buff *skb, struct net_device *dev)
{
short length;
unsigned char *buf;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ static void tx_update_descriptor(struct atmel_private *priv, int is_bcast,
priv->tx_free_mem -= len;
}

static int start_tx(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
{
static const u8 SNAP_RFC1024[6] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
struct atmel_private *priv = netdev_priv(dev);
Expand Down
10 changes: 7 additions & 3 deletions drivers/net/wireless/hostap/hostap_80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <linux/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>

struct hostap_ieee80211_mgmt {
__le16 frame_control;
Expand Down Expand Up @@ -85,8 +86,11 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
struct hostap_80211_rx_status *rx_stats);

void hostap_dump_tx_80211(const char *name, struct sk_buff *skb);
int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev);
int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev);
int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev);
netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb,
struct net_device *dev);
netdev_tx_t hostap_mgmt_start_xmit(struct sk_buff *skb,
struct net_device *dev);
netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb,
struct net_device *dev);

#endif /* HOSTAP_80211_H */
11 changes: 7 additions & 4 deletions drivers/net/wireless/hostap/hostap_80211_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
/* hard_start_xmit function for data interfaces (wlan#, wlan#wds#, wlan#sta)
* Convert Ethernet header into a suitable IEEE 802.11 header depending on
* device configuration. */
int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct hostap_interface *iface;
local_info_t *local;
Expand Down Expand Up @@ -261,7 +262,8 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)


/* hard_start_xmit function for hostapd wlan#ap interfaces */
int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t hostap_mgmt_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct hostap_interface *iface;
local_info_t *local;
Expand Down Expand Up @@ -373,11 +375,12 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
/* hard_start_xmit function for master radio interface wifi#.
* AP processing (TX rate control, power save buffering, etc.).
* Use hardware TX function to send the frame. */
int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct hostap_interface *iface;
local_info_t *local;
int ret = NETDEV_TX_BUSY;
netdev_tx_t ret = NETDEV_TX_BUSY;
u16 fc;
struct hostap_tx_data tx;
ap_tx_ret tx_ret;
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/ipw2x00/ipw2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -3330,8 +3330,8 @@ static irqreturn_t ipw2100_interrupt(int irq, void *data)
return IRQ_NONE;
}

static int ipw2100_tx(struct libipw_txb *txb, struct net_device *dev,
int pri)
static netdev_tx_t ipw2100_tx(struct libipw_txb *txb,
struct net_device *dev, int pri)
{
struct ipw2100_priv *priv = libipw_priv(dev);
struct list_head *element;
Expand Down Expand Up @@ -3369,12 +3369,12 @@ static int ipw2100_tx(struct libipw_txb *txb, struct net_device *dev,
ipw2100_tx_send_data(priv);

spin_unlock_irqrestore(&priv->low_lock, flags);
return 0;
return NETDEV_TX_OK;

fail_unlock:
fail_unlock:
netif_stop_queue(dev);
spin_unlock_irqrestore(&priv->low_lock, flags);
return 1;
return NETDEV_TX_BUSY;
}

static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
Expand Down
9 changes: 5 additions & 4 deletions drivers/net/wireless/ipw2x00/ipw2200.c
Original file line number Diff line number Diff line change
Expand Up @@ -10459,12 +10459,12 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
}
#endif

static int ipw_net_hard_start_xmit(struct libipw_txb *txb,
struct net_device *dev, int pri)
static netdev_tx_t ipw_net_hard_start_xmit(struct libipw_txb *txb,
struct net_device *dev, int pri)
{
struct ipw_priv *priv = libipw_priv(dev);
unsigned long flags;
int ret;
netdev_tx_t ret;

IPW_DEBUG_TX("dev->xmit(%d bytes)\n", txb->payload_size);
spin_lock_irqsave(&priv->lock, flags);
Expand Down Expand Up @@ -11602,7 +11602,8 @@ static int ipw_prom_stop(struct net_device *dev)
return 0;
}

static int ipw_prom_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t ipw_prom_hard_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
IPW_DEBUG_INFO("prom dev->xmit\n");
dev_kfree_skb(skb);
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/wireless/ipw2x00/libipw.h
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,8 @@ struct libipw_device {
/* Callback functions */
void (*set_security) (struct net_device * dev,
struct libipw_security * sec);
int (*hard_start_xmit) (struct libipw_txb * txb,
struct net_device * dev, int pri);
netdev_tx_t (*hard_start_xmit) (struct libipw_txb * txb,
struct net_device * dev, int pri);
int (*reset_port) (struct net_device * dev);
int (*is_queue_full) (struct net_device * dev, int pri);

Expand Down Expand Up @@ -1028,7 +1028,8 @@ extern void libipw_networks_age(struct libipw_device *ieee,
extern int libipw_set_encryption(struct libipw_device *ieee);

/* libipw_tx.c */
extern int libipw_xmit(struct sk_buff *skb, struct net_device *dev);
extern netdev_tx_t libipw_xmit(struct sk_buff *skb,
struct net_device *dev);
extern void libipw_txb_free(struct libipw_txb *);

/* libipw_rx.c */
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/wireless/ipw2x00/libipw_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static int libipw_classify(struct sk_buff *skb)

/* Incoming skb is converted to a txb which consists of
* a block of 802.11 fragment packets (stored as skbs) */
int libipw_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct libipw_device *ieee = netdev_priv(dev);
struct libipw_txb *txb = NULL;
Expand Down Expand Up @@ -523,8 +523,8 @@ int libipw_xmit(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb_any(skb);

if (txb) {
int ret = (*ieee->hard_start_xmit) (txb, dev, priority);
if (ret == 0) {
netdev_tx_t ret = (*ieee->hard_start_xmit)(txb, dev, priority);
if (ret == NETDEV_TX_OK) {
dev->stats.tx_packets++;
dev->stats.tx_bytes += txb->payload_size;
return NETDEV_TX_OK;
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/wireless/libertas/decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef _LBS_DECL_H_
#define _LBS_DECL_H_

#include <linux/device.h>
#include <linux/netdevice.h>

#include "defs.h"

Expand Down Expand Up @@ -41,7 +41,8 @@ u8 lbs_data_rate_to_fw_index(u32 rate);
int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len);
void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd,
int result);
int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb,
struct net_device *dev);
int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band);

int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *);
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/libertas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,8 @@ static int lbs_rtap_stop(struct net_device *dev)
return 0;
}

static int lbs_rtap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t lbs_rtap_hard_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
netif_stop_queue(dev);
return NETDEV_TX_BUSY;
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/wireless/libertas/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,17 @@ static u32 convert_radiotap_rate_to_mv(u8 rate)
* @param skb A pointer to skb which includes TX packet
* @return 0 or -1
*/
int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
unsigned long flags;
struct lbs_private *priv = dev->ml_priv;
struct txpd *txpd;
char *p802x_hdr;
uint16_t pkt_len;
int ret;
netdev_tx_t ret = NETDEV_TX_OK;

lbs_deb_enter(LBS_DEB_TX);

ret = NETDEV_TX_OK;

/* We need to protect against the queues being restarted before
we get round to stopping them */
spin_lock_irqsave(&priv->driver_lock, flags);
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ struct hwsim_radiotap_hdr {
} __attribute__ ((packed));


static int hwsim_mon_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t hwsim_mon_xmit(struct sk_buff *skb,
struct net_device *dev)
{
/* TODO: allow packet injection */
dev_kfree_skb(skb);
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/wireless/netwave_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ static int netwave_open(struct net_device *dev); /* Open the device */
static int netwave_close(struct net_device *dev); /* Close the device */

/* Packet transmission and Packet reception */
static int netwave_start_xmit( struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t netwave_start_xmit( struct sk_buff *skb,
struct net_device *dev);
static int netwave_rx( struct net_device *dev);

/* Interrupt routines */
Expand Down Expand Up @@ -1026,7 +1027,8 @@ static int netwave_hw_xmit(unsigned char* data, int len,
return 0;
}

static int netwave_start_xmit(struct sk_buff *skb, struct net_device *dev) {
static netdev_tx_t netwave_start_xmit(struct sk_buff *skb,
struct net_device *dev) {
/* This flag indicate that the hardware can't perform a transmission.
* Theoritically, NET3 check it before sending a packet to the driver,
* but in fact it never do that and pool continuously.
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/orinoco/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ static int orinoco_change_mtu(struct net_device *dev, int new_mtu)
/* Tx path */
/********************************************************************/

static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct orinoco_private *priv = ndev_priv(dev);
struct net_device_stats *stats = &priv->stats;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/prism54/islpci_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ islpci_eth_cleanup_transmit(islpci_private *priv,
}
}

int
netdev_tx_t
islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
{
islpci_private *priv = netdev_priv(ndev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/prism54/islpci_eth.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct avs_80211_1_header {
};

void islpci_eth_cleanup_transmit(islpci_private *, isl38xx_control_block *);
int islpci_eth_transmit(struct sk_buff *, struct net_device *);
netdev_tx_t islpci_eth_transmit(struct sk_buff *, struct net_device *);
int islpci_eth_receive(islpci_private *);
void islpci_eth_tx_timeout(struct net_device *);
void islpci_do_reset_and_wake(struct work_struct *);
Expand Down
14 changes: 9 additions & 5 deletions drivers/net/wireless/ray_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ static int ray_dev_init(struct net_device *dev);
static const struct ethtool_ops netdev_ethtool_ops;

static int ray_open(struct net_device *dev);
static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev);
static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb,
struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static void ray_update_multi_list(struct net_device *dev, int all);
static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx,
Expand Down Expand Up @@ -915,16 +916,19 @@ static int ray_dev_config(struct net_device *dev, struct ifmap *map)
}

/*===========================================================================*/
static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
ray_dev_t *local = netdev_priv(dev);
struct pcmcia_device *link = local->finder;
short length = skb->len;

if (!(pcmcia_dev_present(link))) {
if (!pcmcia_dev_present(link)) {
DEBUG(2, "ray_dev_start_xmit - device not present\n");
return NETDEV_TX_LOCKED;
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}

DEBUG(3, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev);
if (local->authentication_state == NEED_TO_AUTH) {
DEBUG(0, "ray_cs Sending authentication request.\n");
Expand All @@ -951,8 +955,8 @@ static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev)
default:
dev->trans_start = jiffies;
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}

return NETDEV_TX_OK;
} /* ray_dev_start_xmit */

Expand Down
Loading

0 comments on commit d0cf9c0

Please sign in to comment.