main.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * This file is part of wl1271
  3. *
  4. * Copyright (C) 2008-2010 Nokia Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  18. * 02110-1301 USA
  19. *
  20. */
  21. #include <linux/module.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/err.h>
  24. #include "../wlcore/wlcore.h"
  25. #include "../wlcore/debug.h"
  26. static int __devinit wl12xx_probe(struct platform_device *pdev)
  27. {
  28. struct wl1271 *wl;
  29. struct ieee80211_hw *hw;
  30. hw = wlcore_alloc_hw();
  31. if (IS_ERR(hw)) {
  32. wl1271_error("can't allocate hw");
  33. return PTR_ERR(hw);
  34. }
  35. wl = hw->priv;
  36. return wlcore_probe(wl, pdev);
  37. }
  38. static const struct platform_device_id wl12xx_id_table[] __devinitconst = {
  39. { "wl12xx", 0 },
  40. { } /* Terminating Entry */
  41. };
  42. MODULE_DEVICE_TABLE(platform, wl12xx_id_table);
  43. static struct platform_driver wl12xx_driver = {
  44. .probe = wl12xx_probe,
  45. .remove = __devexit_p(wlcore_remove),
  46. .id_table = wl12xx_id_table,
  47. .driver = {
  48. .name = "wl12xx_driver",
  49. .owner = THIS_MODULE,
  50. }
  51. };
  52. static int __init wl12xx_init(void)
  53. {
  54. return platform_driver_register(&wl12xx_driver);
  55. }
  56. module_init(wl12xx_init);
  57. static void __exit wl12xx_exit(void)
  58. {
  59. platform_driver_unregister(&wl12xx_driver);
  60. }
  61. module_exit(wl12xx_exit);
  62. MODULE_LICENSE("GPL v2");
  63. MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");