aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_util.c
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2017-09-17 23:40:16 +0000
committerConrad Meyer <cem@FreeBSD.org>2017-09-17 23:40:16 +0000
commit2d347b2ef84653fe160cb7d9bc1a64b7c7076a8f (patch)
treee0c6263e1294ea0f62bad821a7c039efe8fe0e36 /sys/compat/linux/linux_util.c
parentd18915fadbf86fbcbc3c7fd01b196192b1812d6b (diff)
Notes
Diffstat (limited to 'sys/compat/linux/linux_util.c')
-rw-r--r--sys/compat/linux/linux_util.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c
index 466c588157c5..61be7b9ab87e 100644
--- a/sys/compat/linux/linux_util.c
+++ b/sys/compat/linux/linux_util.c
@@ -127,14 +127,13 @@ int
linux_driver_get_major_minor(const char *node, int *major, int *minor)
{
struct device_element *de;
+ unsigned long devno;
if (node == NULL || major == NULL || minor == NULL)
return 1;
if (strlen(node) > strlen("pts/") &&
strncmp(node, "pts/", strlen("pts/")) == 0) {
- unsigned long devno;
-
/*
* Linux checks major and minors of the slave device
* to make sure it's a pty device, so let's make him
@@ -147,6 +146,15 @@ linux_driver_get_major_minor(const char *node, int *major, int *minor)
return (0);
}
+ if ((strlen(node) > strlen("drm/") &&
+ strncmp(node, "drm/", strlen("drm/")) == 0) ) {
+ devno = strtoul(node + strlen("drm/"), NULL, 10);
+ *major = 226 + (devno / 256);
+ *minor = devno % 256;
+ return (0);
+ }
+
+
TAILQ_FOREACH(de, &devices, list) {
if (strcmp(node, de->entry.bsd_device_name) == 0) {
*major = de->entry.linux_major;