wl12xx/wlcore: spin out the wl12xx probe from wlcore to a new wl12xx

Create a new small wl12xx module that only contains the probe
functions and depends entirely on wlcore otherwise.

Signed-off-by: Luciano Coelho <coelho@ti.com>
This commit is contained in:
Luciano Coelho 2011-11-20 23:32:10 +02:00
parent 7b3115f265
commit b2ba99ff32
9 changed files with 130 additions and 64 deletions

View File

@ -7,5 +7,8 @@ menuconfig WL_TI
if WL_TI if WL_TI
source "drivers/net/wireless/ti/wl1251/Kconfig" source "drivers/net/wireless/ti/wl1251/Kconfig"
source "drivers/net/wireless/ti/wl12xx/Kconfig"
# keep last for automatic dependencies
source "drivers/net/wireless/ti/wlcore/Kconfig" source "drivers/net/wireless/ti/wlcore/Kconfig"
endif # WL_TI endif # WL_TI

View File

@ -1,3 +1,4 @@
obj-$(CONFIG_WL12XX) += wlcore/ obj-$(CONFIG_WLCORE) += wlcore/
obj-$(CONFIG_WL12XX) += wl12xx/
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wlcore/ obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wlcore/
obj-$(CONFIG_WL1251) += wl1251/ obj-$(CONFIG_WL1251) += wl1251/

View File

@ -0,0 +1,8 @@
config WL12XX
tristate "TI wl12xx support"
select WLCORE
---help---
This module adds support for wireless adapters based on TI wl1271,
wl1273, wl1281 and wl1283 chipsets. This module does *not* include
support for wl1251. For wl1251 support, use the separate homonymous
driver instead.

View File

@ -0,0 +1,3 @@
wl12xx-objs = main.o
obj-$(CONFIG_WL12XX) += wl12xx.o

View File

@ -0,0 +1,56 @@
/*
* This file is part of wl1271
*
* Copyright (C) 2008-2010 Nokia Corporation
*
* 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"
static const struct platform_device_id wl12xx_id_table[] __devinitconst = {
{ "wl12xx", 0 },
{ } /* Terminating Entry */
};
MODULE_DEVICE_TABLE(platform, wl12xx_id_table);
static struct platform_driver wl12xx_driver = {
.probe = wlcore_probe,
.remove = __devexit_p(wlcore_remove),
.id_table = wl12xx_id_table,
.driver = {
.name = "wl12xx_driver",
.owner = THIS_MODULE,
}
};
static int __init wl12xx_init(void)
{
return platform_driver_register(&wl12xx_driver);
}
module_init(wl12xx_init);
static void __exit wl12xx_exit(void)
{
platform_driver_unregister(&wl12xx_driver);
}
module_exit(wl12xx_exit);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");

View File

@ -1,48 +1,41 @@
menuconfig WL12XX_MENU config WLCORE
tristate "TI wl12xx driver support" tristate "TI wlcore support"
depends on MAC80211 && EXPERIMENTAL depends on WL_TI && GENERIC_HARDIRQS
---help---
This will enable TI wl12xx driver support for the following chips:
wl1271, wl1273, wl1281 and wl1283.
The drivers make use of the mac80211 stack.
config WL12XX
tristate "TI wl12xx support"
depends on WL12XX_MENU && GENERIC_HARDIRQS
depends on INET depends on INET
select FW_LOADER select FW_LOADER
---help--- ---help---
This module adds support for wireless adapters based on TI wl1271 and This module contains the main code for TI WLAN chips. It abstracts
TI wl1273 chipsets. This module does *not* include support for wl1251. hardware-specific differences among different chipset families.
For wl1251 support, use the separate homonymous driver instead. Each chipset family needs to implement its own lower-level module
that will depend on this module for the common code.
If you choose to build a module, it will be called wl12xx. Say N if If you choose to build a module, it will be called wlcore. Say N if
unsure. unsure.
config WL12XX_SPI config WLCORE_SPI
tristate "TI wl12xx SPI support" tristate "TI wlcore SPI support"
depends on WL12XX && SPI_MASTER depends on WLCORE && SPI_MASTER
select CRC7 select CRC7
---help--- ---help---
This module adds support for the SPI interface of adapters using This module adds support for the SPI interface of adapters using
TI wl12xx chipsets. Select this if your platform is using TI WLAN chipsets. Select this if your platform is using
the SPI bus. the SPI bus.
If you choose to build a module, it'll be called wl12xx_spi. If you choose to build a module, it'll be called wlcore_spi.
Say N if unsure. Say N if unsure.
config WL12XX_SDIO config WLCORE_SDIO
tristate "TI wl12xx SDIO support" tristate "TI wlcore SDIO support"
depends on WL12XX && MMC depends on WLCORE && MMC
---help--- ---help---
This module adds support for the SDIO interface of adapters using This module adds support for the SDIO interface of adapters using
TI wl12xx chipsets. Select this if your platform is using TI WLAN chipsets. Select this if your platform is using
the SDIO bus. the SDIO bus.
If you choose to build a module, it'll be called wl12xx_sdio. If you choose to build a module, it'll be called wlcore_sdio.
Say N if unsure. Say N if unsure.
config WL12XX_PLATFORM_DATA config WL12XX_PLATFORM_DATA
bool bool
depends on WL12XX_SDIO != n || WL1251_SDIO != n depends on WLCORE_SDIO != n || WL1251_SDIO != n
default y default y

View File

@ -1,13 +1,13 @@
wl12xx-objs = main.o cmd.o io.o event.o tx.o rx.o ps.o acx.o \ wlcore-objs = main.o cmd.o io.o event.o tx.o rx.o ps.o acx.o \
boot.o init.o debugfs.o scan.o boot.o init.o debugfs.o scan.o
wl12xx_spi-objs = spi.o wlcore_spi-objs = spi.o
wl12xx_sdio-objs = sdio.o wlcore_sdio-objs = sdio.o
wl12xx-$(CONFIG_NL80211_TESTMODE) += testmode.o wlcore-$(CONFIG_NL80211_TESTMODE) += testmode.o
obj-$(CONFIG_WL12XX) += wl12xx.o obj-$(CONFIG_WLCORE) += wlcore.o
obj-$(CONFIG_WL12XX_SPI) += wl12xx_spi.o obj-$(CONFIG_WLCORE_SPI) += wlcore_spi.o
obj-$(CONFIG_WL12XX_SDIO) += wl12xx_sdio.o obj-$(CONFIG_WLCORE_SDIO) += wlcore_sdio.o
# small builtin driver bit # small builtin driver bit
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx_platform_data.o obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx_platform_data.o

View File

@ -5477,7 +5477,7 @@ static irqreturn_t wl12xx_hardirq(int irq, void *cookie)
return IRQ_WAKE_THREAD; return IRQ_WAKE_THREAD;
} }
static int __devinit wl12xx_probe(struct platform_device *pdev) int __devinit wlcore_probe(struct platform_device *pdev)
{ {
struct wl12xx_platform_data *pdata = pdev->dev.platform_data; struct wl12xx_platform_data *pdata = pdev->dev.platform_data;
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
@ -5572,8 +5572,9 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
out: out:
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(wlcore_probe);
static int __devexit wl12xx_remove(struct platform_device *pdev) int __devexit wlcore_remove(struct platform_device *pdev)
{ {
struct wl1271 *wl = platform_get_drvdata(pdev); struct wl1271 *wl = platform_get_drvdata(pdev);
@ -5587,34 +5588,7 @@ static int __devexit wl12xx_remove(struct platform_device *pdev)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(wlcore_remove);
static const struct platform_device_id wl12xx_id_table[] __devinitconst = {
{ "wl12xx", 0 },
{ } /* Terminating Entry */
};
MODULE_DEVICE_TABLE(platform, wl12xx_id_table);
static struct platform_driver wl12xx_driver = {
.probe = wl12xx_probe,
.remove = __devexit_p(wl12xx_remove),
.id_table = wl12xx_id_table,
.driver = {
.name = "wl12xx_driver",
.owner = THIS_MODULE,
}
};
static int __init wl12xx_init(void)
{
return platform_driver_register(&wl12xx_driver);
}
module_init(wl12xx_init);
static void __exit wl12xx_exit(void)
{
platform_driver_unregister(&wl12xx_driver);
}
module_exit(wl12xx_exit);
u32 wl12xx_debug_level = DEBUG_NONE; u32 wl12xx_debug_level = DEBUG_NONE;
EXPORT_SYMBOL_GPL(wl12xx_debug_level); EXPORT_SYMBOL_GPL(wl12xx_debug_level);

View File

@ -0,0 +1,28 @@
/*
* This file is part of wlcore
*
* Copyright (C) 2011 Texas Instruments Inc.
*
* 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
*
*/
#ifndef __WLCORE_H__
#define __WLCORE_H__
int __devinit wlcore_probe(struct platform_device *pdev);
int __devexit wlcore_remove(struct platform_device *pdev);
#endif /* __WLCORE_H__ */