This patch fixes Kernel Documentation style.
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
#include "ozpd.h"
#include "ozproto.h"
#include "ozcdev.h"
-/*------------------------------------------------------------------------------
- */
+
#define OZ_RD_BUF_SZ 256
struct oz_cdev {
dev_t devnum;
int rd_in;
int rd_out;
};
-/*------------------------------------------------------------------------------
- */
+
static struct oz_cdev g_cdev;
static struct class *g_oz_class;
-/*------------------------------------------------------------------------------
+/*
* Context: process and softirq
*/
static struct oz_serial_ctx *oz_cdev_claim_ctx(struct oz_pd *pd)
return ctx;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
static void oz_cdev_release_ctx(struct oz_serial_ctx *ctx)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_cdev_open(struct inode *inode, struct file *filp)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_cdev_release(struct inode *inode, struct file *filp)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static ssize_t oz_cdev_read(struct file *filp, char __user *buf, size_t count,
return count;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static ssize_t oz_cdev_write(struct file *filp, const char __user *buf,
return count;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_set_active_pd(const u8 *addr)
return rc;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static long oz_cdev_ioctl(struct file *filp, unsigned int cmd,
return rc;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static unsigned int oz_cdev_poll(struct file *filp, poll_table *wait)
return ret;
}
-/*------------------------------------------------------------------------------
+/*
*/
static const struct file_operations oz_fops = {
.owner = THIS_MODULE,
.poll = oz_cdev_poll
};
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
int oz_cdev_register(void)
return err;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
int oz_cdev_deregister(void)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
int oz_cdev_init(void)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
void oz_cdev_term(void)
oz_app_enable(OZ_APPID_SERIAL, 0);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
int oz_cdev_start(struct oz_pd *pd, int resume)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_cdev_stop(struct oz_pd *pd, int pause)
oz_dbg(ON, "Serial service stopped\n");
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
void oz_cdev_rx(struct oz_pd *pd, struct oz_elt *elt)
#include "ozeltbuf.h"
#include "ozpd.h"
-/*------------------------------------------------------------------------------
- */
#define OZ_ELT_INFO_MAGIC_USED 0x35791057
#define OZ_ELT_INFO_MAGIC_FREE 0x78940102
-/*------------------------------------------------------------------------------
+
+/*
* Context: softirq-serialized
*/
int oz_elt_buf_init(struct oz_elt_buf *buf)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_elt_buf_term(struct oz_elt_buf *buf)
buf->free_elts = 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
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
*/
spin_unlock_bh(&buf->lock);
}
-/*------------------------------------------------------------------------------
- */
int oz_elt_stream_create(struct oz_elt_buf *buf, u8 id, int max_buf_count)
{
struct oz_elt_stream *st;
return 0;
}
-/*------------------------------------------------------------------------------
- */
int oz_elt_stream_delete(struct oz_elt_buf *buf, u8 id)
{
struct list_head *e;
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)
{
if (atomic_dec_and_test(&st->ref_count)) {
}
}
-/*------------------------------------------------------------------------------
+/*
* Precondition: Element buffer lock must be held.
* If this function fails the caller is responsible for deallocating the elt
* info structure.
return 0;
}
-/*------------------------------------------------------------------------------
- */
int oz_select_elts_for_tx(struct oz_elt_buf *buf, u8 isoc, unsigned *len,
unsigned max_len, struct list_head *list)
{
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)
{
struct list_head *free = NULL;
#include "ozurbparanoia.h"
#include "ozhcd.h"
-/*------------------------------------------------------------------------------
+/*
* Number of units of buffering to capture for an isochronous IN endpoint before
* allowing data to be indicated up.
*/
*/
#define EP0_TIMEOUT_COUNTER 13
-/*------------------------------------------------------------------------------
+/*
* Used to link urbs together and also store some status information for each
* urb.
* A cache of these are kept in a pool to reduce number of calls to kmalloc.
*/
#define OZ_HDC_F_SUSPENDED 0x1
-/*------------------------------------------------------------------------------
+/*
* Static function prototypes.
*/
static int oz_hcd_start(struct usb_hcd *hcd);
struct urb *urb);
static void oz_hcd_clear_orphanage(struct oz_hcd *ozhcd, int status);
-/*------------------------------------------------------------------------------
+/*
* Static external variables.
*/
static struct platform_device *g_plat_dev;
},
};
-/*------------------------------------------------------------------------------
+/*
* Gets our private context area (which is of type struct oz_hcd) from the
* usb_hcd structure.
* Context: any
return (struct oz_hcd *)hcd->hcd_priv;
}
-/*------------------------------------------------------------------------------
+/*
* Searches list of ports to find the index of the one with a specified USB
* bus address. If none of the ports has the bus address then the connection
* port is returned, if there is one or -1 otherwise.
return ozhcd->conn_port;
}
-/*------------------------------------------------------------------------------
+/*
* Allocates an urb link, first trying the pool but going to heap if empty.
* Context: any
*/
return urbl;
}
-/*------------------------------------------------------------------------------
+/*
* Frees an urb link by putting it in the pool if there is enough space or
* deallocating it to heap otherwise.
* Context: any
}
}
-/*------------------------------------------------------------------------------
+/*
* Deallocates all the urb links in the pool.
* Context: unknown
*/
}
}
-/*------------------------------------------------------------------------------
+/*
* Allocates endpoint structure and optionally a buffer. If a buffer is
* allocated it immediately follows the endpoint structure.
* Context: softirq
return ep;
}
-/*------------------------------------------------------------------------------
+/*
* Pre-condition: Must be called with g_tasklet_lock held and interrupts
* disabled.
* Context: softirq or process
return NULL;
}
-/*------------------------------------------------------------------------------
+/*
* This is called when we have finished processing an urb. It unlinks it from
* the ep and returns it to the core.
* Context: softirq or process
oz_free_urb_link(cancel_urbl);
}
-/*------------------------------------------------------------------------------
+/*
* Deallocates an endpoint including deallocating any associated stream and
* returning any queued urbs to the core.
* Context: softirq
kfree(ep);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static void oz_complete_buffered_urb(struct oz_port *port,
oz_complete_urb(port->ozhcd->hcd, urb, 0);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static int oz_enqueue_ep_urb(struct oz_port *port, u8 ep_addr, int in_dir,
return err;
}
-/*------------------------------------------------------------------------------
+/*
* Removes an urb from the queue in the endpoint.
* Returns 0 if it is found and -EIDRM otherwise.
* Context: softirq
return urbl ? 0 : -EIDRM;
}
-/*------------------------------------------------------------------------------
+/*
* Finds an urb given its request id.
* Context: softirq
*/
return urb;
}
-/*------------------------------------------------------------------------------
+/*
* Pre-condition: Port lock must be held.
* Context: softirq
*/
port->hpd = hpd;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static struct oz_hcd *oz_hcd_claim(void)
return ozhcd;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static inline void oz_hcd_put(struct oz_hcd *ozhcd)
usb_put_hcd(ozhcd->hcd);
}
-/*------------------------------------------------------------------------------
+/*
* This is called by the protocol handler to notify that a PD has arrived.
* We allocate a port to associate with the PD and create a structure for
* endpoint 0. This port is made the connection port.
return NULL;
}
-/*------------------------------------------------------------------------------
+/*
* This is called by the protocol handler to notify that the PD has gone away.
* We need to deallocate all resources and then request that the root hub is
* polled. We release the reference we hold on the PD.
oz_usb_put(hpd);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
void oz_hcd_pd_reset(void *hpd, void *hport)
usb_hcd_poll_rh_status(ozhcd->hcd);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc,
oz_complete_urb(port->ozhcd->hcd, urb, 0);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static void oz_display_conf_type(u8 t)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static void oz_hcd_complete_set_config(struct oz_port *port, struct urb *urb,
oz_complete_urb(hcd, urb, rc);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static void oz_hcd_complete_set_interface(struct oz_port *port, struct urb *urb,
oz_complete_urb(hcd, urb, rc);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode, const u8 *data,
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
static int oz_hcd_buffer_data(struct oz_endpoint *ep, const u8 *data,
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
void oz_hcd_data_ind(void *hport, u8 endpoint, const u8 *data, int data_len)
spin_unlock_bh(&ozhcd->hcd_lock);
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static inline int oz_usb_get_frame_number(void)
return atomic_inc_return(&g_usb_frame_number);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_hcd_heartbeat(void *hport)
return rc;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static int oz_build_endpoints_for_interface(struct usb_hcd *hcd,
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static void oz_clean_endpoints_for_interface(struct usb_hcd *hcd,
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static int oz_build_endpoints_for_config(struct usb_hcd *hcd,
return -1;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static void oz_clean_endpoints_for_config(struct usb_hcd *hcd,
spin_unlock_bh(&ozhcd->hcd_lock);
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static void *oz_claim_hpd(struct oz_port *port)
return hpd;
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static void oz_process_ep0_urb(struct oz_hcd *ozhcd, struct urb *urb,
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static int oz_urb_process(struct oz_hcd *ozhcd, struct urb *urb)
return rc;
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static void oz_urb_process_tasklet(unsigned long unused)
oz_hcd_put(ozhcd);
}
-/*------------------------------------------------------------------------------
+/*
* This function searches for the urb in any of the lists it could be in.
* If it is found it is removed from the list and completed. If the urb is
* being processed then it won't be in a list so won't be found. However, the
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static void oz_urb_cancel_tasklet(unsigned long unused)
oz_hcd_put(ozhcd);
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static void oz_hcd_clear_orphanage(struct oz_hcd *ozhcd, int status)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static int oz_hcd_start(struct usb_hcd *hcd)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static void oz_hcd_stop(struct usb_hcd *hcd)
{
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static void oz_hcd_shutdown(struct usb_hcd *hcd)
{
}
-/*------------------------------------------------------------------------------
+/*
* Called to queue an urb for the device.
* This function should return a non-zero error code if it fails the urb but
* should not call usb_hcd_giveback_urb().
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static struct oz_urb_link *oz_remove_urb(struct oz_endpoint *ep,
return NULL;
}
-/*------------------------------------------------------------------------------
+/*
* Called to dequeue a previously submitted urb for the device.
* Context: any
*/
return rc;
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static void oz_hcd_endpoint_disable(struct usb_hcd *hcd,
{
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static void oz_hcd_endpoint_reset(struct usb_hcd *hcd,
{
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static int oz_hcd_get_frame_number(struct usb_hcd *hcd)
return oz_usb_get_frame_number();
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
* This is called as a consquence of us calling usb_hcd_poll_rh_status() and we
* always do that in softirq context.
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static void oz_get_hub_descriptor(struct usb_hcd *hcd,
desc->bNbrPorts = OZ_NB_PORTS;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_set_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex)
return err;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex)
return err;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_get_port_status(struct usb_hcd *hcd, u16 windex, char *buf)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_hcd_hub_control(struct usb_hcd *hcd, u16 req_type, u16 wvalue,
return err;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_hcd_bus_suspend(struct usb_hcd *hcd)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_hcd_bus_resume(struct usb_hcd *hcd)
return 0;
}
-/*------------------------------------------------------------------------------
- */
static void oz_plat_shutdown(struct platform_device *dev)
{
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_plat_probe(struct platform_device *dev)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static int oz_plat_remove(struct platform_device *dev)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static int oz_plat_suspend(struct platform_device *dev, pm_message_t msg)
}
-/*------------------------------------------------------------------------------
+/*
* Context: unknown
*/
static int oz_plat_resume(struct platform_device *dev)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
int oz_hcd_init(void)
return err;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
void oz_hcd_term(void)
unsigned int oz_dbg_mask = OZ_DEFAULT_DBG_MASK;
-/*------------------------------------------------------------------------------
+/*
* The name of the 802.11 mac device. Empty string is the default value but a
* value can be supplied as a parameter to the module. An empty string means
* bind to nothing. '*' means bind to all netcards - this includes non-802.11
*/
static char *g_net_dev = "";
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int __init ozwpan_init(void)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static void __exit ozwpan_exit(void)
oz_cdev_deregister();
}
-/*------------------------------------------------------------------------------
- */
module_param(g_net_dev, charp, S_IRUGO);
module_init(ozwpan_init);
module_exit(ozwpan_exit);
#include <linux/uaccess.h>
#include <net/psnap.h>
-/*------------------------------------------------------------------------------
- */
#define OZ_MAX_TX_POOL_SIZE 6
-/*------------------------------------------------------------------------------
- */
static struct oz_tx_frame *oz_tx_frame_alloc(struct oz_pd *pd);
static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f);
static void oz_tx_isoc_free(struct oz_pd *pd, struct oz_tx_frame *f);
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);
OZ_APPID_SERIAL},
};
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static int oz_def_app_init(void)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static void oz_def_app_term(void)
{
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
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
*/
void oz_pd_set_state(struct oz_pd *pd, unsigned state)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_pd_get(struct oz_pd *pd)
atomic_inc(&pd->ref_count);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_pd_put(struct oz_pd *pd)
oz_pd_destroy(pd);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
struct oz_pd *oz_pd_alloc(const u8 *mac_addr)
return pd;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_pd_free(struct work_struct *work)
kfree(pd);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or Process
*/
void oz_pd_destroy(struct oz_pd *pd)
oz_pd_dbg(pd, ON, "failed to schedule workitem\n");
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
int oz_services_start(struct oz_pd *pd, u16 apps, int resume)
return rc;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_services_stop(struct oz_pd *pd, u16 apps, int pause)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
void oz_pd_heartbeat(struct oz_pd *pd, u16 apps)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_pd_stop(struct oz_pd *pd)
oz_pd_put(pd);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_pd_sleep(struct oz_pd *pd)
return do_stop;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static struct oz_tx_frame *oz_tx_frame_alloc(struct oz_pd *pd)
return f;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
static void oz_tx_isoc_free(struct oz_pd *pd, struct oz_tx_frame *f)
pd->nb_queued_isoc_frames);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f)
kfree(f);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
static void oz_set_more_bit(struct sk_buff *skb)
oz_hdr->control |= OZ_F_MORE_DATA;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
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
*/
int oz_prepare_frame(struct oz_pd *pd, int empty)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
static struct sk_buff *oz_build_frame(struct oz_pd *pd, struct oz_tx_frame *f)
return NULL;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
static void oz_retire_frame(struct oz_pd *pd, struct oz_tx_frame *f)
oz_trim_elt_pool(&pd->elt_buff);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
static int oz_send_next_queued_frame(struct oz_pd *pd, int more_data)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
void oz_send_queued_frames(struct oz_pd *pd, int backlog)
oz_send_next_queued_frame(pd, 0);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static int oz_send_isoc_frame(struct oz_pd *pd)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
void oz_retire_tx_frames(struct oz_pd *pd, u8 lpn)
}
}
-/*------------------------------------------------------------------------------
+/*
* Precondition: stream_lock must be held.
* Context: softirq
*/
return NULL;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_isoc_stream_create(struct oz_pd *pd, u8 ep_num)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
static void oz_isoc_stream_free(struct oz_isoc_stream *st)
kfree(st);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_isoc_stream_delete(struct oz_pd *pd, u8 ep_num)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: any
*/
static void oz_isoc_destructor(struct sk_buff *skb)
atomic_dec(&g_submitted_isoc);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 *data, int len)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
void oz_apps_init(void)
g_app_if[i].init();
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
void oz_apps_term(void)
g_app_if[i].term();
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt)
ai->rx(pd, elt);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_pd_indicate_farewells(struct oz_pd *pd)
#include <linux/uaccess.h>
#include <net/psnap.h>
-/*------------------------------------------------------------------------------
- */
#define OZ_CF_CONN_SUCCESS 1
#define OZ_CF_CONN_FAILURE 2
#define OZ_MAX_TIMER_POOL_SIZE 16
-/*------------------------------------------------------------------------------
- */
struct oz_binding {
struct packet_type ptype;
char name[OZ_MAX_BINDING_LEN];
struct list_head link;
};
-/*------------------------------------------------------------------------------
+/*
* Static external variables.
*/
static DEFINE_SPINLOCK(g_polling_lock);
static u16 g_apps = 0x1;
static int g_processing_rx;
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
static u8 oz_get_new_session_id(u8 exclude)
return g_session_id;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
static void oz_send_conn_rsp(struct oz_pd *pd, u8 status)
return;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
static void pd_set_keepalive(struct oz_pd *pd, u8 kalive)
oz_dbg(ON, "Keepalive = %lu mSec\n", pd->keep_alive);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
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
*/
static struct oz_pd *oz_connect_req(struct oz_pd *cur_pd, struct oz_elt *elt,
return pd;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
static void oz_add_farewell(struct oz_pd *pd, u8 ep_num, u8 index,
kfree(f2);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
static void oz_rx_frame(struct sk_buff *skb)
consume_skb(skb);
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
void oz_protocol_term(void)
oz_dbg(ON, "Protocol stopped\n");
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
void oz_pd_heartbeat_handler(unsigned long data)
oz_pd_put(pd);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
void oz_pd_timeout_handler(unsigned long data)
oz_pd_put(pd);
}
-/*------------------------------------------------------------------------------
+/*
* Context: Interrupt
*/
enum hrtimer_restart oz_pd_heartbeat_event(struct hrtimer *timer)
return HRTIMER_RESTART;
}
-/*------------------------------------------------------------------------------
+/*
* Context: Interrupt
*/
enum hrtimer_restart oz_pd_timeout_event(struct hrtimer *timer)
return HRTIMER_NORESTART;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_timer_add(struct oz_pd *pd, int type, unsigned long due_time)
spin_unlock_bh(&g_polling_lock);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_pd_request_heartbeat(struct oz_pd *pd)
pd->pulse_period : OZ_QUANTUM);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
struct oz_pd *oz_pd_find(const u8 *mac_addr)
return NULL;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
void oz_app_enable(int app_id, int enable)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static int oz_pkt_recv(struct sk_buff *skb, struct net_device *dev,
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
void oz_binding_add(const char *net_dev)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static void pd_stop_all_for_device(struct net_device *net_dev)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
void oz_binding_remove(const char *net_dev)
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
static char *oz_get_next_device_name(char *s, char *dname, int max_size)
return s;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
int oz_protocol_init(char *devs)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: process
*/
int oz_get_pd_list(struct oz_mac_addr *addr, int max_count)
return count;
}
-/*------------------------------------------------------------------------------
-*/
void oz_polling_lock_bh(void)
{
spin_lock_bh(&g_polling_lock);
}
-/*------------------------------------------------------------------------------
-*/
void oz_polling_unlock_bh(void)
{
spin_unlock_bh(&g_polling_lock);
#include "ozurbparanoia.h"
-/*-----------------------------------------------------------------------------
- */
#define OZ_MAX_URBS 1000
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)
{
unsigned long irq_state;
spin_unlock_irqrestore(&g_urb_mem_lock, irq_state);
}
-/*------------------------------------------------------------------------------
+/*
*/
int oz_forget_urb(struct urb *urb)
{
#include "ozhcd.h"
#include "ozusbsvc.h"
-/*------------------------------------------------------------------------------
+/*
* This is called once when the driver is loaded to initialise the USB service.
* Context: process
*/
return oz_hcd_init();
}
-/*------------------------------------------------------------------------------
+/*
* This is called once when the driver is unloaded to terminate the USB service.
* Context: process
*/
oz_hcd_term();
}
-/*------------------------------------------------------------------------------
+/*
* This is called when the USB service is started or resumed for a PD.
* Context: softirq
*/
return rc;
}
-/*------------------------------------------------------------------------------
+/*
* This is called when the USB service is stopped or paused for a PD.
* Context: softirq or process
*/
}
}
-/*------------------------------------------------------------------------------
+/*
* 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.
* Context: softirq
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.
* Context: irq or process
}
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_usb_heartbeat(struct oz_pd *pd)
return rc;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_usb_stream_create(void *hpd, u8 ep_num)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_usb_stream_delete(void *hpd, u8 ep_num)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq or process
*/
void oz_usb_request_heartbeat(void *hpd)
#include "ozhcd.h"
#include "ozusbsvc.h"
-/*------------------------------------------------------------------------------
- */
#define MAX_ISOC_FIXED_DATA (253-sizeof(struct oz_isoc_fixed))
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
static int oz_usb_submit_elt(struct oz_elt_buf *eb, struct oz_elt_info *ei,
return ret;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_usb_get_desc_req(void *hpd, u8 req_id, u8 req_type, u8 desc_type,
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static int oz_usb_set_config_req(void *hpd, u8 req_id, u8 index)
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static int oz_usb_set_interface_req(void *hpd, u8 req_id, u8 index, u8 alt)
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static int oz_usb_set_clear_feature_req(void *hpd, u8 req_id, u8 type,
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
static int oz_usb_vendor_class_req(void *hpd, u8 req_id, u8 req_type,
return oz_usb_submit_elt(eb, ei, usb_ctx, 0, 0);
}
-/*------------------------------------------------------------------------------
+/*
* Context: tasklet
*/
int oz_usb_control_req(void *hpd, u8 req_id, struct usb_ctrlrequest *setup,
return rc;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq
*/
int oz_usb_send_isoc(void *hpd, u8 ep_num, struct urb *urb)
return 0;
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq-serialized
*/
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.
* Context: softirq-serialized
oz_usb_put(usb_ctx);
}
-/*------------------------------------------------------------------------------
+/*
* Context: softirq, process
*/
void oz_usb_farewell(struct oz_pd *pd, u8 ep_num, u8 *data, u8 len)