Commit 3d68bd00 authored by Linus Torvalds's avatar Linus Torvalds

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
parents efcbae25 05e9a2f6
...@@ -1428,9 +1428,9 @@ static u32 bond_fix_features(struct net_device *dev, u32 features) ...@@ -1428,9 +1428,9 @@ static u32 bond_fix_features(struct net_device *dev, u32 features)
return features; return features;
} }
#define BOND_VLAN_FEATURES (NETIF_F_ALL_TX_OFFLOADS | \ #define BOND_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \
NETIF_F_SOFT_FEATURES | \ NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
NETIF_F_LRO) NETIF_F_HIGHDMA | NETIF_F_LRO)
static void bond_compute_features(struct bonding *bond) static void bond_compute_features(struct bonding *bond)
{ {
......
...@@ -2289,6 +2289,23 @@ static int gfar_set_mac_address(struct net_device *dev) ...@@ -2289,6 +2289,23 @@ static int gfar_set_mac_address(struct net_device *dev)
return 0; return 0;
} }
/* Check if rx parser should be activated */
void gfar_check_rx_parser_mode(struct gfar_private *priv)
{
struct gfar __iomem *regs;
u32 tempval;
regs = priv->gfargrp[0].regs;
tempval = gfar_read(&regs->rctrl);
/* If parse is no longer required, then disable parser */
if (tempval & RCTRL_REQ_PARSER)
tempval |= RCTRL_PRSDEP_INIT;
else
tempval &= ~RCTRL_PRSDEP_INIT;
gfar_write(&regs->rctrl, tempval);
}
/* Enables and disables VLAN insertion/extraction */ /* Enables and disables VLAN insertion/extraction */
static void gfar_vlan_rx_register(struct net_device *dev, static void gfar_vlan_rx_register(struct net_device *dev,
...@@ -2325,12 +2342,9 @@ static void gfar_vlan_rx_register(struct net_device *dev, ...@@ -2325,12 +2342,9 @@ static void gfar_vlan_rx_register(struct net_device *dev,
/* Disable VLAN tag extraction */ /* Disable VLAN tag extraction */
tempval = gfar_read(&regs->rctrl); tempval = gfar_read(&regs->rctrl);
tempval &= ~RCTRL_VLEX; tempval &= ~RCTRL_VLEX;
/* If parse is no longer required, then disable parser */
if (tempval & RCTRL_REQ_PARSER)
tempval |= RCTRL_PRSDEP_INIT;
else
tempval &= ~RCTRL_PRSDEP_INIT;
gfar_write(&regs->rctrl, tempval); gfar_write(&regs->rctrl, tempval);
gfar_check_rx_parser_mode(priv);
} }
gfar_change_mtu(dev, dev->mtu); gfar_change_mtu(dev, dev->mtu);
......
...@@ -274,7 +274,7 @@ extern const char gfar_driver_version[]; ...@@ -274,7 +274,7 @@ extern const char gfar_driver_version[];
#define RCTRL_PROM 0x00000008 #define RCTRL_PROM 0x00000008
#define RCTRL_EMEN 0x00000002 #define RCTRL_EMEN 0x00000002
#define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \ #define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \
RCTRL_TUCSEN) RCTRL_TUCSEN | RCTRL_FILREN)
#define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \ #define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \
RCTRL_PRSDEP_INIT) RCTRL_PRSDEP_INIT)
#define RCTRL_EXTHASH (RCTRL_GHTX) #define RCTRL_EXTHASH (RCTRL_GHTX)
...@@ -1156,6 +1156,7 @@ extern void gfar_configure_coalescing(struct gfar_private *priv, ...@@ -1156,6 +1156,7 @@ extern void gfar_configure_coalescing(struct gfar_private *priv,
unsigned long tx_mask, unsigned long rx_mask); unsigned long tx_mask, unsigned long rx_mask);
void gfar_init_sysfs(struct net_device *dev); void gfar_init_sysfs(struct net_device *dev);
int gfar_set_features(struct net_device *dev, u32 features); int gfar_set_features(struct net_device *dev, u32 features);
extern void gfar_check_rx_parser_mode(struct gfar_private *priv);
extern const struct ethtool_ops gfar_ethtool_ops; extern const struct ethtool_ops gfar_ethtool_ops;
......
...@@ -677,9 +677,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) ...@@ -677,9 +677,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
if (status & RX_FIFO_FULL) if (status & RX_FIFO_FULL)
dev->stats.rx_fifo_errors++; dev->stats.rx_fifo_errors++;
/* Mask off RX interrupt */ if (likely(napi_schedule_prep(&lp->napi))) {
misr &= ~RX_INTS; /* Mask off RX interrupt */
napi_schedule(&lp->napi); misr &= ~RX_INTS;
__napi_schedule(&lp->napi);
}
} }
/* TX interrupt request */ /* TX interrupt request */
......
...@@ -1097,12 +1097,6 @@ struct net_device { ...@@ -1097,12 +1097,6 @@ struct net_device {
#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ #define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
NETIF_F_FSO) NETIF_F_FSO)
#define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
NETIF_F_HIGHDMA | \
NETIF_F_SCTP_CSUM | \
NETIF_F_ALL_FCOE)
/* /*
* If one device supports one of these features, then enable them * If one device supports one of these features, then enable them
* for all in netdev_increment_features. * for all in netdev_increment_features.
......
...@@ -528,7 +528,11 @@ static int vlan_dev_init(struct net_device *dev) ...@@ -528,7 +528,11 @@ static int vlan_dev_init(struct net_device *dev)
(1<<__LINK_STATE_DORMANT))) | (1<<__LINK_STATE_DORMANT))) |
(1<<__LINK_STATE_PRESENT); (1<<__LINK_STATE_PRESENT);
dev->hw_features = NETIF_F_ALL_TX_OFFLOADS; dev->hw_features = NETIF_F_ALL_CSUM | NETIF_F_SG |
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO |
NETIF_F_HIGHDMA | NETIF_F_SCTP_CSUM |
NETIF_F_ALL_FCOE;
dev->features |= real_dev->vlan_features | NETIF_F_LLTX; dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
dev->gso_max_size = real_dev->gso_max_size; dev->gso_max_size = real_dev->gso_max_size;
......
...@@ -620,7 +620,8 @@ static void l2cap_conn_start(struct l2cap_conn *conn) ...@@ -620,7 +620,8 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
struct sock *parent = bt_sk(sk)->parent; struct sock *parent = bt_sk(sk)->parent;
rsp.result = cpu_to_le16(L2CAP_CR_PEND); rsp.result = cpu_to_le16(L2CAP_CR_PEND);
rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND); rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND);
parent->sk_data_ready(parent, 0); if (parent)
parent->sk_data_ready(parent, 0);
} else { } else {
sk->sk_state = BT_CONFIG; sk->sk_state = BT_CONFIG;
...@@ -2323,8 +2324,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr ...@@ -2323,8 +2324,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
sk = chan->sk; sk = chan->sk;
if ((bt_sk(sk)->defer_setup && sk->sk_state != BT_CONNECT2) || if (sk->sk_state != BT_CONFIG && sk->sk_state != BT_CONNECT2) {
(!bt_sk(sk)->defer_setup && sk->sk_state != BT_CONFIG)) {
struct l2cap_cmd_rej rej; struct l2cap_cmd_rej rej;
rej.reason = cpu_to_le16(0x0002); rej.reason = cpu_to_le16(0x0002);
...@@ -4010,7 +4010,8 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) ...@@ -4010,7 +4010,8 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
struct sock *parent = bt_sk(sk)->parent; struct sock *parent = bt_sk(sk)->parent;
res = L2CAP_CR_PEND; res = L2CAP_CR_PEND;
stat = L2CAP_CS_AUTHOR_PEND; stat = L2CAP_CS_AUTHOR_PEND;
parent->sk_data_ready(parent, 0); if (parent)
parent->sk_data_ready(parent, 0);
} else { } else {
sk->sk_state = BT_CONFIG; sk->sk_state = BT_CONFIG;
res = L2CAP_CR_SUCCESS; res = L2CAP_CR_SUCCESS;
......
...@@ -500,23 +500,20 @@ int sctp_packet_transmit(struct sctp_packet *packet) ...@@ -500,23 +500,20 @@ int sctp_packet_transmit(struct sctp_packet *packet)
* Note: Adler-32 is no longer applicable, as has been replaced * Note: Adler-32 is no longer applicable, as has been replaced
* by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
*/ */
if (!sctp_checksum_disable && if (!sctp_checksum_disable) {
!(dst->dev->features & (NETIF_F_NO_CSUM | NETIF_F_SCTP_CSUM))) { if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
/* 3) Put the resultant value into the checksum field in the /* 3) Put the resultant value into the checksum field in the
* common header, and leave the rest of the bits unchanged. * common header, and leave the rest of the bits unchanged.
*/ */
sh->checksum = sctp_end_cksum(crc32); sh->checksum = sctp_end_cksum(crc32);
} else { } else {
if (dst->dev->features & NETIF_F_SCTP_CSUM) {
/* no need to seed pseudo checksum for SCTP */ /* no need to seed pseudo checksum for SCTP */
nskb->ip_summed = CHECKSUM_PARTIAL; nskb->ip_summed = CHECKSUM_PARTIAL;
nskb->csum_start = (skb_transport_header(nskb) - nskb->csum_start = (skb_transport_header(nskb) -
nskb->head); nskb->head);
nskb->csum_offset = offsetof(struct sctphdr, checksum); nskb->csum_offset = offsetof(struct sctphdr, checksum);
} else {
nskb->ip_summed = CHECKSUM_UNNECESSARY;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment