Skip to content

Commit

Permalink
linux-mbp: v5.12.19-2
Browse files Browse the repository at this point in the history
  • Loading branch information
aunali1 committed Jul 26, 2021
1 parent 1957a11 commit 1bd10dc
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pkgbase = linux-mbp
pkgdesc = Linux for MBP
pkgver = 5.12.19
pkgrel = 1
pkgrel = 2
url = https://git.archlinux.org/linux.git/log/?h=vv5.12-19
arch = x86_64
license = GPL2
Expand Down Expand Up @@ -52,6 +52,7 @@ pkgbase = linux-mbp
source = 7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch
source = 8001-brcmfmac-Add-initial-support-for-the-BRCM4355.patch
source = 8002-brcmfmac-Add-initial-support-for-the-BRCM4377.patch
source = 9001-brcmfmac-p2p-Ensure-virtual-interface-is-initialized.patch
validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886
validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E
sha256sums = e9381cd3525a02f5b895f74147e2440be443ecd45484c6c64075046bc6f94c73
Expand Down Expand Up @@ -86,6 +87,7 @@ pkgbase = linux-mbp
sha256sums = 90a6012cdd8a64ede8e0bbaf7331960bd68f628e0973b65459188eb1ccb5b829
sha256sums = 3a7baa28d5f45bdbff23e838133f2e3c6896412ffb5a919b4992a7b2d17469d9
sha256sums = edb804461e3820ef3397e1e236f7caabf906b6a13d03f406c8462ec476ecbbe5
sha256sums = fa0ad2e2f171eafd727d780588f7ef5d47ddf2d75fab02c67356bbc7b26e25e0

pkgname = linux-mbp
pkgdesc = The Linux for MBP kernel and modules
Expand Down
86 changes: 86 additions & 0 deletions 9001-brcmfmac-p2p-Ensure-virtual-interface-is-initialized.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
From c8f0993e526e930cf497efb54db79250d84ba467 Mon Sep 17 00:00:00 2001
From: Aun-Ali Zaidi <[email protected]>
Date: Mon, 26 Jul 2021 13:56:45 -0500
Subject: [PATCH] brcmfmac: p2p: Ensure virtual interface is initialized before
use

Previously, no check was performed on whether a p2p virtual interface has been
brought up or not, which caused problems on non-standard devices that require
an explicit bring up. Solve this by ensuring the interface structure is
initialized, otherwise bail out.

Based on work by Stan Skowronek <[email protected]>

Signed-off-by: Aun-Ali Zaidi <[email protected]>
Tested-by: Aun-Ali Zaidi <[email protected]>
---
.../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 ++++++-
.../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 12 +++++++++++-
2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index f4405d7861b6..4158b38cfb0e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -5136,8 +5136,13 @@ brcmf_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
ie_offset = DOT11_MGMT_HDR_LEN +
DOT11_BCN_PRB_FIXED_LEN;
ie_len = len - ie_offset;
- if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif)
+ if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif) {
vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
+ if (vif == NULL) {
+ bphy_err(drvr, "No p2p device available for probe response\n");
+ return -ENODEV;
+ }
+ }
err = brcmf_vif_set_mgmt_ie(vif,
BRCMF_VNDR_IE_PRBRSP_FLAG,
&buf[ie_offset],
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index 34cd8a7401fe..0849c67e74fd 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -565,7 +565,8 @@ static s32 brcmf_p2p_deinit_discovery(struct brcmf_p2p_info *p2p)

/* Set the discovery state to SCAN */
vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
- (void)brcmf_p2p_set_discover_state(vif->ifp, WL_P2P_DISC_ST_SCAN, 0, 0);
+ if (vif != NULL)
+ (void)brcmf_p2p_set_discover_state(vif->ifp, WL_P2P_DISC_ST_SCAN, 0, 0);

/* Disable P2P discovery in the firmware */
vif = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
@@ -1351,6 +1352,8 @@ brcmf_p2p_gon_req_collision(struct brcmf_p2p_info *p2p, u8 *mac)
* if not (sa addr > da addr),
* this device will process gon request and drop gon req of peer.
*/
+ if(p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif == NULL)
+ return false;
ifp = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif->ifp;
if (memcmp(mac, ifp->mac_addr, ETH_ALEN) < 0) {
brcmf_dbg(INFO, "Block transmit gon req !!!\n");
@@ -1558,6 +1561,10 @@ static s32 brcmf_p2p_tx_action_frame(struct brcmf_p2p_info *p2p,
vif = p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif;
else
vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
+ if (vif == NULL) {
+ bphy_err(drvr, " no P2P interface available\n");
+ goto exit;
+ }

err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe", af_params,
sizeof(*af_params));
@@ -1735,6 +1742,9 @@ bool brcmf_p2p_send_action_frame(struct brcmf_cfg80211_info *cfg,
unsigned long dwell_jiffies = 0;
bool dwell_overflow = false;

+ if(p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif == NULL)
+ goto exit;
+
u32 requested_dwell = le32_to_cpu(af_params->dwell_time);
action_frame = &af_params->action_frame;
action_frame_len = le16_to_cpu(action_frame->len);
--
2.32.0

8 changes: 6 additions & 2 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pkgbase=linux-mbp
pkgver=5.12.19
_srcname=linux-${pkgver}
pkgrel=1
pkgrel=2
pkgdesc='Linux for MBP'
_srctag=v${pkgver%.*}-${pkgver##*.}
url="https://git.archlinux.org/linux.git/log/?h=v$_srctag"
Expand Down Expand Up @@ -66,6 +66,9 @@ source=(
# Broadcom WIFI/BT device support
8001-brcmfmac-Add-initial-support-for-the-BRCM4355.patch
8002-brcmfmac-Add-initial-support-for-the-BRCM4377.patch

# Broadcom P2P VIF fix
9001-brcmfmac-p2p-Ensure-virtual-interface-is-initialized.patch
)

validpgpkeys=(
Expand Down Expand Up @@ -104,7 +107,8 @@ sha256sums=('e9381cd3525a02f5b895f74147e2440be443ecd45484c6c64075046bc6f94c73'
'9640178d6251686c980c30fc528b3d70beac6ce8246bf433506a3f843808326c'
'90a6012cdd8a64ede8e0bbaf7331960bd68f628e0973b65459188eb1ccb5b829'
'3a7baa28d5f45bdbff23e838133f2e3c6896412ffb5a919b4992a7b2d17469d9'
'edb804461e3820ef3397e1e236f7caabf906b6a13d03f406c8462ec476ecbbe5')
'edb804461e3820ef3397e1e236f7caabf906b6a13d03f406c8462ec476ecbbe5'
'fa0ad2e2f171eafd727d780588f7ef5d47ddf2d75fab02c67356bbc7b26e25e0')

export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
Expand Down

0 comments on commit 1bd10dc

Please sign in to comment.