# [solved] Broadcom WIFI driver with kernel 4.15

## gr3m1in

I have recently faced the problem while compiling net-wireless/broadcom-sta (14e4:43b1) after updating the system.

In case if someone still use a similar device

```
03:00.0 Network controller: Broadcom Limited BCM4352 802.11ac Wireless Network Adapter (rev 03)
```

this might help

```
--- a/src/wl/sys/wl_linux.c     2018-01-31 11:33:26.000000000 +0100

+++ b/src/wl/sys/wl_linux.c     2018-01-31 15:27:18.000000000 +0100

@@ -93,7 +93,11 @@

 

 #include <wlc_wowl.h>

 

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)

 static void wl_timer(ulong data);

+#else

+static void wl_timer(struct timer_list *tl);

+#endif

 static void _wl_timer(wl_timer_t *t);

 static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);

 

@@ -2301,9 +2305,17 @@

 }

 

 static void

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)

 wl_timer(ulong data)

+#else

+wl_timer(struct timer_list *tl)

+#endif

 {

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)

        wl_timer_t *t = (wl_timer_t *)data;

+#else

+    wl_timer_t *t = from_timer(t, tl, timer);

+#endif

 

        if (!WL_ALL_PASSIVE_ENAB(t->wl))

                _wl_timer(t);

@@ -2355,7 +2367,11 @@

 

        bzero(t, sizeof(wl_timer_t));

 

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)

        init_timer(&t->timer);

        t->timer.data = (ulong) t;

        t->timer.function = wl_timer;

+#else

+    timer_setup(&t->timer, wl_timer, 0);

+#endif

        t->wl = wl;
```

This snippet should be placed in 

```
/etc/portage/patches/net-wireless/broadcom-sta/timer.patch
```

 or whatever filename.patch at the same path

----------

## Yamakuzure

Thank you very much!

I still have that wretched chip in my laptop, and am very thankful for your post.  :Smile: 

----------

## NeddySeagoon

gr3m1in,

Please post a gentoo bug, so that it gets into the maintainers work queue.

----------

## gr3m1in

Yamakuzure,

Glad to know that it helped!   :Very Happy: 

NeddySeagoon,

I've been AFK for a while, and someone have already posted the same bug with slightly different patch, so there is no point to create duplicate one.

I'll leave the bug link here

https://bugs.gentoo.org/646106

to make it easier to learn when the manual patch should be removed from /etc/portage/patches

----------

## Yamakuzure

Hrmpf.  :Mad:   Broadcom left us alone with that one for too long. I could only connect to one out of three Networks I regularly use in the end. Nothing helped.

So I cracked and bought an Intel 7260 dual board for 35€. In my Dell Precision M4800 it works ootb and I can connect to all Networks again. Bye Bye BCM!   :Twisted Evil: 

----------

## glecomte

Thanks gr3m1in!

I too have one of these broadcom wifi chips, and your patch worked like a charm.

----------

## archenroot

I am using mini pcie version of this card in Asrock x99 mini itx ac board which I used for my latest custom build, actually I use latest kernel 4.15.7 r1 with linux firmware (latest ~amd64), lspci -kk shows driver in use, but the card is not visible in the system... so in my case still something I am missing.

note I don't use sta broadcom driver, just rely purely on kernel...

----------

