Commit Graph

95073 Commits

Author SHA1 Message Date
Mike Lockwood
35ee07a4df USB: composite: Add usb_composite_force_reset utility to force enumeration
Use this rather than calling usb_gadget_disconnect and usb_gadget_connect
directly to avoid sending USB disconnect events to userspace when resetting
the bus.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:39 -07:00
Dmitry Shmidt
1ee6838659 network: wireless: bcm4329: Set special OUI: 02:1A:11:FH:HH:HH for SoftAP
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:39 -07:00
Mike Lockwood
d620052f3e USB: gadget: android: Remove unused function android_usb_set_connected()
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:39 -07:00
Mike Lockwood
136826b4f1 USB: gadget: composite: Move switch_set_state calls to a work queue
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:39 -07:00
Mike Lockwood
140277b8f7 USB: gadget: f_mtp: USB gadget function driver for MTP and PTP device support.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Mike Lockwood
b3a4a18a4c USB: composite: Add support for functions overriding USB_DT_STRING descriptors
Needed for MTP support.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Mike Lockwood
a9946e705c USB: gadget: composite: Add userspace notifications for USB state changes
Add switch to notify current USB configuration.  This can be used to detect
USB connect and disconnect events.

Broadcast a change via the usb_composite class when a USB function is
enabled or disabled.

Rename usb_function.hidden to usb_function.disabled.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Mike Lockwood
ff9cdcd465 USB: gadget: f_mass_storage: Integrate android customizations
Integrate support for android composite driver and platform data
within CONFIG_USB_ANDROID_MASS_STORAGE.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:38 -07:00
Greg Goldman
8ad3de415d network: wireless: bcm4329: Reduce driver loading time
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:38 -07:00
Arve Hjønnevåg
56ab3d0a00 network: wireless: bcm4329: Add 2.6.35 compatibility and fix memory leak in set_multicast_list
Signed-off-by: Dmitry Shmidt <dimitrysh@android.com>
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:37 -07:00
Dmitry Shmidt
1c57305e18 net: wireless: bcm4329: Add SoftAP MAC address randomization
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:37 -07:00
Mike Chan
12b0cec7ba net: activity_stats: Add statistics for network transmission activity
When enabled, tracks the frequency of network transmissions
(inbound and outbound) and buckets them accordingly.
Buckets are determined by time between network activity.

Each bucket represents the number of network transmisions that were
N sec or longer apart. Where N is defined as 1 << bucket index.

This network pattern tracking is particularly useful for wireless
networks (ie: 3G) where batching network activity closely together
is more power efficient than far apart.

New file: /proc/net/stat/activity

output:

Min Bucket(sec) Count
              1 7
              2 0
              4 1
              8 0
             16 0
             32 2
             64 1
            128 0

Change-Id: I4c4cd8627b872a55f326b1715c51bc3bdd6e8d92
Signed-off-by: Mike Chan <mike@android.com>
2010-09-29 17:49:37 -07:00
Greg Goldman
3ddaed49e7 network: wireless: bcm4329: Update to Version 4.218.239
Add reading mac address from platform data
    Add dhd_os_proto_block protection for dhd_preinit_ioctls
    Revert dhdsdio_clk() changes

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:37 -07:00
Dmitry Shmidt
3e82dd2356 network: wireless: bcm4329: Fix wlan card removal
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:37 -07:00
Greg Goldman
a1eb0b3d9f network: wireless: bcm4329: Fix MAC address import
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
Greg Goldman
7c82d4484a network: wireless: bcm4329: Update to Version 4.218.238
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
Dmitry Shmidt
4d1deab06b network: wireless: bcm4329: Remove unnecessary set_freezable() calls
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
Howard Harte
0946fa3463 network: wireless: bcm4329: Add "HANG" event and console monitoring
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
Dmitry Shmidt
653767f92b network: wireless: bcm4329: Add bcm4329 driver
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-09-29 17:49:36 -07:00
San Mehat
84e65f0b90 staging: android: lowmemorykiller: Remove bitrotted codepath
Now that we're murder-synchronous, this code path will never be
called (and if it does, it doesn't tell us anything useful other
than we killed a task that was already being killed by somebody
else but hadn't gotten its' signal yet)

Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:35 -07:00
San Mehat
7054bf4b53 staging: android: lowmemorykiller: Fix task_struct leak
As it turns out, the CONFIG_PROFILING interfaces leak a
task struct if the notifier chain returns NOTIFY_OK.. doh.

This patch reworks lowmemkiller to use the new generic task
free notifier chain.

Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:34 -07:00
Christopher Lais
9f69ebbf40 binder: Fix memory corruption via page aliasing
binder_deferred_release was not unmapping the page from the buffer
before freeing it, causing memory corruption.  This only happened
when page(s) had not been freed by binder_update_page_range, which
properly unmaps the pages.

This only happens on architectures with VIPT aliasing.

To reproduce, create a program which opens, mmaps, munmaps, then closes
the binder very quickly.  This should leave a page allocated when the
binder is released.  When binder_deferrred_release is called on the
close, the page will remain mapped to the address in the linear
proc->buffer.  Later, we may map the same physical page to a different
virtual address that has different coloring, and this may cause
aliasing to occur.

PAGE_POISONING will greatly increase your chances of noticing any
problems.

Change-Id: I6941bf212881b8bf846bdfda43d3609c7ae4892e

Signed-off-by: Christopher Lais <chris+android@zenthought.org>
2010-09-29 17:49:34 -07:00
San Mehat
28633d10f9 staging: android: lowmemkiller: Substantially reduce overhead during reclaim
This patch optimizes lowmemkiller to not do any work when it has an outstanding
kill-request. This greatly reduces the pressure on the task_list lock
(improving interactivity), as well as improving the vmscan performance
when under heavy memory pressure (by up to 20x in tests).

Note: For this enhancement to work, you need CONFIG_PROFILING

Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:34 -07:00
Velempati Chiranjeevi
c600bd3a24 USB: android gadget: mass storage: Fix format issue for Vista Host
As part of formating the mass storage device, Host sends the INQUIRY
scsi command. As per the standard, the command length for this
command should be 6 bytes, whereas the Vista host sends 12 bytes.

When the command length of the command is not equal to the standard
length, the device sends a phase error as part of the status phase.
When the host receives a phase error, it re-enumerates, hence the
error.

If the command is INQUIRY, and the command length is 12 bytes,
treating this as a good command and not sending the phase error
to the host fixes this issue.

Signed-off-by: Velempati Chiranjeevi <c_cvelem@qualcomm.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:33 -07:00
San Mehat
fdcec72817 lowmemorykiller: Don't try to kill the same pid over and over
Under certain circumstances, a process can take awhile to
handle a sig-kill (especially if it's in a scheduler group with
a very low share ratio). When this occurs, lowmemkiller returns
to vmscan indicating the process memory has been freed - even
though the process is still waiting to die. Since the memory
hasn't actually freed, lowmemkiller is called again shortly after,
and picks the same process to die; regardless of the fact that
it has already been 'scheduled' to die and the memory has already
been reported to vmscan as having been freed.

  Solution is to check fatal_signal_pending() on the selected
task, and if it's already pending destruction return; indicating
to vmscan that no resources were freed on this pass.

Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:33 -07:00
Arve Hjønnevåg
3c455b7767 Staging: android: binder: Create dedicated workqueue for binder deferred work
Some drivers flush the global workqueue when closed. This would deadlock if
the last reference to the file was released from the binder.

Change-Id: Ifdabc0b383fecb20836d1bbb9786c632402a14e1
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2010-09-29 17:49:33 -07:00
Mike Lockwood
8ae1b091c3 Staging: android: timed_gpio: Properly discard invalid timeout values.
The timed output device never previously checked the return value of sscanf,
resulting in an uninitialized int being passed to enable() if input value
was invalid.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:33 -07:00
Mike Lockwood
e2dd99e8e2 USB: gadget: f_mass_storage: Defer handling interface changes until it is safe.
Pulling in some code from file_storage.c, we now handle interface changes
in do_set_config(), which is now not called until any pending requests have
been successfully completed or cancelled.

This fixes a race condition that resulted in usb_ep_free_request() being called
while the request is still busy.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:33 -07:00
Arve Hjønnevåg
0274cdc300 android-common: include linux/slab.h
Change-Id: Ib9655177bfaf00bd5682e1ac0d7e813e16a47eea
2010-09-29 17:49:32 -07:00
Colin Cross
8db6b353ae android-common: Fix slab.h includes for 2.6.34-rc4 2010-09-29 17:49:32 -07:00
Arve Hjønnevåg
cf23783c7a rtc: alarm: Don't use save_time_delta.
Change-Id: Iaefeca497de02fe36b7f5d79075912f6e349ec53
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2010-09-29 17:49:32 -07:00
Arve Hjønnevåg
bcb0d01510 binder: Move debugging information from procfs to debugfs
Change-Id: Ia0f9c8cec68054c6600a799ef864ebf1185c93ab
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2010-09-29 17:49:32 -07:00
Arve Hjønnevåg
a0cc646e7e binder: Use seq_file for debug interface.
Change-Id: I6e9c064ba024329099cb833b2ae9ab43c2ad8c6d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2010-09-29 17:49:32 -07:00
Arve Hjønnevåg
372a94c2ed USB: gadget: android: mass_storage: Use spin_lock_irqsave/spin_unlock_irqrestore
The old code did not allways disable interrupts when called from thread
context, but tried to lock the same spinlock from interrupt context.

This was merged from a change to drivers/usb/function/mass_storage.c
in the android-msm-2.6.29 branch.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:31 -07:00
Mike Lockwood
437ae6a946 USB: gadget: android: check for null _android_dev in android_register_function()
This fixes a load ordering issue that occurred if a function driver loads before
the android gadget driver is initialized.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:31 -07:00
Iliyan Malchev
fcf1d6043f apanic: make APANIC_LABEL depend on APANIC
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-09-29 17:49:31 -07:00
Mike Lockwood
b0d8ef8a45 USB: gadget: f_mass_storage: Flush writes after every 4 MB.
This avoids excessive caching at the block level layer when copying large
files to the storage device.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:31 -07:00
Mike Lockwood
82c7dd9e74 USB: gadget: f_rndis: Add platform data for RNDIS vendor ID and MAC address.
This fixes a kernel panic in rndis.c when receiving the
OID_GEN_VENDOR_DESCRIPTION command.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:30 -07:00
Dima Zavin
d5fb3c725b pmem: Add cache flush ioctl for pmem buffers
Change-Id: I9156bad829e8c65087f122b48cc57638902fab12
Signed-off-by: Dima Zavin <dima@android.com>
2010-09-29 17:49:30 -07:00
Mike Lockwood
d3d0cbff72 USB: gadget: composite: Don't increment interface number for alt settings.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:30 -07:00
Mike Lockwood
af1f674f09 USB: gadget: composite: Don't call set_alt() on functions that are hidden.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:30 -07:00
Mike Lockwood
e8e9925629 USB: gadget: android: Disable UMS when RNDIS ethernet is active.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:29 -07:00
San Mehat
7bb5d8d73a android: logger: Add new system log for framework/system log messages
Signed-off-by: San Mehat <san@google.com>
2010-09-29 17:49:29 -07:00
Mike Lockwood
20098313ba usb: gadget: u_ether: Remove warning from gether_disconnect()
gether_disconnect() is always called before gether_connect() by the different
USB ethernet functions, so this warning was firing during normal operation.

Change-Id: I178cc7d1f67e9e87ac2e99c6674c4db8fcddf4a0
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:28 -07:00
Steve Kondik
565e9273ae Add USB_ANDROID_RNDIS_WCEIS option.
Change-Id: I85973ebfcbfae6b401fb8b402842309c72655149
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:28 -07:00
Dima Zavin
f14c2ef5f1 mtd: nand: Allow NAND chip ids to be included standalone.
Lets non-standard NAND drivers take advantage of known NAND
chip information.

Change-Id: I87e2fcb40b07b2ec91e102f1fa7f419a4b4af0a3
Signed-off-by: Dima Zavin <dima@android.com>
2010-09-29 17:49:28 -07:00
Mike Lockwood
875ca01936 USB: gadget: android: Fix special case for RNDIS ethernet function
Only set device descriptor bDeviceClass field to USB_CLASS_COMM when
the RNDIS function is actually enabled.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:28 -07:00
Mike Lockwood
07daf77545 USB: composite: Compute interface numbers correctly when functions are hidden.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:27 -07:00
Mike Lockwood
70b4a7eed9 USB: gadget: android: Specify USB_CLASS_COMM in device descriptor if using RNDIS
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:27 -07:00
Mike Lockwood
892533d3ee USB: gadget: Disable RNDIS function by default if CONFIG_USB_ANDROID_RNDIS is set
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-29 17:49:27 -07:00