aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2009-11-19 12:03:01 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-11-19 12:03:01 -0800
commit900e0537d14ca7abf3fa0888b21edae0b622cce2 (patch)
tree8f176df625ceddf76369162cd9462c0cd6ef8489
parentf3fec1c2dd60fe946d4e5886479bf93703ed7bf0 (diff)
downloadpatches-900e0537d14ca7abf3fa0888b21edae0b622cce2.tar.gz
staging patches
-rw-r--r--series18
-rw-r--r--staging.current/staging-hv-fix-argument-order-in-incorrect-memset-invocations-in-hyperv-driver.patch69
-rw-r--r--staging/staging-dst-fix-coding-style.patch708
-rw-r--r--staging/staging-fix-assorted-typos-all-over-the-place.patch1200
-rw-r--r--staging/staging-iio-fix-ring-buffer-build.patch76
-rw-r--r--staging/staging-iio-fix-typos-in-documentation.patch56
-rw-r--r--staging/staging-iio-tsl2563-ambient-light-sensor-driver.patch840
-rw-r--r--staging/staging-line6-fix-printk-formats.patch42
-rw-r--r--staging/staging-rt2860-reduce-superfluous-exclamation-marks.patch776
-rw-r--r--staging/staging-rt28x0-fix-comments-in-chip-mac_pci.h.patch188
-rw-r--r--staging/staging-rt28x0-remove-no-longer-needed-common-cmm_data_2860.c.patch1219
-rw-r--r--staging/staging-rtl8187se-remove-card8185-variable-to-simplify-flow.patch569
-rw-r--r--staging/staging-rtl8187se-remove-card_type.patch196
-rw-r--r--staging/staging-rtl8187se-rename-staging-driver-to-avoid-name-conflict-with-mainline-driver.patch63
-rw-r--r--staging/staging-rtl8192u-depends-on-usb.patch36
-rw-r--r--staging/staging-sep-fix-2-warnings.patch43
-rw-r--r--staging/staging-usbip-fix-typo-contoroller.patch26
-rw-r--r--staging/staging-vt665-fix-printk-formats.patch79
18 files changed, 6204 insertions, 0 deletions
diff --git a/series b/series
index 265212d222fe43..b5b23c952722ea 100644
--- a/series
+++ b/series
@@ -21,6 +21,7 @@ gregkh/gkh-version.patch
#################################
# Staging patches for 2.6.32
#################################
+staging.current/staging-hv-fix-argument-order-in-incorrect-memset-invocations-in-hyperv-driver.patch
#####################################################################
@@ -319,6 +320,22 @@ staging/staging-vme-fix-mutex-locking.patch
staging/staging-dst-fix-parentheses.patch
staging/staging-rtl8192su-depends-on-usb.patch
+staging/staging-iio-fix-ring-buffer-build.patch
+staging/staging-rtl8192u-depends-on-usb.patch
+staging/staging-vt665-fix-printk-formats.patch
+staging/staging-line6-fix-printk-formats.patch
+staging/staging-sep-fix-2-warnings.patch
+staging/staging-iio-fix-typos-in-documentation.patch
+staging/staging-iio-tsl2563-ambient-light-sensor-driver.patch
+staging/staging-rt28x0-fix-comments-in-chip-mac_pci.h.patch
+staging/staging-rt2860-reduce-superfluous-exclamation-marks.patch
+staging/staging-rt28x0-remove-no-longer-needed-common-cmm_data_2860.c.patch
+staging/staging-usbip-fix-typo-contoroller.patch
+staging/staging-dst-fix-coding-style.patch
+staging/staging-fix-assorted-typos-all-over-the-place.patch
+staging/staging-rtl8187se-remove-card8185-variable-to-simplify-flow.patch
+staging/staging-rtl8187se-remove-card_type.patch
+staging/staging-rtl8187se-rename-staging-driver-to-avoid-name-conflict-with-mainline-driver.patch
# add and remove drivers .33
staging/staging-android-delete-android-drivers.patch
@@ -340,3 +357,4 @@ staging/staging-rtl8192u-remove-dead-code.patch
+
diff --git a/staging.current/staging-hv-fix-argument-order-in-incorrect-memset-invocations-in-hyperv-driver.patch b/staging.current/staging-hv-fix-argument-order-in-incorrect-memset-invocations-in-hyperv-driver.patch
new file mode 100644
index 00000000000000..a045f74d163e1b
--- /dev/null
+++ b/staging.current/staging-hv-fix-argument-order-in-incorrect-memset-invocations-in-hyperv-driver.patch
@@ -0,0 +1,69 @@
+From davej@redhat.com Thu Nov 19 11:30:16 2009
+From: Dave Jones <davej@redhat.com>
+Date: Wed, 11 Nov 2009 16:57:03 -0500
+Subject: Staging: hv: Fix argument order in incorrect memset invocations in hyperv driver.
+To: Hank Janssen <hjanssen@microsoft.com>
+Cc: Greg Kroah-Hartman <gregkh@suse.de>
+Message-ID: <20091111215703.GA24390@redhat.com>
+Content-Disposition: inline
+
+From: Dave Jones <davej@redhat.com>
+
+Nearly every invocation of memset in drivers/staging/hv/StorVsc.c has
+it's arguments the wrong way around.
+
+Signed-off-by: Dave Jones <davej@redhat.com>
+Cc: Hank Janssen <hjanssen@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/hv/StorVsc.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/staging/hv/StorVsc.c
++++ b/drivers/staging/hv/StorVsc.c
+@@ -196,7 +196,7 @@ static int StorVscChannelInit(struct hv_
+ * Now, initiate the vsc/vsp initialization protocol on the open
+ * channel
+ */
+- memset(request, sizeof(struct storvsc_request_extension), 0);
++ memset(request, 0, sizeof(struct storvsc_request_extension));
+ request->WaitEvent = osd_WaitEventCreate();
+
+ vstorPacket->Operation = VStorOperationBeginInitialization;
+@@ -233,7 +233,7 @@ static int StorVscChannelInit(struct hv_
+ DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION...");
+
+ /* reuse the packet for version range supported */
+- memset(vstorPacket, sizeof(struct vstor_packet), 0);
++ memset(vstorPacket, 0, sizeof(struct vstor_packet));
+ vstorPacket->Operation = VStorOperationQueryProtocolVersion;
+ vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
+
+@@ -266,7 +266,7 @@ static int StorVscChannelInit(struct hv_
+ /* Query channel properties */
+ DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION...");
+
+- memset(vstorPacket, sizeof(struct vstor_packet), 0);
++ memset(vstorPacket, 0, sizeof(struct vstor_packet));
+ vstorPacket->Operation = VStorOperationQueryProperties;
+ vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
+ vstorPacket->StorageChannelProperties.PortNumber =
+@@ -305,7 +305,7 @@ static int StorVscChannelInit(struct hv_
+
+ DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION...");
+
+- memset(vstorPacket, sizeof(struct vstor_packet), 0);
++ memset(vstorPacket, 0, sizeof(struct vstor_packet));
+ vstorPacket->Operation = VStorOperationEndInitialization;
+ vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
+
+@@ -508,7 +508,7 @@ static int StorVscConnectToVsp(struct hv
+ int ret;
+
+ storDriver = (struct storvsc_driver_object *)Device->Driver;
+- memset(&props, sizeof(struct vmstorage_channel_properties), 0);
++ memset(&props, 0, sizeof(struct vmstorage_channel_properties));
+
+ /* Open the channel */
+ ret = Device->Driver->VmbusChannelInterface.Open(Device,
diff --git a/staging/staging-dst-fix-coding-style.patch b/staging/staging-dst-fix-coding-style.patch
new file mode 100644
index 00000000000000..3490d4eed3b759
--- /dev/null
+++ b/staging/staging-dst-fix-coding-style.patch
@@ -0,0 +1,708 @@
+From mz.mzet@gmail.com Thu Nov 19 11:51:43 2009
+From: Mariusz Ziulek <mz.mzet@gmail.com>
+Date: Thu, 12 Nov 2009 15:01:16 +0100
+Subject: [PATCH 1/2] staging: dst: fix coding style
+To: greg@kroah.com
+Cc: Mariusz Ziulek <mz.mzet@gmail.com>
+Message-ID: <1258034476-29197-1-git-send-email-mz.mzet@gmail.com>
+
+
+From: Mariusz Ziulek <mz.mzet@gmail.com>
+
+
+Signed-off-by: Mariusz Ziulek <mz.mzet@gmail.com>
+Cc: Evgeniy Polyakov <zbr@ioremap.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/dst/crypto.c | 64 +++++++++++++++++----------------
+ drivers/staging/dst/dcore.c | 26 +++++++------
+ drivers/staging/dst/export.c | 31 ++++++++--------
+ drivers/staging/dst/state.c | 73 ++++++++++++++++++++------------------
+ drivers/staging/dst/thread_pool.c | 39 ++++++++++----------
+ drivers/staging/dst/trans.c | 18 +++++----
+ 6 files changed, 135 insertions(+), 116 deletions(-)
+
+--- a/drivers/staging/dst/crypto.c
++++ b/drivers/staging/dst/crypto.c
+@@ -64,7 +64,8 @@ err_out_exit:
+ return ERR_PTR(err);
+ }
+
+-static struct crypto_ablkcipher *dst_init_cipher(struct dst_crypto_ctl *ctl, u8 *key)
++static struct crypto_ablkcipher *dst_init_cipher(struct dst_crypto_ctl *ctl,
++ u8 *key)
+ {
+ int err = -EINVAL;
+ struct crypto_ablkcipher *cipher;
+@@ -105,7 +106,7 @@ static void dst_crypto_pages_free(struct
+ {
+ unsigned int i;
+
+- for (i=0; i<e->page_num; ++i)
++ for (i = 0; i < e->page_num; ++i)
+ __free_page(e->pages[i]);
+ kfree(e->pages);
+ }
+@@ -118,7 +119,7 @@ static int dst_crypto_pages_alloc(struct
+ if (!e->pages)
+ return -ENOMEM;
+
+- for (i=0; i<num; ++i) {
++ for (i = 0; i < num; ++i) {
+ e->pages[i] = alloc_page(GFP_KERNEL);
+ if (!e->pages[i])
+ goto err_out_free_pages;
+@@ -139,7 +140,8 @@ err_out_free_pages:
+ * Initialize crypto engine for given node.
+ * Setup cipher/hash, keys, pool of threads and private data.
+ */
+-static int dst_crypto_engine_init(struct dst_crypto_engine *e, struct dst_node *n)
++static int dst_crypto_engine_init(struct dst_crypto_engine *e,
++ struct dst_node *n)
+ {
+ int err;
+ struct dst_crypto_ctl *ctl = &n->crypto;
+@@ -198,8 +200,7 @@ static void dst_crypto_engine_exit(struc
+ /*
+ * Waiting for cipher processing to be completed.
+ */
+-struct dst_crypto_completion
+-{
++struct dst_crypto_completion {
+ struct completion complete;
+ int error;
+ };
+@@ -237,17 +238,17 @@ static int dst_crypto_process(struct abl
+ err = crypto_ablkcipher_decrypt(req);
+
+ switch (err) {
+- case -EINPROGRESS:
+- case -EBUSY:
+- err = wait_for_completion_interruptible_timeout(&c.complete,
+- timeout);
+- if (!err)
+- err = -ETIMEDOUT;
+- else
+- err = c.error;
+- break;
+- default:
+- break;
++ case -EINPROGRESS:
++ case -EBUSY:
++ err = wait_for_completion_interruptible_timeout(&c.complete,
++ timeout);
++ if (!err)
++ err = -ETIMEDOUT;
++ else
++ err = c.error;
++ break;
++ default:
++ break;
+ }
+
+ return err;
+@@ -263,7 +264,7 @@ static int dst_crypto_process(struct abl
+ * temporary storage, which is then being sent to the remote peer.
+ */
+ static int dst_trans_iter_out(struct bio *bio, struct dst_crypto_engine *e,
+- int (* iterator) (struct dst_crypto_engine *e,
++ int (*iterator) (struct dst_crypto_engine *e,
+ struct scatterlist *dst,
+ struct scatterlist *src))
+ {
+@@ -286,7 +287,7 @@ static int dst_trans_iter_out(struct bio
+ }
+
+ static int dst_trans_iter_in(struct bio *bio, struct dst_crypto_engine *e,
+- int (* iterator) (struct dst_crypto_engine *e,
++ int (*iterator) (struct dst_crypto_engine *e,
+ struct scatterlist *dst,
+ struct scatterlist *src))
+ {
+@@ -411,9 +412,9 @@ static void dst_crypto_thread_cleanup(vo
+ * Initialize crypto engine for given node: store keys, create pool
+ * of threads, initialize each one.
+ *
+- * Each thread has unique ID, but 0 and 1 are reserved for receiving and accepting
+- * threads (if export node), so IDs could start from 2, but starting them
+- * from 10 allows easily understand what this thread is for.
++ * Each thread has unique ID, but 0 and 1 are reserved for receiving and
++ * accepting threads (if export node), so IDs could start from 2, but starting
++ * them from 10 allows easily understand what this thread is for.
+ */
+ int dst_node_crypto_init(struct dst_node *n, struct dst_crypto_ctl *ctl)
+ {
+@@ -436,10 +437,10 @@ int dst_node_crypto_init(struct dst_node
+ }
+ memcpy(&n->crypto, ctl, sizeof(struct dst_crypto_ctl));
+
+- for (i=0; i<ctl->thread_num; ++i) {
++ for (i = 0; i < ctl->thread_num; ++i) {
+ snprintf(name, sizeof(name), "%s-crypto-%d", n->name, i);
+ /* Unique ids... */
+- err = thread_pool_add_worker(n->pool, name, i+10,
++ err = thread_pool_add_worker(n->pool, name, i + 10,
+ dst_crypto_thread_init, dst_crypto_thread_cleanup, n);
+ if (err)
+ goto err_out_free_threads;
+@@ -496,8 +497,8 @@ static void dst_dump_bio(struct bio *bio
+ bv->bv_len, bv->bv_offset);
+
+ p = kmap(bv->bv_page) + bv->bv_offset;
+- for (i=0; i<bv->bv_len; ++i)
+- printk("%02x ", p[i]);
++ for (i = 0; i < bv->bv_len; ++i)
++ printk(KERN_DEBUG "%02x ", p[i]);
+ kunmap(bv->bv_page);
+ printk("\n");
+ }
+@@ -532,7 +533,7 @@ static int dst_crypto_process_sending(st
+ printk(KERN_DEBUG "%s: bio: %llu/%u, rw: %lu, hash: ",
+ __func__, (u64)bio->bi_sector,
+ bio->bi_size, bio_data_dir(bio));
+- for (i=0; i<crypto_hash_digestsize(e->hash); ++i)
++ for (i = 0; i < crypto_hash_digestsize(e->hash); ++i)
+ printk("%02x ", hash[i]);
+ printk("\n");
+ }
+@@ -572,9 +573,9 @@ static int dst_crypto_process_receiving(
+ unsigned int i;
+
+ printk(", recv/calc: ");
+- for (i=0; i<crypto_hash_digestsize(e->hash); ++i) {
++ for (i = 0; i < crypto_hash_digestsize(e->hash); ++i)
+ printk("%02x/%02x ", recv_hash[i], hash[i]);
+- }
++
+ }
+ printk("\n");
+ #endif
+@@ -680,8 +681,9 @@ static int dst_export_crypto_action(void
+ struct dst_export_priv *p = bio->bi_private;
+ int err;
+
+- dprintk("%s: e: %p, data: %p, bio: %llu/%u, dir: %lu.\n", __func__,
+- e, e->data, (u64)bio->bi_sector, bio->bi_size, bio_data_dir(bio));
++ dprintk("%s: e: %p, data: %p, bio: %llu/%u, dir: %lu.\n",
++ __func__, e, e->data, (u64)bio->bi_sector,
++ bio->bi_size, bio_data_dir(bio));
+
+ e->enc = (bio_data_dir(bio) == READ);
+ e->iv = p->cmd.id;
+--- a/drivers/staging/dst/dcore.c
++++ b/drivers/staging/dst/dcore.c
+@@ -116,7 +116,7 @@ static int dst_request(struct request_qu
+ * bio_rw_flagged(bio, BIO_RW_DISCARD) only, which does not
+ * work in this case.
+ */
+- //err = -EOPNOTSUPP;
++ /* err = -EOPNOTSUPP; */
+ err = 0;
+ goto end_io;
+ }
+@@ -197,7 +197,8 @@ static int dst_node_create_disk(struct d
+ n->disk->fops = &dst_blk_ops;
+ n->disk->queue = n->queue;
+ n->disk->private_data = n;
+- snprintf(n->disk->disk_name, sizeof(n->disk->disk_name), "dst-%s", n->name);
++ snprintf(n->disk->disk_name, sizeof(n->disk->disk_name),
++ "dst-%s", n->name);
+
+ return 0;
+
+@@ -246,7 +247,8 @@ static ssize_t dst_show_type(struct devi
+ return sprintf(buf, "%u.%u.%u.%u:%d\n",
+ NIPQUAD(sin->sin_addr.s_addr), ntohs(sin->sin_port));
+ } else if (family == AF_INET6) {
+- struct sockaddr_in6 *sin = (struct sockaddr_in6 *)&info->net.addr;
++ struct sockaddr_in6 *sin = (struct sockaddr_in6 *)
++ &info->net.addr;
+ return sprintf(buf,
+ "%pi6:%d\n",
+ &sin->sin6_addr, ntohs(sin->sin6_port));
+@@ -261,7 +263,7 @@ static ssize_t dst_show_type(struct devi
+ sz -= size;
+ buf += size;
+
+- for (i=0; i<addrlen; ++i) {
++ for (i = 0; i < addrlen; ++i) {
+ if (sz < 3)
+ break;
+
+@@ -286,7 +288,7 @@ static int dst_create_node_attributes(st
+ {
+ int err, i;
+
+- for (i=0; i<ARRAY_SIZE(dst_node_attrs); ++i) {
++ for (i = 0; i < ARRAY_SIZE(dst_node_attrs); ++i) {
+ err = device_create_file(&n->info->device,
+ &dst_node_attrs[i]);
+ if (err)
+@@ -306,7 +308,7 @@ static void dst_remove_node_attributes(s
+ {
+ int i;
+
+- for (i=0; i<ARRAY_SIZE(dst_node_attrs); ++i)
++ for (i = 0; i < ARRAY_SIZE(dst_node_attrs); ++i)
+ device_remove_file(&n->info->device,
+ &dst_node_attrs[i]);
+ }
+@@ -358,7 +360,7 @@ err_out_exit:
+ */
+ static inline unsigned int dst_hash(char *str, unsigned int size)
+ {
+- return (jhash(str, size, 0) % dst_hashtable_size);
++ return jhash(str, size, 0) % dst_hashtable_size;
+ }
+
+ static void dst_node_remove(struct dst_node *n)
+@@ -641,7 +643,8 @@ static int dst_start_remote(struct dst_n
+ dst_node_set_size(n);
+ add_disk(n->disk);
+
+- dprintk("DST: started remote node '%s', minor: %d.\n", n->name, n->disk->first_minor);
++ dprintk("DST: started remote node '%s', minor: %d.\n",
++ n->name, n->disk->first_minor);
+
+ return 0;
+ }
+@@ -740,7 +743,8 @@ static int dst_node_remove_unload(struct
+ * counter will be equal to 1),
+ * and subsequent dst_node_put() calls will free the node.
+ */
+- dprintk("%s: going to sleep with %d refcnt.\n", __func__, atomic_read(&n->refcnt));
++ dprintk("%s: going to sleep with %d refcnt.\n",
++ __func__, atomic_read(&n->refcnt));
+ wait_event(n->wait, atomic_read(&n->refcnt) <= 2);
+
+ dst_node_put(n);
+@@ -921,7 +925,7 @@ static int __init dst_hashtable_init(voi
+ if (!dst_hashtable)
+ return -ENOMEM;
+
+- for (i=0; i<dst_hashtable_size; ++i)
++ for (i = 0; i < dst_hashtable_size; ++i)
+ INIT_LIST_HEAD(&dst_hashtable[i]);
+
+ return 0;
+@@ -932,7 +936,7 @@ static void dst_hashtable_exit(void)
+ unsigned int i;
+ struct dst_node *n, *tmp;
+
+- for (i=0; i<dst_hashtable_size; ++i) {
++ for (i = 0; i < dst_hashtable_size; ++i) {
+ list_for_each_entry_safe(n, tmp, &dst_hashtable[i], node_entry) {
+ dst_node_remove_unload(n);
+ }
+--- a/drivers/staging/dst/export.c
++++ b/drivers/staging/dst/export.c
+@@ -53,7 +53,8 @@ void dst_export_exit(void)
+ * its permissions are checked in a security attributes and sent
+ * back.
+ */
+-static unsigned int dst_check_permissions(struct dst_state *main, struct dst_state *st)
++static unsigned int dst_check_permissions(struct dst_state *main,
++ struct dst_state *st)
+ {
+ struct dst_node *n = main->node;
+ struct dst_secure *sentry;
+@@ -73,9 +74,9 @@ static unsigned int dst_check_permission
+
+ /*
+ * This '2' below is a port field. This may be very wrong to do
+- * in atalk for example though. If there will be any need to extent
+- * protocol to something else, I can create per-family helpers and
+- * use them instead of this memcmp.
++ * in atalk for example though. If there will be any need
++ * to extent protocol to something else, I can create
++ * per-family helpers and use them instead of this memcmp.
+ */
+ if (memcmp(s->addr.sa_data + 2, sa->sa_data + 2,
+ sa->sa_data_len - 2))
+@@ -125,8 +126,8 @@ static struct dst_state *dst_accept_clie
+ * Magic HZ? Polling check above is not safe in
+ * all cases (like socket reset in BH context),
+ * so it is simpler just to postpone it to the
+- * process context instead of implementing special
+- * locking there.
++ * process context instead of implementing
++ * special locking there.
+ */
+ schedule_timeout(HZ);
+ }
+@@ -272,8 +273,8 @@ static void dst_state_cleanup_export(str
+ if (p)
+ bio_put(p->bio);
+
+- dprintk("%s: st: %p, refcnt: %d, list_empty: %d, p: %p.\n",
+- __func__, st, atomic_read(&st->refcnt),
++ dprintk("%s: st: %p, refcnt: %d, list_empty: %d, p: "
++ "%p.\n", __func__, st, atomic_read(&st->refcnt),
+ list_empty(&st->request_list), p);
+ }
+ }
+@@ -303,9 +304,9 @@ static int dst_accept(void *init_data, v
+ if (!err) {
+ while (n->trans_scan_timeout) {
+ err = wait_event_interruptible_timeout(st->thread_wait,
+- !list_empty(&st->request_list) ||
+- !n->trans_scan_timeout ||
+- st->need_exit,
++ !list_empty(&st->request_list) ||
++ !n->trans_scan_timeout ||
++ st->need_exit,
+ HZ);
+
+ if (!n->trans_scan_timeout || st->need_exit)
+@@ -341,8 +342,9 @@ static int dst_accept(void *init_data, v
+ int dst_start_export(struct dst_node *n)
+ {
+ if (list_empty(&n->security_list)) {
+- printk(KERN_ERR "You are trying to export node '%s' without security attributes.\n"
+- "No clients will be allowed to connect. Exiting.\n", n->name);
++ printk(KERN_ERR "You are trying to export node '%s' "
++ "without security attributes.\nNo clients will "
++ "be allowed to connect. Exiting.\n", n->name);
+ return -EINVAL;
+ }
+ return dst_node_trans_init(n, sizeof(struct dst_export_priv));
+@@ -552,7 +554,8 @@ int dst_process_io(struct dst_state *st)
+ if (!bio)
+ goto err_out_exit;
+
+- priv = (struct dst_export_priv *)(((void *)bio) - sizeof (struct dst_export_priv));
++ priv = (struct dst_export_priv *)(((void *)bio) -
++ sizeof (struct dst_export_priv));
+
+ priv->state = dst_state_get(st);
+ priv->bio = bio;
+--- a/drivers/staging/dst/state.c
++++ b/drivers/staging/dst/state.c
+@@ -30,13 +30,13 @@
+ * Polling machinery.
+ */
+
+-struct dst_poll_helper
+-{
+- poll_table pt;
++struct dst_poll_helper {
++ poll_table pt;
+ struct dst_state *st;
+ };
+
+-static int dst_queue_wake(wait_queue_t *wait, unsigned mode, int sync, void *key)
++static int dst_queue_wake(wait_queue_t *wait, unsigned mode,
++ int sync, void *key)
+ {
+ struct dst_state *st = container_of(wait, struct dst_state, wait);
+
+@@ -92,7 +92,7 @@ static int dst_data_recv_header(struct s
+ msg.msg_namelen = 0;
+ msg.msg_control = NULL;
+ msg.msg_controllen = 0;
+- msg.msg_flags = (block)?MSG_WAITALL:MSG_DONTWAIT;
++ msg.msg_flags = (block) ? MSG_WAITALL : MSG_DONTWAIT;
+
+ err = kernel_recvmsg(sock, &msg, &iov, 1, iov.iov_len,
+ msg.msg_flags);
+@@ -217,8 +217,8 @@ void dst_dump_addr(struct socket *sk, st
+ {
+ if (sk->ops->family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+- printk(KERN_INFO "%s %u.%u.%u.%u:%d.\n",
+- str, NIPQUAD(sin->sin_addr.s_addr), ntohs(sin->sin_port));
++ printk(KERN_INFO "%s %u.%u.%u.%u:%d.\n", str,
++ NIPQUAD(sin->sin_addr.s_addr), ntohs(sin->sin_port));
+ } else if (sk->ops->family == AF_INET6) {
+ struct sockaddr_in6 *sin = (struct sockaddr_in6 *)sa;
+ printk(KERN_INFO "%s %pi6:%d",
+@@ -271,13 +271,13 @@ err_out_exit:
+ * State reset is used to reconnect to the remote peer.
+ * May fail, but who cares, we will try again later.
+ */
+-static void inline dst_state_reset_nolock(struct dst_state *st)
++static inline void dst_state_reset_nolock(struct dst_state *st)
+ {
+ dst_state_exit_connected(st);
+ dst_state_init_connected(st);
+ }
+
+-static void inline dst_state_reset(struct dst_state *st)
++static inline void dst_state_reset(struct dst_state *st)
+ {
+ dst_state_lock(st);
+ dst_state_reset_nolock(st);
+@@ -335,9 +335,11 @@ static int dst_send_ping(struct dst_stat
+
+ cmd->cmd = __cpu_to_be32(DST_PING);
+
+- err = dst_data_send_header(st->socket, cmd, sizeof(struct dst_cmd), 0);
++ err = dst_data_send_header(st->socket, cmd,
++ sizeof(struct dst_cmd), 0);
+ }
+- dprintk("%s: st: %p, socket: %p, err: %d.\n", __func__, st, st->socket, err);
++ dprintk("%s: st: %p, socket: %p, err: %d.\n", __func__,
++ st, st->socket, err);
+ dst_state_unlock(st);
+
+ return err;
+@@ -390,8 +392,7 @@ int dst_data_recv(struct dst_state *st,
+ err = -ECONNRESET;
+ dst_state_lock(st);
+
+- if ( st->socket &&
+- (st->read_socket == st->socket) &&
++ if (st->socket && (st->read_socket == st->socket) &&
+ (revents & POLLIN)) {
+ err = dst_data_recv_raw(st, data, size);
+ if (err > 0) {
+@@ -402,8 +403,9 @@ int dst_data_recv(struct dst_state *st,
+ }
+
+ if (revents & err_mask || !st->socket) {
+- dprintk("%s: revents: %x, socket: %p, size: %u, err: %d.\n",
+- __func__, revents, st->socket, size, err);
++ dprintk("%s: revents: %x, socket: %p, size: %u, "
++ "err: %d.\n", __func__, revents,
++ st->socket, size, err);
+ err = -ECONNRESET;
+ }
+
+@@ -440,7 +442,8 @@ static int dst_process_cfg(struct dst_st
+ /*
+ * Receive block IO from the network.
+ */
+-static int dst_recv_bio(struct dst_state *st, struct bio *bio, unsigned int total_size)
++static int dst_recv_bio(struct dst_state *st, struct bio *bio,
++ unsigned int total_size)
+ {
+ struct bio_vec *bv;
+ int i, err;
+@@ -450,9 +453,10 @@ static int dst_recv_bio(struct dst_state
+ bio_for_each_segment(bv, bio, i) {
+ sz = min(total_size, bv->bv_len);
+
+- dprintk("%s: bio: %llu/%u, total: %u, len: %u, sz: %u, off: %u.\n",
+- __func__, (u64)bio->bi_sector, bio->bi_size, total_size,
+- bv->bv_len, sz, bv->bv_offset);
++ dprintk("%s: bio: %llu/%u, total: %u, len: %u, sz: %u, "
++ "off: %u.\n", __func__, (u64)bio->bi_sector,
++ bio->bi_size, total_size, bv->bv_len, sz,
++ bv->bv_offset);
+
+ data = kmap(bv->bv_page) + bv->bv_offset;
+ err = dst_data_recv(st, data, sz);
+@@ -590,7 +594,8 @@ static int dst_recv_processing(struct ds
+ cmd->flags, cmd->rw);
+
+ /*
+- * This should catch protocol breakage and random garbage instead of commands.
++ * This should catch protocol breakage and random garbage
++ * instead of commands.
+ */
+ if (unlikely(cmd->csize > st->size - sizeof(struct dst_cmd))) {
+ err = -EBADMSG;
+@@ -599,20 +604,20 @@ static int dst_recv_processing(struct ds
+
+ err = -EPROTO;
+ switch (cmd->cmd) {
+- case DST_IO_RESPONSE:
+- err = dst_process_io_response(st);
+- break;
+- case DST_IO:
+- err = dst_process_io(st);
+- break;
+- case DST_CFG:
+- err = dst_process_cfg(st);
+- break;
+- case DST_PING:
+- err = 0;
+- break;
+- default:
+- break;
++ case DST_IO_RESPONSE:
++ err = dst_process_io_response(st);
++ break;
++ case DST_IO:
++ err = dst_process_io(st);
++ break;
++ case DST_CFG:
++ err = dst_process_cfg(st);
++ break;
++ case DST_PING:
++ err = 0;
++ break;
++ default:
++ break;
+ }
+
+ out_exit:
+--- a/drivers/staging/dst/thread_pool.c
++++ b/drivers/staging/dst/thread_pool.c
+@@ -30,8 +30,7 @@
+ * When action is being performed, thread can not be used by other users,
+ * instead they will sleep until there is free thread to pick their work.
+ */
+-struct thread_pool_worker
+-{
++struct thread_pool_worker {
+ struct list_head worker_entry;
+
+ struct task_struct *thread;
+@@ -48,8 +47,8 @@ struct thread_pool_worker
+ void *private;
+ void *schedule_data;
+
+- int (* action)(void *private, void *schedule_data);
+- void (* cleanup)(void *private);
++ int (*action)(void *private, void *schedule_data);
++ void (*cleanup)(void *private);
+ };
+
+ static void thread_pool_exit_worker(struct thread_pool_worker *w)
+@@ -116,10 +115,12 @@ void thread_pool_del_worker(struct threa
+ struct thread_pool_worker *w = NULL;
+
+ while (!w && p->thread_num) {
+- wait_event(p->wait, !list_empty(&p->ready_list) || !p->thread_num);
++ wait_event(p->wait, !list_empty(&p->ready_list) ||
++ !p->thread_num);
+
+ dprintk("%s: locking list_empty: %d, thread_num: %d.\n",
+- __func__, list_empty(&p->ready_list), p->thread_num);
++ __func__, list_empty(&p->ready_list),
++ p->thread_num);
+
+ mutex_lock(&p->thread_lock);
+ if (!list_empty(&p->ready_list)) {
+@@ -127,8 +128,9 @@ void thread_pool_del_worker(struct threa
+ struct thread_pool_worker,
+ worker_entry);
+
+- dprintk("%s: deleting w: %p, thread_num: %d, list: %p [%p.%p].\n",
+- __func__, w, p->thread_num, &p->ready_list,
++ dprintk("%s: deleting w: %p, thread_num: %d, "
++ "list: %p [%p.%p].\n", __func__,
++ w, p->thread_num, &p->ready_list,
+ p->ready_list.prev, p->ready_list.next);
+
+ p->thread_num--;
+@@ -182,8 +184,8 @@ void thread_pool_del_worker_id(struct th
+ int thread_pool_add_worker(struct thread_pool *p,
+ char *name,
+ unsigned int id,
+- void *(* init)(void *private),
+- void (* cleanup)(void *private),
++ void *(*init)(void *private),
++ void (*cleanup)(void *private),
+ void *private)
+ {
+ struct thread_pool_worker *w;
+@@ -243,8 +245,8 @@ void thread_pool_destroy(struct thread_p
+ * They will have sequential IDs started from zero.
+ */
+ struct thread_pool *thread_pool_create(int num, char *name,
+- void *(* init)(void *private),
+- void (* cleanup)(void *private),
++ void *(*init)(void *private),
++ void (*cleanup)(void *private),
+ void *private)
+ {
+ struct thread_pool_worker *w, *tmp;
+@@ -262,7 +264,7 @@ struct thread_pool *thread_pool_create(i
+ INIT_LIST_HEAD(&p->active_list);
+ p->thread_num = 0;
+
+- for (i=0; i<num; ++i) {
++ for (i = 0; i < num; ++i) {
+ err = thread_pool_add_worker(p, name, i, init,
+ cleanup, private);
+ if (err)
+@@ -287,8 +289,8 @@ err_out_exit:
+ * private data.
+ */
+ int thread_pool_schedule_private(struct thread_pool *p,
+- int (* setup)(void *private, void *data),
+- int (* action)(void *private, void *data),
++ int (*setup)(void *private, void *data),
++ int (*action)(void *private, void *data),
+ void *data, long timeout, void *id)
+ {
+ struct thread_pool_worker *w, *tmp, *worker = NULL;
+@@ -321,7 +323,8 @@ int thread_pool_schedule_private(struct
+ w->has_data = 1;
+ wake_up(&w->wait);
+ } else {
+- list_move_tail(&w->worker_entry, &p->ready_list);
++ list_move_tail(&w->worker_entry,
++ &p->ready_list);
+ }
+
+ break;
+@@ -336,8 +339,8 @@ int thread_pool_schedule_private(struct
+ * Schedule execution on arbitrary thread from the pool.
+ */
+ int thread_pool_schedule(struct thread_pool *p,
+- int (* setup)(void *private, void *data),
+- int (* action)(void *private, void *data),
++ int (*setup)(void *private, void *data),
++ int (*action)(void *private, void *data),
+ void *data, long timeout)
+ {
+ return thread_pool_schedule_private(p, setup,
+--- a/drivers/staging/dst/trans.c
++++ b/drivers/staging/dst/trans.c
+@@ -58,7 +58,7 @@ struct dst_trans *dst_trans_search(struc
+ }
+
+ dprintk("%s: %s transaction: id: %llu.\n", __func__,
+- (ret)?"found":"not found", gen);
++ (ret) ? "found" : "not found", gen);
+
+ return ret;
+ }
+@@ -88,9 +88,9 @@ static int dst_trans_insert(struct dst_t
+
+ new->send_time = jiffies;
+ if (ret) {
+- printk("%s: exist: old: gen: %llu, bio: %llu/%u, send_time: %lu, "
+- "new: gen: %llu, bio: %llu/%u, send_time: %lu.\n",
+- __func__,
++ printk(KERN_DEBUG "%s: exist: old: gen: %llu, bio: %llu/%u, "
++ "send_time: %lu, new: gen: %llu, bio: %llu/%u, "
++ "send_time: %lu.\n", __func__,
+ ret->gen, (u64)ret->bio->bi_sector,
+ ret->bio->bi_size, ret->send_time,
+ new->gen, (u64)new->bio->bi_sector,
+@@ -206,7 +206,8 @@ err_out_exit:
+ */
+ static void dst_trans_scan(struct work_struct *work)
+ {
+- struct dst_node *n = container_of(work, struct dst_node, trans_work.work);
++ struct dst_node *n = container_of(work, struct dst_node,
++ trans_work.work);
+ struct rb_node *rb_node;
+ struct dst_trans *t;
+ unsigned long timeout = n->trans_scan_timeout;
+@@ -246,8 +247,8 @@ static void dst_trans_scan(struct work_s
+ mutex_unlock(&n->trans_lock);
+
+ /*
+- * If no timeout specified then system is in the middle of exiting process,
+- * so no need to reschedule scanning process again.
++ * If no timeout specified then system is in the middle of exiting
++ * process, so no need to reschedule scanning process again.
+ */
+ if (timeout) {
+ if (!num)
+@@ -313,7 +314,8 @@ int dst_node_trans_init(struct dst_node
+ if (!n->trans_cache)
+ goto err_out_exit;
+
+- n->trans_pool = mempool_create_slab_pool(dst_mempool_num, n->trans_cache);
++ n->trans_pool = mempool_create_slab_pool(dst_mempool_num,
++ n->trans_cache);
+ if (!n->trans_pool)
+ goto err_out_cache_destroy;
+
diff --git a/staging/staging-fix-assorted-typos-all-over-the-place.patch b/staging/staging-fix-assorted-typos-all-over-the-place.patch
new file mode 100644
index 00000000000000..74d6c4b33ff829
--- /dev/null
+++ b/staging/staging-fix-assorted-typos-all-over-the-place.patch
@@ -0,0 +1,1200 @@
+From andre.goddard@gmail.com Thu Nov 19 11:53:15 2009
+From: Andr� Goddard Rosa <andre.goddard@gmail.com>
+Date: Sat, 14 Nov 2009 13:09:06 -0200
+Subject: Staging: fix assorted typos all over the place
+To: jkosina@suse.cz, "Greg Kroah-Hartman" <gregkh@suse.de>
+Cc: Andr� Goddard Rosa <andre.goddard@gmail.com>
+Message-ID: <9dc2d726158553d4a722d449eb3027622783d563.1258210894.git.andre.goddard@gmail.com>
+
+
+Signed-off-by: Andr� Goddard Rosa <andre.goddard@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/altpciechdma/altpciechdma.c | 6 +--
+ drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c | 6 +--
+ drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c | 2 -
+ drivers/staging/comedi/drivers/addi-data/addi_common.h | 2 -
+ drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 2 -
+ drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c | 2 -
+ drivers/staging/comedi/drivers/cb_pcidio.c | 4 +-
+ drivers/staging/comedi/drivers/me4000.c | 2 -
+ drivers/staging/comedi/drivers/pcl812.c | 6 +--
+ drivers/staging/comedi/drivers/pcl816.c | 4 +-
+ drivers/staging/comedi/drivers/pcl818.c | 10 +++---
+ drivers/staging/dst/export.c | 2 -
+ drivers/staging/et131x/et131x_adapter.h | 2 -
+ drivers/staging/hv/hv_api.h | 4 +-
+ drivers/staging/iio/accel/accel.h | 6 +--
+ drivers/staging/iio/accel/sca3000.h | 4 +-
+ drivers/staging/iio/accel/sca3000_core.c | 2 -
+ drivers/staging/octeon/cvmx-pow.h | 2 -
+ drivers/staging/octeon/ethernet-tx.c | 2 -
+ drivers/staging/otus/80211core/ccmd.c | 4 +-
+ drivers/staging/otus/80211core/cmm.c | 4 +-
+ drivers/staging/otus/80211core/cmmsta.c | 4 +-
+ drivers/staging/otus/80211core/ctxrx.c | 2 -
+ drivers/staging/otus/80211core/pub_zfi.h | 2 -
+ drivers/staging/quatech_usb2/quatech_usb2.c | 2 -
+ drivers/staging/rar/rar_driver.c | 4 +-
+ drivers/staging/rt2860/sta/rtmp_data.c | 2 -
+ drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c | 6 +--
+ drivers/staging/rtl8187se/r8180.h | 2 -
+ drivers/staging/rtl8187se/r8180_core.c | 10 +++---
+ drivers/staging/rtl8187se/r8180_dm.c | 12 +++----
+ drivers/staging/rtl8187se/r8180_rtl8225z2.c | 2 -
+ drivers/staging/rtl8187se/r8180_wx.c | 2 -
+ drivers/staging/rtl8187se/r8185b_init.c | 4 +-
+ drivers/staging/rtl8192e/ieee80211/ieee80211_module.c | 2 -
+ drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c | 4 +-
+ drivers/staging/rtl8192e/r8190_rtl8256.c | 2 -
+ drivers/staging/rtl8192e/r8192E_core.c | 6 +--
+ drivers/staging/rtl8192e/r8192E_dm.c | 20 ++++++-------
+ drivers/staging/rtl8192e/r8192E_wx.c | 2 -
+ drivers/staging/rtl8192e/r819xE_cmdpkt.c | 2 -
+ drivers/staging/rtl8192e/r819xE_phyreg.h | 2 -
+ drivers/staging/rtl8192su/ieee80211/ieee80211_module.c | 2 -
+ drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c | 4 +-
+ drivers/staging/rtl8192su/ieee80211/readme | 2 -
+ drivers/staging/rtl8192su/r8192S_phy.c | 4 +-
+ drivers/staging/rtl8192su/r8192S_phyreg.h | 2 -
+ drivers/staging/rtl8192su/r8192S_rtl6052.c | 4 +-
+ drivers/staging/rtl8192su/r8192U_dm.c | 10 +++---
+ drivers/staging/rtl8192su/r8192U_wx.c | 2 -
+ drivers/staging/rtl8192su/r819xU_cmdpkt.c | 2 -
+ drivers/staging/sep/sep_driver.c | 2 -
+ drivers/staging/serqt_usb2/serqt_usb2.c | 2 -
+ drivers/staging/vt6655/device_main.c | 2 -
+ drivers/staging/vt6655/ioctl.c | 4 +-
+ drivers/staging/vt6655/mib.h | 4 +-
+ drivers/staging/vt6656/baseband.c | 2 -
+ drivers/staging/vt6656/channel.c | 2 -
+ drivers/staging/vt6656/ioctl.c | 4 +-
+ drivers/staging/vt6656/iwctl.c | 2 -
+ drivers/staging/vt6656/main_usb.c | 2 -
+ drivers/staging/vt6656/mib.h | 4 +-
+ drivers/staging/vt6656/wcmd.c | 2 -
+ 63 files changed, 118 insertions(+), 118 deletions(-)
+
+--- a/drivers/staging/altpciechdma/altpciechdma.c
++++ b/drivers/staging/altpciechdma/altpciechdma.c
+@@ -212,7 +212,7 @@ struct ape_dev {
+ int msi_enabled;
+ /* whether this driver could obtain the regions */
+ int got_regions;
+- /* irq line succesfully requested by this driver, -1 otherwise */
++ /* irq line successfully requested by this driver, -1 otherwise */
+ int irq_line;
+ /* board revision */
+ u8 revision;
+@@ -336,7 +336,7 @@ static int __devinit map_bars(struct ape
+ printk(KERN_DEBUG "BAR[%d] mapped at 0x%p with length %lu(/%lu).\n", i,
+ ape->bar[i], bar_min_len[i], bar_length);
+ }
+- /* succesfully mapped all required BAR regions */
++ /* successfully mapped all required BAR regions */
+ rc = 0;
+ goto success;
+ fail:
+@@ -911,7 +911,7 @@ static int __devinit probe(struct pci_de
+ /* perform DMA engines loop back test */
+ rc = dma_test(ape, dev);
+ (void)rc;
+- /* succesfully took the device */
++ /* successfully took the device */
+ rc = 0;
+ printk(KERN_DEBUG "probe() successful.\n");
+ goto end;
+--- a/drivers/staging/comedi/drivers/addi-data/addi_common.h
++++ b/drivers/staging/comedi/drivers/addi-data/addi_common.h
+@@ -82,7 +82,7 @@ struct addi_board {
+
+ int i_NbrDiChannel; /* Number of DI channels */
+ int i_NbrDoChannel; /* Number of DO channels */
+- int i_DoMaxdata; /* data to set all chanels high */
++ int i_DoMaxdata; /* data to set all channels high */
+
+ int i_NbrTTLChannel; /* Number of TTL channels */
+ const struct comedi_lrange *pr_TTLRangelist; /* rangelist for TTL */
+--- a/drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c
++++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c
+@@ -3807,7 +3807,7 @@ int i_APCI1710_EnableFrequencyMeasuremen
+ s_ModuleInfo[b_ModulNbr].
+ s_SiemensCounterInfo.s_InitFlag.b_CounterInit == 1) {
+ /********************************************/
+- /* Test if frequency mesurement initialised */
++ /* Test if frequency measurement initialised */
+ /********************************************/
+
+ if (devpriv->
+@@ -3953,7 +3953,7 @@ int i_APCI1710_DisableFrequencyMeasureme
+ s_ModuleInfo[b_ModulNbr].
+ s_SiemensCounterInfo.s_InitFlag.b_CounterInit == 1) {
+ /********************************************/
+- /* Test if frequency mesurement initialised */
++ /* Test if frequency measurement initialised */
+ /********************************************/
+
+ if (devpriv->
+@@ -5166,7 +5166,7 @@ int i_APCI1710_ReadFrequencyMeasurement(
+ s_ModuleInfo[b_ModulNbr].
+ s_SiemensCounterInfo.s_InitFlag.b_CounterInit == 1) {
+ /********************************************/
+- /* Test if frequency mesurement initialised */
++ /* Test if frequency measurement initialised */
+ /********************************************/
+
+ if (devpriv->
+--- a/drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c
++++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c
+@@ -1808,7 +1808,7 @@ int i_APCI1710_InsnBitsGetTorCounterProg
+ 2) {
+ if (dw_Status & 4) {
+ /************************/
+- /* Tor counter owerflow */
++ /* Tor counter overflow */
+ /************************/
+
+ *pb_TorCounterStatus
+--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
++++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
+@@ -1468,7 +1468,7 @@ void v_APCI3120_Interrupt(int irq, void
+ int_amcc = inl(devpriv->i_IobaseAmcc + AMCC_OP_REG_INTCSR); /* get AMCC int register */
+
+ if ((!int_daq) && (!(int_amcc & ANY_S593X_INT))) {
+- comedi_error(dev, "IRQ from unknow source");
++ comedi_error(dev, "IRQ from unknown source");
+ return;
+ }
+
+--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
++++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
+@@ -724,7 +724,7 @@ void v_APCI3501_Interrupt(int irq, void
+ APCI3501_TCW_IRQ) & 0x1;
+
+ if ((!ui_Timer_AOWatchdog)) {
+- comedi_error(dev, "IRQ from unknow source");
++ comedi_error(dev, "IRQ from unknown source");
+ return;
+ }
+
+--- a/drivers/staging/comedi/drivers/cb_pcidio.c
++++ b/drivers/staging/comedi/drivers/cb_pcidio.c
+@@ -109,12 +109,12 @@ MODULE_DEVICE_TABLE(pci, pcidio_pci_tabl
+ several hardware drivers keep similar information in this structure,
+ feel free to suggest moving the variable to the struct comedi_device struct. */
+ struct pcidio_private {
+- int data; /* curently unused */
++ int data; /* currently unused */
+
+ /* would be useful for a PCI device */
+ struct pci_dev *pci_dev;
+
+- /* used for DO readback, curently unused */
++ /* used for DO readback, currently unused */
+ unsigned int do_readback[4]; /* up to 4 unsigned int suffice to hold 96 bits for PCI-DIO96 */
+
+ unsigned long dio_reg_base; /* address of port A of the first 8255 chip on board */
+--- a/drivers/staging/comedi/drivers/me4000.c
++++ b/drivers/staging/comedi/drivers/me4000.c
+@@ -840,7 +840,7 @@ static int xilinx_download(struct comedi
+ "comedi%d: me4000: xilinx_download(): DONE flag is not set\n",
+ dev->minor);
+ printk(KERN_ERR
+- "comedi%d: me4000: xilinx_download(): Download not succesful\n",
++ "comedi%d: me4000: xilinx_download(): Download not successful\n",
+ dev->minor);
+ return -EIO;
+ }
+--- a/drivers/staging/comedi/drivers/pcl812.c
++++ b/drivers/staging/comedi/drivers/pcl812.c
+@@ -51,7 +51,7 @@ Options for PCL-812:
+ 5=A/D input range is +/-0.3125V
+ [5] - 0=D/A outputs 0-5V (internal reference -5V)
+ 1=D/A outputs 0-10V (internal reference -10V)
+- 2=D/A outputs unknow (external reference)
++ 2=D/A outputs unknown (external reference)
+
+ Options for PCL-812PG, ACL-8112PG:
+ [0] - IO Base
+@@ -63,7 +63,7 @@ Options for PCL-812PG, ACL-8112PG:
+ 1=A/D have max +/-10V input
+ [5] - 0=D/A outputs 0-5V (internal reference -5V)
+ 1=D/A outputs 0-10V (internal reference -10V)
+- 2=D/A outputs unknow (external reference)
++ 2=D/A outputs unknown (external reference)
+
+ Options for ACL-8112DG/HG, A-822PGL/PGH, A-823PGL/PGH, ACL-8216, A-826PG:
+ [0] - IO Base
+@@ -75,7 +75,7 @@ Options for ACL-8112DG/HG, A-822PGL/PGH,
+ 1=A/D channels are DIFF
+ [5] - 0=D/A outputs 0-5V (internal reference -5V)
+ 1=D/A outputs 0-10V (internal reference -10V)
+- 2=D/A outputs unknow (external reference)
++ 2=D/A outputs unknown (external reference)
+
+ Options for A-821PGL/PGH:
+ [0] - IO Base
+--- a/drivers/staging/comedi/drivers/pcl816.c
++++ b/drivers/staging/comedi/drivers/pcl816.c
+@@ -112,7 +112,7 @@ struct pcl816_board {
+ int n_dichan; /* num of DI chans */
+ int n_dochan; /* num of DO chans */
+ const struct comedi_lrange *ai_range_type; /* default A/D rangelist */
+- const struct comedi_lrange *ao_range_type; /* dafault D/A rangelist */
++ const struct comedi_lrange *ao_range_type; /* default D/A rangelist */
+ unsigned int io_range; /* len of IO space */
+ unsigned int IRQbits; /* allowed interrupts */
+ unsigned int DMAbits; /* allowed DMA chans */
+@@ -445,7 +445,7 @@ static irqreturn_t interrupt_pcl816(int
+ comedi_error(dev, "bad IRQ!");
+ return IRQ_NONE;
+ }
+- comedi_error(dev, "IRQ from unknow source!");
++ comedi_error(dev, "IRQ from unknown source!");
+ return IRQ_NONE;
+ }
+
+--- a/drivers/staging/comedi/drivers/pcl818.c
++++ b/drivers/staging/comedi/drivers/pcl818.c
+@@ -50,7 +50,7 @@ A word or two about DMA. Driver support
+ 1, 10=A/D input -10V..+10V
+ [5] - 0, 5=D/A output 0-5V (internal reference -5V)
+ 1, 10=D/A output 0-10V (internal reference -10V)
+- 2 =D/A output unknow (external reference)
++ 2 =D/A output unknown (external reference)
+
+ Options for PCL-818, PCL-818H:
+ [0] - IO Base
+@@ -60,7 +60,7 @@ A word or two about DMA. Driver support
+ 1= 1MHz clock for 8254
+ [4] - 0, 5=D/A output 0-5V (internal reference -5V)
+ 1, 10=D/A output 0-10V (internal reference -10V)
+- 2 =D/A output unknow (external reference)
++ 2 =D/A output unknown (external reference)
+
+ Options for PCL-818HD, PCL-818HG:
+ [0] - IO Base
+@@ -71,7 +71,7 @@ A word or two about DMA. Driver support
+ 1= 1MHz clock for 8254
+ [4] - 0, 5=D/A output 0-5V (internal reference -5V)
+ 1, 10=D/A output 0-10V (internal reference -10V)
+- 2 =D/A output unknow (external reference)
++ 2 =D/A output unknown (external reference)
+
+ Options for PCL-718:
+ [0] - IO Base
+@@ -92,7 +92,7 @@ A word or two about DMA. Driver support
+ 10= user defined unipolar
+ [5] - 0, 5=D/A outputs 0-5V (internal reference -5V)
+ 1, 10=D/A outputs 0-10V (internal reference -10V)
+- 2=D/A outputs unknow (external reference)
++ 2=D/A outputs unknown (external reference)
+ [6] - 0, 60=max 60kHz A/D sampling
+ 1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
+
+@@ -876,7 +876,7 @@ static irqreturn_t interrupt_pcl818(int
+ return IRQ_NONE;
+ }
+
+- comedi_error(dev, "IRQ from unknow source!");
++ comedi_error(dev, "IRQ from unknown source!");
+ return IRQ_NONE;
+ }
+
+--- a/drivers/staging/dst/export.c
++++ b/drivers/staging/dst/export.c
+@@ -203,7 +203,7 @@ err_out_exit:
+ * so to play good with all cases we just queue BIO into the queue
+ * and wake up processing thread, which gets completed request and
+ * send (encrypting if needed) it back to the client (if it was a read
+- * request), or sends back reply that writing succesfully completed.
++ * request), or sends back reply that writing successfully completed.
+ */
+ static int dst_export_process_request_queue(struct dst_state *st)
+ {
+--- a/drivers/staging/et131x/et131x_adapter.h
++++ b/drivers/staging/et131x/et131x_adapter.h
+@@ -162,7 +162,7 @@ typedef struct _ce_stats_t {
+ u32 tx_deferred;
+
+ /* Rx Statistics. */
+- u32 rx_ov_flow; /* Rx Over Flow */
++ u32 rx_ov_flow; /* Rx Overflow */
+
+ u32 length_err;
+ u32 alignment_err;
+--- a/drivers/staging/hv/hv_api.h
++++ b/drivers/staging/hv/hv_api.h
+@@ -316,13 +316,13 @@
+
+ /*
+ * HV_STATUS_VMX_INSTRUCTION_FAILED
+- * The requested VMX instruction failed to complete succesfully.
++ * The requested VMX instruction failed to complete successfully.
+ */
+ #define HV_STATUS_VMX_INSTRUCTION_FAILED ((u16)0x1011)
+
+ /*
+ * HV_STATUS_VMX_INSTRUCTION_FAILED_WITH_STATUS
+- * The requested VMX instruction failed to complete succesfully indicating
++ * The requested VMX instruction failed to complete successfully indicating
+ * status.
+ */
+ #define HV_STATUS_VMX_INSTRUCTION_FAILED_WITH_STATUS ((u16)0x1012)
+--- a/drivers/staging/iio/accel/accel.h
++++ b/drivers/staging/iio/accel/accel.h
+@@ -31,13 +31,13 @@
+ IIO_DEVICE_ATTR(accel_z, S_IRUGO, _show, NULL, _addr)
+
+ /* Thresholds are somewhat chip dependent - may need quite a few defs here */
+-/* For unified thesholds (shared across all directions */
++/* For unified thresholds (shared across all directions */
+
+ /**
+ * IIO_DEV_ATTR_ACCEL_THRESH: unified threshold
+ * @_mode: read/write
+ * @_show: read detector threshold value
+- * @_store: write detector theshold value
++ * @_store: write detector threshold value
+ * @_addr: driver specific data, typically a register address
+ *
+ * This one is for cases where as single threshold covers all directions
+@@ -48,7 +48,7 @@
+ /**
+ * IIO_DEV_ATTR_ACCEL_THRESH_X: independant direction threshold, x axis
+ * @_mode: readable / writable
+- * @_show: read x axis detector theshold value
++ * @_show: read x axis detector threshold value
+ * @_store: write x axis detector threshold value
+ * @_addr: device driver dependant, typically a register address
+ **/
+--- a/drivers/staging/iio/accel/sca3000_core.c
++++ b/drivers/staging/iio/accel/sca3000_core.c
+@@ -720,7 +720,7 @@ error_ret:
+ static IIO_DEV_ATTR_TEMP(sca3000_read_temp);
+
+ /**
+- * sca3000_show_thresh() sysfs query of a theshold
++ * sca3000_show_thresh() sysfs query of a threshold
+ **/
+ static ssize_t sca3000_show_thresh(struct device *dev,
+ struct device_attribute *attr,
+--- a/drivers/staging/iio/accel/sca3000.h
++++ b/drivers/staging/iio/accel/sca3000.h
+@@ -74,7 +74,7 @@
+ #define SCA3000_MEAS_MODE_OP_2 0x02
+
+ /* In motion detection mode the accelerations are band pass filtered
+- * (aprox 1 - 25Hz) and then a programmable theshold used to trigger
++ * (aprox 1 - 25Hz) and then a programmable threshold used to trigger
+ * and interrupt.
+ */
+ #define SCA3000_MEAS_MODE_MOT_DET 0x03
+@@ -139,7 +139,7 @@
+ /* Values of mulipexed registers (write to ctrl_data after select) */
+ #define SCA3000_REG_ADDR_CTRL_DATA 0x22
+
+-/* Measurment modes available on some sca3000 series chips. Code assumes others
++/* Measurement modes available on some sca3000 series chips. Code assumes others
+ * may become available in the future.
+ *
+ * Bypass - Bypass the low-pass filter in the signal channel so as to increase
+--- a/drivers/staging/octeon/cvmx-pow.h
++++ b/drivers/staging/octeon/cvmx-pow.h
+@@ -1959,7 +1959,7 @@ static inline uint32_t cvmx_pow_tag_get_
+ * @buffer_size:
+ * The size of the supplied buffer
+ *
+- * Returns Zero on sucess, negative on failure
++ * Returns Zero on success, negative on failure
+ */
+ extern int cvmx_pow_capture(void *buffer, int buffer_size);
+
+--- a/drivers/staging/octeon/ethernet-tx.c
++++ b/drivers/staging/octeon/ethernet-tx.c
+@@ -624,7 +624,7 @@ int cvm_oct_transmit_qos(struct net_devi
+ EXPORT_SYMBOL(cvm_oct_transmit_qos);
+
+ /**
+- * This function frees all skb that are currenty queued for TX.
++ * This function frees all skb that are currently queued for TX.
+ *
+ * @dev: Device being shutdown
+ */
+--- a/drivers/staging/otus/80211core/ccmd.c
++++ b/drivers/staging/otus/80211core/ccmd.c
+@@ -899,7 +899,7 @@ u16_t zfiWlanDisable(zdev_t *dev, u8_t R
+ zfStaDisableSWEncryption(dev);
+ }
+
+- /* Improve WEP/TKIP performace with HT AP,
++ /* Improve WEP/TKIP performance with HT AP,
+ detail information please look bug#32495 */
+ /* zfHpSetTTSIFSTime(dev, 0x8); */
+
+@@ -1407,7 +1407,7 @@ u16_t zfWlanReset(zdev_t *dev)
+ zfStaDisableSWEncryption(dev);
+ }
+
+- /* Improve WEP/TKIP performace with HT AP,
++ /* Improve WEP/TKIP performance with HT AP,
+ detail information please look bug#32495
+ */
+ /* zfHpSetTTSIFSTime(dev, 0x8); */
+--- a/drivers/staging/otus/80211core/cmm.c
++++ b/drivers/staging/otus/80211core/cmm.c
+@@ -1428,7 +1428,7 @@ void zfProcessManagement(zdev_t* dev, zb
+ {
+ /* Beacon */
+ case ZM_WLAN_FRAME_TYPE_BEACON :
+- /* if enable 802.11h and current chanel is silent but receive beacon from other AP */
++ /* if enable 802.11h and current channel is silent but receive beacon from other AP */
+ if (((wd->regulationTable.allowChannel[wd->regulationTable.CurChIndex].channelFlags
+ & ZM_REG_FLAG_CHANNEL_CSA) != 0) && wd->sta.DFSEnable)
+ {
+@@ -1469,7 +1469,7 @@ void zfProcessManagement(zdev_t* dev, zb
+ break;
+ /* Probe response */
+ case ZM_WLAN_FRAME_TYPE_PROBERSP :
+- /* if enable 802.11h and current chanel is silent but receive probe response from other AP */
++ /* if enable 802.11h and current channel is silent but receive probe response from other AP */
+ if (((wd->regulationTable.allowChannel[wd->regulationTable.CurChIndex].channelFlags
+ & ZM_REG_FLAG_CHANNEL_CSA) != 0) && wd->sta.DFSEnable)
+ {
+--- a/drivers/staging/otus/80211core/cmmsta.c
++++ b/drivers/staging/otus/80211core/cmmsta.c
+@@ -216,7 +216,7 @@ void zfStaConnectFail(zdev_t* dev, u16_t
+ /* Change internal state */
+ zfChangeAdapterState(dev, ZM_STA_STATE_DISCONNECT);
+
+- /* Improve WEP/TKIP performace with HT AP, detail information please look bug#32495 */
++ /* Improve WEP/TKIP performance with HT AP, detail information please look bug#32495 */
+ //zfHpSetTTSIFSTime(dev, 0x8);
+
+ /* Notify wrapper of connection status changes */
+@@ -4148,7 +4148,7 @@ void zfInfraConnectNetwork(zdev_t* dev)
+ wd->sta.bIsSharedKey = 0;
+ }
+
+- /* Improve WEP/TKIP performace with HT AP, detail information please look bug#32495 */
++ /* Improve WEP/TKIP performance with HT AP, detail information please look bug#32495 */
+ /*
+ if ( (pBssInfo->broadcomHTAp == 1)
+ && (wd->sta.SWEncryptEnable != 0) )
+--- a/drivers/staging/otus/80211core/ctxrx.c
++++ b/drivers/staging/otus/80211core/ctxrx.c
+@@ -3093,7 +3093,7 @@ u16_t zfWlanRxFilter(zdev_t* dev, zbuf_t
+
+ frameType = zmw_rx_buf_readh(dev, buf, offset);
+
+- // Don't divide 2^4 because we don't want the fragementation pkt to be treated as
++ // Don't divide 2^4 because we don't want the fragmentation pkt to be treated as
+ // duplicated frames
+ seq = zmw_rx_buf_readh(dev, buf, offset+22);
+ dst0 = zmw_rx_buf_readh(dev, buf, offset+4);
+--- a/drivers/staging/otus/80211core/pub_zfi.h
++++ b/drivers/staging/otus/80211core/pub_zfi.h
+@@ -782,7 +782,7 @@ extern void zfiWlanSetDynamicSIFSParam(z
+
+ /***** End of section 2 *****/
+
+-/***** section 3 performace evaluation *****/
++/***** section 3 performance evaluation *****/
+ #ifdef ZM_ENABLE_PERFORMANCE_EVALUATION
+ extern void zfiTxPerformanceMSDU(zdev_t* dev, u32_t tick);
+ extern void zfiRxPerformanceMPDU(zdev_t* dev, zbuf_t* buf);
+--- a/drivers/staging/quatech_usb2/quatech_usb2.c
++++ b/drivers/staging/quatech_usb2/quatech_usb2.c
+@@ -1670,7 +1670,7 @@ __func__);
+ dbg("%s(): failed resubmitting read urb, error %d",
+ __func__, result);
+ } else {
+- dbg("%s() sucessfully resumitted read urb", __func__);
++ dbg("%s() successfully resubmitted read urb", __func__);
+ if (tty_st && RxCount) {
+ /* if some inbound data was processed, then
+ * we need to push that through the tty layer
+--- a/drivers/staging/rar/rar_driver.c
++++ b/drivers/staging/rar/rar_driver.c
+@@ -66,7 +66,7 @@ static int __init rar_init_handler(void)
+ static void __exit rar_exit_handler(void);
+
+ /*
+- function that is activated on the succesfull probe of the RAR device
++ function that is activated on the successfull probe of the RAR device
+ */
+ static int __devinit rar_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
+
+@@ -319,7 +319,7 @@ static int memrar_init_rar_params(struct
+ }
+
+ /*
+- function that is activaed on the succesfull probe of the RAR device
++ function that is activated on the successfull probe of the RAR device
+ */
+ static int __devinit rar_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+ {
+--- a/drivers/staging/rt2860/sta/rtmp_data.c
++++ b/drivers/staging/rt2860/sta/rtmp_data.c
+@@ -913,7 +913,7 @@ Arguments:
+ pPacket Pointer to send packet
+
+ Return Value:
+- NDIS_STATUS_SUCCESS If succes to queue the packet into TxSwQueue.
++ NDIS_STATUS_SUCCESS If success to queue the packet into TxSwQueue.
+ NDIS_STATUS_FAILURE If failed to do en-queue.
+
+ Note:
+--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
++++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+@@ -1837,7 +1837,7 @@ ieee80211_rx_frame_softmac(struct ieee80
+
+ if (((ieee->current_network.wmm_info^info_element->data[6])& \
+ 0x0f)||(!ieee->init_wmmparam_flag)) {
+- //refresh paramete element for current network
++ // refresh parameter element for current network
+ // update the register parameter for hardware
+ ieee->init_wmmparam_flag = 1;
+ queue_work(ieee->wq, &ieee->wmm_param_update_wq);
+@@ -1958,10 +1958,10 @@ associate_complete:
+ * care of the ieee802.11 fragmentation.
+ * So the driver receives a fragment per time and might
+ * call the stop function when it want without take care
+- * to have enought room to TX an entire packet.
++ * to have enough room to TX an entire packet.
+ * This might be useful if each fragment need it's own
+ * descriptor, thus just keep a total free memory > than
+- * the max fragmentation treshold is not enought.. If the
++ * the max fragmentation threshold is not enough.. If the
+ * ieee802.11 stack passed a TXB struct then you needed
+ * to keep N free descriptors where
+ * N = MAX_PACKET_SIZE / MIN_FRAG_TRESHOLD
+--- a/drivers/staging/rtl8187se/r8180_core.c
++++ b/drivers/staging/rtl8187se/r8180_core.c
+@@ -1848,7 +1848,7 @@ void rtl8180_rx(struct net_device *dev)
+ sizeof(u8),
+ PCI_DMA_FROMDEVICE);
+
+-drop: // this is used when we have not enought mem
++drop: // this is used when we have not enough mem
+ /* restore the descriptor */
+ *(priv->rxringtail+2)=priv->rxbuffer->dma;
+ *(priv->rxringtail)=*(priv->rxringtail) &~ 0xfff;
+@@ -1919,8 +1919,8 @@ rate)
+ /*
+ * This function doesn't require lock because we make
+ * sure it's called with the tx_lock already acquired.
+- * this come from the kernel's hard_xmit callback (trought
+- * the ieee stack, or from the try_wake_queue (again trought
++ * this come from the kernel's hard_xmit callback (through
++ * the ieee stack, or from the try_wake_queue (again through
+ * the ieee stack.
+ */
+ priority = AC2Q(skb->priority);
+@@ -3399,7 +3399,7 @@ void rtl8180_adapter_start(struct net_de
+ /*
+ The following is very strange. seems to be that 1 means test mode,
+ but we need to acknolwledges the nic when a packet is ready
+- altought we set it to 0
++ although we set it to 0
+ */
+
+ write_nic_byte(dev,
+@@ -4144,7 +4144,7 @@ void rtl8180_tx_isr(struct net_device *d
+ }
+
+ /* we check all the descriptors between the head and the nic,
+- * but not the currenly pointed by the nic (the next to be txed)
++ * but not the currently pointed by the nic (the next to be txed)
+ * and the previous of the pointed (might be in process ??)
+ */
+ offs = (nic - nicbegin);
+--- a/drivers/staging/rtl8187se/r8180_dm.c
++++ b/drivers/staging/rtl8187se/r8180_dm.c
+@@ -36,7 +36,7 @@ bool CheckHighPower(struct net_device *d
+ //
+ // Note:
+ // The reason why we udpate Tx power level here instead of DoRxHighPower()
+-// is the number of IO to change Tx power is much more than chane TR switch
++// is the number of IO to change Tx power is much more than channel TR switch
+ // and they are related to OFDM and MAC registers.
+ // So, we don't want to update it so frequently in per-Rx packet base.
+ //
+@@ -1326,7 +1326,7 @@ SetAntenna8185(
+ break;
+
+ default:
+- printk("SetAntenna8185: unkown RFChipID(%d)\n", priv->rf_chip);
++ printk("SetAntenna8185: unknown RFChipID(%d)\n", priv->rf_chip);
+ break;
+ }
+ break;
+@@ -1346,13 +1346,13 @@ SetAntenna8185(
+ break;
+
+ default:
+- printk("SetAntenna8185: unkown RFChipID(%d)\n", priv->rf_chip);
++ printk("SetAntenna8185: unknown RFChipID(%d)\n", priv->rf_chip);
+ break;
+ }
+ break;
+
+ default:
+- printk("SetAntenna8185: unkown u1bAntennaIndex(%d)\n", u1bAntennaIndex);
++ printk("SetAntenna8185: unknown u1bAntennaIndex(%d)\n", u1bAntennaIndex);
+ break;
+ }
+
+@@ -1448,7 +1448,7 @@ SwAntennaDiversity(
+
+ priv->bAdSwitchedChecking = false;
+
+- // Adjust Rx signal strength threashold.
++ // Adjust Rx signal strength threshold.
+ priv->AdRxSsThreshold = (priv->AdRxSignalStrength + priv->AdRxSsBeforeSwitched) / 2;
+
+ priv->AdRxSsThreshold = (priv->AdRxSsThreshold > priv->AdMaxRxSsThreshold) ?
+@@ -1562,7 +1562,7 @@ SwAntennaDiversity(
+ // priv->AdRxSignalStrength, priv->AdRxSsThreshold);
+
+ priv->bAdSwitchedChecking = false;
+- // Increase Rx signal strength threashold if necessary.
++ // Increase Rx signal strength threshold if necessary.
+ if( (priv->AdRxSignalStrength > (priv->AdRxSsThreshold + 10)) && // Signal is much stronger than current threshold
+ priv->AdRxSsThreshold <= priv->AdMaxRxSsThreshold) // Current threhold is not yet reach upper limit.
+ {
+--- a/drivers/staging/rtl8187se/r8180.h
++++ b/drivers/staging/rtl8187se/r8180.h
+@@ -599,7 +599,7 @@ typedef struct r8180_priv
+ u8 RSSI;
+ char RxPower;
+ u8 InitialGain;
+- //For adjust Dig Threshhold during Legacy/Leisure Power Save Mode
++ //For adjust Dig Threshold during Legacy/Leisure Power Save Mode
+ u32 DozePeriodInPast2Sec;
+ // Don't access BB/RF under disable PLL situation.
+ u8 InitialGainBackUp;
+--- a/drivers/staging/rtl8187se/r8180_rtl8225z2.c
++++ b/drivers/staging/rtl8187se/r8180_rtl8225z2.c
+@@ -1058,7 +1058,7 @@ bool SetZebraRFPowerState8185(struct net
+ break;
+ default:
+ bResult = false;
+- printk("SetZebraRFPowerState8185(): unknow state to set: 0x%X!!!\n", eRFPowerState);
++ printk("SetZebraRFPowerState8185(): unknown state to set: 0x%X!!!\n", eRFPowerState);
+ break;
+ }
+ break;
+--- a/drivers/staging/rtl8187se/r8180_wx.c
++++ b/drivers/staging/rtl8187se/r8180_wx.c
+@@ -276,7 +276,7 @@ static int rtl8180_wx_get_range(struct n
+ range->max_qual.updated = 7; /* Updated all three */
+
+ range->avg_qual.qual = 92; /* > 8% missed beacons is 'bad' */
+- /* TODO: Find real 'good' to 'bad' threshol value for RSSI */
++ /* TODO: Find real 'good' to 'bad' threshold value for RSSI */
+ range->avg_qual.level = 20 + -98;
+ range->avg_qual.noise = 0;
+ range->avg_qual.updated = 7; /* Updated all three */
+--- a/drivers/staging/rtl8187se/r8185b_init.c
++++ b/drivers/staging/rtl8187se/r8185b_init.c
+@@ -2493,8 +2493,8 @@ void rtl8185b_adapter_start(struct net_d
+ PhyConfig8185(dev);
+
+ // We assume RegWirelessMode has already been initialized before,
+- // however, we has to validate the wireless mode here and provide a reasonble
+- // initialized value if necessary. 2005.01.13, by rcnjko.
++ // however, we has to validate the wireless mode here and provide a
++ // reasonable initialized value if necessary. 2005.01.13, by rcnjko.
+ SupportedWirelessMode = GetSupportedWirelessMode8185(dev);
+ if( (ieee->mode != WIRELESS_MODE_B) &&
+ (ieee->mode != WIRELESS_MODE_G) &&
+--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
+@@ -164,7 +164,7 @@ struct net_device *alloc_ieee80211(int s
+ ieee->privacy_invoked = 0;
+ ieee->ieee802_1x = 1;
+ ieee->raw_tx = 0;
+- //ieee->hwsec_support = 1; //defalt support hw security. //use module_param instead.
++ //ieee->hwsec_support = 1; //default support hw security. //use module_param instead.
+ ieee->hwsec_active = 0; //disable hwsec, switch it on when necessary.
+
+ ieee80211_softmac_init(ieee);
+--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
++++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
+@@ -2330,10 +2330,10 @@ ieee80211_rx_frame_softmac(struct ieee80
+ * care of the ieee802.11 fragmentation.
+ * So the driver receives a fragment per time and might
+ * call the stop function when it want without take care
+- * to have enought room to TX an entire packet.
++ * to have enough room to TX an entire packet.
+ * This might be useful if each fragment need it's own
+ * descriptor, thus just keep a total free memory > than
+- * the max fragmentation treshold is not enought.. If the
++ * the max fragmentation threshold is not enough.. If the
+ * ieee802.11 stack passed a TXB struct then you needed
+ * to keep N free descriptors where
+ * N = MAX_PACKET_SIZE / MIN_FRAG_TRESHOLD
+--- a/drivers/staging/rtl8192e/r8190_rtl8256.c
++++ b/drivers/staging/rtl8192e/r8190_rtl8256.c
+@@ -629,7 +629,7 @@ SetRFPowerState8190(
+
+ default:
+ bResult = false;
+- RT_TRACE(COMP_ERR, "SetRFPowerState8190(): unknow state to set: 0x%X!!!\n", eRFPowerState);
++ RT_TRACE(COMP_ERR, "SetRFPowerState8190(): unknown state to set: 0x%X!!!\n", eRFPowerState);
+ break;
+ }
+
+--- a/drivers/staging/rtl8192e/r8192E_core.c
++++ b/drivers/staging/rtl8192e/r8192E_core.c
+@@ -1041,7 +1041,7 @@ static void rtl8192_tx_isr(struct net_de
+ tx_desc_819x_pci *entry = &ring->desc[ring->idx];
+ struct sk_buff *skb;
+
+- /* beacon packet will only use the first descriptor defautly,
++ /* beacon packet will only use the first descriptor defaultly,
+ * and the OWN may not be cleared by the hardware
+ * */
+ if(prio != BEACON_QUEUE) {
+@@ -2562,7 +2562,7 @@ static void rtl8192_read_eeprom_info(str
+ priv->bTXPowerDataReadFromEEPORM = false;
+ }
+
+- // 2007/11/15 MH 8190PCI Default=2T4R, 8192PCIE dafault=1T2R
++ // 2007/11/15 MH 8190PCI Default=2T4R, 8192PCIE default=1T2R
+ priv->rf_type = RTL819X_DEFAULT_RF_TYPE;
+
+ if(priv->card_8192_version > VERSION_8190_BD)
+@@ -3554,7 +3554,7 @@ void rtl8192_prepare_beacon(struct r8192
+ //spin_lock_irqsave(&priv->tx_lock,flags);
+ /* prepare misc info for the beacon xmit */
+ tcb_desc->queue_index = BEACON_QUEUE;
+- /* IBSS does not support HT yet, use 1M defautly */
++ /* IBSS does not support HT yet, use 1M defaultly */
+ tcb_desc->data_rate = 2;
+ tcb_desc->RATRIndex = 7;
+ tcb_desc->bTxDisableRateFallBack = 1;
+--- a/drivers/staging/rtl8192e/r8192E_dm.c
++++ b/drivers/staging/rtl8192e/r8192E_dm.c
+@@ -455,7 +455,7 @@ static void dm_check_rate_adaptive(struc
+ (pra->low_rssi_thresh_for_ra40M):(pra->low_rssi_thresh_for_ra20M);
+ }
+
+- //DbgPrint("[DM] THresh H/L=%d/%d\n\r", RATR.HighRSSIThreshForRA, RATR.LowRSSIThreshForRA);
++ //DbgPrint("[DM] Thresh H/L=%d/%d\n\r", RATR.HighRSSIThreshForRA, RATR.LowRSSIThreshForRA);
+ if(priv->undecorated_smoothed_pwdb >= (long)HighRSSIThreshForRA)
+ {
+ //DbgPrint("[DM] RSSI=%d STA=HIGH\n\r", pHalData->UndecoratedSmoothedPWDB);
+@@ -571,7 +571,7 @@ static u32 OFDMSwingTable[OFDM_Table_Len
+ 0x5a400169, // 3, +3db
+ 0x50800142, // 4, +2db
+ 0x47c0011f, // 5, +1db
+- 0x40000100, // 6, +0db ===> default, upper for higher temprature, lower for low temprature
++ 0x40000100, // 6, +0db ===> default, upper for higher temperature, lower for low temperature
+ 0x390000e4, // 7, -1db
+ 0x32c000cb, // 8, -2db
+ 0x2d4000b5, // 9, -3db
+@@ -932,14 +932,14 @@ static void dm_TXPowerTrackingCallback_T
+ RT_TRACE(COMP_POWER_TRACKING, "Readback ThermalMeterA = %d \n", tmpRegA);
+ if(tmpRegA < 3 || tmpRegA > 13)
+ return;
+- if(tmpRegA >= 12) // if over 12, TP will be bad when high temprature
++ if(tmpRegA >= 12) // if over 12, TP will be bad when high temperature
+ tmpRegA = 12;
+ RT_TRACE(COMP_POWER_TRACKING, "Valid ThermalMeterA = %d \n", tmpRegA);
+ priv->ThermalMeter[0] = ThermalMeterVal; //We use fixed value by Bryant's suggestion
+ priv->ThermalMeter[1] = ThermalMeterVal; //We use fixed value by Bryant's suggestion
+
+- //Get current RF-A temprature index
+- if(priv->ThermalMeter[0] >= (u8)tmpRegA) //lower temprature
++ //Get current RF-A temperature index
++ if(priv->ThermalMeter[0] >= (u8)tmpRegA) //lower temperature
+ {
+ tmpOFDMindex = tmpCCK20Mindex = 6+(priv->ThermalMeter[0]-(u8)tmpRegA);
+ tmpCCK40Mindex = tmpCCK20Mindex - 6;
+@@ -953,7 +953,7 @@ static void dm_TXPowerTrackingCallback_T
+ else
+ {
+ tmpval = ((u8)tmpRegA - priv->ThermalMeter[0]);
+- if(tmpval >= 6) // higher temprature
++ if(tmpval >= 6) // higher temperature
+ tmpOFDMindex = tmpCCK20Mindex = 0; // max to +6dB
+ else
+ tmpOFDMindex = tmpCCK20Mindex = 6 - tmpval;
+@@ -2017,7 +2017,7 @@ static void dm_dig_init(struct net_devic
+ dm_digtable.dbg_mode = DM_DBG_OFF; //off=by real rssi value, on=by DM_DigTable.Rssi_val for new dig
+ dm_digtable.dig_algorithm_switch = 0;
+
+- /* 2007/10/04 MH Define init gain threshol. */
++ /* 2007/10/04 MH Define init gain threshold. */
+ dm_digtable.dig_state = DM_STA_DIG_MAX;
+ dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX;
+ dm_digtable.initialgain_lowerbound_state = false;
+@@ -2145,7 +2145,7 @@ static void dm_ctrl_initgain_byrssi_by_f
+ /*DbgPrint("DIG Check\n\r RSSI=%d LOW=%d HIGH=%d STATE=%d",
+ pHalData->UndecoratedSmoothedPWDB, DM_DigTable.RssiLowThresh,
+ DM_DigTable.RssiHighThresh, DM_DigTable.Dig_State);*/
+- /* 1. When RSSI decrease, We have to judge if it is smaller than a treshold
++ /* 1. When RSSI decrease, We have to judge if it is smaller than a threshold
+ and then execute below step. */
+ if ((priv->undecorated_smoothed_pwdb <= dm_digtable.rssi_low_thresh))
+ {
+@@ -2205,7 +2205,7 @@ static void dm_ctrl_initgain_byrssi_by_f
+
+ }
+
+- /* 2. When RSSI increase, We have to judge if it is larger than a treshold
++ /* 2. When RSSI increase, We have to judge if it is larger than a threshold
+ and then execute below step. */
+ if ((priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_thresh) )
+ {
+@@ -2314,7 +2314,7 @@ static void dm_ctrl_initgain_byrssi_high
+ }
+
+ /* 3. When RSSI >75% or <70%, it is a high power issue. We have to judge if
+- it is larger than a treshold and then execute below step. */
++ it is larger than a threshold and then execute below step. */
+ // 2008/02/05 MH SD3-Jerry Modify PD_TH for high power issue.
+ if (priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_power_highthresh)
+ {
+--- a/drivers/staging/rtl8192e/r8192E_wx.c
++++ b/drivers/staging/rtl8192e/r8192E_wx.c
+@@ -446,7 +446,7 @@ static int rtl8180_wx_get_range(struct n
+ range->max_qual.updated = 7; /* Updated all three */
+
+ range->avg_qual.qual = 92; /* > 8% missed beacons is 'bad' */
+- /* TODO: Find real 'good' to 'bad' threshol value for RSSI */
++ /* TODO: Find real 'good' to 'bad' threshold value for RSSI */
+ range->avg_qual.level = 20 + -98;
+ range->avg_qual.noise = 0;
+ range->avg_qual.updated = 7; /* Updated all three */
+--- a/drivers/staging/rtl8192e/r819xE_cmdpkt.c
++++ b/drivers/staging/rtl8192e/r819xE_cmdpkt.c
+@@ -783,7 +783,7 @@ u32 cmpk_message_handle_rx(struct net_de
+
+ default:
+
+- RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():unknow CMD Element\n");
++ RT_TRACE(COMP_EVENTS, "---->cmpk_message_handle_rx():unknown CMD Element\n");
+ return 1; /* This is a command packet. */
+ }
+ // 2007/01/22 MH Display received rx command packet info.
+--- a/drivers/staging/rtl8192e/r819xE_phyreg.h
++++ b/drivers/staging/rtl8192e/r819xE_phyreg.h
+@@ -294,7 +294,7 @@
+ #define bR2RCCAMask 0x00000f00
+ #define bHSSI_R2TDelay 0xf8000000
+ #define bHSSI_T2RDelay 0xf80000
+-#define bContTxHSSI 0x400 //chane gain at continue Tx
++#define bContTxHSSI 0x400 //channel gain at continue Tx
+ #define bIGFromCCK 0x200
+ #define bAGCAddress 0x3f
+ #define bRxHPTx 0x7000
+--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
++++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
+@@ -156,7 +156,7 @@ struct net_device *alloc_ieee80211(int s
+ ieee->privacy_invoked = 0;
+ ieee->ieee802_1x = 1;
+ ieee->raw_tx = 0;
+- //ieee->hwsec_support = 1; //defalt support hw security. //use module_param instead.
++ //ieee->hwsec_support = 1; //default support hw security. //use module_param instead.
+ ieee->hwsec_active = 0; //disable hwsec, switch it on when necessary.
+
+ ieee80211_softmac_init(ieee);
+--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
++++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
+@@ -2120,10 +2120,10 @@ ieee80211_rx_frame_softmac(struct ieee80
+ * care of the ieee802.11 fragmentation.
+ * So the driver receives a fragment per time and might
+ * call the stop function when it want without take care
+- * to have enought room to TX an entire packet.
++ * to have enough room to TX an entire packet.
+ * This might be useful if each fragment need it's own
+ * descriptor, thus just keep a total free memory > than
+- * the max fragmentation treshold is not enought.. If the
++ * the max fragmentation threshold is not enough.. If the
+ * ieee802.11 stack passed a TXB struct then you needed
+ * to keep N free descriptors where
+ * N = MAX_PACKET_SIZE / MIN_FRAG_TRESHOLD
+--- a/drivers/staging/rtl8192su/ieee80211/readme
++++ b/drivers/staging/rtl8192su/ieee80211/readme
+@@ -37,7 +37,7 @@ What this layer doesn't do (yet)
+ disassociate clients, and it is really prone to always allow access.
+ In bss client mode it is a bit rough with AP deauth and disassoc requests.
+ - It has not any entry point to view the collected stats.
+-- Altought it takes care of the card supported rates in the management frame
++- Although it takes care of the card supported rates in the management frame
+ it sends, support for rate changing on TXed packet is not complete.
+ - Give up once associated in bss client mode (it never detect a
+ signal loss condition to disassociate and restart scanning)
+--- a/drivers/staging/rtl8192su/r8192S_phy.c
++++ b/drivers/staging/rtl8192su/r8192S_phy.c
+@@ -1728,7 +1728,7 @@ static bool phy_SetRFPowerState8192SU(st
+
+ default:
+ bResult = FALSE;
+- //RT_ASSERT(FALSE, ("phy_SetRFPowerState8192SU(): unknow state to set: 0x%X!!!\n", eRFPowerState));
++ //RT_ASSERT(FALSE, ("phy_SetRFPowerState8192SU(): unknown state to set: 0x%X!!!\n", eRFPowerState));
+ break;
+ }
+ break;
+@@ -2711,7 +2711,7 @@ u8 rtl8192_phy_SwChnl(struct net_device*
+ // However, this procedure is performed synchronously which should be running under
+ // passive level.
+ //
+-//not understant it
++//not understand it
+ void PHY_SwChnlPhy8192S( // Only called during initialize
+ struct net_device* dev,
+ u8 channel
+--- a/drivers/staging/rtl8192su/r8192S_phyreg.h
++++ b/drivers/staging/rtl8192su/r8192S_phyreg.h
+@@ -453,7 +453,7 @@
+ #define bR2RCCAMask 0x00000f00
+ #define bHSSI_R2TDelay 0xf8000000
+ #define bHSSI_T2RDelay 0xf80000
+-#define bContTxHSSI 0x400 //chane gain at continue Tx
++#define bContTxHSSI 0x400 //channel gain at continue Tx
+ #define bIGFromCCK 0x200
+ #define bAGCAddress 0x3f
+ #define bRxHPTx 0x7000
+--- a/drivers/staging/rtl8192su/r8192S_rtl6052.c
++++ b/drivers/staging/rtl8192su/r8192S_rtl6052.c
+@@ -326,7 +326,7 @@ extern void PHY_RF6052SetOFDMTxPower(str
+
+ //
+ // If path A and Path B coexist, we must limit Path A tx power.
+- // Protect Path B pwr over or under flow. We need to calculate upper and
++ // Protect Path B pwr over or underflow. We need to calculate upper and
+ // lower bound of path A tx power.
+ //
+ if (priv->rf_type == RF_2T2R)
+@@ -354,7 +354,7 @@ extern void PHY_RF6052SetOFDMTxPower(str
+
+ //
+ // If path A and Path B coexist, we must limit Path A tx power.
+- // Protect Path B pwr over or under flow. We need to calculate upper and
++ // Protect Path B pwr under/over flow. We need to calculate upper and
+ // lower bound of path A tx power.
+ //
+ if (priv->rf_type == RF_2T2R)
+--- a/drivers/staging/rtl8192su/r8192U_dm.c
++++ b/drivers/staging/rtl8192su/r8192U_dm.c
+@@ -593,7 +593,7 @@ static u32 OFDMSwingTable[OFDM_Table_Len
+ 0x5a400169, // 3, +3db
+ 0x50800142, // 4, +2db
+ 0x47c0011f, // 5, +1db
+- 0x40000100, // 6, +0db ===> default, upper for higher temprature, lower for low temprature
++ 0x40000100, // 6, +0db ===> default, upper for higher temperature, lower for low temperature
+ 0x390000e4, // 7, -1db
+ 0x32c000cb, // 8, -2db
+ 0x2d4000b5, // 9, -3db
+@@ -912,14 +912,14 @@ static void dm_TXPowerTrackingCallback_T
+ RT_TRACE(COMP_POWER_TRACKING, "Readback ThermalMeterA = %d \n", tmpRegA);
+ if(tmpRegA < 3 || tmpRegA > 13)
+ return;
+- if(tmpRegA >= 12) // if over 12, TP will be bad when high temprature
++ if(tmpRegA >= 12) // if over 12, TP will be bad when high temperature
+ tmpRegA = 12;
+ RT_TRACE(COMP_POWER_TRACKING, "Valid ThermalMeterA = %d \n", tmpRegA);
+ priv->ThermalMeter[0] = ThermalMeterVal; //We use fixed value by Bryant's suggestion
+ priv->ThermalMeter[1] = ThermalMeterVal; //We use fixed value by Bryant's suggestion
+
+- //Get current RF-A temprature index
+- if(priv->ThermalMeter[0] >= (u8)tmpRegA) //lower temprature
++ //Get current RF-A temperature index
++ if(priv->ThermalMeter[0] >= (u8)tmpRegA) //lower temperature
+ {
+ tmpOFDMindex = tmpCCK20Mindex = 6+(priv->ThermalMeter[0]-(u8)tmpRegA);
+ tmpCCK40Mindex = tmpCCK20Mindex - 6;
+@@ -933,7 +933,7 @@ static void dm_TXPowerTrackingCallback_T
+ else
+ {
+ tmpval = ((u8)tmpRegA - priv->ThermalMeter[0]);
+- if(tmpval >= 6) // higher temprature
++ if(tmpval >= 6) // higher temperature
+ tmpOFDMindex = tmpCCK20Mindex = 0; // max to +6dB
+ else
+ tmpOFDMindex = tmpCCK20Mindex = 6 - tmpval;
+--- a/drivers/staging/rtl8192su/r8192U_wx.c
++++ b/drivers/staging/rtl8192su/r8192U_wx.c
+@@ -435,7 +435,7 @@ static int rtl8180_wx_get_range(struct n
+ range->max_qual.updated = 7; /* Updated all three */
+
+ range->avg_qual.qual = 92; /* > 8% missed beacons is 'bad' */
+- /* TODO: Find real 'good' to 'bad' threshol value for RSSI */
++ /* TODO: Find real 'good' to 'bad' threshold value for RSSI */
+ range->avg_qual.level = 20 + -98;
+ range->avg_qual.noise = 0;
+ range->avg_qual.updated = 7; /* Updated all three */
+--- a/drivers/staging/rtl8192su/r819xU_cmdpkt.c
++++ b/drivers/staging/rtl8192su/r819xU_cmdpkt.c
+@@ -697,7 +697,7 @@ cmpk_message_handle_rx(
+
+ default:
+
+- RT_TRACE(COMP_ERR, "---->cmpk_message_handle_rx():unknow CMD Element\n");
++ RT_TRACE(COMP_ERR, "---->cmpk_message_handle_rx():unknown CMD Element\n");
+ return 1; /* This is a command packet. */
+ }
+ // 2007/01/22 MH Display received rx command packet info.
+--- a/drivers/staging/sep/sep_driver.c
++++ b/drivers/staging/sep/sep_driver.c
+@@ -2449,7 +2449,7 @@ static void sep_configure_dma_burst(stru
+ #endif
+
+ /*
+- Function that is activaed on the succesful probe of the SEP device
++ Function that is activated on the successful probe of the SEP device
+ */
+ static int __devinit sep_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+ {
+--- a/drivers/staging/serqt_usb2/serqt_usb2.c
++++ b/drivers/staging/serqt_usb2/serqt_usb2.c
+@@ -929,7 +929,7 @@ static int qt_open(struct tty_struct *tt
+ dbg(__FILE__ "qt_setuart completed.\n");
+
+ /*
+- * Put this here to make it responsive to stty and defauls set by
++ * Put this here to make it responsive to stty and defaults set by
+ * the tty layer
+ */
+ /* FIXME: is this needed? */
+--- a/drivers/staging/vt6655/device_main.c
++++ b/drivers/staging/vt6655/device_main.c
+@@ -661,7 +661,7 @@ else
+ if(zonetype!=pDevice->abyEEPROM[EEP_OFS_ZONETYPE])
+ printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n",zonetype,pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
+ else
+- printk("Read Zonetype file sucess,use default zonetype setting[%02x]\n",zonetype);
++ printk("Read Zonetype file success,use default zonetype setting[%02x]\n",zonetype);
+ }
+ }
+ else
+--- a/drivers/staging/vt6655/ioctl.c
++++ b/drivers/staging/vt6655/ioctl.c
+@@ -159,7 +159,7 @@ int private_ioctl(PSDevice pDevice, stru
+ else if(zonetype == 0x02) { //Europe
+ sZoneTypeCmd.ZoneType = ZoneType_Europe;
+ }
+- else { //Unknow ZoneType
++ else { //Unknown ZoneType
+ printk("Error:ZoneType[%x] Unknown ???\n",zonetype);
+ result = -EFAULT;
+ break;
+@@ -692,7 +692,7 @@ if(wpa_Result.authenticated==TRUE) {
+ wireless_send_event(pDevice->dev, IWEVCUSTOM, &wrqu, pItemSSID->abySSID);
+ }
+ #endif
+- pDevice->fWPA_Authened = TRUE; //is sucessful peer to wpa_Result.authenticated?
++ pDevice->fWPA_Authened = TRUE; //is successful peer to wpa_Result.authenticated?
+ }
+
+ //printk("get private wpa_supplicant announce WPA SM\n");
+--- a/drivers/staging/vt6655/mib.h
++++ b/drivers/staging/vt6655/mib.h
+@@ -325,10 +325,10 @@ typedef struct tagSStatCounter {
+ #ifdef Calcu_LinkQual
+ //Tx count:
+ ULONG TxNoRetryOkCount; //success tx no retry !
+- ULONG TxRetryOkCount; //sucess tx but retry !
++ ULONG TxRetryOkCount; //success tx but retry !
+ ULONG TxFailCount; //fail tx ?
+ //Rx count:
+- ULONG RxOkCnt; //sucess rx !
++ ULONG RxOkCnt; //success rx !
+ ULONG RxFcsErrCnt; //fail rx ?
+ //statistic
+ ULONG SignalStren;
+--- a/drivers/staging/vt6656/baseband.c
++++ b/drivers/staging/vt6656/baseband.c
+@@ -1040,7 +1040,7 @@ else {
+ if(pDevice->config_file.ZoneType !=pDevice->abyEEPROM[EEP_OFS_ZONETYPE])
+ printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n",pDevice->config_file.ZoneType,pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
+ else
+- printk("Read Zonetype file sucess,use default zonetype setting[%02x]\n",pDevice->config_file.ZoneType);
++ printk("Read Zonetype file success,use default zonetype setting[%02x]\n",pDevice->config_file.ZoneType);
+ }
+ }
+
+--- a/drivers/staging/vt6656/channel.c
++++ b/drivers/staging/vt6656/channel.c
+@@ -19,7 +19,7 @@
+ *
+ * File: channel.c
+ *
+- * Purpose: Channel number maping
++ * Purpose: Channel number mapping
+ *
+ * Author: Lucas Lin
+ *
+--- a/drivers/staging/vt6656/ioctl.c
++++ b/drivers/staging/vt6656/ioctl.c
+@@ -152,7 +152,7 @@ int private_ioctl(PSDevice pDevice, stru
+ else if(zonetype == 0x02) { //Europe
+ sZoneTypeCmd.ZoneType = ZoneType_Europe;
+ }
+- else { //Unknow ZoneType
++ else { //Unknown ZoneType
+ printk("Error:ZoneType[%x] Unknown ???\n",zonetype);
+ result = -EFAULT;
+ break;
+@@ -679,7 +679,7 @@ if(wpa_Result.authenticated==TRUE) {
+ wireless_send_event(pDevice->dev, IWEVCUSTOM, &wrqu, pItemSSID->abySSID);
+ }
+ #endif
+- pDevice->fWPA_Authened = TRUE; //is sucessful peer to wpa_Result.authenticated?
++ pDevice->fWPA_Authened = TRUE; //is successful peer to wpa_Result.authenticated?
+ }
+
+ //printk("get private wpa_supplicant announce WPA SM\n");
+--- a/drivers/staging/vt6656/iwctl.c
++++ b/drivers/staging/vt6656/iwctl.c
+@@ -1724,7 +1724,7 @@ int iwctl_siwauth(struct net_device *dev
+ case IW_AUTH_WPA_ENABLED:
+ //pDevice->bWPADEVUp = !! wrq->value;
+ //if(pDevice->bWPADEVUp==TRUE)
+- // printk("iwctl_siwauth:set WPADEV to enable sucessful*******\n");
++ // printk("iwctl_siwauth:set WPADEV to enable successful*******\n");
+ //else
+ // printk("iwctl_siwauth:set WPADEV to enable fail?????\n");
+ break;
+--- a/drivers/staging/vt6656/main_usb.c
++++ b/drivers/staging/vt6656/main_usb.c
+@@ -1537,7 +1537,7 @@ if(result!=0) {
+ return buffer;
+ }
+
+-//return --->-1:fail; >=0:sucessful
++//return --->-1:fail; >=0:successful
+ static int Read_config_file(PSDevice pDevice) {
+ int result=0;
+ UCHAR tmpbuffer[100];
+--- a/drivers/staging/vt6656/mib.h
++++ b/drivers/staging/vt6656/mib.h
+@@ -357,10 +357,10 @@ typedef struct tagSStatCounter {
+ #ifdef Calcu_LinkQual
+ //Tx count:
+ ULONG TxNoRetryOkCount; //success tx no retry !
+- ULONG TxRetryOkCount; //sucess tx but retry !
++ ULONG TxRetryOkCount; //success tx but retry !
+ ULONG TxFailCount; //fail tx ?
+ //Rx count:
+- ULONG RxOkCnt; //sucess rx !
++ ULONG RxOkCnt; //success rx !
+ ULONG RxFcsErrCnt; //fail rx ?
+ //statistic
+ ULONG SignalStren;
+--- a/drivers/staging/vt6656/wcmd.c
++++ b/drivers/staging/vt6656/wcmd.c
+@@ -1331,7 +1331,7 @@ BSSvSecondTxData(
+ }
+
+ spin_lock_irq(&pDevice->lock);
+- //is wap_supplicant running sucessful OR only open && sharekey mode!
++ //is wap_supplicant running successful OR only open && sharekey mode!
+ #if 1
+ if(((pDevice->bLinkPass ==TRUE)&&(pMgmt->eAuthenMode < WMAC_AUTH_WPA)) || //open && sharekey linking
+ (pDevice->fWPA_Authened == TRUE)) { //wpa linking
diff --git a/staging/staging-iio-fix-ring-buffer-build.patch b/staging/staging-iio-fix-ring-buffer-build.patch
new file mode 100644
index 00000000000000..39ceace8b9bbb6
--- /dev/null
+++ b/staging/staging-iio-fix-ring-buffer-build.patch
@@ -0,0 +1,76 @@
+From randy.dunlap@oracle.com Thu Nov 19 11:17:16 2009
+From: Randy Dunlap <randy.dunlap@oracle.com>
+Date: Tue, 10 Nov 2009 09:04:28 -0800
+Subject: Staging: iio: fix ring buffer build
+To: Stephen Rothwell <sfr@canb.auug.org.au>, devel@driverdev.osuosl.org
+Message-ID: <20091110090428.08797a9a.randy.dunlap@oracle.com>
+
+
+From: Randy Dunlap <randy.dunlap@oracle.com>
+
+max1363 uses both the iio hardware ring buffer and software
+ring buffer interfaces, but its Makefile and Kconfig do not
+reflect that usage, so its build breaks. Add a new Kconfig
+symbol to reflect that usage and change max1363.h & Makefile
+to use the new Kconfig symbol.
+
+Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
+Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
+---
+ drivers/staging/iio/adc/Kconfig | 9 +++++++++
+ drivers/staging/iio/adc/Makefile | 2 +-
+ drivers/staging/iio/adc/max1363.h | 6 +++---
+ 3 files changed, 13 insertions(+), 4 deletions(-)
+
+--- a/drivers/staging/iio/adc/Kconfig
++++ b/drivers/staging/iio/adc/Kconfig
+@@ -12,3 +12,12 @@ config MAX1363
+ convertors (ADC). (max1361, max1362, max1363, max1364, max1136,
+ max1136, max1137, max1138, max1139, max1236, max1237, max11238,
+ max1239) Provides direct access via sysfs.
++
++config MAX1363_RING_BUFFER
++ bool "MAXIM max1363: use ring buffer"
++ depends on MAX1363
++ select IIO_RING_BUFFER
++ select IIO_SW_RING
++ help
++ Say yes here to include ring buffer support in the MAX1363
++ ADC driver.
+--- a/drivers/staging/iio/adc/Makefile
++++ b/drivers/staging/iio/adc/Makefile
+@@ -3,6 +3,6 @@
+ #
+
+ max1363-y := max1363_core.o
+-max1363-$(CONFIG_IIO_RING_BUFFER) += max1363_ring.o
++max1363-$(CONFIG_MAX1363_RING_BUFFER) += max1363_ring.o
+
+ obj-$(CONFIG_MAX1363) += max1363.o
+--- a/drivers/staging/iio/adc/max1363.h
++++ b/drivers/staging/iio/adc/max1363.h
+@@ -228,7 +228,7 @@ struct max1363_state {
+ struct iio_trigger *trig;
+ struct regulator *reg;
+ };
+-#ifdef CONFIG_IIO_RING_BUFFER
++#ifdef CONFIG_MAX1363_RING_BUFFER
+
+ ssize_t max1363_scan_from_ring(struct device *dev,
+ struct device_attribute *attr,
+@@ -239,7 +239,7 @@ void max1363_ring_cleanup(struct iio_dev
+ int max1363_initialize_ring(struct iio_ring_buffer *ring);
+ void max1363_uninitialize_ring(struct iio_ring_buffer *ring);
+
+-#else /* CONFIG_IIO_RING_BUFFER */
++#else /* CONFIG_MAX1363_RING_BUFFER */
+
+ static inline void max1363_uninitialize_ring(struct iio_ring_buffer *ring)
+ {
+@@ -265,5 +265,5 @@ max1363_register_ring_funcs_and_init(str
+ };
+
+ static inline void max1363_ring_cleanup(struct iio_dev *indio_dev) {};
+-#endif /* CONFIG_IIO_RING_BUFFER */
++#endif /* CONFIG_MAX1363_RING_BUFFER */
+ #endif /* _MAX1363_H_ */
diff --git a/staging/staging-iio-fix-typos-in-documentation.patch b/staging/staging-iio-fix-typos-in-documentation.patch
new file mode 100644
index 00000000000000..8d3b1409d2e6f9
--- /dev/null
+++ b/staging/staging-iio-fix-typos-in-documentation.patch
@@ -0,0 +1,56 @@
+From amit.kucheria@verdurent.com Thu Nov 19 11:35:00 2009
+From: Amit Kucheria <amit.kucheria@verdurent.com>
+Date: Mon, 9 Nov 2009 15:10:15 +0200
+Subject: Staging: iio: Fix typos in documentation
+Cc: Jonathan Cameron <jic23@cam.ac.uk>, Greg Kroah-Hartman <gregkh@suse.de>
+Message-ID: <1257772215-1396-1-git-send-email-amit.kucheria@verdurent.com>
+
+
+Spell-check wouln't catch these :)
+
+Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
+Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/iio/Documentation/device.txt | 4 ++--
+ drivers/staging/iio/Documentation/overview.txt | 9 +++++----
+ 2 files changed, 7 insertions(+), 6 deletions(-)
+
+--- a/drivers/staging/iio/Documentation/device.txt
++++ b/drivers/staging/iio/Documentation/device.txt
+@@ -10,7 +10,7 @@ First allocate one using:
+
+ struct iio_dev *indio_dev = iio_allocate_device();
+
+-The fill in the following.
++Then fill in the following:
+
+ indio_dev->dev.parent
+ the struct device associated with the underlying hardware.
+@@ -45,5 +45,5 @@ allocated prior to registering the devic
+ be registered afterwards (otherwise the whole parentage of devices
+ gets confused)
+
+-On remove iio_device_unregister(indio_dev) will remove the device from
++On remove, iio_device_unregister(indio_dev) will remove the device from
+ the core, and iio_free_device will clean up.
+--- a/drivers/staging/iio/Documentation/overview.txt
++++ b/drivers/staging/iio/Documentation/overview.txt
+@@ -24,11 +24,12 @@ hwmon with simple polled access to devic
+ * Event chrdevs. These are similar to input in that they provide a
+ route to user space for hardware triggered events. Such events include
+ threshold detectors, free-fall detectors and more complex action
+-detection. They events themselves are currently very simple with
++detection. The events themselves are currently very simple with
+ merely an event code and a timestamp. Any data associated with the
+-event must be accessed via polling. Note a given device may have one
+-or more event channel. These events are turned on or off (if possible)
+-via sysfs interfaces.
++event must be accessed via polling.
++
++Note: A given device may have one or more event channel. These events are
++turned on or off (if possible) via sysfs interfaces.
+
+ * Hardware ring buffer support. Some recent sensors have included
+ fifo / ring buffers on the sensor chip. These greatly reduce the load
diff --git a/staging/staging-iio-tsl2563-ambient-light-sensor-driver.patch b/staging/staging-iio-tsl2563-ambient-light-sensor-driver.patch
new file mode 100644
index 00000000000000..5b240572c4f8ac
--- /dev/null
+++ b/staging/staging-iio-tsl2563-ambient-light-sensor-driver.patch
@@ -0,0 +1,840 @@
+From amit.kucheria@verdurent.com Thu Nov 19 11:36:07 2009
+From: Amit Kucheria <amit.kucheria@verdurent.com>
+Date: Mon, 9 Nov 2009 15:14:28 +0200
+Subject: Staging: iio: tsl2563 ambient light sensor driver
+To: List Linux Kernel <linux-kernel@vger.kernel.org>
+Cc: Jonathan Cameron <jic23@cam.ac.uk>, Greg Kroah-Hartman <gregkh@suse.de>, linux-omap@vger.kernel.org
+Message-ID: <1257772468-4004-1-git-send-email-amit.kucheria@verdurent.com>
+
+
+Add driver support for the tsl2563 TAOS ambient light sensor. After looking at
+discussions on LKML, the driver was modified from a 'hwmon' driver to an 'iio'
+driver. The sysfs interfaces have been tested on an RX51 (N900) to see if it
+responds to changing light conditions.
+
+The only real reason for submitting this to staging is that it is dependent on
+the IIO subsystem.
+
+Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
+Cc: Jonathan Cameron <jic23@cam.ac.uk>
+Cc: linux-omap@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/iio/light/Kconfig | 11
+ drivers/staging/iio/light/Makefile | 1
+ drivers/staging/iio/light/tsl2563.c | 772 ++++++++++++++++++++++++++++++++++++
+ drivers/staging/iio/light/tsl2563.h | 9
+ 4 files changed, 793 insertions(+)
+
+--- a/drivers/staging/iio/light/Kconfig
++++ b/drivers/staging/iio/light/Kconfig
+@@ -11,3 +11,14 @@ config TSL2561
+ convertor. This chip has two light sensors. One is broadband
+ including infrared whilst the other measures only infrared.
+ Provides direct access via sysfs.
++
++config SENSORS_TSL2563
++ tristate "TAOS TSL2563 ambient light sensor"
++ depends on I2C
++ help
++ If you say yes here you get support for the Taos TSL2563
++ ambient light sensor (found in N900).
++
++ This driver can also be built as a module. If so, the module
++ will be called tsl2563.
++
+--- a/drivers/staging/iio/light/Makefile
++++ b/drivers/staging/iio/light/Makefile
+@@ -3,3 +3,4 @@
+ #
+
+ obj-$(CONFIG_TSL2561) += tsl2561.o
++obj-$(CONFIG_SENSORS_TSL2563) += tsl2563.o
+--- /dev/null
++++ b/drivers/staging/iio/light/tsl2563.c
+@@ -0,0 +1,772 @@
++/*
++ * drivers/i2c/chips/tsl2563.c
++ *
++ * Copyright (C) 2008 Nokia Corporation
++ *
++ * Written by Timo O. Karjalainen <timo.o.karjalainen@nokia.com>
++ * Contact: Amit Kucheria <amit.kucheria@verdurent.com>
++ *
++ * Converted to IIO driver
++ * Amit Kucheria <amit.kucheria@verdurent.com>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA
++ */
++
++#include <linux/module.h>
++#include <linux/i2c.h>
++#include <linux/interrupt.h>
++#include <linux/sched.h>
++#include <linux/mutex.h>
++#include <linux/delay.h>
++#include <linux/platform_device.h>
++#include <linux/pm.h>
++#include <linux/hwmon.h>
++#include <linux/err.h>
++
++#include "../iio.h"
++#include "tsl2563.h"
++
++#define DRIVER_NAME "tsl2563"
++
++/* Use this many bits for fraction part. */
++#define ADC_FRAC_BITS (14)
++
++/* Given number of 1/10000's in ADC_FRAC_BITS precision. */
++#define FRAC10K(f) (((f) * (1L << (ADC_FRAC_BITS))) / (10000))
++
++/* Bits used for fraction in calibration coefficients.*/
++#define CALIB_FRAC_BITS (10)
++/* 0.5 in CALIB_FRAC_BITS precision */
++#define CALIB_FRAC_HALF (1 << (CALIB_FRAC_BITS - 1))
++/* Make a fraction from a number n that was multiplied with b. */
++#define CALIB_FRAC(n, b) (((n) << CALIB_FRAC_BITS) / (b))
++/* Decimal 10^(digits in sysfs presentation) */
++#define CALIB_BASE_SYSFS (1000)
++
++#define TSL2563_CMD (0x80)
++#define TSL2563_CLEARINT (0x40)
++
++#define TSL2563_REG_CTRL (0x00)
++#define TSL2563_REG_TIMING (0x01)
++#define TSL2563_REG_LOWLOW (0x02) /* data0 low threshold, 2 bytes */
++#define TSL2563_REG_LOWHIGH (0x03)
++#define TSL2563_REG_HIGHLOW (0x04) /* data0 high threshold, 2 bytes */
++#define TSL2563_REG_HIGHHIGH (0x05)
++#define TSL2563_REG_INT (0x06)
++#define TSL2563_REG_ID (0x0a)
++#define TSL2563_REG_DATA0LOW (0x0c) /* broadband sensor value, 2 bytes */
++#define TSL2563_REG_DATA0HIGH (0x0d)
++#define TSL2563_REG_DATA1LOW (0x0e) /* infrared sensor value, 2 bytes */
++#define TSL2563_REG_DATA1HIGH (0x0f)
++
++#define TSL2563_CMD_POWER_ON (0x03)
++#define TSL2563_CMD_POWER_OFF (0x00)
++#define TSL2563_CTRL_POWER_MASK (0x03)
++
++#define TSL2563_TIMING_13MS (0x00)
++#define TSL2563_TIMING_100MS (0x01)
++#define TSL2563_TIMING_400MS (0x02)
++#define TSL2563_TIMING_MASK (0x03)
++#define TSL2563_TIMING_GAIN16 (0x10)
++#define TSL2563_TIMING_GAIN1 (0x00)
++
++#define TSL2563_INT_DISBLED (0x00)
++#define TSL2563_INT_LEVEL (0x10)
++#define TSL2563_INT_PERSIST(n) ((n) & 0x0F)
++
++struct tsl2563_gainlevel_coeff {
++ u8 gaintime;
++ u16 min;
++ u16 max;
++};
++
++static struct tsl2563_gainlevel_coeff tsl2563_gainlevel_table[] = {
++ {
++ .gaintime = TSL2563_TIMING_400MS | TSL2563_TIMING_GAIN16,
++ .min = 0,
++ .max = 65534,
++ }, {
++ .gaintime = TSL2563_TIMING_400MS | TSL2563_TIMING_GAIN1,
++ .min = 2048,
++ .max = 65534,
++ }, {
++ .gaintime = TSL2563_TIMING_100MS | TSL2563_TIMING_GAIN1,
++ .min = 4095,
++ .max = 37177,
++ }, {
++ .gaintime = TSL2563_TIMING_13MS | TSL2563_TIMING_GAIN1,
++ .min = 3000,
++ .max = 65535,
++ },
++};
++
++struct tsl2563_chip {
++ struct mutex lock;
++ struct i2c_client *client;
++ struct iio_dev *indio_dev;
++ struct delayed_work poweroff_work;
++
++ /* Remember state for suspend and resume functions */
++ pm_message_t state;
++
++ struct tsl2563_gainlevel_coeff *gainlevel;
++
++ /* Thresholds are in lux */
++ u16 low_thres;
++ u16 high_thres;
++ u8 intr;
++
++ /* Calibration coefficients */
++ u32 calib0;
++ u32 calib1;
++ int cover_comp_gain;
++
++ /* Cache current values, to be returned while suspended */
++ u32 data0;
++ u32 data1;
++};
++
++static int tsl2563_write(struct i2c_client *client, u8 reg, u8 value)
++{
++ int ret;
++ u8 buf[2];
++
++ buf[0] = TSL2563_CMD | reg;
++ buf[1] = value;
++
++ ret = i2c_master_send(client, buf, sizeof(buf));
++ return (ret == sizeof(buf)) ? 0 : ret;
++}
++
++static int tsl2563_read(struct i2c_client *client, u8 reg, void *buf, int len)
++{
++ int ret;
++ u8 cmd = TSL2563_CMD | reg;
++
++ ret = i2c_master_send(client, &cmd, sizeof(cmd));
++ if (ret != sizeof(cmd))
++ return ret;
++
++ return i2c_master_recv(client, buf, len);
++}
++
++static int tsl2563_set_power(struct tsl2563_chip *chip, int on)
++{
++ struct i2c_client *client = chip->client;
++ u8 cmd;
++
++ cmd = on ? TSL2563_CMD_POWER_ON : TSL2563_CMD_POWER_OFF;
++ return tsl2563_write(client, TSL2563_REG_CTRL, cmd);
++}
++
++/*
++ * Return value is 0 for off, 1 for on, or a negative error
++ * code if reading failed.
++ */
++static int tsl2563_get_power(struct tsl2563_chip *chip)
++{
++ struct i2c_client *client = chip->client;
++ int ret;
++ u8 val;
++
++ ret = tsl2563_read(client, TSL2563_REG_CTRL, &val, sizeof(val));
++ if (ret != sizeof(val))
++ return ret;
++
++ return (val & TSL2563_CTRL_POWER_MASK) == TSL2563_CMD_POWER_ON;
++}
++
++static int tsl2563_configure(struct tsl2563_chip *chip)
++{
++ struct i2c_client *client = chip->client;
++ int ret;
++
++ ret = tsl2563_write(client, TSL2563_REG_TIMING,
++ chip->gainlevel->gaintime);
++ if (ret)
++ goto out;
++
++ ret = tsl2563_write(client, TSL2563_REG_INT, chip->intr);
++
++out:
++ return ret;
++}
++
++static void tsl2563_poweroff_work(struct work_struct *work)
++{
++ struct tsl2563_chip *chip =
++ container_of(work, struct tsl2563_chip, poweroff_work.work);
++ tsl2563_set_power(chip, 0);
++}
++
++static int tsl2563_detect(struct tsl2563_chip *chip)
++{
++ int ret;
++
++ ret = tsl2563_set_power(chip, 1);
++ if (ret)
++ return ret;
++
++ ret = tsl2563_get_power(chip);
++ if (ret < 0)
++ return ret;
++
++ return ret ? 0 : -ENODEV;
++}
++
++static int tsl2563_read_id(struct tsl2563_chip *chip, u8 *id)
++{
++ struct i2c_client *client = chip->client;
++ int ret;
++
++ ret = tsl2563_read(client, TSL2563_REG_ID, id, sizeof(*id));
++ if (ret != sizeof(*id))
++ return ret;
++
++ return 0;
++}
++
++/*
++ * "Normalized" ADC value is one obtained with 400ms of integration time and
++ * 16x gain. This function returns the number of bits of shift needed to
++ * convert between normalized values and HW values obtained using given
++ * timing and gain settings.
++ */
++static int adc_shiftbits(u8 timing)
++{
++ int shift = 0;
++
++ switch (timing & TSL2563_TIMING_MASK) {
++ case TSL2563_TIMING_13MS:
++ shift += 5;
++ break;
++ case TSL2563_TIMING_100MS:
++ shift += 2;
++ break;
++ case TSL2563_TIMING_400MS:
++ /* no-op */
++ break;
++ }
++
++ if (!(timing & TSL2563_TIMING_GAIN16))
++ shift += 4;
++
++ return shift;
++}
++
++/* Convert a HW ADC value to normalized scale. */
++static u32 normalize_adc(u16 adc, u8 timing)
++{
++ return adc << adc_shiftbits(timing);
++}
++
++static void tsl2563_wait_adc(struct tsl2563_chip *chip)
++{
++ unsigned int delay;
++
++ switch (chip->gainlevel->gaintime & TSL2563_TIMING_MASK) {
++ case TSL2563_TIMING_13MS:
++ delay = 14;
++ break;
++ case TSL2563_TIMING_100MS:
++ delay = 101;
++ break;
++ default:
++ delay = 402;
++ }
++ /*
++ * TODO: Make sure that we wait at least required delay but why we
++ * have to extend it one tick more?
++ */
++ schedule_timeout_interruptible(msecs_to_jiffies(delay) + 2);
++}
++
++static int tsl2563_adjust_gainlevel(struct tsl2563_chip *chip, u16 adc)
++{
++ struct i2c_client *client = chip->client;
++
++ if (adc > chip->gainlevel->max || adc < chip->gainlevel->min) {
++
++ (adc > chip->gainlevel->max) ?
++ chip->gainlevel++ : chip->gainlevel--;
++
++ tsl2563_write(client, TSL2563_REG_TIMING,
++ chip->gainlevel->gaintime);
++
++ tsl2563_wait_adc(chip);
++ tsl2563_wait_adc(chip);
++
++ return 1;
++ } else
++ return 0;
++}
++
++static int tsl2563_get_adc(struct tsl2563_chip *chip)
++{
++ struct i2c_client *client = chip->client;
++ u8 buf0[2], buf1[2];
++ u16 adc0, adc1;
++ int retry = 1;
++ int ret = 0;
++
++ if (chip->state.event != PM_EVENT_ON)
++ goto out;
++
++ cancel_delayed_work(&chip->poweroff_work);
++
++ if (!tsl2563_get_power(chip)) {
++ ret = tsl2563_set_power(chip, 1);
++ if (ret)
++ goto out;
++ ret = tsl2563_configure(chip);
++ if (ret)
++ goto out;
++ tsl2563_wait_adc(chip);
++ }
++
++ while (retry) {
++ ret = tsl2563_read(client,
++ TSL2563_REG_DATA0LOW | TSL2563_CLEARINT,
++ buf0, sizeof(buf0));
++ if (ret != sizeof(buf0))
++ goto out;
++
++ ret = tsl2563_read(client, TSL2563_REG_DATA1LOW,
++ buf1, sizeof(buf1));
++ if (ret != sizeof(buf1))
++ goto out;
++
++ adc0 = (buf0[1] << 8) + buf0[0];
++ adc1 = (buf1[1] << 8) + buf1[0];
++
++ retry = tsl2563_adjust_gainlevel(chip, adc0);
++ }
++
++ chip->data0 = normalize_adc(adc0, chip->gainlevel->gaintime);
++ chip->data1 = normalize_adc(adc1, chip->gainlevel->gaintime);
++
++ schedule_delayed_work(&chip->poweroff_work, 5 * HZ);
++
++ ret = 0;
++out:
++ return ret;
++}
++
++static inline int calib_to_sysfs(u32 calib)
++{
++ return (int) (((calib * CALIB_BASE_SYSFS) +
++ CALIB_FRAC_HALF) >> CALIB_FRAC_BITS);
++}
++
++static inline u32 calib_from_sysfs(int value)
++{
++ return (((u32) value) << CALIB_FRAC_BITS) / CALIB_BASE_SYSFS;
++}
++
++/*
++ * Conversions between lux and ADC values.
++ *
++ * The basic formula is lux = c0 * adc0 - c1 * adc1, where c0 and c1 are
++ * appropriate constants. Different constants are needed for different
++ * kinds of light, determined by the ratio adc1/adc0 (basically the ratio
++ * of the intensities in infrared and visible wavelengths). lux_table below
++ * lists the upper threshold of the adc1/adc0 ratio and the corresponding
++ * constants.
++ */
++
++struct tsl2563_lux_coeff {
++ unsigned long ch_ratio;
++ unsigned long ch0_coeff;
++ unsigned long ch1_coeff;
++};
++
++static const struct tsl2563_lux_coeff lux_table[] = {
++ {
++ .ch_ratio = FRAC10K(1300),
++ .ch0_coeff = FRAC10K(315),
++ .ch1_coeff = FRAC10K(262),
++ }, {
++ .ch_ratio = FRAC10K(2600),
++ .ch0_coeff = FRAC10K(337),
++ .ch1_coeff = FRAC10K(430),
++ }, {
++ .ch_ratio = FRAC10K(3900),
++ .ch0_coeff = FRAC10K(363),
++ .ch1_coeff = FRAC10K(529),
++ }, {
++ .ch_ratio = FRAC10K(5200),
++ .ch0_coeff = FRAC10K(392),
++ .ch1_coeff = FRAC10K(605),
++ }, {
++ .ch_ratio = FRAC10K(6500),
++ .ch0_coeff = FRAC10K(229),
++ .ch1_coeff = FRAC10K(291),
++ }, {
++ .ch_ratio = FRAC10K(8000),
++ .ch0_coeff = FRAC10K(157),
++ .ch1_coeff = FRAC10K(180),
++ }, {
++ .ch_ratio = FRAC10K(13000),
++ .ch0_coeff = FRAC10K(34),
++ .ch1_coeff = FRAC10K(26),
++ }, {
++ .ch_ratio = ULONG_MAX,
++ .ch0_coeff = 0,
++ .ch1_coeff = 0,
++ },
++};
++
++/*
++ * Convert normalized, scaled ADC values to lux.
++ */
++static unsigned int adc_to_lux(u32 adc0, u32 adc1)
++{
++ const struct tsl2563_lux_coeff *lp = lux_table;
++ unsigned long ratio, lux, ch0 = adc0, ch1 = adc1;
++
++ ratio = ch0 ? ((ch1 << ADC_FRAC_BITS) / ch0) : ULONG_MAX;
++
++ while (lp->ch_ratio < ratio)
++ lp++;
++
++ lux = ch0 * lp->ch0_coeff - ch1 * lp->ch1_coeff;
++
++ return (unsigned int) (lux >> ADC_FRAC_BITS);
++}
++
++/*--------------------------------------------------------------*/
++/* Sysfs interface */
++/*--------------------------------------------------------------*/
++
++static ssize_t tsl2563_adc0_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct iio_dev *indio_dev = dev_get_drvdata(dev);
++ struct tsl2563_chip *chip = indio_dev->dev_data;
++ int ret;
++
++ mutex_lock(&chip->lock);
++
++ ret = tsl2563_get_adc(chip);
++ if (ret)
++ goto out;
++
++ ret = snprintf(buf, PAGE_SIZE, "%d\n", chip->data0);
++out:
++ mutex_unlock(&chip->lock);
++ return ret;
++}
++
++static ssize_t tsl2563_adc1_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct iio_dev *indio_dev = dev_get_drvdata(dev);
++ struct tsl2563_chip *chip = indio_dev->dev_data;
++ int ret;
++
++ mutex_lock(&chip->lock);
++
++ ret = tsl2563_get_adc(chip);
++ if (ret)
++ goto out;
++
++ ret = snprintf(buf, PAGE_SIZE, "%d\n", chip->data1);
++out:
++ mutex_unlock(&chip->lock);
++ return ret;
++}
++
++/* Apply calibration coefficient to ADC count. */
++static u32 calib_adc(u32 adc, u32 calib)
++{
++ unsigned long scaled = adc;
++
++ scaled *= calib;
++ scaled >>= CALIB_FRAC_BITS;
++
++ return (u32) scaled;
++}
++
++static ssize_t tsl2563_lux_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct iio_dev *indio_dev = dev_get_drvdata(dev);
++ struct tsl2563_chip *chip = indio_dev->dev_data;
++ u32 calib0, calib1;
++ int ret;
++
++ mutex_lock(&chip->lock);
++
++ ret = tsl2563_get_adc(chip);
++ if (ret)
++ goto out;
++
++ calib0 = calib_adc(chip->data0, chip->calib0) * chip->cover_comp_gain;
++ calib1 = calib_adc(chip->data1, chip->calib1) * chip->cover_comp_gain;
++
++ ret = snprintf(buf, PAGE_SIZE, "%d\n", adc_to_lux(calib0, calib1));
++
++out:
++ mutex_unlock(&chip->lock);
++ return ret;
++}
++
++static ssize_t format_calib(char *buf, int len, u32 calib)
++{
++ return snprintf(buf, PAGE_SIZE, "%d\n", calib_to_sysfs(calib));
++}
++
++static ssize_t tsl2563_calib0_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct iio_dev *indio_dev = dev_get_drvdata(dev);
++ struct tsl2563_chip *chip = indio_dev->dev_data;
++ int ret;
++
++ mutex_lock(&chip->lock);
++ ret = format_calib(buf, PAGE_SIZE, chip->calib0);
++ mutex_unlock(&chip->lock);
++ return ret;
++}
++
++static ssize_t tsl2563_calib1_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct iio_dev *indio_dev = dev_get_drvdata(dev);
++ struct tsl2563_chip *chip = indio_dev->dev_data;
++ int ret;
++
++ mutex_lock(&chip->lock);
++ ret = format_calib(buf, PAGE_SIZE, chip->calib1);
++ mutex_unlock(&chip->lock);
++ return ret;
++}
++
++static int do_calib_store(struct device *dev, const char *buf, size_t len,
++ int ch)
++{
++ struct iio_dev *indio_dev = dev_get_drvdata(dev);
++ struct tsl2563_chip *chip = indio_dev->dev_data;
++ int value;
++ u32 calib;
++
++ if (1 != sscanf(buf, "%d", &value))
++ return -EINVAL;
++
++ calib = calib_from_sysfs(value);
++
++ if (ch)
++ chip->calib1 = calib;
++ else
++ chip->calib0 = calib;
++
++ return len;
++}
++
++static ssize_t tsl2563_calib0_store(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t len)
++{
++ return do_calib_store(dev, buf, len, 0);
++}
++
++static ssize_t tsl2563_calib1_store(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t len)
++{
++ return do_calib_store(dev, buf, len, 1);
++}
++
++/* AmitXXXX: Convert to IIO_DEV_ATTR_LIGHT* as in tsl2561
++ * once I understand what they mean */
++static DEVICE_ATTR(adc0, S_IRUGO, tsl2563_adc0_show, NULL);
++static DEVICE_ATTR(adc1, S_IRUGO, tsl2563_adc1_show, NULL);
++static DEVICE_ATTR(lux, S_IRUGO, tsl2563_lux_show, NULL);
++static DEVICE_ATTR(calib0, S_IRUGO | S_IWUSR,
++ tsl2563_calib0_show, tsl2563_calib0_store);
++static DEVICE_ATTR(calib1, S_IRUGO | S_IWUSR,
++ tsl2563_calib1_show, tsl2563_calib1_store);
++
++static struct attribute *tsl2563_attributes[] = {
++ &dev_attr_adc0.attr,
++ &dev_attr_adc1.attr,
++ &dev_attr_lux.attr,
++ &dev_attr_calib0.attr,
++ &dev_attr_calib1.attr,
++ NULL
++};
++
++static const struct attribute_group tsl2563_group = {
++ .attrs = tsl2563_attributes,
++};
++
++/*--------------------------------------------------------------*/
++/* Probe, Attach, Remove */
++/*--------------------------------------------------------------*/
++static struct i2c_driver tsl2563_i2c_driver;
++
++static int __devinit tsl2563_probe(struct i2c_client *client,
++ const struct i2c_device_id *device_id)
++{
++ struct tsl2563_chip *chip;
++ struct tsl2563_platform_data *pdata = client->dev.platform_data;
++ int err = 0;
++ int ret;
++ u8 id;
++
++ chip = kzalloc(sizeof(*chip), GFP_KERNEL);
++ if (!chip)
++ return -ENOMEM;
++
++ i2c_set_clientdata(client, chip);
++ chip->client = client;
++
++ err = tsl2563_detect(chip);
++ if (err) {
++ dev_err(&client->dev, "device not found, error %d \n", -err);
++ goto fail1;
++ }
++
++ err = tsl2563_read_id(chip, &id);
++ if (err)
++ goto fail1;
++
++ mutex_init(&chip->lock);
++
++ /* Default values used until userspace says otherwise */
++ chip->low_thres = 0x0;
++ chip->high_thres = 0xffff;
++ chip->gainlevel = tsl2563_gainlevel_table;
++ chip->intr = TSL2563_INT_PERSIST(4);
++ chip->calib0 = calib_from_sysfs(CALIB_BASE_SYSFS);
++ chip->calib1 = calib_from_sysfs(CALIB_BASE_SYSFS);
++
++ if (pdata)
++ chip->cover_comp_gain = pdata->cover_comp_gain;
++ else
++ chip->cover_comp_gain = 1;
++
++ dev_info(&client->dev, "model %d, rev. %d\n", id >> 4, id & 0x0f);
++
++ chip->indio_dev = iio_allocate_device();
++ if (!chip->indio_dev)
++ goto fail1;
++ chip->indio_dev->attrs = &tsl2563_group;
++ chip->indio_dev->dev.parent = &client->dev;
++ chip->indio_dev->dev_data = (void *)(chip);
++ chip->indio_dev->driver_module = THIS_MODULE;
++ chip->indio_dev->modes = INDIO_DIRECT_MODE;
++ ret = iio_device_register(chip->indio_dev);
++ if (ret)
++ goto fail1;
++
++ err = tsl2563_configure(chip);
++ if (err)
++ goto fail2;
++
++ INIT_DELAYED_WORK(&chip->poweroff_work, tsl2563_poweroff_work);
++ schedule_delayed_work(&chip->poweroff_work, 5 * HZ);
++
++ return 0;
++fail2:
++ iio_device_unregister(chip->indio_dev);
++fail1:
++ kfree(chip);
++ return err;
++}
++
++static int tsl2563_remove(struct i2c_client *client)
++{
++ struct tsl2563_chip *chip = i2c_get_clientdata(client);
++
++ iio_device_unregister(chip->indio_dev);
++
++ kfree(chip);
++ return 0;
++}
++
++static int tsl2563_suspend(struct i2c_client *client, pm_message_t state)
++{
++ struct tsl2563_chip *chip = i2c_get_clientdata(client);
++ int ret;
++
++ mutex_lock(&chip->lock);
++
++ ret = tsl2563_set_power(chip, 0);
++ if (ret)
++ goto out;
++
++ chip->state = state;
++
++out:
++ mutex_unlock(&chip->lock);
++ return ret;
++}
++
++static int tsl2563_resume(struct i2c_client *client)
++{
++ struct tsl2563_chip *chip = i2c_get_clientdata(client);
++ int ret;
++
++ mutex_lock(&chip->lock);
++
++ ret = tsl2563_set_power(chip, 1);
++ if (ret)
++ goto out;
++
++ ret = tsl2563_configure(chip);
++ if (ret)
++ goto out;
++
++ chip->state.event = PM_EVENT_ON;
++
++out:
++ mutex_unlock(&chip->lock);
++ return ret;
++}
++
++static const struct i2c_device_id tsl2563_id[] = {
++ { DRIVER_NAME, 0 },
++ { },
++};
++MODULE_DEVICE_TABLE(i2c, tsl2563_id);
++
++static struct i2c_driver tsl2563_i2c_driver = {
++ .driver = {
++ .name = DRIVER_NAME,
++ },
++ .suspend = tsl2563_suspend,
++ .resume = tsl2563_resume,
++ .probe = tsl2563_probe,
++ .remove = __devexit_p(tsl2563_remove),
++ .id_table = tsl2563_id,
++};
++
++static int __init tsl2563_init(void)
++{
++ return i2c_add_driver(&tsl2563_i2c_driver);
++}
++
++static void __exit tsl2563_exit(void)
++{
++ i2c_del_driver(&tsl2563_i2c_driver);
++}
++
++MODULE_AUTHOR("Nokia Corporation");
++MODULE_DESCRIPTION("tsl2563 light sensor driver");
++MODULE_LICENSE("GPL");
++
++module_init(tsl2563_init);
++module_exit(tsl2563_exit);
+--- /dev/null
++++ b/drivers/staging/iio/light/tsl2563.h
+@@ -0,0 +1,9 @@
++#ifndef __LINUX_TSL2563_H
++#define __LINUX_TSL2563_H
++
++struct tsl2563_platform_data {
++ int cover_comp_gain;
++};
++
++#endif /* __LINUX_TSL2563_H */
++
diff --git a/staging/staging-line6-fix-printk-formats.patch b/staging/staging-line6-fix-printk-formats.patch
new file mode 100644
index 00000000000000..16d8d8bf0d2d1f
--- /dev/null
+++ b/staging/staging-line6-fix-printk-formats.patch
@@ -0,0 +1,42 @@
+From randy.dunlap@oracle.com Thu Nov 19 11:19:12 2009
+From: Randy Dunlap <randy.dunlap@oracle.com>
+Date: Thu, 12 Nov 2009 15:46:01 -0800
+Subject: Staging: line6: fix printk formats
+To: Stephen Rothwell <sfr@canb.auug.org.au>, gregkh@suse.de
+Message-ID: <20091112154601.97a4e2ab.randy.dunlap@oracle.com>
+
+
+From: Randy Dunlap <randy.dunlap@oracle.com>
+
+Fix printk format warnings in line6/pod.c; sizeof() is of type
+size_t, so use %zu.
+
+drivers/staging/line6/pod.c:581: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
+drivers/staging/line6/pod.c:693: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
+
+Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/line6/pod.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/line6/pod.c
++++ b/drivers/staging/line6/pod.c
+@@ -579,7 +579,7 @@ static ssize_t pod_set_dump(struct devic
+
+ if (count != sizeof(pod->prog_data)) {
+ dev_err(pod->line6.ifcdev,
+- "data block must be exactly %d bytes\n",
++ "data block must be exactly %zu bytes\n",
+ sizeof(pod->prog_data));
+ return -EINVAL;
+ }
+@@ -691,7 +691,7 @@ static ssize_t pod_set_dump_buf(struct d
+
+ if (count != sizeof(pod->prog_data)) {
+ dev_err(pod->line6.ifcdev,
+- "data block must be exactly %d bytes\n",
++ "data block must be exactly %zu bytes\n",
+ sizeof(pod->prog_data));
+ return -EINVAL;
+ }
diff --git a/staging/staging-rt2860-reduce-superfluous-exclamation-marks.patch b/staging/staging-rt2860-reduce-superfluous-exclamation-marks.patch
new file mode 100644
index 00000000000000..812f4475250f53
--- /dev/null
+++ b/staging/staging-rt2860-reduce-superfluous-exclamation-marks.patch
@@ -0,0 +1,776 @@
+From sd@sedf.de Thu Nov 19 11:46:56 2009
+From: Sebastian Dalfu� <sd@sedf.de>
+Date: Sat, 7 Nov 2009 17:31:12 +0100
+Subject: Staging: rt2860: reduce superfluous exclamation marks
+To: Greg KH <greg@kroah.com>
+Cc: linux-kernel@vger.kernel.org
+Message-ID: <20091107163112.GA25035@sedf.de>
+Content-Disposition: inline
+
+
+From: Sebastian Dalfu� <sd@sedf.de>
+
+This removes superfluous exclamation marks from strings and comments, and
+also three spelling typos.
+
+Signed-off-by: Sebastian Dalfu� <sd@sedf.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/rt2860/common/ba_action.c | 4 +-
+ drivers/staging/rt2860/common/cmm_aes.c | 2 -
+ drivers/staging/rt2860/common/cmm_asic.c | 2 -
+ drivers/staging/rt2860/common/cmm_data.c | 8 ++---
+ drivers/staging/rt2860/common/cmm_data_2860.c | 2 -
+ drivers/staging/rt2860/common/cmm_data_pci.c | 2 -
+ drivers/staging/rt2860/common/cmm_mac_pci.c | 2 -
+ drivers/staging/rt2860/common/cmm_mac_usb.c | 22 +++++++-------
+ drivers/staging/rt2860/common/cmm_sanity.c | 4 +-
+ drivers/staging/rt2860/common/cmm_tkip.c | 2 -
+ drivers/staging/rt2860/common/cmm_wep.c | 2 -
+ drivers/staging/rt2860/common/cmm_wpa.c | 4 +-
+ drivers/staging/rt2860/common/mlme.c | 8 ++---
+ drivers/staging/rt2860/common/rt_rf.c | 2 -
+ drivers/staging/rt2860/common/rtmp_init.c | 6 +--
+ drivers/staging/rt2860/oid.h | 4 +-
+ drivers/staging/rt2860/rt_linux.c | 4 +-
+ drivers/staging/rt2860/rt_linux.h | 2 -
+ drivers/staging/rt2860/rt_main_dev.c | 2 -
+ drivers/staging/rt2860/rtmp_chip.h | 2 -
+ drivers/staging/rt2860/rtmp_def.h | 2 -
+ drivers/staging/rt2860/sta/assoc.c | 4 +-
+ drivers/staging/rt2860/sta/connect.c | 40 +++++++++++++-------------
+ drivers/staging/rt2860/sta/rtmp_data.c | 12 +++----
+ drivers/staging/rt2860/sta/sanity.c | 2 -
+ drivers/staging/rt2860/sta_ioctl.c | 14 ++++-----
+ drivers/staging/rt2860/usb_main_dev.c | 4 +-
+ 27 files changed, 82 insertions(+), 82 deletions(-)
+
+--- a/drivers/staging/rt2860/common/ba_action.c
++++ b/drivers/staging/rt2860/common/ba_action.c
+@@ -1481,7 +1481,7 @@ static void ba_enqueue_reordering_packet
+ NdisReleaseSpinLock(&pBAEntry->RxReRingLock);
+ } else {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("!!! (%d) Can't allocate reordering mpdu blk\n",
++ (" (%d) Can't allocate reordering mpdu blk\n",
+ pBAEntry->list.qlen));
+
+ /*
+@@ -1542,7 +1542,7 @@ void Indicate_AMPDU_Packet(struct rt_rtm
+ }
+ pBAEntry = &pAd->BATable.BARecEntry[Idx];
+ } else {
+- /* impossible !!! */
++ /* impossible ! */
+ ASSERT(0);
+ /* release packet */
+ RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket,
+--- a/drivers/staging/rt2860/common/cmm_aes.c
++++ b/drivers/staging/rt2860/common/cmm_aes.c
+@@ -1279,7 +1279,7 @@ void AES_GTK_KEY_UNWRAP(u8 * key,
+
+ if (R == NULL) {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("!!!AES_GTK_KEY_UNWRAP: no memory!!!\n"));
++ ("AES_GTK_KEY_UNWRAP: no memory!\n"));
+ return;
+ }
+ /* End of if */
+--- a/drivers/staging/rt2860/common/cmm_asic.c
++++ b/drivers/staging/rt2860/common/cmm_asic.c
+@@ -1005,7 +1005,7 @@ void AsicSwitchChannel(struct rt_rtmp_ad
+ void AsicResetBBPAgent(struct rt_rtmp_adapter *pAd)
+ {
+ BBP_CSR_CFG_STRUC BbpCsr;
+- DBGPRINT(RT_DEBUG_ERROR, ("Reset BBP Agent busy bit.!! \n"));
++ DBGPRINT(RT_DEBUG_ERROR, ("Reset BBP Agent busy bit!\n"));
+ /* Still need to find why BBP agent keeps busy, but in fact, hardware still function ok. Now clear busy first. */
+ RTMP_IO_READ32(pAd, H2M_BBP_AGENT, &BbpCsr.word);
+ BbpCsr.field.Busy = 0;
+--- a/drivers/staging/rt2860/common/cmm_data_2860.c
++++ b/drivers/staging/rt2860/common/cmm_data_2860.c
+@@ -847,7 +847,7 @@ VOID RT28xxPciStaAsicForceWakeup(
+ AutoWakeupCfg.word = 0;
+ RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+
+- // If this is called from Halt. ALWAYS force wakeup!!!
++ // If this is called from Halt. ALWAYS force wakeup!
+ if (Level == RTMP_HALT)
+ {
+ RT28xxPciAsicRadioOn(pAd, RTMP_HALT);
+--- a/drivers/staging/rt2860/common/cmm_data.c
++++ b/drivers/staging/rt2860/common/cmm_data.c
+@@ -397,7 +397,7 @@ int MlmeHardTransmitMgmtRing(struct rt_r
+ && (pAd->CommonCfg.bIEEE80211H == 1)
+ && (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)) {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("MlmeHardTransmit --> radar detect not in normal mode !!!\n"));
++ ("MlmeHardTransmit --> radar detect not in normal mode!\n"));
+ /* if (!IrqState) */
+ RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
+ return (NDIS_STATUS_FAILURE);
+@@ -964,7 +964,7 @@ u16 RTMPCalcDuration(struct rt_rtmp_adap
+ IRQL = PASSIVE_LEVEL
+ IRQL = DISPATCH_LEVEL
+
+- See also : BASmartHardTransmit() !!!
++ See also : BASmartHardTransmit() !
+
+ ========================================================================
+ */
+@@ -1708,7 +1708,7 @@ BOOLEAN MacTableDeleteEntry(struct rt_rt
+ pProbeEntry = pProbeEntry->pNext;
+ } while (pProbeEntry);
+
+- /* not found !!! */
++ /* not found ! */
+ ASSERT(pProbeEntry != NULL);
+
+ RTMP_STA_ENTRY_KEY_DEL(pAd, BSS0, wcid);
+@@ -1729,7 +1729,7 @@ BOOLEAN MacTableDeleteEntry(struct rt_rt
+ pAd->MacTab.Size));
+ } else {
+ DBGPRINT(RT_DEBUG_OFF,
+- ("\n%s: Impossible Wcid = %d !!!!!\n",
++ ("\n%s: Impossible Wcid = %d !\n",
+ __func__, wcid));
+ }
+ }
+--- a/drivers/staging/rt2860/common/cmm_data_pci.c
++++ b/drivers/staging/rt2860/common/cmm_data_pci.c
+@@ -979,7 +979,7 @@ int MlmeHardTransmitTxRing(struct rt_rtm
+ && (pAd->CommonCfg.bIEEE80211H == 1)
+ && (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)) {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("MlmeHardTransmit --> radar detect not in normal mode !!!\n"));
++ ("MlmeHardTransmit --> radar detect not in normal mode!\n"));
+ /*NdisReleaseSpinLock(&pAd->TxRingLock); */
+ return (NDIS_STATUS_FAILURE);
+ }
+--- a/drivers/staging/rt2860/common/cmm_mac_pci.c
++++ b/drivers/staging/rt2860/common/cmm_mac_pci.c
+@@ -1650,7 +1650,7 @@ void RT28xxPciMlmeRadioOFF(struct rt_rtm
+
+ if (brc == FALSE) {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("%s call RT28xxPciAsicRadioOff fail !!\n",
++ ("%s call RT28xxPciAsicRadioOff fail!\n",
+ __func__));
+ }
+ }
+--- a/drivers/staging/rt2860/common/cmm_mac_usb.c
++++ b/drivers/staging/rt2860/common/cmm_mac_usb.c
+@@ -205,9 +205,9 @@ int NICInitTransmit(struct rt_rtmp_adapt
+ /*Allocate URB */
+ LM_USB_ALLOC(pObj, pHTTXContext, struct rt_httx_buffer *,
+ sizeof(struct rt_httx_buffer), Status,
+- ("<-- ERROR in Alloc TX TxContext[%d] urb!! \n",
++ ("<-- ERROR in Alloc TX TxContext[%d] urb!\n",
+ acidx), done,
+- ("<-- ERROR in Alloc TX TxContext[%d] struct rt_httx_buffer !! \n",
++ ("<-- ERROR in Alloc TX TxContext[%d] struct rt_httx_buffer!\n",
+ acidx), out1);
+
+ NdisZeroMemory(pHTTXContext->TransferBuffer->
+@@ -259,7 +259,7 @@ int NICInitTransmit(struct rt_rtmp_adapt
+ pMLMEContext->pUrb = RTUSB_ALLOC_URB(0);
+ if (pMLMEContext->pUrb == NULL) {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("<-- ERROR in Alloc TX MLMEContext[%d] urb!! \n",
++ ("<-- ERROR in Alloc TX MLMEContext[%d] urb!\n",
+ i));
+ Status = NDIS_STATUS_RESOURCES;
+ goto out2;
+@@ -296,9 +296,9 @@ int NICInitTransmit(struct rt_rtmp_adapt
+ /*Allocate URB */
+ LM_USB_ALLOC(pObj, pBeaconContext, struct rt_tx_buffer *,
+ sizeof(struct rt_tx_buffer), Status,
+- ("<-- ERROR in Alloc TX BeaconContext[%d] urb!! \n",
++ ("<-- ERROR in Alloc TX BeaconContext[%d] urb!\n",
+ i), out2,
+- ("<-- ERROR in Alloc TX BeaconContext[%d] struct rt_tx_buffer !! \n",
++ ("<-- ERROR in Alloc TX BeaconContext[%d] struct rt_tx_buffer!\n",
+ i), out3);
+
+ pBeaconContext->pAd = pAd;
+@@ -315,9 +315,9 @@ int NICInitTransmit(struct rt_rtmp_adapt
+ /*Allocate URB */
+ LM_USB_ALLOC(pObj, pNullContext, struct rt_tx_buffer *, sizeof(struct rt_tx_buffer),
+ Status,
+- ("<-- ERROR in Alloc TX NullContext urb!! \n"),
++ ("<-- ERROR in Alloc TX NullContext urb!\n"),
+ out3,
+- ("<-- ERROR in Alloc TX NullContext struct rt_tx_buffer !! \n"),
++ ("<-- ERROR in Alloc TX NullContext struct rt_tx_buffer!\n"),
+ out4);
+
+ pNullContext->pAd = pAd;
+@@ -333,9 +333,9 @@ int NICInitTransmit(struct rt_rtmp_adapt
+ /*Allocate URB */
+ LM_USB_ALLOC(pObj, pRTSContext, struct rt_tx_buffer *, sizeof(struct rt_tx_buffer),
+ Status,
+- ("<-- ERROR in Alloc TX RTSContext urb!! \n"),
++ ("<-- ERROR in Alloc TX RTSContext urb!\n"),
+ out4,
+- ("<-- ERROR in Alloc TX RTSContext struct rt_tx_buffer !! \n"),
++ ("<-- ERROR in Alloc TX RTSContext struct rt_tx_buffer!\n"),
+ out5);
+
+ pRTSContext->pAd = pAd;
+@@ -350,9 +350,9 @@ int NICInitTransmit(struct rt_rtmp_adapt
+ /*Allocate URB */
+ LM_USB_ALLOC(pObj, pPsPollContext, struct rt_tx_buffer *,
+ sizeof(struct rt_tx_buffer), Status,
+- ("<-- ERROR in Alloc TX PsPollContext urb!! \n"),
++ ("<-- ERROR in Alloc TX PsPollContext urb!\n"),
+ out5,
+- ("<-- ERROR in Alloc TX PsPollContext struct rt_tx_buffer !! \n"),
++ ("<-- ERROR in Alloc TX PsPollContext struct rt_tx_buffer!\n"),
+ out6);
+
+ pPsPollContext->pAd = pAd;
+--- a/drivers/staging/rt2860/common/cmm_sanity.c
++++ b/drivers/staging/rt2860/common/cmm_sanity.c
+@@ -256,7 +256,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(stru
+
+ /* For some 11a AP which didn't have DS_IE, we use two conditions to decide the channel */
+ /* 1. If the AP is 11n enabled, then check the control channel. */
+- /* 2. If the AP didn't have any info about channel, use the channel we received this frame as the channel. (May inaccuracy!!) */
++ /* 2. If the AP didn't have any info about channel, use the channel we received this frame as the channel. (May inaccuracy!) */
+ u8 CtrlChannel = 0;
+
+ /* Add for 3 necessary EID field check */
+@@ -371,7 +371,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(stru
+ break;
+
+ case IE_HT_CAP:
+- if (pEid->Len >= SIZE_HT_CAP_IE) /*Note: allow extension.!! */
++ if (pEid->Len >= SIZE_HT_CAP_IE) /*Note: allow extension! */
+ {
+ NdisMoveMemory(pHtCapability, pEid->Octet,
+ sizeof(struct rt_ht_capability_ie));
+--- a/drivers/staging/rt2860/common/cmm_tkip.c
++++ b/drivers/staging/rt2860/common/cmm_tkip.c
+@@ -828,6 +828,6 @@ BOOLEAN RTMPSoftDecryptTKIP(struct rt_rt
+ /*RTMPReportMicError(pAd, &pWpaKey[KeyID]); // marked by AlbertY @ 20060630 */
+ return (FALSE);
+ }
+- /*DBGPRINT(RT_DEBUG_TRACE, "RTMPSoftDecryptTKIP Decript done!!\n"); */
++ /*DBGPRINT(RT_DEBUG_TRACE, "RTMPSoftDecryptTKIP Decript done!\n"); */
+ return TRUE;
+ }
+--- a/drivers/staging/rt2860/common/cmm_wep.c
++++ b/drivers/staging/rt2860/common/cmm_wep.c
+@@ -245,7 +245,7 @@ BOOLEAN RTMPSoftDecryptWEP(struct rt_rtm
+ crc32 ^= 0xffffffff; /* complement */
+
+ if (crc32 != cpu2le32(trailfcs)) {
+- DBGPRINT(RT_DEBUG_TRACE, ("! WEP Data CRC Error !\n")); /*CRC error. */
++ DBGPRINT(RT_DEBUG_TRACE, ("WEP Data CRC Error!\n")); /*CRC error. */
+ return (FALSE);
+ }
+ return (TRUE);
+--- a/drivers/staging/rt2860/common/cmm_wpa.c
++++ b/drivers/staging/rt2860/common/cmm_wpa.c
+@@ -1292,7 +1292,7 @@ void PRF(u8 * key,
+ os_alloc_mem(NULL, (u8 **) & input, 1024);
+
+ if (input == NULL) {
+- DBGPRINT(RT_DEBUG_ERROR, ("!!!PRF: no memory!!!\n"));
++ DBGPRINT(RT_DEBUG_ERROR, ("PRF: no memory!\n"));
+ return;
+ }
+ /* Generate concatenation input */
+@@ -2672,7 +2672,7 @@ static void CalculateMIC(u8 KeyDescVer,
+ os_alloc_mem(NULL, (u8 **) & OutBuffer, 512);
+
+ if (OutBuffer == NULL) {
+- DBGPRINT(RT_DEBUG_ERROR, ("!!!CalculateMIC: no memory!!!\n"));
++ DBGPRINT(RT_DEBUG_ERROR, ("CalculateMIC: no memory!\n"));
+ return;
+ }
+ /* make a frame for calculating MIC. */
+--- a/drivers/staging/rt2860/common/mlme.c
++++ b/drivers/staging/rt2860/common/mlme.c
+@@ -483,7 +483,7 @@ void MlmeHandler(struct rt_rtmp_adapter
+ #ifdef RTMP_MAC_USB
+ if (Elem->MsgType == MT2_RESET_CONF) {
+ DBGPRINT_RAW(RT_DEBUG_TRACE,
+- ("!!! reset MLME state machine !!!\n"));
++ ("reset MLME state machine!\n"));
+ MlmeRestartStateMachine(pAd);
+ Elem->Occupied = FALSE;
+ Elem->MsgLen = 0;
+@@ -4042,7 +4042,7 @@ void BssTableSsidSort(struct rt_rtmp_ada
+ }
+ /* Since the AP is using hidden SSID, and we are trying to connect to ANY */
+ /* It definitely will fail. So, skip it. */
+- /* CCX also require not even try to connect it!! */
++ /* CCX also require not even try to connect it! */
+ if (SsidLen == 0)
+ continue;
+
+@@ -4600,8 +4600,8 @@ void MgtMacHeaderInit(struct rt_rtmp_ada
+ * input params:
+ * Buffer - pointer to a pre-allocated memory segment
+ * args - a list of <int arg_size, arg> pairs.
+- * NOTE NOTE NOTE!!!! the last argument must be NULL, otherwise this
+- * function will FAIL!!!
++ * NOTE NOTE NOTE! the last argument must be NULL, otherwise this
++ * function will FAIL!
+ * return:
+ * Size of the buffer
+ * usage:
+--- a/drivers/staging/rt2860/common/rtmp_init.c
++++ b/drivers/staging/rt2860/common/rtmp_init.c
+@@ -75,7 +75,7 @@ struct rt_rtmp_reg_pair MACRegTable[] =
+ {BCN_OFFSET0, 0xece8e4e0}, /* 0x3800, 0x3A00, 0x3C00, 0x3E00, 512B for each beacon */
+ {BCN_OFFSET1, 0xfcf8f4f0}, /* 0x3800, 0x3A00, 0x3C00, 0x3E00, 512B for each beacon */
+ #else
+-#error You must re-calculate new value for BCN_OFFSET0 & BCN_OFFSET1 in MACRegTable[]!!!
++#error You must re-calculate new value for BCN_OFFSET0 & BCN_OFFSET1 in MACRegTable[]!
+ #endif /* HW_BEACON_OFFSET // */
+
+ {LEGACY_BASIC_RATE, 0x0000013f}, /* Basic rate set bitmap */
+@@ -1272,7 +1272,7 @@ void NICInitAsicFromEEPROM(struct rt_rtm
+ pAd->bAutoTxAgcA = pAd->bAutoTxAgcG = FALSE;
+ /* */
+ /* Since BBP has been progamed, to make sure BBP setting will be */
+- /* upate inside of AsicAntennaSelect, so reset to UNKNOWN_BAND!! */
++ /* upate inside of AsicAntennaSelect, so reset to UNKNOWN_BAND! */
+ /* */
+ pAd->CommonCfg.BandState = UNKNOWN_BAND;
+
+@@ -3470,7 +3470,7 @@ err1:
+ err0:
+ #endif /* ST // */
+
+- DBGPRINT(RT_DEBUG_ERROR, ("!!! rt28xx Initialized fail !!!\n"));
++ DBGPRINT(RT_DEBUG_ERROR, ("rt28xx Initialized fail!\n"));
+ return FALSE;
+ }
+
+--- a/drivers/staging/rt2860/common/rt_rf.c
++++ b/drivers/staging/rt2860/common/rt_rf.c
+@@ -72,7 +72,7 @@ int RT30xxWriteRFRegister(struct rt_rtmp
+ if ((i == RETRY_LIMIT)
+ || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) {
+ DBGPRINT_RAW(RT_DEBUG_ERROR,
+- ("Retry count exhausted or device removed!!!\n"));
++ ("Retry count exhausted or device removed!\n"));
+ return STATUS_UNSUCCESSFUL;
+ }
+
+--- a/drivers/staging/rt2860/oid.h
++++ b/drivers/staging/rt2860/oid.h
+@@ -557,7 +557,7 @@ enum {
+ /* New for MeetingHouse Api support */
+ #define OID_MH_802_1X_SUPPORTED 0xFFEDC100
+
+-/* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! */
++/* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition! */
+ typedef union _HTTRANSMIT_SETTING {
+ struct {
+ u16 MCS:7; /* MCS */
+@@ -614,7 +614,7 @@ struct rt_802_11_event_table {
+ struct rt_802_11_event_log Log[MAX_NUMBER_OF_EVENT];
+ };
+
+-/* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! */
++/* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition! */
+ typedef union _MACHTTRANSMIT_SETTING {
+ struct {
+ u16 MCS:7; /* MCS */
+--- a/drivers/staging/rt2860/rt_linux.c
++++ b/drivers/staging/rt2860/rt_linux.c
+@@ -51,7 +51,7 @@ char const *pWirelessSysEventText[IW_SYS
+ "connects with our wireless client", /* IW_STA_LINKUP_EVENT_FLAG */
+ "disconnects with our wireless client", /* IW_STA_LINKDOWN_EVENT_FLAG */
+ "scan completed" /* IW_SCAN_COMPLETED_EVENT_FLAG */
+- "scan terminate!! Busy!! Enqueue fail!!" /* IW_SCAN_ENQUEUE_FAIL_EVENT_FLAG */
++ "scan terminate! Busy! Enqueue fail!" /* IW_SCAN_ENQUEUE_FAIL_EVENT_FLAG */
+ };
+
+ /* for wireless IDS_spoof_attack event message */
+@@ -1282,7 +1282,7 @@ int RtmpOSNetDevDestory(struct rt_rtmp_a
+ {
+
+ /* TODO: Need to fix this */
+- printk("WARNING: This function(%s) not implement yet!!!\n", __func__);
++ printk("WARNING: This function(%s) not implement yet!\n", __func__);
+ return 0;
+ }
+
+--- a/drivers/staging/rt2860/rt_linux.h
++++ b/drivers/staging/rt2860/rt_linux.h
+@@ -427,7 +427,7 @@ do{ \
+
+ #define DBGPRINT_ERR(Fmt) \
+ { \
+- printk("ERROR!!! "); \
++ printk("ERROR! "); \
+ printk Fmt; \
+ }
+
+--- a/drivers/staging/rt2860/rt_main_dev.c
++++ b/drivers/staging/rt2860/rt_main_dev.c
+@@ -321,7 +321,7 @@ int rt28xx_close(struct net_device *dev)
+
+ if (brc == FALSE) {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("%s call RT28xxPciAsicRadioOff fail !!\n",
++ ("%s call RT28xxPciAsicRadioOff fail!\n",
+ __func__));
+ }
+ }
+--- a/drivers/staging/rt2860/rtmp_chip.h
++++ b/drivers/staging/rt2860/rtmp_chip.h
+@@ -197,7 +197,7 @@ typedef union _EEPROM_NIC_CINFIG2_STRUC
+ u16 DynamicTxAgcControl:1; /* */
+ u16 ExternalLNAForG:1; /* */
+ u16 ExternalLNAForA:1; /* external LNA enable for 2.4G */
+- u16 CardbusAcceleration:1; /* !!! NOTE: 0 - enable, 1 - disable */
++ u16 CardbusAcceleration:1; /* ! NOTE: 0 - enable, 1 - disable */
+ u16 BW40MSidebandForG:1;
+ u16 BW40MSidebandForA:1;
+ u16 EnableWPSPBC:1; /* WPS PBC Control bit */
+--- a/drivers/staging/rt2860/rtmp_def.h
++++ b/drivers/staging/rt2860/rtmp_def.h
+@@ -409,7 +409,7 @@
+ #define MAX_LEN_OF_MAC_TABLE MAX_NUMBER_OF_MAC /* if MAX_MBSSID_NUM is 8, this value can't be larger than 211 */
+
+ #if MAX_LEN_OF_MAC_TABLE>MAX_AVAILABLE_CLIENT_WCID
+-#error MAX_LEN_OF_MAC_TABLE can not be larger than MAX_AVAILABLE_CLIENT_WCID!!!!
++#error MAX_LEN_OF_MAC_TABLE can not be larger than MAX_AVAILABLE_CLIENT_WCID!
+ #endif
+
+ #define MAX_NUM_OF_WDS_LINK_PERBSSID 3
+--- a/drivers/staging/rt2860/sta/assoc.c
++++ b/drivers/staging/rt2860/sta/assoc.c
+@@ -563,7 +563,7 @@ void MlmeAssocReqAction(struct rt_rtmp_a
+ pAd->Mlme.AssocMachine.CurrState = ASSOC_WAIT_RSP;
+ } else {
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("ASSOC - MlmeAssocReqAction() sanity check failed. BUG!!!!!! \n"));
++ ("ASSOC - MlmeAssocReqAction() sanity check failed. BUG!\n"));
+ pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
+ Status = MLME_INVALID_FORMAT;
+ MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2,
+@@ -746,7 +746,7 @@ void MlmeReassocReqAction(struct rt_rtmp
+ pAd->Mlme.AssocMachine.CurrState = REASSOC_WAIT_RSP;
+ } else {
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("ASSOC - MlmeReassocReqAction() sanity check failed. BUG!!!! \n"));
++ ("ASSOC - MlmeReassocReqAction() sanity check failed. BUG!\n"));
+ pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
+ Status = MLME_INVALID_FORMAT;
+ MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2,
+--- a/drivers/staging/rt2860/sta/connect.c
++++ b/drivers/staging/rt2860/sta/connect.c
+@@ -214,7 +214,7 @@ void MlmeCntlMachinePerformAction(struct
+ break;
+ #endif /* RTMP_MAC_USB // */
+ default:
+- DBGPRINT_ERR(("!ERROR! CNTL - Illegal message type(=%ld)",
++ DBGPRINT_ERR(("ERROR! CNTL - Illegal message type(=%ld)",
+ Elem->MsgType));
+ break;
+ }
+@@ -911,7 +911,7 @@ void CntlWaitStartProc(struct rt_rtmp_ad
+ pAd->CommonCfg.Bssid[5]));
+ } else {
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("CNTL - Start IBSS fail. BUG!!!!!\n"));
++ ("CNTL - Start IBSS fail. BUG!\n"));
+ pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
+ }
+ }
+@@ -1184,7 +1184,7 @@ void LinkUp(struct rt_rtmp_adapter *pAd,
+ /* */
+ /* ASSOC - DisassocTimeoutAction */
+ /* CNTL - Dis-associate successful */
+- /* !!! LINK DOWN !!! */
++ /* ! LINK DOWN ! */
+ /* [88888] OID_802_11_SSID should have returned NDTEST_WEP_AP2(Returned: ) */
+ /* */
+ /* To prevent DisassocTimeoutAction to call Link down after we link up, */
+@@ -1218,12 +1218,12 @@ void LinkUp(struct rt_rtmp_adapter *pAd,
+ if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
+ AdhocTurnOnQos(pAd);
+
+- DBGPRINT(RT_DEBUG_TRACE, ("!!!Adhoc LINK UP !!! \n"));
++ DBGPRINT(RT_DEBUG_TRACE, ("Adhoc LINK UP!\n"));
+ } else {
+ OPSTATUS_SET_FLAG(pAd, fOP_STATUS_INFRA_ON);
+ OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_ADHOC_ON);
+
+- DBGPRINT(RT_DEBUG_TRACE, ("!!!Infra LINK UP !!! \n"));
++ DBGPRINT(RT_DEBUG_TRACE, ("Infra LINK UP!\n"));
+ }
+
+ /* 3*3 */
+@@ -1262,11 +1262,11 @@ void LinkUp(struct rt_rtmp_adapter *pAd,
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16);
+- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n"));
++ DBGPRINT(RT_DEBUG_TRACE, ("rt2860C !\n"));
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!!40MHz Lower LINK UP !!! Control Channel at Below. Central = %d \n",
++ ("40MHz Lower LINK UP! Control Channel at Below. Central = %d \n",
+ pAd->CommonCfg.CentralChannel));
+ } else if ((pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
+ && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth ==
+@@ -1296,11 +1296,11 @@ void LinkUp(struct rt_rtmp_adapter *pAd,
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16);
+- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n"));
++ DBGPRINT(RT_DEBUG_TRACE, ("rt2860C !\n"));
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! 40MHz Upper LINK UP !!! Control Channel at UpperCentral = %d \n",
++ ("40MHz Upper LINK UP! Control Channel at UpperCentral = %d \n",
+ pAd->CommonCfg.CentralChannel));
+ } else {
+ pAd->CommonCfg.BBPCurrentBW = BW_20;
+@@ -1327,10 +1327,10 @@ void LinkUp(struct rt_rtmp_adapter *pAd,
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x08);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x11);
+- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n"));
++ DBGPRINT(RT_DEBUG_TRACE, ("rt2860C !\n"));
+ }
+
+- DBGPRINT(RT_DEBUG_TRACE, ("!!! 20MHz LINK UP !!! \n"));
++ DBGPRINT(RT_DEBUG_TRACE, ("20MHz LINK UP!\n"));
+ }
+
+ RTMPSetAGCInitValue(pAd, pAd->CommonCfg.BBPCurrentBW);
+@@ -1342,12 +1342,12 @@ void LinkUp(struct rt_rtmp_adapter *pAd,
+ &pAd->BbpTuning.R66CurrentValue);
+
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! LINK UP !!! (BssType=%d, AID=%d, ssid=%s, Channel=%d, CentralChannel = %d)\n",
++ ("LINK UP! (BssType=%d, AID=%d, ssid=%s, Channel=%d, CentralChannel = %d)\n",
+ BssType, pAd->StaActive.Aid, pAd->CommonCfg.Ssid,
+ pAd->CommonCfg.Channel, pAd->CommonCfg.CentralChannel));
+
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! LINK UP !!! (Density =%d, )\n",
++ ("LINK UP! (Density =%d, )\n",
+ pAd->MacTab.Content[BSSID_WCID].MpduDensity));
+
+ AsicSetBssid(pAd, pAd->CommonCfg.Bssid);
+@@ -1634,13 +1634,13 @@ void LinkUp(struct rt_rtmp_adapter *pAd,
+ NdisReleaseSpinLock(&pAd->MacTabLock);
+
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! LINK UP !!! ClientStatusFlags=%lx)\n",
++ ("LINK UP! ClientStatusFlags=%lx)\n",
+ pAd->MacTab.Content[BSSID_WCID].ClientStatusFlags));
+
+ MlmeUpdateTxRates(pAd, TRUE, BSS0);
+ MlmeUpdateHtTxRates(pAd, BSS0);
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! LINK UP !! (StaActive.bHtEnable =%d, )\n",
++ ("LINK UP! (StaActive.bHtEnable =%d, )\n",
+ pAd->StaActive.SupportedPhyInfo.bHtEnable));
+
+ if (pAd->CommonCfg.bAggregationCapable) {
+@@ -1811,7 +1811,7 @@ void LinkUp(struct rt_rtmp_adapter *pAd,
+ pAd->CommonCfg.IOTestParm.bLastAtheros = FALSE;
+ COPY_MAC_ADDR(pAd->CommonCfg.LastBssid, pAd->CommonCfg.Bssid);
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!!pAd->bNextDisableRxBA= %d \n",
++ ("pAd->bNextDisableRxBA= %d \n",
+ pAd->CommonCfg.IOTestParm.bNextDisableRxBA));
+ /* BSSID add in one MAC entry too. Because in Tx, ASIC need to check Cipher and IV/EIV, BAbitmap */
+ /* Pther information in MACTab.Content[BSSID_WCID] is not necessary for driver. */
+@@ -1893,7 +1893,7 @@ void LinkDown(struct rt_rtmp_adapter *pA
+ BSS0, 0);
+ }
+
+- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN !!!\n"));
++ DBGPRINT(RT_DEBUG_TRACE, ("LINK DOWN!\n"));
+ OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED);
+
+ #ifdef RTMP_MAC_PCI
+@@ -1921,7 +1921,7 @@ void LinkDown(struct rt_rtmp_adapter *pA
+
+ if (ADHOC_ON(pAd)) /* Adhoc mode link down */
+ {
+- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN 1!!!\n"));
++ DBGPRINT(RT_DEBUG_TRACE, ("LINK DOWN 1!\n"));
+
+ OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_ADHOC_ON);
+ OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
+@@ -1931,10 +1931,10 @@ void LinkDown(struct rt_rtmp_adapter *pA
+ BssTableDeleteEntry(&pAd->ScanTab, pAd->CommonCfg.Bssid,
+ pAd->CommonCfg.Channel);
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! MacTab.Size=%d !!!\n", pAd->MacTab.Size));
++ (" MacTab.Size=%d !\n", pAd->MacTab.Size));
+ } else /* Infra structure mode */
+ {
+- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN 2!!!\n"));
++ DBGPRINT(RT_DEBUG_TRACE, ("LINK DOWN 2!\n"));
+
+ OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_INFRA_ON);
+ OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
+--- a/drivers/staging/rt2860/sta_ioctl.c
++++ b/drivers/staging/rt2860/sta_ioctl.c
+@@ -600,7 +600,7 @@ int rt_ioctl_siwap(struct net_device *de
+ if (pAdapter->Mlme.CntlMachine.CurrState != CNTL_IDLE) {
+ RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! MLME busy, reset MLME state machine !!!\n"));
++ ("MLME busy, reset MLME state machine!\n"));
+ }
+ /* tell CNTL state machine to call NdisMSetInformationComplete() after completing */
+ /* this request, because this request is initiated by NDIS. */
+@@ -741,7 +741,7 @@ int rt_ioctl_siwscan(struct net_device *
+
+ if (MONITOR_ON(pAdapter)) {
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! Driver is in Monitor Mode now !!!\n"));
++ ("Driver is in Monitor Mode now!\n"));
+ return -EINVAL;
+ }
+
+@@ -758,7 +758,7 @@ int rt_ioctl_siwscan(struct net_device *
+ if ((pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE)
+ && (pAdapter->StaCfg.WpaSupplicantScanCount > 3)) {
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! WpaSupplicantScanCount > 3\n"));
++ ("WpaSupplicantScanCount > 3\n"));
+ Status = NDIS_STATUS_SUCCESS;
+ break;
+ }
+@@ -771,7 +771,7 @@ int rt_ioctl_siwscan(struct net_device *
+ && (pAdapter->StaCfg.PortSecured ==
+ WPA_802_1X_PORT_NOT_SECURED)) {
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! Link UP, Port Not Secured! ignore this set::OID_802_11_BSSID_LIST_SCAN\n"));
++ ("Link UP, Port Not Secured! ignore this set::OID_802_11_BSSID_LIST_SCAN\n"));
+ Status = NDIS_STATUS_SUCCESS;
+ break;
+ }
+@@ -779,7 +779,7 @@ int rt_ioctl_siwscan(struct net_device *
+ if (pAdapter->Mlme.CntlMachine.CurrState != CNTL_IDLE) {
+ RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! MLME busy, reset MLME state machine !!!\n"));
++ ("MLME busy, reset MLME state machine!\n"));
+ }
+ /* tell CNTL state machine to call NdisMSetInformationComplete() after completing */
+ /* this request, because this request is initiated by NDIS. */
+@@ -2256,7 +2256,7 @@ int rt_ioctl_siwpmksa(struct net_device
+ break;
+ default:
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("rt_ioctl_siwpmksa - Unknow Command!!\n"));
++ ("rt_ioctl_siwpmksa - Unknown Command!\n"));
+ break;
+ }
+
+@@ -2664,7 +2664,7 @@ int Set_SSID_Proc(struct rt_rtmp_adapter
+ if (pAdapter->Mlme.CntlMachine.CurrState != CNTL_IDLE) {
+ RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("!!! MLME busy, reset MLME state machine !!!\n"));
++ ("MLME busy, reset MLME state machine!\n"));
+ }
+
+ if ((pAdapter->StaCfg.WpaPassPhraseLen >= 8) &&
+--- a/drivers/staging/rt2860/sta/rtmp_data.c
++++ b/drivers/staging/rt2860/sta/rtmp_data.c
+@@ -192,7 +192,7 @@ void STARxEAPOLFrameIndicate(struct rt_r
+ pRxWI->RSSI1, pRxWI->RSSI2,
+ pRxD->PlcpSignal);
+ DBGPRINT_RAW(RT_DEBUG_TRACE,
+- ("!!! report EAPOL/AIRONET DATA to MLME (len=%d) !!!\n",
++ ("report EAPOL/AIRONET DATA to MLME (len=%d) !\n",
+ pRxBlk->DataSize));
+ }
+ }
+@@ -940,7 +940,7 @@ int STASendPacket(struct rt_rtmp_adapter
+
+ if (pSrcBufVA == NULL) {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("STASendPacket --> pSrcBufVA == NULL !!!SrcBufLen=%x\n",
++ ("STASendPacket --> pSrcBufVA == NULL !SrcBufLen=%x\n",
+ SrcBufLen));
+ /* Resourece is low, system did not allocate virtual address */
+ /* return NDIS_STATUS_FAILURE directly to upper layer */
+@@ -950,7 +950,7 @@ int STASendPacket(struct rt_rtmp_adapter
+
+ if (SrcBufLen < 14) {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("STASendPacket --> Ndis Packet buffer error !!!\n"));
++ ("STASendPacket --> Ndis Packet buffer error!\n"));
+ RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
+ return (NDIS_STATUS_FAILURE);
+ }
+@@ -1007,7 +1007,7 @@ int STASendPacket(struct rt_rtmp_adapter
+ && (RTMP_GET_PACKET_EAPOL(pPacket) == FALSE)
+ ) {
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("STASendPacket --> Drop packet before port secured !!!\n"));
++ ("STASendPacket --> Drop packet before port secured!\n"));
+ RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
+
+ return (NDIS_STATUS_FAILURE);
+@@ -1680,7 +1680,7 @@ void STA_AMPDU_Frame_Tx(struct rt_rtmp_a
+
+ pMacEntry = pTxBlk->pMacEntry;
+ if (pMacEntry->isCached) {
+- /* NOTE: Please make sure the size of pMacEntry->CachedBuf[] is smaller than pTxBlk->HeaderBuf[]!!!! */
++ /* NOTE: Please make sure the size of pMacEntry->CachedBuf[] is smaller than pTxBlk->HeaderBuf[]! */
+ NdisMoveMemory((u8 *)& pTxBlk->
+ HeaderBuf[TXINFO_SIZE],
+ (u8 *)& pMacEntry->CachedBuf[0],
+@@ -2506,7 +2506,7 @@ int STAHardTransmit(struct rt_rtmp_adapt
+ {
+ /* It should not happened! */
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("Send a pacekt was not classified!! It should not happen!\n"));
++ ("Send a packet was not classified! It should not happen!\n"));
+ while (pTxBlk->TxPacketList.Number) {
+ pQEntry =
+ RemoveHeadQueue(&pTxBlk->TxPacketList);
+--- a/drivers/staging/rt2860/sta/sanity.c
++++ b/drivers/staging/rt2860/sta/sanity.c
+@@ -150,7 +150,7 @@ BOOLEAN PeerAssocRspSanity(struct rt_rtm
+
+ case IE_HT_CAP:
+ case IE_HT_CAP2:
+- if (pEid->Len >= SIZE_HT_CAP_IE) /*Note: allow extension.!! */
++ if (pEid->Len >= SIZE_HT_CAP_IE) /*Note: allow extension! */
+ {
+ NdisMoveMemory(pHtCapability, pEid->Octet,
+ SIZE_HT_CAP_IE);
+--- a/drivers/staging/rt2860/usb_main_dev.c
++++ b/drivers/staging/rt2860/usb_main_dev.c
+@@ -584,7 +584,7 @@ void RTUSBWatchDog(struct rt_rtmp_adapte
+ RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
+ if ((MACValue & 0xff) != 0) {
+ DBGPRINT(RT_DEBUG_TRACE,
+- ("TX QUEUE 0 Not EMPTY(Value=0x%0x). !!!!!!!!!!!!!!!\n",
++ ("TX QUEUE 0 Not EMPTY(Value=0x%0x)!\n",
+ MACValue));
+ RTMP_IO_WRITE32(pAd, PBF_CFG, 0xf40012);
+ while ((MACValue & 0xff) != 0 && (idx++ < 10)) {
+@@ -707,7 +707,7 @@ void RTUSBWatchDog(struct rt_rtmp_adapte
+ }
+ } else {
+ DBGPRINT(RT_DEBUG_ERROR,
+- ("Unkonw bulkOut URB maybe hanged!!!!!!!!!!!!\n"));
++ ("Unknown bulkOut URB maybe hanged!\n"));
+ }
+ } else {
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[idx],
diff --git a/staging/staging-rt28x0-fix-comments-in-chip-mac_pci.h.patch b/staging/staging-rt28x0-fix-comments-in-chip-mac_pci.h.patch
new file mode 100644
index 00000000000000..7b43b17da79c4d
--- /dev/null
+++ b/staging/staging-rt28x0-fix-comments-in-chip-mac_pci.h.patch
@@ -0,0 +1,188 @@
+From bzolnier@gmail.com Thu Nov 19 11:46:23 2009
+From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
+Date: Mon, 9 Nov 2009 17:19:45 +0100
+Subject: Staging: rt28x0: fix comments in chip/mac_pci.h
+To: Greg KH <gregkh@suse.de>
+Message-ID: <200911091719.45191.bzolnier@gmail.com>
+
+
+From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
+
+Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/rt2860/chip/mac_pci.h | 72 +++++++++++++++++-----------------
+ 1 file changed, 36 insertions(+), 36 deletions(-)
+
+--- a/drivers/staging/rt2860/chip/mac_pci.h
++++ b/drivers/staging/rt2860/chip/mac_pci.h
+@@ -43,10 +43,10 @@
+ #include "../rtmp_iface.h"
+ #include "../rtmp_dot11.h"
+
+-//
+-// Device ID & Vendor ID related definitions,
+-// NOTE: you should not add the new VendorID/DeviceID here unless you not sure it belongs to what chip.
+-//
++/* */
++/* Device ID & Vendor ID related definitions, */
++/* NOTE: you should not add the new VendorID/DeviceID here unless you not sure it belongs to what chip. */
++/* */
+ #define NIC_PCI_VENDOR_ID 0x1814
+ #define PCIBUS_INTEL_VENDOR 0x8086
+
+@@ -66,22 +66,22 @@
+
+ #define AUX_CTRL 0x10c
+
+-//
+-// TX descriptor format, Tx ring, Mgmt Ring
+-//
++/* */
++/* TX descriptor format, Tx ring, Mgmt Ring */
++/* */
+ struct PACKED rt_txd {
+- // Word 0
++ /* Word 0 */
+ u32 SDPtr0;
+- // Word 1
++ /* Word 1 */
+ u32 SDLen1:14;
+ u32 LastSec1:1;
+ u32 Burst:1;
+ u32 SDLen0:14;
+ u32 LastSec0:1;
+ u32 DMADONE:1;
+- //Word2
++ /*Word2 */
+ u32 SDPtr1;
+- //Word3
++ /*Word3 */
+ u32 rsv2:24;
+ u32 WIV:1; /* Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition */
+ u32 QSEL:2; /* select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA */
+@@ -91,21 +91,21 @@ struct PACKED rt_txd {
+ u32 ICO:1; /* */
+ };
+
+-//
+-// Rx descriptor format, Rx Ring
+-//
++/* */
++/* Rx descriptor format, Rx Ring */
++/* */
+ typedef struct PACKED rt_rxd {
+- // Word 0
++ /* Word 0 */
+ u32 SDP0;
+- // Word 1
++ /* Word 1 */
+ u32 SDL1:14;
+ u32 Rsv:2;
+ u32 SDL0:14;
+ u32 LS0:1;
+ u32 DDONE:1;
+- // Word 2
++ /* Word 2 */
+ u32 SDP1;
+- // Word 3
++ /* Word 3 */
+ u32 BA:1;
+ u32 DATA:1;
+ u32 NULLDATA:1;
+@@ -141,9 +141,9 @@ typedef union _TX_ATTENUATION_CTRL_STRUC
+
+ /* ----------------- EEPROM Related MACRO ----------------- */
+
+-// 8051 firmware image for RT2860 - base address = 0x4000
++/* 8051 firmware image for RT2860 - base address = 0x4000 */
+ #define FIRMWARE_IMAGE_BASE 0x2000
+-#define MAX_FIRMWARE_IMAGE_SIZE 0x2000 // 8kbyte
++#define MAX_FIRMWARE_IMAGE_SIZE 0x2000 /* 8kbyte */
+
+ /* ----------------- Frimware Related MACRO ----------------- */
+ #define RTMP_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
+@@ -222,25 +222,25 @@ typedef union _TX_ATTENUATION_CTRL_STRUC
+ /* ----------------- RX Related MACRO ----------------- */
+
+ /* ----------------- ASIC Related MACRO ----------------- */
+-// reset MAC of a station entry to 0x000000000000
++/* reset MAC of a station entry to 0x000000000000 */
+ #define RTMP_STA_ENTRY_MAC_RESET(pAd, Wcid) \
+ AsicDelWcidTab(pAd, Wcid);
+
+-// add this entry into ASIC RX WCID search table
++/* add this entry into ASIC RX WCID search table */
+ #define RTMP_STA_ENTRY_ADD(pAd, pEntry) \
+ AsicUpdateRxWCIDTable(pAd, pEntry->Aid, pEntry->Addr);
+
+-// add by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
+-// Set MAC register value according operation mode
++/* add by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet */
++/* Set MAC register value according operation mode */
+ #define RTMP_UPDATE_PROTECT(pAd) \
+ AsicUpdateProtect(pAd, 0, (ALLN_SETPROTECT), TRUE, 0);
+-// end johnli
++/* end johnli */
+
+-// remove Pair-wise key material from ASIC
++/* remove Pair-wise key material from ASIC */
+ #define RTMP_STA_ENTRY_KEY_DEL(pAd, BssIdx, Wcid) \
+ AsicRemovePairwiseKeyEntry(pAd, BssIdx, (u8)Wcid);
+
+-// add Client security information into ASIC WCID table and IVEIV table
++/* add Client security information into ASIC WCID table and IVEIV table */
+ #define RTMP_STA_SECURITY_INFO_ADD(pAd, apidx, KeyID, pEntry) \
+ RTMPAddWcidAttributeEntry(pAd, apidx, KeyID, \
+ pAd->SharedKey[apidx][KeyID].CipherAlg, pEntry);
+@@ -257,7 +257,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC
+ pAd->SharedKey[apidx][KeyID].CipherAlg, \
+ pEntry); }
+
+-// Insert the BA bitmap to ASIC for the Wcid entry
++/* Insert the BA bitmap to ASIC for the Wcid entry */
+ #define RTMP_ADD_BA_SESSION_TO_ASIC(_pAd, _Aid, _TID) \
+ do{ \
+ u32 _Value = 0, _Offset; \
+@@ -267,8 +267,8 @@ typedef union _TX_ATTENUATION_CTRL_STRUC
+ RTMP_IO_WRITE32((_pAd), _Offset, _Value);\
+ }while(0)
+
+-// Remove the BA bitmap from ASIC for the Wcid entry
+-// bitmap field starts at 0x10000 in ASIC WCID table
++/* Remove the BA bitmap from ASIC for the Wcid entry */
++/* bitmap field starts at 0x10000 in ASIC WCID table */
+ #define RTMP_DEL_BA_SESSION_FROM_ASIC(_pAd, _Wcid, _TID) \
+ do{ \
+ u32 _Value = 0, _Offset; \
+@@ -280,10 +280,10 @@ typedef union _TX_ATTENUATION_CTRL_STRUC
+
+ /* ----------------- Interface Related MACRO ----------------- */
+
+-//
+-// Enable & Disable NIC interrupt via writing interrupt mask register
+-// Since it use ADAPTER structure, it have to be put after structure definition.
+-//
++/* */
++/* Enable & Disable NIC interrupt via writing interrupt mask register */
++/* Since it use ADAPTER structure, it have to be put after structure definition. */
++/* */
+ #define RTMP_ASIC_INTERRUPT_DISABLE(_pAd) \
+ do{ \
+ RTMP_IO_WRITE32((_pAd), INT_MASK_CSR, 0x0); /* 0: disable */ \
+@@ -324,7 +324,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC
+ /* ----------------- Power Save Related MACRO ----------------- */
+ #define RTMP_PS_POLL_ENQUEUE(pAd) EnqueuePsPoll(pAd)
+
+-// For RTMPPCIePowerLinkCtrlRestore () function
++/* For RTMPPCIePowerLinkCtrlRestore () function */
+ #define RESTORE_HALT 1
+ #define RESTORE_WAKEUP 2
+ #define RESTORE_CLOSE 3
+@@ -352,4 +352,4 @@ typedef union _TX_ATTENUATION_CTRL_STRUC
+ #define RTMP_MLME_RADIO_OFF(pAd) \
+ RT28xxPciMlmeRadioOFF(pAd);
+
+-#endif //__MAC_PCI_H__ //
++#endif /*__MAC_PCI_H__ // */
diff --git a/staging/staging-rt28x0-remove-no-longer-needed-common-cmm_data_2860.c.patch b/staging/staging-rt28x0-remove-no-longer-needed-common-cmm_data_2860.c.patch
new file mode 100644
index 00000000000000..17ca7bb3d3e1bc
--- /dev/null
+++ b/staging/staging-rt28x0-remove-no-longer-needed-common-cmm_data_2860.c.patch
@@ -0,0 +1,1219 @@
+From bzolnier@gmail.com Thu Nov 19 11:48:19 2009
+From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
+Date: Mon, 9 Nov 2009 17:20:39 +0100
+Subject: Staging: rt28x0: remove no longer needed common/cmm_data_2860.c
+To: Greg KH <gregkh@suse.de>
+Message-ID: <200911091720.39821.bzolnier@gmail.com>
+
+
+From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
+
+Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/rt2860/common/cmm_data_2860.c | 1199 --------------------------
+ 1 file changed, 1199 deletions(-)
+
+--- a/drivers/staging/rt2860/common/cmm_data_2860.c
++++ /dev/null
+@@ -1,1199 +0,0 @@
+-/*
+- *************************************************************************
+- * Ralink Tech Inc.
+- * 5F., No.36, Taiyuan St., Jhubei City,
+- * Hsinchu County 302,
+- * Taiwan, R.O.C.
+- *
+- * (c) Copyright 2002-2007, Ralink Technology, Inc.
+- *
+- * This program is free software; you can redistribute it and/or modify *
+- * it under the terms of the GNU General Public License as published by *
+- * the Free Software Foundation; either version 2 of the License, or *
+- * (at your option) any later version. *
+- * *
+- * This program is distributed in the hope that it will be useful, *
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+- * GNU General Public License for more details. *
+- * *
+- * You should have received a copy of the GNU General Public License *
+- * along with this program; if not, write to the *
+- * Free Software Foundation, Inc., *
+- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+- * *
+- *************************************************************************
+-*/
+-
+-/*
+- All functions in this file must be PCI-depended, or you should out your function
+- in other files.
+-
+-*/
+-#include "../rt_config.h"
+-
+-extern RTMP_RF_REGS RF2850RegTable[];
+-extern UCHAR NUM_OF_2850_CHNL;
+-
+-USHORT RtmpPCI_WriteTxResource(
+- IN PRTMP_ADAPTER pAd,
+- IN TX_BLK *pTxBlk,
+- IN BOOLEAN bIsLast,
+- OUT USHORT *FreeNumber)
+-{
+-
+- UCHAR *pDMAHeaderBufVA;
+- USHORT TxIdx, RetTxIdx;
+- PTXD_STRUC pTxD;
+- UINT32 BufBasePaLow;
+- PRTMP_TX_RING pTxRing;
+- USHORT hwHeaderLen;
+-
+- //
+- // get Tx Ring Resource
+- //
+- pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
+- TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
+- pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
+- BufBasePaLow = RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
+-
+- // copy TXINFO + TXWI + WLAN Header + LLC into DMA Header Buffer
+- if (pTxBlk->TxFrameType == TX_AMSDU_FRAME)
+- {
+- hwHeaderLen = pTxBlk->MpduHeaderLen - LENGTH_AMSDU_SUBFRAMEHEAD + pTxBlk->HdrPadLen + LENGTH_AMSDU_SUBFRAMEHEAD;
+- }
+- else
+- {
+- hwHeaderLen = pTxBlk->MpduHeaderLen + pTxBlk->HdrPadLen;
+- }
+- NdisMoveMemory(pDMAHeaderBufVA, pTxBlk->HeaderBuf, TXINFO_SIZE + TXWI_SIZE + hwHeaderLen);
+-
+- pTxRing->Cell[TxIdx].pNdisPacket = pTxBlk->pPacket;
+- pTxRing->Cell[TxIdx].pNextNdisPacket = NULL;
+-
+- //
+- // build Tx Descriptor
+- //
+-
+- pTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
+- NdisZeroMemory(pTxD, TXD_SIZE);
+-
+- pTxD->SDPtr0 = BufBasePaLow;
+- pTxD->SDLen0 = TXINFO_SIZE + TXWI_SIZE + hwHeaderLen; // include padding
+- pTxD->SDPtr1 = PCI_MAP_SINGLE(pAd, pTxBlk, 0, 1, PCI_DMA_TODEVICE);;
+- pTxD->SDLen1 = pTxBlk->SrcBufLen;
+- pTxD->LastSec0 = 0;
+- pTxD->LastSec1 = (bIsLast) ? 1 : 0;
+-
+- RTMPWriteTxDescriptor(pAd, pTxD, FALSE, FIFO_EDCA);
+-
+- RetTxIdx = TxIdx;
+- //
+- // Update Tx index
+- //
+- INC_RING_INDEX(TxIdx, TX_RING_SIZE);
+- pTxRing->TxCpuIdx = TxIdx;
+-
+- *FreeNumber -= 1;
+-
+- return RetTxIdx;
+-}
+-
+-
+-USHORT RtmpPCI_WriteSingleTxResource(
+- IN PRTMP_ADAPTER pAd,
+- IN TX_BLK *pTxBlk,
+- IN BOOLEAN bIsLast,
+- OUT USHORT *FreeNumber)
+-{
+-
+- UCHAR *pDMAHeaderBufVA;
+- USHORT TxIdx, RetTxIdx;
+- PTXD_STRUC pTxD;
+- UINT32 BufBasePaLow;
+- PRTMP_TX_RING pTxRing;
+- USHORT hwHeaderLen;
+-
+- //
+- // get Tx Ring Resource
+- //
+- pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
+- TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
+- pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
+- BufBasePaLow = RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
+-
+- // copy TXINFO + TXWI + WLAN Header + LLC into DMA Header Buffer
+- hwHeaderLen = pTxBlk->MpduHeaderLen + pTxBlk->HdrPadLen;
+-
+- NdisMoveMemory(pDMAHeaderBufVA, pTxBlk->HeaderBuf, TXINFO_SIZE + TXWI_SIZE + hwHeaderLen);
+-
+- pTxRing->Cell[TxIdx].pNdisPacket = pTxBlk->pPacket;
+- pTxRing->Cell[TxIdx].pNextNdisPacket = NULL;
+-
+- //
+- // build Tx Descriptor
+- //
+- pTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
+-
+- NdisZeroMemory(pTxD, TXD_SIZE);
+-
+- pTxD->SDPtr0 = BufBasePaLow;
+- pTxD->SDLen0 = TXINFO_SIZE + TXWI_SIZE + hwHeaderLen; // include padding
+- pTxD->SDPtr1 = PCI_MAP_SINGLE(pAd, pTxBlk, 0, 1, PCI_DMA_TODEVICE);;
+- pTxD->SDLen1 = pTxBlk->SrcBufLen;
+- pTxD->LastSec0 = 0;
+- pTxD->LastSec1 = (bIsLast) ? 1 : 0;
+-
+- RTMPWriteTxDescriptor(pAd, pTxD, FALSE, FIFO_EDCA);
+-
+- RetTxIdx = TxIdx;
+- //
+- // Update Tx index
+- //
+- INC_RING_INDEX(TxIdx, TX_RING_SIZE);
+- pTxRing->TxCpuIdx = TxIdx;
+-
+- *FreeNumber -= 1;
+-
+- return RetTxIdx;
+-}
+-
+-
+-USHORT RtmpPCI_WriteMultiTxResource(
+- IN PRTMP_ADAPTER pAd,
+- IN TX_BLK *pTxBlk,
+- IN UCHAR frameNum,
+- OUT USHORT *FreeNumber)
+-{
+- BOOLEAN bIsLast;
+- UCHAR *pDMAHeaderBufVA;
+- USHORT TxIdx, RetTxIdx;
+- PTXD_STRUC pTxD;
+- UINT32 BufBasePaLow;
+- PRTMP_TX_RING pTxRing;
+- USHORT hwHdrLen;
+- UINT32 firstDMALen;
+-
+- bIsLast = ((frameNum == (pTxBlk->TotalFrameNum - 1)) ? 1 : 0);
+-
+- //
+- // get Tx Ring Resource
+- //
+- pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
+- TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
+- pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
+- BufBasePaLow = RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
+-
+- if (frameNum == 0)
+- {
+- // copy TXINFO + TXWI + WLAN Header + LLC into DMA Header Buffer
+- if (pTxBlk->TxFrameType == TX_AMSDU_FRAME)
+- //hwHdrLen = ROUND_UP(pTxBlk->MpduHeaderLen-LENGTH_AMSDU_SUBFRAMEHEAD, 4)+LENGTH_AMSDU_SUBFRAMEHEAD;
+- hwHdrLen = pTxBlk->MpduHeaderLen - LENGTH_AMSDU_SUBFRAMEHEAD + pTxBlk->HdrPadLen + LENGTH_AMSDU_SUBFRAMEHEAD;
+- else if (pTxBlk->TxFrameType == TX_RALINK_FRAME)
+- //hwHdrLen = ROUND_UP(pTxBlk->MpduHeaderLen-LENGTH_ARALINK_HEADER_FIELD, 4)+LENGTH_ARALINK_HEADER_FIELD;
+- hwHdrLen = pTxBlk->MpduHeaderLen - LENGTH_ARALINK_HEADER_FIELD + pTxBlk->HdrPadLen + LENGTH_ARALINK_HEADER_FIELD;
+- else
+- //hwHdrLen = ROUND_UP(pTxBlk->MpduHeaderLen, 4);
+- hwHdrLen = pTxBlk->MpduHeaderLen + pTxBlk->HdrPadLen;
+-
+- firstDMALen = TXINFO_SIZE + TXWI_SIZE + hwHdrLen;
+- }
+- else
+- {
+- firstDMALen = pTxBlk->MpduHeaderLen;
+- }
+-
+- NdisMoveMemory(pDMAHeaderBufVA, pTxBlk->HeaderBuf, firstDMALen);
+-
+- pTxRing->Cell[TxIdx].pNdisPacket = pTxBlk->pPacket;
+- pTxRing->Cell[TxIdx].pNextNdisPacket = NULL;
+-
+- //
+- // build Tx Descriptor
+- //
+- pTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
+-
+- NdisZeroMemory(pTxD, TXD_SIZE);
+-
+- pTxD->SDPtr0 = BufBasePaLow;
+- pTxD->SDLen0 = firstDMALen; // include padding
+- pTxD->SDPtr1 = PCI_MAP_SINGLE(pAd, pTxBlk, 0, 1, PCI_DMA_TODEVICE);;
+- pTxD->SDLen1 = pTxBlk->SrcBufLen;
+- pTxD->LastSec0 = 0;
+- pTxD->LastSec1 = (bIsLast) ? 1 : 0;
+-
+- RTMPWriteTxDescriptor(pAd, pTxD, FALSE, FIFO_EDCA);
+-
+- RetTxIdx = TxIdx;
+- //
+- // Update Tx index
+- //
+- INC_RING_INDEX(TxIdx, TX_RING_SIZE);
+- pTxRing->TxCpuIdx = TxIdx;
+-
+- *FreeNumber -= 1;
+-
+- return RetTxIdx;
+-
+-}
+-
+-
+-VOID RtmpPCI_FinalWriteTxResource(
+- IN PRTMP_ADAPTER pAd,
+- IN TX_BLK *pTxBlk,
+- IN USHORT totalMPDUSize,
+- IN USHORT FirstTxIdx)
+-{
+-
+- PTXWI_STRUC pTxWI;
+- PRTMP_TX_RING pTxRing;
+-
+- //
+- // get Tx Ring Resource
+- //
+- pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
+- pTxWI = (PTXWI_STRUC) pTxRing->Cell[FirstTxIdx].DmaBuf.AllocVa;
+- pTxWI->MPDUtotalByteCount = totalMPDUSize;
+-}
+-
+-
+-VOID RtmpPCIDataLastTxIdx(
+- IN PRTMP_ADAPTER pAd,
+- IN UCHAR QueIdx,
+- IN USHORT LastTxIdx)
+-{
+- PTXD_STRUC pTxD;
+- PRTMP_TX_RING pTxRing;
+-
+- //
+- // get Tx Ring Resource
+- //
+- pTxRing = &pAd->TxRing[QueIdx];
+-
+- //
+- // build Tx Descriptor
+- //
+- pTxD = (PTXD_STRUC) pTxRing->Cell[LastTxIdx].AllocVa;
+-
+- pTxD->LastSec1 = 1;
+-}
+-
+-
+-USHORT RtmpPCI_WriteFragTxResource(
+- IN PRTMP_ADAPTER pAd,
+- IN TX_BLK *pTxBlk,
+- IN UCHAR fragNum,
+- OUT USHORT *FreeNumber)
+-{
+- UCHAR *pDMAHeaderBufVA;
+- USHORT TxIdx, RetTxIdx;
+- PTXD_STRUC pTxD;
+- UINT32 BufBasePaLow;
+- PRTMP_TX_RING pTxRing;
+- USHORT hwHeaderLen;
+- UINT32 firstDMALen;
+-
+- //
+- // Get Tx Ring Resource
+- //
+- pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
+- TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
+- pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
+- BufBasePaLow = RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
+-
+- //
+- // Copy TXINFO + TXWI + WLAN Header + LLC into DMA Header Buffer
+- //
+- hwHeaderLen = pTxBlk->MpduHeaderLen + pTxBlk->HdrPadLen;
+-
+- firstDMALen = TXINFO_SIZE + TXWI_SIZE + hwHeaderLen;
+- NdisMoveMemory(pDMAHeaderBufVA, pTxBlk->HeaderBuf, firstDMALen);
+-
+-
+- //
+- // Build Tx Descriptor
+- //
+- pTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
+-
+- NdisZeroMemory(pTxD, TXD_SIZE);
+-
+- if (fragNum == pTxBlk->TotalFragNum)
+- {
+- pTxRing->Cell[TxIdx].pNdisPacket = pTxBlk->pPacket;
+- pTxRing->Cell[TxIdx].pNextNdisPacket = NULL;
+- }
+-
+- pTxD->SDPtr0 = BufBasePaLow;
+- pTxD->SDLen0 = firstDMALen; // include padding
+- pTxD->SDPtr1 = PCI_MAP_SINGLE(pAd, pTxBlk, 0, 1, PCI_DMA_TODEVICE);
+- pTxD->SDLen1 = pTxBlk->SrcBufLen;
+- pTxD->LastSec0 = 0;
+- pTxD->LastSec1 = 1;
+-
+- RTMPWriteTxDescriptor(pAd, pTxD, FALSE, FIFO_EDCA);
+-
+- RetTxIdx = TxIdx;
+- pTxBlk->Priv += pTxBlk->SrcBufLen;
+-
+- //
+- // Update Tx index
+- //
+- INC_RING_INDEX(TxIdx, TX_RING_SIZE);
+- pTxRing->TxCpuIdx = TxIdx;
+-
+- *FreeNumber -= 1;
+-
+- return RetTxIdx;
+-
+-}
+-
+-/*
+- Must be run in Interrupt context
+- This function handle PCI specific TxDesc and cpu index update and kick the packet out.
+- */
+-int RtmpPCIMgmtKickOut(
+- IN RTMP_ADAPTER *pAd,
+- IN UCHAR QueIdx,
+- IN PNDIS_PACKET pPacket,
+- IN PUCHAR pSrcBufVA,
+- IN UINT SrcBufLen)
+-{
+- PTXD_STRUC pTxD;
+- ULONG SwIdx = pAd->MgmtRing.TxCpuIdx;
+-
+- pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[SwIdx].AllocVa;
+- if (!pTxD)
+- return 0;
+-
+- pAd->MgmtRing.Cell[SwIdx].pNdisPacket = pPacket;
+- pAd->MgmtRing.Cell[SwIdx].pNextNdisPacket = NULL;
+-
+- RTMPWriteTxDescriptor(pAd, pTxD, TRUE, FIFO_MGMT);
+- pTxD->LastSec0 = 1;
+- pTxD->LastSec1 = 1;
+- pTxD->DMADONE = 0;
+- pTxD->SDLen1 = 0;
+- pTxD->SDPtr0 = PCI_MAP_SINGLE(pAd, pSrcBufVA, SrcBufLen, 0, PCI_DMA_TODEVICE);;
+- pTxD->SDLen0 = SrcBufLen;
+-
+- pAd->RalinkCounters.KickTxCount++;
+- pAd->RalinkCounters.OneSecTxDoneCount++;
+-
+- // Increase TX_CTX_IDX, but write to register later.
+- INC_RING_INDEX(pAd->MgmtRing.TxCpuIdx, MGMT_RING_SIZE);
+-
+- RTMP_IO_WRITE32(pAd, TX_MGMTCTX_IDX, pAd->MgmtRing.TxCpuIdx);
+-
+- return 0;
+-}
+-
+-/*
+- ========================================================================
+-
+- Routine Description:
+- Check Rx descriptor, return NDIS_STATUS_FAILURE if any error dound
+-
+- Arguments:
+- pRxD Pointer to the Rx descriptor
+-
+- Return Value:
+- NDIS_STATUS_SUCCESS No err
+- NDIS_STATUS_FAILURE Error
+-
+- Note:
+-
+- ========================================================================
+-*/
+-NDIS_STATUS RTMPCheckRxError(
+- IN PRTMP_ADAPTER pAd,
+- IN PHEADER_802_11 pHeader,
+- IN PRXWI_STRUC pRxWI,
+- IN PRT28XX_RXD_STRUC pRxD)
+-{
+- PCIPHER_KEY pWpaKey;
+- INT dBm;
+-
+- // Phy errors & CRC errors
+- if (/*(pRxD->PhyErr) ||*/ (pRxD->Crc))
+- {
+- // Check RSSI for Noise Hist statistic collection.
+- dBm = (INT) (pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta;
+- if (dBm <= -87)
+- pAd->StaCfg.RPIDensity[0] += 1;
+- else if (dBm <= -82)
+- pAd->StaCfg.RPIDensity[1] += 1;
+- else if (dBm <= -77)
+- pAd->StaCfg.RPIDensity[2] += 1;
+- else if (dBm <= -72)
+- pAd->StaCfg.RPIDensity[3] += 1;
+- else if (dBm <= -67)
+- pAd->StaCfg.RPIDensity[4] += 1;
+- else if (dBm <= -62)
+- pAd->StaCfg.RPIDensity[5] += 1;
+- else if (dBm <= -57)
+- pAd->StaCfg.RPIDensity[6] += 1;
+- else if (dBm > -57)
+- pAd->StaCfg.RPIDensity[7] += 1;
+-
+- return(NDIS_STATUS_FAILURE);
+- }
+-
+- // Add Rx size to channel load counter, we should ignore error counts
+- pAd->StaCfg.CLBusyBytes += (pRxD->SDL0 + 14);
+-
+- // Drop ToDs promiscous frame, it is opened due to CCX 2 channel load statistics
+- if (pHeader != NULL)
+- {
+- if (pHeader->FC.ToDs)
+- {
+- return(NDIS_STATUS_FAILURE);
+- }
+- }
+-
+- // Drop not U2M frames, cant's drop here because we will drop beacon in this case
+- // I am kind of doubting the U2M bit operation
+- // if (pRxD->U2M == 0)
+- // return(NDIS_STATUS_FAILURE);
+-
+- // drop decyption fail frame
+- if (pRxD->CipherErr)
+- {
+- if (pRxD->CipherErr == 2)
+- {DBGPRINT_RAW(RT_DEBUG_TRACE,("pRxD ERROR: ICV ok but MICErr "));}
+- else if (pRxD->CipherErr == 1)
+- {DBGPRINT_RAW(RT_DEBUG_TRACE,("pRxD ERROR: ICV Err "));}
+- else if (pRxD->CipherErr == 3)
+- DBGPRINT_RAW(RT_DEBUG_TRACE,("pRxD ERROR: Key not valid "));
+-
+- if (((pRxD->CipherErr & 1) == 1) && pAd->CommonCfg.bWirelessEvent && INFRA_ON(pAd))
+- RTMPSendWirelessEvent(pAd, IW_ICV_ERROR_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
+-
+- DBGPRINT_RAW(RT_DEBUG_TRACE,(" %d (len=%d, Mcast=%d, MyBss=%d, Wcid=%d, KeyId=%d)\n",
+- pRxD->CipherErr,
+- pRxD->SDL0,
+- pRxD->Mcast | pRxD->Bcast,
+- pRxD->MyBss,
+- pRxWI->WirelessCliID,
+- pRxWI->KeyIndex));
+-
+- //
+- // MIC Error
+- //
+- if (pRxD->CipherErr == 2)
+- {
+- pWpaKey = &pAd->SharedKey[BSS0][pRxWI->KeyIndex];
+-
+- if (pAd->StaCfg.WpaSupplicantUP)
+- WpaSendMicFailureToWpaSupplicant(pAd,
+- (pWpaKey->Type == PAIRWISEKEY) ? TRUE:FALSE);
+- else
+- RTMPReportMicError(pAd, pWpaKey);
+-
+- if (((pRxD->CipherErr & 2) == 2) && pAd->CommonCfg.bWirelessEvent && INFRA_ON(pAd))
+- RTMPSendWirelessEvent(pAd, IW_MIC_ERROR_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
+-
+- DBGPRINT_RAW(RT_DEBUG_ERROR,("Rx MIC Value error\n"));
+- }
+-
+- if (pHeader == NULL)
+- return(NDIS_STATUS_SUCCESS);
+-
+- return(NDIS_STATUS_FAILURE);
+- }
+-
+- return(NDIS_STATUS_SUCCESS);
+-}
+-
+-/*
+- ==========================================================================
+- Description:
+- This routine sends command to firmware and turn our chip to power save mode.
+- Both RadioOff and .11 power save function needs to call this routine.
+- Input:
+- Level = GUIRADIO_OFF : GUI Radio Off mode
+- Level = DOT11POWERSAVE : 802.11 power save mode
+- Level = RTMP_HALT : When Disable device.
+-
+- ==========================================================================
+- */
+-VOID RT28xxPciAsicRadioOff(
+- IN PRTMP_ADAPTER pAd,
+- IN UCHAR Level,
+- IN USHORT TbttNumToNextWakeUp)
+-{
+- WPDMA_GLO_CFG_STRUC DmaCfg;
+- UCHAR i, tempBBP_R3 = 0;
+- BOOLEAN brc = FALSE, Cancelled;
+- UINT32 TbTTTime = 0;
+- UINT32 PsPollTime = 0, MACValue;
+- ULONG BeaconPeriodTime;
+- UINT32 RxDmaIdx, RxCpuIdx;
+- DBGPRINT(RT_DEBUG_TRACE, ("AsicRadioOff ===> TxCpuIdx = %d, TxDmaIdx = %d. RxCpuIdx = %d, RxDmaIdx = %d.\n", pAd->TxRing[0].TxCpuIdx, pAd->TxRing[0].TxDmaIdx, pAd->RxRing.RxCpuIdx, pAd->RxRing.RxDmaIdx));
+-
+- // Check Rx DMA busy status, if more than half is occupied, give up this radio off.
+- RTMP_IO_READ32(pAd, RX_DRX_IDX , &RxDmaIdx);
+- RTMP_IO_READ32(pAd, RX_CRX_IDX , &RxCpuIdx);
+- if ((RxDmaIdx > RxCpuIdx) && ((RxDmaIdx - RxCpuIdx) > RX_RING_SIZE/3))
+- {
+- DBGPRINT(RT_DEBUG_TRACE, ("AsicRadioOff ===> return1. RxDmaIdx = %d , RxCpuIdx = %d. \n", RxDmaIdx, RxCpuIdx));
+- return;
+- }
+- else if ((RxCpuIdx >= RxDmaIdx) && ((RxCpuIdx - RxDmaIdx) < RX_RING_SIZE/3))
+- {
+- DBGPRINT(RT_DEBUG_TRACE, ("AsicRadioOff ===> return2. RxCpuIdx = %d. RxDmaIdx = %d , \n", RxCpuIdx, RxDmaIdx));
+- return;
+- }
+-
+- // Once go into this function, disable tx because don't want too many packets in queue to prevent HW stops.
+- RTMP_SET_PSFLAG(pAd, fRTMP_PS_DISABLE_TX);
+-
+- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+- {
+- RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled);
+- RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
+-
+- if (Level == DOT11POWERSAVE)
+- {
+- RTMP_IO_READ32(pAd, TBTT_TIMER, &TbTTTime);
+- TbTTTime &= 0x1ffff;
+- // 00. check if need to do sleep in this DTIM period. If next beacon will arrive within 30ms , ...doesn't necessarily sleep.
+- // TbTTTime uint = 64us, LEAD_TIME unit = 1024us, PsPollTime unit = 1ms
+- if (((64*TbTTTime) <((LEAD_TIME*1024) + 40000)) && (TbttNumToNextWakeUp == 0))
+- {
+- DBGPRINT(RT_DEBUG_TRACE, ("TbTTTime = 0x%x , give up this sleep. \n", TbTTTime));
+- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
+- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_DISABLE_TX);
+- return;
+- }
+- else
+- {
+- PsPollTime = (64*TbTTTime- LEAD_TIME*1024)/1000;
+- PsPollTime -= 3;
+-
+- BeaconPeriodTime = pAd->CommonCfg.BeaconPeriod*102/100;
+- if (TbttNumToNextWakeUp > 0)
+- PsPollTime += ((TbttNumToNextWakeUp -1) * BeaconPeriodTime);
+-
+- pAd->Mlme.bPsPollTimerRunning = TRUE;
+- RTMPSetTimer(&pAd->Mlme.PsPollTimer, PsPollTime);
+- }
+- }
+- }
+-
+- // 0. Disable Tx DMA.
+- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &DmaCfg.word);
+- DmaCfg.field.EnableTxDMA = 0;
+- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, DmaCfg.word);
+-
+- // 1. Wait DMA not busy
+- i = 0;
+- do
+- {
+- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &DmaCfg.word);
+- if ((DmaCfg.field.TxDMABusy == 0) && (DmaCfg.field.RxDMABusy == 0))
+- break;
+- RTMPusecDelay(20);
+- i++;
+- }while(i < 50);
+-
+- if (i >= 50)
+- {
+- DBGPRINT(RT_DEBUG_TRACE, ("DMA keeps busy. return on RT28xxPciAsicRadioOff ()\n"));
+- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &DmaCfg.word);
+- DmaCfg.field.EnableTxDMA = 1;
+- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, DmaCfg.word);
+- pAd->CheckDmaBusyCount++;
+- return;
+- }
+- else
+- {
+- pAd->CheckDmaBusyCount = 0;
+- }
+-
+- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
+-
+- // Set to 1R.
+- if (pAd->Antenna.field.RxPath > 1)
+- {
+- tempBBP_R3 = (pAd->StaCfg.BBPR3 & 0xE7);
+- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, tempBBP_R3);
+- }
+-
+- // In Radio Off, we turn off RF clk, So now need to call ASICSwitchChannel again.
+- if (INFRA_ON(pAd) && (pAd->CommonCfg.CentralChannel != pAd->CommonCfg.Channel)
+- && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40))
+- {
+- // Must using 40MHz.
+- AsicTurnOffRFClk(pAd, pAd->CommonCfg.CentralChannel);
+- }
+- else
+- {
+- // Must using 20MHz.
+- AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel);
+- }
+-
+- if (Level != RTMP_HALT)
+- {
+- // Change Interrupt bitmask.
+- RTMP_IO_WRITE32(pAd, INT_MASK_CSR, AutoWakeupInt);
+- }
+- else
+- {
+- NICDisableInterrupt(pAd);
+- }
+-
+- RTMP_IO_WRITE32(pAd, RX_CRX_IDX, pAd->RxRing.RxCpuIdx);
+- // Disable MAC Rx
+- RTMP_IO_READ32(pAd, MAC_SYS_CTRL , &MACValue);
+- MACValue &= 0xf7;
+- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL , MACValue);
+-
+- // 2. Send Sleep command
+- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_STATUS, 0xffffffff);
+- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CID, 0xffffffff);
+- // send POWER-SAVE command to MCU. high-byte = 1 save power as much as possible. high byte = 0 save less power
+- AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x1);
+- // 2-1. Wait command success
+- // Status = 1 : success, Status = 2, already sleep, Status = 3, Maybe MAC is busy so can't finish this task.
+- brc = AsicCheckCommanOk(pAd, PowerSafeCID);
+-
+- if (brc == FALSE)
+- {
+- // try again
+- AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x01); // send POWER-SAVE command to MCU. Timeout unit:40us.
+- //RTMPusecDelay(200);
+- brc = AsicCheckCommanOk(pAd, PowerSafeCID);
+- }
+-
+- // 3. After 0x30 command is ok, send radio off command. lowbyte = 0 for power safe.
+- // If 0x30 command is not ok this time, we can ignore 0x35 command. It will make sure not cause firmware'r problem.
+- if ((Level == DOT11POWERSAVE) && (brc == TRUE))
+- {
+- AsicSendCommandToMcu(pAd, 0x35, PowerRadioOffCID, 0, 0x00); // lowbyte = 0 means to do power safe, NOT turn off radio.
+- // 3-1. Wait command success
+- AsicCheckCommanOk(pAd, PowerRadioOffCID);
+- }
+- else if (brc == TRUE)
+- {
+- AsicSendCommandToMcu(pAd, 0x35, PowerRadioOffCID, 1, 0x00); // lowbyte = 0 means to do power safe, NOT turn off radio.
+- // 3-1. Wait command success
+- AsicCheckCommanOk(pAd, PowerRadioOffCID);
+- }
+-
+- // Wait DMA not busy
+- i = 0;
+- do
+- {
+- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &DmaCfg.word);
+- if ((DmaCfg.field.RxDMABusy == 0) && (DmaCfg.field.TxDMABusy == 0))
+- break;
+- RTMPusecDelay(20);
+- i++;
+- }while(i < 50);
+-
+- if (i >= 50)
+- {
+- pAd->CheckDmaBusyCount++;
+- DBGPRINT(RT_DEBUG_TRACE, ("DMA Rx keeps busy. on RT28xxPciAsicRadioOff ()\n"));
+- }
+- else
+- {
+- pAd->CheckDmaBusyCount = 0;
+- }
+-
+- if (Level == DOT11POWERSAVE)
+- {
+- AUTO_WAKEUP_STRUC AutoWakeupCfg;
+- //RTMPSetTimer(&pAd->Mlme.PsPollTimer, 90);
+-
+- // we have decided to SLEEP, so at least do it for a BEACON period.
+- if (TbttNumToNextWakeUp == 0)
+- TbttNumToNextWakeUp = 1;
+-
+- AutoWakeupCfg.word = 0;
+- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+-
+- // 1. Set auto wake up timer.
+- AutoWakeupCfg.field.NumofSleepingTbtt = TbttNumToNextWakeUp - 1;
+- AutoWakeupCfg.field.EnableAutoWakeup = 1;
+- AutoWakeupCfg.field.AutoLeadTime = LEAD_TIME;
+- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+- }
+-
+- // 4-1. If it's to disable our device. Need to restore PCI Configuration Space to its original value.
+- if (Level == RTMP_HALT)
+- {
+- if ((brc == TRUE) && (i < 50))
+- RTMPPCIeLinkCtrlSetting(pAd, 0);
+- }
+- // 4. Set PCI configuration Space Link Comtrol fields. Only Radio Off needs to call this function
+- else
+- {
+- if ((brc == TRUE) && (i < 50))
+- RTMPPCIeLinkCtrlSetting(pAd, 3);
+- }
+-
+- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_DISABLE_TX);
+-}
+-
+-
+-/*
+- ==========================================================================
+- Description:
+- This routine sends command to firmware and turn our chip to wake up mode from power save mode.
+- Both RadioOn and .11 power save function needs to call this routine.
+- Input:
+- Level = GUIRADIO_OFF : call this function is from Radio Off to Radio On. Need to restore PCI host value.
+- Level = other value : normal wake up function.
+-
+- ==========================================================================
+- */
+-BOOLEAN RT28xxPciAsicRadioOn(
+- IN PRTMP_ADAPTER pAd,
+- IN UCHAR Level)
+-{
+- WPDMA_GLO_CFG_STRUC DmaCfg;
+- BOOLEAN Cancelled, brv = TRUE;
+- UINT32 MACValue;
+-
+- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+- {
+- pAd->Mlme.bPsPollTimerRunning = FALSE;
+- RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
+- if ((Level == GUIRADIO_OFF) || (Level == GUI_IDLE_POWER_SAVE)
+- || (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)))
+- {
+- DBGPRINT(RT_DEBUG_TRACE, ("RT28xxPciAsicRadioOn ()\n"));
+- // 1. Set PCI Link Control in Configuration Space.
+- RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_WAKEUP);
+- RTMPusecDelay(6000);
+- }
+- }
+-
+- pAd->bPCIclkOff = FALSE;
+- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0x3a80);
+- // 2. Send wake up command.
+- AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x02);
+-
+- // 2-1. wait command ok.
+- brv = AsicCheckCommanOk(pAd, PowerWakeCID);
+- if (brv)
+- {
+- NICEnableInterrupt(pAd);
+-
+- // 3. Enable Tx DMA.
+- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &DmaCfg.word);
+- DmaCfg.field.EnableTxDMA = 1;
+- DmaCfg.field.EnableRxDMA = 1;
+- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, DmaCfg.word);
+-
+- // Eable MAC Rx
+- RTMP_IO_READ32(pAd, MAC_SYS_CTRL , &MACValue);
+- MACValue |= 0x8;
+- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL , MACValue);
+-
+- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
+- if (Level == GUI_IDLE_POWER_SAVE)
+- {
+- // In Radio Off, we turn off RF clk, So now need to call ASICSwitchChannel again.
+- if (INFRA_ON(pAd) && (pAd->CommonCfg.CentralChannel != pAd->CommonCfg.Channel)
+- && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40))
+- {
+- // Must using 40MHz.
+- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
+- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
+- }
+- else
+- {
+- // Must using 20MHz.
+- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
+- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
+- }
+- }
+- return TRUE;
+- }
+- else
+- return FALSE;
+-}
+-
+-VOID RT28xxPciStaAsicForceWakeup(
+- IN PRTMP_ADAPTER pAd,
+- IN UCHAR Level)
+-{
+- AUTO_WAKEUP_STRUC AutoWakeupCfg;
+-
+- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WAKEUP_NOW))
+- {
+- DBGPRINT(RT_DEBUG_TRACE, ("waking up now!\n"));
+- return;
+- }
+-
+- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_WAKEUP_NOW);
+- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW);
+-
+- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+- {
+- // Support PCIe Advance Power Save
+- if (((Level == FROM_TX) && (pAd->Mlme.bPsPollTimerRunning == TRUE)) ||
+- (Level == RTMP_HALT))
+- {
+- pAd->Mlme.bPsPollTimerRunning = FALSE;
+- RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_WAKEUP);
+- RTMPusecDelay(5000);
+- DBGPRINT(RT_DEBUG_TRACE, ("=======AsicForceWakeup===bFromTx\n"));
+- }
+-
+- AutoWakeupCfg.word = 0;
+- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+-
+- // If this is called from Halt. ALWAYS force wakeup!
+- if (Level == RTMP_HALT)
+- {
+- RT28xxPciAsicRadioOn(pAd, RTMP_HALT);
+- }
+- else
+- {
+- if (RT28xxPciAsicRadioOn(pAd, DOT11POWERSAVE))
+- {
+- // In Radio Off, we turn off RF clk, So now need to call ASICSwitchChannel again.
+- if (INFRA_ON(pAd) && (pAd->CommonCfg.CentralChannel != pAd->CommonCfg.Channel)
+- && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40))
+- {
+- // Must using 40MHz.
+- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
+- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
+- }
+- else
+- {
+- // Must using 20MHz.
+- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
+- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
+- }
+- }
+- }
+- }
+- else
+- {
+- // PCI, 2860-PCIe
+- AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x00);
+- AutoWakeupCfg.word = 0;
+- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+- }
+-
+- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
+- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_WAKEUP_NOW);
+- DBGPRINT(RT_DEBUG_TRACE, ("<=======RT28xxPciStaAsicForceWakeup\n"));
+-}
+-
+-VOID RT28xxPciStaAsicSleepThenAutoWakeup(
+- IN PRTMP_ADAPTER pAd,
+- IN USHORT TbttNumToNextWakeUp)
+-{
+- if (pAd->StaCfg.bRadio == FALSE)
+- {
+- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
+- return;
+- }
+- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+- {
+- ULONG Now = 0;
+- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WAKEUP_NOW))
+- {
+- DBGPRINT(RT_DEBUG_TRACE, ("waking up now!\n"));
+- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
+- return;
+- }
+-
+- NdisGetSystemUpTime(&Now);
+- // If last send NULL fram time is too close to this receiving beacon (within 8ms), don't go to sleep for this DTM.
+- // Because Some AP can't queuing outgoing frames immediately.
+- if (((pAd->Mlme.LastSendNULLpsmTime + 8) >= Now) && (pAd->Mlme.LastSendNULLpsmTime <= Now))
+- {
+- DBGPRINT(RT_DEBUG_TRACE, ("Now = %lu, LastSendNULLpsmTime=%lu : RxCountSinceLastNULL = %lu. \n", Now, pAd->Mlme.LastSendNULLpsmTime, pAd->RalinkCounters.RxCountSinceLastNULL));
+- return;
+- }
+- else if ((pAd->RalinkCounters.RxCountSinceLastNULL > 0) && ((pAd->Mlme.LastSendNULLpsmTime + pAd->CommonCfg.BeaconPeriod) >= Now))
+- {
+- DBGPRINT(RT_DEBUG_TRACE, ("Now = %lu, LastSendNULLpsmTime=%lu: RxCountSinceLastNULL = %lu > 0 \n", Now, pAd->Mlme.LastSendNULLpsmTime, pAd->RalinkCounters.RxCountSinceLastNULL));
+- return;
+- }
+-
+- RT28xxPciAsicRadioOff(pAd, DOT11POWERSAVE, TbttNumToNextWakeUp);
+- }
+- else
+- {
+- AUTO_WAKEUP_STRUC AutoWakeupCfg;
+- // we have decided to SLEEP, so at least do it for a BEACON period.
+- if (TbttNumToNextWakeUp == 0)
+- TbttNumToNextWakeUp = 1;
+-
+- AutoWakeupCfg.word = 0;
+- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+- AutoWakeupCfg.field.NumofSleepingTbtt = TbttNumToNextWakeUp - 1;
+- AutoWakeupCfg.field.EnableAutoWakeup = 1;
+- AutoWakeupCfg.field.AutoLeadTime = 5;
+- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+- AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x00); // send POWER-SAVE command to MCU. Timeout 40us.
+- DBGPRINT(RT_DEBUG_TRACE, ("<-- %s, TbttNumToNextWakeUp=%d \n", __func__, TbttNumToNextWakeUp));
+- }
+- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_DOZE);
+-}
+-
+-VOID PsPollWakeExec(
+- IN PVOID SystemSpecific1,
+- IN PVOID FunctionContext,
+- IN PVOID SystemSpecific2,
+- IN PVOID SystemSpecific3)
+-{
+- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
+- unsigned long flags;
+-
+- DBGPRINT(RT_DEBUG_TRACE,("-->PsPollWakeExec \n"));
+- RTMP_INT_LOCK(&pAd->irq_lock, flags);
+- if (pAd->Mlme.bPsPollTimerRunning)
+- {
+- RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_WAKEUP);
+- }
+- pAd->Mlme.bPsPollTimerRunning = FALSE;
+- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
+-}
+-
+-VOID RadioOnExec(
+- IN PVOID SystemSpecific1,
+- IN PVOID FunctionContext,
+- IN PVOID SystemSpecific2,
+- IN PVOID SystemSpecific3)
+-{
+- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
+- WPDMA_GLO_CFG_STRUC DmaCfg;
+- BOOLEAN Cancelled;
+-
+- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
+- {
+- DBGPRINT(RT_DEBUG_TRACE,("-->RadioOnExec() return on fOP_STATUS_DOZE == TRUE; \n"));
+- RTMPSetTimer(&pAd->Mlme.RadioOnOffTimer, 10);
+- return;
+- }
+-
+- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
+- {
+- DBGPRINT(RT_DEBUG_TRACE,("-->RadioOnExec() return on SCAN_IN_PROGRESS; \n"));
+- RTMPSetTimer(&pAd->Mlme.RadioOnOffTimer, 10);
+- return;
+- }
+- pAd->Mlme.bPsPollTimerRunning = FALSE;
+- RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
+- if (pAd->StaCfg.bRadio == TRUE)
+- {
+- pAd->bPCIclkOff = FALSE;
+- RTMPRingCleanUp(pAd, QID_AC_BK);
+- RTMPRingCleanUp(pAd, QID_AC_BE);
+- RTMPRingCleanUp(pAd, QID_AC_VI);
+- RTMPRingCleanUp(pAd, QID_AC_VO);
+- RTMPRingCleanUp(pAd, QID_HCCA);
+- RTMPRingCleanUp(pAd, QID_MGMT);
+- RTMPRingCleanUp(pAd, QID_RX);
+-
+- // 2. Send wake up command.
+- AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x02);
+- // 2-1. wait command ok.
+- AsicCheckCommanOk(pAd, PowerWakeCID);
+-
+- // When PCI clock is off, don't want to service interrupt. So when back to clock on, enable interrupt.
+- NICEnableInterrupt(pAd);
+-
+- // 3. Enable Tx DMA.
+- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &DmaCfg.word);
+- DmaCfg.field.EnableTxDMA = 1;
+- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, DmaCfg.word);
+-
+- // In Radio Off, we turn off RF clk, So now need to call ASICSwitchChannel again.
+- if (INFRA_ON(pAd) && (pAd->CommonCfg.CentralChannel != pAd->CommonCfg.Channel)
+- && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40))
+- {
+- // Must using 40MHz.
+- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
+- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
+- }
+- else
+- {
+- // Must using 20MHz.
+- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
+- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
+- }
+-
+- // Clear Radio off flag
+- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
+-
+- // Set LED
+- RTMPSetLED(pAd, LED_RADIO_ON);
+-
+- if (pAd->StaCfg.Psm == PWR_ACTIVE)
+- {
+- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3);
+- }
+- }
+- else
+- {
+- RT28xxPciAsicRadioOff(pAd, GUIRADIO_OFF, 0);
+- }
+-}
+-
+-VOID RT28xxPciMlmeRadioOn(
+- IN PRTMP_ADAPTER pAd)
+-{
+- if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
+- return;
+-
+- DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __func__));
+-
+- if ((pAd->OpMode == OPMODE_AP) ||
+- ((pAd->OpMode == OPMODE_STA) && (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))))
+- {
+- NICResetFromError(pAd);
+-
+- /*
+- RTMPRingCleanUp(pAd, QID_AC_BK);
+- RTMPRingCleanUp(pAd, QID_AC_BE);
+- RTMPRingCleanUp(pAd, QID_AC_VI);
+- RTMPRingCleanUp(pAd, QID_AC_VO);
+- RTMPRingCleanUp(pAd, QID_HCCA);
+- RTMPRingCleanUp(pAd, QID_MGMT);
+- RTMPRingCleanUp(pAd, QID_RX);
+- */
+-
+- // Enable Tx/Rx
+- RTMPEnableRxTx(pAd);
+-
+- // Clear Radio off flag
+- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
+-
+- // Set LED
+- RTMPSetLED(pAd, LED_RADIO_ON);
+- }
+-
+- if ((pAd->OpMode == OPMODE_STA) &&
+- (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)))
+- {
+- BOOLEAN Cancelled;
+-
+- RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_WAKEUP);
+-
+- pAd->Mlme.bPsPollTimerRunning = FALSE;
+- RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
+- RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled);
+- RTMPSetTimer(&pAd->Mlme.RadioOnOffTimer, 10);
+- }
+-}
+-
+-VOID RT28xxPciMlmeRadioOFF(
+- IN PRTMP_ADAPTER pAd)
+-{
+- WPDMA_GLO_CFG_STRUC GloCfg;
+- UINT32 i;
+-
+- if (pAd->StaCfg.bRadio == TRUE)
+- {
+- DBGPRINT(RT_DEBUG_TRACE,("-->MlmeRadioOff() return on bRadio == TRUE; \n"));
+- return;
+- }
+-
+- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
+- return;
+-
+- DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __func__));
+-
+- // Set LED
+- RTMPSetLED(pAd, LED_RADIO_OFF);
+-
+- {
+- BOOLEAN Cancelled;
+-
+- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
+- {
+- RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled);
+- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
+- }
+-
+- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+- {
+- BOOLEAN Cancelled;
+-
+- // Always radio on since the NIC needs to set the MCU command (LED_RADIO_OFF).
+- if ((pAd->OpMode == OPMODE_STA) &&
+- (IDLE_ON(pAd)) &&
+- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
+- {
+- RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE);
+- }
+-
+- pAd->Mlme.bPsPollTimerRunning = FALSE;
+- RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
+- RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled);
+- }
+-
+- // Link down first if any association exists
+- if (INFRA_ON(pAd) || ADHOC_ON(pAd))
+- LinkDown(pAd, FALSE);
+- RTMPusecDelay(10000);
+- //==========================================
+- // Clean up old bss table
+- BssTableInit(&pAd->ScanTab);
+-
+- RTMPRingCleanUp(pAd, QID_AC_BK);
+- RTMPRingCleanUp(pAd, QID_AC_BE);
+- RTMPRingCleanUp(pAd, QID_AC_VI);
+- RTMPRingCleanUp(pAd, QID_AC_VO);
+- RTMPRingCleanUp(pAd, QID_HCCA);
+- RTMPRingCleanUp(pAd, QID_MGMT);
+- RTMPRingCleanUp(pAd, QID_RX);
+-
+- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+- {
+- RTMPSetTimer(&pAd->Mlme.RadioOnOffTimer, 500);
+- return;
+- }
+- }
+-
+- // Set Radio off flag
+- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
+-
+- // Disable Tx/Rx DMA
+- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
+- GloCfg.field.EnableTxDMA = 0;
+- GloCfg.field.EnableRxDMA = 0;
+- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word); // abort all TX rings
+-
+-
+- // MAC_SYS_CTRL => value = 0x0 => 40mA
+- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0);
+-
+- // PWR_PIN_CFG => value = 0x0 => 40mA
+- RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0);
+-
+- // TX_PIN_CFG => value = 0x0 => 20mA
+- RTMP_IO_WRITE32(pAd, TX_PIN_CFG, 0);
+-
+- if (pAd->CommonCfg.BBPCurrentBW == BW_40)
+- {
+- // Must using 40MHz.
+- AsicTurnOffRFClk(pAd, pAd->CommonCfg.CentralChannel);
+- }
+- else
+- {
+- // Must using 20MHz.
+- AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel);
+- }
+-
+- // Waiting for DMA idle
+- i = 0;
+- do
+- {
+- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
+- if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
+- break;
+-
+- RTMPusecDelay(1000);
+- }while (i++ < 100);
+-}
diff --git a/staging/staging-rtl8187se-remove-card8185-variable-to-simplify-flow.patch b/staging/staging-rtl8187se-remove-card8185-variable-to-simplify-flow.patch
new file mode 100644
index 00000000000000..c715915b156d9c
--- /dev/null
+++ b/staging/staging-rtl8187se-remove-card8185-variable-to-simplify-flow.patch
@@ -0,0 +1,569 @@
+From Larry.Finger@lwfinger.net Thu Nov 19 11:55:03 2009
+From: Larry Finger <Larry.Finger@lwfinger.net>
+Date: Mon, 09 Nov 2009 10:53:20 -0600
+Subject: Staging: rtl8187se: Remove card8185 variable to simplify flow
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: Bernhard Schiffner <bernhard@schiffner-limbach.de>
+Message-ID: <4af84900.8X31irYDg1fHCu04%Larry.Finger@lwfinger.net>
+
+
+When this code is used for the rtl8187se, the value of card_8185
+in struct r8180_priv is always 7 or 8. As a result, the program
+flow can be simplified.
+
+Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
+Tested-by: Bernhard Schiffner <bernhard@schiffner-limbach.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/rtl8187se/r8180.h | 17 -
+ drivers/staging/rtl8187se/r8180_core.c | 245 +++++-----------------------
+ drivers/staging/rtl8187se/r8180_dm.c | 1
+ drivers/staging/rtl8187se/r8180_rtl8225z2.c | 44 ++---
+ drivers/staging/rtl8187se/r8185b_init.c | 29 +--
+ 5 files changed, 75 insertions(+), 261 deletions(-)
+
+--- a/drivers/staging/rtl8187se/r8180_core.c
++++ b/drivers/staging/rtl8187se/r8180_core.c
+@@ -886,8 +886,6 @@ void rtl8180_rx_enable(struct net_device
+ rxconf = rxconf | (1<<ACCEPT_ALLMAC_FRAME_SHIFT);
+ }else{
+ rxconf = rxconf | (1<<ACCEPT_NICMAC_FRAME_SHIFT);
+- if(priv->card_8185 == 0)
+- rxconf = rxconf | (1<<RX_CHECK_BSSID_SHIFT);
+ }
+
+ if(priv->ieee80211->iw_mode == IW_MODE_MONITOR){
+@@ -910,9 +908,6 @@ void rtl8180_rx_enable(struct net_device
+
+ rxconf = rxconf &~ RCR_CS_MASK;
+
+- if (!priv->card_8185)
+- rxconf |= (priv->rcr_csense<<RCR_CS_SHIFT);
+-
+ write_nic_dword(dev, RX_CONF, rxconf);
+
+ fix_rx_fifo(dev);
+@@ -964,28 +959,19 @@ void rtl8180_tx_enable(struct net_device
+
+ txconf = read_nic_dword(dev, TX_CONF);
+
+- if (priv->card_8185) {
+- byte = read_nic_byte(dev,CW_CONF);
+- byte &= ~(1<<CW_CONF_PERPACKET_CW_SHIFT);
+- byte &= ~(1<<CW_CONF_PERPACKET_RETRY_SHIFT);
+- write_nic_byte(dev, CW_CONF, byte);
+-
+- tx_agc_ctl = read_nic_byte(dev, TX_AGC_CTL);
+- tx_agc_ctl &= ~(1<<TX_AGC_CTL_PERPACKET_GAIN_SHIFT);
+- tx_agc_ctl &= ~(1<<TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT);
+- tx_agc_ctl |=(1<<TX_AGC_CTL_FEEDBACK_ANT);
+- write_nic_byte(dev, TX_AGC_CTL, tx_agc_ctl);
+- write_nic_byte(dev, 0xec, 0x3f); /* Disable early TX */
+- }
+-
+- if (priv->card_8185)
+- txconf = txconf &~ (1<<TCR_PROBE_NOTIMESTAMP_SHIFT);
+- else {
+- if(hwseqnum)
+- txconf= txconf &~ (1<<TX_CONF_HEADER_AUTOICREMENT_SHIFT);
+- else
+- txconf= txconf | (1<<TX_CONF_HEADER_AUTOICREMENT_SHIFT);
+- }
++ byte = read_nic_byte(dev, CW_CONF);
++ byte &= ~(1<<CW_CONF_PERPACKET_CW_SHIFT);
++ byte &= ~(1<<CW_CONF_PERPACKET_RETRY_SHIFT);
++ write_nic_byte(dev, CW_CONF, byte);
++
++ tx_agc_ctl = read_nic_byte(dev, TX_AGC_CTL);
++ tx_agc_ctl &= ~(1<<TX_AGC_CTL_PERPACKET_GAIN_SHIFT);
++ tx_agc_ctl &= ~(1<<TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT);
++ tx_agc_ctl |= (1<<TX_AGC_CTL_FEEDBACK_ANT);
++ write_nic_byte(dev, TX_AGC_CTL, tx_agc_ctl);
++ write_nic_byte(dev, 0xec, 0x3f); /* Disable early TX */
++
++ txconf = txconf & ~(1<<TCR_PROBE_NOTIMESTAMP_SHIFT);
+
+ txconf = txconf &~ TX_LOOPBACK_MASK;
+ txconf = txconf | (TX_LOOPBACK_NONE <<TX_LOOPBACK_SHIFT);
+@@ -995,13 +981,10 @@ void rtl8180_tx_enable(struct net_device
+ txconf = txconf | (priv->retry_rts<<TX_RTSRETRY_SHIFT);
+ txconf = txconf &~ (1<<TX_NOCRC_SHIFT);
+
+- if (priv->card_8185) {
+- if (priv->hw_plcp_len)
+- txconf = txconf &~ TCR_PLCP_LEN;
+- else
+- txconf = txconf | TCR_PLCP_LEN;
+- } else
+- txconf = txconf &~ TCR_SAT;
++ if (priv->hw_plcp_len)
++ txconf = txconf & ~TCR_PLCP_LEN;
++ else
++ txconf = txconf | TCR_PLCP_LEN;
+
+ txconf = txconf &~ TCR_MXDMA_MASK;
+ txconf = txconf | (TCR_MXDMA_2048<<TCR_MXDMA_SHIFT);
+@@ -1720,8 +1703,6 @@ void rtl8180_rx(struct net_device *dev)
+ else
+ quality = 127 - quality;
+ priv->SignalQuality = quality;
+- if(!priv->card_8185)
+- printk("check your card type\n");
+
+ stats.signal = (u8)quality;//priv->wstats.qual.level = priv->SignalStrength;
+ stats.signalstrength = RXAGC;
+@@ -2221,10 +2202,8 @@ short rtl8180_tx(struct net_device *dev,
+ *(tail+6) = 0;
+ *(tail+7) = 0;
+
+- if(priv->card_8185){
+- //FIXME: this should be triggered by HW encryption parameters.
+- *tail |= (1<<15); //no encrypt
+- }
++ /*FIXME: this should be triggered by HW encryption parameters.*/
++ *tail |= (1<<15); /* no encrypt */
+
+ if(remain==len && !descfrag) {
+ ownbit_flag = false; //added by david woo,2007.12.14
+@@ -2266,7 +2245,7 @@ short rtl8180_tx(struct net_device *dev,
+
+ /* hw_plcp_len is not used for rtl8180 chip */
+ /* FIXME */
+- if(priv->card_8185 == 0 || !priv->hw_plcp_len){
++ if (!priv->hw_plcp_len) {
+ duration = rtl8180_len2duration(len, rate, &ext);
+ *(tail+1) = *(tail+1) | ((duration & 0x7fff)<<16);
+ if(ext) *(tail+1) = *(tail+1) |(1<<31); //plcp length extension
+@@ -2355,8 +2334,7 @@ void rtl8180_link_change(struct net_devi
+
+ rtl8180_set_mode(dev, EPROM_CMD_NORMAL);
+
+- if(priv->card_8185)
+- rtl8180_set_chan(dev, priv->chan);
++ rtl8180_set_chan(dev, priv->chan);
+ }
+
+ void rtl8180_rq_tx_ack(struct net_device *dev){
+@@ -2702,8 +2680,6 @@ short rtl8180_init(struct net_device *de
+ struct r8180_priv *priv = ieee80211_priv(dev);
+ u16 word;
+ u16 version;
+- u8 hw_version;
+- //u8 config3;
+ u32 usValue;
+ u16 tmpu16;
+ int i, j;
+@@ -2928,46 +2904,11 @@ short rtl8180_init(struct net_device *de
+
+ priv->InitialGain = 6;
+
+- hw_version =( read_nic_dword(dev, TCR) & TCR_HWVERID_MASK)>>TCR_HWVERID_SHIFT;
++ DMESG("MAC controller is a RTL8187SE b/g");
++ priv->phy_ver = 2;
+
+- switch (hw_version){
+- case HW_VERID_R8185B_B:
+- priv->card_8185 = VERSION_8187S_C;
+- DMESG("MAC controller is a RTL8187SE b/g");
+- priv->phy_ver = 2;
+- break;
+- case HW_VERID_R8185_ABC:
+- DMESG("MAC controller is a RTL8185 b/g");
+- priv->card_8185 = 1;
+- /* you should not find a card with 8225 PHY ver < C*/
+- priv->phy_ver = 2;
+- break;
+- case HW_VERID_R8185_D:
+- DMESG("MAC controller is a RTL8185 b/g (V. D)");
+- priv->card_8185 = 2;
+- /* you should not find a card with 8225 PHY ver < C*/
+- priv->phy_ver = 2;
+- break;
+- case HW_VERID_R8180_ABCD:
+- DMESG("MAC controller is a RTL8180");
+- priv->card_8185 = 0;
+- break;
+- case HW_VERID_R8180_F:
+- DMESG("MAC controller is a RTL8180 (v. F)");
+- priv->card_8185 = 0;
+- break;
+- default:
+- DMESGW("MAC chip not recognized: version %x. Assuming RTL8180",hw_version);
+- priv->card_8185 = 0;
+- break;
+- }
+-
+- if(priv->card_8185){
+- priv->ieee80211->modulation |= IEEE80211_OFDM_MODULATION;
+- priv->ieee80211->short_slot = 1;
+- }
+- /* you should not found any 8185 Ver B Card */
+- priv->card_8185_Bversion = 0;
++ priv->ieee80211->modulation |= IEEE80211_OFDM_MODULATION;
++ priv->ieee80211->short_slot = 1;
+
+ // just for sync 85
+ priv->card_type = PCI;
+@@ -3026,12 +2967,10 @@ short rtl8180_init(struct net_device *de
+ priv->chtxpwr[i]=word & 0xff;
+ priv->chtxpwr[i+1]=(word & 0xff00)>>8;
+ }
+- if(priv->card_8185){
+- for(i=1,j=0; i<14; i+=2,j++){
+- word = eprom_read(dev,EPROM_TXPW_OFDM_CH1_2 + j);
+- priv->chtxpwr_ofdm[i]=word & 0xff;
+- priv->chtxpwr_ofdm[i+1]=(word & 0xff00)>>8;
+- }
++ for (i = 1, j = 0; i < 14; i += 2, j++) {
++ word = eprom_read(dev, EPROM_TXPW_OFDM_CH1_2 + j);
++ priv->chtxpwr_ofdm[i] = word & 0xff;
++ priv->chtxpwr_ofdm[i+1] = (word & 0xff00)>>8;
+ }
+
+ //3Read crystal calibtration and thermal meter indication on 87SE.
+@@ -3057,37 +2996,11 @@ short rtl8180_init(struct net_device *de
+
+ version = eprom_read(dev,EPROM_VERSION);
+ DMESG("EEPROM version %x",version);
+- if( (!priv->card_8185) && version < 0x0101){
+- DMESG ("EEPROM version too old, assuming defaults");
+- DMESG ("If you see this message *plase* send your \
+-DMESG output to andreamrl@tiscali.it THANKS");
+- priv->digphy=1;
+- priv->antb=0;
+- priv->diversity=1;
+- priv->cs_treshold=0xc;
+- priv->rcr_csense=1;
+- priv->rf_chip=RFCHIPID_PHILIPS;
+- }else{
+- if(!priv->card_8185){
+- u8 rfparam = eprom_read(dev,RF_PARAM);
+- DMESG("RfParam: %x",rfparam);
++ priv->rcr_csense = 3;
+
+- priv->digphy = rfparam & (1<<RF_PARAM_DIGPHY_SHIFT) ? 0:1;
+- priv->antb = rfparam & (1<<RF_PARAM_ANTBDEFAULT_SHIFT) ? 1:0;
++ priv->cs_treshold = (eprom_read(dev, ENERGY_TRESHOLD) & 0xff00) >> 8;
+
+- priv->rcr_csense = (rfparam & RF_PARAM_CARRIERSENSE_MASK) >>
+- RF_PARAM_CARRIERSENSE_SHIFT;
+-
+- priv->diversity =
+- (read_nic_byte(dev,CONFIG2)&(1<<CONFIG2_ANTENNA_SHIFT)) ? 1:0;
+- }else{
+- priv->rcr_csense = 3;
+- }
+-
+- priv->cs_treshold = (eprom_read(dev,ENERGY_TRESHOLD)&0xff00) >>8;
+-
+- priv->rf_chip = 0xff & eprom_read(dev,RFCHIPID);
+- }
++ priv->rf_chip = 0xff & eprom_read(dev, RFCHIPID);
+
+ priv->rf_chip = RF_ZEBRA4;
+ priv->rf_sleep = rtl8225z4_rf_sleep;
+@@ -3099,19 +3012,6 @@ DMESG output to andreamrl@tiscali.it THA
+ priv->rf_set_chan = rtl8225z2_rf_set_chan;
+ priv->rf_set_sens = NULL;
+
+- if(!priv->card_8185){
+- if(priv->antb)
+- DMESG ("Antenna B is default antenna");
+- else
+- DMESG ("Antenna A is default antenna");
+-
+- if(priv->diversity)
+- DMESG ("Antenna diversity is enabled");
+- else
+- DMESG("Antenna diversity is disabled");
+-
+- DMESG("Carrier sense %d",priv->rcr_csense);
+- }
+
+ if (0!=alloc_rx_desc_ring(dev, priv->rxbuffersize, priv->rxringcount))
+ return -ENOMEM;
+@@ -3144,17 +3044,6 @@ DMESG output to andreamrl@tiscali.it THA
+ TX_BEACON_RING_ADDR))
+ return -ENOMEM;
+
+- if(!priv->card_8185){
+- if(read_nic_byte(dev, CONFIG0) & (1<<CONFIG0_WEP40_SHIFT))
+- DMESG ("40-bit WEP is supported in hardware");
+- else
+- DMESG ("40-bit WEP is NOT supported in hardware");
+-
+- if(read_nic_byte(dev,CONFIG0) & (1<<CONFIG0_WEP104_SHIFT))
+- DMESG ("104-bit WEP is supported in hardware");
+- else
+- DMESG ("104-bit WEP is NOT supported in hardware");
+- }
+ #if !defined(SA_SHIRQ)
+ if(request_irq(dev->irq, (void *)rtl8180_interrupt, IRQF_SHARED, dev->name, dev)){
+ #else
+@@ -3172,17 +3061,6 @@ DMESG output to andreamrl@tiscali.it THA
+
+ void rtl8180_no_hw_wep(struct net_device *dev)
+ {
+- struct r8180_priv *priv = ieee80211_priv(dev);
+-
+- if (!priv->card_8185) {
+- u8 security;
+-
+- security = read_nic_byte(dev, SECURITY);
+- security &=~(1<<SECURITY_WEP_TX_ENABLE_SHIFT);
+- security &=~(1<<SECURITY_WEP_RX_ENABLE_SHIFT);
+-
+- write_nic_byte(dev, SECURITY, security);
+- }
+ }
+
+ void rtl8180_set_hw_wep(struct net_device *dev)
+@@ -3355,8 +3233,6 @@ void rtl8185_set_rate(struct net_device
+ void rtl8180_adapter_start(struct net_device *dev)
+ {
+ struct r8180_priv *priv = ieee80211_priv(dev);
+- u32 anaparam;
+- u16 word;
+ u8 config3;
+
+ rtl8180_rtx_disable(dev);
+@@ -3384,12 +3260,6 @@ void rtl8180_adapter_start(struct net_de
+
+ rtl8180_update_msr(dev);
+
+- if(!priv->card_8185){
+- anaparam = eprom_read(dev,EPROM_ANAPARAM_ADDRLWORD);
+- anaparam |= eprom_read(dev,EPROM_ANAPARAM_ADDRHWORD)<<16;
+-
+- rtl8180_set_anaparam(dev,anaparam);
+- }
+ /* These might be unnecessary since we do in rx_enable / tx_enable */
+ fix_rx_fifo(dev);
+ fix_tx_fifo(dev);
+@@ -3406,54 +3276,27 @@ void rtl8180_adapter_start(struct net_de
+ CONFIG2, read_nic_byte(dev,CONFIG2) &~\
+ (1<<CONFIG2_DMA_POLLING_MODE_SHIFT));
+ //^the nic isn't in test mode
+- if(priv->card_8185)
+- write_nic_byte(dev,
++ write_nic_byte(dev,
+ CONFIG2, read_nic_byte(dev,CONFIG2)|(1<<4));
+
+ rtl8180_set_mode(dev,EPROM_CMD_NORMAL);
+
+ write_nic_dword(dev,INT_TIMEOUT,0);
+
+- if(!priv->card_8185)
+- {
+- /*
+- experimental - this might be needed to calibrate AGC,
+- anyway it shouldn't hurt
+- */
+- write_nic_byte(dev, CONFIG5,
+- read_nic_byte(dev, CONFIG5) | (1<<AGCRESET_SHIFT));
+- read_nic_byte(dev, CONFIG5);
+- udelay(15);
+- write_nic_byte(dev, CONFIG5,
+- read_nic_byte(dev, CONFIG5) &~ (1<<AGCRESET_SHIFT));
+- }else{
+- write_nic_byte(dev, WPA_CONFIG, 0);
+- //write_nic_byte(dev, TESTR, 0xd);
+- }
++ write_nic_byte(dev, WPA_CONFIG, 0);
+
+ rtl8180_no_hw_wep(dev);
+
+- if(priv->card_8185){
+- rtl8185_set_rate(dev);
+- write_nic_byte(dev, RATE_FALLBACK, 0x81);
+- }else{
+- word = read_nic_word(dev, BRSR);
+- word &= ~BRSR_MBR;
+- word &= ~BRSR_BPLCP;
+- word |= ieeerate2rtlrate(priv->ieee80211->basic_rate);
+- word |= 0x0f;
+- write_nic_word(dev, BRSR, word);
+- }
+-
+- if(priv->card_8185){
+- write_nic_byte(dev, GP_ENABLE,read_nic_byte(dev, GP_ENABLE) & ~(1<<6));
+-
+- //FIXME cfg 3 ClkRun enable - isn't it ReadOnly ?
+- rtl8180_set_mode(dev, EPROM_CMD_CONFIG);
+- write_nic_byte(dev,CONFIG3, read_nic_byte(dev, CONFIG3)
+- | (1 << CONFIG3_CLKRUN_SHIFT));
+- rtl8180_set_mode(dev, EPROM_CMD_NORMAL);
+- }
++ rtl8185_set_rate(dev);
++ write_nic_byte(dev, RATE_FALLBACK, 0x81);
++
++ write_nic_byte(dev, GP_ENABLE, read_nic_byte(dev, GP_ENABLE) & ~(1<<6));
++
++ /*FIXME cfg 3 ClkRun enable - isn't it ReadOnly ? */
++ rtl8180_set_mode(dev, EPROM_CMD_CONFIG);
++ write_nic_byte(dev, CONFIG3, read_nic_byte(dev, CONFIG3)
++ | (1 << CONFIG3_CLKRUN_SHIFT));
++ rtl8180_set_mode(dev, EPROM_CMD_NORMAL);
+
+ priv->rf_init(dev);
+
+--- a/drivers/staging/rtl8187se/r8180_dm.c
++++ b/drivers/staging/rtl8187se/r8180_dm.c
+@@ -197,7 +197,6 @@ DIG_Zebra(
+ { // Advised from SD3 DZ
+ priv->InitialGain = 4; // In 87B, m74dBm means State 4 (m82dBm)
+ }
+- //if(pHalData->VersionID != VERSION_8187B_B)
+ { // Advised from SD3 DZ
+ OfdmFA1 = 0x20;
+ }
+--- a/drivers/staging/rtl8187se/r8180.h
++++ b/drivers/staging/rtl8187se/r8180.h
+@@ -77,21 +77,6 @@ typedef enum _WIRELESS_MODE {
+ WIRELESS_MODE_AUTO = 0x08,
+ } WIRELESS_MODE;
+
+-typedef enum _VERSION_8185{
+- // RTL8185
+- VERSION_8185_UNKNOWN,
+- VERSION_8185_C, // C-cut
+- VERSION_8185_D, // D-cut
+- // RTL8185B
+- VERSION_8185B_B, // B-cut
+- VERSION_8185B_D, // D-cut
+- VERSION_8185B_E, // E-cut
+- //RTL8187S-PCIE
+- VERSION_8187S_B, // B-cut
+- VERSION_8187S_C, // C-cut
+- VERSION_8187S_D, // D-cut
+-
+-}VERSION_8185,*PVERSION_8185;
+ typedef struct ChnlAccessSetting {
+ u16 SIFS_Timer;
+ u16 DIFS_Timer;
+@@ -341,8 +326,6 @@ typedef struct r8180_priv
+ int irq;
+ struct ieee80211_device *ieee80211;
+
+- short card_8185; /* O: rtl8180, 1:rtl8185 V B/C, 2:rtl8185 V D, 3:rtl8185B */
+- short card_8185_Bversion; /* if TCR reports card V B/C this discriminates */
+ short phy_ver; /* meaningful for rtl8225 1:A 2:B 3:C */
+ short enable_gpio0;
+ enum card_type {PCI,MINIPCI,CARDBUS,USB/*rtl8187*/}card_type;
+--- a/drivers/staging/rtl8187se/r8180_rtl8225z2.c
++++ b/drivers/staging/rtl8187se/r8180_rtl8225z2.c
+@@ -445,30 +445,28 @@ s8 DbmToTxPwrIdx(struct r8180_priv *priv
+ * OFDM Power in dBm = Index * 0.5 + 0
+ * CCK Power in dBm = Index * 0.25 + 13
+ */
+- if (priv->card_8185 >= VERSION_8187S_B) {
+- s32 tmp = 0;
++ s32 tmp = 0;
+
+- if (WirelessMode == WIRELESS_MODE_G) {
+- bUseDefault = false;
+- tmp = (2 * PowerInDbm);
+-
+- if (tmp < 0)
+- TxPwrIdx = 0;
+- else if (tmp > 40) /* 40 means 20 dBm. */
+- TxPwrIdx = 40;
+- else
+- TxPwrIdx = (s8)tmp;
+- } else if (WirelessMode == WIRELESS_MODE_B) {
+- bUseDefault = false;
+- tmp = (4 * PowerInDbm) - 52;
+-
+- if(tmp < 0)
+- TxPwrIdx = 0;
+- else if (tmp > 28) /* 28 means 20 dBm. */
+- TxPwrIdx = 28;
+- else
+- TxPwrIdx = (s8)tmp;
+- }
++ if (WirelessMode == WIRELESS_MODE_G) {
++ bUseDefault = false;
++ tmp = (2 * PowerInDbm);
++
++ if (tmp < 0)
++ TxPwrIdx = 0;
++ else if (tmp > 40) /* 40 means 20 dBm. */
++ TxPwrIdx = 40;
++ else
++ TxPwrIdx = (s8)tmp;
++ } else if (WirelessMode == WIRELESS_MODE_B) {
++ bUseDefault = false;
++ tmp = (4 * PowerInDbm) - 52;
++
++ if (tmp < 0)
++ TxPwrIdx = 0;
++ else if (tmp > 28) /* 28 means 20 dBm. */
++ TxPwrIdx = 28;
++ else
++ TxPwrIdx = (s8)tmp;
+ }
+
+ /*
+--- a/drivers/staging/rtl8187se/r8185b_init.c
++++ b/drivers/staging/rtl8187se/r8185b_init.c
+@@ -1023,6 +1023,7 @@ ZEBRA_Config_85BASIC_HardCode(
+ u32 addr,data;
+ u32 u4bRegOffset, u4bRegValue, u4bRF23, u4bRF24;
+ u8 u1b24E;
++ int d_cut = 0;
+
+
+ //=============================================================================
+@@ -1035,8 +1036,10 @@ ZEBRA_Config_85BASIC_HardCode(
+ u4bRF23= RF_ReadReg(dev, 0x08); mdelay(1);
+ u4bRF24= RF_ReadReg(dev, 0x09); mdelay(1);
+
+- if (u4bRF23==0x818 && u4bRF24==0x70C && priv->card_8185 == VERSION_8187S_C)
+- priv->card_8185 = VERSION_8187S_D;
++ if (u4bRF23 == 0x818 && u4bRF24 == 0x70C) {
++ d_cut = 1;
++ printk(KERN_INFO "rtl8187se: card type changed from C- to D-cut\n");
++ }
+
+ // Page0 : reg0-reg15
+
+@@ -1070,18 +1073,9 @@ ZEBRA_Config_85BASIC_HardCode(
+
+ RF_WriteReg(dev, 0x03, 0x0806); mdelay(1);
+
+- if(priv->card_8185 < VERSION_8187S_C)
+- {
+- RF_WriteReg(dev, 0x04, 0x03f7); mdelay(1);
+- RF_WriteReg(dev, 0x05, 0x05ab); mdelay(1);
+- RF_WriteReg(dev, 0x06, 0x00c1); mdelay(1);
+- }
+- else
+- {
+- RF_WriteReg(dev, 0x04, 0x03a7); mdelay(1);
+- RF_WriteReg(dev, 0x05, 0x059b); mdelay(1);
+- RF_WriteReg(dev, 0x06, 0x0081); mdelay(1);
+- }
++ RF_WriteReg(dev, 0x04, 0x03a7); mdelay(1);
++ RF_WriteReg(dev, 0x05, 0x059b); mdelay(1);
++ RF_WriteReg(dev, 0x06, 0x0081); mdelay(1);
+
+
+ RF_WriteReg(dev, 0x07, 0x01A0); mdelay(1);
+@@ -1091,14 +1085,11 @@ ZEBRA_Config_85BASIC_HardCode(
+ RF_WriteReg(dev, 0x0a, 0x0001); mdelay(1);
+ RF_WriteReg(dev, 0x0b, 0x0418); mdelay(1);
+
+- if(priv->card_8185 == VERSION_8187S_D)
+- {
++ if (d_cut) {
+ RF_WriteReg(dev, 0x0c, 0x0fbe); mdelay(1);
+ RF_WriteReg(dev, 0x0d, 0x0008); mdelay(1);
+ RF_WriteReg(dev, 0x0e, 0x0807); mdelay(1); // RX LO buffer
+- }
+- else
+- {
++ } else {
+ RF_WriteReg(dev, 0x0c, 0x0fbe); mdelay(1);
+ RF_WriteReg(dev, 0x0d, 0x0008); mdelay(1);
+ RF_WriteReg(dev, 0x0e, 0x0806); mdelay(1); // RX LO buffer
diff --git a/staging/staging-rtl8187se-remove-card_type.patch b/staging/staging-rtl8187se-remove-card_type.patch
new file mode 100644
index 00000000000000..44df9cad0a12d7
--- /dev/null
+++ b/staging/staging-rtl8187se-remove-card_type.patch
@@ -0,0 +1,196 @@
+From Larry.Finger@lwfinger.net Thu Nov 19 11:55:37 2009
+From: Larry Finger <Larry.Finger@lwfinger.net>
+Date: Tue, 10 Nov 2009 16:44:47 -0600
+Subject: Staging: rtl8187se: Remove card_type
+To: Greg Kroah-Hartman <gregkh@suse.de>, bzolnier@gmail.com
+Message-ID: <4af9ecdf.PFfC9drWlHV20I8E%Larry.Finger@lwfinger.net>
+
+
+The vendor-written driver for the RTL8187SE has a private variable
+for the card type, even though it only occurs in PCI format.
+
+Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/rtl8187se/r8180.h | 1
+ drivers/staging/rtl8187se/r8180_core.c | 9 ----
+ drivers/staging/rtl8187se/r8180_rtl8225z2.c | 53 ++++++----------------------
+ 3 files changed, 13 insertions(+), 50 deletions(-)
+
+--- a/drivers/staging/rtl8187se/r8180_core.c
++++ b/drivers/staging/rtl8187se/r8180_core.c
+@@ -2911,8 +2911,6 @@ short rtl8180_init(struct net_device *de
+ priv->ieee80211->short_slot = 1;
+
+ // just for sync 85
+- priv->card_type = PCI;
+- DMESG("This is a PCI NIC");
+ priv->enable_gpio0 = 0;
+
+ usValue = eprom_read(dev, EEPROM_SW_REVD_OFFSET);
+@@ -3233,7 +3231,6 @@ void rtl8185_set_rate(struct net_device
+ void rtl8180_adapter_start(struct net_device *dev)
+ {
+ struct r8180_priv *priv = ieee80211_priv(dev);
+- u8 config3;
+
+ rtl8180_rtx_disable(dev);
+ rtl8180_reset(dev);
+@@ -3247,12 +3244,6 @@ void rtl8180_adapter_start(struct net_de
+
+ rtl8180_beacon_tx_disable(dev);
+
+- if(priv->card_type == CARDBUS ){
+- config3=read_nic_byte(dev, CONFIG3);
+- write_nic_byte(dev,CONFIG3,config3 | CONFIG3_FuncRegEn);
+- write_nic_word(dev,FEMR, FEMR_INTR | FEMR_WKUP | FEMR_GWAKE |
+- read_nic_word(dev, FEMR));
+- }
+ rtl8180_set_mode(dev, EPROM_CMD_CONFIG);
+ write_nic_dword(dev, MAC0, ((u32*)dev->dev_addr)[0]);
+ write_nic_word(dev, MAC4, ((u32*)dev->dev_addr)[1] & 0xffff );
+--- a/drivers/staging/rtl8187se/r8180.h
++++ b/drivers/staging/rtl8187se/r8180.h
+@@ -328,7 +328,6 @@ typedef struct r8180_priv
+
+ short phy_ver; /* meaningful for rtl8225 1:A 2:B 3:C */
+ short enable_gpio0;
+- enum card_type {PCI,MINIPCI,CARDBUS,USB/*rtl8187*/}card_type;
+ short hw_plcp_len;
+ short plcp_preamble_mode; // 0:auto 1:short 2:long
+
+--- a/drivers/staging/rtl8187se/r8180_rtl8225z2.c
++++ b/drivers/staging/rtl8187se/r8180_rtl8225z2.c
+@@ -23,7 +23,6 @@ static void write_rtl8225(struct net_dev
+ u16 out, select;
+ u8 bit;
+ u32 bangdata = (data << 4) | (adr & 0xf);
+- struct r8180_priv *priv = ieee80211_priv(dev);
+
+ out = read_nic_word(dev, RFPinsOutput) & 0xfff3;
+
+@@ -33,7 +32,7 @@ static void write_rtl8225(struct net_dev
+ select = read_nic_word(dev, RFPinsSelect);
+
+ write_nic_word(dev, RFPinsSelect, select | 0x7 |
+- ((priv->card_type == USB) ? 0 : SW_CONTROL_GPIO));
++ SW_CONTROL_GPIO);
+
+ force_pci_posting(dev);
+ udelay(10);
+@@ -71,16 +70,11 @@ static void write_rtl8225(struct net_dev
+ force_pci_posting(dev);
+ udelay(10);
+
+- write_nic_word(dev, RFPinsOutput, out |
+- ((priv->card_type == USB) ? 4 : BB_HOST_BANG_EN));
++ write_nic_word(dev, RFPinsOutput, out | BB_HOST_BANG_EN);
+
+- write_nic_word(dev, RFPinsSelect, select |
+- ((priv->card_type == USB) ? 0 : SW_CONTROL_GPIO));
++ write_nic_word(dev, RFPinsSelect, select | SW_CONTROL_GPIO);
+
+- if (priv->card_type == USB)
+- mdelay(2);
+- else
+- rtl8185_rf_pins_enable(dev);
++ rtl8185_rf_pins_enable(dev);
+ }
+
+ static const u16 rtl8225bcd_rxgain[] = {
+@@ -174,15 +168,9 @@ static void rtl8225_SetTXPowerLevel(stru
+ u8 cck_power_level = 0xff & priv->chtxpwr[ch];
+ u8 ofdm_power_level = 0xff & priv->chtxpwr_ofdm[ch];
+
+- if (priv->card_type == USB) {
+- max_cck_power_level = 11;
+- max_ofdm_power_level = 25;
+- min_ofdm_power_level = 10;
+- } else {
+- max_cck_power_level = 35;
+- max_ofdm_power_level = 35;
+- min_ofdm_power_level = 0;
+- }
++ max_cck_power_level = 35;
++ max_ofdm_power_level = 35;
++ min_ofdm_power_level = 0;
+
+ if (cck_power_level > max_cck_power_level)
+ cck_power_level = max_cck_power_level;
+@@ -629,8 +617,7 @@ void rtl8225z2_rf_init(struct net_device
+
+ priv->chan = channel;
+
+- if (priv->card_type != USB)
+- rtl8225_host_pci_init(dev);
++ rtl8225_host_pci_init(dev);
+
+ write_nic_dword(dev, RF_TIMING, 0x000a8008);
+
+@@ -653,7 +640,7 @@ void rtl8225z2_rf_init(struct net_device
+ write_rtl8225(dev, 0x4, 0x8c3); mdelay(1);
+ write_rtl8225(dev, 0x5, 0xc72); mdelay(1);
+ write_rtl8225(dev, 0x6, 0xe6); mdelay(1);
+- write_rtl8225(dev, 0x7, ((priv->card_type == USB)? 0x82a : rtl8225_chan[channel])); mdelay(1);
++ write_rtl8225(dev, 0x7, rtl8225_chan[channel]); mdelay(1);
+ write_rtl8225(dev, 0x8, 0x3f); mdelay(1);
+ write_rtl8225(dev, 0x9, 0x335); mdelay(1);
+ write_rtl8225(dev, 0xa, 0x9d4); mdelay(1);
+@@ -679,13 +666,6 @@ void rtl8225z2_rf_init(struct net_device
+
+ write_rtl8225(dev, 0x2, 0xc4d);
+
+- if (priv->card_type == USB) {
+- mdelay(200);
+-
+- write_rtl8225(dev, 0x2, 0x44d);
+- mdelay(100);
+- }
+-
+ /* FIXME!! rtl8187 we have to check if calibrarion
+ * is successful and eventually cal. again (repeat
+ * the two write on reg 2)
+@@ -705,9 +685,6 @@ void rtl8225z2_rf_init(struct net_device
+
+ write_rtl8225(dev, 0x0, 0x2bf);
+
+- if (priv->card_type != USB)
+- rtl8185_rf_pins_enable(dev);
+-
+ for (i = 0; i < 128; i++) {
+ data = rtl8225_agc[i];
+
+@@ -724,7 +701,7 @@ void rtl8225z2_rf_init(struct net_device
+
+ write_phy_ofdm(dev, 0x00, 0x01); mdelay(1);
+ write_phy_ofdm(dev, 0x01, 0x02); mdelay(1);
+- write_phy_ofdm(dev, 0x02, ((priv->card_type == USB) ? 0x42 : 0x62)); mdelay(1);
++ write_phy_ofdm(dev, 0x02, 0x62); mdelay(1);
+ write_phy_ofdm(dev, 0x03, 0x00); mdelay(1);
+ write_phy_ofdm(dev, 0x04, 0x00); mdelay(1);
+ write_phy_ofdm(dev, 0x05, 0x00); mdelay(1);
+@@ -772,7 +749,7 @@ void rtl8225z2_rf_init(struct net_device
+ write_phy_cck(dev, 0x6, 0xfc); mdelay(1);
+ write_phy_cck(dev, 0x7, 0x78); mdelay(1);
+ write_phy_cck(dev, 0x8, 0x2e); mdelay(1);
+- write_phy_cck(dev, 0x10, ((priv->card_type == USB) ? 0x9b: 0x93)); mdelay(1);
++ write_phy_cck(dev, 0x10, 0x93); mdelay(1);
+ write_phy_cck(dev, 0x11, 0x88); mdelay(1);
+ write_phy_cck(dev, 0x12, 0x47); mdelay(1);
+ write_phy_cck(dev, 0x13, 0xd0);
+@@ -806,12 +783,8 @@ void rtl8225z2_rf_init(struct net_device
+ /* switch to high-speed 3-wire
+ * last digit. 2 for both cck and ofdm
+ */
+- if (priv->card_type == USB)
+- write_nic_dword(dev, 0x94, 0x3dc00002);
+- else {
+- write_nic_dword(dev, 0x94, 0x15c00002);
+- rtl8185_rf_pins_enable(dev);
+- }
++ write_nic_dword(dev, 0x94, 0x15c00002);
++ rtl8185_rf_pins_enable(dev);
+
+ rtl8225_rf_set_chan(dev, priv->chan);
+ }
diff --git a/staging/staging-rtl8187se-rename-staging-driver-to-avoid-name-conflict-with-mainline-driver.patch b/staging/staging-rtl8187se-rename-staging-driver-to-avoid-name-conflict-with-mainline-driver.patch
new file mode 100644
index 00000000000000..edf933a51dd5fe
--- /dev/null
+++ b/staging/staging-rtl8187se-rename-staging-driver-to-avoid-name-conflict-with-mainline-driver.patch
@@ -0,0 +1,63 @@
+From Larry.Finger@lwfinger.net Thu Nov 19 11:55:55 2009
+From: Larry Finger <Larry.Finger@lwfinger.net>
+Date: Mon, 16 Nov 2009 23:35:38 -0600
+Subject: Staging: rtl8187se: Rename staging driver to avoid name conflict with mainline driver
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Message-ID: <4b02362a.0nr661Zozk1yE8rZ%Larry.Finger@lwfinger.net>
+
+
+Now that active development has begun on a mainline version of
+a driver for the RTL8187SE that should be called rtl8187se, there
+is a conflict with the driver in staging with the same name.
+
+To solve the conflict, rename the driver in staging to r8187se.
+
+Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/Makefile | 2 +-
+ drivers/staging/rtl8187se/Kconfig | 3 ++-
+ drivers/staging/rtl8187se/Makefile | 4 ++--
+ 3 files changed, 5 insertions(+), 4 deletions(-)
+
+--- a/drivers/staging/Makefile
++++ b/drivers/staging/Makefile
+@@ -19,7 +19,7 @@ obj-$(CONFIG_COMEDI) += comedi/
+ obj-$(CONFIG_ASUS_OLED) += asus_oled/
+ obj-$(CONFIG_PANEL) += panel/
+ obj-$(CONFIG_ALTERA_PCIE_CHDMA) += altpciechdma/
+-obj-$(CONFIG_RTL8187SE) += rtl8187se/
++obj-$(CONFIG_R8187SE) += rtl8187se/
+ obj-$(CONFIG_RTL8192SU) += rtl8192su/
+ obj-$(CONFIG_RTL8192U) += rtl8192u/
+ obj-$(CONFIG_RTL8192E) += rtl8192e/
+--- a/drivers/staging/rtl8187se/Kconfig
++++ b/drivers/staging/rtl8187se/Kconfig
+@@ -1,6 +1,7 @@
+-config RTL8187SE
++config R8187SE
+ tristate "RealTek RTL8187SE Wireless LAN NIC driver"
+ depends on PCI && WLAN
+ depends on WIRELESS_EXT
+ default N
+ ---help---
++ If built as a module, it will be called r8187se.ko.
+--- a/drivers/staging/rtl8187se/Makefile
++++ b/drivers/staging/rtl8187se/Makefile
+@@ -16,7 +16,7 @@ EXTRA_CFLAGS += -DENABLE_LPS
+
+ #EXTRA_CFLAGS += -mhard-float -DCONFIG_FORCE_HARD_FLOAT=y
+
+-rtl8187se-objs := \
++r8187se-objs := \
+ r8180_core.o \
+ r8180_93cx6.o \
+ r8180_wx.o \
+@@ -35,5 +35,5 @@ rtl8187se-objs := \
+ ieee80211/ieee80211_crypt_ccmp.o \
+ ieee80211/ieee80211_crypt_wep.o
+
+-obj-$(CONFIG_RTL8187SE) += rtl8187se.o
++obj-$(CONFIG_R8187SE) += r8187se.o
+
diff --git a/staging/staging-rtl8192u-depends-on-usb.patch b/staging/staging-rtl8192u-depends-on-usb.patch
new file mode 100644
index 00000000000000..cfd9e20f8d705e
--- /dev/null
+++ b/staging/staging-rtl8192u-depends-on-usb.patch
@@ -0,0 +1,36 @@
+From randy.dunlap@oracle.com Thu Nov 19 11:18:07 2009
+From: Randy Dunlap <randy.dunlap@oracle.com>
+Date: Wed, 11 Nov 2009 09:31:23 -0800
+Subject: Staging: rtl8192u: depends on USB
+To: Stephen Rothwell <sfr@canb.auug.org.au>, devel@driverdev.osuosl.org
+Message-ID: <20091111093123.f137a04c.randy.dunlap@oracle.com>
+
+
+From: Randy Dunlap <randy.dunlap@oracle.com>
+
+rtl8192u uses usb_* interfaces so it should depend on USB.
+
+ERROR: "usb_kill_urb" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
+ERROR: "usb_deregister" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
+ERROR: "usb_control_msg" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
+ERROR: "usb_submit_urb" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
+ERROR: "usb_register_driver" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
+ERROR: "usb_free_urb" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
+ERROR: "usb_alloc_urb" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
+
+Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/rtl8192u/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/rtl8192u/Kconfig
++++ b/drivers/staging/rtl8192u/Kconfig
+@@ -1,6 +1,6 @@
+ config RTL8192U
+ tristate "RealTek RTL8192U Wireless LAN NIC driver"
+- depends on PCI && WLAN
++ depends on PCI && WLAN && USB
+ depends on WIRELESS_EXT
+ default N
+ ---help---
diff --git a/staging/staging-sep-fix-2-warnings.patch b/staging/staging-sep-fix-2-warnings.patch
new file mode 100644
index 00000000000000..ef766572e8bf3f
--- /dev/null
+++ b/staging/staging-sep-fix-2-warnings.patch
@@ -0,0 +1,43 @@
+From randy.dunlap@oracle.com Thu Nov 19 11:19:35 2009
+From: Randy Dunlap <randy.dunlap@oracle.com>
+Date: Tue, 17 Nov 2009 10:17:42 -0800
+Subject: Staging: sep: fix 2 warnings
+To: Stephen Rothwell <sfr@canb.auug.org.au>, gregkh@suse.de
+Message-ID: <20091117101742.d512100e.randy.dunlap@oracle.com>
+
+
+From: Randy Dunlap <randy.dunlap@oracle.com>
+
+Fix printk format warning:
+drivers/staging/sep/sep_driver.c:276: warning: format '%08llx' expects type 'long long unsigned int', but argument 2 has type 'dma_addr_t'
+
+and variable may be used uninitialized (correct):
+drivers/staging/sep/sep_driver.c:1774: warning: 'error' may be used uninitialized in this function
+
+Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
+Acked-by: Alan Cox <alan@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/sep/sep_driver.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/sep/sep_driver.c
++++ b/drivers/staging/sep/sep_driver.c
+@@ -273,7 +273,8 @@ static dma_addr_t sep_shared_virt_to_bus
+ void *virt_address)
+ {
+ dma_addr_t pa = sep->shared_bus + (virt_address - sep->shared_addr);
+- edbg("sep: virt to bus b %08llx v %p\n", pa, virt_address);
++ edbg("sep: virt to bus b %08llx v %p\n",
++ (unsigned long long)pa, virt_address);
+ return pa;
+ }
+
+@@ -1788,6 +1789,7 @@ static int sep_create_flow_dma_tables_ha
+ first_table_data.physical_address = 0xffffffff;
+
+ /* find the free structure for flow data */
++ error = -EINVAL;
+ flow_context_ptr = sep_find_flow_context(sep, SEP_FREE_FLOW_ID);
+ if (flow_context_ptr == NULL)
+ goto end_function;
diff --git a/staging/staging-usbip-fix-typo-contoroller.patch b/staging/staging-usbip-fix-typo-contoroller.patch
new file mode 100644
index 00000000000000..b8a92f08e7515b
--- /dev/null
+++ b/staging/staging-usbip-fix-typo-contoroller.patch
@@ -0,0 +1,26 @@
+From rpjday@crashcourse.ca Thu Nov 19 11:51:13 2009
+From: "Robert P. J. Day" <rpjday@crashcourse.ca>
+Date: Fri, 13 Nov 2009 15:13:43 -0500 (EST)
+Subject: Staging: usbip: Fix typo "Contoroller".
+Cc: Greg KH <greg@kroah.com>
+Message-ID: <alpine.LFD.2.00.0911131512480.12802@localhost>
+
+
+Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/usbip/vhci_hcd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/usbip/vhci_hcd.c
++++ b/drivers/staging/usbip/vhci_hcd.c
+@@ -56,7 +56,7 @@ static void vhci_stop(struct usb_hcd *hc
+ static int vhci_get_frame_number(struct usb_hcd *hcd);
+
+ static const char driver_name[] = "vhci_hcd";
+-static const char driver_desc[] = "USB/IP Virtual Host Contoroller";
++static const char driver_desc[] = "USB/IP Virtual Host Controller";
+
+ struct vhci_hcd *the_controller;
+
diff --git a/staging/staging-vt665-fix-printk-formats.patch b/staging/staging-vt665-fix-printk-formats.patch
new file mode 100644
index 00000000000000..f7dd24e7ed5552
--- /dev/null
+++ b/staging/staging-vt665-fix-printk-formats.patch
@@ -0,0 +1,79 @@
+From randy.dunlap@oracle.com Thu Nov 19 11:18:52 2009
+From: Randy Dunlap <randy.dunlap@oracle.com>
+Date: Wed, 11 Nov 2009 09:31:42 -0800
+Subject: Staging: vt665*: fix printk formats
+To: Stephen Rothwell <sfr@canb.auug.org.au>, devel@driverdev.osuosl.org
+Message-ID: <20091111093142.30ad84d0.randy.dunlap@oracle.com>
+
+
+From: Randy Dunlap <randy.dunlap@oracle.com>
+
+Fix printk format warnings in vt665[56]:
+
+drivers/staging/vt6655/wpa.c:150: warning: format '%ld' expects type 'long int', but argument 3 has type 'unsigned int'
+drivers/staging/vt6655/wpa.c:181: warning: format '%ld' expects type 'long int', but argument 3 has type 'unsigned int'
+
+drivers/staging/vt6656/wpa.c:150: warning: format '%ld' expects type 'long int', but argument 3 has type 'unsigned int'
+drivers/staging/vt6656/wpa.c:181: warning: format '%ld' expects type 'long int', but argument 3 has type 'unsigned int'
+drivers/staging/vt6656/firmware.c:804: warning: format '%ld' expects type 'long int', but argument 3 has type 'unsigned int'
+
+Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/vt6655/wpa.c | 4 ++--
+ drivers/staging/vt6656/firmware.c | 2 +-
+ drivers/staging/vt6656/wpa.c | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/staging/vt6655/wpa.c
++++ b/drivers/staging/vt6655/wpa.c
+@@ -147,7 +147,7 @@ WPA_ParseRSN (
+ if (pRSN->len >= 12) //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)
+ {
+ j = 0;
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d, sizeof(pBSSList->abyPKType): %ld\n", pRSN->wPKCount, sizeof(pBSSList->abyPKType));
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d, sizeof(pBSSList->abyPKType): %zu\n", pRSN->wPKCount, sizeof(pBSSList->abyPKType));
+ for(i = 0; (i < pRSN->wPKCount) && (j < sizeof(pBSSList->abyPKType)/sizeof(BYTE)); i++) {
+ if(pRSN->len >= 12+i*4+4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*i)
+ if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI00, 4))
+@@ -178,7 +178,7 @@ WPA_ParseRSN (
+ // overlay IE_RSN_Auth structure into correct place
+ pIE_RSN_Auth = (PWLAN_IE_RSN_AUTH) pRSN->PKSList[m].abyOUI;
+ j = 0;
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAuthCount: %d, sizeof(pBSSList->abyAuthType): %ld\n",
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAuthCount: %d, sizeof(pBSSList->abyAuthType): %zu\n",
+ pIE_RSN_Auth->wAuthCount, sizeof(pBSSList->abyAuthType));
+ for(i = 0; (i < pIE_RSN_Auth->wAuthCount) && (j < sizeof(pBSSList->abyAuthType)/sizeof(BYTE)); i++) {
+ if(pRSN->len >= 14+4+(m+i)*4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*m)+AKC(2)+AKS(4*i)
+--- a/drivers/staging/vt6656/firmware.c
++++ b/drivers/staging/vt6656/firmware.c
+@@ -801,7 +801,7 @@ FIRMWAREbDownload(
+ &(pBuffer[ii])
+ );
+
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Download firmware...%d %ld\n", ii, sizeof(abyFirmware));
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Download firmware...%d %zu\n", ii, sizeof(abyFirmware));
+ if (NdisStatus != STATUS_SUCCESS) {
+ if (pBuffer)
+ kfree(pBuffer);
+--- a/drivers/staging/vt6656/wpa.c
++++ b/drivers/staging/vt6656/wpa.c
+@@ -147,7 +147,7 @@ WPA_ParseRSN (
+ if (pRSN->len >= 12) //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)
+ {
+ j = 0;
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d, sizeof(pBSSList->abyPKType): %ld\n", pRSN->wPKCount, sizeof(pBSSList->abyPKType));
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d, sizeof(pBSSList->abyPKType): %zu\n", pRSN->wPKCount, sizeof(pBSSList->abyPKType));
+ for(i = 0; (i < pRSN->wPKCount) && (j < sizeof(pBSSList->abyPKType)/sizeof(BYTE)); i++) {
+ if(pRSN->len >= 12+i*4+4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*i)
+ if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI00, 4))
+@@ -178,7 +178,7 @@ WPA_ParseRSN (
+ // overlay IE_RSN_Auth structure into correct place
+ pIE_RSN_Auth = (PWLAN_IE_RSN_AUTH) pRSN->PKSList[m].abyOUI;
+ j = 0;
+- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAuthCount: %d, sizeof(pBSSList->abyAuthType): %ld\n",
++ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAuthCount: %d, sizeof(pBSSList->abyAuthType): %zu\n",
+ pIE_RSN_Auth->wAuthCount, sizeof(pBSSList->abyAuthType));
+ for(i = 0; (i < pIE_RSN_Auth->wAuthCount) && (j < sizeof(pBSSList->abyAuthType)/sizeof(BYTE)); i++) {
+ if(pRSN->len >= 14+4+(m+i)*4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*m)+AKC(2)+AKS(4*i)