Commit 0d903b8b authored by Gilles Chanteperdrix's avatar Gilles Chanteperdrix Committed by Philippe Gerum
Browse files

rtnet: add more netdev compatibility functions

Needed for newer versions of drivers
parent 9aa9eb21
......@@ -46,6 +46,8 @@
#define NETIF_F_LLTX 4096
#endif
#define RTDEV_TX_OK 0
#define RTDEV_TX_BUSY 1
enum rtnet_link_state {
__RTNET_LINK_STATE_XOFF = 0,
......@@ -156,7 +158,6 @@ struct rtnet_device {
struct rtskb *skb);
};
struct rtnet_core_cmd;
struct rtdev_event_hook {
......@@ -229,6 +230,37 @@ void rtdev_unmap_rtskb(struct rtskb *skb);
struct rtskb *rtnetdev_alloc_rtskb(struct rtnet_device *dev, unsigned int size);
#define rtnetdev_priv(dev) ((dev)->priv)
#define rtdev_emerg(__dev, format, args...) \
pr_emerg("%s: " format, (__dev)->name, ##args)
#define rtdev_alert(__dev, format, args...) \
pr_alert("%s: " format, (__dev)->name, ##args)
#define rtdev_crit(__dev, format, args...) \
pr_crit("%s: " format, (__dev)->name, ##args)
#define rtdev_err(__dev, format, args...) \
pr_err("%s: " format, (__dev)->name, ##args)
#define rtdev_warn(__dev, format, args...) \
pr_warn("%s: " format, (__dev)->name, ##args)
#define rtdev_notice(__dev, format, args...) \
pr_notice("%s: " format, (__dev)->name, ##args)
#define rtdev_info(__dev, format, args...) \
pr_info("%s: " format, (__dev)->name, ##args)
#define rtdev_dbg(__dev, format, args...) \
pr_debug("%s: " format, (__dev)->name, ##args)
#ifdef VERBOSE_DEBUG
#define rtdev_vdbg rtdev_dbg
#else
#define rtdev_vdbg(__dev, format, args...) \
({ \
if (0) \
pr_debug("%s: " format, (__dev)->name, ##args); \
\
0; \
})
#endif
#endif /* __KERNEL__ */
#endif /* __RTDEV_H_ */
......@@ -295,6 +295,18 @@ extern void kfree_rtskb(struct rtskb *skb);
#define dev_kfree_rtskb(a) kfree_rtskb(a)
#define rtskb_checksum_none_assert(skb) (skb->ip_summed = CHECKSUM_NONE)
static inline void rtskb_tx_timestamp(struct rtskb *skb)
{
nanosecs_abs_t *ts = skb->xmit_stamp;
if (!ts)
return;
*ts = cpu_to_be64(rtdm_clock_read() + *ts);
}
/***
* rtskb_queue_init - initialize the queue
* @queue
......
......@@ -129,14 +129,6 @@
#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
/*
* pointer to private data.
*/
static inline void * rtnetdev_priv(struct rtnet_device *rtnet_dev)
{
return (char *)rtnet_dev + ((sizeof(struct rtnet_device) + 31) & ~31);
}
#ifdef CONFIG_RTWLAN_DEBUG
#define RTWLAN_DEBUG_PRINTK(__message...) do{ rtdm_printk(__message); }while(0)
#define RTWLAN_DEBUG(__message,__args...) RTWLAN_DEBUG_PRINTK(KERN_DEBUG "rtwlan->%s: Debug - " __message,__FUNCTION__,##__args);
......
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