1From 99b1bbc01ea0611e93cb94c2a2532aef96676976 Mon Sep 17 00:00:00 2001
2From: X9VoiD <oscar.silvestrexx@gmail.com>
3Date: Wed, 19 Oct 2022 00:29:28 +0800
4Subject: [PATCH 15/16] linuxPackages.broadcom_sta: fix build issues with
5 kernel 6.0+
6
7---
8 src/shared/linux_osl.c | 2 +-
9 src/wl/sys/wl_cfg80211_hybrid.c | 17 ++++++++---------
10 src/wl/sys/wl_iw.h | 1 -
11 src/wl/sys/wl_linux.c | 17 +++++++++--------
12 4 files changed, 18 insertions(+), 19 deletions(-)
13
14diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c
15index 5a25b82..18bacb6 100644
16--- a/src/shared/linux_osl.c
17+++ b/src/shared/linux_osl.c
18@@ -1101,7 +1101,7 @@ osl_os_get_image_block(char *buf, int len, void *image)
19 if (!image)
20 return 0;
21
22- rdlen = kernel_read(fp, fp->f_pos, buf, len);
23+ rdlen = kernel_read(fp, (void *)fp->f_pos, (size_t)len, (loff_t *)buf);
24 if (rdlen > 0)
25 fp->f_pos += rdlen;
26
27diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
28index 9ae56a1..a6b2ca2 100644
29--- a/src/wl/sys/wl_cfg80211_hybrid.c
30+++ b/src/wl/sys/wl_cfg80211_hybrid.c
31@@ -790,6 +790,7 @@ wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
32 break;
33 case NL80211_AUTHTYPE_NETWORK_EAP:
34 WL_DBG(("network eap\n"));
35+ break;
36 default:
37 val = 2;
38 WL_ERR(("invalid auth type (%d)\n", sme->auth_type));
39@@ -2347,26 +2348,24 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev,
40 const wl_event_msg_t *e, void *data)
41 {
42 struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl);
43+ s32 err = 0;
44 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
45 struct cfg80211_bss *bss;
46 struct wlc_ssid *ssid;
47+ struct cfg80211_roam_info roam_info;
48 ssid = &wl->profile->ssid;
49 bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
50 ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
51- struct cfg80211_roam_info roam_info = {
52 // Rel. commit "cfg80211: Indicate MLO connection info in connect and roam callbacks" (Veerendranath Jakkam, Wed Jun 8)
53 #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
54- .bss = bss,
55+ roam_info.bss = bss;
56 #else
57- .links[0].bss = bss,
58+ roam_info.links[0].bss = bss;
59 #endif
60- .req_ie = conn_info->req_ie,
61- .req_ie_len = conn_info->req_ie_len,
62- .resp_ie = conn_info->resp_ie,
63- .resp_ie_len = conn_info->resp_ie_len,
64- };
65+ roam_info.req_ie = conn_info->req_ie;
66+ roam_info.req_ie_len = conn_info->req_ie_len;
67+ roam_info.resp_ie = conn_info->resp_ie;
68 #endif
69- s32 err = 0;
70
71 wl_get_assoc_ies(wl);
72 memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN);
73diff --git a/src/wl/sys/wl_iw.h b/src/wl/sys/wl_iw.h
74index 3ab084f..471d11f 100644
75--- a/src/wl/sys/wl_iw.h
76+++ b/src/wl/sys/wl_iw.h
77@@ -70,7 +70,6 @@ struct cntry_locales_custom {
78 #define WL_IW_RSSI_EXCELLENT -57
79 #define WL_IW_RSSI_INVALID 0
80 #define MAX_WX_STRING 80
81-#define isprint(c) bcm_isprint(c)
82 #define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1)
83 #define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3)
84 #define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5)
85diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
86index 25c4706..4c7e238 100644
87--- a/src/wl/sys/wl_linux.c
88+++ b/src/wl/sys/wl_linux.c
89@@ -791,14 +791,15 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
90 pci_read_config_dword(pdev, 0x40, &val);
91 if ((val & 0x0000ff00) != 0)
92 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
93- bar1_size = pci_resource_len(pdev, 2);
94- #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
95- bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2),
96- bar1_size);
97- #else
98- bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
99- bar1_size);
100- #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */
101+
102+ bar1_size = pci_resource_len(pdev, 2);
103+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
104+ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2),
105+ bar1_size);
106+ #else
107+ bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
108+ bar1_size);
109+ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */
110 wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev,
111 pdev->irq, bar1_addr, bar1_size);
112
113--
1142.45.1
115