libinput, linux-kpi, iwlwifi: remove a shadowing header, add missing prototypes

Three defects that were latent until GCC 14+ made implicit declarations
and pointer-type mismatches errors. None was a missing implementation --
in every case the code existed and only the declaration was wrong.

libinput
  Carried its own bundled libudev.h that shadowed the real one from the
  libudev recipe, which it already declares as a dependency. The bundled
  copy lacked udev_device_get_sysattr_value(), so udev/libinput-device-
  group.c got an implicit declaration and then an int-to-pointer
  assignment. The real header is a strict superset -- nothing is declared
  in the bundled copy that the real one lacks -- so the bundled file is
  dead code that shadows a real implementation, which
  LOCAL-FORK-SUPREMACY-POLICY.md Rule 4 requires removing.

linux-kpi
  ieee80211_register_rx_handler() is fully implemented in
  src/rust_impl/mac80211.rs as #[no_mangle] extern "C", and
  ieee80211_rx_drain()'s own doc comment refers to it, but it was never
  declared in c_headers/net/mac80211.h. Declared it.

redbear-iwlwifi
  - rb_iwlwifi_bridge_register_rx() is used ~1800 lines before its
    definition with no forward declaration. Added one at file scope.
  - bridge_rx_callback was declared here as taking void *hw, while its
    Rust definition in src/bridge/callback.rs takes *mut Ieee80211Hw and
    linux-kpi's RxCallback type expects struct ieee80211_hw *. The C
    declaration was simply wrong; corrected to match the implementation.

All three cook clean.
This commit is contained in:
2026-08-03 16:28:40 +03:00
parent af03420bcc
commit 46abc404a2
3 changed files with 18 additions and 66 deletions
@@ -289,6 +289,13 @@ extern struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, const u
extern void ieee80211_beacon_loss(struct ieee80211_vif *vif);
extern void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb);
extern size_t ieee80211_rx_drain(struct ieee80211_hw *hw);
/* Implemented in src/rust_impl/mac80211.rs (#[no_mangle] extern "C").
Registers a per-hw callback that ieee80211_rx_drain() delivers frames to
instead of logging and freeing them. The declaration was missing, so C
callers got an implicit declaration -- fatal from GCC 14 on. */
extern void ieee80211_register_rx_handler(struct ieee80211_hw *hw,
void (*callback)(struct ieee80211_hw *hw,
struct sk_buff *skb));
extern void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb);
extern void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue);
extern void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue);
@@ -30,6 +30,11 @@
#include <stdio.h>
#include <string.h>
/* Defined further down in this file; declared here because the first use
precedes the definition by ~1800 lines and an implicit declaration is
an error from GCC 14 on. */
void rb_iwlwifi_bridge_register_rx(struct ieee80211_hw *hw);
// Known gaps vs Linux 7.1 iwlwifi (drivers/net/wireless/intel/iwlwifi/):
// Mini-MVM present (linux_mvm.c) — RW descriptor parsing, signal extraction,
// firmware TLV metadata, Minstrel rate adaptation, thermal management
@@ -2684,7 +2689,12 @@ int rb_iwlwifi_register_mac80211(struct pci_dev *dev, char *out, unsigned long o
/* ── Bridge registration and TX submission ──────────────────── */
/* Rust callback: bridge/src/callback.rs */
extern void bridge_rx_callback(void *hw, struct sk_buff *skb);
/* Implemented in src/bridge/callback.rs as
unsafe extern "C" fn bridge_rx_callback(*mut Ieee80211Hw, *mut SkBuff)
The first parameter was declared `void *` here, which does not match the
RxCallback type ieee80211_register_rx_handler() takes; GCC 14+ rejects the
mismatch outright rather than warning. */
extern void bridge_rx_callback(struct ieee80211_hw *hw, struct sk_buff *skb);
/* Last registered hw (for TX submission from Rust). */
static struct ieee80211_hw *rb_iwlwifi_bridge_hw;
@@ -1,65 +0,0 @@
#ifndef LIBINPUT_LIBUDEV_SHIM_H
#define LIBINPUT_LIBUDEV_SHIM_H
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct udev;
struct udev_device;
struct udev_enumerate;
struct udev_list_entry;
struct udev_monitor;
struct udev *udev_new(void);
struct udev *udev_ref(struct udev *udev);
struct udev *udev_unref(struct udev *udev);
struct udev *udev_device_get_udev(struct udev_device *udev_device);
struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum);
struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath);
struct udev_device *udev_device_ref(struct udev_device *udev_device);
struct udev_device *udev_device_unref(struct udev_device *udev_device);
const char *udev_device_get_action(struct udev_device *udev_device);
const char *udev_device_get_devnode(struct udev_device *udev_device);
int udev_device_get_is_initialized(struct udev_device *udev_device);
struct udev_device *udev_device_get_parent(struct udev_device *udev_device);
struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device,
const char *subsystem,
const char *devtype);
struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device);
const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key);
const char *udev_device_get_sysname(struct udev_device *udev_device);
const char *udev_device_get_syspath(struct udev_device *udev_device);
struct udev_enumerate *udev_enumerate_new(struct udev *udev);
struct udev_enumerate *udev_enumerate_unref(struct udev_enumerate *udev_enumerate);
int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate,
const char *subsystem);
struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate);
int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate);
const char *udev_list_entry_get_name(struct udev_list_entry *list_entry);
struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry);
const char *udev_list_entry_get_value(struct udev_list_entry *list_entry);
#define udev_list_entry_foreach(list_entry, first_entry) \
for ((list_entry) = (first_entry); (list_entry) != NULL; \
(list_entry) = udev_list_entry_get_next(list_entry))
struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name);
struct udev_monitor *udev_monitor_unref(struct udev_monitor *udev_monitor);
int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor);
int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor,
const char *subsystem,
const char *devtype);
int udev_monitor_get_fd(struct udev_monitor *udev_monitor);
struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor);
#ifdef __cplusplus
}
#endif
#endif