WiFi is disabled after sleep

Whenever I turn on my laptop from sleep (i.e. I close the lid, and later open the lid), WiFi is disabled, and I need to press the function key twice to turn on the WiFi.

This does not happed when waking up from suspend (even if I close the lid when the laptop is in suspend mode).

$ inxi --admin --verbosity=7 --filter --no-host --width
System:
  Kernel: 5.10.36-2-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 
  root=UUID=067bb185-2ee6-4461-8d00-69086fb7fed6 rw quiet udev.log_priority=3 
  Desktop: Xfce 4.16.0 tk: Gtk 3.24.24 info: xfce4-panel, vala-panel wm: xfwm4 
  vt: 7 dm: LightDM 1.30.0 Distro: Manjaro Linux base: Arch Linux 
Machine:
  Type: Laptop System: HP product: HP 250 G5 Notebook PC 
  v: Type1ProductConfigId serial: <filter> Chassis: type: 10 serial: <filter> 
  Mobo: HP model: 81EB v: 61.41 serial: <filter> UEFI: Insyde v: F.24 
  date: 01/05/2017 
Battery:
  ID-1: BAT1 charge: 32.1 Wh (100.0%) condition: 32.1/32.1 Wh (100.0%) 
  volts: 16.6 min: 14.6 model: Hewlett-Packard PABAS0241231 type: Li-ion 
  serial: <filter> status: Full 
Memory:
  RAM: total: 3.73 GiB used: 2.89 GiB (77.3%) 
  RAM Report: permissions: Unable to run dmidecode. Root privileges required. 
CPU:
  Info: Dual Core model: Intel Core i3-6006U bits: 64 type: MT MCP 
  arch: Skylake family: 6 model-id: 4E (78) stepping: 3 microcode: E2 cache: 
  L2: 3 MiB bogomips: 16006 
  Speed: 501 MHz min/max: 400/2000 MHz Core speeds (MHz): 1: 501 2: 500 3: 500 
  4: 500 
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat arch_perfmon art 
  avx avx2 bmi1 bmi2 bts clflush clflushopt cmov constant_tsc cpuid 
  cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est 
  f16c flexpriority flush_l1d fma fpu fsgsbase fxsr ht hwp hwp_act_window 
  hwp_epp hwp_notify ibpb ibrs intel_pt invpcid invpcid_single lahf_lm lm mca 
  mce md_clear mmx monitor movbe mpx msr mtrr nonstop_tsc nopl nx pae pat pbe 
  pcid pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pti pts rdrand 
  rdseed rdtscp rep_good sdbg sep smap smep ss ssbd sse sse2 sse4_1 sse4_2 
  ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust tsc_deadline_timer vme 
  vmx vnmi vpid x2apic xgetbv1 xsave xsavec xsaveopt xsaves xtopology xtpr 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds mitigation: Microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel Skylake GT2 [HD Graphics 520] vendor: Hewlett-Packard 
  driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:1916 class-ID: 0300 
  Device-2: Chicony HP TrueVision HD type: USB driver: uvcvideo bus-ID: 1-5:3 
  chip-ID: 04f2:b56c class-ID: 0e02 serial: <filter> 
  Display: x11 server: X.Org 1.20.11 driver: loaded: intel 
  unloaded: modesetting alternate: fbdev,vesa display-ID: :0.0 screens: 1 
  Screen-1: 0 s-res: 1600x900 s-dpi: 96 s-size: 423x238mm (16.7x9.4") 
  s-diag: 485mm (19.1") 
  Monitor-1: eDP1 res: 1600x900 hz: 60 dpi: 120 size: 340x190mm (13.4x7.5") 
  diag: 389mm (15.3") 
  OpenGL: renderer: Mesa Intel HD Graphics 520 (SKL GT2) v: 4.6 Mesa 21.0.3 
  direct render: Yes 
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel alternate: snd_soc_skl bus-ID: 00:1f.3 
  chip-ID: 8086:9d70 class-ID: 0403 
  Sound Server-1: ALSA v: k5.10.36-2-MANJARO running: yes 
  Sound Server-2: JACK v: 0.125.0 running: no 
  Sound Server-3: PulseAudio v: 14.2 running: yes 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Hewlett-Packard driver: r8169 v: kernel port: 3000 bus-ID: 01:00.0 
  chip-ID: 10ec:8168 class-ID: 0200 
  IF: eno1 state: down mac: <filter> 
  Device-2: Intel Wireless 3165 driver: iwlwifi v: kernel port: 3000 
  bus-ID: 02:00.0 chip-ID: 8086:3165 class-ID: 0280 
  IF: wlo1 state: up mac: <filter> 
  IP v4: <filter> type: dynamic noprefixroute scope: global 
  broadcast: <filter> 
  IP v6: <filter> type: noprefixroute scope: link 
  WAN IP: <filter> 
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 
  bus-ID: 1-4:2 chip-ID: 8087:0a2a class-ID: e001 
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends 
Logical:
  Message: No logical block device data found. 
RAID:
  Message: No RAID data found. 
Drives:
  Local Storage: total: 931.51 GiB used: 514.93 GiB (55.3%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/sda maj-min: 8:0 vendor: Toshiba model: MQ01ABD100 
  size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s 
  rotation: 5400 rpm serial: <filter> rev: 4C scheme: GPT 
  Optical-1: /dev/sr0 vendor: hp model: DVDRW GUD1N rev: MD00 dev-links: cdrom 
  Features: speed: 24 multisession: yes audio: yes dvd: yes 
  rw: cd-r,cd-rw,dvd-r,dvd-ram state: running 
Partition:
  ID-1: / raw-size: 51.76 GiB size: 50.64 GiB (97.85%) used: 32.02 GiB (63.2%) 
  fs: ext4 dev: /dev/sda5 maj-min: 8:5 label: N/A 
  uuid: 067bb185-2ee6-4461-8d00-69086fb7fed6 
  ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%) 
  used: 100.9 MiB (39.4%) fs: vfat dev: /dev/sda1 maj-min: 8:1 label: N/A 
  uuid: DAA7-28F1 
  ID-3: /home raw-size: 22.98 GiB size: 22.45 GiB (97.70%) 
  used: 2.27 GiB (10.1%) fs: ext4 dev: /dev/sda9 maj-min: 8:9 label: N/A 
  uuid: e9f5c454-28c8-46b9-9160-97f9fcaf28ff 
  ID-4: /run/media/archisman/Store raw-size: 674.65 GiB 
  size: 674.65 GiB (100.00%) used: 480.53 GiB (71.2%) fs: ntfs dev: /dev/sda4 
  maj-min: 8:4 label: Store uuid: 01D30BC133BF3900 
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default) 
  ID-1: swap-1 type: zram size: 2 GiB used: 308.5 MiB (15.1%) priority: 5 
  dev: /dev/zram0 
Unmounted:
  ID-1: /dev/sda10 maj-min: 8:10 size: 68.36 GiB fs: ext4 label: N/A 
  uuid: c69fac7e-e0ba-4d3e-8923-7b7d799496ff 
  ID-2: /dev/sda2 maj-min: 8:2 size: 16 MiB fs: <superuser required> 
  label: N/A uuid: N/A 
  ID-3: /dev/sda3 maj-min: 8:3 size: 99.55 GiB fs: ntfs label: Windows 
  uuid: 70C06E16C06DE338 
  ID-4: /dev/sda6 maj-min: 8:6 size: 980 MiB fs: ntfs label: Windows RE tools 
  uuid: E26C282D6C27FB45 
  ID-5: /dev/sda7 maj-min: 8:7 size: 12.98 GiB fs: ntfs label: RECOVERY 
  uuid: 1840ED4740ED2C66 
USB:
  Hub-1: 1-0:1 info: Full speed (or root) Hub ports: 12 rev: 2.0 
  speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900 
  Device-1: 1-4:2 info: Intel Bluetooth wireless interface type: Bluetooth 
  driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 100mA 
  chip-ID: 8087:0a2a class-ID: e001 
  Device-2: 1-5:3 info: Chicony HP TrueVision HD type: Video driver: uvcvideo 
  interfaces: 2 rev: 2.0 speed: 480 Mb/s power: 500mA chip-ID: 04f2:b56c 
  class-ID: 0e02 serial: <filter> 
  Hub-2: 2-0:1 info: Full speed (or root) Hub ports: 6 rev: 3.0 speed: 5 Gb/s 
  chip-ID: 1d6b:0003 class-ID: 0900 
Sensors:
  System Temperatures: cpu: 38.0 C mobo: 29.8 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 221 Uptime: 2d 13h 03m wakeups: 13 Init: systemd v: 247 
  tool: systemctl Compilers: gcc: 10.2.0 clang: 11.1.0 Packages: pacman: 1555 
  lib: 327 Shell: Bash v: 5.1.8 running-in: xfce4-terminal inxi: 3.3.04 

How to change this behavior?

Expected behavior

If the WiFi was turned on before closing the lid, it should be turned on afterwards.
If the WiFi was turned off before closing the lid, it should remain turned off afterwards.
Right now, it is always turned off after closing the lid.

Please let me know if I need to provide any other information.