Skip to content

Commit

Permalink
wl18xx: add new module
Browse files Browse the repository at this point in the history
Add the wl18xx module and the probe functions.  Use wlcore for the
main parts (not functional at this point due to differences in the
wl18xx initialization).

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
  • Loading branch information
Luciano Coelho committed Jun 5, 2012
1 parent f8f5701 commit 9a1a699
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/ti/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ menuconfig WL_TI
if WL_TI
source "drivers/net/wireless/ti/wl1251/Kconfig"
source "drivers/net/wireless/ti/wl12xx/Kconfig"
source "drivers/net/wireless/ti/wl18xx/Kconfig"

# keep last for automatic dependencies
source "drivers/net/wireless/ti/wlcore/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ti/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ obj-$(CONFIG_WLCORE) += wlcore/
obj-$(CONFIG_WL12XX) += wl12xx/
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wlcore/
obj-$(CONFIG_WL1251) += wl1251/
obj-$(CONFIG_WL18XX) += wl18xx/
6 changes: 6 additions & 0 deletions drivers/net/wireless/ti/wl18xx/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config WL18XX
tristate "TI wl18xx support"
select WLCORE
---help---
This module adds support for wireless adapters based on TI
WiLink 8 chipsets.
3 changes: 3 additions & 0 deletions drivers/net/wireless/ti/wl18xx/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wl18xx-objs = main.o

obj-$(CONFIG_WL18XX) += wl18xx.o
73 changes: 73 additions & 0 deletions drivers/net/wireless/ti/wl18xx/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* This file is part of wl18xx
*
* Copyright (C) 2011 Texas Instruments
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/

#include <linux/module.h>
#include <linux/platform_device.h>

#include "../wlcore/wlcore.h"
#include "../wlcore/debug.h"

int __devinit wl18xx_probe(struct platform_device *pdev)
{
struct wl1271 *wl;
struct ieee80211_hw *hw;

hw = wlcore_alloc_hw(0);
if (IS_ERR(hw)) {
wl1271_error("can't allocate hw");
return PTR_ERR(hw);
}

wl = hw->priv;

return wlcore_probe(wl, pdev);
}

static const struct platform_device_id wl18xx_id_table[] __devinitconst = {
{ "wl18xx", 0 },
{ } /* Terminating Entry */
};
MODULE_DEVICE_TABLE(platform, wl18xx_id_table);

static struct platform_driver wl18xx_driver = {
.probe = wl18xx_probe,
.remove = __devexit_p(wlcore_remove),
.id_table = wl18xx_id_table,
.driver = {
.name = "wl18xx_driver",
.owner = THIS_MODULE,
}
};

static int __init wl18xx_init(void)
{
return platform_driver_register(&wl18xx_driver);
}
module_init(wl18xx_init);

static void __exit wl18xx_exit(void)
{
platform_driver_unregister(&wl18xx_driver);
}
module_exit(wl18xx_exit);

MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");

0 comments on commit 9a1a699

Please sign in to comment.