- fix building for kernel 5.6
[packages/wl.git] / linux-5.6.patch
1 --- wl-6.30.223.271/wl/src/shared/linux_osl.c~  2020-04-04 23:51:43.000000000 +0200
2 +++ wl-6.30.223.271/wl/src/shared/linux_osl.c   2020-04-05 22:13:14.896669372 +0200
3 @@ -929,7 +929,11 @@
4  void *
5  osl_reg_map(uint32 pa, uint size)
6  {
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
8         return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
9 +#else
10 +       return (ioremap((unsigned long)pa, (unsigned long)size));
11 +#endif
12  }
13  
14  void
15 --- wl-6.30.223.271/wl/src/wl/sys/wl_linux.c~   2020-04-04 23:51:43.000000000 +0200
16 +++ wl-6.30.223.271/wl/src/wl/sys/wl_linux.c    2020-04-05 22:14:41.633337296 +0200
17 @@ -586,7 +586,11 @@
18         }
19         wl->bcm_bustype = bustype;
20  
21 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
22         if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
23 +#else
24 +       if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
25 +#endif
26                 WL_ERROR(("wl%d: ioremap() failed\n", unit));
27                 goto fail;
28         }
29 @@ -783,7 +787,11 @@
30         if ((val & 0x0000ff00) != 0)
31                 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
32                 bar1_size = pci_resource_len(pdev, 2);
33 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
34                 bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
35 +#else
36 +               bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2),
37 +#endif
38                         bar1_size);
39         wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev,
40                 pdev->irq, bar1_addr, bar1_size);
41 @@ -3374,11 +3374,18 @@
42  }
43  
44  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
45 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
46  static const struct file_operations wl_fops = {
47         .owner  = THIS_MODULE,
48         .read   = wl_proc_read,
49         .write  = wl_proc_write,
50  };
51 +#else
52 +static const struct proc_ops wl_fops = {
53 +       .proc_read      = wl_proc_read,
54 +       .proc_write     = wl_proc_write,
55 +};
56 +#endif
57  #endif
58  
59  static int
This page took 0.06967 seconds and 3 git commands to generate.