From patchwork Sat Feb 15 11:55:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin van Wijngaarden X-Patchwork-Id: 3656171 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3DF07BF40C for ; Sat, 15 Feb 2014 11:56:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C82B20122 for ; Sat, 15 Feb 2014 11:56:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD61C20131 for ; Sat, 15 Feb 2014 11:56:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752800AbaBOLzh (ORCPT ); Sat, 15 Feb 2014 06:55:37 -0500 Received: from mail-ea0-f174.google.com ([209.85.215.174]:60072 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752297AbaBOLzf (ORCPT ); Sat, 15 Feb 2014 06:55:35 -0500 Received: by mail-ea0-f174.google.com with SMTP id z10so2961764ead.33 for ; Sat, 15 Feb 2014 03:55:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Ga8dOTnPe+3T4cIQiHrysgLCSFzMpTJuy7M82RKsWm4=; b=ntQuqKgHMl7S4Dx/+ETWl174u9aO0KDL3MGfNo8qL2f/kOqpc7mCo9veOMNHTdvX+5 xkvKTYc1FgwHXzVhGA2Viri8h54wdxueJ/dESv//+DGZHvfczA9Yk/RSeQt/HG3Kic1O EVHcCgeq4cDZ7BAuI0sJfhGML7Etitn8fw9vxoPPzAgr8eEYhCAmrNqGAcYszDaMyPR1 XD5pCx1npLUERTo6hh5bCq/uCKihzsIxjJRRXYuU07wnYPZeEd1fxa4kcG+VOdnD22qp ZjTh5hyad9U/wPplAilB8kjxw6jMz1jyXspLkEO3ME6hNJmu3xSK4zd4jSarKXkBwRPt o+UQ== X-Received: by 10.15.42.136 with SMTP id u8mr15131718eev.52.1392465333381; Sat, 15 Feb 2014 03:55:33 -0800 (PST) Received: from Jultra.qqa.nl (5354B8DB.cm-6-5c.dynamic.ziggo.nl. [83.84.184.219]) by mx.google.com with ESMTPSA id d9sm31412854eei.9.2014.02.15.03.55.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Feb 2014 03:55:32 -0800 (PST) From: Justin van Wijngaarden To: linville@tuxdriver.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Justin van Wijngaarden Subject: [PATCH] Drivers: net: wireless: mac80211_hwim fixed coding style issues Date: Sat, 15 Feb 2014 12:55:12 +0100 Message-Id: <1392465312-3780-1-git-send-email-justinvanwijngaarden@gmail.com> X-Mailer: git-send-email 1.9.rc1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixed a few coding style issues, things like comments and braces. Signed-off-by: Justin van Wijngaarden --- drivers/net/wireless/mac80211_hwsim.c | 101 ++++++++++++++++------------------ 1 file changed, 47 insertions(+), 54 deletions(-) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 69d4c31..4a1ce5b 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -1,19 +1,17 @@ -/* - * mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211 +/* mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211 * Copyright (c) 2008, Jouni Malinen * Copyright (c) 2011, Javier Lopez * * 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. - */ +*/ -/* - * TODO: +/* TODO: * - Add TSF sync and fix IBSS beacon transmission by adding * competition for "air time" at TBTT * - RX filtering based on filter configuration (data->rx_filter) - */ +*/ #include #include @@ -49,11 +47,11 @@ static int channels = 1; module_param(channels, int, 0444); MODULE_PARM_DESC(channels, "Number of concurrent channels"); -static bool paged_rx = false; +static bool paged_rx; module_param(paged_rx, bool, 0644); MODULE_PARM_DESC(paged_rx, "Use paged SKBs for RX instead of linear ones"); -static bool rctbl = false; +static bool rctbl; module_param(rctbl, bool, 0444); MODULE_PARM_DESC(rctbl, "Handle rate control table"); @@ -70,27 +68,27 @@ MODULE_PARM_DESC(rctbl, "Handle rate control table"); * and all possible combinations. * * @HWSIM_REGTEST_DISABLED: No regulatory tests are performed, - * this is the default value. + * this is the default value. * @HWSIM_REGTEST_DRIVER_REG_FOLLOW: Used for testing the driver regulatory * hint, only one driver regulatory hint will be sent as such the - * secondary radios are expected to follow. + * secondary radios are expected to follow. * @HWSIM_REGTEST_DRIVER_REG_ALL: Used for testing the driver regulatory - * request with all radios reporting the same regulatory domain. + * request with all radios reporting the same regulatory domain. * @HWSIM_REGTEST_DIFF_COUNTRY: Used for testing the drivers calling - * different regulatory domains requests. Expected behaviour is for - * an intersection to occur but each device will still use their - * respective regulatory requested domains. Subsequent radios will - * use the resulting intersection. + * different regulatory domains requests. Expected behaviour is for + * an intersection to occur but each device will still use their + * respective regulatory requested domains. Subsequent radios will + * use the resulting intersection. * @HWSIM_REGTEST_WORLD_ROAM: Used for testing the world roaming. We accomplish * this by using a custom beacon-capable regulatory domain for the first * radio. All other device world roam. * @HWSIM_REGTEST_CUSTOM_WORLD: Used for testing the custom world regulatory - * domain requests. All radios will adhere to this custom world regulatory - * domain. + * domain requests. All radios will adhere to this custom world regulatory + * domain. * @HWSIM_REGTEST_CUSTOM_WORLD_2: Used for testing 2 custom world regulatory - * domain requests. The first radio will adhere to the first custom world - * regulatory domain, the second one to the second custom world regulatory - * domain. All other devices will world roam. + * domain requests. The first radio will adhere to the first custom world + * regulatory domain, the second one to the second custom world regulatory + * domain. All other devices will world roam. * @HWSIM_REGTEST_STRICT_FOLLOW_: Used for testing strict regulatory domain * settings, only the first radio will send a regulatory domain request * and use strict settings. The rest of the radios are expected to follow. @@ -104,15 +102,15 @@ MODULE_PARM_DESC(rctbl, "Handle rate control table"); * other devices should follow the intersection created between the * first two. * @HWSIM_REGTEST_ALL: Used for testing every possible mix. You will need - * at least 6 radios for a complete test. We will test in this order: - * 1 - driver custom world regulatory domain - * 2 - second custom world regulatory domain - * 3 - first driver regulatory domain request - * 4 - second driver regulatory domain request - * 5 - strict regulatory domain settings using the third driver regulatory - * domain request - * 6 and on - should follow the intersection of the 3rd, 4rth and 5th radio - * regulatory requests. + * at least 6 radios for a complete test. We will test in this order: + * 1 - driver custom world regulatory domain + * 2 - second custom world regulatory domain + * 3 - first driver regulatory domain request + * 4 - second driver regulatory domain request + * 5 - strict regulatory domain settings using the third driver regulatory + * domain request + * 6 and on - should follow the intersection of the 3rd, 4rth and 5th radio + * regulatory requests. */ enum hwsim_regtest { HWSIM_REGTEST_DISABLED = 0, @@ -406,8 +404,7 @@ struct mac80211_hwsim_data { struct dentry *debugfs; struct sk_buff_head pending; /* packets pending */ - /* - * Only radios in the same group can communicate together (the + /* Only radios in the same group can communicate together (the * channel has to match too). Each bit represents a group. A * radio can be in more then one group. */ @@ -764,11 +761,13 @@ static bool hwsim_ps_rx_ok(struct mac80211_hwsim_data *data, return false; case PS_AUTO_POLL: /* TODO: accept (some) Beacons by default and other frames only - * if pending PS-Poll has been sent */ + * if pending PS-Poll has been sent + */ return true; case PS_MANUAL_POLL: /* Allow unicast frames to own address if there is a pending - * PS-Poll */ + * PS-Poll + */ if (data->ps_poll_pending && memcmp(data->hw->wiphy->perm_addr, skb->data + 4, ETH_ALEN) == 0) { @@ -856,7 +855,8 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw, goto nla_put_failure; /* We get the flags for this transmission, and we translate them to - wmediumd flags */ + * wmediumd flags + */ if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) hwsim_flags |= HWSIM_TX_CTL_REQ_TX_STATUS; @@ -966,8 +966,7 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw, secpath_reset(skb); nf_reset(skb); - /* - * Get absolute mactime here so all HWs RX at the "same time", and + /* Get absolute mactime here so all HWs RX at the "same time", and * absolute TX time for beacon mactime so the timestamp matches. * Giving beacons a different mactime than non-beacons looks messy, but * it helps the Toffset be exact and a ~10us mactime discrepancy @@ -1007,8 +1006,7 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw, continue; } - /* - * reserve some space for our vendor and the normal + /* reserve some space for our vendor and the normal * radiotap header, since we're copying anyway */ if (skb->len < PAGE_SIZE && paged_rx) { @@ -1036,8 +1034,7 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw, rx_status.mactime = now + data2->tsf_offset; #if 0 - /* - * Don't enable this code by default as the OUI 00:00:00 + /* Don't enable this code by default as the OUI 00:00:00 * is registered to Xerox so we shouldn't use it here, it * might find its way into pcap files. * Note that this code requires the headroom in the SKB @@ -1047,8 +1044,7 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw, rx_status.vendor_radiotap_oui[1] = 0x00; rx_status.vendor_radiotap_oui[2] = 0x00; rx_status.vendor_radiotap_subns = 127; - /* - * Radiotap vendor namespaces can (and should) also be + /* Radiotap vendor namespaces can (and should) also be * split into fields by using the standard radiotap * presence bitmap mechanism. Use just BIT(0) here for * the presence bitmap. @@ -1197,8 +1193,7 @@ static int mac80211_hwsim_change_interface(struct ieee80211_hw *hw, newtype, vif->addr); hwsim_check_magic(vif); - /* - * interface may change from non-AP to AP in + /* interface may change from non-AP to AP in * which case this needs to be set up again */ vif->cab_queue = 0; @@ -1371,7 +1366,7 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed) static void mac80211_hwsim_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, - unsigned int *total_flags,u64 multicast) + unsigned int *total_flags, u64 multicast) { struct mac80211_hwsim_data *data = hw->priv; @@ -1465,9 +1460,8 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw, info->use_short_preamble); } - if (changed & BSS_CHANGED_ERP_SLOT) { + if (changed & BSS_CHANGED_ERP_SLOT) wiphy_debug(hw->wiphy, " ERP_SLOT: %d\n", info->use_short_slot); - } if (changed & BSS_CHANGED_HT) { wiphy_debug(hw->wiphy, " HT: op_mode=0x%x\n", @@ -1556,8 +1550,7 @@ static int mac80211_hwsim_get_survey( /* Current channel */ survey->channel = conf->chandef.chan; - /* - * Magically conjured noise level --- this is only ok for simulated hardware. + /* Magically conjured noise level --- this is only ok for simulated hardware. * * A real driver which cannot determine the real channel noise MUST NOT * report any noise, especially not a magically conjured one :-) @@ -1569,8 +1562,7 @@ static int mac80211_hwsim_get_survey( } #ifdef CONFIG_NL80211_TESTMODE -/* - * This section contains example code for using netlink +/* This section contains example code for using netlink * attributes with the testmode command in nl80211. */ @@ -2191,9 +2183,9 @@ static void mac80211_hwsim_free(void) } static const struct net_device_ops hwsim_netdev_ops = { - .ndo_start_xmit = hwsim_mon_xmit, + .ndo_start_xmit = hwsim_mon_xmit, .ndo_change_mtu = eth_change_mtu, - .ndo_set_mac_address = eth_mac_addr, + .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, }; @@ -2274,7 +2266,8 @@ static int hwsim_tx_info_frame_received_nl(struct sk_buff *skb_2, goto out; /* Tx info received because the frame was broadcasted on user space, - so we get all the necessary info: tx attempts and skb control buff */ + * so we get all the necessary info: tx attempts and skb control buff + */ tx_attempts = (struct hwsim_tx_rate *)nla_data( info->attrs[HWSIM_ATTR_TX_INFO]);