disable-hwcrypto.sh 835 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. set -e
  3. NOHWCRYPT="ath5k ath9k ath9k_htc rt2800usb carl9170 b43 p54common rt2500usb rt2800pci rt2800usb rt73usb"
  4. SWCRYPTO="iwlwifi iwl3945 iwl4965"
  5. HWCRYPTO="ipw2200"
  6. # 1. Create nohwcrypt.conf options file
  7. rm /etc/modprobe.d/nohwcrypt.conf 2> /dev/null || true
  8. for MODULE in $NOHWCRYPT
  9. do echo "options $MODULE nohwcrypt=1" >> /etc/modprobe.d/nohwcrypt.conf; done
  10. for MODULE in $SWCRYPTO
  11. do echo "options $MODULE swcrypto=1" >> /etc/modprobe.d/nohwcrypt.conf; done
  12. for MODULE in $HWCRYPTO
  13. do echo "options $MODULE hwcrypto=0" >> /etc/modprobe.d/nohwcrypt.conf; done
  14. # 2. Remove loaded modules so they'll reload parameters
  15. for MODULE in $NOHWCRYPT $SWCRYPTO $HWCRYPTO
  16. do rmmod $MODULE 2> /dev/null || true; done
  17. # 3. Done. To be sure parameters are reloaded, reboot computer.
  18. echo "Done. Reboot your computer."