mirror of
https://github.com/shenmintao/aic8800d80.git
synced 2026-09-26 17:44:16 +00:00
cfg80211_ops.set_monitor_channel() gained a "struct net_device *dev"
parameter in mainline 6.13, and the change was backported to the 6.12
stable series starting with 6.12.101. Debian 13 ships 6.12.107, so the
existing ">= 6.13.0" guards select the old prototype there and the build
fails with -Wincompatible-pointer-types:
rwnx_main.c: error: initialization of
'int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *)'
from incompatible pointer type
'int (*)(struct wiphy *, struct cfg80211_chan_def *)'
[-Wincompatible-pointer-types]
This is the failure reported in #96 for Debian 13 trixie.
Introduce AICWF_CFG80211_SET_MONITOR_CHANNEL_HAS_DEV in rwnx_compat.h,
defined at AICWF_CFG80211_VERSION_CODE >= 6.12.101, and gate the nine
set_monitor_channel call sites on it instead of comparing against 6.13.0.
The threshold covers both the 6.12 backport and mainline 6.13, while
kernels 6.11 and earlier 6.12.x keep the old prototype. The check now
lives in one place and follows the existing AICWF_CFG80211_VERSION_CODE
convention, so OpenWrt builds can override it with CFG80211_VERSION.
The MODULE_IMPORT_NS guard at rwnx_main.c that also checks 6.13.0 is
unrelated and is left untouched.
Verified with clean builds against linux-headers 5.15.0-191,
6.1.0-53, 6.8.0-139, 6.11.0-8 and 6.12.107+deb13.
73 lines
1.6 KiB
C
73 lines
1.6 KiB
C
/**
|
|
******************************************************************************
|
|
*
|
|
* @file private_cmd.h
|
|
*
|
|
* Copyright (C) Aicsemi 2018-2024
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
|
|
#ifndef _AIC_PRIV_CMD_H_
|
|
#define _AIC_PRIV_CMD_H_
|
|
|
|
#include "rwnx_defs.h"
|
|
|
|
typedef struct _android_wifi_priv_cmd {
|
|
char *buf;
|
|
int used_len;
|
|
int total_len;
|
|
} android_wifi_priv_cmd;
|
|
|
|
struct aicwf_cs_info {
|
|
u8_l phymode;
|
|
u8_l bandwidth;
|
|
u16_l freq;
|
|
|
|
s8_l rssi;
|
|
s8_l snr;
|
|
s8_l noise;
|
|
u8_l txpwr;
|
|
|
|
//chanutil
|
|
u16_l chan_time_ms;
|
|
u16_l chan_time_busy_ms;
|
|
|
|
char countrycode[4];
|
|
u8_l rxnss;
|
|
u8_l rxmcs;
|
|
u8_l txnss;
|
|
u8_l txmcs;
|
|
|
|
u32_l tx_phyrate;
|
|
u32_l rx_phyrate;
|
|
|
|
u32_l tx_ack_succ_stat;
|
|
u32_l tx_ack_fail_stat;
|
|
|
|
u16_l chan_tx_busy_time;
|
|
};
|
|
|
|
#ifdef CONFIG_COMPAT
|
|
typedef struct _compat_android_wifi_priv_cmd {
|
|
compat_caddr_t buf;
|
|
int used_len;
|
|
int total_len;
|
|
} compat_android_wifi_priv_cmd;
|
|
#endif /* CONFIG_COMPAT */
|
|
|
|
int android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);
|
|
int get_cs_info(struct rwnx_vif *vif, u8 *mac_addr, u8 *val);
|
|
|
|
unsigned int command_strtoul(const char *cp, char **endp, unsigned int base);
|
|
int str_starts(const char *str, const char *start);
|
|
int handle_private_cmd(struct net_device *net, char *command, u32 cmd_len);
|
|
#ifdef AICWF_CFG80211_SET_MONITOR_CHANNEL_HAS_DEV
|
|
void set_mon_chan(struct rwnx_vif *vif, struct net_device *dev, char *parameter);
|
|
#else
|
|
void set_mon_chan(struct rwnx_vif *vif, char *parameter);
|
|
#endif
|
|
|
|
#endif /* _AIC_PRIV_CMD_H_ */
|
|
|