Commit 6e244a83 authored by Rupesh Gujare's avatar Rupesh Gujare Committed by Greg Kroah-Hartman

staging: ozwpan: Add a blank line between functions & declarations.

This patch adds a blank line between global declarations &
functions for readability.
Signed-off-by: default avatarRupesh Gujare <rupesh.gujare@atmel.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 18f8191e
......@@ -43,6 +43,7 @@ struct oz_serial_ctx {
*/
static struct oz_cdev g_cdev;
static struct class *g_oz_class;
/*------------------------------------------------------------------------------
* Context: process and softirq
*/
......@@ -57,6 +58,7 @@ static struct oz_serial_ctx *oz_cdev_claim_ctx(struct oz_pd *pd)
spin_unlock_bh(&pd->app_lock[OZ_APPID_SERIAL-1]);
return ctx;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -67,6 +69,7 @@ static void oz_cdev_release_ctx(struct oz_serial_ctx *ctx)
kfree(ctx);
}
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -79,6 +82,7 @@ static int oz_cdev_open(struct inode *inode, struct file *filp)
filp->private_data = dev;
return 0;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -86,6 +90,7 @@ static int oz_cdev_release(struct inode *inode, struct file *filp)
{
return 0;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -138,6 +143,7 @@ static ssize_t oz_cdev_read(struct file *filp, char __user *buf, size_t count,
oz_pd_put(pd);
return count;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -195,6 +201,7 @@ static ssize_t oz_cdev_write(struct file *filp, const char __user *buf,
oz_pd_put(pd);
return count;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -229,6 +236,7 @@ static int oz_set_active_pd(const u8 *addr)
}
return rc;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -296,6 +304,7 @@ static long oz_cdev_ioctl(struct file *filp, unsigned int cmd,
}
return rc;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -319,6 +328,7 @@ static unsigned int oz_cdev_poll(struct file *filp, poll_table *wait)
poll_wait(filp, &dev->rdq, wait);
return ret;
}
/*------------------------------------------------------------------------------
*/
static const struct file_operations oz_fops = {
......@@ -330,6 +340,7 @@ static const struct file_operations oz_fops = {
.unlocked_ioctl = oz_cdev_ioctl,
.poll = oz_cdev_poll
};
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -374,6 +385,7 @@ int oz_cdev_register(void)
unregister_chrdev_region(g_cdev.devnum, 1);
return err;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -387,6 +399,7 @@ int oz_cdev_deregister(void)
}
return 0;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -395,6 +408,7 @@ int oz_cdev_init(void)
oz_app_enable(OZ_APPID_SERIAL, 1);
return 0;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -402,6 +416,7 @@ void oz_cdev_term(void)
{
oz_app_enable(OZ_APPID_SERIAL, 0);
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -439,6 +454,7 @@ int oz_cdev_start(struct oz_pd *pd, int resume)
oz_dbg(ON, "Serial service started\n");
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -468,6 +484,7 @@ void oz_cdev_stop(struct oz_pd *pd, int pause)
}
oz_dbg(ON, "Serial service stopped\n");
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......
......@@ -28,6 +28,7 @@ int oz_elt_buf_init(struct oz_elt_buf *buf)
spin_lock_init(&buf->lock);
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -60,6 +61,7 @@ void oz_elt_buf_term(struct oz_elt_buf *buf)
}
buf->free_elts = 0;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -93,6 +95,7 @@ struct oz_elt_info *oz_elt_info_alloc(struct oz_elt_buf *buf)
}
return ei;
}
/*------------------------------------------------------------------------------
* Precondition: oz_elt_buf.lock must be held.
* Context: softirq or process
......@@ -111,6 +114,7 @@ void oz_elt_info_free(struct oz_elt_buf *buf, struct oz_elt_info *ei)
}
}
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -128,6 +132,7 @@ void oz_elt_info_free_chain(struct oz_elt_buf *buf, struct list_head *list)
}
spin_unlock_bh(&buf->lock);
}
/*------------------------------------------------------------------------------
*/
int oz_elt_stream_create(struct oz_elt_buf *buf, u8 id, int max_buf_count)
......@@ -148,6 +153,7 @@ int oz_elt_stream_create(struct oz_elt_buf *buf, u8 id, int max_buf_count)
spin_unlock_bh(&buf->lock);
return 0;
}
/*------------------------------------------------------------------------------
*/
int oz_elt_stream_delete(struct oz_elt_buf *buf, u8 id)
......@@ -187,12 +193,14 @@ int oz_elt_stream_delete(struct oz_elt_buf *buf, u8 id)
oz_elt_stream_put(st);
return 0;
}
/*------------------------------------------------------------------------------
*/
void oz_elt_stream_get(struct oz_elt_stream *st)
{
atomic_inc(&st->ref_count);
}
/*------------------------------------------------------------------------------
*/
void oz_elt_stream_put(struct oz_elt_stream *st)
......@@ -202,6 +210,7 @@ void oz_elt_stream_put(struct oz_elt_stream *st)
kfree(st);
}
}
/*------------------------------------------------------------------------------
* Precondition: Element buffer lock must be held.
* If this function fails the caller is responsible for deallocating the elt
......@@ -265,6 +274,7 @@ int oz_queue_elt_info(struct oz_elt_buf *buf, u8 isoc, u8 id,
&buf->isoc_list : &buf->order_list);
return 0;
}
/*------------------------------------------------------------------------------
*/
int oz_select_elts_for_tx(struct oz_elt_buf *buf, u8 isoc, unsigned *len,
......@@ -311,12 +321,14 @@ int oz_select_elts_for_tx(struct oz_elt_buf *buf, u8 isoc, unsigned *len,
spin_unlock_bh(&buf->lock);
return count;
}
/*------------------------------------------------------------------------------
*/
int oz_are_elts_available(struct oz_elt_buf *buf)
{
return buf->order_list.next != &buf->order_list;
}
/*------------------------------------------------------------------------------
*/
void oz_trim_elt_pool(struct oz_elt_buf *buf)
......
This diff is collapsed.
......@@ -25,6 +25,7 @@ unsigned int oz_dbg_mask = OZ_DEFAULT_DBG_MASK;
* netcards. Bindings can be added later using an IOCTL.
*/
static char *g_net_dev = "";
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -36,6 +37,7 @@ static int __init ozwpan_init(void)
oz_apps_init();
return 0;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -45,6 +47,7 @@ static void __exit ozwpan_exit(void)
oz_apps_term();
oz_cdev_deregister();
}
/*------------------------------------------------------------------------------
*/
module_param(g_net_dev, charp, S_IRUGO);
......
......@@ -24,6 +24,7 @@
/*------------------------------------------------------------------------------
*/
#define OZ_MAX_TX_POOL_SIZE 6
/*------------------------------------------------------------------------------
*/
static struct oz_tx_frame *oz_tx_frame_alloc(struct oz_pd *pd);
......@@ -40,10 +41,12 @@ static void oz_def_app_term(void);
static int oz_def_app_start(struct oz_pd *pd, int resume);
static void oz_def_app_stop(struct oz_pd *pd, int pause);
static void oz_def_app_rx(struct oz_pd *pd, struct oz_elt *elt);
/*------------------------------------------------------------------------------
* Counts the uncompleted isoc frames submitted to netcard.
*/
static atomic_t g_submitted_isoc = ATOMIC_INIT(0);
/* Application handler functions.
*/
static const struct oz_app_if g_app_if[OZ_APPID_MAX] = {
......@@ -83,6 +86,7 @@ static const struct oz_app_if g_app_if[OZ_APPID_MAX] = {
NULL,
OZ_APPID_SERIAL},
};
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -90,12 +94,14 @@ static int oz_def_app_init(void)
{
return 0;
}
/*------------------------------------------------------------------------------
* Context: process
*/
static void oz_def_app_term(void)
{
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -103,18 +109,21 @@ static int oz_def_app_start(struct oz_pd *pd, int resume)
{
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
static void oz_def_app_stop(struct oz_pd *pd, int pause)
{
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
static void oz_def_app_rx(struct oz_pd *pd, struct oz_elt *elt)
{
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -136,6 +145,7 @@ void oz_pd_set_state(struct oz_pd *pd, unsigned state)
break;
}
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -143,6 +153,7 @@ void oz_pd_get(struct oz_pd *pd)
{
atomic_inc(&pd->ref_count);
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -151,6 +162,7 @@ void oz_pd_put(struct oz_pd *pd)
if (atomic_dec_and_test(&pd->ref_count))
oz_pd_destroy(pd);
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -188,6 +200,7 @@ struct oz_pd *oz_pd_alloc(const u8 *mac_addr)
}
return pd;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -244,6 +257,7 @@ void oz_pd_destroy(struct oz_pd *pd)
dev_put(pd->net_dev);
kfree(pd);
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -271,6 +285,7 @@ int oz_services_start(struct oz_pd *pd, u16 apps, int resume)
}
return rc;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -293,6 +308,7 @@ void oz_services_stop(struct oz_pd *pd, u16 apps, int pause)
}
}
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -315,6 +331,7 @@ void oz_pd_heartbeat(struct oz_pd *pd, u16 apps)
;
}
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -338,6 +355,7 @@ void oz_pd_stop(struct oz_pd *pd)
oz_dbg(ON, "pd ref count = %d\n", atomic_read(&pd->ref_count));
oz_pd_put(pd);
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -366,6 +384,7 @@ int oz_pd_sleep(struct oz_pd *pd)
}
return do_stop;
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -389,6 +408,7 @@ static struct oz_tx_frame *oz_tx_frame_alloc(struct oz_pd *pd)
}
return f;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -406,6 +426,7 @@ static void oz_tx_isoc_free(struct oz_pd *pd, struct oz_tx_frame *f)
oz_dbg(TX_FRAMES, "Releasing ISOC Frame isoc_nb= %d\n",
pd->nb_queued_isoc_frames);
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -421,6 +442,7 @@ static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f)
spin_unlock_bh(&pd->tx_frame_lock);
kfree(f);
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -430,6 +452,7 @@ static void oz_set_more_bit(struct sk_buff *skb)
oz_hdr->control |= OZ_F_MORE_DATA;
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -439,6 +462,7 @@ static void oz_set_last_pkt_nb(struct oz_pd *pd, struct sk_buff *skb)
oz_hdr->last_pkt_num = pd->trigger_pkt_num & OZ_LAST_PN_MASK;
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -470,6 +494,7 @@ int oz_prepare_frame(struct oz_pd *pd, int empty)
spin_unlock(&pd->tx_frame_lock);
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -515,6 +540,7 @@ static struct sk_buff *oz_build_frame(struct oz_pd *pd, struct oz_tx_frame *f)
kfree_skb(skb);
return NULL;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -538,6 +564,7 @@ static void oz_retire_frame(struct oz_pd *pd, struct oz_tx_frame *f)
if (pd->elt_buff.free_elts > pd->elt_buff.max_free_elts)
oz_trim_elt_pool(&pd->elt_buff);
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -592,6 +619,7 @@ static int oz_send_next_queued_frame(struct oz_pd *pd, int more_data)
}
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -630,6 +658,7 @@ void oz_send_queued_frames(struct oz_pd *pd, int backlog)
out: oz_prepare_frame(pd, 1);
oz_send_next_queued_frame(pd, 0);
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -679,6 +708,7 @@ static int oz_send_isoc_frame(struct oz_pd *pd)
oz_elt_info_free_chain(&pd->elt_buff, &list);
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -720,6 +750,7 @@ void oz_retire_tx_frames(struct oz_pd *pd, u8 lpn)
oz_retire_frame(pd, f);
}
}
/*------------------------------------------------------------------------------
* Precondition: stream_lock must be held.
* Context: softirq
......@@ -736,6 +767,7 @@ static struct oz_isoc_stream *pd_stream_find(struct oz_pd *pd, u8 ep_num)
}
return NULL;
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -755,6 +787,7 @@ int oz_isoc_stream_create(struct oz_pd *pd, u8 ep_num)
kfree(st);
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -763,6 +796,7 @@ static void oz_isoc_stream_free(struct oz_isoc_stream *st)
kfree_skb(st->skb);
kfree(st);
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -779,6 +813,7 @@ int oz_isoc_stream_delete(struct oz_pd *pd, u8 ep_num)
oz_isoc_stream_free(st);
return 0;
}
/*------------------------------------------------------------------------------
* Context: any
*/
......@@ -786,6 +821,7 @@ static void oz_isoc_destructor(struct sk_buff *skb)
{
atomic_dec(&g_submitted_isoc);
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -907,6 +943,7 @@ out: kfree_skb(skb);
}
return 0;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -918,6 +955,7 @@ void oz_apps_init(void)
if (g_app_if[i].init)
g_app_if[i].init();
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -930,6 +968,7 @@ void oz_apps_term(void)
if (g_app_if[i].term)
g_app_if[i].term();
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -942,6 +981,7 @@ void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt)
ai = &g_app_if[app_id-1];
ai->rx(pd, elt);
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......
......@@ -22,6 +22,7 @@
#include <asm/unaligned.h>
#include <linux/uaccess.h>
#include <net/psnap.h>
/*------------------------------------------------------------------------------
*/
#define OZ_CF_CONN_SUCCESS 1
......@@ -51,6 +52,7 @@ static struct sk_buff_head g_rx_queue;
static u8 g_session_id;
static u16 g_apps = 0x1;
static int g_processing_rx;
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -64,6 +66,7 @@ static u8 oz_get_new_session_id(u8 exclude)
}
return g_session_id;
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -109,6 +112,7 @@ static void oz_send_conn_rsp(struct oz_pd *pd, u8 status)
dev_queue_xmit(skb);
return;
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -134,6 +138,7 @@ static void pd_set_keepalive(struct oz_pd *pd, u8 kalive)
}
oz_dbg(ON, "Keepalive = %lu mSec\n", pd->keep_alive);
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -150,6 +155,7 @@ static void pd_set_presleep(struct oz_pd *pd, u8 presleep, u8 start_timer)
}
oz_dbg(ON, "Presleep time = %lu mSec\n", pd->presleep);
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -284,6 +290,7 @@ static struct oz_pd *oz_connect_req(struct oz_pd *cur_pd, struct oz_elt *elt,
oz_pd_destroy(free_pd);
return pd;
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -315,6 +322,7 @@ static void oz_add_farewell(struct oz_pd *pd, u8 ep_num, u8 index,
if (found)
kfree(f2);
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -436,6 +444,7 @@ static void oz_rx_frame(struct sk_buff *skb)
oz_pd_put(pd);
consume_skb(skb);
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -473,6 +482,7 @@ void oz_protocol_term(void)
spin_unlock_bh(&g_polling_lock);
oz_dbg(ON, "Protocol stopped\n");
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -489,6 +499,7 @@ void oz_pd_heartbeat_handler(unsigned long data)
oz_pd_heartbeat(pd, apps);
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -509,6 +520,7 @@ void oz_pd_timeout_handler(unsigned long data)
break;
}
}
/*------------------------------------------------------------------------------
* Context: Interrupt
*/
......@@ -522,6 +534,7 @@ enum hrtimer_restart oz_pd_heartbeat_event(struct hrtimer *timer)
tasklet_schedule(&pd->heartbeat_tasklet);
return HRTIMER_RESTART;
}
/*------------------------------------------------------------------------------
* Context: Interrupt
*/
......@@ -533,6 +546,7 @@ enum hrtimer_restart oz_pd_timeout_event(struct hrtimer *timer)
tasklet_schedule(&pd->timeout_tasklet);
return HRTIMER_NORESTART;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -563,6 +577,7 @@ void oz_timer_add(struct oz_pd *pd, int type, unsigned long due_time)
}
spin_unlock_bh(&g_polling_lock);
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -571,6 +586,7 @@ void oz_pd_request_heartbeat(struct oz_pd *pd)
oz_timer_add(pd, OZ_TIMER_HEARTBEAT, pd->pulse_period > 0 ?
pd->pulse_period : OZ_QUANTUM);
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......@@ -591,6 +607,7 @@ struct oz_pd *oz_pd_find(const u8 *mac_addr)
spin_unlock_bh(&g_polling_lock);
return NULL;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -605,6 +622,7 @@ void oz_app_enable(int app_id, int enable)
spin_unlock_bh(&g_polling_lock);
}
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -639,6 +657,7 @@ static int oz_pkt_recv(struct sk_buff *skb, struct net_device *dev,
}
return 0;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -672,6 +691,7 @@ void oz_binding_add(const char *net_dev)
}
}
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -696,6 +716,7 @@ static void pd_stop_all_for_device(struct net_device *net_dev)
oz_pd_put(pd);
}
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -724,6 +745,7 @@ void oz_binding_remove(const char *net_dev)
kfree(binding);
}
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -738,6 +760,7 @@ static char *oz_get_next_device_name(char *s, char *dname, int max_size)
*dname = 0;
return s;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -756,6 +779,7 @@ int oz_protocol_init(char *devs)
}
return 0;
}
/*------------------------------------------------------------------------------
* Context: process
*/
......@@ -775,12 +799,14 @@ int oz_get_pd_list(struct oz_mac_addr *addr, int max_count)
spin_unlock_bh(&g_polling_lock);
return count;
}
/*------------------------------------------------------------------------------
*/
void oz_polling_lock_bh(void)
{
spin_lock_bh(&g_polling_lock);
}
/*------------------------------------------------------------------------------
*/
void oz_polling_unlock_bh(void)
......
......@@ -16,6 +16,7 @@
struct urb *g_urb_memory[OZ_MAX_URBS];
int g_nb_urbs;
DEFINE_SPINLOCK(g_urb_mem_lock);
/*-----------------------------------------------------------------------------
*/
void oz_remember_urb(struct urb *urb)
......@@ -31,6 +32,7 @@ void oz_remember_urb(struct urb *urb)
}
spin_unlock_irqrestore(&g_urb_mem_lock, irq_state);
}
/*------------------------------------------------------------------------------
*/
int oz_forget_urb(struct urb *urb)
......
......@@ -36,6 +36,7 @@ int oz_usb_init(void)
{
return oz_hcd_init();
}
/*------------------------------------------------------------------------------
* This is called once when the driver is unloaded to terminate the USB service.
* Context: process
......@@ -44,6 +45,7 @@ void oz_usb_term(void)
{
oz_hcd_term();
}
/*------------------------------------------------------------------------------
* This is called when the USB service is started or resumed for a PD.
* Context: softirq
......@@ -108,6 +110,7 @@ int oz_usb_start(struct oz_pd *pd, int resume)
oz_usb_put(usb_ctx);
return rc;
}
/*------------------------------------------------------------------------------
* This is called when the USB service is stopped or paused for a PD.
* Context: softirq or process
......@@ -148,6 +151,7 @@ void oz_usb_stop(struct oz_pd *pd, int pause)
oz_usb_put(usb_ctx);
}
}
/*------------------------------------------------------------------------------
* This increments the reference count of the context area for a specific PD.
* This ensures this context area does not disappear while still in use.
......@@ -159,6 +163,7 @@ void oz_usb_get(void *hpd)
atomic_inc(&usb_ctx->ref_count);
}
/*------------------------------------------------------------------------------
* This decrements the reference count of the context area for a specific PD
* and destroys the context area if the reference count becomes zero.
......@@ -174,6 +179,7 @@ void oz_usb_put(void *hpd)
kfree(usb_ctx);
}
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -198,6 +204,7 @@ int oz_usb_heartbeat(struct oz_pd *pd)
oz_usb_put(usb_ctx);
return rc;
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -219,6 +226,7 @@ int oz_usb_stream_create(void *hpd, u8 ep_num)
}
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -241,6 +249,7 @@ int oz_usb_stream_delete(void *hpd, u8 ep_num)
}
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq or process
*/
......
......@@ -21,9 +21,11 @@
#include "ozusbif.h"
#include "ozhcd.h"
#include "ozusbsvc.h"
/*------------------------------------------------------------------------------
*/
#define MAX_ISOC_FIXED_DATA (253-sizeof(struct oz_isoc_fixed))
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -50,6 +52,7 @@ static int oz_usb_submit_elt(struct oz_elt_buf *eb, struct oz_elt_info *ei,
spin_unlock_bh(&eb->lock);
return ret;
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -86,6 +89,7 @@ int oz_usb_get_desc_req(void *hpd, u8 req_id, u8 req_type, u8 desc_type,
body->index = index;
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
/*------------------------------------------------------------------------------
* Context: tasklet
*/
......@@ -108,6 +112,7 @@ static int oz_usb_set_config_req(void *hpd, u8 req_id, u8 index)
body->index = index;
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
/*------------------------------------------------------------------------------
* Context: tasklet
*/
......@@ -131,6 +136,7 @@ static int oz_usb_set_interface_req(void *hpd, u8 req_id, u8 index, u8 alt)
body->alternative = alt;
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
/*------------------------------------------------------------------------------
* Context: tasklet
*/
......@@ -156,6 +162,7 @@ static int oz_usb_set_clear_feature_req(void *hpd, u8 req_id, u8 type,
put_unaligned(feature, &body->feature);
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
/*------------------------------------------------------------------------------
* Context: tasklet
*/
......@@ -184,6 +191,7 @@ static int oz_usb_vendor_class_req(void *hpd, u8 req_id, u8 req_type,
memcpy(body->data, data, data_len);
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
/*------------------------------------------------------------------------------
* Context: tasklet
*/
......@@ -232,6 +240,7 @@ int oz_usb_control_req(void *hpd, u8 req_id, struct usb_ctrlrequest *setup,
}
return rc;
}
/*------------------------------------------------------------------------------
* Context: softirq
*/
......@@ -303,6 +312,7 @@ int oz_usb_send_isoc(void *hpd, u8 ep_num, struct urb *urb)
}
return 0;
}
/*------------------------------------------------------------------------------
* Context: softirq-serialized
*/
......@@ -346,6 +356,7 @@ static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx,
}
}
/*------------------------------------------------------------------------------
* This is called when the PD has received a USB element. The type of element
* is determined and is then passed to an appropriate handler function.
......@@ -418,6 +429,7 @@ void oz_usb_rx(struct oz_pd *pd, struct oz_elt *elt)
done:
oz_usb_put(usb_ctx);
}
/*------------------------------------------------------------------------------
* Context: softirq, process
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment