This patch clears the peripheral masks upon the mdlog exit
and USB disconnection. This enables to keep the data and
cmd channel open for read.
CRs-Fixed: 1057143
Change-Id: Ie6f19319b75f3bf389ddd5a8168fd3bcd3efbc8b
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
Currently, there is possibility of out-of-bound accesses during
handling of data in non-hdlc path. The patch adds proper protection
when processing non-hdlc packet information to fix the issue.
CRs-Fixed: 2029216
Change-Id: I07c466f85bd8ac08226948fea86b1d8567e68431
Signed-off-by: Hardik Arya <harya@codeaurora.org>
This fix removes dependency between real time message mask
table and build time message mask table. Also this fix
synchronizes retrieval and modification of real time message
mask table.
CRs-Fixed: 2015227
Change-Id: Id0a0964337ec4645d7061fc35120dfa061a990ff
Signed-off-by: Gopikrishna Mogasati <gmogas@codeaurora.org>
This patch initializes the control channel workqueues
before registering with SMD, close the SMD control channel
on receiving the feature mask from peripheral on socket channel
if the sockets are supported and reset the in_busy variable
for the buffer that reads the data from socket channel
when diag socket state is closed.
This patch also adds add mutex protection on receiving feature mask while closing
SMD and start reading from socket channel
CRs-Fixed: 1059771
Change-Id: Icdf27dce5b3eb7cfc4a7686f044195db13a81a58
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
Copy the data from buf table in diag_md_copy_to_user() if the
userspace buffer has space. If the data copy fails then drain
the data once the userpace buf is available instead of dropping
the data.
Change-Id: I6a24b13837ce7a07ea0d6bd2954b40a776c6ae0b
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Diag driver has an incorrect value for Sensor channel peripheral
mask leading to incorrect calculations.
Change-Id: Ia72edead666c93b80b374263d194a941efa8cbf7
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
When there are multiple clients voting for memory device mode, diag
driver is incorrectly picking the client for draining data. Also,
memory device client that is currently receiving data won't receive
data when a new memory device client comes up. This patch addresses
these issues.
Change-Id: I6c2b3f46a1ade60c58db9c35b551f490268cfbee
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
This patch adds support for time sync command.
Also forwards the time sync control packet to all
the peripherals on receiving time sync switch command.
Change-Id: I5c42203bcf3cd830dbf937879b01d002c73c0c31
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
The value of sensors STM bit mask was set incorrectly leading to
erroneous calculations. This patch adds the correct value for
Sensors STM bit mask.
Change-Id: I6aad29025068f8386da30bff785e7e10fe282cc0
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Add support for extended mobile ID command version 2
to provide chipid information to tools.
Change-Id: I428d62caafe638897aeb8fed66e35dccc1e11963
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Add control packet support to signal MEMORY_DEVICE application
when a pd comes up.
Change-Id: I7182dfbe60ee07d0ab2f7c87eb981816ba764e25
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Currently, apps diag is holding a spinlock while releasing
wake source. This may lead to spinlock contention in case
multiple zero size packets are received over smd thus leading
to lockout. This patch removes the spinlock protection while
releasing wake source.
Change-Id: I73f2b6f584bfbc259cd534c59aedbacd4cc59381
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Currently, APPS diag may send commands to peripherals even before
forwarding feature mask. This patch adds new check which ensures
that any command is sent to peripheral only after forwarding
feature mask.
Change-Id: I024ad6d3bcb2636f6f7d82a3744f034110ec1eb6
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Diag driver must respond to log-on-demand command request if Modem
delegates the support for log-on-demand. Diag driver was forwarding
the command to Modem even if the support is present on Apps. This
patch fixes this issue.
Change-Id: I45265ea5fd3205b067ae829a2c105e449bdd621a
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag on peripherals now support communication over IPC router
sockets. Add support on application processor to communicate with
the peripherals over sockets. This patch also maintains backwards
compatibility over SMD.
Change-Id: Id95d89e83a5532224594991c080c78747b510f74
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag SMD structures are embedded inside Diag core logic. This patch
modularizes operations performed over SMD, keeping it distinct from
other diag modules.
Change-Id: I6bd99b109da7b71d6310708312078d7334cc0f58
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Macros referring to different peripherals have the type of channel
in their name and the macros for channel types have the underlying
transport in their name. This patch renames the macros used in
Diag driver.
Change-Id: I0c98e7e4fde68716bf3491e143603618d1740dac
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Peripheral features are embdedded in the diag core logic.
Refactor the code to separate the peripheral features into a
different structure.
Change-Id: I302d6523722d29e874337a032ea39df26d439d2e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
There are some macros and variables in the Diag driver that are
not being used. Remove all the instances of those macros and
variables.
Change-Id: I800b776f3db1356c55a51de7747a26d8581fe9bf
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag fails to forward the commands registered on apps to
the user space clients since the proc id in the command
registration table is compared with the wrong proc id for
apps. Added a change to check the correct proc id for apps
while forwarding the command from kernel to userspace.
Change-Id: I4baac98fb752061b7621a6f725ce586bacd58a30
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Provide ioctl support for the user space clients to toggle the
hdlc support on kernel side.
Change-Id: Ifd87c94a619165052599103991f3f296d2c272f3
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Tools and userspace clients can now send non HDLC encoded
packets to the target. Add support for incoming packets that
are not HDLC encoded and maintain backwards compatibility for
tools that needs HDLC encoding.
Change-Id: Ie56248ad7d48cacd5782fcd1f629fbb8319c7ecc
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Add support in Diag driver to query log, event, msg packet allocation
and drop counts through command request/responses. Also added support
for resetting these statistics.
Change-Id: I4c33394101442e0955d66f30714e1d0dc1af4c1c
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Currently, diag driver restricts the number of command registration
by the user space clients and registrations from peripherals to
a predefined number. Remove this restriction and make the table
dynamic in size.
Change-Id: I536af1d8fb4efabf483947c592ce1df2875f9c62
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Currently, diag driver has support for only one instance of
callback process. This process is used to communicate with both
local and remote processors. Expand the support for callback mode
to support multiple processes each communicating with different
processors.
Change-Id: I933a04c874e306527d11dbf706ea7ccc3e8c39ab
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Currently diag supports requests and response upto 4k in length.
Make changes to increase this size to 16k.
Change-Id: I414e703bc3b84d86e19077785c8387283db4441b
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Diag supports different types of data coming from the userspace.
Each type has an unique length requirement. Diag driver was
checking the incoming length against a common value. Refactor
the code to modularize different packet types and include
unique length checks in each module.
Change-Id: I921ef51a3e2bb97803aee380c790698da81d7033
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver has to support a new command for retrieving the
mobile id of the target. The response contains the chip family.
Change-Id: I2e12dd6834f8be95688678286e360c4e75af9524
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Diag on the peripherals has support to buffer diag data and drain
them as and when required. This patchset adds support on the apps
processor to enable different buffering modes on the peripherals.
Change-Id: I07b9ffe36dfc5c90ac0d8a8da91922e1127aed58
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver has an ability to log diag data to USB or to the user
space clients. Make changes to modularize different modes of
logging schemes.
Change-Id: I91c95ce4ec8117f6926d8e6dfa164fd6cb07dc4b
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Refactor diagfwd_bridge to make it scalable and to communicate
with the remote devices in a much cleaner fashion. Also make
changes to DCI to reflect the changes in the bridge.
Change-Id: Ica5a3552ec94c5543518698390c910518da04f3b
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag USB structures are deeply coupled with diag drivers. Each
instance of USB channel is used explicitly. Make changes to
modularize USB channels designated for Diag.
Change-Id: Id408e227e7e92178afa847064afe18bb6c0dd019
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Add diag support on the apps to communicate with diag on sensors
processor.
Change-Id: I14632cdf55d917316f72153324a445553839e531
Signed-off-by: sgownipa <sgownipa@codeaurora.org>
Diag driver is deeply coupled with SMUX structures. Make changes
to remove references of SMUX from diag core files.
Change-Id: I2abc6b98659fea5b5b429467af9ccf5ed3d37eaf
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver is currently using USB structures internally for
data transfers. Refactor the code by removing these structures.
Change-Id: I9e283af0f99cfb732fe74371dcbeae9c15e83b64
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
The current design of Diag memory pools makes it difficult to scale.
Diag HSIC structures maintain their own memory pools. Make changes
to bring all memory pools together.
Change-Id: I08acbd2ea35438637f875fdc5c2ab896d9db3dd9
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver on the apps processor should be responding to the
mask requests from tools. Make changes to the driver to centralize
diag log, event, msg build time and run time masks on the apps
processor.
Change-Id: I14b4119343d2b5def1ef203f26215511bc3cd465
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag message, log and event masks were formatted uniquely. Refactor
code to change the design of all diag masks.
Change-Id: Ic1516591088404204ad11187487b96690706f17a
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Refactor handling of diag control packets and make them robust
by adding more error handling.
Change-Id: I90d0212a10269ac00cc1bd3731f38f20e3918b2e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver can let apps processor go to suspend when receiving
data from remote processors and peripherals. This can result in
diag data being dropped on the apps processor. This patch ensures
that the apps processor is awake till the data is copied to the
user space.
Change-Id: Id3c46c66675d3b5632721dede5e59420b69c568e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>