main.c 1.8 KB

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