nix-community / acpi_call

A linux kernel module that enables calls to ACPI methods through /proc/acpi/call. [maintainer=@teleshoes /@Mic92]
GNU General Public License v3.0
80 stars 23 forks source link

Increase buffer size to fit large packages, e.g. _PRT #22

Closed dunkaist closed 2 years ago

dunkaist commented 2 years ago

_PRT (PCI Route Table) can be a large package with dozens of entries. Each entry is a package of four entries. Thus often BUFFER_SIZE of 256B is not enough. This pull request is to increase the limit and fix the accompanying compiler warning.

Before:

[root@desk acpi_call]# echo '\_SB_.PCI0._PRT' > /proc/acpi/call 
[root@desk acpi_call]# cat /proc/acpi/call
[[0x8ffff, 0x0, 0x0, 0x2b], ..., [0x1ffff, 0x2, 0x0, 0x2a], [0x1fff[root@desk acpi_call]#

After:

[root@desk acpi_call]# echo '\_SB_.PCI0._PRT' > /proc/acpi/call 
[root@desk acpi_call]# cat /proc/acpi/call
[[0x8ffff, 0x0, 0x0, 0x2b], ..., [0x1ffff, 0x2, 0x0, 0x2a], [0x1ffff, 0x3, 0x0, 0x2b]][root@desk acpi_call]#
teleshoes commented 2 years ago

looks good to me. thanks!