usb: gadget: mbim: protect packets queue corruption

The f_mbim usb function driver maintain a packets queue sent from the
host as encapsulated commands which need to be read by the QBI using the
mbim_read fops.

In case of excessive messages arriving from the host we end up with simple
race condition between the queue writer and queue reader which end up in
corruption of the queue and packet loss.

Simply add a missing lock protection upon reading (deleting) a packet from
queue.

Change-Id: I8aff04745f02cbefd3d6b83d944cad9aa1726ebf
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
diag: Increase the maximum number of SSIDs per msg mask range

Diag was using a max ssid range of 100. This has increased due
to addition of new SSIDs. This patch increases the range to 200
and adds checks to limit the SSID masks to this range. This
changes the order of sending the feature masks, sending it before
the msg masks to let the peripherals know the features Apps
support.

Change-Id: Id124a29b38f9a0640cee77cfd49bfbb88c18dcb0
CRs-fixed: 576183
Signed-off-by: Sridhar Ancha <sancha@codeaurora.org>
Merge "diag: Increase the maximum number of SSIDs per msg mask range"
Merge "usb: gadget: mbim: protect packets queue corruption"
usb: smd: Send zero length packets in modem data calls

The USB protocol requires zero length packets to be sent when the data
transmission ends on a USB packet size boundary. This fix enables sending
zero length pakcets when required.

Change-Id: Ife4edae6e0ef01d0e06e5a9e0e29cf25fb6e7465
CRs-fixed: 546473
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Merge "usb: smd: Send zero length packets in modem data calls"