USB: gadget: f_mtp: fix send ZLP packet algorithm.

USB: gadget: f_mtp: fix send ZLP packet algorithm.

If size of the data that sent from MTP-device to computer is a multiple of
wMaxPacketSize (usb endpoint) then at the end of transfer device must
send ZLP packet. Previously in f_mtp module a variable 'maxpacket' that
used to send ZLP packet was always equal to 512. For USB2.0 wMaxPacketSize
equals 512 but for USB1.1 wMaxPacketSize can be 64, 32, 16 or 8. Now variable
'maxpacket' contains real value of wMaxPacketSize in all USB modes and ZLP
packet is sent correctly for USB1.1.

Change-Id: I75606c954119dea2a76d955849a47208df0d2db0
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>

commit 0002f14d069f03b4b28922c28c9652f0cccdfffb 1 parent 3a9a7be15d
Oleksandr Dmytryshyn authored 2 months ago faux123 committed a month ago
Removed PMEM it's no longer used and DEPRECATED.(old junk)
usb: gadget: Fix usb string id allocation

Don't reset next_string_id every time the gadget is enabled, this makes
the next strings allocated overwrite strings allocated at probe time.
Instead, fix rndis not to allocate new string ids on every config bind.

Change-Id: Ied28ee416bb6f00c434c34176fe5b7f0dcb2b2d4
Signed-off-by: Benoit Goby <benoit@android.com>

commit 494af65ee90e31ca2aab4517976fca27c9bad07a 1 parent 0e18d3327f
Benoit Goby authored 7 months ago faux123 committed a month ago
usb: gadget: android: Honor CONFIG_USB_GADGET_VBUS_DRAW

The maximum current draw was hard coded to 500 mA.  composite.c
has code that uses CONFIG_USB_GADGET_VBUS_DRAW to set the
bMaxPower and to set whether or not the device is self-powered if
they haven't been set.  This change removes the code in android.c
to allow composite.c to set them.

Change-Id: I9db37922e91ee86e9e5c0e14519e119e5c41ca48
Signed-off-by: Scott Anderson <saa@google.com>

faux123 authored a month ago
Input: evdev - Add ioctl to block suspend while event queue is not empty.

Add an ioctl, EVIOCSSUSPENDBLOCK, to enable a wakelock that will block
suspend while the event queue is not empty. This allows userspace code to
process input events while the device appears to be asleep.

The current code holds the wakelock for up 5 seconds for every input
device and client. This can prevent suspend if sensor with a high data
rate is active, even when that sensor is not capable of waking the
device once it is suspended.

Change-Id: I624d66ef30a0b3abb543685c343382b8419b42b9
Signed-off-by: Arve Hjønnevåg <arve@android.com>
ASoC: core: Query active DAI links

Query active DAI links (dynamic and legacy frontends) in a SoC card.

+ All missing functions.

Change-Id: Ieaef958833feb40499e0d67f3217f00a19ade87e
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
ASoC: core: Promote DAI link startup

Promote DAI link startup to the beginning of SoC PCM open(),
required to:

- Prepare machine-level external environment (like clocks, power
  supplies) for CPU DAIs and CODECs
- Some CODECs add hw constraints (e.g. snd_pcm_hw_constraint_list
  for twl6040, wm8523, wm8988, etc) during their startup handler
  which can be dependent on machine level settings (e.g. sysclk).
  Currently, those constraints are honored until next stream
  activity takes place as the DAI link startup occurs after
  CODEC's.

Similarly, DAI link shutdown is now moved to the last position in
SoC PCM close().

Change-Id: Iabf4256be528d1d7befa2e03bfda89a9cafe959a
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
cfg80211: fix a crash in nl80211_send_station

mac80211 leaves sinfo->assoc_req_ies uninitialized, causing a random
pointer memory access in nl80211_send_station.
Instead of checking if the pointer is null, use sinfo->filled, like
the rest of the fields.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

commit 6cfcbd5c8d69f31982a71f97f70fe4499005b873 1 parent a45b03bf0d
Felix Fietkau authored a year ago faux123 committed a month ago
net: wireless: bcmdhd: Add SET_RANDOM_MAC_SOFTAP option

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
nl80211/cfg80211: add max_sched_scan_ssids in the hw description

Some chips can scan more SSIDs with a single scheduled scan command
than with a single normal scan command (eg. wl12xx chips).

To support this, this patch creates a separate hardware description
element that describes the amount of SSIDs supported in scheduled
scans.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

Conflicts:

	include/linux/nl80211.h
nl80211/cfg80211: add max_sched_scan_ie_len in the hw description

Some chips may support different lengths of user-supplied IEs with a
single scheduled scan command than with a single normal scan command.

To support this, this patch creates a separate hardware description
element that describes the maximum size of user-supplied information
element data supported in scheduled scans.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
nl80211/cfg80211: add match filtering for sched_scan

Introduce filtering for scheduled scans to reduce the number of
unnecessary results (which cause useless wake-ups).

Add a new nested attribute where sets of parameters to be matched can
be passed when starting a scheduled scan.  Only scan results that
match any of the sets will be returned.

At this point, the set consists of a single parameter, an SSID.  This
can be easily extended in the future to support more complex matches.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

Conflicts:

	include/linux/nl80211.h
	net/wireless/nl80211.c
net: wireless: bcmdhd: Always turn Off wlan power on interface down

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Add sched-scan config option

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Add WL_CFG80211_STA_EVENT config option

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Add constant mDNS filter

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
net: wireless: bcmdhd: Set probe_resp.timestamp value to scan results

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
switch: add timestamps to switch driver

Change-Id: Iac5b5279f45fcc6e506d801cb5e9d6d2f6f6f9fa
Signed-off-by: Erik Gilling <konkers@android.com>
configs: enable XFRM_USER

This is passive, it just installs the hooks to receive netlink commands
from user space.
It will allow experimenting with IPSec.

Change-Id: I3f7e44d924113cbca5e0aafbef4ac9f1e01c5752
Signed-off-by: JP Abgrall <jpa@google.com>
configs: enabled the netfilter IDLETIMER support.

The idletimer is passive until setup via iptables.

Change-Id: I7f11bd1bb8266e73025ae6e43923184af9462b8e
Signed-off-by: JP Abgrall <jpa@google.com>