aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-05-25 12:37:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:39 -0400
commit084708b61014776198c56d1606343d4f504c691e (patch)
tree201a683b3a1eff6f8103eef7fe93690d970b09f3 /drivers/net/wireless/libertas/main.c
parented457037c5e8287a3fd24408250fb396b57b9a1b (diff)
[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: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c52
1 files changed, 22 insertions, 30 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index c9d155ce98a..8c1f0e1e890 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -32,7 +32,7 @@ const char libertas_driver_version[] = "COMM-USB8388-" DRIVER_RELEASE_VERSION
32/* Module parameters */ 32/* Module parameters */
33unsigned int libertas_debug = 0; 33unsigned int libertas_debug = 0;
34module_param(libertas_debug, int, 0644); 34module_param(libertas_debug, int, 0644);
35 35EXPORT_SYMBOL_GPL(libertas_debug);
36 36
37 37
38#define WLAN_TX_PWR_DEFAULT 20 /*100mW */ 38#define WLAN_TX_PWR_DEFAULT 20 /*100mW */
@@ -173,8 +173,6 @@ u8 libertas_adhoc_rates_b[4] = { 0x82, 0x84, 0x8b, 0x96 };
173u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE] = 173u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE] =
174 { 0x10, 0x20, 0x30, 0x31, 0x32, 0x40 }; 174 { 0x10, 0x20, 0x30, 0x31, 0x32, 0x40 };
175 175
176static u8 *default_fw_name = "usb8388.bin";
177
178/** 176/**
179 * Attributes exported through sysfs 177 * Attributes exported through sysfs
180 */ 178 */
@@ -766,7 +764,7 @@ static int wlan_service_main_thread(void *data)
766 * @param card A pointer to card 764 * @param card A pointer to card
767 * @return A pointer to wlan_private structure 765 * @return A pointer to wlan_private structure
768 */ 766 */
769wlan_private *wlan_add_card(void *card) 767wlan_private *libertas_add_card(void *card)
770{ 768{
771 struct net_device *dev = NULL; 769 struct net_device *dev = NULL;
772 wlan_private *priv = NULL; 770 wlan_private *priv = NULL;
@@ -826,8 +824,9 @@ done:
826 lbs_deb_leave_args(LBS_DEB_NET, "priv %p", priv); 824 lbs_deb_leave_args(LBS_DEB_NET, "priv %p", priv);
827 return priv; 825 return priv;
828} 826}
827EXPORT_SYMBOL_GPL(libertas_add_card);
829 828
830int libertas_activate_card(wlan_private *priv) 829int libertas_activate_card(wlan_private *priv, char *fw_name)
831{ 830{
832 struct net_device *dev = priv->wlan_dev.netdev; 831 struct net_device *dev = priv->wlan_dev.netdev;
833 int ret = -1; 832 int ret = -1;
@@ -854,7 +853,7 @@ int libertas_activate_card(wlan_private *priv)
854 } 853 }
855 854
856 /* init FW and HW */ 855 /* init FW and HW */
857 if (libertas_init_fw(priv)) { 856 if (fw_name && libertas_init_fw(priv, fw_name)) {
858 lbs_pr_err("firmware init failed\n"); 857 lbs_pr_err("firmware init failed\n");
859 goto err_registerdev; 858 goto err_registerdev;
860 } 859 }
@@ -884,6 +883,8 @@ done:
884 lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); 883 lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
885 return ret; 884 return ret;
886} 885}
886EXPORT_SYMBOL_GPL(libertas_activate_card);
887
887 888
888/** 889/**
889 * @brief This function adds mshX interface 890 * @brief This function adds mshX interface
@@ -891,7 +892,7 @@ done:
891 * @param priv A pointer to the wlan_private structure 892 * @param priv A pointer to the wlan_private structure
892 * @return 0 if successful, -X otherwise 893 * @return 0 if successful, -X otherwise
893 */ 894 */
894int wlan_add_mesh(wlan_private *priv) 895int libertas_add_mesh(wlan_private *priv)
895{ 896{
896 struct net_device *mesh_dev = NULL; 897 struct net_device *mesh_dev = NULL;
897 int ret = 0; 898 int ret = 0;
@@ -949,6 +950,7 @@ done:
949 lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret); 950 lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret);
950 return ret; 951 return ret;
951} 952}
953EXPORT_SYMBOL_GPL(libertas_add_mesh);
952 954
953static void wake_pending_cmdnodes(wlan_private *priv) 955static void wake_pending_cmdnodes(wlan_private *priv)
954{ 956{
@@ -966,7 +968,7 @@ static void wake_pending_cmdnodes(wlan_private *priv)
966} 968}
967 969
968 970
969int wlan_remove_card(wlan_private *priv) 971int libertas_remove_card(wlan_private *priv)
970{ 972{
971 wlan_adapter *adapter; 973 wlan_adapter *adapter;
972 struct net_device *dev; 974 struct net_device *dev;
@@ -1022,8 +1024,10 @@ out:
1022 lbs_deb_leave(LBS_DEB_NET); 1024 lbs_deb_leave(LBS_DEB_NET);
1023 return 0; 1025 return 0;
1024} 1026}
1027EXPORT_SYMBOL_GPL(libertas_remove_card);
1025 1028
1026void wlan_remove_mesh(wlan_private *priv) 1029
1030void libertas_remove_mesh(wlan_private *priv)
1027{ 1031{
1028 struct net_device *mesh_dev; 1032 struct net_device *mesh_dev;
1029 1033
@@ -1046,6 +1050,7 @@ void wlan_remove_mesh(wlan_private *priv)
1046out: 1050out:
1047 lbs_deb_leave(LBS_DEB_NET); 1051 lbs_deb_leave(LBS_DEB_NET);
1048} 1052}
1053EXPORT_SYMBOL_GPL(libertas_remove_mesh);
1049 1054
1050/** 1055/**
1051 * @brief This function finds the CFP in 1056 * @brief This function finds the CFP in
@@ -1141,41 +1146,28 @@ void libertas_interrupt(struct net_device *dev)
1141 1146
1142 lbs_deb_leave(LBS_DEB_THREAD); 1147 lbs_deb_leave(LBS_DEB_THREAD);
1143} 1148}
1149EXPORT_SYMBOL_GPL(libertas_interrupt);
1144 1150
1145static int wlan_init_module(void) 1151static int libertas_init_module(void)
1146{ 1152{
1147 int ret = 0;
1148
1149 lbs_deb_enter(LBS_DEB_MAIN); 1153 lbs_deb_enter(LBS_DEB_MAIN);
1150
1151 if (libertas_fw_name == NULL) {
1152 libertas_fw_name = default_fw_name;
1153 }
1154
1155 libertas_debugfs_init(); 1154 libertas_debugfs_init();
1156 1155 lbs_deb_leave(LBS_DEB_MAIN);
1157 if (if_usb_register()) { 1156 return 0;
1158 ret = -1;
1159 libertas_debugfs_remove();
1160 }
1161
1162 lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
1163 return ret;
1164} 1157}
1165 1158
1166static void wlan_cleanup_module(void) 1159static void libertas_exit_module(void)
1167{ 1160{
1168 lbs_deb_enter(LBS_DEB_MAIN); 1161 lbs_deb_enter(LBS_DEB_MAIN);
1169 1162
1170 if_usb_unregister();
1171 libertas_debugfs_remove(); 1163 libertas_debugfs_remove();
1172 1164
1173 lbs_deb_leave(LBS_DEB_MAIN); 1165 lbs_deb_leave(LBS_DEB_MAIN);
1174} 1166}
1175 1167
1176module_init(wlan_init_module); 1168module_init(libertas_init_module);
1177module_exit(wlan_cleanup_module); 1169module_exit(libertas_exit_module);
1178 1170
1179MODULE_DESCRIPTION("M-WLAN Driver"); 1171MODULE_DESCRIPTION("Libertas WLAN Driver Library");
1180MODULE_AUTHOR("Marvell International Ltd."); 1172MODULE_AUTHOR("Marvell International Ltd.");
1181MODULE_LICENSE("GPL"); 1173MODULE_LICENSE("GPL");