简体   繁体   中英

How to reset system in wireless driver?

Can I use emergency_restart() ?

or If I use kill(1, SIGTERM);

I need to include "signal.h", but it seems not work in wireless driver

  1. embedded linux system
  2. device: wireless AP
  3. code section: wireless driver

As Basile says, kill() is a user space syscall, so you can't use it from a kernel module. It's a crude way to accomplish what you are trying to do anyways. Unless you have a reason to use emergency_restart() over kernel_restart() I would use the latter. The options you have can be found in reboot.h .

BTW, this is opening a security hole in your system. Since the driver is interpreting the data packet to determine if it is time to restart, there the OS cannot help to determine if that source has authority to perform such an action on your system. You may be better off with a user-space daemon which is run with the appropriate permissions to reboot the computer, and can act as an authentication agent and a reboot agent rather than doing it in your driver.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM