main.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 struct wlcore_ops wl12xx_ops = {
  27. };
  28. static int __devinit wl12xx_probe(struct platform_device *pdev)
  29. {
  30. struct wl1271 *wl;
  31. struct ieee80211_hw *hw;
  32. hw = wlcore_alloc_hw();
  33. if (IS_ERR(hw)) {
  34. wl1271_error("can't allocate hw");
  35. return PTR_ERR(hw);
  36. }
  37. wl = hw->priv;
  38. wl->ops = &wl12xx_ops;
  39. return wlcore_probe(wl, pdev);
  40. }
  41. static const struct platform_device_id wl12xx_id_table[] __devinitconst = {
  42. { "wl12xx", 0 },
  43. { } /* Terminating Entry */
  44. };
  45. MODULE_DEVICE_TABLE(platform, wl12xx_id_table);
  46. static struct platform_driver wl12xx_driver = {
  47. .probe = wl12xx_probe,
  48. .remove = __devexit_p(wlcore_remove),
  49. .id_table = wl12xx_id_table,
  50. .driver = {
  51. .name = "wl12xx_driver",
  52. .owner = THIS_MODULE,
  53. }
  54. };
  55. static int __init wl12xx_init(void)
  56. {
  57. return platform_driver_register(&wl12xx_driver);
  58. }
  59. module_init(wl12xx_init);
  60. static void __exit wl12xx_exit(void)
  61. {
  62. platform_driver_unregister(&wl12xx_driver);
  63. }
  64. module_exit(wl12xx_exit);
  65. MODULE_LICENSE("GPL v2");
  66. MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");