summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vxlan: fix a shadow local variableWANG Cong2015-04-081-1/+0
| | | | | | | | | | Commit 79b16aadea32cce077 ("udp_tunnel: Pass UDP socket down through udp_tunnel{, 6}_xmit_skb()") introduce 'sk' but we already have one inner 'sk'. Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'hv_netvsc_linearize'David S. Miller2015-04-081-13/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vitaly Kuznetsov says: ==================== hv_netvsc: linearize SKBs bigger than MAX_PAGE_BUFFER_COUNT-2 pages This patch series fixes the same issue which was fixed in Xen with commit 97a6d1bb2b658ac85ed88205ccd1ab809899884d ("xen-netfront: Fix handling packets on compound pages with skb_linearize"). It is relatively easy to create a packet which is small in size but occupies more than 30 (MAX_PAGE_BUFFER_COUNT-2) pages. Here is a kernel-mode reproducer which tries sending a packet with only 34 bytes of payload (but on 34 pages) and fails: static int __init sendfb_init(void) { struct socket *sock; int i, ret; struct sockaddr_in in4_addr = { 0 }; struct page *pages[17]; unsigned long flags; ret = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock); if (ret) { pr_err("failed to create socket: %d!\n", ret); return ret; } in4_addr.sin_family = AF_INET; /* www.google.com, 74.125.133.99 */ in4_addr.sin_addr.s_addr = cpu_to_be32(0x4a7d8563); in4_addr.sin_port = cpu_to_be16(80); ret = sock->ops->connect(sock, (struct sockaddr *)&in4_addr, sizeof(in4_addr), 0); if (ret) { pr_err("failed to connect: %d!\n", ret); return ret; } /* We can send up to 17 frags */ flags = MSG_MORE; for (i = 0; i < 17; i++) { if (i == 16) flags = MSG_EOR; pages[i] = alloc_pages(GFP_KERNEL | __GFP_COMP, 1); if (!pages[i]) { pr_err("out of memory!"); goto free_pages; } sock->ops->sendpage(sock, pages[i], PAGE_SIZE -1, 2, flags); } free_pages: for (; i > 0; i--) __free_pages(pages[i - 1], 1); printk("sendfb_init: test done\n"); return -1; } module_init(sendfb_init); MODULE_LICENSE("GPL"); A try to load such module results in multiple 'kernel: hv_netvsc vmbus_15 eth0: Packet too big: 100' messages as all retries fail as well. It should also be possible to trigger the issue from userspace, I expect e.g. NFS under heavy load to get stuck sometimes. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * hv_netvsc: try linearizing big SKBs before dropping themVitaly Kuznetsov2015-04-081-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | In netvsc_start_xmit() we can handle packets which are scattered around not more than MAX_PAGE_BUFFER_COUNT-2 pages. It is, however, easy to create a packet which is not big in size but occupies more pages (e.g. if it uses frags on compound pages boundaries). When we drop such packet it cases sender to try resending it but in most cases it will try resending the same packet which will also get dropped, this will cause the particular connection to stick. To solve the issue we can try linearizing skb. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * hv_netvsc: use single existing drop path in netvsc_start_xmitVitaly Kuznetsov2015-04-081-8/+6
|/ | | | | | | | | | | ... which validly uses dev_kfree_skb_any() instead of dev_kfree_skb(). Setting ret to -EFAULT and -ENOMEM have no real meaning here (we need to set it to anything but -EAGAIN) as we drop the packet and return NETDEV_TX_OK anyway. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'sfc-next'David S. Miller2015-04-0816-207/+454
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shradha Shah says: ==================== sfc: Nic specific sriov functions, netdev_ops and sriov_configure First two patches among the series of patches to support SRIOV on EF10. First patch declares nic specific sriov functions in nic specific headers, creates only one instance of the netdev_ops, removes sriov functionality from Falcon code. Second patch adds support for sriov_configure. The Virtual Functions can be enabled but they do not bind to the SFC driver just yet. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * sfc: Enable VF's via a write to the sysfs file sriov_numvfsShradha Shah2015-04-089-1/+87
| | | | | | | | | | | | | | | | This patch adds support for the use of sriov_configure on EF10 to enable Virtual Functions while the driver is loaded. Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * sfc: Own header for nic-specific sriov functions, single instance of ↵Shradha Shah2015-04-0815-207/+368
|/ | | | | | | | | | | | | | | | | | | netdev_ops and sriov removed from Falcon code By putting all the efx_{siena,ef10}_sriov_* declarations in {siena,ef10}_sriov.h, ensure they cannot be called from nic-generic code. Also fixes up an instance of this, where mcdi.c was calling efx_siena_sriov_flr. The single instance of netdev_ops should call general high level functions that can then call something adapter specific in efx_nic_type. We should only do adapter specialisation via efx_nic_type. Removal of sriov functionality from the Falcon code means that tests are needed for the presence of some callbacks. Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'dma_rmb_wmb'David S. Miller2015-04-086-29/+29
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alexander Duyck says: ==================== Replace wmb()/rmb() with dma_wmb()/dma_rmb() where appropriate This is a start of a side project cleaning up the drivers that can make use of the dma_wmb and dma_rmb calls. The general idea is to start removing the unnecessary wmb/rmb calls from a number of drivers and to make use of the lighter weight dma_wmb/dma_rmb calls as this should allow for an overall improvement in performance as each barrier can cost a significant number of cycles and on architectures such as x86 this is unnecessary. These changes are what I would consider low hanging fruit. The likelihood of the changes introducing an error should be low since the use of the barriers in these cases are fairly obvious. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * e1000, e1000e: Use dma_rmb instead of rmb for descriptor read orderingAlexander Duyck2015-04-082-7/+7
| | | | | | | | | | | | | | | | | | | | This change replaces calls to rmb with dma_rmb in the case where we want to order all follow-on descriptor reads after the check for the descriptor status bit. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * s2io: Update driver to use dma_wmbAlexander Duyck2015-04-081-4/+4
| | | | | | | | | | | | | | | | | | This change updates several spots where a wmb was being used to instead use a dma_wmb to flush out writes before updating the control portion of the descriptor. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * sungem, sunhme, sunvnet: Update drivers to use dma_wmb/rmbAlexander Duyck2015-04-083-18/+18
|/ | | | | | | | | This patch goes through and replaces wmb/rmb with dma_wmb/dma_rmb in cases where the barrier is being used to order writes or reads to just memory and doesn't involve any programmed I/O. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bonding: Remove unnecessary initializationMahesh Bandewar2015-04-081-9/+0
| | | | | | | | bond_3ad_bind_slave() calls ad_initialize_port() and then immediately assigns correct values making some of that initialization unnecessary. Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bonding: Code re-factoring for admin, oper-key operationsMahesh Bandewar2015-04-081-16/+13
| | | | | | | | | This patch breaks the rich assignments into it's own statements and removes some duplicate code where admin-key, & oper-key are updated. Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ipv6: call iptunnel_xmit with NULL sock pointer if no tunnel sock is availableHannes Frederic Sowa2015-04-081-1/+1
| | | | | | | Fixes: 79b16aadea32cce ("udp_tunnel: Pass UDP socket down through udp_tunnel{, 6}_xmit_skb().") Reported-by: David S. Miller <davem@davemloft.net> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* ipv4: ip_tunnel: use net namespace from rtable not socketHannes Frederic Sowa2015-04-081-1/+2
| | | | | | | | | | | | | The socket parameter might legally be NULL, thus sock_net is sometimes causing a NULL pointer dereference. Using net_device pointer in dst_entry is more reliable. Fixes: b6a7719aedd7e5c ("ipv4: hash net ptr into fragmentation bucket selection") Reported-by: Rick Jones <rick.jones2@hp.com> Cc: Rick Jones <rick.jones2@hp.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: remove extra newlinesSheng Yong2015-04-075-14/+0
| | | | | Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hv_netvsc: Fix the packet free when it is in skb headroomHaiyang Zhang2015-04-073-3/+6
| | | | | | | | | In the two places changed, we now use netvsc_xmit_completion() which properly frees hv_netvsc_packet in or not in skb headroom. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hv_netvsc: Define a macro RNDIS_AND_PPI_SIZEHaiyang Zhang2015-04-072-12/+9
| | | | | | | | | The sum of RNDIS msg and PPI struct sizes is used in multiple places, so we define a macro for them. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hv_netvsc: Clean up two unused variablesHaiyang Zhang2015-04-073-4/+0
| | | | | | Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tcp: RFC7413 option support for Fast Open clientDaniel Lee2015-04-076-15/+39
| | | | | | | | | | | | | | | | | | | | | | Fast Open has been using an experimental option with a magic number (RFC6994). This patch makes the client by default use the RFC7413 option (34) to get and send Fast Open cookies. This patch makes the client solicit cookies from a given server first with the RFC7413 option. If that fails to elicit a cookie, then it tries the RFC6994 experimental option. If that also fails, it uses the RFC7413 option on all subsequent connect attempts. If the server returns a Fast Open cookie then the client caches the form of the option that successfully elicited a cookie, and uses that form on later connects when it presents that cookie. The idea is to gradually obsolete the use of experimental options as the servers and clients upgrade, while keeping the interoperability meanwhile. Signed-off-by: Daniel Lee <Longinus00@gmail.com> Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tcp: RFC7413 option support for Fast Open serverDaniel Lee2015-04-075-23/+57
| | | | | | | | | | | | | | | Fast Open has been using the experimental option with a magic number (RFC6994) to request and grant Fast Open cookies. This patch enables the server to support the official IANA option 34 in RFC7413 in addition. The change has passed all existing Fast Open tests with both old and new options at Google. Signed-off-by: Daniel Lee <Longinus00@gmail.com> Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cxgb4: Move ethtool related code to a separate fileHariprasad Shenai2015-04-075-1608/+1702
| | | | | Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdevice.h: remove iflink descriptionNicolas Dichtel2015-04-071-2/+1
| | | | | | | | | Also move 'group' description to match the order of the net_device structure. Fixes: 7a66bbc96ce9 ("net: remove iflink field from struct net_device") Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'netns-next'David S. Miller2015-04-072-10/+97
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nicolas Dichtel says: ==================== netns: enhance netlink interface for nsid The first patch is a small cleanup. The second patch implements notifications for netns id events. And the last one allows to dump existing netns id from userland. iproute2 patches are available, I can send them on demand. v2: drop the first patch (the fix is now in net-next) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * netns: allow to dump netns idsNicolas Dichtel2015-04-071-1/+48
| | | | | | | | | | | | | | | | Which this patch, it's possible to dump the list of ids allocated for peer netns. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * netns: notify netns id eventsNicolas Dichtel2015-04-072-8/+48
| | | | | | | | | | | | | | | | | | | | | | With this patch, netns ids that are created and deleted are advertised into the group RTNLGRP_NSID. Because callers of rtnl_net_notifyid() already know the id of the peer, there is no need to call __peernet2id() in rtnl_net_fill(). Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * netns: minor cleanup in rtnl_net_getid()Nicolas Dichtel2015-04-071-1/+1
|/ | | | | | | No need to initialize err, it will be overridden by the value of nlmsg_parse(). Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'udp_tunnel_sk'David S. Miller2015-04-0751-251/+349
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent UDP tunnels from operating on garbage socket So this should do the rest of the work such that when we encapsulate into a UDP tunnel, the output path works on the UDP tunnel's socket rather than skb->sk. Part of this work is based upon changes done by Jiri Pirko some time ago. Basically the first step is to pass the socket through the nf_hook okfn(), and then next we do the same for the UDP tunnel xmit routines. Signed-off-by: David S. Miller <davem@davemloft.net>
| * udp_tunnel: Pass UDP socket down through udp_tunnel{, 6}_xmit_skb().David Miller2015-04-0714-28/+48
| | | | | | | | | | | | | | | | | | | | | | That was we can make sure the output path of ipv4/ipv6 operate on the UDP socket rather than whatever random thing happens to be in skb->sk. Based upon a patch by Jiri Pirko. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
| * netfilter: Pass socket pointer down through okfn().David Miller2015-04-0739-218/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the output paths in particular, we have to sometimes deal with two socket contexts. First, and usually skb->sk, is the local socket that generated the frame. And second, is potentially the socket used to control a tunneling socket, such as one the encapsulates using UDP. We do not want to disassociate skb->sk when encapsulating in order to fix this, because that would break socket memory accounting. The most extreme case where this can cause huge problems is an AF_PACKET socket transmitting over a vxlan device. We hit code paths doing checks that assume they are dealing with an ipv4 socket, but are actually operating upon the AF_PACKET one. Signed-off-by: David S. Miller <davem@davemloft.net>
| * netfilter: Add socket pointer to nf_hook_state.David Miller2015-04-072-1/+10
| | | | | | | | | | | | | | | | It is currently always set to NULL, but nf_queue is adjusted to be prepared for it being set to a real socket by taking and releasing a reference to that socket when necessary. Signed-off-by: David S. Miller <davem@davemloft.net>
| * netfilter: Add nf_hook_state initializer function.David Miller2015-04-071-8/+18
|/ | | | | | | | | | This way we can consolidate where we setup new nf_hook_state objects, to make sure the entire thing is initialized. The only other place an nf_hook_object is instantiated is nf_queue, wherein a structure copy is used. Signed-off-by: David S. Miller <davem@davemloft.net>
* cosa: fix error return codeJulia Lawall2015-04-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return a negative error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
* wan: lmc: fix error return codeJulia Lawall2015-04-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return a negative error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'for-upstream' of ↵David S. Miller2015-04-0722-338/+570
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Johan Hedberg says: ==================== pull request: bluetooth-next 2015-04-04 Here's what's probably the last bluetooth-next pull request for 4.1: - Fixes for LE advertising data & advertising parameters - Fix for race condition with HCI_RESET flag - New BNEPGETSUPPFEAT ioctl, needed for certification - New HCI request callback type to get the resulting skb - Cleanups to use BIT() macro wherever possible - Consolidate Broadcom device entries in the btusb HCI driver - Check for valid flags in CMTP, HIDP & BNEP - Disallow local privacy & OOB data combo to prevent a potential race - Expose SMP & ECDH selftest results through debugfs - Expose current Device ID info through debugfs Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * Bluetooth: Fix location of TX power field in LE advertising dataMarcel Holtmann2015-04-041-6/+8
| | | | | | | | | | | | | | | | | | The TX power field in the LE advertising data should be placed last since it needs to be possible to enable kernel controlled TX power, but still allow for userspace provided flags field. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: hidp: Use BIT(x) instead of (1 << x)Marcel Holtmann2015-04-041-2/+2
| | | | | | | | | | Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: cmtp: Use BIT(x) instead of (1 << x)Marcel Holtmann2015-04-042-3/+3
| | | | | | | | | | Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: bnep: Handle BNEP connection setup requestGrzegorz Kolodziejczyk2015-04-033-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | With this patch kernel will be able to handle setup request. This is needed if we would like to handle control mesages with extension headers. User space will be only resposible for reading setup data and checking if scenario is conformance to specification (dst and src device bnep role). In case of new user space, setup data must be leaved(peek msg) on queue. New bnep session will be responsible for handling this data. Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: bnep: Add support to extended headers of control framesGrzegorz Kolodziejczyk2015-04-031-10/+36
| | | | | | | | | | | | | | | | | | | | | | Handling extended headers of control frames is required BNEP functionality. This patch refractor bnep rx frame handling function. Extended header for control frames shouldn't be omitted as it was previously done. Every control frame should be checked if it contains extended header and then every extension should be parsed separately. Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: bnep: Add support for get bnep features via ioctlGrzegorz Kolodziejczyk2015-04-033-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed if user space wants to know supported bnep features by kernel, e.g. if kernel supports sending response to bnep setup control message. By now there is no possibility to know supported features by kernel in case of bnep. Ioctls allows only to add connection, delete connection, get connection list, get connection info. Adding connection if it's possible (establishing network device connection) is equivalent to starting bnep session. Bnep session handles data queue of transmit, receive messages over bnep channel. It means that if we add connection the received/transmitted data will be parsed immediately. In case of get bnep features we want to know before session start, if we should leave setup data on socket queue and let kernel to handle with it, or in case of no setup handling support, if we should pull this message and handle setup response within user space. Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: bnep: Return err value while sending cmd is not understoodGrzegorz Kolodziejczyk2015-04-031-1/+1
| | | | | | | | | | | | | | | | Send command not understood response should be verified if it was successfully sent, like all send responses. Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Disallow LE local out-of-band data when LE privacy is usedMarcel Holtmann2015-04-021-6/+19
| | | | | | | | | | | | | | | | | | | | When the LE pivacy feature is used, then pairing has to happen based on resolvable random addresses (RPA), but currently there is no clean way to retrieve the correct RPA. So instead of returning an outdated RPA, just disallow this command when LE privacy is in use. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * Bluetooth: Convert local OOB data reading to use HCI requestJohan Hedberg2015-04-023-54/+65
| | | | | | | | | | | | | | | | | | | | | | | | Now that there's a HCI request API available where the callback receives the resulting skb, we can convert the local OOB data reading to use this new API. This patch does the necessary update in mgmt.c (which also requires moving the callback higher up since it's now a static function) and removes the custom calls from hci_event.c that are no-longer necessary. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Move hci_get_cmd_complete() to hci_event.cJohan Hedberg2015-04-022-51/+58
| | | | | | | | | | | | | | | | | | | | | | | | To make the hci_req_run_skb() API consistent with hci_cmd_sync_ev() the callback should receive the cmd_complete parameters in the 'normal' case and the full HCI event if a special event was expected. This patch moves the hci_get_cmd_complete() function from hci_core.c to hci_event.c where it's used to strip the skb from the needed headers before passing it on to the callback. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Remove unused hci_req_pending() functionJohan Hedberg2015-04-022-7/+0
| | | | | | | | | | | | | | | | The hci_req_pending() function has no users anymore, so simply remove it. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Remove unneeded recv_event variableJohan Hedberg2015-04-023-16/+0
| | | | | | | | | | | | | | | | | | Now that the synchronous HCI requests use the new API and a new private variable the recv_evt member of hci_dev is no-longer needed. This patch removes it. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Convert hci_req_sync family of function to new request APIJohan Hedberg2015-04-022-14/+15
| | | | | | | | | | | | | | | | | | | | | | Now that there's an API in place that allows passing the resulting skb to the request callback we can conveniently convert the hci_req_sync and related functions to use it. Since we still need to get the skb from the async callback into the sleeping _sync() function the patch adds another req_skb variable to hci_dev where the sync request state is tracked. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add second hci_request callback option for full skbJohan Hedberg2015-04-025-44/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a second possible callback for HCI requests where the callback will receive the full skb of the last successfully completed HCI command. This API is useful for cases where we want to use a request to read some data and the existing hci_event.c handlers do not store it e.g. in the hci_dev struct. The reason the patch is a bit bigger than just adding the new API is because the hci_req_cmd_complete() functions required some refactoring to enable it: now hci_req_cmd_complete() is simply used to request the callback pointers if any, and the actual calling of them happens from a single place at the end of hci_event_packet(). The reason for this is that we need to pass the original skb (without any skb_pull, etc modifications done to it) and it's simplest to keep track of it within the hci_event_packet() function. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add clarifying comment to command status handlingJohan Hedberg2015-04-021-0/+6
| | | | | | | | | | | | | | | | | | | | When dealing with HCI command status events, the reasoning for trying to mark a request as complete if no specific event is being waited for and status was success is not self-evident. This patch adds a clarifying comment above the if-statement. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
OpenPOWER on IntegriCloud