#define WPRINTK(fmt, args...) \
printk(KERN_WARNING "netfront/accel: " fmt, ##args)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 5)
+#define kref_init(x,y) kref_init(x,y)
+#define kref_put(x,y) kref_put(x)
+#else
+#define kref_init(x,y) kref_init(x)
+#define kref_put(x,y) kref_put(x,y)
+#endif
+
/*
* List of all netfront accelerator plugin modules available. Each
* list entry is of type struct netfront_accelerator.
*/
kref_get(&vif_state->np->accelerator->accel_kref);
/* This persists until vif_state->hooks are cleared */
- kref_init(&vif_state->vif_kref);
+ kref_init(&vif_state->vif_kref, vif_kref_release);
/* Make sure there are no data path operations going on */
netif_poll_disable(vif_state->np->netdev);
* persist until the accelerator hooks are removed (e.g. by
* accelerator module unload)
*/
- kref_init(&accelerator->accel_kref);
+ kref_init(&accelerator->accel_kref, accel_kref_release);
/*
* Store the hooks for future calls to probe a new device, and