summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKenneth Kwak <kkwak@nvidia.com>2014-06-24 21:39:56 -0700
committerPeter Kim <pekim@nvidia.com>2014-06-25 19:16:17 -0700
commit8f17ce4a920155aaf51051acd8f325b1ebf904bf (patch)
tree771101fbc173091805f8fccf74ccaa12d4a12811 /drivers
parent0d48f7b8aa06d4c69f37d56789d6b20e0cf4ba4f (diff)
Revert "staging: ozwpan: Update to latest drop"
DO NOT INTEGRATE Bug 1466757 This reverts commit f989de509c5c92d9d6f1b60ab44877f8b4f4a8fb. Change-Id: Ica2944c936a14b643ffb7232fd50f9145e3daae9 Signed-off-by: Kenneth Kwak <kkwak@nvidia.com> Reviewed-on: http://git-master/r/428082 Reviewed-by: Peter Kim <pekim@nvidia.com> Tested-by: Peter Kim <pekim@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/ozwpan/ozcdev.c39
-rw-r--r--drivers/staging/ozwpan/ozmain.c2
-rw-r--r--drivers/staging/ozwpan/ozpd.c9
-rw-r--r--drivers/staging/ozwpan/ozpd.h8
-rw-r--r--drivers/staging/ozwpan/ozproto.c33
5 files changed, 14 insertions, 77 deletions
diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c
index 7e4559bfe377..9785eaa86b94 100644
--- a/drivers/staging/ozwpan/ozcdev.c
+++ b/drivers/staging/ozwpan/ozcdev.c
@@ -99,16 +99,11 @@ int oz_cdev_open(struct inode *inode, struct file *filp)
{
struct oz_cdev *dev;
- if (!atomic_add_unless(&g_cdev.ref_count, 1, 1)) {
- oz_trace_msg(O, "OPEN %08X EBUSY\n",
- (unsigned int)((uintptr_t)filp));
+ if (!atomic_add_unless(&g_cdev.ref_count, 1, 1))
return -EBUSY;
- }
dev = container_of(inode->i_cdev, struct oz_cdev, cdev);
filp->private_data = dev;
-
- oz_trace_msg(O, "OPEN %08X OK\n", (unsigned int)((uintptr_t)filp));
return 0;
}
/*------------------------------------------------------------------------------
@@ -117,7 +112,6 @@ int oz_cdev_open(struct inode *inode, struct file *filp)
int oz_cdev_release(struct inode *inode, struct file *filp)
{
atomic_dec(&g_cdev.ref_count);
- oz_trace_msg(O, "CLOSE %08X\n", (unsigned int)((uintptr_t)filp));
return 0;
}
/*------------------------------------------------------------------------------
@@ -132,20 +126,14 @@ ssize_t oz_cdev_read(struct file *filp, char __user *buf, size_t count,
struct oz_pd *pd;
struct oz_serial_ctx *ctx;
- oz_trace_msg(O, "READ I %X %04X\n",
- (unsigned int)((uintptr_t)filp), (int)count);
-
spin_lock_bh(&g_cdev.lock);
pd = g_cdev.active_pd;
if (pd)
oz_pd_get(pd);
is_tftp = (g_cdev.mode & OZ_MODE_TFTP) ? 1 : 0;
spin_unlock_bh(&g_cdev.lock);
- if (pd == NULL) {
- oz_trace_msg(O, "READ O %X %04X\n",
- (unsigned int)((uintptr_t)filp), (unsigned int)(-1));
+ if (pd == NULL)
return -1;
- }
ctx = oz_cdev_claim_ctx(pd);
if (ctx == NULL)
goto out2;
@@ -233,8 +221,6 @@ out1:
oz_cdev_release_ctx(ctx);
out2:
oz_pd_put(pd);
- oz_trace_msg(O, "READ O %08X %04X\n",
- (unsigned int)((uintptr_t)filp), (unsigned int)(count));
return count;
}
/*------------------------------------------------------------------------------
@@ -251,19 +237,16 @@ ssize_t oz_cdev_write(struct file *filp, const char __user *buf, size_t count,
struct oz_app_hdr *app_hdr;
struct oz_serial_ctx *ctx;
- oz_trace_msg(O, "WRITE I %08X %04X\n",
- (unsigned int)((uintptr_t)filp), (int)count);
+ if (count > sizeof(ei->data) - sizeof(*elt) - sizeof(*app_hdr))
+ return -EINVAL;
spin_lock_bh(&g_cdev.lock);
pd = g_cdev.active_pd;
if (pd)
oz_pd_get(pd);
spin_unlock_bh(&g_cdev.lock);
- if (pd == NULL) {
- oz_trace_msg(O, "WRITE O %08X %04X\n",
- (unsigned int)((uintptr_t)filp), (unsigned int)count);
+ if (pd == NULL)
return -1;
- }
if (!(pd->state & OZ_PD_S_CONNECTED))
return -ENXIO;
eb = &pd->elt_buff;
@@ -318,8 +301,6 @@ out:
spin_unlock_bh(&eb->lock);
}
oz_pd_put(pd);
- oz_trace_msg(O, "WRITE O %08X %04X\n",
- (unsigned int)((uintptr_t)filp), (unsigned int)count);
return count;
}
/*------------------------------------------------------------------------------
@@ -336,14 +317,11 @@ int oz_set_active_pd(const u8 *addr)
spin_lock_bh(&g_cdev.lock);
if (memcmp(g_cdev.active_addr, addr, ETH_ALEN) == 0) {
spin_unlock_bh(&g_cdev.lock);
- oz_pd_put(pd);
return rc;
}
memcpy(g_cdev.active_addr, addr, ETH_ALEN);
old_pd = g_cdev.active_pd;
g_cdev.active_pd = pd;
- oz_trace_msg(O, "Active PD:%08x\n",
- (unsigned int)((uintptr_t)pd));
spin_unlock_bh(&g_cdev.lock);
/*Reset buffer pointers if new device is selected*/
@@ -367,7 +345,6 @@ int oz_set_active_pd(const u8 *addr)
g_cdev.active_pd = NULL;
memset(g_cdev.active_addr, 0,
sizeof(g_cdev.active_addr));
- oz_trace_msg(O, "Active PD:00000000\n");
spin_unlock_bh(&g_cdev.lock);
if (pd)
oz_pd_put(pd);
@@ -492,9 +469,6 @@ unsigned int oz_cdev_poll(struct file *filp, poll_table *wait)
{
unsigned int ret = 0;
struct oz_cdev *dev = filp->private_data;
-
- oz_trace_msg(O, "POLL I %08X\n", (unsigned int)((uintptr_t)filp));
-
spin_lock_bh(&dev->lock);
if (dev->active_pd) {
struct oz_serial_ctx *ctx = oz_cdev_claim_ctx(dev->active_pd);
@@ -514,9 +488,6 @@ unsigned int oz_cdev_poll(struct file *filp, poll_table *wait)
if (wait)
poll_wait(filp, &dev->rdq, wait);
-
- oz_trace_msg(O, "POLL O %08X %08X\n",
- (unsigned int)((uintptr_t)filp), ret);
return ret;
}
/*------------------------------------------------------------------------------
diff --git a/drivers/staging/ozwpan/ozmain.c b/drivers/staging/ozwpan/ozmain.c
index 4287f1067208..8bb7d67da4b6 100644
--- a/drivers/staging/ozwpan/ozmain.c
+++ b/drivers/staging/ozwpan/ozmain.c
@@ -51,6 +51,6 @@ module_exit(ozwpan_exit);
MODULE_AUTHOR("Chris Kelly");
MODULE_DESCRIPTION("Ozmo Devices USB over WiFi hcd driver");
-MODULE_VERSION("10.00.01.02.05");
+MODULE_VERSION("1.2.3-rc10");
MODULE_LICENSE("GPL");
diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index ad4acb59e8d9..a99d0b49b45f 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -208,7 +208,7 @@ static void oz_pd_free(struct work_struct *work)
struct oz_isoc_stream *st;
struct oz_farewell *fwell;
pd = container_of(work, struct oz_pd, workitem);
- oz_trace_msg(M, "Destroying PD:%p\n", pd);
+ oz_trace("Destroying PD\n");
tasklet_kill(&pd->heartbeat_tasklet);
tasklet_kill(&pd->timeout_tasklet);
/* Delete any streams.
@@ -245,10 +245,8 @@ static void oz_pd_free(struct work_struct *work)
pd->tx_pool = e->next;
kfree(container_of(e, struct oz_tx_frame, link));
}
- if (pd->net_dev) {
- oz_trace_msg(M, "dev_put(%p)\n", pd->net_dev);
+ if (pd->net_dev)
dev_put(pd->net_dev);
- }
kfree(pd);
}
@@ -349,7 +347,7 @@ void oz_pd_heartbeat(struct oz_pd *pd, u16 apps)
void oz_pd_stop(struct oz_pd *pd)
{
u16 stop_apps = 0;
- oz_trace_msg(M, "oz_pd_stop() State = 0x%x\n", pd->state);
+ oz_trace("%s: State = 0x%x\n", __func__, pd->state);
oz_polling_lock_bh();
oz_pd_indicate_farewells(pd);
stop_apps = pd->total_apps;
@@ -364,7 +362,6 @@ void oz_pd_stop(struct oz_pd *pd)
oz_polling_unlock_bh();
- oz_trace_msg(M, "pd ref count = %d\n", atomic_read(&pd->ref_count));
oz_pd_put(pd);
}
/*------------------------------------------------------------------------------
diff --git a/drivers/staging/ozwpan/ozpd.h b/drivers/staging/ozwpan/ozpd.h
index a4270fe69ee5..d75f0afa20ed 100644
--- a/drivers/staging/ozwpan/ozpd.h
+++ b/drivers/staging/ozwpan/ozpd.h
@@ -22,13 +22,6 @@
#define OZ_TIMER_HEARTBEAT 2
#define OZ_TIMER_STOP 3
-
-/* Tasklet Scheduled flag.
- */
-#define OZ_TASKLET_SCHED_TIMEOUT 0
-#define OZ_TASKLET_SCHED_HEARTBEAT 1
-
-
#define ETH_STRING_LEN 17
/* Data structure that hold information on a frame for transmisson. This is
* built when the frame is first transmitted and is used to rebuild the frame
@@ -107,7 +100,6 @@ struct oz_pd {
u8 timeout_type;
struct tasklet_struct heartbeat_tasklet;
struct tasklet_struct timeout_tasklet;
- unsigned long tasklet_sched;
struct work_struct workitem;
u8 up_audio_buf;
};
diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c
index f0ac43283588..cbb1335f3ce1 100644
--- a/drivers/staging/ozwpan/ozproto.c
+++ b/drivers/staging/ozwpan/ozproto.c
@@ -192,7 +192,6 @@ static struct oz_pd *oz_connect_req(struct oz_pd *cur_pd, struct oz_elt *elt,
}
if (pd->net_dev != net_dev) {
old_net_dev = pd->net_dev;
- oz_trace_msg(M, "dev_hold(%p)\n", net_dev);
dev_hold(net_dev);
pd->net_dev = net_dev;
}
@@ -281,10 +280,8 @@ done:
oz_pd_put(pd);
pd = NULL;
}
- if (old_net_dev) {
- oz_trace_msg(M, "dev_put(%p)", old_net_dev);
+ if (old_net_dev)
dev_put(old_net_dev);
- }
if (free_pd)
oz_pd_destroy(free_pd);
return pd;
@@ -459,10 +456,8 @@ void oz_protocol_term(void)
list_del(&b->link);
spin_unlock_bh(&g_binding_lock);
dev_remove_pack(&b->ptype);
- if (b->ptype.dev) {
- oz_trace_msg(M, "dev_put(%p)\n", b->ptype.dev);
+ if (b->ptype.dev)
dev_put(b->ptype.dev);
- }
kfree(b);
spin_lock_bh(&g_binding_lock);
}
@@ -497,7 +492,7 @@ void oz_pd_heartbeat_handler(unsigned long data)
spin_unlock_bh(&g_polling_lock);
if (apps)
oz_pd_heartbeat(pd, apps);
- clear_bit(OZ_TASKLET_SCHED_HEARTBEAT, &pd->tasklet_sched);
+
oz_pd_put(pd);
}
/*------------------------------------------------------------------------------
@@ -521,7 +516,6 @@ void oz_pd_timeout_handler(unsigned long data)
oz_pd_stop(pd);
break;
}
- clear_bit(OZ_TASKLET_SCHED_TIMEOUT, &pd->tasklet_sched);
oz_pd_put(pd);
}
/*------------------------------------------------------------------------------
@@ -535,15 +529,7 @@ enum hrtimer_restart oz_pd_heartbeat_event(struct hrtimer *timer)
hrtimer_forward(timer,
hrtimer_get_expires(timer), pd->pulse_period);
oz_pd_get(pd);
- if (!test_and_set_bit(OZ_TASKLET_SCHED_HEARTBEAT, &pd->tasklet_sched)) {
- /* schedule tasklet! */
- tasklet_schedule(&pd->heartbeat_tasklet);
- } else {
- /* oz_pd_heartbeat_handler is already scheduled or running.
- * decrement pd counter.
- */
- oz_pd_put(pd);
- }
+ tasklet_schedule(&pd->heartbeat_tasklet);
return HRTIMER_RESTART;
}
/*------------------------------------------------------------------------------
@@ -555,15 +541,7 @@ enum hrtimer_restart oz_pd_timeout_event(struct hrtimer *timer)
pd = container_of(timer, struct oz_pd, timeout);
oz_pd_get(pd);
- if (!test_and_set_bit(OZ_TASKLET_SCHED_TIMEOUT, &pd->tasklet_sched)) {
- /* Schedule tasklet! */
- tasklet_schedule(&pd->timeout_tasklet);
- } else {
- /* oz_pd_timeout_handler is already scheduled or running.
- * decrement pd counter.
- */
- oz_pd_put(pd);
- }
+ tasklet_schedule(&pd->timeout_tasklet);
return HRTIMER_NORESTART;
}
/*------------------------------------------------------------------------------
@@ -763,7 +741,6 @@ void oz_binding_remove(const char *net_dev)
if (found) {
dev_remove_pack(&binding->ptype);
if (binding->ptype.dev) {
- oz_trace_msg(M, "dev_put(%s)\n", binding->name);
dev_put(binding->ptype.dev);
pd_stop_all_for_device(binding->ptype.dev);
}