aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-17 15:49:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-17 15:49:28 -0400
commit3d68bd0010d2c9bc9ad6004fdcc4d6a56dcae199 (patch)
tree013ac9bd1bc68d1d9dda17346eefc617aeb47265
parentefcbae253f97bf82e7befd372da3ad5995a53f1a (diff)
parent05e9a2f67849e427f8900bad0a3f2a939e8dd3d6 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: Bluetooth: Fix crash with incoming L2CAP connections Bluetooth: Fix regression in L2CAP connection procedure gianfar: rx parser r6040: only disable RX interrupt if napi_schedule_prep is successful net: remove NETIF_F_ALL_TX_OFFLOADS net: sctp: fix checksum marking for outgoing packets
-rw-r--r--drivers/net/bonding/bond_main.c6
-rw-r--r--drivers/net/gianfar.c24
-rw-r--r--drivers/net/gianfar.h3
-rw-r--r--drivers/net/r6040.c8
-rw-r--r--include/linux/netdevice.h6
-rw-r--r--net/8021q/vlan_dev.c6
-rw-r--r--net/bluetooth/l2cap_core.c9
-rw-r--r--net/sctp/output.c19
8 files changed, 47 insertions, 34 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index eafe44a528ac..63c22b0bb5ad 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1428,9 +1428,9 @@ out:
1428 return features; 1428 return features;
1429} 1429}
1430 1430
1431#define BOND_VLAN_FEATURES (NETIF_F_ALL_TX_OFFLOADS | \ 1431#define BOND_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \
1432 NETIF_F_SOFT_FEATURES | \ 1432 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
1433 NETIF_F_LRO) 1433 NETIF_F_HIGHDMA | NETIF_F_LRO)
1434 1434
1435static void bond_compute_features(struct bonding *bond) 1435static void bond_compute_features(struct bonding *bond)
1436{ 1436{
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 2dfcc8047847..dfa55f94ba7f 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -2289,6 +2289,23 @@ static int gfar_set_mac_address(struct net_device *dev)
2289 return 0; 2289 return 0;
2290} 2290}
2291 2291
2292/* Check if rx parser should be activated */
2293void gfar_check_rx_parser_mode(struct gfar_private *priv)
2294{
2295 struct gfar __iomem *regs;
2296 u32 tempval;
2297
2298 regs = priv->gfargrp[0].regs;
2299
2300 tempval = gfar_read(&regs->rctrl);
2301 /* If parse is no longer required, then disable parser */
2302 if (tempval & RCTRL_REQ_PARSER)
2303 tempval |= RCTRL_PRSDEP_INIT;
2304 else
2305 tempval &= ~RCTRL_PRSDEP_INIT;
2306 gfar_write(&regs->rctrl, tempval);
2307}
2308
2292 2309
2293/* Enables and disables VLAN insertion/extraction */ 2310/* Enables and disables VLAN insertion/extraction */
2294static void gfar_vlan_rx_register(struct net_device *dev, 2311static void gfar_vlan_rx_register(struct net_device *dev,
@@ -2325,12 +2342,9 @@ static void gfar_vlan_rx_register(struct net_device *dev,
2325 /* Disable VLAN tag extraction */ 2342 /* Disable VLAN tag extraction */
2326 tempval = gfar_read(&regs->rctrl); 2343 tempval = gfar_read(&regs->rctrl);
2327 tempval &= ~RCTRL_VLEX; 2344 tempval &= ~RCTRL_VLEX;
2328 /* If parse is no longer required, then disable parser */
2329 if (tempval & RCTRL_REQ_PARSER)
2330 tempval |= RCTRL_PRSDEP_INIT;
2331 else
2332 tempval &= ~RCTRL_PRSDEP_INIT;
2333 gfar_write(&regs->rctrl, tempval); 2345 gfar_write(&regs->rctrl, tempval);
2346
2347 gfar_check_rx_parser_mode(priv);
2334 } 2348 }
2335 2349
2336 gfar_change_mtu(dev, dev->mtu); 2350 gfar_change_mtu(dev, dev->mtu);
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index ba36dc7a3435..440e69d8beff 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -274,7 +274,7 @@ extern const char gfar_driver_version[];
274#define RCTRL_PROM 0x00000008 274#define RCTRL_PROM 0x00000008
275#define RCTRL_EMEN 0x00000002 275#define RCTRL_EMEN 0x00000002
276#define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \ 276#define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \
277 RCTRL_TUCSEN) 277 RCTRL_TUCSEN | RCTRL_FILREN)
278#define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \ 278#define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \
279 RCTRL_PRSDEP_INIT) 279 RCTRL_PRSDEP_INIT)
280#define RCTRL_EXTHASH (RCTRL_GHTX) 280#define RCTRL_EXTHASH (RCTRL_GHTX)
@@ -1156,6 +1156,7 @@ extern void gfar_configure_coalescing(struct gfar_private *priv,
1156 unsigned long tx_mask, unsigned long rx_mask); 1156 unsigned long tx_mask, unsigned long rx_mask);
1157void gfar_init_sysfs(struct net_device *dev); 1157void gfar_init_sysfs(struct net_device *dev);
1158int gfar_set_features(struct net_device *dev, u32 features); 1158int gfar_set_features(struct net_device *dev, u32 features);
1159extern void gfar_check_rx_parser_mode(struct gfar_private *priv);
1159 1160
1160extern const struct ethtool_ops gfar_ethtool_ops; 1161extern const struct ethtool_ops gfar_ethtool_ops;
1161 1162
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 200a363c3bf5..0ffec4608441 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -677,9 +677,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
677 if (status & RX_FIFO_FULL) 677 if (status & RX_FIFO_FULL)
678 dev->stats.rx_fifo_errors++; 678 dev->stats.rx_fifo_errors++;
679 679
680 /* Mask off RX interrupt */ 680 if (likely(napi_schedule_prep(&lp->napi))) {
681 misr &= ~RX_INTS; 681 /* Mask off RX interrupt */
682 napi_schedule(&lp->napi); 682 misr &= ~RX_INTS;
683 __napi_schedule(&lp->napi);
684 }
683 } 685 }
684 686
685 /* TX interrupt request */ 687 /* TX interrupt request */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 54b8b4d7b68f..9e19477991ad 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1097,12 +1097,6 @@ struct net_device {
1097#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ 1097#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
1098 NETIF_F_FSO) 1098 NETIF_F_FSO)
1099 1099
1100#define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \
1101 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
1102 NETIF_F_HIGHDMA | \
1103 NETIF_F_SCTP_CSUM | \
1104 NETIF_F_ALL_FCOE)
1105
1106 /* 1100 /*
1107 * If one device supports one of these features, then enable them 1101 * If one device supports one of these features, then enable them
1108 * for all in netdev_increment_features. 1102 * for all in netdev_increment_features.
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 86bff9b1ac47..6e82148edfc8 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -528,7 +528,11 @@ static int vlan_dev_init(struct net_device *dev)
528 (1<<__LINK_STATE_DORMANT))) | 528 (1<<__LINK_STATE_DORMANT))) |
529 (1<<__LINK_STATE_PRESENT); 529 (1<<__LINK_STATE_PRESENT);
530 530
531 dev->hw_features = NETIF_F_ALL_TX_OFFLOADS; 531 dev->hw_features = NETIF_F_ALL_CSUM | NETIF_F_SG |
532 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO |
533 NETIF_F_HIGHDMA | NETIF_F_SCTP_CSUM |
534 NETIF_F_ALL_FCOE;
535
532 dev->features |= real_dev->vlan_features | NETIF_F_LLTX; 536 dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
533 dev->gso_max_size = real_dev->gso_max_size; 537 dev->gso_max_size = real_dev->gso_max_size;
534 538
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index ebff14c69078..7705e26e699f 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -620,7 +620,8 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
620 struct sock *parent = bt_sk(sk)->parent; 620 struct sock *parent = bt_sk(sk)->parent;
621 rsp.result = cpu_to_le16(L2CAP_CR_PEND); 621 rsp.result = cpu_to_le16(L2CAP_CR_PEND);
622 rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND); 622 rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND);
623 parent->sk_data_ready(parent, 0); 623 if (parent)
624 parent->sk_data_ready(parent, 0);
624 625
625 } else { 626 } else {
626 sk->sk_state = BT_CONFIG; 627 sk->sk_state = BT_CONFIG;
@@ -2323,8 +2324,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
2323 2324
2324 sk = chan->sk; 2325 sk = chan->sk;
2325 2326
2326 if ((bt_sk(sk)->defer_setup && sk->sk_state != BT_CONNECT2) || 2327 if (sk->sk_state != BT_CONFIG && sk->sk_state != BT_CONNECT2) {
2327 (!bt_sk(sk)->defer_setup && sk->sk_state != BT_CONFIG)) {
2328 struct l2cap_cmd_rej rej; 2328 struct l2cap_cmd_rej rej;
2329 2329
2330 rej.reason = cpu_to_le16(0x0002); 2330 rej.reason = cpu_to_le16(0x0002);
@@ -4010,7 +4010,8 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
4010 struct sock *parent = bt_sk(sk)->parent; 4010 struct sock *parent = bt_sk(sk)->parent;
4011 res = L2CAP_CR_PEND; 4011 res = L2CAP_CR_PEND;
4012 stat = L2CAP_CS_AUTHOR_PEND; 4012 stat = L2CAP_CS_AUTHOR_PEND;
4013 parent->sk_data_ready(parent, 0); 4013 if (parent)
4014 parent->sk_data_ready(parent, 0);
4014 } else { 4015 } else {
4015 sk->sk_state = BT_CONFIG; 4016 sk->sk_state = BT_CONFIG;
4016 res = L2CAP_CR_SUCCESS; 4017 res = L2CAP_CR_SUCCESS;
diff --git a/net/sctp/output.c b/net/sctp/output.c
index b4f3cf06d8da..08b3cead6503 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -500,23 +500,20 @@ int sctp_packet_transmit(struct sctp_packet *packet)
500 * Note: Adler-32 is no longer applicable, as has been replaced 500 * Note: Adler-32 is no longer applicable, as has been replaced
501 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. 501 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
502 */ 502 */
503 if (!sctp_checksum_disable && 503 if (!sctp_checksum_disable) {
504 !(dst->dev->features & (NETIF_F_NO_CSUM | NETIF_F_SCTP_CSUM))) { 504 if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
505 __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); 505 __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
506 506
507 /* 3) Put the resultant value into the checksum field in the 507 /* 3) Put the resultant value into the checksum field in the
508 * common header, and leave the rest of the bits unchanged. 508 * common header, and leave the rest of the bits unchanged.
509 */ 509 */
510 sh->checksum = sctp_end_cksum(crc32); 510 sh->checksum = sctp_end_cksum(crc32);
511 } else { 511 } else {
512 if (dst->dev->features & NETIF_F_SCTP_CSUM) {
513 /* no need to seed pseudo checksum for SCTP */ 512 /* no need to seed pseudo checksum for SCTP */
514 nskb->ip_summed = CHECKSUM_PARTIAL; 513 nskb->ip_summed = CHECKSUM_PARTIAL;
515 nskb->csum_start = (skb_transport_header(nskb) - 514 nskb->csum_start = (skb_transport_header(nskb) -
516 nskb->head); 515 nskb->head);
517 nskb->csum_offset = offsetof(struct sctphdr, checksum); 516 nskb->csum_offset = offsetof(struct sctphdr, checksum);
518 } else {
519 nskb->ip_summed = CHECKSUM_UNNECESSARY;
520 } 517 }
521 } 518 }
522 519