linux-5.6.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. diff -Nurp broadcom-wl-6.30.223.271.orig/src/shared/linux_osl.c broadcom-wl-6.30.223.271/src/shared/linux_osl.c
  2. --- broadcom-wl-6.30.223.271.orig/src/shared/linux_osl.c 2020-04-11 13:01:14.768843749 +0300
  3. +++ broadcom-wl-6.30.223.271/src/shared/linux_osl.c 2020-04-11 13:15:29.246184298 +0300
  4. @@ -946,7 +946,11 @@ osl_getcycles(void)
  5. void *
  6. osl_reg_map(uint32 pa, uint size)
  7. {
  8. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
  9. + return (ioremap((unsigned long)pa, (unsigned long)size));
  10. +#else
  11. return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
  12. +#endif
  13. }
  14. void
  15. diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c
  16. --- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c 2020-04-11 13:01:14.775844079 +0300
  17. +++ broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c 2020-04-11 13:18:05.671569807 +0300
  18. @@ -586,7 +586,11 @@ wl_attach(uint16 vendor, uint16 device,
  19. }
  20. wl->bcm_bustype = bustype;
  21. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
  22. + if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
  23. +#else
  24. if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
  25. +#endif
  26. WL_ERROR(("wl%d: ioremap() failed\n", unit));
  27. goto fail;
  28. }
  29. @@ -776,7 +780,11 @@ wl_pci_probe(struct pci_dev *pdev, const
  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(pci_resource_start(pdev, 2),
  35. +#else
  36. bar1_addr = (uchar *)ioremap_nocache(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. @@ -3348,10 +3356,16 @@ wl_proc_write(struct file *filp, const c
  42. }
  43. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
  44. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
  45. +static const struct proc_ops wl_fops = {
  46. + .proc_read = wl_proc_read,
  47. + .proc_write = wl_proc_write,
  48. +#else
  49. static const struct file_operations wl_fops = {
  50. .owner = THIS_MODULE,
  51. .read = wl_proc_read,
  52. .write = wl_proc_write,
  53. +#endif
  54. };
  55. #endif