Skip to content

Kernel driver - #16

Merged
geohot merged 14 commits into
commaai:masterfrom
diamondman:kernel_driver
Jun 26, 2017
Merged

geohot merged 14 commits into
commaai:masterfrom
diamondman:kernel_driver

Conversation

@diamondman

Copy link
Copy Markdown
Contributor

First version of the Panda Kernel Driver.
Works with all 3 CNA interfaces of the Panda.
Passes workbench test of panda to panda communication.

Comment thread driver/panda.c
@@ -0,0 +1,612 @@
/**
* @file panda.c
* @author Jeddy Diamond Exum

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, typo in your name

Comment thread driver_test/Makefile
@@ -0,0 +1,2 @@
all:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to driver/linux/test

Comment thread driver/.gitignore
@@ -0,0 +1,6 @@
.*.cmd

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to driver/linux/

Expecting a windows driver soon

Comment thread driver/panda.c

module_usb_driver(panda_usb_driver);

MODULE_LICENSE("GPL");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any issue with "Dual MIT/GPL"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code largely influenced by an existing kernel driver. GPL is likely required.

Comment thread driver/panda.c
return -ENOMEM;
}

usb_fill_int_urb(urb, priv_dev->udev,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call panda_usb_read_int_callback to trigger this to avoid copied code?

Comment thread driver/panda.c
usb_rcvintpipe(priv_dev->udev, 1),
urb->transfer_buffer, PANDA_USB_RX_BUFF_SIZE,
panda_usb_read_int_callback, priv_dev, 5);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does URB_NO_TRANSFER_DMA_MAP have to be set here? If not, why is it set for the first usb_fill_int_urb?

@geohot
geohot merged commit b81c62c into commaai:master Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants