選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

iwmgmt_cmd.c 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (C) 2009 Joshua Oreman <oremanj@rwcr.net>.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of the
  7. * License, or any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. FILE_LICENCE ( GPL2_OR_LATER );
  19. #include <gpxe/netdevice.h>
  20. #include <gpxe/net80211.h>
  21. #include <gpxe/command.h>
  22. #include <usr/iwmgmt.h>
  23. #include <hci/ifmgmt_cmd.h>
  24. /* "iwstat" command */
  25. static int iwstat_payload ( struct net_device *netdev ) {
  26. struct net80211_device *dev = net80211_get ( netdev );
  27. if ( dev )
  28. iwstat ( dev );
  29. return 0;
  30. }
  31. static int iwstat_exec ( int argc, char **argv ) {
  32. return ifcommon_exec ( argc, argv,
  33. iwstat_payload, "Display wireless status of" );
  34. }
  35. /* "iwlist" command */
  36. static int iwlist_payload ( struct net_device *netdev ) {
  37. struct net80211_device *dev = net80211_get ( netdev );
  38. if ( dev )
  39. return iwlist ( dev );
  40. return 0;
  41. }
  42. static int iwlist_exec ( int argc, char **argv ) {
  43. return ifcommon_exec ( argc, argv, iwlist_payload,
  44. "List wireless networks available via" );
  45. }
  46. /** Wireless interface management commands */
  47. struct command iwmgmt_commands[] __command = {
  48. {
  49. .name = "iwstat",
  50. .exec = iwstat_exec,
  51. },
  52. {
  53. .name = "iwlist",
  54. .exec = iwlist_exec,
  55. },
  56. };