From patchwork Wed Dec 2 14:26:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Schurig X-Patchwork-Id: 64283 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB2EUM4B007964 for ; Wed, 2 Dec 2009 14:30:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754646AbZLBOaO (ORCPT ); Wed, 2 Dec 2009 09:30:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754643AbZLBOaO (ORCPT ); Wed, 2 Dec 2009 09:30:14 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:65310 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754608AbZLBOaM (ORCPT ); Wed, 2 Dec 2009 09:30:12 -0500 Received: by mail-bw0-f227.google.com with SMTP id 27so217224bwz.21 for ; Wed, 02 Dec 2009 06:30:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:message-id :references:user-agent:date:from:to:subject:content-disposition; bh=630k2+K9y2ogDWaMh3oahsWv6taErDrHYkF+8rQX96Y=; b=MybgEVJ3/np3RvF2ic3za9fKKj+tMJDVNSlCM93A0Ec8PxT5dM8+39uTA0GyNXNOcx 15ELQjFnVRvFBbQGpnO8d6zSstMi+yP+zlWDBlnFAE81a0AqZy8pJoeNAUEKpCPeobE6 Pwvkr0SDmTC8/frOMu4qGqU40lZ/JRpjAM1zE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:references:user-agent:date:from:to:subject :content-disposition; b=FGXUAlSaOhM1mOLGCLtor3bvmx2NY6nKorimxn+kDXfb0mgsvcAVLWU5JbWU1GbWrr kP/s/NMBJHFuiBeqitp6dDzY2zAfC1pwSPau62jRiGrWA+UL0J5Bz0vW7Xt6itfJYnMy HiGziDjsAlJGcBE7byW15do8xJ0Dra914P8iU= Received: by 10.204.153.220 with SMTP id l28mr202932bkw.86.1259764218847; Wed, 02 Dec 2009 06:30:18 -0800 (PST) Received: from holgerschurig@gmail.com (pD95FA93E.dip0.t-ipconnect.de [217.95.169.62]) by mx.google.com with ESMTPS id 15sm332843bwz.8.2009.12.02.06.30.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Dec 2009 06:30:18 -0800 (PST) Received: by holgerschurig@gmail.com (sSMTP sendmail emulation); Wed, 02 Dec 2009 15:29:45 +0100 Message-Id: <20091202142945.383166379@gmail.com> References: <20091202142555.654873300@gmail.com> User-Agent: quilt/0.46-1 Date: Wed, 02 Dec 2009 15:26:02 +0100 From: Holger Schurig To: John Linville , linux-wireless@vger.kernel.org, Dan Williams Subject: [PATCH 07/10] libertas: make mesh configurable Content-Disposition: inline; filename=lbs-mesh-kconfig.patch Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- linux-wl.orig/drivers/net/wireless/libertas/Kconfig +++ linux-wl/drivers/net/wireless/libertas/Kconfig @@ -37,3 +37,9 @@ config LIBERTAS_DEBUG depends on LIBERTAS ---help--- Debugging support. + +config LIBERTAS_MESH + bool "Enable mesh support" + depends on LIBERTAS + help + This enables Libertas' MESH support, used by e.g. the OLPC people. --- linux-wl.orig/drivers/net/wireless/libertas/Makefile +++ linux-wl/drivers/net/wireless/libertas/Makefile @@ -5,11 +5,11 @@ libertas-y += cmdresp.o libertas-y += debugfs.o libertas-y += ethtool.o libertas-y += main.o -libertas-y += mesh.o libertas-y += rx.o libertas-y += scan.o libertas-y += tx.o libertas-y += wext.o +libertas-$(CONFIG_LIBERTAS_MESH) += mesh.o usb8xxx-objs += if_usb.o libertas_cs-objs += if_cs.o --- linux-wl.orig/drivers/net/wireless/libertas/mesh.h +++ linux-wl/drivers/net/wireless/libertas/mesh.h @@ -9,6 +9,8 @@ #include +#ifdef CONFIG_LIBERTAS_MESH + /* Mesh statistics */ struct lbs_mesh_stats { u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */ @@ -90,5 +92,20 @@ void lbs_mesh_ethtool_get_strings(struct #define lbs_mesh_connected(priv) (priv->mesh_connect_status == LBS_CONNECTED) +#else + +#define lbs_init_mesh(priv) +#define lbs_deinit_mesh(priv) +#define lbs_add_mesh(priv) +#define lbs_remove_mesh(priv) +#define lbs_mesh_set_dev(priv, dev, rxpd) (dev) +#define lbs_mesh_set_txpd(priv, dev, txpd) +#define lbs_mesh_config(priv, enable, chan) +#define lbs_mesh_open(priv) (0) +#define lbs_mesh_connected(priv) (0) + +#endif + + #endif --- linux-wl.orig/drivers/net/wireless/libertas/dev.h +++ linux-wl/drivers/net/wireless/libertas/dev.h @@ -39,12 +39,14 @@ struct lbs_private { /* Mesh */ struct net_device *mesh_dev; /* Virtual device */ +#ifdef CONFIG_LIBERTAS_MESH u32 mesh_connect_status; struct lbs_mesh_stats mstats; int mesh_open; uint16_t mesh_tlv; u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1]; u8 mesh_ssid_len; +#endif /* Monitor mode */ struct net_device *rtap_net_dev; --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c +++ linux-wl/drivers/net/wireless/libertas/cmd.c @@ -998,6 +998,8 @@ int lbs_prepare_and_send_command(struct ret = 0; break; +#ifdef CONFIG_LIBERTAS_MESH + case CMD_BT_ACCESS: ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf); break; @@ -1006,6 +1008,8 @@ int lbs_prepare_and_send_command(struct ret = lbs_cmd_fwt_access(cmdptr, cmd_action, pdata_buf); break; +#endif + case CMD_802_11_BEACON_CTRL: ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action); break; --- linux-wl.orig/drivers/net/wireless/libertas/ethtool.c +++ linux-wl/drivers/net/wireless/libertas/ethtool.c @@ -114,9 +114,11 @@ const struct ethtool_ops lbs_ethtool_ops .get_drvinfo = lbs_ethtool_get_drvinfo, .get_eeprom = lbs_ethtool_get_eeprom, .get_eeprom_len = lbs_ethtool_get_eeprom_len, +#ifdef CONFIG_LIBERTAS_MESH .get_sset_count = lbs_mesh_ethtool_get_sset_count, .get_ethtool_stats = lbs_mesh_ethtool_get_stats, .get_strings = lbs_mesh_ethtool_get_strings, +#endif .get_wol = lbs_ethtool_get_wol, .set_wol = lbs_ethtool_set_wol, }; --- linux-wl.orig/drivers/net/wireless/libertas/wext.c +++ linux-wl/drivers/net/wireless/libertas/wext.c @@ -298,6 +298,7 @@ static int lbs_get_nick(struct net_devic return 0; } +#ifdef CONFIG_LIBERTAS_MESH static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) { @@ -321,6 +322,7 @@ static int mesh_get_nick(struct net_devi lbs_deb_leave(LBS_DEB_WEXT); return 0; } +#endif static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) @@ -422,6 +424,7 @@ static int lbs_get_mode(struct net_devic return 0; } +#ifdef CONFIG_LIBERTAS_MESH static int mesh_wlan_get_mode(struct net_device *dev, struct iw_request_info *info, u32 * uwrq, char *extra) @@ -433,6 +436,7 @@ static int mesh_wlan_get_mode(struct net lbs_deb_leave(LBS_DEB_WEXT); return 0; } +#endif static int lbs_get_txpow(struct net_device *dev, struct iw_request_info *info, @@ -1010,6 +1014,7 @@ out: return ret; } +#ifdef CONFIG_LIBERTAS_MESH static int lbs_mesh_set_freq(struct net_device *dev, struct iw_request_info *info, struct iw_freq *fwrq, char *extra) @@ -1061,6 +1066,7 @@ out: lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); return ret; } +#endif static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info, struct iw_param *vwrq, char *extra) @@ -2110,6 +2116,7 @@ out: return ret; } +#ifdef CONFIG_LIBERTAS_MESH static int lbs_mesh_get_essid(struct net_device *dev, struct iw_request_info *info, struct iw_point *dwrq, char *extra) @@ -2163,6 +2170,7 @@ static int lbs_mesh_set_essid(struct net lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); return ret; } +#endif /** * @brief Connect to the AP or Ad-hoc Network with specific bssid @@ -2269,7 +2277,13 @@ static const iw_handler lbs_handler[] = (iw_handler) lbs_get_encodeext,/* SIOCGIWENCODEEXT */ (iw_handler) NULL, /* SIOCSIWPMKSA */ }; +struct iw_handler_def lbs_handler_def = { + .num_standard = ARRAY_SIZE(lbs_handler), + .standard = (iw_handler *) lbs_handler, + .get_wireless_stats = lbs_get_wireless_stats, +}; +#ifdef CONFIG_LIBERTAS_MESH static const iw_handler mesh_wlan_handler[] = { (iw_handler) NULL, /* SIOCSIWCOMMIT */ (iw_handler) lbs_get_name, /* SIOCGIWNAME */ @@ -2327,14 +2341,10 @@ static const iw_handler mesh_wlan_handle (iw_handler) lbs_get_encodeext,/* SIOCGIWENCODEEXT */ (iw_handler) NULL, /* SIOCSIWPMKSA */ }; -struct iw_handler_def lbs_handler_def = { - .num_standard = ARRAY_SIZE(lbs_handler), - .standard = (iw_handler *) lbs_handler, - .get_wireless_stats = lbs_get_wireless_stats, -}; struct iw_handler_def mesh_handler_def = { .num_standard = ARRAY_SIZE(mesh_wlan_handler), .standard = (iw_handler *) mesh_wlan_handler, .get_wireless_stats = lbs_get_wireless_stats, }; +#endif