int irda_device_set_raw_mode(struct net_device* self, int status);
int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts);
int irda_device_change_speed(struct net_device *dev, __u32 speed);
-void irda_device_setup(struct net_device *dev);
struct net_device *alloc_irdadev(int sizeof_priv);
/* Dongle interface */
* Utility function for getting the minimum turnaround time out of
* the skb, where it has been hidden in the cb field.
*/
-#define irda_get_mtt(skb) ( \
- IRDA_MIN(10000, \
- (((struct irda_skb_cb *) skb->cb)->magic == LAP_MAGIC) ? \
- ((struct irda_skb_cb *)(skb->cb))->mtt : 10000 \
- ) \
-)
-
-#if 0
-extern inline __u16 irda_get_mtt(struct sk_buff *skb)
+static inline __u16 irda_get_mtt(const struct sk_buff *skb)
{
- __u16 mtt;
-
- if (((struct irda_skb_cb *)(skb->cb))->magic != LAP_MAGIC)
- mtt = 10000;
- else
- mtt = ((struct irda_skb_cb *)(skb->cb))->mtt;
-
- ASSERT(mtt <= 10000, return 10000;);
-
- return mtt;
+ const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->cb;
+ return (cb->magic == LAP_MAGIC) ? cb->mtt : 10000;
}
-#endif
/*
* Function irda_get_next_speed (skb)
*
* Note : return -1 for user space frames
*/
-#define irda_get_next_speed(skb) ( \
- (((struct irda_skb_cb*) skb->cb)->magic == LAP_MAGIC) ? \
- ((struct irda_skb_cb *)(skb->cb))->next_speed : -1 \
-)
-
-#if 0
-extern inline __u32 irda_get_next_speed(struct sk_buff *skb)
+static inline __u32 irda_get_next_speed(const struct sk_buff *skb)
{
- __u32 speed;
-
- if (((struct irda_skb_cb *)(skb->cb))->magic != LAP_MAGIC)
- speed = -1;
- else
- speed = ((struct irda_skb_cb *)(skb->cb))->next_speed;
-
- return speed;
+ const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->cb;
+ return (cb->magic == LAP_MAGIC) ? cb->next_speed : -1;
}
-#endif
/*
* Function irda_get_next_xbofs (skb)
*
* Note : default to 10 for user space frames
*/
-#define irda_get_xbofs(skb) ( \
- (((struct irda_skb_cb*) skb->cb)->magic == LAP_MAGIC) ? \
- ((struct irda_skb_cb *)(skb->cb))->xbofs : 10 \
-)
+static inline __u16 irda_get_xbofs(const struct sk_buff *skb)
+{
+ const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->cb;
+ return (cb->magic == LAP_MAGIC) ? cb->xbofs : 10;
+}
/*
* Function irda_get_next_xbofs (skb)
*
* Note : return -1 for user space frames
*/
-#define irda_get_next_xbofs(skb) ( \
- (((struct irda_skb_cb*) skb->cb)->magic == LAP_MAGIC) ? \
- ((struct irda_skb_cb *)(skb->cb))->next_xbofs : -1 \
-)
-
+static inline __u16 irda_get_next_xbofs(const struct sk_buff *skb)
+{
+ const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->cb;
+ return (cb->magic == LAP_MAGIC) ? cb->next_xbofs : -1;
+}
#endif /* IRDA_DEVICE_H */
irlap_stop_mbusy_timer(self);
}
}
+EXPORT_SYMBOL(irda_device_set_media_busy);
+
int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts)
{
task->state = state;
}
+EXPORT_SYMBOL(irda_task_next_state);
static void __irda_task_delete(struct irda_task *task)
{
struct irda_task *parent, void *param)
{
struct irda_task *task;
- int ret;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
hashbin_insert(tasks, (irda_queue_t *) task, (long) task, NULL);
/* No time to waste, so lets get going! */
- ret = irda_task_kick(task);
- if (ret)
- return NULL;
- else
- return task;
+ return irda_task_kick(task) ? NULL : task;
}
+EXPORT_SYMBOL(irda_task_execute);
/*
* Function irda_task_timer_expired (data)
{
return alloc_netdev(sizeof_priv, "irda%d", irda_device_setup);
}
+EXPORT_SYMBOL(alloc_irdadev);
/*
* Function irda_device_init_dongle (self, type, qos)
spin_unlock(&dongles->hb_spinlock);
return dongle;
}
+EXPORT_SYMBOL(irda_device_dongle_init);
/*
* Function irda_device_dongle_cleanup (dongle)
return 0;
}
+EXPORT_SYMBOL(irda_device_dongle_cleanup);
/*
* Function irda_device_register_dongle (dongle)
return 0;
}
+EXPORT_SYMBOL(irda_device_register_dongle);
/*
* Function irda_device_unregister_dongle (dongle)
ERROR("%s: dongle not found!\n", __FUNCTION__);
spin_unlock(&dongles->hb_spinlock);
}
+EXPORT_SYMBOL(irda_device_unregister_dongle);
/*
* Function irda_device_set_mode (self, mode)
/* IrLAP */
EXPORT_SYMBOL(irda_init_max_qos_capabilies);
EXPORT_SYMBOL(irda_qos_bits_to_value);
-EXPORT_SYMBOL(irda_device_setup);
-EXPORT_SYMBOL(alloc_irdadev);
-EXPORT_SYMBOL(irda_device_set_media_busy);
-EXPORT_SYMBOL(irda_device_txqueue_empty);
-
-EXPORT_SYMBOL(irda_device_dongle_init);
-EXPORT_SYMBOL(irda_device_dongle_cleanup);
-EXPORT_SYMBOL(irda_device_register_dongle);
-EXPORT_SYMBOL(irda_device_unregister_dongle);
-EXPORT_SYMBOL(irda_task_execute);
-EXPORT_SYMBOL(irda_task_next_state);
-EXPORT_SYMBOL(irda_task_delete);
#ifdef CONFIG_IRDA_DEBUG