#include <net/sock.h>
#include <linux/can.h>
#include <linux/miscdevice.h>
-#include "canethgw.h"
+#include <linux/can/canethgw.h>
MODULE_LICENSE("GPL");
+struct cegw_job
+{
+ struct kref refcount;
+ struct socket* can_sock;
+ struct socket* udp_sock;
+ __u32 udp_dstcnt;
+ struct sockaddr_in udp_dst[0];
+};
+
static int cegw_udp2can(void *data);
static int cegw_udp_send(struct socket *udp_sock, struct can_frame *cf,
struct sockaddr_in* addr);
if (addrlen != sizeof(struct sockaddr_in))
return -EAFNOSUPPORT;
- /* */
job = kmalloc(GFP_KERNEL, sizeof(*job) + dstcnt*addrlen );
if (job == NULL)
return -ENOMEM;
static long cegw_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
- int err;
+ long err;
switch (cmd) {
case CEGW_IOCTL_START:
static int __init cegw_init(void)
{
- misc_register(&cegw_device);
-
- return 0;
+ return misc_register(&cegw_device);
}
static void __exit cegw_exit(void)
module_init(cegw_init);
module_exit(cegw_exit);
-