diff -pruN 6.30.223.271-27/debian/changelog 6.30.223.271-27ubuntu2/debian/changelog
--- 6.30.223.271-27/debian/changelog	2025-06-04 13:41:29.000000000 +0000
+++ 6.30.223.271-27ubuntu2/debian/changelog	2025-08-17 15:37:22.000000000 +0000
@@ -1,3 +1,29 @@
+broadcom-sta (6.30.223.271-27ubuntu2) questing; urgency=medium
+
+  [ Joan Bruguera Micó ]
+
+  * Failed to build against linux-6.17 (LP: #2120508)
+    - 42-broadcom-wl-fix-linux-6.17.patch
+  * UBSAN: array-index-out-of-bounds (LP: #2030978)
+    - 43-broadcom-wl-fix-linux-6.5.patch
+
+ -- You-Sheng Yang <vicamo@gmail.com>  Sun, 17 Aug 2025 23:37:22 +0800
+
+broadcom-sta (6.30.223.271-27ubuntu1) questing; urgency=medium
+
+  [ You-Sheng Yang ]
+
+  * Non-maintainer upload.
+  * Failed to build against linux-6.16 (LP: #2114261)
+    - 41-wl-use-timer_container_of-for-kernel-6.16.patch
+
+  [ Jeremy Bícha ]
+
+  * Revert "Promote module-assistant to Depends" because it is not in
+    restricted or main
+
+ -- You-Sheng Yang <vicamo@gmail.com>  Fri, 13 Jun 2025 18:50:36 +0800
+
 broadcom-sta (6.30.223.271-27) unstable; urgency=low
 
   [ Eduard Bloch ]
diff -pruN 6.30.223.271-27/debian/control 6.30.223.271-27ubuntu2/debian/control
--- 6.30.223.271-27/debian/control	2025-06-04 13:41:29.000000000 +0000
+++ 6.30.223.271-27ubuntu2/debian/control	2025-06-17 08:08:13.000000000 +0000
@@ -1,7 +1,8 @@
 Source: broadcom-sta
 Section: non-free/kernel
 Priority: optional
-Maintainer: Eduard Bloch <blade@debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Eduard Bloch <blade@debian.org>
 Uploaders: Cyril Lacoux <clacoux@easter-eggs.com>, Roger Shimizu <rosh@debian.org>
 Build-Depends:
  debhelper-compat (= 13),
@@ -18,7 +19,7 @@ Testsuite: autopkgtest-pkg-dkms
 Package: broadcom-sta-common
 Architecture: amd64 i386
 Depends: ${misc:Depends}
-Recommends: broadcom-sta-source
+Recommends: broadcom-sta-source, module-assistant
 Description: Common files for the Broadcom STA Wireless driver
  Broadcom STA is a binary-only device driver to support the following IEEE
  802.11a/b/g/n wireless network cards: BCM4311-, BCM4312-, BCM4313-,
@@ -53,9 +54,9 @@ Architecture: amd64 i386
 Depends:
  ${misc:Depends},
  debhelper-compat (= 13),
- module-assistant,
  make,
  xz-utils
+Recommends: module-assistant
 Description: Source for the Broadcom STA Wireless driver
  Broadcom STA is a binary-only device driver to support the following IEEE
  802.11a/b/g/n wireless network cards: BCM4311-, BCM4312-, BCM4313-,
diff -pruN 6.30.223.271-27/debian/patches/41-wl-use-timer_container_of-for-kernel-6.16.patch 6.30.223.271-27ubuntu2/debian/patches/41-wl-use-timer_container_of-for-kernel-6.16.patch
--- 6.30.223.271-27/debian/patches/41-wl-use-timer_container_of-for-kernel-6.16.patch	1970-01-01 00:00:00.000000000 +0000
+++ 6.30.223.271-27ubuntu2/debian/patches/41-wl-use-timer_container_of-for-kernel-6.16.patch	2025-06-17 08:08:13.000000000 +0000
@@ -0,0 +1,28 @@
+From: You-Sheng Yang <vicamo@gmail.com>
+Date: Fri, 13 Jun 2025 18:46:24 +0800
+Subject: wl: use timer_container_of for kernel >= 6.16
+
+`from_timer` macro renamed in v6.16-rc1 commit 41cb08555c416 ("treewide,
+timers: Rename from_timer() to timer_container_of()").
+
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2114261
+Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
+---
+ amd64/src/wl/sys/wl_linux.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/amd64/src/wl/sys/wl_linux.c b/amd64/src/wl/sys/wl_linux.c
+index d36f8bc..8bf80ab 100644
+--- a/amd64/src/wl/sys/wl_linux.c
++++ b/amd64/src/wl/sys/wl_linux.c
+@@ -2377,7 +2377,9 @@ wl_timer(
+ #endif
+ ) {
+ 	wl_timer_t *t =
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
++		timer_container_of(t, tl, timer);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+ 		from_timer(t, tl, timer);
+ #else
+ 		(wl_timer_t *)data;
diff -pruN 6.30.223.271-27/debian/patches/42-broadcom-wl-fix-linux-6.17.patch 6.30.223.271-27ubuntu2/debian/patches/42-broadcom-wl-fix-linux-6.17.patch
--- 6.30.223.271-27/debian/patches/42-broadcom-wl-fix-linux-6.17.patch	1970-01-01 00:00:00.000000000 +0000
+++ 6.30.223.271-27ubuntu2/debian/patches/42-broadcom-wl-fix-linux-6.17.patch	2025-08-17 15:37:22.000000000 +0000
@@ -0,0 +1,91 @@
+From: =?utf-8?q?Joan_Bruguera_Mic=C3=B3?= <joanbrugueram@gmail.com>
+Date: Sat, 28 Jun 2025 22:14:42 +0000
+Subject: Tentative patch for broadcom-wl 6.30.223.271 driver for Linux
+ 6.17-rc1
+
+Some function prototype updates, rel. commit "wifi: cfg80211/mac80211:
+Add support to get radio index" (Roopni Devanathan, 15 Jun 2025)
+
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2120508
+Origin: https://gist.github.com/joanbm/4e7f18febc2c25f5fdf8143a739dccd1
+Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
+---
+ amd64/src/wl/sys/wl_cfg80211_hybrid.c | 28 ++++++++++++++++++++++++----
+ 1 file changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.c b/amd64/src/wl/sys/wl_cfg80211_hybrid.c
+index 204aab8..dde162a 100644
+--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -67,7 +67,11 @@ wl_cfg80211_scan(struct wiphy *wiphy,
+ static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+            struct cfg80211_scan_request *request);
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
++static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed);
++#else
+ static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
++#endif
+ 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);
+@@ -86,7 +90,10 @@ static int wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
+            struct cfg80211_connect_params *sme);
+ static s32 wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_code);
+ 
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
++static s32 wl_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, int radio_idx,
++                                    enum nl80211_tx_power_setting type, s32 dbm);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
+ static s32
+ wl_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
+                          enum nl80211_tx_power_setting type, s32 mbm);
+@@ -98,7 +105,10 @@ static s32 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)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
++static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, int radio_idx,
++                                    u32 link_id, s32 *dbm);
++#elif 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);
+ #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);
+@@ -664,7 +674,11 @@ static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l)
+ 	return err;
+ }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
++static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed)
++#else
+ static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
++#endif
+ {
+ 	struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
+ 	struct net_device *ndev = wl_to_ndev(wl);
+@@ -1102,7 +1116,10 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_c
+ 	return err;
+ }
+ 
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
++static s32 wl_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, int radio_idx,
++                                    enum nl80211_tx_power_setting type, s32 mbm)
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
+ static s32
+ wl_cfg80211_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev,
+                          enum nl80211_tx_power_setting type, s32 mbm)
+@@ -1163,7 +1180,10 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type, s32 mb
+ 	return err;
+ }
+ 
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
++static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, int radio_idx,
++                                    u32 link_id, s32 *dbm)
++#elif 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)
+ #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)
diff -pruN 6.30.223.271-27/debian/patches/43-broadcom-wl-fix-linux-6.5.patch 6.30.223.271-27ubuntu2/debian/patches/43-broadcom-wl-fix-linux-6.5.patch
--- 6.30.223.271-27/debian/patches/43-broadcom-wl-fix-linux-6.5.patch	1970-01-01 00:00:00.000000000 +0000
+++ 6.30.223.271-27ubuntu2/debian/patches/43-broadcom-wl-fix-linux-6.5.patch	2025-08-17 15:37:22.000000000 +0000
@@ -0,0 +1,183 @@
+From: =?utf-8?q?Joan_Bruguera_Mic=C3=B3?= <joanbrugue...@gmail.com>
+Date: Sat, 5 Aug 2023 20:54:12 +0000
+Subject: Tentative patch for broadcom-wl 6.30.223.271 driver for Linux
+ 6.5-rc1
+
+Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-36 on Arch Linux
+
+On Linux 6.5, due to commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS
+on GCC"), flexible trailing arrays declared like `whatever_t foo[1];`
+will generate warnings when CONFIG_UBSAN & co. is enabled, such as:
+
+    UBSAN: array-index-out-of-bounds in /var/lib/dkms/broadcom-wl/6.30.223.271/build/amd64/src/wl/sys/wl_linux.c:1919:4
+    index 2 is out of range for type 'ether_addr [1]'
+    CPU: 8 PID: 131 Comm: kworker/8:1 Tainted: P           OE      [...]
+    Hardware name: [...]
+    Workqueue: ipv6_addrconf addrconf_dad_work
+    Call Trace:
+     <TASK>
+     dump_stack_lvl+0x47/0x60
+     __ubsan_handle_out_of_bounds+0xc7/0x100
+     _wl_set_multicast_list+0x372/0x710 [wl b2d4dadbf09aee67f0822b96bf7f4b96338be49b]
+     ? __dev_mc_add+0xb3/0x150
+     [...]
+
+This was technically always wrong, but was detected now because of the
+commit above, and because Ubuntu 23.04 enables CONFIG_UBSAN by default.
+Thanks to Satadru Pramanik for the heads-up & report.
+
+Migrate them to the standard C99 syntax `whatever_t foo[];` to fix it.
+(Quite a few trailing one-element arrays remain unchanged, either
+because they are never used, or never accessed past the first element)
+
+Reported-by: Satadru Pramanik <sata...@gmail.com>
+Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2d47c6956ab3c8b580a59d7704aab3e2a4882b6c
+Link: https://lwn.net/Articles/936728/
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2030978
+Origin: backport, https://bugs.launchpad.net/ubuntu/+source/broadcom-sta/+bug/2030978/+attachment/5691493/+files/broadcom-wl-fix-linux-6.5.patch
+Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
+---
+ amd64/src/include/bcmutils.h          |  2 +-
+ amd64/src/include/wlioctl.h           | 10 +++++-----
+ amd64/src/wl/sys/wl_cfg80211_hybrid.c |  4 ++--
+ amd64/src/wl/sys/wl_cfg80211_hybrid.h |  6 +++---
+ amd64/src/wl/sys/wl_iw.c              |  4 ++--
+ 5 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/amd64/src/include/bcmutils.h b/amd64/src/include/bcmutils.h
+index 5fafe3d..7ad55ae 100644
+--- a/amd64/src/include/bcmutils.h
++++ b/amd64/src/include/bcmutils.h
+@@ -558,7 +558,7 @@ typedef struct bcm_bit_desc_ex {
+ typedef struct bcm_tlv {
+ 	uint8	id;
+ 	uint8	len;
+-	uint8	data[1];
++	uint8	data[];
+ } bcm_tlv_t;
+ 
+ #define bcm_valid_tlv(elt, buflen) ((buflen) >= 2 && (int)(buflen) >= (int)(2 + (elt)->len))
+diff --git a/amd64/src/include/wlioctl.h b/amd64/src/include/wlioctl.h
+index 2c05c7c..d47ce17 100644
+--- a/amd64/src/include/wlioctl.h
++++ b/amd64/src/include/wlioctl.h
+@@ -91,7 +91,7 @@ typedef struct wl_scan_results {
+ 	uint32 buflen;
+ 	uint32 version;
+ 	uint32 count;
+-	wl_bss_info_t bss_info[1];
++	wl_bss_info_t bss_info[];
+ } wl_scan_results_t;
+ 
+ #define WL_MAXRATES_IN_SET		16	
+@@ -129,7 +129,7 @@ typedef struct wl_uint32_list {
+ 
+ 	uint32 count;
+ 
+-	uint32 element[1];
++	uint32 element[];
+ } wl_uint32_list_t;
+ 
+ typedef struct wl_assoc_params {
+@@ -247,7 +247,7 @@ typedef struct _pmkid {
+ 
+ typedef struct _pmkid_list {
+ 	uint32	npmkid;
+-	pmkid_t	pmkid[1];
++	pmkid_t	pmkid[];
+ } pmkid_list_t;
+ 
+ typedef struct _pmkid_cand {
+@@ -257,7 +257,7 @@ typedef struct _pmkid_cand {
+ 
+ typedef struct _pmkid_cand_list {
+ 	uint32	npmkid_cand;
+-	pmkid_cand_t	pmkid_cand[1];
++	pmkid_cand_t	pmkid_cand[];
+ } pmkid_cand_list_t;
+ 
+ typedef struct {
+@@ -278,7 +278,7 @@ typedef struct channel_info {
+ 
+ struct maclist {
+ 	uint count;			
+-	struct ether_addr ea[1];	
++	struct ether_addr ea[];
+ };
+ 
+ typedef struct wl_ioctl {
+diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.c b/amd64/src/wl/sys/wl_cfg80211_hybrid.c
+index dde162a..36fcd79 100644
+--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -1620,7 +1620,7 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
+                       struct cfg80211_pmksa *pmksa)
+ {
+ 	struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
+-	struct _pmkid_list pmkid;
++	struct { pmkid_t pmkid[1]; } pmkid;
+ 	s32 err = 0;
+ 	int i;
+ 
+@@ -2028,7 +2028,7 @@ static s32 wl_inform_single_bss(struct wl_cfg80211_priv *wl, struct wl_bss_info
+ 		WL_DBG(("Beacon is larger than buffer. Discarding\n"));
+ 		return -E2BIG;
+ 	}
+-	notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) +
++	notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) +
+ 	                         WL_BSS_INFO_MAX, GFP_KERNEL);
+ 	if (!notif_bss_info) {
+ 		WL_ERR(("notif_bss_info alloc failed\n"));
+diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.h b/amd64/src/wl/sys/wl_cfg80211_hybrid.h
+index 014c399..e117897 100644
+--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.h
++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.h
+@@ -126,7 +126,7 @@ struct wl_cfg80211_bss_info {
+ 	u16 channel;
+ 	s16 rssi;
+ 	u16 frame_len;
+-	u8 frame_buf[1];
++	u8 frame_buf[];
+ };
+ 
+ struct wl_cfg80211_scan_req {
+@@ -142,7 +142,7 @@ struct wl_cfg80211_event_q {
+ 	struct list_head eq_list;
+ 	u32 etype;
+ 	wl_event_msg_t emsg;
+-	s8 edata[1];
++	s8 edata[];
+ };
+ 
+ struct wl_cfg80211_security {
+@@ -174,7 +174,7 @@ struct wl_cfg80211_assoc_ielen {
+ 
+ struct wl_cfg80211_pmk_list {
+ 	pmkid_list_t pmkids;
+-	pmkid_t foo[MAXPMKID - 1];
++	pmkid_t foo[MAXPMKID];
+ };
+ 
+ struct wl_cfg80211_priv {
+diff --git a/amd64/src/wl/sys/wl_iw.c b/amd64/src/wl/sys/wl_iw.c
+index e346b15..e28de40 100644
+--- a/amd64/src/wl/sys/wl_iw.c
++++ b/amd64/src/wl/sys/wl_iw.c
+@@ -1875,7 +1875,7 @@ wl_iw_set_encodeext(
+ #if WIRELESS_EXT > 17
+ struct {
+ 	pmkid_list_t pmkids;
+-	pmkid_t foo[MAXPMKID-1];
++	pmkid_t foo[MAXPMKID];
+ } pmkid_list;
+ static int
+ wl_iw_set_pmksa(
+@@ -1898,7 +1898,7 @@ wl_iw_set_pmksa(
+ 		bzero((char *)&pmkid_list, sizeof(pmkid_list));
+ 	}
+ 	if (iwpmksa->cmd == IW_PMKSA_REMOVE) {
+-		pmkid_list_t pmkid, *pmkidptr;
++		struct { pmkid_t pmkid[1]; } pmkid, *pmkidptr;
+ 		pmkidptr = &pmkid;
+ 		bcopy(&iwpmksa->bssid.sa_data[0], &pmkidptr->pmkid[0].BSSID, ETHER_ADDR_LEN);
+ 		bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID, WPA2_PMKID_LEN);
diff -pruN 6.30.223.271-27/debian/patches/series 6.30.223.271-27ubuntu2/debian/patches/series
--- 6.30.223.271-27/debian/patches/series	2025-06-04 13:41:29.000000000 +0000
+++ 6.30.223.271-27ubuntu2/debian/patches/series	2025-08-17 15:37:22.000000000 +0000
@@ -38,3 +38,6 @@
 38-build-don-t-use-deprecated-EXTRA_-FLAGS.patch
 39-wl-use-timer_delete-for-kernel-6.15.patch
 40-wl-add-MODULE_DESCRIPTION.patch
+41-wl-use-timer_container_of-for-kernel-6.16.patch
+42-broadcom-wl-fix-linux-6.17.patch
+43-broadcom-wl-fix-linux-6.5.patch
