aircrack-ng / rtl8812au

RTL8812AU/21AU and RTL8814AU driver with monitor mode and frame injection
GNU General Public License v2.0
3.39k stars 749 forks source link

Fix cfg80211 Function Argument Errors and Include Missing Header Files for 5.15.x Linux Kernel Compatibility #1160

Open IamCOD3X opened 3 weeks ago

IamCOD3X commented 3 weeks ago

Summary

This pull request addresses several compatibility issues and ensures smooth operation with the 5.15.x Linux kernel. The changes include:

  1. Fixing the "too few arguments to function cfg80211_ch_switch_started_notify" error by adjusting the number of arguments passed based on the kernel version.
  2. Adding necessary flags to resolve errors related to missing header files, such as "drv_types.h not found".
  3. Incorporating conditionals to support the 5.15.x kernel series specifically.

Changes

  1. Function Argument Fixes:

    • Updated the calls to cfg80211_ch_switch_started_notify:
      • For kernel versions 6.3.0 to less than 6.9.0: Five arguments.
      • For kernel versions 6.1.0 to less than 6.3.0, and 5.15.0 to less than 6.9.0: Four arguments.
      • For kernel versions 5.15.78 and above: Four arguments.
      • For kernel versions 5.11.0 to less than 5.15.0, or RHEL version 8.0 or higher: Three arguments.
      • For versions lower than 5.11.0: Two arguments.
    • Updated the calls to cfg80211_ch_switch_notify:
      • For kernel versions 6.3.0 to less than 6.9.0: Four arguments.
      • For kernel versions 5.19.2 and above: Three arguments.
      • For kernel versions 5.15.0 to less than 6.9.0, and 5.15.78 and above: Three arguments.
      • For versions lower than 5.15.0: Two arguments.
  2. Header File Fixes:

    • Added flags to include paths for header files to fix errors like "drv_types.h not found".
  3. Other Compatibility Fixes:

    • Ensured correct handling of key management functions with added link_id parameter for kernel versions 5.15.78 and above.
    • Adjusted cfg80211_rtw_stop_ap and cfg80211_rtw_get_channel functions to accommodate additional parameters in 5.15.78 and above.
    • Updated rtw_cfg80211_indicate_connect and other related functions for proper field assignments in kernel 5.15.78 and above.

Motivation

These changes ensure compatibility with the 5.15.x Linux kernel, preventing build errors related to function argument mismatches and header file issues. This is crucial for maintaining stability and functionality across different kernel versions.

Testing

Additional Notes