aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2014-12-05Bluetooth: Add support for enabling Extended Scanner Filter PoliciesMarcel Holtmann1-0/+13
The new Extended Scanner Filter Policies feature has to be enabled by selecting the correct filter policy for the scan parameters. This patch does that when the controller has been enabled to use LE Privacy. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Add support for handling LE Direct Advertising Report eventsMarcel Holtmann1-2/+55
When the controller sends a LE Direct Advertising Report event, the host must confirm that the resolvable random address provided matches with its own identity resolving key. If it does, then that advertising report needs to be processed. If it does not match, the report needs to be ignored. This patch adds full support for handling these new reports and using them for device discovery and connection handling. This means when a Bluetooth controller supports the Extended Scanner Filter Policies, it is possible to use directed advertising with LE privacy. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Enabled LE Direct Advertising Report event if supportedMarcel Holtmann1-0/+8
When the controller supports the Extended Scanner Filter Policies, it supports the LE Direct Advertising Report event. However by default that event is blocked by the LE event mask. It is required to enable it during controller setup. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05mac802154: use goto label on failureVarka Bhadram1-2/+1
Signed-off-by: Varka Bhadram <[email protected]> Reviewed-by: Stefan Schmidt <[email protected]> Acked-by: Alexander Aring <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Report invalid RSSI for service discovery and background scanMarcel Holtmann1-2/+10
When using Start Service Discovery and when background scanning is used to report devices, the RSSI is reported or the value 127 is provided in case RSSI in unavailable. For Start Discovery the value 0 is reported to keep backwards compatibility with the existing users. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Fix discovery filter when no RSSI is availableMarcel Holtmann2-3/+11
When no RSSI value is available then make sure that the result is filtered out when the RSSI threshold filter is active. This means that all Bluetooth 1.1 or earlier devices will not report any results when using a RSSI threshold filter. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Remove redundant reverse_base_uuid variableJohan Hedberg1-10/+2
The mgmt.c file already has a bluetooth_base_uuid variable which has the exact same value as the reverse_base_uuid one. This patch removes the redundant variable. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Fix Get Conn Info to use cmd_complete callbackJohan Hedberg1-51/+33
This patch fixes the Get Connection Information mgmt command to take advantage of the new cmd_complete callback. This allows for great simplifications in the logic for constructing the cmd_complete event. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Fix initializing hci_conn RSSI to invalid valueJohan Hedberg1-0/+1
When we create the hci_conn object we should properly initialize the RSSI to HCI_RSSI_INVALID. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Convert Get Clock Info to use cmd_complete callbackJohan Hedberg1-24/+35
This patch converts the Get Clock Information mgmt command to take advantage of the new cmd_complete callback for pending commands. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Convert discovery commands to use cmd_complete callbackJohan Hedberg1-11/+16
This patch converts the Start/Stop Discovery mgmt commands to use the cmd_complete callback of struct pending_cmd. Since both of these commands return the same parameters as they take as input we can use the existing generic_cmd_complete() helper for this. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Convert Unpair Device to use cmd_complete callbackJohan Hedberg1-7/+3
This patch updates the Unpair Device code to take advantage of the cmd_complete callback of struct pending_cmd. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Convert Pair Device to use cmd_complete callbackJohan Hedberg1-3/+5
This patch converts the Pair Device mgmt command to use the new cmd_complete callback for pending mgmt commands. The already existing pairing_complete() function is exactly what's needed and doesn't need changing. In addition to getting the return parameters always right this patch actually fixes a reference counting bug and memory leak with the hci_conn that's attached to the pending mgmt command - something that would occur when powering off or unplugging the adapter while pairing is in progress. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Use cmd_complete callback for authentication mgmt commandsJohan Hedberg1-22/+14
This patch converts the user confirmation & PIN code mgmt commands to take advantage of the new cmd_complete callback for pending mgmt commands. The patch also adds a new generic addr_cmd_complete() helper function to be used with commands that send a mgmt_addr_info response based on a mgmt_addr_info in the beginning of the command parameters. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Convert Disconnect mgmt command to use cmd_complete callbackJohan Hedberg1-14/+10
This patch converts the Disconnect mgmt command to take advantage of the new cmd_complete callback that's part of the pending_cmd struct. There are many commands whose response parameters map 1:1 to the command parameters and Disconnect is one of them. This patch adds a generic_cmd_complete() function for such commands that can be reused in subsequent patches. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Store parameter length with pending mgmt commandsJohan Hedberg1-3/+3
As preparation for making generic cmd_complete responses possible we'll need to track the parameter length in addition to just a pointer to them. This patch adds the necessary variable to the pending_cmd struct. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Add callback to create proper cmd_complete eventsJohan Hedberg1-2/+17
We've got a couple of generic scenarios where all pending mgmt commands are processed and responses are sent to them. These scenarios are powering off the adapter and removing the adapter. So far the code has been generating cmd_status responses with NOT_POWERED and INVALID_INDEX resposes respectively, but this violates the mgmt specification for commands that should always generate a cmd_complete. This patch adds support for specifying a callback for the pending_cmd context that each command handler can use for command-specific cmd_complete event generation. The actual per-command event generators will come in subsequent patches. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05net/mac802154: No need for an extra space when castingStefan Schmidt1-2/+2
Coding style cleanup. Signed-off-by: Stefan Schmidt <[email protected]> Acked-by: Alexander Aring <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05net/mac802154: Remove extra blank lines.Stefan Schmidt2-21/+0
Signed-off-by: Stefan Schmidt <[email protected]> Acked-by: Alexander Aring <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05net/ieee802154: Remove and add extra blank lines as needed.Stefan Schmidt7-21/+2
Some have been missing and some have been needed. Just cosmetics. Signed-off-by: Stefan Schmidt <[email protected]> Acked-by: Alexander Aring <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05net/ieee802154: Make sure alignment matches parenthesis..Stefan Schmidt1-1/+1
Follow coding style of the kernel. Signed-off-by: Stefan Schmidt <[email protected]> Acked-by: Alexander Aring <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05net/6lowpan: Remove FSF address from GPL statement.Stefan Schmidt1-3/+0
This might change and we already deliver a copy of the license with the kernel. This was already removed form the ieee802154 code but missed here. Signed-off-by: Stefan Schmidt <[email protected]> Acked-by: Alexander Aring <[email protected]> Acked-by: Jukka Rissanen <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-05Bluetooth: Clear discovery filter before starting background scanMarcel Holtmann1-11/+9
Currently the discovery filter information are only cleared when the actual discovery procedure has been stopped. To make sure that none of the filters interfere with the background scanning and its device found event reporting, clear the filter before starting background scanning. This means that the discovery filter is now cleared before either Start Discovery, Start Service Discovery or background scanning. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Fix memory leaks from discovery filter UUID listMarcel Holtmann2-2/+11
In case of failure or when unplugging a controller, the allocated memory for the UUID list of the discovery filter is not freed. Use the newly introduced helper for reset the discovery filter and with that also freeing existing memory. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Add helper function for clearing the discovery filterMarcel Holtmann1-4/+1
The discovery filter allocates memory for its UUID list. So use a helper function to free it and reset it to default states. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Add support for Start Service Discovery commandJakub Pawlowski1-0/+106
This patch adds support for the Start Service Discovery command. It does all the checks for command parameters and configured the discovery filter settings correctly. However the actual support for filtering will be added with another patch. Signed-off-by: Jakub Pawlowski <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Add logic for UUID filter handlingJakub Pawlowski1-0/+70
The previous patch provided the framework for integrating the UUID filtering into the service discovery. This patch now provides the actual filter logic. Signed-off-by: Jakub Pawlowski <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Add framework for device found filtering based on UUIDMarcel Holtmann1-2/+52
Using Start Service Discovery provides the option to specifiy a list of UUID that are used to filter out device found events. This patch provides the framework for hooking up the UUID filter. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Filter device found events based on RSSI thresholdMarcel Holtmann1-0/+9
Using Start Service Discovery allows to provide a RSSI threshold. This patch implements support for filtering out device found events based on the provided value. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-05Bluetooth: Add extra discovery fields for storing filter informationJakub Pawlowski2-0/+16
With the upcoming addition of support for Start Service Discovery, the discovery handling needs to filter on RSSI and UUID values. For that they need to be stored in the discovery handling. This patch adds the appropiate fields and also make sure they are reset when discovery has been stopped. Signed-off-by: Jakub Pawlowski <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-04bury struct proc_ns in fs/procAl Viro1-3/+1
a) make get_proc_ns() return a pointer to struct ns_common b) mirror ns_ops in dentry->d_fsdata of ns dentries, so that is_mnt_ns_file() could get away with fewer dereferences. That way struct proc_ns becomes invisible outside of fs/proc/*.c Signed-off-by: Al Viro <[email protected]>
2014-12-04copy address of proc_ns_ops into ns_commonAl Viro1-2/+7
Signed-off-by: Al Viro <[email protected]>
2014-12-04new helpers: ns_alloc_inum/ns_free_inumAl Viro1-2/+2
take struct ns_common *, for now simply wrappers around proc_{alloc,free}_inum() Signed-off-by: Al Viro <[email protected]>
2014-12-04make proc_ns_operations work with struct ns_common * instead of void *Al Viro1-9/+3
We can do that now. And kill ->inum(), while we are at it - all instances are identical. Signed-off-by: Al Viro <[email protected]>
2014-12-04netns: switch ->get()/->put()/->install()/->inum() to working with &net->nsAl Viro1-6/+10
Signed-off-by: Al Viro <[email protected]>
2014-12-04common object embedded into various struct ....nsAl Viro1-3/+3
for now - just move corresponding ->proc_inum instances over there Acked-by: "Eric W. Biederman" <[email protected]> Signed-off-by: Al Viro <[email protected]>
2014-12-04Merge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-nextJohn W. Linville15-181/+429
Johannes Berg <[email protected]> says: "This time I have Felix's no-status rate control work, which will allow drivers to work better with rate control even if they don't have perfect status reporting. In addition to this, a small hwsim fix from Patrik, one of the regulatory patches from Arik, and a number of cleanups and fixes I did myself. Of note is a patch where I disable CFG80211_WEXT so that compatibility is no longer selectable - this is intended as a wake-up call for anyone who's still using it, and is still easily worked around (it's a one-line patch) before we fully remove the code as well in the future." Signed-off-by: John W. Linville <[email protected]>
2014-12-04Merge tag 'nfc-next-3.19-1' of ↵John W. Linville10-125/+1188
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next Samuel Ortiz <[email protected]> says: "NFC: 3.19 pull request This is the NFC pull request for 3.19. With this one we get: - NFC digital improvements for DEP support: Chaining, NACK and ATN support added. - NCI improvements: Support for p2p target, SE IO operand addition, SE operands extensions to support proprietary implementations, and a few fixes. - NFC HCI improvements: OPEN_PIPE and NOTIFY_ALL_CLEARED support, and SE IO operand addition. - A bunch of minor improvements and fixes for STMicro st21nfcb and st21nfca" Signed-off-by: John W. Linville <[email protected]>
2014-12-04Bluetooth: Split triggering of discovery commands into separate functionMarcel Holtmann1-114/+100
The actual process of compiling the correct HCI commands for triggering discovery is something that should be generic. So instead of mixing it into the Start Discover operation handling, split it out into its own function utilizing HCI request handling and just providing status in case of errors or invalid parameters. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-04Bluetooth: Use {start,stop}_discovery_complete handler for cmd_completeMarcel Holtmann1-66/+31
Sending the required cmd_complete for the management commands should be done in one place and not in multiple places. Especially for Start and Stop Discovery commands this is split into to sending it in case of failure from the complete handler, but in case of success from the event state update function triggering mgmt_discovering. This is way too convoluted and since hci_request serializes the HCI command processing, send the cmd_complete response from the complete handler for all cases. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-04Bluetooth: Simplify the error handling of Start Discovery commandMarcel Holtmann1-11/+7
The Start Discovery command has some complicated code when it comes to error handling. With the future introduction of Start Service Discovery simplifying this makes it easier to read. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-03Bluetooth: Increment management interface revisionMarcel Holtmann1-1/+1
This patch increments the management interface revision due to the addition of support for LE Secure Connection feature. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-03Bluetooth: Increase minor version of core moduleMarcel Holtmann1-1/+1
With the addition of support for Bluetooth Low Energy Secure Connections feature, it makes sense to increase the minor version of the Bluetooth core module. The module version is not used anywhere, but it gives a nice extra hint for debugging purposes. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
2014-12-03Bluetooth: Fix false-positive "uninitialized" compiler warningJohan Hedberg1-10/+12
Some gcc versions don't seem to be able to properly track the flow of the smp_cmd_pairing_random() function and end up causing the following types of (false-positive) warnings: smp.c:1995:6: warning: ‘nb’ may be used uninitialized in this function [-Wmaybe-uninitialized] err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey); smp.c:1995:6: warning: ‘na’ may be used uninitialized in this function [-Wmaybe-uninitialized] err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey); ^ smp.c:1995:6: warning: ‘pkbx’ may be used uninitialized in this function [-Wmaybe-uninitialized] err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey); ^ smp.c:1995:6: warning: ‘pkax’ may be used uninitialized in this function [-Wmaybe-uninitialized] err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey); This patch fixes the issue by moving the pkax/pkbx and na/nb initialization earlier in the function. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-03Bluetooth: Fix minor coding style issue in smp.cJohan Hedberg1-1/+1
The convention for checking for NULL pointers is !ptr and not ptr == NULL. This patch fixes such an occurrence in smp.c. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-03Bluetooth: Fix SMP debug key handlingJohan Hedberg2-11/+14
We need to keep debug keys around at least until the point that they are used - otherwise e.g. slave role behavior wouldn't work as there'd be no key to be looked up. The correct behavior should therefore be to return any stored keys but when we clean up the SMP context to remove the key from the hdev list if keeping debug keys around hasn't been requestsed. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-03Bluetooth: Organize SMP crypto functions to logical sectionsJohan Hedberg1-63/+71
This patch organizes the various SMP crypto functions so that the LE SC functions appear in one section and the legacy SMP functions in a separate one. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-03Bluetooth: Fix missing const declarations in SMP functionsJohan Hedberg2-10/+13
Several SMP functions take read-only data. This patch fixes the declaration of these parameters to use the const specifier as appropriate. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-03Bluetooth: Introduce SMP_DBG macro for low-level debugingJohan Hedberg1-28/+40
The various inputs & outputs of the crypto functions as well as the values of the ECDH keys can be considered security sensitive. They should therefore not end up in dmesg by mistake. This patch introduces a new SMP_DBG macro which requires explicit compilation with -DDEBUG to be enabled. All crypto related data logs now use this macro instead of BT_DBG. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2014-12-03Bluetooth: Add basic LE SC OOB support for remote OOB dataJohan Hedberg1-2/+36
This patch adds basic OOB pairing support when we've received the remote OOB data. This includes tracking the remote r value (in smp->rr) as well as doing the appropriate f4() call when needed. Previously the OOB rand would have been stored in smp->rrnd however these are actually two independent values so we need separate variables for them. Na/Nb in the spec maps to smp->prnd/rrnd and ra/rb maps to smp->rr with smp->pr to come once local OOB data is supported. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>