Skip to content

Instantly share code, notes, and snippets.

@vejeta
Last active October 19, 2025 01:46
Show Gist options
  • Select an option

  • Save vejeta/9f86a7084766719eaaab049034669f2c to your computer and use it in GitHub Desktop.

Select an option

Save vejeta/9f86a7084766719eaaab049034669f2c to your computer and use it in GitHub Desktop.
Patch for broadcom-sta-6.30.223.271/wl-kernel-6.17-fix.patch
--- a/src/wl/sys/wl_cfg80211_hybrid.c
+++ b/src/wl/sys/wl_cfg80211_hybrid.c
@@ -67,7 +67,7 @@
static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request);
#endif
-static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
+static int wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, int unused, u32 changed);
static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params);
static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev);
@@ -88,22 +88,22 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static s32
-wl_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
+wl_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
enum nl80211_tx_power_setting type, s32 mbm);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
-static s32 wl_cfg80211_set_tx_power(struct wiphy *wiphy,
+static int wl_cfg80211_set_tx_power(struct wiphy *wiphy,
enum nl80211_tx_power_setting type, s32 mbm);
#else
-static s32 wl_cfg80211_set_tx_power(struct wiphy *wiphy,
+static int wl_cfg80211_set_tx_power(struct wiphy *wiphy,
enum tx_power_setting type, s32 mbm);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, u32 /*link_id*/, s32 *dbm);
+static int wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, int /*link_id*/, unsigned int unused2, int *dbm);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, s32 *dbm);
+static int wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, s32 *dbm);
#else
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm);
+static int wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
@@ -664,7 +664,7 @@
return err;
}
-static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
+static int wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, int unused, u32 changed)
{
struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
struct net_device *ndev = wl_to_ndev(wl);
@@ -1104,7 +1104,7 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static s32
-wl_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
+wl_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
enum nl80211_tx_power_setting type, s32 mbm)
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
static s32
@@ -1164,11 +1164,11 @@
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, u32 /*link_id*/, s32 *dbm)
+static int wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, int /*link_id*/, unsigned int unused2, int *dbm)
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, s32 *dbm)
+static int wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, s32 *dbm)
#else
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
+static int wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
#endif
{
struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
@vejeta
Copy link
Author

vejeta commented Oct 18, 2025

Install broadcom-sta-dkms from sid

Edit /usr/src/broadcom-sta-6.30.223.271/dkms.conf

PACKAGE_NAME="broadcom-sta"
PACKAGE_VERSION="6.30.223.271"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules"
BUILT_MODULE_NAME[0]="wl"
DEST_MODULE_LOCATION[0]="/updates"
AUTOINSTALL="yes"

Aplicar parche solo para kernels 6.17+

PATCH_MATCH[0]="^(6.1[7-9].|[7-9].[0-9]+.)"
PATCH[0]="kernel-6.17-fixes.patch"

#Despues
sudo cp broadcom-sta-kernel-6.17-fix.patch /usr/src/broadcom-sta-6.30.223.271/patches/

Reinstalar

sudo dkms remove broadcom-sta/6.30.223.271 --all
sudo dkms install broadcom-sta/6.30.223.271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment