main.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * This file is part of wl18xx
  3. *
  4. * Copyright (C) 2011 Texas Instruments
  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 "../wlcore/wlcore.h"
  24. #include "../wlcore/debug.h"
  25. static struct wlcore_ops wl18xx_ops = {
  26. };
  27. int __devinit wl18xx_probe(struct platform_device *pdev)
  28. {
  29. struct wl1271 *wl;
  30. struct ieee80211_hw *hw;
  31. hw = wlcore_alloc_hw(0);
  32. if (IS_ERR(hw)) {
  33. wl1271_error("can't allocate hw");
  34. return PTR_ERR(hw);
  35. }
  36. wl = hw->priv;
  37. wl->ops = &wl18xx_ops;
  38. return wlcore_probe(wl, pdev);
  39. }
  40. static const struct platform_device_id wl18xx_id_table[] __devinitconst = {
  41. { "wl18xx", 0 },
  42. { } /* Terminating Entry */
  43. };
  44. MODULE_DEVICE_TABLE(platform, wl18xx_id_table);
  45. static struct platform_driver wl18xx_driver = {
  46. .probe = wl18xx_probe,
  47. .remove = __devexit_p(wlcore_remove),
  48. .id_table = wl18xx_id_table,
  49. .driver = {
  50. .name = "wl18xx_driver",
  51. .owner = THIS_MODULE,
  52. }
  53. };
  54. static int __init wl18xx_init(void)
  55. {
  56. return platform_driver_register(&wl18xx_driver);
  57. }
  58. module_init(wl18xx_init);
  59. static void __exit wl18xx_exit(void)
  60. {
  61. platform_driver_unregister(&wl18xx_driver);
  62. }
  63. module_exit(wl18xx_exit);
  64. MODULE_LICENSE("GPL v2");
  65. MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");