From e086a3698af911a8c5da839c5345a39826bab5b1 Mon Sep 17 00:00:00 2001 From: Ismayil Taghi-Zada Date: Fri, 16 Sep 2022 20:55:36 +0400 Subject: [PATCH 1/3] Add .gitignore; adapt kbdmxe.c and acpi_video_dell.c to compile in FreeBSD 13. Changes not tested yet! --- .gitignore | 4 ++++ acpi_video_dell/acpi_video_dell.c | 2 +- kbdmxe/kbdmxe.c | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c30504 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.o +.h +.ko +x86/ diff --git a/acpi_video_dell/acpi_video_dell.c b/acpi_video_dell/acpi_video_dell.c index c91db4f..ac2d2ce 100644 --- a/acpi_video_dell/acpi_video_dell.c +++ b/acpi_video_dell/acpi_video_dell.c @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD: releng/11.0/sys/dev/acpica/acpi_video_dell.c 295939 2016-02- #include #include #include - +#include #include #include diff --git a/kbdmxe/kbdmxe.c b/kbdmxe/kbdmxe.c index d32bb72..45f3988 100644 --- a/kbdmxe/kbdmxe.c +++ b/kbdmxe/kbdmxe.c @@ -52,11 +52,11 @@ #include #include #include +#include #include #include #include #include - /* the initial key map, accent map and fkey strings */ #ifdef KBDMXE_DFLT_KEYMAP #define KBD_DFLT_KEYMAP @@ -136,7 +136,7 @@ struct kbdmxe_kbd }; typedef struct kbdmxe_kbd kbdmxe_kbd_t; - +typedef void timeout_t (void *); /* * kbdmxe state */ @@ -369,9 +369,9 @@ static keyboard_switch_t kbdmxesw = { .clear_state = kbdmxe_clear_state, .get_state = kbdmxe_get_state, .set_state = kbdmxe_set_state, - .get_fkeystr = genkbd_get_fkeystr, + .get_fkeystr = kbdd_get_fkeystr, .poll = kbdmxe_poll, - .diag = genkbd_diag, + .diag = kbdd_diag, }; /* From e5bb2b39cac1ad46ae1296c81f44641773358095 Mon Sep 17 00:00:00 2001 From: Ismayil Taghi-Zada Date: Fri, 16 Sep 2022 21:04:40 +0400 Subject: [PATCH 2/3] Update README.md --- README.md | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 60a3796..8a47bac 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ not switch off NCQ during the installation the data written on the disk will be corrupted and the installation will fail. Therefore before booting the kernel at the loader prompt type - kern.cam.ada.0.quirks="0x2" + `kern.cam.ada.0.quirks="0x2"` to switch off NCQ for the SSD. Be careful to do this everytime you boot the installation medium. @@ -22,30 +22,30 @@ after you boot into it. Be sure that `/boot/device.hints` contains - hint.acpi_throttle.0.disabled="1" - hint.p4tcc.0.disabled="1" + `hint.acpi_throttle.0.disabled="1"` + `hint.p4tcc.0.disabled="1"` Add the lines if they are not there. For power saving of the graphics card and the sound system and of PCI devices for which there is no driver add - drm.i915.enable_rc6=7 - hw.snd.latency=7 - hw.pci.do_power_nodriver=3 + `drm.i915.enable_rc6=7` + `hw.snd.latency=7` + `hw.pci.do_power_nodriver=3` to `/boot/loader.conf`. And finally activate `powerd` in `/etc/rc.conf`: - powerd_enable="YES" - economy_cx_lowest="Cmax" - performance_cx_lowest="Cmax" + `powerd_enable="YES"` + `economy_cx_lowest="Cmax"` + `performance_cx_lowest="Cmax"` It is vital that the graphics drivers are *not* loaded during boot but by adding them to the `kld_list` in `/etc/rc.conf`: - kld_list+=' drm2 i915kms' + `kld_list+=' i915kms'` I experienced failures of `powerd` if I did otherwise; the power consumption when running on battery never dropped below 14 W if the @@ -64,11 +64,11 @@ interface of the network card has to be changed. The following lines in `/etc/rc.conf` produce a working failover configuration of the wifi and the network card. - ifconfig_em0="up" + ```ifconfig_em0="up" ifconfig_emo_alias0="ether xx:xx:xx:xx:xx:xx" wlans_iwm0="wlan0" ifconfig_wlan0="WPA" cloned_interfaces="lagg0" - ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP" + ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP"` `xx:xx:xx:xx:xx:xx` stands for the ethernet address of the wifi card. It can be found with `ifconfig`. Comment out the second and @@ -90,7 +90,7 @@ versions. Suspend/Resume does not require a reset of the video stack. Therefore set it to `0` in `/boot/loader.conf` - hw.acpi.reset_video="0" + `hw.acpi.reset_video="0"` which is the default anyway. @@ -105,25 +105,17 @@ files to `/boot/modules/`. Load the modules in the usual way by adding either - kbdmxe_load="YES" acpi_dell_wmi_load="YES" + `acpi_dell_wmi_load="YES"` to `/boot/loader.conf` or by adding the line - kld_list+=' kbdmxe acpi_dell_wmi' + `kld_list+=' acpi_dell_wmi'` to `/etc/rc.conf`. -`kbdmux` and `kbdmxe` do not play well together as they use the -same resources. So deactivate `kbdmux` by putting the following -line into `/boot/device.hints` - - hint.kbdmux.0.disabled="1" - -To activate `kbdmxe` copy the file `kbdmxe` from the `rc.d` directory -in this repository to `/usr/local/etc/rc.d`. And activate the script -in `/etc/rc.conf` with the line - - kbdmxe_enable="YES" +Leave kbdmxe, don't compile it, with it keyboard doesn't work in X11. +KBDMXE here is ACPI subsystem in devd; it controls Media buttons(pause, prev, next, Volume Up/Down). +Those can work without KBDMXE, just bind it in your DE/WM to corresponding script in control-tools/ directory. To be able to control the LCD brightness we need the functionality of the kernel module `acpi_video`. Unfortunately it reacts on the @@ -133,12 +125,12 @@ there is an altered version `acpi_video_dell` in this repository which you should build and copy to `/boot/modules/` and load it in the usual way with - acpi_video_dell_load="YES" + `acpi_video_dell_load="YES"` in `/boot/loader.conf` or by adding the module to the list in `/etc/rc.conf` - kld_list+=' acpi_video_dell" + `kld_list+=' acpi_video_dell"` An example of how `devd` can be configure to react on the various notifications delivered by `kbdmxe` and `acpi_dell_wmi` is shown From eb24ffebe4dacd57c61cbbbdee6244539eda00f8 Mon Sep 17 00:00:00 2001 From: Ismayil Taghi-Zada Date: Fri, 16 Sep 2022 21:06:42 +0400 Subject: [PATCH 3/3] Revert "Update README.md" This reverts commit e5bb2b39cac1ad46ae1296c81f44641773358095. --- README.md | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 8a47bac..60a3796 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ not switch off NCQ during the installation the data written on the disk will be corrupted and the installation will fail. Therefore before booting the kernel at the loader prompt type - `kern.cam.ada.0.quirks="0x2"` + kern.cam.ada.0.quirks="0x2" to switch off NCQ for the SSD. Be careful to do this everytime you boot the installation medium. @@ -22,30 +22,30 @@ after you boot into it. Be sure that `/boot/device.hints` contains - `hint.acpi_throttle.0.disabled="1"` - `hint.p4tcc.0.disabled="1"` + hint.acpi_throttle.0.disabled="1" + hint.p4tcc.0.disabled="1" Add the lines if they are not there. For power saving of the graphics card and the sound system and of PCI devices for which there is no driver add - `drm.i915.enable_rc6=7` - `hw.snd.latency=7` - `hw.pci.do_power_nodriver=3` + drm.i915.enable_rc6=7 + hw.snd.latency=7 + hw.pci.do_power_nodriver=3 to `/boot/loader.conf`. And finally activate `powerd` in `/etc/rc.conf`: - `powerd_enable="YES"` - `economy_cx_lowest="Cmax"` - `performance_cx_lowest="Cmax"` + powerd_enable="YES" + economy_cx_lowest="Cmax" + performance_cx_lowest="Cmax" It is vital that the graphics drivers are *not* loaded during boot but by adding them to the `kld_list` in `/etc/rc.conf`: - `kld_list+=' i915kms'` + kld_list+=' drm2 i915kms' I experienced failures of `powerd` if I did otherwise; the power consumption when running on battery never dropped below 14 W if the @@ -64,11 +64,11 @@ interface of the network card has to be changed. The following lines in `/etc/rc.conf` produce a working failover configuration of the wifi and the network card. - ```ifconfig_em0="up" + ifconfig_em0="up" ifconfig_emo_alias0="ether xx:xx:xx:xx:xx:xx" wlans_iwm0="wlan0" ifconfig_wlan0="WPA" cloned_interfaces="lagg0" - ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP"` + ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP" `xx:xx:xx:xx:xx:xx` stands for the ethernet address of the wifi card. It can be found with `ifconfig`. Comment out the second and @@ -90,7 +90,7 @@ versions. Suspend/Resume does not require a reset of the video stack. Therefore set it to `0` in `/boot/loader.conf` - `hw.acpi.reset_video="0"` + hw.acpi.reset_video="0" which is the default anyway. @@ -105,17 +105,25 @@ files to `/boot/modules/`. Load the modules in the usual way by adding either - `acpi_dell_wmi_load="YES"` + kbdmxe_load="YES" acpi_dell_wmi_load="YES" to `/boot/loader.conf` or by adding the line - `kld_list+=' acpi_dell_wmi'` + kld_list+=' kbdmxe acpi_dell_wmi' to `/etc/rc.conf`. -Leave kbdmxe, don't compile it, with it keyboard doesn't work in X11. -KBDMXE here is ACPI subsystem in devd; it controls Media buttons(pause, prev, next, Volume Up/Down). -Those can work without KBDMXE, just bind it in your DE/WM to corresponding script in control-tools/ directory. +`kbdmux` and `kbdmxe` do not play well together as they use the +same resources. So deactivate `kbdmux` by putting the following +line into `/boot/device.hints` + + hint.kbdmux.0.disabled="1" + +To activate `kbdmxe` copy the file `kbdmxe` from the `rc.d` directory +in this repository to `/usr/local/etc/rc.d`. And activate the script +in `/etc/rc.conf` with the line + + kbdmxe_enable="YES" To be able to control the LCD brightness we need the functionality of the kernel module `acpi_video`. Unfortunately it reacts on the @@ -125,12 +133,12 @@ there is an altered version `acpi_video_dell` in this repository which you should build and copy to `/boot/modules/` and load it in the usual way with - `acpi_video_dell_load="YES"` + acpi_video_dell_load="YES" in `/boot/loader.conf` or by adding the module to the list in `/etc/rc.conf` - `kld_list+=' acpi_video_dell"` + kld_list+=' acpi_video_dell" An example of how `devd` can be configure to react on the various notifications delivered by `kbdmxe` and `acpi_dell_wmi` is shown