Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wireless: convert drivers to netdev_tx_t

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>

authored by

Stephen Hemminger and committed by
David S. Miller
d0cf9c0d 0fc48098

+92 -65
+6 -6
drivers/net/wimax/i2400m/netdev.c
··· 334 334 * that will sleep. See i2400m_net_wake_tx() for details. 335 335 */ 336 336 static 337 - int i2400m_hard_start_xmit(struct sk_buff *skb, 338 - struct net_device *net_dev) 337 + netdev_tx_t i2400m_hard_start_xmit(struct sk_buff *skb, 338 + struct net_device *net_dev) 339 339 { 340 - int result; 341 340 struct i2400m *i2400m = net_dev_to_i2400m(net_dev); 342 341 struct device *dev = i2400m_dev(i2400m); 342 + int result; 343 343 344 344 d_fnstart(3, dev, "(skb %p net_dev %p)\n", skb, net_dev); 345 345 if (i2400m->state == I2400M_SS_IDLE) ··· 353 353 net_dev->stats.tx_bytes += skb->len; 354 354 } 355 355 kfree_skb(skb); 356 - result = NETDEV_TX_OK; 357 - d_fnend(3, dev, "(skb %p net_dev %p) = %d\n", skb, net_dev, result); 358 - return result; 356 + 357 + d_fnend(3, dev, "(skb %p net_dev %p)\n", skb, net_dev); 358 + return NETDEV_TX_OK; 359 359 } 360 360 361 361
+9 -3
drivers/net/wireless/airo.c
··· 1920 1920 return 0; 1921 1921 } 1922 1922 1923 - static int mpi_start_xmit(struct sk_buff *skb, struct net_device *dev) { 1923 + static netdev_tx_t mpi_start_xmit(struct sk_buff *skb, 1924 + struct net_device *dev) 1925 + { 1924 1926 int npacks, pending; 1925 1927 unsigned long flags; 1926 1928 struct airo_info *ai = dev->ml_priv; ··· 2121 2119 dev_kfree_skb(skb); 2122 2120 } 2123 2121 2124 - static int airo_start_xmit(struct sk_buff *skb, struct net_device *dev) { 2122 + static netdev_tx_t airo_start_xmit(struct sk_buff *skb, 2123 + struct net_device *dev) 2124 + { 2125 2125 s16 len; 2126 2126 int i, j; 2127 2127 struct airo_info *priv = dev->ml_priv; ··· 2188 2184 dev_kfree_skb(skb); 2189 2185 } 2190 2186 2191 - static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) { 2187 + static netdev_tx_t airo_start_xmit11(struct sk_buff *skb, 2188 + struct net_device *dev) 2189 + { 2192 2190 s16 len; 2193 2191 int i, j; 2194 2192 struct airo_info *priv = dev->ml_priv;
+2 -2
drivers/net/wireless/arlan-main.c
··· 77 77 static int arlans_found; 78 78 79 79 static int arlan_open(struct net_device *dev); 80 - static int arlan_tx(struct sk_buff *skb, struct net_device *dev); 80 + static netdev_tx_t arlan_tx(struct sk_buff *skb, struct net_device *dev); 81 81 static irqreturn_t arlan_interrupt(int irq, void *dev_id); 82 82 static int arlan_close(struct net_device *dev); 83 83 static struct net_device_stats * ··· 1169 1169 } 1170 1170 1171 1171 1172 - static int arlan_tx(struct sk_buff *skb, struct net_device *dev) 1172 + static netdev_tx_t arlan_tx(struct sk_buff *skb, struct net_device *dev) 1173 1173 { 1174 1174 short length; 1175 1175 unsigned char *buf;
+1 -1
drivers/net/wireless/atmel.c
··· 781 781 priv->tx_free_mem -= len; 782 782 } 783 783 784 - static int start_tx(struct sk_buff *skb, struct net_device *dev) 784 + static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev) 785 785 { 786 786 static const u8 SNAP_RFC1024[6] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; 787 787 struct atmel_private *priv = netdev_priv(dev);
+7 -3
drivers/net/wireless/hostap/hostap_80211.h
··· 3 3 4 4 #include <linux/types.h> 5 5 #include <linux/skbuff.h> 6 + #include <linux/netdevice.h> 6 7 7 8 struct hostap_ieee80211_mgmt { 8 9 __le16 frame_control; ··· 86 85 struct hostap_80211_rx_status *rx_stats); 87 86 88 87 void hostap_dump_tx_80211(const char *name, struct sk_buff *skb); 89 - int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev); 90 - int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev); 91 - int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev); 88 + netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb, 89 + struct net_device *dev); 90 + netdev_tx_t hostap_mgmt_start_xmit(struct sk_buff *skb, 91 + struct net_device *dev); 92 + netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb, 93 + struct net_device *dev); 92 94 93 95 #endif /* HOSTAP_80211_H */
+7 -4
drivers/net/wireless/hostap/hostap_80211_tx.c
··· 53 53 /* hard_start_xmit function for data interfaces (wlan#, wlan#wds#, wlan#sta) 54 54 * Convert Ethernet header into a suitable IEEE 802.11 header depending on 55 55 * device configuration. */ 56 - int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) 56 + netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb, 57 + struct net_device *dev) 57 58 { 58 59 struct hostap_interface *iface; 59 60 local_info_t *local; ··· 262 261 263 262 264 263 /* hard_start_xmit function for hostapd wlan#ap interfaces */ 265 - int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev) 264 + netdev_tx_t hostap_mgmt_start_xmit(struct sk_buff *skb, 265 + struct net_device *dev) 266 266 { 267 267 struct hostap_interface *iface; 268 268 local_info_t *local; ··· 375 373 /* hard_start_xmit function for master radio interface wifi#. 376 374 * AP processing (TX rate control, power save buffering, etc.). 377 375 * Use hardware TX function to send the frame. */ 378 - int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) 376 + netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb, 377 + struct net_device *dev) 379 378 { 380 379 struct hostap_interface *iface; 381 380 local_info_t *local; 382 - int ret = NETDEV_TX_BUSY; 381 + netdev_tx_t ret = NETDEV_TX_BUSY; 383 382 u16 fc; 384 383 struct hostap_tx_data tx; 385 384 ap_tx_ret tx_ret;
+5 -5
drivers/net/wireless/ipw2x00/ipw2100.c
··· 3330 3330 return IRQ_NONE; 3331 3331 } 3332 3332 3333 - static int ipw2100_tx(struct libipw_txb *txb, struct net_device *dev, 3334 - int pri) 3333 + static netdev_tx_t ipw2100_tx(struct libipw_txb *txb, 3334 + struct net_device *dev, int pri) 3335 3335 { 3336 3336 struct ipw2100_priv *priv = libipw_priv(dev); 3337 3337 struct list_head *element; ··· 3369 3369 ipw2100_tx_send_data(priv); 3370 3370 3371 3371 spin_unlock_irqrestore(&priv->low_lock, flags); 3372 - return 0; 3372 + return NETDEV_TX_OK; 3373 3373 3374 - fail_unlock: 3374 + fail_unlock: 3375 3375 netif_stop_queue(dev); 3376 3376 spin_unlock_irqrestore(&priv->low_lock, flags); 3377 - return 1; 3377 + return NETDEV_TX_BUSY; 3378 3378 } 3379 3379 3380 3380 static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
+5 -4
drivers/net/wireless/ipw2x00/ipw2200.c
··· 10459 10459 } 10460 10460 #endif 10461 10461 10462 - static int ipw_net_hard_start_xmit(struct libipw_txb *txb, 10463 - struct net_device *dev, int pri) 10462 + static netdev_tx_t ipw_net_hard_start_xmit(struct libipw_txb *txb, 10463 + struct net_device *dev, int pri) 10464 10464 { 10465 10465 struct ipw_priv *priv = libipw_priv(dev); 10466 10466 unsigned long flags; 10467 - int ret; 10467 + netdev_tx_t ret; 10468 10468 10469 10469 IPW_DEBUG_TX("dev->xmit(%d bytes)\n", txb->payload_size); 10470 10470 spin_lock_irqsave(&priv->lock, flags); ··· 11602 11602 return 0; 11603 11603 } 11604 11604 11605 - static int ipw_prom_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 11605 + static netdev_tx_t ipw_prom_hard_start_xmit(struct sk_buff *skb, 11606 + struct net_device *dev) 11606 11607 { 11607 11608 IPW_DEBUG_INFO("prom dev->xmit\n"); 11608 11609 dev_kfree_skb(skb);
+4 -3
drivers/net/wireless/ipw2x00/libipw.h
··· 867 867 /* Callback functions */ 868 868 void (*set_security) (struct net_device * dev, 869 869 struct libipw_security * sec); 870 - int (*hard_start_xmit) (struct libipw_txb * txb, 871 - struct net_device * dev, int pri); 870 + netdev_tx_t (*hard_start_xmit) (struct libipw_txb * txb, 871 + struct net_device * dev, int pri); 872 872 int (*reset_port) (struct net_device * dev); 873 873 int (*is_queue_full) (struct net_device * dev, int pri); 874 874 ··· 1028 1028 extern int libipw_set_encryption(struct libipw_device *ieee); 1029 1029 1030 1030 /* libipw_tx.c */ 1031 - extern int libipw_xmit(struct sk_buff *skb, struct net_device *dev); 1031 + extern netdev_tx_t libipw_xmit(struct sk_buff *skb, 1032 + struct net_device *dev); 1032 1033 extern void libipw_txb_free(struct libipw_txb *); 1033 1034 1034 1035 /* libipw_rx.c */
+3 -3
drivers/net/wireless/ipw2x00/libipw_tx.c
··· 252 252 253 253 /* Incoming skb is converted to a txb which consists of 254 254 * a block of 802.11 fragment packets (stored as skbs) */ 255 - int libipw_xmit(struct sk_buff *skb, struct net_device *dev) 255 + netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev) 256 256 { 257 257 struct libipw_device *ieee = netdev_priv(dev); 258 258 struct libipw_txb *txb = NULL; ··· 523 523 dev_kfree_skb_any(skb); 524 524 525 525 if (txb) { 526 - int ret = (*ieee->hard_start_xmit) (txb, dev, priority); 527 - if (ret == 0) { 526 + netdev_tx_t ret = (*ieee->hard_start_xmit)(txb, dev, priority); 527 + if (ret == NETDEV_TX_OK) { 528 528 dev->stats.tx_packets++; 529 529 dev->stats.tx_bytes += txb->payload_size; 530 530 return NETDEV_TX_OK;
+3 -2
drivers/net/wireless/libertas/decl.h
··· 6 6 #ifndef _LBS_DECL_H_ 7 7 #define _LBS_DECL_H_ 8 8 9 - #include <linux/device.h> 9 + #include <linux/netdevice.h> 10 10 11 11 #include "defs.h" 12 12 ··· 41 41 int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len); 42 42 void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, 43 43 int result); 44 - int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); 44 + netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, 45 + struct net_device *dev); 45 46 int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band); 46 47 47 48 int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *);
+2 -1
drivers/net/wireless/libertas/main.c
··· 1647 1647 return 0; 1648 1648 } 1649 1649 1650 - static int lbs_rtap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 1650 + static netdev_tx_t lbs_rtap_hard_start_xmit(struct sk_buff *skb, 1651 + struct net_device *dev) 1651 1652 { 1652 1653 netif_stop_queue(dev); 1653 1654 return NETDEV_TX_BUSY;
+2 -4
drivers/net/wireless/libertas/tx.c
··· 57 57 * @param skb A pointer to skb which includes TX packet 58 58 * @return 0 or -1 59 59 */ 60 - int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 60 + netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 61 61 { 62 62 unsigned long flags; 63 63 struct lbs_private *priv = dev->ml_priv; 64 64 struct txpd *txpd; 65 65 char *p802x_hdr; 66 66 uint16_t pkt_len; 67 - int ret; 67 + netdev_tx_t ret = NETDEV_TX_OK; 68 68 69 69 lbs_deb_enter(LBS_DEB_TX); 70 - 71 - ret = NETDEV_TX_OK; 72 70 73 71 /* We need to protect against the queues being restarted before 74 72 we get round to stopping them */
+2 -1
drivers/net/wireless/mac80211_hwsim.c
··· 312 312 } __attribute__ ((packed)); 313 313 314 314 315 - static int hwsim_mon_xmit(struct sk_buff *skb, struct net_device *dev) 315 + static netdev_tx_t hwsim_mon_xmit(struct sk_buff *skb, 316 + struct net_device *dev) 316 317 { 317 318 /* TODO: allow packet injection */ 318 319 dev_kfree_skb(skb);
+4 -2
drivers/net/wireless/netwave_cs.c
··· 203 203 static int netwave_close(struct net_device *dev); /* Close the device */ 204 204 205 205 /* Packet transmission and Packet reception */ 206 - static int netwave_start_xmit( struct sk_buff *skb, struct net_device *dev); 206 + static netdev_tx_t netwave_start_xmit( struct sk_buff *skb, 207 + struct net_device *dev); 207 208 static int netwave_rx( struct net_device *dev); 208 209 209 210 /* Interrupt routines */ ··· 1027 1026 return 0; 1028 1027 } 1029 1028 1030 - static int netwave_start_xmit(struct sk_buff *skb, struct net_device *dev) { 1029 + static netdev_tx_t netwave_start_xmit(struct sk_buff *skb, 1030 + struct net_device *dev) { 1031 1031 /* This flag indicate that the hardware can't perform a transmission. 1032 1032 * Theoritically, NET3 check it before sending a packet to the driver, 1033 1033 * but in fact it never do that and pool continuously.
+1 -1
drivers/net/wireless/orinoco/main.c
··· 337 337 /* Tx path */ 338 338 /********************************************************************/ 339 339 340 - static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) 340 + static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev) 341 341 { 342 342 struct orinoco_private *priv = ndev_priv(dev); 343 343 struct net_device_stats *stats = &priv->stats;
+1 -1
drivers/net/wireless/prism54/islpci_eth.c
··· 72 72 } 73 73 } 74 74 75 - int 75 + netdev_tx_t 76 76 islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) 77 77 { 78 78 islpci_private *priv = netdev_priv(ndev);
+1 -1
drivers/net/wireless/prism54/islpci_eth.h
··· 64 64 }; 65 65 66 66 void islpci_eth_cleanup_transmit(islpci_private *, isl38xx_control_block *); 67 - int islpci_eth_transmit(struct sk_buff *, struct net_device *); 67 + netdev_tx_t islpci_eth_transmit(struct sk_buff *, struct net_device *); 68 68 int islpci_eth_receive(islpci_private *); 69 69 void islpci_eth_tx_timeout(struct net_device *); 70 70 void islpci_do_reset_and_wake(struct work_struct *);
+9 -5
drivers/net/wireless/ray_cs.c
··· 104 104 static const struct ethtool_ops netdev_ethtool_ops; 105 105 106 106 static int ray_open(struct net_device *dev); 107 - static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev); 107 + static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb, 108 + struct net_device *dev); 108 109 static void set_multicast_list(struct net_device *dev); 109 110 static void ray_update_multi_list(struct net_device *dev, int all); 110 111 static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx, ··· 916 915 } 917 916 918 917 /*===========================================================================*/ 919 - static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev) 918 + static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb, 919 + struct net_device *dev) 920 920 { 921 921 ray_dev_t *local = netdev_priv(dev); 922 922 struct pcmcia_device *link = local->finder; 923 923 short length = skb->len; 924 924 925 - if (!(pcmcia_dev_present(link))) { 925 + if (!pcmcia_dev_present(link)) { 926 926 DEBUG(2, "ray_dev_start_xmit - device not present\n"); 927 - return NETDEV_TX_LOCKED; 927 + dev_kfree_skb(skb); 928 + return NETDEV_TX_OK; 928 929 } 930 + 929 931 DEBUG(3, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev); 930 932 if (local->authentication_state == NEED_TO_AUTH) { 931 933 DEBUG(0, "ray_cs Sending authentication request.\n"); ··· 955 951 default: 956 952 dev->trans_start = jiffies; 957 953 dev_kfree_skb(skb); 958 - return NETDEV_TX_OK; 959 954 } 955 + 960 956 return NETDEV_TX_OK; 961 957 } /* ray_dev_start_xmit */ 962 958
+1 -1
drivers/net/wireless/strip.c
··· 1533 1533 } 1534 1534 1535 1535 /* Encapsulate a datagram and kick it into a TTY queue. */ 1536 - static int strip_xmit(struct sk_buff *skb, struct net_device *dev) 1536 + static netdev_tx_t strip_xmit(struct sk_buff *skb, struct net_device *dev) 1537 1537 { 1538 1538 struct strip *strip_info = netdev_priv(dev); 1539 1539
+2 -1
drivers/net/wireless/wavelan.c
··· 2841 2841 * the packet. We also prevent reentrance. Then we call the function 2842 2842 * to send the packet. 2843 2843 */ 2844 - static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev) 2844 + static netdev_tx_t wavelan_packet_xmit(struct sk_buff *skb, 2845 + struct net_device * dev) 2845 2846 { 2846 2847 net_local *lp = netdev_priv(dev); 2847 2848 unsigned long flags;
+1 -1
drivers/net/wireless/wavelan.p.h
··· 611 611 wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer. */ 612 612 void *, 613 613 short); 614 - static int 614 + static netdev_tx_t 615 615 wavelan_packet_xmit(struct sk_buff *, /* Send a packet. */ 616 616 struct net_device *); 617 617 /* -------------------- HARDWARE CONFIGURATION -------------------- */
+1 -1
drivers/net/wireless/wavelan_cs.c
··· 3078 3078 * the packet. We also prevent reentrance. Then, we call the function 3079 3079 * to send the packet... 3080 3080 */ 3081 - static int 3081 + static netdev_tx_t 3082 3082 wavelan_packet_xmit(struct sk_buff * skb, 3083 3083 struct net_device * dev) 3084 3084 {
+1 -1
drivers/net/wireless/wavelan_cs.p.h
··· 707 707 wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer */ 708 708 void *, 709 709 short); 710 - static int 710 + static netdev_tx_t 711 711 wavelan_packet_xmit(struct sk_buff *, /* Send a packet */ 712 712 struct net_device *); 713 713 /* -------------------- HARDWARE CONFIGURATION -------------------- */
+2 -1
drivers/net/wireless/wl3501_cs.c
··· 1333 1333 * 1 - Could not transmit (dev_queue_xmit will queue it) 1334 1334 * and try to sent it later 1335 1335 */ 1336 - static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 1336 + static netdev_tx_t wl3501_hard_start_xmit(struct sk_buff *skb, 1337 + struct net_device *dev) 1337 1338 { 1338 1339 int enabled, rc; 1339 1340 struct wl3501_card *this = netdev_priv(dev);
+2 -1
drivers/net/wireless/zd1201.c
··· 779 779 (llc+snap+type+payload) 780 780 zd 1 null byte, zd1201 packet type 781 781 */ 782 - static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 782 + static netdev_tx_t zd1201_hard_start_xmit(struct sk_buff *skb, 783 + struct net_device *dev) 783 784 { 784 785 struct zd1201 *zd = netdev_priv(dev); 785 786 unsigned char *txbuf = zd->txdata;
+4 -2
net/mac80211/ieee80211_i.h
··· 1050 1050 /* tx handling */ 1051 1051 void ieee80211_clear_tx_pending(struct ieee80211_local *local); 1052 1052 void ieee80211_tx_pending(unsigned long data); 1053 - int ieee80211_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev); 1054 - int ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev); 1053 + netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, 1054 + struct net_device *dev); 1055 + netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, 1056 + struct net_device *dev); 1055 1057 1056 1058 /* HT */ 1057 1059 void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband,
+4 -4
net/mac80211/tx.c
··· 1483 1483 dev_put(sdata->dev); 1484 1484 } 1485 1485 1486 - int ieee80211_monitor_start_xmit(struct sk_buff *skb, 1487 - struct net_device *dev) 1486 + netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, 1487 + struct net_device *dev) 1488 1488 { 1489 1489 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 1490 1490 struct ieee80211_channel *chan = local->hw.conf.channel; ··· 1568 1568 * encapsulated packet will then be passed to master interface, wlan#.11, for 1569 1569 * transmission (through low-level driver). 1570 1570 */ 1571 - int ieee80211_subif_start_xmit(struct sk_buff *skb, 1572 - struct net_device *dev) 1571 + netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, 1572 + struct net_device *dev) 1573 1573 { 1574 1574 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1575 1575 struct ieee80211_local *local = sdata->local;