Bluesleep driver, out-of-band sleep protocol, needs to be
notified in case of MSM initiated datatransfer to wakeup
BTS chip. This notification is required to turn on UART
clocks. This change was missing in the .38 kernel
which is vital for Bluetooth to work in 7x27.
Change-Id: I6e2004c13d140901c9bdee7a98ca43e2f9c07dc3
Signed-off-by: NaveenKumar <naveenr@codeaurora.org>
This changes L2CAP ERTM acknowledgements so that they are sent at least
every 200ms. Instead of extending the timeout each time a packet is
received, the original deadline of the timer will remain unchanged.
When the timer fires all packets received to that point will be
acknowledged. With the previous timeout behavior a slow sender could
delay the ack too long by sending at least one packet every 200ms.
Change-Id: If1153f7e96e797cd785527c1b4e8cc3f2a372461
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
When returning to a BR/EDR connection, restore the default timeouts.
If the remote device disables timeouts, do not attempt to start
timers. Fixed a byte ordering issue.
Change-Id: Idd673e2eaee77aa8c524cdcfc6236df17bca344a
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
This allows streaming mode receive code to be shared between
RFCOMM and L2CAP ERTM. Includes handling of non-linear
socket buffers. (leftover pieces from 2.6.35 carried forward).
Change-Id: If3c20f79c0a0ca1f7cff1ffd75de94cfdcb8e252
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
This fix reinitiates the authentication process when remote
device doesnot have the link key for the current connection.
Change-Id: I7160b2690964125d3e0839273aafda18fa436b6c
Signed-off-by: Rakesh KrishnaMoorthy <rakeshk@codeaurora.org>
In cases where there are both lost packets and a slow consumer of data
(causing flow control to be triggered), the ERTM receive state machine
was not correctly transitioning back to the normal receive state once
any out-of-order data frames were reassembled. This commit ensures
that the out-of-order queue is only checked while in the "SREJ sent"
state, and that the receive state is updated correctly once the
out-of-order queue is emptied.
Change-Id: I22a224891d137e3f39b933195c150c5840f83c2e
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Packet-based and block-based flow control use the same counting
method, so re-use the hci_dev fields instead of making a second set.
Change-Id: I2022ae49487a2a56f27d803f3bf522bd5350e60c
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Discard any frames received while in the local busy state. This makes
the code less complex, and results in fewer retransmitted packets
when dealing with lost data.
Change-Id: Id06f923609df1c4e5f7c553355bb8db7794bbe2d
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
These messages are helpful when tracking frames that are received
but not yet reassembled. They are turned off by default.
Change-Id: Idfd9bbd808762c91e59af758aac50e8501895d48
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
When an AMP Manager initiating a Physical Link receives the A2MP
Create Physical Link response message from the remote device it has
already started the physical link creation process with the local
AMP Controller. It should cancel this creation process if the remote
device indicates it will not accept the link.
Change-Id: I4dc67cf5f798347ace7030a94e0a50b0e74f93be
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
The A2MP Discover response may contain a variable length
feature mask field, which is extended by setting a bit every
two octets. Previously it was assumed this field was a fixed
size of 2 octets.
Change-Id: I768d2a8d883fde293d46acdf7a6b36b185ecaa95
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Even when an AMP channel is in use, L2CAP commands use the BR/EDR
device. Therefore, command data must be fragmented according to the
BR/EDR HCI MTU.
Change-Id: I039ec53157cd8f70e95e85ebb9dbf34a3061fef0
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
According to the current distributed security logic between
kernel-userspace, the kernel is not aware of the level of
security that a link-key provides when userspace responds
to the link key request. Adding a ioctl entry which will
update the kernel space auth_key's level of security as soon
as userspace responds to the link key request.
CRs-fixed: 264601
Change-Id: I6765cce92a6f8b761742d57ea94e81502f6e7fcf
Signed-off-by: NaveenKumar <naveenr@codeaurora.org>
Data transmission is stopped during an AMP channel move. If the channel
move fails due to a problem setting up the physical link and there is
data in the transmit queue, data transmission needs to be triggered.
It was possible for data transfer to stall if there was data in the
transmit queue but no further data was added to the queue.
Change-Id: I554ccf477f4abae39b96c8d716b380d14d1abb74
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
AMP controllers have different optimal settings for packet sizes
and checksums, so BT3.0+HS includes the ability to reconfigure
the L2CAP settings when a channel is moved between controllers.
Change-Id: Iad1592104ebc6ac4a9d9ed54b1d763b1786f4a1b
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
The cherry-pick of 3300d9a930 removed
handling of some AMP signals.
Change-Id: I5317cc8aa90b5ad54565c18b9710ac6bb20834e7
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Bluetooth 3.0+HS depends on an AMP manager to coordinate the setup and
teardown of AMP physical and logical links using the A2MP protocol.
There are also new L2CAP signals that allow two Bluetooth devices to
move L2CAP channels to and from a high-speed link, and a new socket
option for applications to use to control the type of Bluetooth link
used for L2CAP traffic.
Change-Id: I98067e0781b31f5d694e7b7da5cf5006dc21f514
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Captures a new Kconfig dependency for generation of AMP keys.
Change-Id: I82d5f40af3417b4020a477f75e5af07761a3f1b1
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
The A2MP protocol uses a reliable ERTM channel to coordinate
high-speed AMP channels between two Bluetooth devices. This
is done using a fixed channel ID, but ERTM carries a lot of
state so the existing approach of hard-coded fixed channel
handlers does not work. This adds hooks for creation and
use of fixed channel sockets for use within the kernel.
Change-Id: I27363b7882ffc8ec643ffe792b078f253700089b
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
This adds support for AMP controllers to the Bluetooth HCI layer.
The architecture was agreed upon at the 2010 BlueZ Summit.
A new notion of an "HCI channel" is introduced, which corresponds
with AMP logical links. AMP controllers are also a new device type,
with a new set of HCI commands and events that need to be supported.
Change-Id: I6dbf96f800cbd6878a37c0a463f5261c8681134c
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Enhanced Retransmission Mode (ERTM) is a new feature in BT3.0, and
is a requirement for BT3.0+HS with high-speed AMP controllers.
Some work had already been done to add ERTM support to BlueZ,
but the high-speed feature is more demanding in terms of efficiency
and needs some extended control over ERTM operation. This commit
includes more robust state machines, no copying of received data,
improved transmit queue management, support for extended headers,
and more robust locking.
Change-Id: I21aba0e3fecb02e901bb174787a37533a923c327
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Upcoming ERTM changes introduce the possiblity of non-linear
socket buffers being passed to L2CAP users within the kernel.
Check for and force these socket buffers to be linearized.
There should not be performance issues, since these Bluetooth
profiles do not use ERTM in practice. Without this change,
non-linear buffers could cause stability problems.
Change-Id: Ibb473de4d248c7ad85f9e7b8ff59a84a686449e7
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
The previous cherry-pick moved this function, but we want the pre-existing
version of l2cap_chan_ready().
Change-Id: I195892876ca1e2ea3b3e181cda4df76522dc9768
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
This undoes all upstream bluetooth core changes since around
b79f44c (Bluetooth: Fix keeping the command timer running,
2011-04-11).
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Add the reference count for Smart Wireless Interface Manager to
know whether there are any process who still has the socket in
question in use or not.
Redefine the TCP_FLAG as it gives compiling error when an enum is defined
by a function return.
Change-Id: I1aa9c810fec2e332048c9ef4199ec3f996bc3a75
Signed-off-by: Chinh Tran <chinht@codeaurora.org>
Add enable_flow flag to the prio qdisc. Packet flow is
enabled by default, but can be disabled from userspace
(e.g. IPROUTE2 tc tool). This allows for suspending packet
dequeue on a per-qdisc basis, which is needed to supprot
Quality of Service (QOS) when using WWAN modem.
Change-Id: I932f296be946f1acc3b00c7d8569bbb733d33622
Acked-by: Andrew Richardson <randrew@qualcomm.com>
CRs-Fixed: 283471
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
WiFi Drivers can advertize the number of bands dynamically.
A check has been added to see if the band information is
present and only then the values are extracted.
Without this check, a kernel crash shall occur as we would
extract the band information though the driver does not
advertize.
Change-Id: Ia726a692a3c2dcef2fcff0a59363053524c5f806
Signed-off-by: Sunil Dutt Undekari<duttus@codeaurora.org>
Provision to distinguish the P2P scan and the normal scan
with no_cck flag and thus disable the 11b rates for
p2p scan.
Change-Id: Ia4073a5f926c6ac97dffdee99f54ba53535fea85
Signed-off-by: Sunil Dutt Undekari<duttus@codeaurora.org>
This provides WAPI support for cfg80211.
Change-Id: I6ec1f6804cd9017bd332b4dd5ab06f18b390e120
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
[sboyd: drop net/wireless/nl80211.c part]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This new mode allows Neighbor discovery packets to be sent to userspace
without regards to the state of the forwarding setting. Without this, NDP
packets addressed to the host are still received, but those for other
addresses are not.
Enabling this mode allows NDP proxying to be performed from userspace.
Change-Id: I69b7a7c0c42e3253c42d6f2e163c0ce1d848aed6
Signed-off-by: Jaime Lopez <jaimel@codeaurora.org>
Add to support for msm_rmnet device using ARPHRD_RAWIP.
Change-Id: Ie1e5433f440b26b644cccb18083ef325129f7942
Acked-by: Andrew Richardson <randrew@qualcomm.com>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
The header file was renamed to pm_qos.h in e8db0be (PM QoS: Move
and rename the implementation files, 2011-08-25) but this
documentation wasn't updated. Update it.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Currently otg driver is voting to allow TCXO shutdown in host
bus suspend due to which devices connected in system suspend
are not getting detected. Hence don't allow TCXO shutdown in
host bus suspend.
As long term solution, need HW rework for detecting connecting
devices in host mode during system suspend. This is required to
route D+ and D- lines to MPM for monitoring interrupt during
system suspend.
CRs-Fixed: 366111
Change-Id: Ic478a0e327b104eec64b5cfe2bd1f9369f8ef72e
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
OTG driver should not be using power_supply_get_by_name in IRQ context
and calling this api for every USB cable insertion/removal is very
inefficient.
CRs-Fixed: 363098
Change-Id: Iae7f63c755fbb177abd23cbff0b81d3cd76f95b8
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
This change adds the ability of the msm_otg to go to LPM when
USB cable is connected and bus is suspended.
This ability is enabled by a board file parameter.
The msm_otg is notified about SUSPEND/RESUME events via the
UDC layer. New event for RESUME was defined for that.
Change-Id: Ic508f1898cc3b57ab76eccd379bea38ed363570b
Signed-off-by: Amit Blay <ablay@codeaurora.org>
While turning on the OTG, the charger should be configured to not draw
any current from the usb before turning on the 5V boost. While turning
off the OTG, the boost should be turned off before configuring the
charger to draw current from usb.
Fix this ordering.
Change-Id: Iebd9bf166334e34d92b2ada623dec71a5f0326eb
CRs-Fixed: 338648
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Part of commit d44455a0b838b1d691e63913f0b159552ac01803 introduced
a regression affecting resume behavior in that the controller's system
resume callback is being followed by an immediate runtime suspend; if
the system resume was caused by an OTG event, there would be a pending
runtime resume in the state machine function, which might fail due to
this race, causing the PHY to be unnecessarily reset.
This patch limits the actual hardware resumes to happen only when needed.
If a possible wakeup event such as VBUS or ID interrupt occurs while
in system suspend, don't allow runtime resume to execute in the wakeup
handler but rather defer the resuming to the system resume callback.
Also by incrementing the PM runtime usage counter within the system
resume, it may help prevent the premature runtime suspend from happening
immediately afterward. Otherwise, if there is no such OTG event, and
the controller is not a suspended host, do nothing.
If the bus is instead runtime suspended (and not system suspended) when
a wakeup event occurs, then normal runtime resume will bring the
hardware out of low power mode.
CRs-fixed: 358761
Change-Id: I4249690485949ecb3072e258859608ecea52ec9b
Signed-off-by: Jack Pham <jackp@codeaurora.org>
To enable better power management and entering CPU idle states while
USB cable is connected and no USB SW involvement is required
(MSM BAM2BAM mode) a new SysFS was added.
This SysFS allow controlling USB voting and gives the ability
to save power consumption while USB is active.
default behavior is high QoS. to change the new SysFS
echo high/low to /sys/class/android_usb/android0/pm_qos
Change-Id: Ia73491cfddc3968e1d04423a1750c89fab5fefeb
Signed-off-by: Ofir Cohen <ofirc@codeaurora.org>
Enable VDD CX regulator voltage setting even for kernel configs
without PM_SLEEP enabled. This is required so that USB functions
without power management.
Previously disabling power management also incorrectly disables USB.
Change-Id: I81d04cbca2e956e12fe40eeb97fbaab8c2ec1fd2
Signed-off-by: David Ng <dave@codeaurora.org>
Disable PHY VBUS comparator if otg driver depends on PMIC
for VBUS and ID notifications. If enabled, VBUS comparator is
creating some noise to SESSVLD comparator and causing SESSVLD
comparator to trigger low due to which link state machine becomes
stuck as it operates solely on that value.
CRs-Fixed: 355991
Change-Id: Ieb8101f3063ebf9898da3ec9fd158c248a6cb15a
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
New platform uses RBCPR hardware feature, with that voting for
absolute voltage of VDD CX is not required. Hence vote for corner of
VDD CX which uses nominal corner voltage on VDD CX.
CRs-Fixed: 355399
Change-ID: I22a73c5a439c98195b907ff3d032eb675a557612
Signed-off-by: Mayank Rana <mrana@codeaurora.org>