Package Details: alx-wol-dkms 6-2

Git Clone URL: https://aur.archlinux.org/alx-wol-dkms.git (read-only, click to copy)
Package Base: alx-wol-dkms
Description: The alx kernel module with a patch enabling WoL applied
Upstream URL: https://bugzilla.kernel.org/show_bug.cgi?id=61651
Keywords: alx dkms wake-on-lan wol
Licenses: GPL
Submitter: angelsl
Maintainer: christoph_heiss
Last Packager: christoph_heiss
Votes: 8
Popularity: 0.000000
First Submitted: 2017-12-26 05:17 (UTC)
Last Updated: 2023-03-19 00:54 (UTC)

Dependencies (4)

Required by (0)

Sources (10)

Latest Comments

« First ‹ Previous 1 2 3 4 Next › Last »

jhwshin commented on 2021-05-22 10:55 (UTC) (edited on 2021-05-22 11:02 (UTC) by jhwshin)

Was getting a HUNK error during failed patch for 000-enable-alx-wol.patch

==> Extracting sources...
==> Starting prepare()...
patching file ethtool.c
patching file hw.c
patching file hw.h
patching file main.c
Hunk #2 succeeded at 1348 (offset 4 lines).
Hunk #3 succeeded at 1898 (offset 1 line).
Hunk #4 FAILED at 1940.
Hunk #5 succeeded at 2017 (offset 1 line).
Hunk #6 succeeded at 2068 (offset 1 line).
1 out of 6 hunks FAILED -- saving rejects to file main.c.rej
==> ERROR: A failure occurred in prepare().
    Aborting...

I think I found a fix with patch below.

Tested and currently working on 5.12.5-arch1

@@ -1878,40 +1940,71 @@
 static int alx_suspend(struct device *dev)
 {
    struct alx_priv *alx = dev_get_drvdata(dev);
+   struct pci_dev *pdev = alx->hw.pdev;
+   int err;
+   bool wol_en;

-   if (!netif_running(alx->dev))
-       return 0;
-   netif_device_detach(alx->dev);
-   __alx_stop(alx);
+   err = __alx_shutdown(pdev, &wol_en);
+   if (err) {
+       dev_err(&pdev->dev, "shutdown fail in suspend %d\n", err);
+       return err;
+   }
+
+   if (wol_en) {
+       pci_prepare_to_sleep(pdev);
+   } else {
+       pci_wake_from_d3(pdev, false);
+       pci_set_power_state(pdev, PCI_D3hot);
+   }
    return 0;
 }

 static int alx_resume(struct device *dev)
 {
    struct alx_priv *alx = dev_get_drvdata(dev);
+   struct net_device *netdev = alx->dev;
    struct alx_hw *hw = &alx->hw;
+   struct pci_dev *pdev = hw->pdev;
    int err;

+  pci_set_power_state(pdev, PCI_D0);
+  pci_restore_state(pdev);
+  pci_save_state(pdev);
+
+  pci_enable_wake(pdev, PCI_D3hot, 0);
+  pci_enable_wake(pdev, PCI_D3cold, 0);
+
+  hw->link_speed = SPEED_UNKNOWN;
+  alx->int_mask = ALX_ISR_MISC;
+
+   alx_reset_pcie(hw);
    alx_reset_phy(hw);

-   if (!netif_running(alx->dev))
-       return 0;

-   rtnl_lock();
-   err = __alx_open(alx, true);
-   rtnl_unlock();
-   if (err)
-      return err;

-   netif_device_attach(alx->dev);

-   return 0;
+  err = alx_reset_mac(hw);
+  if (err) {
+    netif_err(alx, hw, alx->dev,
+                                   "resume:reset_mac fail %d\n", err);
+    return -EIO;
+  }
+  err = alx_setup_speed_duplex(hw, hw->adv_cfg, hw->flowctrl);
+   if (err) {
+       netif_err(alx, hw, alx->dev,
+                               "resume:setup_speed_duplex fail %d\n", err);
+    return -EIO;
+  }
+  
+   if (netif_running(netdev)) {
+       err = __alx_open(alx, true);
+    if (err)
+      return err;
+  }
+  netif_device_attach(netdev);
+  return err;
 }

-static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume);
-#define ALX_PM_OPS      (&alx_pm_ops)
-#else
-#define ALX_PM_OPS      NULL
 #endif

angelsl commented on 2021-04-04 09:09 (UTC)

@Arkas:

Manjaro is technically off-topic on the AUR.

But, yes, using _kernel_tag=5.10.15-arch1 will probably work, because the alx driver code doesn't change that much, but just be aware that it will not give you the exact source that Manjaro uses. (Manjaro's kernel PKGBUILDs download the kernel.org tarballs and apply patch files, instead of using a Git repository like Arch.)

Arkas commented on 2021-04-04 08:31 (UTC)

Is it also possible to apply this patch for Manjaro? My kernel version is at the moment 5.10.15-1-MANJARO. So can I just use 5.10.15-arch1 as _kernel_tag? Or do I need to change more, since using my kernel version als _kernel_tag results in download errors for the used source files?

johanbcn commented on 2020-08-18 16:03 (UTC) (edited on 2020-08-18 16:03 (UTC) by johanbcn)

It does work as stated by @Friz64, but you have to use the kernel tag matching the one from your kernel headers.

Assuming you are using the default kernel provided on arch, follow these steps:

  1. Find out your kernel version by running pacman -Qi linux-headers. At the moment of writing this, it's 5.8.1.arch1-1

  2. Edit the PKGBUILD file and change the _kernel_tag variable accordingly. In this case: _kernel_tag=5.8.1-arch1

  3. You may skip updating the checksum of the files by running makepkg --skipchecksums. Up to you.

miguelangellv commented on 2020-07-02 22:02 (UTC) (edited on 2020-07-02 22:03 (UTC) by miguelangellv)

I get error, I try the change of @Friz64 and get the same error

cat /var/lib/dkms/alx-wol/5.6/build/make.log DKMS make.log for alx-wol-5.6 for kernel 5.6.16-1-MANJARO (x86_64) jue 02 jul 2020 23:57:55 CEST make: se entra en el directorio '/usr/lib/modules/5.6.16-1-MANJARO/build' AR /var/lib/dkms/alx-wol/5.6/build/built-in.a CC [M] /var/lib/dkms/alx-wol/5.6/build/ethtool.o CC [M] /var/lib/dkms/alx-wol/5.6/build/main.o CC [M] /var/lib/dkms/alx-wol/5.6/build/hw.o /var/lib/dkms/alx-wol/5.6/build/main.c:1744:28: error: inicialización de ‘void ()(struct net_device , unsigned int)’ desde un tipo de puntero ‘void ()(struct net_device )’ incompatible [-Werror=incompatible-pointer-types] 1744 | .ndo_tx_timeout = alx_tx_timeout, | ^~~~~~~~~~~~~~ /var/lib/dkms/alx-wol/5.6/build/main.c:1744:28: nota: (cerca de la inicialización de ‘alx_netdev_ops.ndo_tx_timeout’) cc1: algunos avisos se tratan como errores make[1]: [scripts/Makefile.build:267: /var/lib/dkms/alx-wol/5.6/build/main.o] Error 1 make: [Makefile:1695: /var/lib/dkms/alx-wol/5.6/build] Error 2 make: se sale del directorio '/usr/lib/modules/5.6.16-1-MANJARO/build'

Friz64 commented on 2020-04-12 16:31 (UTC) (edited on 2020-04-12 16:31 (UTC) by Friz64)

I had success manually changing PKGBUILD's line 5 to _kernel_tag=5.6.3-arch1 and line 30 to '514eef113fa12f51ecb8cb6651866aa55a5d40b247ae1225d6159f681b5edcd1'.

DocMAX commented on 2020-04-10 15:11 (UTC)

Needs an update once again for 5.6.x...

edward-p commented on 2019-12-09 07:26 (UTC)

@Luk_3D I don't use Manjaro. But I think you need install linux-headers.