diff options
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux')
13 files changed, 119 insertions, 40 deletions
| diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index 00dd1f9a1ec0..a5a7abd55287 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -37,13 +37,8 @@  #define	BIT(nr)			(1UL << (nr))  #define	BIT_ULL(nr)		(1ULL << (nr)) -#ifdef __LP64__ -#define	BITS_PER_LONG		64 -#else -#define	BITS_PER_LONG		32 -#endif - -#define	BITS_PER_LONG_LONG	64 +#define	BITS_PER_LONG		(__SIZEOF_LONG__ * __CHAR_BIT__) +#define	BITS_PER_LONG_LONG	(__SIZEOF_LONG_LONG__ * __CHAR_BIT__)  #define	BITMAP_FIRST_WORD_MASK(start)	(~0UL << ((start) % BITS_PER_LONG))  #define	BITMAP_LAST_WORD_MASK(n)	(~0UL >> (BITS_PER_LONG - (n))) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index 948396144ad6..4146c829b936 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -31,6 +31,7 @@  #define	_LINUXKPI_LINUX_COMPILER_H_  #include <sys/cdefs.h> +#include <sys/endian.h>  #define __user  #define __kernel @@ -79,6 +80,13 @@  #else  #define	__counted_by(_x)  #endif +#if BYTE_ORDER == LITTLE_ENDIAN +#define	__counted_by_le(_x)		__counted_by(_x) +#define	__counted_by_be(_x) +#else +#define	__counted_by_le(_x) +#define	__counted_by_be(_x)		__counted_by(_x) +#endif  #define	likely(x)			__builtin_expect(!!(x), 1)  #define	unlikely(x)			__builtin_expect(!!(x), 0) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 7dd6340746d2..c291133e2e0b 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -92,6 +92,7 @@ struct device_driver {  	const struct dev_pm_ops *pm;  	void (*shutdown) (struct device *); +	void (*coredump) (struct device *);  };  struct device_type { diff --git a/sys/compat/linuxkpi/common/include/linux/etherdevice.h b/sys/compat/linuxkpi/common/include/linux/etherdevice.h index 1f2d6cf22d7e..b9a4951de8ac 100644 --- a/sys/compat/linuxkpi/common/include/linux/etherdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/etherdevice.h @@ -27,6 +27,8 @@  #include <linux/types.h>  #include <linux/device.h> +#include <linux/skbuff.h> +#include <linux/netdevice.h>  #include <sys/random.h>  #include <sys/libkern.h> @@ -137,4 +139,25 @@ device_get_mac_address(struct device *dev, char *dst)  	return (-ENOENT);  } +/* Returns network byte order. */ +static inline uint16_t +eth_type_trans(struct sk_buff *skb, struct net_device *dev) +{ +	pr_debug("%s: TODO\n", __func__); +	return (htons(ETHERTYPE_8023)); +} + +static inline void +eth_hw_addr_set(struct net_device *dev, const u8 *addr) +{ +	pr_debug("%s: TODO (if we want to)\n", __func__); +} + +static inline int +eth_platform_get_mac_address(struct device *dev __unused, u8 *addr __unused) +{ +	pr_debug("%s: TODO\n", __func__); +	return (-ENODEV); +} +  #endif					/* _LINUXKPI_LINUX_ETHERDEVICE_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/fips.h b/sys/compat/linuxkpi/common/include/linux/fips.h new file mode 100644 index 000000000000..25c0c1fc1fa0 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/fips.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2025 Bjoern A. Zeeb + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#ifndef	_LINUXKPI_LINUX_FIPS_H +#define	_LINUXKPI_LINUX_FIPS_H + +#define	fips_enabled	0 + +#endif /* _LINUXKPI_LINUX_FIPS_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 17041bb03ce8..ea8c0fc8ef5e 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -312,6 +312,7 @@ enum ieee80211_ac_numbers {  #define	IEEE80211_MLD_CAP_OP_MAX_SIMUL_LINKS	0xf  #define	IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP		0x0060  #define	IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP_SAME	1 +#define	IEEE80211_MLD_CAP_OP_LINK_RECONF_SUPPORT		0x2000  struct ieee80211_mcs_info {  	uint8_t		rx_mask[IEEE80211_HT_MCS_MASK_LEN]; @@ -365,6 +366,7 @@ enum ieee80211_chanctx_change_flags {  	IEEE80211_CHANCTX_CHANGE_CHANNEL	= BIT(4),  	IEEE80211_CHANCTX_CHANGE_PUNCTURING	= BIT(5),  	IEEE80211_CHANCTX_CHANGE_MIN_DEF	= BIT(6), +	IEEE80211_CHANCTX_CHANGE_AP		= BIT(7),  };  enum ieee80211_frame_release_type { diff --git a/sys/compat/linuxkpi/common/include/linux/netdevice.h b/sys/compat/linuxkpi/common/include/linux/netdevice.h index 3b808a4a1749..cf27753bcb80 100644 --- a/sys/compat/linuxkpi/common/include/linux/netdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/netdevice.h @@ -486,6 +486,21 @@ netdev_priv(const struct net_device *ndev)  }  /* -------------------------------------------------------------------------- */ + +static __inline void +netif_device_attach(struct net_device *ndev) +{ +	pr_debug("%s: TODO\n", __func__); +} + +static __inline void +netif_device_detach(struct net_device *ndev) +{ +	pr_debug("%s: TODO\n", __func__); +} + + +/* -------------------------------------------------------------------------- */  /* This is really rtnetlink and probably belongs elsewhere. */  #define	rtnl_lock()		do { } while(0) diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index f3979d3a2abc..845ffec4bcba 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -50,6 +50,7 @@ enum nl80211_feature_flags {  	NL80211_FEATURE_WFA_TPC_IE_IN_PROBES		= BIT(15),  	NL80211_FEATURE_AP_SCAN				= BIT(16),  	NL80211_FEATURE_ACTIVE_MONITOR			= BIT(17), +	NL80211_FEATURE_SAE				= BIT(18),  };  enum nl80211_pmsr_ftm_failure_flags { @@ -85,6 +86,7 @@ enum nl80211_reg_rule_flags {  	NL80211_RRF_NO_6GHZ_AFC_CLIENT			= BIT(15),  	NL80211_RRF_PSD					= BIT(16),  	NL80211_RRF_ALLOW_6GHZ_VLP_AP			= BIT(17), +	NL80211_RRF_ALLOW_20MHZ_ACTIVITY		= BIT(18),  };  #define	NL80211_RRF_NO_HT40	(NL80211_RRF_NO_HT40MINUS|NL80211_RRF_NO_HT40PLUS) @@ -434,6 +436,14 @@ enum nl80211_hidden_ssid {  	NL80211_HIDDEN_SSID_NOT_IN_USE,  }; +enum nl80211_external_auth_action { +	NL80211_EXTERNAL_AUTH_START, +}; + +enum nl80211_rxmgmt_flags { +	NL80211_RXMGMT_FLAG_EXTERNAL_AUTH	= BIT(1), +}; +  #define	NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY	16  #define	NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY	24 diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index ffc2be600c22..06336bf963d6 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -832,6 +832,19 @@ lkpi_pci_restore_state(struct pci_dev *pdev)  #define pci_restore_state(dev)	lkpi_pci_restore_state(dev)  static inline int +linuxkpi_pci_enable_wake(struct pci_dev *pdev, pci_power_t state, bool ena) +{ +	/* +	 * We do not currently support this in device.h either to +	 * check if the device is allowed to wake up in first place. +	 */ +	pr_debug("%s: TODO\n", __func__); +	return (0); +} +#define	pci_enable_wake(dev, state, ena)				\ +    linuxkpi_pci_enable_wake(dev, state, ena) + +static inline int  pci_reset_function(struct pci_dev *pdev)  { diff --git a/sys/compat/linuxkpi/common/include/linux/platform_device.h b/sys/compat/linuxkpi/common/include/linux/platform_device.h index 6853e709cb70..dba79f5936cc 100644 --- a/sys/compat/linuxkpi/common/include/linux/platform_device.h +++ b/sys/compat/linuxkpi/common/include/linux/platform_device.h @@ -39,7 +39,7 @@ struct platform_device {  };  struct platform_driver { -	int				(*remove)(struct platform_device *); +	void				(*remove)(struct platform_device *);  	struct device_driver		driver;  }; diff --git a/sys/compat/linuxkpi/common/include/linux/pm.h b/sys/compat/linuxkpi/common/include/linux/pm.h index c8d943027909..932697e0eda8 100644 --- a/sys/compat/linuxkpi/common/include/linux/pm.h +++ b/sys/compat/linuxkpi/common/include/linux/pm.h @@ -97,4 +97,18 @@ pm_wakeup_event(struct device *dev __unused, unsigned int x __unused)  	pr_debug("%s: TODO\n", __func__);  } +/* + * We do not need to specify anything here as a VT switch always happens on + * suspend/resume. + */ +static inline void +pm_vt_switch_required(struct device *dev __unused, bool required __unused) +{ +} + +static inline void +pm_vt_switch_unregister(struct device *dev __unused) +{ +} +  #endif	/* _LINUXKPI_LINUX_PM_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 6e41c368a8b8..2e560a120e41 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -1159,6 +1159,9 @@ skb_cow_head(struct sk_buff *skb, unsigned int headroom)  	return (-1);  } +/* Misplaced here really but sock comes from skbuff. */ +#define	sk_pacing_shift_update(sock, n) +  #define	SKB_WITH_OVERHEAD(_s)						\  	(_s) - ALIGN(sizeof(struct skb_shared_info), CACHE_LINE_SIZE) diff --git a/sys/compat/linuxkpi/common/include/linux/soc/mediatek/mtk_wed.h b/sys/compat/linuxkpi/common/include/linux/soc/mediatek/mtk_wed.h index 903053e7f6e8..9f3a1ee4c139 100644 --- a/sys/compat/linuxkpi/common/include/linux/soc/mediatek/mtk_wed.h +++ b/sys/compat/linuxkpi/common/include/linux/soc/mediatek/mtk_wed.h @@ -1,54 +1,36 @@  /*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2022-2023 Bjoern A. Zeeb - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. + * Copyright (c) 2022-2025 Bjoern A. Zeeb   * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause   */  #ifndef	_LINUXKPI_LINUX_SOC_MEDIATEK_MTK_WED_H  #define	_LINUXKPI_LINUX_SOC_MEDIATEK_MTK_WED_H +#include <linux/kernel.h>	/* pr_debug */ +  struct mtk_wed_device {  };  #define	WED_WO_STA_REC	0x6 -#define	mtk_wed_device_start(_dev, _mask)		do { } while(0) -#define	mtk_wed_device_detach(_dev)			do { } while(0) +#define	mtk_wed_device_start(_dev, _mask)		do { pr_debug("%s: TODO\n", __func__); } while(0) +#define	mtk_wed_device_detach(_dev)			do { pr_debug("%s: TODO\n", __func__); } while(0)  #define	mtk_wed_device_irq_get(_dev, _mask)		0 -#define	mtk_wed_device_irq_set_mask(_dev, _mask)	do { } while(0) -#define	mtk_wed_device_update_msg(_dev, _id, _msg, _len)	(-ENODEV) -#define	mtk_wed_device_dma_reset(_dev)			do {} while (0) +#define	mtk_wed_device_irq_set_mask(_dev, _mask)	do { pr_debug("%s: TODO\n", __func__); } while(0) +#define	mtk_wed_device_update_msg(_dev, _id, _msg, _len)	({ pr_debug("%s: TODO\n", __func__); -ENODEV; }) +#define	mtk_wed_device_dma_reset(_dev)			do { pr_debug("%s: TODO\n", __func__); } while (0)  #define	mtk_wed_device_ppe_check(_dev, _skb, _reason, _entry) \ -    do {} while (0) -#define	mtk_wed_device_stop(_dev)			do { } while(0) -#define	mtk_wed_device_start_hw_rro(_dev, _mask, _b)	do { } while(0) -#define	mtk_wed_device_setup_tc(_dev, _ndev, _type, _tdata)	(-EOPNOTSUPP) +    do { pr_debug("%s: TODO\n", __func__); } while (0) +#define	mtk_wed_device_stop(_dev)			do { pr_debug("%s: TODO\n", __func__); } while(0) +#define	mtk_wed_device_start_hw_rro(_dev, _mask, _b)	do { pr_debug("%s: TODO\n", __func__); } while(0) +#define	mtk_wed_device_setup_tc(_dev, _ndev, _type, _tdata)	({ pr_debug("%s: TODO\n", __func__); -EOPNOTSUPP; })  static inline bool  mtk_wed_device_active(struct mtk_wed_device *dev __unused)  { +	pr_debug("%s: TODO\n", __func__);  	return (false);  } @@ -56,6 +38,7 @@ static inline bool  mtk_wed_get_rx_capa(struct mtk_wed_device *dev __unused)  { +	pr_debug("%s: TODO\n", __func__);  	return (false);  } | 
