Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 084708b6 authored by Holger Schurig's avatar Holger Schurig Committed by John W. Linville
Browse files

[PATCH] libertas: split module into two (libertas.ko and usb8xxx.ko)



* add CONFIG_LIBERTAS to Kconfig
* remove global variable libertas_fw_name, the USB module might want to
    use a different default FW name than the CF module, so libertas_fw_name
    is now local to if_usb.c
* exported some symbols as GPL

Signed-off-by: default avatarHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ed457037
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -266,16 +266,22 @@ config IPW2200_DEBUG

	  If you are not sure, say N here.

config LIBERTAS_USB
	tristate "Marvell Libertas 8388 802.11a/b/g cards"
	depends on USB && WLAN_80211
config LIBERTAS
	tristate "Marvell 8xxx Libertas WLAN driver support"
	depends on WLAN_80211
	select FW_LOADER
	---help---
	  A library for Marvell Libertas 8xxx devices.

config LIBERTAS_USB
	tristate "Marvell Libertas 8388 USB 802.11b/g cards"
	depends on LIBERTAS && USB
	---help---
	  A driver for Marvell Libertas 8388 USB devices.

config LIBERTAS_USB_DEBUG
	bool "Enable full debugging output in the Libertas USB module."
	depends on LIBERTAS_USB
config LIBERTAS_DEBUG
	bool "Enable full debugging output in the Libertas module."
	depends on LIBERTAS
	---help---
	  Debugging support.

+2 −2
Original line number Diff line number Diff line
usb8xxx-objs := main.o fw.o wext.o \
libertas-objs := main.o fw.o wext.o \
		rx.o tx.o cmd.o 	  \
		cmdresp.o scan.o	  \
		join.o 11d.o 		  \
@@ -8,5 +8,5 @@ usb8xxx-objs := main.o fw.o wext.o \
usb8xxx-objs += if_bootcmd.o
usb8xxx-objs += if_usb.o

obj-$(CONFIG_LIBERTAS)     += libertas.o
obj-$(CONFIG_LIBERTAS_USB) += usb8xxx.o
+1 −0
Original line number Diff line number Diff line
@@ -1459,6 +1459,7 @@ int libertas_prepare_and_send_command(wlan_private * priv,
	lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
	return ret;
}
EXPORT_SYMBOL_GPL(libertas_prepare_and_send_command);

/**
 *  @brief This function allocates the command buffer and link
+6 −10
Original line number Diff line number Diff line
@@ -74,20 +74,16 @@ void libertas_mac_event_disconnected(wlan_private * priv);
void libertas_send_iwevcustom_event(wlan_private * priv, s8 * str);

/* fw.c */
int libertas_init_fw(wlan_private * priv);
int libertas_init_fw(wlan_private * priv, char *fw_name);

/* main.c */
struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band,
						             int *cfp_no);
wlan_private *wlan_add_card(void *card);
int libertas_activate_card(wlan_private *priv);
int wlan_remove_card(wlan_private *priv);
int wlan_add_mesh(wlan_private *priv);
void wlan_remove_mesh(wlan_private *priv);

/* preliminary here */
int if_usb_register(void);
void if_usb_unregister(void);
wlan_private *libertas_add_card(void *card);
int libertas_activate_card(wlan_private *priv, char *fw_name);
int libertas_remove_card(wlan_private *priv);
int libertas_add_mesh(wlan_private *priv);
void libertas_remove_mesh(wlan_private *priv);


#endif				/* _WLAN_DECL_H_ */
+5 −9
Original line number Diff line number Diff line
/**
  * This file contains the initialization for FW and HW
  */
#include <linux/moduleparam.h>
#include <linux/firmware.h>

#include "host.h"
@@ -11,9 +10,6 @@
#include "wext.h"
#include "if_usb.h"

char *libertas_fw_name = NULL;
module_param_named(fw_name, libertas_fw_name, charp, 0644);

/**
 *  @brief This function checks the validity of Boot2/FW image.
 *
@@ -67,18 +63,18 @@ static int check_fwfile_format(u8 *data, u32 totlen)
 *  @param priv    A pointer to wlan_private structure
 *  @return 	   0 or -1
 */
static int wlan_setup_station_hw(wlan_private * priv)
static int wlan_setup_station_hw(wlan_private * priv, char *fw_name)
{
	int ret = -1;
	wlan_adapter *adapter = priv->adapter;

	lbs_deb_enter(LBS_DEB_FW);

	if ((ret = request_firmware(&priv->firmware, libertas_fw_name,
	if ((ret = request_firmware(&priv->firmware, fw_name,
				    priv->hotplug_device)) < 0) {
		lbs_pr_err("request_firmware() failed with %#x\n",
		       ret);
		lbs_pr_err("firmware %s not found\n", libertas_fw_name);
		lbs_pr_err("firmware %s not found\n", fw_name);
		goto done;
	}

@@ -247,7 +243,7 @@ static void wlan_init_adapter(wlan_private * priv)

static void command_timer_fn(unsigned long data);

int libertas_init_fw(wlan_private * priv)
int libertas_init_fw(wlan_private * priv, char *fw_name)
{
	int ret = -1;
	wlan_adapter *adapter = priv->adapter;
@@ -266,7 +262,7 @@ int libertas_init_fw(wlan_private * priv)
			(unsigned long)priv);

	/* download fimrware etc. */
	if ((ret = wlan_setup_station_hw(priv)) != 0) {
	if ((ret = wlan_setup_station_hw(priv, fw_name)) != 0) {
		del_timer_sync(&adapter->command_timer);
		goto done;
	}
Loading