diff options
Diffstat (limited to 'drivers')
301 files changed, 2485 insertions, 1387 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 77b364889224..caf6e4d19469 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -4005,10 +4005,9 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, | |||
4005 | * | 4005 | * |
4006 | * skb socket buffer containing HDLC frame | 4006 | * skb socket buffer containing HDLC frame |
4007 | * dev pointer to network device structure | 4007 | * dev pointer to network device structure |
4008 | * | ||
4009 | * returns 0 if success, otherwise error code | ||
4010 | */ | 4008 | */ |
4011 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | 4009 | static netdev_tx_t hdlcdev_xmit(struct sk_buff *skb, |
4010 | struct net_device *dev) | ||
4012 | { | 4011 | { |
4013 | MGSLPC_INFO *info = dev_to_port(dev); | 4012 | MGSLPC_INFO *info = dev_to_port(dev); |
4014 | unsigned long flags; | 4013 | unsigned long flags; |
@@ -4043,7 +4042,7 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4043 | } | 4042 | } |
4044 | spin_unlock_irqrestore(&info->lock,flags); | 4043 | spin_unlock_irqrestore(&info->lock,flags); |
4045 | 4044 | ||
4046 | return 0; | 4045 | return NETDEV_TX_OK; |
4047 | } | 4046 | } |
4048 | 4047 | ||
4049 | /** | 4048 | /** |
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 813552f14884..4846b73ef28d 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -7697,10 +7697,9 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, | |||
7697 | * | 7697 | * |
7698 | * skb socket buffer containing HDLC frame | 7698 | * skb socket buffer containing HDLC frame |
7699 | * dev pointer to network device structure | 7699 | * dev pointer to network device structure |
7700 | * | ||
7701 | * returns 0 if success, otherwise error code | ||
7702 | */ | 7700 | */ |
7703 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | 7701 | static netdev_tx_t hdlcdev_xmit(struct sk_buff *skb, |
7702 | struct net_device *dev) | ||
7704 | { | 7703 | { |
7705 | struct mgsl_struct *info = dev_to_port(dev); | 7704 | struct mgsl_struct *info = dev_to_port(dev); |
7706 | unsigned long flags; | 7705 | unsigned long flags; |
@@ -7731,7 +7730,7 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
7731 | usc_start_transmitter(info); | 7730 | usc_start_transmitter(info); |
7732 | spin_unlock_irqrestore(&info->irq_spinlock,flags); | 7731 | spin_unlock_irqrestore(&info->irq_spinlock,flags); |
7733 | 7732 | ||
7734 | return 0; | 7733 | return NETDEV_TX_OK; |
7735 | } | 7734 | } |
7736 | 7735 | ||
7737 | /** | 7736 | /** |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 91f20a92fddf..8678f0c8699d 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -1497,10 +1497,9 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, | |||
1497 | * | 1497 | * |
1498 | * skb socket buffer containing HDLC frame | 1498 | * skb socket buffer containing HDLC frame |
1499 | * dev pointer to network device structure | 1499 | * dev pointer to network device structure |
1500 | * | ||
1501 | * returns 0 if success, otherwise error code | ||
1502 | */ | 1500 | */ |
1503 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | 1501 | static netdev_tx_t hdlcdev_xmit(struct sk_buff *skb, |
1502 | struct net_device *dev) | ||
1504 | { | 1503 | { |
1505 | struct slgt_info *info = dev_to_port(dev); | 1504 | struct slgt_info *info = dev_to_port(dev); |
1506 | unsigned long flags; | 1505 | unsigned long flags; |
@@ -1529,7 +1528,7 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1529 | update_tx_timer(info); | 1528 | update_tx_timer(info); |
1530 | spin_unlock_irqrestore(&info->lock,flags); | 1529 | spin_unlock_irqrestore(&info->lock,flags); |
1531 | 1530 | ||
1532 | return 0; | 1531 | return NETDEV_TX_OK; |
1533 | } | 1532 | } |
1534 | 1533 | ||
1535 | /** | 1534 | /** |
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 8d4a2a8a0a70..2b18adc4ee19 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c | |||
@@ -1608,10 +1608,9 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding, | |||
1608 | * | 1608 | * |
1609 | * skb socket buffer containing HDLC frame | 1609 | * skb socket buffer containing HDLC frame |
1610 | * dev pointer to network device structure | 1610 | * dev pointer to network device structure |
1611 | * | ||
1612 | * returns 0 if success, otherwise error code | ||
1613 | */ | 1611 | */ |
1614 | static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | 1612 | static netdev_tx_t hdlcdev_xmit(struct sk_buff *skb, |
1613 | struct net_device *dev) | ||
1615 | { | 1614 | { |
1616 | SLMP_INFO *info = dev_to_port(dev); | 1615 | SLMP_INFO *info = dev_to_port(dev); |
1617 | unsigned long flags; | 1616 | unsigned long flags; |
@@ -1642,7 +1641,7 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1642 | tx_start(info); | 1641 | tx_start(info); |
1643 | spin_unlock_irqrestore(&info->lock,flags); | 1642 | spin_unlock_irqrestore(&info->lock,flags); |
1644 | 1643 | ||
1645 | return 0; | 1644 | return NETDEV_TX_OK; |
1646 | } | 1645 | } |
1647 | 1646 | ||
1648 | /** | 1647 | /** |
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index a42209a73aed..84edc8b84c62 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c | |||
@@ -1188,7 +1188,7 @@ static int fwnet_stop(struct net_device *net) | |||
1188 | return 0; | 1188 | return 0; |
1189 | } | 1189 | } |
1190 | 1190 | ||
1191 | static int fwnet_tx(struct sk_buff *skb, struct net_device *net) | 1191 | static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net) |
1192 | { | 1192 | { |
1193 | struct fwnet_header hdr_buf; | 1193 | struct fwnet_header hdr_buf; |
1194 | struct fwnet_device *dev = netdev_priv(net); | 1194 | struct fwnet_device *dev = netdev_priv(net); |
@@ -1342,7 +1342,7 @@ static void fwnet_get_drvinfo(struct net_device *net, | |||
1342 | strcpy(info->bus_info, "ieee1394"); | 1342 | strcpy(info->bus_info, "ieee1394"); |
1343 | } | 1343 | } |
1344 | 1344 | ||
1345 | static struct ethtool_ops fwnet_ethtool_ops = { | 1345 | static const struct ethtool_ops fwnet_ethtool_ops = { |
1346 | .get_drvinfo = fwnet_get_drvinfo, | 1346 | .get_drvinfo = fwnet_get_drvinfo, |
1347 | }; | 1347 | }; |
1348 | 1348 | ||
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index f5c586c2bba6..3a62c4c2d419 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -169,10 +169,11 @@ static int ether1394_header_cache(const struct neighbour *neigh, | |||
169 | static void ether1394_header_cache_update(struct hh_cache *hh, | 169 | static void ether1394_header_cache_update(struct hh_cache *hh, |
170 | const struct net_device *dev, | 170 | const struct net_device *dev, |
171 | const unsigned char *haddr); | 171 | const unsigned char *haddr); |
172 | static int ether1394_tx(struct sk_buff *skb, struct net_device *dev); | 172 | static netdev_tx_t ether1394_tx(struct sk_buff *skb, |
173 | struct net_device *dev); | ||
173 | static void ether1394_iso(struct hpsb_iso *iso); | 174 | static void ether1394_iso(struct hpsb_iso *iso); |
174 | 175 | ||
175 | static struct ethtool_ops ethtool_ops; | 176 | static const struct ethtool_ops ethtool_ops; |
176 | 177 | ||
177 | static int ether1394_write(struct hpsb_host *host, int srcid, int destid, | 178 | static int ether1394_write(struct hpsb_host *host, int srcid, int destid, |
178 | quadlet_t *data, u64 addr, size_t len, u16 flags); | 179 | quadlet_t *data, u64 addr, size_t len, u16 flags); |
@@ -1555,7 +1556,8 @@ static void ether1394_complete_cb(void *__ptask) | |||
1555 | } | 1556 | } |
1556 | 1557 | ||
1557 | /* Transmit a packet (called by kernel) */ | 1558 | /* Transmit a packet (called by kernel) */ |
1558 | static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) | 1559 | static netdev_tx_t ether1394_tx(struct sk_buff *skb, |
1560 | struct net_device *dev) | ||
1559 | { | 1561 | { |
1560 | struct eth1394hdr hdr_buf; | 1562 | struct eth1394hdr hdr_buf; |
1561 | struct eth1394_priv *priv = netdev_priv(dev); | 1563 | struct eth1394_priv *priv = netdev_priv(dev); |
@@ -1694,14 +1696,6 @@ fail: | |||
1694 | dev->stats.tx_errors++; | 1696 | dev->stats.tx_errors++; |
1695 | spin_unlock_irqrestore(&priv->lock, flags); | 1697 | spin_unlock_irqrestore(&priv->lock, flags); |
1696 | 1698 | ||
1697 | /* | ||
1698 | * FIXME: According to a patch from 2003-02-26, "returning non-zero | ||
1699 | * causes serious problems" here, allegedly. Before that patch, | ||
1700 | * -ERRNO was returned which is not appropriate under Linux 2.6. | ||
1701 | * Perhaps more needs to be done? Stop the queue in serious | ||
1702 | * conditions and restart it elsewhere? | ||
1703 | */ | ||
1704 | /* return NETDEV_TX_BUSY; */ | ||
1705 | return NETDEV_TX_OK; | 1699 | return NETDEV_TX_OK; |
1706 | } | 1700 | } |
1707 | 1701 | ||
@@ -1712,7 +1706,7 @@ static void ether1394_get_drvinfo(struct net_device *dev, | |||
1712 | strcpy(info->bus_info, "ieee1394"); /* FIXME provide more detail? */ | 1706 | strcpy(info->bus_info, "ieee1394"); /* FIXME provide more detail? */ |
1713 | } | 1707 | } |
1714 | 1708 | ||
1715 | static struct ethtool_ops ethtool_ops = { | 1709 | static const struct ethtool_ops ethtool_ops = { |
1716 | .get_drvinfo = ether1394_get_drvinfo | 1710 | .get_drvinfo = ether1394_get_drvinfo |
1717 | }; | 1711 | }; |
1718 | 1712 | ||
diff --git a/drivers/ieee802154/fakehard.c b/drivers/ieee802154/fakehard.c index c1c9697f9fde..96a2959ce877 100644 --- a/drivers/ieee802154/fakehard.c +++ b/drivers/ieee802154/fakehard.c | |||
@@ -257,7 +257,8 @@ static int ieee802154_fake_close(struct net_device *dev) | |||
257 | return 0; | 257 | return 0; |
258 | } | 258 | } |
259 | 259 | ||
260 | static int ieee802154_fake_xmit(struct sk_buff *skb, struct net_device *dev) | 260 | static netdev_tx_t ieee802154_fake_xmit(struct sk_buff *skb, |
261 | struct net_device *dev) | ||
261 | { | 262 | { |
262 | skb->iif = dev->ifindex; | 263 | skb->iif = dev->ifindex; |
263 | skb->dev = dev; | 264 | skb->dev = dev; |
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index c6e6611d3016..538e409d4515 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c | |||
@@ -1508,7 +1508,7 @@ static int nes_netdev_set_settings(struct net_device *netdev, struct ethtool_cmd | |||
1508 | } | 1508 | } |
1509 | 1509 | ||
1510 | 1510 | ||
1511 | static struct ethtool_ops nes_ethtool_ops = { | 1511 | static const struct ethtool_ops nes_ethtool_ops = { |
1512 | .get_link = ethtool_op_get_link, | 1512 | .get_link = ethtool_op_get_link, |
1513 | .get_settings = nes_netdev_get_settings, | 1513 | .get_settings = nes_netdev_get_settings, |
1514 | .set_settings = nes_netdev_set_settings, | 1514 | .set_settings = nes_netdev_set_settings, |
diff --git a/drivers/isdn/hysdn/hysdn_net.c b/drivers/isdn/hysdn/hysdn_net.c index c73004b3b2ac..72eb92647c1b 100644 --- a/drivers/isdn/hysdn/hysdn_net.c +++ b/drivers/isdn/hysdn/hysdn_net.c | |||
@@ -119,7 +119,7 @@ net_close(struct net_device *dev) | |||
119 | /* send a packet on this interface. */ | 119 | /* send a packet on this interface. */ |
120 | /* new style for kernel >= 2.3.33 */ | 120 | /* new style for kernel >= 2.3.33 */ |
121 | /************************************/ | 121 | /************************************/ |
122 | static int | 122 | static netdev_tx_t |
123 | net_send_packet(struct sk_buff *skb, struct net_device *dev) | 123 | net_send_packet(struct sk_buff *skb, struct net_device *dev) |
124 | { | 124 | { |
125 | struct net_local *lp = (struct net_local *) dev; | 125 | struct net_local *lp = (struct net_local *) dev; |
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 57bf4bf50278..90b56ed8651f 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -176,7 +176,8 @@ static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp) | |||
176 | /* Prototypes */ | 176 | /* Prototypes */ |
177 | 177 | ||
178 | static int isdn_net_force_dial_lp(isdn_net_local *); | 178 | static int isdn_net_force_dial_lp(isdn_net_local *); |
179 | static int isdn_net_start_xmit(struct sk_buff *, struct net_device *); | 179 | static netdev_tx_t isdn_net_start_xmit(struct sk_buff *, |
180 | struct net_device *); | ||
180 | 181 | ||
181 | static void isdn_net_ciscohdlck_connected(isdn_net_local *lp); | 182 | static void isdn_net_ciscohdlck_connected(isdn_net_local *lp); |
182 | static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp); | 183 | static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp); |
@@ -1160,7 +1161,7 @@ static void isdn_net_tx_timeout(struct net_device * ndev) | |||
1160 | * If this interface isn't connected to a ISDN-Channel, find a free channel, | 1161 | * If this interface isn't connected to a ISDN-Channel, find a free channel, |
1161 | * and start dialing. | 1162 | * and start dialing. |
1162 | */ | 1163 | */ |
1163 | static int | 1164 | static netdev_tx_t |
1164 | isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev) | 1165 | isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev) |
1165 | { | 1166 | { |
1166 | isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev); | 1167 | isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev); |
diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c index e29fb1a4a611..f60309175ef5 100644 --- a/drivers/net/3c501.c +++ b/drivers/net/3c501.c | |||
@@ -409,7 +409,7 @@ static void el_timeout(struct net_device *dev) | |||
409 | * no real choice. | 409 | * no real choice. |
410 | */ | 410 | */ |
411 | 411 | ||
412 | static int el_start_xmit(struct sk_buff *skb, struct net_device *dev) | 412 | static netdev_tx_t el_start_xmit(struct sk_buff *skb, struct net_device *dev) |
413 | { | 413 | { |
414 | struct net_local *lp = netdev_priv(dev); | 414 | struct net_local *lp = netdev_priv(dev); |
415 | int ioaddr = dev->base_addr; | 415 | int ioaddr = dev->base_addr; |
diff --git a/drivers/net/3c501.h b/drivers/net/3c501.h index f40b0493337a..183fd55f03cb 100644 --- a/drivers/net/3c501.h +++ b/drivers/net/3c501.h | |||
@@ -6,7 +6,7 @@ | |||
6 | static int el1_probe1(struct net_device *dev, int ioaddr); | 6 | static int el1_probe1(struct net_device *dev, int ioaddr); |
7 | static int el_open(struct net_device *dev); | 7 | static int el_open(struct net_device *dev); |
8 | static void el_timeout(struct net_device *dev); | 8 | static void el_timeout(struct net_device *dev); |
9 | static int el_start_xmit(struct sk_buff *skb, struct net_device *dev); | 9 | static netdev_tx_t el_start_xmit(struct sk_buff *skb, struct net_device *dev); |
10 | static irqreturn_t el_interrupt(int irq, void *dev_id); | 10 | static irqreturn_t el_interrupt(int irq, void *dev_id); |
11 | static void el_receive(struct net_device *dev); | 11 | static void el_receive(struct net_device *dev); |
12 | static void el_reset(struct net_device *dev); | 12 | static void el_reset(struct net_device *dev); |
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c index 7bba480d7220..a21c9d15ef8a 100644 --- a/drivers/net/3c505.c +++ b/drivers/net/3c505.c | |||
@@ -976,7 +976,7 @@ static int elp_open(struct net_device *dev) | |||
976 | * | 976 | * |
977 | ******************************************************/ | 977 | ******************************************************/ |
978 | 978 | ||
979 | static bool send_packet(struct net_device *dev, struct sk_buff *skb) | 979 | static netdev_tx_t send_packet(struct net_device *dev, struct sk_buff *skb) |
980 | { | 980 | { |
981 | elp_device *adapter = netdev_priv(dev); | 981 | elp_device *adapter = netdev_priv(dev); |
982 | unsigned long target; | 982 | unsigned long target; |
@@ -1067,7 +1067,7 @@ static void elp_timeout(struct net_device *dev) | |||
1067 | * | 1067 | * |
1068 | ******************************************************/ | 1068 | ******************************************************/ |
1069 | 1069 | ||
1070 | static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1070 | static netdev_tx_t elp_start_xmit(struct sk_buff *skb, struct net_device *dev) |
1071 | { | 1071 | { |
1072 | unsigned long flags; | 1072 | unsigned long flags; |
1073 | elp_device *adapter = netdev_priv(dev); | 1073 | elp_device *adapter = netdev_priv(dev); |
diff --git a/drivers/net/3c507.c b/drivers/net/3c507.c index 9e93a0b39b6e..a6dc8bcbc7df 100644 --- a/drivers/net/3c507.c +++ b/drivers/net/3c507.c | |||
@@ -284,7 +284,8 @@ static unsigned short init_words[] = { | |||
284 | 284 | ||
285 | static int el16_probe1(struct net_device *dev, int ioaddr); | 285 | static int el16_probe1(struct net_device *dev, int ioaddr); |
286 | static int el16_open(struct net_device *dev); | 286 | static int el16_open(struct net_device *dev); |
287 | static int el16_send_packet(struct sk_buff *skb, struct net_device *dev); | 287 | static netdev_tx_t el16_send_packet(struct sk_buff *skb, |
288 | struct net_device *dev); | ||
288 | static irqreturn_t el16_interrupt(int irq, void *dev_id); | 289 | static irqreturn_t el16_interrupt(int irq, void *dev_id); |
289 | static void el16_rx(struct net_device *dev); | 290 | static void el16_rx(struct net_device *dev); |
290 | static int el16_close(struct net_device *dev); | 291 | static int el16_close(struct net_device *dev); |
@@ -509,7 +510,8 @@ static void el16_tx_timeout (struct net_device *dev) | |||
509 | } | 510 | } |
510 | 511 | ||
511 | 512 | ||
512 | static int el16_send_packet (struct sk_buff *skb, struct net_device *dev) | 513 | static netdev_tx_t el16_send_packet (struct sk_buff *skb, |
514 | struct net_device *dev) | ||
513 | { | 515 | { |
514 | struct net_local *lp = netdev_priv(dev); | 516 | struct net_local *lp = netdev_priv(dev); |
515 | int ioaddr = dev->base_addr; | 517 | int ioaddr = dev->base_addr; |
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index d2515d840c00..3b00a4e927aa 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -191,7 +191,7 @@ static void el3_common_remove(struct net_device *dev); | |||
191 | static ushort id_read_eeprom(int index); | 191 | static ushort id_read_eeprom(int index); |
192 | static ushort read_eeprom(int ioaddr, int index); | 192 | static ushort read_eeprom(int ioaddr, int index); |
193 | static int el3_open(struct net_device *dev); | 193 | static int el3_open(struct net_device *dev); |
194 | static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev); | 194 | static netdev_tx_t el3_start_xmit(struct sk_buff *skb, struct net_device *dev); |
195 | static irqreturn_t el3_interrupt(int irq, void *dev_id); | 195 | static irqreturn_t el3_interrupt(int irq, void *dev_id); |
196 | static void update_stats(struct net_device *dev); | 196 | static void update_stats(struct net_device *dev); |
197 | static struct net_device_stats *el3_get_stats(struct net_device *dev); | 197 | static struct net_device_stats *el3_get_stats(struct net_device *dev); |
@@ -816,7 +816,7 @@ el3_tx_timeout (struct net_device *dev) | |||
816 | } | 816 | } |
817 | 817 | ||
818 | 818 | ||
819 | static int | 819 | static netdev_tx_t |
820 | el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | 820 | el3_start_xmit(struct sk_buff *skb, struct net_device *dev) |
821 | { | 821 | { |
822 | struct el3_private *lp = netdev_priv(dev); | 822 | struct el3_private *lp = netdev_priv(dev); |
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c index 3116410b3499..4adcb950f5f1 100644 --- a/drivers/net/3c515.c +++ b/drivers/net/3c515.c | |||
@@ -369,8 +369,8 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr, | |||
369 | struct pnp_dev *idev, int card_number); | 369 | struct pnp_dev *idev, int card_number); |
370 | static int corkscrew_open(struct net_device *dev); | 370 | static int corkscrew_open(struct net_device *dev); |
371 | static void corkscrew_timer(unsigned long arg); | 371 | static void corkscrew_timer(unsigned long arg); |
372 | static int corkscrew_start_xmit(struct sk_buff *skb, | 372 | static netdev_tx_t corkscrew_start_xmit(struct sk_buff *skb, |
373 | struct net_device *dev); | 373 | struct net_device *dev); |
374 | static int corkscrew_rx(struct net_device *dev); | 374 | static int corkscrew_rx(struct net_device *dev); |
375 | static void corkscrew_timeout(struct net_device *dev); | 375 | static void corkscrew_timeout(struct net_device *dev); |
376 | static int boomerang_rx(struct net_device *dev); | 376 | static int boomerang_rx(struct net_device *dev); |
@@ -998,8 +998,8 @@ static void corkscrew_timeout(struct net_device *dev) | |||
998 | netif_wake_queue(dev); | 998 | netif_wake_queue(dev); |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | static int corkscrew_start_xmit(struct sk_buff *skb, | 1001 | static netdev_tx_t corkscrew_start_xmit(struct sk_buff *skb, |
1002 | struct net_device *dev) | 1002 | struct net_device *dev) |
1003 | { | 1003 | { |
1004 | struct corkscrew_private *vp = netdev_priv(dev); | 1004 | struct corkscrew_private *vp = netdev_priv(dev); |
1005 | int ioaddr = dev->base_addr; | 1005 | int ioaddr = dev->base_addr; |
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index 70c701b80d99..cb0b730799ba 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c | |||
@@ -183,7 +183,7 @@ sizeof(nop_cmd) = 8; | |||
183 | static irqreturn_t elmc_interrupt(int irq, void *dev_id); | 183 | static irqreturn_t elmc_interrupt(int irq, void *dev_id); |
184 | static int elmc_open(struct net_device *dev); | 184 | static int elmc_open(struct net_device *dev); |
185 | static int elmc_close(struct net_device *dev); | 185 | static int elmc_close(struct net_device *dev); |
186 | static int elmc_send_packet(struct sk_buff *, struct net_device *); | 186 | static netdev_tx_t elmc_send_packet(struct sk_buff *, struct net_device *); |
187 | static struct net_device_stats *elmc_get_stats(struct net_device *dev); | 187 | static struct net_device_stats *elmc_get_stats(struct net_device *dev); |
188 | static void elmc_timeout(struct net_device *dev); | 188 | static void elmc_timeout(struct net_device *dev); |
189 | #ifdef ELMC_MULTICAST | 189 | #ifdef ELMC_MULTICAST |
@@ -1129,7 +1129,7 @@ static void elmc_timeout(struct net_device *dev) | |||
1129 | * send frame | 1129 | * send frame |
1130 | */ | 1130 | */ |
1131 | 1131 | ||
1132 | static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev) | 1132 | static netdev_tx_t elmc_send_packet(struct sk_buff *skb, struct net_device *dev) |
1133 | { | 1133 | { |
1134 | int len; | 1134 | int len; |
1135 | int i; | 1135 | int i; |
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index 72b9ed7f4641..6021e6dded8f 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c | |||
@@ -213,7 +213,8 @@ static int mc32_probe1(struct net_device *dev, int ioaddr); | |||
213 | static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len); | 213 | static int mc32_command(struct net_device *dev, u16 cmd, void *data, int len); |
214 | static int mc32_open(struct net_device *dev); | 214 | static int mc32_open(struct net_device *dev); |
215 | static void mc32_timeout(struct net_device *dev); | 215 | static void mc32_timeout(struct net_device *dev); |
216 | static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev); | 216 | static netdev_tx_t mc32_send_packet(struct sk_buff *skb, |
217 | struct net_device *dev); | ||
217 | static irqreturn_t mc32_interrupt(int irq, void *dev_id); | 218 | static irqreturn_t mc32_interrupt(int irq, void *dev_id); |
218 | static int mc32_close(struct net_device *dev); | 219 | static int mc32_close(struct net_device *dev); |
219 | static struct net_device_stats *mc32_get_stats(struct net_device *dev); | 220 | static struct net_device_stats *mc32_get_stats(struct net_device *dev); |
@@ -1020,7 +1021,8 @@ static void mc32_timeout(struct net_device *dev) | |||
1020 | * | 1021 | * |
1021 | */ | 1022 | */ |
1022 | 1023 | ||
1023 | static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev) | 1024 | static netdev_tx_t mc32_send_packet(struct sk_buff *skb, |
1025 | struct net_device *dev) | ||
1024 | { | 1026 | { |
1025 | struct mc32_local *lp = netdev_priv(dev); | 1027 | struct mc32_local *lp = netdev_priv(dev); |
1026 | u32 head = atomic_read(&lp->tx_ring_head); | 1028 | u32 head = atomic_read(&lp->tx_ring_head); |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index beb040264dbd..7adff4d0960d 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -716,8 +716,10 @@ static int mdio_read(struct net_device *dev, int phy_id, int location); | |||
716 | static void mdio_write(struct net_device *vp, int phy_id, int location, int value); | 716 | static void mdio_write(struct net_device *vp, int phy_id, int location, int value); |
717 | static void vortex_timer(unsigned long arg); | 717 | static void vortex_timer(unsigned long arg); |
718 | static void rx_oom_timer(unsigned long arg); | 718 | static void rx_oom_timer(unsigned long arg); |
719 | static int vortex_start_xmit(struct sk_buff *skb, struct net_device *dev); | 719 | static netdev_tx_t vortex_start_xmit(struct sk_buff *skb, |
720 | static int boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev); | 720 | struct net_device *dev); |
721 | static netdev_tx_t boomerang_start_xmit(struct sk_buff *skb, | ||
722 | struct net_device *dev); | ||
721 | static int vortex_rx(struct net_device *dev); | 723 | static int vortex_rx(struct net_device *dev); |
722 | static int boomerang_rx(struct net_device *dev); | 724 | static int boomerang_rx(struct net_device *dev); |
723 | static irqreturn_t vortex_interrupt(int irq, void *dev_id); | 725 | static irqreturn_t vortex_interrupt(int irq, void *dev_id); |
@@ -2035,7 +2037,7 @@ vortex_error(struct net_device *dev, int status) | |||
2035 | } | 2037 | } |
2036 | } | 2038 | } |
2037 | 2039 | ||
2038 | static int | 2040 | static netdev_tx_t |
2039 | vortex_start_xmit(struct sk_buff *skb, struct net_device *dev) | 2041 | vortex_start_xmit(struct sk_buff *skb, struct net_device *dev) |
2040 | { | 2042 | { |
2041 | struct vortex_private *vp = netdev_priv(dev); | 2043 | struct vortex_private *vp = netdev_priv(dev); |
@@ -2090,7 +2092,7 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2090 | return NETDEV_TX_OK; | 2092 | return NETDEV_TX_OK; |
2091 | } | 2093 | } |
2092 | 2094 | ||
2093 | static int | 2095 | static netdev_tx_t |
2094 | boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) | 2096 | boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) |
2095 | { | 2097 | { |
2096 | struct vortex_private *vp = netdev_priv(dev); | 2098 | struct vortex_private *vp = netdev_priv(dev); |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 4a8995aaeca3..462d9f59c53a 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -736,7 +736,8 @@ static void cp_tx (struct cp_private *cp) | |||
736 | netif_wake_queue(cp->dev); | 736 | netif_wake_queue(cp->dev); |
737 | } | 737 | } |
738 | 738 | ||
739 | static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) | 739 | static netdev_tx_t cp_start_xmit (struct sk_buff *skb, |
740 | struct net_device *dev) | ||
740 | { | 741 | { |
741 | struct cp_private *cp = netdev_priv(dev); | 742 | struct cp_private *cp = netdev_priv(dev); |
742 | unsigned entry; | 743 | unsigned entry; |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index b39ec98345ea..4a3628755026 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -628,8 +628,8 @@ static void mdio_write (struct net_device *dev, int phy_id, int location, | |||
628 | static void rtl8139_start_thread(struct rtl8139_private *tp); | 628 | static void rtl8139_start_thread(struct rtl8139_private *tp); |
629 | static void rtl8139_tx_timeout (struct net_device *dev); | 629 | static void rtl8139_tx_timeout (struct net_device *dev); |
630 | static void rtl8139_init_ring (struct net_device *dev); | 630 | static void rtl8139_init_ring (struct net_device *dev); |
631 | static int rtl8139_start_xmit (struct sk_buff *skb, | 631 | static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb, |
632 | struct net_device *dev); | 632 | struct net_device *dev); |
633 | #ifdef CONFIG_NET_POLL_CONTROLLER | 633 | #ifdef CONFIG_NET_POLL_CONTROLLER |
634 | static void rtl8139_poll_controller(struct net_device *dev); | 634 | static void rtl8139_poll_controller(struct net_device *dev); |
635 | #endif | 635 | #endif |
@@ -1687,7 +1687,8 @@ static void rtl8139_tx_timeout (struct net_device *dev) | |||
1687 | } | 1687 | } |
1688 | } | 1688 | } |
1689 | 1689 | ||
1690 | static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) | 1690 | static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb, |
1691 | struct net_device *dev) | ||
1691 | { | 1692 | { |
1692 | struct rtl8139_private *tp = netdev_priv(dev); | 1693 | struct rtl8139_private *tp = netdev_priv(dev); |
1693 | void __iomem *ioaddr = tp->mmio_addr; | 1694 | void __iomem *ioaddr = tp->mmio_addr; |
diff --git a/drivers/net/82596.c b/drivers/net/82596.c index 996cc9102215..ea6b139b812c 100644 --- a/drivers/net/82596.c +++ b/drivers/net/82596.c | |||
@@ -356,7 +356,7 @@ static char init_setup[] = | |||
356 | 0x7f /* *multi IA */ }; | 356 | 0x7f /* *multi IA */ }; |
357 | 357 | ||
358 | static int i596_open(struct net_device *dev); | 358 | static int i596_open(struct net_device *dev); |
359 | static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev); | 359 | static netdev_tx_t i596_start_xmit(struct sk_buff *skb, struct net_device *dev); |
360 | static irqreturn_t i596_interrupt(int irq, void *dev_id); | 360 | static irqreturn_t i596_interrupt(int irq, void *dev_id); |
361 | static int i596_close(struct net_device *dev); | 361 | static int i596_close(struct net_device *dev); |
362 | static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd); | 362 | static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd); |
@@ -1054,8 +1054,7 @@ static void i596_tx_timeout (struct net_device *dev) | |||
1054 | netif_wake_queue (dev); | 1054 | netif_wake_queue (dev); |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | 1057 | static netdev_tx_t i596_start_xmit(struct sk_buff *skb, struct net_device *dev) | |
1058 | static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev) | ||
1059 | { | 1058 | { |
1060 | struct i596_private *lp = dev->ml_priv; | 1059 | struct i596_private *lp = dev->ml_priv; |
1061 | struct tx_cmd *tx_cmd; | 1060 | struct tx_cmd *tx_cmd; |
diff --git a/drivers/net/8390.c b/drivers/net/8390.c index 21153dea8ebe..7c7518be1756 100644 --- a/drivers/net/8390.c +++ b/drivers/net/8390.c | |||
@@ -17,7 +17,7 @@ int ei_close(struct net_device *dev) | |||
17 | } | 17 | } |
18 | EXPORT_SYMBOL(ei_close); | 18 | EXPORT_SYMBOL(ei_close); |
19 | 19 | ||
20 | int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) | 20 | netdev_tx_t ei_start_xmit(struct sk_buff *skb, struct net_device *dev) |
21 | { | 21 | { |
22 | return __ei_start_xmit(skb, dev); | 22 | return __ei_start_xmit(skb, dev); |
23 | } | 23 | } |
diff --git a/drivers/net/8390.h b/drivers/net/8390.h index 3c61d6d2748a..3d9e8fb4fbee 100644 --- a/drivers/net/8390.h +++ b/drivers/net/8390.h | |||
@@ -40,7 +40,7 @@ extern int ei_open(struct net_device *dev); | |||
40 | extern int ei_close(struct net_device *dev); | 40 | extern int ei_close(struct net_device *dev); |
41 | extern irqreturn_t ei_interrupt(int irq, void *dev_id); | 41 | extern irqreturn_t ei_interrupt(int irq, void *dev_id); |
42 | extern void ei_tx_timeout(struct net_device *dev); | 42 | extern void ei_tx_timeout(struct net_device *dev); |
43 | extern int ei_start_xmit(struct sk_buff *skb, struct net_device *dev); | 43 | extern netdev_tx_t ei_start_xmit(struct sk_buff *skb, struct net_device *dev); |
44 | extern void ei_set_multicast_list(struct net_device *dev); | 44 | extern void ei_set_multicast_list(struct net_device *dev); |
45 | extern struct net_device_stats *ei_get_stats(struct net_device *dev); | 45 | extern struct net_device_stats *ei_get_stats(struct net_device *dev); |
46 | 46 | ||
@@ -58,7 +58,7 @@ extern int eip_open(struct net_device *dev); | |||
58 | extern int eip_close(struct net_device *dev); | 58 | extern int eip_close(struct net_device *dev); |
59 | extern irqreturn_t eip_interrupt(int irq, void *dev_id); | 59 | extern irqreturn_t eip_interrupt(int irq, void *dev_id); |
60 | extern void eip_tx_timeout(struct net_device *dev); | 60 | extern void eip_tx_timeout(struct net_device *dev); |
61 | extern int eip_start_xmit(struct sk_buff *skb, struct net_device *dev); | 61 | extern netdev_tx_t eip_start_xmit(struct sk_buff *skb, struct net_device *dev); |
62 | extern void eip_set_multicast_list(struct net_device *dev); | 62 | extern void eip_set_multicast_list(struct net_device *dev); |
63 | extern struct net_device_stats *eip_get_stats(struct net_device *dev); | 63 | extern struct net_device_stats *eip_get_stats(struct net_device *dev); |
64 | 64 | ||
diff --git a/drivers/net/8390p.c b/drivers/net/8390p.c index d225c291fd93..a2a64ea0b691 100644 --- a/drivers/net/8390p.c +++ b/drivers/net/8390p.c | |||
@@ -22,7 +22,7 @@ int eip_close(struct net_device *dev) | |||
22 | } | 22 | } |
23 | EXPORT_SYMBOL(eip_close); | 23 | EXPORT_SYMBOL(eip_close); |
24 | 24 | ||
25 | int eip_start_xmit(struct sk_buff *skb, struct net_device *dev) | 25 | netdev_tx_t eip_start_xmit(struct sk_buff *skb, struct net_device *dev) |
26 | { | 26 | { |
27 | return __ei_start_xmit(skb, dev); | 27 | return __ei_start_xmit(skb, dev); |
28 | } | 28 | } |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index fed9bdaecfa2..21333c18f344 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1727,12 +1727,14 @@ config KS8842 | |||
1727 | tristate "Micrel KSZ8842" | 1727 | tristate "Micrel KSZ8842" |
1728 | depends on HAS_IOMEM | 1728 | depends on HAS_IOMEM |
1729 | help | 1729 | help |
1730 | This platform driver is for Micrel KSZ8842 chip. | 1730 | This platform driver is for Micrel KSZ8842 / KS8842 |
1731 | 2-port ethernet switch chip (managed, VLAN, QoS). | ||
1731 | 1732 | ||
1732 | config KS8851 | 1733 | config KS8851 |
1733 | tristate "Micrel KS8851 SPI" | 1734 | tristate "Micrel KS8851 SPI" |
1734 | depends on SPI | 1735 | depends on SPI |
1735 | select MII | 1736 | select MII |
1737 | select CRC32 | ||
1736 | help | 1738 | help |
1737 | SPI driver for Micrel KS8851 SPI attached network chip. | 1739 | SPI driver for Micrel KS8851 SPI attached network chip. |
1738 | 1740 | ||
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index 174a81187a95..b7ec0368d7e8 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c | |||
@@ -547,7 +547,8 @@ static void lance_tx_timeout(struct net_device *dev) | |||
547 | netif_wake_queue(dev); | 547 | netif_wake_queue(dev); |
548 | } | 548 | } |
549 | 549 | ||
550 | static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | 550 | static netdev_tx_t lance_start_xmit (struct sk_buff *skb, |
551 | struct net_device *dev) | ||
551 | { | 552 | { |
552 | struct lance_private *lp = netdev_priv(dev); | 553 | struct lance_private *lp = netdev_priv(dev); |
553 | volatile struct lance_regs *ll = lp->ll; | 554 | volatile struct lance_regs *ll = lp->ll; |
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 08419ee10290..5f0b05c2d71f 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -2464,7 +2464,8 @@ ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr, | |||
2464 | } | 2464 | } |
2465 | 2465 | ||
2466 | 2466 | ||
2467 | static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev) | 2467 | static netdev_tx_t ace_start_xmit(struct sk_buff *skb, |
2468 | struct net_device *dev) | ||
2468 | { | 2469 | { |
2469 | struct ace_private *ap = netdev_priv(dev); | 2470 | struct ace_private *ap = netdev_priv(dev); |
2470 | struct ace_regs __iomem *regs = ap->regs; | 2471 | struct ace_regs __iomem *regs = ap->regs; |
diff --git a/drivers/net/acenic.h b/drivers/net/acenic.h index c987c9b5a137..17079b927ffa 100644 --- a/drivers/net/acenic.h +++ b/drivers/net/acenic.h | |||
@@ -775,7 +775,8 @@ static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs); | |||
775 | static irqreturn_t ace_interrupt(int irq, void *dev_id); | 775 | static irqreturn_t ace_interrupt(int irq, void *dev_id); |
776 | static int ace_load_firmware(struct net_device *dev); | 776 | static int ace_load_firmware(struct net_device *dev); |
777 | static int ace_open(struct net_device *dev); | 777 | static int ace_open(struct net_device *dev); |
778 | static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev); | 778 | static netdev_tx_t ace_start_xmit(struct sk_buff *skb, |
779 | struct net_device *dev); | ||
779 | static int ace_close(struct net_device *dev); | 780 | static int ace_close(struct net_device *dev); |
780 | static void ace_tasklet(unsigned long dev); | 781 | static void ace_tasklet(unsigned long dev); |
781 | static void ace_dump_trace(struct ace_private *ap); | 782 | static void ace_dump_trace(struct ace_private *ap); |
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index 61ac671f97bf..98b5f462c092 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -1300,7 +1300,8 @@ static int amd8111e_tx_queue_avail(struct amd8111e_priv* lp ) | |||
1300 | 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. | 1300 | 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. |
1301 | */ | 1301 | */ |
1302 | 1302 | ||
1303 | static int amd8111e_start_xmit(struct sk_buff *skb, struct net_device * dev) | 1303 | static netdev_tx_t amd8111e_start_xmit(struct sk_buff *skb, |
1304 | struct net_device * dev) | ||
1304 | { | 1305 | { |
1305 | struct amd8111e_priv *lp = netdev_priv(dev); | 1306 | struct amd8111e_priv *lp = netdev_priv(dev); |
1306 | int tx_index; | 1307 | int tx_index; |
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c index 29b279f88efb..b5dc7f550725 100644 --- a/drivers/net/appletalk/cops.c +++ b/drivers/net/appletalk/cops.c | |||
@@ -192,7 +192,8 @@ static irqreturn_t cops_interrupt (int irq, void *dev_id); | |||
192 | static void cops_poll (unsigned long ltdev); | 192 | static void cops_poll (unsigned long ltdev); |
193 | static void cops_timeout(struct net_device *dev); | 193 | static void cops_timeout(struct net_device *dev); |
194 | static void cops_rx (struct net_device *dev); | 194 | static void cops_rx (struct net_device *dev); |
195 | static int cops_send_packet (struct sk_buff *skb, struct net_device *dev); | 195 | static netdev_tx_t cops_send_packet (struct sk_buff *skb, |
196 | struct net_device *dev); | ||
196 | static void set_multicast_list (struct net_device *dev); | 197 | static void set_multicast_list (struct net_device *dev); |
197 | static int cops_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); | 198 | static int cops_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); |
198 | static int cops_close (struct net_device *dev); | 199 | static int cops_close (struct net_device *dev); |
@@ -875,7 +876,8 @@ static void cops_timeout(struct net_device *dev) | |||
875 | * Make the card transmit a LocalTalk packet. | 876 | * Make the card transmit a LocalTalk packet. |
876 | */ | 877 | */ |
877 | 878 | ||
878 | static int cops_send_packet(struct sk_buff *skb, struct net_device *dev) | 879 | static netdev_tx_t cops_send_packet(struct sk_buff *skb, |
880 | struct net_device *dev) | ||
879 | { | 881 | { |
880 | struct cops_local *lp = netdev_priv(dev); | 882 | struct cops_local *lp = netdev_priv(dev); |
881 | int ioaddr = dev->base_addr; | 883 | int ioaddr = dev->base_addr; |
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c index 6cfd961bb8de..bea87da97e34 100644 --- a/drivers/net/appletalk/ipddp.c +++ b/drivers/net/appletalk/ipddp.c | |||
@@ -48,7 +48,8 @@ static int ipddp_mode = IPDDP_DECAP; | |||
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | /* Index to functions, as function prototypes. */ | 50 | /* Index to functions, as function prototypes. */ |
51 | static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev); | 51 | static netdev_tx_t ipddp_xmit(struct sk_buff *skb, |
52 | struct net_device *dev); | ||
52 | static int ipddp_create(struct ipddp_route *new_rt); | 53 | static int ipddp_create(struct ipddp_route *new_rt); |
53 | static int ipddp_delete(struct ipddp_route *rt); | 54 | static int ipddp_delete(struct ipddp_route *rt); |
54 | static struct ipddp_route* __ipddp_find_route(struct ipddp_route *rt); | 55 | static struct ipddp_route* __ipddp_find_route(struct ipddp_route *rt); |
@@ -113,7 +114,7 @@ static struct net_device * __init ipddp_init(void) | |||
113 | /* | 114 | /* |
114 | * Transmit LLAP/ELAP frame using aarp_send_ddp. | 115 | * Transmit LLAP/ELAP frame using aarp_send_ddp. |
115 | */ | 116 | */ |
116 | static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev) | 117 | static netdev_tx_t ipddp_xmit(struct sk_buff *skb, struct net_device *dev) |
117 | { | 118 | { |
118 | __be32 paddr = skb_rtable(skb)->rt_gateway; | 119 | __be32 paddr = skb_rtable(skb)->rt_gateway; |
119 | struct ddpehdr *ddp; | 120 | struct ddpehdr *ddp; |
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c index c80fb9cf8ffa..08760baece7a 100644 --- a/drivers/net/appletalk/ltpc.c +++ b/drivers/net/appletalk/ltpc.c | |||
@@ -697,7 +697,7 @@ static int do_read(struct net_device *dev, void *cbuf, int cbuflen, | |||
697 | 697 | ||
698 | static struct timer_list ltpc_timer; | 698 | static struct timer_list ltpc_timer; |
699 | 699 | ||
700 | static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev); | 700 | static netdev_tx_t ltpc_xmit(struct sk_buff *skb, struct net_device *dev); |
701 | 701 | ||
702 | static int read_30 ( struct net_device *dev) | 702 | static int read_30 ( struct net_device *dev) |
703 | { | 703 | { |
@@ -895,7 +895,7 @@ static void ltpc_poll(unsigned long l) | |||
895 | 895 | ||
896 | /* DDP to LLAP translation */ | 896 | /* DDP to LLAP translation */ |
897 | 897 | ||
898 | static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev) | 898 | static netdev_tx_t ltpc_xmit(struct sk_buff *skb, struct net_device *dev) |
899 | { | 899 | { |
900 | /* in kernel 1.3.xx, on entry skb->data points to ddp header, | 900 | /* in kernel 1.3.xx, on entry skb->data points to ddp header, |
901 | * and skb->len is the length of the ddp data + ddp header | 901 | * and skb->len is the length of the ddp data + ddp header |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index 7d227cdab9f8..75a572560909 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -591,7 +591,8 @@ static int arcnet_rebuild_header(struct sk_buff *skb) | |||
591 | 591 | ||
592 | 592 | ||
593 | /* Called by the kernel in order to transmit a packet. */ | 593 | /* Called by the kernel in order to transmit a packet. */ |
594 | int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev) | 594 | netdev_tx_t arcnet_send_packet(struct sk_buff *skb, |
595 | struct net_device *dev) | ||
595 | { | 596 | { |
596 | struct arcnet_local *lp = netdev_priv(dev); | 597 | struct arcnet_local *lp = netdev_priv(dev); |
597 | struct archdr *pkt; | 598 | struct archdr *pkt; |
diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c index 47d976cc3d7d..c35af3e106b1 100644 --- a/drivers/net/ariadne.c +++ b/drivers/net/ariadne.c | |||
@@ -115,7 +115,8 @@ struct lancedata { | |||
115 | 115 | ||
116 | static int ariadne_open(struct net_device *dev); | 116 | static int ariadne_open(struct net_device *dev); |
117 | static void ariadne_init_ring(struct net_device *dev); | 117 | static void ariadne_init_ring(struct net_device *dev); |
118 | static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev); | 118 | static netdev_tx_t ariadne_start_xmit(struct sk_buff *skb, |
119 | struct net_device *dev); | ||
119 | static void ariadne_tx_timeout(struct net_device *dev); | 120 | static void ariadne_tx_timeout(struct net_device *dev); |
120 | static int ariadne_rx(struct net_device *dev); | 121 | static int ariadne_rx(struct net_device *dev); |
121 | static void ariadne_reset(struct net_device *dev); | 122 | static void ariadne_reset(struct net_device *dev); |
@@ -589,7 +590,8 @@ static void ariadne_tx_timeout(struct net_device *dev) | |||
589 | } | 590 | } |
590 | 591 | ||
591 | 592 | ||
592 | static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev) | 593 | static netdev_tx_t ariadne_start_xmit(struct sk_buff *skb, |
594 | struct net_device *dev) | ||
593 | { | 595 | { |
594 | struct ariadne_private *priv = netdev_priv(dev); | 596 | struct ariadne_private *priv = netdev_priv(dev); |
595 | volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr; | 597 | volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr; |
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c index fbf4645417d4..2be49c817995 100644 --- a/drivers/net/arm/ep93xx_eth.c +++ b/drivers/net/arm/ep93xx_eth.c | |||
@@ -762,7 +762,7 @@ static u32 ep93xx_get_link(struct net_device *dev) | |||
762 | return mii_link_ok(&ep->mii); | 762 | return mii_link_ok(&ep->mii); |
763 | } | 763 | } |
764 | 764 | ||
765 | static struct ethtool_ops ep93xx_ethtool_ops = { | 765 | static const struct ethtool_ops ep93xx_ethtool_ops = { |
766 | .get_drvinfo = ep93xx_get_drvinfo, | 766 | .get_drvinfo = ep93xx_get_drvinfo, |
767 | .get_settings = ep93xx_get_settings, | 767 | .get_settings = ep93xx_get_settings, |
768 | .set_settings = ep93xx_set_settings, | 768 | .set_settings = ep93xx_set_settings, |
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index 3fe09876e76d..691b81eb0f46 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c | |||
@@ -802,7 +802,7 @@ static int ixp4xx_nway_reset(struct net_device *dev) | |||
802 | return phy_start_aneg(port->phydev); | 802 | return phy_start_aneg(port->phydev); |
803 | } | 803 | } |
804 | 804 | ||
805 | static struct ethtool_ops ixp4xx_ethtool_ops = { | 805 | static const struct ethtool_ops ixp4xx_ethtool_ops = { |
806 | .get_drvinfo = ixp4xx_get_drvinfo, | 806 | .get_drvinfo = ixp4xx_get_drvinfo, |
807 | .get_settings = ixp4xx_get_settings, | 807 | .get_settings = ixp4xx_get_settings, |
808 | .set_settings = ixp4xx_set_settings, | 808 | .set_settings = ixp4xx_set_settings, |
diff --git a/drivers/net/arm/ks8695net.c b/drivers/net/arm/ks8695net.c index 35cd264abae7..4f702d52606a 100644 --- a/drivers/net/arm/ks8695net.c +++ b/drivers/net/arm/ks8695net.c | |||
@@ -1063,7 +1063,7 @@ ks8695_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo *info) | |||
1063 | sizeof(info->bus_info)); | 1063 | sizeof(info->bus_info)); |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | static struct ethtool_ops ks8695_ethtool_ops = { | 1066 | static const struct ethtool_ops ks8695_ethtool_ops = { |
1067 | .get_msglevel = ks8695_get_msglevel, | 1067 | .get_msglevel = ks8695_get_msglevel, |
1068 | .set_msglevel = ks8695_set_msglevel, | 1068 | .set_msglevel = ks8695_set_msglevel, |
1069 | .get_settings = ks8695_get_settings, | 1069 | .get_settings = ks8695_get_settings, |
diff --git a/drivers/net/arm/w90p910_ether.c b/drivers/net/arm/w90p910_ether.c index 890716f6c018..3a0948f02b46 100644 --- a/drivers/net/arm/w90p910_ether.c +++ b/drivers/net/arm/w90p910_ether.c | |||
@@ -1098,7 +1098,7 @@ static struct platform_driver w90p910_ether_driver = { | |||
1098 | .probe = w90p910_ether_probe, | 1098 | .probe = w90p910_ether_probe, |
1099 | .remove = __devexit_p(w90p910_ether_remove), | 1099 | .remove = __devexit_p(w90p910_ether_remove), |
1100 | .driver = { | 1100 | .driver = { |
1101 | .name = "w90p910-emc", | 1101 | .name = "nuc900-emc", |
1102 | .owner = THIS_MODULE, | 1102 | .owner = THIS_MODULE, |
1103 | }, | 1103 | }, |
1104 | }; | 1104 | }; |
@@ -1119,5 +1119,5 @@ module_exit(w90p910_ether_exit); | |||
1119 | MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); | 1119 | MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); |
1120 | MODULE_DESCRIPTION("w90p910 MAC driver!"); | 1120 | MODULE_DESCRIPTION("w90p910 MAC driver!"); |
1121 | MODULE_LICENSE("GPL"); | 1121 | MODULE_LICENSE("GPL"); |
1122 | MODULE_ALIAS("platform:w90p910-emc"); | 1122 | MODULE_ALIAS("platform:nuc900-emc"); |
1123 | 1123 | ||
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c index 5349c58d1fae..544d5af6950e 100644 --- a/drivers/net/at1700.c +++ b/drivers/net/at1700.c | |||
@@ -159,7 +159,8 @@ struct net_local { | |||
159 | static int at1700_probe1(struct net_device *dev, int ioaddr); | 159 | static int at1700_probe1(struct net_device *dev, int ioaddr); |
160 | static int read_eeprom(long ioaddr, int location); | 160 | static int read_eeprom(long ioaddr, int location); |
161 | static int net_open(struct net_device *dev); | 161 | static int net_open(struct net_device *dev); |
162 | static int net_send_packet(struct sk_buff *skb, struct net_device *dev); | 162 | static netdev_tx_t net_send_packet(struct sk_buff *skb, |
163 | struct net_device *dev); | ||
163 | static irqreturn_t net_interrupt(int irq, void *dev_id); | 164 | static irqreturn_t net_interrupt(int irq, void *dev_id); |
164 | static void net_rx(struct net_device *dev); | 165 | static void net_rx(struct net_device *dev); |
165 | static int net_close(struct net_device *dev); | 166 | static int net_close(struct net_device *dev); |
@@ -595,7 +596,8 @@ static void net_tx_timeout (struct net_device *dev) | |||
595 | } | 596 | } |
596 | 597 | ||
597 | 598 | ||
598 | static int net_send_packet (struct sk_buff *skb, struct net_device *dev) | 599 | static netdev_tx_t net_send_packet (struct sk_buff *skb, |
600 | struct net_device *dev) | ||
599 | { | 601 | { |
600 | struct net_local *lp = netdev_priv(dev); | 602 | struct net_local *lp = netdev_priv(dev); |
601 | int ioaddr = dev->base_addr; | 603 | int ioaddr = dev->base_addr; |
diff --git a/drivers/net/atl1c/atl1c_ethtool.c b/drivers/net/atl1c/atl1c_ethtool.c index 00d11b480af3..9b1e0eaebb5c 100644 --- a/drivers/net/atl1c/atl1c_ethtool.c +++ b/drivers/net/atl1c/atl1c_ethtool.c | |||
@@ -294,7 +294,7 @@ static int atl1c_nway_reset(struct net_device *netdev) | |||
294 | return 0; | 294 | return 0; |
295 | } | 295 | } |
296 | 296 | ||
297 | static struct ethtool_ops atl1c_ethtool_ops = { | 297 | static const struct ethtool_ops atl1c_ethtool_ops = { |
298 | .get_settings = atl1c_get_settings, | 298 | .get_settings = atl1c_get_settings, |
299 | .set_settings = atl1c_set_settings, | 299 | .set_settings = atl1c_set_settings, |
300 | .get_drvinfo = atl1c_get_drvinfo, | 300 | .get_drvinfo = atl1c_get_drvinfo, |
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c index 1d601ce7d5b2..bf7cc83e9836 100644 --- a/drivers/net/atl1c/atl1c_main.c +++ b/drivers/net/atl1c/atl1c_main.c | |||
@@ -2055,7 +2055,8 @@ static void atl1c_tx_queue(struct atl1c_adapter *adapter, struct sk_buff *skb, | |||
2055 | AT_WRITE_REG(&adapter->hw, REG_MB_PRIO_PROD_IDX, prod_data); | 2055 | AT_WRITE_REG(&adapter->hw, REG_MB_PRIO_PROD_IDX, prod_data); |
2056 | } | 2056 | } |
2057 | 2057 | ||
2058 | static int atl1c_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 2058 | static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb, |
2059 | struct net_device *netdev) | ||
2059 | { | 2060 | { |
2060 | struct atl1c_adapter *adapter = netdev_priv(netdev); | 2061 | struct atl1c_adapter *adapter = netdev_priv(netdev); |
2061 | unsigned long flags; | 2062 | unsigned long flags; |
diff --git a/drivers/net/atl1e/atl1e_ethtool.c b/drivers/net/atl1e/atl1e_ethtool.c index 4003955d7a96..60edb9f232bb 100644 --- a/drivers/net/atl1e/atl1e_ethtool.c +++ b/drivers/net/atl1e/atl1e_ethtool.c | |||
@@ -378,7 +378,7 @@ static int atl1e_nway_reset(struct net_device *netdev) | |||
378 | return 0; | 378 | return 0; |
379 | } | 379 | } |
380 | 380 | ||
381 | static struct ethtool_ops atl1e_ethtool_ops = { | 381 | static const struct ethtool_ops atl1e_ethtool_ops = { |
382 | .get_settings = atl1e_get_settings, | 382 | .get_settings = atl1e_get_settings, |
383 | .set_settings = atl1e_set_settings, | 383 | .set_settings = atl1e_set_settings, |
384 | .get_drvinfo = atl1e_get_drvinfo, | 384 | .get_drvinfo = atl1e_get_drvinfo, |
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c index 4570749e3d3b..bca127e65f95 100644 --- a/drivers/net/atl1e/atl1e_main.c +++ b/drivers/net/atl1e/atl1e_main.c | |||
@@ -1839,7 +1839,8 @@ static void atl1e_tx_queue(struct atl1e_adapter *adapter, u16 count, | |||
1839 | AT_WRITE_REG(&adapter->hw, REG_MB_TPD_PROD_IDX, tx_ring->next_to_use); | 1839 | AT_WRITE_REG(&adapter->hw, REG_MB_TPD_PROD_IDX, tx_ring->next_to_use); |
1840 | } | 1840 | } |
1841 | 1841 | ||
1842 | static int atl1e_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 1842 | static netdev_tx_t atl1e_xmit_frame(struct sk_buff *skb, |
1843 | struct net_device *netdev) | ||
1843 | { | 1844 | { |
1844 | struct atl1e_adapter *adapter = netdev_priv(netdev); | 1845 | struct atl1e_adapter *adapter = netdev_priv(netdev); |
1845 | unsigned long flags; | 1846 | unsigned long flags; |
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 8bca12f71390..00569dc1313c 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -2349,7 +2349,8 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count, | |||
2349 | atomic_set(&tpd_ring->next_to_use, next_to_use); | 2349 | atomic_set(&tpd_ring->next_to_use, next_to_use); |
2350 | } | 2350 | } |
2351 | 2351 | ||
2352 | static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 2352 | static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb, |
2353 | struct net_device *netdev) | ||
2353 | { | 2354 | { |
2354 | struct atl1_adapter *adapter = netdev_priv(netdev); | 2355 | struct atl1_adapter *adapter = netdev_priv(netdev); |
2355 | struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring; | 2356 | struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring; |
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c index 204db961029e..10c06b97001f 100644 --- a/drivers/net/atlx/atl2.c +++ b/drivers/net/atlx/atl2.c | |||
@@ -821,7 +821,8 @@ static inline int TxdFreeBytes(struct atl2_adapter *adapter) | |||
821 | (int) (txd_read_ptr - adapter->txd_write_ptr - 1); | 821 | (int) (txd_read_ptr - adapter->txd_write_ptr - 1); |
822 | } | 822 | } |
823 | 823 | ||
824 | static int atl2_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 824 | static netdev_tx_t atl2_xmit_frame(struct sk_buff *skb, |
825 | struct net_device *netdev) | ||
825 | { | 826 | { |
826 | struct atl2_adapter *adapter = netdev_priv(netdev); | 827 | struct atl2_adapter *adapter = netdev_priv(netdev); |
827 | struct tx_pkt_header *txph; | 828 | struct tx_pkt_header *txph; |
@@ -2093,7 +2094,7 @@ static int atl2_nway_reset(struct net_device *netdev) | |||
2093 | return 0; | 2094 | return 0; |
2094 | } | 2095 | } |
2095 | 2096 | ||
2096 | static struct ethtool_ops atl2_ethtool_ops = { | 2097 | static const struct ethtool_ops atl2_ethtool_ops = { |
2097 | .get_settings = atl2_get_settings, | 2098 | .get_settings = atl2_get_settings, |
2098 | .set_settings = atl2_set_settings, | 2099 | .set_settings = atl2_set_settings, |
2099 | .get_drvinfo = atl2_get_drvinfo, | 2100 | .get_drvinfo = atl2_get_drvinfo, |
diff --git a/drivers/net/atp.c b/drivers/net/atp.c index 4beacc9c909f..9043294fe617 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c | |||
@@ -199,7 +199,8 @@ static int net_open(struct net_device *dev); | |||
199 | static void hardware_init(struct net_device *dev); | 199 | static void hardware_init(struct net_device *dev); |
200 | static void write_packet(long ioaddr, int length, unsigned char *packet, int pad, int mode); | 200 | static void write_packet(long ioaddr, int length, unsigned char *packet, int pad, int mode); |
201 | static void trigger_send(long ioaddr, int length); | 201 | static void trigger_send(long ioaddr, int length); |
202 | static int atp_send_packet(struct sk_buff *skb, struct net_device *dev); | 202 | static netdev_tx_t atp_send_packet(struct sk_buff *skb, |
203 | struct net_device *dev); | ||
203 | static irqreturn_t atp_interrupt(int irq, void *dev_id); | 204 | static irqreturn_t atp_interrupt(int irq, void *dev_id); |
204 | static void net_rx(struct net_device *dev); | 205 | static void net_rx(struct net_device *dev); |
205 | static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode); | 206 | static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode); |
@@ -552,7 +553,8 @@ static void tx_timeout(struct net_device *dev) | |||
552 | dev->stats.tx_errors++; | 553 | dev->stats.tx_errors++; |
553 | } | 554 | } |
554 | 555 | ||
555 | static int atp_send_packet(struct sk_buff *skb, struct net_device *dev) | 556 | static netdev_tx_t atp_send_packet(struct sk_buff *skb, |
557 | struct net_device *dev) | ||
556 | { | 558 | { |
557 | struct net_local *lp = netdev_priv(dev); | 559 | struct net_local *lp = netdev_priv(dev); |
558 | long ioaddr = dev->base_addr; | 560 | long ioaddr = dev->base_addr; |
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 2aab1ebc6cd1..fdf5937233fc 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -937,7 +937,7 @@ static int au1000_close(struct net_device *dev) | |||
937 | /* | 937 | /* |
938 | * Au1000 transmit routine. | 938 | * Au1000 transmit routine. |
939 | */ | 939 | */ |
940 | static int au1000_tx(struct sk_buff *skb, struct net_device *dev) | 940 | static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev) |
941 | { | 941 | { |
942 | struct au1000_private *aup = netdev_priv(dev); | 942 | struct au1000_private *aup = netdev_priv(dev); |
943 | struct net_device_stats *ps = &dev->stats; | 943 | struct net_device_stats *ps = &dev->stats; |
@@ -1157,6 +1157,9 @@ static struct net_device * au1000_probe(int port_num) | |||
1157 | aup->mii_bus->name = "au1000_eth_mii"; | 1157 | aup->mii_bus->name = "au1000_eth_mii"; |
1158 | snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id); | 1158 | snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id); |
1159 | aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); | 1159 | aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); |
1160 | if (aup->mii_bus->irq == NULL) | ||
1161 | goto err_out; | ||
1162 | |||
1160 | for(i = 0; i < PHY_MAX_ADDR; ++i) | 1163 | for(i = 0; i < PHY_MAX_ADDR; ++i) |
1161 | aup->mii_bus->irq[i] = PHY_POLL; | 1164 | aup->mii_bus->irq[i] = PHY_POLL; |
1162 | 1165 | ||
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 07c92f34d8d8..951735c9ec0b 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -946,15 +946,16 @@ static void b44_tx_timeout(struct net_device *dev) | |||
946 | netif_wake_queue(dev); | 946 | netif_wake_queue(dev); |
947 | } | 947 | } |
948 | 948 | ||
949 | static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | 949 | static netdev_tx_t b44_start_xmit(struct sk_buff *skb, struct net_device *dev) |
950 | { | 950 | { |
951 | struct b44 *bp = netdev_priv(dev); | 951 | struct b44 *bp = netdev_priv(dev); |
952 | int rc = NETDEV_TX_OK; | 952 | int rc = NETDEV_TX_OK; |
953 | dma_addr_t mapping; | 953 | dma_addr_t mapping; |
954 | u32 len, entry, ctrl; | 954 | u32 len, entry, ctrl; |
955 | unsigned long flags; | ||
955 | 956 | ||
956 | len = skb->len; | 957 | len = skb->len; |
957 | spin_lock_irq(&bp->lock); | 958 | spin_lock_irqsave(&bp->lock, flags); |
958 | 959 | ||
959 | /* This is a hard error, log it. */ | 960 | /* This is a hard error, log it. */ |
960 | if (unlikely(TX_BUFFS_AVAIL(bp) < 1)) { | 961 | if (unlikely(TX_BUFFS_AVAIL(bp) < 1)) { |
@@ -1027,7 +1028,7 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1027 | dev->trans_start = jiffies; | 1028 | dev->trans_start = jiffies; |
1028 | 1029 | ||
1029 | out_unlock: | 1030 | out_unlock: |
1030 | spin_unlock_irq(&bp->lock); | 1031 | spin_unlock_irqrestore(&bp->lock, flags); |
1031 | 1032 | ||
1032 | return rc; | 1033 | return rc; |
1033 | 1034 | ||
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index beb131399231..6c45a2233d0d 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -259,7 +259,7 @@ struct be_adapter { | |||
259 | bool promiscuous; | 259 | bool promiscuous; |
260 | }; | 260 | }; |
261 | 261 | ||
262 | extern struct ethtool_ops be_ethtool_ops; | 262 | extern const struct ethtool_ops be_ethtool_ops; |
263 | 263 | ||
264 | #define drvr_stats(adapter) (&adapter->stats.drvr_stats) | 264 | #define drvr_stats(adapter) (&adapter->stats.drvr_stats) |
265 | 265 | ||
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index c480c19200d7..4ff3cc465406 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -332,7 +332,7 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd) | |||
332 | return status; | 332 | return status; |
333 | } | 333 | } |
334 | 334 | ||
335 | struct ethtool_ops be_ethtool_ops = { | 335 | const struct ethtool_ops be_ethtool_ops = { |
336 | .get_settings = be_get_settings, | 336 | .get_settings = be_get_settings, |
337 | .get_drvinfo = be_get_drvinfo, | 337 | .get_drvinfo = be_get_drvinfo, |
338 | .get_link = ethtool_op_get_link, | 338 | .get_link = ethtool_op_get_link, |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 7b9efee890f8..e19fe1dcd144 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -427,7 +427,8 @@ static int make_tx_wrbs(struct be_adapter *adapter, | |||
427 | return copied; | 427 | return copied; |
428 | } | 428 | } |
429 | 429 | ||
430 | static int be_xmit(struct sk_buff *skb, struct net_device *netdev) | 430 | static netdev_tx_t be_xmit(struct sk_buff *skb, |
431 | struct net_device *netdev) | ||
431 | { | 432 | { |
432 | struct be_adapter *adapter = netdev_priv(netdev); | 433 | struct be_adapter *adapter = netdev_priv(netdev); |
433 | struct be_tx_obj *tx_obj = &adapter->tx_obj; | 434 | struct be_tx_obj *tx_obj = &adapter->tx_obj; |
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index f580b21eabd1..14bd3801f7d3 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -491,7 +491,7 @@ static void bfin_mac_ethtool_getdrvinfo(struct net_device *dev, | |||
491 | strcpy(info->bus_info, dev_name(&dev->dev)); | 491 | strcpy(info->bus_info, dev_name(&dev->dev)); |
492 | } | 492 | } |
493 | 493 | ||
494 | static struct ethtool_ops bfin_mac_ethtool_ops = { | 494 | static const struct ethtool_ops bfin_mac_ethtool_ops = { |
495 | .get_settings = bfin_mac_ethtool_getsettings, | 495 | .get_settings = bfin_mac_ethtool_getsettings, |
496 | .set_settings = bfin_mac_ethtool_setsettings, | 496 | .set_settings = bfin_mac_ethtool_setsettings, |
497 | .get_link = ethtool_op_get_link, | 497 | .get_link = ethtool_op_get_link, |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index c4e85f694272..1357d548e698 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -401,9 +401,11 @@ static int bnx2_unregister_cnic(struct net_device *dev) | |||
401 | struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; | 401 | struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; |
402 | struct cnic_eth_dev *cp = &bp->cnic_eth_dev; | 402 | struct cnic_eth_dev *cp = &bp->cnic_eth_dev; |
403 | 403 | ||
404 | mutex_lock(&bp->cnic_lock); | ||
404 | cp->drv_state = 0; | 405 | cp->drv_state = 0; |
405 | bnapi->cnic_present = 0; | 406 | bnapi->cnic_present = 0; |
406 | rcu_assign_pointer(bp->cnic_ops, NULL); | 407 | rcu_assign_pointer(bp->cnic_ops, NULL); |
408 | mutex_unlock(&bp->cnic_lock); | ||
407 | synchronize_rcu(); | 409 | synchronize_rcu(); |
408 | return 0; | 410 | return 0; |
409 | } | 411 | } |
@@ -431,13 +433,13 @@ bnx2_cnic_stop(struct bnx2 *bp) | |||
431 | struct cnic_ops *c_ops; | 433 | struct cnic_ops *c_ops; |
432 | struct cnic_ctl_info info; | 434 | struct cnic_ctl_info info; |
433 | 435 | ||
434 | rcu_read_lock(); | 436 | mutex_lock(&bp->cnic_lock); |
435 | c_ops = rcu_dereference(bp->cnic_ops); | 437 | c_ops = bp->cnic_ops; |
436 | if (c_ops) { | 438 | if (c_ops) { |
437 | info.cmd = CNIC_CTL_STOP_CMD; | 439 | info.cmd = CNIC_CTL_STOP_CMD; |
438 | c_ops->cnic_ctl(bp->cnic_data, &info); | 440 | c_ops->cnic_ctl(bp->cnic_data, &info); |
439 | } | 441 | } |
440 | rcu_read_unlock(); | 442 | mutex_unlock(&bp->cnic_lock); |
441 | } | 443 | } |
442 | 444 | ||
443 | static void | 445 | static void |
@@ -446,8 +448,8 @@ bnx2_cnic_start(struct bnx2 *bp) | |||
446 | struct cnic_ops *c_ops; | 448 | struct cnic_ops *c_ops; |
447 | struct cnic_ctl_info info; | 449 | struct cnic_ctl_info info; |
448 | 450 | ||
449 | rcu_read_lock(); | 451 | mutex_lock(&bp->cnic_lock); |
450 | c_ops = rcu_dereference(bp->cnic_ops); | 452 | c_ops = bp->cnic_ops; |
451 | if (c_ops) { | 453 | if (c_ops) { |
452 | if (!(bp->flags & BNX2_FLAG_USING_MSIX)) { | 454 | if (!(bp->flags & BNX2_FLAG_USING_MSIX)) { |
453 | struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; | 455 | struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; |
@@ -457,7 +459,7 @@ bnx2_cnic_start(struct bnx2 *bp) | |||
457 | info.cmd = CNIC_CTL_START_CMD; | 459 | info.cmd = CNIC_CTL_START_CMD; |
458 | c_ops->cnic_ctl(bp->cnic_data, &info); | 460 | c_ops->cnic_ctl(bp->cnic_data, &info); |
459 | } | 461 | } |
460 | rcu_read_unlock(); | 462 | mutex_unlock(&bp->cnic_lock); |
461 | } | 463 | } |
462 | 464 | ||
463 | #else | 465 | #else |
@@ -6283,7 +6285,7 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp) | |||
6283 | * bnx2_tx_int() runs without netif_tx_lock unless it needs to call | 6285 | * bnx2_tx_int() runs without netif_tx_lock unless it needs to call |
6284 | * netif_wake_queue(). | 6286 | * netif_wake_queue(). |
6285 | */ | 6287 | */ |
6286 | static int | 6288 | static netdev_tx_t |
6287 | bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) | 6289 | bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) |
6288 | { | 6290 | { |
6289 | struct bnx2 *bp = netdev_priv(dev); | 6291 | struct bnx2 *bp = netdev_priv(dev); |
@@ -7687,6 +7689,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
7687 | 7689 | ||
7688 | spin_lock_init(&bp->phy_lock); | 7690 | spin_lock_init(&bp->phy_lock); |
7689 | spin_lock_init(&bp->indirect_lock); | 7691 | spin_lock_init(&bp->indirect_lock); |
7692 | #ifdef BCM_CNIC | ||
7693 | mutex_init(&bp->cnic_lock); | ||
7694 | #endif | ||
7690 | INIT_WORK(&bp->reset_task, bnx2_reset_task); | 7695 | INIT_WORK(&bp->reset_task, bnx2_reset_task); |
7691 | 7696 | ||
7692 | dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0); | 7697 | dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0); |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 7544188b6541..6c7f795d12de 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -6903,6 +6903,7 @@ struct bnx2 { | |||
6903 | u32 idle_chk_status_idx; | 6903 | u32 idle_chk_status_idx; |
6904 | 6904 | ||
6905 | #ifdef BCM_CNIC | 6905 | #ifdef BCM_CNIC |
6906 | struct mutex cnic_lock; | ||
6906 | struct cnic_eth_dev cnic_eth_dev; | 6907 | struct cnic_eth_dev cnic_eth_dev; |
6907 | #endif | 6908 | #endif |
6908 | 6909 | ||
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index b318d16a4d91..20f0ed956df2 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -10606,7 +10606,7 @@ static int bnx2x_phys_id(struct net_device *dev, u32 data) | |||
10606 | return 0; | 10606 | return 0; |
10607 | } | 10607 | } |
10608 | 10608 | ||
10609 | static struct ethtool_ops bnx2x_ethtool_ops = { | 10609 | static const struct ethtool_ops bnx2x_ethtool_ops = { |
10610 | .get_settings = bnx2x_get_settings, | 10610 | .get_settings = bnx2x_get_settings, |
10611 | .set_settings = bnx2x_set_settings, | 10611 | .set_settings = bnx2x_set_settings, |
10612 | .get_drvinfo = bnx2x_get_drvinfo, | 10612 | .get_drvinfo = bnx2x_get_drvinfo, |
@@ -10936,7 +10936,7 @@ exit_lbl: | |||
10936 | * bnx2x_tx_int() runs without netif_tx_lock unless it needs to call | 10936 | * bnx2x_tx_int() runs without netif_tx_lock unless it needs to call |
10937 | * netif_wake_queue() | 10937 | * netif_wake_queue() |
10938 | */ | 10938 | */ |
10939 | static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | 10939 | static netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) |
10940 | { | 10940 | { |
10941 | struct bnx2x *bp = netdev_priv(dev); | 10941 | struct bnx2x *bp = netdev_priv(dev); |
10942 | struct bnx2x_fastpath *fp, *fp_stat; | 10942 | struct bnx2x_fastpath *fp, *fp_stat; |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 2108706d2f0c..9b5936f072dc 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -79,8 +79,15 @@ | |||
79 | */ | 79 | */ |
80 | #define RLB_PROMISC_TIMEOUT 10*ALB_TIMER_TICKS_PER_SEC | 80 | #define RLB_PROMISC_TIMEOUT 10*ALB_TIMER_TICKS_PER_SEC |
81 | 81 | ||
82 | static const u8 mac_bcast[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff}; | 82 | #ifndef __long_aligned |
83 | static const u8 mac_v6_allmcast[ETH_ALEN] = {0x33,0x33,0x00,0x00,0x00,0x01}; | 83 | #define __long_aligned __attribute__((aligned((sizeof(long))))) |
84 | #endif | ||
85 | static const u8 mac_bcast[ETH_ALEN] __long_aligned = { | ||
86 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff | ||
87 | }; | ||
88 | static const u8 mac_v6_allmcast[ETH_ALEN] __long_aligned = { | ||
89 | 0x33, 0x33, 0x00, 0x00, 0x00, 0x01 | ||
90 | }; | ||
84 | static const int alb_delta_in_ticks = HZ / ALB_TIMER_TICKS_PER_SEC; | 91 | static const int alb_delta_in_ticks = HZ / ALB_TIMER_TICKS_PER_SEC; |
85 | 92 | ||
86 | #pragma pack(1) | 93 | #pragma pack(1) |
@@ -460,8 +467,8 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave) | |||
460 | 467 | ||
461 | if (assigned_slave) { | 468 | if (assigned_slave) { |
462 | rx_hash_table[index].slave = assigned_slave; | 469 | rx_hash_table[index].slave = assigned_slave; |
463 | if (memcmp(rx_hash_table[index].mac_dst, | 470 | if (compare_ether_addr_64bits(rx_hash_table[index].mac_dst, |
464 | mac_bcast, ETH_ALEN)) { | 471 | mac_bcast)) { |
465 | bond_info->rx_hashtbl[index].ntt = 1; | 472 | bond_info->rx_hashtbl[index].ntt = 1; |
466 | bond_info->rx_ntt = 1; | 473 | bond_info->rx_ntt = 1; |
467 | /* A slave has been removed from the | 474 | /* A slave has been removed from the |
@@ -575,7 +582,7 @@ static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *sla | |||
575 | client_info = &(bond_info->rx_hashtbl[hash_index]); | 582 | client_info = &(bond_info->rx_hashtbl[hash_index]); |
576 | 583 | ||
577 | if ((client_info->slave == slave) && | 584 | if ((client_info->slave == slave) && |
578 | memcmp(client_info->mac_dst, mac_bcast, ETH_ALEN)) { | 585 | compare_ether_addr_64bits(client_info->mac_dst, mac_bcast)) { |
579 | client_info->ntt = 1; | 586 | client_info->ntt = 1; |
580 | ntt = 1; | 587 | ntt = 1; |
581 | } | 588 | } |
@@ -616,9 +623,9 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) | |||
616 | * unicast mac address. | 623 | * unicast mac address. |
617 | */ | 624 | */ |
618 | if ((client_info->ip_src == src_ip) && | 625 | if ((client_info->ip_src == src_ip) && |
619 | memcmp(client_info->slave->dev->dev_addr, | 626 | compare_ether_addr_64bits(client_info->slave->dev->dev_addr, |
620 | bond->dev->dev_addr, ETH_ALEN) && | 627 | bond->dev->dev_addr) && |
621 | memcmp(client_info->mac_dst, mac_bcast, ETH_ALEN)) { | 628 | compare_ether_addr_64bits(client_info->mac_dst, mac_bcast)) { |
622 | client_info->ntt = 1; | 629 | client_info->ntt = 1; |
623 | bond_info->rx_ntt = 1; | 630 | bond_info->rx_ntt = 1; |
624 | } | 631 | } |
@@ -645,7 +652,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon | |||
645 | if ((client_info->ip_src == arp->ip_src) && | 652 | if ((client_info->ip_src == arp->ip_src) && |
646 | (client_info->ip_dst == arp->ip_dst)) { | 653 | (client_info->ip_dst == arp->ip_dst)) { |
647 | /* the entry is already assigned to this client */ | 654 | /* the entry is already assigned to this client */ |
648 | if (memcmp(arp->mac_dst, mac_bcast, ETH_ALEN)) { | 655 | if (compare_ether_addr_64bits(arp->mac_dst, mac_bcast)) { |
649 | /* update mac address from arp */ | 656 | /* update mac address from arp */ |
650 | memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN); | 657 | memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN); |
651 | } | 658 | } |
@@ -680,7 +687,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon | |||
680 | memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN); | 687 | memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN); |
681 | client_info->slave = assigned_slave; | 688 | client_info->slave = assigned_slave; |
682 | 689 | ||
683 | if (memcmp(client_info->mac_dst, mac_bcast, ETH_ALEN)) { | 690 | if (compare_ether_addr_64bits(client_info->mac_dst, mac_bcast)) { |
684 | client_info->ntt = 1; | 691 | client_info->ntt = 1; |
685 | bond->alb_info.rx_ntt = 1; | 692 | bond->alb_info.rx_ntt = 1; |
686 | } else { | 693 | } else { |
@@ -1046,21 +1053,18 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla | |||
1046 | int perm_curr_diff; | 1053 | int perm_curr_diff; |
1047 | int perm_bond_diff; | 1054 | int perm_bond_diff; |
1048 | 1055 | ||
1049 | perm_curr_diff = memcmp(slave->perm_hwaddr, | 1056 | perm_curr_diff = compare_ether_addr_64bits(slave->perm_hwaddr, |
1050 | slave->dev->dev_addr, | 1057 | slave->dev->dev_addr); |
1051 | ETH_ALEN); | 1058 | perm_bond_diff = compare_ether_addr_64bits(slave->perm_hwaddr, |
1052 | perm_bond_diff = memcmp(slave->perm_hwaddr, | 1059 | bond->dev->dev_addr); |
1053 | bond->dev->dev_addr, | ||
1054 | ETH_ALEN); | ||
1055 | 1060 | ||
1056 | if (perm_curr_diff && perm_bond_diff) { | 1061 | if (perm_curr_diff && perm_bond_diff) { |
1057 | struct slave *tmp_slave; | 1062 | struct slave *tmp_slave; |
1058 | int i, found = 0; | 1063 | int i, found = 0; |
1059 | 1064 | ||
1060 | bond_for_each_slave(bond, tmp_slave, i) { | 1065 | bond_for_each_slave(bond, tmp_slave, i) { |
1061 | if (!memcmp(slave->perm_hwaddr, | 1066 | if (!compare_ether_addr_64bits(slave->perm_hwaddr, |
1062 | tmp_slave->dev->dev_addr, | 1067 | tmp_slave->dev->dev_addr)) { |
1063 | ETH_ALEN)) { | ||
1064 | found = 1; | 1068 | found = 1; |
1065 | break; | 1069 | break; |
1066 | } | 1070 | } |
@@ -1114,10 +1118,10 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | |||
1114 | * check uniqueness of slave's mac address against the other | 1118 | * check uniqueness of slave's mac address against the other |
1115 | * slaves in the bond. | 1119 | * slaves in the bond. |
1116 | */ | 1120 | */ |
1117 | if (memcmp(slave->perm_hwaddr, bond->dev->dev_addr, ETH_ALEN)) { | 1121 | if (compare_ether_addr_64bits(slave->perm_hwaddr, bond->dev->dev_addr)) { |
1118 | bond_for_each_slave(bond, tmp_slave1, i) { | 1122 | bond_for_each_slave(bond, tmp_slave1, i) { |
1119 | if (!memcmp(tmp_slave1->dev->dev_addr, slave->dev->dev_addr, | 1123 | if (!compare_ether_addr_64bits(tmp_slave1->dev->dev_addr, |
1120 | ETH_ALEN)) { | 1124 | slave->dev->dev_addr)) { |
1121 | found = 1; | 1125 | found = 1; |
1122 | break; | 1126 | break; |
1123 | } | 1127 | } |
@@ -1140,9 +1144,8 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | |||
1140 | bond_for_each_slave(bond, tmp_slave1, i) { | 1144 | bond_for_each_slave(bond, tmp_slave1, i) { |
1141 | found = 0; | 1145 | found = 0; |
1142 | bond_for_each_slave(bond, tmp_slave2, j) { | 1146 | bond_for_each_slave(bond, tmp_slave2, j) { |
1143 | if (!memcmp(tmp_slave1->perm_hwaddr, | 1147 | if (!compare_ether_addr_64bits(tmp_slave1->perm_hwaddr, |
1144 | tmp_slave2->dev->dev_addr, | 1148 | tmp_slave2->dev->dev_addr)) { |
1145 | ETH_ALEN)) { | ||
1146 | found = 1; | 1149 | found = 1; |
1147 | break; | 1150 | break; |
1148 | } | 1151 | } |
@@ -1157,9 +1160,8 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | |||
1157 | } | 1160 | } |
1158 | 1161 | ||
1159 | if (!has_bond_addr) { | 1162 | if (!has_bond_addr) { |
1160 | if (!memcmp(tmp_slave1->dev->dev_addr, | 1163 | if (!compare_ether_addr_64bits(tmp_slave1->dev->dev_addr, |
1161 | bond->dev->dev_addr, | 1164 | bond->dev->dev_addr)) { |
1162 | ETH_ALEN)) { | ||
1163 | 1165 | ||
1164 | has_bond_addr = tmp_slave1; | 1166 | has_bond_addr = tmp_slave1; |
1165 | } | 1167 | } |
@@ -1313,7 +1315,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1313 | case ETH_P_IP: { | 1315 | case ETH_P_IP: { |
1314 | const struct iphdr *iph = ip_hdr(skb); | 1316 | const struct iphdr *iph = ip_hdr(skb); |
1315 | 1317 | ||
1316 | if ((memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) || | 1318 | if (!compare_ether_addr_64bits(eth_data->h_dest, mac_bcast) || |
1317 | (iph->daddr == ip_bcast) || | 1319 | (iph->daddr == ip_bcast) || |
1318 | (iph->protocol == IPPROTO_IGMP)) { | 1320 | (iph->protocol == IPPROTO_IGMP)) { |
1319 | do_tx_balance = 0; | 1321 | do_tx_balance = 0; |
@@ -1327,7 +1329,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1327 | /* IPv6 doesn't really use broadcast mac address, but leave | 1329 | /* IPv6 doesn't really use broadcast mac address, but leave |
1328 | * that here just in case. | 1330 | * that here just in case. |
1329 | */ | 1331 | */ |
1330 | if (memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) { | 1332 | if (!compare_ether_addr_64bits(eth_data->h_dest, mac_bcast)) { |
1331 | do_tx_balance = 0; | 1333 | do_tx_balance = 0; |
1332 | break; | 1334 | break; |
1333 | } | 1335 | } |
@@ -1335,7 +1337,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) | |||
1335 | /* IPv6 uses all-nodes multicast as an equivalent to | 1337 | /* IPv6 uses all-nodes multicast as an equivalent to |
1336 | * broadcasts in IPv4. | 1338 | * broadcasts in IPv4. |
1337 | */ | 1339 | */ |
1338 | if (memcmp(eth_data->h_dest, mac_v6_allmcast, ETH_ALEN) == 0) { | 1340 | if (!compare_ether_addr_64bits(eth_data->h_dest, mac_v6_allmcast)) { |
1339 | do_tx_balance = 0; | 1341 | do_tx_balance = 0; |
1340 | break; | 1342 | break; |
1341 | } | 1343 | } |
@@ -1660,8 +1662,8 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave | |||
1660 | struct slave *tmp_slave; | 1662 | struct slave *tmp_slave; |
1661 | /* find slave that is holding the bond's mac address */ | 1663 | /* find slave that is holding the bond's mac address */ |
1662 | bond_for_each_slave(bond, tmp_slave, i) { | 1664 | bond_for_each_slave(bond, tmp_slave, i) { |
1663 | if (!memcmp(tmp_slave->dev->dev_addr, | 1665 | if (!compare_ether_addr_64bits(tmp_slave->dev->dev_addr, |
1664 | bond->dev->dev_addr, ETH_ALEN)) { | 1666 | bond->dev->dev_addr)) { |
1665 | swap_slave = tmp_slave; | 1667 | swap_slave = tmp_slave; |
1666 | break; | 1668 | break; |
1667 | } | 1669 | } |
@@ -1739,7 +1741,8 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) | |||
1739 | swap_slave = NULL; | 1741 | swap_slave = NULL; |
1740 | 1742 | ||
1741 | bond_for_each_slave(bond, slave, i) { | 1743 | bond_for_each_slave(bond, slave, i) { |
1742 | if (!memcmp(slave->dev->dev_addr, bond_dev->dev_addr, ETH_ALEN)) { | 1744 | if (!compare_ether_addr_64bits(slave->dev->dev_addr, |
1745 | bond_dev->dev_addr)) { | ||
1743 | swap_slave = slave; | 1746 | swap_slave = slave; |
1744 | break; | 1747 | break; |
1745 | } | 1748 | } |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 7c0e0bded15e..a7e731f8a0da 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4450,7 +4450,7 @@ static void bond_set_xmit_hash_policy(struct bonding *bond) | |||
4450 | } | 4450 | } |
4451 | } | 4451 | } |
4452 | 4452 | ||
4453 | static int bond_start_xmit(struct sk_buff *skb, struct net_device *dev) | 4453 | static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev) |
4454 | { | 4454 | { |
4455 | const struct bonding *bond = netdev_priv(dev); | 4455 | const struct bonding *bond = netdev_priv(dev); |
4456 | 4456 | ||
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 6290a502742e..68247714466f 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -163,9 +163,9 @@ struct slave { | |||
163 | u32 original_flags; | 163 | u32 original_flags; |
164 | u32 original_mtu; | 164 | u32 original_mtu; |
165 | u32 link_failure_count; | 165 | u32 link_failure_count; |
166 | u8 perm_hwaddr[ETH_ALEN]; | ||
166 | u16 speed; | 167 | u16 speed; |
167 | u8 duplex; | 168 | u8 duplex; |
168 | u8 perm_hwaddr[ETH_ALEN]; | ||
169 | struct ad_slave_info ad_info; /* HUGE - better to dynamically alloc */ | 169 | struct ad_slave_info ad_info; /* HUGE - better to dynamically alloc */ |
170 | struct tlb_slave_info tlb_info; | 170 | struct tlb_slave_info tlb_info; |
171 | }; | 171 | }; |
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index b3004de1e5e4..9ce3ddac4e9b 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c | |||
@@ -238,7 +238,8 @@ static void chipset_init(struct net_device *dev) | |||
238 | * xx xx xx xx ff ll 00 11 22 33 44 55 66 77 | 238 | * xx xx xx xx ff ll 00 11 22 33 44 55 66 77 |
239 | * [ can-id ] [flags] [len] [can data (up to 8 bytes] | 239 | * [ can-id ] [flags] [len] [can data (up to 8 bytes] |
240 | */ | 240 | */ |
241 | static int sja1000_start_xmit(struct sk_buff *skb, struct net_device *dev) | 241 | static netdev_tx_t sja1000_start_xmit(struct sk_buff *skb, |
242 | struct net_device *dev) | ||
242 | { | 243 | { |
243 | struct sja1000_priv *priv = netdev_priv(dev); | 244 | struct sja1000_priv *priv = netdev_priv(dev); |
244 | struct net_device_stats *stats = &dev->stats; | 245 | struct net_device_stats *stats = &dev->stats; |
diff --git a/drivers/net/can/vcan.c b/drivers/net/can/vcan.c index a10c1d7b3b0a..6971f6cd37fa 100644 --- a/drivers/net/can/vcan.c +++ b/drivers/net/can/vcan.c | |||
@@ -83,7 +83,7 @@ static void vcan_rx(struct sk_buff *skb, struct net_device *dev) | |||
83 | netif_rx(skb); | 83 | netif_rx(skb); |
84 | } | 84 | } |
85 | 85 | ||
86 | static int vcan_tx(struct sk_buff *skb, struct net_device *dev) | 86 | static netdev_tx_t vcan_tx(struct sk_buff *skb, struct net_device *dev) |
87 | { | 87 | { |
88 | struct net_device_stats *stats = &dev->stats; | 88 | struct net_device_stats *stats = &dev->stats; |
89 | int loop; | 89 | int loop; |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 299a33b914f8..7517dc1da650 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -2918,7 +2918,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring, | |||
2918 | return 0; | 2918 | return 0; |
2919 | } | 2919 | } |
2920 | 2920 | ||
2921 | static int cas_start_xmit(struct sk_buff *skb, struct net_device *dev) | 2921 | static netdev_tx_t cas_start_xmit(struct sk_buff *skb, struct net_device *dev) |
2922 | { | 2922 | { |
2923 | struct cas *cp = netdev_priv(dev); | 2923 | struct cas *cp = netdev_priv(dev); |
2924 | 2924 | ||
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 3711d64e45ef..8c658cf6f62f 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -1776,7 +1776,7 @@ static inline int eth_hdr_len(const void *data) | |||
1776 | /* | 1776 | /* |
1777 | * Adds the CPL header to the sk_buff and passes it to t1_sge_tx. | 1777 | * Adds the CPL header to the sk_buff and passes it to t1_sge_tx. |
1778 | */ | 1778 | */ |
1779 | int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1779 | netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev) |
1780 | { | 1780 | { |
1781 | struct adapter *adapter = dev->ml_priv; | 1781 | struct adapter *adapter = dev->ml_priv; |
1782 | struct sge *sge = adapter->sge; | 1782 | struct sge *sge = adapter->sge; |
diff --git a/drivers/net/chelsio/sge.h b/drivers/net/chelsio/sge.h index 8c9405123992..00cc37fc1f6f 100644 --- a/drivers/net/chelsio/sge.h +++ b/drivers/net/chelsio/sge.h | |||
@@ -78,7 +78,7 @@ void t1_sge_destroy(struct sge *); | |||
78 | irqreturn_t t1_interrupt(int irq, void *cookie); | 78 | irqreturn_t t1_interrupt(int irq, void *cookie); |
79 | int t1_poll(struct napi_struct *, int); | 79 | int t1_poll(struct napi_struct *, int); |
80 | 80 | ||
81 | int t1_start_xmit(struct sk_buff *skb, struct net_device *dev); | 81 | netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev); |
82 | void t1_set_vlan_accel(struct adapter *adapter, int on_off); | 82 | void t1_set_vlan_accel(struct adapter *adapter, int on_off); |
83 | void t1_sge_start(struct sge *); | 83 | void t1_sge_start(struct sge *); |
84 | void t1_sge_stop(struct sge *); | 84 | void t1_sge_stop(struct sge *); |
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index f8a09236dc0a..d45eacb76702 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
@@ -138,6 +138,16 @@ static struct cnic_dev *cnic_from_netdev(struct net_device *netdev) | |||
138 | return NULL; | 138 | return NULL; |
139 | } | 139 | } |
140 | 140 | ||
141 | static inline void ulp_get(struct cnic_ulp_ops *ulp_ops) | ||
142 | { | ||
143 | atomic_inc(&ulp_ops->ref_count); | ||
144 | } | ||
145 | |||
146 | static inline void ulp_put(struct cnic_ulp_ops *ulp_ops) | ||
147 | { | ||
148 | atomic_dec(&ulp_ops->ref_count); | ||
149 | } | ||
150 | |||
141 | static void cnic_ctx_wr(struct cnic_dev *dev, u32 cid_addr, u32 off, u32 val) | 151 | static void cnic_ctx_wr(struct cnic_dev *dev, u32 cid_addr, u32 off, u32 val) |
142 | { | 152 | { |
143 | struct cnic_local *cp = dev->cnic_priv; | 153 | struct cnic_local *cp = dev->cnic_priv; |
@@ -358,6 +368,7 @@ int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) | |||
358 | } | 368 | } |
359 | read_unlock(&cnic_dev_lock); | 369 | read_unlock(&cnic_dev_lock); |
360 | 370 | ||
371 | atomic_set(&ulp_ops->ref_count, 0); | ||
361 | rcu_assign_pointer(cnic_ulp_tbl[ulp_type], ulp_ops); | 372 | rcu_assign_pointer(cnic_ulp_tbl[ulp_type], ulp_ops); |
362 | mutex_unlock(&cnic_lock); | 373 | mutex_unlock(&cnic_lock); |
363 | 374 | ||
@@ -379,6 +390,8 @@ int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) | |||
379 | int cnic_unregister_driver(int ulp_type) | 390 | int cnic_unregister_driver(int ulp_type) |
380 | { | 391 | { |
381 | struct cnic_dev *dev; | 392 | struct cnic_dev *dev; |
393 | struct cnic_ulp_ops *ulp_ops; | ||
394 | int i = 0; | ||
382 | 395 | ||
383 | if (ulp_type >= MAX_CNIC_ULP_TYPE) { | 396 | if (ulp_type >= MAX_CNIC_ULP_TYPE) { |
384 | printk(KERN_ERR PFX "cnic_unregister_driver: Bad type %d\n", | 397 | printk(KERN_ERR PFX "cnic_unregister_driver: Bad type %d\n", |
@@ -386,7 +399,8 @@ int cnic_unregister_driver(int ulp_type) | |||
386 | return -EINVAL; | 399 | return -EINVAL; |
387 | } | 400 | } |
388 | mutex_lock(&cnic_lock); | 401 | mutex_lock(&cnic_lock); |
389 | if (!cnic_ulp_tbl[ulp_type]) { | 402 | ulp_ops = cnic_ulp_tbl[ulp_type]; |
403 | if (!ulp_ops) { | ||
390 | printk(KERN_ERR PFX "cnic_unregister_driver: Type %d has not " | 404 | printk(KERN_ERR PFX "cnic_unregister_driver: Type %d has not " |
391 | "been registered\n", ulp_type); | 405 | "been registered\n", ulp_type); |
392 | goto out_unlock; | 406 | goto out_unlock; |
@@ -411,6 +425,14 @@ int cnic_unregister_driver(int ulp_type) | |||
411 | 425 | ||
412 | mutex_unlock(&cnic_lock); | 426 | mutex_unlock(&cnic_lock); |
413 | synchronize_rcu(); | 427 | synchronize_rcu(); |
428 | while ((atomic_read(&ulp_ops->ref_count) != 0) && (i < 20)) { | ||
429 | msleep(100); | ||
430 | i++; | ||
431 | } | ||
432 | |||
433 | if (atomic_read(&ulp_ops->ref_count) != 0) | ||
434 | printk(KERN_WARNING PFX "%s: Failed waiting for ref count to go" | ||
435 | " to zero.\n", dev->netdev->name); | ||
414 | return 0; | 436 | return 0; |
415 | 437 | ||
416 | out_unlock: | 438 | out_unlock: |
@@ -466,6 +488,7 @@ EXPORT_SYMBOL(cnic_register_driver); | |||
466 | static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) | 488 | static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) |
467 | { | 489 | { |
468 | struct cnic_local *cp = dev->cnic_priv; | 490 | struct cnic_local *cp = dev->cnic_priv; |
491 | int i = 0; | ||
469 | 492 | ||
470 | if (ulp_type >= MAX_CNIC_ULP_TYPE) { | 493 | if (ulp_type >= MAX_CNIC_ULP_TYPE) { |
471 | printk(KERN_ERR PFX "cnic_unregister_device: Bad type %d\n", | 494 | printk(KERN_ERR PFX "cnic_unregister_device: Bad type %d\n", |
@@ -486,6 +509,15 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) | |||
486 | 509 | ||
487 | synchronize_rcu(); | 510 | synchronize_rcu(); |
488 | 511 | ||
512 | while (test_bit(ULP_F_CALL_PENDING, &cp->ulp_flags[ulp_type]) && | ||
513 | i < 20) { | ||
514 | msleep(100); | ||
515 | i++; | ||
516 | } | ||
517 | if (test_bit(ULP_F_CALL_PENDING, &cp->ulp_flags[ulp_type])) | ||
518 | printk(KERN_WARNING PFX "%s: Failed waiting for ULP up call" | ||
519 | " to complete.\n", dev->netdev->name); | ||
520 | |||
489 | return 0; | 521 | return 0; |
490 | } | 522 | } |
491 | EXPORT_SYMBOL(cnic_unregister_driver); | 523 | EXPORT_SYMBOL(cnic_unregister_driver); |
@@ -1101,18 +1133,23 @@ static void cnic_ulp_stop(struct cnic_dev *dev) | |||
1101 | if (cp->cnic_uinfo) | 1133 | if (cp->cnic_uinfo) |
1102 | cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); | 1134 | cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); |
1103 | 1135 | ||
1104 | rcu_read_lock(); | ||
1105 | for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { | 1136 | for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { |
1106 | struct cnic_ulp_ops *ulp_ops; | 1137 | struct cnic_ulp_ops *ulp_ops; |
1107 | 1138 | ||
1108 | ulp_ops = rcu_dereference(cp->ulp_ops[if_type]); | 1139 | mutex_lock(&cnic_lock); |
1109 | if (!ulp_ops) | 1140 | ulp_ops = cp->ulp_ops[if_type]; |
1141 | if (!ulp_ops) { | ||
1142 | mutex_unlock(&cnic_lock); | ||
1110 | continue; | 1143 | continue; |
1144 | } | ||
1145 | set_bit(ULP_F_CALL_PENDING, &cp->ulp_flags[if_type]); | ||
1146 | mutex_unlock(&cnic_lock); | ||
1111 | 1147 | ||
1112 | if (test_and_clear_bit(ULP_F_START, &cp->ulp_flags[if_type])) | 1148 | if (test_and_clear_bit(ULP_F_START, &cp->ulp_flags[if_type])) |
1113 | ulp_ops->cnic_stop(cp->ulp_handle[if_type]); | 1149 | ulp_ops->cnic_stop(cp->ulp_handle[if_type]); |
1150 | |||
1151 | clear_bit(ULP_F_CALL_PENDING, &cp->ulp_flags[if_type]); | ||
1114 | } | 1152 | } |
1115 | rcu_read_unlock(); | ||
1116 | } | 1153 | } |
1117 | 1154 | ||
1118 | static void cnic_ulp_start(struct cnic_dev *dev) | 1155 | static void cnic_ulp_start(struct cnic_dev *dev) |
@@ -1120,18 +1157,23 @@ static void cnic_ulp_start(struct cnic_dev *dev) | |||
1120 | struct cnic_local *cp = dev->cnic_priv; | 1157 | struct cnic_local *cp = dev->cnic_priv; |
1121 | int if_type; | 1158 | int if_type; |
1122 | 1159 | ||
1123 | rcu_read_lock(); | ||
1124 | for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { | 1160 | for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { |
1125 | struct cnic_ulp_ops *ulp_ops; | 1161 | struct cnic_ulp_ops *ulp_ops; |
1126 | 1162 | ||
1127 | ulp_ops = rcu_dereference(cp->ulp_ops[if_type]); | 1163 | mutex_lock(&cnic_lock); |
1128 | if (!ulp_ops || !ulp_ops->cnic_start) | 1164 | ulp_ops = cp->ulp_ops[if_type]; |
1165 | if (!ulp_ops || !ulp_ops->cnic_start) { | ||
1166 | mutex_unlock(&cnic_lock); | ||
1129 | continue; | 1167 | continue; |
1168 | } | ||
1169 | set_bit(ULP_F_CALL_PENDING, &cp->ulp_flags[if_type]); | ||
1170 | mutex_unlock(&cnic_lock); | ||
1130 | 1171 | ||
1131 | if (!test_and_set_bit(ULP_F_START, &cp->ulp_flags[if_type])) | 1172 | if (!test_and_set_bit(ULP_F_START, &cp->ulp_flags[if_type])) |
1132 | ulp_ops->cnic_start(cp->ulp_handle[if_type]); | 1173 | ulp_ops->cnic_start(cp->ulp_handle[if_type]); |
1174 | |||
1175 | clear_bit(ULP_F_CALL_PENDING, &cp->ulp_flags[if_type]); | ||
1133 | } | 1176 | } |
1134 | rcu_read_unlock(); | ||
1135 | } | 1177 | } |
1136 | 1178 | ||
1137 | static int cnic_ctl(void *data, struct cnic_ctl_info *info) | 1179 | static int cnic_ctl(void *data, struct cnic_ctl_info *info) |
@@ -1141,22 +1183,18 @@ static int cnic_ctl(void *data, struct cnic_ctl_info *info) | |||
1141 | switch (info->cmd) { | 1183 | switch (info->cmd) { |
1142 | case CNIC_CTL_STOP_CMD: | 1184 | case CNIC_CTL_STOP_CMD: |
1143 | cnic_hold(dev); | 1185 | cnic_hold(dev); |
1144 | mutex_lock(&cnic_lock); | ||
1145 | 1186 | ||
1146 | cnic_ulp_stop(dev); | 1187 | cnic_ulp_stop(dev); |
1147 | cnic_stop_hw(dev); | 1188 | cnic_stop_hw(dev); |
1148 | 1189 | ||
1149 | mutex_unlock(&cnic_lock); | ||
1150 | cnic_put(dev); | 1190 | cnic_put(dev); |
1151 | break; | 1191 | break; |
1152 | case CNIC_CTL_START_CMD: | 1192 | case CNIC_CTL_START_CMD: |
1153 | cnic_hold(dev); | 1193 | cnic_hold(dev); |
1154 | mutex_lock(&cnic_lock); | ||
1155 | 1194 | ||
1156 | if (!cnic_start_hw(dev)) | 1195 | if (!cnic_start_hw(dev)) |
1157 | cnic_ulp_start(dev); | 1196 | cnic_ulp_start(dev); |
1158 | 1197 | ||
1159 | mutex_unlock(&cnic_lock); | ||
1160 | cnic_put(dev); | 1198 | cnic_put(dev); |
1161 | break; | 1199 | break; |
1162 | default: | 1200 | default: |
@@ -1170,19 +1208,23 @@ static void cnic_ulp_init(struct cnic_dev *dev) | |||
1170 | int i; | 1208 | int i; |
1171 | struct cnic_local *cp = dev->cnic_priv; | 1209 | struct cnic_local *cp = dev->cnic_priv; |
1172 | 1210 | ||
1173 | rcu_read_lock(); | ||
1174 | for (i = 0; i < MAX_CNIC_ULP_TYPE_EXT; i++) { | 1211 | for (i = 0; i < MAX_CNIC_ULP_TYPE_EXT; i++) { |
1175 | struct cnic_ulp_ops *ulp_ops; | 1212 | struct cnic_ulp_ops *ulp_ops; |
1176 | 1213 | ||
1177 | ulp_ops = rcu_dereference(cnic_ulp_tbl[i]); | 1214 | mutex_lock(&cnic_lock); |
1178 | if (!ulp_ops || !ulp_ops->cnic_init) | 1215 | ulp_ops = cnic_ulp_tbl[i]; |
1216 | if (!ulp_ops || !ulp_ops->cnic_init) { | ||
1217 | mutex_unlock(&cnic_lock); | ||
1179 | continue; | 1218 | continue; |
1219 | } | ||
1220 | ulp_get(ulp_ops); | ||
1221 | mutex_unlock(&cnic_lock); | ||
1180 | 1222 | ||
1181 | if (!test_and_set_bit(ULP_F_INIT, &cp->ulp_flags[i])) | 1223 | if (!test_and_set_bit(ULP_F_INIT, &cp->ulp_flags[i])) |
1182 | ulp_ops->cnic_init(dev); | 1224 | ulp_ops->cnic_init(dev); |
1183 | 1225 | ||
1226 | ulp_put(ulp_ops); | ||
1184 | } | 1227 | } |
1185 | rcu_read_unlock(); | ||
1186 | } | 1228 | } |
1187 | 1229 | ||
1188 | static void cnic_ulp_exit(struct cnic_dev *dev) | 1230 | static void cnic_ulp_exit(struct cnic_dev *dev) |
@@ -1190,19 +1232,23 @@ static void cnic_ulp_exit(struct cnic_dev *dev) | |||
1190 | int i; | 1232 | int i; |
1191 | struct cnic_local *cp = dev->cnic_priv; | 1233 | struct cnic_local *cp = dev->cnic_priv; |
1192 | 1234 | ||
1193 | rcu_read_lock(); | ||
1194 | for (i = 0; i < MAX_CNIC_ULP_TYPE_EXT; i++) { | 1235 | for (i = 0; i < MAX_CNIC_ULP_TYPE_EXT; i++) { |
1195 | struct cnic_ulp_ops *ulp_ops; | 1236 | struct cnic_ulp_ops *ulp_ops; |
1196 | 1237 | ||
1197 | ulp_ops = rcu_dereference(cnic_ulp_tbl[i]); | 1238 | mutex_lock(&cnic_lock); |
1198 | if (!ulp_ops || !ulp_ops->cnic_exit) | 1239 | ulp_ops = cnic_ulp_tbl[i]; |
1240 | if (!ulp_ops || !ulp_ops->cnic_exit) { | ||
1241 | mutex_unlock(&cnic_lock); | ||
1199 | continue; | 1242 | continue; |
1243 | } | ||
1244 | ulp_get(ulp_ops); | ||
1245 | mutex_unlock(&cnic_lock); | ||
1200 | 1246 | ||
1201 | if (test_and_clear_bit(ULP_F_INIT, &cp->ulp_flags[i])) | 1247 | if (test_and_clear_bit(ULP_F_INIT, &cp->ulp_flags[i])) |
1202 | ulp_ops->cnic_exit(dev); | 1248 | ulp_ops->cnic_exit(dev); |
1203 | 1249 | ||
1250 | ulp_put(ulp_ops); | ||
1204 | } | 1251 | } |
1205 | rcu_read_unlock(); | ||
1206 | } | 1252 | } |
1207 | 1253 | ||
1208 | static int cnic_cm_offload_pg(struct cnic_sock *csk) | 1254 | static int cnic_cm_offload_pg(struct cnic_sock *csk) |
@@ -2418,21 +2464,45 @@ static int cnic_start_bnx2_hw(struct cnic_dev *dev) | |||
2418 | return 0; | 2464 | return 0; |
2419 | } | 2465 | } |
2420 | 2466 | ||
2421 | static int cnic_start_hw(struct cnic_dev *dev) | 2467 | static int cnic_register_netdev(struct cnic_dev *dev) |
2422 | { | 2468 | { |
2423 | struct cnic_local *cp = dev->cnic_priv; | 2469 | struct cnic_local *cp = dev->cnic_priv; |
2424 | struct cnic_eth_dev *ethdev = cp->ethdev; | 2470 | struct cnic_eth_dev *ethdev = cp->ethdev; |
2425 | int err; | 2471 | int err; |
2426 | 2472 | ||
2427 | if (test_bit(CNIC_F_CNIC_UP, &dev->flags)) | 2473 | if (!ethdev) |
2428 | return -EALREADY; | 2474 | return -ENODEV; |
2475 | |||
2476 | if (ethdev->drv_state & CNIC_DRV_STATE_REGD) | ||
2477 | return 0; | ||
2429 | 2478 | ||
2430 | err = ethdev->drv_register_cnic(dev->netdev, cp->cnic_ops, dev); | 2479 | err = ethdev->drv_register_cnic(dev->netdev, cp->cnic_ops, dev); |
2431 | if (err) { | 2480 | if (err) |
2432 | printk(KERN_ERR PFX "%s: register_cnic failed\n", | 2481 | printk(KERN_ERR PFX "%s: register_cnic failed\n", |
2433 | dev->netdev->name); | 2482 | dev->netdev->name); |
2434 | goto err2; | 2483 | |
2435 | } | 2484 | return err; |
2485 | } | ||
2486 | |||
2487 | static void cnic_unregister_netdev(struct cnic_dev *dev) | ||
2488 | { | ||
2489 | struct cnic_local *cp = dev->cnic_priv; | ||
2490 | struct cnic_eth_dev *ethdev = cp->ethdev; | ||
2491 | |||
2492 | if (!ethdev) | ||
2493 | return; | ||
2494 | |||
2495 | ethdev->drv_unregister_cnic(dev->netdev); | ||
2496 | } | ||
2497 | |||
2498 | static int cnic_start_hw(struct cnic_dev *dev) | ||
2499 | { | ||
2500 | struct cnic_local *cp = dev->cnic_priv; | ||
2501 | struct cnic_eth_dev *ethdev = cp->ethdev; | ||
2502 | int err; | ||
2503 | |||
2504 | if (test_bit(CNIC_F_CNIC_UP, &dev->flags)) | ||
2505 | return -EALREADY; | ||
2436 | 2506 | ||
2437 | dev->regview = ethdev->io_base; | 2507 | dev->regview = ethdev->io_base; |
2438 | cp->chip_id = ethdev->chip_id; | 2508 | cp->chip_id = ethdev->chip_id; |
@@ -2463,18 +2533,13 @@ static int cnic_start_hw(struct cnic_dev *dev) | |||
2463 | return 0; | 2533 | return 0; |
2464 | 2534 | ||
2465 | err1: | 2535 | err1: |
2466 | ethdev->drv_unregister_cnic(dev->netdev); | ||
2467 | cp->free_resc(dev); | 2536 | cp->free_resc(dev); |
2468 | pci_dev_put(dev->pcidev); | 2537 | pci_dev_put(dev->pcidev); |
2469 | err2: | ||
2470 | return err; | 2538 | return err; |
2471 | } | 2539 | } |
2472 | 2540 | ||
2473 | static void cnic_stop_bnx2_hw(struct cnic_dev *dev) | 2541 | static void cnic_stop_bnx2_hw(struct cnic_dev *dev) |
2474 | { | 2542 | { |
2475 | struct cnic_local *cp = dev->cnic_priv; | ||
2476 | struct cnic_eth_dev *ethdev = cp->ethdev; | ||
2477 | |||
2478 | cnic_disable_bnx2_int_sync(dev); | 2543 | cnic_disable_bnx2_int_sync(dev); |
2479 | 2544 | ||
2480 | cnic_reg_wr_ind(dev, BNX2_CP_SCRATCH + 0x20, 0); | 2545 | cnic_reg_wr_ind(dev, BNX2_CP_SCRATCH + 0x20, 0); |
@@ -2486,8 +2551,6 @@ static void cnic_stop_bnx2_hw(struct cnic_dev *dev) | |||
2486 | cnic_setup_5709_context(dev, 0); | 2551 | cnic_setup_5709_context(dev, 0); |
2487 | cnic_free_irq(dev); | 2552 | cnic_free_irq(dev); |
2488 | 2553 | ||
2489 | ethdev->drv_unregister_cnic(dev->netdev); | ||
2490 | |||
2491 | cnic_free_resc(dev); | 2554 | cnic_free_resc(dev); |
2492 | } | 2555 | } |
2493 | 2556 | ||
@@ -2568,7 +2631,7 @@ static struct cnic_dev *init_bnx2_cnic(struct net_device *dev) | |||
2568 | probe = symbol_get(bnx2_cnic_probe); | 2631 | probe = symbol_get(bnx2_cnic_probe); |
2569 | if (probe) { | 2632 | if (probe) { |
2570 | ethdev = (*probe)(dev); | 2633 | ethdev = (*probe)(dev); |
2571 | symbol_put_addr(probe); | 2634 | symbol_put(bnx2_cnic_probe); |
2572 | } | 2635 | } |
2573 | if (!ethdev) | 2636 | if (!ethdev) |
2574 | return NULL; | 2637 | return NULL; |
@@ -2671,10 +2734,12 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event, | |||
2671 | else if (event == NETDEV_UNREGISTER) | 2734 | else if (event == NETDEV_UNREGISTER) |
2672 | cnic_ulp_exit(dev); | 2735 | cnic_ulp_exit(dev); |
2673 | else if (event == NETDEV_UP) { | 2736 | else if (event == NETDEV_UP) { |
2674 | mutex_lock(&cnic_lock); | 2737 | if (cnic_register_netdev(dev) != 0) { |
2738 | cnic_put(dev); | ||
2739 | goto done; | ||
2740 | } | ||
2675 | if (!cnic_start_hw(dev)) | 2741 | if (!cnic_start_hw(dev)) |
2676 | cnic_ulp_start(dev); | 2742 | cnic_ulp_start(dev); |
2677 | mutex_unlock(&cnic_lock); | ||
2678 | } | 2743 | } |
2679 | 2744 | ||
2680 | rcu_read_lock(); | 2745 | rcu_read_lock(); |
@@ -2693,10 +2758,9 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event, | |||
2693 | rcu_read_unlock(); | 2758 | rcu_read_unlock(); |
2694 | 2759 | ||
2695 | if (event == NETDEV_GOING_DOWN) { | 2760 | if (event == NETDEV_GOING_DOWN) { |
2696 | mutex_lock(&cnic_lock); | ||
2697 | cnic_ulp_stop(dev); | 2761 | cnic_ulp_stop(dev); |
2698 | cnic_stop_hw(dev); | 2762 | cnic_stop_hw(dev); |
2699 | mutex_unlock(&cnic_lock); | 2763 | cnic_unregister_netdev(dev); |
2700 | } else if (event == NETDEV_UNREGISTER) { | 2764 | } else if (event == NETDEV_UNREGISTER) { |
2701 | write_lock(&cnic_dev_lock); | 2765 | write_lock(&cnic_dev_lock); |
2702 | list_del_init(&dev->list); | 2766 | list_del_init(&dev->list); |
@@ -2728,6 +2792,7 @@ static void cnic_release(void) | |||
2728 | } | 2792 | } |
2729 | 2793 | ||
2730 | cnic_ulp_exit(dev); | 2794 | cnic_ulp_exit(dev); |
2795 | cnic_unregister_netdev(dev); | ||
2731 | list_del_init(&dev->list); | 2796 | list_del_init(&dev->list); |
2732 | cnic_free_dev(dev); | 2797 | cnic_free_dev(dev); |
2733 | } | 2798 | } |
diff --git a/drivers/net/cnic.h b/drivers/net/cnic.h index 5192d4a9df5a..a94b302bb464 100644 --- a/drivers/net/cnic.h +++ b/drivers/net/cnic.h | |||
@@ -176,6 +176,7 @@ struct cnic_local { | |||
176 | unsigned long ulp_flags[MAX_CNIC_ULP_TYPE]; | 176 | unsigned long ulp_flags[MAX_CNIC_ULP_TYPE]; |
177 | #define ULP_F_INIT 0 | 177 | #define ULP_F_INIT 0 |
178 | #define ULP_F_START 1 | 178 | #define ULP_F_START 1 |
179 | #define ULP_F_CALL_PENDING 2 | ||
179 | struct cnic_ulp_ops *ulp_ops[MAX_CNIC_ULP_TYPE]; | 180 | struct cnic_ulp_ops *ulp_ops[MAX_CNIC_ULP_TYPE]; |
180 | 181 | ||
181 | /* protected by ulp_lock */ | 182 | /* protected by ulp_lock */ |
diff --git a/drivers/net/cnic_if.h b/drivers/net/cnic_if.h index d1bce27ee99e..a49235739eef 100644 --- a/drivers/net/cnic_if.h +++ b/drivers/net/cnic_if.h | |||
@@ -290,6 +290,7 @@ struct cnic_ulp_ops { | |||
290 | void (*iscsi_nl_send_msg)(struct cnic_dev *dev, u32 msg_type, | 290 | void (*iscsi_nl_send_msg)(struct cnic_dev *dev, u32 msg_type, |
291 | char *data, u16 data_size); | 291 | char *data, u16 data_size); |
292 | struct module *owner; | 292 | struct module *owner; |
293 | atomic_t ref_count; | ||
293 | }; | 294 | }; |
294 | 295 | ||
295 | extern int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops); | 296 | extern int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops); |
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index 839cac5fd8a5..0c54219960e2 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c | |||
@@ -246,7 +246,7 @@ struct net_local { | |||
246 | 246 | ||
247 | static int cs89x0_probe1(struct net_device *dev, int ioaddr, int modular); | 247 | static int cs89x0_probe1(struct net_device *dev, int ioaddr, int modular); |
248 | static int net_open(struct net_device *dev); | 248 | static int net_open(struct net_device *dev); |
249 | static int net_send_packet(struct sk_buff *skb, struct net_device *dev); | 249 | static netdev_tx_t net_send_packet(struct sk_buff *skb, struct net_device *dev); |
250 | static irqreturn_t net_interrupt(int irq, void *dev_id); | 250 | static irqreturn_t net_interrupt(int irq, void *dev_id); |
251 | static void set_multicast_list(struct net_device *dev); | 251 | static void set_multicast_list(struct net_device *dev); |
252 | static void net_timeout(struct net_device *dev); | 252 | static void net_timeout(struct net_device *dev); |
@@ -1518,7 +1518,7 @@ static void net_timeout(struct net_device *dev) | |||
1518 | netif_wake_queue(dev); | 1518 | netif_wake_queue(dev); |
1519 | } | 1519 | } |
1520 | 1520 | ||
1521 | static int net_send_packet(struct sk_buff *skb, struct net_device *dev) | 1521 | static netdev_tx_t net_send_packet(struct sk_buff *skb,struct net_device *dev) |
1522 | { | 1522 | { |
1523 | struct net_local *lp = netdev_priv(dev); | 1523 | struct net_local *lp = netdev_priv(dev); |
1524 | unsigned long flags; | 1524 | unsigned long flags; |
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h index 74723f2e7431..2b1aea6aa558 100644 --- a/drivers/net/cxgb3/adapter.h +++ b/drivers/net/cxgb3/adapter.h | |||
@@ -309,7 +309,7 @@ void t3_stop_sge_timers(struct adapter *adap); | |||
309 | void t3_free_sge_resources(struct adapter *adap); | 309 | void t3_free_sge_resources(struct adapter *adap); |
310 | void t3_sge_err_intr_handler(struct adapter *adapter); | 310 | void t3_sge_err_intr_handler(struct adapter *adapter); |
311 | irq_handler_t t3_intr_handler(struct adapter *adap, int polling); | 311 | irq_handler_t t3_intr_handler(struct adapter *adap, int polling); |
312 | int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev); | 312 | netdev_tx_t t3_eth_xmit(struct sk_buff *skb, struct net_device *dev); |
313 | int t3_mgmt_tx(struct adapter *adap, struct sk_buff *skb); | 313 | int t3_mgmt_tx(struct adapter *adap, struct sk_buff *skb); |
314 | void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p); | 314 | void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p); |
315 | int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, | 315 | int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, |
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 29c79eb43beb..f86612857a73 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -1216,7 +1216,7 @@ static inline void t3_stop_tx_queue(struct netdev_queue *txq, | |||
1216 | * | 1216 | * |
1217 | * Add a packet to an SGE Tx queue. Runs with softirqs disabled. | 1217 | * Add a packet to an SGE Tx queue. Runs with softirqs disabled. |
1218 | */ | 1218 | */ |
1219 | int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev) | 1219 | netdev_tx_t t3_eth_xmit(struct sk_buff *skb, struct net_device *dev) |
1220 | { | 1220 | { |
1221 | int qidx; | 1221 | int qidx; |
1222 | unsigned int ndesc, pidx, credits, gen, compl; | 1222 | unsigned int ndesc, pidx, credits, gen, compl; |
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c index b2e0a8fc21d7..6a6ea038d7a3 100644 --- a/drivers/net/defxx.c +++ b/drivers/net/defxx.c | |||
@@ -300,7 +300,8 @@ static int dfx_rcv_init(DFX_board_t *bp, int get_buffers); | |||
300 | static void dfx_rcv_queue_process(DFX_board_t *bp); | 300 | static void dfx_rcv_queue_process(DFX_board_t *bp); |
301 | static void dfx_rcv_flush(DFX_board_t *bp); | 301 | static void dfx_rcv_flush(DFX_board_t *bp); |
302 | 302 | ||
303 | static int dfx_xmt_queue_pkt(struct sk_buff *skb, struct net_device *dev); | 303 | static netdev_tx_t dfx_xmt_queue_pkt(struct sk_buff *skb, |
304 | struct net_device *dev); | ||
304 | static int dfx_xmt_done(DFX_board_t *bp); | 305 | static int dfx_xmt_done(DFX_board_t *bp); |
305 | static void dfx_xmt_flush(DFX_board_t *bp); | 306 | static void dfx_xmt_flush(DFX_board_t *bp); |
306 | 307 | ||
@@ -3188,11 +3189,8 @@ static void dfx_rcv_queue_process( | |||
3188 | * None | 3189 | * None |
3189 | */ | 3190 | */ |
3190 | 3191 | ||
3191 | static int dfx_xmt_queue_pkt( | 3192 | static netdev_tx_t dfx_xmt_queue_pkt(struct sk_buff *skb, |
3192 | struct sk_buff *skb, | 3193 | struct net_device *dev) |
3193 | struct net_device *dev | ||
3194 | ) | ||
3195 | |||
3196 | { | 3194 | { |
3197 | DFX_board_t *bp = netdev_priv(dev); | 3195 | DFX_board_t *bp = netdev_priv(dev); |
3198 | u8 prod; /* local transmit producer index */ | 3196 | u8 prod; /* local transmit producer index */ |
diff --git a/drivers/net/depca.c b/drivers/net/depca.c index adb997c5bb5d..9686c1fa28f1 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c | |||
@@ -516,7 +516,8 @@ struct depca_private { | |||
516 | ** Public Functions | 516 | ** Public Functions |
517 | */ | 517 | */ |
518 | static int depca_open(struct net_device *dev); | 518 | static int depca_open(struct net_device *dev); |
519 | static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev); | 519 | static netdev_tx_t depca_start_xmit(struct sk_buff *skb, |
520 | struct net_device *dev); | ||
520 | static irqreturn_t depca_interrupt(int irq, void *dev_id); | 521 | static irqreturn_t depca_interrupt(int irq, void *dev_id); |
521 | static int depca_close(struct net_device *dev); | 522 | static int depca_close(struct net_device *dev); |
522 | static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 523 | static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
@@ -928,7 +929,8 @@ static void depca_tx_timeout(struct net_device *dev) | |||
928 | /* | 929 | /* |
929 | ** Writes a socket buffer to TX descriptor ring and starts transmission | 930 | ** Writes a socket buffer to TX descriptor ring and starts transmission |
930 | */ | 931 | */ |
931 | static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev) | 932 | static netdev_tx_t depca_start_xmit(struct sk_buff *skb, |
933 | struct net_device *dev) | ||
932 | { | 934 | { |
933 | struct depca_private *lp = netdev_priv(dev); | 935 | struct depca_private *lp = netdev_priv(dev); |
934 | u_long ioaddr = dev->base_addr; | 936 | u_long ioaddr = dev->base_addr; |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 4b6a219fecea..7fa7a907f134 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -59,7 +59,7 @@ static int rio_open (struct net_device *dev); | |||
59 | static void rio_timer (unsigned long data); | 59 | static void rio_timer (unsigned long data); |
60 | static void rio_tx_timeout (struct net_device *dev); | 60 | static void rio_tx_timeout (struct net_device *dev); |
61 | static void alloc_list (struct net_device *dev); | 61 | static void alloc_list (struct net_device *dev); |
62 | static int start_xmit (struct sk_buff *skb, struct net_device *dev); | 62 | static netdev_tx_t start_xmit (struct sk_buff *skb, struct net_device *dev); |
63 | static irqreturn_t rio_interrupt (int irq, void *dev_instance); | 63 | static irqreturn_t rio_interrupt (int irq, void *dev_instance); |
64 | static void rio_free_tx (struct net_device *dev, int irq); | 64 | static void rio_free_tx (struct net_device *dev, int irq); |
65 | static void tx_error (struct net_device *dev, int tx_status); | 65 | static void tx_error (struct net_device *dev, int tx_status); |
@@ -600,7 +600,7 @@ alloc_list (struct net_device *dev) | |||
600 | return; | 600 | return; |
601 | } | 601 | } |
602 | 602 | ||
603 | static int | 603 | static netdev_tx_t |
604 | start_xmit (struct sk_buff *skb, struct net_device *dev) | 604 | start_xmit (struct sk_buff *skb, struct net_device *dev) |
605 | { | 605 | { |
606 | struct netdev_private *np = netdev_priv(dev); | 606 | struct netdev_private *np = netdev_priv(dev); |
diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c index 2818d5de3940..234685213f1a 100644 --- a/drivers/net/dnet.c +++ b/drivers/net/dnet.c | |||
@@ -541,7 +541,7 @@ static inline void dnet_print_skb(struct sk_buff *skb) | |||
541 | #define dnet_print_skb(skb) do {} while (0) | 541 | #define dnet_print_skb(skb) do {} while (0) |
542 | #endif | 542 | #endif |
543 | 543 | ||
544 | static int dnet_start_xmit(struct sk_buff *skb, struct net_device *dev) | 544 | static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev) |
545 | { | 545 | { |
546 | 546 | ||
547 | struct dnet *bp = netdev_priv(dev); | 547 | struct dnet *bp = netdev_priv(dev); |
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index 713ce6c532c5..37dcfdc63456 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c | |||
@@ -39,8 +39,6 @@ | |||
39 | 39 | ||
40 | static int numdummies = 1; | 40 | static int numdummies = 1; |
41 | 41 | ||
42 | static int dummy_xmit(struct sk_buff *skb, struct net_device *dev); | ||
43 | |||
44 | static int dummy_set_address(struct net_device *dev, void *p) | 42 | static int dummy_set_address(struct net_device *dev, void *p) |
45 | { | 43 | { |
46 | struct sockaddr *sa = p; | 44 | struct sockaddr *sa = p; |
@@ -57,6 +55,16 @@ static void set_multicast_list(struct net_device *dev) | |||
57 | { | 55 | { |
58 | } | 56 | } |
59 | 57 | ||
58 | |||
59 | static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev) | ||
60 | { | ||
61 | dev->stats.tx_packets++; | ||
62 | dev->stats.tx_bytes += skb->len; | ||
63 | |||
64 | dev_kfree_skb(skb); | ||
65 | return NETDEV_TX_OK; | ||
66 | } | ||
67 | |||
60 | static const struct net_device_ops dummy_netdev_ops = { | 68 | static const struct net_device_ops dummy_netdev_ops = { |
61 | .ndo_start_xmit = dummy_xmit, | 69 | .ndo_start_xmit = dummy_xmit, |
62 | .ndo_validate_addr = eth_validate_addr, | 70 | .ndo_validate_addr = eth_validate_addr, |
@@ -78,16 +86,6 @@ static void dummy_setup(struct net_device *dev) | |||
78 | dev->flags &= ~IFF_MULTICAST; | 86 | dev->flags &= ~IFF_MULTICAST; |
79 | random_ether_addr(dev->dev_addr); | 87 | random_ether_addr(dev->dev_addr); |
80 | } | 88 | } |
81 | |||
82 | static int dummy_xmit(struct sk_buff *skb, struct net_device *dev) | ||
83 | { | ||
84 | dev->stats.tx_packets++; | ||
85 | dev->stats.tx_bytes += skb->len; | ||
86 | |||
87 | dev_kfree_skb(skb); | ||
88 | return NETDEV_TX_OK; | ||
89 | } | ||
90 | |||
91 | static int dummy_validate(struct nlattr *tb[], struct nlattr *data[]) | 89 | static int dummy_validate(struct nlattr *tb[], struct nlattr *data[]) |
92 | { | 90 | { |
93 | if (tb[IFLA_ADDRESS]) { | 91 | if (tb[IFLA_ADDRESS]) { |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 569df19f0df5..679965c2bb86 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -1690,7 +1690,8 @@ static void e100_xmit_prepare(struct nic *nic, struct cb *cb, | |||
1690 | cb->u.tcb.tbd.size = cpu_to_le16(skb->len); | 1690 | cb->u.tcb.tbd.size = cpu_to_le16(skb->len); |
1691 | } | 1691 | } |
1692 | 1692 | ||
1693 | static int e100_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 1693 | static netdev_tx_t e100_xmit_frame(struct sk_buff *skb, |
1694 | struct net_device *netdev) | ||
1694 | { | 1695 | { |
1695 | struct nic *nic = netdev_priv(netdev); | 1696 | struct nic *nic = netdev_priv(netdev); |
1696 | int err; | 1697 | int err; |
@@ -1899,7 +1900,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, | |||
1899 | nic->ru_running = RU_SUSPENDED; | 1900 | nic->ru_running = RU_SUSPENDED; |
1900 | pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr, | 1901 | pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr, |
1901 | sizeof(struct rfd), | 1902 | sizeof(struct rfd), |
1902 | PCI_DMA_BIDIRECTIONAL); | 1903 | PCI_DMA_FROMDEVICE); |
1903 | return -ENODATA; | 1904 | return -ENODATA; |
1904 | } | 1905 | } |
1905 | 1906 | ||
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index d7df00c2dbd6..2c723b1b8820 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -125,7 +125,8 @@ static void e1000_set_rx_mode(struct net_device *netdev); | |||
125 | static void e1000_update_phy_info(unsigned long data); | 125 | static void e1000_update_phy_info(unsigned long data); |
126 | static void e1000_watchdog(unsigned long data); | 126 | static void e1000_watchdog(unsigned long data); |
127 | static void e1000_82547_tx_fifo_stall(unsigned long data); | 127 | static void e1000_82547_tx_fifo_stall(unsigned long data); |
128 | static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev); | 128 | static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, |
129 | struct net_device *netdev); | ||
129 | static struct net_device_stats * e1000_get_stats(struct net_device *netdev); | 130 | static struct net_device_stats * e1000_get_stats(struct net_device *netdev); |
130 | static int e1000_change_mtu(struct net_device *netdev, int new_mtu); | 131 | static int e1000_change_mtu(struct net_device *netdev, int new_mtu); |
131 | static int e1000_set_mac(struct net_device *netdev, void *p); | 132 | static int e1000_set_mac(struct net_device *netdev, void *p); |
@@ -2401,7 +2402,9 @@ static void e1000_set_rx_mode(struct net_device *netdev) | |||
2401 | rctl &= ~E1000_RCTL_MPE; | 2402 | rctl &= ~E1000_RCTL_MPE; |
2402 | } | 2403 | } |
2403 | if (adapter->hw.mac_type != e1000_ich8lan) | 2404 | if (adapter->hw.mac_type != e1000_ich8lan) |
2404 | rctl |= E1000_RCTL_VFE; | 2405 | /* Enable VLAN filter if there is a VLAN */ |
2406 | if (adapter->vlgrp) | ||
2407 | rctl |= E1000_RCTL_VFE; | ||
2405 | } | 2408 | } |
2406 | 2409 | ||
2407 | if (netdev->uc.count > rar_entries - 1) { | 2410 | if (netdev->uc.count > rar_entries - 1) { |
@@ -3249,7 +3252,8 @@ static int e1000_maybe_stop_tx(struct net_device *netdev, | |||
3249 | } | 3252 | } |
3250 | 3253 | ||
3251 | #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) | 3254 | #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) |
3252 | static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 3255 | static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, |
3256 | struct net_device *netdev) | ||
3253 | { | 3257 | { |
3254 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3258 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3255 | struct e1000_hw *hw = &adapter->hw; | 3259 | struct e1000_hw *hw = &adapter->hw; |
@@ -4854,6 +4858,8 @@ static void e1000_vlan_rx_register(struct net_device *netdev, | |||
4854 | /* enable VLAN receive filtering */ | 4858 | /* enable VLAN receive filtering */ |
4855 | rctl = er32(RCTL); | 4859 | rctl = er32(RCTL); |
4856 | rctl &= ~E1000_RCTL_CFIEN; | 4860 | rctl &= ~E1000_RCTL_CFIEN; |
4861 | if (!(netdev->flags & IFF_PROMISC)) | ||
4862 | rctl |= E1000_RCTL_VFE; | ||
4857 | ew32(RCTL, rctl); | 4863 | ew32(RCTL, rctl); |
4858 | e1000_update_mng_vlan(adapter); | 4864 | e1000_update_mng_vlan(adapter); |
4859 | } | 4865 | } |
@@ -4864,6 +4870,11 @@ static void e1000_vlan_rx_register(struct net_device *netdev, | |||
4864 | ew32(CTRL, ctrl); | 4870 | ew32(CTRL, ctrl); |
4865 | 4871 | ||
4866 | if (adapter->hw.mac_type != e1000_ich8lan) { | 4872 | if (adapter->hw.mac_type != e1000_ich8lan) { |
4873 | /* disable VLAN receive filtering */ | ||
4874 | rctl = er32(RCTL); | ||
4875 | rctl &= ~E1000_RCTL_VFE; | ||
4876 | ew32(RCTL, rctl); | ||
4877 | |||
4867 | if (adapter->mng_vlan_id != | 4878 | if (adapter->mng_vlan_id != |
4868 | (u16)E1000_MNG_VLAN_NONE) { | 4879 | (u16)E1000_MNG_VLAN_NONE) { |
4869 | e1000_vlan_rx_kill_vid(netdev, | 4880 | e1000_vlan_rx_kill_vid(netdev, |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 63415bb6f48f..0f8d9619adea 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -4097,7 +4097,8 @@ static int e1000_maybe_stop_tx(struct net_device *netdev, int size) | |||
4097 | } | 4097 | } |
4098 | 4098 | ||
4099 | #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) | 4099 | #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) |
4100 | static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 4100 | static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, |
4101 | struct net_device *netdev) | ||
4101 | { | 4102 | { |
4102 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4103 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4103 | struct e1000_ring *tx_ring = adapter->tx_ring; | 4104 | struct e1000_ring *tx_ring = adapter->tx_ring; |
@@ -4538,8 +4539,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
4538 | /* Allow time for pending master requests to run */ | 4539 | /* Allow time for pending master requests to run */ |
4539 | e1000e_disable_pcie_master(&adapter->hw); | 4540 | e1000e_disable_pcie_master(&adapter->hw); |
4540 | 4541 | ||
4541 | if ((adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) && | 4542 | if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) { |
4542 | !(hw->mac.ops.check_mng_mode(hw))) { | ||
4543 | /* enable wakeup by the PHY */ | 4543 | /* enable wakeup by the PHY */ |
4544 | retval = e1000_init_phy_wakeup(adapter, wufc); | 4544 | retval = e1000_init_phy_wakeup(adapter, wufc); |
4545 | if (retval) | 4545 | if (retval) |
@@ -4557,7 +4557,8 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
4557 | *enable_wake = !!wufc; | 4557 | *enable_wake = !!wufc; |
4558 | 4558 | ||
4559 | /* make sure adapter isn't asleep if manageability is enabled */ | 4559 | /* make sure adapter isn't asleep if manageability is enabled */ |
4560 | if (adapter->flags & FLAG_MNG_PT_ENABLED) | 4560 | if ((adapter->flags & FLAG_MNG_PT_ENABLED) || |
4561 | (hw->mac.ops.check_mng_mode(hw))) | ||
4561 | *enable_wake = true; | 4562 | *enable_wake = true; |
4562 | 4563 | ||
4563 | if (adapter->hw.phy.type == e1000_phy_igp_3) | 4564 | if (adapter->hw.phy.type == e1000_phy_igp_3) |
@@ -4670,14 +4671,6 @@ static int e1000_resume(struct pci_dev *pdev) | |||
4670 | return err; | 4671 | return err; |
4671 | } | 4672 | } |
4672 | 4673 | ||
4673 | /* AER (Advanced Error Reporting) hooks */ | ||
4674 | err = pci_enable_pcie_error_reporting(pdev); | ||
4675 | if (err) { | ||
4676 | dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed " | ||
4677 | "0x%x\n", err); | ||
4678 | /* non-fatal, continue */ | ||
4679 | } | ||
4680 | |||
4681 | pci_set_master(pdev); | 4674 | pci_set_master(pdev); |
4682 | 4675 | ||
4683 | pci_enable_wake(pdev, PCI_D3hot, 0); | 4676 | pci_enable_wake(pdev, PCI_D3hot, 0); |
@@ -4990,6 +4983,14 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4990 | if (err) | 4983 | if (err) |
4991 | goto err_pci_reg; | 4984 | goto err_pci_reg; |
4992 | 4985 | ||
4986 | /* AER (Advanced Error Reporting) hooks */ | ||
4987 | err = pci_enable_pcie_error_reporting(pdev); | ||
4988 | if (err) { | ||
4989 | dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed " | ||
4990 | "0x%x\n", err); | ||
4991 | /* non-fatal, continue */ | ||
4992 | } | ||
4993 | |||
4993 | pci_set_master(pdev); | 4994 | pci_set_master(pdev); |
4994 | /* PCI config space info */ | 4995 | /* PCI config space info */ |
4995 | err = pci_save_state(pdev); | 4996 | err = pci_save_state(pdev); |
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index 53317a83857a..1e934160062c 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c | |||
@@ -309,7 +309,8 @@ struct eepro_local { | |||
309 | 309 | ||
310 | static int eepro_probe1(struct net_device *dev, int autoprobe); | 310 | static int eepro_probe1(struct net_device *dev, int autoprobe); |
311 | static int eepro_open(struct net_device *dev); | 311 | static int eepro_open(struct net_device *dev); |
312 | static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev); | 312 | static netdev_tx_t eepro_send_packet(struct sk_buff *skb, |
313 | struct net_device *dev); | ||
313 | static irqreturn_t eepro_interrupt(int irq, void *dev_id); | 314 | static irqreturn_t eepro_interrupt(int irq, void *dev_id); |
314 | static void eepro_rx(struct net_device *dev); | 315 | static void eepro_rx(struct net_device *dev); |
315 | static void eepro_transmit_interrupt(struct net_device *dev); | 316 | static void eepro_transmit_interrupt(struct net_device *dev); |
@@ -1133,7 +1134,8 @@ static void eepro_tx_timeout (struct net_device *dev) | |||
1133 | } | 1134 | } |
1134 | 1135 | ||
1135 | 1136 | ||
1136 | static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev) | 1137 | static netdev_tx_t eepro_send_packet(struct sk_buff *skb, |
1138 | struct net_device *dev) | ||
1137 | { | 1139 | { |
1138 | struct eepro_local *lp = netdev_priv(dev); | 1140 | struct eepro_local *lp = netdev_priv(dev); |
1139 | unsigned long flags; | 1141 | unsigned long flags; |
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index d1b6368faacd..592de8f1668a 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c | |||
@@ -246,7 +246,8 @@ static char mca_irqmap[] = { 12, 9, 3, 4, 5, 10, 11, 15 }; | |||
246 | static int eexp_open(struct net_device *dev); | 246 | static int eexp_open(struct net_device *dev); |
247 | static int eexp_close(struct net_device *dev); | 247 | static int eexp_close(struct net_device *dev); |
248 | static void eexp_timeout(struct net_device *dev); | 248 | static void eexp_timeout(struct net_device *dev); |
249 | static int eexp_xmit(struct sk_buff *buf, struct net_device *dev); | 249 | static netdev_tx_t eexp_xmit(struct sk_buff *buf, |
250 | struct net_device *dev); | ||
250 | 251 | ||
251 | static irqreturn_t eexp_irq(int irq, void *dev_addr); | 252 | static irqreturn_t eexp_irq(int irq, void *dev_addr); |
252 | static void eexp_set_multicast(struct net_device *dev); | 253 | static void eexp_set_multicast(struct net_device *dev); |
@@ -650,7 +651,7 @@ static void eexp_timeout(struct net_device *dev) | |||
650 | * Called to transmit a packet, or to allow us to right ourselves | 651 | * Called to transmit a packet, or to allow us to right ourselves |
651 | * if the kernel thinks we've died. | 652 | * if the kernel thinks we've died. |
652 | */ | 653 | */ |
653 | static int eexp_xmit(struct sk_buff *buf, struct net_device *dev) | 654 | static netdev_tx_t eexp_xmit(struct sk_buff *buf, struct net_device *dev) |
654 | { | 655 | { |
655 | short length = buf->len; | 656 | short length = buf->len; |
656 | #ifdef CONFIG_SMP | 657 | #ifdef CONFIG_SMP |
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 372d6c6a4e7f..117fc6c12e34 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c | |||
@@ -1276,7 +1276,8 @@ static void enc28j60_hw_tx(struct enc28j60_net *priv) | |||
1276 | locked_reg_bfset(priv, ECON1, ECON1_TXRTS); | 1276 | locked_reg_bfset(priv, ECON1, ECON1_TXRTS); |
1277 | } | 1277 | } |
1278 | 1278 | ||
1279 | static int enc28j60_send_packet(struct sk_buff *skb, struct net_device *dev) | 1279 | static netdev_tx_t enc28j60_send_packet(struct sk_buff *skb, |
1280 | struct net_device *dev) | ||
1280 | { | 1281 | { |
1281 | struct enc28j60_net *priv = netdev_priv(dev); | 1282 | struct enc28j60_net *priv = netdev_priv(dev); |
1282 | 1283 | ||
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 8005b602f776..2ea036333db2 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -256,7 +256,7 @@ static void enic_set_msglevel(struct net_device *netdev, u32 value) | |||
256 | enic->msg_enable = value; | 256 | enic->msg_enable = value; |
257 | } | 257 | } |
258 | 258 | ||
259 | static struct ethtool_ops enic_ethtool_ops = { | 259 | static const struct ethtool_ops enic_ethtool_ops = { |
260 | .get_settings = enic_get_settings, | 260 | .get_settings = enic_get_settings, |
261 | .get_drvinfo = enic_get_drvinfo, | 261 | .get_drvinfo = enic_get_drvinfo, |
262 | .get_msglevel = enic_get_msglevel, | 262 | .get_msglevel = enic_get_msglevel, |
@@ -622,7 +622,8 @@ static inline void enic_queue_wq_skb(struct enic *enic, | |||
622 | } | 622 | } |
623 | 623 | ||
624 | /* netif_tx_lock held, process context with BHs disabled, or BH */ | 624 | /* netif_tx_lock held, process context with BHs disabled, or BH */ |
625 | static int enic_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev) | 625 | static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb, |
626 | struct net_device *netdev) | ||
626 | { | 627 | { |
627 | struct enic *enic = netdev_priv(netdev); | 628 | struct enic *enic = netdev_priv(netdev); |
628 | struct vnic_wq *wq = &enic->wq[0]; | 629 | struct vnic_wq *wq = &enic->wq[0]; |
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index d668ff2af6e3..641a10d2e843 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -298,7 +298,8 @@ static void epic_restart(struct net_device *dev); | |||
298 | static void epic_timer(unsigned long data); | 298 | static void epic_timer(unsigned long data); |
299 | static void epic_tx_timeout(struct net_device *dev); | 299 | static void epic_tx_timeout(struct net_device *dev); |
300 | static void epic_init_ring(struct net_device *dev); | 300 | static void epic_init_ring(struct net_device *dev); |
301 | static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev); | 301 | static netdev_tx_t epic_start_xmit(struct sk_buff *skb, |
302 | struct net_device *dev); | ||
302 | static int epic_rx(struct net_device *dev, int budget); | 303 | static int epic_rx(struct net_device *dev, int budget); |
303 | static int epic_poll(struct napi_struct *napi, int budget); | 304 | static int epic_poll(struct napi_struct *napi, int budget); |
304 | static irqreturn_t epic_interrupt(int irq, void *dev_instance); | 305 | static irqreturn_t epic_interrupt(int irq, void *dev_instance); |
@@ -961,7 +962,7 @@ static void epic_init_ring(struct net_device *dev) | |||
961 | return; | 962 | return; |
962 | } | 963 | } |
963 | 964 | ||
964 | static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev) | 965 | static netdev_tx_t epic_start_xmit(struct sk_buff *skb, struct net_device *dev) |
965 | { | 966 | { |
966 | struct epic_private *ep = netdev_priv(dev); | 967 | struct epic_private *ep = netdev_priv(dev); |
967 | int entry, free_count; | 968 | int entry, free_count; |
diff --git a/drivers/net/eql.c b/drivers/net/eql.c index c0e69c5cae84..d4d9a3eda695 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c | |||
@@ -127,7 +127,7 @@ | |||
127 | static int eql_open(struct net_device *dev); | 127 | static int eql_open(struct net_device *dev); |
128 | static int eql_close(struct net_device *dev); | 128 | static int eql_close(struct net_device *dev); |
129 | static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); | 129 | static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); |
130 | static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev); | 130 | static netdev_tx_t eql_slave_xmit(struct sk_buff *skb, struct net_device *dev); |
131 | 131 | ||
132 | #define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE) | 132 | #define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE) |
133 | #define eql_is_master(dev) ((dev->flags & IFF_MASTER) == IFF_MASTER) | 133 | #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) | |||
325 | return best_slave; | 325 | return best_slave; |
326 | } | 326 | } |
327 | 327 | ||
328 | static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev) | 328 | static netdev_tx_t eql_slave_xmit(struct sk_buff *skb, struct net_device *dev) |
329 | { | 329 | { |
330 | equalizer_t *eql = netdev_priv(dev); | 330 | equalizer_t *eql = netdev_priv(dev); |
331 | slave_t *slave; | 331 | slave_t *slave; |
diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c index 97d5205edc8f..71bfeec33a0b 100644 --- a/drivers/net/eth16i.c +++ b/drivers/net/eth16i.c | |||
@@ -405,7 +405,7 @@ static int eth16i_read_eeprom_word(int ioaddr); | |||
405 | static void eth16i_eeprom_cmd(int ioaddr, unsigned char command); | 405 | static void eth16i_eeprom_cmd(int ioaddr, unsigned char command); |
406 | static int eth16i_open(struct net_device *dev); | 406 | static int eth16i_open(struct net_device *dev); |
407 | static int eth16i_close(struct net_device *dev); | 407 | static int eth16i_close(struct net_device *dev); |
408 | static int eth16i_tx(struct sk_buff *skb, struct net_device *dev); | 408 | static netdev_tx_t eth16i_tx(struct sk_buff *skb, struct net_device *dev); |
409 | static void eth16i_rx(struct net_device *dev); | 409 | static void eth16i_rx(struct net_device *dev); |
410 | static void eth16i_timeout(struct net_device *dev); | 410 | static void eth16i_timeout(struct net_device *dev); |
411 | static irqreturn_t eth16i_interrupt(int irq, void *dev_id); | 411 | static irqreturn_t eth16i_interrupt(int irq, void *dev_id); |
@@ -1053,7 +1053,7 @@ static void eth16i_timeout(struct net_device *dev) | |||
1053 | netif_wake_queue(dev); | 1053 | netif_wake_queue(dev); |
1054 | } | 1054 | } |
1055 | 1055 | ||
1056 | static int eth16i_tx(struct sk_buff *skb, struct net_device *dev) | 1056 | static netdev_tx_t eth16i_tx(struct sk_buff *skb, struct net_device *dev) |
1057 | { | 1057 | { |
1058 | struct eth16i_local *lp = netdev_priv(dev); | 1058 | struct eth16i_local *lp = netdev_priv(dev); |
1059 | int ioaddr = dev->base_addr; | 1059 | int ioaddr = dev->base_addr; |
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 4dbe5f173273..b871aefed9c6 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c | |||
@@ -802,7 +802,7 @@ static struct net_device_stats *ethoc_stats(struct net_device *dev) | |||
802 | return &priv->stats; | 802 | return &priv->stats; |
803 | } | 803 | } |
804 | 804 | ||
805 | static int ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev) | 805 | static netdev_tx_t ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev) |
806 | { | 806 | { |
807 | struct ethoc *priv = netdev_priv(dev); | 807 | struct ethoc *priv = netdev_priv(dev); |
808 | struct ethoc_bd bd; | 808 | struct ethoc_bd bd; |
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c index 9c51bc813ad3..b2a5ec8f3721 100644 --- a/drivers/net/ewrk3.c +++ b/drivers/net/ewrk3.c | |||
@@ -298,7 +298,7 @@ struct ewrk3_private { | |||
298 | ** Public Functions | 298 | ** Public Functions |
299 | */ | 299 | */ |
300 | static int ewrk3_open(struct net_device *dev); | 300 | static int ewrk3_open(struct net_device *dev); |
301 | static int ewrk3_queue_pkt(struct sk_buff *skb, struct net_device *dev); | 301 | static netdev_tx_t ewrk3_queue_pkt(struct sk_buff *skb, struct net_device *dev); |
302 | static irqreturn_t ewrk3_interrupt(int irq, void *dev_id); | 302 | static irqreturn_t ewrk3_interrupt(int irq, void *dev_id); |
303 | static int ewrk3_close(struct net_device *dev); | 303 | static int ewrk3_close(struct net_device *dev); |
304 | static void set_multicast_list(struct net_device *dev); | 304 | static void set_multicast_list(struct net_device *dev); |
@@ -764,7 +764,7 @@ static void ewrk3_timeout(struct net_device *dev) | |||
764 | /* | 764 | /* |
765 | ** Writes a socket buffer to the free page queue | 765 | ** Writes a socket buffer to the free page queue |
766 | */ | 766 | */ |
767 | static int ewrk3_queue_pkt (struct sk_buff *skb, struct net_device *dev) | 767 | static netdev_tx_t ewrk3_queue_pkt(struct sk_buff *skb, struct net_device *dev) |
768 | { | 768 | { |
769 | struct ewrk3_private *lp = netdev_priv(dev); | 769 | struct ewrk3_private *lp = netdev_priv(dev); |
770 | u_long iobase = dev->base_addr; | 770 | u_long iobase = dev->base_addr; |
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c index f66da84a9398..18d5fbb9673e 100644 --- a/drivers/net/fealnx.c +++ b/drivers/net/fealnx.c | |||
@@ -433,7 +433,7 @@ static void netdev_timer(unsigned long data); | |||
433 | static void reset_timer(unsigned long data); | 433 | static void reset_timer(unsigned long data); |
434 | static void fealnx_tx_timeout(struct net_device *dev); | 434 | static void fealnx_tx_timeout(struct net_device *dev); |
435 | static void init_ring(struct net_device *dev); | 435 | static void init_ring(struct net_device *dev); |
436 | static int start_tx(struct sk_buff *skb, struct net_device *dev); | 436 | static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev); |
437 | static irqreturn_t intr_handler(int irq, void *dev_instance); | 437 | static irqreturn_t intr_handler(int irq, void *dev_instance); |
438 | static int netdev_rx(struct net_device *dev); | 438 | static int netdev_rx(struct net_device *dev); |
439 | static void set_rx_mode(struct net_device *dev); | 439 | static void set_rx_mode(struct net_device *dev); |
@@ -1305,7 +1305,7 @@ static void init_ring(struct net_device *dev) | |||
1305 | } | 1305 | } |
1306 | 1306 | ||
1307 | 1307 | ||
1308 | static int start_tx(struct sk_buff *skb, struct net_device *dev) | 1308 | static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev) |
1309 | { | 1309 | { |
1310 | struct netdev_private *np = netdev_priv(dev); | 1310 | struct netdev_private *np = netdev_priv(dev); |
1311 | unsigned long flags; | 1311 | unsigned long flags; |
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index cc786333d95c..c40113f58963 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c | |||
@@ -309,6 +309,7 @@ static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
309 | { | 309 | { |
310 | struct mpc52xx_fec_priv *priv = netdev_priv(dev); | 310 | struct mpc52xx_fec_priv *priv = netdev_priv(dev); |
311 | struct bcom_fec_bd *bd; | 311 | struct bcom_fec_bd *bd; |
312 | unsigned long flags; | ||
312 | 313 | ||
313 | if (bcom_queue_full(priv->tx_dmatsk)) { | 314 | if (bcom_queue_full(priv->tx_dmatsk)) { |
314 | if (net_ratelimit()) | 315 | if (net_ratelimit()) |
@@ -316,7 +317,7 @@ static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
316 | return NETDEV_TX_BUSY; | 317 | return NETDEV_TX_BUSY; |
317 | } | 318 | } |
318 | 319 | ||
319 | spin_lock_irq(&priv->lock); | 320 | spin_lock_irqsave(&priv->lock, flags); |
320 | dev->trans_start = jiffies; | 321 | dev->trans_start = jiffies; |
321 | 322 | ||
322 | bd = (struct bcom_fec_bd *) | 323 | bd = (struct bcom_fec_bd *) |
@@ -332,7 +333,7 @@ static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
332 | netif_stop_queue(dev); | 333 | netif_stop_queue(dev); |
333 | } | 334 | } |
334 | 335 | ||
335 | spin_unlock_irq(&priv->lock); | 336 | spin_unlock_irqrestore(&priv->lock, flags); |
336 | 337 | ||
337 | return NETDEV_TX_OK; | 338 | return NETDEV_TX_OK; |
338 | } | 339 | } |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 3b4e0766c7b2..0a1c2bb27d4d 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -2137,7 +2137,7 @@ static void nv_gear_backoff_reseed(struct net_device *dev) | |||
2137 | * nv_start_xmit: dev->hard_start_xmit function | 2137 | * nv_start_xmit: dev->hard_start_xmit function |
2138 | * Called with netif_tx_lock held. | 2138 | * Called with netif_tx_lock held. |
2139 | */ | 2139 | */ |
2140 | static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | 2140 | static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev) |
2141 | { | 2141 | { |
2142 | struct fe_priv *np = netdev_priv(dev); | 2142 | struct fe_priv *np = netdev_priv(dev); |
2143 | u32 tx_flags = 0; | 2143 | u32 tx_flags = 0; |
@@ -2257,7 +2257,8 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2257 | return NETDEV_TX_OK; | 2257 | return NETDEV_TX_OK; |
2258 | } | 2258 | } |
2259 | 2259 | ||
2260 | static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | 2260 | static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb, |
2261 | struct net_device *dev) | ||
2261 | { | 2262 | { |
2262 | struct fe_priv *np = netdev_priv(dev); | 2263 | struct fe_priv *np = netdev_priv(dev); |
2263 | u32 tx_flags = 0; | 2264 | u32 tx_flags = 0; |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 4544da4cf3ce..772104c5ed26 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -490,6 +490,7 @@ static int gfar_remove(struct of_device *ofdev) | |||
490 | 490 | ||
491 | dev_set_drvdata(&ofdev->dev, NULL); | 491 | dev_set_drvdata(&ofdev->dev, NULL); |
492 | 492 | ||
493 | unregister_netdev(dev); | ||
493 | iounmap(priv->regs); | 494 | iounmap(priv->regs); |
494 | free_netdev(priv->ndev); | 495 | free_netdev(priv->ndev); |
495 | 496 | ||
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 635341d6a028..1d5064a09aca 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -557,7 +557,8 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | |||
557 | static void hamachi_timer(unsigned long data); | 557 | static void hamachi_timer(unsigned long data); |
558 | static void hamachi_tx_timeout(struct net_device *dev); | 558 | static void hamachi_tx_timeout(struct net_device *dev); |
559 | static void hamachi_init_ring(struct net_device *dev); | 559 | static void hamachi_init_ring(struct net_device *dev); |
560 | static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev); | 560 | static netdev_tx_t hamachi_start_xmit(struct sk_buff *skb, |
561 | struct net_device *dev); | ||
561 | static irqreturn_t hamachi_interrupt(int irq, void *dev_instance); | 562 | static irqreturn_t hamachi_interrupt(int irq, void *dev_instance); |
562 | static int hamachi_rx(struct net_device *dev); | 563 | static int hamachi_rx(struct net_device *dev); |
563 | static inline int hamachi_tx(struct net_device *dev); | 564 | static inline int hamachi_tx(struct net_device *dev); |
@@ -1263,7 +1264,8 @@ do { \ | |||
1263 | } while (0) | 1264 | } while (0) |
1264 | #endif | 1265 | #endif |
1265 | 1266 | ||
1266 | static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1267 | static netdev_tx_t hamachi_start_xmit(struct sk_buff *skb, |
1268 | struct net_device *dev) | ||
1267 | { | 1269 | { |
1268 | struct hamachi_private *hmp = netdev_priv(dev); | 1270 | struct hamachi_private *hmp = netdev_priv(dev); |
1269 | unsigned entry; | 1271 | unsigned entry; |
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 6cb2bdfd7b19..fb588301a05d 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -242,7 +242,7 @@ out_drop: | |||
242 | 242 | ||
243 | /* Encapsulate an IP datagram and kick it into a TTY queue. */ | 243 | /* Encapsulate an IP datagram and kick it into a TTY queue. */ |
244 | 244 | ||
245 | static int sp_xmit(struct sk_buff *skb, struct net_device *dev) | 245 | static netdev_tx_t sp_xmit(struct sk_buff *skb, struct net_device *dev) |
246 | { | 246 | { |
247 | struct sixpack *sp = netdev_priv(dev); | 247 | struct sixpack *sp = netdev_priv(dev); |
248 | 248 | ||
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index 4c5f4dfbe05e..3c7cc7f45800 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -247,7 +247,7 @@ drop: | |||
247 | /* | 247 | /* |
248 | * Send an AX.25 frame via an ethernet interface | 248 | * Send an AX.25 frame via an ethernet interface |
249 | */ | 249 | */ |
250 | static int bpq_xmit(struct sk_buff *skb, struct net_device *dev) | 250 | static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev) |
251 | { | 251 | { |
252 | struct sk_buff *newskb; | 252 | struct sk_buff *newskb; |
253 | unsigned char *ptr; | 253 | unsigned char *ptr; |
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index 16b060b92117..0013c409782c 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -399,7 +399,8 @@ void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s) | |||
399 | * ===================== network driver interface ========================= | 399 | * ===================== network driver interface ========================= |
400 | */ | 400 | */ |
401 | 401 | ||
402 | static int hdlcdrv_send_packet(struct sk_buff *skb, struct net_device *dev) | 402 | static netdev_tx_t hdlcdrv_send_packet(struct sk_buff *skb, |
403 | struct net_device *dev) | ||
403 | { | 404 | { |
404 | struct hdlcdrv_state *sm = netdev_priv(dev); | 405 | struct hdlcdrv_state *sm = netdev_priv(dev); |
405 | 406 | ||
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index ac191ef2119b..33b55f729742 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -525,7 +525,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len) | |||
525 | } | 525 | } |
526 | 526 | ||
527 | /* Encapsulate an AX.25 packet and kick it into a TTY queue. */ | 527 | /* Encapsulate an AX.25 packet and kick it into a TTY queue. */ |
528 | static int ax_xmit(struct sk_buff *skb, struct net_device *dev) | 528 | static netdev_tx_t ax_xmit(struct sk_buff *skb, struct net_device *dev) |
529 | { | 529 | { |
530 | struct mkiss *ax = netdev_priv(dev); | 530 | struct mkiss *ax = netdev_priv(dev); |
531 | 531 | ||
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c index c5406525c1ad..35c936175bba 100644 --- a/drivers/net/hamradio/scc.c +++ b/drivers/net/hamradio/scc.c | |||
@@ -209,7 +209,8 @@ static void scc_net_setup(struct net_device *dev); | |||
209 | static int scc_net_open(struct net_device *dev); | 209 | static int scc_net_open(struct net_device *dev); |
210 | static int scc_net_close(struct net_device *dev); | 210 | static int scc_net_close(struct net_device *dev); |
211 | static void scc_net_rx(struct scc_channel *scc, struct sk_buff *skb); | 211 | static void scc_net_rx(struct scc_channel *scc, struct sk_buff *skb); |
212 | static int scc_net_tx(struct sk_buff *skb, struct net_device *dev); | 212 | static netdev_tx_t scc_net_tx(struct sk_buff *skb, |
213 | struct net_device *dev); | ||
213 | static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); | 214 | static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); |
214 | static int scc_net_set_mac_address(struct net_device *dev, void *addr); | 215 | static int scc_net_set_mac_address(struct net_device *dev, void *addr); |
215 | static struct net_device_stats * scc_net_get_stats(struct net_device *dev); | 216 | static struct net_device_stats * scc_net_get_stats(struct net_device *dev); |
@@ -1634,7 +1635,7 @@ static void scc_net_rx(struct scc_channel *scc, struct sk_buff *skb) | |||
1634 | 1635 | ||
1635 | /* ----> transmit frame <---- */ | 1636 | /* ----> transmit frame <---- */ |
1636 | 1637 | ||
1637 | static int scc_net_tx(struct sk_buff *skb, struct net_device *dev) | 1638 | static netdev_tx_t scc_net_tx(struct sk_buff *skb, struct net_device *dev) |
1638 | { | 1639 | { |
1639 | struct scc_channel *scc = (struct scc_channel *) dev->ml_priv; | 1640 | struct scc_channel *scc = (struct scc_channel *) dev->ml_priv; |
1640 | unsigned long flags; | 1641 | unsigned long flags; |
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index b85aa162314e..694132e04af6 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c | |||
@@ -594,7 +594,8 @@ static void ptt_off(struct net_device *dev) | |||
594 | outb(PTT_OFF, MCR(dev->base_addr)); | 594 | outb(PTT_OFF, MCR(dev->base_addr)); |
595 | } | 595 | } |
596 | 596 | ||
597 | static int yam_send_packet(struct sk_buff *skb, struct net_device *dev) | 597 | static netdev_tx_t yam_send_packet(struct sk_buff *skb, |
598 | struct net_device *dev) | ||
598 | { | 599 | { |
599 | struct yam_port *yp = netdev_priv(dev); | 600 | struct yam_port *yp = netdev_priv(dev); |
600 | 601 | ||
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index d1b63387e9bc..a9a1a99f02dd 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -240,9 +240,10 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus, | |||
240 | 240 | ||
241 | static int hp100_open(struct net_device *dev); | 241 | static int hp100_open(struct net_device *dev); |
242 | static int hp100_close(struct net_device *dev); | 242 | static int hp100_close(struct net_device *dev); |
243 | static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev); | 243 | static netdev_tx_t hp100_start_xmit(struct sk_buff *skb, |
244 | static int hp100_start_xmit_bm(struct sk_buff *skb, | 244 | struct net_device *dev); |
245 | struct net_device *dev); | 245 | static netdev_tx_t hp100_start_xmit_bm(struct sk_buff *skb, |
246 | struct net_device *dev); | ||
246 | static void hp100_rx(struct net_device *dev); | 247 | static void hp100_rx(struct net_device *dev); |
247 | static struct net_device_stats *hp100_get_stats(struct net_device *dev); | 248 | static struct net_device_stats *hp100_get_stats(struct net_device *dev); |
248 | static void hp100_misc_interrupt(struct net_device *dev); | 249 | static void hp100_misc_interrupt(struct net_device *dev); |
@@ -1483,7 +1484,8 @@ static int hp100_check_lan(struct net_device *dev) | |||
1483 | */ | 1484 | */ |
1484 | 1485 | ||
1485 | /* tx function for busmaster mode */ | 1486 | /* tx function for busmaster mode */ |
1486 | static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | 1487 | static netdev_tx_t hp100_start_xmit_bm(struct sk_buff *skb, |
1488 | struct net_device *dev) | ||
1487 | { | 1489 | { |
1488 | unsigned long flags; | 1490 | unsigned long flags; |
1489 | int i, ok_flag; | 1491 | int i, ok_flag; |
@@ -1635,7 +1637,8 @@ static void hp100_clean_txring(struct net_device *dev) | |||
1635 | } | 1637 | } |
1636 | 1638 | ||
1637 | /* tx function for slave modes */ | 1639 | /* tx function for slave modes */ |
1638 | static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1640 | static netdev_tx_t hp100_start_xmit(struct sk_buff *skb, |
1641 | struct net_device *dev) | ||
1639 | { | 1642 | { |
1640 | unsigned long flags; | 1643 | unsigned long flags; |
1641 | int i, ok_flag; | 1644 | int i, ok_flag; |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 5443558c439d..d7579e4feefc 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -1305,6 +1305,8 @@ static int emac_close(struct net_device *ndev) | |||
1305 | 1305 | ||
1306 | free_irq(dev->emac_irq, dev); | 1306 | free_irq(dev->emac_irq, dev); |
1307 | 1307 | ||
1308 | netif_carrier_off(ndev); | ||
1309 | |||
1308 | return 0; | 1310 | return 0; |
1309 | } | 1311 | } |
1310 | 1312 | ||
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c index 448098d3b39b..090a6d3af112 100644 --- a/drivers/net/ibmlana.c +++ b/drivers/net/ibmlana.c | |||
@@ -812,7 +812,7 @@ static int ibmlana_close(struct net_device *dev) | |||
812 | 812 | ||
813 | /* transmit a block. */ | 813 | /* transmit a block. */ |
814 | 814 | ||
815 | static int ibmlana_tx(struct sk_buff *skb, struct net_device *dev) | 815 | static netdev_tx_t ibmlana_tx(struct sk_buff *skb, struct net_device *dev) |
816 | { | 816 | { |
817 | ibmlana_priv *priv = netdev_priv(dev); | 817 | ibmlana_priv *priv = netdev_priv(dev); |
818 | int tmplen, addr; | 818 | int tmplen, addr; |
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 76b295a18185..5862282ab2fe 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -887,7 +887,8 @@ static int ibmveth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
887 | 887 | ||
888 | #define page_offset(v) ((unsigned long)(v) & ((1 << 12) - 1)) | 888 | #define page_offset(v) ((unsigned long)(v) & ((1 << 12) - 1)) |
889 | 889 | ||
890 | static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) | 890 | static netdev_tx_t ibmveth_start_xmit(struct sk_buff *skb, |
891 | struct net_device *netdev) | ||
891 | { | 892 | { |
892 | struct ibmveth_adapter *adapter = netdev_priv(netdev); | 893 | struct ibmveth_adapter *adapter = netdev_priv(netdev); |
893 | union ibmveth_buf_desc desc; | 894 | union ibmveth_buf_desc desc; |
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 0a79b4517804..801f088c134f 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -59,7 +59,7 @@ struct ifb_private { | |||
59 | static int numifbs = 2; | 59 | static int numifbs = 2; |
60 | 60 | ||
61 | static void ri_tasklet(unsigned long dev); | 61 | static void ri_tasklet(unsigned long dev); |
62 | static int ifb_xmit(struct sk_buff *skb, struct net_device *dev); | 62 | static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev); |
63 | static int ifb_open(struct net_device *dev); | 63 | static int ifb_open(struct net_device *dev); |
64 | static int ifb_close(struct net_device *dev); | 64 | static int ifb_close(struct net_device *dev); |
65 | 65 | ||
@@ -160,11 +160,10 @@ static void ifb_setup(struct net_device *dev) | |||
160 | random_ether_addr(dev->dev_addr); | 160 | random_ether_addr(dev->dev_addr); |
161 | } | 161 | } |
162 | 162 | ||
163 | static int ifb_xmit(struct sk_buff *skb, struct net_device *dev) | 163 | static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev) |
164 | { | 164 | { |
165 | struct ifb_private *dp = netdev_priv(dev); | 165 | struct ifb_private *dp = netdev_priv(dev); |
166 | struct net_device_stats *stats = &dev->stats; | 166 | struct net_device_stats *stats = &dev->stats; |
167 | int ret = NETDEV_TX_OK; | ||
168 | u32 from = G_TC_FROM(skb->tc_verd); | 167 | u32 from = G_TC_FROM(skb->tc_verd); |
169 | 168 | ||
170 | stats->rx_packets++; | 169 | stats->rx_packets++; |
@@ -173,7 +172,7 @@ static int ifb_xmit(struct sk_buff *skb, struct net_device *dev) | |||
173 | if (!(from & (AT_INGRESS|AT_EGRESS)) || !skb->iif) { | 172 | if (!(from & (AT_INGRESS|AT_EGRESS)) || !skb->iif) { |
174 | dev_kfree_skb(skb); | 173 | dev_kfree_skb(skb); |
175 | stats->rx_dropped++; | 174 | stats->rx_dropped++; |
176 | return ret; | 175 | return NETDEV_TX_OK; |
177 | } | 176 | } |
178 | 177 | ||
179 | if (skb_queue_len(&dp->rq) >= dev->tx_queue_len) { | 178 | 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) | |||
187 | tasklet_schedule(&dp->ifb_tasklet); | 186 | tasklet_schedule(&dp->ifb_tasklet); |
188 | } | 187 | } |
189 | 188 | ||
190 | return ret; | 189 | return NETDEV_TX_OK; |
191 | } | 190 | } |
192 | 191 | ||
193 | static int ifb_close(struct net_device *dev) | 192 | static int ifb_close(struct net_device *dev) |
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index 114ccab1f2be..d004c359244c 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c | |||
@@ -2016,7 +2016,7 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data) | |||
2016 | } | 2016 | } |
2017 | } | 2017 | } |
2018 | 2018 | ||
2019 | static struct ethtool_ops igb_ethtool_ops = { | 2019 | static const struct ethtool_ops igb_ethtool_ops = { |
2020 | .get_settings = igb_get_settings, | 2020 | .get_settings = igb_get_settings, |
2021 | .set_settings = igb_set_settings, | 2021 | .set_settings = igb_set_settings, |
2022 | .get_drvinfo = igb_get_drvinfo, | 2022 | .get_drvinfo = igb_get_drvinfo, |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index cef4289d5716..7a054d99bff1 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -98,9 +98,11 @@ static void igb_set_multi(struct net_device *); | |||
98 | static void igb_update_phy_info(unsigned long); | 98 | static void igb_update_phy_info(unsigned long); |
99 | static void igb_watchdog(unsigned long); | 99 | static void igb_watchdog(unsigned long); |
100 | static void igb_watchdog_task(struct work_struct *); | 100 | static void igb_watchdog_task(struct work_struct *); |
101 | static int igb_xmit_frame_ring_adv(struct sk_buff *, struct net_device *, | 101 | static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *, |
102 | struct igb_ring *); | 102 | struct net_device *, |
103 | static int igb_xmit_frame_adv(struct sk_buff *skb, struct net_device *); | 103 | struct igb_ring *); |
104 | static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb, | ||
105 | struct net_device *); | ||
104 | static struct net_device_stats *igb_get_stats(struct net_device *); | 106 | static struct net_device_stats *igb_get_stats(struct net_device *); |
105 | static int igb_change_mtu(struct net_device *, int); | 107 | static int igb_change_mtu(struct net_device *, int); |
106 | static int igb_set_mac(struct net_device *, void *); | 108 | static int igb_set_mac(struct net_device *, void *); |
@@ -3295,9 +3297,9 @@ static int igb_maybe_stop_tx(struct net_device *netdev, | |||
3295 | return __igb_maybe_stop_tx(netdev, tx_ring, size); | 3297 | return __igb_maybe_stop_tx(netdev, tx_ring, size); |
3296 | } | 3298 | } |
3297 | 3299 | ||
3298 | static int igb_xmit_frame_ring_adv(struct sk_buff *skb, | 3300 | static netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb, |
3299 | struct net_device *netdev, | 3301 | struct net_device *netdev, |
3300 | struct igb_ring *tx_ring) | 3302 | struct igb_ring *tx_ring) |
3301 | { | 3303 | { |
3302 | struct igb_adapter *adapter = netdev_priv(netdev); | 3304 | struct igb_adapter *adapter = netdev_priv(netdev); |
3303 | unsigned int first; | 3305 | unsigned int first; |
@@ -3385,7 +3387,8 @@ static int igb_xmit_frame_ring_adv(struct sk_buff *skb, | |||
3385 | return NETDEV_TX_OK; | 3387 | return NETDEV_TX_OK; |
3386 | } | 3388 | } |
3387 | 3389 | ||
3388 | static int igb_xmit_frame_adv(struct sk_buff *skb, struct net_device *netdev) | 3390 | static netdev_tx_t igb_xmit_frame_adv(struct sk_buff *skb, |
3391 | struct net_device *netdev) | ||
3389 | { | 3392 | { |
3390 | struct igb_adapter *adapter = netdev_priv(netdev); | 3393 | struct igb_adapter *adapter = netdev_priv(netdev); |
3391 | struct igb_ring *tx_ring; | 3394 | struct igb_ring *tx_ring; |
@@ -3398,7 +3401,7 @@ static int igb_xmit_frame_adv(struct sk_buff *skb, struct net_device *netdev) | |||
3398 | * to a flow. Right now, performance is impacted slightly negatively | 3401 | * to a flow. Right now, performance is impacted slightly negatively |
3399 | * if using multiple tx queues. If the stack breaks away from a | 3402 | * if using multiple tx queues. If the stack breaks away from a |
3400 | * single qdisc implementation, we can look at this again. */ | 3403 | * single qdisc implementation, we can look at this again. */ |
3401 | return (igb_xmit_frame_ring_adv(skb, netdev, tx_ring)); | 3404 | return igb_xmit_frame_ring_adv(skb, netdev, tx_ring); |
3402 | } | 3405 | } |
3403 | 3406 | ||
3404 | /** | 3407 | /** |
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index 3f03c42ece97..dadb78229ad5 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -2204,9 +2204,9 @@ static inline void igbvf_tx_queue_adv(struct igbvf_adapter *adapter, | |||
2204 | mmiowb(); | 2204 | mmiowb(); |
2205 | } | 2205 | } |
2206 | 2206 | ||
2207 | static int igbvf_xmit_frame_ring_adv(struct sk_buff *skb, | 2207 | static netdev_tx_t igbvf_xmit_frame_ring_adv(struct sk_buff *skb, |
2208 | struct net_device *netdev, | 2208 | struct net_device *netdev, |
2209 | struct igbvf_ring *tx_ring) | 2209 | struct igbvf_ring *tx_ring) |
2210 | { | 2210 | { |
2211 | struct igbvf_adapter *adapter = netdev_priv(netdev); | 2211 | struct igbvf_adapter *adapter = netdev_priv(netdev); |
2212 | unsigned int first, tx_flags = 0; | 2212 | unsigned int first, tx_flags = 0; |
@@ -2279,11 +2279,11 @@ static int igbvf_xmit_frame_ring_adv(struct sk_buff *skb, | |||
2279 | return NETDEV_TX_OK; | 2279 | return NETDEV_TX_OK; |
2280 | } | 2280 | } |
2281 | 2281 | ||
2282 | static int igbvf_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 2282 | static netdev_tx_t igbvf_xmit_frame(struct sk_buff *skb, |
2283 | struct net_device *netdev) | ||
2283 | { | 2284 | { |
2284 | struct igbvf_adapter *adapter = netdev_priv(netdev); | 2285 | struct igbvf_adapter *adapter = netdev_priv(netdev); |
2285 | struct igbvf_ring *tx_ring; | 2286 | struct igbvf_ring *tx_ring; |
2286 | int retval; | ||
2287 | 2287 | ||
2288 | if (test_bit(__IGBVF_DOWN, &adapter->state)) { | 2288 | if (test_bit(__IGBVF_DOWN, &adapter->state)) { |
2289 | dev_kfree_skb_any(skb); | 2289 | dev_kfree_skb_any(skb); |
@@ -2292,9 +2292,7 @@ static int igbvf_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2292 | 2292 | ||
2293 | tx_ring = &adapter->tx_ring[0]; | 2293 | tx_ring = &adapter->tx_ring[0]; |
2294 | 2294 | ||
2295 | retval = igbvf_xmit_frame_ring_adv(skb, netdev, tx_ring); | 2295 | return igbvf_xmit_frame_ring_adv(skb, netdev, tx_ring); |
2296 | |||
2297 | return retval; | ||
2298 | } | 2296 | } |
2299 | 2297 | ||
2300 | /** | 2298 | /** |
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 43019461b776..9f7b5d4172b8 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c | |||
@@ -1858,7 +1858,8 @@ static int ipg_nic_stop(struct net_device *dev) | |||
1858 | return 0; | 1858 | return 0; |
1859 | } | 1859 | } |
1860 | 1860 | ||
1861 | static int ipg_nic_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1861 | static netdev_tx_t ipg_nic_hard_start_xmit(struct sk_buff *skb, |
1862 | struct net_device *dev) | ||
1862 | { | 1863 | { |
1863 | struct ipg_nic_private *sp = netdev_priv(dev); | 1864 | struct ipg_nic_private *sp = netdev_priv(dev); |
1864 | void __iomem *ioaddr = sp->ioaddr; | 1865 | void __iomem *ioaddr = sp->ioaddr; |
@@ -2185,7 +2186,7 @@ static int ipg_nway_reset(struct net_device *dev) | |||
2185 | return rc; | 2186 | return rc; |
2186 | } | 2187 | } |
2187 | 2188 | ||
2188 | static struct ethtool_ops ipg_ethtool_ops = { | 2189 | static const struct ethtool_ops ipg_ethtool_ops = { |
2189 | .get_settings = ipg_get_settings, | 2190 | .get_settings = ipg_get_settings, |
2190 | .set_settings = ipg_set_settings, | 2191 | .set_settings = ipg_set_settings, |
2191 | .nway_reset = ipg_nway_reset, | 2192 | .nway_reset = ipg_nway_reset, |
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c index f0d0cea6e329..12c7b006f767 100644 --- a/drivers/net/irda/ali-ircc.c +++ b/drivers/net/irda/ali-ircc.c | |||
@@ -111,7 +111,8 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd | |||
111 | static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud); | 111 | static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud); |
112 | 112 | ||
113 | /* SIR function */ | 113 | /* SIR function */ |
114 | static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev); | 114 | static netdev_tx_t ali_ircc_sir_hard_xmit(struct sk_buff *skb, |
115 | struct net_device *dev); | ||
115 | static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self); | 116 | static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self); |
116 | static void ali_ircc_sir_receive(struct ali_ircc_cb *self); | 117 | static void ali_ircc_sir_receive(struct ali_ircc_cb *self); |
117 | static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self); | 118 | static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self); |
@@ -119,7 +120,8 @@ static int ali_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len); | |||
119 | static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed); | 120 | static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed); |
120 | 121 | ||
121 | /* FIR function */ | 122 | /* FIR function */ |
122 | static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev); | 123 | static netdev_tx_t ali_ircc_fir_hard_xmit(struct sk_buff *skb, |
124 | struct net_device *dev); | ||
123 | static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 speed); | 125 | static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 speed); |
124 | static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self); | 126 | static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self); |
125 | static int ali_ircc_dma_receive(struct ali_ircc_cb *self); | 127 | static int ali_ircc_dma_receive(struct ali_ircc_cb *self); |
@@ -1435,7 +1437,8 @@ static int ali_ircc_net_close(struct net_device *dev) | |||
1435 | * Transmit the frame | 1437 | * Transmit the frame |
1436 | * | 1438 | * |
1437 | */ | 1439 | */ |
1438 | static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | 1440 | static netdev_tx_t ali_ircc_fir_hard_xmit(struct sk_buff *skb, |
1441 | struct net_device *dev) | ||
1439 | { | 1442 | { |
1440 | struct ali_ircc_cb *self; | 1443 | struct ali_ircc_cb *self; |
1441 | unsigned long flags; | 1444 | unsigned long flags; |
@@ -1957,7 +1960,8 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1957 | * Transmit the frame! | 1960 | * Transmit the frame! |
1958 | * | 1961 | * |
1959 | */ | 1962 | */ |
1960 | static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | 1963 | static netdev_tx_t ali_ircc_sir_hard_xmit(struct sk_buff *skb, |
1964 | struct net_device *dev) | ||
1961 | { | 1965 | { |
1962 | struct ali_ircc_cb *self; | 1966 | struct ali_ircc_cb *self; |
1963 | unsigned long flags; | 1967 | unsigned long flags; |
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c index 22baf65e1563..eb424681202d 100644 --- a/drivers/net/irda/au1k_ir.c +++ b/drivers/net/irda/au1k_ir.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
25 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
26 | #include <linux/etherdevice.h> | ||
27 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
28 | #include <linux/rtnetlink.h> | 27 | #include <linux/rtnetlink.h> |
29 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
@@ -205,9 +204,6 @@ static const struct net_device_ops au1k_irda_netdev_ops = { | |||
205 | .ndo_start_xmit = au1k_irda_hard_xmit, | 204 | .ndo_start_xmit = au1k_irda_hard_xmit, |
206 | .ndo_tx_timeout = au1k_tx_timeout, | 205 | .ndo_tx_timeout = au1k_tx_timeout, |
207 | .ndo_do_ioctl = au1k_irda_ioctl, | 206 | .ndo_do_ioctl = au1k_irda_ioctl, |
208 | .ndo_change_mtu = eth_change_mtu, | ||
209 | .ndo_validate_addr = eth_validate_addr, | ||
210 | .ndo_set_mac_address = eth_mac_addr, | ||
211 | }; | 207 | }; |
212 | 208 | ||
213 | static int au1k_irda_net_init(struct net_device *dev) | 209 | static int au1k_irda_net_init(struct net_device *dev) |
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index e4e905698dc7..2d7b5c1d5572 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -970,7 +970,7 @@ toshoboe_probe (struct toshoboe_cb *self) | |||
970 | /* Netdev style code */ | 970 | /* Netdev style code */ |
971 | 971 | ||
972 | /* Transmit something */ | 972 | /* Transmit something */ |
973 | static int | 973 | static netdev_tx_t |
974 | toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev) | 974 | toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev) |
975 | { | 975 | { |
976 | struct toshoboe_cb *self; | 976 | struct toshoboe_cb *self; |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 6a1aa7a40fe2..215adf6377d0 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -111,7 +111,8 @@ static void irda_usb_init_qos(struct irda_usb_cb *self) ; | |||
111 | static struct irda_class_desc *irda_usb_find_class_desc(struct usb_interface *intf); | 111 | static struct irda_class_desc *irda_usb_find_class_desc(struct usb_interface *intf); |
112 | static void irda_usb_disconnect(struct usb_interface *intf); | 112 | static void irda_usb_disconnect(struct usb_interface *intf); |
113 | static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self); | 113 | static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self); |
114 | static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *dev); | 114 | static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb, |
115 | struct net_device *dev); | ||
115 | static int irda_usb_open(struct irda_usb_cb *self); | 116 | static int irda_usb_open(struct irda_usb_cb *self); |
116 | static void irda_usb_close(struct irda_usb_cb *self); | 117 | static void irda_usb_close(struct irda_usb_cb *self); |
117 | static void speed_bulk_callback(struct urb *urb); | 118 | static void speed_bulk_callback(struct urb *urb); |
@@ -381,7 +382,8 @@ static void speed_bulk_callback(struct urb *urb) | |||
381 | /* | 382 | /* |
382 | * Send an IrDA frame to the USB dongle (for transmission) | 383 | * Send an IrDA frame to the USB dongle (for transmission) |
383 | */ | 384 | */ |
384 | static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | 385 | static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb, |
386 | struct net_device *netdev) | ||
385 | { | 387 | { |
386 | struct irda_usb_cb *self = netdev_priv(netdev); | 388 | struct irda_usb_cb *self = netdev_priv(netdev); |
387 | struct urb *urb = self->tx_urb; | 389 | struct urb *urb = self->tx_urb; |
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c index c3e4e2c435ba..2fc30b449eea 100644 --- a/drivers/net/irda/kingsun-sir.c +++ b/drivers/net/irda/kingsun-sir.c | |||
@@ -150,7 +150,8 @@ static void kingsun_send_irq(struct urb *urb) | |||
150 | /* | 150 | /* |
151 | * Called from net/core when new frame is available. | 151 | * Called from net/core when new frame is available. |
152 | */ | 152 | */ |
153 | static int kingsun_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | 153 | static netdev_tx_t kingsun_hard_xmit(struct sk_buff *skb, |
154 | struct net_device *netdev) | ||
154 | { | 155 | { |
155 | struct kingsun_cb *kingsun; | 156 | struct kingsun_cb *kingsun; |
156 | int wraplen; | 157 | int wraplen; |
@@ -416,7 +417,7 @@ static int kingsun_net_ioctl(struct net_device *netdev, struct ifreq *rq, | |||
416 | } | 417 | } |
417 | 418 | ||
418 | static const struct net_device_ops kingsun_ops = { | 419 | static const struct net_device_ops kingsun_ops = { |
419 | .ndo_start_xmit = kingsun_hard_xmit, | 420 | .ndo_start_xmit = kingsun_hard_xmit, |
420 | .ndo_open = kingsun_net_open, | 421 | .ndo_open = kingsun_net_open, |
421 | .ndo_stop = kingsun_net_close, | 422 | .ndo_stop = kingsun_net_close, |
422 | .ndo_do_ioctl = kingsun_net_ioctl, | 423 | .ndo_do_ioctl = kingsun_net_ioctl, |
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c index d73b8b64fcb9..f4d13fc51cbc 100644 --- a/drivers/net/irda/ks959-sir.c +++ b/drivers/net/irda/ks959-sir.c | |||
@@ -385,7 +385,8 @@ static void ks959_send_irq(struct urb *urb) | |||
385 | /* | 385 | /* |
386 | * Called from net/core when new frame is available. | 386 | * Called from net/core when new frame is available. |
387 | */ | 387 | */ |
388 | static int ks959_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | 388 | static netdev_tx_t ks959_hard_xmit(struct sk_buff *skb, |
389 | struct net_device *netdev) | ||
389 | { | 390 | { |
390 | struct ks959_cb *kingsun; | 391 | struct ks959_cb *kingsun; |
391 | unsigned int wraplen; | 392 | unsigned int wraplen; |
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c index 1ef45ec74422..5f9d73353972 100644 --- a/drivers/net/irda/ksdazzle-sir.c +++ b/drivers/net/irda/ksdazzle-sir.c | |||
@@ -298,7 +298,8 @@ static void ksdazzle_send_irq(struct urb *urb) | |||
298 | /* | 298 | /* |
299 | * Called from net/core when new frame is available. | 299 | * Called from net/core when new frame is available. |
300 | */ | 300 | */ |
301 | static int ksdazzle_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | 301 | static netdev_tx_t ksdazzle_hard_xmit(struct sk_buff *skb, |
302 | struct net_device *netdev) | ||
302 | { | 303 | { |
303 | struct ksdazzle_cb *kingsun; | 304 | struct ksdazzle_cb *kingsun; |
304 | unsigned int wraplen; | 305 | unsigned int wraplen; |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index f4df1001983c..b3d30bcb88e7 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -817,7 +817,8 @@ static void mcs_send_irq(struct urb *urb) | |||
817 | } | 817 | } |
818 | 818 | ||
819 | /* Transmit callback funtion. */ | 819 | /* Transmit callback funtion. */ |
820 | static int mcs_hard_xmit(struct sk_buff *skb, struct net_device *ndev) | 820 | static netdev_tx_t mcs_hard_xmit(struct sk_buff *skb, |
821 | struct net_device *ndev) | ||
821 | { | 822 | { |
822 | unsigned long flags; | 823 | unsigned long flags; |
823 | struct mcs_cb *mcs; | 824 | struct mcs_cb *mcs; |
diff --git a/drivers/net/irda/mcs7780.h b/drivers/net/irda/mcs7780.h index 6bdc621e67c6..b10689b2887c 100644 --- a/drivers/net/irda/mcs7780.h +++ b/drivers/net/irda/mcs7780.h | |||
@@ -156,7 +156,8 @@ static int mcs_net_open(struct net_device *netdev); | |||
156 | 156 | ||
157 | static void mcs_receive_irq(struct urb *urb); | 157 | static void mcs_receive_irq(struct urb *urb); |
158 | static void mcs_send_irq(struct urb *urb); | 158 | static void mcs_send_irq(struct urb *urb); |
159 | static int mcs_hard_xmit(struct sk_buff *skb, struct net_device *netdev); | 159 | static netdev_tx_t mcs_hard_xmit(struct sk_buff *skb, |
160 | struct net_device *netdev); | ||
160 | 161 | ||
161 | static int mcs_probe(struct usb_interface *intf, | 162 | static int mcs_probe(struct usb_interface *intf, |
162 | const struct usb_device_id *id); | 163 | const struct usb_device_id *id); |
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index 51ca89c9a0ba..2413295ebd90 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c | |||
@@ -173,8 +173,10 @@ static int nsc_ircc_setup(chipio_t *info); | |||
173 | static void nsc_ircc_pio_receive(struct nsc_ircc_cb *self); | 173 | static void nsc_ircc_pio_receive(struct nsc_ircc_cb *self); |
174 | static int nsc_ircc_dma_receive(struct nsc_ircc_cb *self); | 174 | static int nsc_ircc_dma_receive(struct nsc_ircc_cb *self); |
175 | static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase); | 175 | static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase); |
176 | static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev); | 176 | static netdev_tx_t nsc_ircc_hard_xmit_sir(struct sk_buff *skb, |
177 | static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev); | 177 | struct net_device *dev); |
178 | static netdev_tx_t nsc_ircc_hard_xmit_fir(struct sk_buff *skb, | ||
179 | struct net_device *dev); | ||
178 | static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size); | 180 | static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size); |
179 | static void nsc_ircc_dma_xmit(struct nsc_ircc_cb *self, int iobase); | 181 | static void nsc_ircc_dma_xmit(struct nsc_ircc_cb *self, int iobase); |
180 | static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 baud); | 182 | static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 baud); |
@@ -1355,7 +1357,8 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed) | |||
1355 | * Transmit the frame! | 1357 | * Transmit the frame! |
1356 | * | 1358 | * |
1357 | */ | 1359 | */ |
1358 | static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev) | 1360 | static netdev_tx_t nsc_ircc_hard_xmit_sir(struct sk_buff *skb, |
1361 | struct net_device *dev) | ||
1359 | { | 1362 | { |
1360 | struct nsc_ircc_cb *self; | 1363 | struct nsc_ircc_cb *self; |
1361 | unsigned long flags; | 1364 | unsigned long flags; |
@@ -1427,7 +1430,8 @@ static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev) | |||
1427 | return NETDEV_TX_OK; | 1430 | return NETDEV_TX_OK; |
1428 | } | 1431 | } |
1429 | 1432 | ||
1430 | static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev) | 1433 | static netdev_tx_t nsc_ircc_hard_xmit_fir(struct sk_buff *skb, |
1434 | struct net_device *dev) | ||
1431 | { | 1435 | { |
1432 | struct nsc_ircc_cb *self; | 1436 | struct nsc_ircc_cb *self; |
1433 | unsigned long flags; | 1437 | unsigned long flags; |
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index e76a083f901a..1445e5865196 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c | |||
@@ -803,9 +803,6 @@ static const struct net_device_ops pxa_irda_netdev_ops = { | |||
803 | .ndo_stop = pxa_irda_stop, | 803 | .ndo_stop = pxa_irda_stop, |
804 | .ndo_start_xmit = pxa_irda_hard_xmit, | 804 | .ndo_start_xmit = pxa_irda_hard_xmit, |
805 | .ndo_do_ioctl = pxa_irda_ioctl, | 805 | .ndo_do_ioctl = pxa_irda_ioctl, |
806 | .ndo_change_mtu = eth_change_mtu, | ||
807 | .ndo_validate_addr = eth_validate_addr, | ||
808 | .ndo_set_mac_address = eth_mac_addr, | ||
809 | }; | 806 | }; |
810 | 807 | ||
811 | static int pxa_irda_probe(struct platform_device *pdev) | 808 | static int pxa_irda_probe(struct platform_device *pdev) |
@@ -830,6 +827,7 @@ static int pxa_irda_probe(struct platform_device *pdev) | |||
830 | if (!dev) | 827 | if (!dev) |
831 | goto err_mem_3; | 828 | goto err_mem_3; |
832 | 829 | ||
830 | SET_NETDEV_DEV(dev, &pdev->dev); | ||
833 | si = netdev_priv(dev); | 831 | si = netdev_priv(dev); |
834 | si->dev = &pdev->dev; | 832 | si->dev = &pdev->dev; |
835 | si->pdata = pdev->dev.platform_data; | 833 | si->pdata = pdev->dev.platform_data; |
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c index 70e6acc597b0..38bf7cf2256d 100644 --- a/drivers/net/irda/sa1100_ir.c +++ b/drivers/net/irda/sa1100_ir.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/errno.h> | 25 | #include <linux/errno.h> |
26 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
27 | #include <linux/etherdevice.h> | ||
28 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
29 | #include <linux/rtnetlink.h> | 28 | #include <linux/rtnetlink.h> |
30 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
@@ -881,9 +880,6 @@ static const struct net_device_ops sa1100_irda_netdev_ops = { | |||
881 | .ndo_stop = sa1100_irda_stop, | 880 | .ndo_stop = sa1100_irda_stop, |
882 | .ndo_start_xmit = sa1100_irda_hard_xmit, | 881 | .ndo_start_xmit = sa1100_irda_hard_xmit, |
883 | .ndo_do_ioctl = sa1100_irda_ioctl, | 882 | .ndo_do_ioctl = sa1100_irda_ioctl, |
884 | .ndo_change_mtu = eth_change_mtu, | ||
885 | .ndo_validate_addr = eth_validate_addr, | ||
886 | .ndo_set_mac_address = eth_mac_addr, | ||
887 | }; | 883 | }; |
888 | 884 | ||
889 | static int sa1100_irda_probe(struct platform_device *pdev) | 885 | static int sa1100_irda_probe(struct platform_device *pdev) |
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index 71dce20e62be..4b2a1a9eac2a 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c | |||
@@ -582,7 +582,8 @@ EXPORT_SYMBOL(sirdev_receive); | |||
582 | 582 | ||
583 | /* callbacks from network layer */ | 583 | /* callbacks from network layer */ |
584 | 584 | ||
585 | static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev) | 585 | static netdev_tx_t sirdev_hard_xmit(struct sk_buff *skb, |
586 | struct net_device *ndev) | ||
586 | { | 587 | { |
587 | struct sir_dev *dev = netdev_priv(ndev); | 588 | struct sir_dev *dev = netdev_priv(ndev); |
588 | unsigned long flags; | 589 | unsigned long flags; |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index 15f8a7f81600..1e8dd8c74a64 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -194,8 +194,10 @@ static int __exit smsc_ircc_close(struct smsc_ircc_cb *self); | |||
194 | static int smsc_ircc_dma_receive(struct smsc_ircc_cb *self); | 194 | static int smsc_ircc_dma_receive(struct smsc_ircc_cb *self); |
195 | static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self); | 195 | static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self); |
196 | static void smsc_ircc_sir_receive(struct smsc_ircc_cb *self); | 196 | static void smsc_ircc_sir_receive(struct smsc_ircc_cb *self); |
197 | static int smsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev); | 197 | static netdev_tx_t smsc_ircc_hard_xmit_sir(struct sk_buff *skb, |
198 | static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev); | 198 | struct net_device *dev); |
199 | static netdev_tx_t smsc_ircc_hard_xmit_fir(struct sk_buff *skb, | ||
200 | struct net_device *dev); | ||
199 | static void smsc_ircc_dma_xmit(struct smsc_ircc_cb *self, int bofs); | 201 | static void smsc_ircc_dma_xmit(struct smsc_ircc_cb *self, int bofs); |
200 | static void smsc_ircc_dma_xmit_complete(struct smsc_ircc_cb *self); | 202 | static void smsc_ircc_dma_xmit_complete(struct smsc_ircc_cb *self); |
201 | static void smsc_ircc_change_speed(struct smsc_ircc_cb *self, u32 speed); | 203 | static void smsc_ircc_change_speed(struct smsc_ircc_cb *self, u32 speed); |
@@ -486,7 +488,8 @@ static int __init smsc_ircc_init(void) | |||
486 | return ret; | 488 | return ret; |
487 | } | 489 | } |
488 | 490 | ||
489 | static int smsc_ircc_net_xmit(struct sk_buff *skb, struct net_device *dev) | 491 | static netdev_tx_t smsc_ircc_net_xmit(struct sk_buff *skb, |
492 | struct net_device *dev) | ||
490 | { | 493 | { |
491 | struct smsc_ircc_cb *self = netdev_priv(dev); | 494 | struct smsc_ircc_cb *self = netdev_priv(dev); |
492 | 495 | ||
@@ -878,7 +881,8 @@ static void smsc_ircc_timeout(struct net_device *dev) | |||
878 | * waits until the next transmit interrupt, and continues until the | 881 | * waits until the next transmit interrupt, and continues until the |
879 | * frame is transmitted. | 882 | * frame is transmitted. |
880 | */ | 883 | */ |
881 | static int smsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev) | 884 | static netdev_tx_t smsc_ircc_hard_xmit_sir(struct sk_buff *skb, |
885 | struct net_device *dev) | ||
882 | { | 886 | { |
883 | struct smsc_ircc_cb *self; | 887 | struct smsc_ircc_cb *self; |
884 | unsigned long flags; | 888 | unsigned long flags; |
@@ -1183,7 +1187,8 @@ static void smsc_ircc_set_sir_speed(struct smsc_ircc_cb *self, __u32 speed) | |||
1183 | * Transmit the frame! | 1187 | * Transmit the frame! |
1184 | * | 1188 | * |
1185 | */ | 1189 | */ |
1186 | static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev) | 1190 | static netdev_tx_t smsc_ircc_hard_xmit_fir(struct sk_buff *skb, |
1191 | struct net_device *dev) | ||
1187 | { | 1192 | { |
1188 | struct smsc_ircc_cb *self; | 1193 | struct smsc_ircc_cb *self; |
1189 | unsigned long flags; | 1194 | unsigned long flags; |
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index c475b23091bc..528767dec9d7 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -560,7 +560,8 @@ static int change_speed(struct stir_cb *stir, unsigned speed) | |||
560 | /* | 560 | /* |
561 | * Called from net/core when new frame is available. | 561 | * Called from net/core when new frame is available. |
562 | */ | 562 | */ |
563 | static int stir_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | 563 | static netdev_tx_t stir_hard_xmit(struct sk_buff *skb, |
564 | struct net_device *netdev) | ||
564 | { | 565 | { |
565 | struct stir_cb *stir = netdev_priv(netdev); | 566 | struct stir_cb *stir = netdev_priv(netdev); |
566 | 567 | ||
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index 36a60748447b..a5ca71cec028 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -87,10 +87,10 @@ static int via_ircc_close(struct via_ircc_cb *self); | |||
87 | static int via_ircc_dma_receive(struct via_ircc_cb *self); | 87 | static int via_ircc_dma_receive(struct via_ircc_cb *self); |
88 | static int via_ircc_dma_receive_complete(struct via_ircc_cb *self, | 88 | static int via_ircc_dma_receive_complete(struct via_ircc_cb *self, |
89 | int iobase); | 89 | int iobase); |
90 | static int via_ircc_hard_xmit_sir(struct sk_buff *skb, | 90 | static netdev_tx_t via_ircc_hard_xmit_sir(struct sk_buff *skb, |
91 | struct net_device *dev); | 91 | struct net_device *dev); |
92 | static int via_ircc_hard_xmit_fir(struct sk_buff *skb, | 92 | static netdev_tx_t via_ircc_hard_xmit_fir(struct sk_buff *skb, |
93 | struct net_device *dev); | 93 | struct net_device *dev); |
94 | static void via_hw_init(struct via_ircc_cb *self); | 94 | static void via_hw_init(struct via_ircc_cb *self); |
95 | static void via_ircc_change_speed(struct via_ircc_cb *self, __u32 baud); | 95 | static void via_ircc_change_speed(struct via_ircc_cb *self, __u32 baud); |
96 | static irqreturn_t via_ircc_interrupt(int irq, void *dev_id); | 96 | static irqreturn_t via_ircc_interrupt(int irq, void *dev_id); |
@@ -823,8 +823,8 @@ static void via_ircc_change_speed(struct via_ircc_cb *self, __u32 speed) | |||
823 | * Transmit the frame! | 823 | * Transmit the frame! |
824 | * | 824 | * |
825 | */ | 825 | */ |
826 | static int via_ircc_hard_xmit_sir(struct sk_buff *skb, | 826 | static netdev_tx_t via_ircc_hard_xmit_sir(struct sk_buff *skb, |
827 | struct net_device *dev) | 827 | struct net_device *dev) |
828 | { | 828 | { |
829 | struct via_ircc_cb *self; | 829 | struct via_ircc_cb *self; |
830 | unsigned long flags; | 830 | unsigned long flags; |
@@ -895,8 +895,8 @@ static int via_ircc_hard_xmit_sir(struct sk_buff *skb, | |||
895 | return NETDEV_TX_OK; | 895 | return NETDEV_TX_OK; |
896 | } | 896 | } |
897 | 897 | ||
898 | static int via_ircc_hard_xmit_fir(struct sk_buff *skb, | 898 | static netdev_tx_t via_ircc_hard_xmit_fir(struct sk_buff *skb, |
899 | struct net_device *dev) | 899 | struct net_device *dev) |
900 | { | 900 | { |
901 | struct via_ircc_cb *self; | 901 | struct via_ircc_cb *self; |
902 | u16 iobase; | 902 | u16 iobase; |
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c index 08e26f1297b4..7cfb8b6593c6 100644 --- a/drivers/net/irda/vlsi_ir.c +++ b/drivers/net/irda/vlsi_ir.c | |||
@@ -854,7 +854,8 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) | |||
854 | return ret; | 854 | return ret; |
855 | } | 855 | } |
856 | 856 | ||
857 | static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) | 857 | static netdev_tx_t vlsi_hard_start_xmit(struct sk_buff *skb, |
858 | struct net_device *ndev) | ||
858 | { | 859 | { |
859 | vlsi_irda_dev_t *idev = netdev_priv(ndev); | 860 | vlsi_irda_dev_t *idev = netdev_priv(ndev); |
860 | struct vlsi_ring *r = idev->tx_ring; | 861 | struct vlsi_ring *r = idev->tx_ring; |
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index 462bc437080f..551810fd2976 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c | |||
@@ -93,7 +93,8 @@ static int w83977af_close(struct w83977af_ir *self); | |||
93 | static int w83977af_probe(int iobase, int irq, int dma); | 93 | static int w83977af_probe(int iobase, int irq, int dma); |
94 | static int w83977af_dma_receive(struct w83977af_ir *self); | 94 | static int w83977af_dma_receive(struct w83977af_ir *self); |
95 | static int w83977af_dma_receive_complete(struct w83977af_ir *self); | 95 | static int w83977af_dma_receive_complete(struct w83977af_ir *self); |
96 | static int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev); | 96 | static netdev_tx_t w83977af_hard_xmit(struct sk_buff *skb, |
97 | struct net_device *dev); | ||
97 | static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size); | 98 | static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size); |
98 | static void w83977af_dma_write(struct w83977af_ir *self, int iobase); | 99 | static void w83977af_dma_write(struct w83977af_ir *self, int iobase); |
99 | static void w83977af_change_speed(struct w83977af_ir *self, __u32 speed); | 100 | static void w83977af_change_speed(struct w83977af_ir *self, __u32 speed); |
@@ -490,7 +491,8 @@ static void w83977af_change_speed(struct w83977af_ir *self, __u32 speed) | |||
490 | * Sets up a DMA transfer to send the current frame. | 491 | * Sets up a DMA transfer to send the current frame. |
491 | * | 492 | * |
492 | */ | 493 | */ |
493 | static int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev) | 494 | static netdev_tx_t w83977af_hard_xmit(struct sk_buff *skb, |
495 | struct net_device *dev) | ||
494 | { | 496 | { |
495 | struct w83977af_ir *self; | 497 | struct w83977af_ir *self; |
496 | __s32 speed; | 498 | __s32 speed; |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index fad08ce8a6c3..8aa44dca57eb 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -81,7 +81,8 @@ static void ixgb_clean_tx_ring(struct ixgb_adapter *adapter); | |||
81 | static void ixgb_clean_rx_ring(struct ixgb_adapter *adapter); | 81 | static void ixgb_clean_rx_ring(struct ixgb_adapter *adapter); |
82 | static void ixgb_set_multi(struct net_device *netdev); | 82 | static void ixgb_set_multi(struct net_device *netdev); |
83 | static void ixgb_watchdog(unsigned long data); | 83 | static void ixgb_watchdog(unsigned long data); |
84 | static int ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev); | 84 | static netdev_tx_t ixgb_xmit_frame(struct sk_buff *skb, |
85 | struct net_device *netdev); | ||
85 | static struct net_device_stats *ixgb_get_stats(struct net_device *netdev); | 86 | static struct net_device_stats *ixgb_get_stats(struct net_device *netdev); |
86 | static int ixgb_change_mtu(struct net_device *netdev, int new_mtu); | 87 | static int ixgb_change_mtu(struct net_device *netdev, int new_mtu); |
87 | static int ixgb_set_mac(struct net_device *netdev, void *p); | 88 | static int ixgb_set_mac(struct net_device *netdev, void *p); |
@@ -1442,7 +1443,7 @@ static int ixgb_maybe_stop_tx(struct net_device *netdev, | |||
1442 | MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 /* for context */ \ | 1443 | MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 /* for context */ \ |
1443 | + 1 /* one more needed for sentinel TSO workaround */ | 1444 | + 1 /* one more needed for sentinel TSO workaround */ |
1444 | 1445 | ||
1445 | static int | 1446 | static netdev_tx_t |
1446 | ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 1447 | ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) |
1447 | { | 1448 | { |
1448 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 1449 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index c983c89630af..dd688d45e9cd 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -450,6 +450,12 @@ extern int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter, | |||
450 | extern int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid, | 450 | extern int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid, |
451 | struct scatterlist *sgl, unsigned int sgc); | 451 | struct scatterlist *sgl, unsigned int sgc); |
452 | extern int ixgbe_fcoe_ddp_put(struct net_device *netdev, u16 xid); | 452 | extern int ixgbe_fcoe_ddp_put(struct net_device *netdev, u16 xid); |
453 | extern int ixgbe_fcoe_enable(struct net_device *netdev); | ||
454 | extern int ixgbe_fcoe_disable(struct net_device *netdev); | ||
455 | #ifdef CONFIG_IXGBE_DCB | ||
456 | extern u8 ixgbe_fcoe_getapp(struct ixgbe_adapter *adapter); | ||
457 | extern u8 ixgbe_fcoe_setapp(struct ixgbe_adapter *adapter, u8 up); | ||
458 | #endif /* CONFIG_IXGBE_DCB */ | ||
453 | #endif /* IXGBE_FCOE */ | 459 | #endif /* IXGBE_FCOE */ |
454 | 460 | ||
455 | #endif /* _IXGBE_H_ */ | 461 | #endif /* _IXGBE_H_ */ |
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index 916430f2a7e7..cb7f0c3c6e16 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -41,8 +41,7 @@ | |||
41 | static s32 ixgbe_get_copper_link_capabilities_82598(struct ixgbe_hw *hw, | 41 | static s32 ixgbe_get_copper_link_capabilities_82598(struct ixgbe_hw *hw, |
42 | ixgbe_link_speed *speed, | 42 | ixgbe_link_speed *speed, |
43 | bool *autoneg); | 43 | bool *autoneg); |
44 | static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw); | 44 | static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, |
45 | static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw, | ||
46 | ixgbe_link_speed speed, | 45 | ixgbe_link_speed speed, |
47 | bool autoneg, | 46 | bool autoneg, |
48 | bool autoneg_wait_to_complete); | 47 | bool autoneg_wait_to_complete); |
@@ -156,8 +155,6 @@ static s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw) | |||
156 | /* Overwrite the link function pointers if copper PHY */ | 155 | /* Overwrite the link function pointers if copper PHY */ |
157 | if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) { | 156 | if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) { |
158 | mac->ops.setup_link = &ixgbe_setup_copper_link_82598; | 157 | mac->ops.setup_link = &ixgbe_setup_copper_link_82598; |
159 | mac->ops.setup_link_speed = | ||
160 | &ixgbe_setup_copper_link_speed_82598; | ||
161 | mac->ops.get_link_capabilities = | 158 | mac->ops.get_link_capabilities = |
162 | &ixgbe_get_copper_link_capabilities_82598; | 159 | &ixgbe_get_copper_link_capabilities_82598; |
163 | } | 160 | } |
@@ -465,13 +462,14 @@ out: | |||
465 | } | 462 | } |
466 | 463 | ||
467 | /** | 464 | /** |
468 | * ixgbe_setup_mac_link_82598 - Configures MAC link settings | 465 | * ixgbe_start_mac_link_82598 - Configures MAC link settings |
469 | * @hw: pointer to hardware structure | 466 | * @hw: pointer to hardware structure |
470 | * | 467 | * |
471 | * Configures link settings based on values in the ixgbe_hw struct. | 468 | * Configures link settings based on values in the ixgbe_hw struct. |
472 | * Restarts the link. Performs autonegotiation if needed. | 469 | * Restarts the link. Performs autonegotiation if needed. |
473 | **/ | 470 | **/ |
474 | static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw) | 471 | static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, |
472 | bool autoneg_wait_to_complete) | ||
475 | { | 473 | { |
476 | u32 autoc_reg; | 474 | u32 autoc_reg; |
477 | u32 links_reg; | 475 | u32 links_reg; |
@@ -484,7 +482,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw) | |||
484 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); | 482 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); |
485 | 483 | ||
486 | /* Only poll for autoneg to complete if specified to do so */ | 484 | /* Only poll for autoneg to complete if specified to do so */ |
487 | if (hw->phy.autoneg_wait_to_complete) { | 485 | if (autoneg_wait_to_complete) { |
488 | if ((autoc_reg & IXGBE_AUTOC_LMS_MASK) == | 486 | if ((autoc_reg & IXGBE_AUTOC_LMS_MASK) == |
489 | IXGBE_AUTOC_LMS_KX4_AN || | 487 | IXGBE_AUTOC_LMS_KX4_AN || |
490 | (autoc_reg & IXGBE_AUTOC_LMS_MASK) == | 488 | (autoc_reg & IXGBE_AUTOC_LMS_MASK) == |
@@ -600,7 +598,7 @@ out: | |||
600 | 598 | ||
601 | 599 | ||
602 | /** | 600 | /** |
603 | * ixgbe_setup_mac_link_speed_82598 - Set MAC link speed | 601 | * ixgbe_setup_mac_link_82598 - Set MAC link speed |
604 | * @hw: pointer to hardware structure | 602 | * @hw: pointer to hardware structure |
605 | * @speed: new link speed | 603 | * @speed: new link speed |
606 | * @autoneg: true if auto-negotiation enabled | 604 | * @autoneg: true if auto-negotiation enabled |
@@ -608,7 +606,7 @@ out: | |||
608 | * | 606 | * |
609 | * Set the link speed in the AUTOC register and restarts link. | 607 | * Set the link speed in the AUTOC register and restarts link. |
610 | **/ | 608 | **/ |
611 | static s32 ixgbe_setup_mac_link_speed_82598(struct ixgbe_hw *hw, | 609 | static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, |
612 | ixgbe_link_speed speed, bool autoneg, | 610 | ixgbe_link_speed speed, bool autoneg, |
613 | bool autoneg_wait_to_complete) | 611 | bool autoneg_wait_to_complete) |
614 | { | 612 | { |
@@ -638,14 +636,12 @@ static s32 ixgbe_setup_mac_link_speed_82598(struct ixgbe_hw *hw, | |||
638 | } | 636 | } |
639 | 637 | ||
640 | if (status == 0) { | 638 | if (status == 0) { |
641 | hw->phy.autoneg_wait_to_complete = autoneg_wait_to_complete; | ||
642 | |||
643 | /* | 639 | /* |
644 | * Setup and restart the link based on the new values in | 640 | * Setup and restart the link based on the new values in |
645 | * ixgbe_hw This will write the AUTOC register based on the new | 641 | * ixgbe_hw This will write the AUTOC register based on the new |
646 | * stored values | 642 | * stored values |
647 | */ | 643 | */ |
648 | status = ixgbe_setup_mac_link_82598(hw); | 644 | status = ixgbe_start_mac_link_82598(hw, autoneg_wait_to_complete); |
649 | } | 645 | } |
650 | 646 | ||
651 | return status; | 647 | return status; |
@@ -653,29 +649,7 @@ static s32 ixgbe_setup_mac_link_speed_82598(struct ixgbe_hw *hw, | |||
653 | 649 | ||
654 | 650 | ||
655 | /** | 651 | /** |
656 | * ixgbe_setup_copper_link_82598 - Setup copper link settings | 652 | * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field |
657 | * @hw: pointer to hardware structure | ||
658 | * | ||
659 | * Configures link settings based on values in the ixgbe_hw struct. | ||
660 | * Restarts the link. Performs autonegotiation if needed. Restart | ||
661 | * phy and wait for autonegotiate to finish. Then synchronize the | ||
662 | * MAC and PHY. | ||
663 | **/ | ||
664 | static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw) | ||
665 | { | ||
666 | s32 status; | ||
667 | |||
668 | /* Restart autonegotiation on PHY */ | ||
669 | status = hw->phy.ops.setup_link(hw); | ||
670 | |||
671 | /* Set up MAC */ | ||
672 | ixgbe_setup_mac_link_82598(hw); | ||
673 | |||
674 | return status; | ||
675 | } | ||
676 | |||
677 | /** | ||
678 | * ixgbe_setup_copper_link_speed_82598 - Set the PHY autoneg advertised field | ||
679 | * @hw: pointer to hardware structure | 653 | * @hw: pointer to hardware structure |
680 | * @speed: new link speed | 654 | * @speed: new link speed |
681 | * @autoneg: true if autonegotiation enabled | 655 | * @autoneg: true if autonegotiation enabled |
@@ -683,7 +657,7 @@ static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw) | |||
683 | * | 657 | * |
684 | * Sets the link speed in the AUTOC register in the MAC and restarts link. | 658 | * Sets the link speed in the AUTOC register in the MAC and restarts link. |
685 | **/ | 659 | **/ |
686 | static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw, | 660 | static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, |
687 | ixgbe_link_speed speed, | 661 | ixgbe_link_speed speed, |
688 | bool autoneg, | 662 | bool autoneg, |
689 | bool autoneg_wait_to_complete) | 663 | bool autoneg_wait_to_complete) |
@@ -695,7 +669,7 @@ static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw, | |||
695 | autoneg_wait_to_complete); | 669 | autoneg_wait_to_complete); |
696 | 670 | ||
697 | /* Set up MAC */ | 671 | /* Set up MAC */ |
698 | ixgbe_setup_mac_link_82598(hw); | 672 | ixgbe_start_mac_link_82598(hw, autoneg_wait_to_complete); |
699 | 673 | ||
700 | return status; | 674 | return status; |
701 | } | 675 | } |
@@ -1163,7 +1137,6 @@ static struct ixgbe_mac_operations mac_ops_82598 = { | |||
1163 | .read_analog_reg8 = &ixgbe_read_analog_reg8_82598, | 1137 | .read_analog_reg8 = &ixgbe_read_analog_reg8_82598, |
1164 | .write_analog_reg8 = &ixgbe_write_analog_reg8_82598, | 1138 | .write_analog_reg8 = &ixgbe_write_analog_reg8_82598, |
1165 | .setup_link = &ixgbe_setup_mac_link_82598, | 1139 | .setup_link = &ixgbe_setup_mac_link_82598, |
1166 | .setup_link_speed = &ixgbe_setup_mac_link_speed_82598, | ||
1167 | .check_link = &ixgbe_check_mac_link_82598, | 1140 | .check_link = &ixgbe_check_mac_link_82598, |
1168 | .get_link_capabilities = &ixgbe_get_link_capabilities_82598, | 1141 | .get_link_capabilities = &ixgbe_get_link_capabilities_82598, |
1169 | .led_on = &ixgbe_led_on_generic, | 1142 | .led_on = &ixgbe_led_on_generic, |
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 364b6d2279e4..61af47e75aa1 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -38,23 +38,23 @@ | |||
38 | #define IXGBE_82599_MC_TBL_SIZE 128 | 38 | #define IXGBE_82599_MC_TBL_SIZE 128 |
39 | #define IXGBE_82599_VFT_TBL_SIZE 128 | 39 | #define IXGBE_82599_VFT_TBL_SIZE 128 |
40 | 40 | ||
41 | static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw); | 41 | s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, |
42 | static s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, | 42 | ixgbe_link_speed speed, |
43 | ixgbe_link_speed speed, bool autoneg, | 43 | bool autoneg, |
44 | bool autoneg_wait_to_complete); | 44 | bool autoneg_wait_to_complete); |
45 | static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw); | 45 | s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, |
46 | static s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw, | 46 | bool autoneg_wait_to_complete); |
47 | ixgbe_link_speed speed, | 47 | s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, |
48 | bool autoneg, | 48 | ixgbe_link_speed speed, |
49 | bool autoneg_wait_to_complete); | 49 | bool autoneg, |
50 | bool autoneg_wait_to_complete); | ||
50 | static s32 ixgbe_get_copper_link_capabilities_82599(struct ixgbe_hw *hw, | 51 | static s32 ixgbe_get_copper_link_capabilities_82599(struct ixgbe_hw *hw, |
51 | ixgbe_link_speed *speed, | 52 | ixgbe_link_speed *speed, |
52 | bool *autoneg); | 53 | bool *autoneg); |
53 | static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw); | 54 | static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, |
54 | static s32 ixgbe_setup_copper_link_speed_82599(struct ixgbe_hw *hw, | 55 | ixgbe_link_speed speed, |
55 | ixgbe_link_speed speed, | 56 | bool autoneg, |
56 | bool autoneg, | 57 | bool autoneg_wait_to_complete); |
57 | bool autoneg_wait_to_complete); | ||
58 | static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); | 58 | static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); |
59 | 59 | ||
60 | static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) | 60 | static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) |
@@ -62,15 +62,9 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) | |||
62 | struct ixgbe_mac_info *mac = &hw->mac; | 62 | struct ixgbe_mac_info *mac = &hw->mac; |
63 | if (hw->phy.multispeed_fiber) { | 63 | if (hw->phy.multispeed_fiber) { |
64 | /* Set up dual speed SFP+ support */ | 64 | /* Set up dual speed SFP+ support */ |
65 | mac->ops.setup_link = | 65 | mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; |
66 | &ixgbe_setup_mac_link_multispeed_fiber; | ||
67 | mac->ops.setup_link_speed = | ||
68 | &ixgbe_setup_mac_link_speed_multispeed_fiber; | ||
69 | } else { | 66 | } else { |
70 | mac->ops.setup_link = | 67 | mac->ops.setup_link = &ixgbe_setup_mac_link_82599; |
71 | &ixgbe_setup_mac_link_82599; | ||
72 | mac->ops.setup_link_speed = | ||
73 | &ixgbe_setup_mac_link_speed_82599; | ||
74 | } | 68 | } |
75 | } | 69 | } |
76 | 70 | ||
@@ -178,8 +172,6 @@ static s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw) | |||
178 | /* If copper media, overwrite with copper function pointers */ | 172 | /* If copper media, overwrite with copper function pointers */ |
179 | if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) { | 173 | if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) { |
180 | mac->ops.setup_link = &ixgbe_setup_copper_link_82599; | 174 | mac->ops.setup_link = &ixgbe_setup_copper_link_82599; |
181 | mac->ops.setup_link_speed = | ||
182 | &ixgbe_setup_copper_link_speed_82599; | ||
183 | mac->ops.get_link_capabilities = | 175 | mac->ops.get_link_capabilities = |
184 | &ixgbe_get_copper_link_capabilities_82599; | 176 | &ixgbe_get_copper_link_capabilities_82599; |
185 | } | 177 | } |
@@ -354,13 +346,15 @@ out: | |||
354 | } | 346 | } |
355 | 347 | ||
356 | /** | 348 | /** |
357 | * ixgbe_setup_mac_link_82599 - Setup MAC link settings | 349 | * ixgbe_start_mac_link_82599 - Setup MAC link settings |
358 | * @hw: pointer to hardware structure | 350 | * @hw: pointer to hardware structure |
351 | * @autoneg_wait_to_complete: true when waiting for completion is needed | ||
359 | * | 352 | * |
360 | * Configures link settings based on values in the ixgbe_hw struct. | 353 | * Configures link settings based on values in the ixgbe_hw struct. |
361 | * Restarts the link. Performs autonegotiation if needed. | 354 | * Restarts the link. Performs autonegotiation if needed. |
362 | **/ | 355 | **/ |
363 | static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw) | 356 | s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, |
357 | bool autoneg_wait_to_complete) | ||
364 | { | 358 | { |
365 | u32 autoc_reg; | 359 | u32 autoc_reg; |
366 | u32 links_reg; | 360 | u32 links_reg; |
@@ -373,7 +367,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw) | |||
373 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); | 367 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); |
374 | 368 | ||
375 | /* Only poll for autoneg to complete if specified to do so */ | 369 | /* Only poll for autoneg to complete if specified to do so */ |
376 | if (hw->phy.autoneg_wait_to_complete) { | 370 | if (autoneg_wait_to_complete) { |
377 | if ((autoc_reg & IXGBE_AUTOC_LMS_MASK) == | 371 | if ((autoc_reg & IXGBE_AUTOC_LMS_MASK) == |
378 | IXGBE_AUTOC_LMS_KX4_KX_KR || | 372 | IXGBE_AUTOC_LMS_KX4_KX_KR || |
379 | (autoc_reg & IXGBE_AUTOC_LMS_MASK) == | 373 | (autoc_reg & IXGBE_AUTOC_LMS_MASK) == |
@@ -401,25 +395,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw) | |||
401 | } | 395 | } |
402 | 396 | ||
403 | /** | 397 | /** |
404 | * ixgbe_setup_mac_link_multispeed_fiber - Setup MAC link settings | 398 | * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed |
405 | * @hw: pointer to hardware structure | ||
406 | * | ||
407 | * Configures link settings based on values in the ixgbe_hw struct. | ||
408 | * Restarts the link for multi-speed fiber at 1G speed, if link | ||
409 | * fails at 10G. | ||
410 | * Performs autonegotiation if needed. | ||
411 | **/ | ||
412 | static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw) | ||
413 | { | ||
414 | s32 status = 0; | ||
415 | ixgbe_link_speed link_speed = IXGBE_LINK_SPEED_82599_AUTONEG; | ||
416 | status = ixgbe_setup_mac_link_speed_multispeed_fiber(hw, link_speed, | ||
417 | true, true); | ||
418 | return status; | ||
419 | } | ||
420 | |||
421 | /** | ||
422 | * ixgbe_setup_mac_link_speed_multispeed_fiber - Set MAC link speed | ||
423 | * @hw: pointer to hardware structure | 399 | * @hw: pointer to hardware structure |
424 | * @speed: new link speed | 400 | * @speed: new link speed |
425 | * @autoneg: true if autonegotiation enabled | 401 | * @autoneg: true if autonegotiation enabled |
@@ -427,10 +403,10 @@ static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw) | |||
427 | * | 403 | * |
428 | * Set the link speed in the AUTOC register and restarts link. | 404 | * Set the link speed in the AUTOC register and restarts link. |
429 | **/ | 405 | **/ |
430 | static s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, | 406 | s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, |
431 | ixgbe_link_speed speed, | 407 | ixgbe_link_speed speed, |
432 | bool autoneg, | 408 | bool autoneg, |
433 | bool autoneg_wait_to_complete) | 409 | bool autoneg_wait_to_complete) |
434 | { | 410 | { |
435 | s32 status = 0; | 411 | s32 status = 0; |
436 | ixgbe_link_speed phy_link_speed; | 412 | ixgbe_link_speed phy_link_speed; |
@@ -445,15 +421,6 @@ static s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, | |||
445 | hw->mac.ops.get_link_capabilities(hw, &phy_link_speed, &negotiation); | 421 | hw->mac.ops.get_link_capabilities(hw, &phy_link_speed, &negotiation); |
446 | speed &= phy_link_speed; | 422 | speed &= phy_link_speed; |
447 | 423 | ||
448 | /* Set autoneg_advertised value based on input link speed */ | ||
449 | hw->phy.autoneg_advertised = 0; | ||
450 | |||
451 | if (speed & IXGBE_LINK_SPEED_10GB_FULL) | ||
452 | hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_10GB_FULL; | ||
453 | |||
454 | if (speed & IXGBE_LINK_SPEED_1GB_FULL) | ||
455 | hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_1GB_FULL; | ||
456 | |||
457 | /* | 424 | /* |
458 | * When the driver changes the link speeds that it can support, | 425 | * When the driver changes the link speeds that it can support, |
459 | * it sets autotry_restart to true to indicate that we need to | 426 | * it sets autotry_restart to true to indicate that we need to |
@@ -485,12 +452,12 @@ static s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, | |||
485 | /* Allow module to change analog characteristics (1G->10G) */ | 452 | /* Allow module to change analog characteristics (1G->10G) */ |
486 | msleep(40); | 453 | msleep(40); |
487 | 454 | ||
488 | status = ixgbe_setup_mac_link_speed_82599(hw, | 455 | status = ixgbe_setup_mac_link_82599(hw, |
489 | IXGBE_LINK_SPEED_10GB_FULL, | 456 | IXGBE_LINK_SPEED_10GB_FULL, |
490 | autoneg, | 457 | autoneg, |
491 | autoneg_wait_to_complete); | 458 | autoneg_wait_to_complete); |
492 | if (status != 0) | 459 | if (status != 0) |
493 | goto out; | 460 | return status; |
494 | 461 | ||
495 | /* Flap the tx laser if it has not already been done */ | 462 | /* Flap the tx laser if it has not already been done */ |
496 | if (hw->mac.autotry_restart) { | 463 | if (hw->mac.autotry_restart) { |
@@ -539,12 +506,12 @@ static s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, | |||
539 | /* Allow module to change analog characteristics (10G->1G) */ | 506 | /* Allow module to change analog characteristics (10G->1G) */ |
540 | msleep(40); | 507 | msleep(40); |
541 | 508 | ||
542 | status = ixgbe_setup_mac_link_speed_82599(hw, | 509 | status = ixgbe_setup_mac_link_82599(hw, |
543 | IXGBE_LINK_SPEED_1GB_FULL, | 510 | IXGBE_LINK_SPEED_1GB_FULL, |
544 | autoneg, | 511 | autoneg, |
545 | autoneg_wait_to_complete); | 512 | autoneg_wait_to_complete); |
546 | if (status != 0) | 513 | if (status != 0) |
547 | goto out; | 514 | return status; |
548 | 515 | ||
549 | /* Flap the tx laser if it has not already been done */ | 516 | /* Flap the tx laser if it has not already been done */ |
550 | if (hw->mac.autotry_restart) { | 517 | if (hw->mac.autotry_restart) { |
@@ -576,12 +543,21 @@ static s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, | |||
576 | * single highest speed that the user requested. | 543 | * single highest speed that the user requested. |
577 | */ | 544 | */ |
578 | if (speedcnt > 1) | 545 | if (speedcnt > 1) |
579 | status = ixgbe_setup_mac_link_speed_multispeed_fiber(hw, | 546 | status = ixgbe_setup_mac_link_multispeed_fiber(hw, |
580 | highest_link_speed, | 547 | highest_link_speed, |
581 | autoneg, | 548 | autoneg, |
582 | autoneg_wait_to_complete); | 549 | autoneg_wait_to_complete); |
583 | 550 | ||
584 | out: | 551 | out: |
552 | /* Set autoneg_advertised value based on input link speed */ | ||
553 | hw->phy.autoneg_advertised = 0; | ||
554 | |||
555 | if (speed & IXGBE_LINK_SPEED_10GB_FULL) | ||
556 | hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_10GB_FULL; | ||
557 | |||
558 | if (speed & IXGBE_LINK_SPEED_1GB_FULL) | ||
559 | hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_1GB_FULL; | ||
560 | |||
585 | return status; | 561 | return status; |
586 | } | 562 | } |
587 | 563 | ||
@@ -640,7 +616,7 @@ static s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw, | |||
640 | } | 616 | } |
641 | 617 | ||
642 | /** | 618 | /** |
643 | * ixgbe_setup_mac_link_speed_82599 - Set MAC link speed | 619 | * ixgbe_setup_mac_link_82599 - Set MAC link speed |
644 | * @hw: pointer to hardware structure | 620 | * @hw: pointer to hardware structure |
645 | * @speed: new link speed | 621 | * @speed: new link speed |
646 | * @autoneg: true if autonegotiation enabled | 622 | * @autoneg: true if autonegotiation enabled |
@@ -648,10 +624,9 @@ static s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw, | |||
648 | * | 624 | * |
649 | * Set the link speed in the AUTOC register and restarts link. | 625 | * Set the link speed in the AUTOC register and restarts link. |
650 | **/ | 626 | **/ |
651 | static s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw, | 627 | s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, |
652 | ixgbe_link_speed speed, | 628 | ixgbe_link_speed speed, bool autoneg, |
653 | bool autoneg, | 629 | bool autoneg_wait_to_complete) |
654 | bool autoneg_wait_to_complete) | ||
655 | { | 630 | { |
656 | s32 status = 0; | 631 | s32 status = 0; |
657 | u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); | 632 | u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); |
@@ -751,26 +726,7 @@ out: | |||
751 | } | 726 | } |
752 | 727 | ||
753 | /** | 728 | /** |
754 | * ixgbe_setup_copper_link_82599 - Setup copper link settings | 729 | * ixgbe_setup_copper_link_82599 - Set the PHY autoneg advertised field |
755 | * @hw: pointer to hardware structure | ||
756 | * | ||
757 | * Restarts the link on PHY and then MAC. Performs autonegotiation if needed. | ||
758 | **/ | ||
759 | static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw) | ||
760 | { | ||
761 | s32 status; | ||
762 | |||
763 | /* Restart autonegotiation on PHY */ | ||
764 | status = hw->phy.ops.setup_link(hw); | ||
765 | |||
766 | /* Set up MAC */ | ||
767 | ixgbe_setup_mac_link_82599(hw); | ||
768 | |||
769 | return status; | ||
770 | } | ||
771 | |||
772 | /** | ||
773 | * ixgbe_setup_copper_link_speed_82599 - Set the PHY autoneg advertised field | ||
774 | * @hw: pointer to hardware structure | 730 | * @hw: pointer to hardware structure |
775 | * @speed: new link speed | 731 | * @speed: new link speed |
776 | * @autoneg: true if autonegotiation enabled | 732 | * @autoneg: true if autonegotiation enabled |
@@ -778,10 +734,10 @@ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw) | |||
778 | * | 734 | * |
779 | * Restarts link on PHY and MAC based on settings passed in. | 735 | * Restarts link on PHY and MAC based on settings passed in. |
780 | **/ | 736 | **/ |
781 | static s32 ixgbe_setup_copper_link_speed_82599(struct ixgbe_hw *hw, | 737 | static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, |
782 | ixgbe_link_speed speed, | 738 | ixgbe_link_speed speed, |
783 | bool autoneg, | 739 | bool autoneg, |
784 | bool autoneg_wait_to_complete) | 740 | bool autoneg_wait_to_complete) |
785 | { | 741 | { |
786 | s32 status; | 742 | s32 status; |
787 | 743 | ||
@@ -789,7 +745,7 @@ static s32 ixgbe_setup_copper_link_speed_82599(struct ixgbe_hw *hw, | |||
789 | status = hw->phy.ops.setup_link_speed(hw, speed, autoneg, | 745 | status = hw->phy.ops.setup_link_speed(hw, speed, autoneg, |
790 | autoneg_wait_to_complete); | 746 | autoneg_wait_to_complete); |
791 | /* Set up MAC */ | 747 | /* Set up MAC */ |
792 | ixgbe_setup_mac_link_82599(hw); | 748 | ixgbe_start_mac_link_82599(hw, autoneg_wait_to_complete); |
793 | 749 | ||
794 | return status; | 750 | return status; |
795 | } | 751 | } |
@@ -2470,7 +2426,6 @@ static struct ixgbe_mac_operations mac_ops_82599 = { | |||
2470 | .read_analog_reg8 = &ixgbe_read_analog_reg8_82599, | 2426 | .read_analog_reg8 = &ixgbe_read_analog_reg8_82599, |
2471 | .write_analog_reg8 = &ixgbe_write_analog_reg8_82599, | 2427 | .write_analog_reg8 = &ixgbe_write_analog_reg8_82599, |
2472 | .setup_link = &ixgbe_setup_mac_link_82599, | 2428 | .setup_link = &ixgbe_setup_mac_link_82599, |
2473 | .setup_link_speed = &ixgbe_setup_mac_link_speed_82599, | ||
2474 | .check_link = &ixgbe_check_mac_link_82599, | 2429 | .check_link = &ixgbe_check_mac_link_82599, |
2475 | .get_link_capabilities = &ixgbe_get_link_capabilities_82599, | 2430 | .get_link_capabilities = &ixgbe_get_link_capabilities_82599, |
2476 | .led_on = &ixgbe_led_on_generic, | 2431 | .led_on = &ixgbe_led_on_generic, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ixgbe/ixgbe_dcb_82599.c index 589f62c7062a..ec8a252636d3 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_82599.c +++ b/drivers/net/ixgbe/ixgbe_dcb_82599.c | |||
@@ -145,8 +145,12 @@ s32 ixgbe_dcb_config_rx_arbiter_82599(struct ixgbe_hw *hw, | |||
145 | u32 credit_max = 0; | 145 | u32 credit_max = 0; |
146 | u8 i = 0; | 146 | u8 i = 0; |
147 | 147 | ||
148 | /* Disable the arbiter before changing parameters */ | 148 | /* |
149 | IXGBE_WRITE_REG(hw, IXGBE_RTRPCS, IXGBE_RTRPCS_ARBDIS); | 149 | * Disable the arbiter before changing parameters |
150 | * (always enable recycle mode; WSP) | ||
151 | */ | ||
152 | reg = IXGBE_RTRPCS_RRM | IXGBE_RTRPCS_RAC | IXGBE_RTRPCS_ARBDIS; | ||
153 | IXGBE_WRITE_REG(hw, IXGBE_RTRPCS, reg); | ||
150 | 154 | ||
151 | /* Map all traffic classes to their UP, 1 to 1 */ | 155 | /* Map all traffic classes to their UP, 1 to 1 */ |
152 | reg = 0; | 156 | reg = 0; |
@@ -194,9 +198,6 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82599(struct ixgbe_hw *hw, | |||
194 | u32 reg, max_credits; | 198 | u32 reg, max_credits; |
195 | u8 i; | 199 | u8 i; |
196 | 200 | ||
197 | /* Disable the arbiter before changing parameters */ | ||
198 | IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, IXGBE_RTTDCS_ARBDIS); | ||
199 | |||
200 | /* Clear the per-Tx queue credits; we use per-TC instead */ | 201 | /* Clear the per-Tx queue credits; we use per-TC instead */ |
201 | for (i = 0; i < 128; i++) { | 202 | for (i = 0; i < 128; i++) { |
202 | IXGBE_WRITE_REG(hw, IXGBE_RTTDQSEL, i); | 203 | IXGBE_WRITE_REG(hw, IXGBE_RTTDQSEL, i); |
@@ -244,8 +245,14 @@ s32 ixgbe_dcb_config_tx_data_arbiter_82599(struct ixgbe_hw *hw, | |||
244 | u32 reg; | 245 | u32 reg; |
245 | u8 i; | 246 | u8 i; |
246 | 247 | ||
247 | /* Disable the arbiter before changing parameters */ | 248 | /* |
248 | IXGBE_WRITE_REG(hw, IXGBE_RTTPCS, IXGBE_RTTPCS_ARBDIS); | 249 | * Disable the arbiter before changing parameters |
250 | * (always enable recycle mode; SP; arb delay) | ||
251 | */ | ||
252 | reg = IXGBE_RTTPCS_TPPAC | IXGBE_RTTPCS_TPRM | | ||
253 | (IXGBE_RTTPCS_ARBD_DCB << IXGBE_RTTPCS_ARBD_SHIFT) | | ||
254 | IXGBE_RTTPCS_ARBDIS; | ||
255 | IXGBE_WRITE_REG(hw, IXGBE_RTTPCS, reg); | ||
249 | 256 | ||
250 | /* Map all traffic classes to their UP, 1 to 1 */ | 257 | /* Map all traffic classes to their UP, 1 to 1 */ |
251 | reg = 0; | 258 | reg = 0; |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index 34bca45fbd17..47d9dde82a8a 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c | |||
@@ -139,23 +139,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
139 | adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; | 139 | adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; |
140 | } | 140 | } |
141 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; | 141 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; |
142 | #ifdef IXGBE_FCOE | ||
143 | /* Turn on FCoE offload */ | ||
144 | if ((adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) && | ||
145 | (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))) { | ||
146 | adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; | ||
147 | adapter->ring_feature[RING_F_FCOE].indices = | ||
148 | IXGBE_FCRETA_SIZE; | ||
149 | netdev->features |= NETIF_F_FCOE_CRC; | ||
150 | netdev->features |= NETIF_F_FSO; | ||
151 | netdev->features |= NETIF_F_FCOE_MTU; | ||
152 | netdev->vlan_features |= NETIF_F_FCOE_CRC; | ||
153 | netdev->vlan_features |= NETIF_F_FSO; | ||
154 | netdev->vlan_features |= NETIF_F_FCOE_MTU; | ||
155 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; | ||
156 | netdev_features_change(netdev); | ||
157 | } | ||
158 | #endif /* IXGBE_FCOE */ | ||
159 | ixgbe_init_interrupt_scheme(adapter); | 142 | ixgbe_init_interrupt_scheme(adapter); |
160 | if (netif_running(netdev)) | 143 | if (netif_running(netdev)) |
161 | netdev->netdev_ops->ndo_open(netdev); | 144 | netdev->netdev_ops->ndo_open(netdev); |
@@ -174,22 +157,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
174 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) | 157 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) |
175 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; | 158 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; |
176 | 159 | ||
177 | #ifdef IXGBE_FCOE | ||
178 | /* Turn off FCoE offload */ | ||
179 | if (adapter->flags & (IXGBE_FLAG_FCOE_CAPABLE | | ||
180 | IXGBE_FLAG_FCOE_ENABLED)) { | ||
181 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; | ||
182 | adapter->ring_feature[RING_F_FCOE].indices = 0; | ||
183 | netdev->features &= ~NETIF_F_FCOE_CRC; | ||
184 | netdev->features &= ~NETIF_F_FSO; | ||
185 | netdev->features &= ~NETIF_F_FCOE_MTU; | ||
186 | netdev->vlan_features &= ~NETIF_F_FCOE_CRC; | ||
187 | netdev->vlan_features &= ~NETIF_F_FSO; | ||
188 | netdev->vlan_features &= ~NETIF_F_FCOE_MTU; | ||
189 | netdev->fcoe_ddp_xid = 0; | ||
190 | netdev_features_change(netdev); | ||
191 | } | ||
192 | #endif /* IXGBE_FCOE */ | ||
193 | ixgbe_init_interrupt_scheme(adapter); | 160 | ixgbe_init_interrupt_scheme(adapter); |
194 | if (netif_running(netdev)) | 161 | if (netif_running(netdev)) |
195 | netdev->netdev_ops->ndo_open(netdev); | 162 | netdev->netdev_ops->ndo_open(netdev); |
@@ -513,6 +480,64 @@ static void ixgbe_dcbnl_setpfcstate(struct net_device *netdev, u8 state) | |||
513 | return; | 480 | return; |
514 | } | 481 | } |
515 | 482 | ||
483 | /** | ||
484 | * ixgbe_dcbnl_getapp - retrieve the DCBX application user priority | ||
485 | * @netdev : the corresponding netdev | ||
486 | * @idtype : identifies the id as ether type or TCP/UDP port number | ||
487 | * @id: id is either ether type or TCP/UDP port number | ||
488 | * | ||
489 | * Returns : on success, returns a non-zero 802.1p user priority bitmap | ||
490 | * otherwise returns 0 as the invalid user priority bitmap to indicate an | ||
491 | * error. | ||
492 | */ | ||
493 | static u8 ixgbe_dcbnl_getapp(struct net_device *netdev, u8 idtype, u16 id) | ||
494 | { | ||
495 | u8 rval = 0; | ||
496 | |||
497 | switch (idtype) { | ||
498 | case DCB_APP_IDTYPE_ETHTYPE: | ||
499 | #ifdef IXGBE_FCOE | ||
500 | if (id == ETH_P_FCOE) | ||
501 | rval = ixgbe_fcoe_getapp(netdev_priv(netdev)); | ||
502 | #endif | ||
503 | break; | ||
504 | case DCB_APP_IDTYPE_PORTNUM: | ||
505 | break; | ||
506 | default: | ||
507 | break; | ||
508 | } | ||
509 | return rval; | ||
510 | } | ||
511 | |||
512 | /** | ||
513 | * ixgbe_dcbnl_setapp - set the DCBX application user priority | ||
514 | * @netdev : the corresponding netdev | ||
515 | * @idtype : identifies the id as ether type or TCP/UDP port number | ||
516 | * @id: id is either ether type or TCP/UDP port number | ||
517 | * @up: the 802.1p user priority bitmap | ||
518 | * | ||
519 | * Returns : 0 on success or 1 on error | ||
520 | */ | ||
521 | static u8 ixgbe_dcbnl_setapp(struct net_device *netdev, | ||
522 | u8 idtype, u16 id, u8 up) | ||
523 | { | ||
524 | u8 rval = 1; | ||
525 | |||
526 | switch (idtype) { | ||
527 | case DCB_APP_IDTYPE_ETHTYPE: | ||
528 | #ifdef IXGBE_FCOE | ||
529 | if (id == ETH_P_FCOE) | ||
530 | rval = ixgbe_fcoe_setapp(netdev_priv(netdev), up); | ||
531 | #endif | ||
532 | break; | ||
533 | case DCB_APP_IDTYPE_PORTNUM: | ||
534 | break; | ||
535 | default: | ||
536 | break; | ||
537 | } | ||
538 | return rval; | ||
539 | } | ||
540 | |||
516 | struct dcbnl_rtnl_ops dcbnl_ops = { | 541 | struct dcbnl_rtnl_ops dcbnl_ops = { |
517 | .getstate = ixgbe_dcbnl_get_state, | 542 | .getstate = ixgbe_dcbnl_get_state, |
518 | .setstate = ixgbe_dcbnl_set_state, | 543 | .setstate = ixgbe_dcbnl_set_state, |
@@ -533,5 +558,7 @@ struct dcbnl_rtnl_ops dcbnl_ops = { | |||
533 | .setnumtcs = ixgbe_dcbnl_setnumtcs, | 558 | .setnumtcs = ixgbe_dcbnl_setnumtcs, |
534 | .getpfcstate = ixgbe_dcbnl_getpfcstate, | 559 | .getpfcstate = ixgbe_dcbnl_getpfcstate, |
535 | .setpfcstate = ixgbe_dcbnl_setpfcstate, | 560 | .setpfcstate = ixgbe_dcbnl_setpfcstate, |
561 | .getapp = ixgbe_dcbnl_getapp, | ||
562 | .setapp = ixgbe_dcbnl_setapp, | ||
536 | }; | 563 | }; |
537 | 564 | ||
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 1444ec512536..026e94a99849 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -233,11 +233,11 @@ static int ixgbe_set_settings(struct net_device *netdev, | |||
233 | return err; | 233 | return err; |
234 | /* this sets the link speed and restarts auto-neg */ | 234 | /* this sets the link speed and restarts auto-neg */ |
235 | hw->mac.autotry_restart = true; | 235 | hw->mac.autotry_restart = true; |
236 | err = hw->mac.ops.setup_link_speed(hw, advertised, true, true); | 236 | err = hw->mac.ops.setup_link(hw, advertised, true, true); |
237 | if (err) { | 237 | if (err) { |
238 | DPRINTK(PROBE, INFO, | 238 | DPRINTK(PROBE, INFO, |
239 | "setup link failed with code %d\n", err); | 239 | "setup link failed with code %d\n", err); |
240 | hw->mac.ops.setup_link_speed(hw, old, true, true); | 240 | hw->mac.ops.setup_link(hw, old, true, true); |
241 | } | 241 | } |
242 | } else { | 242 | } else { |
243 | /* in this case we currently only support 10Gb/FULL */ | 243 | /* in this case we currently only support 10Gb/FULL */ |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c index 28cf104e36cc..0607cffbb213 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ixgbe/ixgbe_fcoe.c | |||
@@ -27,6 +27,9 @@ | |||
27 | 27 | ||
28 | 28 | ||
29 | #include "ixgbe.h" | 29 | #include "ixgbe.h" |
30 | #ifdef CONFIG_IXGBE_DCB | ||
31 | #include "ixgbe_dcb_82599.h" | ||
32 | #endif /* CONFIG_IXGBE_DCB */ | ||
30 | #include <linux/if_ether.h> | 33 | #include <linux/if_ether.h> |
31 | #include <scsi/scsi_cmnd.h> | 34 | #include <scsi/scsi_cmnd.h> |
32 | #include <scsi/scsi_device.h> | 35 | #include <scsi/scsi_device.h> |
@@ -554,3 +557,158 @@ void ixgbe_cleanup_fcoe(struct ixgbe_adapter *adapter) | |||
554 | fcoe->pool = NULL; | 557 | fcoe->pool = NULL; |
555 | } | 558 | } |
556 | } | 559 | } |
560 | |||
561 | /** | ||
562 | * ixgbe_fcoe_enable - turn on FCoE offload feature | ||
563 | * @netdev: the corresponding netdev | ||
564 | * | ||
565 | * Turns on FCoE offload feature in 82599. | ||
566 | * | ||
567 | * Returns : 0 indicates success or -EINVAL on failure | ||
568 | */ | ||
569 | int ixgbe_fcoe_enable(struct net_device *netdev) | ||
570 | { | ||
571 | int rc = -EINVAL; | ||
572 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
573 | |||
574 | |||
575 | if (!(adapter->flags & IXGBE_FLAG_FCOE_CAPABLE)) | ||
576 | goto out_enable; | ||
577 | |||
578 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) | ||
579 | goto out_enable; | ||
580 | |||
581 | DPRINTK(DRV, INFO, "Enabling FCoE offload features.\n"); | ||
582 | if (netif_running(netdev)) | ||
583 | netdev->netdev_ops->ndo_stop(netdev); | ||
584 | |||
585 | ixgbe_clear_interrupt_scheme(adapter); | ||
586 | |||
587 | adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; | ||
588 | adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE; | ||
589 | netdev->features |= NETIF_F_FCOE_CRC; | ||
590 | netdev->features |= NETIF_F_FSO; | ||
591 | netdev->features |= NETIF_F_FCOE_MTU; | ||
592 | netdev->vlan_features |= NETIF_F_FCOE_CRC; | ||
593 | netdev->vlan_features |= NETIF_F_FSO; | ||
594 | netdev->vlan_features |= NETIF_F_FCOE_MTU; | ||
595 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; | ||
596 | netdev_features_change(netdev); | ||
597 | |||
598 | ixgbe_init_interrupt_scheme(adapter); | ||
599 | |||
600 | if (netif_running(netdev)) | ||
601 | netdev->netdev_ops->ndo_open(netdev); | ||
602 | rc = 0; | ||
603 | |||
604 | out_enable: | ||
605 | return rc; | ||
606 | } | ||
607 | |||
608 | /** | ||
609 | * ixgbe_fcoe_disable - turn off FCoE offload feature | ||
610 | * @netdev: the corresponding netdev | ||
611 | * | ||
612 | * Turns off FCoE offload feature in 82599. | ||
613 | * | ||
614 | * Returns : 0 indicates success or -EINVAL on failure | ||
615 | */ | ||
616 | int ixgbe_fcoe_disable(struct net_device *netdev) | ||
617 | { | ||
618 | int rc = -EINVAL; | ||
619 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
620 | |||
621 | if (!(adapter->flags & IXGBE_FLAG_FCOE_CAPABLE)) | ||
622 | goto out_disable; | ||
623 | |||
624 | if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED)) | ||
625 | goto out_disable; | ||
626 | |||
627 | DPRINTK(DRV, INFO, "Disabling FCoE offload features.\n"); | ||
628 | if (netif_running(netdev)) | ||
629 | netdev->netdev_ops->ndo_stop(netdev); | ||
630 | |||
631 | ixgbe_clear_interrupt_scheme(adapter); | ||
632 | |||
633 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; | ||
634 | adapter->ring_feature[RING_F_FCOE].indices = 0; | ||
635 | netdev->features &= ~NETIF_F_FCOE_CRC; | ||
636 | netdev->features &= ~NETIF_F_FSO; | ||
637 | netdev->features &= ~NETIF_F_FCOE_MTU; | ||
638 | netdev->vlan_features &= ~NETIF_F_FCOE_CRC; | ||
639 | netdev->vlan_features &= ~NETIF_F_FSO; | ||
640 | netdev->vlan_features &= ~NETIF_F_FCOE_MTU; | ||
641 | netdev->fcoe_ddp_xid = 0; | ||
642 | netdev_features_change(netdev); | ||
643 | |||
644 | ixgbe_cleanup_fcoe(adapter); | ||
645 | |||
646 | ixgbe_init_interrupt_scheme(adapter); | ||
647 | if (netif_running(netdev)) | ||
648 | netdev->netdev_ops->ndo_open(netdev); | ||
649 | rc = 0; | ||
650 | |||
651 | out_disable: | ||
652 | return rc; | ||
653 | } | ||
654 | |||
655 | #ifdef CONFIG_IXGBE_DCB | ||
656 | /** | ||
657 | * ixgbe_fcoe_getapp - retrieves current user priority bitmap for FCoE | ||
658 | * @adapter : ixgbe adapter | ||
659 | * | ||
660 | * Finds out the corresponding user priority bitmap from the current | ||
661 | * traffic class that FCoE belongs to. Returns 0 as the invalid user | ||
662 | * priority bitmap to indicate an error. | ||
663 | * | ||
664 | * Returns : 802.1p user priority bitmap for FCoE | ||
665 | */ | ||
666 | u8 ixgbe_fcoe_getapp(struct ixgbe_adapter *adapter) | ||
667 | { | ||
668 | int i; | ||
669 | u8 tc; | ||
670 | u32 up2tc; | ||
671 | |||
672 | up2tc = IXGBE_READ_REG(&adapter->hw, IXGBE_RTTUP2TC); | ||
673 | for (i = 0; i < MAX_USER_PRIORITY; i++) { | ||
674 | tc = (u8)(up2tc >> (i * IXGBE_RTTUP2TC_UP_SHIFT)); | ||
675 | tc &= (MAX_TRAFFIC_CLASS - 1); | ||
676 | if (adapter->fcoe.tc == tc) | ||
677 | return 1 << i; | ||
678 | } | ||
679 | |||
680 | return 0; | ||
681 | } | ||
682 | |||
683 | /** | ||
684 | * ixgbe_fcoe_setapp - sets the user priority bitmap for FCoE | ||
685 | * @adapter : ixgbe adapter | ||
686 | * @up : 802.1p user priority bitmap | ||
687 | * | ||
688 | * Finds out the traffic class from the input user priority | ||
689 | * bitmap for FCoE. | ||
690 | * | ||
691 | * Returns : 0 on success otherwise returns 1 on error | ||
692 | */ | ||
693 | u8 ixgbe_fcoe_setapp(struct ixgbe_adapter *adapter, u8 up) | ||
694 | { | ||
695 | int i; | ||
696 | u32 up2tc; | ||
697 | |||
698 | /* valid user priority bitmap must not be 0 */ | ||
699 | if (up) { | ||
700 | /* from user priority to the corresponding traffic class */ | ||
701 | up2tc = IXGBE_READ_REG(&adapter->hw, IXGBE_RTTUP2TC); | ||
702 | for (i = 0; i < MAX_USER_PRIORITY; i++) { | ||
703 | if (up & (1 << i)) { | ||
704 | up2tc >>= (i * IXGBE_RTTUP2TC_UP_SHIFT); | ||
705 | up2tc &= (MAX_TRAFFIC_CLASS - 1); | ||
706 | adapter->fcoe.tc = (u8)up2tc; | ||
707 | return 0; | ||
708 | } | ||
709 | } | ||
710 | } | ||
711 | |||
712 | return 1; | ||
713 | } | ||
714 | #endif /* CONFIG_IXGBE_DCB */ | ||
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.h b/drivers/net/ixgbe/ixgbe_fcoe.h index c5b50026a897..b5dee7b3ef1c 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.h +++ b/drivers/net/ixgbe/ixgbe_fcoe.h | |||
@@ -46,6 +46,9 @@ | |||
46 | #define IXGBE_FCBUFF_MIN 4096 /* 4KB min */ | 46 | #define IXGBE_FCBUFF_MIN 4096 /* 4KB min */ |
47 | #define IXGBE_FCOE_DDP_MAX 512 /* 9 bits xid */ | 47 | #define IXGBE_FCOE_DDP_MAX 512 /* 9 bits xid */ |
48 | 48 | ||
49 | /* Default traffic class to use for FCoE */ | ||
50 | #define IXGBE_FCOE_DEFTC 3 | ||
51 | |||
49 | /* fcerr */ | 52 | /* fcerr */ |
50 | #define IXGBE_FCERR_BADCRC 0x00100000 | 53 | #define IXGBE_FCERR_BADCRC 0x00100000 |
51 | 54 | ||
@@ -59,6 +62,7 @@ struct ixgbe_fcoe_ddp { | |||
59 | }; | 62 | }; |
60 | 63 | ||
61 | struct ixgbe_fcoe { | 64 | struct ixgbe_fcoe { |
65 | u8 tc; | ||
62 | spinlock_t lock; | 66 | spinlock_t lock; |
63 | struct pci_pool *pool; | 67 | struct pci_pool *pool; |
64 | struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX]; | 68 | struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX]; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 0bea096e964b..4042d878670e 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -2516,7 +2516,7 @@ static void ixgbe_sfp_link_config(struct ixgbe_adapter *adapter) | |||
2516 | static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) | 2516 | static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) |
2517 | { | 2517 | { |
2518 | u32 autoneg; | 2518 | u32 autoneg; |
2519 | bool link_up = false; | 2519 | bool negotiation, link_up = false; |
2520 | u32 ret = IXGBE_ERR_LINK_SETUP; | 2520 | u32 ret = IXGBE_ERR_LINK_SETUP; |
2521 | 2521 | ||
2522 | if (hw->mac.ops.check_link) | 2522 | if (hw->mac.ops.check_link) |
@@ -2526,13 +2526,12 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) | |||
2526 | goto link_cfg_out; | 2526 | goto link_cfg_out; |
2527 | 2527 | ||
2528 | if (hw->mac.ops.get_link_capabilities) | 2528 | if (hw->mac.ops.get_link_capabilities) |
2529 | ret = hw->mac.ops.get_link_capabilities(hw, &autoneg, | 2529 | ret = hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); |
2530 | &hw->mac.autoneg); | ||
2531 | if (ret) | 2530 | if (ret) |
2532 | goto link_cfg_out; | 2531 | goto link_cfg_out; |
2533 | 2532 | ||
2534 | if (hw->mac.ops.setup_link_speed) | 2533 | if (hw->mac.ops.setup_link) |
2535 | ret = hw->mac.ops.setup_link_speed(hw, autoneg, true, link_up); | 2534 | ret = hw->mac.ops.setup_link(hw, autoneg, negotiation, link_up); |
2536 | link_cfg_out: | 2535 | link_cfg_out: |
2537 | return ret; | 2536 | return ret; |
2538 | } | 2537 | } |
@@ -3801,6 +3800,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
3801 | adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE; | 3800 | adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE; |
3802 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; | 3801 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; |
3803 | adapter->ring_feature[RING_F_FCOE].indices = 0; | 3802 | adapter->ring_feature[RING_F_FCOE].indices = 0; |
3803 | /* Default traffic class to use for FCoE */ | ||
3804 | adapter->fcoe.tc = IXGBE_FCOE_DEFTC; | ||
3804 | #endif /* IXGBE_FCOE */ | 3805 | #endif /* IXGBE_FCOE */ |
3805 | } | 3806 | } |
3806 | 3807 | ||
@@ -4515,14 +4516,14 @@ static void ixgbe_multispeed_fiber_task(struct work_struct *work) | |||
4515 | multispeed_fiber_task); | 4516 | multispeed_fiber_task); |
4516 | struct ixgbe_hw *hw = &adapter->hw; | 4517 | struct ixgbe_hw *hw = &adapter->hw; |
4517 | u32 autoneg; | 4518 | u32 autoneg; |
4519 | bool negotiation; | ||
4518 | 4520 | ||
4519 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; | 4521 | adapter->flags |= IXGBE_FLAG_IN_SFP_LINK_TASK; |
4520 | autoneg = hw->phy.autoneg_advertised; | 4522 | autoneg = hw->phy.autoneg_advertised; |
4521 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) | 4523 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) |
4522 | hw->mac.ops.get_link_capabilities(hw, &autoneg, | 4524 | hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); |
4523 | &hw->mac.autoneg); | 4525 | if (hw->mac.ops.setup_link) |
4524 | if (hw->mac.ops.setup_link_speed) | 4526 | hw->mac.ops.setup_link(hw, autoneg, negotiation, true); |
4525 | hw->mac.ops.setup_link_speed(hw, autoneg, true, true); | ||
4526 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; | 4527 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; |
4527 | adapter->flags &= ~IXGBE_FLAG_IN_SFP_LINK_TASK; | 4528 | adapter->flags &= ~IXGBE_FLAG_IN_SFP_LINK_TASK; |
4528 | } | 4529 | } |
@@ -5107,7 +5108,8 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
5107 | return skb_tx_hash(dev, skb); | 5108 | return skb_tx_hash(dev, skb); |
5108 | } | 5109 | } |
5109 | 5110 | ||
5110 | static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 5111 | static netdev_tx_t ixgbe_xmit_frame(struct sk_buff *skb, |
5112 | struct net_device *netdev) | ||
5111 | { | 5113 | { |
5112 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 5114 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
5113 | struct ixgbe_ring *tx_ring; | 5115 | struct ixgbe_ring *tx_ring; |
@@ -5376,6 +5378,8 @@ static const struct net_device_ops ixgbe_netdev_ops = { | |||
5376 | #ifdef IXGBE_FCOE | 5378 | #ifdef IXGBE_FCOE |
5377 | .ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get, | 5379 | .ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get, |
5378 | .ndo_fcoe_ddp_done = ixgbe_fcoe_ddp_put, | 5380 | .ndo_fcoe_ddp_done = ixgbe_fcoe_ddp_put, |
5381 | .ndo_fcoe_enable = ixgbe_fcoe_enable, | ||
5382 | .ndo_fcoe_disable = ixgbe_fcoe_disable, | ||
5379 | #endif /* IXGBE_FCOE */ | 5383 | #endif /* IXGBE_FCOE */ |
5380 | }; | 5384 | }; |
5381 | 5385 | ||
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index f0f3406ef001..8ba90eec1dc9 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -2332,9 +2332,7 @@ struct ixgbe_mac_operations { | |||
2332 | s32 (*enable_rx_dma)(struct ixgbe_hw *, u32); | 2332 | s32 (*enable_rx_dma)(struct ixgbe_hw *, u32); |
2333 | 2333 | ||
2334 | /* Link */ | 2334 | /* Link */ |
2335 | s32 (*setup_link)(struct ixgbe_hw *); | 2335 | s32 (*setup_link)(struct ixgbe_hw *, ixgbe_link_speed, bool, bool); |
2336 | s32 (*setup_link_speed)(struct ixgbe_hw *, ixgbe_link_speed, bool, | ||
2337 | bool); | ||
2338 | s32 (*check_link)(struct ixgbe_hw *, ixgbe_link_speed *, bool *, bool); | 2336 | s32 (*check_link)(struct ixgbe_hw *, ixgbe_link_speed *, bool *, bool); |
2339 | s32 (*get_link_capabilities)(struct ixgbe_hw *, ixgbe_link_speed *, | 2337 | s32 (*get_link_capabilities)(struct ixgbe_hw *, ixgbe_link_speed *, |
2340 | bool *); | 2338 | bool *); |
@@ -2406,8 +2404,6 @@ struct ixgbe_mac_info { | |||
2406 | u32 orig_autoc; | 2404 | u32 orig_autoc; |
2407 | u32 orig_autoc2; | 2405 | u32 orig_autoc2; |
2408 | bool orig_link_settings_stored; | 2406 | bool orig_link_settings_stored; |
2409 | bool autoneg; | ||
2410 | bool autoneg_succeeded; | ||
2411 | bool autotry_restart; | 2407 | bool autotry_restart; |
2412 | }; | 2408 | }; |
2413 | 2409 | ||
@@ -2422,7 +2418,6 @@ struct ixgbe_phy_info { | |||
2422 | enum ixgbe_media_type media_type; | 2418 | enum ixgbe_media_type media_type; |
2423 | bool reset_disable; | 2419 | bool reset_disable; |
2424 | ixgbe_autoneg_advertised autoneg_advertised; | 2420 | ixgbe_autoneg_advertised autoneg_advertised; |
2425 | bool autoneg_wait_to_complete; | ||
2426 | bool multispeed_fiber; | 2421 | bool multispeed_fiber; |
2427 | }; | 2422 | }; |
2428 | 2423 | ||
diff --git a/drivers/net/ixp2000/ixpdev.c b/drivers/net/ixp2000/ixpdev.c index 588b44d944ce..127243461a51 100644 --- a/drivers/net/ixp2000/ixpdev.c +++ b/drivers/net/ixp2000/ixpdev.c | |||
@@ -41,6 +41,7 @@ static int ixpdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
41 | struct ixpdev_priv *ip = netdev_priv(dev); | 41 | struct ixpdev_priv *ip = netdev_priv(dev); |
42 | struct ixpdev_tx_desc *desc; | 42 | struct ixpdev_tx_desc *desc; |
43 | int entry; | 43 | int entry; |
44 | unsigned long flags; | ||
44 | 45 | ||
45 | if (unlikely(skb->len > PAGE_SIZE)) { | 46 | if (unlikely(skb->len > PAGE_SIZE)) { |
46 | /* @@@ Count drops. */ | 47 | /* @@@ Count drops. */ |
@@ -63,11 +64,11 @@ static int ixpdev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
63 | 64 | ||
64 | dev->trans_start = jiffies; | 65 | dev->trans_start = jiffies; |
65 | 66 | ||
66 | local_irq_disable(); | 67 | local_irq_save(flags); |
67 | ip->tx_queue_entries++; | 68 | ip->tx_queue_entries++; |
68 | if (ip->tx_queue_entries == TX_BUF_COUNT_PER_CHAN) | 69 | if (ip->tx_queue_entries == TX_BUF_COUNT_PER_CHAN) |
69 | netif_stop_queue(dev); | 70 | netif_stop_queue(dev); |
70 | local_irq_enable(); | 71 | local_irq_restore(flags); |
71 | 72 | ||
72 | return NETDEV_TX_OK; | 73 | return NETDEV_TX_OK; |
73 | } | 74 | } |
diff --git a/drivers/net/jme.c b/drivers/net/jme.c index e7068c7cd627..1d2a32544ed2 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c | |||
@@ -1931,7 +1931,7 @@ jme_stop_queue_if_full(struct jme_adapter *jme) | |||
1931 | * This function is already protected by netif_tx_lock() | 1931 | * This function is already protected by netif_tx_lock() |
1932 | */ | 1932 | */ |
1933 | 1933 | ||
1934 | static int | 1934 | static netdev_tx_t |
1935 | jme_start_xmit(struct sk_buff *skb, struct net_device *netdev) | 1935 | jme_start_xmit(struct sk_buff *skb, struct net_device *netdev) |
1936 | { | 1936 | { |
1937 | struct jme_adapter *jme = netdev_priv(netdev); | 1937 | struct jme_adapter *jme = netdev_priv(netdev); |
diff --git a/drivers/net/korina.c b/drivers/net/korina.c index 51ca54c8ec57..03199fa10003 100644 --- a/drivers/net/korina.c +++ b/drivers/net/korina.c | |||
@@ -743,7 +743,7 @@ static u32 netdev_get_link(struct net_device *dev) | |||
743 | return mii_link_ok(&lp->mii_if); | 743 | return mii_link_ok(&lp->mii_if); |
744 | } | 744 | } |
745 | 745 | ||
746 | static struct ethtool_ops netdev_ethtool_ops = { | 746 | static const struct ethtool_ops netdev_ethtool_ops = { |
747 | .get_drvinfo = netdev_get_drvinfo, | 747 | .get_drvinfo = netdev_get_drvinfo, |
748 | .get_settings = netdev_get_settings, | 748 | .get_settings = netdev_get_settings, |
749 | .set_settings = netdev_set_settings, | 749 | .set_settings = netdev_set_settings, |
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c index 39b0aea2aab3..99e954167fa6 100644 --- a/drivers/net/ks8842.c +++ b/drivers/net/ks8842.c | |||
@@ -551,7 +551,8 @@ static int ks8842_close(struct net_device *netdev) | |||
551 | return 0; | 551 | return 0; |
552 | } | 552 | } |
553 | 553 | ||
554 | static int ks8842_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 554 | static netdev_tx_t ks8842_xmit_frame(struct sk_buff *skb, |
555 | struct net_device *netdev) | ||
555 | { | 556 | { |
556 | int ret; | 557 | int ret; |
557 | struct ks8842_adapter *adapter = netdev_priv(netdev); | 558 | struct ks8842_adapter *adapter = netdev_priv(netdev); |
@@ -618,7 +619,7 @@ static const struct net_device_ops ks8842_netdev_ops = { | |||
618 | .ndo_validate_addr = eth_validate_addr | 619 | .ndo_validate_addr = eth_validate_addr |
619 | }; | 620 | }; |
620 | 621 | ||
621 | static struct ethtool_ops ks8842_ethtool_ops = { | 622 | static const struct ethtool_ops ks8842_ethtool_ops = { |
622 | .get_link = ethtool_op_get_link, | 623 | .get_link = ethtool_op_get_link, |
623 | }; | 624 | }; |
624 | 625 | ||
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c index 9a1dea60c1c4..547ac7c7479c 100644 --- a/drivers/net/ks8851.c +++ b/drivers/net/ks8851.c | |||
@@ -868,11 +868,12 @@ static int ks8851_net_stop(struct net_device *dev) | |||
868 | * and secondly so we can round up more than one packet to transmit which | 868 | * and secondly so we can round up more than one packet to transmit which |
869 | * means we can try and avoid generating too many transmit done interrupts. | 869 | * means we can try and avoid generating too many transmit done interrupts. |
870 | */ | 870 | */ |
871 | static int ks8851_start_xmit(struct sk_buff *skb, struct net_device *dev) | 871 | static netdev_tx_t ks8851_start_xmit(struct sk_buff *skb, |
872 | struct net_device *dev) | ||
872 | { | 873 | { |
873 | struct ks8851_net *ks = netdev_priv(dev); | 874 | struct ks8851_net *ks = netdev_priv(dev); |
874 | unsigned needed = calc_txlen(skb->len); | 875 | unsigned needed = calc_txlen(skb->len); |
875 | int ret = NETDEV_TX_OK; | 876 | netdev_tx_t ret = NETDEV_TX_OK; |
876 | 877 | ||
877 | if (netif_msg_tx_queued(ks)) | 878 | if (netif_msg_tx_queued(ks)) |
878 | ks_dbg(ks, "%s: skb %p, %d@%p\n", __func__, | 879 | ks_dbg(ks, "%s: skb %p, %d@%p\n", __func__, |
diff --git a/drivers/net/lance.c b/drivers/net/lance.c index 30fd4f5f1d5a..dcda30338b65 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c | |||
@@ -300,7 +300,8 @@ static unsigned char lance_need_isa_bounce_buffers = 1; | |||
300 | 300 | ||
301 | static int lance_open(struct net_device *dev); | 301 | static int lance_open(struct net_device *dev); |
302 | static void lance_init_ring(struct net_device *dev, gfp_t mode); | 302 | static void lance_init_ring(struct net_device *dev, gfp_t mode); |
303 | static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev); | 303 | static netdev_tx_t lance_start_xmit(struct sk_buff *skb, |
304 | struct net_device *dev); | ||
304 | static int lance_rx(struct net_device *dev); | 305 | static int lance_rx(struct net_device *dev); |
305 | static irqreturn_t lance_interrupt(int irq, void *dev_id); | 306 | static irqreturn_t lance_interrupt(int irq, void *dev_id); |
306 | static int lance_close(struct net_device *dev); | 307 | static int lance_close(struct net_device *dev); |
@@ -949,7 +950,8 @@ static void lance_tx_timeout (struct net_device *dev) | |||
949 | } | 950 | } |
950 | 951 | ||
951 | 952 | ||
952 | static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) | 953 | static netdev_tx_t lance_start_xmit(struct sk_buff *skb, |
954 | struct net_device *dev) | ||
953 | { | 955 | { |
954 | struct lance_private *lp = dev->ml_priv; | 956 | struct lance_private *lp = dev->ml_priv; |
955 | int ioaddr = dev->base_addr; | 957 | int ioaddr = dev->base_addr; |
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c index d6be36000c5c..256119882b1e 100644 --- a/drivers/net/lib8390.c +++ b/drivers/net/lib8390.c | |||
@@ -299,7 +299,8 @@ static void __ei_tx_timeout(struct net_device *dev) | |||
299 | * Sends a packet to an 8390 network device. | 299 | * Sends a packet to an 8390 network device. |
300 | */ | 300 | */ |
301 | 301 | ||
302 | static int __ei_start_xmit(struct sk_buff *skb, struct net_device *dev) | 302 | static netdev_tx_t __ei_start_xmit(struct sk_buff *skb, |
303 | struct net_device *dev) | ||
303 | { | 304 | { |
304 | unsigned long e8390_base = dev->base_addr; | 305 | unsigned long e8390_base = dev->base_addr; |
305 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 306 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 51bbce72bede..1bc654a73c47 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -69,7 +69,8 @@ struct pcpu_lstats { | |||
69 | * The higher levels take care of making this non-reentrant (it's | 69 | * The higher levels take care of making this non-reentrant (it's |
70 | * called with bh's disabled). | 70 | * called with bh's disabled). |
71 | */ | 71 | */ |
72 | static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) | 72 | static netdev_tx_t loopback_xmit(struct sk_buff *skb, |
73 | struct net_device *dev) | ||
73 | { | 74 | { |
74 | struct pcpu_lstats *pcpu_lstats, *lb_stats; | 75 | struct pcpu_lstats *pcpu_lstats, *lb_stats; |
75 | int len; | 76 | int len; |
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c index c292bad411ee..cc3ed9cf28be 100644 --- a/drivers/net/lp486e.c +++ b/drivers/net/lp486e.c | |||
@@ -377,7 +377,7 @@ static char init_setup[14] = { | |||
377 | }; | 377 | }; |
378 | 378 | ||
379 | static int i596_open(struct net_device *dev); | 379 | static int i596_open(struct net_device *dev); |
380 | static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev); | 380 | static netdev_tx_t i596_start_xmit(struct sk_buff *skb, struct net_device *dev); |
381 | static irqreturn_t i596_interrupt(int irq, void *dev_id); | 381 | static irqreturn_t i596_interrupt(int irq, void *dev_id); |
382 | static int i596_close(struct net_device *dev); | 382 | static int i596_close(struct net_device *dev); |
383 | static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd); | 383 | static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd); |
@@ -863,7 +863,7 @@ static int i596_open(struct net_device *dev) | |||
863 | return 0; /* Always succeed */ | 863 | return 0; /* Always succeed */ |
864 | } | 864 | } |
865 | 865 | ||
866 | static int i596_start_xmit (struct sk_buff *skb, struct net_device *dev) { | 866 | static netdev_tx_t i596_start_xmit (struct sk_buff *skb, struct net_device *dev) { |
867 | struct tx_cmd *tx_cmd; | 867 | struct tx_cmd *tx_cmd; |
868 | short length; | 868 | short length; |
869 | 869 | ||
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index d22952c78f13..fb65b427c692 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c | |||
@@ -620,6 +620,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
620 | dma_addr_t mapping; | 620 | dma_addr_t mapping; |
621 | unsigned int len, entry; | 621 | unsigned int len, entry; |
622 | u32 ctrl; | 622 | u32 ctrl; |
623 | unsigned long flags; | ||
623 | 624 | ||
624 | #ifdef DEBUG | 625 | #ifdef DEBUG |
625 | int i; | 626 | int i; |
@@ -635,12 +636,12 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
635 | #endif | 636 | #endif |
636 | 637 | ||
637 | len = skb->len; | 638 | len = skb->len; |
638 | spin_lock_irq(&bp->lock); | 639 | spin_lock_irqsave(&bp->lock, flags); |
639 | 640 | ||
640 | /* This is a hard error, log it. */ | 641 | /* This is a hard error, log it. */ |
641 | if (TX_BUFFS_AVAIL(bp) < 1) { | 642 | if (TX_BUFFS_AVAIL(bp) < 1) { |
642 | netif_stop_queue(dev); | 643 | netif_stop_queue(dev); |
643 | spin_unlock_irq(&bp->lock); | 644 | spin_unlock_irqrestore(&bp->lock, flags); |
644 | dev_err(&bp->pdev->dev, | 645 | dev_err(&bp->pdev->dev, |
645 | "BUG! Tx Ring full when queue awake!\n"); | 646 | "BUG! Tx Ring full when queue awake!\n"); |
646 | dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n", | 647 | dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n", |
@@ -674,7 +675,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
674 | if (TX_BUFFS_AVAIL(bp) < 1) | 675 | if (TX_BUFFS_AVAIL(bp) < 1) |
675 | netif_stop_queue(dev); | 676 | netif_stop_queue(dev); |
676 | 677 | ||
677 | spin_unlock_irq(&bp->lock); | 678 | spin_unlock_irqrestore(&bp->lock, flags); |
678 | 679 | ||
679 | dev->trans_start = jiffies; | 680 | dev->trans_start = jiffies; |
680 | 681 | ||
@@ -1078,7 +1079,7 @@ static void macb_get_drvinfo(struct net_device *dev, | |||
1078 | strcpy(info->bus_info, dev_name(&bp->pdev->dev)); | 1079 | strcpy(info->bus_info, dev_name(&bp->pdev->dev)); |
1079 | } | 1080 | } |
1080 | 1081 | ||
1081 | static struct ethtool_ops macb_ethtool_ops = { | 1082 | static const struct ethtool_ops macb_ethtool_ops = { |
1082 | .get_settings = macb_get_settings, | 1083 | .get_settings = macb_get_settings, |
1083 | .set_settings = macb_set_settings, | 1084 | .set_settings = macb_set_settings, |
1084 | .get_drvinfo = macb_get_drvinfo, | 1085 | .get_drvinfo = macb_get_drvinfo, |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 99eed9f37c84..c85c46d2a309 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -54,7 +54,7 @@ static struct macvlan_dev *macvlan_hash_lookup(const struct macvlan_port *port, | |||
54 | struct hlist_node *n; | 54 | struct hlist_node *n; |
55 | 55 | ||
56 | hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[addr[5]], hlist) { | 56 | hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[addr[5]], hlist) { |
57 | if (!compare_ether_addr(vlan->dev->dev_addr, addr)) | 57 | if (!compare_ether_addr_64bits(vlan->dev->dev_addr, addr)) |
58 | return vlan; | 58 | return vlan; |
59 | } | 59 | } |
60 | return NULL; | 60 | return NULL; |
@@ -92,7 +92,7 @@ static int macvlan_addr_busy(const struct macvlan_port *port, | |||
92 | * currently in use by the underlying device or | 92 | * currently in use by the underlying device or |
93 | * another macvlan. | 93 | * another macvlan. |
94 | */ | 94 | */ |
95 | if (memcmp(port->dev->dev_addr, addr, ETH_ALEN) == 0) | 95 | if (!compare_ether_addr_64bits(port->dev->dev_addr, addr)) |
96 | return 1; | 96 | return 1; |
97 | 97 | ||
98 | if (macvlan_hash_lookup(port, addr)) | 98 | if (macvlan_hash_lookup(port, addr)) |
@@ -130,7 +130,7 @@ static void macvlan_broadcast(struct sk_buff *skb, | |||
130 | dev->stats.multicast++; | 130 | dev->stats.multicast++; |
131 | 131 | ||
132 | nskb->dev = dev; | 132 | nskb->dev = dev; |
133 | if (!compare_ether_addr(eth->h_dest, dev->broadcast)) | 133 | if (!compare_ether_addr_64bits(eth->h_dest, dev->broadcast)) |
134 | nskb->pkt_type = PACKET_BROADCAST; | 134 | nskb->pkt_type = PACKET_BROADCAST; |
135 | else | 135 | else |
136 | nskb->pkt_type = PACKET_MULTICAST; | 136 | nskb->pkt_type = PACKET_MULTICAST; |
@@ -184,7 +184,8 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb) | |||
184 | return NULL; | 184 | return NULL; |
185 | } | 185 | } |
186 | 186 | ||
187 | static int macvlan_start_xmit(struct sk_buff *skb, struct net_device *dev) | 187 | static netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, |
188 | struct net_device *dev) | ||
188 | { | 189 | { |
189 | const struct macvlan_dev *vlan = netdev_priv(dev); | 190 | const struct macvlan_dev *vlan = netdev_priv(dev); |
190 | unsigned int len = skb->len; | 191 | unsigned int len = skb->len; |
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c index 0ecc1e1b013e..8c7279965b44 100644 --- a/drivers/net/mlx4/en_tx.c +++ b/drivers/net/mlx4/en_tx.c | |||
@@ -437,6 +437,7 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind) | |||
437 | { | 437 | { |
438 | struct mlx4_en_cq *cq = &priv->tx_cq[tx_ind]; | 438 | struct mlx4_en_cq *cq = &priv->tx_cq[tx_ind]; |
439 | struct mlx4_en_tx_ring *ring = &priv->tx_ring[tx_ind]; | 439 | struct mlx4_en_tx_ring *ring = &priv->tx_ring[tx_ind]; |
440 | unsigned long flags; | ||
440 | 441 | ||
441 | /* If we don't have a pending timer, set one up to catch our recent | 442 | /* If we don't have a pending timer, set one up to catch our recent |
442 | post in case the interface becomes idle */ | 443 | post in case the interface becomes idle */ |
@@ -445,9 +446,9 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind) | |||
445 | 446 | ||
446 | /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */ | 447 | /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */ |
447 | if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0) | 448 | if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0) |
448 | if (spin_trylock_irq(&ring->comp_lock)) { | 449 | if (spin_trylock_irqsave(&ring->comp_lock, flags)) { |
449 | mlx4_en_process_tx_cq(priv->dev, cq); | 450 | mlx4_en_process_tx_cq(priv->dev, cq); |
450 | spin_unlock_irq(&ring->comp_lock); | 451 | spin_unlock_irqrestore(&ring->comp_lock, flags); |
451 | } | 452 | } |
452 | } | 453 | } |
453 | 454 | ||
@@ -588,7 +589,7 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
588 | return skb_tx_hash(dev, skb); | 589 | return skb_tx_hash(dev, skb); |
589 | } | 590 | } |
590 | 591 | ||
591 | int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | 592 | netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) |
592 | { | 593 | { |
593 | struct mlx4_en_priv *priv = netdev_priv(dev); | 594 | struct mlx4_en_priv *priv = netdev_priv(dev); |
594 | struct mlx4_en_dev *mdev = priv->mdev; | 595 | struct mlx4_en_dev *mdev = priv->mdev; |
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h index 4513fb4960dc..4376147b0ea0 100644 --- a/drivers/net/mlx4/mlx4_en.h +++ b/drivers/net/mlx4/mlx4_en.h | |||
@@ -518,7 +518,7 @@ int mlx4_en_arm_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq); | |||
518 | void mlx4_en_poll_tx_cq(unsigned long data); | 518 | void mlx4_en_poll_tx_cq(unsigned long data); |
519 | void mlx4_en_tx_irq(struct mlx4_cq *mcq); | 519 | void mlx4_en_tx_irq(struct mlx4_cq *mcq); |
520 | u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb); | 520 | u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb); |
521 | int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev); | 521 | netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev); |
522 | 522 | ||
523 | int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring, | 523 | int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring, |
524 | u32 size, u16 stride); | 524 | u32 size, u16 stride); |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 75deef35b1e0..6930c87f362e 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -360,7 +360,8 @@ MODULE_PARM_DESC(myri10ge_dca, "Enable DCA if possible"); | |||
360 | #define myri10ge_pio_copy(to,from,size) __iowrite64_copy(to,from,size/8) | 360 | #define myri10ge_pio_copy(to,from,size) __iowrite64_copy(to,from,size/8) |
361 | 361 | ||
362 | static void myri10ge_set_multicast_list(struct net_device *dev); | 362 | static void myri10ge_set_multicast_list(struct net_device *dev); |
363 | static int myri10ge_sw_tso(struct sk_buff *skb, struct net_device *dev); | 363 | static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb, |
364 | struct net_device *dev); | ||
364 | 365 | ||
365 | static inline void put_be32(__be32 val, __be32 __iomem * p) | 366 | static inline void put_be32(__be32 val, __be32 __iomem * p) |
366 | { | 367 | { |
@@ -2656,7 +2657,8 @@ myri10ge_submit_req(struct myri10ge_tx_buf *tx, struct mcp_kreq_ether_send *src, | |||
2656 | * it and try again. | 2657 | * it and try again. |
2657 | */ | 2658 | */ |
2658 | 2659 | ||
2659 | static int myri10ge_xmit(struct sk_buff *skb, struct net_device *dev) | 2660 | static netdev_tx_t myri10ge_xmit(struct sk_buff *skb, |
2661 | struct net_device *dev) | ||
2660 | { | 2662 | { |
2661 | struct myri10ge_priv *mgp = netdev_priv(dev); | 2663 | struct myri10ge_priv *mgp = netdev_priv(dev); |
2662 | struct myri10ge_slice_state *ss; | 2664 | struct myri10ge_slice_state *ss; |
@@ -2947,12 +2949,13 @@ drop: | |||
2947 | 2949 | ||
2948 | } | 2950 | } |
2949 | 2951 | ||
2950 | static int myri10ge_sw_tso(struct sk_buff *skb, struct net_device *dev) | 2952 | static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb, |
2953 | struct net_device *dev) | ||
2951 | { | 2954 | { |
2952 | struct sk_buff *segs, *curr; | 2955 | struct sk_buff *segs, *curr; |
2953 | struct myri10ge_priv *mgp = netdev_priv(dev); | 2956 | struct myri10ge_priv *mgp = netdev_priv(dev); |
2954 | struct myri10ge_slice_state *ss; | 2957 | struct myri10ge_slice_state *ss; |
2955 | int status; | 2958 | netdev_tx_t status; |
2956 | 2959 | ||
2957 | segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO6); | 2960 | segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO6); |
2958 | if (IS_ERR(segs)) | 2961 | if (IS_ERR(segs)) |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 32db12a27342..bd41351e4e26 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -621,7 +621,7 @@ static void drain_ring(struct net_device *dev); | |||
621 | static void free_ring(struct net_device *dev); | 621 | static void free_ring(struct net_device *dev); |
622 | static void reinit_ring(struct net_device *dev); | 622 | static void reinit_ring(struct net_device *dev); |
623 | static void init_registers(struct net_device *dev); | 623 | static void init_registers(struct net_device *dev); |
624 | static int start_tx(struct sk_buff *skb, struct net_device *dev); | 624 | static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev); |
625 | static irqreturn_t intr_handler(int irq, void *dev_instance); | 625 | static irqreturn_t intr_handler(int irq, void *dev_instance); |
626 | static void netdev_error(struct net_device *dev, int intr_status); | 626 | static void netdev_error(struct net_device *dev, int intr_status); |
627 | static int natsemi_poll(struct napi_struct *napi, int budget); | 627 | static int natsemi_poll(struct napi_struct *napi, int budget); |
@@ -2079,7 +2079,7 @@ static void reinit_ring(struct net_device *dev) | |||
2079 | reinit_rx(dev); | 2079 | reinit_rx(dev); |
2080 | } | 2080 | } |
2081 | 2081 | ||
2082 | static int start_tx(struct sk_buff *skb, struct net_device *dev) | 2082 | static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev) |
2083 | { | 2083 | { |
2084 | struct netdev_private *np = netdev_priv(dev); | 2084 | struct netdev_private *np = netdev_priv(dev); |
2085 | void __iomem * ioaddr = ns_ioaddr(dev); | 2085 | void __iomem * ioaddr = ns_ioaddr(dev); |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 449d3511628f..224a74691312 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -1410,6 +1410,6 @@ extern void netxen_change_ringparam(struct netxen_adapter *adapter); | |||
1410 | extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, | 1410 | extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, |
1411 | int *valp); | 1411 | int *valp); |
1412 | 1412 | ||
1413 | extern struct ethtool_ops netxen_nic_ethtool_ops; | 1413 | extern const struct ethtool_ops netxen_nic_ethtool_ops; |
1414 | 1414 | ||
1415 | #endif /* __NETXEN_NIC_H_ */ | 1415 | #endif /* __NETXEN_NIC_H_ */ |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 3886135006e1..e376a1c4eb06 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -963,7 +963,7 @@ static int netxen_nic_set_flags(struct net_device *netdev, u32 data) | |||
963 | return 0; | 963 | return 0; |
964 | } | 964 | } |
965 | 965 | ||
966 | struct ethtool_ops netxen_nic_ethtool_ops = { | 966 | const struct ethtool_ops netxen_nic_ethtool_ops = { |
967 | .get_settings = netxen_nic_get_settings, | 967 | .get_settings = netxen_nic_get_settings, |
968 | .set_settings = netxen_nic_set_settings, | 968 | .set_settings = netxen_nic_set_settings, |
969 | .get_drvinfo = netxen_nic_get_drvinfo, | 969 | .get_drvinfo = netxen_nic_get_drvinfo, |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index fab51d16f5fb..f824a392bf56 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -63,7 +63,8 @@ static int __devinit netxen_nic_probe(struct pci_dev *pdev, | |||
63 | static void __devexit netxen_nic_remove(struct pci_dev *pdev); | 63 | static void __devexit netxen_nic_remove(struct pci_dev *pdev); |
64 | static int netxen_nic_open(struct net_device *netdev); | 64 | static int netxen_nic_open(struct net_device *netdev); |
65 | static int netxen_nic_close(struct net_device *netdev); | 65 | static int netxen_nic_close(struct net_device *netdev); |
66 | static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); | 66 | static netdev_tx_t netxen_nic_xmit_frame(struct sk_buff *, |
67 | struct net_device *); | ||
67 | static void netxen_tx_timeout(struct net_device *netdev); | 68 | static void netxen_tx_timeout(struct net_device *netdev); |
68 | static void netxen_reset_task(struct work_struct *work); | 69 | static void netxen_reset_task(struct work_struct *work); |
69 | static void netxen_watchdog(unsigned long); | 70 | static void netxen_watchdog(unsigned long); |
@@ -1599,7 +1600,7 @@ netxen_clear_cmddesc(u64 *desc) | |||
1599 | desc[2] = 0ULL; | 1600 | desc[2] = 0ULL; |
1600 | } | 1601 | } |
1601 | 1602 | ||
1602 | static int | 1603 | static netdev_tx_t |
1603 | netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 1604 | netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) |
1604 | { | 1605 | { |
1605 | struct netxen_adapter *adapter = netdev_priv(netdev); | 1606 | struct netxen_adapter *adapter = netdev_priv(netdev); |
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c index a0ac5d4f27d3..bd0ac690d12c 100644 --- a/drivers/net/ni52.c +++ b/drivers/net/ni52.c | |||
@@ -170,7 +170,7 @@ static int ni52_probe1(struct net_device *dev, int ioaddr); | |||
170 | static irqreturn_t ni52_interrupt(int irq, void *dev_id); | 170 | static irqreturn_t ni52_interrupt(int irq, void *dev_id); |
171 | static int ni52_open(struct net_device *dev); | 171 | static int ni52_open(struct net_device *dev); |
172 | static int ni52_close(struct net_device *dev); | 172 | static int ni52_close(struct net_device *dev); |
173 | static int ni52_send_packet(struct sk_buff *, struct net_device *); | 173 | static netdev_tx_t ni52_send_packet(struct sk_buff *, struct net_device *); |
174 | static struct net_device_stats *ni52_get_stats(struct net_device *dev); | 174 | static struct net_device_stats *ni52_get_stats(struct net_device *dev); |
175 | static void set_multicast_list(struct net_device *dev); | 175 | static void set_multicast_list(struct net_device *dev); |
176 | static void ni52_timeout(struct net_device *dev); | 176 | static void ni52_timeout(struct net_device *dev); |
@@ -1173,7 +1173,8 @@ static void ni52_timeout(struct net_device *dev) | |||
1173 | * send frame | 1173 | * send frame |
1174 | */ | 1174 | */ |
1175 | 1175 | ||
1176 | static int ni52_send_packet(struct sk_buff *skb, struct net_device *dev) | 1176 | static netdev_tx_t ni52_send_packet(struct sk_buff *skb, |
1177 | struct net_device *dev) | ||
1177 | { | 1178 | { |
1178 | int len, i; | 1179 | int len, i; |
1179 | #ifndef NO_NOPCOMMANDS | 1180 | #ifndef NO_NOPCOMMANDS |
diff --git a/drivers/net/ni65.c b/drivers/net/ni65.c index 81a061785898..752c2e4d9cf4 100644 --- a/drivers/net/ni65.c +++ b/drivers/net/ni65.c | |||
@@ -252,7 +252,8 @@ static void ni65_xmit_intr(struct net_device *dev,int); | |||
252 | static int ni65_open(struct net_device *dev); | 252 | static int ni65_open(struct net_device *dev); |
253 | static int ni65_lance_reinit(struct net_device *dev); | 253 | static int ni65_lance_reinit(struct net_device *dev); |
254 | static void ni65_init_lance(struct priv *p,unsigned char*,int,int); | 254 | static void ni65_init_lance(struct priv *p,unsigned char*,int,int); |
255 | static int ni65_send_packet(struct sk_buff *skb, struct net_device *dev); | 255 | static netdev_tx_t ni65_send_packet(struct sk_buff *skb, |
256 | struct net_device *dev); | ||
256 | static void ni65_timeout(struct net_device *dev); | 257 | static void ni65_timeout(struct net_device *dev); |
257 | static int ni65_close(struct net_device *dev); | 258 | static int ni65_close(struct net_device *dev); |
258 | static int ni65_alloc_buffer(struct net_device *dev); | 259 | static int ni65_alloc_buffer(struct net_device *dev); |
@@ -1157,7 +1158,8 @@ static void ni65_timeout(struct net_device *dev) | |||
1157 | * Send a packet | 1158 | * Send a packet |
1158 | */ | 1159 | */ |
1159 | 1160 | ||
1160 | static int ni65_send_packet(struct sk_buff *skb, struct net_device *dev) | 1161 | static netdev_tx_t ni65_send_packet(struct sk_buff *skb, |
1162 | struct net_device *dev) | ||
1161 | { | 1163 | { |
1162 | struct priv *p = dev->ml_priv; | 1164 | struct priv *p = dev->ml_priv; |
1163 | 1165 | ||
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 3ada7ea2abca..119fd4e04141 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -6657,7 +6657,8 @@ static u64 niu_compute_tx_flags(struct sk_buff *skb, struct ethhdr *ehdr, | |||
6657 | return ret; | 6657 | return ret; |
6658 | } | 6658 | } |
6659 | 6659 | ||
6660 | static int niu_start_xmit(struct sk_buff *skb, struct net_device *dev) | 6660 | static netdev_tx_t niu_start_xmit(struct sk_buff *skb, |
6661 | struct net_device *dev) | ||
6661 | { | 6662 | { |
6662 | struct niu *np = netdev_priv(dev); | 6663 | struct niu *np = netdev_priv(dev); |
6663 | unsigned long align, headroom; | 6664 | unsigned long align, headroom; |
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 1576ac07216e..c594e1946476 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -1077,7 +1077,8 @@ static void ns83820_cleanup_tx(struct ns83820 *dev) | |||
1077 | * while trying to track down a bug in either the zero copy code or | 1077 | * while trying to track down a bug in either the zero copy code or |
1078 | * the tx fifo (hence the MAX_FRAG_LEN). | 1078 | * the tx fifo (hence the MAX_FRAG_LEN). |
1079 | */ | 1079 | */ |
1080 | static int ns83820_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) | 1080 | static netdev_tx_t ns83820_hard_start_xmit(struct sk_buff *skb, |
1081 | struct net_device *ndev) | ||
1081 | { | 1082 | { |
1082 | struct ns83820 *dev = PRIV(ndev); | 1083 | struct ns83820 *dev = PRIV(ndev); |
1083 | u32 free_idx, cmdsts, extsts; | 1084 | u32 free_idx, cmdsts, extsts; |
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index a23aa8724042..382d26520acc 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -239,7 +239,8 @@ static void tc574_wait_for_completion(struct net_device *dev, int cmd); | |||
239 | static void tc574_reset(struct net_device *dev); | 239 | static void tc574_reset(struct net_device *dev); |
240 | static void media_check(unsigned long arg); | 240 | static void media_check(unsigned long arg); |
241 | static int el3_open(struct net_device *dev); | 241 | static int el3_open(struct net_device *dev); |
242 | static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev); | 242 | static netdev_tx_t el3_start_xmit(struct sk_buff *skb, |
243 | struct net_device *dev); | ||
243 | static irqreturn_t el3_interrupt(int irq, void *dev_id); | 244 | static irqreturn_t el3_interrupt(int irq, void *dev_id); |
244 | static void update_stats(struct net_device *dev); | 245 | static void update_stats(struct net_device *dev); |
245 | static struct net_device_stats *el3_get_stats(struct net_device *dev); | 246 | static struct net_device_stats *el3_get_stats(struct net_device *dev); |
@@ -778,7 +779,8 @@ static void pop_tx_status(struct net_device *dev) | |||
778 | } | 779 | } |
779 | } | 780 | } |
780 | 781 | ||
781 | static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | 782 | static netdev_tx_t el3_start_xmit(struct sk_buff *skb, |
783 | struct net_device *dev) | ||
782 | { | 784 | { |
783 | unsigned int ioaddr = dev->base_addr; | 785 | unsigned int ioaddr = dev->base_addr; |
784 | struct el3_private *lp = netdev_priv(dev); | 786 | struct el3_private *lp = netdev_priv(dev); |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index d2156ab3da2b..569fb06793cf 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -149,7 +149,8 @@ static void tc589_reset(struct net_device *dev); | |||
149 | static void media_check(unsigned long arg); | 149 | static void media_check(unsigned long arg); |
150 | static int el3_config(struct net_device *dev, struct ifmap *map); | 150 | static int el3_config(struct net_device *dev, struct ifmap *map); |
151 | static int el3_open(struct net_device *dev); | 151 | static int el3_open(struct net_device *dev); |
152 | static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev); | 152 | static netdev_tx_t el3_start_xmit(struct sk_buff *skb, |
153 | struct net_device *dev); | ||
153 | static irqreturn_t el3_interrupt(int irq, void *dev_id); | 154 | static irqreturn_t el3_interrupt(int irq, void *dev_id); |
154 | static void update_stats(struct net_device *dev); | 155 | static void update_stats(struct net_device *dev); |
155 | static struct net_device_stats *el3_get_stats(struct net_device *dev); | 156 | static struct net_device_stats *el3_get_stats(struct net_device *dev); |
@@ -604,7 +605,8 @@ static void pop_tx_status(struct net_device *dev) | |||
604 | } | 605 | } |
605 | } | 606 | } |
606 | 607 | ||
607 | static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | 608 | static netdev_tx_t el3_start_xmit(struct sk_buff *skb, |
609 | struct net_device *dev) | ||
608 | { | 610 | { |
609 | unsigned int ioaddr = dev->base_addr; | 611 | unsigned int ioaddr = dev->base_addr; |
610 | struct el3_private *priv = netdev_priv(dev); | 612 | struct el3_private *priv = netdev_priv(dev); |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 1e87d634d7bc..3b681c1d7523 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -92,7 +92,8 @@ static void axnet_release(struct pcmcia_device *link); | |||
92 | static int axnet_open(struct net_device *dev); | 92 | static int axnet_open(struct net_device *dev); |
93 | static int axnet_close(struct net_device *dev); | 93 | static int axnet_close(struct net_device *dev); |
94 | static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 94 | static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
95 | static int axnet_start_xmit(struct sk_buff *skb, struct net_device *dev); | 95 | static netdev_tx_t axnet_start_xmit(struct sk_buff *skb, |
96 | struct net_device *dev); | ||
96 | static struct net_device_stats *get_stats(struct net_device *dev); | 97 | static struct net_device_stats *get_stats(struct net_device *dev); |
97 | static void set_multicast_list(struct net_device *dev); | 98 | static void set_multicast_list(struct net_device *dev); |
98 | static void axnet_tx_timeout(struct net_device *dev); | 99 | static void axnet_tx_timeout(struct net_device *dev); |
@@ -1063,7 +1064,8 @@ static void axnet_tx_timeout(struct net_device *dev) | |||
1063 | * Sends a packet to an 8390 network device. | 1064 | * Sends a packet to an 8390 network device. |
1064 | */ | 1065 | */ |
1065 | 1066 | ||
1066 | static int axnet_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1067 | static netdev_tx_t axnet_start_xmit(struct sk_buff *skb, |
1068 | struct net_device *dev) | ||
1067 | { | 1069 | { |
1068 | long e8390_base = dev->base_addr; | 1070 | long e8390_base = dev->base_addr; |
1069 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 1071 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 434d9407bfb3..7e01fbdb87e0 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -96,7 +96,8 @@ static void fmvj18x_detach(struct pcmcia_device *p_dev); | |||
96 | static int fjn_config(struct net_device *dev, struct ifmap *map); | 96 | static int fjn_config(struct net_device *dev, struct ifmap *map); |
97 | static int fjn_open(struct net_device *dev); | 97 | static int fjn_open(struct net_device *dev); |
98 | static int fjn_close(struct net_device *dev); | 98 | static int fjn_close(struct net_device *dev); |
99 | static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev); | 99 | static netdev_tx_t fjn_start_xmit(struct sk_buff *skb, |
100 | struct net_device *dev); | ||
100 | static irqreturn_t fjn_interrupt(int irq, void *dev_id); | 101 | static irqreturn_t fjn_interrupt(int irq, void *dev_id); |
101 | static void fjn_rx(struct net_device *dev); | 102 | static void fjn_rx(struct net_device *dev); |
102 | static void fjn_reset(struct net_device *dev); | 103 | static void fjn_reset(struct net_device *dev); |
@@ -856,7 +857,8 @@ static void fjn_tx_timeout(struct net_device *dev) | |||
856 | netif_wake_queue(dev); | 857 | netif_wake_queue(dev); |
857 | } | 858 | } |
858 | 859 | ||
859 | static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev) | 860 | static netdev_tx_t fjn_start_xmit(struct sk_buff *skb, |
861 | struct net_device *dev) | ||
860 | { | 862 | { |
861 | struct local_info_t *lp = netdev_priv(dev); | 863 | struct local_info_t *lp = netdev_priv(dev); |
862 | unsigned int ioaddr = dev->base_addr; | 864 | unsigned int ioaddr = dev->base_addr; |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index dd6059076705..5ed6339c52bc 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -424,7 +424,8 @@ static void nmclan_reset(struct net_device *dev); | |||
424 | static int mace_config(struct net_device *dev, struct ifmap *map); | 424 | static int mace_config(struct net_device *dev, struct ifmap *map); |
425 | static int mace_open(struct net_device *dev); | 425 | static int mace_open(struct net_device *dev); |
426 | static int mace_close(struct net_device *dev); | 426 | static int mace_close(struct net_device *dev); |
427 | static int mace_start_xmit(struct sk_buff *skb, struct net_device *dev); | 427 | static netdev_tx_t mace_start_xmit(struct sk_buff *skb, |
428 | struct net_device *dev); | ||
428 | static void mace_tx_timeout(struct net_device *dev); | 429 | static void mace_tx_timeout(struct net_device *dev); |
429 | static irqreturn_t mace_interrupt(int irq, void *dev_id); | 430 | static irqreturn_t mace_interrupt(int irq, void *dev_id); |
430 | static struct net_device_stats *mace_get_stats(struct net_device *dev); | 431 | static struct net_device_stats *mace_get_stats(struct net_device *dev); |
@@ -937,7 +938,8 @@ static void mace_tx_timeout(struct net_device *dev) | |||
937 | netif_wake_queue(dev); | 938 | netif_wake_queue(dev); |
938 | } | 939 | } |
939 | 940 | ||
940 | static int mace_start_xmit(struct sk_buff *skb, struct net_device *dev) | 941 | static netdev_tx_t mace_start_xmit(struct sk_buff *skb, |
942 | struct net_device *dev) | ||
941 | { | 943 | { |
942 | mace_private *lp = netdev_priv(dev); | 944 | mace_private *lp = netdev_priv(dev); |
943 | unsigned int ioaddr = dev->base_addr; | 945 | unsigned int ioaddr = dev->base_addr; |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 2f39244c17f2..7bde2cd34c7e 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -288,7 +288,8 @@ static int smc_open(struct net_device *dev); | |||
288 | static int smc_close(struct net_device *dev); | 288 | static int smc_close(struct net_device *dev); |
289 | static int smc_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 289 | static int smc_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
290 | static void smc_tx_timeout(struct net_device *dev); | 290 | static void smc_tx_timeout(struct net_device *dev); |
291 | static int smc_start_xmit(struct sk_buff *skb, struct net_device *dev); | 291 | static netdev_tx_t smc_start_xmit(struct sk_buff *skb, |
292 | struct net_device *dev); | ||
292 | static irqreturn_t smc_interrupt(int irq, void *dev_id); | 293 | static irqreturn_t smc_interrupt(int irq, void *dev_id); |
293 | static void smc_rx(struct net_device *dev); | 294 | static void smc_rx(struct net_device *dev); |
294 | static void set_rx_mode(struct net_device *dev); | 295 | static void set_rx_mode(struct net_device *dev); |
@@ -1370,7 +1371,8 @@ static void smc_tx_timeout(struct net_device *dev) | |||
1370 | netif_wake_queue(dev); | 1371 | netif_wake_queue(dev); |
1371 | } | 1372 | } |
1372 | 1373 | ||
1373 | static int smc_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1374 | static netdev_tx_t smc_start_xmit(struct sk_buff *skb, |
1375 | struct net_device *dev) | ||
1374 | { | 1376 | { |
1375 | struct smc_private *smc = netdev_priv(dev); | 1377 | struct smc_private *smc = netdev_priv(dev); |
1376 | unsigned int ioaddr = dev->base_addr; | 1378 | unsigned int ioaddr = dev->base_addr; |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index eda7bf6047cd..68de89167b49 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -352,7 +352,8 @@ typedef struct local_info_t { | |||
352 | /**************** | 352 | /**************** |
353 | * Some more prototypes | 353 | * Some more prototypes |
354 | */ | 354 | */ |
355 | static int do_start_xmit(struct sk_buff *skb, struct net_device *dev); | 355 | static netdev_tx_t do_start_xmit(struct sk_buff *skb, |
356 | struct net_device *dev); | ||
356 | static void xirc_tx_timeout(struct net_device *dev); | 357 | static void xirc_tx_timeout(struct net_device *dev); |
357 | static void xirc2ps_tx_timeout_task(struct work_struct *work); | 358 | static void xirc2ps_tx_timeout_task(struct work_struct *work); |
358 | static void set_addresses(struct net_device *dev); | 359 | static void set_addresses(struct net_device *dev); |
@@ -1361,7 +1362,7 @@ xirc_tx_timeout(struct net_device *dev) | |||
1361 | schedule_work(&lp->tx_timeout_task); | 1362 | schedule_work(&lp->tx_timeout_task); |
1362 | } | 1363 | } |
1363 | 1364 | ||
1364 | static int | 1365 | static netdev_tx_t |
1365 | do_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1366 | do_start_xmit(struct sk_buff *skb, struct net_device *dev) |
1366 | { | 1367 | { |
1367 | local_info_t *lp = netdev_priv(dev); | 1368 | local_info_t *lp = netdev_priv(dev); |
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 6859442f1862..6d28b18e7e28 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -303,7 +303,8 @@ static int pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *); | |||
303 | static int pcnet32_probe1(unsigned long, int, struct pci_dev *); | 303 | static int pcnet32_probe1(unsigned long, int, struct pci_dev *); |
304 | static int pcnet32_open(struct net_device *); | 304 | static int pcnet32_open(struct net_device *); |
305 | static int pcnet32_init_ring(struct net_device *); | 305 | static int pcnet32_init_ring(struct net_device *); |
306 | static int pcnet32_start_xmit(struct sk_buff *, struct net_device *); | 306 | static netdev_tx_t pcnet32_start_xmit(struct sk_buff *, |
307 | struct net_device *); | ||
307 | static void pcnet32_tx_timeout(struct net_device *dev); | 308 | static void pcnet32_tx_timeout(struct net_device *dev); |
308 | static irqreturn_t pcnet32_interrupt(int, void *); | 309 | static irqreturn_t pcnet32_interrupt(int, void *); |
309 | static int pcnet32_close(struct net_device *); | 310 | static int pcnet32_close(struct net_device *); |
@@ -2481,7 +2482,8 @@ static void pcnet32_tx_timeout(struct net_device *dev) | |||
2481 | spin_unlock_irqrestore(&lp->lock, flags); | 2482 | spin_unlock_irqrestore(&lp->lock, flags); |
2482 | } | 2483 | } |
2483 | 2484 | ||
2484 | static int pcnet32_start_xmit(struct sk_buff *skb, struct net_device *dev) | 2485 | static netdev_tx_t pcnet32_start_xmit(struct sk_buff *skb, |
2486 | struct net_device *dev) | ||
2485 | { | 2487 | { |
2486 | struct pcnet32_private *lp = netdev_priv(dev); | 2488 | struct pcnet32_private *lp = netdev_priv(dev); |
2487 | unsigned long ioaddr = dev->base_addr; | 2489 | unsigned long ioaddr = dev->base_addr; |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 35be2e8f0c98..9bf2a6be9031 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -951,7 +951,7 @@ out: | |||
951 | /* | 951 | /* |
952 | * Network interface unit routines. | 952 | * Network interface unit routines. |
953 | */ | 953 | */ |
954 | static int | 954 | static netdev_tx_t |
955 | ppp_start_xmit(struct sk_buff *skb, struct net_device *dev) | 955 | ppp_start_xmit(struct sk_buff *skb, struct net_device *dev) |
956 | { | 956 | { |
957 | struct ppp *ppp = netdev_priv(dev); | 957 | struct ppp *ppp = netdev_priv(dev); |
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c index a3932c9f3406..b211613e9dbd 100644 --- a/drivers/net/ps3_gelic_net.c +++ b/drivers/net/ps3_gelic_net.c | |||
@@ -1346,7 +1346,7 @@ done: | |||
1346 | return status; | 1346 | return status; |
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | static struct ethtool_ops gelic_ether_ethtool_ops = { | 1349 | static const struct ethtool_ops gelic_ether_ethtool_ops = { |
1350 | .get_drvinfo = gelic_net_get_drvinfo, | 1350 | .get_drvinfo = gelic_net_get_drvinfo, |
1351 | .get_settings = gelic_ether_get_settings, | 1351 | .get_settings = gelic_ether_get_settings, |
1352 | .get_link = ethtool_op_get_link, | 1352 | .get_link = ethtool_op_get_link, |
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c index 6932b08d746b..227b141c4fbd 100644 --- a/drivers/net/ps3_gelic_wireless.c +++ b/drivers/net/ps3_gelic_wireless.c | |||
@@ -2714,7 +2714,7 @@ static const struct net_device_ops gelic_wl_netdevice_ops = { | |||
2714 | #endif | 2714 | #endif |
2715 | }; | 2715 | }; |
2716 | 2716 | ||
2717 | static struct ethtool_ops gelic_wl_ethtool_ops = { | 2717 | static const struct ethtool_ops gelic_wl_ethtool_ops = { |
2718 | .get_drvinfo = gelic_net_get_drvinfo, | 2718 | .get_drvinfo = gelic_net_get_drvinfo, |
2719 | .get_link = gelic_wl_get_link, | 2719 | .get_link = gelic_wl_get_link, |
2720 | .get_tx_csum = ethtool_op_get_tx_csum, | 2720 | .get_tx_csum = ethtool_op_get_tx_csum, |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 3e4b67aaa6ea..4c610511eb40 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -2572,7 +2572,8 @@ map_error: | |||
2572 | * The IOCB is always the top of the chain followed by one or more | 2572 | * The IOCB is always the top of the chain followed by one or more |
2573 | * OALs (when necessary). | 2573 | * OALs (when necessary). |
2574 | */ | 2574 | */ |
2575 | static int ql3xxx_send(struct sk_buff *skb, struct net_device *ndev) | 2575 | static netdev_tx_t ql3xxx_send(struct sk_buff *skb, |
2576 | struct net_device *ndev) | ||
2576 | { | 2577 | { |
2577 | struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev); | 2578 | struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev); |
2578 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; | 2579 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 8dd266befdc7..220529257828 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -2103,7 +2103,7 @@ static void ql_hw_csum_setup(struct sk_buff *skb, | |||
2103 | iph->daddr, len, iph->protocol, 0); | 2103 | iph->daddr, len, iph->protocol, 0); |
2104 | } | 2104 | } |
2105 | 2105 | ||
2106 | static int qlge_send(struct sk_buff *skb, struct net_device *ndev) | 2106 | static netdev_tx_t qlge_send(struct sk_buff *skb, struct net_device *ndev) |
2107 | { | 2107 | { |
2108 | struct tx_ring_desc *tx_ring_desc; | 2108 | struct tx_ring_desc *tx_ring_desc; |
2109 | struct ob_mac_iocb_req *mac_iocb_ptr; | 2109 | struct ob_mac_iocb_req *mac_iocb_ptr; |
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index 8068a07eb2b3..7dfcb58b0eb4 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c | |||
@@ -883,13 +883,13 @@ static int r6040_open(struct net_device *dev) | |||
883 | return 0; | 883 | return 0; |
884 | } | 884 | } |
885 | 885 | ||
886 | static int r6040_start_xmit(struct sk_buff *skb, struct net_device *dev) | 886 | static netdev_tx_t r6040_start_xmit(struct sk_buff *skb, |
887 | struct net_device *dev) | ||
887 | { | 888 | { |
888 | struct r6040_private *lp = netdev_priv(dev); | 889 | struct r6040_private *lp = netdev_priv(dev); |
889 | struct r6040_descriptor *descptr; | 890 | struct r6040_descriptor *descptr; |
890 | void __iomem *ioaddr = lp->base; | 891 | void __iomem *ioaddr = lp->base; |
891 | unsigned long flags; | 892 | unsigned long flags; |
892 | int ret = NETDEV_TX_OK; | ||
893 | 893 | ||
894 | /* Critical Section */ | 894 | /* Critical Section */ |
895 | spin_lock_irqsave(&lp->lock, flags); | 895 | spin_lock_irqsave(&lp->lock, flags); |
@@ -899,8 +899,7 @@ static int r6040_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
899 | spin_unlock_irqrestore(&lp->lock, flags); | 899 | spin_unlock_irqrestore(&lp->lock, flags); |
900 | netif_stop_queue(dev); | 900 | netif_stop_queue(dev); |
901 | printk(KERN_ERR DRV_NAME ": no tx descriptor\n"); | 901 | printk(KERN_ERR DRV_NAME ": no tx descriptor\n"); |
902 | ret = NETDEV_TX_BUSY; | 902 | return NETDEV_TX_BUSY; |
903 | return ret; | ||
904 | } | 903 | } |
905 | 904 | ||
906 | /* Statistic Counter */ | 905 | /* Statistic Counter */ |
@@ -928,7 +927,8 @@ static int r6040_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
928 | 927 | ||
929 | dev->trans_start = jiffies; | 928 | dev->trans_start = jiffies; |
930 | spin_unlock_irqrestore(&lp->lock, flags); | 929 | spin_unlock_irqrestore(&lp->lock, flags); |
931 | return ret; | 930 | |
931 | return NETDEV_TX_OK; | ||
932 | } | 932 | } |
933 | 933 | ||
934 | static void r6040_multicast_list(struct net_device *dev) | 934 | static void r6040_multicast_list(struct net_device *dev) |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 8cd85309c675..ec0092affd5d 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -507,7 +507,8 @@ MODULE_LICENSE("GPL"); | |||
507 | MODULE_VERSION(RTL8169_VERSION); | 507 | MODULE_VERSION(RTL8169_VERSION); |
508 | 508 | ||
509 | static int rtl8169_open(struct net_device *dev); | 509 | static int rtl8169_open(struct net_device *dev); |
510 | static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev); | 510 | static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, |
511 | struct net_device *dev); | ||
511 | static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance); | 512 | static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance); |
512 | static int rtl8169_init_ring(struct net_device *dev); | 513 | static int rtl8169_init_ring(struct net_device *dev); |
513 | static void rtl_hw_start(struct net_device *dev); | 514 | static void rtl_hw_start(struct net_device *dev); |
@@ -3357,7 +3358,8 @@ static inline u32 rtl8169_tso_csum(struct sk_buff *skb, struct net_device *dev) | |||
3357 | return 0; | 3358 | return 0; |
3358 | } | 3359 | } |
3359 | 3360 | ||
3360 | static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev) | 3361 | static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, |
3362 | struct net_device *dev) | ||
3361 | { | 3363 | { |
3362 | struct rtl8169_private *tp = netdev_priv(dev); | 3364 | struct rtl8169_private *tp = netdev_priv(dev); |
3363 | unsigned int frags, entry = tp->cur_tx % NUM_TX_DESC; | 3365 | unsigned int frags, entry = tp->cur_tx % NUM_TX_DESC; |
@@ -3366,7 +3368,6 @@ static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3366 | dma_addr_t mapping; | 3368 | dma_addr_t mapping; |
3367 | u32 status, len; | 3369 | u32 status, len; |
3368 | u32 opts1; | 3370 | u32 opts1; |
3369 | int ret = NETDEV_TX_OK; | ||
3370 | 3371 | ||
3371 | if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { | 3372 | if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { |
3372 | if (netif_msg_drv(tp)) { | 3373 | if (netif_msg_drv(tp)) { |
@@ -3418,13 +3419,12 @@ static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3418 | } | 3419 | } |
3419 | 3420 | ||
3420 | out: | 3421 | out: |
3421 | return ret; | 3422 | return NETDEV_TX_OK; |
3422 | 3423 | ||
3423 | err_stop: | 3424 | err_stop: |
3424 | netif_stop_queue(dev); | 3425 | netif_stop_queue(dev); |
3425 | ret = NETDEV_TX_BUSY; | ||
3426 | dev->stats.tx_dropped++; | 3426 | dev->stats.tx_dropped++; |
3427 | goto out; | 3427 | return NETDEV_TX_BUSY; |
3428 | } | 3428 | } |
3429 | 3429 | ||
3430 | static void rtl8169_pcierr_interrupt(struct net_device *dev) | 3430 | static void rtl8169_pcierr_interrupt(struct net_device *dev) |
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c index d95534655911..20a71749154a 100644 --- a/drivers/net/rrunner.c +++ b/drivers/net/rrunner.c | |||
@@ -1401,7 +1401,8 @@ static int rr_close(struct net_device *dev) | |||
1401 | } | 1401 | } |
1402 | 1402 | ||
1403 | 1403 | ||
1404 | static int rr_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1404 | static netdev_tx_t rr_start_xmit(struct sk_buff *skb, |
1405 | struct net_device *dev) | ||
1405 | { | 1406 | { |
1406 | struct rr_private *rrpriv = netdev_priv(dev); | 1407 | struct rr_private *rrpriv = netdev_priv(dev); |
1407 | struct rr_regs __iomem *regs = rrpriv->regs; | 1408 | struct rr_regs __iomem *regs = rrpriv->regs; |
diff --git a/drivers/net/rrunner.h b/drivers/net/rrunner.h index 6173f11218df..28169043ae49 100644 --- a/drivers/net/rrunner.h +++ b/drivers/net/rrunner.h | |||
@@ -831,7 +831,8 @@ static int rr_init1(struct net_device *dev); | |||
831 | static irqreturn_t rr_interrupt(int irq, void *dev_id); | 831 | static irqreturn_t rr_interrupt(int irq, void *dev_id); |
832 | 832 | ||
833 | static int rr_open(struct net_device *dev); | 833 | static int rr_open(struct net_device *dev); |
834 | static int rr_start_xmit(struct sk_buff *skb, struct net_device *dev); | 834 | static netdev_tx_t rr_start_xmit(struct sk_buff *skb, |
835 | struct net_device *dev); | ||
835 | static int rr_close(struct net_device *dev); | 836 | static int rr_close(struct net_device *dev); |
836 | static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 837 | static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
837 | static unsigned int rr_read_eeprom(struct rr_private *rrpriv, | 838 | static unsigned int rr_read_eeprom(struct rr_private *rrpriv, |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 3138df5773ee..ddccf5fa56b6 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -4072,7 +4072,7 @@ static int s2io_close(struct net_device *dev) | |||
4072 | * 0 on success & 1 on failure. | 4072 | * 0 on success & 1 on failure. |
4073 | */ | 4073 | */ |
4074 | 4074 | ||
4075 | static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | 4075 | static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev) |
4076 | { | 4076 | { |
4077 | struct s2io_nic *sp = netdev_priv(dev); | 4077 | struct s2io_nic *sp = netdev_priv(dev); |
4078 | u16 frg_cnt, frg_len, i, queue, queue_len, put_off, get_off; | 4078 | u16 frg_cnt, frg_len, i, queue, queue_len, put_off, get_off; |
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c index 6a81aec645d9..ee366c5a8fa3 100644 --- a/drivers/net/sb1000.c +++ b/drivers/net/sb1000.c | |||
@@ -82,7 +82,8 @@ struct sb1000_private { | |||
82 | extern int sb1000_probe(struct net_device *dev); | 82 | extern int sb1000_probe(struct net_device *dev); |
83 | static int sb1000_open(struct net_device *dev); | 83 | static int sb1000_open(struct net_device *dev); |
84 | static int sb1000_dev_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd); | 84 | static int sb1000_dev_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd); |
85 | static int sb1000_start_xmit(struct sk_buff *skb, struct net_device *dev); | 85 | static netdev_tx_t sb1000_start_xmit(struct sk_buff *skb, |
86 | struct net_device *dev); | ||
86 | static irqreturn_t sb1000_interrupt(int irq, void *dev_id); | 87 | static irqreturn_t sb1000_interrupt(int irq, void *dev_id); |
87 | static int sb1000_close(struct net_device *dev); | 88 | static int sb1000_close(struct net_device *dev); |
88 | 89 | ||
@@ -1080,7 +1081,7 @@ static int sb1000_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1080 | } | 1081 | } |
1081 | 1082 | ||
1082 | /* transmit function: do nothing since SB1000 can't send anything out */ | 1083 | /* transmit function: do nothing since SB1000 can't send anything out */ |
1083 | static int | 1084 | static netdev_tx_t |
1084 | sb1000_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1085 | sb1000_start_xmit(struct sk_buff *skb, struct net_device *dev) |
1085 | { | 1086 | { |
1086 | printk(KERN_WARNING "%s: trying to transmit!!!\n", dev->name); | 1087 | printk(KERN_WARNING "%s: trying to transmit!!!\n", dev->name); |
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c index e3156c97bb58..8d6030022d14 100644 --- a/drivers/net/sc92031.c +++ b/drivers/net/sc92031.c | |||
@@ -941,7 +941,8 @@ static struct net_device_stats *sc92031_get_stats(struct net_device *dev) | |||
941 | return &dev->stats; | 941 | return &dev->stats; |
942 | } | 942 | } |
943 | 943 | ||
944 | static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev) | 944 | static netdev_tx_t sc92031_start_xmit(struct sk_buff *skb, |
945 | struct net_device *dev) | ||
945 | { | 946 | { |
946 | struct sc92031_priv *priv = netdev_priv(dev); | 947 | struct sc92031_priv *priv = netdev_priv(dev); |
947 | void __iomem *port_base = priv->port_base; | 948 | void __iomem *port_base = priv->port_base; |
diff --git a/drivers/net/seeq8005.c b/drivers/net/seeq8005.c index 7cc8bb814137..39246d457ac2 100644 --- a/drivers/net/seeq8005.c +++ b/drivers/net/seeq8005.c | |||
@@ -81,7 +81,8 @@ struct net_local { | |||
81 | static int seeq8005_probe1(struct net_device *dev, int ioaddr); | 81 | static int seeq8005_probe1(struct net_device *dev, int ioaddr); |
82 | static int seeq8005_open(struct net_device *dev); | 82 | static int seeq8005_open(struct net_device *dev); |
83 | static void seeq8005_timeout(struct net_device *dev); | 83 | static void seeq8005_timeout(struct net_device *dev); |
84 | static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev); | 84 | static netdev_tx_t seeq8005_send_packet(struct sk_buff *skb, |
85 | struct net_device *dev); | ||
85 | static irqreturn_t seeq8005_interrupt(int irq, void *dev_id); | 86 | static irqreturn_t seeq8005_interrupt(int irq, void *dev_id); |
86 | static void seeq8005_rx(struct net_device *dev); | 87 | static void seeq8005_rx(struct net_device *dev); |
87 | static int seeq8005_close(struct net_device *dev); | 88 | static int seeq8005_close(struct net_device *dev); |
@@ -394,7 +395,8 @@ static void seeq8005_timeout(struct net_device *dev) | |||
394 | netif_wake_queue(dev); | 395 | netif_wake_queue(dev); |
395 | } | 396 | } |
396 | 397 | ||
397 | static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev) | 398 | static netdev_tx_t seeq8005_send_packet(struct sk_buff *skb, |
399 | struct net_device *dev) | ||
398 | { | 400 | { |
399 | short length = skb->len; | 401 | short length = skb->len; |
400 | unsigned char *buf; | 402 | unsigned char *buf; |
diff --git a/drivers/net/sfc/efx.h b/drivers/net/sfc/efx.h index da157aa74b83..aecaf62f4929 100644 --- a/drivers/net/sfc/efx.h +++ b/drivers/net/sfc/efx.h | |||
@@ -20,8 +20,9 @@ | |||
20 | #define FALCON_B_P_DEVID 0x0710 | 20 | #define FALCON_B_P_DEVID 0x0710 |
21 | 21 | ||
22 | /* TX */ | 22 | /* TX */ |
23 | extern int efx_xmit(struct efx_nic *efx, | 23 | extern netdev_tx_t efx_xmit(struct efx_nic *efx, |
24 | struct efx_tx_queue *tx_queue, struct sk_buff *skb); | 24 | struct efx_tx_queue *tx_queue, |
25 | struct sk_buff *skb); | ||
25 | extern void efx_stop_queue(struct efx_nic *efx); | 26 | extern void efx_stop_queue(struct efx_nic *efx); |
26 | extern void efx_wake_queue(struct efx_nic *efx); | 27 | extern void efx_wake_queue(struct efx_nic *efx); |
27 | 28 | ||
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 997ea2a3d53f..45018f283ffa 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -731,7 +731,7 @@ static void efx_ethtool_get_pauseparam(struct net_device *net_dev, | |||
731 | } | 731 | } |
732 | 732 | ||
733 | 733 | ||
734 | struct ethtool_ops efx_ethtool_ops = { | 734 | const struct ethtool_ops efx_ethtool_ops = { |
735 | .get_settings = efx_ethtool_get_settings, | 735 | .get_settings = efx_ethtool_get_settings, |
736 | .set_settings = efx_ethtool_set_settings, | 736 | .set_settings = efx_ethtool_set_settings, |
737 | .get_drvinfo = efx_ethtool_get_drvinfo, | 737 | .get_drvinfo = efx_ethtool_get_drvinfo, |
diff --git a/drivers/net/sfc/ethtool.h b/drivers/net/sfc/ethtool.h index 3628e43df14d..295ead403356 100644 --- a/drivers/net/sfc/ethtool.h +++ b/drivers/net/sfc/ethtool.h | |||
@@ -22,6 +22,6 @@ extern int efx_ethtool_get_settings(struct net_device *net_dev, | |||
22 | extern int efx_ethtool_set_settings(struct net_device *net_dev, | 22 | extern int efx_ethtool_set_settings(struct net_device *net_dev, |
23 | struct ethtool_cmd *ecmd); | 23 | struct ethtool_cmd *ecmd); |
24 | 24 | ||
25 | extern struct ethtool_ops efx_ethtool_ops; | 25 | extern const struct ethtool_ops efx_ethtool_ops; |
26 | 26 | ||
27 | #endif /* EFX_ETHTOOL_H */ | 27 | #endif /* EFX_ETHTOOL_H */ |
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index b67ccca3fc1a..817c7efc11e0 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -400,7 +400,8 @@ static int efx_begin_loopback(struct efx_tx_queue *tx_queue) | |||
400 | struct efx_loopback_state *state = efx->loopback_selftest; | 400 | struct efx_loopback_state *state = efx->loopback_selftest; |
401 | struct efx_loopback_payload *payload; | 401 | struct efx_loopback_payload *payload; |
402 | struct sk_buff *skb; | 402 | struct sk_buff *skb; |
403 | int i, rc; | 403 | int i; |
404 | netdev_tx_t rc; | ||
404 | 405 | ||
405 | /* Transmit N copies of buffer */ | 406 | /* Transmit N copies of buffer */ |
406 | for (i = 0; i < state->packet_count; i++) { | 407 | for (i = 0; i < state->packet_count; i++) { |
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index 14a14788566c..489c4de31447 100644 --- a/drivers/net/sfc/tx.c +++ b/drivers/net/sfc/tx.c | |||
@@ -138,8 +138,8 @@ static void efx_tsoh_free(struct efx_tx_queue *tx_queue, | |||
138 | * Returns NETDEV_TX_OK or NETDEV_TX_BUSY | 138 | * Returns NETDEV_TX_OK or NETDEV_TX_BUSY |
139 | * You must hold netif_tx_lock() to call this function. | 139 | * You must hold netif_tx_lock() to call this function. |
140 | */ | 140 | */ |
141 | static int efx_enqueue_skb(struct efx_tx_queue *tx_queue, | 141 | static netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, |
142 | struct sk_buff *skb) | 142 | struct sk_buff *skb) |
143 | { | 143 | { |
144 | struct efx_nic *efx = tx_queue->efx; | 144 | struct efx_nic *efx = tx_queue->efx; |
145 | struct pci_dev *pci_dev = efx->pci_dev; | 145 | struct pci_dev *pci_dev = efx->pci_dev; |
@@ -152,7 +152,7 @@ static int efx_enqueue_skb(struct efx_tx_queue *tx_queue, | |||
152 | unsigned int dma_len; | 152 | unsigned int dma_len; |
153 | bool unmap_single; | 153 | bool unmap_single; |
154 | int q_space, i = 0; | 154 | int q_space, i = 0; |
155 | int rc = NETDEV_TX_OK; | 155 | netdev_tx_t rc = NETDEV_TX_OK; |
156 | 156 | ||
157 | EFX_BUG_ON_PARANOID(tx_queue->write_count != tx_queue->insert_count); | 157 | EFX_BUG_ON_PARANOID(tx_queue->write_count != tx_queue->insert_count); |
158 | 158 | ||
@@ -353,14 +353,11 @@ static void efx_dequeue_buffers(struct efx_tx_queue *tx_queue, | |||
353 | * | 353 | * |
354 | * Context: netif_tx_lock held | 354 | * Context: netif_tx_lock held |
355 | */ | 355 | */ |
356 | inline int efx_xmit(struct efx_nic *efx, | 356 | inline netdev_tx_t efx_xmit(struct efx_nic *efx, |
357 | struct efx_tx_queue *tx_queue, struct sk_buff *skb) | 357 | struct efx_tx_queue *tx_queue, struct sk_buff *skb) |
358 | { | 358 | { |
359 | int rc; | ||
360 | |||
361 | /* Map fragments for DMA and add to TX queue */ | 359 | /* Map fragments for DMA and add to TX queue */ |
362 | rc = efx_enqueue_skb(tx_queue, skb); | 360 | return efx_enqueue_skb(tx_queue, skb); |
363 | return rc; | ||
364 | } | 361 | } |
365 | 362 | ||
366 | /* Initiate a packet transmission. We use one channel per CPU | 363 | /* Initiate a packet transmission. We use one channel per CPU |
@@ -372,7 +369,8 @@ inline int efx_xmit(struct efx_nic *efx, | |||
372 | * Note that returning anything other than NETDEV_TX_OK will cause the | 369 | * Note that returning anything other than NETDEV_TX_OK will cause the |
373 | * OS to free the skb. | 370 | * OS to free the skb. |
374 | */ | 371 | */ |
375 | int efx_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev) | 372 | netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, |
373 | struct net_device *net_dev) | ||
376 | { | 374 | { |
377 | struct efx_nic *efx = netdev_priv(net_dev); | 375 | struct efx_nic *efx = netdev_priv(net_dev); |
378 | struct efx_tx_queue *tx_queue; | 376 | struct efx_tx_queue *tx_queue; |
diff --git a/drivers/net/sfc/tx.h b/drivers/net/sfc/tx.h index 5e1cc234e42f..e3678962a5b4 100644 --- a/drivers/net/sfc/tx.h +++ b/drivers/net/sfc/tx.h | |||
@@ -18,7 +18,8 @@ void efx_remove_tx_queue(struct efx_tx_queue *tx_queue); | |||
18 | void efx_init_tx_queue(struct efx_tx_queue *tx_queue); | 18 | void efx_init_tx_queue(struct efx_tx_queue *tx_queue); |
19 | void efx_fini_tx_queue(struct efx_tx_queue *tx_queue); | 19 | void efx_fini_tx_queue(struct efx_tx_queue *tx_queue); |
20 | 20 | ||
21 | int efx_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev); | 21 | netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, |
22 | struct net_device *net_dev); | ||
22 | void efx_release_tx_buffers(struct efx_tx_queue *tx_queue); | 23 | void efx_release_tx_buffers(struct efx_tx_queue *tx_queue); |
23 | 24 | ||
24 | #endif /* EFX_TX_H */ | 25 | #endif /* EFX_TX_H */ |
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index 1f040e8a000b..7cc9898f4e00 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -1168,7 +1168,8 @@ static int sis190_close(struct net_device *dev) | |||
1168 | return 0; | 1168 | return 0; |
1169 | } | 1169 | } |
1170 | 1170 | ||
1171 | static int sis190_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1171 | static netdev_tx_t sis190_start_xmit(struct sk_buff *skb, |
1172 | struct net_device *dev) | ||
1172 | { | 1173 | { |
1173 | struct sis190_private *tp = netdev_priv(dev); | 1174 | struct sis190_private *tp = netdev_priv(dev); |
1174 | void __iomem *ioaddr = tp->mmio_addr; | 1175 | void __iomem *ioaddr = tp->mmio_addr; |
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index 61ceeaaf104d..d8827323507a 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -214,7 +214,8 @@ static void sis900_check_mode (struct net_device *net_dev, struct mii_phy *mii_p | |||
214 | static void sis900_tx_timeout(struct net_device *net_dev); | 214 | static void sis900_tx_timeout(struct net_device *net_dev); |
215 | static void sis900_init_tx_ring(struct net_device *net_dev); | 215 | static void sis900_init_tx_ring(struct net_device *net_dev); |
216 | static void sis900_init_rx_ring(struct net_device *net_dev); | 216 | static void sis900_init_rx_ring(struct net_device *net_dev); |
217 | static int sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev); | 217 | static netdev_tx_t sis900_start_xmit(struct sk_buff *skb, |
218 | struct net_device *net_dev); | ||
218 | static int sis900_rx(struct net_device *net_dev); | 219 | static int sis900_rx(struct net_device *net_dev); |
219 | static void sis900_finish_xmit (struct net_device *net_dev); | 220 | static void sis900_finish_xmit (struct net_device *net_dev); |
220 | static irqreturn_t sis900_interrupt(int irq, void *dev_instance); | 221 | static irqreturn_t sis900_interrupt(int irq, void *dev_instance); |
@@ -1571,7 +1572,7 @@ static void sis900_tx_timeout(struct net_device *net_dev) | |||
1571 | * tell upper layer if the buffer is full | 1572 | * tell upper layer if the buffer is full |
1572 | */ | 1573 | */ |
1573 | 1574 | ||
1574 | static int | 1575 | static netdev_tx_t |
1575 | sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev) | 1576 | sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev) |
1576 | { | 1577 | { |
1577 | struct sis900_private *sis_priv = netdev_priv(net_dev); | 1578 | struct sis900_private *sis_priv = netdev_priv(net_dev); |
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c index 888a14a045ef..38a508b4aad9 100644 --- a/drivers/net/skfp/skfddi.c +++ b/drivers/net/skfp/skfddi.c | |||
@@ -107,7 +107,8 @@ static void skfp_ctl_set_multicast_list(struct net_device *dev); | |||
107 | static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev); | 107 | static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev); |
108 | static int skfp_ctl_set_mac_address(struct net_device *dev, void *addr); | 108 | static int skfp_ctl_set_mac_address(struct net_device *dev, void *addr); |
109 | static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 109 | static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
110 | static int skfp_send_pkt(struct sk_buff *skb, struct net_device *dev); | 110 | static netdev_tx_t skfp_send_pkt(struct sk_buff *skb, |
111 | struct net_device *dev); | ||
111 | static void send_queued_packets(struct s_smc *smc); | 112 | static void send_queued_packets(struct s_smc *smc); |
112 | static void CheckSourceAddress(unsigned char *frame, unsigned char *hw_addr); | 113 | static void CheckSourceAddress(unsigned char *frame, unsigned char *hw_addr); |
113 | static void ResetAdapter(struct s_smc *smc); | 114 | static void ResetAdapter(struct s_smc *smc); |
@@ -1056,7 +1057,8 @@ static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
1056 | * Side Effects: | 1057 | * Side Effects: |
1057 | * None | 1058 | * None |
1058 | */ | 1059 | */ |
1059 | static int skfp_send_pkt(struct sk_buff *skb, struct net_device *dev) | 1060 | static netdev_tx_t skfp_send_pkt(struct sk_buff *skb, |
1061 | struct net_device *dev) | ||
1060 | { | 1062 | { |
1061 | struct s_smc *smc = netdev_priv(dev); | 1063 | struct s_smc *smc = netdev_priv(dev); |
1062 | skfddi_priv *bp = &smc->os; | 1064 | skfddi_priv *bp = &smc->os; |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 543af2044f40..1a1e68549f5c 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -2746,7 +2746,8 @@ static inline int skge_avail(const struct skge_ring *ring) | |||
2746 | + (ring->to_clean - ring->to_use) - 1; | 2746 | + (ring->to_clean - ring->to_use) - 1; |
2747 | } | 2747 | } |
2748 | 2748 | ||
2749 | static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) | 2749 | static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, |
2750 | struct net_device *dev) | ||
2750 | { | 2751 | { |
2751 | struct skge_port *skge = netdev_priv(dev); | 2752 | struct skge_port *skge = netdev_priv(dev); |
2752 | struct skge_hw *hw = skge->hw; | 2753 | struct skge_hw *hw = skge->hw; |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index dd630cf18b4d..d1f3b46a2b08 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -256,6 +256,9 @@ static void sky2_power_on(struct sky2_hw *hw) | |||
256 | 256 | ||
257 | sky2_read32(hw, B2_GP_IO); | 257 | sky2_read32(hw, B2_GP_IO); |
258 | } | 258 | } |
259 | |||
260 | /* Turn on "driver loaded" LED */ | ||
261 | sky2_write16(hw, B0_CTST, Y2_LED_STAT_ON); | ||
259 | } | 262 | } |
260 | 263 | ||
261 | static void sky2_power_aux(struct sky2_hw *hw) | 264 | static void sky2_power_aux(struct sky2_hw *hw) |
@@ -270,10 +273,13 @@ static void sky2_power_aux(struct sky2_hw *hw) | |||
270 | Y2_COR_CLK_LNK2_DIS | Y2_CLK_GAT_LNK2_DIS); | 273 | Y2_COR_CLK_LNK2_DIS | Y2_CLK_GAT_LNK2_DIS); |
271 | 274 | ||
272 | /* switch power to VAUX */ | 275 | /* switch power to VAUX */ |
273 | if (sky2_read16(hw, B0_CTST) & Y2_VAUX_AVAIL) | 276 | if (sky2_read32(hw, B0_CTST) & Y2_VAUX_AVAIL) |
274 | sky2_write8(hw, B0_POWER_CTRL, | 277 | sky2_write8(hw, B0_POWER_CTRL, |
275 | (PC_VAUX_ENA | PC_VCC_ENA | | 278 | (PC_VAUX_ENA | PC_VCC_ENA | |
276 | PC_VAUX_ON | PC_VCC_OFF)); | 279 | PC_VAUX_ON | PC_VCC_OFF)); |
280 | |||
281 | /* turn off "driver loaded LED" */ | ||
282 | sky2_write16(hw, B0_CTST, Y2_LED_STAT_OFF); | ||
277 | } | 283 | } |
278 | 284 | ||
279 | static void sky2_gmac_reset(struct sky2_hw *hw, unsigned port) | 285 | static void sky2_gmac_reset(struct sky2_hw *hw, unsigned port) |
@@ -1399,6 +1405,61 @@ nomem: | |||
1399 | return -ENOMEM; | 1405 | return -ENOMEM; |
1400 | } | 1406 | } |
1401 | 1407 | ||
1408 | static int sky2_alloc_buffers(struct sky2_port *sky2) | ||
1409 | { | ||
1410 | struct sky2_hw *hw = sky2->hw; | ||
1411 | |||
1412 | /* must be power of 2 */ | ||
1413 | sky2->tx_le = pci_alloc_consistent(hw->pdev, | ||
1414 | sky2->tx_ring_size * | ||
1415 | sizeof(struct sky2_tx_le), | ||
1416 | &sky2->tx_le_map); | ||
1417 | if (!sky2->tx_le) | ||
1418 | goto nomem; | ||
1419 | |||
1420 | sky2->tx_ring = kcalloc(sky2->tx_ring_size, sizeof(struct tx_ring_info), | ||
1421 | GFP_KERNEL); | ||
1422 | if (!sky2->tx_ring) | ||
1423 | goto nomem; | ||
1424 | |||
1425 | sky2->rx_le = pci_alloc_consistent(hw->pdev, RX_LE_BYTES, | ||
1426 | &sky2->rx_le_map); | ||
1427 | if (!sky2->rx_le) | ||
1428 | goto nomem; | ||
1429 | memset(sky2->rx_le, 0, RX_LE_BYTES); | ||
1430 | |||
1431 | sky2->rx_ring = kcalloc(sky2->rx_pending, sizeof(struct rx_ring_info), | ||
1432 | GFP_KERNEL); | ||
1433 | if (!sky2->rx_ring) | ||
1434 | goto nomem; | ||
1435 | |||
1436 | return 0; | ||
1437 | nomem: | ||
1438 | return -ENOMEM; | ||
1439 | } | ||
1440 | |||
1441 | static void sky2_free_buffers(struct sky2_port *sky2) | ||
1442 | { | ||
1443 | struct sky2_hw *hw = sky2->hw; | ||
1444 | |||
1445 | if (sky2->rx_le) { | ||
1446 | pci_free_consistent(hw->pdev, RX_LE_BYTES, | ||
1447 | sky2->rx_le, sky2->rx_le_map); | ||
1448 | sky2->rx_le = NULL; | ||
1449 | } | ||
1450 | if (sky2->tx_le) { | ||
1451 | pci_free_consistent(hw->pdev, | ||
1452 | sky2->tx_ring_size * sizeof(struct sky2_tx_le), | ||
1453 | sky2->tx_le, sky2->tx_le_map); | ||
1454 | sky2->tx_le = NULL; | ||
1455 | } | ||
1456 | kfree(sky2->tx_ring); | ||
1457 | kfree(sky2->rx_ring); | ||
1458 | |||
1459 | sky2->tx_ring = NULL; | ||
1460 | sky2->rx_ring = NULL; | ||
1461 | } | ||
1462 | |||
1402 | /* Bring up network interface. */ | 1463 | /* Bring up network interface. */ |
1403 | static int sky2_up(struct net_device *dev) | 1464 | static int sky2_up(struct net_device *dev) |
1404 | { | 1465 | { |
@@ -1406,7 +1467,7 @@ static int sky2_up(struct net_device *dev) | |||
1406 | struct sky2_hw *hw = sky2->hw; | 1467 | struct sky2_hw *hw = sky2->hw; |
1407 | unsigned port = sky2->port; | 1468 | unsigned port = sky2->port; |
1408 | u32 imask, ramsize; | 1469 | u32 imask, ramsize; |
1409 | int cap, err = -ENOMEM; | 1470 | int cap, err; |
1410 | struct net_device *otherdev = hw->dev[sky2->port^1]; | 1471 | struct net_device *otherdev = hw->dev[sky2->port^1]; |
1411 | 1472 | ||
1412 | /* | 1473 | /* |
@@ -1425,32 +1486,12 @@ static int sky2_up(struct net_device *dev) | |||
1425 | 1486 | ||
1426 | netif_carrier_off(dev); | 1487 | netif_carrier_off(dev); |
1427 | 1488 | ||
1428 | /* must be power of 2 */ | 1489 | err = sky2_alloc_buffers(sky2); |
1429 | sky2->tx_le = pci_alloc_consistent(hw->pdev, | 1490 | if (err) |
1430 | sky2->tx_ring_size * | ||
1431 | sizeof(struct sky2_tx_le), | ||
1432 | &sky2->tx_le_map); | ||
1433 | if (!sky2->tx_le) | ||
1434 | goto err_out; | ||
1435 | |||
1436 | sky2->tx_ring = kcalloc(sky2->tx_ring_size, sizeof(struct tx_ring_info), | ||
1437 | GFP_KERNEL); | ||
1438 | if (!sky2->tx_ring) | ||
1439 | goto err_out; | 1491 | goto err_out; |
1440 | 1492 | ||
1441 | tx_init(sky2); | 1493 | tx_init(sky2); |
1442 | 1494 | ||
1443 | sky2->rx_le = pci_alloc_consistent(hw->pdev, RX_LE_BYTES, | ||
1444 | &sky2->rx_le_map); | ||
1445 | if (!sky2->rx_le) | ||
1446 | goto err_out; | ||
1447 | memset(sky2->rx_le, 0, RX_LE_BYTES); | ||
1448 | |||
1449 | sky2->rx_ring = kcalloc(sky2->rx_pending, sizeof(struct rx_ring_info), | ||
1450 | GFP_KERNEL); | ||
1451 | if (!sky2->rx_ring) | ||
1452 | goto err_out; | ||
1453 | |||
1454 | sky2_mac_init(hw, port); | 1495 | sky2_mac_init(hw, port); |
1455 | 1496 | ||
1456 | /* Register is number of 4K blocks on internal RAM buffer. */ | 1497 | /* Register is number of 4K blocks on internal RAM buffer. */ |
@@ -1507,22 +1548,7 @@ static int sky2_up(struct net_device *dev) | |||
1507 | return 0; | 1548 | return 0; |
1508 | 1549 | ||
1509 | err_out: | 1550 | err_out: |
1510 | if (sky2->rx_le) { | 1551 | sky2_free_buffers(sky2); |
1511 | pci_free_consistent(hw->pdev, RX_LE_BYTES, | ||
1512 | sky2->rx_le, sky2->rx_le_map); | ||
1513 | sky2->rx_le = NULL; | ||
1514 | } | ||
1515 | if (sky2->tx_le) { | ||
1516 | pci_free_consistent(hw->pdev, | ||
1517 | sky2->tx_ring_size * sizeof(struct sky2_tx_le), | ||
1518 | sky2->tx_le, sky2->tx_le_map); | ||
1519 | sky2->tx_le = NULL; | ||
1520 | } | ||
1521 | kfree(sky2->tx_ring); | ||
1522 | kfree(sky2->rx_ring); | ||
1523 | |||
1524 | sky2->tx_ring = NULL; | ||
1525 | sky2->rx_ring = NULL; | ||
1526 | return err; | 1552 | return err; |
1527 | } | 1553 | } |
1528 | 1554 | ||
@@ -1574,7 +1600,8 @@ static void sky2_tx_unmap(struct pci_dev *pdev, | |||
1574 | * the number of ring elements will probably be less than the number | 1600 | * the number of ring elements will probably be less than the number |
1575 | * of list elements used. | 1601 | * of list elements used. |
1576 | */ | 1602 | */ |
1577 | static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | 1603 | static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb, |
1604 | struct net_device *dev) | ||
1578 | { | 1605 | { |
1579 | struct sky2_port *sky2 = netdev_priv(dev); | 1606 | struct sky2_port *sky2 = netdev_priv(dev); |
1580 | struct sky2_hw *hw = sky2->hw; | 1607 | struct sky2_hw *hw = sky2->hw; |
@@ -1866,9 +1893,6 @@ static int sky2_down(struct net_device *dev) | |||
1866 | sky2_phy_power_down(hw, port); | 1893 | sky2_phy_power_down(hw, port); |
1867 | spin_unlock_bh(&sky2->phy_lock); | 1894 | spin_unlock_bh(&sky2->phy_lock); |
1868 | 1895 | ||
1869 | /* turn off LED's */ | ||
1870 | sky2_write16(hw, B0_Y2LED, LED_STAT_OFF); | ||
1871 | |||
1872 | sky2_tx_reset(hw, port); | 1896 | sky2_tx_reset(hw, port); |
1873 | 1897 | ||
1874 | /* Free any pending frames stuck in HW queue */ | 1898 | /* Free any pending frames stuck in HW queue */ |
@@ -1876,20 +1900,7 @@ static int sky2_down(struct net_device *dev) | |||
1876 | 1900 | ||
1877 | sky2_rx_clean(sky2); | 1901 | sky2_rx_clean(sky2); |
1878 | 1902 | ||
1879 | pci_free_consistent(hw->pdev, RX_LE_BYTES, | 1903 | sky2_free_buffers(sky2); |
1880 | sky2->rx_le, sky2->rx_le_map); | ||
1881 | kfree(sky2->rx_ring); | ||
1882 | |||
1883 | pci_free_consistent(hw->pdev, | ||
1884 | sky2->tx_ring_size * sizeof(struct sky2_tx_le), | ||
1885 | sky2->tx_le, sky2->tx_le_map); | ||
1886 | kfree(sky2->tx_ring); | ||
1887 | |||
1888 | sky2->tx_le = NULL; | ||
1889 | sky2->rx_le = NULL; | ||
1890 | |||
1891 | sky2->rx_ring = NULL; | ||
1892 | sky2->tx_ring = NULL; | ||
1893 | 1904 | ||
1894 | return 0; | 1905 | return 0; |
1895 | } | 1906 | } |
@@ -2982,8 +2993,6 @@ static void sky2_reset(struct sky2_hw *hw) | |||
2982 | sky2_write8(hw, B2_TI_CTRL, TIM_STOP); | 2993 | sky2_write8(hw, B2_TI_CTRL, TIM_STOP); |
2983 | sky2_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ); | 2994 | sky2_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ); |
2984 | 2995 | ||
2985 | sky2_write8(hw, B0_Y2LED, LED_STAT_ON); | ||
2986 | |||
2987 | /* Turn off descriptor polling */ | 2996 | /* Turn off descriptor polling */ |
2988 | sky2_write32(hw, B28_DPT_CTRL, DPT_STOP); | 2997 | sky2_write32(hw, B28_DPT_CTRL, DPT_STOP); |
2989 | 2998 | ||
@@ -4600,7 +4609,6 @@ static void __devexit sky2_remove(struct pci_dev *pdev) | |||
4600 | 4609 | ||
4601 | sky2_power_aux(hw); | 4610 | sky2_power_aux(hw); |
4602 | 4611 | ||
4603 | sky2_write16(hw, B0_Y2LED, LED_STAT_OFF); | ||
4604 | sky2_write8(hw, B0_CTST, CS_RST_SET); | 4612 | sky2_write8(hw, B0_CTST, CS_RST_SET); |
4605 | sky2_read8(hw, B0_CTST); | 4613 | sky2_read8(hw, B0_CTST); |
4606 | 4614 | ||
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 73c954712467..e0f23a101043 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -155,7 +155,7 @@ enum pci_cfg_reg1 { | |||
155 | enum csr_regs { | 155 | enum csr_regs { |
156 | B0_RAP = 0x0000, | 156 | B0_RAP = 0x0000, |
157 | B0_CTST = 0x0004, | 157 | B0_CTST = 0x0004, |
158 | B0_Y2LED = 0x0005, | 158 | |
159 | B0_POWER_CTRL = 0x0007, | 159 | B0_POWER_CTRL = 0x0007, |
160 | B0_ISRC = 0x0008, | 160 | B0_ISRC = 0x0008, |
161 | B0_IMSK = 0x000c, | 161 | B0_IMSK = 0x000c, |
@@ -260,7 +260,7 @@ enum csr_regs { | |||
260 | Y2_CFG_AER = 0x1d00, /* PCI Advanced Error Report region */ | 260 | Y2_CFG_AER = 0x1d00, /* PCI Advanced Error Report region */ |
261 | }; | 261 | }; |
262 | 262 | ||
263 | /* B0_CTST 16 bit Control/Status register */ | 263 | /* B0_CTST 24 bit Control/Status register */ |
264 | enum { | 264 | enum { |
265 | Y2_VMAIN_AVAIL = 1<<17,/* VMAIN available (YUKON-2 only) */ | 265 | Y2_VMAIN_AVAIL = 1<<17,/* VMAIN available (YUKON-2 only) */ |
266 | Y2_VAUX_AVAIL = 1<<16,/* VAUX available (YUKON-2 only) */ | 266 | Y2_VAUX_AVAIL = 1<<16,/* VAUX available (YUKON-2 only) */ |
@@ -283,13 +283,6 @@ enum { | |||
283 | CS_RST_SET = 1, /* Set Software reset */ | 283 | CS_RST_SET = 1, /* Set Software reset */ |
284 | }; | 284 | }; |
285 | 285 | ||
286 | /* B0_LED 8 Bit LED register */ | ||
287 | enum { | ||
288 | /* Bit 7.. 2: reserved */ | ||
289 | LED_STAT_ON = 1<<1, /* Status LED on */ | ||
290 | LED_STAT_OFF = 1, /* Status LED off */ | ||
291 | }; | ||
292 | |||
293 | /* B0_POWER_CTRL 8 Bit Power Control reg (YUKON only) */ | 286 | /* B0_POWER_CTRL 8 Bit Power Control reg (YUKON only) */ |
294 | enum { | 287 | enum { |
295 | PC_VAUX_ENA = 1<<7, /* Switch VAUX Enable */ | 288 | PC_VAUX_ENA = 1<<7, /* Switch VAUX Enable */ |
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 899c4a2112c9..26f6ee93a064 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -474,7 +474,7 @@ out: | |||
474 | 474 | ||
475 | 475 | ||
476 | /* Encapsulate an IP datagram and kick it into a TTY queue. */ | 476 | /* Encapsulate an IP datagram and kick it into a TTY queue. */ |
477 | static int | 477 | static netdev_tx_t |
478 | sl_xmit(struct sk_buff *skb, struct net_device *dev) | 478 | sl_xmit(struct sk_buff *skb, struct net_device *dev) |
479 | { | 479 | { |
480 | struct slip *sl = netdev_priv(dev); | 480 | struct slip *sl = netdev_priv(dev); |
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c index 0a1b6f401087..934a12012829 100644 --- a/drivers/net/smc9194.c +++ b/drivers/net/smc9194.c | |||
@@ -299,7 +299,8 @@ static void smc_hardware_send_packet( struct net_device * dev ); | |||
299 | . to store the packet, I call this routine, which either sends it | 299 | . to store the packet, I call this routine, which either sends it |
300 | . now, or generates an interrupt when the card is ready for the | 300 | . now, or generates an interrupt when the card is ready for the |
301 | . packet */ | 301 | . packet */ |
302 | static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device *dev ); | 302 | static netdev_tx_t smc_wait_to_send_packet( struct sk_buff * skb, |
303 | struct net_device *dev ); | ||
303 | 304 | ||
304 | /* this does a soft reset on the device */ | 305 | /* this does a soft reset on the device */ |
305 | static void smc_reset( int ioaddr ); | 306 | static void smc_reset( int ioaddr ); |
@@ -487,7 +488,8 @@ static void smc_setmulticast( int ioaddr, int count, struct dev_mc_list * addrs | |||
487 | . o (NO): Enable interrupts and let the interrupt handler deal with it. | 488 | . o (NO): Enable interrupts and let the interrupt handler deal with it. |
488 | . o (YES):Send it now. | 489 | . o (YES):Send it now. |
489 | */ | 490 | */ |
490 | static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * dev ) | 491 | static netdev_tx_t smc_wait_to_send_packet(struct sk_buff *skb, |
492 | struct net_device *dev) | ||
491 | { | 493 | { |
492 | struct smc_local *lp = netdev_priv(dev); | 494 | struct smc_local *lp = netdev_priv(dev); |
493 | unsigned int ioaddr = dev->base_addr; | 495 | unsigned int ioaddr = dev->base_addr; |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 0f2c52c2e044..61be6d7680f6 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -196,21 +196,23 @@ static void PRINT_PKT(u_char *buf, int length) | |||
196 | /* this enables an interrupt in the interrupt mask register */ | 196 | /* this enables an interrupt in the interrupt mask register */ |
197 | #define SMC_ENABLE_INT(lp, x) do { \ | 197 | #define SMC_ENABLE_INT(lp, x) do { \ |
198 | unsigned char mask; \ | 198 | unsigned char mask; \ |
199 | spin_lock_irq(&lp->lock); \ | 199 | unsigned long smc_enable_flags; \ |
200 | spin_lock_irqsave(&lp->lock, smc_enable_flags); \ | ||
200 | mask = SMC_GET_INT_MASK(lp); \ | 201 | mask = SMC_GET_INT_MASK(lp); \ |
201 | mask |= (x); \ | 202 | mask |= (x); \ |
202 | SMC_SET_INT_MASK(lp, mask); \ | 203 | SMC_SET_INT_MASK(lp, mask); \ |
203 | spin_unlock_irq(&lp->lock); \ | 204 | spin_unlock_irqrestore(&lp->lock, smc_enable_flags); \ |
204 | } while (0) | 205 | } while (0) |
205 | 206 | ||
206 | /* this disables an interrupt from the interrupt mask register */ | 207 | /* this disables an interrupt from the interrupt mask register */ |
207 | #define SMC_DISABLE_INT(lp, x) do { \ | 208 | #define SMC_DISABLE_INT(lp, x) do { \ |
208 | unsigned char mask; \ | 209 | unsigned char mask; \ |
209 | spin_lock_irq(&lp->lock); \ | 210 | unsigned long smc_disable_flags; \ |
211 | spin_lock_irqsave(&lp->lock, smc_disable_flags); \ | ||
210 | mask = SMC_GET_INT_MASK(lp); \ | 212 | mask = SMC_GET_INT_MASK(lp); \ |
211 | mask &= ~(x); \ | 213 | mask &= ~(x); \ |
212 | SMC_SET_INT_MASK(lp, mask); \ | 214 | SMC_SET_INT_MASK(lp, mask); \ |
213 | spin_unlock_irq(&lp->lock); \ | 215 | spin_unlock_irqrestore(&lp->lock, smc_disable_flags); \ |
214 | } while (0) | 216 | } while (0) |
215 | 217 | ||
216 | /* | 218 | /* |
@@ -520,21 +522,21 @@ static inline void smc_rcv(struct net_device *dev) | |||
520 | * any other concurrent access and C would always interrupt B. But life | 522 | * any other concurrent access and C would always interrupt B. But life |
521 | * isn't that easy in a SMP world... | 523 | * isn't that easy in a SMP world... |
522 | */ | 524 | */ |
523 | #define smc_special_trylock(lock) \ | 525 | #define smc_special_trylock(lock, flags) \ |
524 | ({ \ | 526 | ({ \ |
525 | int __ret; \ | 527 | int __ret; \ |
526 | local_irq_disable(); \ | 528 | local_irq_save(flags); \ |
527 | __ret = spin_trylock(lock); \ | 529 | __ret = spin_trylock(lock); \ |
528 | if (!__ret) \ | 530 | if (!__ret) \ |
529 | local_irq_enable(); \ | 531 | local_irq_restore(flags); \ |
530 | __ret; \ | 532 | __ret; \ |
531 | }) | 533 | }) |
532 | #define smc_special_lock(lock) spin_lock_irq(lock) | 534 | #define smc_special_lock(lock, flags) spin_lock_irqsave(lock, flags) |
533 | #define smc_special_unlock(lock) spin_unlock_irq(lock) | 535 | #define smc_special_unlock(lock, flags) spin_unlock_irqrestore(lock, flags) |
534 | #else | 536 | #else |
535 | #define smc_special_trylock(lock) (1) | 537 | #define smc_special_trylock(lock, flags) (1) |
536 | #define smc_special_lock(lock) do { } while (0) | 538 | #define smc_special_lock(lock, flags) do { } while (0) |
537 | #define smc_special_unlock(lock) do { } while (0) | 539 | #define smc_special_unlock(lock, flags) do { } while (0) |
538 | #endif | 540 | #endif |
539 | 541 | ||
540 | /* | 542 | /* |
@@ -548,10 +550,11 @@ static void smc_hardware_send_pkt(unsigned long data) | |||
548 | struct sk_buff *skb; | 550 | struct sk_buff *skb; |
549 | unsigned int packet_no, len; | 551 | unsigned int packet_no, len; |
550 | unsigned char *buf; | 552 | unsigned char *buf; |
553 | unsigned long flags; | ||
551 | 554 | ||
552 | DBG(3, "%s: %s\n", dev->name, __func__); | 555 | DBG(3, "%s: %s\n", dev->name, __func__); |
553 | 556 | ||
554 | if (!smc_special_trylock(&lp->lock)) { | 557 | if (!smc_special_trylock(&lp->lock, flags)) { |
555 | netif_stop_queue(dev); | 558 | netif_stop_queue(dev); |
556 | tasklet_schedule(&lp->tx_task); | 559 | tasklet_schedule(&lp->tx_task); |
557 | return; | 560 | return; |
@@ -559,7 +562,7 @@ static void smc_hardware_send_pkt(unsigned long data) | |||
559 | 562 | ||
560 | skb = lp->pending_tx_skb; | 563 | skb = lp->pending_tx_skb; |
561 | if (unlikely(!skb)) { | 564 | if (unlikely(!skb)) { |
562 | smc_special_unlock(&lp->lock); | 565 | smc_special_unlock(&lp->lock, flags); |
563 | return; | 566 | return; |
564 | } | 567 | } |
565 | lp->pending_tx_skb = NULL; | 568 | lp->pending_tx_skb = NULL; |
@@ -569,7 +572,7 @@ static void smc_hardware_send_pkt(unsigned long data) | |||
569 | printk("%s: Memory allocation failed.\n", dev->name); | 572 | printk("%s: Memory allocation failed.\n", dev->name); |
570 | dev->stats.tx_errors++; | 573 | dev->stats.tx_errors++; |
571 | dev->stats.tx_fifo_errors++; | 574 | dev->stats.tx_fifo_errors++; |
572 | smc_special_unlock(&lp->lock); | 575 | smc_special_unlock(&lp->lock, flags); |
573 | goto done; | 576 | goto done; |
574 | } | 577 | } |
575 | 578 | ||
@@ -608,7 +611,7 @@ static void smc_hardware_send_pkt(unsigned long data) | |||
608 | 611 | ||
609 | /* queue the packet for TX */ | 612 | /* queue the packet for TX */ |
610 | SMC_SET_MMU_CMD(lp, MC_ENQUEUE); | 613 | SMC_SET_MMU_CMD(lp, MC_ENQUEUE); |
611 | smc_special_unlock(&lp->lock); | 614 | smc_special_unlock(&lp->lock, flags); |
612 | 615 | ||
613 | dev->trans_start = jiffies; | 616 | dev->trans_start = jiffies; |
614 | dev->stats.tx_packets++; | 617 | dev->stats.tx_packets++; |
@@ -633,6 +636,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
633 | struct smc_local *lp = netdev_priv(dev); | 636 | struct smc_local *lp = netdev_priv(dev); |
634 | void __iomem *ioaddr = lp->base; | 637 | void __iomem *ioaddr = lp->base; |
635 | unsigned int numPages, poll_count, status; | 638 | unsigned int numPages, poll_count, status; |
639 | unsigned long flags; | ||
636 | 640 | ||
637 | DBG(3, "%s: %s\n", dev->name, __func__); | 641 | DBG(3, "%s: %s\n", dev->name, __func__); |
638 | 642 | ||
@@ -658,7 +662,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
658 | return NETDEV_TX_OK; | 662 | return NETDEV_TX_OK; |
659 | } | 663 | } |
660 | 664 | ||
661 | smc_special_lock(&lp->lock); | 665 | smc_special_lock(&lp->lock, flags); |
662 | 666 | ||
663 | /* now, try to allocate the memory */ | 667 | /* now, try to allocate the memory */ |
664 | SMC_SET_MMU_CMD(lp, MC_ALLOC | numPages); | 668 | SMC_SET_MMU_CMD(lp, MC_ALLOC | numPages); |
@@ -676,7 +680,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
676 | } | 680 | } |
677 | } while (--poll_count); | 681 | } while (--poll_count); |
678 | 682 | ||
679 | smc_special_unlock(&lp->lock); | 683 | smc_special_unlock(&lp->lock, flags); |
680 | 684 | ||
681 | lp->pending_tx_skb = skb; | 685 | lp->pending_tx_skb = skb; |
682 | if (!poll_count) { | 686 | if (!poll_count) { |
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c index 60abdb1081ad..514311d67b36 100644 --- a/drivers/net/smsc9420.c +++ b/drivers/net/smsc9420.c | |||
@@ -968,7 +968,8 @@ static void smsc9420_complete_tx(struct net_device *dev) | |||
968 | } | 968 | } |
969 | } | 969 | } |
970 | 970 | ||
971 | static int smsc9420_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | 971 | static netdev_tx_t smsc9420_hard_start_xmit(struct sk_buff *skb, |
972 | struct net_device *dev) | ||
972 | { | 973 | { |
973 | struct smsc9420_pdata *pd = netdev_priv(dev); | 974 | struct smsc9420_pdata *pd = netdev_priv(dev); |
974 | dma_addr_t mapping; | 975 | dma_addr_t mapping; |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 5e7645ee8ab0..a36e2b51e88c 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -595,7 +595,7 @@ static int netdev_open(struct net_device *dev); | |||
595 | static void check_duplex(struct net_device *dev); | 595 | static void check_duplex(struct net_device *dev); |
596 | static void tx_timeout(struct net_device *dev); | 596 | static void tx_timeout(struct net_device *dev); |
597 | static void init_ring(struct net_device *dev); | 597 | static void init_ring(struct net_device *dev); |
598 | static int start_tx(struct sk_buff *skb, struct net_device *dev); | 598 | static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev); |
599 | static irqreturn_t intr_handler(int irq, void *dev_instance); | 599 | static irqreturn_t intr_handler(int irq, void *dev_instance); |
600 | static void netdev_error(struct net_device *dev, int intr_status); | 600 | static void netdev_error(struct net_device *dev, int intr_status); |
601 | static int __netdev_rx(struct net_device *dev, int *quota); | 601 | static int __netdev_rx(struct net_device *dev, int *quota); |
@@ -1223,7 +1223,7 @@ static void init_ring(struct net_device *dev) | |||
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | 1225 | ||
1226 | static int start_tx(struct sk_buff *skb, struct net_device *dev) | 1226 | static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev) |
1227 | { | 1227 | { |
1228 | struct netdev_private *np = netdev_priv(dev); | 1228 | struct netdev_private *np = netdev_priv(dev); |
1229 | unsigned int entry; | 1229 | unsigned int entry; |
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index d09be481bcc4..e13685a570f4 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -415,7 +415,7 @@ static void check_duplex(struct net_device *dev); | |||
415 | static void netdev_timer(unsigned long data); | 415 | static void netdev_timer(unsigned long data); |
416 | static void tx_timeout(struct net_device *dev); | 416 | static void tx_timeout(struct net_device *dev); |
417 | static void init_ring(struct net_device *dev); | 417 | static void init_ring(struct net_device *dev); |
418 | static int start_tx(struct sk_buff *skb, struct net_device *dev); | 418 | static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev); |
419 | static int reset_tx (struct net_device *dev); | 419 | static int reset_tx (struct net_device *dev); |
420 | static irqreturn_t intr_handler(int irq, void *dev_instance); | 420 | static irqreturn_t intr_handler(int irq, void *dev_instance); |
421 | static void rx_poll(unsigned long data); | 421 | static void rx_poll(unsigned long data); |
@@ -1053,7 +1053,7 @@ static void tx_poll (unsigned long data) | |||
1053 | return; | 1053 | return; |
1054 | } | 1054 | } |
1055 | 1055 | ||
1056 | static int | 1056 | static netdev_tx_t |
1057 | start_tx (struct sk_buff *skb, struct net_device *dev) | 1057 | start_tx (struct sk_buff *skb, struct net_device *dev) |
1058 | { | 1058 | { |
1059 | struct netdev_private *np = netdev_priv(dev); | 1059 | struct netdev_private *np = netdev_priv(dev); |
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index d2dfe0ab5106..e0dfdd246470 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -1015,7 +1015,8 @@ static __inline__ int gem_intme(int entry) | |||
1015 | return 0; | 1015 | return 0; |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1018 | static netdev_tx_t gem_start_xmit(struct sk_buff *skb, |
1019 | struct net_device *dev) | ||
1019 | { | 1020 | { |
1020 | struct gem *gp = netdev_priv(dev); | 1021 | struct gem *gp = netdev_priv(dev); |
1021 | int entry; | 1022 | int entry; |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 008bd59fc64b..37d721bbdb35 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -2252,7 +2252,8 @@ static void happy_meal_tx_timeout(struct net_device *dev) | |||
2252 | netif_wake_queue(dev); | 2252 | netif_wake_queue(dev); |
2253 | } | 2253 | } |
2254 | 2254 | ||
2255 | static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev) | 2255 | static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, |
2256 | struct net_device *dev) | ||
2256 | { | 2257 | { |
2257 | struct happy_meal *hp = netdev_priv(dev); | 2258 | struct happy_meal *hp = netdev_priv(dev); |
2258 | int entry; | 2259 | int entry; |
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c index 3c2679cd196b..ec9dfb251f30 100644 --- a/drivers/net/tehuti.c +++ b/drivers/net/tehuti.c | |||
@@ -1622,7 +1622,8 @@ static inline int bdx_tx_space(struct bdx_priv *priv) | |||
1622 | * the driver. Note: the driver must NOT put the skb in its DMA ring. | 1622 | * the driver. Note: the driver must NOT put the skb in its DMA ring. |
1623 | * o NETDEV_TX_LOCKED Locking failed, please retry quickly. | 1623 | * o NETDEV_TX_LOCKED Locking failed, please retry quickly. |
1624 | */ | 1624 | */ |
1625 | static int bdx_tx_transmit(struct sk_buff *skb, struct net_device *ndev) | 1625 | static netdev_tx_t bdx_tx_transmit(struct sk_buff *skb, |
1626 | struct net_device *ndev) | ||
1626 | { | 1627 | { |
1627 | struct bdx_priv *priv = netdev_priv(ndev); | 1628 | struct bdx_priv *priv = netdev_priv(ndev); |
1628 | struct txd_fifo *f = &priv->txd_fifo0; | 1629 | struct txd_fifo *f = &priv->txd_fifo0; |
@@ -2427,7 +2428,7 @@ static void bdx_get_ethtool_stats(struct net_device *netdev, | |||
2427 | */ | 2428 | */ |
2428 | static void bdx_ethtool_ops(struct net_device *netdev) | 2429 | static void bdx_ethtool_ops(struct net_device *netdev) |
2429 | { | 2430 | { |
2430 | static struct ethtool_ops bdx_ethtool_ops = { | 2431 | static const struct ethtool_ops bdx_ethtool_ops = { |
2431 | .get_settings = bdx_get_settings, | 2432 | .get_settings = bdx_get_settings, |
2432 | .get_drvinfo = bdx_get_drvinfo, | 2433 | .get_drvinfo = bdx_get_drvinfo, |
2433 | .get_link = ethtool_op_get_link, | 2434 | .get_link = ethtool_op_get_link, |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index a7d14aae258a..bd4981052609 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -68,8 +68,8 @@ | |||
68 | 68 | ||
69 | #define DRV_MODULE_NAME "tg3" | 69 | #define DRV_MODULE_NAME "tg3" |
70 | #define PFX DRV_MODULE_NAME ": " | 70 | #define PFX DRV_MODULE_NAME ": " |
71 | #define DRV_MODULE_VERSION "3.101" | 71 | #define DRV_MODULE_VERSION "3.102" |
72 | #define DRV_MODULE_RELDATE "August 28, 2009" | 72 | #define DRV_MODULE_RELDATE "September 1, 2009" |
73 | 73 | ||
74 | #define TG3_DEF_MAC_MODE 0 | 74 | #define TG3_DEF_MAC_MODE 0 |
75 | #define TG3_DEF_RX_MODE 0 | 75 | #define TG3_DEF_RX_MODE 0 |
@@ -102,6 +102,7 @@ | |||
102 | #define TG3_DEF_RX_RING_PENDING 200 | 102 | #define TG3_DEF_RX_RING_PENDING 200 |
103 | #define TG3_RX_JUMBO_RING_SIZE 256 | 103 | #define TG3_RX_JUMBO_RING_SIZE 256 |
104 | #define TG3_DEF_RX_JUMBO_RING_PENDING 100 | 104 | #define TG3_DEF_RX_JUMBO_RING_PENDING 100 |
105 | #define TG3_RSS_INDIR_TBL_SIZE 128 | ||
105 | 106 | ||
106 | /* Do not place this n-ring entries value into the tp struct itself, | 107 | /* Do not place this n-ring entries value into the tp struct itself, |
107 | * we really want to expose these constants to GCC so that modulo et | 108 | * we really want to expose these constants to GCC so that modulo et |
@@ -110,7 +111,8 @@ | |||
110 | * replace things like '% foo' with '& (foo - 1)'. | 111 | * replace things like '% foo' with '& (foo - 1)'. |
111 | */ | 112 | */ |
112 | #define TG3_RX_RCB_RING_SIZE(tp) \ | 113 | #define TG3_RX_RCB_RING_SIZE(tp) \ |
113 | ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ? 512 : 1024) | 114 | (((tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) && \ |
115 | !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) ? 512 : 1024) | ||
114 | 116 | ||
115 | #define TG3_TX_RING_SIZE 512 | 117 | #define TG3_TX_RING_SIZE 512 |
116 | #define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1) | 118 | #define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1) |
@@ -160,6 +162,7 @@ MODULE_FIRMWARE(FIRMWARE_TG3); | |||
160 | MODULE_FIRMWARE(FIRMWARE_TG3TSO); | 162 | MODULE_FIRMWARE(FIRMWARE_TG3TSO); |
161 | MODULE_FIRMWARE(FIRMWARE_TG3TSO5); | 163 | MODULE_FIRMWARE(FIRMWARE_TG3TSO5); |
162 | 164 | ||
165 | #define TG3_RSS_MIN_NUM_MSIX_VECS 2 | ||
163 | 166 | ||
164 | static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */ | 167 | static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */ |
165 | module_param(tg3_debug, int, 0); | 168 | module_param(tg3_debug, int, 0); |
@@ -613,33 +616,41 @@ static void tg3_ape_unlock(struct tg3 *tp, int locknum) | |||
613 | 616 | ||
614 | static void tg3_disable_ints(struct tg3 *tp) | 617 | static void tg3_disable_ints(struct tg3 *tp) |
615 | { | 618 | { |
619 | int i; | ||
620 | |||
616 | tw32(TG3PCI_MISC_HOST_CTRL, | 621 | tw32(TG3PCI_MISC_HOST_CTRL, |
617 | (tp->misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT)); | 622 | (tp->misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT)); |
618 | tw32_mailbox_f(tp->napi[0].int_mbox, 0x00000001); | 623 | for (i = 0; i < tp->irq_max; i++) |
619 | } | 624 | tw32_mailbox_f(tp->napi[i].int_mbox, 0x00000001); |
620 | |||
621 | static inline void tg3_cond_int(struct tg3 *tp) | ||
622 | { | ||
623 | if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) && | ||
624 | (tp->napi[0].hw_status->status & SD_STATUS_UPDATED)) | ||
625 | tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl | GRC_LCLCTRL_SETINT); | ||
626 | else | ||
627 | tw32(HOSTCC_MODE, tp->coalesce_mode | | ||
628 | (HOSTCC_MODE_ENABLE | HOSTCC_MODE_NOW)); | ||
629 | } | 625 | } |
630 | 626 | ||
631 | static void tg3_enable_ints(struct tg3 *tp) | 627 | static void tg3_enable_ints(struct tg3 *tp) |
632 | { | 628 | { |
633 | struct tg3_napi *tnapi = &tp->napi[0]; | 629 | int i; |
630 | u32 coal_now = 0; | ||
631 | |||
634 | tp->irq_sync = 0; | 632 | tp->irq_sync = 0; |
635 | wmb(); | 633 | wmb(); |
636 | 634 | ||
637 | tw32(TG3PCI_MISC_HOST_CTRL, | 635 | tw32(TG3PCI_MISC_HOST_CTRL, |
638 | (tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT)); | 636 | (tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT)); |
639 | tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24); | 637 | |
640 | if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) | 638 | for (i = 0; i < tp->irq_cnt; i++) { |
639 | struct tg3_napi *tnapi = &tp->napi[i]; | ||
641 | tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24); | 640 | tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24); |
642 | tg3_cond_int(tp); | 641 | if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) |
642 | tw32_mailbox_f(tnapi->int_mbox, tnapi->last_tag << 24); | ||
643 | |||
644 | coal_now |= tnapi->coal_now; | ||
645 | } | ||
646 | |||
647 | /* Force an initial interrupt */ | ||
648 | if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) && | ||
649 | (tp->napi[0].hw_status->status & SD_STATUS_UPDATED)) | ||
650 | tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl | GRC_LCLCTRL_SETINT); | ||
651 | else | ||
652 | tw32(HOSTCC_MODE, tp->coalesce_mode | | ||
653 | HOSTCC_MODE_ENABLE | coal_now); | ||
643 | } | 654 | } |
644 | 655 | ||
645 | static inline unsigned int tg3_has_work(struct tg3_napi *tnapi) | 656 | static inline unsigned int tg3_has_work(struct tg3_napi *tnapi) |
@@ -657,7 +668,7 @@ static inline unsigned int tg3_has_work(struct tg3_napi *tnapi) | |||
657 | } | 668 | } |
658 | /* check for RX/TX work to do */ | 669 | /* check for RX/TX work to do */ |
659 | if (sblk->idx[0].tx_consumer != tnapi->tx_cons || | 670 | if (sblk->idx[0].tx_consumer != tnapi->tx_cons || |
660 | sblk->idx[0].rx_producer != tnapi->rx_rcb_ptr) | 671 | *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr) |
661 | work_exists = 1; | 672 | work_exists = 1; |
662 | 673 | ||
663 | return work_exists; | 674 | return work_exists; |
@@ -682,38 +693,56 @@ static void tg3_int_reenable(struct tg3_napi *tnapi) | |||
682 | if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) && | 693 | if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) && |
683 | tg3_has_work(tnapi)) | 694 | tg3_has_work(tnapi)) |
684 | tw32(HOSTCC_MODE, tp->coalesce_mode | | 695 | tw32(HOSTCC_MODE, tp->coalesce_mode | |
685 | (HOSTCC_MODE_ENABLE | HOSTCC_MODE_NOW)); | 696 | HOSTCC_MODE_ENABLE | tnapi->coal_now); |
697 | } | ||
698 | |||
699 | static void tg3_napi_disable(struct tg3 *tp) | ||
700 | { | ||
701 | int i; | ||
702 | |||
703 | for (i = tp->irq_cnt - 1; i >= 0; i--) | ||
704 | napi_disable(&tp->napi[i].napi); | ||
705 | } | ||
706 | |||
707 | static void tg3_napi_enable(struct tg3 *tp) | ||
708 | { | ||
709 | int i; | ||
710 | |||
711 | for (i = 0; i < tp->irq_cnt; i++) | ||
712 | napi_enable(&tp->napi[i].napi); | ||
686 | } | 713 | } |
687 | 714 | ||
688 | static inline void tg3_netif_stop(struct tg3 *tp) | 715 | static inline void tg3_netif_stop(struct tg3 *tp) |
689 | { | 716 | { |
690 | tp->dev->trans_start = jiffies; /* prevent tx timeout */ | 717 | tp->dev->trans_start = jiffies; /* prevent tx timeout */ |
691 | napi_disable(&tp->napi[0].napi); | 718 | tg3_napi_disable(tp); |
692 | netif_tx_disable(tp->dev); | 719 | netif_tx_disable(tp->dev); |
693 | } | 720 | } |
694 | 721 | ||
695 | static inline void tg3_netif_start(struct tg3 *tp) | 722 | static inline void tg3_netif_start(struct tg3 *tp) |
696 | { | 723 | { |
697 | struct tg3_napi *tnapi = &tp->napi[0]; | 724 | /* NOTE: unconditional netif_tx_wake_all_queues is only |
698 | netif_wake_queue(tp->dev); | 725 | * appropriate so long as all callers are assured to |
699 | /* NOTE: unconditional netif_wake_queue is only appropriate | 726 | * have free tx slots (such as after tg3_init_hw) |
700 | * so long as all callers are assured to have free tx slots | ||
701 | * (such as after tg3_init_hw) | ||
702 | */ | 727 | */ |
703 | napi_enable(&tnapi->napi); | 728 | netif_tx_wake_all_queues(tp->dev); |
704 | tnapi->hw_status->status |= SD_STATUS_UPDATED; | 729 | |
730 | tg3_napi_enable(tp); | ||
731 | tp->napi[0].hw_status->status |= SD_STATUS_UPDATED; | ||
705 | tg3_enable_ints(tp); | 732 | tg3_enable_ints(tp); |
706 | } | 733 | } |
707 | 734 | ||
708 | static void tg3_switch_clocks(struct tg3 *tp) | 735 | static void tg3_switch_clocks(struct tg3 *tp) |
709 | { | 736 | { |
710 | u32 clock_ctrl = tr32(TG3PCI_CLOCK_CTRL); | 737 | u32 clock_ctrl; |
711 | u32 orig_clock_ctrl; | 738 | u32 orig_clock_ctrl; |
712 | 739 | ||
713 | if ((tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) || | 740 | if ((tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) || |
714 | (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) | 741 | (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) |
715 | return; | 742 | return; |
716 | 743 | ||
744 | clock_ctrl = tr32(TG3PCI_CLOCK_CTRL); | ||
745 | |||
717 | orig_clock_ctrl = clock_ctrl; | 746 | orig_clock_ctrl = clock_ctrl; |
718 | clock_ctrl &= (CLOCK_CTRL_FORCE_CLKRUN | | 747 | clock_ctrl &= (CLOCK_CTRL_FORCE_CLKRUN | |
719 | CLOCK_CTRL_CLKRUN_OENABLE | | 748 | CLOCK_CTRL_CLKRUN_OENABLE | |
@@ -753,7 +782,7 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val) | |||
753 | 782 | ||
754 | *val = 0x0; | 783 | *val = 0x0; |
755 | 784 | ||
756 | frame_val = ((PHY_ADDR << MI_COM_PHY_ADDR_SHIFT) & | 785 | frame_val = ((tp->phy_addr << MI_COM_PHY_ADDR_SHIFT) & |
757 | MI_COM_PHY_ADDR_MASK); | 786 | MI_COM_PHY_ADDR_MASK); |
758 | frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) & | 787 | frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) & |
759 | MI_COM_REG_ADDR_MASK); | 788 | MI_COM_REG_ADDR_MASK); |
@@ -804,7 +833,7 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val) | |||
804 | udelay(80); | 833 | udelay(80); |
805 | } | 834 | } |
806 | 835 | ||
807 | frame_val = ((PHY_ADDR << MI_COM_PHY_ADDR_SHIFT) & | 836 | frame_val = ((tp->phy_addr << MI_COM_PHY_ADDR_SHIFT) & |
808 | MI_COM_PHY_ADDR_MASK); | 837 | MI_COM_PHY_ADDR_MASK); |
809 | frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) & | 838 | frame_val |= ((reg << MI_COM_REG_ADDR_SHIFT) & |
810 | MI_COM_REG_ADDR_MASK); | 839 | MI_COM_REG_ADDR_MASK); |
@@ -992,6 +1021,21 @@ static void tg3_mdio_start(struct tg3 *tp) | |||
992 | tw32_f(MAC_MI_MODE, tp->mi_mode); | 1021 | tw32_f(MAC_MI_MODE, tp->mi_mode); |
993 | udelay(80); | 1022 | udelay(80); |
994 | 1023 | ||
1024 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { | ||
1025 | u32 funcnum, is_serdes; | ||
1026 | |||
1027 | funcnum = tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC; | ||
1028 | if (funcnum) | ||
1029 | tp->phy_addr = 2; | ||
1030 | else | ||
1031 | tp->phy_addr = 1; | ||
1032 | |||
1033 | is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; | ||
1034 | if (is_serdes) | ||
1035 | tp->phy_addr += 7; | ||
1036 | } else | ||
1037 | tp->phy_addr = PHY_ADDR; | ||
1038 | |||
995 | if ((tp->tg3_flags3 & TG3_FLG3_MDIOBUS_INITED) && | 1039 | if ((tp->tg3_flags3 & TG3_FLG3_MDIOBUS_INITED) && |
996 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) | 1040 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) |
997 | tg3_mdio_config_5785(tp); | 1041 | tg3_mdio_config_5785(tp); |
@@ -1967,8 +2011,9 @@ static void tg3_frob_aux_power(struct tg3 *tp) | |||
1967 | if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0) | 2011 | if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0) |
1968 | return; | 2012 | return; |
1969 | 2013 | ||
1970 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || | 2014 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || |
1971 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) { | 2015 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 || |
2016 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { | ||
1972 | struct net_device *dev_peer; | 2017 | struct net_device *dev_peer; |
1973 | 2018 | ||
1974 | dev_peer = pci_get_drvdata(tp->pdev_peer); | 2019 | dev_peer = pci_get_drvdata(tp->pdev_peer); |
@@ -4285,6 +4330,13 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
4285 | struct tg3 *tp = tnapi->tp; | 4330 | struct tg3 *tp = tnapi->tp; |
4286 | u32 hw_idx = tnapi->hw_status->idx[0].tx_consumer; | 4331 | u32 hw_idx = tnapi->hw_status->idx[0].tx_consumer; |
4287 | u32 sw_idx = tnapi->tx_cons; | 4332 | u32 sw_idx = tnapi->tx_cons; |
4333 | struct netdev_queue *txq; | ||
4334 | int index = tnapi - tp->napi; | ||
4335 | |||
4336 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX) | ||
4337 | index--; | ||
4338 | |||
4339 | txq = netdev_get_tx_queue(tp->dev, index); | ||
4288 | 4340 | ||
4289 | while (sw_idx != hw_idx) { | 4341 | while (sw_idx != hw_idx) { |
4290 | struct tx_ring_info *ri = &tnapi->tx_buffers[sw_idx]; | 4342 | struct tx_ring_info *ri = &tnapi->tx_buffers[sw_idx]; |
@@ -4326,13 +4378,13 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
4326 | */ | 4378 | */ |
4327 | smp_mb(); | 4379 | smp_mb(); |
4328 | 4380 | ||
4329 | if (unlikely(netif_queue_stopped(tp->dev) && | 4381 | if (unlikely(netif_tx_queue_stopped(txq) && |
4330 | (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi)))) { | 4382 | (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi)))) { |
4331 | netif_tx_lock(tp->dev); | 4383 | __netif_tx_lock(txq, smp_processor_id()); |
4332 | if (netif_queue_stopped(tp->dev) && | 4384 | if (netif_tx_queue_stopped(txq) && |
4333 | (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi))) | 4385 | (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi))) |
4334 | netif_wake_queue(tp->dev); | 4386 | netif_tx_wake_queue(txq); |
4335 | netif_tx_unlock(tp->dev); | 4387 | __netif_tx_unlock(txq); |
4336 | } | 4388 | } |
4337 | } | 4389 | } |
4338 | 4390 | ||
@@ -4485,7 +4537,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) | |||
4485 | int received; | 4537 | int received; |
4486 | struct tg3_rx_prodring_set *tpr = &tp->prodring[0]; | 4538 | struct tg3_rx_prodring_set *tpr = &tp->prodring[0]; |
4487 | 4539 | ||
4488 | hw_idx = tnapi->hw_status->idx[0].rx_producer; | 4540 | hw_idx = *(tnapi->rx_rcb_prod_idx); |
4489 | /* | 4541 | /* |
4490 | * We need to order the read of hw_idx and the read of | 4542 | * We need to order the read of hw_idx and the read of |
4491 | * the opaque cookie. | 4543 | * the opaque cookie. |
@@ -4616,7 +4668,7 @@ next_pkt_nopost: | |||
4616 | 4668 | ||
4617 | /* Refresh hw_idx to see if there is new work */ | 4669 | /* Refresh hw_idx to see if there is new work */ |
4618 | if (sw_idx == hw_idx) { | 4670 | if (sw_idx == hw_idx) { |
4619 | hw_idx = tnapi->hw_status->idx[0].rx_producer; | 4671 | hw_idx = *(tnapi->rx_rcb_prod_idx); |
4620 | rmb(); | 4672 | rmb(); |
4621 | } | 4673 | } |
4622 | } | 4674 | } |
@@ -4678,7 +4730,7 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget) | |||
4678 | * All RX "locking" is done by ensuring outside | 4730 | * All RX "locking" is done by ensuring outside |
4679 | * code synchronizes with tg3->napi.poll() | 4731 | * code synchronizes with tg3->napi.poll() |
4680 | */ | 4732 | */ |
4681 | if (sblk->idx[0].rx_producer != tnapi->rx_rcb_ptr) | 4733 | if (*(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr) |
4682 | work_done += tg3_rx(tnapi, budget - work_done); | 4734 | work_done += tg3_rx(tnapi, budget - work_done); |
4683 | 4735 | ||
4684 | return work_done; | 4736 | return work_done; |
@@ -4729,12 +4781,15 @@ tx_recovery: | |||
4729 | 4781 | ||
4730 | static void tg3_irq_quiesce(struct tg3 *tp) | 4782 | static void tg3_irq_quiesce(struct tg3 *tp) |
4731 | { | 4783 | { |
4784 | int i; | ||
4785 | |||
4732 | BUG_ON(tp->irq_sync); | 4786 | BUG_ON(tp->irq_sync); |
4733 | 4787 | ||
4734 | tp->irq_sync = 1; | 4788 | tp->irq_sync = 1; |
4735 | smp_mb(); | 4789 | smp_mb(); |
4736 | 4790 | ||
4737 | synchronize_irq(tp->pdev->irq); | 4791 | for (i = 0; i < tp->irq_cnt; i++) |
4792 | synchronize_irq(tp->napi[i].irq_vec); | ||
4738 | } | 4793 | } |
4739 | 4794 | ||
4740 | static inline int tg3_irq_sync(struct tg3 *tp) | 4795 | static inline int tg3_irq_sync(struct tg3 *tp) |
@@ -4768,7 +4823,8 @@ static irqreturn_t tg3_msi_1shot(int irq, void *dev_id) | |||
4768 | struct tg3 *tp = tnapi->tp; | 4823 | struct tg3 *tp = tnapi->tp; |
4769 | 4824 | ||
4770 | prefetch(tnapi->hw_status); | 4825 | prefetch(tnapi->hw_status); |
4771 | prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]); | 4826 | if (tnapi->rx_rcb) |
4827 | prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]); | ||
4772 | 4828 | ||
4773 | if (likely(!tg3_irq_sync(tp))) | 4829 | if (likely(!tg3_irq_sync(tp))) |
4774 | napi_schedule(&tnapi->napi); | 4830 | napi_schedule(&tnapi->napi); |
@@ -4786,7 +4842,8 @@ static irqreturn_t tg3_msi(int irq, void *dev_id) | |||
4786 | struct tg3 *tp = tnapi->tp; | 4842 | struct tg3 *tp = tnapi->tp; |
4787 | 4843 | ||
4788 | prefetch(tnapi->hw_status); | 4844 | prefetch(tnapi->hw_status); |
4789 | prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]); | 4845 | if (tnapi->rx_rcb) |
4846 | prefetch(&tnapi->rx_rcb[tnapi->rx_rcb_ptr]); | ||
4790 | /* | 4847 | /* |
4791 | * Writing any value to intr-mbox-0 clears PCI INTA# and | 4848 | * Writing any value to intr-mbox-0 clears PCI INTA# and |
4792 | * chip-internal interrupt pending events. | 4849 | * chip-internal interrupt pending events. |
@@ -4937,7 +4994,7 @@ static int tg3_restart_hw(struct tg3 *tp, int reset_phy) | |||
4937 | tg3_full_unlock(tp); | 4994 | tg3_full_unlock(tp); |
4938 | del_timer_sync(&tp->timer); | 4995 | del_timer_sync(&tp->timer); |
4939 | tp->irq_sync = 0; | 4996 | tp->irq_sync = 0; |
4940 | napi_enable(&tp->napi[0].napi); | 4997 | tg3_napi_enable(tp); |
4941 | dev_close(tp->dev); | 4998 | dev_close(tp->dev); |
4942 | tg3_full_lock(tp, 0); | 4999 | tg3_full_lock(tp, 0); |
4943 | } | 5000 | } |
@@ -4947,9 +5004,11 @@ static int tg3_restart_hw(struct tg3 *tp, int reset_phy) | |||
4947 | #ifdef CONFIG_NET_POLL_CONTROLLER | 5004 | #ifdef CONFIG_NET_POLL_CONTROLLER |
4948 | static void tg3_poll_controller(struct net_device *dev) | 5005 | static void tg3_poll_controller(struct net_device *dev) |
4949 | { | 5006 | { |
5007 | int i; | ||
4950 | struct tg3 *tp = netdev_priv(dev); | 5008 | struct tg3 *tp = netdev_priv(dev); |
4951 | 5009 | ||
4952 | tg3_interrupt(tp->pdev->irq, dev); | 5010 | for (i = 0; i < tp->irq_cnt; i++) |
5011 | tg3_interrupt(tp->napi[i].irq_vec, dev); | ||
4953 | } | 5012 | } |
4954 | #endif | 5013 | #endif |
4955 | 5014 | ||
@@ -5135,15 +5194,20 @@ static void tg3_set_txd(struct tg3_napi *tnapi, int entry, | |||
5135 | /* hard_start_xmit for devices that don't have any bugs and | 5194 | /* hard_start_xmit for devices that don't have any bugs and |
5136 | * support TG3_FLG2_HW_TSO_2 only. | 5195 | * support TG3_FLG2_HW_TSO_2 only. |
5137 | */ | 5196 | */ |
5138 | static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | 5197 | static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, |
5198 | struct net_device *dev) | ||
5139 | { | 5199 | { |
5140 | struct tg3 *tp = netdev_priv(dev); | 5200 | struct tg3 *tp = netdev_priv(dev); |
5141 | u32 len, entry, base_flags, mss; | 5201 | u32 len, entry, base_flags, mss; |
5142 | struct skb_shared_info *sp; | 5202 | struct skb_shared_info *sp; |
5143 | dma_addr_t mapping; | 5203 | dma_addr_t mapping; |
5144 | struct tg3_napi *tnapi = &tp->napi[0]; | 5204 | struct tg3_napi *tnapi; |
5205 | struct netdev_queue *txq; | ||
5145 | 5206 | ||
5146 | len = skb_headlen(skb); | 5207 | txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); |
5208 | tnapi = &tp->napi[skb_get_queue_mapping(skb)]; | ||
5209 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX) | ||
5210 | tnapi++; | ||
5147 | 5211 | ||
5148 | /* We are running in BH disabled context with netif_tx_lock | 5212 | /* We are running in BH disabled context with netif_tx_lock |
5149 | * and TX reclaim runs via tp->napi.poll inside of a software | 5213 | * and TX reclaim runs via tp->napi.poll inside of a software |
@@ -5151,8 +5215,8 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
5151 | * no IRQ context deadlocks to worry about either. Rejoice! | 5215 | * no IRQ context deadlocks to worry about either. Rejoice! |
5152 | */ | 5216 | */ |
5153 | if (unlikely(tg3_tx_avail(tnapi) <= (skb_shinfo(skb)->nr_frags + 1))) { | 5217 | if (unlikely(tg3_tx_avail(tnapi) <= (skb_shinfo(skb)->nr_frags + 1))) { |
5154 | if (!netif_queue_stopped(dev)) { | 5218 | if (!netif_tx_queue_stopped(txq)) { |
5155 | netif_stop_queue(dev); | 5219 | netif_tx_stop_queue(txq); |
5156 | 5220 | ||
5157 | /* This is a hard error, log it. */ | 5221 | /* This is a hard error, log it. */ |
5158 | printk(KERN_ERR PFX "%s: BUG! Tx Ring full when " | 5222 | printk(KERN_ERR PFX "%s: BUG! Tx Ring full when " |
@@ -5166,6 +5230,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
5166 | mss = 0; | 5230 | mss = 0; |
5167 | if ((mss = skb_shinfo(skb)->gso_size) != 0) { | 5231 | if ((mss = skb_shinfo(skb)->gso_size) != 0) { |
5168 | int tcp_opt_len, ip_tcp_len; | 5232 | int tcp_opt_len, ip_tcp_len; |
5233 | u32 hdrlen; | ||
5169 | 5234 | ||
5170 | if (skb_header_cloned(skb) && | 5235 | if (skb_header_cloned(skb) && |
5171 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { | 5236 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { |
@@ -5174,7 +5239,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
5174 | } | 5239 | } |
5175 | 5240 | ||
5176 | if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) | 5241 | if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) |
5177 | mss |= (skb_headlen(skb) - ETH_HLEN) << 9; | 5242 | hdrlen = skb_headlen(skb) - ETH_HLEN; |
5178 | else { | 5243 | else { |
5179 | struct iphdr *iph = ip_hdr(skb); | 5244 | struct iphdr *iph = ip_hdr(skb); |
5180 | 5245 | ||
@@ -5183,9 +5248,17 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
5183 | 5248 | ||
5184 | iph->check = 0; | 5249 | iph->check = 0; |
5185 | iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); | 5250 | iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); |
5186 | mss |= (ip_tcp_len + tcp_opt_len) << 9; | 5251 | hdrlen = ip_tcp_len + tcp_opt_len; |
5187 | } | 5252 | } |
5188 | 5253 | ||
5254 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { | ||
5255 | mss |= (hdrlen & 0xc) << 12; | ||
5256 | if (hdrlen & 0x10) | ||
5257 | base_flags |= 0x00000010; | ||
5258 | base_flags |= (hdrlen & 0x3e0) << 5; | ||
5259 | } else | ||
5260 | mss |= hdrlen << 9; | ||
5261 | |||
5189 | base_flags |= (TXD_FLAG_CPU_PRE_DMA | | 5262 | base_flags |= (TXD_FLAG_CPU_PRE_DMA | |
5190 | TXD_FLAG_CPU_POST_DMA); | 5263 | TXD_FLAG_CPU_POST_DMA); |
5191 | 5264 | ||
@@ -5211,6 +5284,12 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
5211 | 5284 | ||
5212 | tnapi->tx_buffers[entry].skb = skb; | 5285 | tnapi->tx_buffers[entry].skb = skb; |
5213 | 5286 | ||
5287 | len = skb_headlen(skb); | ||
5288 | |||
5289 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && | ||
5290 | !mss && skb->len > ETH_DATA_LEN) | ||
5291 | base_flags |= TXD_FLAG_JMB_PKT; | ||
5292 | |||
5214 | tg3_set_txd(tnapi, entry, mapping, len, base_flags, | 5293 | tg3_set_txd(tnapi, entry, mapping, len, base_flags, |
5215 | (skb_shinfo(skb)->nr_frags == 0) | (mss << 1)); | 5294 | (skb_shinfo(skb)->nr_frags == 0) | (mss << 1)); |
5216 | 5295 | ||
@@ -5240,9 +5319,9 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
5240 | 5319 | ||
5241 | tnapi->tx_prod = entry; | 5320 | tnapi->tx_prod = entry; |
5242 | if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) { | 5321 | if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) { |
5243 | netif_stop_queue(dev); | 5322 | netif_tx_stop_queue(txq); |
5244 | if (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi)) | 5323 | if (tg3_tx_avail(tnapi) > TG3_TX_WAKEUP_THRESH(tnapi)) |
5245 | netif_wake_queue(tp->dev); | 5324 | netif_tx_wake_queue(txq); |
5246 | } | 5325 | } |
5247 | 5326 | ||
5248 | out_unlock: | 5327 | out_unlock: |
@@ -5251,7 +5330,8 @@ out_unlock: | |||
5251 | return NETDEV_TX_OK; | 5330 | return NETDEV_TX_OK; |
5252 | } | 5331 | } |
5253 | 5332 | ||
5254 | static int tg3_start_xmit_dma_bug(struct sk_buff *, struct net_device *); | 5333 | static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *, |
5334 | struct net_device *); | ||
5255 | 5335 | ||
5256 | /* Use GSO to workaround a rare TSO bug that may be triggered when the | 5336 | /* Use GSO to workaround a rare TSO bug that may be triggered when the |
5257 | * TSO header is greater than 80 bytes. | 5337 | * TSO header is greater than 80 bytes. |
@@ -5290,7 +5370,8 @@ tg3_tso_bug_end: | |||
5290 | /* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and | 5370 | /* hard_start_xmit for devices that have the 4G bug and/or 40-bit bug and |
5291 | * support TG3_FLG2_HW_TSO_1 or firmware TSO only. | 5371 | * support TG3_FLG2_HW_TSO_1 or firmware TSO only. |
5292 | */ | 5372 | */ |
5293 | static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) | 5373 | static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb, |
5374 | struct net_device *dev) | ||
5294 | { | 5375 | { |
5295 | struct tg3 *tp = netdev_priv(dev); | 5376 | struct tg3 *tp = netdev_priv(dev); |
5296 | u32 len, entry, base_flags, mss; | 5377 | u32 len, entry, base_flags, mss; |
@@ -5713,28 +5794,34 @@ err_out: | |||
5713 | */ | 5794 | */ |
5714 | static void tg3_free_rings(struct tg3 *tp) | 5795 | static void tg3_free_rings(struct tg3 *tp) |
5715 | { | 5796 | { |
5716 | struct tg3_napi *tnapi = &tp->napi[0]; | 5797 | int i, j; |
5717 | int i; | ||
5718 | |||
5719 | for (i = 0; i < TG3_TX_RING_SIZE; ) { | ||
5720 | struct tx_ring_info *txp; | ||
5721 | struct sk_buff *skb; | ||
5722 | 5798 | ||
5723 | txp = &tnapi->tx_buffers[i]; | 5799 | for (j = 0; j < tp->irq_cnt; j++) { |
5724 | skb = txp->skb; | 5800 | struct tg3_napi *tnapi = &tp->napi[j]; |
5725 | 5801 | ||
5726 | if (skb == NULL) { | 5802 | if (!tnapi->tx_buffers) |
5727 | i++; | ||
5728 | continue; | 5803 | continue; |
5729 | } | ||
5730 | 5804 | ||
5731 | skb_dma_unmap(&tp->pdev->dev, skb, DMA_TO_DEVICE); | 5805 | for (i = 0; i < TG3_TX_RING_SIZE; ) { |
5806 | struct tx_ring_info *txp; | ||
5807 | struct sk_buff *skb; | ||
5808 | |||
5809 | txp = &tnapi->tx_buffers[i]; | ||
5810 | skb = txp->skb; | ||
5811 | |||
5812 | if (skb == NULL) { | ||
5813 | i++; | ||
5814 | continue; | ||
5815 | } | ||
5732 | 5816 | ||
5733 | txp->skb = NULL; | 5817 | skb_dma_unmap(&tp->pdev->dev, skb, DMA_TO_DEVICE); |
5734 | 5818 | ||
5735 | i += skb_shinfo(skb)->nr_frags + 1; | 5819 | txp->skb = NULL; |
5736 | 5820 | ||
5737 | dev_kfree_skb_any(skb); | 5821 | i += skb_shinfo(skb)->nr_frags + 1; |
5822 | |||
5823 | dev_kfree_skb_any(skb); | ||
5824 | } | ||
5738 | } | 5825 | } |
5739 | 5826 | ||
5740 | tg3_rx_prodring_free(tp, &tp->prodring[0]); | 5827 | tg3_rx_prodring_free(tp, &tp->prodring[0]); |
@@ -5749,16 +5836,29 @@ static void tg3_free_rings(struct tg3 *tp) | |||
5749 | */ | 5836 | */ |
5750 | static int tg3_init_rings(struct tg3 *tp) | 5837 | static int tg3_init_rings(struct tg3 *tp) |
5751 | { | 5838 | { |
5752 | struct tg3_napi *tnapi = &tp->napi[0]; | 5839 | int i; |
5753 | 5840 | ||
5754 | /* Free up all the SKBs. */ | 5841 | /* Free up all the SKBs. */ |
5755 | tg3_free_rings(tp); | 5842 | tg3_free_rings(tp); |
5756 | 5843 | ||
5757 | /* Zero out all descriptors. */ | 5844 | for (i = 0; i < tp->irq_cnt; i++) { |
5758 | memset(tnapi->tx_ring, 0, TG3_TX_RING_BYTES); | 5845 | struct tg3_napi *tnapi = &tp->napi[i]; |
5846 | |||
5847 | tnapi->last_tag = 0; | ||
5848 | tnapi->last_irq_tag = 0; | ||
5849 | tnapi->hw_status->status = 0; | ||
5850 | tnapi->hw_status->status_tag = 0; | ||
5851 | memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); | ||
5852 | |||
5853 | tnapi->tx_prod = 0; | ||
5854 | tnapi->tx_cons = 0; | ||
5855 | if (tnapi->tx_ring) | ||
5856 | memset(tnapi->tx_ring, 0, TG3_TX_RING_BYTES); | ||
5759 | 5857 | ||
5760 | tnapi->rx_rcb_ptr = 0; | 5858 | tnapi->rx_rcb_ptr = 0; |
5761 | memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp)); | 5859 | if (tnapi->rx_rcb) |
5860 | memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp)); | ||
5861 | } | ||
5762 | 5862 | ||
5763 | return tg3_rx_prodring_alloc(tp, &tp->prodring[0]); | 5863 | return tg3_rx_prodring_alloc(tp, &tp->prodring[0]); |
5764 | } | 5864 | } |
@@ -5769,31 +5869,41 @@ static int tg3_init_rings(struct tg3 *tp) | |||
5769 | */ | 5869 | */ |
5770 | static void tg3_free_consistent(struct tg3 *tp) | 5870 | static void tg3_free_consistent(struct tg3 *tp) |
5771 | { | 5871 | { |
5772 | struct tg3_napi *tnapi = &tp->napi[0]; | 5872 | int i; |
5773 | 5873 | ||
5774 | kfree(tnapi->tx_buffers); | 5874 | for (i = 0; i < tp->irq_cnt; i++) { |
5775 | tnapi->tx_buffers = NULL; | 5875 | struct tg3_napi *tnapi = &tp->napi[i]; |
5776 | if (tnapi->tx_ring) { | 5876 | |
5777 | pci_free_consistent(tp->pdev, TG3_TX_RING_BYTES, | 5877 | if (tnapi->tx_ring) { |
5778 | tnapi->tx_ring, tnapi->tx_desc_mapping); | 5878 | pci_free_consistent(tp->pdev, TG3_TX_RING_BYTES, |
5779 | tnapi->tx_ring = NULL; | 5879 | tnapi->tx_ring, tnapi->tx_desc_mapping); |
5780 | } | 5880 | tnapi->tx_ring = NULL; |
5781 | if (tnapi->rx_rcb) { | 5881 | } |
5782 | pci_free_consistent(tp->pdev, TG3_RX_RCB_RING_BYTES(tp), | 5882 | |
5783 | tnapi->rx_rcb, tnapi->rx_rcb_mapping); | 5883 | kfree(tnapi->tx_buffers); |
5784 | tnapi->rx_rcb = NULL; | 5884 | tnapi->tx_buffers = NULL; |
5785 | } | 5885 | |
5786 | if (tnapi->hw_status) { | 5886 | if (tnapi->rx_rcb) { |
5787 | pci_free_consistent(tp->pdev, TG3_HW_STATUS_SIZE, | 5887 | pci_free_consistent(tp->pdev, TG3_RX_RCB_RING_BYTES(tp), |
5788 | tnapi->hw_status, | 5888 | tnapi->rx_rcb, |
5789 | tnapi->status_mapping); | 5889 | tnapi->rx_rcb_mapping); |
5790 | tnapi->hw_status = NULL; | 5890 | tnapi->rx_rcb = NULL; |
5891 | } | ||
5892 | |||
5893 | if (tnapi->hw_status) { | ||
5894 | pci_free_consistent(tp->pdev, TG3_HW_STATUS_SIZE, | ||
5895 | tnapi->hw_status, | ||
5896 | tnapi->status_mapping); | ||
5897 | tnapi->hw_status = NULL; | ||
5898 | } | ||
5791 | } | 5899 | } |
5900 | |||
5792 | if (tp->hw_stats) { | 5901 | if (tp->hw_stats) { |
5793 | pci_free_consistent(tp->pdev, sizeof(struct tg3_hw_stats), | 5902 | pci_free_consistent(tp->pdev, sizeof(struct tg3_hw_stats), |
5794 | tp->hw_stats, tp->stats_mapping); | 5903 | tp->hw_stats, tp->stats_mapping); |
5795 | tp->hw_stats = NULL; | 5904 | tp->hw_stats = NULL; |
5796 | } | 5905 | } |
5906 | |||
5797 | tg3_rx_prodring_fini(tp, &tp->prodring[0]); | 5907 | tg3_rx_prodring_fini(tp, &tp->prodring[0]); |
5798 | } | 5908 | } |
5799 | 5909 | ||
@@ -5803,44 +5913,79 @@ static void tg3_free_consistent(struct tg3 *tp) | |||
5803 | */ | 5913 | */ |
5804 | static int tg3_alloc_consistent(struct tg3 *tp) | 5914 | static int tg3_alloc_consistent(struct tg3 *tp) |
5805 | { | 5915 | { |
5806 | struct tg3_napi *tnapi = &tp->napi[0]; | 5916 | int i; |
5807 | 5917 | ||
5808 | if (tg3_rx_prodring_init(tp, &tp->prodring[0])) | 5918 | if (tg3_rx_prodring_init(tp, &tp->prodring[0])) |
5809 | return -ENOMEM; | 5919 | return -ENOMEM; |
5810 | 5920 | ||
5811 | tnapi->tx_buffers = kzalloc(sizeof(struct tx_ring_info) * | 5921 | tp->hw_stats = pci_alloc_consistent(tp->pdev, |
5812 | TG3_TX_RING_SIZE, GFP_KERNEL); | 5922 | sizeof(struct tg3_hw_stats), |
5813 | if (!tnapi->tx_buffers) | 5923 | &tp->stats_mapping); |
5924 | if (!tp->hw_stats) | ||
5814 | goto err_out; | 5925 | goto err_out; |
5815 | 5926 | ||
5816 | tnapi->tx_ring = pci_alloc_consistent(tp->pdev, TG3_TX_RING_BYTES, | 5927 | memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats)); |
5817 | &tnapi->tx_desc_mapping); | ||
5818 | if (!tnapi->tx_ring) | ||
5819 | goto err_out; | ||
5820 | 5928 | ||
5821 | tnapi->hw_status = pci_alloc_consistent(tp->pdev, | 5929 | for (i = 0; i < tp->irq_cnt; i++) { |
5822 | TG3_HW_STATUS_SIZE, | 5930 | struct tg3_napi *tnapi = &tp->napi[i]; |
5823 | &tnapi->status_mapping); | 5931 | struct tg3_hw_status *sblk; |
5824 | if (!tnapi->hw_status) | ||
5825 | goto err_out; | ||
5826 | 5932 | ||
5827 | memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); | 5933 | tnapi->hw_status = pci_alloc_consistent(tp->pdev, |
5934 | TG3_HW_STATUS_SIZE, | ||
5935 | &tnapi->status_mapping); | ||
5936 | if (!tnapi->hw_status) | ||
5937 | goto err_out; | ||
5828 | 5938 | ||
5829 | tnapi->rx_rcb = pci_alloc_consistent(tp->pdev, | 5939 | memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); |
5830 | TG3_RX_RCB_RING_BYTES(tp), | 5940 | sblk = tnapi->hw_status; |
5831 | &tnapi->rx_rcb_mapping); | ||
5832 | if (!tnapi->rx_rcb) | ||
5833 | goto err_out; | ||
5834 | 5941 | ||
5835 | memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp)); | 5942 | /* |
5943 | * When RSS is enabled, the status block format changes | ||
5944 | * slightly. The "rx_jumbo_consumer", "reserved", | ||
5945 | * and "rx_mini_consumer" members get mapped to the | ||
5946 | * other three rx return ring producer indexes. | ||
5947 | */ | ||
5948 | switch (i) { | ||
5949 | default: | ||
5950 | tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer; | ||
5951 | break; | ||
5952 | case 2: | ||
5953 | tnapi->rx_rcb_prod_idx = &sblk->rx_jumbo_consumer; | ||
5954 | break; | ||
5955 | case 3: | ||
5956 | tnapi->rx_rcb_prod_idx = &sblk->reserved; | ||
5957 | break; | ||
5958 | case 4: | ||
5959 | tnapi->rx_rcb_prod_idx = &sblk->rx_mini_consumer; | ||
5960 | break; | ||
5961 | } | ||
5836 | 5962 | ||
5837 | tp->hw_stats = pci_alloc_consistent(tp->pdev, | 5963 | /* |
5838 | sizeof(struct tg3_hw_stats), | 5964 | * If multivector RSS is enabled, vector 0 does not handle |
5839 | &tp->stats_mapping); | 5965 | * rx or tx interrupts. Don't allocate any resources for it. |
5840 | if (!tp->hw_stats) | 5966 | */ |
5841 | goto err_out; | 5967 | if (!i && (tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS)) |
5968 | continue; | ||
5842 | 5969 | ||
5843 | memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats)); | 5970 | tnapi->rx_rcb = pci_alloc_consistent(tp->pdev, |
5971 | TG3_RX_RCB_RING_BYTES(tp), | ||
5972 | &tnapi->rx_rcb_mapping); | ||
5973 | if (!tnapi->rx_rcb) | ||
5974 | goto err_out; | ||
5975 | |||
5976 | memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp)); | ||
5977 | |||
5978 | tnapi->tx_buffers = kzalloc(sizeof(struct tx_ring_info) * | ||
5979 | TG3_TX_RING_SIZE, GFP_KERNEL); | ||
5980 | if (!tnapi->tx_buffers) | ||
5981 | goto err_out; | ||
5982 | |||
5983 | tnapi->tx_ring = pci_alloc_consistent(tp->pdev, | ||
5984 | TG3_TX_RING_BYTES, | ||
5985 | &tnapi->tx_desc_mapping); | ||
5986 | if (!tnapi->tx_ring) | ||
5987 | goto err_out; | ||
5988 | } | ||
5844 | 5989 | ||
5845 | return 0; | 5990 | return 0; |
5846 | 5991 | ||
@@ -5901,7 +6046,6 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int | |||
5901 | static int tg3_abort_hw(struct tg3 *tp, int silent) | 6046 | static int tg3_abort_hw(struct tg3 *tp, int silent) |
5902 | { | 6047 | { |
5903 | int i, err; | 6048 | int i, err; |
5904 | struct tg3_napi *tnapi = &tp->napi[0]; | ||
5905 | 6049 | ||
5906 | tg3_disable_ints(tp); | 6050 | tg3_disable_ints(tp); |
5907 | 6051 | ||
@@ -5953,8 +6097,11 @@ static int tg3_abort_hw(struct tg3 *tp, int silent) | |||
5953 | err |= tg3_stop_block(tp, BUFMGR_MODE, BUFMGR_MODE_ENABLE, silent); | 6097 | err |= tg3_stop_block(tp, BUFMGR_MODE, BUFMGR_MODE_ENABLE, silent); |
5954 | err |= tg3_stop_block(tp, MEMARB_MODE, MEMARB_MODE_ENABLE, silent); | 6098 | err |= tg3_stop_block(tp, MEMARB_MODE, MEMARB_MODE_ENABLE, silent); |
5955 | 6099 | ||
5956 | if (tnapi->hw_status) | 6100 | for (i = 0; i < tp->irq_cnt; i++) { |
5957 | memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); | 6101 | struct tg3_napi *tnapi = &tp->napi[i]; |
6102 | if (tnapi->hw_status) | ||
6103 | memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); | ||
6104 | } | ||
5958 | if (tp->hw_stats) | 6105 | if (tp->hw_stats) |
5959 | memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats)); | 6106 | memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats)); |
5960 | 6107 | ||
@@ -6241,7 +6388,7 @@ static int tg3_chip_reset(struct tg3 *tp) | |||
6241 | { | 6388 | { |
6242 | u32 val; | 6389 | u32 val; |
6243 | void (*write_op)(struct tg3 *, u32, u32); | 6390 | void (*write_op)(struct tg3 *, u32, u32); |
6244 | int err; | 6391 | int i, err; |
6245 | 6392 | ||
6246 | tg3_nvram_lock(tp); | 6393 | tg3_nvram_lock(tp); |
6247 | 6394 | ||
@@ -6281,14 +6428,19 @@ static int tg3_chip_reset(struct tg3 *tp) | |||
6281 | * sharing or irqpoll. | 6428 | * sharing or irqpoll. |
6282 | */ | 6429 | */ |
6283 | tp->tg3_flags |= TG3_FLAG_CHIP_RESETTING; | 6430 | tp->tg3_flags |= TG3_FLAG_CHIP_RESETTING; |
6284 | if (tp->napi[0].hw_status) { | 6431 | for (i = 0; i < tp->irq_cnt; i++) { |
6285 | tp->napi[0].hw_status->status = 0; | 6432 | struct tg3_napi *tnapi = &tp->napi[i]; |
6286 | tp->napi[0].hw_status->status_tag = 0; | 6433 | if (tnapi->hw_status) { |
6434 | tnapi->hw_status->status = 0; | ||
6435 | tnapi->hw_status->status_tag = 0; | ||
6436 | } | ||
6437 | tnapi->last_tag = 0; | ||
6438 | tnapi->last_irq_tag = 0; | ||
6287 | } | 6439 | } |
6288 | tp->napi[0].last_tag = 0; | ||
6289 | tp->napi[0].last_irq_tag = 0; | ||
6290 | smp_mb(); | 6440 | smp_mb(); |
6291 | synchronize_irq(tp->pdev->irq); | 6441 | |
6442 | for (i = 0; i < tp->irq_cnt; i++) | ||
6443 | synchronize_irq(tp->napi[i].irq_vec); | ||
6292 | 6444 | ||
6293 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) { | 6445 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) { |
6294 | val = tr32(TG3_PCIE_LNKCTL) & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN; | 6446 | val = tr32(TG3_PCIE_LNKCTL) & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN; |
@@ -6444,7 +6596,9 @@ static int tg3_chip_reset(struct tg3 *tp) | |||
6444 | tg3_mdio_start(tp); | 6596 | tg3_mdio_start(tp); |
6445 | 6597 | ||
6446 | if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) && | 6598 | if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) && |
6447 | tp->pci_chip_rev_id != CHIPREV_ID_5750_A0) { | 6599 | tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 && |
6600 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 && | ||
6601 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) { | ||
6448 | val = tr32(0x7c00); | 6602 | val = tr32(0x7c00); |
6449 | 6603 | ||
6450 | tw32(0x7c00, val | (1 << 25)); | 6604 | tw32(0x7c00, val | (1 << 25)); |
@@ -6794,24 +6948,175 @@ static void tg3_set_bdinfo(struct tg3 *tp, u32 bdinfo_addr, | |||
6794 | static void __tg3_set_rx_mode(struct net_device *); | 6948 | static void __tg3_set_rx_mode(struct net_device *); |
6795 | static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec) | 6949 | static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec) |
6796 | { | 6950 | { |
6797 | tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs); | 6951 | int i; |
6798 | tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs); | 6952 | |
6799 | tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames); | 6953 | if (!(tp->tg3_flags2 & TG3_FLG2_USING_MSIX)) { |
6800 | tw32(HOSTCC_TXMAX_FRAMES, ec->tx_max_coalesced_frames); | 6954 | tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs); |
6801 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { | 6955 | tw32(HOSTCC_TXMAX_FRAMES, ec->tx_max_coalesced_frames); |
6802 | tw32(HOSTCC_RXCOAL_TICK_INT, ec->rx_coalesce_usecs_irq); | 6956 | tw32(HOSTCC_TXCOAL_MAXF_INT, ec->tx_max_coalesced_frames_irq); |
6803 | tw32(HOSTCC_TXCOAL_TICK_INT, ec->tx_coalesce_usecs_irq); | 6957 | |
6958 | tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs); | ||
6959 | tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames); | ||
6960 | tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq); | ||
6961 | } else { | ||
6962 | tw32(HOSTCC_TXCOL_TICKS, 0); | ||
6963 | tw32(HOSTCC_TXMAX_FRAMES, 0); | ||
6964 | tw32(HOSTCC_TXCOAL_MAXF_INT, 0); | ||
6965 | |||
6966 | tw32(HOSTCC_RXCOL_TICKS, 0); | ||
6967 | tw32(HOSTCC_RXMAX_FRAMES, 0); | ||
6968 | tw32(HOSTCC_RXCOAL_MAXF_INT, 0); | ||
6804 | } | 6969 | } |
6805 | tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq); | 6970 | |
6806 | tw32(HOSTCC_TXCOAL_MAXF_INT, ec->tx_max_coalesced_frames_irq); | ||
6807 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { | 6971 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { |
6808 | u32 val = ec->stats_block_coalesce_usecs; | 6972 | u32 val = ec->stats_block_coalesce_usecs; |
6809 | 6973 | ||
6974 | tw32(HOSTCC_RXCOAL_TICK_INT, ec->rx_coalesce_usecs_irq); | ||
6975 | tw32(HOSTCC_TXCOAL_TICK_INT, ec->tx_coalesce_usecs_irq); | ||
6976 | |||
6810 | if (!netif_carrier_ok(tp->dev)) | 6977 | if (!netif_carrier_ok(tp->dev)) |
6811 | val = 0; | 6978 | val = 0; |
6812 | 6979 | ||
6813 | tw32(HOSTCC_STAT_COAL_TICKS, val); | 6980 | tw32(HOSTCC_STAT_COAL_TICKS, val); |
6814 | } | 6981 | } |
6982 | |||
6983 | for (i = 0; i < tp->irq_cnt - 1; i++) { | ||
6984 | u32 reg; | ||
6985 | |||
6986 | reg = HOSTCC_RXCOL_TICKS_VEC1 + i * 0x18; | ||
6987 | tw32(reg, ec->rx_coalesce_usecs); | ||
6988 | reg = HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18; | ||
6989 | tw32(reg, ec->tx_coalesce_usecs); | ||
6990 | reg = HOSTCC_RXMAX_FRAMES_VEC1 + i * 0x18; | ||
6991 | tw32(reg, ec->rx_max_coalesced_frames); | ||
6992 | reg = HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18; | ||
6993 | tw32(reg, ec->tx_max_coalesced_frames); | ||
6994 | reg = HOSTCC_RXCOAL_MAXF_INT_VEC1 + i * 0x18; | ||
6995 | tw32(reg, ec->rx_max_coalesced_frames_irq); | ||
6996 | reg = HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18; | ||
6997 | tw32(reg, ec->tx_max_coalesced_frames_irq); | ||
6998 | } | ||
6999 | |||
7000 | for (; i < tp->irq_max - 1; i++) { | ||
7001 | tw32(HOSTCC_RXCOL_TICKS_VEC1 + i * 0x18, 0); | ||
7002 | tw32(HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18, 0); | ||
7003 | tw32(HOSTCC_RXMAX_FRAMES_VEC1 + i * 0x18, 0); | ||
7004 | tw32(HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18, 0); | ||
7005 | tw32(HOSTCC_RXCOAL_MAXF_INT_VEC1 + i * 0x18, 0); | ||
7006 | tw32(HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18, 0); | ||
7007 | } | ||
7008 | } | ||
7009 | |||
7010 | /* tp->lock is held. */ | ||
7011 | static void tg3_rings_reset(struct tg3 *tp) | ||
7012 | { | ||
7013 | int i; | ||
7014 | u32 stblk, txrcb, rxrcb, limit; | ||
7015 | struct tg3_napi *tnapi = &tp->napi[0]; | ||
7016 | |||
7017 | /* Disable all transmit rings but the first. */ | ||
7018 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) | ||
7019 | limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 16; | ||
7020 | else | ||
7021 | limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE; | ||
7022 | |||
7023 | for (txrcb = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE; | ||
7024 | txrcb < limit; txrcb += TG3_BDINFO_SIZE) | ||
7025 | tg3_write_mem(tp, txrcb + TG3_BDINFO_MAXLEN_FLAGS, | ||
7026 | BDINFO_FLAGS_DISABLED); | ||
7027 | |||
7028 | |||
7029 | /* Disable all receive return rings but the first. */ | ||
7030 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
7031 | limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 17; | ||
7032 | else if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) | ||
7033 | limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16; | ||
7034 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) | ||
7035 | limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 4; | ||
7036 | else | ||
7037 | limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE; | ||
7038 | |||
7039 | for (rxrcb = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE; | ||
7040 | rxrcb < limit; rxrcb += TG3_BDINFO_SIZE) | ||
7041 | tg3_write_mem(tp, rxrcb + TG3_BDINFO_MAXLEN_FLAGS, | ||
7042 | BDINFO_FLAGS_DISABLED); | ||
7043 | |||
7044 | /* Disable interrupts */ | ||
7045 | tw32_mailbox_f(tp->napi[0].int_mbox, 1); | ||
7046 | |||
7047 | /* Zero mailbox registers. */ | ||
7048 | if (tp->tg3_flags & TG3_FLAG_SUPPORT_MSIX) { | ||
7049 | for (i = 1; i < TG3_IRQ_MAX_VECS; i++) { | ||
7050 | tp->napi[i].tx_prod = 0; | ||
7051 | tp->napi[i].tx_cons = 0; | ||
7052 | tw32_mailbox(tp->napi[i].prodmbox, 0); | ||
7053 | tw32_rx_mbox(tp->napi[i].consmbox, 0); | ||
7054 | tw32_mailbox_f(tp->napi[i].int_mbox, 1); | ||
7055 | } | ||
7056 | } else { | ||
7057 | tp->napi[0].tx_prod = 0; | ||
7058 | tp->napi[0].tx_cons = 0; | ||
7059 | tw32_mailbox(tp->napi[0].prodmbox, 0); | ||
7060 | tw32_rx_mbox(tp->napi[0].consmbox, 0); | ||
7061 | } | ||
7062 | |||
7063 | /* Make sure the NIC-based send BD rings are disabled. */ | ||
7064 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { | ||
7065 | u32 mbox = MAILBOX_SNDNIC_PROD_IDX_0 + TG3_64BIT_REG_LOW; | ||
7066 | for (i = 0; i < 16; i++) | ||
7067 | tw32_tx_mbox(mbox + i * 8, 0); | ||
7068 | } | ||
7069 | |||
7070 | txrcb = NIC_SRAM_SEND_RCB; | ||
7071 | rxrcb = NIC_SRAM_RCV_RET_RCB; | ||
7072 | |||
7073 | /* Clear status block in ram. */ | ||
7074 | memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); | ||
7075 | |||
7076 | /* Set status block DMA address */ | ||
7077 | tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH, | ||
7078 | ((u64) tnapi->status_mapping >> 32)); | ||
7079 | tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW, | ||
7080 | ((u64) tnapi->status_mapping & 0xffffffff)); | ||
7081 | |||
7082 | if (tnapi->tx_ring) { | ||
7083 | tg3_set_bdinfo(tp, txrcb, tnapi->tx_desc_mapping, | ||
7084 | (TG3_TX_RING_SIZE << | ||
7085 | BDINFO_FLAGS_MAXLEN_SHIFT), | ||
7086 | NIC_SRAM_TX_BUFFER_DESC); | ||
7087 | txrcb += TG3_BDINFO_SIZE; | ||
7088 | } | ||
7089 | |||
7090 | if (tnapi->rx_rcb) { | ||
7091 | tg3_set_bdinfo(tp, rxrcb, tnapi->rx_rcb_mapping, | ||
7092 | (TG3_RX_RCB_RING_SIZE(tp) << | ||
7093 | BDINFO_FLAGS_MAXLEN_SHIFT), 0); | ||
7094 | rxrcb += TG3_BDINFO_SIZE; | ||
7095 | } | ||
7096 | |||
7097 | stblk = HOSTCC_STATBLCK_RING1; | ||
7098 | |||
7099 | for (i = 1, tnapi++; i < tp->irq_cnt; i++, tnapi++) { | ||
7100 | u64 mapping = (u64)tnapi->status_mapping; | ||
7101 | tw32(stblk + TG3_64BIT_REG_HIGH, mapping >> 32); | ||
7102 | tw32(stblk + TG3_64BIT_REG_LOW, mapping & 0xffffffff); | ||
7103 | |||
7104 | /* Clear status block in ram. */ | ||
7105 | memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE); | ||
7106 | |||
7107 | tg3_set_bdinfo(tp, txrcb, tnapi->tx_desc_mapping, | ||
7108 | (TG3_TX_RING_SIZE << | ||
7109 | BDINFO_FLAGS_MAXLEN_SHIFT), | ||
7110 | NIC_SRAM_TX_BUFFER_DESC); | ||
7111 | |||
7112 | tg3_set_bdinfo(tp, rxrcb, tnapi->rx_rcb_mapping, | ||
7113 | (TG3_RX_RCB_RING_SIZE(tp) << | ||
7114 | BDINFO_FLAGS_MAXLEN_SHIFT), 0); | ||
7115 | |||
7116 | stblk += 8; | ||
7117 | txrcb += TG3_BDINFO_SIZE; | ||
7118 | rxrcb += TG3_BDINFO_SIZE; | ||
7119 | } | ||
6815 | } | 7120 | } |
6816 | 7121 | ||
6817 | /* tp->lock is held. */ | 7122 | /* tp->lock is held. */ |
@@ -6928,7 +7233,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6928 | return err; | 7233 | return err; |
6929 | 7234 | ||
6930 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 && | 7235 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 && |
6931 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761) { | 7236 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761 && |
7237 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) { | ||
6932 | /* This value is determined during the probe time DMA | 7238 | /* This value is determined during the probe time DMA |
6933 | * engine test, tg3_test_dma. | 7239 | * engine test, tg3_test_dma. |
6934 | */ | 7240 | */ |
@@ -7082,54 +7388,16 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7082 | BDINFO_FLAGS_DISABLED); | 7388 | BDINFO_FLAGS_DISABLED); |
7083 | } | 7389 | } |
7084 | 7390 | ||
7085 | val = RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT; | 7391 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) |
7392 | val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) | | ||
7393 | (RX_STD_MAX_SIZE << 2); | ||
7394 | else | ||
7395 | val = RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT; | ||
7086 | } else | 7396 | } else |
7087 | val = RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT; | 7397 | val = RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT; |
7088 | 7398 | ||
7089 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS, val); | 7399 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS, val); |
7090 | 7400 | ||
7091 | /* There is only one send ring on 5705/5750, no need to explicitly | ||
7092 | * disable the others. | ||
7093 | */ | ||
7094 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { | ||
7095 | /* Clear out send RCB ring in SRAM. */ | ||
7096 | for (i = NIC_SRAM_SEND_RCB; i < NIC_SRAM_RCV_RET_RCB; i += TG3_BDINFO_SIZE) | ||
7097 | tg3_write_mem(tp, i + TG3_BDINFO_MAXLEN_FLAGS, | ||
7098 | BDINFO_FLAGS_DISABLED); | ||
7099 | } | ||
7100 | |||
7101 | tp->napi[0].tx_prod = 0; | ||
7102 | tp->napi[0].tx_cons = 0; | ||
7103 | tw32_tx_mbox(MAILBOX_SNDNIC_PROD_IDX_0 + TG3_64BIT_REG_LOW, 0); | ||
7104 | |||
7105 | val = MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW; | ||
7106 | tw32_mailbox(val, 0); | ||
7107 | |||
7108 | tg3_set_bdinfo(tp, NIC_SRAM_SEND_RCB, | ||
7109 | tp->napi[0].tx_desc_mapping, | ||
7110 | (TG3_TX_RING_SIZE << | ||
7111 | BDINFO_FLAGS_MAXLEN_SHIFT), | ||
7112 | NIC_SRAM_TX_BUFFER_DESC); | ||
7113 | |||
7114 | /* There is only one receive return ring on 5705/5750, no need | ||
7115 | * to explicitly disable the others. | ||
7116 | */ | ||
7117 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { | ||
7118 | for (i = NIC_SRAM_RCV_RET_RCB; i < NIC_SRAM_STATS_BLK; | ||
7119 | i += TG3_BDINFO_SIZE) { | ||
7120 | tg3_write_mem(tp, i + TG3_BDINFO_MAXLEN_FLAGS, | ||
7121 | BDINFO_FLAGS_DISABLED); | ||
7122 | } | ||
7123 | } | ||
7124 | |||
7125 | tw32_rx_mbox(tp->napi[0].consmbox, 0); | ||
7126 | |||
7127 | tg3_set_bdinfo(tp, NIC_SRAM_RCV_RET_RCB, | ||
7128 | tp->napi[0].rx_rcb_mapping, | ||
7129 | (TG3_RX_RCB_RING_SIZE(tp) << | ||
7130 | BDINFO_FLAGS_MAXLEN_SHIFT), | ||
7131 | 0); | ||
7132 | |||
7133 | tpr->rx_std_ptr = tp->rx_pending; | 7401 | tpr->rx_std_ptr = tp->rx_pending; |
7134 | tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW, | 7402 | tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW, |
7135 | tpr->rx_std_ptr); | 7403 | tpr->rx_std_ptr); |
@@ -7139,6 +7407,13 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7139 | tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW, | 7407 | tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW, |
7140 | tpr->rx_jmb_ptr); | 7408 | tpr->rx_jmb_ptr); |
7141 | 7409 | ||
7410 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { | ||
7411 | tw32(STD_REPLENISH_LWM, 32); | ||
7412 | tw32(JMB_REPLENISH_LWM, 16); | ||
7413 | } | ||
7414 | |||
7415 | tg3_rings_reset(tp); | ||
7416 | |||
7142 | /* Initialize MAC address and backoff seed. */ | 7417 | /* Initialize MAC address and backoff seed. */ |
7143 | __tg3_set_mac_addr(tp, 0); | 7418 | __tg3_set_mac_addr(tp, 0); |
7144 | 7419 | ||
@@ -7226,12 +7501,6 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7226 | 7501 | ||
7227 | __tg3_set_coalesce(tp, &tp->coal); | 7502 | __tg3_set_coalesce(tp, &tp->coal); |
7228 | 7503 | ||
7229 | /* set status block DMA address */ | ||
7230 | tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH, | ||
7231 | ((u64) tp->napi[0].status_mapping >> 32)); | ||
7232 | tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW, | ||
7233 | ((u64) tp->napi[0].status_mapping & 0xffffffff)); | ||
7234 | |||
7235 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { | 7504 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { |
7236 | /* Status/statistics block address. See tg3_timer, | 7505 | /* Status/statistics block address. See tg3_timer, |
7237 | * the tg3_periodic_fetch_stats call there, and | 7506 | * the tg3_periodic_fetch_stats call there, and |
@@ -7242,7 +7511,16 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7242 | tw32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW, | 7511 | tw32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW, |
7243 | ((u64) tp->stats_mapping & 0xffffffff)); | 7512 | ((u64) tp->stats_mapping & 0xffffffff)); |
7244 | tw32(HOSTCC_STATS_BLK_NIC_ADDR, NIC_SRAM_STATS_BLK); | 7513 | tw32(HOSTCC_STATS_BLK_NIC_ADDR, NIC_SRAM_STATS_BLK); |
7514 | |||
7245 | tw32(HOSTCC_STATUS_BLK_NIC_ADDR, NIC_SRAM_STATUS_BLK); | 7515 | tw32(HOSTCC_STATUS_BLK_NIC_ADDR, NIC_SRAM_STATUS_BLK); |
7516 | |||
7517 | /* Clear statistics and status block memory areas */ | ||
7518 | for (i = NIC_SRAM_STATS_BLK; | ||
7519 | i < NIC_SRAM_STATUS_BLK + TG3_HW_STATUS_SIZE; | ||
7520 | i += sizeof(u32)) { | ||
7521 | tg3_write_mem(tp, i, 0); | ||
7522 | udelay(40); | ||
7523 | } | ||
7246 | } | 7524 | } |
7247 | 7525 | ||
7248 | tw32(HOSTCC_MODE, HOSTCC_MODE_ENABLE | tp->coalesce_mode); | 7526 | tw32(HOSTCC_MODE, HOSTCC_MODE_ENABLE | tp->coalesce_mode); |
@@ -7252,15 +7530,6 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7252 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) | 7530 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) |
7253 | tw32(RCVLSC_MODE, RCVLSC_MODE_ENABLE | RCVLSC_MODE_ATTN_ENABLE); | 7531 | tw32(RCVLSC_MODE, RCVLSC_MODE_ENABLE | RCVLSC_MODE_ATTN_ENABLE); |
7254 | 7532 | ||
7255 | /* Clear statistics/status block in chip, and status block in ram. */ | ||
7256 | for (i = NIC_SRAM_STATS_BLK; | ||
7257 | i < NIC_SRAM_STATUS_BLK + TG3_HW_STATUS_SIZE; | ||
7258 | i += sizeof(u32)) { | ||
7259 | tg3_write_mem(tp, i, 0); | ||
7260 | udelay(40); | ||
7261 | } | ||
7262 | memset(tp->napi[0].hw_status, 0, TG3_HW_STATUS_SIZE); | ||
7263 | |||
7264 | if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) { | 7533 | if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) { |
7265 | tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT; | 7534 | tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT; |
7266 | /* reset to prevent losing 1st rx packet intermittently */ | 7535 | /* reset to prevent losing 1st rx packet intermittently */ |
@@ -7312,7 +7581,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7312 | tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl); | 7581 | tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl); |
7313 | udelay(100); | 7582 | udelay(100); |
7314 | 7583 | ||
7315 | tw32_mailbox_f(tp->napi[0].int_mbox, 0); | 7584 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX) { |
7585 | val = tr32(MSGINT_MODE); | ||
7586 | val |= MSGINT_MODE_MULTIVEC_EN | MSGINT_MODE_ENABLE; | ||
7587 | tw32(MSGINT_MODE, val); | ||
7588 | } | ||
7316 | 7589 | ||
7317 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { | 7590 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { |
7318 | tw32_f(DMAC_MODE, DMAC_MODE_ENABLE); | 7591 | tw32_f(DMAC_MODE, DMAC_MODE_ENABLE); |
@@ -7382,7 +7655,10 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7382 | tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE); | 7655 | tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE); |
7383 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) | 7656 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) |
7384 | tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE | 0x8); | 7657 | tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE | 0x8); |
7385 | tw32(SNDBDI_MODE, SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE); | 7658 | val = SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE; |
7659 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX) | ||
7660 | val |= SNDBDI_MODE_MULTI_TXQ_EN; | ||
7661 | tw32(SNDBDI_MODE, val); | ||
7386 | tw32(SNDBDS_MODE, SNDBDS_MODE_ENABLE | SNDBDS_MODE_ATTN_ENABLE); | 7662 | tw32(SNDBDS_MODE, SNDBDS_MODE_ENABLE | SNDBDS_MODE_ATTN_ENABLE); |
7387 | 7663 | ||
7388 | if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) { | 7664 | if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) { |
@@ -7401,10 +7677,46 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7401 | tw32_f(MAC_TX_MODE, tp->tx_mode); | 7677 | tw32_f(MAC_TX_MODE, tp->tx_mode); |
7402 | udelay(100); | 7678 | udelay(100); |
7403 | 7679 | ||
7680 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS) { | ||
7681 | u32 reg = MAC_RSS_INDIR_TBL_0; | ||
7682 | u8 *ent = (u8 *)&val; | ||
7683 | |||
7684 | /* Setup the indirection table */ | ||
7685 | for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i++) { | ||
7686 | int idx = i % sizeof(val); | ||
7687 | |||
7688 | ent[idx] = i % (tp->irq_cnt - 1); | ||
7689 | if (idx == sizeof(val) - 1) { | ||
7690 | tw32(reg, val); | ||
7691 | reg += 4; | ||
7692 | } | ||
7693 | } | ||
7694 | |||
7695 | /* Setup the "secret" hash key. */ | ||
7696 | tw32(MAC_RSS_HASH_KEY_0, 0x5f865437); | ||
7697 | tw32(MAC_RSS_HASH_KEY_1, 0xe4ac62cc); | ||
7698 | tw32(MAC_RSS_HASH_KEY_2, 0x50103a45); | ||
7699 | tw32(MAC_RSS_HASH_KEY_3, 0x36621985); | ||
7700 | tw32(MAC_RSS_HASH_KEY_4, 0xbf14c0e8); | ||
7701 | tw32(MAC_RSS_HASH_KEY_5, 0x1bc27a1e); | ||
7702 | tw32(MAC_RSS_HASH_KEY_6, 0x84f4b556); | ||
7703 | tw32(MAC_RSS_HASH_KEY_7, 0x094ea6fe); | ||
7704 | tw32(MAC_RSS_HASH_KEY_8, 0x7dda01e7); | ||
7705 | tw32(MAC_RSS_HASH_KEY_9, 0xc04d7481); | ||
7706 | } | ||
7707 | |||
7404 | tp->rx_mode = RX_MODE_ENABLE; | 7708 | tp->rx_mode = RX_MODE_ENABLE; |
7405 | if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS) | 7709 | if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS) |
7406 | tp->rx_mode |= RX_MODE_IPV6_CSUM_ENABLE; | 7710 | tp->rx_mode |= RX_MODE_IPV6_CSUM_ENABLE; |
7407 | 7711 | ||
7712 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS) | ||
7713 | tp->rx_mode |= RX_MODE_RSS_ENABLE | | ||
7714 | RX_MODE_RSS_ITBL_HASH_BITS_7 | | ||
7715 | RX_MODE_RSS_IPV6_HASH_EN | | ||
7716 | RX_MODE_RSS_TCP_IPV6_HASH_EN | | ||
7717 | RX_MODE_RSS_IPV4_HASH_EN | | ||
7718 | RX_MODE_RSS_TCP_IPV4_HASH_EN; | ||
7719 | |||
7408 | tw32_f(MAC_RX_MODE, tp->rx_mode); | 7720 | tw32_f(MAC_RX_MODE, tp->rx_mode); |
7409 | udelay(10); | 7721 | udelay(10); |
7410 | 7722 | ||
@@ -7619,7 +7931,7 @@ static void tg3_timer(unsigned long __opaque) | |||
7619 | tp->grc_local_ctrl | GRC_LCLCTRL_SETINT); | 7931 | tp->grc_local_ctrl | GRC_LCLCTRL_SETINT); |
7620 | } else { | 7932 | } else { |
7621 | tw32(HOSTCC_MODE, tp->coalesce_mode | | 7933 | tw32(HOSTCC_MODE, tp->coalesce_mode | |
7622 | (HOSTCC_MODE_ENABLE | HOSTCC_MODE_NOW)); | 7934 | HOSTCC_MODE_ENABLE | HOSTCC_MODE_NOW); |
7623 | } | 7935 | } |
7624 | 7936 | ||
7625 | if (!(tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { | 7937 | if (!(tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { |
@@ -7720,13 +8032,22 @@ restart_timer: | |||
7720 | add_timer(&tp->timer); | 8032 | add_timer(&tp->timer); |
7721 | } | 8033 | } |
7722 | 8034 | ||
7723 | static int tg3_request_irq(struct tg3 *tp) | 8035 | static int tg3_request_irq(struct tg3 *tp, int irq_num) |
7724 | { | 8036 | { |
7725 | irq_handler_t fn; | 8037 | irq_handler_t fn; |
7726 | unsigned long flags; | 8038 | unsigned long flags; |
7727 | char *name = tp->dev->name; | 8039 | char *name; |
8040 | struct tg3_napi *tnapi = &tp->napi[irq_num]; | ||
7728 | 8041 | ||
7729 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) { | 8042 | if (tp->irq_cnt == 1) |
8043 | name = tp->dev->name; | ||
8044 | else { | ||
8045 | name = &tnapi->irq_lbl[0]; | ||
8046 | snprintf(name, IFNAMSIZ, "%s-%d", tp->dev->name, irq_num); | ||
8047 | name[IFNAMSIZ-1] = 0; | ||
8048 | } | ||
8049 | |||
8050 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI_OR_MSIX) { | ||
7730 | fn = tg3_msi; | 8051 | fn = tg3_msi; |
7731 | if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) | 8052 | if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) |
7732 | fn = tg3_msi_1shot; | 8053 | fn = tg3_msi_1shot; |
@@ -7737,7 +8058,8 @@ static int tg3_request_irq(struct tg3 *tp) | |||
7737 | fn = tg3_interrupt_tagged; | 8058 | fn = tg3_interrupt_tagged; |
7738 | flags = IRQF_SHARED | IRQF_SAMPLE_RANDOM; | 8059 | flags = IRQF_SHARED | IRQF_SAMPLE_RANDOM; |
7739 | } | 8060 | } |
7740 | return request_irq(tp->pdev->irq, fn, flags, name, &tp->napi[0]); | 8061 | |
8062 | return request_irq(tnapi->irq_vec, fn, flags, name, tnapi); | ||
7741 | } | 8063 | } |
7742 | 8064 | ||
7743 | static int tg3_test_interrupt(struct tg3 *tp) | 8065 | static int tg3_test_interrupt(struct tg3 *tp) |
@@ -7745,15 +8067,26 @@ static int tg3_test_interrupt(struct tg3 *tp) | |||
7745 | struct tg3_napi *tnapi = &tp->napi[0]; | 8067 | struct tg3_napi *tnapi = &tp->napi[0]; |
7746 | struct net_device *dev = tp->dev; | 8068 | struct net_device *dev = tp->dev; |
7747 | int err, i, intr_ok = 0; | 8069 | int err, i, intr_ok = 0; |
8070 | u32 val; | ||
7748 | 8071 | ||
7749 | if (!netif_running(dev)) | 8072 | if (!netif_running(dev)) |
7750 | return -ENODEV; | 8073 | return -ENODEV; |
7751 | 8074 | ||
7752 | tg3_disable_ints(tp); | 8075 | tg3_disable_ints(tp); |
7753 | 8076 | ||
7754 | free_irq(tp->pdev->irq, tnapi); | 8077 | free_irq(tnapi->irq_vec, tnapi); |
8078 | |||
8079 | /* | ||
8080 | * Turn off MSI one shot mode. Otherwise this test has no | ||
8081 | * observable way to know whether the interrupt was delivered. | ||
8082 | */ | ||
8083 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && | ||
8084 | (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) { | ||
8085 | val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE; | ||
8086 | tw32(MSGINT_MODE, val); | ||
8087 | } | ||
7755 | 8088 | ||
7756 | err = request_irq(tp->pdev->irq, tg3_test_isr, | 8089 | err = request_irq(tnapi->irq_vec, tg3_test_isr, |
7757 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, tnapi); | 8090 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, tnapi); |
7758 | if (err) | 8091 | if (err) |
7759 | return err; | 8092 | return err; |
@@ -7762,7 +8095,7 @@ static int tg3_test_interrupt(struct tg3 *tp) | |||
7762 | tg3_enable_ints(tp); | 8095 | tg3_enable_ints(tp); |
7763 | 8096 | ||
7764 | tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE | | 8097 | tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE | |
7765 | HOSTCC_MODE_NOW); | 8098 | tnapi->coal_now); |
7766 | 8099 | ||
7767 | for (i = 0; i < 5; i++) { | 8100 | for (i = 0; i < 5; i++) { |
7768 | u32 int_mbox, misc_host_ctrl; | 8101 | u32 int_mbox, misc_host_ctrl; |
@@ -7781,15 +8114,22 @@ static int tg3_test_interrupt(struct tg3 *tp) | |||
7781 | 8114 | ||
7782 | tg3_disable_ints(tp); | 8115 | tg3_disable_ints(tp); |
7783 | 8116 | ||
7784 | free_irq(tp->pdev->irq, tnapi); | 8117 | free_irq(tnapi->irq_vec, tnapi); |
7785 | 8118 | ||
7786 | err = tg3_request_irq(tp); | 8119 | err = tg3_request_irq(tp, 0); |
7787 | 8120 | ||
7788 | if (err) | 8121 | if (err) |
7789 | return err; | 8122 | return err; |
7790 | 8123 | ||
7791 | if (intr_ok) | 8124 | if (intr_ok) { |
8125 | /* Reenable MSI one shot mode. */ | ||
8126 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && | ||
8127 | (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) { | ||
8128 | val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE; | ||
8129 | tw32(MSGINT_MODE, val); | ||
8130 | } | ||
7792 | return 0; | 8131 | return 0; |
8132 | } | ||
7793 | 8133 | ||
7794 | return -EIO; | 8134 | return -EIO; |
7795 | } | 8135 | } |
@@ -7829,13 +8169,13 @@ static int tg3_test_msi(struct tg3 *tp) | |||
7829 | "the PCI maintainer and include system chipset information.\n", | 8169 | "the PCI maintainer and include system chipset information.\n", |
7830 | tp->dev->name); | 8170 | tp->dev->name); |
7831 | 8171 | ||
7832 | free_irq(tp->pdev->irq, &tp->napi[0]); | 8172 | free_irq(tp->napi[0].irq_vec, &tp->napi[0]); |
7833 | 8173 | ||
7834 | pci_disable_msi(tp->pdev); | 8174 | pci_disable_msi(tp->pdev); |
7835 | 8175 | ||
7836 | tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; | 8176 | tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; |
7837 | 8177 | ||
7838 | err = tg3_request_irq(tp); | 8178 | err = tg3_request_irq(tp, 0); |
7839 | if (err) | 8179 | if (err) |
7840 | return err; | 8180 | return err; |
7841 | 8181 | ||
@@ -7850,7 +8190,7 @@ static int tg3_test_msi(struct tg3 *tp) | |||
7850 | tg3_full_unlock(tp); | 8190 | tg3_full_unlock(tp); |
7851 | 8191 | ||
7852 | if (err) | 8192 | if (err) |
7853 | free_irq(tp->pdev->irq, &tp->napi[0]); | 8193 | free_irq(tp->napi[0].irq_vec, &tp->napi[0]); |
7854 | 8194 | ||
7855 | return err; | 8195 | return err; |
7856 | } | 8196 | } |
@@ -7886,37 +8226,95 @@ static int tg3_request_firmware(struct tg3 *tp) | |||
7886 | return 0; | 8226 | return 0; |
7887 | } | 8227 | } |
7888 | 8228 | ||
8229 | static bool tg3_enable_msix(struct tg3 *tp) | ||
8230 | { | ||
8231 | int i, rc, cpus = num_online_cpus(); | ||
8232 | struct msix_entry msix_ent[tp->irq_max]; | ||
8233 | |||
8234 | if (cpus == 1) | ||
8235 | /* Just fallback to the simpler MSI mode. */ | ||
8236 | return false; | ||
8237 | |||
8238 | /* | ||
8239 | * We want as many rx rings enabled as there are cpus. | ||
8240 | * The first MSIX vector only deals with link interrupts, etc, | ||
8241 | * so we add one to the number of vectors we are requesting. | ||
8242 | */ | ||
8243 | tp->irq_cnt = min_t(unsigned, cpus + 1, tp->irq_max); | ||
8244 | |||
8245 | for (i = 0; i < tp->irq_max; i++) { | ||
8246 | msix_ent[i].entry = i; | ||
8247 | msix_ent[i].vector = 0; | ||
8248 | } | ||
8249 | |||
8250 | rc = pci_enable_msix(tp->pdev, msix_ent, tp->irq_cnt); | ||
8251 | if (rc != 0) { | ||
8252 | if (rc < TG3_RSS_MIN_NUM_MSIX_VECS) | ||
8253 | return false; | ||
8254 | if (pci_enable_msix(tp->pdev, msix_ent, rc)) | ||
8255 | return false; | ||
8256 | printk(KERN_NOTICE | ||
8257 | "%s: Requested %d MSI-X vectors, received %d\n", | ||
8258 | tp->dev->name, tp->irq_cnt, rc); | ||
8259 | tp->irq_cnt = rc; | ||
8260 | } | ||
8261 | |||
8262 | tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS; | ||
8263 | |||
8264 | for (i = 0; i < tp->irq_max; i++) | ||
8265 | tp->napi[i].irq_vec = msix_ent[i].vector; | ||
8266 | |||
8267 | tp->dev->real_num_tx_queues = tp->irq_cnt - 1; | ||
8268 | |||
8269 | return true; | ||
8270 | } | ||
8271 | |||
7889 | static void tg3_ints_init(struct tg3 *tp) | 8272 | static void tg3_ints_init(struct tg3 *tp) |
7890 | { | 8273 | { |
7891 | if (tp->tg3_flags & TG3_FLAG_SUPPORT_MSI) { | 8274 | if ((tp->tg3_flags & TG3_FLAG_SUPPORT_MSI_OR_MSIX) && |
8275 | !(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)) { | ||
7892 | /* All MSI supporting chips should support tagged | 8276 | /* All MSI supporting chips should support tagged |
7893 | * status. Assert that this is the case. | 8277 | * status. Assert that this is the case. |
7894 | */ | 8278 | */ |
7895 | if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)) { | 8279 | printk(KERN_WARNING PFX "%s: MSI without TAGGED? " |
7896 | printk(KERN_WARNING PFX "%s: MSI without TAGGED? " | 8280 | "Not using MSI.\n", tp->dev->name); |
7897 | "Not using MSI.\n", tp->dev->name); | 8281 | goto defcfg; |
7898 | } else if (pci_enable_msi(tp->pdev) == 0) { | 8282 | } |
7899 | u32 msi_mode; | ||
7900 | 8283 | ||
7901 | msi_mode = tr32(MSGINT_MODE); | 8284 | if ((tp->tg3_flags & TG3_FLAG_SUPPORT_MSIX) && tg3_enable_msix(tp)) |
7902 | tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE); | 8285 | tp->tg3_flags2 |= TG3_FLG2_USING_MSIX; |
7903 | tp->tg3_flags2 |= TG3_FLG2_USING_MSI; | 8286 | else if ((tp->tg3_flags & TG3_FLAG_SUPPORT_MSI) && |
7904 | } | 8287 | pci_enable_msi(tp->pdev) == 0) |
8288 | tp->tg3_flags2 |= TG3_FLG2_USING_MSI; | ||
8289 | |||
8290 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI_OR_MSIX) { | ||
8291 | u32 msi_mode = tr32(MSGINT_MODE); | ||
8292 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX) | ||
8293 | msi_mode |= MSGINT_MODE_MULTIVEC_EN; | ||
8294 | tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE); | ||
8295 | } | ||
8296 | defcfg: | ||
8297 | if (!(tp->tg3_flags2 & TG3_FLG2_USING_MSIX)) { | ||
8298 | tp->irq_cnt = 1; | ||
8299 | tp->napi[0].irq_vec = tp->pdev->irq; | ||
8300 | tp->dev->real_num_tx_queues = 1; | ||
7905 | } | 8301 | } |
7906 | } | 8302 | } |
7907 | 8303 | ||
7908 | static void tg3_ints_fini(struct tg3 *tp) | 8304 | static void tg3_ints_fini(struct tg3 *tp) |
7909 | { | 8305 | { |
7910 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) { | 8306 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX) |
7911 | pci_disable_msi(tp->pdev); | 8307 | pci_disable_msix(tp->pdev); |
7912 | tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; | 8308 | else if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) |
7913 | } | 8309 | pci_disable_msi(tp->pdev); |
8310 | tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI_OR_MSIX; | ||
8311 | tp->tg3_flags3 &= ~TG3_FLG3_ENABLE_RSS; | ||
7914 | } | 8312 | } |
7915 | 8313 | ||
7916 | static int tg3_open(struct net_device *dev) | 8314 | static int tg3_open(struct net_device *dev) |
7917 | { | 8315 | { |
7918 | struct tg3 *tp = netdev_priv(dev); | 8316 | struct tg3 *tp = netdev_priv(dev); |
7919 | int err; | 8317 | int i, err; |
7920 | 8318 | ||
7921 | if (tp->fw_needed) { | 8319 | if (tp->fw_needed) { |
7922 | err = tg3_request_firmware(tp); | 8320 | err = tg3_request_firmware(tp); |
@@ -7947,21 +8345,33 @@ static int tg3_open(struct net_device *dev) | |||
7947 | 8345 | ||
7948 | tg3_full_unlock(tp); | 8346 | tg3_full_unlock(tp); |
7949 | 8347 | ||
8348 | /* | ||
8349 | * Setup interrupts first so we know how | ||
8350 | * many NAPI resources to allocate | ||
8351 | */ | ||
8352 | tg3_ints_init(tp); | ||
8353 | |||
7950 | /* The placement of this call is tied | 8354 | /* The placement of this call is tied |
7951 | * to the setup and use of Host TX descriptors. | 8355 | * to the setup and use of Host TX descriptors. |
7952 | */ | 8356 | */ |
7953 | err = tg3_alloc_consistent(tp); | 8357 | err = tg3_alloc_consistent(tp); |
7954 | if (err) | 8358 | if (err) |
7955 | return err; | 8359 | goto err_out1; |
7956 | |||
7957 | tg3_ints_init(tp); | ||
7958 | 8360 | ||
7959 | napi_enable(&tp->napi[0].napi); | 8361 | tg3_napi_enable(tp); |
7960 | 8362 | ||
7961 | err = tg3_request_irq(tp); | 8363 | for (i = 0; i < tp->irq_cnt; i++) { |
8364 | struct tg3_napi *tnapi = &tp->napi[i]; | ||
8365 | err = tg3_request_irq(tp, i); | ||
8366 | if (err) { | ||
8367 | for (i--; i >= 0; i--) | ||
8368 | free_irq(tnapi->irq_vec, tnapi); | ||
8369 | break; | ||
8370 | } | ||
8371 | } | ||
7962 | 8372 | ||
7963 | if (err) | 8373 | if (err) |
7964 | goto err_out1; | 8374 | goto err_out2; |
7965 | 8375 | ||
7966 | tg3_full_lock(tp, 0); | 8376 | tg3_full_lock(tp, 0); |
7967 | 8377 | ||
@@ -7990,7 +8400,7 @@ static int tg3_open(struct net_device *dev) | |||
7990 | tg3_full_unlock(tp); | 8400 | tg3_full_unlock(tp); |
7991 | 8401 | ||
7992 | if (err) | 8402 | if (err) |
7993 | goto err_out2; | 8403 | goto err_out3; |
7994 | 8404 | ||
7995 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) { | 8405 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) { |
7996 | err = tg3_test_msi(tp); | 8406 | err = tg3_test_msi(tp); |
@@ -8001,16 +8411,16 @@ static int tg3_open(struct net_device *dev) | |||
8001 | tg3_free_rings(tp); | 8411 | tg3_free_rings(tp); |
8002 | tg3_full_unlock(tp); | 8412 | tg3_full_unlock(tp); |
8003 | 8413 | ||
8004 | goto err_out1; | 8414 | goto err_out2; |
8005 | } | 8415 | } |
8006 | 8416 | ||
8007 | if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) { | 8417 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 && |
8008 | if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) { | 8418 | (tp->tg3_flags2 & TG3_FLG2_USING_MSI) && |
8009 | u32 val = tr32(PCIE_TRANSACTION_CFG); | 8419 | (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)) { |
8420 | u32 val = tr32(PCIE_TRANSACTION_CFG); | ||
8010 | 8421 | ||
8011 | tw32(PCIE_TRANSACTION_CFG, | 8422 | tw32(PCIE_TRANSACTION_CFG, |
8012 | val | PCIE_TRANS_CFG_1SHOT_MSI); | 8423 | val | PCIE_TRANS_CFG_1SHOT_MSI); |
8013 | } | ||
8014 | } | 8424 | } |
8015 | } | 8425 | } |
8016 | 8426 | ||
@@ -8024,17 +8434,22 @@ static int tg3_open(struct net_device *dev) | |||
8024 | 8434 | ||
8025 | tg3_full_unlock(tp); | 8435 | tg3_full_unlock(tp); |
8026 | 8436 | ||
8027 | netif_start_queue(dev); | 8437 | netif_tx_start_all_queues(dev); |
8028 | 8438 | ||
8029 | return 0; | 8439 | return 0; |
8030 | 8440 | ||
8441 | err_out3: | ||
8442 | for (i = tp->irq_cnt - 1; i >= 0; i--) { | ||
8443 | struct tg3_napi *tnapi = &tp->napi[i]; | ||
8444 | free_irq(tnapi->irq_vec, tnapi); | ||
8445 | } | ||
8446 | |||
8031 | err_out2: | 8447 | err_out2: |
8032 | free_irq(tp->pdev->irq, &tp->napi[0]); | 8448 | tg3_napi_disable(tp); |
8449 | tg3_free_consistent(tp); | ||
8033 | 8450 | ||
8034 | err_out1: | 8451 | err_out1: |
8035 | napi_disable(&tp->napi[0].napi); | ||
8036 | tg3_ints_fini(tp); | 8452 | tg3_ints_fini(tp); |
8037 | tg3_free_consistent(tp); | ||
8038 | return err; | 8453 | return err; |
8039 | } | 8454 | } |
8040 | 8455 | ||
@@ -8273,12 +8688,13 @@ static struct tg3_ethtool_stats *tg3_get_estats(struct tg3 *); | |||
8273 | 8688 | ||
8274 | static int tg3_close(struct net_device *dev) | 8689 | static int tg3_close(struct net_device *dev) |
8275 | { | 8690 | { |
8691 | int i; | ||
8276 | struct tg3 *tp = netdev_priv(dev); | 8692 | struct tg3 *tp = netdev_priv(dev); |
8277 | 8693 | ||
8278 | napi_disable(&tp->napi[0].napi); | 8694 | tg3_napi_disable(tp); |
8279 | cancel_work_sync(&tp->reset_task); | 8695 | cancel_work_sync(&tp->reset_task); |
8280 | 8696 | ||
8281 | netif_stop_queue(dev); | 8697 | netif_tx_stop_all_queues(dev); |
8282 | 8698 | ||
8283 | del_timer_sync(&tp->timer); | 8699 | del_timer_sync(&tp->timer); |
8284 | 8700 | ||
@@ -8295,7 +8711,10 @@ static int tg3_close(struct net_device *dev) | |||
8295 | 8711 | ||
8296 | tg3_full_unlock(tp); | 8712 | tg3_full_unlock(tp); |
8297 | 8713 | ||
8298 | free_irq(tp->pdev->irq, &tp->napi[0]); | 8714 | for (i = tp->irq_cnt - 1; i >= 0; i--) { |
8715 | struct tg3_napi *tnapi = &tp->napi[i]; | ||
8716 | free_irq(tnapi->irq_vec, tnapi); | ||
8717 | } | ||
8299 | 8718 | ||
8300 | tg3_ints_fini(tp); | 8719 | tg3_ints_fini(tp); |
8301 | 8720 | ||
@@ -8862,7 +9281,7 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
8862 | cmd->speed = tp->link_config.active_speed; | 9281 | cmd->speed = tp->link_config.active_speed; |
8863 | cmd->duplex = tp->link_config.active_duplex; | 9282 | cmd->duplex = tp->link_config.active_duplex; |
8864 | } | 9283 | } |
8865 | cmd->phy_address = PHY_ADDR; | 9284 | cmd->phy_address = tp->phy_addr; |
8866 | cmd->transceiver = XCVR_INTERNAL; | 9285 | cmd->transceiver = XCVR_INTERNAL; |
8867 | cmd->autoneg = tp->link_config.autoneg; | 9286 | cmd->autoneg = tp->link_config.autoneg; |
8868 | cmd->maxtxpkt = 0; | 9287 | cmd->maxtxpkt = 0; |
@@ -9037,7 +9456,8 @@ static int tg3_set_tso(struct net_device *dev, u32 value) | |||
9037 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && | 9456 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && |
9038 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || | 9457 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || |
9039 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | 9458 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || |
9040 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) | 9459 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || |
9460 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
9041 | dev->features |= NETIF_F_TSO_ECN; | 9461 | dev->features |= NETIF_F_TSO_ECN; |
9042 | } else | 9462 | } else |
9043 | dev->features &= ~(NETIF_F_TSO6 | NETIF_F_TSO_ECN); | 9463 | dev->features &= ~(NETIF_F_TSO6 | NETIF_F_TSO_ECN); |
@@ -9105,7 +9525,7 @@ static void tg3_get_ringparam(struct net_device *dev, struct ethtool_ringparam * | |||
9105 | static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) | 9525 | static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) |
9106 | { | 9526 | { |
9107 | struct tg3 *tp = netdev_priv(dev); | 9527 | struct tg3 *tp = netdev_priv(dev); |
9108 | int irq_sync = 0, err = 0; | 9528 | int i, irq_sync = 0, err = 0; |
9109 | 9529 | ||
9110 | if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) || | 9530 | if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) || |
9111 | (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) || | 9531 | (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) || |
@@ -9129,7 +9549,9 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e | |||
9129 | tp->rx_pending > 63) | 9549 | tp->rx_pending > 63) |
9130 | tp->rx_pending = 63; | 9550 | tp->rx_pending = 63; |
9131 | tp->rx_jumbo_pending = ering->rx_jumbo_pending; | 9551 | tp->rx_jumbo_pending = ering->rx_jumbo_pending; |
9132 | tp->napi[0].tx_pending = ering->tx_pending; | 9552 | |
9553 | for (i = 0; i < TG3_IRQ_MAX_VECS; i++) | ||
9554 | tp->napi[i].tx_pending = ering->tx_pending; | ||
9133 | 9555 | ||
9134 | if (netif_running(dev)) { | 9556 | if (netif_running(dev)) { |
9135 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); | 9557 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
@@ -9837,7 +10259,7 @@ static int tg3_test_memory(struct tg3 *tp) | |||
9837 | static int tg3_run_loopback(struct tg3 *tp, int loopback_mode) | 10259 | static int tg3_run_loopback(struct tg3 *tp, int loopback_mode) |
9838 | { | 10260 | { |
9839 | u32 mac_mode, rx_start_idx, rx_idx, tx_idx, opaque_key; | 10261 | u32 mac_mode, rx_start_idx, rx_idx, tx_idx, opaque_key; |
9840 | u32 desc_idx; | 10262 | u32 desc_idx, coal_now; |
9841 | struct sk_buff *skb, *rx_skb; | 10263 | struct sk_buff *skb, *rx_skb; |
9842 | u8 *tx_data; | 10264 | u8 *tx_data; |
9843 | dma_addr_t map; | 10265 | dma_addr_t map; |
@@ -9846,8 +10268,14 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode) | |||
9846 | struct tg3_napi *tnapi, *rnapi; | 10268 | struct tg3_napi *tnapi, *rnapi; |
9847 | struct tg3_rx_prodring_set *tpr = &tp->prodring[0]; | 10269 | struct tg3_rx_prodring_set *tpr = &tp->prodring[0]; |
9848 | 10270 | ||
9849 | tnapi = &tp->napi[0]; | 10271 | if (tp->irq_cnt > 1) { |
9850 | rnapi = &tp->napi[0]; | 10272 | tnapi = &tp->napi[1]; |
10273 | rnapi = &tp->napi[1]; | ||
10274 | } else { | ||
10275 | tnapi = &tp->napi[0]; | ||
10276 | rnapi = &tp->napi[0]; | ||
10277 | } | ||
10278 | coal_now = tnapi->coal_now | rnapi->coal_now; | ||
9851 | 10279 | ||
9852 | if (loopback_mode == TG3_MAC_LOOPBACK) { | 10280 | if (loopback_mode == TG3_MAC_LOOPBACK) { |
9853 | /* HW errata - mac loopback fails in some cases on 5780. | 10281 | /* HW errata - mac loopback fails in some cases on 5780. |
@@ -9926,7 +10354,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode) | |||
9926 | map = pci_map_single(tp->pdev, skb->data, tx_len, PCI_DMA_TODEVICE); | 10354 | map = pci_map_single(tp->pdev, skb->data, tx_len, PCI_DMA_TODEVICE); |
9927 | 10355 | ||
9928 | tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE | | 10356 | tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE | |
9929 | HOSTCC_MODE_NOW); | 10357 | rnapi->coal_now); |
9930 | 10358 | ||
9931 | udelay(10); | 10359 | udelay(10); |
9932 | 10360 | ||
@@ -9947,7 +10375,7 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode) | |||
9947 | /* 250 usec to allow enough time on some 10/100 Mbps devices. */ | 10375 | /* 250 usec to allow enough time on some 10/100 Mbps devices. */ |
9948 | for (i = 0; i < 25; i++) { | 10376 | for (i = 0; i < 25; i++) { |
9949 | tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE | | 10377 | tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE | |
9950 | HOSTCC_MODE_NOW); | 10378 | coal_now); |
9951 | 10379 | ||
9952 | udelay(10); | 10380 | udelay(10); |
9953 | 10381 | ||
@@ -10157,7 +10585,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
10157 | 10585 | ||
10158 | switch(cmd) { | 10586 | switch(cmd) { |
10159 | case SIOCGMIIPHY: | 10587 | case SIOCGMIIPHY: |
10160 | data->phy_id = PHY_ADDR; | 10588 | data->phy_id = tp->phy_addr; |
10161 | 10589 | ||
10162 | /* fallthru */ | 10590 | /* fallthru */ |
10163 | case SIOCGMIIREG: { | 10591 | case SIOCGMIIREG: { |
@@ -10440,6 +10868,33 @@ static void __devinit tg3_get_nvram_info(struct tg3 *tp) | |||
10440 | } | 10868 | } |
10441 | } | 10869 | } |
10442 | 10870 | ||
10871 | static void __devinit tg3_nvram_get_pagesize(struct tg3 *tp, u32 nvmcfg1) | ||
10872 | { | ||
10873 | switch (nvmcfg1 & NVRAM_CFG1_5752PAGE_SIZE_MASK) { | ||
10874 | case FLASH_5752PAGE_SIZE_256: | ||
10875 | tp->nvram_pagesize = 256; | ||
10876 | break; | ||
10877 | case FLASH_5752PAGE_SIZE_512: | ||
10878 | tp->nvram_pagesize = 512; | ||
10879 | break; | ||
10880 | case FLASH_5752PAGE_SIZE_1K: | ||
10881 | tp->nvram_pagesize = 1024; | ||
10882 | break; | ||
10883 | case FLASH_5752PAGE_SIZE_2K: | ||
10884 | tp->nvram_pagesize = 2048; | ||
10885 | break; | ||
10886 | case FLASH_5752PAGE_SIZE_4K: | ||
10887 | tp->nvram_pagesize = 4096; | ||
10888 | break; | ||
10889 | case FLASH_5752PAGE_SIZE_264: | ||
10890 | tp->nvram_pagesize = 264; | ||
10891 | break; | ||
10892 | case FLASH_5752PAGE_SIZE_528: | ||
10893 | tp->nvram_pagesize = 528; | ||
10894 | break; | ||
10895 | } | ||
10896 | } | ||
10897 | |||
10443 | static void __devinit tg3_get_5752_nvram_info(struct tg3 *tp) | 10898 | static void __devinit tg3_get_5752_nvram_info(struct tg3 *tp) |
10444 | { | 10899 | { |
10445 | u32 nvcfg1; | 10900 | u32 nvcfg1; |
@@ -10471,26 +10926,7 @@ static void __devinit tg3_get_5752_nvram_info(struct tg3 *tp) | |||
10471 | } | 10926 | } |
10472 | 10927 | ||
10473 | if (tp->tg3_flags2 & TG3_FLG2_FLASH) { | 10928 | if (tp->tg3_flags2 & TG3_FLG2_FLASH) { |
10474 | switch (nvcfg1 & NVRAM_CFG1_5752PAGE_SIZE_MASK) { | 10929 | tg3_nvram_get_pagesize(tp, nvcfg1); |
10475 | case FLASH_5752PAGE_SIZE_256: | ||
10476 | tp->nvram_pagesize = 256; | ||
10477 | break; | ||
10478 | case FLASH_5752PAGE_SIZE_512: | ||
10479 | tp->nvram_pagesize = 512; | ||
10480 | break; | ||
10481 | case FLASH_5752PAGE_SIZE_1K: | ||
10482 | tp->nvram_pagesize = 1024; | ||
10483 | break; | ||
10484 | case FLASH_5752PAGE_SIZE_2K: | ||
10485 | tp->nvram_pagesize = 2048; | ||
10486 | break; | ||
10487 | case FLASH_5752PAGE_SIZE_4K: | ||
10488 | tp->nvram_pagesize = 4096; | ||
10489 | break; | ||
10490 | case FLASH_5752PAGE_SIZE_264: | ||
10491 | tp->nvram_pagesize = 264; | ||
10492 | break; | ||
10493 | } | ||
10494 | } else { | 10930 | } else { |
10495 | /* For eeprom, set pagesize to maximum eeprom size */ | 10931 | /* For eeprom, set pagesize to maximum eeprom size */ |
10496 | tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE; | 10932 | tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE; |
@@ -10743,34 +11179,84 @@ static void __devinit tg3_get_57780_nvram_info(struct tg3 *tp) | |||
10743 | return; | 11179 | return; |
10744 | } | 11180 | } |
10745 | 11181 | ||
10746 | switch (nvcfg1 & NVRAM_CFG1_5752PAGE_SIZE_MASK) { | 11182 | tg3_nvram_get_pagesize(tp, nvcfg1); |
10747 | case FLASH_5752PAGE_SIZE_256: | 11183 | if (tp->nvram_pagesize != 264 && tp->nvram_pagesize != 528) |
10748 | tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS; | ||
10749 | tp->nvram_pagesize = 256; | ||
10750 | break; | ||
10751 | case FLASH_5752PAGE_SIZE_512: | ||
10752 | tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS; | 11184 | tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS; |
10753 | tp->nvram_pagesize = 512; | 11185 | } |
10754 | break; | 11186 | |
10755 | case FLASH_5752PAGE_SIZE_1K: | 11187 | |
10756 | tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS; | 11188 | static void __devinit tg3_get_5717_nvram_info(struct tg3 *tp) |
10757 | tp->nvram_pagesize = 1024; | 11189 | { |
10758 | break; | 11190 | u32 nvcfg1; |
10759 | case FLASH_5752PAGE_SIZE_2K: | 11191 | |
10760 | tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS; | 11192 | nvcfg1 = tr32(NVRAM_CFG1); |
10761 | tp->nvram_pagesize = 2048; | 11193 | |
10762 | break; | 11194 | switch (nvcfg1 & NVRAM_CFG1_5752VENDOR_MASK) { |
10763 | case FLASH_5752PAGE_SIZE_4K: | 11195 | case FLASH_5717VENDOR_ATMEL_EEPROM: |
10764 | tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS; | 11196 | case FLASH_5717VENDOR_MICRO_EEPROM: |
10765 | tp->nvram_pagesize = 4096; | 11197 | tp->nvram_jedecnum = JEDEC_ATMEL; |
10766 | break; | 11198 | tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED; |
10767 | case FLASH_5752PAGE_SIZE_264: | 11199 | tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE; |
10768 | tp->nvram_pagesize = 264; | 11200 | |
11201 | nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS; | ||
11202 | tw32(NVRAM_CFG1, nvcfg1); | ||
11203 | return; | ||
11204 | case FLASH_5717VENDOR_ATMEL_MDB011D: | ||
11205 | case FLASH_5717VENDOR_ATMEL_ADB011B: | ||
11206 | case FLASH_5717VENDOR_ATMEL_ADB011D: | ||
11207 | case FLASH_5717VENDOR_ATMEL_MDB021D: | ||
11208 | case FLASH_5717VENDOR_ATMEL_ADB021B: | ||
11209 | case FLASH_5717VENDOR_ATMEL_ADB021D: | ||
11210 | case FLASH_5717VENDOR_ATMEL_45USPT: | ||
11211 | tp->nvram_jedecnum = JEDEC_ATMEL; | ||
11212 | tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED; | ||
11213 | tp->tg3_flags2 |= TG3_FLG2_FLASH; | ||
11214 | |||
11215 | switch (nvcfg1 & NVRAM_CFG1_5752VENDOR_MASK) { | ||
11216 | case FLASH_5717VENDOR_ATMEL_MDB021D: | ||
11217 | case FLASH_5717VENDOR_ATMEL_ADB021B: | ||
11218 | case FLASH_5717VENDOR_ATMEL_ADB021D: | ||
11219 | tp->nvram_size = TG3_NVRAM_SIZE_256KB; | ||
11220 | break; | ||
11221 | default: | ||
11222 | tp->nvram_size = TG3_NVRAM_SIZE_128KB; | ||
11223 | break; | ||
11224 | } | ||
10769 | break; | 11225 | break; |
10770 | case FLASH_5752PAGE_SIZE_528: | 11226 | case FLASH_5717VENDOR_ST_M_M25PE10: |
10771 | tp->nvram_pagesize = 528; | 11227 | case FLASH_5717VENDOR_ST_A_M25PE10: |
11228 | case FLASH_5717VENDOR_ST_M_M45PE10: | ||
11229 | case FLASH_5717VENDOR_ST_A_M45PE10: | ||
11230 | case FLASH_5717VENDOR_ST_M_M25PE20: | ||
11231 | case FLASH_5717VENDOR_ST_A_M25PE20: | ||
11232 | case FLASH_5717VENDOR_ST_M_M45PE20: | ||
11233 | case FLASH_5717VENDOR_ST_A_M45PE20: | ||
11234 | case FLASH_5717VENDOR_ST_25USPT: | ||
11235 | case FLASH_5717VENDOR_ST_45USPT: | ||
11236 | tp->nvram_jedecnum = JEDEC_ST; | ||
11237 | tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED; | ||
11238 | tp->tg3_flags2 |= TG3_FLG2_FLASH; | ||
11239 | |||
11240 | switch (nvcfg1 & NVRAM_CFG1_5752VENDOR_MASK) { | ||
11241 | case FLASH_5717VENDOR_ST_M_M25PE20: | ||
11242 | case FLASH_5717VENDOR_ST_A_M25PE20: | ||
11243 | case FLASH_5717VENDOR_ST_M_M45PE20: | ||
11244 | case FLASH_5717VENDOR_ST_A_M45PE20: | ||
11245 | tp->nvram_size = TG3_NVRAM_SIZE_256KB; | ||
11246 | break; | ||
11247 | default: | ||
11248 | tp->nvram_size = TG3_NVRAM_SIZE_128KB; | ||
11249 | break; | ||
11250 | } | ||
10772 | break; | 11251 | break; |
11252 | default: | ||
11253 | tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM; | ||
11254 | return; | ||
10773 | } | 11255 | } |
11256 | |||
11257 | tg3_nvram_get_pagesize(tp, nvcfg1); | ||
11258 | if (tp->nvram_pagesize != 264 && tp->nvram_pagesize != 528) | ||
11259 | tp->tg3_flags3 |= TG3_FLG3_NO_NVRAM_ADDR_TRANS; | ||
10774 | } | 11260 | } |
10775 | 11261 | ||
10776 | /* Chips other than 5700/5701 use the NVRAM for fetching info. */ | 11262 | /* Chips other than 5700/5701 use the NVRAM for fetching info. */ |
@@ -10815,6 +11301,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp) | |||
10815 | tg3_get_5906_nvram_info(tp); | 11301 | tg3_get_5906_nvram_info(tp); |
10816 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) | 11302 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) |
10817 | tg3_get_57780_nvram_info(tp); | 11303 | tg3_get_57780_nvram_info(tp); |
11304 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
11305 | tg3_get_5717_nvram_info(tp); | ||
10818 | else | 11306 | else |
10819 | tg3_get_nvram_info(tp); | 11307 | tg3_get_nvram_info(tp); |
10820 | 11308 | ||
@@ -11928,8 +12416,17 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
11928 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_USE_PROD_ID_REG) { | 12416 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_USE_PROD_ID_REG) { |
11929 | u32 prod_id_asic_rev; | 12417 | u32 prod_id_asic_rev; |
11930 | 12418 | ||
11931 | pci_read_config_dword(tp->pdev, TG3PCI_PRODID_ASICREV, | 12419 | if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717C || |
11932 | &prod_id_asic_rev); | 12420 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717S || |
12421 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718C || | ||
12422 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718S) | ||
12423 | pci_read_config_dword(tp->pdev, | ||
12424 | TG3PCI_GEN2_PRODID_ASICREV, | ||
12425 | &prod_id_asic_rev); | ||
12426 | else | ||
12427 | pci_read_config_dword(tp->pdev, TG3PCI_PRODID_ASICREV, | ||
12428 | &prod_id_asic_rev); | ||
12429 | |||
11933 | tp->pci_chip_rev_id = prod_id_asic_rev; | 12430 | tp->pci_chip_rev_id = prod_id_asic_rev; |
11934 | } | 12431 | } |
11935 | 12432 | ||
@@ -12067,8 +12564,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12067 | pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL, | 12564 | pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL, |
12068 | tp->misc_host_ctrl); | 12565 | tp->misc_host_ctrl); |
12069 | 12566 | ||
12070 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || | 12567 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 || |
12071 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) | 12568 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 || |
12569 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
12072 | tp->pdev_peer = tg3_find_peer(tp); | 12570 | tp->pdev_peer = tg3_find_peer(tp); |
12073 | 12571 | ||
12074 | /* Intentionally exclude ASIC_REV_5906 */ | 12572 | /* Intentionally exclude ASIC_REV_5906 */ |
@@ -12077,7 +12575,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12077 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | 12575 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || |
12078 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | 12576 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || |
12079 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | 12577 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || |
12080 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) | 12578 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || |
12579 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
12081 | tp->tg3_flags3 |= TG3_FLG3_5755_PLUS; | 12580 | tp->tg3_flags3 |= TG3_FLG3_5755_PLUS; |
12082 | 12581 | ||
12083 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 || | 12582 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 || |
@@ -12125,8 +12624,18 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12125 | } | 12624 | } |
12126 | } | 12625 | } |
12127 | 12626 | ||
12627 | tp->irq_max = 1; | ||
12628 | |||
12629 | #ifdef TG3_NAPI | ||
12630 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { | ||
12631 | tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX; | ||
12632 | tp->irq_max = TG3_IRQ_MAX_VECS; | ||
12633 | } | ||
12634 | #endif | ||
12635 | |||
12128 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) || | 12636 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) || |
12129 | (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) | 12637 | (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) || |
12638 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
12130 | tp->tg3_flags |= TG3_FLAG_JUMBO_CAPABLE; | 12639 | tp->tg3_flags |= TG3_FLAG_JUMBO_CAPABLE; |
12131 | 12640 | ||
12132 | pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE, | 12641 | pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE, |
@@ -12260,7 +12769,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12260 | tp->write32 = tg3_write_flush_reg32; | 12769 | tp->write32 = tg3_write_flush_reg32; |
12261 | } | 12770 | } |
12262 | 12771 | ||
12263 | |||
12264 | if ((tp->tg3_flags & TG3_FLAG_TXD_MBOX_HWBUG) || | 12772 | if ((tp->tg3_flags & TG3_FLAG_TXD_MBOX_HWBUG) || |
12265 | (tp->tg3_flags & TG3_FLAG_MBOX_WRITE_REORDER)) { | 12773 | (tp->tg3_flags & TG3_FLAG_MBOX_WRITE_REORDER)) { |
12266 | tp->write32_tx_mbox = tg3_write32_tx_mbox; | 12774 | tp->write32_tx_mbox = tg3_write32_tx_mbox; |
@@ -12319,7 +12827,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12319 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | 12827 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || |
12320 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || | 12828 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || |
12321 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | 12829 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || |
12322 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) | 12830 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || |
12831 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
12323 | tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT; | 12832 | tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT; |
12324 | 12833 | ||
12325 | /* Set up tp->grc_local_ctrl before calling tg3_set_power_state(). | 12834 | /* Set up tp->grc_local_ctrl before calling tg3_set_power_state(). |
@@ -12397,7 +12906,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12397 | if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) && | 12906 | if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) && |
12398 | !(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) && | 12907 | !(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) && |
12399 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 && | 12908 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 && |
12400 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780) { | 12909 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 && |
12910 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) { | ||
12401 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | 12911 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || |
12402 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | 12912 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || |
12403 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | 12913 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || |
@@ -12639,8 +13149,10 @@ static int __devinit tg3_get_device_address(struct tg3 *tp) | |||
12639 | tw32_f(NVRAM_CMD, NVRAM_CMD_RESET); | 13149 | tw32_f(NVRAM_CMD, NVRAM_CMD_RESET); |
12640 | else | 13150 | else |
12641 | tg3_nvram_unlock(tp); | 13151 | tg3_nvram_unlock(tp); |
12642 | } | 13152 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { |
12643 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | 13153 | if (tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC) |
13154 | mac_offset = 0xcc; | ||
13155 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | ||
12644 | mac_offset = 0x10; | 13156 | mac_offset = 0x10; |
12645 | 13157 | ||
12646 | /* First try to get it from MAC address mailbox. */ | 13158 | /* First try to get it from MAC address mailbox. */ |
@@ -13121,7 +13633,8 @@ static void __devinit tg3_init_link_config(struct tg3 *tp) | |||
13121 | 13633 | ||
13122 | static void __devinit tg3_init_bufmgr_config(struct tg3 *tp) | 13634 | static void __devinit tg3_init_bufmgr_config(struct tg3 *tp) |
13123 | { | 13635 | { |
13124 | if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { | 13636 | if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS && |
13637 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) { | ||
13125 | tp->bufmgr_config.mbuf_read_dma_low_water = | 13638 | tp->bufmgr_config.mbuf_read_dma_low_water = |
13126 | DEFAULT_MB_RDMA_LOW_WATER_5705; | 13639 | DEFAULT_MB_RDMA_LOW_WATER_5705; |
13127 | tp->bufmgr_config.mbuf_mac_rx_low_water = | 13640 | tp->bufmgr_config.mbuf_mac_rx_low_water = |
@@ -13326,7 +13839,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13326 | static int tg3_version_printed = 0; | 13839 | static int tg3_version_printed = 0; |
13327 | struct net_device *dev; | 13840 | struct net_device *dev; |
13328 | struct tg3 *tp; | 13841 | struct tg3 *tp; |
13329 | int err, pm_cap; | 13842 | int i, err, pm_cap; |
13843 | u32 sndmbx, rcvmbx, intmbx; | ||
13330 | char str[40]; | 13844 | char str[40]; |
13331 | u64 dma_mask, persist_dma_mask; | 13845 | u64 dma_mask, persist_dma_mask; |
13332 | 13846 | ||
@@ -13358,7 +13872,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13358 | goto err_out_free_res; | 13872 | goto err_out_free_res; |
13359 | } | 13873 | } |
13360 | 13874 | ||
13361 | dev = alloc_etherdev(sizeof(*tp)); | 13875 | dev = alloc_etherdev_mq(sizeof(*tp), TG3_IRQ_MAX_VECS); |
13362 | if (!dev) { | 13876 | if (!dev) { |
13363 | printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n"); | 13877 | printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n"); |
13364 | err = -ENOMEM; | 13878 | err = -ENOMEM; |
@@ -13421,11 +13935,50 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13421 | tp->rx_pending = TG3_DEF_RX_RING_PENDING; | 13935 | tp->rx_pending = TG3_DEF_RX_RING_PENDING; |
13422 | tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING; | 13936 | tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING; |
13423 | 13937 | ||
13424 | tp->napi[0].tp = tp; | 13938 | intmbx = MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW; |
13425 | tp->napi[0].int_mbox = MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW; | 13939 | rcvmbx = MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW; |
13426 | tp->napi[0].consmbox = MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW; | 13940 | sndmbx = MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW; |
13427 | tp->napi[0].prodmbox = MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW; | 13941 | for (i = 0; i < TG3_IRQ_MAX_VECS; i++) { |
13428 | tp->napi[0].tx_pending = TG3_DEF_TX_RING_PENDING; | 13942 | struct tg3_napi *tnapi = &tp->napi[i]; |
13943 | |||
13944 | tnapi->tp = tp; | ||
13945 | tnapi->tx_pending = TG3_DEF_TX_RING_PENDING; | ||
13946 | |||
13947 | tnapi->int_mbox = intmbx; | ||
13948 | if (i < 4) | ||
13949 | intmbx += 0x8; | ||
13950 | else | ||
13951 | intmbx += 0x4; | ||
13952 | |||
13953 | tnapi->consmbox = rcvmbx; | ||
13954 | tnapi->prodmbox = sndmbx; | ||
13955 | |||
13956 | if (i) | ||
13957 | tnapi->coal_now = HOSTCC_MODE_COAL_VEC1_NOW << (i - 1); | ||
13958 | else | ||
13959 | tnapi->coal_now = HOSTCC_MODE_NOW; | ||
13960 | |||
13961 | if (!(tp->tg3_flags & TG3_FLAG_SUPPORT_MSIX)) | ||
13962 | break; | ||
13963 | |||
13964 | /* | ||
13965 | * If we support MSIX, we'll be using RSS. If we're using | ||
13966 | * RSS, the first vector only handles link interrupts and the | ||
13967 | * remaining vectors handle rx and tx interrupts. Reuse the | ||
13968 | * mailbox values for the next iteration. The values we setup | ||
13969 | * above are still useful for the single vectored mode. | ||
13970 | */ | ||
13971 | if (!i) | ||
13972 | continue; | ||
13973 | |||
13974 | rcvmbx += 0x8; | ||
13975 | |||
13976 | if (sndmbx & 0x4) | ||
13977 | sndmbx -= 0x4; | ||
13978 | else | ||
13979 | sndmbx += 0xc; | ||
13980 | } | ||
13981 | |||
13429 | netif_napi_add(dev, &tp->napi[0].napi, tg3_poll, 64); | 13982 | netif_napi_add(dev, &tp->napi[0].napi, tg3_poll, 64); |
13430 | dev->ethtool_ops = &tg3_ethtool_ops; | 13983 | dev->ethtool_ops = &tg3_ethtool_ops; |
13431 | dev->watchdog_timeo = TG3_TX_TIMEOUT; | 13984 | dev->watchdog_timeo = TG3_TX_TIMEOUT; |
@@ -13520,7 +14073,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13520 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && | 14073 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && |
13521 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || | 14074 | GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || |
13522 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | 14075 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || |
13523 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) | 14076 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || |
14077 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
13524 | dev->features |= NETIF_F_TSO_ECN; | 14078 | dev->features |= NETIF_F_TSO_ECN; |
13525 | } | 14079 | } |
13526 | 14080 | ||
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index a816b2c0f167..82b45d8797b4 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -46,6 +46,10 @@ | |||
46 | #define TG3PCI_DEVICE_TIGON3_57788 0x1691 | 46 | #define TG3PCI_DEVICE_TIGON3_57788 0x1691 |
47 | #define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */ | 47 | #define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */ |
48 | #define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */ | 48 | #define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */ |
49 | #define TG3PCI_DEVICE_TIGON3_5717C 0x1655 | ||
50 | #define TG3PCI_DEVICE_TIGON3_5717S 0x1656 | ||
51 | #define TG3PCI_DEVICE_TIGON3_5718C 0x1665 | ||
52 | #define TG3PCI_DEVICE_TIGON3_5718S 0x1666 | ||
49 | /* 0x04 --> 0x64 unused */ | 53 | /* 0x04 --> 0x64 unused */ |
50 | #define TG3PCI_MSI_DATA 0x00000064 | 54 | #define TG3PCI_MSI_DATA 0x00000064 |
51 | /* 0x66 --> 0x68 unused */ | 55 | /* 0x66 --> 0x68 unused */ |
@@ -117,6 +121,7 @@ | |||
117 | #define ASIC_REV_5761 0x5761 | 121 | #define ASIC_REV_5761 0x5761 |
118 | #define ASIC_REV_5785 0x5785 | 122 | #define ASIC_REV_5785 0x5785 |
119 | #define ASIC_REV_57780 0x57780 | 123 | #define ASIC_REV_57780 0x57780 |
124 | #define ASIC_REV_5717 0x5717 | ||
120 | #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) | 125 | #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) |
121 | #define CHIPREV_5700_AX 0x70 | 126 | #define CHIPREV_5700_AX 0x70 |
122 | #define CHIPREV_5700_BX 0x71 | 127 | #define CHIPREV_5700_BX 0x71 |
@@ -203,20 +208,20 @@ | |||
203 | #define TG3PCI_MEM_WIN_BASE_ADDR 0x0000007c | 208 | #define TG3PCI_MEM_WIN_BASE_ADDR 0x0000007c |
204 | #define TG3PCI_REG_DATA 0x00000080 | 209 | #define TG3PCI_REG_DATA 0x00000080 |
205 | #define TG3PCI_MEM_WIN_DATA 0x00000084 | 210 | #define TG3PCI_MEM_WIN_DATA 0x00000084 |
206 | #define TG3PCI_MODE_CTRL 0x00000088 | ||
207 | #define TG3PCI_MISC_CFG 0x0000008c | ||
208 | #define TG3PCI_MISC_LOCAL_CTRL 0x00000090 | 211 | #define TG3PCI_MISC_LOCAL_CTRL 0x00000090 |
209 | /* 0x94 --> 0x98 unused */ | 212 | /* 0x94 --> 0x98 unused */ |
210 | #define TG3PCI_STD_RING_PROD_IDX 0x00000098 /* 64-bit */ | 213 | #define TG3PCI_STD_RING_PROD_IDX 0x00000098 /* 64-bit */ |
211 | #define TG3PCI_RCV_RET_RING_CON_IDX 0x000000a0 /* 64-bit */ | 214 | #define TG3PCI_RCV_RET_RING_CON_IDX 0x000000a0 /* 64-bit */ |
212 | #define TG3PCI_SND_PROD_IDX 0x000000a8 /* 64-bit */ | 215 | /* 0xa0 --> 0xb8 unused */ |
213 | /* 0xb0 --> 0xb8 unused */ | ||
214 | #define TG3PCI_DUAL_MAC_CTRL 0x000000b8 | 216 | #define TG3PCI_DUAL_MAC_CTRL 0x000000b8 |
215 | #define DUAL_MAC_CTRL_CH_MASK 0x00000003 | 217 | #define DUAL_MAC_CTRL_CH_MASK 0x00000003 |
216 | #define DUAL_MAC_CTRL_ID 0x00000004 | 218 | #define DUAL_MAC_CTRL_ID 0x00000004 |
217 | #define TG3PCI_PRODID_ASICREV 0x000000bc | 219 | #define TG3PCI_PRODID_ASICREV 0x000000bc |
218 | #define PROD_ID_ASIC_REV_MASK 0x0fffffff | 220 | #define PROD_ID_ASIC_REV_MASK 0x0fffffff |
219 | /* 0xc0 --> 0x110 unused */ | 221 | /* 0xc0 --> 0xf4 unused */ |
222 | |||
223 | #define TG3PCI_GEN2_PRODID_ASICREV 0x000000f4 | ||
224 | /* 0xf8 --> 0x200 unused */ | ||
220 | 225 | ||
221 | #define TG3_CORR_ERR_STAT 0x00000110 | 226 | #define TG3_CORR_ERR_STAT 0x00000110 |
222 | #define TG3_CORR_ERR_STAT_CLEAR 0xffffffff | 227 | #define TG3_CORR_ERR_STAT_CLEAR 0xffffffff |
@@ -446,6 +451,12 @@ | |||
446 | #define RX_MODE_PROMISC 0x00000100 | 451 | #define RX_MODE_PROMISC 0x00000100 |
447 | #define RX_MODE_NO_CRC_CHECK 0x00000200 | 452 | #define RX_MODE_NO_CRC_CHECK 0x00000200 |
448 | #define RX_MODE_KEEP_VLAN_TAG 0x00000400 | 453 | #define RX_MODE_KEEP_VLAN_TAG 0x00000400 |
454 | #define RX_MODE_RSS_IPV4_HASH_EN 0x00010000 | ||
455 | #define RX_MODE_RSS_TCP_IPV4_HASH_EN 0x00020000 | ||
456 | #define RX_MODE_RSS_IPV6_HASH_EN 0x00040000 | ||
457 | #define RX_MODE_RSS_TCP_IPV6_HASH_EN 0x00080000 | ||
458 | #define RX_MODE_RSS_ITBL_HASH_BITS_7 0x00700000 | ||
459 | #define RX_MODE_RSS_ENABLE 0x00800000 | ||
449 | #define RX_MODE_IPV6_CSUM_ENABLE 0x01000000 | 460 | #define RX_MODE_IPV6_CSUM_ENABLE 0x01000000 |
450 | #define MAC_RX_STATUS 0x0000046c | 461 | #define MAC_RX_STATUS 0x0000046c |
451 | #define RX_STATUS_REMOTE_TX_XOFFED 0x00000001 | 462 | #define RX_STATUS_REMOTE_TX_XOFFED 0x00000001 |
@@ -683,6 +694,7 @@ | |||
683 | #define SG_DIG_PARTNER_FULL_DUPLEX 0x00020000 /* If !MRADV_CRC16_SELECT */ | 694 | #define SG_DIG_PARTNER_FULL_DUPLEX 0x00020000 /* If !MRADV_CRC16_SELECT */ |
684 | #define SG_DIG_PARTNER_NEXT_PAGE 0x00010000 /* If !MRADV_CRC16_SELECT */ | 695 | #define SG_DIG_PARTNER_NEXT_PAGE 0x00010000 /* If !MRADV_CRC16_SELECT */ |
685 | #define SG_DIG_AUTONEG_STATE_MASK 0x00000ff0 | 696 | #define SG_DIG_AUTONEG_STATE_MASK 0x00000ff0 |
697 | #define SG_DIG_IS_SERDES 0x00000100 | ||
686 | #define SG_DIG_COMMA_DETECTOR 0x00000008 | 698 | #define SG_DIG_COMMA_DETECTOR 0x00000008 |
687 | #define SG_DIG_MAC_ACK_STATUS 0x00000004 | 699 | #define SG_DIG_MAC_ACK_STATUS 0x00000004 |
688 | #define SG_DIG_AUTONEG_COMPLETE 0x00000002 | 700 | #define SG_DIG_AUTONEG_COMPLETE 0x00000002 |
@@ -690,7 +702,22 @@ | |||
690 | /* 0x5b8 --> 0x600 unused */ | 702 | /* 0x5b8 --> 0x600 unused */ |
691 | #define MAC_TX_MAC_STATE_BASE 0x00000600 /* 16 bytes */ | 703 | #define MAC_TX_MAC_STATE_BASE 0x00000600 /* 16 bytes */ |
692 | #define MAC_RX_MAC_STATE_BASE 0x00000610 /* 20 bytes */ | 704 | #define MAC_RX_MAC_STATE_BASE 0x00000610 /* 20 bytes */ |
693 | /* 0x624 --> 0x800 unused */ | 705 | /* 0x624 --> 0x670 unused */ |
706 | |||
707 | #define MAC_RSS_INDIR_TBL_0 0x00000630 | ||
708 | |||
709 | #define MAC_RSS_HASH_KEY_0 0x00000670 | ||
710 | #define MAC_RSS_HASH_KEY_1 0x00000674 | ||
711 | #define MAC_RSS_HASH_KEY_2 0x00000678 | ||
712 | #define MAC_RSS_HASH_KEY_3 0x0000067c | ||
713 | #define MAC_RSS_HASH_KEY_4 0x00000680 | ||
714 | #define MAC_RSS_HASH_KEY_5 0x00000684 | ||
715 | #define MAC_RSS_HASH_KEY_6 0x00000688 | ||
716 | #define MAC_RSS_HASH_KEY_7 0x0000068c | ||
717 | #define MAC_RSS_HASH_KEY_8 0x00000690 | ||
718 | #define MAC_RSS_HASH_KEY_9 0x00000694 | ||
719 | /* 0x698 --> 0x800 unused */ | ||
720 | |||
694 | #define MAC_TX_STATS_OCTETS 0x00000800 | 721 | #define MAC_TX_STATS_OCTETS 0x00000800 |
695 | #define MAC_TX_STATS_RESV1 0x00000804 | 722 | #define MAC_TX_STATS_RESV1 0x00000804 |
696 | #define MAC_TX_STATS_COLLISIONS 0x00000808 | 723 | #define MAC_TX_STATS_COLLISIONS 0x00000808 |
@@ -822,6 +849,7 @@ | |||
822 | #define SNDBDI_MODE_RESET 0x00000001 | 849 | #define SNDBDI_MODE_RESET 0x00000001 |
823 | #define SNDBDI_MODE_ENABLE 0x00000002 | 850 | #define SNDBDI_MODE_ENABLE 0x00000002 |
824 | #define SNDBDI_MODE_ATTN_ENABLE 0x00000004 | 851 | #define SNDBDI_MODE_ATTN_ENABLE 0x00000004 |
852 | #define SNDBDI_MODE_MULTI_TXQ_EN 0x00000020 | ||
825 | #define SNDBDI_STATUS 0x00001804 | 853 | #define SNDBDI_STATUS 0x00001804 |
826 | #define SNDBDI_STATUS_ERROR_ATTN 0x00000004 | 854 | #define SNDBDI_STATUS_ERROR_ATTN 0x00000004 |
827 | #define SNDBDI_IN_PROD_IDX_0 0x00001808 | 855 | #define SNDBDI_IN_PROD_IDX_0 0x00001808 |
@@ -950,7 +978,11 @@ | |||
950 | #define RCVBDI_MINI_THRESH 0x00002c14 | 978 | #define RCVBDI_MINI_THRESH 0x00002c14 |
951 | #define RCVBDI_STD_THRESH 0x00002c18 | 979 | #define RCVBDI_STD_THRESH 0x00002c18 |
952 | #define RCVBDI_JUMBO_THRESH 0x00002c1c | 980 | #define RCVBDI_JUMBO_THRESH 0x00002c1c |
953 | /* 0x2c20 --> 0x3000 unused */ | 981 | /* 0x2c20 --> 0x2d00 unused */ |
982 | |||
983 | #define STD_REPLENISH_LWM 0x00002d00 | ||
984 | #define JMB_REPLENISH_LWM 0x00002d04 | ||
985 | /* 0x2d08 --> 0x3000 unused */ | ||
954 | 986 | ||
955 | /* Receive BD Completion Control Registers */ | 987 | /* Receive BD Completion Control Registers */ |
956 | #define RCVCC_MODE 0x00003000 | 988 | #define RCVCC_MODE 0x00003000 |
@@ -996,8 +1028,10 @@ | |||
996 | #define TG3_CPMU_HST_ACC 0x0000361c | 1028 | #define TG3_CPMU_HST_ACC 0x0000361c |
997 | #define CPMU_HST_ACC_MACCLK_MASK 0x001f0000 | 1029 | #define CPMU_HST_ACC_MACCLK_MASK 0x001f0000 |
998 | #define CPMU_HST_ACC_MACCLK_6_25 0x00130000 | 1030 | #define CPMU_HST_ACC_MACCLK_6_25 0x00130000 |
999 | /* 0x3620 --> 0x3630 unused */ | 1031 | /* 0x3620 --> 0x362c unused */ |
1000 | 1032 | ||
1033 | #define TG3_CPMU_STATUS 0x0000362c | ||
1034 | #define TG3_CPMU_STATUS_PCIE_FUNC 0x20000000 | ||
1001 | #define TG3_CPMU_CLCK_STAT 0x00003630 | 1035 | #define TG3_CPMU_CLCK_STAT 0x00003630 |
1002 | #define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000 | 1036 | #define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000 |
1003 | #define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000 | 1037 | #define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000 |
@@ -1031,6 +1065,7 @@ | |||
1031 | #define HOSTCC_MODE_CLRTICK_TXBD 0x00000400 | 1065 | #define HOSTCC_MODE_CLRTICK_TXBD 0x00000400 |
1032 | #define HOSTCC_MODE_NOINT_ON_NOW 0x00000800 | 1066 | #define HOSTCC_MODE_NOINT_ON_NOW 0x00000800 |
1033 | #define HOSTCC_MODE_NOINT_ON_FORCE 0x00001000 | 1067 | #define HOSTCC_MODE_NOINT_ON_FORCE 0x00001000 |
1068 | #define HOSTCC_MODE_COAL_VEC1_NOW 0x00002000 | ||
1034 | #define HOSTCC_STATUS 0x00003c04 | 1069 | #define HOSTCC_STATUS 0x00003c04 |
1035 | #define HOSTCC_STATUS_ERROR_ATTN 0x00000004 | 1070 | #define HOSTCC_STATUS_ERROR_ATTN 0x00000004 |
1036 | #define HOSTCC_RXCOL_TICKS 0x00003c08 | 1071 | #define HOSTCC_RXCOL_TICKS 0x00003c08 |
@@ -1116,7 +1151,16 @@ | |||
1116 | #define HOSTCC_SND_CON_IDX_13 0x00003cf4 | 1151 | #define HOSTCC_SND_CON_IDX_13 0x00003cf4 |
1117 | #define HOSTCC_SND_CON_IDX_14 0x00003cf8 | 1152 | #define HOSTCC_SND_CON_IDX_14 0x00003cf8 |
1118 | #define HOSTCC_SND_CON_IDX_15 0x00003cfc | 1153 | #define HOSTCC_SND_CON_IDX_15 0x00003cfc |
1119 | /* 0x3d00 --> 0x4000 unused */ | 1154 | #define HOSTCC_STATBLCK_RING1 0x00003d00 |
1155 | /* 0x3d00 --> 0x3d80 unused */ | ||
1156 | |||
1157 | #define HOSTCC_RXCOL_TICKS_VEC1 0x00003d80 | ||
1158 | #define HOSTCC_TXCOL_TICKS_VEC1 0x00003d84 | ||
1159 | #define HOSTCC_RXMAX_FRAMES_VEC1 0x00003d88 | ||
1160 | #define HOSTCC_TXMAX_FRAMES_VEC1 0x00003d8c | ||
1161 | #define HOSTCC_RXCOAL_MAXF_INT_VEC1 0x00003d90 | ||
1162 | #define HOSTCC_TXCOAL_MAXF_INT_VEC1 0x00003d94 | ||
1163 | /* 0x3d98 --> 0x4000 unused */ | ||
1120 | 1164 | ||
1121 | /* Memory arbiter control registers */ | 1165 | /* Memory arbiter control registers */ |
1122 | #define MEMARB_MODE 0x00004000 | 1166 | #define MEMARB_MODE 0x00004000 |
@@ -1454,6 +1498,8 @@ | |||
1454 | #define MSGINT_MODE 0x00006000 | 1498 | #define MSGINT_MODE 0x00006000 |
1455 | #define MSGINT_MODE_RESET 0x00000001 | 1499 | #define MSGINT_MODE_RESET 0x00000001 |
1456 | #define MSGINT_MODE_ENABLE 0x00000002 | 1500 | #define MSGINT_MODE_ENABLE 0x00000002 |
1501 | #define MSGINT_MODE_ONE_SHOT_DISABLE 0x00000020 | ||
1502 | #define MSGINT_MODE_MULTIVEC_EN 0x00000080 | ||
1457 | #define MSGINT_STATUS 0x00006004 | 1503 | #define MSGINT_STATUS 0x00006004 |
1458 | #define MSGINT_FIFO 0x00006008 | 1504 | #define MSGINT_FIFO 0x00006008 |
1459 | /* 0x600c --> 0x6400 unused */ | 1505 | /* 0x600c --> 0x6400 unused */ |
@@ -1649,6 +1695,25 @@ | |||
1649 | #define FLASH_57780VENDOR_ATMEL_AT45DB021B 0x03400002 | 1695 | #define FLASH_57780VENDOR_ATMEL_AT45DB021B 0x03400002 |
1650 | #define FLASH_57780VENDOR_ATMEL_AT45DB041D 0x00400001 | 1696 | #define FLASH_57780VENDOR_ATMEL_AT45DB041D 0x00400001 |
1651 | #define FLASH_57780VENDOR_ATMEL_AT45DB041B 0x03400001 | 1697 | #define FLASH_57780VENDOR_ATMEL_AT45DB041B 0x03400001 |
1698 | #define FLASH_5717VENDOR_ATMEL_EEPROM 0x02000001 | ||
1699 | #define FLASH_5717VENDOR_MICRO_EEPROM 0x02000003 | ||
1700 | #define FLASH_5717VENDOR_ATMEL_MDB011D 0x01000001 | ||
1701 | #define FLASH_5717VENDOR_ATMEL_MDB021D 0x01000003 | ||
1702 | #define FLASH_5717VENDOR_ST_M_M25PE10 0x02000000 | ||
1703 | #define FLASH_5717VENDOR_ST_M_M25PE20 0x02000002 | ||
1704 | #define FLASH_5717VENDOR_ST_M_M45PE10 0x00000001 | ||
1705 | #define FLASH_5717VENDOR_ST_M_M45PE20 0x00000003 | ||
1706 | #define FLASH_5717VENDOR_ATMEL_ADB011B 0x01400000 | ||
1707 | #define FLASH_5717VENDOR_ATMEL_ADB021B 0x01400002 | ||
1708 | #define FLASH_5717VENDOR_ATMEL_ADB011D 0x01400001 | ||
1709 | #define FLASH_5717VENDOR_ATMEL_ADB021D 0x01400003 | ||
1710 | #define FLASH_5717VENDOR_ST_A_M25PE10 0x02400000 | ||
1711 | #define FLASH_5717VENDOR_ST_A_M25PE20 0x02400002 | ||
1712 | #define FLASH_5717VENDOR_ST_A_M45PE10 0x02400001 | ||
1713 | #define FLASH_5717VENDOR_ST_A_M45PE20 0x02400003 | ||
1714 | #define FLASH_5717VENDOR_ATMEL_45USPT 0x03400000 | ||
1715 | #define FLASH_5717VENDOR_ST_25USPT 0x03400002 | ||
1716 | #define FLASH_5717VENDOR_ST_45USPT 0x03400001 | ||
1652 | #define NVRAM_CFG1_5752PAGE_SIZE_MASK 0x70000000 | 1717 | #define NVRAM_CFG1_5752PAGE_SIZE_MASK 0x70000000 |
1653 | #define FLASH_5752PAGE_SIZE_256 0x00000000 | 1718 | #define FLASH_5752PAGE_SIZE_256 0x00000000 |
1654 | #define FLASH_5752PAGE_SIZE_512 0x10000000 | 1719 | #define FLASH_5752PAGE_SIZE_512 0x10000000 |
@@ -2091,6 +2156,7 @@ struct tg3_tx_buffer_desc { | |||
2091 | #define TXD_FLAG_IP_CSUM 0x0002 | 2156 | #define TXD_FLAG_IP_CSUM 0x0002 |
2092 | #define TXD_FLAG_END 0x0004 | 2157 | #define TXD_FLAG_END 0x0004 |
2093 | #define TXD_FLAG_IP_FRAG 0x0008 | 2158 | #define TXD_FLAG_IP_FRAG 0x0008 |
2159 | #define TXD_FLAG_JMB_PKT 0x0008 | ||
2094 | #define TXD_FLAG_IP_FRAG_END 0x0010 | 2160 | #define TXD_FLAG_IP_FRAG_END 0x0010 |
2095 | #define TXD_FLAG_VLAN 0x0040 | 2161 | #define TXD_FLAG_VLAN 0x0040 |
2096 | #define TXD_FLAG_COAL_NOW 0x0080 | 2162 | #define TXD_FLAG_COAL_NOW 0x0080 |
@@ -2487,7 +2553,7 @@ struct tg3_rx_prodring_set { | |||
2487 | dma_addr_t rx_jmb_mapping; | 2553 | dma_addr_t rx_jmb_mapping; |
2488 | }; | 2554 | }; |
2489 | 2555 | ||
2490 | #define TG3_IRQ_MAX_VECS 1 | 2556 | #define TG3_IRQ_MAX_VECS 5 |
2491 | 2557 | ||
2492 | struct tg3_napi { | 2558 | struct tg3_napi { |
2493 | struct napi_struct napi ____cacheline_aligned; | 2559 | struct napi_struct napi ____cacheline_aligned; |
@@ -2497,6 +2563,7 @@ struct tg3_napi { | |||
2497 | u32 last_tag; | 2563 | u32 last_tag; |
2498 | u32 last_irq_tag; | 2564 | u32 last_irq_tag; |
2499 | u32 int_mbox; | 2565 | u32 int_mbox; |
2566 | u32 coal_now; | ||
2500 | u32 tx_prod; | 2567 | u32 tx_prod; |
2501 | u32 tx_cons; | 2568 | u32 tx_cons; |
2502 | u32 tx_pending; | 2569 | u32 tx_pending; |
@@ -2504,6 +2571,7 @@ struct tg3_napi { | |||
2504 | 2571 | ||
2505 | u32 consmbox; | 2572 | u32 consmbox; |
2506 | u32 rx_rcb_ptr; | 2573 | u32 rx_rcb_ptr; |
2574 | u16 *rx_rcb_prod_idx; | ||
2507 | 2575 | ||
2508 | struct tg3_rx_buffer_desc *rx_rcb; | 2576 | struct tg3_rx_buffer_desc *rx_rcb; |
2509 | struct tg3_tx_buffer_desc *tx_ring; | 2577 | struct tg3_tx_buffer_desc *tx_ring; |
@@ -2512,6 +2580,9 @@ struct tg3_napi { | |||
2512 | dma_addr_t status_mapping; | 2580 | dma_addr_t status_mapping; |
2513 | dma_addr_t rx_rcb_mapping; | 2581 | dma_addr_t rx_rcb_mapping; |
2514 | dma_addr_t tx_desc_mapping; | 2582 | dma_addr_t tx_desc_mapping; |
2583 | |||
2584 | char irq_lbl[IFNAMSIZ]; | ||
2585 | unsigned int irq_vec; | ||
2515 | }; | 2586 | }; |
2516 | 2587 | ||
2517 | struct tg3 { | 2588 | struct tg3 { |
@@ -2616,6 +2687,9 @@ struct tg3 { | |||
2616 | #define TG3_FLAG_NVRAM 0x00002000 | 2687 | #define TG3_FLAG_NVRAM 0x00002000 |
2617 | #define TG3_FLAG_NVRAM_BUFFERED 0x00004000 | 2688 | #define TG3_FLAG_NVRAM_BUFFERED 0x00004000 |
2618 | #define TG3_FLAG_SUPPORT_MSI 0x00008000 | 2689 | #define TG3_FLAG_SUPPORT_MSI 0x00008000 |
2690 | #define TG3_FLAG_SUPPORT_MSIX 0x00010000 | ||
2691 | #define TG3_FLAG_SUPPORT_MSI_OR_MSIX (TG3_FLAG_SUPPORT_MSI | \ | ||
2692 | TG3_FLAG_SUPPORT_MSIX) | ||
2619 | #define TG3_FLAG_PCIX_MODE 0x00020000 | 2693 | #define TG3_FLAG_PCIX_MODE 0x00020000 |
2620 | #define TG3_FLAG_PCI_HIGH_SPEED 0x00040000 | 2694 | #define TG3_FLAG_PCI_HIGH_SPEED 0x00040000 |
2621 | #define TG3_FLAG_PCI_32BIT 0x00080000 | 2695 | #define TG3_FLAG_PCI_32BIT 0x00080000 |
@@ -2654,6 +2728,9 @@ struct tg3 { | |||
2654 | #define TG3_FLG2_5750_PLUS 0x00080000 | 2728 | #define TG3_FLG2_5750_PLUS 0x00080000 |
2655 | #define TG3_FLG2_PROTECTED_NVRAM 0x00100000 | 2729 | #define TG3_FLG2_PROTECTED_NVRAM 0x00100000 |
2656 | #define TG3_FLG2_USING_MSI 0x00200000 | 2730 | #define TG3_FLG2_USING_MSI 0x00200000 |
2731 | #define TG3_FLG2_USING_MSIX 0x00400000 | ||
2732 | #define TG3_FLG2_USING_MSI_OR_MSIX (TG3_FLG2_USING_MSI | \ | ||
2733 | TG3_FLG2_USING_MSIX) | ||
2657 | #define TG3_FLG2_MII_SERDES 0x00800000 | 2734 | #define TG3_FLG2_MII_SERDES 0x00800000 |
2658 | #define TG3_FLG2_ANY_SERDES (TG3_FLG2_PHY_SERDES | \ | 2735 | #define TG3_FLG2_ANY_SERDES (TG3_FLG2_PHY_SERDES | \ |
2659 | TG3_FLG2_MII_SERDES) | 2736 | TG3_FLG2_MII_SERDES) |
@@ -2683,6 +2760,7 @@ struct tg3 { | |||
2683 | #define TG3_FLG3_NO_NVRAM 0x00004000 | 2760 | #define TG3_FLG3_NO_NVRAM 0x00004000 |
2684 | #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000 | 2761 | #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000 |
2685 | #define TG3_FLG3_PHY_IS_FET 0x00010000 | 2762 | #define TG3_FLG3_PHY_IS_FET 0x00010000 |
2763 | #define TG3_FLG3_ENABLE_RSS 0x00020000 | ||
2686 | 2764 | ||
2687 | struct timer_list timer; | 2765 | struct timer_list timer; |
2688 | u16 timer_counter; | 2766 | u16 timer_counter; |
@@ -2728,6 +2806,8 @@ struct tg3 { | |||
2728 | struct mii_bus *mdio_bus; | 2806 | struct mii_bus *mdio_bus; |
2729 | int mdio_irq[PHY_MAX_ADDR]; | 2807 | int mdio_irq[PHY_MAX_ADDR]; |
2730 | 2808 | ||
2809 | u8 phy_addr; | ||
2810 | |||
2731 | /* PHY info */ | 2811 | /* PHY info */ |
2732 | u32 phy_id; | 2812 | u32 phy_id; |
2733 | #define PHY_ID_MASK 0xfffffff0 | 2813 | #define PHY_ID_MASK 0xfffffff0 |
@@ -2827,6 +2907,9 @@ struct tg3 { | |||
2827 | 2907 | ||
2828 | #define SST_25VF0X0_PAGE_SIZE 4098 | 2908 | #define SST_25VF0X0_PAGE_SIZE 4098 |
2829 | 2909 | ||
2910 | unsigned int irq_max; | ||
2911 | unsigned int irq_cnt; | ||
2912 | |||
2830 | struct ethtool_coalesce coal; | 2913 | struct ethtool_coalesce coal; |
2831 | 2914 | ||
2832 | /* firmware info */ | 2915 | /* firmware info */ |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index 70c9ec45d8fb..49e273bceed6 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -289,7 +289,7 @@ static void TLan_EisaProbe( void ); | |||
289 | static void TLan_Eisa_Cleanup( void ); | 289 | static void TLan_Eisa_Cleanup( void ); |
290 | static int TLan_Init( struct net_device * ); | 290 | static int TLan_Init( struct net_device * ); |
291 | static int TLan_Open( struct net_device *dev ); | 291 | static int TLan_Open( struct net_device *dev ); |
292 | static int TLan_StartTx( struct sk_buff *, struct net_device *); | 292 | static netdev_tx_t TLan_StartTx( struct sk_buff *, struct net_device *); |
293 | static irqreturn_t TLan_HandleInterrupt( int, void *); | 293 | static irqreturn_t TLan_HandleInterrupt( int, void *); |
294 | static int TLan_Close( struct net_device *); | 294 | static int TLan_Close( struct net_device *); |
295 | static struct net_device_stats *TLan_GetStats( struct net_device *); | 295 | static struct net_device_stats *TLan_GetStats( struct net_device *); |
@@ -1083,7 +1083,7 @@ static void TLan_tx_timeout_work(struct work_struct *work) | |||
1083 | * | 1083 | * |
1084 | **************************************************************/ | 1084 | **************************************************************/ |
1085 | 1085 | ||
1086 | static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev ) | 1086 | static netdev_tx_t TLan_StartTx( struct sk_buff *skb, struct net_device *dev ) |
1087 | { | 1087 | { |
1088 | TLanPrivateInfo *priv = netdev_priv(dev); | 1088 | TLanPrivateInfo *priv = netdev_priv(dev); |
1089 | dma_addr_t tail_list_phys; | 1089 | dma_addr_t tail_list_phys; |
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index 1787d52941bc..724158966ec1 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c | |||
@@ -128,7 +128,7 @@ static int xl_init(struct net_device *dev); | |||
128 | static int xl_open(struct net_device *dev); | 128 | static int xl_open(struct net_device *dev); |
129 | static int xl_open_hw(struct net_device *dev) ; | 129 | static int xl_open_hw(struct net_device *dev) ; |
130 | static int xl_hw_reset(struct net_device *dev); | 130 | static int xl_hw_reset(struct net_device *dev); |
131 | static int xl_xmit(struct sk_buff *skb, struct net_device *dev); | 131 | static netdev_tx_t xl_xmit(struct sk_buff *skb, struct net_device *dev); |
132 | static void xl_dn_comp(struct net_device *dev); | 132 | static void xl_dn_comp(struct net_device *dev); |
133 | static int xl_close(struct net_device *dev); | 133 | static int xl_close(struct net_device *dev); |
134 | static void xl_set_rx_mode(struct net_device *dev); | 134 | static void xl_set_rx_mode(struct net_device *dev); |
@@ -1193,7 +1193,7 @@ static irqreturn_t xl_interrupt(int irq, void *dev_id) | |||
1193 | * Tx - Polling configuration | 1193 | * Tx - Polling configuration |
1194 | */ | 1194 | */ |
1195 | 1195 | ||
1196 | static int xl_xmit(struct sk_buff *skb, struct net_device *dev) | 1196 | static netdev_tx_t xl_xmit(struct sk_buff *skb, struct net_device *dev) |
1197 | { | 1197 | { |
1198 | struct xl_private *xl_priv=netdev_priv(dev); | 1198 | struct xl_private *xl_priv=netdev_priv(dev); |
1199 | struct xl_tx_desc *txd ; | 1199 | struct xl_tx_desc *txd ; |
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index 96d00c8f8d3e..525bbc5b9c9d 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
@@ -191,7 +191,8 @@ static int tok_init_card(struct net_device *dev); | |||
191 | static void tok_open_adapter(unsigned long dev_addr); | 191 | static void tok_open_adapter(unsigned long dev_addr); |
192 | static void open_sap(unsigned char type, struct net_device *dev); | 192 | static void open_sap(unsigned char type, struct net_device *dev); |
193 | static void tok_set_multicast_list(struct net_device *dev); | 193 | static void tok_set_multicast_list(struct net_device *dev); |
194 | static int tok_send_packet(struct sk_buff *skb, struct net_device *dev); | 194 | static netdev_tx_t tok_send_packet(struct sk_buff *skb, |
195 | struct net_device *dev); | ||
195 | static int tok_close(struct net_device *dev); | 196 | static int tok_close(struct net_device *dev); |
196 | static irqreturn_t tok_interrupt(int irq, void *dev_id); | 197 | static irqreturn_t tok_interrupt(int irq, void *dev_id); |
197 | static void initial_tok_int(struct net_device *dev); | 198 | static void initial_tok_int(struct net_device *dev); |
@@ -1022,7 +1023,8 @@ static void tok_set_multicast_list(struct net_device *dev) | |||
1022 | 1023 | ||
1023 | #define STATION_ID_OFST 4 | 1024 | #define STATION_ID_OFST 4 |
1024 | 1025 | ||
1025 | static int tok_send_packet(struct sk_buff *skb, struct net_device *dev) | 1026 | static netdev_tx_t tok_send_packet(struct sk_buff *skb, |
1027 | struct net_device *dev) | ||
1026 | { | 1028 | { |
1027 | struct tok_info *ti; | 1029 | struct tok_info *ti; |
1028 | unsigned long flags; | 1030 | unsigned long flags; |
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c index d07e61a9499e..26dca2b2bdbd 100644 --- a/drivers/net/tokenring/lanstreamer.c +++ b/drivers/net/tokenring/lanstreamer.c | |||
@@ -203,7 +203,8 @@ static int streamer_ioctl(struct net_device *, struct ifreq *, int); | |||
203 | 203 | ||
204 | static int streamer_reset(struct net_device *dev); | 204 | static int streamer_reset(struct net_device *dev); |
205 | static int streamer_open(struct net_device *dev); | 205 | static int streamer_open(struct net_device *dev); |
206 | static int streamer_xmit(struct sk_buff *skb, struct net_device *dev); | 206 | static netdev_tx_t streamer_xmit(struct sk_buff *skb, |
207 | struct net_device *dev); | ||
207 | static int streamer_close(struct net_device *dev); | 208 | static int streamer_close(struct net_device *dev); |
208 | static void streamer_set_rx_mode(struct net_device *dev); | 209 | static void streamer_set_rx_mode(struct net_device *dev); |
209 | static irqreturn_t streamer_interrupt(int irq, void *dev_id); | 210 | static irqreturn_t streamer_interrupt(int irq, void *dev_id); |
@@ -1141,7 +1142,8 @@ static irqreturn_t streamer_interrupt(int irq, void *dev_id) | |||
1141 | return IRQ_HANDLED; | 1142 | return IRQ_HANDLED; |
1142 | } | 1143 | } |
1143 | 1144 | ||
1144 | static int streamer_xmit(struct sk_buff *skb, struct net_device *dev) | 1145 | static netdev_tx_t streamer_xmit(struct sk_buff *skb, |
1146 | struct net_device *dev) | ||
1145 | { | 1147 | { |
1146 | struct streamer_private *streamer_priv = | 1148 | struct streamer_private *streamer_priv = |
1147 | netdev_priv(dev); | 1149 | netdev_priv(dev); |
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index f73f4e684f33..d9ec7f0bbd0a 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -182,7 +182,8 @@ MODULE_DEVICE_TABLE(pci,olympic_pci_tbl) ; | |||
182 | static int olympic_probe(struct pci_dev *pdev, const struct pci_device_id *ent); | 182 | static int olympic_probe(struct pci_dev *pdev, const struct pci_device_id *ent); |
183 | static int olympic_init(struct net_device *dev); | 183 | static int olympic_init(struct net_device *dev); |
184 | static int olympic_open(struct net_device *dev); | 184 | static int olympic_open(struct net_device *dev); |
185 | static int olympic_xmit(struct sk_buff *skb, struct net_device *dev); | 185 | static netdev_tx_t olympic_xmit(struct sk_buff *skb, |
186 | struct net_device *dev); | ||
186 | static int olympic_close(struct net_device *dev); | 187 | static int olympic_close(struct net_device *dev); |
187 | static void olympic_set_rx_mode(struct net_device *dev); | 188 | static void olympic_set_rx_mode(struct net_device *dev); |
188 | static void olympic_freemem(struct net_device *dev) ; | 189 | static void olympic_freemem(struct net_device *dev) ; |
@@ -1030,7 +1031,8 @@ static irqreturn_t olympic_interrupt(int irq, void *dev_id) | |||
1030 | return IRQ_HANDLED; | 1031 | return IRQ_HANDLED; |
1031 | } | 1032 | } |
1032 | 1033 | ||
1033 | static int olympic_xmit(struct sk_buff *skb, struct net_device *dev) | 1034 | static netdev_tx_t olympic_xmit(struct sk_buff *skb, |
1035 | struct net_device *dev) | ||
1034 | { | 1036 | { |
1035 | struct olympic_private *olympic_priv=netdev_priv(dev); | 1037 | struct olympic_private *olympic_priv=netdev_priv(dev); |
1036 | u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio; | 1038 | u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio; |
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index 23e012f5bbf4..ebda61bc4c2f 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c | |||
@@ -234,7 +234,8 @@ static int smctr_rx_frame(struct net_device *dev); | |||
234 | 234 | ||
235 | /* S */ | 235 | /* S */ |
236 | static int smctr_send_dat(struct net_device *dev); | 236 | static int smctr_send_dat(struct net_device *dev); |
237 | static int smctr_send_packet(struct sk_buff *skb, struct net_device *dev); | 237 | static netdev_tx_t smctr_send_packet(struct sk_buff *skb, |
238 | struct net_device *dev); | ||
238 | static int smctr_send_lobe_media_test(struct net_device *dev); | 239 | static int smctr_send_lobe_media_test(struct net_device *dev); |
239 | static int smctr_send_rpt_addr(struct net_device *dev, MAC_HEADER *rmf, | 240 | static int smctr_send_rpt_addr(struct net_device *dev, MAC_HEADER *rmf, |
240 | __u16 correlator); | 241 | __u16 correlator); |
@@ -4571,7 +4572,8 @@ static void smctr_timeout(struct net_device *dev) | |||
4571 | /* | 4572 | /* |
4572 | * Gets skb from system, queues it and checks if it can be sent | 4573 | * Gets skb from system, queues it and checks if it can be sent |
4573 | */ | 4574 | */ |
4574 | static int smctr_send_packet(struct sk_buff *skb, struct net_device *dev) | 4575 | static netdev_tx_t smctr_send_packet(struct sk_buff *skb, |
4576 | struct net_device *dev) | ||
4575 | { | 4577 | { |
4576 | struct net_local *tp = netdev_priv(dev); | 4578 | struct net_local *tp = netdev_priv(dev); |
4577 | 4579 | ||
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index 07f6dfd3ba0c..a7b6888829b5 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c | |||
@@ -144,8 +144,8 @@ static void tms380tr_exec_sifcmd(struct net_device *dev, unsigned int WriteValu | |||
144 | /* "G" */ | 144 | /* "G" */ |
145 | static struct net_device_stats *tms380tr_get_stats(struct net_device *dev); | 145 | static struct net_device_stats *tms380tr_get_stats(struct net_device *dev); |
146 | /* "H" */ | 146 | /* "H" */ |
147 | static int tms380tr_hardware_send_packet(struct sk_buff *skb, | 147 | static netdev_tx_t tms380tr_hardware_send_packet(struct sk_buff *skb, |
148 | struct net_device *dev); | 148 | struct net_device *dev); |
149 | /* "I" */ | 149 | /* "I" */ |
150 | static int tms380tr_init_adapter(struct net_device *dev); | 150 | static int tms380tr_init_adapter(struct net_device *dev); |
151 | static void tms380tr_init_ipb(struct net_local *tp); | 151 | static void tms380tr_init_ipb(struct net_local *tp); |
@@ -165,7 +165,8 @@ static int tms380tr_reset_adapter(struct net_device *dev); | |||
165 | static void tms380tr_reset_interrupt(struct net_device *dev); | 165 | static void tms380tr_reset_interrupt(struct net_device *dev); |
166 | static void tms380tr_ring_status_irq(struct net_device *dev); | 166 | static void tms380tr_ring_status_irq(struct net_device *dev); |
167 | /* "S" */ | 167 | /* "S" */ |
168 | static int tms380tr_send_packet(struct sk_buff *skb, struct net_device *dev); | 168 | static netdev_tx_t tms380tr_send_packet(struct sk_buff *skb, |
169 | struct net_device *dev); | ||
169 | static void tms380tr_set_multicast_list(struct net_device *dev); | 170 | static void tms380tr_set_multicast_list(struct net_device *dev); |
170 | static int tms380tr_set_mac_address(struct net_device *dev, void *addr); | 171 | static int tms380tr_set_mac_address(struct net_device *dev, void *addr); |
171 | /* "T" */ | 172 | /* "T" */ |
@@ -599,21 +600,23 @@ static void tms380tr_timeout(struct net_device *dev) | |||
599 | /* | 600 | /* |
600 | * Gets skb from system, queues it and checks if it can be sent | 601 | * Gets skb from system, queues it and checks if it can be sent |
601 | */ | 602 | */ |
602 | static int tms380tr_send_packet(struct sk_buff *skb, struct net_device *dev) | 603 | static netdev_tx_t tms380tr_send_packet(struct sk_buff *skb, |
604 | struct net_device *dev) | ||
603 | { | 605 | { |
604 | struct net_local *tp = netdev_priv(dev); | 606 | struct net_local *tp = netdev_priv(dev); |
605 | int err; | 607 | netdev_tx_t rc; |
606 | 608 | ||
607 | err = tms380tr_hardware_send_packet(skb, dev); | 609 | rc = tms380tr_hardware_send_packet(skb, dev); |
608 | if(tp->TplFree->NextTPLPtr->BusyFlag) | 610 | if(tp->TplFree->NextTPLPtr->BusyFlag) |
609 | netif_stop_queue(dev); | 611 | netif_stop_queue(dev); |
610 | return (err); | 612 | return rc; |
611 | } | 613 | } |
612 | 614 | ||
613 | /* | 615 | /* |
614 | * Move frames into adapter tx queue | 616 | * Move frames into adapter tx queue |
615 | */ | 617 | */ |
616 | static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device *dev) | 618 | static netdev_tx_t tms380tr_hardware_send_packet(struct sk_buff *skb, |
619 | struct net_device *dev) | ||
617 | { | 620 | { |
618 | TPL *tpl; | 621 | TPL *tpl; |
619 | short length; | 622 | short length; |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index bc8a6b263b40..74e5ba42d38d 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -599,7 +599,8 @@ next: | |||
599 | netif_wake_queue(de->dev); | 599 | netif_wake_queue(de->dev); |
600 | } | 600 | } |
601 | 601 | ||
602 | static int de_start_xmit (struct sk_buff *skb, struct net_device *dev) | 602 | static netdev_tx_t de_start_xmit (struct sk_buff *skb, |
603 | struct net_device *dev) | ||
603 | { | 604 | { |
604 | struct de_private *de = netdev_priv(dev); | 605 | struct de_private *de = netdev_priv(dev); |
605 | unsigned int entry, tx_free; | 606 | unsigned int entry, tx_free; |
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index acfdccd44567..a8349b7200b5 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c | |||
@@ -895,7 +895,8 @@ static struct { | |||
895 | ** Public Functions | 895 | ** Public Functions |
896 | */ | 896 | */ |
897 | static int de4x5_open(struct net_device *dev); | 897 | static int de4x5_open(struct net_device *dev); |
898 | static int de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev); | 898 | static netdev_tx_t de4x5_queue_pkt(struct sk_buff *skb, |
899 | struct net_device *dev); | ||
899 | static irqreturn_t de4x5_interrupt(int irq, void *dev_id); | 900 | static irqreturn_t de4x5_interrupt(int irq, void *dev_id); |
900 | static int de4x5_close(struct net_device *dev); | 901 | static int de4x5_close(struct net_device *dev); |
901 | static struct net_device_stats *de4x5_get_stats(struct net_device *dev); | 902 | static struct net_device_stats *de4x5_get_stats(struct net_device *dev); |
@@ -1456,18 +1457,16 @@ de4x5_sw_reset(struct net_device *dev) | |||
1456 | /* | 1457 | /* |
1457 | ** Writes a socket buffer address to the next available transmit descriptor. | 1458 | ** Writes a socket buffer address to the next available transmit descriptor. |
1458 | */ | 1459 | */ |
1459 | static int | 1460 | static netdev_tx_t |
1460 | de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) | 1461 | de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) |
1461 | { | 1462 | { |
1462 | struct de4x5_private *lp = netdev_priv(dev); | 1463 | struct de4x5_private *lp = netdev_priv(dev); |
1463 | u_long iobase = dev->base_addr; | 1464 | u_long iobase = dev->base_addr; |
1464 | int status = NETDEV_TX_OK; | ||
1465 | u_long flags = 0; | 1465 | u_long flags = 0; |
1466 | 1466 | ||
1467 | netif_stop_queue(dev); | 1467 | netif_stop_queue(dev); |
1468 | if (!lp->tx_enable) { /* Cannot send for now */ | 1468 | if (!lp->tx_enable) /* Cannot send for now */ |
1469 | return NETDEV_TX_LOCKED; | 1469 | return NETDEV_TX_LOCKED; |
1470 | } | ||
1471 | 1470 | ||
1472 | /* | 1471 | /* |
1473 | ** Clean out the TX ring asynchronously to interrupts - sometimes the | 1472 | ** Clean out the TX ring asynchronously to interrupts - sometimes the |
@@ -1521,7 +1520,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) | |||
1521 | 1520 | ||
1522 | lp->cache.lock = 0; | 1521 | lp->cache.lock = 0; |
1523 | 1522 | ||
1524 | return status; | 1523 | return NETDEV_TX_OK; |
1525 | } | 1524 | } |
1526 | 1525 | ||
1527 | /* | 1526 | /* |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 5e15fab58c17..a45ded0538b8 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -311,7 +311,7 @@ static u8 SF_mode; /* Special Function: 1:VLAN, 2:RX Flow Control | |||
311 | 311 | ||
312 | /* function declaration ------------------------------------- */ | 312 | /* function declaration ------------------------------------- */ |
313 | static int dmfe_open(struct DEVICE *); | 313 | static int dmfe_open(struct DEVICE *); |
314 | static int dmfe_start_xmit(struct sk_buff *, struct DEVICE *); | 314 | static netdev_tx_t dmfe_start_xmit(struct sk_buff *, struct DEVICE *); |
315 | static int dmfe_stop(struct DEVICE *); | 315 | static int dmfe_stop(struct DEVICE *); |
316 | static void dmfe_set_filter_mode(struct DEVICE *); | 316 | static void dmfe_set_filter_mode(struct DEVICE *); |
317 | static const struct ethtool_ops netdev_ethtool_ops; | 317 | static const struct ethtool_ops netdev_ethtool_ops; |
@@ -661,7 +661,8 @@ static void dmfe_init_dm910x(struct DEVICE *dev) | |||
661 | * Send a packet to media from the upper layer. | 661 | * Send a packet to media from the upper layer. |
662 | */ | 662 | */ |
663 | 663 | ||
664 | static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev) | 664 | static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb, |
665 | struct DEVICE *dev) | ||
665 | { | 666 | { |
666 | struct dmfe_board_info *db = netdev_priv(dev); | 667 | struct dmfe_board_info *db = netdev_priv(dev); |
667 | struct tx_desc *txptr; | 668 | struct tx_desc *txptr; |
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 019050f273a2..b89b73c0b30b 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -256,7 +256,8 @@ const char tulip_media_cap[32] = | |||
256 | static void tulip_tx_timeout(struct net_device *dev); | 256 | static void tulip_tx_timeout(struct net_device *dev); |
257 | static void tulip_init_ring(struct net_device *dev); | 257 | static void tulip_init_ring(struct net_device *dev); |
258 | static void tulip_free_ring(struct net_device *dev); | 258 | static void tulip_free_ring(struct net_device *dev); |
259 | static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev); | 259 | static netdev_tx_t tulip_start_xmit(struct sk_buff *skb, |
260 | struct net_device *dev); | ||
260 | static int tulip_open(struct net_device *dev); | 261 | static int tulip_open(struct net_device *dev); |
261 | static int tulip_close(struct net_device *dev); | 262 | static int tulip_close(struct net_device *dev); |
262 | static void tulip_up(struct net_device *dev); | 263 | static void tulip_up(struct net_device *dev); |
@@ -645,15 +646,16 @@ static void tulip_init_ring(struct net_device *dev) | |||
645 | tp->tx_ring[i-1].buffer2 = cpu_to_le32(tp->tx_ring_dma); | 646 | tp->tx_ring[i-1].buffer2 = cpu_to_le32(tp->tx_ring_dma); |
646 | } | 647 | } |
647 | 648 | ||
648 | static int | 649 | static netdev_tx_t |
649 | tulip_start_xmit(struct sk_buff *skb, struct net_device *dev) | 650 | tulip_start_xmit(struct sk_buff *skb, struct net_device *dev) |
650 | { | 651 | { |
651 | struct tulip_private *tp = netdev_priv(dev); | 652 | struct tulip_private *tp = netdev_priv(dev); |
652 | int entry; | 653 | int entry; |
653 | u32 flag; | 654 | u32 flag; |
654 | dma_addr_t mapping; | 655 | dma_addr_t mapping; |
656 | unsigned long flags; | ||
655 | 657 | ||
656 | spin_lock_irq(&tp->lock); | 658 | spin_lock_irqsave(&tp->lock, flags); |
657 | 659 | ||
658 | /* Calculate the next Tx descriptor entry. */ | 660 | /* Calculate the next Tx descriptor entry. */ |
659 | entry = tp->cur_tx % TX_RING_SIZE; | 661 | entry = tp->cur_tx % TX_RING_SIZE; |
@@ -688,7 +690,7 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
688 | /* Trigger an immediate transmit demand. */ | 690 | /* Trigger an immediate transmit demand. */ |
689 | iowrite32(0, tp->base_addr + CSR1); | 691 | iowrite32(0, tp->base_addr + CSR1); |
690 | 692 | ||
691 | spin_unlock_irq(&tp->lock); | 693 | spin_unlock_irqrestore(&tp->lock, flags); |
692 | 694 | ||
693 | dev->trans_start = jiffies; | 695 | dev->trans_start = jiffies; |
694 | 696 | ||
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c index 9074a34eb814..c457a0ca55ad 100644 --- a/drivers/net/tulip/uli526x.c +++ b/drivers/net/tulip/uli526x.c | |||
@@ -215,7 +215,8 @@ static int mode = 8; | |||
215 | 215 | ||
216 | /* function declaration ------------------------------------- */ | 216 | /* function declaration ------------------------------------- */ |
217 | static int uli526x_open(struct net_device *); | 217 | static int uli526x_open(struct net_device *); |
218 | static int uli526x_start_xmit(struct sk_buff *, struct net_device *); | 218 | static netdev_tx_t uli526x_start_xmit(struct sk_buff *, |
219 | struct net_device *); | ||
219 | static int uli526x_stop(struct net_device *); | 220 | static int uli526x_stop(struct net_device *); |
220 | static void uli526x_set_filter_mode(struct net_device *); | 221 | static void uli526x_set_filter_mode(struct net_device *); |
221 | static const struct ethtool_ops netdev_ethtool_ops; | 222 | static const struct ethtool_ops netdev_ethtool_ops; |
@@ -567,7 +568,8 @@ static void uli526x_init(struct net_device *dev) | |||
567 | * Send a packet to media from the upper layer. | 568 | * Send a packet to media from the upper layer. |
568 | */ | 569 | */ |
569 | 570 | ||
570 | static int uli526x_start_xmit(struct sk_buff *skb, struct net_device *dev) | 571 | static netdev_tx_t uli526x_start_xmit(struct sk_buff *skb, |
572 | struct net_device *dev) | ||
571 | { | 573 | { |
572 | struct uli526x_board_info *db = netdev_priv(dev); | 574 | struct uli526x_board_info *db = netdev_priv(dev); |
573 | struct tx_desc *txptr; | 575 | struct tx_desc *txptr; |
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c index 1853530a32a2..3e59397e5386 100644 --- a/drivers/net/tulip/winbond-840.c +++ b/drivers/net/tulip/winbond-840.c | |||
@@ -333,7 +333,7 @@ static void init_registers(struct net_device *dev); | |||
333 | static void tx_timeout(struct net_device *dev); | 333 | static void tx_timeout(struct net_device *dev); |
334 | static int alloc_ringdesc(struct net_device *dev); | 334 | static int alloc_ringdesc(struct net_device *dev); |
335 | static void free_ringdesc(struct netdev_private *np); | 335 | static void free_ringdesc(struct netdev_private *np); |
336 | static int start_tx(struct sk_buff *skb, struct net_device *dev); | 336 | static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev); |
337 | static irqreturn_t intr_handler(int irq, void *dev_instance); | 337 | static irqreturn_t intr_handler(int irq, void *dev_instance); |
338 | static void netdev_error(struct net_device *dev, int intr_status); | 338 | static void netdev_error(struct net_device *dev, int intr_status); |
339 | static int netdev_rx(struct net_device *dev); | 339 | static int netdev_rx(struct net_device *dev); |
@@ -997,7 +997,7 @@ static void free_ringdesc(struct netdev_private *np) | |||
997 | 997 | ||
998 | } | 998 | } |
999 | 999 | ||
1000 | static int start_tx(struct sk_buff *skb, struct net_device *dev) | 1000 | static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev) |
1001 | { | 1001 | { |
1002 | struct netdev_private *np = netdev_priv(dev); | 1002 | struct netdev_private *np = netdev_priv(dev); |
1003 | unsigned entry; | 1003 | unsigned entry; |
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c index 22b6a239fb33..0f2ca5980c3c 100644 --- a/drivers/net/tulip/xircom_cb.c +++ b/drivers/net/tulip/xircom_cb.c | |||
@@ -113,7 +113,8 @@ struct xircom_private { | |||
113 | static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id); | 113 | static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id); |
114 | static void xircom_remove(struct pci_dev *pdev); | 114 | static void xircom_remove(struct pci_dev *pdev); |
115 | static irqreturn_t xircom_interrupt(int irq, void *dev_instance); | 115 | static irqreturn_t xircom_interrupt(int irq, void *dev_instance); |
116 | static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev); | 116 | static netdev_tx_t xircom_start_xmit(struct sk_buff *skb, |
117 | struct net_device *dev); | ||
117 | static int xircom_open(struct net_device *dev); | 118 | static int xircom_open(struct net_device *dev); |
118 | static int xircom_close(struct net_device *dev); | 119 | static int xircom_close(struct net_device *dev); |
119 | static void xircom_up(struct xircom_private *card); | 120 | static void xircom_up(struct xircom_private *card); |
@@ -384,7 +385,8 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance) | |||
384 | return IRQ_HANDLED; | 385 | return IRQ_HANDLED; |
385 | } | 386 | } |
386 | 387 | ||
387 | static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev) | 388 | static netdev_tx_t xircom_start_xmit(struct sk_buff *skb, |
389 | struct net_device *dev) | ||
388 | { | 390 | { |
389 | struct xircom_private *card; | 391 | struct xircom_private *card; |
390 | unsigned long flags; | 392 | unsigned long flags; |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 2533f5cf2e4b..589a44acdc76 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -103,13 +103,10 @@ struct tun_struct { | |||
103 | uid_t owner; | 103 | uid_t owner; |
104 | gid_t group; | 104 | gid_t group; |
105 | 105 | ||
106 | struct sk_buff_head readq; | ||
107 | |||
108 | struct net_device *dev; | 106 | struct net_device *dev; |
109 | struct fasync_struct *fasync; | 107 | struct fasync_struct *fasync; |
110 | 108 | ||
111 | struct tap_filter txflt; | 109 | struct tap_filter txflt; |
112 | struct sock *sk; | ||
113 | struct socket socket; | 110 | struct socket socket; |
114 | 111 | ||
115 | #ifdef TUN_DEBUG | 112 | #ifdef TUN_DEBUG |
@@ -155,7 +152,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file) | |||
155 | tfile->tun = tun; | 152 | tfile->tun = tun; |
156 | tun->tfile = tfile; | 153 | tun->tfile = tfile; |
157 | dev_hold(tun->dev); | 154 | dev_hold(tun->dev); |
158 | sock_hold(tun->sk); | 155 | sock_hold(tun->socket.sk); |
159 | atomic_inc(&tfile->count); | 156 | atomic_inc(&tfile->count); |
160 | 157 | ||
161 | out: | 158 | out: |
@@ -171,7 +168,7 @@ static void __tun_detach(struct tun_struct *tun) | |||
171 | netif_tx_unlock_bh(tun->dev); | 168 | netif_tx_unlock_bh(tun->dev); |
172 | 169 | ||
173 | /* Drop read queue */ | 170 | /* Drop read queue */ |
174 | skb_queue_purge(&tun->readq); | 171 | skb_queue_purge(&tun->socket.sk->sk_receive_queue); |
175 | 172 | ||
176 | /* Drop the extra count on the net device */ | 173 | /* Drop the extra count on the net device */ |
177 | dev_put(tun->dev); | 174 | dev_put(tun->dev); |
@@ -340,7 +337,7 @@ static void tun_free_netdev(struct net_device *dev) | |||
340 | { | 337 | { |
341 | struct tun_struct *tun = netdev_priv(dev); | 338 | struct tun_struct *tun = netdev_priv(dev); |
342 | 339 | ||
343 | sock_put(tun->sk); | 340 | sock_put(tun->socket.sk); |
344 | } | 341 | } |
345 | 342 | ||
346 | /* Net device open. */ | 343 | /* Net device open. */ |
@@ -358,7 +355,7 @@ static int tun_net_close(struct net_device *dev) | |||
358 | } | 355 | } |
359 | 356 | ||
360 | /* Net device start xmit */ | 357 | /* Net device start xmit */ |
361 | static int tun_net_xmit(struct sk_buff *skb, struct net_device *dev) | 358 | static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) |
362 | { | 359 | { |
363 | struct tun_struct *tun = netdev_priv(dev); | 360 | struct tun_struct *tun = netdev_priv(dev); |
364 | 361 | ||
@@ -374,7 +371,7 @@ static int tun_net_xmit(struct sk_buff *skb, struct net_device *dev) | |||
374 | if (!check_filter(&tun->txflt, skb)) | 371 | if (!check_filter(&tun->txflt, skb)) |
375 | goto drop; | 372 | goto drop; |
376 | 373 | ||
377 | if (skb_queue_len(&tun->readq) >= dev->tx_queue_len) { | 374 | if (skb_queue_len(&tun->socket.sk->sk_receive_queue) >= dev->tx_queue_len) { |
378 | if (!(tun->flags & TUN_ONE_QUEUE)) { | 375 | if (!(tun->flags & TUN_ONE_QUEUE)) { |
379 | /* Normal queueing mode. */ | 376 | /* Normal queueing mode. */ |
380 | /* Packet scheduler handles dropping of further packets. */ | 377 | /* Packet scheduler handles dropping of further packets. */ |
@@ -391,7 +388,7 @@ static int tun_net_xmit(struct sk_buff *skb, struct net_device *dev) | |||
391 | } | 388 | } |
392 | 389 | ||
393 | /* Enqueue packet */ | 390 | /* Enqueue packet */ |
394 | skb_queue_tail(&tun->readq, skb); | 391 | skb_queue_tail(&tun->socket.sk->sk_receive_queue, skb); |
395 | dev->trans_start = jiffies; | 392 | dev->trans_start = jiffies; |
396 | 393 | ||
397 | /* Notify and wake up reader process */ | 394 | /* Notify and wake up reader process */ |
@@ -492,13 +489,13 @@ static unsigned int tun_chr_poll(struct file *file, poll_table * wait) | |||
492 | if (!tun) | 489 | if (!tun) |
493 | return POLLERR; | 490 | return POLLERR; |
494 | 491 | ||
495 | sk = tun->sk; | 492 | sk = tun->socket.sk; |
496 | 493 | ||
497 | DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name); | 494 | DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name); |
498 | 495 | ||
499 | poll_wait(file, &tun->socket.wait, wait); | 496 | poll_wait(file, &tun->socket.wait, wait); |
500 | 497 | ||
501 | if (!skb_queue_empty(&tun->readq)) | 498 | if (!skb_queue_empty(&sk->sk_receive_queue)) |
502 | mask |= POLLIN | POLLRDNORM; | 499 | mask |= POLLIN | POLLRDNORM; |
503 | 500 | ||
504 | if (sock_writeable(sk) || | 501 | if (sock_writeable(sk) || |
@@ -519,7 +516,7 @@ static inline struct sk_buff *tun_alloc_skb(struct tun_struct *tun, | |||
519 | size_t prepad, size_t len, | 516 | size_t prepad, size_t len, |
520 | size_t linear, int noblock) | 517 | size_t linear, int noblock) |
521 | { | 518 | { |
522 | struct sock *sk = tun->sk; | 519 | struct sock *sk = tun->socket.sk; |
523 | struct sk_buff *skb; | 520 | struct sk_buff *skb; |
524 | int err; | 521 | int err; |
525 | 522 | ||
@@ -787,7 +784,7 @@ static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv, | |||
787 | current->state = TASK_INTERRUPTIBLE; | 784 | current->state = TASK_INTERRUPTIBLE; |
788 | 785 | ||
789 | /* Read frames from the queue */ | 786 | /* Read frames from the queue */ |
790 | if (!(skb=skb_dequeue(&tun->readq))) { | 787 | if (!(skb=skb_dequeue(&tun->socket.sk->sk_receive_queue))) { |
791 | if (file->f_flags & O_NONBLOCK) { | 788 | if (file->f_flags & O_NONBLOCK) { |
792 | ret = -EAGAIN; | 789 | ret = -EAGAIN; |
793 | break; | 790 | break; |
@@ -824,8 +821,6 @@ static void tun_setup(struct net_device *dev) | |||
824 | { | 821 | { |
825 | struct tun_struct *tun = netdev_priv(dev); | 822 | struct tun_struct *tun = netdev_priv(dev); |
826 | 823 | ||
827 | skb_queue_head_init(&tun->readq); | ||
828 | |||
829 | tun->owner = -1; | 824 | tun->owner = -1; |
830 | tun->group = -1; | 825 | tun->group = -1; |
831 | 826 | ||
@@ -991,7 +986,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) | |||
991 | sk->sk_write_space = tun_sock_write_space; | 986 | sk->sk_write_space = tun_sock_write_space; |
992 | sk->sk_sndbuf = INT_MAX; | 987 | sk->sk_sndbuf = INT_MAX; |
993 | 988 | ||
994 | tun->sk = sk; | ||
995 | container_of(sk, struct tun_sock, sk)->tun = tun; | 989 | container_of(sk, struct tun_sock, sk)->tun = tun; |
996 | 990 | ||
997 | tun_net_init(dev); | 991 | tun_net_init(dev); |
@@ -1249,7 +1243,7 @@ static long tun_chr_ioctl(struct file *file, unsigned int cmd, | |||
1249 | break; | 1243 | break; |
1250 | 1244 | ||
1251 | case TUNGETSNDBUF: | 1245 | case TUNGETSNDBUF: |
1252 | sndbuf = tun->sk->sk_sndbuf; | 1246 | sndbuf = tun->socket.sk->sk_sndbuf; |
1253 | if (copy_to_user(argp, &sndbuf, sizeof(sndbuf))) | 1247 | if (copy_to_user(argp, &sndbuf, sizeof(sndbuf))) |
1254 | ret = -EFAULT; | 1248 | ret = -EFAULT; |
1255 | break; | 1249 | break; |
@@ -1260,7 +1254,7 @@ static long tun_chr_ioctl(struct file *file, unsigned int cmd, | |||
1260 | break; | 1254 | break; |
1261 | } | 1255 | } |
1262 | 1256 | ||
1263 | tun->sk->sk_sndbuf = sndbuf; | 1257 | tun->socket.sk->sk_sndbuf = sndbuf; |
1264 | break; | 1258 | break; |
1265 | 1259 | ||
1266 | default: | 1260 | default: |
@@ -1343,7 +1337,7 @@ static int tun_chr_close(struct inode *inode, struct file *file) | |||
1343 | 1337 | ||
1344 | tun = tfile->tun; | 1338 | tun = tfile->tun; |
1345 | if (tun) | 1339 | if (tun) |
1346 | sock_put(tun->sk); | 1340 | sock_put(tun->socket.sk); |
1347 | 1341 | ||
1348 | put_net(tfile->net); | 1342 | put_net(tfile->net); |
1349 | kfree(tfile); | 1343 | kfree(tfile); |
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 2c26b4577e8a..d6d345229fe9 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -762,7 +762,7 @@ typhoon_tso_fill(struct sk_buff *skb, struct transmit_ring *txRing, | |||
762 | tcpd->status = 0; | 762 | tcpd->status = 0; |
763 | } | 763 | } |
764 | 764 | ||
765 | static int | 765 | static netdev_tx_t |
766 | typhoon_start_tx(struct sk_buff *skb, struct net_device *dev) | 766 | typhoon_start_tx(struct sk_buff *skb, struct net_device *dev) |
767 | { | 767 | { |
768 | struct typhoon *tp = netdev_priv(dev); | 768 | struct typhoon *tp = netdev_priv(dev); |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 7fb96f33bade..3b647d07e410 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -3084,10 +3084,11 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3084 | u8 __iomem *bd; /* BD pointer */ | 3084 | u8 __iomem *bd; /* BD pointer */ |
3085 | u32 bd_status; | 3085 | u32 bd_status; |
3086 | u8 txQ = 0; | 3086 | u8 txQ = 0; |
3087 | unsigned long flags; | ||
3087 | 3088 | ||
3088 | ugeth_vdbg("%s: IN", __func__); | 3089 | ugeth_vdbg("%s: IN", __func__); |
3089 | 3090 | ||
3090 | spin_lock_irq(&ugeth->lock); | 3091 | spin_lock_irqsave(&ugeth->lock, flags); |
3091 | 3092 | ||
3092 | dev->stats.tx_bytes += skb->len; | 3093 | dev->stats.tx_bytes += skb->len; |
3093 | 3094 | ||
@@ -3144,7 +3145,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3144 | uccf = ugeth->uccf; | 3145 | uccf = ugeth->uccf; |
3145 | out_be16(uccf->p_utodr, UCC_FAST_TOD); | 3146 | out_be16(uccf->p_utodr, UCC_FAST_TOD); |
3146 | #endif | 3147 | #endif |
3147 | spin_unlock_irq(&ugeth->lock); | 3148 | spin_unlock_irqrestore(&ugeth->lock, flags); |
3148 | 3149 | ||
3149 | return NETDEV_TX_OK; | 3150 | return NETDEV_TX_OK; |
3150 | } | 3151 | } |
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 87b4a0289919..6ce7f775bb74 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -731,7 +731,7 @@ static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd) | |||
731 | /* We need to override some ethtool_ops so we require our | 731 | /* We need to override some ethtool_ops so we require our |
732 | own structure so we don't interfere with other usbnet | 732 | own structure so we don't interfere with other usbnet |
733 | devices that may be connected at the same time. */ | 733 | devices that may be connected at the same time. */ |
734 | static struct ethtool_ops ax88172_ethtool_ops = { | 734 | static const struct ethtool_ops ax88172_ethtool_ops = { |
735 | .get_drvinfo = asix_get_drvinfo, | 735 | .get_drvinfo = asix_get_drvinfo, |
736 | .get_link = asix_get_link, | 736 | .get_link = asix_get_link, |
737 | .get_msglevel = usbnet_get_msglevel, | 737 | .get_msglevel = usbnet_get_msglevel, |
@@ -873,7 +873,7 @@ out: | |||
873 | return ret; | 873 | return ret; |
874 | } | 874 | } |
875 | 875 | ||
876 | static struct ethtool_ops ax88772_ethtool_ops = { | 876 | static const struct ethtool_ops ax88772_ethtool_ops = { |
877 | .get_drvinfo = asix_get_drvinfo, | 877 | .get_drvinfo = asix_get_drvinfo, |
878 | .get_link = asix_get_link, | 878 | .get_link = asix_get_link, |
879 | .get_msglevel = usbnet_get_msglevel, | 879 | .get_msglevel = usbnet_get_msglevel, |
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c index 7abdc4abbe07..2bed6b087d16 100644 --- a/drivers/net/usb/catc.c +++ b/drivers/net/usb/catc.c | |||
@@ -411,7 +411,8 @@ static void catc_tx_done(struct urb *urb) | |||
411 | spin_unlock_irqrestore(&catc->tx_lock, flags); | 411 | spin_unlock_irqrestore(&catc->tx_lock, flags); |
412 | } | 412 | } |
413 | 413 | ||
414 | static int catc_start_xmit(struct sk_buff *skb, struct net_device *netdev) | 414 | static netdev_tx_t catc_start_xmit(struct sk_buff *skb, |
415 | struct net_device *netdev) | ||
415 | { | 416 | { |
416 | struct catc *catc = netdev_priv(netdev); | 417 | struct catc *catc = netdev_priv(netdev); |
417 | unsigned long flags; | 418 | unsigned long flags; |
@@ -697,7 +698,7 @@ static int catc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
697 | return 0; | 698 | return 0; |
698 | } | 699 | } |
699 | 700 | ||
700 | static struct ethtool_ops ops = { | 701 | static const struct ethtool_ops ops = { |
701 | .get_drvinfo = catc_get_drvinfo, | 702 | .get_drvinfo = catc_get_drvinfo, |
702 | .get_settings = catc_get_settings, | 703 | .get_settings = catc_get_settings, |
703 | .get_link = ethtool_op_get_link | 704 | .get_link = ethtool_op_get_link |
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 792af72da8ac..0ca5916ca8df 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c | |||
@@ -55,7 +55,7 @@ static void rx_complete(struct urb *req); | |||
55 | /* | 55 | /* |
56 | * Network device callbacks | 56 | * Network device callbacks |
57 | */ | 57 | */ |
58 | static int usbpn_xmit(struct sk_buff *skb, struct net_device *dev) | 58 | static netdev_tx_t usbpn_xmit(struct sk_buff *skb, struct net_device *dev) |
59 | { | 59 | { |
60 | struct usbpn_dev *pnd = netdev_priv(dev); | 60 | struct usbpn_dev *pnd = netdev_priv(dev); |
61 | struct urb *req = NULL; | 61 | struct urb *req = NULL; |
@@ -82,12 +82,12 @@ static int usbpn_xmit(struct sk_buff *skb, struct net_device *dev) | |||
82 | if (pnd->tx_queue >= dev->tx_queue_len) | 82 | if (pnd->tx_queue >= dev->tx_queue_len) |
83 | netif_stop_queue(dev); | 83 | netif_stop_queue(dev); |
84 | spin_unlock_irqrestore(&pnd->tx_lock, flags); | 84 | spin_unlock_irqrestore(&pnd->tx_lock, flags); |
85 | return 0; | 85 | return NETDEV_TX_OK; |
86 | 86 | ||
87 | drop: | 87 | drop: |
88 | dev_kfree_skb(skb); | 88 | dev_kfree_skb(skb); |
89 | dev->stats.tx_dropped++; | 89 | dev->stats.tx_dropped++; |
90 | return 0; | 90 | return NETDEV_TX_OK; |
91 | } | 91 | } |
92 | 92 | ||
93 | static void tx_complete(struct urb *req) | 93 | static void tx_complete(struct urb *req) |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 1d3730d6690f..72470f77f556 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -356,7 +356,7 @@ static int dm9601_ioctl(struct net_device *net, struct ifreq *rq, int cmd) | |||
356 | return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); | 356 | return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); |
357 | } | 357 | } |
358 | 358 | ||
359 | static struct ethtool_ops dm9601_ethtool_ops = { | 359 | static const struct ethtool_ops dm9601_ethtool_ops = { |
360 | .get_drvinfo = dm9601_get_drvinfo, | 360 | .get_drvinfo = dm9601_get_drvinfo, |
361 | .get_link = dm9601_get_link, | 361 | .get_link = dm9601_get_link, |
362 | .get_msglevel = usbnet_get_msglevel, | 362 | .get_msglevel = usbnet_get_msglevel, |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index ffe410635735..3f9c92a2afcb 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -771,7 +771,8 @@ static void write_bulk_callback(struct urb *urb) | |||
771 | } | 771 | } |
772 | 772 | ||
773 | /* called by kernel when we need to transmit a packet */ | 773 | /* called by kernel when we need to transmit a packet */ |
774 | static int hso_net_start_xmit(struct sk_buff *skb, struct net_device *net) | 774 | static netdev_tx_t hso_net_start_xmit(struct sk_buff *skb, |
775 | struct net_device *net) | ||
775 | { | 776 | { |
776 | struct hso_net *odev = netdev_priv(net); | 777 | struct hso_net *odev = netdev_priv(net); |
777 | int result; | 778 | int result; |
@@ -828,7 +829,7 @@ static void hso_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info | |||
828 | usb_make_path(odev->parent->usb, info->bus_info, sizeof info->bus_info); | 829 | usb_make_path(odev->parent->usb, info->bus_info, sizeof info->bus_info); |
829 | } | 830 | } |
830 | 831 | ||
831 | static struct ethtool_ops ops = { | 832 | static const struct ethtool_ops ops = { |
832 | .get_drvinfo = hso_get_drvinfo, | 833 | .get_drvinfo = hso_get_drvinfo, |
833 | .get_link = ethtool_op_get_link | 834 | .get_link = ethtool_op_get_link |
834 | }; | 835 | }; |
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index 200fe3d525ca..e2a39b9be96e 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
@@ -778,7 +778,7 @@ static u32 kaweth_get_link(struct net_device *dev) | |||
778 | return kaweth->linkstate; | 778 | return kaweth->linkstate; |
779 | } | 779 | } |
780 | 780 | ||
781 | static struct ethtool_ops ops = { | 781 | static const struct ethtool_ops ops = { |
782 | .get_drvinfo = kaweth_get_drvinfo, | 782 | .get_drvinfo = kaweth_get_drvinfo, |
783 | .get_link = kaweth_get_link | 783 | .get_link = kaweth_get_link |
784 | }; | 784 | }; |
@@ -803,7 +803,8 @@ static void kaweth_usb_transmit_complete(struct urb *urb) | |||
803 | /**************************************************************** | 803 | /**************************************************************** |
804 | * kaweth_start_xmit | 804 | * kaweth_start_xmit |
805 | ****************************************************************/ | 805 | ****************************************************************/ |
806 | static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net) | 806 | static netdev_tx_t kaweth_start_xmit(struct sk_buff *skb, |
807 | struct net_device *net) | ||
807 | { | 808 | { |
808 | struct kaweth_device *kaweth = netdev_priv(net); | 809 | struct kaweth_device *kaweth = netdev_priv(net); |
809 | __le16 *private_header; | 810 | __le16 *private_header; |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index 7ae9afe99a4f..10873d96b2da 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -449,7 +449,7 @@ static void mcs7830_get_regs(struct net_device *net, struct ethtool_regs *regs, | |||
449 | mcs7830_get_reg(dev, 0, regs->len, data); | 449 | mcs7830_get_reg(dev, 0, regs->len, data); |
450 | } | 450 | } |
451 | 451 | ||
452 | static struct ethtool_ops mcs7830_ethtool_ops = { | 452 | static const struct ethtool_ops mcs7830_ethtool_ops = { |
453 | .get_drvinfo = mcs7830_get_drvinfo, | 453 | .get_drvinfo = mcs7830_get_drvinfo, |
454 | .get_regs_len = mcs7830_get_regs_len, | 454 | .get_regs_len = mcs7830_get_regs_len, |
455 | .get_regs = mcs7830_get_regs, | 455 | .get_regs = mcs7830_get_regs, |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 69d2df95ac86..6fdaba8674b9 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -876,7 +876,8 @@ static void pegasus_tx_timeout(struct net_device *net) | |||
876 | pegasus->stats.tx_errors++; | 876 | pegasus->stats.tx_errors++; |
877 | } | 877 | } |
878 | 878 | ||
879 | static int pegasus_start_xmit(struct sk_buff *skb, struct net_device *net) | 879 | static netdev_tx_t pegasus_start_xmit(struct sk_buff *skb, |
880 | struct net_device *net) | ||
880 | { | 881 | { |
881 | pegasus_t *pegasus = netdev_priv(net); | 882 | pegasus_t *pegasus = netdev_priv(net); |
882 | int count = ((skb->len + 2) & 0x3f) ? skb->len + 2 : skb->len + 3; | 883 | int count = ((skb->len + 2) & 0x3f) ? skb->len + 2 : skb->len + 3; |
@@ -1173,7 +1174,7 @@ static void pegasus_set_msglevel(struct net_device *dev, u32 v) | |||
1173 | pegasus->msg_enable = v; | 1174 | pegasus->msg_enable = v; |
1174 | } | 1175 | } |
1175 | 1176 | ||
1176 | static struct ethtool_ops ops = { | 1177 | static const struct ethtool_ops ops = { |
1177 | .get_drvinfo = pegasus_get_drvinfo, | 1178 | .get_drvinfo = pegasus_get_drvinfo, |
1178 | .get_settings = pegasus_get_settings, | 1179 | .get_settings = pegasus_get_settings, |
1179 | .set_settings = pegasus_set_settings, | 1180 | .set_settings = pegasus_set_settings, |
diff --git a/drivers/net/usb/pegasus.h b/drivers/net/usb/pegasus.h index c7467823cd1c..f968c834ff63 100644 --- a/drivers/net/usb/pegasus.h +++ b/drivers/net/usb/pegasus.h | |||
@@ -250,6 +250,8 @@ PEGASUS_DEV( "IO DATA USB ET/TX", VENDOR_IODATA, 0x0904, | |||
250 | DEFAULT_GPIO_RESET ) | 250 | DEFAULT_GPIO_RESET ) |
251 | PEGASUS_DEV( "IO DATA USB ET/TX-S", VENDOR_IODATA, 0x0913, | 251 | PEGASUS_DEV( "IO DATA USB ET/TX-S", VENDOR_IODATA, 0x0913, |
252 | DEFAULT_GPIO_RESET | PEGASUS_II ) | 252 | DEFAULT_GPIO_RESET | PEGASUS_II ) |
253 | PEGASUS_DEV( "IO DATA USB ETX-US2", VENDOR_IODATA, 0x092a, | ||
254 | DEFAULT_GPIO_RESET | PEGASUS_II ) | ||
253 | PEGASUS_DEV( "Kingston KNU101TX Ethernet", VENDOR_KINGSTON, 0x000a, | 255 | PEGASUS_DEV( "Kingston KNU101TX Ethernet", VENDOR_KINGSTON, 0x000a, |
254 | DEFAULT_GPIO_RESET) | 256 | DEFAULT_GPIO_RESET) |
255 | PEGASUS_DEV( "LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x4002, | 257 | PEGASUS_DEV( "LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x4002, |
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index bac8b77fb25e..b091e20ca167 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c | |||
@@ -727,7 +727,8 @@ static void rtl8150_set_multicast(struct net_device *netdev) | |||
727 | netif_wake_queue(netdev); | 727 | netif_wake_queue(netdev); |
728 | } | 728 | } |
729 | 729 | ||
730 | static int rtl8150_start_xmit(struct sk_buff *skb, struct net_device *netdev) | 730 | static netdev_tx_t rtl8150_start_xmit(struct sk_buff *skb, |
731 | struct net_device *netdev) | ||
731 | { | 732 | { |
732 | rtl8150_t *dev = netdev_priv(netdev); | 733 | rtl8150_t *dev = netdev_priv(netdev); |
733 | int count, res; | 734 | int count, res; |
@@ -864,7 +865,7 @@ static int rtl8150_get_settings(struct net_device *netdev, struct ethtool_cmd *e | |||
864 | return 0; | 865 | return 0; |
865 | } | 866 | } |
866 | 867 | ||
867 | static struct ethtool_ops ops = { | 868 | static const struct ethtool_ops ops = { |
868 | .get_drvinfo = rtl8150_get_drvinfo, | 869 | .get_drvinfo = rtl8150_get_drvinfo, |
869 | .get_settings = rtl8150_get_settings, | 870 | .get_settings = rtl8150_get_settings, |
870 | .get_link = ethtool_op_get_link | 871 | .get_link = ethtool_op_get_link |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 09bd6351f64c..938fb3530a7a 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -625,7 +625,7 @@ static int smsc95xx_ethtool_set_tx_csum(struct net_device *netdev, u32 val) | |||
625 | return smsc95xx_set_csums(dev); | 625 | return smsc95xx_set_csums(dev); |
626 | } | 626 | } |
627 | 627 | ||
628 | static struct ethtool_ops smsc95xx_ethtool_ops = { | 628 | static const struct ethtool_ops smsc95xx_ethtool_ops = { |
629 | .get_link = usbnet_get_link, | 629 | .get_link = usbnet_get_link, |
630 | .nway_reset = usbnet_nway_reset, | 630 | .nway_reset = usbnet_nway_reset, |
631 | .get_drvinfo = usbnet_get_drvinfo, | 631 | .get_drvinfo = usbnet_get_drvinfo, |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 7d471fca2743..24b36f795151 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -854,7 +854,7 @@ void usbnet_set_msglevel (struct net_device *net, u32 level) | |||
854 | EXPORT_SYMBOL_GPL(usbnet_set_msglevel); | 854 | EXPORT_SYMBOL_GPL(usbnet_set_msglevel); |
855 | 855 | ||
856 | /* drivers may override default ethtool_ops in their bind() routine */ | 856 | /* drivers may override default ethtool_ops in their bind() routine */ |
857 | static struct ethtool_ops usbnet_ethtool_ops = { | 857 | static const struct ethtool_ops usbnet_ethtool_ops = { |
858 | .get_settings = usbnet_get_settings, | 858 | .get_settings = usbnet_get_settings, |
859 | .set_settings = usbnet_set_settings, | 859 | .set_settings = usbnet_set_settings, |
860 | .get_link = usbnet_get_link, | 860 | .get_link = usbnet_get_link, |
@@ -1007,15 +1007,16 @@ EXPORT_SYMBOL_GPL(usbnet_tx_timeout); | |||
1007 | 1007 | ||
1008 | /*-------------------------------------------------------------------------*/ | 1008 | /*-------------------------------------------------------------------------*/ |
1009 | 1009 | ||
1010 | int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net) | 1010 | netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, |
1011 | struct net_device *net) | ||
1011 | { | 1012 | { |
1012 | struct usbnet *dev = netdev_priv(net); | 1013 | struct usbnet *dev = netdev_priv(net); |
1013 | int length; | 1014 | int length; |
1014 | int retval = NET_XMIT_SUCCESS; | ||
1015 | struct urb *urb = NULL; | 1015 | struct urb *urb = NULL; |
1016 | struct skb_data *entry; | 1016 | struct skb_data *entry; |
1017 | struct driver_info *info = dev->driver_info; | 1017 | struct driver_info *info = dev->driver_info; |
1018 | unsigned long flags; | 1018 | unsigned long flags; |
1019 | int retval; | ||
1019 | 1020 | ||
1020 | // some devices want funky USB-level framing, for | 1021 | // some devices want funky USB-level framing, for |
1021 | // win32 driver (usually) and/or hardware quirks | 1022 | // win32 driver (usually) and/or hardware quirks |
@@ -1079,7 +1080,6 @@ int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net) | |||
1079 | if (netif_msg_tx_err (dev)) | 1080 | if (netif_msg_tx_err (dev)) |
1080 | devdbg (dev, "drop, code %d", retval); | 1081 | devdbg (dev, "drop, code %d", retval); |
1081 | drop: | 1082 | drop: |
1082 | retval = NET_XMIT_SUCCESS; | ||
1083 | dev->net->stats.tx_dropped++; | 1083 | dev->net->stats.tx_dropped++; |
1084 | if (skb) | 1084 | if (skb) |
1085 | dev_kfree_skb_any (skb); | 1085 | dev_kfree_skb_any (skb); |
@@ -1088,7 +1088,7 @@ drop: | |||
1088 | devdbg (dev, "> tx, len %d, type 0x%x", | 1088 | devdbg (dev, "> tx, len %d, type 0x%x", |
1089 | length, skb->protocol); | 1089 | length, skb->protocol); |
1090 | } | 1090 | } |
1091 | return retval; | 1091 | return NETDEV_TX_OK; |
1092 | } | 1092 | } |
1093 | EXPORT_SYMBOL_GPL(usbnet_start_xmit); | 1093 | EXPORT_SYMBOL_GPL(usbnet_start_xmit); |
1094 | 1094 | ||
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 190f784c9cfe..ade5b344f75d 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -129,7 +129,7 @@ static int veth_set_tx_csum(struct net_device *dev, u32 data) | |||
129 | return 0; | 129 | return 0; |
130 | } | 130 | } |
131 | 131 | ||
132 | static struct ethtool_ops veth_ethtool_ops = { | 132 | static const struct ethtool_ops veth_ethtool_ops = { |
133 | .get_settings = veth_get_settings, | 133 | .get_settings = veth_get_settings, |
134 | .get_drvinfo = veth_get_drvinfo, | 134 | .get_drvinfo = veth_get_drvinfo, |
135 | .get_link = ethtool_op_get_link, | 135 | .get_link = ethtool_op_get_link, |
@@ -148,7 +148,7 @@ static struct ethtool_ops veth_ethtool_ops = { | |||
148 | * xmit | 148 | * xmit |
149 | */ | 149 | */ |
150 | 150 | ||
151 | static int veth_xmit(struct sk_buff *skb, struct net_device *dev) | 151 | static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) |
152 | { | 152 | { |
153 | struct net_device *rcv = NULL; | 153 | struct net_device *rcv = NULL; |
154 | struct veth_priv *priv, *rcv_priv; | 154 | struct veth_priv *priv, *rcv_priv; |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index 46eb618bbc90..1fd70583be44 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -408,7 +408,8 @@ static int mdio_read(struct net_device *dev, int phy_id, int location); | |||
408 | static void mdio_write(struct net_device *dev, int phy_id, int location, int value); | 408 | static void mdio_write(struct net_device *dev, int phy_id, int location, int value); |
409 | static int rhine_open(struct net_device *dev); | 409 | static int rhine_open(struct net_device *dev); |
410 | static void rhine_tx_timeout(struct net_device *dev); | 410 | static void rhine_tx_timeout(struct net_device *dev); |
411 | static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev); | 411 | static netdev_tx_t rhine_start_tx(struct sk_buff *skb, |
412 | struct net_device *dev); | ||
412 | static irqreturn_t rhine_interrupt(int irq, void *dev_instance); | 413 | static irqreturn_t rhine_interrupt(int irq, void *dev_instance); |
413 | static void rhine_tx(struct net_device *dev); | 414 | static void rhine_tx(struct net_device *dev); |
414 | static int rhine_rx(struct net_device *dev, int limit); | 415 | static int rhine_rx(struct net_device *dev, int limit); |
@@ -1213,11 +1214,13 @@ static void rhine_tx_timeout(struct net_device *dev) | |||
1213 | netif_wake_queue(dev); | 1214 | netif_wake_queue(dev); |
1214 | } | 1215 | } |
1215 | 1216 | ||
1216 | static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev) | 1217 | static netdev_tx_t rhine_start_tx(struct sk_buff *skb, |
1218 | struct net_device *dev) | ||
1217 | { | 1219 | { |
1218 | struct rhine_private *rp = netdev_priv(dev); | 1220 | struct rhine_private *rp = netdev_priv(dev); |
1219 | void __iomem *ioaddr = rp->base; | 1221 | void __iomem *ioaddr = rp->base; |
1220 | unsigned entry; | 1222 | unsigned entry; |
1223 | unsigned long flags; | ||
1221 | 1224 | ||
1222 | /* Caution: the write order is important here, set the field | 1225 | /* Caution: the write order is important here, set the field |
1223 | with the "ownership" bits last. */ | 1226 | with the "ownership" bits last. */ |
@@ -1261,7 +1264,7 @@ static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
1261 | cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN)); | 1264 | cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN)); |
1262 | 1265 | ||
1263 | /* lock eth irq */ | 1266 | /* lock eth irq */ |
1264 | spin_lock_irq(&rp->lock); | 1267 | spin_lock_irqsave(&rp->lock, flags); |
1265 | wmb(); | 1268 | wmb(); |
1266 | rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn); | 1269 | rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn); |
1267 | wmb(); | 1270 | wmb(); |
@@ -1280,7 +1283,7 @@ static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
1280 | 1283 | ||
1281 | dev->trans_start = jiffies; | 1284 | dev->trans_start = jiffies; |
1282 | 1285 | ||
1283 | spin_unlock_irq(&rp->lock); | 1286 | spin_unlock_irqrestore(&rp->lock, flags); |
1284 | 1287 | ||
1285 | if (debug > 4) { | 1288 | if (debug > 4) { |
1286 | printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d.\n", | 1289 | printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d.\n", |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 47be41a39d35..ced1446dec04 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1789,7 +1789,7 @@ static void velocity_error(struct velocity_info *vptr, int status) | |||
1789 | * mode | 1789 | * mode |
1790 | */ | 1790 | */ |
1791 | if (vptr->rev_id < REV_ID_VT3216_A0) { | 1791 | if (vptr->rev_id < REV_ID_VT3216_A0) { |
1792 | if (vptr->mii_status | VELOCITY_DUPLEX_FULL) | 1792 | if (vptr->mii_status & VELOCITY_DUPLEX_FULL) |
1793 | BYTE_REG_BITS_ON(TCR_TB2BDIS, ®s->TCR); | 1793 | BYTE_REG_BITS_ON(TCR_TB2BDIS, ®s->TCR); |
1794 | else | 1794 | else |
1795 | BYTE_REG_BITS_OFF(TCR_TB2BDIS, ®s->TCR); | 1795 | BYTE_REG_BITS_OFF(TCR_TB2BDIS, ®s->TCR); |
@@ -2465,7 +2465,8 @@ static int velocity_close(struct net_device *dev) | |||
2465 | * Called by the networ layer to request a packet is queued to | 2465 | * Called by the networ layer to request a packet is queued to |
2466 | * the velocity. Returns zero on success. | 2466 | * the velocity. Returns zero on success. |
2467 | */ | 2467 | */ |
2468 | static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) | 2468 | static netdev_tx_t velocity_xmit(struct sk_buff *skb, |
2469 | struct net_device *dev) | ||
2469 | { | 2470 | { |
2470 | struct velocity_info *vptr = netdev_priv(dev); | 2471 | struct velocity_info *vptr = netdev_priv(dev); |
2471 | int qnum = 0; | 2472 | int qnum = 0; |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index a6f903f00924..32266fb89c20 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -70,6 +70,9 @@ struct virtnet_info | |||
70 | struct sk_buff_head recv; | 70 | struct sk_buff_head recv; |
71 | struct sk_buff_head send; | 71 | struct sk_buff_head send; |
72 | 72 | ||
73 | /* Work struct for refilling if we run low on memory. */ | ||
74 | struct delayed_work refill; | ||
75 | |||
73 | /* Chain pages by the private ptr. */ | 76 | /* Chain pages by the private ptr. */ |
74 | struct page *pages; | 77 | struct page *pages; |
75 | }; | 78 | }; |
@@ -273,19 +276,22 @@ drop: | |||
273 | dev_kfree_skb(skb); | 276 | dev_kfree_skb(skb); |
274 | } | 277 | } |
275 | 278 | ||
276 | static void try_fill_recv_maxbufs(struct virtnet_info *vi) | 279 | static bool try_fill_recv_maxbufs(struct virtnet_info *vi, gfp_t gfp) |
277 | { | 280 | { |
278 | struct sk_buff *skb; | 281 | struct sk_buff *skb; |
279 | struct scatterlist sg[2+MAX_SKB_FRAGS]; | 282 | struct scatterlist sg[2+MAX_SKB_FRAGS]; |
280 | int num, err, i; | 283 | int num, err, i; |
284 | bool oom = false; | ||
281 | 285 | ||
282 | sg_init_table(sg, 2+MAX_SKB_FRAGS); | 286 | sg_init_table(sg, 2+MAX_SKB_FRAGS); |
283 | for (;;) { | 287 | for (;;) { |
284 | struct virtio_net_hdr *hdr; | 288 | struct virtio_net_hdr *hdr; |
285 | 289 | ||
286 | skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN); | 290 | skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN); |
287 | if (unlikely(!skb)) | 291 | if (unlikely(!skb)) { |
292 | oom = true; | ||
288 | break; | 293 | break; |
294 | } | ||
289 | 295 | ||
290 | skb_reserve(skb, NET_IP_ALIGN); | 296 | skb_reserve(skb, NET_IP_ALIGN); |
291 | skb_put(skb, MAX_PACKET_LEN); | 297 | skb_put(skb, MAX_PACKET_LEN); |
@@ -296,7 +302,7 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi) | |||
296 | if (vi->big_packets) { | 302 | if (vi->big_packets) { |
297 | for (i = 0; i < MAX_SKB_FRAGS; i++) { | 303 | for (i = 0; i < MAX_SKB_FRAGS; i++) { |
298 | skb_frag_t *f = &skb_shinfo(skb)->frags[i]; | 304 | skb_frag_t *f = &skb_shinfo(skb)->frags[i]; |
299 | f->page = get_a_page(vi, GFP_ATOMIC); | 305 | f->page = get_a_page(vi, gfp); |
300 | if (!f->page) | 306 | if (!f->page) |
301 | break; | 307 | break; |
302 | 308 | ||
@@ -325,31 +331,35 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi) | |||
325 | if (unlikely(vi->num > vi->max)) | 331 | if (unlikely(vi->num > vi->max)) |
326 | vi->max = vi->num; | 332 | vi->max = vi->num; |
327 | vi->rvq->vq_ops->kick(vi->rvq); | 333 | vi->rvq->vq_ops->kick(vi->rvq); |
334 | return !oom; | ||
328 | } | 335 | } |
329 | 336 | ||
330 | static void try_fill_recv(struct virtnet_info *vi) | 337 | /* Returns false if we couldn't fill entirely (OOM). */ |
338 | static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) | ||
331 | { | 339 | { |
332 | struct sk_buff *skb; | 340 | struct sk_buff *skb; |
333 | struct scatterlist sg[1]; | 341 | struct scatterlist sg[1]; |
334 | int err; | 342 | int err; |
343 | bool oom = false; | ||
335 | 344 | ||
336 | if (!vi->mergeable_rx_bufs) { | 345 | if (!vi->mergeable_rx_bufs) |
337 | try_fill_recv_maxbufs(vi); | 346 | return try_fill_recv_maxbufs(vi, gfp); |
338 | return; | ||
339 | } | ||
340 | 347 | ||
341 | for (;;) { | 348 | for (;;) { |
342 | skb_frag_t *f; | 349 | skb_frag_t *f; |
343 | 350 | ||
344 | skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN); | 351 | skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN); |
345 | if (unlikely(!skb)) | 352 | if (unlikely(!skb)) { |
353 | oom = true; | ||
346 | break; | 354 | break; |
355 | } | ||
347 | 356 | ||
348 | skb_reserve(skb, NET_IP_ALIGN); | 357 | skb_reserve(skb, NET_IP_ALIGN); |
349 | 358 | ||
350 | f = &skb_shinfo(skb)->frags[0]; | 359 | f = &skb_shinfo(skb)->frags[0]; |
351 | f->page = get_a_page(vi, GFP_ATOMIC); | 360 | f->page = get_a_page(vi, gfp); |
352 | if (!f->page) { | 361 | if (!f->page) { |
362 | oom = true; | ||
353 | kfree_skb(skb); | 363 | kfree_skb(skb); |
354 | break; | 364 | break; |
355 | } | 365 | } |
@@ -373,6 +383,7 @@ static void try_fill_recv(struct virtnet_info *vi) | |||
373 | if (unlikely(vi->num > vi->max)) | 383 | if (unlikely(vi->num > vi->max)) |
374 | vi->max = vi->num; | 384 | vi->max = vi->num; |
375 | vi->rvq->vq_ops->kick(vi->rvq); | 385 | vi->rvq->vq_ops->kick(vi->rvq); |
386 | return !oom; | ||
376 | } | 387 | } |
377 | 388 | ||
378 | static void skb_recv_done(struct virtqueue *rvq) | 389 | static void skb_recv_done(struct virtqueue *rvq) |
@@ -385,6 +396,23 @@ static void skb_recv_done(struct virtqueue *rvq) | |||
385 | } | 396 | } |
386 | } | 397 | } |
387 | 398 | ||
399 | static void refill_work(struct work_struct *work) | ||
400 | { | ||
401 | struct virtnet_info *vi; | ||
402 | bool still_empty; | ||
403 | |||
404 | vi = container_of(work, struct virtnet_info, refill.work); | ||
405 | napi_disable(&vi->napi); | ||
406 | try_fill_recv(vi, GFP_KERNEL); | ||
407 | still_empty = (vi->num == 0); | ||
408 | napi_enable(&vi->napi); | ||
409 | |||
410 | /* In theory, this can happen: if we don't get any buffers in | ||
411 | * we will *never* try to fill again. */ | ||
412 | if (still_empty) | ||
413 | schedule_delayed_work(&vi->refill, HZ/2); | ||
414 | } | ||
415 | |||
388 | static int virtnet_poll(struct napi_struct *napi, int budget) | 416 | static int virtnet_poll(struct napi_struct *napi, int budget) |
389 | { | 417 | { |
390 | struct virtnet_info *vi = container_of(napi, struct virtnet_info, napi); | 418 | struct virtnet_info *vi = container_of(napi, struct virtnet_info, napi); |
@@ -400,10 +428,10 @@ again: | |||
400 | received++; | 428 | received++; |
401 | } | 429 | } |
402 | 430 | ||
403 | /* FIXME: If we oom and completely run out of inbufs, we need | 431 | if (vi->num < vi->max / 2) { |
404 | * to start a timer trying to fill more. */ | 432 | if (!try_fill_recv(vi, GFP_ATOMIC)) |
405 | if (vi->num < vi->max / 2) | 433 | schedule_delayed_work(&vi->refill, 0); |
406 | try_fill_recv(vi); | 434 | } |
407 | 435 | ||
408 | /* Out of packets? */ | 436 | /* Out of packets? */ |
409 | if (received < budget) { | 437 | if (received < budget) { |
@@ -519,7 +547,7 @@ static void xmit_tasklet(unsigned long data) | |||
519 | netif_tx_unlock_bh(vi->dev); | 547 | netif_tx_unlock_bh(vi->dev); |
520 | } | 548 | } |
521 | 549 | ||
522 | static int start_xmit(struct sk_buff *skb, struct net_device *dev) | 550 | static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) |
523 | { | 551 | { |
524 | struct virtnet_info *vi = netdev_priv(dev); | 552 | struct virtnet_info *vi = netdev_priv(dev); |
525 | 553 | ||
@@ -770,7 +798,7 @@ static void virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid) | |||
770 | dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid); | 798 | dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid); |
771 | } | 799 | } |
772 | 800 | ||
773 | static struct ethtool_ops virtnet_ethtool_ops = { | 801 | static const struct ethtool_ops virtnet_ethtool_ops = { |
774 | .set_tx_csum = virtnet_set_tx_csum, | 802 | .set_tx_csum = virtnet_set_tx_csum, |
775 | .set_sg = ethtool_op_set_sg, | 803 | .set_sg = ethtool_op_set_sg, |
776 | .set_tso = ethtool_op_set_tso, | 804 | .set_tso = ethtool_op_set_tso, |
@@ -894,6 +922,7 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
894 | vi->vdev = vdev; | 922 | vi->vdev = vdev; |
895 | vdev->priv = vi; | 923 | vdev->priv = vi; |
896 | vi->pages = NULL; | 924 | vi->pages = NULL; |
925 | INIT_DELAYED_WORK(&vi->refill, refill_work); | ||
897 | 926 | ||
898 | /* If they give us a callback when all buffers are done, we don't need | 927 | /* If they give us a callback when all buffers are done, we don't need |
899 | * the timer. */ | 928 | * the timer. */ |
@@ -942,7 +971,7 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
942 | } | 971 | } |
943 | 972 | ||
944 | /* Last of all, set up some receive buffers. */ | 973 | /* Last of all, set up some receive buffers. */ |
945 | try_fill_recv(vi); | 974 | try_fill_recv(vi, GFP_KERNEL); |
946 | 975 | ||
947 | /* If we didn't even get one input buffer, we're useless. */ | 976 | /* If we didn't even get one input buffer, we're useless. */ |
948 | if (vi->num == 0) { | 977 | if (vi->num == 0) { |
@@ -959,6 +988,7 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
959 | 988 | ||
960 | unregister: | 989 | unregister: |
961 | unregister_netdev(dev); | 990 | unregister_netdev(dev); |
991 | cancel_delayed_work_sync(&vi->refill); | ||
962 | free_vqs: | 992 | free_vqs: |
963 | vdev->config->del_vqs(vdev); | 993 | vdev->config->del_vqs(vdev); |
964 | free: | 994 | free: |
@@ -987,6 +1017,7 @@ static void virtnet_remove(struct virtio_device *vdev) | |||
987 | BUG_ON(vi->num != 0); | 1017 | BUG_ON(vi->num != 0); |
988 | 1018 | ||
989 | unregister_netdev(vi->dev); | 1019 | unregister_netdev(vi->dev); |
1020 | cancel_delayed_work_sync(&vi->refill); | ||
990 | 1021 | ||
991 | vdev->config->del_vqs(vi->vdev); | 1022 | vdev->config->del_vqs(vi->vdev); |
992 | 1023 | ||
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index 094d15548a2b..41dccba50c46 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
@@ -812,7 +812,7 @@ static int vxge_learn_mac(struct vxgedev *vdev, u8 *mac_header) | |||
812 | * NOTE: when device cant queue the pkt, just the trans_start variable will | 812 | * NOTE: when device cant queue the pkt, just the trans_start variable will |
813 | * not be upadted. | 813 | * not be upadted. |
814 | */ | 814 | */ |
815 | static int | 815 | static netdev_tx_t |
816 | vxge_xmit(struct sk_buff *skb, struct net_device *dev) | 816 | vxge_xmit(struct sk_buff *skb, struct net_device *dev) |
817 | { | 817 | { |
818 | struct vxge_fifo *fifo = NULL; | 818 | struct vxge_fifo *fifo = NULL; |
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 61581ee5f08c..66360a2a14c2 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c | |||
@@ -279,7 +279,7 @@ static int cosa_net_attach(struct net_device *dev, unsigned short encoding, | |||
279 | static int cosa_net_open(struct net_device *d); | 279 | static int cosa_net_open(struct net_device *d); |
280 | static int cosa_net_close(struct net_device *d); | 280 | static int cosa_net_close(struct net_device *d); |
281 | static void cosa_net_timeout(struct net_device *d); | 281 | static void cosa_net_timeout(struct net_device *d); |
282 | static int cosa_net_tx(struct sk_buff *skb, struct net_device *d); | 282 | static netdev_tx_t cosa_net_tx(struct sk_buff *skb, struct net_device *d); |
283 | static char *cosa_net_setup_rx(struct channel_data *channel, int size); | 283 | static char *cosa_net_setup_rx(struct channel_data *channel, int size); |
284 | static int cosa_net_rx_done(struct channel_data *channel); | 284 | static int cosa_net_rx_done(struct channel_data *channel); |
285 | static int cosa_net_tx_done(struct channel_data *channel, int size); | 285 | static int cosa_net_tx_done(struct channel_data *channel, int size); |
@@ -672,7 +672,8 @@ static int cosa_net_open(struct net_device *dev) | |||
672 | return 0; | 672 | return 0; |
673 | } | 673 | } |
674 | 674 | ||
675 | static int cosa_net_tx(struct sk_buff *skb, struct net_device *dev) | 675 | static netdev_tx_t cosa_net_tx(struct sk_buff *skb, |
676 | struct net_device *dev) | ||
676 | { | 677 | { |
677 | struct channel_data *chan = dev_to_chan(dev); | 678 | struct channel_data *chan = dev_to_chan(dev); |
678 | 679 | ||
@@ -680,7 +681,7 @@ static int cosa_net_tx(struct sk_buff *skb, struct net_device *dev) | |||
680 | 681 | ||
681 | chan->tx_skb = skb; | 682 | chan->tx_skb = skb; |
682 | cosa_start_tx(chan, skb->data, skb->len); | 683 | cosa_start_tx(chan, skb->data, skb->len); |
683 | return 0; | 684 | return NETDEV_TX_OK; |
684 | } | 685 | } |
685 | 686 | ||
686 | static void cosa_net_timeout(struct net_device *dev) | 687 | static void cosa_net_timeout(struct net_device *dev) |
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c index 4ae9bd297cc2..2573c18b6aa5 100644 --- a/drivers/net/wan/cycx_x25.c +++ b/drivers/net/wan/cycx_x25.c | |||
@@ -139,8 +139,8 @@ static int cycx_netdevice_hard_header(struct sk_buff *skb, | |||
139 | const void *daddr, const void *saddr, | 139 | const void *daddr, const void *saddr, |
140 | unsigned len); | 140 | unsigned len); |
141 | static int cycx_netdevice_rebuild_header(struct sk_buff *skb); | 141 | static int cycx_netdevice_rebuild_header(struct sk_buff *skb); |
142 | static int cycx_netdevice_hard_start_xmit(struct sk_buff *skb, | 142 | static netdev_tx_t cycx_netdevice_hard_start_xmit(struct sk_buff *skb, |
143 | struct net_device *dev); | 143 | struct net_device *dev); |
144 | 144 | ||
145 | static struct net_device_stats * | 145 | static struct net_device_stats * |
146 | cycx_netdevice_get_stats(struct net_device *dev); | 146 | cycx_netdevice_get_stats(struct net_device *dev); |
@@ -593,8 +593,8 @@ static int cycx_netdevice_rebuild_header(struct sk_buff *skb) | |||
593 | * bottom half" (with interrupts enabled). | 593 | * bottom half" (with interrupts enabled). |
594 | * 2. Setting tbusy flag will inhibit further transmit requests from the | 594 | * 2. Setting tbusy flag will inhibit further transmit requests from the |
595 | * protocol stack and can be used for flow control with protocol layer. */ | 595 | * protocol stack and can be used for flow control with protocol layer. */ |
596 | static int cycx_netdevice_hard_start_xmit(struct sk_buff *skb, | 596 | static netdev_tx_t cycx_netdevice_hard_start_xmit(struct sk_buff *skb, |
597 | struct net_device *dev) | 597 | struct net_device *dev) |
598 | { | 598 | { |
599 | struct cycx_x25_channel *chan = netdev_priv(dev); | 599 | struct cycx_x25_channel *chan = netdev_priv(dev); |
600 | struct cycx_device *card = chan->card; | 600 | struct cycx_device *card = chan->card; |
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index 8526b6d1ee4d..69d269d32b5b 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c | |||
@@ -186,12 +186,11 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) | |||
186 | dev_kfree_skb(skb); | 186 | dev_kfree_skb(skb); |
187 | } | 187 | } |
188 | 188 | ||
189 | static int dlci_transmit(struct sk_buff *skb, struct net_device *dev) | 189 | static netdev_tx_t dlci_transmit(struct sk_buff *skb, |
190 | struct net_device *dev) | ||
190 | { | 191 | { |
191 | struct dlci_local *dlp; | 192 | struct dlci_local *dlp; |
192 | int ret; | 193 | netdev_tx_t ret; |
193 | |||
194 | ret = 0; | ||
195 | 194 | ||
196 | if (!skb || !dev) | 195 | if (!skb || !dev) |
197 | return NETDEV_TX_OK; | 196 | return NETDEV_TX_OK; |
@@ -200,6 +199,8 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev) | |||
200 | 199 | ||
201 | netif_stop_queue(dev); | 200 | netif_stop_queue(dev); |
202 | 201 | ||
202 | /* This is hackish, overloads driver specific return values | ||
203 | on top of normal transmit return! */ | ||
203 | ret = dlp->slave->netdev_ops->ndo_start_xmit(skb, dlp->slave); | 204 | ret = dlp->slave->netdev_ops->ndo_start_xmit(skb, dlp->slave); |
204 | switch (ret) | 205 | switch (ret) |
205 | { | 206 | { |
@@ -207,11 +208,11 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev) | |||
207 | dev->stats.tx_packets++; | 208 | dev->stats.tx_packets++; |
208 | ret = NETDEV_TX_OK; | 209 | ret = NETDEV_TX_OK; |
209 | break; | 210 | break; |
210 | case DLCI_RET_ERR: | 211 | case DLCI_RET_ERR: |
211 | dev->stats.tx_errors++; | 212 | dev->stats.tx_errors++; |
212 | ret = NETDEV_TX_OK; | 213 | ret = NETDEV_TX_OK; |
213 | break; | 214 | break; |
214 | case DLCI_RET_DROP: | 215 | case DLCI_RET_DROP: |
215 | dev->stats.tx_dropped++; | 216 | dev->stats.tx_dropped++; |
216 | ret = NETDEV_TX_BUSY; | 217 | ret = NETDEV_TX_BUSY; |
217 | break; | 218 | break; |
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c index cc00e0f89ecb..b2247bd0d492 100644 --- a/drivers/net/wan/dscc4.c +++ b/drivers/net/wan/dscc4.c | |||
@@ -359,7 +359,8 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *, struct dscc4_dev_priv *); | |||
359 | static int dscc4_found1(struct pci_dev *, void __iomem *ioaddr); | 359 | static int dscc4_found1(struct pci_dev *, void __iomem *ioaddr); |
360 | static int dscc4_init_one(struct pci_dev *, const struct pci_device_id *ent); | 360 | static int dscc4_init_one(struct pci_dev *, const struct pci_device_id *ent); |
361 | static int dscc4_open(struct net_device *); | 361 | static int dscc4_open(struct net_device *); |
362 | static int dscc4_start_xmit(struct sk_buff *, struct net_device *); | 362 | static netdev_tx_t dscc4_start_xmit(struct sk_buff *, |
363 | struct net_device *); | ||
363 | static int dscc4_close(struct net_device *); | 364 | static int dscc4_close(struct net_device *); |
364 | static int dscc4_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 365 | static int dscc4_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
365 | static int dscc4_init_ring(struct net_device *); | 366 | static int dscc4_init_ring(struct net_device *); |
@@ -1148,7 +1149,8 @@ static int dscc4_tx_poll(struct dscc4_dev_priv *dpriv, struct net_device *dev) | |||
1148 | } | 1149 | } |
1149 | #endif /* DSCC4_POLLING */ | 1150 | #endif /* DSCC4_POLLING */ |
1150 | 1151 | ||
1151 | static int dscc4_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1152 | static netdev_tx_t dscc4_start_xmit(struct sk_buff *skb, |
1153 | struct net_device *dev) | ||
1152 | { | 1154 | { |
1153 | struct dscc4_dev_priv *dpriv = dscc4_priv(dev); | 1155 | struct dscc4_dev_priv *dpriv = dscc4_priv(dev); |
1154 | struct dscc4_pci_priv *ppriv = dpriv->pci_priv; | 1156 | struct dscc4_pci_priv *ppriv = dpriv->pci_priv; |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index 20a1237a3d74..3e90eb816181 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -2274,7 +2274,7 @@ fst_tx_timeout(struct net_device *dev) | |||
2274 | port->start = 0; | 2274 | port->start = 0; |
2275 | } | 2275 | } |
2276 | 2276 | ||
2277 | static int | 2277 | static netdev_tx_t |
2278 | fst_start_xmit(struct sk_buff *skb, struct net_device *dev) | 2278 | fst_start_xmit(struct sk_buff *skb, struct net_device *dev) |
2279 | { | 2279 | { |
2280 | struct fst_card_info *card; | 2280 | struct fst_card_info *card; |
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c index 1ea1ef6c3b96..80114c93bae7 100644 --- a/drivers/net/wan/hd64570.c +++ b/drivers/net/wan/hd64570.c | |||
@@ -620,7 +620,7 @@ static void sca_dump_rings(struct net_device *dev) | |||
620 | #endif /* DEBUG_RINGS */ | 620 | #endif /* DEBUG_RINGS */ |
621 | 621 | ||
622 | 622 | ||
623 | static int sca_xmit(struct sk_buff *skb, struct net_device *dev) | 623 | static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev) |
624 | { | 624 | { |
625 | port_t *port = dev_to_port(dev); | 625 | port_t *port = dev_to_port(dev); |
626 | card_t *card = port_to_card(port); | 626 | card_t *card = port_to_card(port); |
@@ -674,7 +674,7 @@ static int sca_xmit(struct sk_buff *skb, struct net_device *dev) | |||
674 | spin_unlock_irq(&port->lock); | 674 | spin_unlock_irq(&port->lock); |
675 | 675 | ||
676 | dev_kfree_skb(skb); | 676 | dev_kfree_skb(skb); |
677 | return 0; | 677 | return NETDEV_TX_OK; |
678 | } | 678 | } |
679 | 679 | ||
680 | 680 | ||
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index f099c34a3ae2..84f01373e11f 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c | |||
@@ -562,7 +562,7 @@ static void sca_dump_rings(struct net_device *dev) | |||
562 | #endif /* DEBUG_RINGS */ | 562 | #endif /* DEBUG_RINGS */ |
563 | 563 | ||
564 | 564 | ||
565 | static int sca_xmit(struct sk_buff *skb, struct net_device *dev) | 565 | static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev) |
566 | { | 566 | { |
567 | port_t *port = dev_to_port(dev); | 567 | port_t *port = dev_to_port(dev); |
568 | card_t *card = port->card; | 568 | card_t *card = port->card; |
@@ -601,7 +601,7 @@ static int sca_xmit(struct sk_buff *skb, struct net_device *dev) | |||
601 | spin_unlock_irq(&port->lock); | 601 | spin_unlock_irq(&port->lock); |
602 | 602 | ||
603 | dev_kfree_skb(skb); | 603 | dev_kfree_skb(skb); |
604 | return 0; | 604 | return NETDEV_TX_OK; |
605 | } | 605 | } |
606 | 606 | ||
607 | 607 | ||
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index 7596eae1b35c..cc07236ea734 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c | |||
@@ -66,7 +66,7 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev, | |||
66 | return hdlc->proto->netif_rx(skb); | 66 | return hdlc->proto->netif_rx(skb); |
67 | } | 67 | } |
68 | 68 | ||
69 | int hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev) | 69 | netdev_tx_t hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev) |
70 | { | 70 | { |
71 | hdlc_device *hdlc = dev_to_hdlc(dev); | 71 | hdlc_device *hdlc = dev_to_hdlc(dev); |
72 | 72 | ||
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 52438c76bf8a..840cff72a0f1 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c | |||
@@ -407,7 +407,7 @@ static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
407 | return -EINVAL; | 407 | return -EINVAL; |
408 | } | 408 | } |
409 | 409 | ||
410 | static int pvc_xmit(struct sk_buff *skb, struct net_device *dev) | 410 | static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev) |
411 | { | 411 | { |
412 | pvc_device *pvc = dev->ml_priv; | 412 | pvc_device *pvc = dev->ml_priv; |
413 | 413 | ||
diff --git a/drivers/net/wan/hdlc_raw_eth.c b/drivers/net/wan/hdlc_raw_eth.c index 49e68f5ca5f2..1b30fcc24145 100644 --- a/drivers/net/wan/hdlc_raw_eth.c +++ b/drivers/net/wan/hdlc_raw_eth.c | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | static int raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr); | 26 | static int raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr); |
27 | 27 | ||
28 | static int eth_tx(struct sk_buff *skb, struct net_device *dev) | 28 | static netdev_tx_t eth_tx(struct sk_buff *skb, struct net_device *dev) |
29 | { | 29 | { |
30 | int pad = ETH_ZLEN - skb->len; | 30 | int pad = ETH_ZLEN - skb->len; |
31 | if (pad > 0) { /* Pad the frame with zeros */ | 31 | if (pad > 0) { /* Pad the frame with zeros */ |
diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c index b1dc29ed1583..aa9248f8eb1a 100644 --- a/drivers/net/wan/hdlc_x25.c +++ b/drivers/net/wan/hdlc_x25.c | |||
@@ -87,7 +87,7 @@ static void x25_data_transmit(struct net_device *dev, struct sk_buff *skb) | |||
87 | 87 | ||
88 | 88 | ||
89 | 89 | ||
90 | static int x25_xmit(struct sk_buff *skb, struct net_device *dev) | 90 | static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev) |
91 | { | 91 | { |
92 | int result; | 92 | int result; |
93 | 93 | ||
@@ -98,7 +98,7 @@ static int x25_xmit(struct sk_buff *skb, struct net_device *dev) | |||
98 | skb_pull(skb, 1); | 98 | skb_pull(skb, 1); |
99 | if ((result = lapb_data_request(dev, skb)) != LAPB_OK) | 99 | if ((result = lapb_data_request(dev, skb)) != LAPB_OK) |
100 | dev_kfree_skb(skb); | 100 | dev_kfree_skb(skb); |
101 | return 0; | 101 | return NETDEV_TX_OK; |
102 | 102 | ||
103 | case 1: | 103 | case 1: |
104 | if ((result = lapb_connect_request(dev))!= LAPB_OK) { | 104 | if ((result = lapb_connect_request(dev))!= LAPB_OK) { |
@@ -129,7 +129,7 @@ static int x25_xmit(struct sk_buff *skb, struct net_device *dev) | |||
129 | } | 129 | } |
130 | 130 | ||
131 | dev_kfree_skb(skb); | 131 | dev_kfree_skb(skb); |
132 | return 0; | 132 | return NETDEV_TX_OK; |
133 | } | 133 | } |
134 | 134 | ||
135 | 135 | ||
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c index 567d4f5062d6..15002c3d0d95 100644 --- a/drivers/net/wan/hostess_sv11.c +++ b/drivers/net/wan/hostess_sv11.c | |||
@@ -156,7 +156,8 @@ static int hostess_ioctl(struct net_device *d, struct ifreq *ifr, int cmd) | |||
156 | * Passed network frames, fire them downwind. | 156 | * Passed network frames, fire them downwind. |
157 | */ | 157 | */ |
158 | 158 | ||
159 | static int hostess_queue_xmit(struct sk_buff *skb, struct net_device *d) | 159 | static netdev_tx_t hostess_queue_xmit(struct sk_buff *skb, |
160 | struct net_device *d) | ||
160 | { | 161 | { |
161 | return z8530_queue_xmit(&dev_to_sv(d)->chanA, skb); | 162 | return z8530_queue_xmit(&dev_to_sv(d)->chanA, skb); |
162 | } | 163 | } |
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index aff4f6bdf3d5..d1e3c673e9b2 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
@@ -147,7 +147,8 @@ static int lapbeth_data_indication(struct net_device *dev, struct sk_buff *skb) | |||
147 | /* | 147 | /* |
148 | * Send a LAPB frame via an ethernet interface | 148 | * Send a LAPB frame via an ethernet interface |
149 | */ | 149 | */ |
150 | static int lapbeth_xmit(struct sk_buff *skb, struct net_device *dev) | 150 | static netdev_tx_t lapbeth_xmit(struct sk_buff *skb, |
151 | struct net_device *dev) | ||
151 | { | 152 | { |
152 | int err; | 153 | int err; |
153 | 154 | ||
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index 4b83d8872857..7ea71b33d2e9 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c | |||
@@ -89,7 +89,8 @@ MODULE_DEVICE_TABLE(pci, lmc_pci_tbl); | |||
89 | MODULE_LICENSE("GPL v2"); | 89 | MODULE_LICENSE("GPL v2"); |
90 | 90 | ||
91 | 91 | ||
92 | static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev); | 92 | static netdev_tx_t lmc_start_xmit(struct sk_buff *skb, |
93 | struct net_device *dev); | ||
93 | static int lmc_rx (struct net_device *dev); | 94 | static int lmc_rx (struct net_device *dev); |
94 | static int lmc_open(struct net_device *dev); | 95 | static int lmc_open(struct net_device *dev); |
95 | static int lmc_close(struct net_device *dev); | 96 | static int lmc_close(struct net_device *dev); |
@@ -1423,12 +1424,12 @@ lmc_int_fail_out: | |||
1423 | return IRQ_RETVAL(handled); | 1424 | return IRQ_RETVAL(handled); |
1424 | } | 1425 | } |
1425 | 1426 | ||
1426 | static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1427 | static netdev_tx_t lmc_start_xmit(struct sk_buff *skb, |
1428 | struct net_device *dev) | ||
1427 | { | 1429 | { |
1428 | lmc_softc_t *sc = dev_to_sc(dev); | 1430 | lmc_softc_t *sc = dev_to_sc(dev); |
1429 | u32 flag; | 1431 | u32 flag; |
1430 | int entry; | 1432 | int entry; |
1431 | int ret = NETDEV_TX_OK; | ||
1432 | unsigned long flags; | 1433 | unsigned long flags; |
1433 | 1434 | ||
1434 | lmc_trace(dev, "lmc_start_xmit in"); | 1435 | lmc_trace(dev, "lmc_start_xmit in"); |
@@ -1510,7 +1511,7 @@ static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1510 | spin_unlock_irqrestore(&sc->lmc_lock, flags); | 1511 | spin_unlock_irqrestore(&sc->lmc_lock, flags); |
1511 | 1512 | ||
1512 | lmc_trace(dev, "lmc_start_xmit_out"); | 1513 | lmc_trace(dev, "lmc_start_xmit_out"); |
1513 | return ret; | 1514 | return NETDEV_TX_OK; |
1514 | } | 1515 | } |
1515 | 1516 | ||
1516 | 1517 | ||
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 85c02a2ec2e7..1cc24a45f003 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
@@ -114,7 +114,8 @@ static int sbni_pci_probe( struct net_device * ); | |||
114 | static struct net_device *sbni_probe1(struct net_device *, unsigned long, int); | 114 | static struct net_device *sbni_probe1(struct net_device *, unsigned long, int); |
115 | static int sbni_open( struct net_device * ); | 115 | static int sbni_open( struct net_device * ); |
116 | static int sbni_close( struct net_device * ); | 116 | static int sbni_close( struct net_device * ); |
117 | static int sbni_start_xmit( struct sk_buff *, struct net_device * ); | 117 | static netdev_tx_t sbni_start_xmit(struct sk_buff *, |
118 | struct net_device * ); | ||
118 | static int sbni_ioctl( struct net_device *, struct ifreq *, int ); | 119 | static int sbni_ioctl( struct net_device *, struct ifreq *, int ); |
119 | static void set_multicast_list( struct net_device * ); | 120 | static void set_multicast_list( struct net_device * ); |
120 | 121 | ||
@@ -444,7 +445,7 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) | |||
444 | 445 | ||
445 | #ifdef CONFIG_SBNI_MULTILINE | 446 | #ifdef CONFIG_SBNI_MULTILINE |
446 | 447 | ||
447 | static int | 448 | static netdev_tx_t |
448 | sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) | 449 | sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) |
449 | { | 450 | { |
450 | struct net_device *p; | 451 | struct net_device *p; |
@@ -472,7 +473,7 @@ sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
472 | 473 | ||
473 | #else /* CONFIG_SBNI_MULTILINE */ | 474 | #else /* CONFIG_SBNI_MULTILINE */ |
474 | 475 | ||
475 | static int | 476 | static netdev_tx_t |
476 | sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) | 477 | sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) |
477 | { | 478 | { |
478 | struct net_local *nl = netdev_priv(dev); | 479 | struct net_local *nl = netdev_priv(dev); |
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index 1d637f407a0c..63c76458431c 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c | |||
@@ -651,7 +651,8 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i | |||
651 | **************************/ | 651 | **************************/ |
652 | 652 | ||
653 | /* NOTE: the DLCI driver deals with freeing the SKB!! */ | 653 | /* NOTE: the DLCI driver deals with freeing the SKB!! */ |
654 | static int sdla_transmit(struct sk_buff *skb, struct net_device *dev) | 654 | static netdev_tx_t sdla_transmit(struct sk_buff *skb, |
655 | struct net_device *dev) | ||
655 | { | 656 | { |
656 | struct frad_local *flp; | 657 | struct frad_local *flp; |
657 | int ret, addr, accept, i; | 658 | int ret, addr, accept, i; |
@@ -737,7 +738,7 @@ static int sdla_transmit(struct sk_buff *skb, struct net_device *dev) | |||
737 | if(flp->master[i]!=NULL) | 738 | if(flp->master[i]!=NULL) |
738 | netif_wake_queue(flp->master[i]); | 739 | netif_wake_queue(flp->master[i]); |
739 | } | 740 | } |
740 | return(ret); | 741 | return NETDEV_TX_OK; |
741 | } | 742 | } |
742 | 743 | ||
743 | static void sdla_receive(struct net_device *dev) | 744 | static void sdla_receive(struct net_device *dev) |
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c index 23b269027453..0c525e24b247 100644 --- a/drivers/net/wan/sealevel.c +++ b/drivers/net/wan/sealevel.c | |||
@@ -156,7 +156,8 @@ static int sealevel_ioctl(struct net_device *d, struct ifreq *ifr, int cmd) | |||
156 | * Passed network frames, fire them downwind. | 156 | * Passed network frames, fire them downwind. |
157 | */ | 157 | */ |
158 | 158 | ||
159 | static int sealevel_queue_xmit(struct sk_buff *skb, struct net_device *d) | 159 | static netdev_tx_t sealevel_queue_xmit(struct sk_buff *skb, |
160 | struct net_device *d) | ||
160 | { | 161 | { |
161 | return z8530_queue_xmit(dev_to_chan(d)->chan, skb); | 162 | return z8530_queue_xmit(dev_to_chan(d)->chan, skb); |
162 | } | 163 | } |
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 03b76adbe5f0..daee8a0624ee 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c | |||
@@ -268,7 +268,7 @@ static irqreturn_t wanxl_intr(int irq, void* dev_id) | |||
268 | 268 | ||
269 | 269 | ||
270 | 270 | ||
271 | static int wanxl_xmit(struct sk_buff *skb, struct net_device *dev) | 271 | static netdev_tx_t wanxl_xmit(struct sk_buff *skb, struct net_device *dev) |
272 | { | 272 | { |
273 | port_t *port = dev_to_port(dev); | 273 | port_t *port = dev_to_port(dev); |
274 | desc_t *desc; | 274 | desc_t *desc; |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 1047920e742c..27945049c9e1 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -299,7 +299,8 @@ static void x25_asy_timeout(struct net_device *dev) | |||
299 | 299 | ||
300 | /* Encapsulate an IP datagram and kick it into a TTY queue. */ | 300 | /* Encapsulate an IP datagram and kick it into a TTY queue. */ |
301 | 301 | ||
302 | static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev) | 302 | static netdev_tx_t x25_asy_xmit(struct sk_buff *skb, |
303 | struct net_device *dev) | ||
303 | { | 304 | { |
304 | struct x25_asy *sl = netdev_priv(dev); | 305 | struct x25_asy *sl = netdev_priv(dev); |
305 | int err; | 306 | int err; |
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index ad4e79c4c5c3..0be7ec7299db 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c | |||
@@ -1727,15 +1727,14 @@ static inline int spans_boundary(struct sk_buff *skb) | |||
1727 | * point. | 1727 | * point. |
1728 | */ | 1728 | */ |
1729 | 1729 | ||
1730 | int z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb) | 1730 | netdev_tx_t z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb) |
1731 | { | 1731 | { |
1732 | unsigned long flags; | 1732 | unsigned long flags; |
1733 | 1733 | ||
1734 | netif_stop_queue(c->netdevice); | 1734 | netif_stop_queue(c->netdevice); |
1735 | if(c->tx_next_skb) | 1735 | if(c->tx_next_skb) |
1736 | { | 1736 | return NETDEV_TX_BUSY; |
1737 | return 1; | 1737 | |
1738 | } | ||
1739 | 1738 | ||
1740 | /* PC SPECIFIC - DMA limits */ | 1739 | /* PC SPECIFIC - DMA limits */ |
1741 | 1740 | ||
@@ -1767,7 +1766,7 @@ int z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb) | |||
1767 | z8530_tx_begin(c); | 1766 | z8530_tx_begin(c); |
1768 | spin_unlock_irqrestore(c->lock, flags); | 1767 | spin_unlock_irqrestore(c->lock, flags); |
1769 | 1768 | ||
1770 | return 0; | 1769 | return NETDEV_TX_OK; |
1771 | } | 1770 | } |
1772 | 1771 | ||
1773 | EXPORT_SYMBOL(z8530_queue_xmit); | 1772 | EXPORT_SYMBOL(z8530_queue_xmit); |
diff --git a/drivers/net/wan/z85230.h b/drivers/net/wan/z85230.h index 85b3e785d484..f29d554fc07d 100644 --- a/drivers/net/wan/z85230.h +++ b/drivers/net/wan/z85230.h | |||
@@ -406,7 +406,8 @@ extern int z8530_sync_dma_close(struct net_device *, struct z8530_channel *); | |||
406 | extern int z8530_sync_txdma_open(struct net_device *, struct z8530_channel *); | 406 | extern int z8530_sync_txdma_open(struct net_device *, struct z8530_channel *); |
407 | extern int z8530_sync_txdma_close(struct net_device *, struct z8530_channel *); | 407 | extern int z8530_sync_txdma_close(struct net_device *, struct z8530_channel *); |
408 | extern int z8530_channel_load(struct z8530_channel *, u8 *); | 408 | extern int z8530_channel_load(struct z8530_channel *, u8 *); |
409 | extern int z8530_queue_xmit(struct z8530_channel *c, struct sk_buff *skb); | 409 | extern netdev_tx_t z8530_queue_xmit(struct z8530_channel *c, |
410 | struct sk_buff *skb); | ||
410 | extern void z8530_null_rx(struct z8530_channel *c, struct sk_buff *skb); | 411 | extern void z8530_null_rx(struct z8530_channel *c, struct sk_buff *skb); |
411 | 412 | ||
412 | 413 | ||
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c index 9653f478b382..796396cb4c82 100644 --- a/drivers/net/wimax/i2400m/netdev.c +++ b/drivers/net/wimax/i2400m/netdev.c | |||
@@ -334,12 +334,12 @@ int i2400m_net_tx(struct i2400m *i2400m, struct net_device *net_dev, | |||
334 | * that will sleep. See i2400m_net_wake_tx() for details. | 334 | * that will sleep. See i2400m_net_wake_tx() for details. |
335 | */ | 335 | */ |
336 | static | 336 | static |
337 | int i2400m_hard_start_xmit(struct sk_buff *skb, | 337 | netdev_tx_t i2400m_hard_start_xmit(struct sk_buff *skb, |
338 | struct net_device *net_dev) | 338 | struct net_device *net_dev) |
339 | { | 339 | { |
340 | int result; | ||
341 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); | 340 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); |
342 | struct device *dev = i2400m_dev(i2400m); | 341 | struct device *dev = i2400m_dev(i2400m); |
342 | int result; | ||
343 | 343 | ||
344 | d_fnstart(3, dev, "(skb %p net_dev %p)\n", skb, net_dev); | 344 | d_fnstart(3, dev, "(skb %p net_dev %p)\n", skb, net_dev); |
345 | if (i2400m->state == I2400M_SS_IDLE) | 345 | if (i2400m->state == I2400M_SS_IDLE) |
@@ -353,9 +353,9 @@ int i2400m_hard_start_xmit(struct sk_buff *skb, | |||
353 | net_dev->stats.tx_bytes += skb->len; | 353 | net_dev->stats.tx_bytes += skb->len; |
354 | } | 354 | } |
355 | kfree_skb(skb); | 355 | kfree_skb(skb); |
356 | result = NETDEV_TX_OK; | 356 | |
357 | d_fnend(3, dev, "(skb %p net_dev %p) = %d\n", skb, net_dev, result); | 357 | d_fnend(3, dev, "(skb %p net_dev %p)\n", skb, net_dev); |
358 | return result; | 358 | return NETDEV_TX_OK; |
359 | } | 359 | } |
360 | 360 | ||
361 | 361 | ||
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index c150c4858576..7116a1aa20ce 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -1920,7 +1920,9 @@ static int airo_open(struct net_device *dev) { | |||
1920 | return 0; | 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 | int npacks, pending; | 1926 | int npacks, pending; |
1925 | unsigned long flags; | 1927 | unsigned long flags; |
1926 | struct airo_info *ai = dev->ml_priv; | 1928 | struct airo_info *ai = dev->ml_priv; |
@@ -2119,7 +2121,9 @@ static void airo_end_xmit(struct net_device *dev) { | |||
2119 | dev_kfree_skb(skb); | 2121 | dev_kfree_skb(skb); |
2120 | } | 2122 | } |
2121 | 2123 | ||
2122 | static int airo_start_xmit(struct sk_buff *skb, struct net_device *dev) { | 2124 | static netdev_tx_t airo_start_xmit(struct sk_buff *skb, |
2125 | struct net_device *dev) | ||
2126 | { | ||
2123 | s16 len; | 2127 | s16 len; |
2124 | int i, j; | 2128 | int i, j; |
2125 | struct airo_info *priv = dev->ml_priv; | 2129 | struct airo_info *priv = dev->ml_priv; |
@@ -2184,7 +2188,9 @@ static void airo_end_xmit11(struct net_device *dev) { | |||
2184 | dev_kfree_skb(skb); | 2188 | dev_kfree_skb(skb); |
2185 | } | 2189 | } |
2186 | 2190 | ||
2187 | static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) { | 2191 | static netdev_tx_t airo_start_xmit11(struct sk_buff *skb, |
2192 | struct net_device *dev) | ||
2193 | { | ||
2188 | s16 len; | 2194 | s16 len; |
2189 | int i, j; | 2195 | int i, j; |
2190 | struct airo_info *priv = dev->ml_priv; | 2196 | struct airo_info *priv = dev->ml_priv; |
diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c index f96c634e2d35..921a082487a1 100644 --- a/drivers/net/wireless/arlan-main.c +++ b/drivers/net/wireless/arlan-main.c | |||
@@ -77,7 +77,7 @@ struct arlan_conf_stru arlan_conf[MAX_ARLANS]; | |||
77 | static int arlans_found; | 77 | static int arlans_found; |
78 | 78 | ||
79 | static int arlan_open(struct net_device *dev); | 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 | static irqreturn_t arlan_interrupt(int irq, void *dev_id); | 81 | static irqreturn_t arlan_interrupt(int irq, void *dev_id); |
82 | static int arlan_close(struct net_device *dev); | 82 | static int arlan_close(struct net_device *dev); |
83 | static struct net_device_stats * | 83 | static struct net_device_stats * |
@@ -1169,7 +1169,7 @@ static void arlan_tx_timeout (struct net_device *dev) | |||
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 | short length; | 1174 | short length; |
1175 | unsigned char *buf; | 1175 | unsigned char *buf; |
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index 05813bc3e308..a3b36b3a9d67 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
@@ -781,7 +781,7 @@ static void tx_update_descriptor(struct atmel_private *priv, int is_bcast, | |||
781 | priv->tx_free_mem -= len; | 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 | static const u8 SNAP_RFC1024[6] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; | 786 | static const u8 SNAP_RFC1024[6] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; |
787 | struct atmel_private *priv = netdev_priv(dev); | 787 | struct atmel_private *priv = netdev_priv(dev); |
diff --git a/drivers/net/wireless/hostap/hostap_80211.h b/drivers/net/wireless/hostap/hostap_80211.h index 2e9fb0f383fc..7f9d8d976aa8 100644 --- a/drivers/net/wireless/hostap/hostap_80211.h +++ b/drivers/net/wireless/hostap/hostap_80211.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/skbuff.h> | 5 | #include <linux/skbuff.h> |
6 | #include <linux/netdevice.h> | ||
6 | 7 | ||
7 | struct hostap_ieee80211_mgmt { | 8 | struct hostap_ieee80211_mgmt { |
8 | __le16 frame_control; | 9 | __le16 frame_control; |
@@ -85,8 +86,11 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb, | |||
85 | struct hostap_80211_rx_status *rx_stats); | 86 | struct hostap_80211_rx_status *rx_stats); |
86 | 87 | ||
87 | void hostap_dump_tx_80211(const char *name, struct sk_buff *skb); | 88 | void hostap_dump_tx_80211(const char *name, struct sk_buff *skb); |
88 | int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev); | 89 | netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb, |
89 | int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev); | 90 | struct net_device *dev); |
90 | int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev); | 91 | netdev_tx_t hostap_mgmt_start_xmit(struct sk_buff *skb, |
92 | struct net_device *dev); | ||
93 | netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb, | ||
94 | struct net_device *dev); | ||
91 | 95 | ||
92 | #endif /* HOSTAP_80211_H */ | 96 | #endif /* HOSTAP_80211_H */ |
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index 1fe1bbabb907..90108b698f11 100644 --- a/drivers/net/wireless/hostap/hostap_80211_tx.c +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c | |||
@@ -53,7 +53,8 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb) | |||
53 | /* hard_start_xmit function for data interfaces (wlan#, wlan#wds#, wlan#sta) | 53 | /* hard_start_xmit function for data interfaces (wlan#, wlan#wds#, wlan#sta) |
54 | * Convert Ethernet header into a suitable IEEE 802.11 header depending on | 54 | * Convert Ethernet header into a suitable IEEE 802.11 header depending on |
55 | * device configuration. */ | 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 | struct hostap_interface *iface; | 59 | struct hostap_interface *iface; |
59 | local_info_t *local; | 60 | local_info_t *local; |
@@ -261,7 +262,8 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
261 | 262 | ||
262 | 263 | ||
263 | /* hard_start_xmit function for hostapd wlan#ap interfaces */ | 264 | /* hard_start_xmit function for hostapd wlan#ap interfaces */ |
264 | int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev) | 265 | netdev_tx_t hostap_mgmt_start_xmit(struct sk_buff *skb, |
266 | struct net_device *dev) | ||
265 | { | 267 | { |
266 | struct hostap_interface *iface; | 268 | struct hostap_interface *iface; |
267 | local_info_t *local; | 269 | local_info_t *local; |
@@ -373,11 +375,12 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb, | |||
373 | /* hard_start_xmit function for master radio interface wifi#. | 375 | /* hard_start_xmit function for master radio interface wifi#. |
374 | * AP processing (TX rate control, power save buffering, etc.). | 376 | * AP processing (TX rate control, power save buffering, etc.). |
375 | * Use hardware TX function to send the frame. */ | 377 | * Use hardware TX function to send the frame. */ |
376 | int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) | 378 | netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb, |
379 | struct net_device *dev) | ||
377 | { | 380 | { |
378 | struct hostap_interface *iface; | 381 | struct hostap_interface *iface; |
379 | local_info_t *local; | 382 | local_info_t *local; |
380 | int ret = NETDEV_TX_BUSY; | 383 | netdev_tx_t ret = NETDEV_TX_BUSY; |
381 | u16 fc; | 384 | u16 fc; |
382 | struct hostap_tx_data tx; | 385 | struct hostap_tx_data tx; |
383 | ap_tx_ret tx_ret; | 386 | ap_tx_ret tx_ret; |
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 77457386e0aa..240cff1e6979 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -3330,8 +3330,8 @@ static irqreturn_t ipw2100_interrupt(int irq, void *data) | |||
3330 | return IRQ_NONE; | 3330 | return IRQ_NONE; |
3331 | } | 3331 | } |
3332 | 3332 | ||
3333 | static int ipw2100_tx(struct libipw_txb *txb, struct net_device *dev, | 3333 | static netdev_tx_t ipw2100_tx(struct libipw_txb *txb, |
3334 | int pri) | 3334 | struct net_device *dev, int pri) |
3335 | { | 3335 | { |
3336 | struct ipw2100_priv *priv = libipw_priv(dev); | 3336 | struct ipw2100_priv *priv = libipw_priv(dev); |
3337 | struct list_head *element; | 3337 | struct list_head *element; |
@@ -3369,12 +3369,12 @@ static int ipw2100_tx(struct libipw_txb *txb, struct net_device *dev, | |||
3369 | ipw2100_tx_send_data(priv); | 3369 | ipw2100_tx_send_data(priv); |
3370 | 3370 | ||
3371 | spin_unlock_irqrestore(&priv->low_lock, flags); | 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 | netif_stop_queue(dev); | 3375 | netif_stop_queue(dev); |
3376 | spin_unlock_irqrestore(&priv->low_lock, flags); | 3376 | spin_unlock_irqrestore(&priv->low_lock, flags); |
3377 | return 1; | 3377 | return NETDEV_TX_BUSY; |
3378 | } | 3378 | } |
3379 | 3379 | ||
3380 | static int ipw2100_msg_allocate(struct ipw2100_priv *priv) | 3380 | static int ipw2100_msg_allocate(struct ipw2100_priv *priv) |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 3f8372daf46a..8d58e6ed4e7d 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -2893,45 +2893,27 @@ static int ipw_fw_dma_add_command_block(struct ipw_priv *priv, | |||
2893 | return 0; | 2893 | return 0; |
2894 | } | 2894 | } |
2895 | 2895 | ||
2896 | static int ipw_fw_dma_add_buffer(struct ipw_priv *priv, | 2896 | static int ipw_fw_dma_add_buffer(struct ipw_priv *priv, dma_addr_t *src_address, |
2897 | u32 src_phys, u32 dest_address, u32 length) | 2897 | int nr, u32 dest_address, u32 len) |
2898 | { | 2898 | { |
2899 | u32 bytes_left = length; | 2899 | int ret, i; |
2900 | u32 src_offset = 0; | 2900 | u32 size; |
2901 | u32 dest_offset = 0; | 2901 | |
2902 | int status = 0; | ||
2903 | IPW_DEBUG_FW(">> \n"); | 2902 | IPW_DEBUG_FW(">> \n"); |
2904 | IPW_DEBUG_FW_INFO("src_phys=0x%x dest_address=0x%x length=0x%x\n", | 2903 | IPW_DEBUG_FW_INFO("nr=%d dest_address=0x%x len=0x%x\n", |
2905 | src_phys, dest_address, length); | 2904 | nr, dest_address, len); |
2906 | while (bytes_left > CB_MAX_LENGTH) { | 2905 | |
2907 | status = ipw_fw_dma_add_command_block(priv, | 2906 | for (i = 0; i < nr; i++) { |
2908 | src_phys + src_offset, | 2907 | size = min_t(u32, len - i * CB_MAX_LENGTH, CB_MAX_LENGTH); |
2909 | dest_address + | 2908 | ret = ipw_fw_dma_add_command_block(priv, src_address[i], |
2910 | dest_offset, | 2909 | dest_address + |
2911 | CB_MAX_LENGTH, 0, 0); | 2910 | i * CB_MAX_LENGTH, size, |
2912 | if (status) { | 2911 | 0, 0); |
2912 | if (ret) { | ||
2913 | IPW_DEBUG_FW_INFO(": Failed\n"); | 2913 | IPW_DEBUG_FW_INFO(": Failed\n"); |
2914 | return -1; | 2914 | return -1; |
2915 | } else | 2915 | } else |
2916 | IPW_DEBUG_FW_INFO(": Added new cb\n"); | 2916 | IPW_DEBUG_FW_INFO(": Added new cb\n"); |
2917 | |||
2918 | src_offset += CB_MAX_LENGTH; | ||
2919 | dest_offset += CB_MAX_LENGTH; | ||
2920 | bytes_left -= CB_MAX_LENGTH; | ||
2921 | } | ||
2922 | |||
2923 | /* add the buffer tail */ | ||
2924 | if (bytes_left > 0) { | ||
2925 | status = | ||
2926 | ipw_fw_dma_add_command_block(priv, src_phys + src_offset, | ||
2927 | dest_address + dest_offset, | ||
2928 | bytes_left, 0, 0); | ||
2929 | if (status) { | ||
2930 | IPW_DEBUG_FW_INFO(": Failed on the buffer tail\n"); | ||
2931 | return -1; | ||
2932 | } else | ||
2933 | IPW_DEBUG_FW_INFO | ||
2934 | (": Adding new cb - the buffer tail\n"); | ||
2935 | } | 2917 | } |
2936 | 2918 | ||
2937 | IPW_DEBUG_FW("<< \n"); | 2919 | IPW_DEBUG_FW("<< \n"); |
@@ -3179,59 +3161,91 @@ static int ipw_load_ucode(struct ipw_priv *priv, u8 * data, size_t len) | |||
3179 | 3161 | ||
3180 | static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len) | 3162 | static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len) |
3181 | { | 3163 | { |
3182 | int rc = -1; | 3164 | int ret = -1; |
3183 | int offset = 0; | 3165 | int offset = 0; |
3184 | struct fw_chunk *chunk; | 3166 | struct fw_chunk *chunk; |
3185 | dma_addr_t shared_phys; | 3167 | int total_nr = 0; |
3186 | u8 *shared_virt; | 3168 | int i; |
3169 | struct pci_pool *pool; | ||
3170 | u32 *virts[CB_NUMBER_OF_ELEMENTS_SMALL]; | ||
3171 | dma_addr_t phys[CB_NUMBER_OF_ELEMENTS_SMALL]; | ||
3187 | 3172 | ||
3188 | IPW_DEBUG_TRACE("<< : \n"); | 3173 | IPW_DEBUG_TRACE("<< : \n"); |
3189 | shared_virt = pci_alloc_consistent(priv->pci_dev, len, &shared_phys); | ||
3190 | 3174 | ||
3191 | if (!shared_virt) | 3175 | pool = pci_pool_create("ipw2200", priv->pci_dev, CB_MAX_LENGTH, 0, 0); |
3176 | if (!pool) { | ||
3177 | IPW_ERROR("pci_pool_create failed\n"); | ||
3192 | return -ENOMEM; | 3178 | return -ENOMEM; |
3193 | 3179 | } | |
3194 | memmove(shared_virt, data, len); | ||
3195 | 3180 | ||
3196 | /* Start the Dma */ | 3181 | /* Start the Dma */ |
3197 | rc = ipw_fw_dma_enable(priv); | 3182 | ret = ipw_fw_dma_enable(priv); |
3198 | 3183 | ||
3199 | /* the DMA is already ready this would be a bug. */ | 3184 | /* the DMA is already ready this would be a bug. */ |
3200 | BUG_ON(priv->sram_desc.last_cb_index > 0); | 3185 | BUG_ON(priv->sram_desc.last_cb_index > 0); |
3201 | 3186 | ||
3202 | do { | 3187 | do { |
3188 | u32 chunk_len; | ||
3189 | u8 *start; | ||
3190 | int size; | ||
3191 | int nr = 0; | ||
3192 | |||
3203 | chunk = (struct fw_chunk *)(data + offset); | 3193 | chunk = (struct fw_chunk *)(data + offset); |
3204 | offset += sizeof(struct fw_chunk); | 3194 | offset += sizeof(struct fw_chunk); |
3195 | chunk_len = le32_to_cpu(chunk->length); | ||
3196 | start = data + offset; | ||
3197 | |||
3198 | nr = (chunk_len + CB_MAX_LENGTH - 1) / CB_MAX_LENGTH; | ||
3199 | for (i = 0; i < nr; i++) { | ||
3200 | virts[total_nr] = pci_pool_alloc(pool, GFP_KERNEL, | ||
3201 | &phys[total_nr]); | ||
3202 | if (!virts[total_nr]) { | ||
3203 | ret = -ENOMEM; | ||
3204 | goto out; | ||
3205 | } | ||
3206 | size = min_t(u32, chunk_len - i * CB_MAX_LENGTH, | ||
3207 | CB_MAX_LENGTH); | ||
3208 | memcpy(virts[total_nr], start, size); | ||
3209 | start += size; | ||
3210 | total_nr++; | ||
3211 | /* We don't support fw chunk larger than 64*8K */ | ||
3212 | BUG_ON(total_nr > CB_NUMBER_OF_ELEMENTS_SMALL); | ||
3213 | } | ||
3214 | |||
3205 | /* build DMA packet and queue up for sending */ | 3215 | /* build DMA packet and queue up for sending */ |
3206 | /* dma to chunk->address, the chunk->length bytes from data + | 3216 | /* dma to chunk->address, the chunk->length bytes from data + |
3207 | * offeset*/ | 3217 | * offeset*/ |
3208 | /* Dma loading */ | 3218 | /* Dma loading */ |
3209 | rc = ipw_fw_dma_add_buffer(priv, shared_phys + offset, | 3219 | ret = ipw_fw_dma_add_buffer(priv, &phys[total_nr - nr], |
3210 | le32_to_cpu(chunk->address), | 3220 | nr, le32_to_cpu(chunk->address), |
3211 | le32_to_cpu(chunk->length)); | 3221 | chunk_len); |
3212 | if (rc) { | 3222 | if (ret) { |
3213 | IPW_DEBUG_INFO("dmaAddBuffer Failed\n"); | 3223 | IPW_DEBUG_INFO("dmaAddBuffer Failed\n"); |
3214 | goto out; | 3224 | goto out; |
3215 | } | 3225 | } |
3216 | 3226 | ||
3217 | offset += le32_to_cpu(chunk->length); | 3227 | offset += chunk_len; |
3218 | } while (offset < len); | 3228 | } while (offset < len); |
3219 | 3229 | ||
3220 | /* Run the DMA and wait for the answer */ | 3230 | /* Run the DMA and wait for the answer */ |
3221 | rc = ipw_fw_dma_kick(priv); | 3231 | ret = ipw_fw_dma_kick(priv); |
3222 | if (rc) { | 3232 | if (ret) { |
3223 | IPW_ERROR("dmaKick Failed\n"); | 3233 | IPW_ERROR("dmaKick Failed\n"); |
3224 | goto out; | 3234 | goto out; |
3225 | } | 3235 | } |
3226 | 3236 | ||
3227 | rc = ipw_fw_dma_wait(priv); | 3237 | ret = ipw_fw_dma_wait(priv); |
3228 | if (rc) { | 3238 | if (ret) { |
3229 | IPW_ERROR("dmaWaitSync Failed\n"); | 3239 | IPW_ERROR("dmaWaitSync Failed\n"); |
3230 | goto out; | 3240 | goto out; |
3231 | } | 3241 | } |
3232 | out: | 3242 | out: |
3233 | pci_free_consistent(priv->pci_dev, len, shared_virt, shared_phys); | 3243 | for (i = 0; i < total_nr; i++) |
3234 | return rc; | 3244 | pci_pool_free(pool, virts[i], phys[i]); |
3245 | |||
3246 | pci_pool_destroy(pool); | ||
3247 | |||
3248 | return ret; | ||
3235 | } | 3249 | } |
3236 | 3250 | ||
3237 | /* stop nic */ | 3251 | /* stop nic */ |
@@ -10459,12 +10473,12 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, | |||
10459 | } | 10473 | } |
10460 | #endif | 10474 | #endif |
10461 | 10475 | ||
10462 | static int ipw_net_hard_start_xmit(struct libipw_txb *txb, | 10476 | static netdev_tx_t ipw_net_hard_start_xmit(struct libipw_txb *txb, |
10463 | struct net_device *dev, int pri) | 10477 | struct net_device *dev, int pri) |
10464 | { | 10478 | { |
10465 | struct ipw_priv *priv = libipw_priv(dev); | 10479 | struct ipw_priv *priv = libipw_priv(dev); |
10466 | unsigned long flags; | 10480 | unsigned long flags; |
10467 | int ret; | 10481 | netdev_tx_t ret; |
10468 | 10482 | ||
10469 | IPW_DEBUG_TX("dev->xmit(%d bytes)\n", txb->payload_size); | 10483 | IPW_DEBUG_TX("dev->xmit(%d bytes)\n", txb->payload_size); |
10470 | spin_lock_irqsave(&priv->lock, flags); | 10484 | spin_lock_irqsave(&priv->lock, flags); |
@@ -11602,7 +11616,8 @@ static int ipw_prom_stop(struct net_device *dev) | |||
11602 | return 0; | 11616 | return 0; |
11603 | } | 11617 | } |
11604 | 11618 | ||
11605 | static int ipw_prom_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | 11619 | static netdev_tx_t ipw_prom_hard_start_xmit(struct sk_buff *skb, |
11620 | struct net_device *dev) | ||
11606 | { | 11621 | { |
11607 | IPW_DEBUG_INFO("prom dev->xmit\n"); | 11622 | IPW_DEBUG_INFO("prom dev->xmit\n"); |
11608 | dev_kfree_skb(skb); | 11623 | dev_kfree_skb(skb); |
diff --git a/drivers/net/wireless/ipw2x00/libipw.h b/drivers/net/wireless/ipw2x00/libipw.h index 8f91d3427ce5..bf45391172f3 100644 --- a/drivers/net/wireless/ipw2x00/libipw.h +++ b/drivers/net/wireless/ipw2x00/libipw.h | |||
@@ -867,8 +867,8 @@ struct libipw_device { | |||
867 | /* Callback functions */ | 867 | /* Callback functions */ |
868 | void (*set_security) (struct net_device * dev, | 868 | void (*set_security) (struct net_device * dev, |
869 | struct libipw_security * sec); | 869 | struct libipw_security * sec); |
870 | int (*hard_start_xmit) (struct libipw_txb * txb, | 870 | netdev_tx_t (*hard_start_xmit) (struct libipw_txb * txb, |
871 | struct net_device * dev, int pri); | 871 | struct net_device * dev, int pri); |
872 | int (*reset_port) (struct net_device * dev); | 872 | int (*reset_port) (struct net_device * dev); |
873 | int (*is_queue_full) (struct net_device * dev, int pri); | 873 | int (*is_queue_full) (struct net_device * dev, int pri); |
874 | 874 | ||
@@ -1028,7 +1028,8 @@ extern void libipw_networks_age(struct libipw_device *ieee, | |||
1028 | extern int libipw_set_encryption(struct libipw_device *ieee); | 1028 | extern int libipw_set_encryption(struct libipw_device *ieee); |
1029 | 1029 | ||
1030 | /* libipw_tx.c */ | 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 | extern void libipw_txb_free(struct libipw_txb *); | 1033 | extern void libipw_txb_free(struct libipw_txb *); |
1033 | 1034 | ||
1034 | /* libipw_rx.c */ | 1035 | /* libipw_rx.c */ |
diff --git a/drivers/net/wireless/ipw2x00/libipw_tx.c b/drivers/net/wireless/ipw2x00/libipw_tx.c index 46530ce56ea6..da8beac7fcf3 100644 --- a/drivers/net/wireless/ipw2x00/libipw_tx.c +++ b/drivers/net/wireless/ipw2x00/libipw_tx.c | |||
@@ -252,7 +252,7 @@ static int libipw_classify(struct sk_buff *skb) | |||
252 | 252 | ||
253 | /* Incoming skb is converted to a txb which consists of | 253 | /* Incoming skb is converted to a txb which consists of |
254 | * a block of 802.11 fragment packets (stored as skbs) */ | 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 | struct libipw_device *ieee = netdev_priv(dev); | 257 | struct libipw_device *ieee = netdev_priv(dev); |
258 | struct libipw_txb *txb = NULL; | 258 | struct libipw_txb *txb = NULL; |
@@ -523,8 +523,8 @@ int libipw_xmit(struct sk_buff *skb, struct net_device *dev) | |||
523 | dev_kfree_skb_any(skb); | 523 | dev_kfree_skb_any(skb); |
524 | 524 | ||
525 | if (txb) { | 525 | if (txb) { |
526 | int ret = (*ieee->hard_start_xmit) (txb, dev, priority); | 526 | netdev_tx_t ret = (*ieee->hard_start_xmit)(txb, dev, priority); |
527 | if (ret == 0) { | 527 | if (ret == NETDEV_TX_OK) { |
528 | dev->stats.tx_packets++; | 528 | dev->stats.tx_packets++; |
529 | dev->stats.tx_bytes += txb->payload_size; | 529 | dev->stats.tx_bytes += txb->payload_size; |
530 | return NETDEV_TX_OK; | 530 | return NETDEV_TX_OK; |
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h index 0b84bdca0726..8b15380ae6e1 100644 --- a/drivers/net/wireless/libertas/decl.h +++ b/drivers/net/wireless/libertas/decl.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #ifndef _LBS_DECL_H_ | 6 | #ifndef _LBS_DECL_H_ |
7 | #define _LBS_DECL_H_ | 7 | #define _LBS_DECL_H_ |
8 | 8 | ||
9 | #include <linux/device.h> | 9 | #include <linux/netdevice.h> |
10 | 10 | ||
11 | #include "defs.h" | 11 | #include "defs.h" |
12 | 12 | ||
@@ -41,7 +41,8 @@ u8 lbs_data_rate_to_fw_index(u32 rate); | |||
41 | int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len); | 41 | int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len); |
42 | void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, | 42 | void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, |
43 | int result); | 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 | int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band); | 46 | int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band); |
46 | 47 | ||
47 | int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *); | 48 | int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *); |
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 578c69783589..d3b69a4b4b5e 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include "defs.h" | 14 | #include "defs.h" |
15 | #include "hostcmd.h" | 15 | #include "hostcmd.h" |
16 | 16 | ||
17 | extern struct ethtool_ops lbs_ethtool_ops; | 17 | extern const struct ethtool_ops lbs_ethtool_ops; |
18 | 18 | ||
19 | #define MAX_BSSID_PER_CHANNEL 16 | 19 | #define MAX_BSSID_PER_CHANNEL 16 |
20 | 20 | ||
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c index b118a35ec605..039b555e4d76 100644 --- a/drivers/net/wireless/libertas/ethtool.c +++ b/drivers/net/wireless/libertas/ethtool.c | |||
@@ -183,7 +183,7 @@ static int lbs_ethtool_set_wol(struct net_device *dev, | |||
183 | return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL); | 183 | return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL); |
184 | } | 184 | } |
185 | 185 | ||
186 | struct ethtool_ops lbs_ethtool_ops = { | 186 | const struct ethtool_ops lbs_ethtool_ops = { |
187 | .get_drvinfo = lbs_ethtool_get_drvinfo, | 187 | .get_drvinfo = lbs_ethtool_get_drvinfo, |
188 | .get_eeprom = lbs_ethtool_get_eeprom, | 188 | .get_eeprom = lbs_ethtool_get_eeprom, |
189 | .get_eeprom_len = lbs_ethtool_get_eeprom_len, | 189 | .get_eeprom_len = lbs_ethtool_get_eeprom_len, |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 8df1cfd5f93a..87b4e497faa2 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -1647,7 +1647,8 @@ static int lbs_rtap_stop(struct net_device *dev) | |||
1647 | return 0; | 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 | netif_stop_queue(dev); | 1653 | netif_stop_queue(dev); |
1653 | return NETDEV_TX_BUSY; | 1654 | return NETDEV_TX_BUSY; |
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c index 160cfd8311c0..4c018f7a0a8d 100644 --- a/drivers/net/wireless/libertas/tx.c +++ b/drivers/net/wireless/libertas/tx.c | |||
@@ -57,19 +57,17 @@ static u32 convert_radiotap_rate_to_mv(u8 rate) | |||
57 | * @param skb A pointer to skb which includes TX packet | 57 | * @param skb A pointer to skb which includes TX packet |
58 | * @return 0 or -1 | 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 | unsigned long flags; | 62 | unsigned long flags; |
63 | struct lbs_private *priv = dev->ml_priv; | 63 | struct lbs_private *priv = dev->ml_priv; |
64 | struct txpd *txpd; | 64 | struct txpd *txpd; |
65 | char *p802x_hdr; | 65 | char *p802x_hdr; |
66 | uint16_t pkt_len; | 66 | uint16_t pkt_len; |
67 | int ret; | 67 | netdev_tx_t ret = NETDEV_TX_OK; |
68 | 68 | ||
69 | lbs_deb_enter(LBS_DEB_TX); | 69 | lbs_deb_enter(LBS_DEB_TX); |
70 | 70 | ||
71 | ret = NETDEV_TX_OK; | ||
72 | |||
73 | /* We need to protect against the queues being restarted before | 71 | /* We need to protect against the queues being restarted before |
74 | we get round to stopping them */ | 72 | we get round to stopping them */ |
75 | spin_lock_irqsave(&priv->driver_lock, flags); | 73 | spin_lock_irqsave(&priv->driver_lock, flags); |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 6f6cd43592c8..896f532182f0 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -312,7 +312,8 @@ struct hwsim_radiotap_hdr { | |||
312 | } __attribute__ ((packed)); | 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 | /* TODO: allow packet injection */ | 318 | /* TODO: allow packet injection */ |
318 | dev_kfree_skb(skb); | 319 | dev_kfree_skb(skb); |
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c index 712f26eef35d..9498b46c99a4 100644 --- a/drivers/net/wireless/netwave_cs.c +++ b/drivers/net/wireless/netwave_cs.c | |||
@@ -203,7 +203,8 @@ static int netwave_open(struct net_device *dev); /* Open the device */ | |||
203 | static int netwave_close(struct net_device *dev); /* Close the device */ | 203 | static int netwave_close(struct net_device *dev); /* Close the device */ |
204 | 204 | ||
205 | /* Packet transmission and Packet reception */ | 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 | static int netwave_rx( struct net_device *dev); | 208 | static int netwave_rx( struct net_device *dev); |
208 | 209 | ||
209 | /* Interrupt routines */ | 210 | /* Interrupt routines */ |
@@ -1026,7 +1027,8 @@ static int netwave_hw_xmit(unsigned char* data, int len, | |||
1026 | return 0; | 1027 | return 0; |
1027 | } | 1028 | } |
1028 | 1029 | ||
1029 | static int netwave_start_xmit(struct sk_buff *skb, struct net_device *dev) { | 1030 | static netdev_tx_t netwave_start_xmit(struct sk_buff *skb, |
1031 | struct net_device *dev) { | ||
1030 | /* This flag indicate that the hardware can't perform a transmission. | 1032 | /* This flag indicate that the hardware can't perform a transmission. |
1031 | * Theoritically, NET3 check it before sending a packet to the driver, | 1033 | * Theoritically, NET3 check it before sending a packet to the driver, |
1032 | * but in fact it never do that and pool continuously. | 1034 | * but in fact it never do that and pool continuously. |
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c index 40d8dfa7eace..359652d35e63 100644 --- a/drivers/net/wireless/orinoco/hw.c +++ b/drivers/net/wireless/orinoco/hw.c | |||
@@ -644,7 +644,7 @@ int orinoco_hw_get_tkip_iv(struct orinoco_private *priv, int key, u8 *tsc) | |||
644 | int err = 0; | 644 | int err = 0; |
645 | u8 tsc_arr[4][ORINOCO_SEQ_LEN]; | 645 | u8 tsc_arr[4][ORINOCO_SEQ_LEN]; |
646 | 646 | ||
647 | if ((key < 0) || (key > 4)) | 647 | if ((key < 0) || (key >= 4)) |
648 | return -EINVAL; | 648 | return -EINVAL; |
649 | 649 | ||
650 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV, | 650 | err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV, |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index 2c7dc65cd2be..7a32bcb0c037 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -337,7 +337,7 @@ static int orinoco_change_mtu(struct net_device *dev, int new_mtu) | |||
337 | /* Tx path */ | 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 | struct orinoco_private *priv = ndev_priv(dev); | 342 | struct orinoco_private *priv = ndev_priv(dev); |
343 | struct net_device_stats *stats = &priv->stats; | 343 | struct net_device_stats *stats = &priv->stats; |
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index 9b5ee3419287..872b64783e78 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c | |||
@@ -72,7 +72,7 @@ islpci_eth_cleanup_transmit(islpci_private *priv, | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | int | 75 | netdev_tx_t |
76 | islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) | 76 | islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev) |
77 | { | 77 | { |
78 | islpci_private *priv = netdev_priv(ndev); | 78 | islpci_private *priv = netdev_priv(ndev); |
diff --git a/drivers/net/wireless/prism54/islpci_eth.h b/drivers/net/wireless/prism54/islpci_eth.h index 61454d32d74d..54f9a4b7bf9b 100644 --- a/drivers/net/wireless/prism54/islpci_eth.h +++ b/drivers/net/wireless/prism54/islpci_eth.h | |||
@@ -64,7 +64,7 @@ struct avs_80211_1_header { | |||
64 | }; | 64 | }; |
65 | 65 | ||
66 | void islpci_eth_cleanup_transmit(islpci_private *, isl38xx_control_block *); | 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 | int islpci_eth_receive(islpci_private *); | 68 | int islpci_eth_receive(islpci_private *); |
69 | void islpci_eth_tx_timeout(struct net_device *); | 69 | void islpci_eth_tx_timeout(struct net_device *); |
70 | void islpci_do_reset_and_wake(struct work_struct *); | 70 | void islpci_do_reset_and_wake(struct work_struct *); |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 325206969c97..88cd58eb3b9f 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -104,7 +104,8 @@ static int ray_dev_init(struct net_device *dev); | |||
104 | static const struct ethtool_ops netdev_ethtool_ops; | 104 | static const struct ethtool_ops netdev_ethtool_ops; |
105 | 105 | ||
106 | static int ray_open(struct net_device *dev); | 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 | static void set_multicast_list(struct net_device *dev); | 109 | static void set_multicast_list(struct net_device *dev); |
109 | static void ray_update_multi_list(struct net_device *dev, int all); | 110 | static void ray_update_multi_list(struct net_device *dev, int all); |
110 | static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx, | 111 | static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx, |
@@ -915,16 +916,19 @@ static int ray_dev_config(struct net_device *dev, struct ifmap *map) | |||
915 | } | 916 | } |
916 | 917 | ||
917 | /*===========================================================================*/ | 918 | /*===========================================================================*/ |
918 | static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev) | 919 | static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb, |
920 | struct net_device *dev) | ||
919 | { | 921 | { |
920 | ray_dev_t *local = netdev_priv(dev); | 922 | ray_dev_t *local = netdev_priv(dev); |
921 | struct pcmcia_device *link = local->finder; | 923 | struct pcmcia_device *link = local->finder; |
922 | short length = skb->len; | 924 | short length = skb->len; |
923 | 925 | ||
924 | if (!(pcmcia_dev_present(link))) { | 926 | if (!pcmcia_dev_present(link)) { |
925 | DEBUG(2, "ray_dev_start_xmit - device not present\n"); | 927 | DEBUG(2, "ray_dev_start_xmit - device not present\n"); |
926 | return NETDEV_TX_LOCKED; | 928 | dev_kfree_skb(skb); |
929 | return NETDEV_TX_OK; | ||
927 | } | 930 | } |
931 | |||
928 | DEBUG(3, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev); | 932 | DEBUG(3, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev); |
929 | if (local->authentication_state == NEED_TO_AUTH) { | 933 | if (local->authentication_state == NEED_TO_AUTH) { |
930 | DEBUG(0, "ray_cs Sending authentication request.\n"); | 934 | DEBUG(0, "ray_cs Sending authentication request.\n"); |
@@ -951,8 +955,8 @@ static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
951 | default: | 955 | default: |
952 | dev->trans_start = jiffies; | 956 | dev->trans_start = jiffies; |
953 | dev_kfree_skb(skb); | 957 | dev_kfree_skb(skb); |
954 | return NETDEV_TX_OK; | ||
955 | } | 958 | } |
959 | |||
956 | return NETDEV_TX_OK; | 960 | return NETDEV_TX_OK; |
957 | } /* ray_dev_start_xmit */ | 961 | } /* ray_dev_start_xmit */ |
958 | 962 | ||
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index 9679b29e1c49..2017ccc00145 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -871,6 +871,9 @@ static int rtl8187b_init_hw(struct ieee80211_hw *dev) | |||
871 | priv->aifsn[3] = 3; /* AIFSN[AC_BE] */ | 871 | priv->aifsn[3] = 3; /* AIFSN[AC_BE] */ |
872 | rtl818x_iowrite8(priv, &priv->map->ACM_CONTROL, 0); | 872 | rtl818x_iowrite8(priv, &priv->map->ACM_CONTROL, 0); |
873 | 873 | ||
874 | /* ENEDCA flag must always be set, transmit issues? */ | ||
875 | rtl818x_iowrite8(priv, &priv->map->MSR, RTL818X_MSR_ENEDCA); | ||
876 | |||
874 | return 0; | 877 | return 0; |
875 | } | 878 | } |
876 | 879 | ||
@@ -1176,13 +1179,16 @@ static void rtl8187_bss_info_changed(struct ieee80211_hw *dev, | |||
1176 | rtl818x_iowrite8(priv, &priv->map->BSSID[i], | 1179 | rtl818x_iowrite8(priv, &priv->map->BSSID[i], |
1177 | info->bssid[i]); | 1180 | info->bssid[i]); |
1178 | 1181 | ||
1182 | if (priv->is_rtl8187b) | ||
1183 | reg = RTL818X_MSR_ENEDCA; | ||
1184 | else | ||
1185 | reg = 0; | ||
1186 | |||
1179 | if (is_valid_ether_addr(info->bssid)) { | 1187 | if (is_valid_ether_addr(info->bssid)) { |
1180 | reg = RTL818X_MSR_INFRA; | 1188 | reg |= RTL818X_MSR_INFRA; |
1181 | if (priv->is_rtl8187b) | ||
1182 | reg |= RTL818X_MSR_ENEDCA; | ||
1183 | rtl818x_iowrite8(priv, &priv->map->MSR, reg); | 1189 | rtl818x_iowrite8(priv, &priv->map->MSR, reg); |
1184 | } else { | 1190 | } else { |
1185 | reg = RTL818X_MSR_NO_LINK; | 1191 | reg |= RTL818X_MSR_NO_LINK; |
1186 | rtl818x_iowrite8(priv, &priv->map->MSR, reg); | 1192 | rtl818x_iowrite8(priv, &priv->map->MSR, reg); |
1187 | } | 1193 | } |
1188 | 1194 | ||
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c index ef2cb20e96ad..ea6a87c19319 100644 --- a/drivers/net/wireless/strip.c +++ b/drivers/net/wireless/strip.c | |||
@@ -1533,7 +1533,7 @@ static void strip_send(struct strip *strip_info, struct sk_buff *skb) | |||
1533 | } | 1533 | } |
1534 | 1534 | ||
1535 | /* Encapsulate a datagram and kick it into a TTY queue. */ | 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 | struct strip *strip_info = netdev_priv(dev); | 1538 | struct strip *strip_info = netdev_priv(dev); |
1539 | 1539 | ||
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c index 5cb5329a20d1..d634b2da3b84 100644 --- a/drivers/net/wireless/wavelan.c +++ b/drivers/net/wireless/wavelan.c | |||
@@ -2841,7 +2841,8 @@ static int wv_packet_write(struct net_device * dev, void *buf, short length) | |||
2841 | * the packet. We also prevent reentrance. Then we call the function | 2841 | * the packet. We also prevent reentrance. Then we call the function |
2842 | * to send the packet. | 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 | net_local *lp = netdev_priv(dev); | 2847 | net_local *lp = netdev_priv(dev); |
2847 | unsigned long flags; | 2848 | unsigned long flags; |
diff --git a/drivers/net/wireless/wavelan.p.h b/drivers/net/wireless/wavelan.p.h index 2daa0210d789..dbe8de6e5f52 100644 --- a/drivers/net/wireless/wavelan.p.h +++ b/drivers/net/wireless/wavelan.p.h | |||
@@ -611,7 +611,7 @@ static inline int | |||
611 | wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer. */ | 611 | wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer. */ |
612 | void *, | 612 | void *, |
613 | short); | 613 | short); |
614 | static int | 614 | static netdev_tx_t |
615 | wavelan_packet_xmit(struct sk_buff *, /* Send a packet. */ | 615 | wavelan_packet_xmit(struct sk_buff *, /* Send a packet. */ |
616 | struct net_device *); | 616 | struct net_device *); |
617 | /* -------------------- HARDWARE CONFIGURATION -------------------- */ | 617 | /* -------------------- HARDWARE CONFIGURATION -------------------- */ |
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index b9748d432019..431a20ec6db6 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -3078,7 +3078,7 @@ wv_packet_write(struct net_device * dev, | |||
3078 | * the packet. We also prevent reentrance. Then, we call the function | 3078 | * the packet. We also prevent reentrance. Then, we call the function |
3079 | * to send the packet... | 3079 | * to send the packet... |
3080 | */ | 3080 | */ |
3081 | static int | 3081 | static netdev_tx_t |
3082 | wavelan_packet_xmit(struct sk_buff * skb, | 3082 | wavelan_packet_xmit(struct sk_buff * skb, |
3083 | struct net_device * dev) | 3083 | struct net_device * dev) |
3084 | { | 3084 | { |
diff --git a/drivers/net/wireless/wavelan_cs.p.h b/drivers/net/wireless/wavelan_cs.p.h index 706fd3007d21..81d91531c4f9 100644 --- a/drivers/net/wireless/wavelan_cs.p.h +++ b/drivers/net/wireless/wavelan_cs.p.h | |||
@@ -707,7 +707,7 @@ static void | |||
707 | wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer */ | 707 | wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer */ |
708 | void *, | 708 | void *, |
709 | short); | 709 | short); |
710 | static int | 710 | static netdev_tx_t |
711 | wavelan_packet_xmit(struct sk_buff *, /* Send a packet */ | 711 | wavelan_packet_xmit(struct sk_buff *, /* Send a packet */ |
712 | struct net_device *); | 712 | struct net_device *); |
713 | /* -------------------- HARDWARE CONFIGURATION -------------------- */ | 713 | /* -------------------- HARDWARE CONFIGURATION -------------------- */ |
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index a83a5621ec44..4f1e0cfe609b 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c | |||
@@ -1333,7 +1333,8 @@ static void wl3501_tx_timeout(struct net_device *dev) | |||
1333 | * 1 - Could not transmit (dev_queue_xmit will queue it) | 1333 | * 1 - Could not transmit (dev_queue_xmit will queue it) |
1334 | * and try to sent it later | 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 | int enabled, rc; | 1339 | int enabled, rc; |
1339 | struct wl3501_card *this = netdev_priv(dev); | 1340 | struct wl3501_card *this = netdev_priv(dev); |
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c index dae1bfb7655e..bc81974a2bc7 100644 --- a/drivers/net/wireless/zd1201.c +++ b/drivers/net/wireless/zd1201.c | |||
@@ -779,7 +779,8 @@ static int zd1201_net_stop(struct net_device *dev) | |||
779 | (llc+snap+type+payload) | 779 | (llc+snap+type+payload) |
780 | zd 1 null byte, zd1201 packet type | 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 | struct zd1201 *zd = netdev_priv(dev); | 785 | struct zd1201 *zd = netdev_priv(dev); |
785 | unsigned char *txbuf = zd->txdata; | 786 | unsigned char *txbuf = zd->txdata; |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 3700c49d76ca..baa051d5bfbe 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include <xen/interface/memory.h> | 51 | #include <xen/interface/memory.h> |
52 | #include <xen/interface/grant_table.h> | 52 | #include <xen/interface/grant_table.h> |
53 | 53 | ||
54 | static struct ethtool_ops xennet_ethtool_ops; | 54 | static const struct ethtool_ops xennet_ethtool_ops; |
55 | 55 | ||
56 | struct netfront_cb { | 56 | struct netfront_cb { |
57 | struct page *page; | 57 | struct page *page; |
@@ -1627,7 +1627,7 @@ static void backend_changed(struct xenbus_device *dev, | |||
1627 | } | 1627 | } |
1628 | } | 1628 | } |
1629 | 1629 | ||
1630 | static struct ethtool_ops xennet_ethtool_ops = | 1630 | static const struct ethtool_ops xennet_ethtool_ops = |
1631 | { | 1631 | { |
1632 | .set_tx_csum = ethtool_op_set_tx_csum, | 1632 | .set_tx_csum = ethtool_op_set_tx_csum, |
1633 | .set_sg = xennet_set_sg, | 1633 | .set_sg = xennet_set_sg, |
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index 7e05b40ae36b..7e05b40ae36b 100755..100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c | |||
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index 76764237cde6..4987040c414b 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
@@ -346,8 +346,9 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | |||
346 | static int yellowfin_open(struct net_device *dev); | 346 | static int yellowfin_open(struct net_device *dev); |
347 | static void yellowfin_timer(unsigned long data); | 347 | static void yellowfin_timer(unsigned long data); |
348 | static void yellowfin_tx_timeout(struct net_device *dev); | 348 | static void yellowfin_tx_timeout(struct net_device *dev); |
349 | static void yellowfin_init_ring(struct net_device *dev); | 349 | static int yellowfin_init_ring(struct net_device *dev); |
350 | static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev); | 350 | static netdev_tx_t yellowfin_start_xmit(struct sk_buff *skb, |
351 | struct net_device *dev); | ||
351 | static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance); | 352 | static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance); |
352 | static int yellowfin_rx(struct net_device *dev); | 353 | static int yellowfin_rx(struct net_device *dev); |
353 | static void yellowfin_error(struct net_device *dev, int intr_status); | 354 | static void yellowfin_error(struct net_device *dev, int intr_status); |
@@ -573,19 +574,24 @@ static int yellowfin_open(struct net_device *dev) | |||
573 | { | 574 | { |
574 | struct yellowfin_private *yp = netdev_priv(dev); | 575 | struct yellowfin_private *yp = netdev_priv(dev); |
575 | void __iomem *ioaddr = yp->base; | 576 | void __iomem *ioaddr = yp->base; |
576 | int i; | 577 | int i, ret; |
577 | 578 | ||
578 | /* Reset the chip. */ | 579 | /* Reset the chip. */ |
579 | iowrite32(0x80000000, ioaddr + DMACtrl); | 580 | iowrite32(0x80000000, ioaddr + DMACtrl); |
580 | 581 | ||
581 | i = request_irq(dev->irq, &yellowfin_interrupt, IRQF_SHARED, dev->name, dev); | 582 | ret = request_irq(dev->irq, &yellowfin_interrupt, IRQF_SHARED, dev->name, dev); |
582 | if (i) return i; | 583 | if (ret) |
584 | return ret; | ||
583 | 585 | ||
584 | if (yellowfin_debug > 1) | 586 | if (yellowfin_debug > 1) |
585 | printk(KERN_DEBUG "%s: yellowfin_open() irq %d.\n", | 587 | printk(KERN_DEBUG "%s: yellowfin_open() irq %d.\n", |
586 | dev->name, dev->irq); | 588 | dev->name, dev->irq); |
587 | 589 | ||
588 | yellowfin_init_ring(dev); | 590 | ret = yellowfin_init_ring(dev); |
591 | if (ret) { | ||
592 | free_irq(dev->irq, dev); | ||
593 | return ret; | ||
594 | } | ||
589 | 595 | ||
590 | iowrite32(yp->rx_ring_dma, ioaddr + RxPtr); | 596 | iowrite32(yp->rx_ring_dma, ioaddr + RxPtr); |
591 | iowrite32(yp->tx_ring_dma, ioaddr + TxPtr); | 597 | iowrite32(yp->tx_ring_dma, ioaddr + TxPtr); |
@@ -725,10 +731,10 @@ static void yellowfin_tx_timeout(struct net_device *dev) | |||
725 | } | 731 | } |
726 | 732 | ||
727 | /* Initialize the Rx and Tx rings, along with various 'dev' bits. */ | 733 | /* Initialize the Rx and Tx rings, along with various 'dev' bits. */ |
728 | static void yellowfin_init_ring(struct net_device *dev) | 734 | static int yellowfin_init_ring(struct net_device *dev) |
729 | { | 735 | { |
730 | struct yellowfin_private *yp = netdev_priv(dev); | 736 | struct yellowfin_private *yp = netdev_priv(dev); |
731 | int i; | 737 | int i, j; |
732 | 738 | ||
733 | yp->tx_full = 0; | 739 | yp->tx_full = 0; |
734 | yp->cur_rx = yp->cur_tx = 0; | 740 | yp->cur_rx = yp->cur_tx = 0; |
@@ -753,6 +759,11 @@ static void yellowfin_init_ring(struct net_device *dev) | |||
753 | yp->rx_ring[i].addr = cpu_to_le32(pci_map_single(yp->pci_dev, | 759 | yp->rx_ring[i].addr = cpu_to_le32(pci_map_single(yp->pci_dev, |
754 | skb->data, yp->rx_buf_sz, PCI_DMA_FROMDEVICE)); | 760 | skb->data, yp->rx_buf_sz, PCI_DMA_FROMDEVICE)); |
755 | } | 761 | } |
762 | if (i != RX_RING_SIZE) { | ||
763 | for (j = 0; j < i; j++) | ||
764 | dev_kfree_skb(yp->rx_skbuff[j]); | ||
765 | return -ENOMEM; | ||
766 | } | ||
756 | yp->rx_ring[i-1].dbdma_cmd = cpu_to_le32(CMD_STOP); | 767 | yp->rx_ring[i-1].dbdma_cmd = cpu_to_le32(CMD_STOP); |
757 | yp->dirty_rx = (unsigned int)(i - RX_RING_SIZE); | 768 | yp->dirty_rx = (unsigned int)(i - RX_RING_SIZE); |
758 | 769 | ||
@@ -769,8 +780,6 @@ static void yellowfin_init_ring(struct net_device *dev) | |||
769 | yp->tx_ring[--i].dbdma_cmd = cpu_to_le32(CMD_STOP | BRANCH_ALWAYS); | 780 | yp->tx_ring[--i].dbdma_cmd = cpu_to_le32(CMD_STOP | BRANCH_ALWAYS); |
770 | #else | 781 | #else |
771 | { | 782 | { |
772 | int j; | ||
773 | |||
774 | /* Tx ring needs a pair of descriptors, the second for the status. */ | 783 | /* Tx ring needs a pair of descriptors, the second for the status. */ |
775 | for (i = 0; i < TX_RING_SIZE; i++) { | 784 | for (i = 0; i < TX_RING_SIZE; i++) { |
776 | j = 2*i; | 785 | j = 2*i; |
@@ -805,10 +814,11 @@ static void yellowfin_init_ring(struct net_device *dev) | |||
805 | } | 814 | } |
806 | #endif | 815 | #endif |
807 | yp->tx_tail_desc = &yp->tx_status[0]; | 816 | yp->tx_tail_desc = &yp->tx_status[0]; |
808 | return; | 817 | return 0; |
809 | } | 818 | } |
810 | 819 | ||
811 | static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev) | 820 | static netdev_tx_t yellowfin_start_xmit(struct sk_buff *skb, |
821 | struct net_device *dev) | ||
812 | { | 822 | { |
813 | struct yellowfin_private *yp = netdev_priv(dev); | 823 | struct yellowfin_private *yp = netdev_priv(dev); |
814 | unsigned entry; | 824 | unsigned entry; |
diff --git a/drivers/net/znet.c b/drivers/net/znet.c index 7f9e14131a5c..a0384b6f09b6 100644 --- a/drivers/net/znet.c +++ b/drivers/net/znet.c | |||
@@ -156,7 +156,8 @@ struct netidblk { | |||
156 | }; | 156 | }; |
157 | 157 | ||
158 | static int znet_open(struct net_device *dev); | 158 | static int znet_open(struct net_device *dev); |
159 | static int znet_send_packet(struct sk_buff *skb, struct net_device *dev); | 159 | static netdev_tx_t znet_send_packet(struct sk_buff *skb, |
160 | struct net_device *dev); | ||
160 | static irqreturn_t znet_interrupt(int irq, void *dev_id); | 161 | static irqreturn_t znet_interrupt(int irq, void *dev_id); |
161 | static void znet_rx(struct net_device *dev); | 162 | static void znet_rx(struct net_device *dev); |
162 | static int znet_close(struct net_device *dev); | 163 | static int znet_close(struct net_device *dev); |
@@ -534,7 +535,7 @@ static void znet_tx_timeout (struct net_device *dev) | |||
534 | netif_wake_queue (dev); | 535 | netif_wake_queue (dev); |
535 | } | 536 | } |
536 | 537 | ||
537 | static int znet_send_packet(struct sk_buff *skb, struct net_device *dev) | 538 | static netdev_tx_t znet_send_packet(struct sk_buff *skb, struct net_device *dev) |
538 | { | 539 | { |
539 | int ioaddr = dev->base_addr; | 540 | int ioaddr = dev->base_addr; |
540 | struct znet_private *znet = netdev_priv(dev); | 541 | struct znet_private *znet = netdev_priv(dev); |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 12ee7a35ca59..94b161121c26 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -863,7 +863,7 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev) | |||
863 | return; | 863 | return; |
864 | } | 864 | } |
865 | 865 | ||
866 | static struct ethtool_ops qeth_l2_ethtool_ops = { | 866 | static const struct ethtool_ops qeth_l2_ethtool_ops = { |
867 | .get_link = ethtool_op_get_link, | 867 | .get_link = ethtool_op_get_link, |
868 | .get_strings = qeth_core_get_strings, | 868 | .get_strings = qeth_core_get_strings, |
869 | .get_ethtool_stats = qeth_core_get_ethtool_stats, | 869 | .get_ethtool_stats = qeth_core_get_ethtool_stats, |
@@ -872,7 +872,7 @@ static struct ethtool_ops qeth_l2_ethtool_ops = { | |||
872 | .get_settings = qeth_core_ethtool_get_settings, | 872 | .get_settings = qeth_core_ethtool_get_settings, |
873 | }; | 873 | }; |
874 | 874 | ||
875 | static struct ethtool_ops qeth_l2_osn_ops = { | 875 | static const struct ethtool_ops qeth_l2_osn_ops = { |
876 | .get_strings = qeth_core_get_strings, | 876 | .get_strings = qeth_core_get_strings, |
877 | .get_ethtool_stats = qeth_core_get_ethtool_stats, | 877 | .get_ethtool_stats = qeth_core_get_ethtool_stats, |
878 | .get_stats_count = qeth_core_get_stats_count, | 878 | .get_stats_count = qeth_core_get_stats_count, |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index d9fabe30c0da..115b4a0dae6e 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -2946,7 +2946,7 @@ static int qeth_l3_ethtool_set_tso(struct net_device *dev, u32 data) | |||
2946 | return 0; | 2946 | return 0; |
2947 | } | 2947 | } |
2948 | 2948 | ||
2949 | static struct ethtool_ops qeth_l3_ethtool_ops = { | 2949 | static const struct ethtool_ops qeth_l3_ethtool_ops = { |
2950 | .get_link = ethtool_op_get_link, | 2950 | .get_link = ethtool_op_get_link, |
2951 | .get_tx_csum = ethtool_op_get_tx_csum, | 2951 | .get_tx_csum = ethtool_op_get_tx_csum, |
2952 | .set_tx_csum = ethtool_op_set_tx_hw_csum, | 2952 | .set_tx_csum = ethtool_op_set_tx_hw_csum, |
diff --git a/drivers/staging/at76_usb/at76_usb.c b/drivers/staging/at76_usb/at76_usb.c index 7b8aa5edf42f..c165c50c0119 100644 --- a/drivers/staging/at76_usb/at76_usb.c +++ b/drivers/staging/at76_usb/at76_usb.c | |||
@@ -3396,7 +3396,7 @@ static u32 at76_ethtool_get_link(struct net_device *netdev) | |||
3396 | return priv->mac_state == MAC_CONNECTED; | 3396 | return priv->mac_state == MAC_CONNECTED; |
3397 | } | 3397 | } |
3398 | 3398 | ||
3399 | static struct ethtool_ops at76_ethtool_ops = { | 3399 | static const struct ethtool_ops at76_ethtool_ops = { |
3400 | .get_drvinfo = at76_ethtool_get_drvinfo, | 3400 | .get_drvinfo = at76_ethtool_get_drvinfo, |
3401 | .get_link = at76_ethtool_get_link, | 3401 | .get_link = at76_ethtool_get_link, |
3402 | }; | 3402 | }; |
diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c index 93cab0a48925..42230e62a222 100644 --- a/drivers/staging/octeon/ethernet-mdio.c +++ b/drivers/staging/octeon/ethernet-mdio.c | |||
@@ -170,7 +170,7 @@ static u32 cvm_oct_get_link(struct net_device *dev) | |||
170 | return ret; | 170 | return ret; |
171 | } | 171 | } |
172 | 172 | ||
173 | struct ethtool_ops cvm_oct_ethtool_ops = { | 173 | struct const ethtool_ops cvm_oct_ethtool_ops = { |
174 | .get_drvinfo = cvm_oct_get_drvinfo, | 174 | .get_drvinfo = cvm_oct_get_drvinfo, |
175 | .get_settings = cvm_oct_get_settings, | 175 | .get_settings = cvm_oct_get_settings, |
176 | .set_settings = cvm_oct_set_settings, | 176 | .set_settings = cvm_oct_set_settings, |
diff --git a/drivers/staging/octeon/ethernet-mdio.h b/drivers/staging/octeon/ethernet-mdio.h index 6314141e5ef2..b3328aeec2df 100644 --- a/drivers/staging/octeon/ethernet-mdio.h +++ b/drivers/staging/octeon/ethernet-mdio.h | |||
@@ -41,6 +41,6 @@ | |||
41 | #include <net/xfrm.h> | 41 | #include <net/xfrm.h> |
42 | #endif /* CONFIG_XFRM */ | 42 | #endif /* CONFIG_XFRM */ |
43 | 43 | ||
44 | extern struct ethtool_ops cvm_oct_ethtool_ops; | 44 | extern const struct ethtool_ops cvm_oct_ethtool_ops; |
45 | int cvm_oct_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 45 | int cvm_oct_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
46 | int cvm_oct_mdio_setup_device(struct net_device *dev); | 46 | int cvm_oct_mdio_setup_device(struct net_device *dev); |
diff --git a/drivers/staging/sxg/sxg.h b/drivers/staging/sxg/sxg.h index f07aa708d862..110096a5c52f 100644 --- a/drivers/staging/sxg/sxg.h +++ b/drivers/staging/sxg/sxg.h | |||
@@ -782,6 +782,6 @@ struct slic_crash_info { | |||
782 | #define SIOCSLICSETINTAGG (SIOCDEVPRIVATE+10) | 782 | #define SIOCSLICSETINTAGG (SIOCDEVPRIVATE+10) |
783 | #define SIOCSLICTRACEDUMP (SIOCDEVPRIVATE+11) | 783 | #define SIOCSLICTRACEDUMP (SIOCDEVPRIVATE+11) |
784 | 784 | ||
785 | extern struct ethtool_ops sxg_nic_ethtool_ops; | 785 | extern const struct ethtool_ops sxg_nic_ethtool_ops; |
786 | #define SXG_COMPLETE_SLOW_SEND_LIMIT 128 | 786 | #define SXG_COMPLETE_SLOW_SEND_LIMIT 128 |
787 | #endif /* __SXG_DRIVER_H__ */ | 787 | #endif /* __SXG_DRIVER_H__ */ |
diff --git a/drivers/staging/sxg/sxg_ethtool.c b/drivers/staging/sxg/sxg_ethtool.c index ad89cb829b85..f5a0706478da 100644 --- a/drivers/staging/sxg/sxg_ethtool.c +++ b/drivers/staging/sxg/sxg_ethtool.c | |||
@@ -300,7 +300,7 @@ static int sxg_nic_get_eeprom(struct net_device *netdev, | |||
300 | return 0; | 300 | return 0; |
301 | } | 301 | } |
302 | 302 | ||
303 | struct ethtool_ops sxg_nic_ethtool_ops = { | 303 | const struct ethtool_ops sxg_nic_ethtool_ops = { |
304 | .get_settings = sxg_nic_get_settings, | 304 | .get_settings = sxg_nic_get_settings, |
305 | .set_settings = sxg_nic_set_settings, | 305 | .set_settings = sxg_nic_set_settings, |
306 | .get_drvinfo = sxg_nic_get_drvinfo, | 306 | .get_drvinfo = sxg_nic_get_drvinfo, |
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index aac69b591aeb..c66521953917 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c | |||
@@ -181,7 +181,7 @@ static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p) | |||
181 | * - ... probably more ethtool ops | 181 | * - ... probably more ethtool ops |
182 | */ | 182 | */ |
183 | 183 | ||
184 | static struct ethtool_ops ops = { | 184 | static const struct ethtool_ops ops = { |
185 | .get_drvinfo = eth_get_drvinfo, | 185 | .get_drvinfo = eth_get_drvinfo, |
186 | .get_link = ethtool_op_get_link, | 186 | .get_link = ethtool_op_get_link, |
187 | }; | 187 | }; |
@@ -465,7 +465,8 @@ static inline int is_promisc(u16 cdc_filter) | |||
465 | return cdc_filter & USB_CDC_PACKET_TYPE_PROMISCUOUS; | 465 | return cdc_filter & USB_CDC_PACKET_TYPE_PROMISCUOUS; |
466 | } | 466 | } |
467 | 467 | ||
468 | static int eth_start_xmit(struct sk_buff *skb, struct net_device *net) | 468 | static netdev_tx_t eth_start_xmit(struct sk_buff *skb, |
469 | struct net_device *net) | ||
469 | { | 470 | { |
470 | struct eth_dev *dev = netdev_priv(net); | 471 | struct eth_dev *dev = netdev_priv(net); |
471 | int length = skb->len; | 472 | int length = skb->len; |
diff --git a/drivers/uwb/i1480/i1480u-wlp/i1480u-wlp.h b/drivers/uwb/i1480/i1480u-wlp/i1480u-wlp.h index 3421d3339d7d..2e31f536a347 100644 --- a/drivers/uwb/i1480/i1480u-wlp/i1480u-wlp.h +++ b/drivers/uwb/i1480/i1480u-wlp/i1480u-wlp.h | |||
@@ -267,7 +267,8 @@ extern void i1480u_sysfs_release(struct i1480u *); | |||
267 | /* netdev interface */ | 267 | /* netdev interface */ |
268 | extern int i1480u_open(struct net_device *); | 268 | extern int i1480u_open(struct net_device *); |
269 | extern int i1480u_stop(struct net_device *); | 269 | extern int i1480u_stop(struct net_device *); |
270 | extern int i1480u_hard_start_xmit(struct sk_buff *, struct net_device *); | 270 | extern netdev_tx_t i1480u_hard_start_xmit(struct sk_buff *, |
271 | struct net_device *); | ||
271 | extern void i1480u_tx_timeout(struct net_device *); | 272 | extern void i1480u_tx_timeout(struct net_device *); |
272 | extern int i1480u_set_config(struct net_device *, struct ifmap *); | 273 | extern int i1480u_set_config(struct net_device *, struct ifmap *); |
273 | extern int i1480u_change_mtu(struct net_device *, int); | 274 | extern int i1480u_change_mtu(struct net_device *, int); |
diff --git a/drivers/uwb/i1480/i1480u-wlp/tx.c b/drivers/uwb/i1480/i1480u-wlp/tx.c index 26bacc009c65..3db3449dbda4 100644 --- a/drivers/uwb/i1480/i1480u-wlp/tx.c +++ b/drivers/uwb/i1480/i1480u-wlp/tx.c | |||
@@ -503,7 +503,8 @@ out: | |||
503 | * | 503 | * |
504 | * @net_dev->xmit_lock is held | 504 | * @net_dev->xmit_lock is held |
505 | */ | 505 | */ |
506 | int i1480u_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev) | 506 | netdev_tx_t i1480u_hard_start_xmit(struct sk_buff *skb, |
507 | struct net_device *net_dev) | ||
507 | { | 508 | { |
508 | int result; | 509 | int result; |
509 | struct i1480u *i1480u = netdev_priv(net_dev); | 510 | struct i1480u *i1480u = netdev_priv(net_dev); |