From 24fd1dfff2c20db6ef9c0dcc44fc3c59a1099f5f Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Thu, 3 Sep 2009 12:34:19 +0300 Subject: [PATCH] --- yaml --- r: 168743 b: refs/heads/master c: 93f19c9fc8c98bb6d2e9825115989603ffd5cd1f h: refs/heads/master i: 168741: df24d95f320a55da3845bf65bf118a7b72bd7215 168739: 0a4585b1290317ea6f9af05b5e03ef12a2a37745 168735: 00df0452960b92c36cd9d626af20b969720c7828 v: v3 --- [refs] | 2 +- trunk/drivers/net/can/Kconfig | 60 ++++++++++++++++++++++++--- trunk/drivers/net/can/dev.c | 6 --- trunk/drivers/net/can/sja1000/Kconfig | 47 --------------------- trunk/drivers/net/can/usb/Kconfig | 10 ----- trunk/drivers/net/can/usb/Makefile | 2 - trunk/drivers/net/r8169.c | 4 +- trunk/drivers/net/s2io.c | 1 - trunk/include/net/sctp/structs.h | 2 +- trunk/net/bluetooth/hci_conn.c | 1 + trunk/net/ipv4/ipmr.c | 4 +- trunk/net/ipv4/tcp.c | 19 ++++----- trunk/net/sctp/associola.c | 4 +- trunk/net/sctp/sm_statefuns.c | 15 +++---- trunk/net/sctp/socket.c | 40 +++++++----------- trunk/net/sctp/transport.c | 3 +- 16 files changed, 93 insertions(+), 127 deletions(-) delete mode 100644 trunk/drivers/net/can/sja1000/Kconfig delete mode 100644 trunk/drivers/net/can/usb/Kconfig diff --git a/[refs] b/[refs] index 653ea4c5e4e8..139b7c0cc6bd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8812304cf1110ae16b0778680f6022216cf4716a +refs/heads/master: 93f19c9fc8c98bb6d2e9825115989603ffd5cd1f diff --git a/trunk/drivers/net/can/Kconfig b/trunk/drivers/net/can/Kconfig index 772f6d2489ce..df32c109b7ac 100644 --- a/trunk/drivers/net/can/Kconfig +++ b/trunk/drivers/net/can/Kconfig @@ -35,16 +35,66 @@ config CAN_CALC_BITTIMING arguments "tq", "prop_seg", "phase_seg1", "phase_seg2" and "sjw". If unsure, say Y. +config CAN_SJA1000 + depends on CAN_DEV && HAS_IOMEM + tristate "Philips SJA1000" + ---help--- + Driver for the SJA1000 CAN controllers from Philips or NXP + +config CAN_SJA1000_ISA + depends on CAN_SJA1000 && ISA + tristate "ISA Bus based legacy SJA1000 driver" + ---help--- + This driver adds legacy support for SJA1000 chips connected to + the ISA bus using I/O port, memory mapped or indirect access. + +config CAN_SJA1000_PLATFORM + depends on CAN_SJA1000 + tristate "Generic Platform Bus based SJA1000 driver" + ---help--- + This driver adds support for the SJA1000 chips connected to + the "platform bus" (Linux abstraction for directly to the + processor attached devices). Which can be found on various + boards from Phytec (http://www.phytec.de) like the PCM027, + PCM038. + +config CAN_SJA1000_OF_PLATFORM + depends on CAN_SJA1000 && PPC_OF + tristate "Generic OF Platform Bus based SJA1000 driver" + ---help--- + This driver adds support for the SJA1000 chips connected to + the OpenFirmware "platform bus" found on embedded systems with + OpenFirmware bindings, e.g. if you have a PowerPC based system + you may want to enable this option. + +config CAN_EMS_PCI + tristate "EMS CPC-PCI, CPC-PCIe and CPC-104P Card" + depends on PCI && CAN_SJA1000 + ---help--- + This driver is for the one, two or four channel CPC-PCI, + CPC-PCIe and CPC-104P cards from EMS Dr. Thomas Wuensche + (http://www.ems-wuensche.de). + +config CAN_EMS_USB + tristate "EMS CPC-USB/ARM7 CAN/USB interface" + depends on USB && CAN_DEV + ---help--- + This driver is for the one channel CPC-USB/ARM7 CAN/USB interface + from from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de). + +config CAN_KVASER_PCI + tristate "Kvaser PCIcanx and Kvaser PCIcan PCI Cards" + depends on PCI && CAN_SJA1000 + ---help--- + This driver is for the the PCIcanx and PCIcan cards (1, 2 or + 4 channel) from Kvaser (http://www.kvaser.com). + config CAN_AT91 tristate "Atmel AT91 onchip CAN controller" - depends on CAN_DEV && ARCH_AT91SAM9263 + depends on CAN && CAN_DEV && ARCH_AT91SAM9263 ---help--- This is a driver for the SoC CAN controller in Atmel's AT91SAM9263. -source "drivers/net/can/sja1000/Kconfig" - -source "drivers/net/can/usb/Kconfig" - config CAN_DEBUG_DEVICES bool "CAN devices debugging messages" depends on CAN diff --git a/trunk/drivers/net/can/dev.c b/trunk/drivers/net/can/dev.c index 2868fe842a41..564e31c9fee4 100644 --- a/trunk/drivers/net/can/dev.c +++ b/trunk/drivers/net/can/dev.c @@ -629,11 +629,6 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) return -EMSGSIZE; } -static size_t can_get_xstats_size(const struct net_device *dev) -{ - return sizeof(struct can_device_stats); -} - static int can_fill_xstats(struct sk_buff *skb, const struct net_device *dev) { struct can_priv *priv = netdev_priv(dev); @@ -662,7 +657,6 @@ static struct rtnl_link_ops can_link_ops __read_mostly = { .changelink = can_changelink, .get_size = can_get_size, .fill_info = can_fill_info, - .get_xstats_size = can_get_xstats_size, .fill_xstats = can_fill_xstats, }; diff --git a/trunk/drivers/net/can/sja1000/Kconfig b/trunk/drivers/net/can/sja1000/Kconfig deleted file mode 100644 index 4c674927f247..000000000000 --- a/trunk/drivers/net/can/sja1000/Kconfig +++ /dev/null @@ -1,47 +0,0 @@ -menuconfig CAN_SJA1000 - tristate "Philips/NXP SJA1000 devices" - depends on CAN_DEV && HAS_IOMEM - -if CAN_SJA1000 - -config CAN_SJA1000_ISA - tristate "ISA Bus based legacy SJA1000 driver" - depends on ISA - ---help--- - This driver adds legacy support for SJA1000 chips connected to - the ISA bus using I/O port, memory mapped or indirect access. - -config CAN_SJA1000_PLATFORM - tristate "Generic Platform Bus based SJA1000 driver" - ---help--- - This driver adds support for the SJA1000 chips connected to - the "platform bus" (Linux abstraction for directly to the - processor attached devices). Which can be found on various - boards from Phytec (http://www.phytec.de) like the PCM027, - PCM038. - -config CAN_SJA1000_OF_PLATFORM - tristate "Generic OF Platform Bus based SJA1000 driver" - depends on PPC_OF - ---help--- - This driver adds support for the SJA1000 chips connected to - the OpenFirmware "platform bus" found on embedded systems with - OpenFirmware bindings, e.g. if you have a PowerPC based system - you may want to enable this option. - -config CAN_EMS_PCI - tristate "EMS CPC-PCI, CPC-PCIe and CPC-104P Card" - depends on PCI - ---help--- - This driver is for the one, two or four channel CPC-PCI, - CPC-PCIe and CPC-104P cards from EMS Dr. Thomas Wuensche - (http://www.ems-wuensche.de). - -config CAN_KVASER_PCI - tristate "Kvaser PCIcanx and Kvaser PCIcan PCI Cards" - depends on PCI - ---help--- - This driver is for the the PCIcanx and PCIcan cards (1, 2 or - 4 channel) from Kvaser (http://www.kvaser.com). - -endif diff --git a/trunk/drivers/net/can/usb/Kconfig b/trunk/drivers/net/can/usb/Kconfig deleted file mode 100644 index bbc78e0b8a15..000000000000 --- a/trunk/drivers/net/can/usb/Kconfig +++ /dev/null @@ -1,10 +0,0 @@ -menu "CAN USB interfaces" - depends on USB && CAN_DEV - -config CAN_EMS_USB - tristate "EMS CPC-USB/ARM7 CAN/USB interface" - ---help--- - This driver is for the one channel CPC-USB/ARM7 CAN/USB interface - from from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de). - -endmenu diff --git a/trunk/drivers/net/can/usb/Makefile b/trunk/drivers/net/can/usb/Makefile index 0afd51d4c7a5..c3f75ba701b1 100644 --- a/trunk/drivers/net/can/usb/Makefile +++ b/trunk/drivers/net/can/usb/Makefile @@ -3,5 +3,3 @@ # obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o - -ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG diff --git a/trunk/drivers/net/r8169.c b/trunk/drivers/net/r8169.c index b9221bdc7184..fa4935678488 100644 --- a/trunk/drivers/net/r8169.c +++ b/trunk/drivers/net/r8169.c @@ -3243,9 +3243,9 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) static void rtl8169_set_rxbufsize(struct rtl8169_private *tp, struct net_device *dev) { - unsigned int max_frame = dev->mtu + VLAN_ETH_HLEN + ETH_FCS_LEN; + unsigned int mtu = dev->mtu; - tp->rx_buf_sz = (max_frame > RX_BUF_SIZE) ? max_frame : RX_BUF_SIZE; + tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE; } static int rtl8169_open(struct net_device *dev) diff --git a/trunk/drivers/net/s2io.c b/trunk/drivers/net/s2io.c index 0dd7839322bc..ddccf5fa56b6 100644 --- a/trunk/drivers/net/s2io.c +++ b/trunk/drivers/net/s2io.c @@ -3494,7 +3494,6 @@ static void s2io_reset(struct s2io_nic *sp) /* Restore the PCI state saved during initialization. */ pci_restore_state(sp->pdev); - pci_save_state(sp->pdev); pci_read_config_word(sp->pdev, 0x2, &val16); if (check_pci_device_id(val16) != (u16)PCI_ANY_ID) break; diff --git a/trunk/include/net/sctp/structs.h b/trunk/include/net/sctp/structs.h index cd2e18778f81..6e5f0e0c7967 100644 --- a/trunk/include/net/sctp/structs.h +++ b/trunk/include/net/sctp/structs.h @@ -1980,7 +1980,7 @@ void sctp_assoc_set_primary(struct sctp_association *, void sctp_assoc_del_nonprimary_peers(struct sctp_association *, struct sctp_transport *); int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, - sctp_scope_t, gfp_t); + gfp_t); int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, struct sctp_cookie*, gfp_t gfp); diff --git a/trunk/net/bluetooth/hci_conn.c b/trunk/net/bluetooth/hci_conn.c index a9750984f772..b7c4224f4e7d 100644 --- a/trunk/net/bluetooth/hci_conn.c +++ b/trunk/net/bluetooth/hci_conn.c @@ -211,6 +211,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst) conn->type = type; conn->mode = HCI_CM_ACTIVE; conn->state = BT_OPEN; + conn->auth_type = HCI_AT_GENERAL_BONDING; conn->power_save = 1; conn->disc_timeout = HCI_DISCONN_TIMEOUT; diff --git a/trunk/net/ipv4/ipmr.c b/trunk/net/ipv4/ipmr.c index 99508d66a642..630a56df7b47 100644 --- a/trunk/net/ipv4/ipmr.c +++ b/trunk/net/ipv4/ipmr.c @@ -483,10 +483,8 @@ static int vif_add(struct net *net, struct vifctl *vifc, int mrtsock) return -EINVAL; } - if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) { - dev_put(dev); + if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) return -EADDRNOTAVAIL; - } IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)++; ip_rt_multicast_event(in_dev); diff --git a/trunk/net/ipv4/tcp.c b/trunk/net/ipv4/tcp.c index f1813bc71088..98440ad82558 100644 --- a/trunk/net/ipv4/tcp.c +++ b/trunk/net/ipv4/tcp.c @@ -1183,9 +1183,7 @@ void tcp_cleanup_rbuf(struct sock *sk, int copied) #if TCP_DEBUG struct sk_buff *skb = skb_peek(&sk->sk_receive_queue); - WARN(skb && !before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq), - KERN_INFO "cleanup rbuf bug: copied %X seq %X rcvnxt %X\n", - tp->copied_seq, TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt); + WARN_ON(skb && !before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq)); #endif if (inet_csk_ack_scheduled(sk)) { @@ -1432,13 +1430,11 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, /* Now that we have two receive queues this * shouldn't happen. */ - if (WARN(before(*seq, TCP_SKB_CB(skb)->seq), - KERN_INFO "recvmsg bug: copied %X " - "seq %X rcvnxt %X fl %X\n", *seq, - TCP_SKB_CB(skb)->seq, tp->rcv_nxt, - flags)) + if (before(*seq, TCP_SKB_CB(skb)->seq)) { + printk(KERN_INFO "recvmsg bug: copied %X " + "seq %X\n", *seq, TCP_SKB_CB(skb)->seq); break; - + } offset = *seq - TCP_SKB_CB(skb)->seq; if (tcp_hdr(skb)->syn) offset--; @@ -1447,9 +1443,8 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, if (tcp_hdr(skb)->fin) goto found_fin_ok; WARN(!(flags & MSG_PEEK), KERN_INFO "recvmsg bug 2: " - "copied %X seq %X rcvnxt %X fl %X\n", - *seq, TCP_SKB_CB(skb)->seq, - tp->rcv_nxt, flags); + "copied %X seq %X\n", *seq, + TCP_SKB_CB(skb)->seq); } /* Well, if we have backlog, try to process it now yet. */ diff --git a/trunk/net/sctp/associola.c b/trunk/net/sctp/associola.c index 7eed77a39d0d..8450960df24f 100644 --- a/trunk/net/sctp/associola.c +++ b/trunk/net/sctp/associola.c @@ -1485,13 +1485,15 @@ void sctp_assoc_rwnd_decrease(struct sctp_association *asoc, unsigned len) * local endpoint and the remote peer. */ int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc, - sctp_scope_t scope, gfp_t gfp) + gfp_t gfp) { + sctp_scope_t scope; int flags; /* Use scoping rules to determine the subset of addresses from * the endpoint. */ + scope = sctp_scope(&asoc->peer.active_path->ipaddr); flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0; if (asoc->peer.ipv4_address) flags |= SCTP_ADDR4_PEERSUPP; diff --git a/trunk/net/sctp/sm_statefuns.c b/trunk/net/sctp/sm_statefuns.c index d4df45022ffa..c8fae1983dd1 100644 --- a/trunk/net/sctp/sm_statefuns.c +++ b/trunk/net/sctp/sm_statefuns.c @@ -384,11 +384,6 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep, if (!new_asoc) goto nomem; - if (sctp_assoc_set_bind_addr_from_ep(new_asoc, - sctp_scope(sctp_source(chunk)), - GFP_ATOMIC) < 0) - goto nomem_init; - /* The call, sctp_process_init(), can fail on memory allocation. */ if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type, sctp_source(chunk), @@ -406,6 +401,9 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep, len = ntohs(err_chunk->chunk_hdr->length) - sizeof(sctp_chunkhdr_t); + if (sctp_assoc_set_bind_addr_from_ep(new_asoc, GFP_ATOMIC) < 0) + goto nomem_init; + repl = sctp_make_init_ack(new_asoc, chunk, GFP_ATOMIC, len); if (!repl) goto nomem_init; @@ -1454,10 +1452,6 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( if (!new_asoc) goto nomem; - if (sctp_assoc_set_bind_addr_from_ep(new_asoc, - sctp_scope(sctp_source(chunk)), GFP_ATOMIC) < 0) - goto nomem; - /* In the outbound INIT ACK the endpoint MUST copy its current * Verification Tag and Peers Verification tag into a reserved * place (local tie-tag and per tie-tag) within the state cookie. @@ -1494,6 +1488,9 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( sizeof(sctp_chunkhdr_t); } + if (sctp_assoc_set_bind_addr_from_ep(new_asoc, GFP_ATOMIC) < 0) + goto nomem; + repl = sctp_make_init_ack(new_asoc, chunk, GFP_ATOMIC, len); if (!repl) goto nomem; diff --git a/trunk/net/sctp/socket.c b/trunk/net/sctp/socket.c index 3a95fcb17a9e..c8d05758661d 100644 --- a/trunk/net/sctp/socket.c +++ b/trunk/net/sctp/socket.c @@ -1080,13 +1080,6 @@ static int __sctp_connect(struct sock* sk, err = -ENOMEM; goto out_free; } - - err = sctp_assoc_set_bind_addr_from_ep(asoc, scope, - GFP_KERNEL); - if (err < 0) { - goto out_free; - } - } /* Prime the peer's transport structures. */ @@ -1102,6 +1095,11 @@ static int __sctp_connect(struct sock* sk, walk_size += af->sockaddr_len; } + err = sctp_assoc_set_bind_addr_from_ep(asoc, GFP_KERNEL); + if (err < 0) { + goto out_free; + } + /* In case the user of sctp_connectx() wants an association * id back, assign one now. */ @@ -1276,30 +1274,22 @@ SCTP_STATIC int sctp_setsockopt_connectx(struct sock* sk, } /* - * New (hopefully final) interface for the API. - * We use the sctp_getaddrs_old structure so that use-space library - * can avoid any unnecessary allocations. The only defferent part - * is that we store the actual length of the address buffer into the - * addrs_num structure member. That way we can re-use the existing - * code. + * New (hopefully final) interface for the API. The option buffer is used + * both for the returned association id and the addresses. */ SCTP_STATIC int sctp_getsockopt_connectx3(struct sock* sk, int len, char __user *optval, int __user *optlen) { - struct sctp_getaddrs_old param; sctp_assoc_t assoc_id = 0; int err = 0; - if (len < sizeof(param)) + if (len < sizeof(assoc_id)) return -EINVAL; - if (copy_from_user(¶m, optval, sizeof(param))) - return -EFAULT; - err = __sctp_setsockopt_connectx(sk, - (struct sockaddr __user *)param.addrs, - param.addr_num, &assoc_id); + (struct sockaddr __user *)(optval + sizeof(assoc_id)), + len - sizeof(assoc_id), &assoc_id); if (err == 0 || err == -EINPROGRESS) { if (copy_to_user(optval, &assoc_id, sizeof(assoc_id))) @@ -1699,11 +1689,6 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, goto out_unlock; } asoc = new_asoc; - err = sctp_assoc_set_bind_addr_from_ep(asoc, scope, GFP_KERNEL); - if (err < 0) { - err = -ENOMEM; - goto out_free; - } /* If the SCTP_INIT ancillary data is specified, set all * the association init values accordingly. @@ -1733,6 +1718,11 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, err = -ENOMEM; goto out_free; } + err = sctp_assoc_set_bind_addr_from_ep(asoc, GFP_KERNEL); + if (err < 0) { + err = -ENOMEM; + goto out_free; + } } /* ASSERT: we have a valid association at this point. */ diff --git a/trunk/net/sctp/transport.c b/trunk/net/sctp/transport.c index 3b141bb32faf..c256e4839316 100644 --- a/trunk/net/sctp/transport.c +++ b/trunk/net/sctp/transport.c @@ -308,8 +308,7 @@ void sctp_transport_route(struct sctp_transport *transport, /* Initialize sk->sk_rcv_saddr, if the transport is the * association's active path for getsockname(). */ - if (asoc && (!asoc->peer.primary_path || - (transport == asoc->peer.active_path))) + if (asoc && (transport == asoc->peer.active_path)) opt->pf->af->to_sk_saddr(&transport->saddr, asoc->base.sk); } else